(function(undefined) { // @note // A few conventions for the documentation of this file: // 1. Always use "//" (in contrast with "/**/") // 2. The syntax used is Yardoc (yardoc.org), which is intended for Ruby (se below) // 3. `@param` and `@return` types should be preceded by `JS.` when referring to // JavaScript constructors (e.g. `JS.Function`) otherwise Ruby is assumed. // 4. `nil` and `null` being unambiguous refer to the respective // objects/values in Ruby and JavaScript // 5. This is still WIP :) so please give feedback and suggestions on how // to improve or for alternative solutions // // The way the code is digested before going through Yardoc is a secret kept // in the docs repo (https://github.com/opal/docs/tree/master). if (typeof(this.Opal) !== 'undefined') { console.warn('Opal already loaded. Loading twice can cause troubles, please fix your setup.'); return this.Opal; } var nil; // The actual class for BasicObject var BasicObject; // The actual Object class. // The leading underscore is to avoid confusion with window.Object() var _Object; // The actual Module class var Module; // The actual Class class var Class; // Constructor for instances of BasicObject function BasicObject_alloc(){} // Constructor for instances of Object function Object_alloc(){} // Constructor for instances of Class function Class_alloc(){} // Constructor for instances of Module function Module_alloc(){} // Constructor for instances of NilClass (nil) function NilClass_alloc(){} // The Opal object that is exposed globally var Opal = this.Opal = {}; // All bridged classes - keep track to donate methods from Object var bridges = {}; // TopScope is used for inheriting constants from the top scope var TopScope = function(){}; // Opal just acts as the top scope TopScope.prototype = Opal; // To inherit scopes Opal.constructor = TopScope; // List top scope constants Opal.constants = []; // This is a useful reference to global object inside ruby files Opal.global = this; // Configure runtime behavior with regards to require and unsupported fearures Opal.config = { missing_require_severity: 'error', // error, warning, ignore unsupported_features_severity: 'warning' // error, warning, ignore } // Minify common function calls var $hasOwn = Opal.hasOwnProperty; var $slice = Opal.slice = Array.prototype.slice; // Nil object id is always 4 var nil_id = 4; // Generates even sequential numbers greater than 4 // (nil_id) to serve as unique ids for ruby objects var unique_id = nil_id; // Return next unique id Opal.uid = function() { unique_id += 2; return unique_id; }; // Table holds all class variables Opal.cvars = {}; // Globals table Opal.gvars = {}; // Exit function, this should be replaced by platform specific implementation // (See nodejs and phantom for examples) Opal.exit = function(status) { if (Opal.gvars.DEBUG) console.log('Exited with status '+status); }; // keeps track of exceptions for $! Opal.exceptions = []; // @private // Pops an exception from the stack and updates `$!`. Opal.pop_exception = function() { Opal.gvars["!"] = Opal.exceptions.pop() || nil; } // Constants // --------- // Get a constant on the given scope. Every class and module in Opal has a // scope used to store, and inherit, constants. For example, the top level // `Object` in ruby has a scope accessible as `Opal.Object.$$scope`. // // To get the `Array` class using this scope, you could use: // // Opal.Object.$$scope.get("Array") // // If a constant with the given name cannot be found, then a dispatch to the // class/module's `#const_method` is called, which by default will raise an // error. // // @param name [String] the name of the constant to lookup // @return [Object] // Opal.get = function(name) { var constant = this[name]; if (constant == null) { return this.base.$const_get(name); } return constant; }; // Create a new constants scope for the given class with the given // base. Constants are looked up through their parents, so the base // scope will be the outer scope of the new klass. // // @param base_scope [$$scope] the scope in which the new scope should be created // @param klass [Class] // @param id [String, null] the name of the newly created scope // Opal.create_scope = function(base_scope, klass, id) { var const_alloc = function() {}; var const_scope = const_alloc.prototype = new base_scope.constructor(); klass.$$scope = const_scope; klass.$$base_module = base_scope.base; const_scope.base = klass; const_scope.constructor = const_alloc; const_scope.constants = []; if (id) { Opal.cdecl(base_scope, id, klass); const_alloc.displayName = id+"_scope_alloc"; } }; // Constant assignment, see also `Opal.cdecl` // // @param base_module [Module, Class] the constant namespace // @param name [String] the name of the constant // @param value [Object] the value of the constant // // @example Assigning a namespaced constant // self::FOO = 'bar' // // @example Assigning with Module#const_set // Foo.const_set :BAR, 123 // Opal.casgn = function(base_module, name, value) { function update(klass, name) { klass.$$name = name; for (name in klass.$$scope) { var value = klass.$$scope[name]; if (value.$$name === nil && (value.$$is_class || value.$$is_module)) { update(value, name) } } } var scope = base_module.$$scope; if (value.$$is_class || value.$$is_module) { // Only checking _Object prevents setting a const on an anonymous class // that has a superclass that's not Object if (value.$$is_class || value.$$base_module === _Object) { value.$$base_module = base_module; } if (value.$$name === nil && value.$$base_module.$$name !== nil) { update(value, name); } } scope.constants.push(name); scope[name] = value; // If we dynamically declare a constant in a module, // we should populate all the classes that include this module // with the same constant if (base_module.$$is_module && base_module.$$dep) { for (var i = 0; i < base_module.$$dep.length; i++) { var dep = base_module.$$dep[i]; Opal.casgn(dep, name, value); } } return value; }; // Constant declaration // // @example // FOO = :bar // // @param base_scope [$$scope] the current scope // @param name [String] the name of the constant // @param value [Object] the value of the constant Opal.cdecl = function(base_scope, name, value) { if ((value.$$is_class || value.$$is_module) && value.$$orig_scope == null) { value.$$name = name; value.$$orig_scope = base_scope; // Here we should explicitly set a base module // (a module where the constant was initially defined) value.$$base_module = base_scope.base; base_scope.constructor[name] = value; } base_scope.constants.push(name); return base_scope[name] = value; }; // Modules & Classes // ----------------- // A `class Foo; end` expression in ruby is compiled to call this runtime // method which either returns an existing class of the given name, or creates // a new class in the given `base` scope. // // If a constant with the given name exists, then we check to make sure that // it is a class and also that the superclasses match. If either of these // fail, then we raise a `TypeError`. Note, `superclass` may be null if one // was not specified in the ruby code. // // We pass a constructor to this method of the form `function ClassName() {}` // simply so that classes show up with nicely formatted names inside debuggers // in the web browser (or node/sprockets). // // The `base` is the current `self` value where the class is being created // from. We use this to get the scope for where the class should be created. // If `base` is an object (not a class/module), we simple get its class and // use that as the base instead. // // @param base [Object] where the class is being created // @param superclass [Class,null] superclass of the new class (may be null) // @param id [String] the name of the class to be created // @param constructor [JS.Function] function to use as constructor // // @return new [Class] or existing ruby class // Opal.klass = function(base, superclass, name, constructor) { var klass, bridged, alloc; // If base is an object, use its class if (!base.$$is_class && !base.$$is_module) { base = base.$$class; } // If the superclass is a function then we're bridging a native JS class if (typeof(superclass) === 'function') { bridged = superclass; superclass = _Object; } // Try to find the class in the current scope klass = base.$$scope[name]; // If the class exists in the scope, then we must use that if (klass && klass.$$orig_scope === base.$$scope) { // Make sure the existing constant is a class, or raise error if (!klass.$$is_class) { throw Opal.TypeError.$new(name + " is not a class"); } // Make sure existing class has same superclass if (superclass && klass.$$super !== superclass) { throw Opal.TypeError.$new("superclass mismatch for class " + name); } return klass; } // Class doesnt exist, create a new one with given superclass... // Not specifying a superclass means we can assume it to be Object if (superclass == null) { superclass = _Object; } // If bridged the JS class will also be the alloc function alloc = bridged || Opal.boot_class_alloc(name, constructor, superclass); // Create the class object (instance of Class) klass = Opal.setup_class_object(name, alloc, superclass.$$name, superclass.constructor); // @property $$super the superclass, doesn't get changed by module inclusions klass.$$super = superclass; // @property $$parent direct parent class // starts with the superclass, after klass inclusion is // the last included klass klass.$$parent = superclass; // Every class gets its own constant scope, inherited from current scope Opal.create_scope(base.$$scope, klass, name); // Name new class directly onto current scope (Opal.Foo.Baz = klass) base[name] = klass; if (bridged) { Opal.bridge(klass, alloc); } else { // Copy all parent constants to child, unless parent is Object if (superclass !== _Object && superclass !== BasicObject) { Opal.donate_constants(superclass, klass); } // Call .inherited() hook with new class on the superclass if (superclass.$inherited) { superclass.$inherited(klass); } } return klass; }; // Boot a base class (makes instances). // // @param name [String,null] the class name // @param constructor [JS.Function] the class' instances constructor/alloc function // @param superclass [Class,null] the superclass object // @return [JS.Function] the consturctor holding the prototype for the class' instances Opal.boot_class_alloc = function(name, constructor, superclass) { if (superclass) { var alloc_proxy = function() {}; alloc_proxy.prototype = superclass.$$proto || superclass.prototype; constructor.prototype = new alloc_proxy(); } if (name) { constructor.displayName = name+'_alloc'; } constructor.prototype.constructor = constructor; return constructor; }; // Adds common/required properties to class object (as in `Class.new`) // // @param name [String,null] The name of the class // // @param alloc [JS.Function] The constructor of the class' instances // // @param superclass_name [String,null] // The name of the super class, this is // usefule to build the `.displayName` of the singleton class // // @param superclass_alloc [JS.Function] // The constructor of the superclass from which the singleton_class is // derived. // // @return [Class] Opal.setup_class_object = function(name, alloc, superclass_name, superclass_alloc) { // Grab the superclass prototype and use it to build an intermediary object // in the prototype chain. var superclass_alloc_proxy = function() {}; superclass_alloc_proxy.prototype = superclass_alloc.prototype; superclass_alloc_proxy.displayName = superclass_name; var singleton_class_alloc = function() {} singleton_class_alloc.prototype = new superclass_alloc_proxy(); // The built class is the only instance of its singleton_class var klass = new singleton_class_alloc(); // @property $$alloc This is the constructor of instances of the current // class. Its prototype will be used for method lookup klass.$$alloc = alloc; klass.$$name = name || nil; // @property $$id Each class is assigned a unique `id` that helps // comparation and implementation of `#object_id` klass.$$id = Opal.uid(); // Set a displayName for the singleton_class singleton_class_alloc.displayName = "#"))+">"; // @property $$proto This is the prototype on which methods will be defined klass.$$proto = alloc.prototype; // @property $$proto.$$class Make available to instances a reference to the // class they belong to. klass.$$proto.$$class = klass; // @property constructor keeps a ref to the constructor, but apparently the // constructor is already set on: // // `var klass = new constructor` is called. // // Maybe there are some browsers not abiding (IE6?) klass.constructor = singleton_class_alloc; // @property $$is_class Clearly mark this as a class klass.$$is_class = true; // @property $$class Classes are instances of the class Class klass.$$class = Class; // @property $$inc included modules klass.$$inc = []; return klass; }; // Define new module (or return existing module). The given `base` is basically // the current `self` value the `module` statement was defined in. If this is // a ruby module or class, then it is used, otherwise if the base is a ruby // object then that objects real ruby class is used (e.g. if the base is the // main object, then the top level `Object` class is used as the base). // // If a module of the given name is already defined in the base, then that // instance is just returned. // // If there is a class of the given name in the base, then an error is // generated instead (cannot have a class and module of same name in same base). // // Otherwise, a new module is created in the base with the given name, and that // new instance is returned back (to be referenced at runtime). // // @param base [Module, Class] class or module this definition is inside // @param id [String] the name of the new (or existing) module // // @return [Module] Opal.module = function(base, name) { var module; if (!base.$$is_class && !base.$$is_module) { base = base.$$class; } if ($hasOwn.call(base.$$scope, name)) { module = base.$$scope[name]; if (!module.$$is_module && module !== _Object) { throw Opal.TypeError.$new(name + " is not a module"); } } else { module = Opal.module_allocate(Module); Opal.create_scope(base.$$scope, module, name); } return module; }; // The implementation for Module#initialize // @param module [Module] // @param block [Proc,nil] // @return nil Opal.module_initialize = function(module, block) { if (block !== nil) { var block_self = block.$$s; block.$$s = null; block.call(module); block.$$s = block_self; } return nil; }; // Internal function to create a new module instance. This simply sets up // the prototype hierarchy and method tables. // Opal.module_allocate = function(superclass) { var mtor = function() {}; mtor.prototype = superclass.$$alloc.prototype; function module_constructor() {} module_constructor.prototype = new mtor(); var module = new module_constructor(); var module_prototype = {}; // @property $$id Each class is assigned a unique `id` that helps // comparation and implementation of `#object_id` module.$$id = Opal.uid(); // Set the display name of the singleton prototype holder module_constructor.displayName = "#>" // @property $$proto This is the prototype on which methods will be defined module.$$proto = module_prototype; // @property constructor // keeps a ref to the constructor, but apparently the // constructor is already set on: // // `var module = new constructor` is called. // // Maybe there are some browsers not abiding (IE6?) module.constructor = module_constructor; // @property $$is_module Clearly mark this as a module module.$$is_module = true; module.$$class = Module; // @property $$super // the superclass, doesn't get changed by module inclusions module.$$super = superclass; // @property $$parent // direct parent class or module // starts with the superclass, after module inclusion is // the last included module module.$$parent = superclass; // @property $$inc included modules module.$$inc = []; // mark the object as a module module.$$is_module = true; // initialize dependency tracking module.$$dep = []; // initialize the name with nil module.$$name = nil; return module; }; // Return the singleton class for the passed object. // // If the given object alredy has a singleton class, then it will be stored on // the object as the `$$meta` property. If this exists, then it is simply // returned back. // // Otherwise, a new singleton object for the class or object is created, set on // the object at `$$meta` for future use, and then returned. // // @param object [Object] the ruby object // @return [Class] the singleton class for object Opal.get_singleton_class = function(object) { if (object.$$meta) { return object.$$meta; } if (object.$$is_class || object.$$is_module) { return Opal.build_class_singleton_class(object); } return Opal.build_object_singleton_class(object); }; // Build the singleton class for an existing class. Class object are built // with their singleton class already in the prototype chain and inheriting // from their superclass object (up to `Class` itself). // // NOTE: Actually in MRI a class' singleton class inherits from its // superclass' singleton class which in turn inherits from Class. // // @param klass [Class] // @return [Class] Opal.build_class_singleton_class = function(object) { var alloc, superclass, klass; if (object.$$meta) { return object.$$meta; } // The constructor and prototype of the singleton_class instances is the // current class constructor and prototype. alloc = object.constructor; // The singleton_class superclass is the singleton_class of its superclass; // but BasicObject has no superclass (its `$$super` is null), thus we // fallback on `Class`. superclass = object === BasicObject ? Class : Opal.build_class_singleton_class(object.$$super); klass = Opal.setup_class_object(null, alloc, superclass.$$name, superclass.constructor); klass.$$super = superclass; klass.$$parent = superclass; // The singleton_class retains the same scope as the original class Opal.create_scope(object.$$scope, klass); klass.$$is_singleton = true; klass.$$singleton_of = object; return object.$$meta = klass; }; // Build the singleton class for a Ruby (non class) Object. // // @param object [Object] // @return [Class] Opal.build_object_singleton_class = function(object) { var superclass = object.$$class, name = "#>"; var alloc = Opal.boot_class_alloc(name, function(){}, superclass) var klass = Opal.setup_class_object(name, alloc, superclass.$$name, superclass.constructor); klass.$$super = superclass; klass.$$parent = superclass; klass.$$class = superclass.$$class; klass.$$scope = superclass.$$scope; klass.$$proto = object; klass.$$is_singleton = true; klass.$$singleton_of = object; return object.$$meta = klass; }; // Bridges a single method. Opal.bridge_method = function(target, from, name, body) { var ancestors, i, ancestor, length; ancestors = target.$$bridge.$ancestors(); // order important here, we have to check for method presence in // ancestors from the bridged class to the last ancestor for (i = 0, length = ancestors.length; i < length; i++) { ancestor = ancestors[i]; if ($hasOwn.call(ancestor.$$proto, name) && ancestor.$$proto[name] && !ancestor.$$proto[name].$$donated && !ancestor.$$proto[name].$$stub && ancestor !== from) { break; } if (ancestor === from) { target.prototype[name] = body break; } } }; // Bridges from *donator* to a *target*. Opal._bridge = function(target, donator) { var id, methods, method, i, bridged; if (typeof(target) === "function") { id = donator.$__id__(); methods = donator.$instance_methods(); for (i = methods.length - 1; i >= 0; i--) { method = '$' + methods[i]; Opal.bridge_method(target, donator, method, donator.$$proto[method]); } if (!bridges[id]) { bridges[id] = []; } bridges[id].push(target); } else { bridged = bridges[target.$__id__()]; if (bridged) { for (i = bridged.length - 1; i >= 0; i--) { Opal._bridge(bridged[i], donator); } bridges[donator.$__id__()] = bridged.slice(); } } }; // The actual inclusion of a module into a class. // // ## Class `$$parent` and `iclass` // // To handle `super` calls, every class has a `$$parent`. This parent is // used to resolve the next class for a super call. A normal class would // have this point to its superclass. However, if a class includes a module // then this would need to take into account the module. The module would // also have to then point its `$$parent` to the actual superclass. We // cannot modify modules like this, because it might be included in more // then one class. To fix this, we actually insert an `iclass` as the class' // `$$parent` which can then point to the superclass. The `iclass` acts as // a proxy to the actual module, so the `super` chain can then search it for // the required method. // // @param module [Module] the module to include // @param klass [Class] the target class to include module into // @return [null] Opal.append_features = function(module, klass) { var iclass, donator, prototype, methods, id, i; // check if this module is already included in the class for (i = klass.$$inc.length - 1; i >= 0; i--) { if (klass.$$inc[i] === module) { return; } } klass.$$inc.push(module); module.$$dep.push(klass); Opal._bridge(klass, module); // iclass iclass = { $$name: module.$$name, $$proto: module.$$proto, $$parent: klass.$$parent, $$module: module, $$iclass: true }; klass.$$parent = iclass; donator = module.$$proto; prototype = klass.$$proto; methods = module.$instance_methods(); for (i = methods.length - 1; i >= 0; i--) { id = '$' + methods[i]; // if the target class already has a method of the same name defined // and that method was NOT donated, then it must be a method defined // by the class so we do not want to override it if ( prototype.hasOwnProperty(id) && !prototype[id].$$donated && !prototype[id].$$stub) { continue; } prototype[id] = donator[id]; prototype[id].$$donated = module; } Opal.donate_constants(module, klass); }; // Table that holds all methods that have been defined on all objects // It is used for defining method stubs for new coming native classes Opal.stubs = {}; // For performance, some core Ruby classes are toll-free bridged to their // native JavaScript counterparts (e.g. a Ruby Array is a JavaScript Array). // // This method is used to setup a native constructor (e.g. Array), to have // its prototype act like a normal Ruby class. Firstly, a new Ruby class is // created using the native constructor so that its prototype is set as the // target for th new class. Note: all bridged classes are set to inherit // from Object. // // Example: // // Opal.bridge(self, Function); // // @param klass [Class] the Ruby class to bridge // @param constructor [JS.Function] native JavaScript constructor to use // @return [Class] returns the passed Ruby class // Opal.bridge = function(klass, constructor) { if (constructor.$$bridge) { throw Opal.ArgumentError.$new("already bridged"); } Opal.stub_subscribers.push(constructor.prototype); // Populate constructor with previously stored stubs for (var method_name in Opal.stubs) { if (!(method_name in constructor.prototype)) { constructor.prototype[method_name] = Opal.stub_for(method_name); } } constructor.prototype.$$class = klass; constructor.$$bridge = klass; var ancestors = klass.$ancestors(); // order important here, we have to bridge from the last ancestor to the // bridged class for (var i = ancestors.length - 1; i >= 0; i--) { Opal._bridge(constructor, ancestors[i]); } for (var name in BasicObject_alloc.prototype) { var method = BasicObject_alloc.prototype[method]; if (method && method.$$stub && !(name in constructor.prototype)) { constructor.prototype[name] = method; } } return klass; }; // When a source module is included into the target module, we must also copy // its constants to the target. // Opal.donate_constants = function(source_mod, target_mod) { var source_constants = source_mod.$$scope.constants, target_scope = target_mod.$$scope, target_constants = target_scope.constants; for (var i = 0, length = source_constants.length; i < length; i++) { target_constants.push(source_constants[i]); target_scope[source_constants[i]] = source_mod.$$scope[source_constants[i]]; } }; // Donate methods for a module. Opal.donate = function(module, jsid) { var included_in = module.$$dep, body = module.$$proto[jsid], i, length, includee, dest, current, klass_includees, j, jj, current_owner_index, module_index; if (!included_in) { return; } for (i = 0, length = included_in.length; i < length; i++) { includee = included_in[i]; dest = includee.$$proto; current = dest[jsid]; if (dest.hasOwnProperty(jsid) && !current.$$donated && !current.$$stub) { // target class has already defined the same method name - do nothing } else if (dest.hasOwnProperty(jsid) && !current.$$stub) { // target class includes another module that has defined this method klass_includees = includee.$$inc; for (j = 0, jj = klass_includees.length; j < jj; j++) { if (klass_includees[j] === current.$$donated) { current_owner_index = j; } if (klass_includees[j] === module) { module_index = j; } } // only redefine method on class if the module was included AFTER // the module which defined the current method body. Also make sure // a module can overwrite a method it defined before if (current_owner_index <= module_index) { dest[jsid] = body; dest[jsid].$$donated = module; } } else { // neither a class, or module included by class, has defined method dest[jsid] = body; dest[jsid].$$donated = module; } if (includee.$$dep) { Opal.donate(includee, jsid); } } }; // The Array of ancestors for a given module/class Opal.ancestors = function(module_or_class) { var parent = module_or_class, result = [], modules; while (parent) { result.push(parent); for (var i=0; i < parent.$$inc.length; i++) { modules = Opal.ancestors(parent.$$inc[i]); for(var j = 0; j < modules.length; j++) { result.push(modules[j]); } } // only the actual singleton class gets included in its ancestry // after that, traverse the normal class hierarchy if (parent.$$is_singleton && parent.$$singleton_of.$$is_module) { parent = parent.$$singleton_of.$$super; } else { parent = parent.$$is_class ? parent.$$super : null; } } return result; }; // Method Missing // -------------- // Methods stubs are used to facilitate method_missing in opal. A stub is a // placeholder function which just calls `method_missing` on the receiver. // If no method with the given name is actually defined on an object, then it // is obvious to say that the stub will be called instead, and then in turn // method_missing will be called. // // When a file in ruby gets compiled to javascript, it includes a call to // this function which adds stubs for every method name in the compiled file. // It should then be safe to assume that method_missing will work for any // method call detected. // // Method stubs are added to the BasicObject prototype, which every other // ruby object inherits, so all objects should handle method missing. A stub // is only added if the given property name (method name) is not already // defined. // // Note: all ruby methods have a `$` prefix in javascript, so all stubs will // have this prefix as well (to make this method more performant). // // Opal.add_stubs(["$foo", "$bar", "$baz="]); // // All stub functions will have a private `$$stub` property set to true so // that other internal methods can detect if a method is just a stub or not. // `Kernel#respond_to?` uses this property to detect a methods presence. // // @param stubs [Array] an array of method stubs to add // @return [undefined] Opal.add_stubs = function(stubs) { var subscriber, subscribers = Opal.stub_subscribers, i, ilength = stubs.length, j, jlength = subscribers.length, method_name, stub; for (i = 0; i < ilength; i++) { method_name = stubs[i]; // Save method name to populate other subscribers with this stub Opal.stubs[method_name] = true; stub = Opal.stub_for(method_name); for (j = 0; j < jlength; j++) { subscriber = subscribers[j]; if (!(method_name in subscriber)) { subscriber[method_name] = stub; } } } }; // Keep a list of prototypes that want method_missing stubs to be added. // // @default [Prototype List] BasicObject_alloc.prototype // Opal.stub_subscribers = [BasicObject_alloc.prototype]; // Add a method_missing stub function to the given prototype for the // given name. // // @param prototype [Prototype] the target prototype // @param stub [String] stub name to add (e.g. "$foo") // @return [undefined] Opal.add_stub_for = function(prototype, stub) { var method_missing_stub = Opal.stub_for(stub); prototype[stub] = method_missing_stub; }; // Generate the method_missing stub for a given method name. // // @param method_name [String] The js-name of the method to stub (e.g. "$foo") // @return [undefined] Opal.stub_for = function(method_name) { function method_missing_stub() { // Copy any given block onto the method_missing dispatcher this.$method_missing.$$p = method_missing_stub.$$p; // Set block property to null ready for the next call (stop false-positives) method_missing_stub.$$p = null; // call method missing with correct args (remove '$' prefix on method name) var args_ary = new Array(arguments.length); for(var i = 0, l = args_ary.length; i < l; i++) { args_ary[i] = arguments[i]; } return this.$method_missing.apply(this, [method_name.slice(1)].concat(args_ary)); } method_missing_stub.$$stub = true; return method_missing_stub; }; // Methods // ------- // Arity count error dispatcher for methods // // @param actual [Fixnum] number of arguments given to method // @param expected [Fixnum] expected number of arguments // @param object [Object] owner of the method +meth+ // @param meth [String] method name that got wrong number of arguments // @raise [ArgumentError] Opal.ac = function(actual, expected, object, meth) { var inspect = ''; if (object.$$is_class || object.$$is_module) { inspect += object.$$name + '.'; } else { inspect += object.$$class.$$name + '#'; } inspect += meth; throw Opal.ArgumentError.$new('[' + inspect + '] wrong number of arguments(' + actual + ' for ' + expected + ')'); }; // Arity count error dispatcher for blocks // // @param actual [Fixnum] number of arguments given to block // @param expected [Fixnum] expected number of arguments // @param context [Object] context of the block definition // @raise [ArgumentError] Opal.block_ac = function(actual, expected, context) { var inspect = "`block in " + context + "'"; throw Opal.ArgumentError.$new(inspect + ': wrong number of arguments (' + actual + ' for ' + expected + ')'); } // Super dispatcher Opal.find_super_dispatcher = function(obj, jsid, current_func, defcheck, defs) { var dispatcher; if (defs) { if (obj.$$is_class || obj.$$is_module) { dispatcher = defs.$$super; } else { dispatcher = obj.$$class.$$proto; } } else { dispatcher = Opal.find_obj_super_dispatcher(obj, jsid, current_func); } dispatcher = dispatcher['$' + jsid]; if (!defcheck && dispatcher.$$stub && Opal.Kernel.$method_missing === obj.$method_missing) { // method_missing hasn't been explicitly defined throw Opal.NoMethodError.$new('super: no superclass method `'+jsid+"' for "+obj, jsid); } return dispatcher; }; // Iter dispatcher for super in a block Opal.find_iter_super_dispatcher = function(obj, jsid, current_func, defcheck, implicit) { var call_jsid = jsid; if (!current_func) { throw Opal.RuntimeError.$new("super called outside of method"); } if (implicit && current_func.$$define_meth) { throw Opal.RuntimeError.$new("implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly"); } if (current_func.$$def) { call_jsid = current_func.$$jsid; } return Opal.find_super_dispatcher(obj, call_jsid, current_func, defcheck); }; Opal.find_obj_super_dispatcher = function(obj, jsid, current_func) { var klass = obj.$$meta || obj.$$class; // first we need to find the class/module current_func is located on klass = Opal.find_owning_class(klass, current_func); if (!klass) { throw new Error("could not find current class for super()"); } jsid = '$' + jsid; return Opal.find_super_func(klass, jsid, current_func); }; Opal.find_owning_class = function(klass, current_func) { var owner = current_func.$$owner; while (klass) { // repeating for readability if (klass.$$iclass && klass.$$module === current_func.$$donated) { // this klass was the last one the module donated to // case is also hit with multiple module includes break; } else if (klass.$$iclass && klass.$$module === owner) { // module has donated to other classes but klass isn't one of those break; } else if (owner.$$is_singleton && klass === owner.$$singleton_of.$$class) { // cases like stdlib `Singleton::included` that use a singleton of a singleton break; } else if (klass === owner) { // no modules, pure class inheritance break; } klass = klass.$$parent; } return klass; }; Opal.find_super_func = function(owning_klass, jsid, current_func) { var klass = owning_klass.$$parent; // now we can find the super while (klass) { var working = klass.$$proto[jsid]; if (working && working !== current_func) { // ok break; } klass = klass.$$parent; } return klass.$$proto; }; // Used to return as an expression. Sometimes, we can't simply return from // a javascript function as if we were a method, as the return is used as // an expression, or even inside a block which must "return" to the outer // method. This helper simply throws an error which is then caught by the // method. This approach is expensive, so it is only used when absolutely // needed. // Opal.ret = function(val) { Opal.returner.$v = val; throw Opal.returner; }; // Used to break out of a block. Opal.brk = function(val, breaker) { breaker.$v = val; throw breaker; }; // Builds a new unique breaker, this is to avoid multiple nested breaks to get // in the way of each other. Opal.new_brk = function() { return new Error('unexpected break'); }; // handles yield calls for 1 yielded arg Opal.yield1 = function(block, arg) { if (typeof(block) !== "function") { throw Opal.LocalJumpError.$new("no block given"); } var has_mlhs = block.$$has_top_level_mlhs_arg, has_trailing_comma = block.$$has_trailing_comma_in_args; if (block.length > 1 || ((has_mlhs || has_trailing_comma) && block.length === 1)) { arg = Opal.to_ary(arg); } if ((block.length > 1 || (has_trailing_comma && block.length === 1)) && arg.$$is_array) { return block.apply(null, arg); } else { return block(arg); } }; // handles yield for > 1 yielded arg Opal.yieldX = function(block, args) { if (typeof(block) !== "function") { throw Opal.LocalJumpError.$new("no block given"); } if (block.length > 1 && args.length === 1) { if (args[0].$$is_array) { return block.apply(null, args[0]); } } if (!args.$$is_array) { var args_ary = new Array(args.length); for(var i = 0, l = args_ary.length; i < l; i++) { args_ary[i] = args[i]; } return block.apply(null, args_ary); } return block.apply(null, args); }; // Finds the corresponding exception match in candidates. Each candidate can // be a value, or an array of values. Returns null if not found. Opal.rescue = function(exception, candidates) { for (var i = 0; i < candidates.length; i++) { var candidate = candidates[i]; if (candidate.$$is_array) { var result = Opal.rescue(exception, candidate); if (result) { return result; } } else if (candidate['$==='](exception)) { return candidate; } } return null; }; Opal.is_a = function(object, klass) { if (object.$$meta === klass) { return true; } var i, length, ancestors = Opal.ancestors(object.$$class); for (i = 0, length = ancestors.length; i < length; i++) { if (ancestors[i] === klass) { return true; } } ancestors = Opal.ancestors(object.$$meta); for (i = 0, length = ancestors.length; i < length; i++) { if (ancestors[i] === klass) { return true; } } return false; }; // Helpers for extracting kwsplats // Used for: { **h } Opal.to_hash = function(value) { if (value.$$is_hash) { return value; } else if (value['$respond_to?']('to_hash', true)) { var hash = value.$to_hash(); if (hash.$$is_hash) { return hash; } else { throw Opal.TypeError.$new("Can't convert " + value.$$class + " to Hash (" + value.$$class + "#to_hash gives " + hash.$$class + ")"); } } else { throw Opal.TypeError.$new("no implicit conversion of " + value.$$class + " into Hash"); } }; // Helpers for implementing multiple assignment // Our code for extracting the values and assigning them only works if the // return value is a JS array. // So if we get an Array subclass, extract the wrapped JS array from it // Used for: a, b = something (no splat) Opal.to_ary = function(value) { if (value.$$is_array) { return value; } else if (value['$respond_to?']('to_ary', true)) { var ary = value.$to_ary(); if (ary === nil) { return [value]; } else if (ary.$$is_array) { return ary; } else { throw Opal.TypeError.$new("Can't convert " + value.$$class + " to Array (" + value.$$class + "#to_ary gives " + ary.$$class + ")"); } } else { return [value]; } }; // Used for: a, b = *something (with splat) Opal.to_a = function(value) { if (value.$$is_array) { // A splatted array must be copied return value.slice(); } else if (value['$respond_to?']('to_a', true)) { var ary = value.$to_a(); if (ary === nil) { return [value]; } else if (ary.$$is_array) { return ary; } else { throw Opal.TypeError.$new("Can't convert " + value.$$class + " to Array (" + value.$$class + "#to_a gives " + ary.$$class + ")"); } } else { return [value]; } }; // Used for extracting keyword arguments from arguments passed to // JS function. If provided +arguments+ list doesn't have a Hash // as a last item, returns a blank Hash. // // @param parameters [Array] // @return [Hash] // Opal.extract_kwargs = function(parameters) { var kwargs = parameters[parameters.length - 1]; if (kwargs != null && kwargs['$respond_to?']('to_hash', true)) { Array.prototype.splice.call(parameters, parameters.length - 1, 1); return kwargs.$to_hash(); } else { return Opal.hash2([], {}); } } // Used to get a list of rest keyword arguments. Method takes the given // keyword args, i.e. the hash literal passed to the method containing all // keyword arguemnts passed to method, as well as the used args which are // the names of required and optional arguments defined. This method then // just returns all key/value pairs which have not been used, in a new // hash literal. // // @param given_args [Hash] all kwargs given to method // @param used_args [Object] all keys used as named kwargs // @return [Hash] // Opal.kwrestargs = function(given_args, used_args) { var keys = [], map = {}, key = null, given_map = given_args.$$smap; for (key in given_map) { if (!used_args[key]) { keys.push(key); map[key] = given_map[key]; } } return Opal.hash2(keys, map); }; // Call a ruby method on a ruby object with some arguments: // // @example // var my_array = [1, 2, 3, 4] // Opal.send(my_array, 'length') # => 4 // Opal.send(my_array, 'reverse!') # => [4, 3, 2, 1] // // A missing method will be forwarded to the object via // method_missing. // // The result of either call with be returned. // // @param recv [Object] the ruby object // @param mid [String] ruby method to call // @return [Object] forwards the return value of the method (or of method_missing) Opal.send = function(recv, mid) { var args_ary = new Array(Math.max(arguments.length - 2, 0)); for(var i = 0, l = args_ary.length; i < l; i++) { args_ary[i] = arguments[i + 2]; } var func = recv['$' + mid]; if (func) { return func.apply(recv, args_ary); } return recv.$method_missing.apply(recv, [mid].concat(args_ary)); }; Opal.block_send = function(recv, mid, block) { var args_ary = new Array(Math.max(arguments.length - 3, 0)); for(var i = 0, l = args_ary.length; i < l; i++) { args_ary[i] = arguments[i + 3]; } var func = recv['$' + mid]; if (func) { func.$$p = block; return func.apply(recv, args_ary); } return recv.$method_missing.apply(recv, [mid].concat(args_ary)); }; // Used to define methods on an object. This is a helper method, used by the // compiled source to define methods on special case objects when the compiler // can not determine the destination object, or the object is a Module // instance. This can get called by `Module#define_method` as well. // // ## Modules // // Any method defined on a module will come through this runtime helper. // The method is added to the module body, and the owner of the method is // set to be the module itself. This is used later when choosing which // method should show on a class if more than 1 included modules define // the same method. Finally, if the module is in `module_function` mode, // then the method is also defined onto the module itself. // // ## Classes // // This helper will only be called for classes when a method is being // defined indirectly; either through `Module#define_method`, or by a // literal `def` method inside an `instance_eval` or `class_eval` body. In // either case, the method is simply added to the class' prototype. A special // exception exists for `BasicObject` and `Object`. These two classes are // special because they are used in toll-free bridged classes. In each of // these two cases, extra work is required to define the methods on toll-free // bridged class' prototypes as well. // // ## Objects // // If a simple ruby object is the object, then the method is simply just // defined on the object as a singleton method. This would be the case when // a method is defined inside an `instance_eval` block. // // @param obj [Object, Class] the actual obj to define method for // @param jsid [String] the JavaScript friendly method name (e.g. '$foo') // @param body [JS.Function] the literal JavaScript function used as method // @return [null] // Opal.defn = function(obj, jsid, body) { obj.$$proto[jsid] = body; // for super dispatcher, etc. body.$$owner = obj; if (obj.$$is_module) { Opal.donate(obj, jsid); if (obj.$$module_function) { Opal.defs(obj, jsid, body); } } if (obj.$__id__ && !obj.$__id__.$$stub) { var bridged = bridges[obj.$__id__()]; if (bridged) { for (var i = bridged.length - 1; i >= 0; i--) { Opal.bridge_method(bridged[i], obj, jsid, body); } } } var singleton_of = obj.$$singleton_of; if (obj.$method_added && !obj.$method_added.$$stub && !singleton_of) { obj.$method_added(jsid.substr(1)); } else if (singleton_of && singleton_of.$singleton_method_added && !singleton_of.$singleton_method_added.$$stub) { singleton_of.$singleton_method_added(jsid.substr(1)); } return nil; }; // Define a singleton method on the given object. Opal.defs = function(obj, jsid, body) { Opal.defn(Opal.get_singleton_class(obj), jsid, body) }; Opal.def = function(obj, jsid, body) { // if instance_eval is invoked on a module/class, it sets inst_eval_mod if (!obj.$$eval && (obj.$$is_class || obj.$$is_module)) { Opal.defn(obj, jsid, body); } else { Opal.defs(obj, jsid, body); } }; // Called from #remove_method. Opal.rdef = function(obj, jsid) { // TODO: remove from bridges as well if (!$hasOwn.call(obj.$$proto, jsid)) { throw Opal.NameError.$new("method '" + jsid.substr(1) + "' not defined in " + obj.$name()); } delete obj.$$proto[jsid]; if (obj.$$is_singleton) { if (obj.$$proto.$singleton_method_removed && !obj.$$proto.$singleton_method_removed.$$stub) { obj.$$proto.$singleton_method_removed(jsid.substr(1)); } } else { if (obj.$method_removed && !obj.$method_removed.$$stub) { obj.$method_removed(jsid.substr(1)); } } }; // Called from #undef_method. Opal.udef = function(obj, jsid) { if (!obj.$$proto[jsid] || obj.$$proto[jsid].$$stub) { throw Opal.NameError.$new("method '" + jsid.substr(1) + "' not defined in " + obj.$name()); } Opal.add_stub_for(obj.$$proto, jsid); if (obj.$$is_singleton) { if (obj.$$proto.$singleton_method_undefined && !obj.$$proto.$singleton_method_undefined.$$stub) { obj.$$proto.$singleton_method_undefined(jsid.substr(1)); } } else { if (obj.$method_undefined && !obj.$method_undefined.$$stub) { obj.$method_undefined(jsid.substr(1)); } } }; Opal.alias = function(obj, name, old) { var id = '$' + name, old_id = '$' + old, body = obj.$$proto['$' + old]; // instance_eval is being run on a class/module, so that need to alias class methods if (obj.$$eval) { return Opal.alias(Opal.get_singleton_class(obj), name, old); } if (typeof(body) !== "function" || body.$$stub) { var ancestor = obj.$$super; while (typeof(body) !== "function" && ancestor) { body = ancestor[old_id]; ancestor = ancestor.$$super; } if (typeof(body) !== "function" || body.$$stub) { throw Opal.NameError.$new("undefined method `" + old + "' for class `" + obj.$name() + "'") } } Opal.defn(obj, id, body); return obj; }; Opal.alias_native = function(obj, name, native_name) { var id = '$' + name, body = obj.$$proto[native_name]; if (typeof(body) !== "function" || body.$$stub) { throw Opal.NameError.$new("undefined native method `" + native_name + "' for class `" + obj.$name() + "'") } Opal.defn(obj, id, body); return obj; }; // Hashes // ------ Opal.hash_init = function(hash) { hash.$$smap = {}; hash.$$map = {}; hash.$$keys = []; }; Opal.hash_clone = function(from_hash, to_hash) { to_hash.$$none = from_hash.$$none; to_hash.$$proc = from_hash.$$proc; for (var i = 0, keys = from_hash.$$keys, length = keys.length, key, value; i < length; i++) { key = from_hash.$$keys[i]; if (key.$$is_string) { value = from_hash.$$smap[key]; } else { value = key.value; key = key.key; } Opal.hash_put(to_hash, key, value); } }; Opal.hash_put = function(hash, key, value) { if (key.$$is_string) { if (!hash.$$smap.hasOwnProperty(key)) { hash.$$keys.push(key); } hash.$$smap[key] = value; return; } var key_hash = key.$hash(), bucket, last_bucket; if (!hash.$$map.hasOwnProperty(key_hash)) { bucket = {key: key, key_hash: key_hash, value: value}; hash.$$keys.push(bucket); hash.$$map[key_hash] = bucket; return; } bucket = hash.$$map[key_hash]; while (bucket) { if (key === bucket.key || key['$eql?'](bucket.key)) { last_bucket = undefined; bucket.value = value; break; } last_bucket = bucket; bucket = bucket.next; } if (last_bucket) { bucket = {key: key, key_hash: key_hash, value: value}; hash.$$keys.push(bucket); last_bucket.next = bucket; } }; Opal.hash_get = function(hash, key) { if (key.$$is_string) { if (hash.$$smap.hasOwnProperty(key)) { return hash.$$smap[key]; } return; } var key_hash = key.$hash(), bucket; if (hash.$$map.hasOwnProperty(key_hash)) { bucket = hash.$$map[key_hash]; while (bucket) { if (key === bucket.key || key['$eql?'](bucket.key)) { return bucket.value; } bucket = bucket.next; } } }; Opal.hash_delete = function(hash, key) { var i, keys = hash.$$keys, length = keys.length, value; if (key.$$is_string) { if (!hash.$$smap.hasOwnProperty(key)) { return; } for (i = 0; i < length; i++) { if (keys[i] === key) { keys.splice(i, 1); break; } } value = hash.$$smap[key]; delete hash.$$smap[key]; return value; } var key_hash = key.$hash(); if (!hash.$$map.hasOwnProperty(key_hash)) { return; } var bucket = hash.$$map[key_hash], last_bucket; while (bucket) { if (key === bucket.key || key['$eql?'](bucket.key)) { value = bucket.value; for (i = 0; i < length; i++) { if (keys[i] === bucket) { keys.splice(i, 1); break; } } if (last_bucket && bucket.next) { last_bucket.next = bucket.next; } else if (last_bucket) { delete last_bucket.next; } else if (bucket.next) { hash.$$map[key_hash] = bucket.next; } else { delete hash.$$map[key_hash]; } return value; } last_bucket = bucket; bucket = bucket.next; } }; Opal.hash_rehash = function(hash) { for (var i = 0, length = hash.$$keys.length, key_hash, bucket, last_bucket; i < length; i++) { if (hash.$$keys[i].$$is_string) { continue; } key_hash = hash.$$keys[i].key.$hash(); if (key_hash === hash.$$keys[i].key_hash) { continue; } bucket = hash.$$map[hash.$$keys[i].key_hash]; last_bucket = undefined; while (bucket) { if (bucket === hash.$$keys[i]) { if (last_bucket && bucket.next) { last_bucket.next = bucket.next; } else if (last_bucket) { delete last_bucket.next; } else if (bucket.next) { hash.$$map[hash.$$keys[i].key_hash] = bucket.next; } else { delete hash.$$map[hash.$$keys[i].key_hash]; } break; } last_bucket = bucket; bucket = bucket.next; } hash.$$keys[i].key_hash = key_hash; if (!hash.$$map.hasOwnProperty(key_hash)) { hash.$$map[key_hash] = hash.$$keys[i]; continue; } bucket = hash.$$map[key_hash]; last_bucket = undefined; while (bucket) { if (bucket === hash.$$keys[i]) { last_bucket = undefined; break; } last_bucket = bucket; bucket = bucket.next; } if (last_bucket) { last_bucket.next = hash.$$keys[i]; } } }; Opal.hash = function() { var arguments_length = arguments.length, args, hash, i, length, key, value; if (arguments_length === 1 && arguments[0].$$is_hash) { return arguments[0]; } hash = new Opal.Hash.$$alloc(); Opal.hash_init(hash); if (arguments_length === 1 && arguments[0].$$is_array) { args = arguments[0]; length = args.length; for (i = 0; i < length; i++) { if (args[i].length !== 2) { throw Opal.ArgumentError.$new("value not of length 2: " + args[i].$inspect()); } key = args[i][0]; value = args[i][1]; Opal.hash_put(hash, key, value); } return hash; } if (arguments_length === 1) { args = arguments[0]; for (key in args) { if (args.hasOwnProperty(key)) { value = args[key]; Opal.hash_put(hash, key, value); } } return hash; } if (arguments_length % 2 !== 0) { throw Opal.ArgumentError.$new("odd number of arguments for Hash"); } for (i = 0; i < arguments_length; i += 2) { key = arguments[i]; value = arguments[i + 1]; Opal.hash_put(hash, key, value); } return hash; }; // hash2 is a faster creator for hashes that just use symbols and // strings as keys. The map and keys array can be constructed at // compile time, so they are just added here by the constructor // function // Opal.hash2 = function(keys, smap) { var hash = new Opal.Hash.$$alloc(); hash.$$smap = smap; hash.$$map = {}; hash.$$keys = keys; return hash; }; // Create a new range instance with first and last values, and whether the // range excludes the last value. // Opal.range = function(first, last, exc) { var range = new Opal.Range.$$alloc(); range.begin = first; range.end = last; range.exclude = exc; return range; }; Opal.ivar = function(name) { if ( // properties name === "constructor" || name === "displayName" || name === "__count__" || name === "__noSuchMethod__" || name === "__parent__" || name === "__proto__" || // methods name === "hasOwnProperty" || name === "valueOf" ) { return name + "$"; } return name; }; // Require system // -------------- Opal.modules = {}; Opal.loaded_features = ['corelib/runtime']; Opal.current_dir = '.' Opal.require_table = {'corelib/runtime': true}; Opal.normalize = function(path) { var parts, part, new_parts = [], SEPARATOR = '/'; if (Opal.current_dir !== '.') { path = Opal.current_dir.replace(/\/*$/, '/') + path; } path = path.replace(/\.(rb|opal|js)$/, ''); parts = path.split(SEPARATOR); for (var i = 0, ii = parts.length; i < ii; i++) { part = parts[i]; if (part === '') continue; (part === '..') ? new_parts.pop() : new_parts.push(part) } return new_parts.join(SEPARATOR); }; Opal.loaded = function(paths) { var i, l, path; for (i = 0, l = paths.length; i < l; i++) { path = Opal.normalize(paths[i]); if (Opal.require_table[path]) { return; } Opal.loaded_features.push(path); Opal.require_table[path] = true; } }; Opal.load = function(path) { path = Opal.normalize(path); Opal.loaded([path]); var module = Opal.modules[path]; if (module) { module(Opal); } else { var severity = Opal.config.missing_require_severity; var message = 'cannot load such file -- ' + path; if (severity === "error") { Opal.LoadError ? Opal.LoadError.$new(message) : function(){throw message}(); } else if (severity === "warning") { console.warn('WARNING: LoadError: ' + message); } } return true; }; Opal.require = function(path) { path = Opal.normalize(path); if (Opal.require_table[path]) { return false; } return Opal.load(path); }; // Initialization // -------------- // Constructors for *instances* of core objects Opal.boot_class_alloc('BasicObject', BasicObject_alloc); Opal.boot_class_alloc('Object', Object_alloc, BasicObject_alloc); Opal.boot_class_alloc('Module', Module_alloc, Object_alloc); Opal.boot_class_alloc('Class', Class_alloc, Module_alloc); // Constructors for *classes* of core objects Opal.BasicObject = BasicObject = Opal.setup_class_object('BasicObject', BasicObject_alloc, 'Class', Class_alloc); Opal.Object = _Object = Opal.setup_class_object('Object', Object_alloc, 'BasicObject', BasicObject.constructor); Opal.Module = Module = Opal.setup_class_object('Module', Module_alloc, 'Object', _Object.constructor); Opal.Class = Class = Opal.setup_class_object('Class', Class_alloc, 'Module', Module.constructor); Opal.constants.push("BasicObject"); Opal.constants.push("Object"); Opal.constants.push("Module"); Opal.constants.push("Class"); // Fix booted classes to use their metaclass BasicObject.$$class = Class; _Object.$$class = Class; Module.$$class = Class; Class.$$class = Class; // Fix superclasses of booted classes BasicObject.$$super = null; _Object.$$super = BasicObject; Module.$$super = _Object; Class.$$super = Module; BasicObject.$$parent = null; _Object.$$parent = BasicObject; Module.$$parent = _Object; Class.$$parent = Module; Opal.base = _Object; BasicObject.$$scope = _Object.$$scope = Opal; BasicObject.$$orig_scope = _Object.$$orig_scope = Opal; Module.$$scope = _Object.$$scope; Module.$$orig_scope = _Object.$$orig_scope; Class.$$scope = _Object.$$scope; Class.$$orig_scope = _Object.$$orig_scope; // Forward .toString() to #to_s _Object.$$proto.toString = function() { return this.$to_s(); }; // Make Kernel#require immediately available as it's needed to require all the // other corelib files. _Object.$$proto.$require = Opal.require; // Instantiate the top object Opal.top = new _Object.$$alloc(); // Nil Opal.klass(_Object, _Object, 'NilClass', NilClass_alloc); nil = Opal.nil = new NilClass_alloc(); nil.$$id = nil_id; nil.call = nil.apply = function() { throw Opal.LocalJumpError.$new('no block given'); }; Opal.breaker = new Error('unexpected break (old)'); Opal.returner = new Error('unexpected return'); TypeError.$$super = Error; }).call(this); if (typeof(global) !== 'undefined') { global.Opal = this.Opal; Opal.global = global; } if (typeof(window) !== 'undefined') { window.Opal = this.Opal; Opal.global = window; } Opal.loaded(["corelib/runtime"]); /* Generated by Opal 0.10.3 */ Opal.modules["corelib/helpers"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$new', '$class', '$===', '$respond_to?', '$raise', '$type_error', '$__send__', '$coerce_to', '$nil?', '$<=>', '$inspect', '$coerce_to!', '$!=', '$[]', '$upcase']); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13; Opal.defs(self, '$bridge', TMP_1 = function $$bridge(klass, constructor) { var self = this; return Opal.bridge(klass, constructor); }, TMP_1.$$arity = 2); Opal.defs(self, '$type_error', TMP_2 = function $$type_error(object, type, method, coerced) { var $a, $b, self = this; if (method == null) { method = nil; } if (coerced == null) { coerced = nil; } if ((($a = (($b = method !== false && method !== nil && method != null) ? coerced : method)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('TypeError').$new("can't convert " + (object.$class()) + " into " + (type) + " (" + (object.$class()) + "#" + (method) + " gives " + (coerced.$class())) } else { return $scope.get('TypeError').$new("no implicit conversion of " + (object.$class()) + " into " + (type)) }; }, TMP_2.$$arity = -3); Opal.defs(self, '$coerce_to', TMP_3 = function $$coerce_to(object, type, method) { var $a, self = this; if ((($a = type['$==='](object)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return object}; if ((($a = object['$respond_to?'](method)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise(self.$type_error(object, type)) }; return object.$__send__(method); }, TMP_3.$$arity = 3); Opal.defs(self, '$coerce_to!', TMP_4 = function(object, type, method) { var $a, self = this, coerced = nil; coerced = self.$coerce_to(object, type, method); if ((($a = type['$==='](coerced)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise(self.$type_error(object, type, method, coerced)) }; return coerced; }, TMP_4.$$arity = 3); Opal.defs(self, '$coerce_to?', TMP_5 = function(object, type, method) { var $a, self = this, coerced = nil; if ((($a = object['$respond_to?'](method)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; coerced = self.$coerce_to(object, type, method); if ((($a = coerced['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if ((($a = type['$==='](coerced)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise(self.$type_error(object, type, method, coerced)) }; return coerced; }, TMP_5.$$arity = 3); Opal.defs(self, '$try_convert', TMP_6 = function $$try_convert(object, type, method) { var $a, self = this; if ((($a = type['$==='](object)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return object}; if ((($a = object['$respond_to?'](method)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return object.$__send__(method) } else { return nil }; }, TMP_6.$$arity = 3); Opal.defs(self, '$compare', TMP_7 = function $$compare(a, b) { var $a, self = this, compare = nil; compare = a['$<=>'](b); if ((($a = compare === nil) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "comparison of " + (a.$class()) + " with " + (b.$class()) + " failed")}; return compare; }, TMP_7.$$arity = 2); Opal.defs(self, '$destructure', TMP_8 = function $$destructure(args) { var self = this; if (args.length == 1) { return args[0]; } else if (args.$$is_array) { return args; } else { var args_ary = new Array(args.length); for(var i = 0, l = args_ary.length; i < l; i++) { args_ary[i] = args[i]; } return args_ary; } }, TMP_8.$$arity = 1); Opal.defs(self, '$respond_to?', TMP_9 = function(obj, method) { var self = this; if (obj == null || !obj.$$class) { return false; } return obj['$respond_to?'](method); }, TMP_9.$$arity = 2); Opal.defs(self, '$inspect', TMP_10 = function $$inspect(obj) { var self = this; if (obj === undefined) { return "undefined"; } else if (obj === null) { return "null"; } else if (!obj.$$class) { return obj.toString(); } else { return obj.$inspect(); } }, TMP_10.$$arity = 1); Opal.defs(self, '$instance_variable_name!', TMP_11 = function(name) { var $a, self = this; name = $scope.get('Opal')['$coerce_to!'](name, $scope.get('String'), "to_str"); if ((($a = /^@[a-zA-Z_][a-zA-Z0-9_]*?$/.test(name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('NameError').$new("'" + (name) + "' is not allowed as an instance variable name", name)) }; return name; }, TMP_11.$$arity = 1); Opal.defs(self, '$const_name!', TMP_12 = function(const_name) { var $a, self = this; const_name = $scope.get('Opal')['$coerce_to!'](const_name, $scope.get('String'), "to_str"); if ((($a = const_name['$[]'](0)['$!='](const_name['$[]'](0).$upcase())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('NameError'), "wrong constant name " + (const_name))}; return const_name; }, TMP_12.$$arity = 1); Opal.defs(self, '$pristine', TMP_13 = function $$pristine(owner_class, $a_rest) { var self = this, method_names; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } method_names = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { method_names[$arg_idx - 1] = arguments[$arg_idx]; } var method_name; for (var i = method_names.length - 1; i >= 0; i--) { method_name = method_names[i]; owner_class.$$proto['$'+method_name].$$pristine = true } return nil; }, TMP_13.$$arity = -2); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/module"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range, $hash2 = Opal.hash2; Opal.add_stubs(['$===', '$raise', '$equal?', '$<', '$>', '$nil?', '$attr_reader', '$attr_writer', '$coerce_to!', '$new', '$const_name!', '$=~', '$inject', '$const_get', '$split', '$const_missing', '$==', '$!', '$start_with?', '$to_proc', '$lambda', '$bind', '$call', '$class', '$append_features', '$included', '$name', '$cover?', '$size', '$merge', '$compile', '$proc', '$to_s', '$__id__', '$constants', '$include?']); return (function($base, $super) { function $Module(){}; var self = $Module = $klass($base, $super, 'Module', $Module); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_22, TMP_23, TMP_24, TMP_25, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49; Opal.defs(self, '$allocate', TMP_1 = function $$allocate() { var self = this; var module; module = Opal.module_allocate(self); Opal.create_scope(Opal.Module.$$scope, module, null); return module; }, TMP_1.$$arity = 0); Opal.defn(self, '$initialize', TMP_2 = function $$initialize() { var self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; return Opal.module_initialize(self, block); }, TMP_2.$$arity = 0); Opal.defn(self, '$===', TMP_3 = function(object) { var $a, self = this; if ((($a = object == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return Opal.is_a(object, self); }, TMP_3.$$arity = 1); Opal.defn(self, '$<', TMP_4 = function(other) { var $a, self = this; if ((($a = $scope.get('Module')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "compared with non class/module") }; var working = self, ancestors, i, length; if (working === other) { return false; } for (i = 0, ancestors = Opal.ancestors(self), length = ancestors.length; i < length; i++) { if (ancestors[i] === other) { return true; } } for (i = 0, ancestors = Opal.ancestors(other), length = ancestors.length; i < length; i++) { if (ancestors[i] === self) { return false; } } return nil; }, TMP_4.$$arity = 1); Opal.defn(self, '$<=', TMP_5 = function(other) { var $a, self = this; return ((($a = self['$equal?'](other)) !== false && $a !== nil && $a != null) ? $a : $rb_lt(self, other)); }, TMP_5.$$arity = 1); Opal.defn(self, '$>', TMP_6 = function(other) { var $a, self = this; if ((($a = $scope.get('Module')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "compared with non class/module") }; return $rb_lt(other, self); }, TMP_6.$$arity = 1); Opal.defn(self, '$>=', TMP_7 = function(other) { var $a, self = this; return ((($a = self['$equal?'](other)) !== false && $a !== nil && $a != null) ? $a : $rb_gt(self, other)); }, TMP_7.$$arity = 1); Opal.defn(self, '$<=>', TMP_8 = function(other) { var $a, self = this, lt = nil; if (self === other) { return 0; } if ((($a = $scope.get('Module')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; lt = $rb_lt(self, other); if ((($a = lt['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if (lt !== false && lt !== nil && lt != null) { return -1 } else { return 1 }; }, TMP_8.$$arity = 1); Opal.defn(self, '$alias_method', TMP_9 = function $$alias_method(newname, oldname) { var self = this; Opal.alias(self, newname, oldname); return self; }, TMP_9.$$arity = 2); Opal.defn(self, '$alias_native', TMP_10 = function $$alias_native(mid, jsid) { var self = this; if (jsid == null) { jsid = mid; } Opal.alias_native(self, mid, jsid); return self; }, TMP_10.$$arity = -2); Opal.defn(self, '$ancestors', TMP_11 = function $$ancestors() { var self = this; return Opal.ancestors(self); }, TMP_11.$$arity = 0); Opal.defn(self, '$append_features', TMP_12 = function $$append_features(klass) { var self = this; Opal.append_features(self, klass); return self; }, TMP_12.$$arity = 1); Opal.defn(self, '$attr_accessor', TMP_13 = function $$attr_accessor($a_rest) { var $b, $c, self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } ($b = self).$attr_reader.apply($b, Opal.to_a(names)); return ($c = self).$attr_writer.apply($c, Opal.to_a(names)); }, TMP_13.$$arity = -1); Opal.alias(self, 'attr', 'attr_accessor'); Opal.defn(self, '$attr_reader', TMP_14 = function $$attr_reader($a_rest) { var self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } var proto = self.$$proto; for (var i = names.length - 1; i >= 0; i--) { var name = names[i], id = '$' + name, ivar = Opal.ivar(name); // the closure here is needed because name will change at the next // cycle, I wish we could use let. var body = (function(ivar) { return function() { if (this[ivar] == null) { return nil; } else { return this[ivar]; } }; })(ivar); // initialize the instance variable as nil proto[ivar] = nil; body.$$parameters = []; body.$$arity = 0; if (self.$$is_singleton) { proto.constructor.prototype[id] = body; } else { Opal.defn(self, id, body); } } return nil; }, TMP_14.$$arity = -1); Opal.defn(self, '$attr_writer', TMP_15 = function $$attr_writer($a_rest) { var self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } var proto = self.$$proto; for (var i = names.length - 1; i >= 0; i--) { var name = names[i], id = '$' + name + '=', ivar = Opal.ivar(name); // the closure here is needed because name will change at the next // cycle, I wish we could use let. var body = (function(ivar){ return function(value) { return this[ivar] = value; } })(ivar); body.$$parameters = [['req']]; body.$$arity = 1; // initialize the instance variable as nil proto[ivar] = nil; if (self.$$is_singleton) { proto.constructor.prototype[id] = body; } else { Opal.defn(self, id, body); } } return nil; }, TMP_15.$$arity = -1); Opal.defn(self, '$autoload', TMP_16 = function $$autoload(const$, path) { var self = this; var autoloaders; if (!(autoloaders = self.$$autoload)) { autoloaders = self.$$autoload = {}; } autoloaders[const$] = path; return nil; ; }, TMP_16.$$arity = 2); Opal.defn(self, '$class_variable_get', TMP_17 = function $$class_variable_get(name) { var $a, self = this; name = $scope.get('Opal')['$coerce_to!'](name, $scope.get('String'), "to_str"); if ((($a = name.length < 3 || name.slice(0,2) !== '@@') !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('NameError').$new("class vars should start with @@", name))}; var value = Opal.cvars[name.slice(2)]; (function() {if ((($a = value == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('NameError').$new("uninitialized class variable @@a in", name)) } else { return nil }; return nil; })() return value; }, TMP_17.$$arity = 1); Opal.defn(self, '$class_variable_set', TMP_18 = function $$class_variable_set(name, value) { var $a, self = this; name = $scope.get('Opal')['$coerce_to!'](name, $scope.get('String'), "to_str"); if ((($a = name.length < 3 || name.slice(0,2) !== '@@') !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('NameError'))}; Opal.cvars[name.slice(2)] = value; return value; }, TMP_18.$$arity = 2); Opal.defn(self, '$constants', TMP_19 = function $$constants() { var self = this; return self.$$scope.constants.slice(0); }, TMP_19.$$arity = 0); Opal.defn(self, '$const_defined?', TMP_20 = function(name, inherit) { var $a, self = this; if (inherit == null) { inherit = true; } name = $scope.get('Opal')['$const_name!'](name); if ((($a = name['$=~']((($scope.get('Opal')).$$scope.get('CONST_NAME_REGEXP')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('NameError').$new("wrong constant name " + (name), name)) }; var scopes = [self.$$scope]; if (inherit || self === Opal.Object) { var parent = self.$$super; while (parent !== Opal.BasicObject) { scopes.push(parent.$$scope); parent = parent.$$super; } } for (var i = 0, length = scopes.length; i < length; i++) { if (scopes[i].hasOwnProperty(name)) { return true; } } return false; }, TMP_20.$$arity = -2); Opal.defn(self, '$const_get', TMP_22 = function $$const_get(name, inherit) { var $a, $b, TMP_21, self = this; if (inherit == null) { inherit = true; } name = $scope.get('Opal')['$const_name!'](name); if (name.indexOf('::') === 0 && name !== '::'){ name = name.slice(2); } if ((($a = name.indexOf('::') != -1 && name != '::') !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = name.$split("::")).$inject, $a.$$p = (TMP_21 = function(o, c){var self = TMP_21.$$s || this; if (o == null) o = nil;if (c == null) c = nil; return o.$const_get(c)}, TMP_21.$$s = self, TMP_21.$$arity = 2, TMP_21), $a).call($b, self)}; if ((($a = name['$=~']((($scope.get('Opal')).$$scope.get('CONST_NAME_REGEXP')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('NameError').$new("wrong constant name " + (name), name)) }; var scopes = [self.$$scope]; if (inherit || self == Opal.Object) { var parent = self.$$super; while (parent !== Opal.BasicObject) { scopes.push(parent.$$scope); parent = parent.$$super; } } for (var i = 0, length = scopes.length; i < length; i++) { if (scopes[i].hasOwnProperty(name)) { return scopes[i][name]; } } return self.$const_missing(name); }, TMP_22.$$arity = -2); Opal.defn(self, '$const_missing', TMP_23 = function $$const_missing(name) { var self = this, full_const_name = nil; if (self.$$autoload) { var file = self.$$autoload[name]; if (file) { self.$require(file); return self.$const_get(name); } } full_const_name = (function() {if (self['$==']($scope.get('Object'))) { return name } else { return "" + (self) + "::" + (name) }; return nil; })(); return self.$raise($scope.get('NameError').$new("uninitialized constant " + (full_const_name), name)); }, TMP_23.$$arity = 1); Opal.defn(self, '$const_set', TMP_24 = function $$const_set(name, value) { var $a, $b, self = this; name = $scope.get('Opal')['$const_name!'](name); if ((($a = ((($b = (name['$=~']((($scope.get('Opal')).$$scope.get('CONST_NAME_REGEXP'))))['$!']()) !== false && $b !== nil && $b != null) ? $b : name['$start_with?']("::"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('NameError').$new("wrong constant name " + (name), name))}; Opal.casgn(self, name, value); return value; }, TMP_24.$$arity = 2); Opal.defn(self, '$define_method', TMP_25 = function $$define_method(name, method) { var $a, $b, $c, TMP_26, self = this, $iter = TMP_25.$$p, block = $iter || nil, $case = nil; TMP_25.$$p = null; if ((($a = method === undefined && block === nil) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "tried to create a Proc object without a block")}; ((($a = block) !== false && $a !== nil && $a != null) ? $a : block = (function() {$case = method;if ($scope.get('Proc')['$===']($case)) {return method}else if ($scope.get('Method')['$===']($case)) {return method.$to_proc().$$unbound;}else if ($scope.get('UnboundMethod')['$===']($case)) {return ($b = ($c = self).$lambda, $b.$$p = (TMP_26 = function($d_rest){var self = TMP_26.$$s || this, args, $e, bound = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } bound = method.$bind(self); return ($e = bound).$call.apply($e, Opal.to_a(args));}, TMP_26.$$s = self, TMP_26.$$arity = -1, TMP_26), $b).call($c)}else {return self.$raise($scope.get('TypeError'), "wrong argument type " + (block.$class()) + " (expected Proc/Method)")}})()); var id = '$' + name; block.$$jsid = name; block.$$s = null; block.$$def = block; block.$$define_meth = true; Opal.defn(self, id, block); return name; }, TMP_25.$$arity = -2); Opal.defn(self, '$remove_method', TMP_27 = function $$remove_method($a_rest) { var self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = 0, length = names.length; i < length; i++) { Opal.rdef(self, "$" + names[i]); } return self; }, TMP_27.$$arity = -1); Opal.defn(self, '$singleton_class?', TMP_28 = function() { var self = this; return !!self.$$is_singleton; }, TMP_28.$$arity = 0); Opal.defn(self, '$include', TMP_29 = function $$include($a_rest) { var self = this, mods; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } mods = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { mods[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = mods.length - 1; i >= 0; i--) { var mod = mods[i]; if (mod === self) { continue; } if (!mod.$$is_module) { self.$raise($scope.get('TypeError'), "wrong argument type " + ((mod).$class()) + " (expected Module)"); } (mod).$append_features(self); (mod).$included(self); } return self; }, TMP_29.$$arity = -1); Opal.defn(self, '$included_modules', TMP_30 = function $$included_modules() { var self = this; var results; var module_chain = function(klass) { var included = []; for (var i = 0; i != klass.$$inc.length; i++) { var mod_or_class = klass.$$inc[i]; included.push(mod_or_class); included = included.concat(module_chain(mod_or_class)); } return included; }; results = module_chain(self); // need superclass's modules if (self.$$is_class) { for (var cls = self; cls; cls = cls.$$super) { results = results.concat(module_chain(cls)); } } return results; }, TMP_30.$$arity = 0); Opal.defn(self, '$include?', TMP_31 = function(mod) { var self = this; for (var cls = self; cls; cls = cls.$$super) { for (var i = 0; i != cls.$$inc.length; i++) { var mod2 = cls.$$inc[i]; if (mod === mod2) { return true; } } } return false; }, TMP_31.$$arity = 1); Opal.defn(self, '$instance_method', TMP_32 = function $$instance_method(name) { var self = this; var meth = self.$$proto['$' + name]; if (!meth || meth.$$stub) { self.$raise($scope.get('NameError').$new("undefined method `" + (name) + "' for class `" + (self.$name()) + "'", name)); } return $scope.get('UnboundMethod').$new(self, meth, name); }, TMP_32.$$arity = 1); Opal.defn(self, '$instance_methods', TMP_33 = function $$instance_methods(include_super) { var self = this; if (include_super == null) { include_super = true; } var methods = [], proto = self.$$proto; for (var prop in proto) { if (prop.charAt(0) !== '$') { continue; } if (typeof(proto[prop]) !== "function") { continue; } if (proto[prop].$$stub) { continue; } if (!self.$$is_module) { if (self !== Opal.BasicObject && proto[prop] === Opal.BasicObject.$$proto[prop]) { continue; } if (!include_super && !proto.hasOwnProperty(prop)) { continue; } if (!include_super && proto[prop].$$donated) { continue; } } methods.push(prop.substr(1)); } return methods; }, TMP_33.$$arity = -1); Opal.defn(self, '$included', TMP_34 = function $$included(mod) { var self = this; return nil; }, TMP_34.$$arity = 1); Opal.defn(self, '$extended', TMP_35 = function $$extended(mod) { var self = this; return nil; }, TMP_35.$$arity = 1); Opal.defn(self, '$method_added', TMP_36 = function $$method_added($a_rest) { var self = this; return nil; }, TMP_36.$$arity = -1); Opal.defn(self, '$method_removed', TMP_37 = function $$method_removed($a_rest) { var self = this; return nil; }, TMP_37.$$arity = -1); Opal.defn(self, '$method_undefined', TMP_38 = function $$method_undefined($a_rest) { var self = this; return nil; }, TMP_38.$$arity = -1); Opal.defn(self, '$module_eval', TMP_39 = function $$module_eval($a_rest) { var $b, $c, TMP_40, self = this, args, $iter = TMP_39.$$p, block = $iter || nil, string = nil, file = nil, _lineno = nil, default_eval_options = nil, compiling_options = nil, compiled = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_39.$$p = null; if ((($b = ($c = block['$nil?'](), $c !== false && $c !== nil && $c != null ?!!Opal.compile : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ($range(1, 3, false))['$cover?'](args.$size())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "wrong number of arguments (0 for 1..3)") }; $b = Opal.to_a(args), string = ($b[0] == null ? nil : $b[0]), file = ($b[1] == null ? nil : $b[1]), _lineno = ($b[2] == null ? nil : $b[2]), $b; default_eval_options = $hash2(["file", "eval"], {"file": (((($b = file) !== false && $b !== nil && $b != null) ? $b : "(eval)")), "eval": true}); compiling_options = Opal.hash({ arity_check: false }).$merge(default_eval_options); compiled = $scope.get('Opal').$compile(string, compiling_options); block = ($b = ($c = $scope.get('Kernel')).$proc, $b.$$p = (TMP_40 = function(){var self = TMP_40.$$s || this; return (function(self) { return eval(compiled); })(self) }, TMP_40.$$s = self, TMP_40.$$arity = 0, TMP_40), $b).call($c); } else if ((($b = $rb_gt(args.$size(), 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (args.$size()) + " for 0)")}; var old = block.$$s, result; block.$$s = null; result = block.apply(self, [self]); block.$$s = old; return result; }, TMP_39.$$arity = -1); Opal.alias(self, 'class_eval', 'module_eval'); Opal.defn(self, '$module_exec', TMP_41 = function $$module_exec($a_rest) { var self = this, args, $iter = TMP_41.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_41.$$p = null; if (block === nil) { self.$raise($scope.get('LocalJumpError'), "no block given") } var block_self = block.$$s, result; block.$$s = null; result = block.apply(self, args); block.$$s = block_self; return result; ; }, TMP_41.$$arity = -1); Opal.alias(self, 'class_exec', 'module_exec'); Opal.defn(self, '$method_defined?', TMP_42 = function(method) { var self = this; var body = self.$$proto['$' + method]; return (!!body) && !body.$$stub; }, TMP_42.$$arity = 1); Opal.defn(self, '$module_function', TMP_43 = function $$module_function($a_rest) { var self = this, methods; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } methods = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { methods[$arg_idx - 0] = arguments[$arg_idx]; } if (methods.length === 0) { self.$$module_function = true; } else { for (var i = 0, length = methods.length; i < length; i++) { var meth = methods[i], id = '$' + meth, func = self.$$proto[id]; Opal.defs(self, id, func); } } return self; }, TMP_43.$$arity = -1); Opal.defn(self, '$name', TMP_44 = function $$name() { var self = this; if (self.$$full_name) { return self.$$full_name; } var result = [], base = self; while (base) { if (base.$$name === nil) { return result.length === 0 ? nil : result.join('::'); } result.unshift(base.$$name); base = base.$$base_module; if (base === Opal.Object) { break; } } if (result.length === 0) { return nil; } return self.$$full_name = result.join('::'); }, TMP_44.$$arity = 0); Opal.defn(self, '$remove_class_variable', TMP_45 = function $$remove_class_variable($a_rest) { var self = this; return nil; }, TMP_45.$$arity = -1); Opal.defn(self, '$remove_const', TMP_46 = function $$remove_const(name) { var self = this; var old = self.$$scope[name]; delete self.$$scope[name]; return old; }, TMP_46.$$arity = 1); Opal.defn(self, '$to_s', TMP_47 = function $$to_s() { var $a, self = this; return ((($a = Opal.Module.$name.call(self)) !== false && $a !== nil && $a != null) ? $a : "#<" + (self.$$is_module ? 'Module' : 'Class') + ":0x" + (self.$__id__().$to_s(16)) + ">"); }, TMP_47.$$arity = 0); Opal.defn(self, '$undef_method', TMP_48 = function $$undef_method($a_rest) { var self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = 0, length = names.length; i < length; i++) { Opal.udef(self, "$" + names[i]); } return self; }, TMP_48.$$arity = -1); return (Opal.defn(self, '$instance_variables', TMP_49 = function $$instance_variables() { var self = this, consts = nil; consts = self.$constants(); var result = []; for (var name in self) { if (self.hasOwnProperty(name) && name.charAt(0) !== '$' && name !== 'constructor' && !consts['$include?'](name)) { result.push('@' + name); } } return result; }, TMP_49.$$arity = 0), nil) && 'instance_variables'; })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/class"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$allocate', '$name', '$to_s']); self.$require("corelib/module"); return (function($base, $super) { function $Class(){}; var self = $Class = $klass($base, $super, 'Class', $Class); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; Opal.defs(self, '$new', TMP_1 = function(superclass) { var self = this, $iter = TMP_1.$$p, block = $iter || nil; if (superclass == null) { superclass = $scope.get('Object'); } TMP_1.$$p = null; if (!superclass.$$is_class) { throw Opal.TypeError.$new("superclass must be a Class"); } var alloc = Opal.boot_class_alloc(null, function(){}, superclass) var klass = Opal.setup_class_object(null, alloc, superclass.$$name, superclass.constructor); klass.$$super = superclass; klass.$$parent = superclass; // inherit scope from parent Opal.create_scope(superclass.$$scope, klass); superclass.$inherited(klass); Opal.module_initialize(klass, block); return klass; }, TMP_1.$$arity = -1); Opal.defn(self, '$allocate', TMP_2 = function $$allocate() { var self = this; var obj = new self.$$alloc(); obj.$$id = Opal.uid(); return obj; }, TMP_2.$$arity = 0); Opal.defn(self, '$inherited', TMP_3 = function $$inherited(cls) { var self = this; return nil; }, TMP_3.$$arity = 1); Opal.defn(self, '$new', TMP_4 = function($a_rest) { var self = this, args, $iter = TMP_4.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_4.$$p = null; var obj = self.$allocate(); obj.$initialize.$$p = block; obj.$initialize.apply(obj, args); return obj; ; }, TMP_4.$$arity = -1); Opal.defn(self, '$superclass', TMP_5 = function $$superclass() { var self = this; return self.$$super || nil; }, TMP_5.$$arity = 0); return (Opal.defn(self, '$to_s', TMP_6 = function $$to_s() { var $a, $b, self = this, $iter = TMP_6.$$p, $yield = $iter || nil; TMP_6.$$p = null; var singleton_of = self.$$singleton_of; if (singleton_of && (singleton_of.$$is_class || singleton_of.$$is_module)) { return "#"; } else if (singleton_of) { // a singleton class created from an object return "#>"; } return ($a = ($b = self, Opal.find_super_dispatcher(self, 'to_s', TMP_6, false)), $a.$$p = null, $a).call($b); }, TMP_6.$$arity = 0), nil) && 'to_s'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/basic_object"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range, $hash2 = Opal.hash2; Opal.add_stubs(['$==', '$!', '$nil?', '$cover?', '$size', '$raise', '$merge', '$compile', '$proc', '$>', '$new', '$inspect']); return (function($base, $super) { function $BasicObject(){}; var self = $BasicObject = $klass($base, $super, 'BasicObject', $BasicObject); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14; Opal.defn(self, '$initialize', TMP_1 = function $$initialize($a_rest) { var self = this; return nil; }, TMP_1.$$arity = -1); Opal.defn(self, '$==', TMP_2 = function(other) { var self = this; return self === other; }, TMP_2.$$arity = 1); Opal.defn(self, '$eql?', TMP_3 = function(other) { var self = this; return self['$=='](other); }, TMP_3.$$arity = 1); Opal.alias(self, 'equal?', '=='); Opal.defn(self, '$__id__', TMP_4 = function $$__id__() { var self = this; return self.$$id || (self.$$id = Opal.uid()); }, TMP_4.$$arity = 0); Opal.defn(self, '$__send__', TMP_5 = function $$__send__(symbol, $a_rest) { var self = this, args, $iter = TMP_5.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_5.$$p = null; var func = self['$' + symbol] if (func) { if (block !== nil) { func.$$p = block; } return func.apply(self, args); } if (block !== nil) { self.$method_missing.$$p = block; } return self.$method_missing.apply(self, [symbol].concat(args)); }, TMP_5.$$arity = -2); Opal.defn(self, '$!', TMP_6 = function() { var self = this; return false; }, TMP_6.$$arity = 0); Opal.defn(self, '$!=', TMP_7 = function(other) { var self = this; return (self['$=='](other))['$!'](); }, TMP_7.$$arity = 1); Opal.alias(self, 'equal?', '=='); Opal.defn(self, '$instance_eval', TMP_8 = function $$instance_eval($a_rest) { var $b, $c, TMP_9, self = this, args, $iter = TMP_8.$$p, block = $iter || nil, string = nil, file = nil, _lineno = nil, default_eval_options = nil, compiling_options = nil, compiled = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_8.$$p = null; if ((($b = ($c = block['$nil?'](), $c !== false && $c !== nil && $c != null ?!!Opal.compile : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ($range(1, 3, false))['$cover?'](args.$size())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "wrong number of arguments (0 for 1..3)") }; $b = Opal.to_a(args), string = ($b[0] == null ? nil : $b[0]), file = ($b[1] == null ? nil : $b[1]), _lineno = ($b[2] == null ? nil : $b[2]), $b; default_eval_options = $hash2(["file", "eval"], {"file": (((($b = file) !== false && $b !== nil && $b != null) ? $b : "(eval)")), "eval": true}); compiling_options = Opal.hash({ arity_check: false }).$merge(default_eval_options); compiled = $scope.get('Opal').$compile(string, compiling_options); block = ($b = ($c = $scope.get('Kernel')).$proc, $b.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; return (function(self) { return eval(compiled); })(self) }, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $b).call($c); } else if ((($b = $rb_gt(args.$size(), 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (args.$size()) + " for 0)")}; var old = block.$$s, result; block.$$s = null; // Need to pass $$eval so that method definitions know if this is // being done on a class/module. Cannot be compiler driven since // send(:instance_eval) needs to work. if (self.$$is_class || self.$$is_module) { self.$$eval = true; try { result = block.call(self, self); } finally { self.$$eval = false; } } else { result = block.call(self, self); } block.$$s = old; return result; }, TMP_8.$$arity = -1); Opal.defn(self, '$instance_exec', TMP_10 = function $$instance_exec($a_rest) { var self = this, args, $iter = TMP_10.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_10.$$p = null; if (block !== false && block !== nil && block != null) { } else { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "no block given") }; var block_self = block.$$s, result; block.$$s = null; if (self.$$is_class || self.$$is_module) { self.$$eval = true; try { result = block.apply(self, args); } finally { self.$$eval = false; } } else { result = block.apply(self, args); } block.$$s = block_self; return result; }, TMP_10.$$arity = -1); Opal.defn(self, '$singleton_method_added', TMP_11 = function $$singleton_method_added($a_rest) { var self = this; return nil; }, TMP_11.$$arity = -1); Opal.defn(self, '$singleton_method_removed', TMP_12 = function $$singleton_method_removed($a_rest) { var self = this; return nil; }, TMP_12.$$arity = -1); Opal.defn(self, '$singleton_method_undefined', TMP_13 = function $$singleton_method_undefined($a_rest) { var self = this; return nil; }, TMP_13.$$arity = -1); return (Opal.defn(self, '$method_missing', TMP_14 = function $$method_missing(symbol, $a_rest) { var $b, self = this, args, $iter = TMP_14.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_14.$$p = null; return $scope.get('Kernel').$raise($scope.get('NoMethodError').$new((function() {if ((($b = self.$inspect && !self.$inspect.$$stub) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "undefined method `" + (symbol) + "' for " + (self.$inspect()) + ":" + (self.$$class) } else { return "undefined method `" + (symbol) + "' for " + (self.$$class) }; return nil; })(), symbol)); }, TMP_14.$$arity = -2), nil) && 'method_missing'; })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/kernel"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $gvars = Opal.gvars, $hash2 = Opal.hash2, $klass = Opal.klass; Opal.add_stubs(['$raise', '$new', '$inspect', '$!', '$=~', '$==', '$object_id', '$class', '$coerce_to?', '$<<', '$allocate', '$copy_instance_variables', '$copy_singleton_methods', '$initialize_clone', '$initialize_copy', '$define_method', '$to_proc', '$singleton_class', '$initialize_dup', '$for', '$>', '$size', '$pop', '$call', '$append_features', '$extended', '$length', '$respond_to?', '$[]', '$nil?', '$to_a', '$to_int', '$fetch', '$Integer', '$Float', '$to_ary', '$to_str', '$coerce_to', '$to_s', '$__id__', '$instance_variable_name!', '$coerce_to!', '$===', '$enum_for', '$print', '$format', '$puts', '$each', '$<=', '$empty?', '$exception', '$kind_of?', '$respond_to_missing?', '$try_convert!', '$expand_path', '$join', '$start_with?', '$sym', '$arg', '$open', '$include']); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51, TMP_52, TMP_53, TMP_54, TMP_55, TMP_56, TMP_57, TMP_58, TMP_59, TMP_60, TMP_61, TMP_62, TMP_63; Opal.defn(self, '$method_missing', TMP_1 = function $$method_missing(symbol, $a_rest) { var self = this, args, $iter = TMP_1.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_1.$$p = null; return self.$raise($scope.get('NoMethodError').$new("undefined method `" + (symbol) + "' for " + (self.$inspect()), symbol, args)); }, TMP_1.$$arity = -2); Opal.defn(self, '$=~', TMP_2 = function(obj) { var self = this; return false; }, TMP_2.$$arity = 1); Opal.defn(self, '$!~', TMP_3 = function(obj) { var self = this; return (self['$=~'](obj))['$!'](); }, TMP_3.$$arity = 1); Opal.defn(self, '$===', TMP_4 = function(other) { var $a, self = this; return ((($a = self.$object_id()['$=='](other.$object_id())) !== false && $a !== nil && $a != null) ? $a : self['$=='](other)); }, TMP_4.$$arity = 1); Opal.defn(self, '$<=>', TMP_5 = function(other) { var self = this; // set guard for infinite recursion self.$$comparable = true; var x = self['$=='](other); if (x && x !== nil) { return 0; } return nil; }, TMP_5.$$arity = 1); Opal.defn(self, '$method', TMP_6 = function $$method(name) { var self = this; var meth = self['$' + name]; if (!meth || meth.$$stub) { self.$raise($scope.get('NameError').$new("undefined method `" + (name) + "' for class `" + (self.$class()) + "'", name)); } return $scope.get('Method').$new(self, meth, name); }, TMP_6.$$arity = 1); Opal.defn(self, '$methods', TMP_7 = function $$methods(all) { var self = this; if (all == null) { all = true; } var methods = []; for (var key in self) { if (key[0] == "$" && typeof(self[key]) === "function") { if (all == false || all === nil) { if (!Opal.hasOwnProperty.call(self, key)) { continue; } } if (self[key].$$stub === undefined) { methods.push(key.substr(1)); } } } return methods; }, TMP_7.$$arity = -1); Opal.alias(self, 'public_methods', 'methods'); Opal.defn(self, '$Array', TMP_8 = function $$Array(object) { var self = this; var coerced; if (object === nil) { return []; } if (object.$$is_array) { return object; } coerced = $scope.get('Opal')['$coerce_to?'](object, $scope.get('Array'), "to_ary"); if (coerced !== nil) { return coerced; } coerced = $scope.get('Opal')['$coerce_to?'](object, $scope.get('Array'), "to_a"); if (coerced !== nil) { return coerced; } return [object]; }, TMP_8.$$arity = 1); Opal.defn(self, '$at_exit', TMP_9 = function $$at_exit() { var $a, self = this, $iter = TMP_9.$$p, block = $iter || nil; if ($gvars.__at_exit__ == null) $gvars.__at_exit__ = nil; TMP_9.$$p = null; ((($a = $gvars.__at_exit__) !== false && $a !== nil && $a != null) ? $a : $gvars.__at_exit__ = []); return $gvars.__at_exit__['$<<'](block); }, TMP_9.$$arity = 0); Opal.defn(self, '$caller', TMP_10 = function $$caller() { var self = this; return []; }, TMP_10.$$arity = 0); Opal.defn(self, '$class', TMP_11 = function() { var self = this; return self.$$class; }, TMP_11.$$arity = 0); Opal.defn(self, '$copy_instance_variables', TMP_12 = function $$copy_instance_variables(other) { var self = this; for (var name in other) { if (other.hasOwnProperty(name) && name.charAt(0) !== '$') { self[name] = other[name]; } } }, TMP_12.$$arity = 1); Opal.defn(self, '$copy_singleton_methods', TMP_13 = function $$copy_singleton_methods(other) { var self = this; var name; if (other.hasOwnProperty('$$meta')) { var other_singleton_class_proto = Opal.get_singleton_class(other).$$proto; var self_singleton_class_proto = Opal.get_singleton_class(self).$$proto; for (name in other_singleton_class_proto) { if (name.charAt(0) === '$' && other_singleton_class_proto.hasOwnProperty(name)) { self_singleton_class_proto[name] = other_singleton_class_proto[name]; } } } for (name in other) { if (name.charAt(0) === '$' && name.charAt(1) !== '$' && other.hasOwnProperty(name)) { self[name] = other[name]; } } }, TMP_13.$$arity = 1); Opal.defn(self, '$clone', TMP_14 = function $$clone() { var self = this, copy = nil; copy = self.$class().$allocate(); copy.$copy_instance_variables(self); copy.$copy_singleton_methods(self); copy.$initialize_clone(self); return copy; }, TMP_14.$$arity = 0); Opal.defn(self, '$initialize_clone', TMP_15 = function $$initialize_clone(other) { var self = this; return self.$initialize_copy(other); }, TMP_15.$$arity = 1); Opal.defn(self, '$define_singleton_method', TMP_16 = function $$define_singleton_method(name, method) { var $a, $b, self = this, $iter = TMP_16.$$p, block = $iter || nil; TMP_16.$$p = null; return ($a = ($b = self.$singleton_class()).$define_method, $a.$$p = block.$to_proc(), $a).call($b, name, method); }, TMP_16.$$arity = -2); Opal.defn(self, '$dup', TMP_17 = function $$dup() { var self = this, copy = nil; copy = self.$class().$allocate(); copy.$copy_instance_variables(self); copy.$initialize_dup(self); return copy; }, TMP_17.$$arity = 0); Opal.defn(self, '$initialize_dup', TMP_18 = function $$initialize_dup(other) { var self = this; return self.$initialize_copy(other); }, TMP_18.$$arity = 1); Opal.defn(self, '$enum_for', TMP_19 = function $$enum_for(method, $a_rest) { var $b, $c, self = this, args, $iter = TMP_19.$$p, block = $iter || nil; if (method == null) { method = "each"; } var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_19.$$p = null; return ($b = ($c = $scope.get('Enumerator')).$for, $b.$$p = block.$to_proc(), $b).apply($c, [self, method].concat(Opal.to_a(args))); }, TMP_19.$$arity = -1); Opal.alias(self, 'to_enum', 'enum_for'); Opal.defn(self, '$equal?', TMP_20 = function(other) { var self = this; return self === other; }, TMP_20.$$arity = 1); Opal.defn(self, '$exit', TMP_21 = function $$exit(status) { var $a, $b, self = this, block = nil; if ($gvars.__at_exit__ == null) $gvars.__at_exit__ = nil; if (status == null) { status = true; } ((($a = $gvars.__at_exit__) !== false && $a !== nil && $a != null) ? $a : $gvars.__at_exit__ = []); while ((($b = $rb_gt($gvars.__at_exit__.$size(), 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { block = $gvars.__at_exit__.$pop(); block.$call();}; if ((($a = status === true) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { status = 0}; Opal.exit(status); return nil; }, TMP_21.$$arity = -1); Opal.defn(self, '$extend', TMP_22 = function $$extend($a_rest) { var self = this, mods; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } mods = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { mods[$arg_idx - 0] = arguments[$arg_idx]; } var singleton = self.$singleton_class(); for (var i = mods.length - 1; i >= 0; i--) { var mod = mods[i]; if (!mod.$$is_module) { self.$raise($scope.get('TypeError'), "wrong argument type " + ((mod).$class()) + " (expected Module)"); } (mod).$append_features(singleton); (mod).$extended(self); } ; return self; }, TMP_22.$$arity = -1); Opal.defn(self, '$format', TMP_23 = function $$format(format_string, $a_rest) { var $b, $c, self = this, args, ary = nil; if ($gvars.DEBUG == null) $gvars.DEBUG = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } if ((($b = (($c = args.$length()['$=='](1)) ? args['$[]'](0)['$respond_to?']("to_ary") : args.$length()['$=='](1))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { ary = $scope.get('Opal')['$coerce_to?'](args['$[]'](0), $scope.get('Array'), "to_ary"); if ((($b = ary['$nil?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { args = ary.$to_a() };}; var result = '', //used for slicing: begin_slice = 0, end_slice, //used for iterating over the format string: i, len = format_string.length, //used for processing field values: arg, str, //used for processing %g and %G fields: exponent, //used for keeping track of width and precision: width, precision, //used for holding temporary values: tmp_num, //used for processing %{} and %<> fileds: hash_parameter_key, closing_brace_char, //used for processing %b, %B, %o, %x, and %X fields: base_number, base_prefix, base_neg_zero_regex, base_neg_zero_digit, //used for processing arguments: next_arg, seq_arg_num = 1, pos_arg_num = 0, //used for keeping track of flags: flags, FNONE = 0, FSHARP = 1, FMINUS = 2, FPLUS = 4, FZERO = 8, FSPACE = 16, FWIDTH = 32, FPREC = 64, FPREC0 = 128; function CHECK_FOR_FLAGS() { if (flags&FWIDTH) { self.$raise($scope.get('ArgumentError'), "flag after width") } if (flags&FPREC0) { self.$raise($scope.get('ArgumentError'), "flag after precision") } } function CHECK_FOR_WIDTH() { if (flags&FWIDTH) { self.$raise($scope.get('ArgumentError'), "width given twice") } if (flags&FPREC0) { self.$raise($scope.get('ArgumentError'), "width after precision") } } function GET_NTH_ARG(num) { if (num >= args.length) { self.$raise($scope.get('ArgumentError'), "too few arguments") } return args[num]; } function GET_NEXT_ARG() { switch (pos_arg_num) { case -1: self.$raise($scope.get('ArgumentError'), "unnumbered(" + (seq_arg_num) + ") mixed with numbered") case -2: self.$raise($scope.get('ArgumentError'), "unnumbered(" + (seq_arg_num) + ") mixed with named") } pos_arg_num = seq_arg_num++; return GET_NTH_ARG(pos_arg_num - 1); } function GET_POS_ARG(num) { if (pos_arg_num > 0) { self.$raise($scope.get('ArgumentError'), "numbered(" + (num) + ") after unnumbered(" + (pos_arg_num) + ")") } if (pos_arg_num === -2) { self.$raise($scope.get('ArgumentError'), "numbered(" + (num) + ") after named") } if (num < 1) { self.$raise($scope.get('ArgumentError'), "invalid index - " + (num) + "$") } pos_arg_num = -1; return GET_NTH_ARG(num - 1); } function GET_ARG() { return (next_arg === undefined ? GET_NEXT_ARG() : next_arg); } function READ_NUM(label) { var num, str = ''; for (;; i++) { if (i === len) { self.$raise($scope.get('ArgumentError'), "malformed format string - %*[0-9]") } if (format_string.charCodeAt(i) < 48 || format_string.charCodeAt(i) > 57) { i--; num = parseInt(str, 10) || 0; if (num > 2147483647) { self.$raise($scope.get('ArgumentError'), "" + (label) + " too big") } return num; } str += format_string.charAt(i); } } function READ_NUM_AFTER_ASTER(label) { var arg, num = READ_NUM(label); if (format_string.charAt(i + 1) === '$') { i++; arg = GET_POS_ARG(num); } else { arg = GET_NEXT_ARG(); } return (arg).$to_int(); } for (i = format_string.indexOf('%'); i !== -1; i = format_string.indexOf('%', i)) { str = undefined; flags = FNONE; width = -1; precision = -1; next_arg = undefined; end_slice = i; i++; switch (format_string.charAt(i)) { case '%': begin_slice = i; case '': case '\n': case '\0': i++; continue; } format_sequence: for (; i < len; i++) { switch (format_string.charAt(i)) { case ' ': CHECK_FOR_FLAGS(); flags |= FSPACE; continue format_sequence; case '#': CHECK_FOR_FLAGS(); flags |= FSHARP; continue format_sequence; case '+': CHECK_FOR_FLAGS(); flags |= FPLUS; continue format_sequence; case '-': CHECK_FOR_FLAGS(); flags |= FMINUS; continue format_sequence; case '0': CHECK_FOR_FLAGS(); flags |= FZERO; continue format_sequence; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tmp_num = READ_NUM('width'); if (format_string.charAt(i + 1) === '$') { if (i + 2 === len) { str = '%'; i++; break format_sequence; } if (next_arg !== undefined) { self.$raise($scope.get('ArgumentError'), "value given twice - %" + (tmp_num) + "$") } next_arg = GET_POS_ARG(tmp_num); i++; } else { CHECK_FOR_WIDTH(); flags |= FWIDTH; width = tmp_num; } continue format_sequence; case '<': case '\{': closing_brace_char = (format_string.charAt(i) === '<' ? '>' : '\}'); hash_parameter_key = ''; i++; for (;; i++) { if (i === len) { self.$raise($scope.get('ArgumentError'), "malformed name - unmatched parenthesis") } if (format_string.charAt(i) === closing_brace_char) { if (pos_arg_num > 0) { self.$raise($scope.get('ArgumentError'), "named " + (hash_parameter_key) + " after unnumbered(" + (pos_arg_num) + ")") } if (pos_arg_num === -1) { self.$raise($scope.get('ArgumentError'), "named " + (hash_parameter_key) + " after numbered") } pos_arg_num = -2; if (args[0] === undefined || !args[0].$$is_hash) { self.$raise($scope.get('ArgumentError'), "one hash required") } next_arg = (args[0]).$fetch(hash_parameter_key); if (closing_brace_char === '>') { continue format_sequence; } else { str = next_arg.toString(); if (precision !== -1) { str = str.slice(0, precision); } if (flags&FMINUS) { while (str.length < width) { str = str + ' '; } } else { while (str.length < width) { str = ' ' + str; } } break format_sequence; } } hash_parameter_key += format_string.charAt(i); } case '*': i++; CHECK_FOR_WIDTH(); flags |= FWIDTH; width = READ_NUM_AFTER_ASTER('width'); if (width < 0) { flags |= FMINUS; width = -width; } continue format_sequence; case '.': if (flags&FPREC0) { self.$raise($scope.get('ArgumentError'), "precision given twice") } flags |= FPREC|FPREC0; precision = 0; i++; if (format_string.charAt(i) === '*') { i++; precision = READ_NUM_AFTER_ASTER('precision'); if (precision < 0) { flags &= ~FPREC; } continue format_sequence; } precision = READ_NUM('precision'); continue format_sequence; case 'd': case 'i': case 'u': arg = self.$Integer(GET_ARG()); if (arg >= 0) { str = arg.toString(); while (str.length < precision) { str = '0' + str; } if (flags&FMINUS) { if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && precision === -1) { while (str.length < width - ((flags&FPLUS || flags&FSPACE) ? 1 : 0)) { str = '0' + str; } if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } } else { if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } while (str.length < width) { str = ' ' + str; } } } } else { str = (-arg).toString(); while (str.length < precision) { str = '0' + str; } if (flags&FMINUS) { str = '-' + str; while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && precision === -1) { while (str.length < width - 1) { str = '0' + str; } str = '-' + str; } else { str = '-' + str; while (str.length < width) { str = ' ' + str; } } } } break format_sequence; case 'b': case 'B': case 'o': case 'x': case 'X': switch (format_string.charAt(i)) { case 'b': case 'B': base_number = 2; base_prefix = '0b'; base_neg_zero_regex = /^1+/; base_neg_zero_digit = '1'; break; case 'o': base_number = 8; base_prefix = '0'; base_neg_zero_regex = /^3?7+/; base_neg_zero_digit = '7'; break; case 'x': case 'X': base_number = 16; base_prefix = '0x'; base_neg_zero_regex = /^f+/; base_neg_zero_digit = 'f'; break; } arg = self.$Integer(GET_ARG()); if (arg >= 0) { str = arg.toString(base_number); while (str.length < precision) { str = '0' + str; } if (flags&FMINUS) { if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } if (flags&FSHARP && arg !== 0) { str = base_prefix + str; } while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && precision === -1) { while (str.length < width - ((flags&FPLUS || flags&FSPACE) ? 1 : 0) - ((flags&FSHARP && arg !== 0) ? base_prefix.length : 0)) { str = '0' + str; } if (flags&FSHARP && arg !== 0) { str = base_prefix + str; } if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } } else { if (flags&FSHARP && arg !== 0) { str = base_prefix + str; } if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } while (str.length < width) { str = ' ' + str; } } } } else { if (flags&FPLUS || flags&FSPACE) { str = (-arg).toString(base_number); while (str.length < precision) { str = '0' + str; } if (flags&FMINUS) { if (flags&FSHARP) { str = base_prefix + str; } str = '-' + str; while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && precision === -1) { while (str.length < width - 1 - (flags&FSHARP ? 2 : 0)) { str = '0' + str; } if (flags&FSHARP) { str = base_prefix + str; } str = '-' + str; } else { if (flags&FSHARP) { str = base_prefix + str; } str = '-' + str; while (str.length < width) { str = ' ' + str; } } } } else { str = (arg >>> 0).toString(base_number).replace(base_neg_zero_regex, base_neg_zero_digit); while (str.length < precision - 2) { str = base_neg_zero_digit + str; } if (flags&FMINUS) { str = '..' + str; if (flags&FSHARP) { str = base_prefix + str; } while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && precision === -1) { while (str.length < width - 2 - (flags&FSHARP ? base_prefix.length : 0)) { str = base_neg_zero_digit + str; } str = '..' + str; if (flags&FSHARP) { str = base_prefix + str; } } else { str = '..' + str; if (flags&FSHARP) { str = base_prefix + str; } while (str.length < width) { str = ' ' + str; } } } } } if (format_string.charAt(i) === format_string.charAt(i).toUpperCase()) { str = str.toUpperCase(); } break format_sequence; case 'f': case 'e': case 'E': case 'g': case 'G': arg = self.$Float(GET_ARG()); if (arg >= 0 || isNaN(arg)) { if (arg === Infinity) { str = 'Inf'; } else { switch (format_string.charAt(i)) { case 'f': str = arg.toFixed(precision === -1 ? 6 : precision); break; case 'e': case 'E': str = arg.toExponential(precision === -1 ? 6 : precision); break; case 'g': case 'G': str = arg.toExponential(); exponent = parseInt(str.split('e')[1], 10); if (!(exponent < -4 || exponent >= (precision === -1 ? 6 : precision))) { str = arg.toPrecision(precision === -1 ? (flags&FSHARP ? 6 : undefined) : precision); } break; } } if (flags&FMINUS) { if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && arg !== Infinity && !isNaN(arg)) { while (str.length < width - ((flags&FPLUS || flags&FSPACE) ? 1 : 0)) { str = '0' + str; } if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } } else { if (flags&FPLUS || flags&FSPACE) { str = (flags&FPLUS ? '+' : ' ') + str; } while (str.length < width) { str = ' ' + str; } } } } else { if (arg === -Infinity) { str = 'Inf'; } else { switch (format_string.charAt(i)) { case 'f': str = (-arg).toFixed(precision === -1 ? 6 : precision); break; case 'e': case 'E': str = (-arg).toExponential(precision === -1 ? 6 : precision); break; case 'g': case 'G': str = (-arg).toExponential(); exponent = parseInt(str.split('e')[1], 10); if (!(exponent < -4 || exponent >= (precision === -1 ? 6 : precision))) { str = (-arg).toPrecision(precision === -1 ? (flags&FSHARP ? 6 : undefined) : precision); } break; } } if (flags&FMINUS) { str = '-' + str; while (str.length < width) { str = str + ' '; } } else { if (flags&FZERO && arg !== -Infinity) { while (str.length < width - 1) { str = '0' + str; } str = '-' + str; } else { str = '-' + str; while (str.length < width) { str = ' ' + str; } } } } if (format_string.charAt(i) === format_string.charAt(i).toUpperCase() && arg !== Infinity && arg !== -Infinity && !isNaN(arg)) { str = str.toUpperCase(); } str = str.replace(/([eE][-+]?)([0-9])$/, '$10$2'); break format_sequence; case 'a': case 'A': // Not implemented because there are no specs for this field type. self.$raise($scope.get('NotImplementedError'), "`A` and `a` format field types are not implemented in Opal yet") case 'c': arg = GET_ARG(); if ((arg)['$respond_to?']("to_ary")) { arg = (arg).$to_ary()[0]; } if ((arg)['$respond_to?']("to_str")) { str = (arg).$to_str(); } else { str = String.fromCharCode($scope.get('Opal').$coerce_to(arg, $scope.get('Integer'), "to_int")); } if (str.length !== 1) { self.$raise($scope.get('ArgumentError'), "%c requires a character") } if (flags&FMINUS) { while (str.length < width) { str = str + ' '; } } else { while (str.length < width) { str = ' ' + str; } } break format_sequence; case 'p': str = (GET_ARG()).$inspect(); if (precision !== -1) { str = str.slice(0, precision); } if (flags&FMINUS) { while (str.length < width) { str = str + ' '; } } else { while (str.length < width) { str = ' ' + str; } } break format_sequence; case 's': str = (GET_ARG()).$to_s(); if (precision !== -1) { str = str.slice(0, precision); } if (flags&FMINUS) { while (str.length < width) { str = str + ' '; } } else { while (str.length < width) { str = ' ' + str; } } break format_sequence; default: self.$raise($scope.get('ArgumentError'), "malformed format string - %" + (format_string.charAt(i))) } } if (str === undefined) { self.$raise($scope.get('ArgumentError'), "malformed format string - %") } result += format_string.slice(begin_slice, end_slice) + str; begin_slice = i + 1; } if ($gvars.DEBUG && pos_arg_num >= 0 && seq_arg_num < args.length) { self.$raise($scope.get('ArgumentError'), "too many arguments for format string") } return result + format_string.slice(begin_slice); ; }, TMP_23.$$arity = -2); Opal.defn(self, '$hash', TMP_24 = function $$hash() { var self = this; return self.$__id__(); }, TMP_24.$$arity = 0); Opal.defn(self, '$initialize_copy', TMP_25 = function $$initialize_copy(other) { var self = this; return nil; }, TMP_25.$$arity = 1); Opal.defn(self, '$inspect', TMP_26 = function $$inspect() { var self = this; return self.$to_s(); }, TMP_26.$$arity = 0); Opal.defn(self, '$instance_of?', TMP_27 = function(klass) { var self = this; if (!klass.$$is_class && !klass.$$is_module) { self.$raise($scope.get('TypeError'), "class or module required"); } return self.$$class === klass; ; }, TMP_27.$$arity = 1); Opal.defn(self, '$instance_variable_defined?', TMP_28 = function(name) { var self = this; name = $scope.get('Opal')['$instance_variable_name!'](name); return Opal.hasOwnProperty.call(self, name.substr(1)); }, TMP_28.$$arity = 1); Opal.defn(self, '$instance_variable_get', TMP_29 = function $$instance_variable_get(name) { var self = this; name = $scope.get('Opal')['$instance_variable_name!'](name); var ivar = self[Opal.ivar(name.substr(1))]; return ivar == null ? nil : ivar; }, TMP_29.$$arity = 1); Opal.defn(self, '$instance_variable_set', TMP_30 = function $$instance_variable_set(name, value) { var self = this; name = $scope.get('Opal')['$instance_variable_name!'](name); return self[Opal.ivar(name.substr(1))] = value; }, TMP_30.$$arity = 2); Opal.defn(self, '$remove_instance_variable', TMP_31 = function $$remove_instance_variable(name) { var self = this; name = $scope.get('Opal')['$instance_variable_name!'](name); var key = Opal.ivar(name.substr(1)), val; if (self.hasOwnProperty(key)) { val = self[key]; delete self[key]; return val; } return self.$raise($scope.get('NameError'), "instance variable " + (name) + " not defined"); }, TMP_31.$$arity = 1); Opal.defn(self, '$instance_variables', TMP_32 = function $$instance_variables() { var self = this; var result = [], ivar; for (var name in self) { if (self.hasOwnProperty(name) && name.charAt(0) !== '$') { if (name.substr(-1) === '$') { ivar = name.slice(0, name.length - 1); } else { ivar = name; } result.push('@' + ivar); } } return result; }, TMP_32.$$arity = 0); Opal.defn(self, '$Integer', TMP_33 = function $$Integer(value, base) { var self = this; var i, str, base_digits; if (!value.$$is_string) { if (base !== undefined) { self.$raise($scope.get('ArgumentError'), "base specified for non string value") } if (value === nil) { self.$raise($scope.get('TypeError'), "can't convert nil into Integer") } if (value.$$is_number) { if (value === Infinity || value === -Infinity || isNaN(value)) { self.$raise($scope.get('FloatDomainError'), value) } return Math.floor(value); } if (value['$respond_to?']("to_int")) { i = value.$to_int(); if (i !== nil) { return i; } } return $scope.get('Opal')['$coerce_to!'](value, $scope.get('Integer'), "to_i"); } if (base === undefined) { base = 0; } else { base = $scope.get('Opal').$coerce_to(base, $scope.get('Integer'), "to_int"); if (base === 1 || base < 0 || base > 36) { self.$raise($scope.get('ArgumentError'), "invalid radix " + (base)) } } str = value.toLowerCase(); str = str.replace(/(\d)_(?=\d)/g, '$1'); str = str.replace(/^(\s*[+-]?)(0[bodx]?)/, function (_, head, flag) { switch (flag) { case '0b': if (base === 0 || base === 2) { base = 2; return head; } case '0': case '0o': if (base === 0 || base === 8) { base = 8; return head; } case '0d': if (base === 0 || base === 10) { base = 10; return head; } case '0x': if (base === 0 || base === 16) { base = 16; return head; } } self.$raise($scope.get('ArgumentError'), "invalid value for Integer(): \"" + (value) + "\"") }); base = (base === 0 ? 10 : base); base_digits = '0-' + (base <= 10 ? base - 1 : '9a-' + String.fromCharCode(97 + (base - 11))); if (!(new RegExp('^\\s*[+-]?[' + base_digits + ']+\\s*$')).test(str)) { self.$raise($scope.get('ArgumentError'), "invalid value for Integer(): \"" + (value) + "\"") } i = parseInt(str, base); if (isNaN(i)) { self.$raise($scope.get('ArgumentError'), "invalid value for Integer(): \"" + (value) + "\"") } return i; ; }, TMP_33.$$arity = -2); Opal.defn(self, '$Float', TMP_34 = function $$Float(value) { var self = this; var str; if (value === nil) { self.$raise($scope.get('TypeError'), "can't convert nil into Float") } if (value.$$is_string) { str = value.toString(); str = str.replace(/(\d)_(?=\d)/g, '$1'); //Special case for hex strings only: if (/^\s*[-+]?0[xX][0-9a-fA-F]+\s*$/.test(str)) { return self.$Integer(str); } if (!/^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$/.test(str)) { self.$raise($scope.get('ArgumentError'), "invalid value for Float(): \"" + (value) + "\"") } return parseFloat(str); } return $scope.get('Opal')['$coerce_to!'](value, $scope.get('Float'), "to_f"); }, TMP_34.$$arity = 1); Opal.defn(self, '$Hash', TMP_35 = function $$Hash(arg) { var $a, $b, self = this; if ((($a = ((($b = arg['$nil?']()) !== false && $b !== nil && $b != null) ? $b : arg['$==']([]))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $hash2([], {})}; if ((($a = $scope.get('Hash')['$==='](arg)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return arg}; return $scope.get('Opal')['$coerce_to!'](arg, $scope.get('Hash'), "to_hash"); }, TMP_35.$$arity = 1); Opal.defn(self, '$is_a?', TMP_36 = function(klass) { var self = this; if (!klass.$$is_class && !klass.$$is_module) { self.$raise($scope.get('TypeError'), "class or module required"); } return Opal.is_a(self, klass); ; }, TMP_36.$$arity = 1); Opal.alias(self, 'kind_of?', 'is_a?'); Opal.defn(self, '$lambda', TMP_37 = function $$lambda() { var self = this, $iter = TMP_37.$$p, block = $iter || nil; TMP_37.$$p = null; block.$$is_lambda = true; return block; }, TMP_37.$$arity = 0); Opal.defn(self, '$load', TMP_38 = function $$load(file) { var self = this; file = $scope.get('Opal')['$coerce_to!'](file, $scope.get('String'), "to_str"); return Opal.load(file); }, TMP_38.$$arity = 1); Opal.defn(self, '$loop', TMP_39 = function $$loop() { var self = this, $iter = TMP_39.$$p, $yield = $iter || nil; TMP_39.$$p = null; if (($yield !== nil)) { } else { return self.$enum_for("loop") }; while (true) { Opal.yieldX($yield, []) } ; return self; }, TMP_39.$$arity = 0); Opal.defn(self, '$nil?', TMP_40 = function() { var self = this; return false; }, TMP_40.$$arity = 0); Opal.alias(self, 'object_id', '__id__'); Opal.defn(self, '$printf', TMP_41 = function $$printf($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $rb_gt(args.$length(), 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$print(($b = self).$format.apply($b, Opal.to_a(args)))}; return nil; }, TMP_41.$$arity = -1); Opal.defn(self, '$proc', TMP_42 = function $$proc() { var self = this, $iter = TMP_42.$$p, block = $iter || nil; TMP_42.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to create Proc object without a block") }; block.$$is_lambda = false; return block; }, TMP_42.$$arity = 0); Opal.defn(self, '$puts', TMP_43 = function $$puts($a_rest) { var $b, self = this, strs; if ($gvars.stdout == null) $gvars.stdout = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } strs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { strs[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $gvars.stdout).$puts.apply($b, Opal.to_a(strs)); }, TMP_43.$$arity = -1); Opal.defn(self, '$p', TMP_45 = function $$p($a_rest) { var $b, $c, TMP_44, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } ($b = ($c = args).$each, $b.$$p = (TMP_44 = function(obj){var self = TMP_44.$$s || this; if ($gvars.stdout == null) $gvars.stdout = nil; if (obj == null) obj = nil; return $gvars.stdout.$puts(obj.$inspect())}, TMP_44.$$s = self, TMP_44.$$arity = 1, TMP_44), $b).call($c); if ((($b = $rb_le(args.$length(), 1)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return args['$[]'](0) } else { return args }; }, TMP_45.$$arity = -1); Opal.defn(self, '$print', TMP_46 = function $$print($a_rest) { var $b, self = this, strs; if ($gvars.stdout == null) $gvars.stdout = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } strs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { strs[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $gvars.stdout).$print.apply($b, Opal.to_a(strs)); }, TMP_46.$$arity = -1); Opal.defn(self, '$warn', TMP_47 = function $$warn($a_rest) { var $b, $c, self = this, strs; if ($gvars.VERBOSE == null) $gvars.VERBOSE = nil; if ($gvars.stderr == null) $gvars.stderr = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } strs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { strs[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = ((($c = $gvars.VERBOSE['$nil?']()) !== false && $c !== nil && $c != null) ? $c : strs['$empty?']())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return nil } else { return ($b = $gvars.stderr).$puts.apply($b, Opal.to_a(strs)) }; }, TMP_47.$$arity = -1); Opal.defn(self, '$raise', TMP_48 = function $$raise(exception, string, _backtrace) { var self = this; if ($gvars["!"] == null) $gvars["!"] = nil; if (string == null) { string = nil; } if (_backtrace == null) { _backtrace = nil; } if (exception == null && $gvars["!"] !== nil) { throw $gvars["!"]; } if (exception == null) { exception = $scope.get('RuntimeError').$new(); } else if (exception.$$is_string) { exception = $scope.get('RuntimeError').$new(exception); } // using respond_to? and not an undefined check to avoid method_missing matching as true else if (exception.$$is_class && exception['$respond_to?']("exception")) { exception = exception.$exception(string); } else if (exception['$kind_of?']($scope.get('Exception'))) { // exception is fine } else { exception = $scope.get('TypeError').$new("exception class/object expected"); } if ($gvars["!"] !== nil) { Opal.exceptions.push($gvars["!"]); } $gvars["!"] = exception; throw exception; ; }, TMP_48.$$arity = -1); Opal.alias(self, 'fail', 'raise'); Opal.defn(self, '$rand', TMP_49 = function $$rand(max) { var self = this; if (max === undefined) { return Math.random(); } else if (max.$$is_range) { var min = max.begin, range = max.end - min; if(!max.exclude) range++; return self.$rand(range) + min; } else { return Math.floor(Math.random() * Math.abs($scope.get('Opal').$coerce_to(max, $scope.get('Integer'), "to_int"))); } }, TMP_49.$$arity = -1); Opal.defn(self, '$respond_to?', TMP_50 = function(name, include_all) { var $a, self = this; if (include_all == null) { include_all = false; } if ((($a = self['$respond_to_missing?'](name, include_all)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; var body = self['$' + name]; if (typeof(body) === "function" && !body.$$stub) { return true; } return false; }, TMP_50.$$arity = -2); Opal.defn(self, '$respond_to_missing?', TMP_51 = function(method_name, include_all) { var self = this; if (include_all == null) { include_all = false; } return false; }, TMP_51.$$arity = -2); Opal.defn(self, '$require', TMP_52 = function $$require(file) { var self = this; file = $scope.get('Opal')['$coerce_to!'](file, $scope.get('String'), "to_str"); return Opal.require(file); }, TMP_52.$$arity = 1); Opal.defn(self, '$require_relative', TMP_53 = function $$require_relative(file) { var self = this; $scope.get('Opal')['$try_convert!'](file, $scope.get('String'), "to_str"); file = $scope.get('File').$expand_path($scope.get('File').$join(Opal.current_file, "..", file)); return Opal.require(file); }, TMP_53.$$arity = 1); Opal.defn(self, '$require_tree', TMP_54 = function $$require_tree(path) { var self = this; path = $scope.get('File').$expand_path(path); if (path['$=='](".")) { path = ""}; for (var name in Opal.modules) { if ((name)['$start_with?'](path)) { Opal.require(name); } } ; return nil; }, TMP_54.$$arity = 1); Opal.alias(self, 'send', '__send__'); Opal.alias(self, 'public_send', '__send__'); Opal.defn(self, '$singleton_class', TMP_55 = function $$singleton_class() { var self = this; return Opal.get_singleton_class(self); }, TMP_55.$$arity = 0); Opal.defn(self, '$sleep', TMP_56 = function $$sleep(seconds) { var self = this; if (seconds == null) { seconds = nil; } if (seconds === nil) { self.$raise($scope.get('TypeError'), "can't convert NilClass into time interval") } if (!seconds.$$is_number) { self.$raise($scope.get('TypeError'), "can't convert " + (seconds.$class()) + " into time interval") } if (seconds < 0) { self.$raise($scope.get('ArgumentError'), "time interval must be positive") } var t = new Date(); while (new Date() - t <= seconds * 1000); return seconds; ; }, TMP_56.$$arity = -1); Opal.alias(self, 'sprintf', 'format'); Opal.alias(self, 'srand', 'rand'); Opal.defn(self, '$String', TMP_57 = function $$String(str) { var $a, self = this; return ((($a = $scope.get('Opal')['$coerce_to?'](str, $scope.get('String'), "to_str")) !== false && $a !== nil && $a != null) ? $a : $scope.get('Opal')['$coerce_to!'](str, $scope.get('String'), "to_s")); }, TMP_57.$$arity = 1); Opal.defn(self, '$tap', TMP_58 = function $$tap() { var self = this, $iter = TMP_58.$$p, block = $iter || nil; TMP_58.$$p = null; Opal.yield1(block, self); return self; }, TMP_58.$$arity = 0); Opal.defn(self, '$to_proc', TMP_59 = function $$to_proc() { var self = this; return self; }, TMP_59.$$arity = 0); Opal.defn(self, '$to_s', TMP_60 = function $$to_s() { var self = this; return "#<" + (self.$class()) + ":0x" + (self.$__id__().$to_s(16)) + ">"; }, TMP_60.$$arity = 0); Opal.defn(self, '$catch', TMP_61 = function(sym) { var self = this, $iter = TMP_61.$$p, $yield = $iter || nil, e = nil; TMP_61.$$p = null; try { return Opal.yieldX($yield, []); } catch ($err) { if (Opal.rescue($err, [$scope.get('UncaughtThrowError')])) {e = $err; try { if (e.$sym()['$=='](sym)) { return e.$arg()}; return self.$raise(); } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_61.$$arity = 1); Opal.defn(self, '$throw', TMP_62 = function($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return self.$raise($scope.get('UncaughtThrowError').$new(args)); }, TMP_62.$$arity = -1); Opal.defn(self, '$open', TMP_63 = function $$open($a_rest) { var $b, $c, self = this, args, $iter = TMP_63.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_63.$$p = null; return ($b = ($c = $scope.get('File')).$open, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_63.$$arity = -1); })($scope.base); return (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope; return self.$include($scope.get('Kernel')) })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/error"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module; Opal.add_stubs(['$new', '$clone', '$to_s', '$empty?', '$class', '$attr_reader', '$[]', '$>', '$length', '$inspect']); (function($base, $super) { function $Exception(){}; var self = $Exception = $klass($base, $super, 'Exception', $Exception); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; def.message = nil; Opal.defs(self, '$new', TMP_1 = function($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } var message = (args.length > 0) ? args[0] : nil; var err = new self.$$alloc(message); if (Error.captureStackTrace) { Error.captureStackTrace(err); } err.name = self.$$name; err.$initialize.apply(err, args); return err; }, TMP_1.$$arity = -1); Opal.defs(self, '$exception', TMP_2 = function $$exception($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self).$new.apply($b, Opal.to_a(args)); }, TMP_2.$$arity = -1); Opal.defn(self, '$initialize', TMP_3 = function $$initialize($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return self.message = (args.length > 0) ? args[0] : nil; }, TMP_3.$$arity = -1); Opal.defn(self, '$backtrace', TMP_4 = function $$backtrace() { var self = this; var backtrace = self.stack; if (typeof(backtrace) === 'string') { return backtrace.split("\n").slice(0, 15); } else if (backtrace) { return backtrace.slice(0, 15); } return []; }, TMP_4.$$arity = 0); Opal.defn(self, '$exception', TMP_5 = function $$exception(str) { var self = this; if (str == null) { str = nil; } if (str === nil || self === str) { return self; } var cloned = self.$clone(); cloned.message = str; return cloned; }, TMP_5.$$arity = -1); Opal.defn(self, '$message', TMP_6 = function $$message() { var self = this; return self.$to_s(); }, TMP_6.$$arity = 0); Opal.defn(self, '$inspect', TMP_7 = function $$inspect() { var $a, self = this, as_str = nil; as_str = self.$to_s(); if ((($a = as_str['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$class().$to_s() } else { return "#<" + (self.$class().$to_s()) + ": " + (self.$to_s()) + ">" }; }, TMP_7.$$arity = 0); return (Opal.defn(self, '$to_s', TMP_8 = function $$to_s() { var $a, $b, self = this; return ((($a = (($b = self.message, $b !== false && $b !== nil && $b != null ?self.message.$to_s() : $b))) !== false && $a !== nil && $a != null) ? $a : self.$class().$to_s()); }, TMP_8.$$arity = 0), nil) && 'to_s'; })($scope.base, Error); (function($base, $super) { function $ScriptError(){}; var self = $ScriptError = $klass($base, $super, 'ScriptError', $ScriptError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $SyntaxError(){}; var self = $SyntaxError = $klass($base, $super, 'SyntaxError', $SyntaxError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('ScriptError')); (function($base, $super) { function $LoadError(){}; var self = $LoadError = $klass($base, $super, 'LoadError', $LoadError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('ScriptError')); (function($base, $super) { function $NotImplementedError(){}; var self = $NotImplementedError = $klass($base, $super, 'NotImplementedError', $NotImplementedError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('ScriptError')); (function($base, $super) { function $SystemExit(){}; var self = $SystemExit = $klass($base, $super, 'SystemExit', $SystemExit); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $NoMemoryError(){}; var self = $NoMemoryError = $klass($base, $super, 'NoMemoryError', $NoMemoryError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $SignalException(){}; var self = $SignalException = $klass($base, $super, 'SignalException', $SignalException); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $Interrupt(){}; var self = $Interrupt = $klass($base, $super, 'Interrupt', $Interrupt); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $SecurityError(){}; var self = $SecurityError = $klass($base, $super, 'SecurityError', $SecurityError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $StandardError(){}; var self = $StandardError = $klass($base, $super, 'StandardError', $StandardError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); (function($base, $super) { function $ZeroDivisionError(){}; var self = $ZeroDivisionError = $klass($base, $super, 'ZeroDivisionError', $ZeroDivisionError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $NameError(){}; var self = $NameError = $klass($base, $super, 'NameError', $NameError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $NoMethodError(){}; var self = $NoMethodError = $klass($base, $super, 'NoMethodError', $NoMethodError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('NameError')); (function($base, $super) { function $RuntimeError(){}; var self = $RuntimeError = $klass($base, $super, 'RuntimeError', $RuntimeError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $LocalJumpError(){}; var self = $LocalJumpError = $klass($base, $super, 'LocalJumpError', $LocalJumpError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $TypeError(){}; var self = $TypeError = $klass($base, $super, 'TypeError', $TypeError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $ArgumentError(){}; var self = $ArgumentError = $klass($base, $super, 'ArgumentError', $ArgumentError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $IndexError(){}; var self = $IndexError = $klass($base, $super, 'IndexError', $IndexError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $StopIteration(){}; var self = $StopIteration = $klass($base, $super, 'StopIteration', $StopIteration); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('IndexError')); (function($base, $super) { function $KeyError(){}; var self = $KeyError = $klass($base, $super, 'KeyError', $KeyError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('IndexError')); (function($base, $super) { function $RangeError(){}; var self = $RangeError = $klass($base, $super, 'RangeError', $RangeError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $FloatDomainError(){}; var self = $FloatDomainError = $klass($base, $super, 'FloatDomainError', $FloatDomainError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('RangeError')); (function($base, $super) { function $IOError(){}; var self = $IOError = $klass($base, $super, 'IOError', $IOError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $SystemCallError(){}; var self = $SystemCallError = $klass($base, $super, 'SystemCallError', $SystemCallError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base) { var $Errno, self = $Errno = $module($base, 'Errno'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $EINVAL(){}; var self = $EINVAL = $klass($base, $super, 'EINVAL', $EINVAL); var def = self.$$proto, $scope = self.$$scope, TMP_9; return (Opal.defs(self, '$new', TMP_9 = function() { var $a, $b, self = this, $iter = TMP_9.$$p, $yield = $iter || nil; TMP_9.$$p = null; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_9, false, $EINVAL)), $a.$$p = null, $a).call($b, "Invalid argument"); }, TMP_9.$$arity = 0), nil) && 'new' })($scope.base, $scope.get('SystemCallError')) })($scope.base); (function($base, $super) { function $UncaughtThrowError(){}; var self = $UncaughtThrowError = $klass($base, $super, 'UncaughtThrowError', $UncaughtThrowError); var def = self.$$proto, $scope = self.$$scope, TMP_10; def.sym = nil; self.$attr_reader("sym", "arg"); return (Opal.defn(self, '$initialize', TMP_10 = function $$initialize(args) { var $a, $b, self = this, $iter = TMP_10.$$p, $yield = $iter || nil; TMP_10.$$p = null; self.sym = args['$[]'](0); if ((($a = $rb_gt(args.$length(), 1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.arg = args['$[]'](1)}; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_10, false)), $a.$$p = null, $a).call($b, "uncaught throw " + (self.sym.$inspect())); }, TMP_10.$$arity = 1), nil) && 'initialize'; })($scope.base, $scope.get('ArgumentError')); (function($base, $super) { function $NameError(){}; var self = $NameError = $klass($base, $super, 'NameError', $NameError); var def = self.$$proto, $scope = self.$$scope, TMP_11; self.$attr_reader("name"); return (Opal.defn(self, '$initialize', TMP_11 = function $$initialize(message, name) { var $a, $b, self = this, $iter = TMP_11.$$p, $yield = $iter || nil; if (name == null) { name = nil; } TMP_11.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_11, false)), $a.$$p = null, $a).call($b, message); return self.name = name; }, TMP_11.$$arity = -2), nil) && 'initialize'; })($scope.base, null); return (function($base, $super) { function $NoMethodError(){}; var self = $NoMethodError = $klass($base, $super, 'NoMethodError', $NoMethodError); var def = self.$$proto, $scope = self.$$scope, TMP_12; self.$attr_reader("args"); return (Opal.defn(self, '$initialize', TMP_12 = function $$initialize(message, name, args) { var $a, $b, self = this, $iter = TMP_12.$$p, $yield = $iter || nil; if (name == null) { name = nil; } if (args == null) { args = []; } TMP_12.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_12, false)), $a.$$p = null, $a).call($b, message, name); return self.args = args; }, TMP_12.$$arity = -2), nil) && 'initialize'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/constants"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.cdecl($scope, 'RUBY_PLATFORM', "opal"); Opal.cdecl($scope, 'RUBY_ENGINE', "opal"); Opal.cdecl($scope, 'RUBY_VERSION', "2.2.5"); Opal.cdecl($scope, 'RUBY_ENGINE_VERSION', "0.10.3"); Opal.cdecl($scope, 'RUBY_RELEASE_DATE', "2016-10-31"); Opal.cdecl($scope, 'RUBY_PATCHLEVEL', 0); Opal.cdecl($scope, 'RUBY_REVISION', 0); Opal.cdecl($scope, 'RUBY_COPYRIGHT', "opal - Copyright (C) 2013-2015 Adam Beynon"); return Opal.cdecl($scope, 'RUBY_DESCRIPTION', "opal " + ($scope.get('RUBY_ENGINE_VERSION')) + " (" + ($scope.get('RUBY_RELEASE_DATE')) + " revision " + ($scope.get('RUBY_REVISION')) + ")"); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/base"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("corelib/runtime"); self.$require("corelib/helpers"); self.$require("corelib/module"); self.$require("corelib/class"); self.$require("corelib/basic_object"); self.$require("corelib/kernel"); self.$require("corelib/error"); return self.$require("corelib/constants"); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/nil"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$raise', '$class', '$new', '$>', '$length', '$Rational']); (function($base, $super) { function $NilClass(){}; var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18; def.$$meta = self; Opal.defn(self, '$!', TMP_1 = function() { var self = this; return true; }, TMP_1.$$arity = 0); Opal.defn(self, '$&', TMP_2 = function(other) { var self = this; return false; }, TMP_2.$$arity = 1); Opal.defn(self, '$|', TMP_3 = function(other) { var self = this; return other !== false && other !== nil; }, TMP_3.$$arity = 1); Opal.defn(self, '$^', TMP_4 = function(other) { var self = this; return other !== false && other !== nil; }, TMP_4.$$arity = 1); Opal.defn(self, '$==', TMP_5 = function(other) { var self = this; return other === nil; }, TMP_5.$$arity = 1); Opal.defn(self, '$dup', TMP_6 = function $$dup() { var self = this; return self.$raise($scope.get('TypeError'), "can't dup " + (self.$class())); }, TMP_6.$$arity = 0); Opal.defn(self, '$clone', TMP_7 = function $$clone() { var self = this; return self.$raise($scope.get('TypeError'), "can't clone " + (self.$class())); }, TMP_7.$$arity = 0); Opal.defn(self, '$inspect', TMP_8 = function $$inspect() { var self = this; return "nil"; }, TMP_8.$$arity = 0); Opal.defn(self, '$nil?', TMP_9 = function() { var self = this; return true; }, TMP_9.$$arity = 0); Opal.defn(self, '$singleton_class', TMP_10 = function $$singleton_class() { var self = this; return $scope.get('NilClass'); }, TMP_10.$$arity = 0); Opal.defn(self, '$to_a', TMP_11 = function $$to_a() { var self = this; return []; }, TMP_11.$$arity = 0); Opal.defn(self, '$to_h', TMP_12 = function $$to_h() { var self = this; return Opal.hash(); }, TMP_12.$$arity = 0); Opal.defn(self, '$to_i', TMP_13 = function $$to_i() { var self = this; return 0; }, TMP_13.$$arity = 0); Opal.alias(self, 'to_f', 'to_i'); Opal.defn(self, '$to_s', TMP_14 = function $$to_s() { var self = this; return ""; }, TMP_14.$$arity = 0); Opal.defn(self, '$to_c', TMP_15 = function $$to_c() { var self = this; return $scope.get('Complex').$new(0, 0); }, TMP_15.$$arity = 0); Opal.defn(self, '$rationalize', TMP_16 = function $$rationalize($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $rb_gt(args.$length(), 1)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('ArgumentError'))}; return self.$Rational(0, 1); }, TMP_16.$$arity = -1); Opal.defn(self, '$to_r', TMP_17 = function $$to_r() { var self = this; return self.$Rational(0, 1); }, TMP_17.$$arity = 0); return (Opal.defn(self, '$instance_variables', TMP_18 = function $$instance_variables() { var self = this; return []; }, TMP_18.$$arity = 0), nil) && 'instance_variables'; })($scope.base, null); return Opal.cdecl($scope, 'NIL', nil); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/boolean"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$raise', '$class']); (function($base, $super) { function $Boolean(){}; var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10; def.$$is_boolean = true; def.$$meta = self; Opal.defn(self, '$__id__', TMP_1 = function $$__id__() { var self = this; return self.valueOf() ? 2 : 0; }, TMP_1.$$arity = 0); Opal.alias(self, 'object_id', '__id__'); Opal.defn(self, '$!', TMP_2 = function() { var self = this; return self != true; }, TMP_2.$$arity = 0); Opal.defn(self, '$&', TMP_3 = function(other) { var self = this; return (self == true) ? (other !== false && other !== nil) : false; }, TMP_3.$$arity = 1); Opal.defn(self, '$|', TMP_4 = function(other) { var self = this; return (self == true) ? true : (other !== false && other !== nil); }, TMP_4.$$arity = 1); Opal.defn(self, '$^', TMP_5 = function(other) { var self = this; return (self == true) ? (other === false || other === nil) : (other !== false && other !== nil); }, TMP_5.$$arity = 1); Opal.defn(self, '$==', TMP_6 = function(other) { var self = this; return (self == true) === other.valueOf(); }, TMP_6.$$arity = 1); Opal.alias(self, 'equal?', '=='); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$singleton_class', TMP_7 = function $$singleton_class() { var self = this; return $scope.get('Boolean'); }, TMP_7.$$arity = 0); Opal.defn(self, '$to_s', TMP_8 = function $$to_s() { var self = this; return (self == true) ? 'true' : 'false'; }, TMP_8.$$arity = 0); Opal.defn(self, '$dup', TMP_9 = function $$dup() { var self = this; return self.$raise($scope.get('TypeError'), "can't dup " + (self.$class())); }, TMP_9.$$arity = 0); return (Opal.defn(self, '$clone', TMP_10 = function $$clone() { var self = this; return self.$raise($scope.get('TypeError'), "can't clone " + (self.$class())); }, TMP_10.$$arity = 0), nil) && 'clone'; })($scope.base, Boolean); Opal.cdecl($scope, 'TrueClass', $scope.get('Boolean')); Opal.cdecl($scope, 'FalseClass', $scope.get('Boolean')); Opal.cdecl($scope, 'TRUE', true); return Opal.cdecl($scope, 'FALSE', false); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/comparable"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$===', '$>', '$<', '$equal?', '$<=>', '$normalize', '$raise', '$class']); return (function($base) { var $Comparable, self = $Comparable = $module($base, 'Comparable'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; Opal.defs(self, '$normalize', TMP_1 = function $$normalize(what) { var $a, self = this; if ((($a = $scope.get('Integer')['$==='](what)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return what}; if ((($a = $rb_gt(what, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 1}; if ((($a = $rb_lt(what, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return -1}; return 0; }, TMP_1.$$arity = 1); Opal.defn(self, '$==', TMP_2 = function(other) { var $a, self = this, cmp = nil; try { if ((($a = self['$equal?'](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if (self["$<=>"] == Opal.Kernel["$<=>"]) { return false; } // check for infinite recursion if (self.$$comparable) { delete self.$$comparable; return false; } if ((($a = cmp = (self['$<=>'](other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; return $scope.get('Comparable').$normalize(cmp) == 0; } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return false } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_2.$$arity = 1); Opal.defn(self, '$>', TMP_3 = function(other) { var $a, self = this, cmp = nil; if ((($a = cmp = (self['$<=>'](other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed") }; return $scope.get('Comparable').$normalize(cmp) > 0; }, TMP_3.$$arity = 1); Opal.defn(self, '$>=', TMP_4 = function(other) { var $a, self = this, cmp = nil; if ((($a = cmp = (self['$<=>'](other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed") }; return $scope.get('Comparable').$normalize(cmp) >= 0; }, TMP_4.$$arity = 1); Opal.defn(self, '$<', TMP_5 = function(other) { var $a, self = this, cmp = nil; if ((($a = cmp = (self['$<=>'](other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed") }; return $scope.get('Comparable').$normalize(cmp) < 0; }, TMP_5.$$arity = 1); Opal.defn(self, '$<=', TMP_6 = function(other) { var $a, self = this, cmp = nil; if ((($a = cmp = (self['$<=>'](other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed") }; return $scope.get('Comparable').$normalize(cmp) <= 0; }, TMP_6.$$arity = 1); Opal.defn(self, '$between?', TMP_7 = function(min, max) { var self = this; if ($rb_lt(self, min)) { return false}; if ($rb_gt(self, max)) { return false}; return true; }, TMP_7.$$arity = 2); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/regexp"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$nil?', '$[]', '$raise', '$escape', '$options', '$to_str', '$new', '$join', '$coerce_to!', '$!', '$match', '$coerce_to?', '$begin', '$coerce_to', '$call', '$=~', '$attr_reader', '$===', '$inspect', '$to_a']); (function($base, $super) { function $RegexpError(){}; var self = $RegexpError = $klass($base, $super, 'RegexpError', $RegexpError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $Regexp(){}; var self = $Regexp = $klass($base, $super, 'Regexp', $Regexp); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15; Opal.cdecl($scope, 'IGNORECASE', 1); Opal.cdecl($scope, 'MULTILINE', 4); def.$$is_regexp = true; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; Opal.defn(self, '$allocate', TMP_1 = function $$allocate() { var $a, $b, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, allocated = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } allocated = ($a = ($b = self, Opal.find_super_dispatcher(self, 'allocate', TMP_1, false)), $a.$$p = $iter, $a).apply($b, $zuper); allocated.uninitialized = true; return allocated; }, TMP_1.$$arity = 0); Opal.defn(self, '$escape', TMP_2 = function $$escape(string) { var self = this; return string.replace(/([-[\]\/{}()*+?.^$\\| ])/g, '\\$1') .replace(/[\n]/g, '\\n') .replace(/[\r]/g, '\\r') .replace(/[\f]/g, '\\f') .replace(/[\t]/g, '\\t'); }, TMP_2.$$arity = 1); Opal.defn(self, '$last_match', TMP_3 = function $$last_match(n) { var $a, self = this; if ($gvars["~"] == null) $gvars["~"] = nil; if (n == null) { n = nil; } if ((($a = n['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $gvars["~"] } else { return $gvars["~"]['$[]'](n) }; }, TMP_3.$$arity = -1); Opal.alias(self, 'quote', 'escape'); Opal.defn(self, '$union', TMP_4 = function $$union($a_rest) { var self = this, parts; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } parts = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { parts[$arg_idx - 0] = arguments[$arg_idx]; } var is_first_part_array, quoted_validated, part, options, each_part_options; if (parts.length == 0) { return /(?!)/; } // cover the 2 arrays passed as arguments case is_first_part_array = parts[0].$$is_array; if (parts.length > 1 && is_first_part_array) { self.$raise($scope.get('TypeError'), "no implicit conversion of Array into String") } // deal with splat issues (related to https://github.com/opal/opal/issues/858) if (is_first_part_array) { parts = parts[0]; } options = undefined; quoted_validated = []; for (var i=0; i < parts.length; i++) { part = parts[i]; if (part.$$is_string) { quoted_validated.push(self.$escape(part)); } else if (part.$$is_regexp) { each_part_options = (part).$options(); if (options != undefined && options != each_part_options) { self.$raise($scope.get('TypeError'), "All expressions must use the same options") } options = each_part_options; quoted_validated.push('('+part.source+')'); } else { quoted_validated.push(self.$escape((part).$to_str())); } } return self.$new((quoted_validated).$join("|"), options); }, TMP_4.$$arity = -1); return (Opal.defn(self, '$new', TMP_5 = function(regexp, options) { var self = this; if (regexp.$$is_regexp) { return new RegExp(regexp); } regexp = $scope.get('Opal')['$coerce_to!'](regexp, $scope.get('String'), "to_str"); if (regexp.charAt(regexp.length - 1) === '\\' && regexp.charAt(regexp.length - 2) !== '\\') { self.$raise($scope.get('RegexpError'), "too short escape sequence: /" + (regexp) + "/") } if (options === undefined || options['$!']()) { return new RegExp(regexp); } if (options.$$is_number) { var temp = ''; if ($scope.get('IGNORECASE') & options) { temp += 'i'; } if ($scope.get('MULTILINE') & options) { temp += 'm'; } options = temp; } else { options = 'i'; } return new RegExp(regexp, options); ; }, TMP_5.$$arity = -2), nil) && 'new'; })(Opal.get_singleton_class(self)); Opal.defn(self, '$==', TMP_6 = function(other) { var self = this; return other.constructor == RegExp && self.toString() === other.toString(); }, TMP_6.$$arity = 1); Opal.defn(self, '$===', TMP_7 = function(string) { var self = this; return self.$match($scope.get('Opal')['$coerce_to?'](string, $scope.get('String'), "to_str")) !== nil; }, TMP_7.$$arity = 1); Opal.defn(self, '$=~', TMP_8 = function(string) { var $a, self = this; if ($gvars["~"] == null) $gvars["~"] = nil; return ($a = self.$match(string), $a !== false && $a !== nil && $a != null ?$gvars["~"].$begin(0) : $a); }, TMP_8.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$inspect', TMP_9 = function $$inspect() { var self = this; return self.toString(); }, TMP_9.$$arity = 0); Opal.defn(self, '$match', TMP_10 = function $$match(string, pos) { var self = this, $iter = TMP_10.$$p, block = $iter || nil; if ($gvars["~"] == null) $gvars["~"] = nil; TMP_10.$$p = null; if (self.uninitialized) { self.$raise($scope.get('TypeError'), "uninitialized Regexp") } if (pos === undefined) { pos = 0; } else { pos = $scope.get('Opal').$coerce_to(pos, $scope.get('Integer'), "to_int"); } if (string === nil) { return $gvars["~"] = nil; } string = $scope.get('Opal').$coerce_to(string, $scope.get('String'), "to_str"); if (pos < 0) { pos += string.length; if (pos < 0) { return $gvars["~"] = nil; } } var source = self.source; var flags = 'g'; // m flag + a . in Ruby will match white space, but in JS, it only matches beginning/ending of lines, so we get the equivalent here if (self.multiline) { source = source.replace('.', "[\\s\\S]"); flags += 'm'; } // global RegExp maintains state, so not using self/this var md, re = new RegExp(source, flags + (self.ignoreCase ? 'i' : '')); while (true) { md = re.exec(string); if (md === null) { return $gvars["~"] = nil; } if (md.index >= pos) { $gvars["~"] = $scope.get('MatchData').$new(re, md) return block === nil ? $gvars["~"] : block.$call($gvars["~"]); } re.lastIndex = md.index + 1; } ; }, TMP_10.$$arity = -2); Opal.defn(self, '$~', TMP_11 = function() { var self = this; if ($gvars._ == null) $gvars._ = nil; return self['$=~']($gvars._); }, TMP_11.$$arity = 0); Opal.defn(self, '$source', TMP_12 = function $$source() { var self = this; return self.source; }, TMP_12.$$arity = 0); Opal.defn(self, '$options', TMP_13 = function $$options() { var self = this; if (self.uninitialized) { self.$raise($scope.get('TypeError'), "uninitialized Regexp") } var result = 0; // should be supported in IE6 according to https://msdn.microsoft.com/en-us/library/7f5z26w4(v=vs.94).aspx if (self.multiline) { result |= $scope.get('MULTILINE'); } if (self.ignoreCase) { result |= $scope.get('IGNORECASE'); } return result; ; }, TMP_13.$$arity = 0); Opal.defn(self, '$casefold?', TMP_14 = function() { var self = this; return self.ignoreCase; }, TMP_14.$$arity = 0); Opal.alias(self, 'to_s', 'source'); return (Opal.defs(self, '$_load', TMP_15 = function $$_load(args) { var $a, self = this; return ($a = self).$new.apply($a, Opal.to_a(args)); }, TMP_15.$$arity = 1), nil) && '_load'; })($scope.base, RegExp); return (function($base, $super) { function $MatchData(){}; var self = $MatchData = $klass($base, $super, 'MatchData', $MatchData); var def = self.$$proto, $scope = self.$$scope, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27; def.matches = nil; self.$attr_reader("post_match", "pre_match", "regexp", "string"); Opal.defn(self, '$initialize', TMP_16 = function $$initialize(regexp, match_groups) { var self = this; $gvars["~"] = self; self.regexp = regexp; self.begin = match_groups.index; self.string = match_groups.input; self.pre_match = match_groups.input.slice(0, match_groups.index); self.post_match = match_groups.input.slice(match_groups.index + match_groups[0].length); self.matches = []; for (var i = 0, length = match_groups.length; i < length; i++) { var group = match_groups[i]; if (group == null) { self.matches.push(nil); } else { self.matches.push(group); } } }, TMP_16.$$arity = 2); Opal.defn(self, '$[]', TMP_17 = function($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self.matches)['$[]'].apply($b, Opal.to_a(args)); }, TMP_17.$$arity = -1); Opal.defn(self, '$offset', TMP_18 = function $$offset(n) { var self = this; if (n !== 0) { self.$raise($scope.get('ArgumentError'), "MatchData#offset only supports 0th element") } return [self.begin, self.begin + self.matches[n].length]; ; }, TMP_18.$$arity = 1); Opal.defn(self, '$==', TMP_19 = function(other) { var $a, $b, $c, $d, self = this; if ((($a = $scope.get('MatchData')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; return ($a = ($b = ($c = ($d = self.string == other.string, $d !== false && $d !== nil && $d != null ?self.regexp.toString() == other.regexp.toString() : $d), $c !== false && $c !== nil && $c != null ?self.pre_match == other.pre_match : $c), $b !== false && $b !== nil && $b != null ?self.post_match == other.post_match : $b), $a !== false && $a !== nil && $a != null ?self.begin == other.begin : $a); }, TMP_19.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$begin', TMP_20 = function $$begin(n) { var self = this; if (n !== 0) { self.$raise($scope.get('ArgumentError'), "MatchData#begin only supports 0th element") } return self.begin; ; }, TMP_20.$$arity = 1); Opal.defn(self, '$end', TMP_21 = function $$end(n) { var self = this; if (n !== 0) { self.$raise($scope.get('ArgumentError'), "MatchData#end only supports 0th element") } return self.begin + self.matches[n].length; ; }, TMP_21.$$arity = 1); Opal.defn(self, '$captures', TMP_22 = function $$captures() { var self = this; return self.matches.slice(1); }, TMP_22.$$arity = 0); Opal.defn(self, '$inspect', TMP_23 = function $$inspect() { var self = this; var str = "#"; ; }, TMP_23.$$arity = 0); Opal.defn(self, '$length', TMP_24 = function $$length() { var self = this; return self.matches.length; }, TMP_24.$$arity = 0); Opal.alias(self, 'size', 'length'); Opal.defn(self, '$to_a', TMP_25 = function $$to_a() { var self = this; return self.matches; }, TMP_25.$$arity = 0); Opal.defn(self, '$to_s', TMP_26 = function $$to_s() { var self = this; return self.matches[0]; }, TMP_26.$$arity = 0); return (Opal.defn(self, '$values_at', TMP_27 = function $$values_at($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } var i, a, index, values = []; for (i = 0; i < args.length; i++) { if (args[i].$$is_range) { a = (args[i]).$to_a(); a.unshift(i, 1); Array.prototype.splice.apply(args, a); } index = $scope.get('Opal')['$coerce_to!'](args[i], $scope.get('Integer'), "to_int"); if (index < 0) { index += self.matches.length; if (index < 0) { values.push(nil); continue; } } values.push(self.matches[index]); } return values; }, TMP_27.$$arity = -1), nil) && 'values_at'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/string"] = function(Opal) { function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$include', '$coerce_to?', '$coerce_to', '$raise', '$===', '$format', '$to_s', '$respond_to?', '$to_str', '$<=>', '$==', '$=~', '$new', '$empty?', '$ljust', '$ceil', '$/', '$+', '$rjust', '$floor', '$to_a', '$each_char', '$to_proc', '$coerce_to!', '$copy_singleton_methods', '$initialize_clone', '$initialize_dup', '$enum_for', '$size', '$chomp', '$[]', '$to_i', '$each_line', '$class', '$match', '$captures', '$proc', '$shift', '$__send__', '$succ', '$escape']); self.$require("corelib/comparable"); self.$require("corelib/regexp"); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51, TMP_52, TMP_53, TMP_54, TMP_55, TMP_56, TMP_57, TMP_58, TMP_59, TMP_61, TMP_62, TMP_63, TMP_64, TMP_65, TMP_66, TMP_67, TMP_68; def.length = nil; self.$include($scope.get('Comparable')); def.$$is_string = true; Opal.defn(self, '$__id__', TMP_1 = function $$__id__() { var self = this; return self.toString(); }, TMP_1.$$arity = 0); Opal.alias(self, 'object_id', '__id__'); Opal.defs(self, '$try_convert', TMP_2 = function $$try_convert(what) { var self = this; return $scope.get('Opal')['$coerce_to?'](what, $scope.get('String'), "to_str"); }, TMP_2.$$arity = 1); Opal.defs(self, '$new', TMP_3 = function(str) { var self = this; if (str == null) { str = ""; } str = $scope.get('Opal').$coerce_to(str, $scope.get('String'), "to_str"); return new String(str); }, TMP_3.$$arity = -1); Opal.defn(self, '$initialize', TMP_4 = function $$initialize(str) { var self = this; if (str === undefined) { return self; } return self.$raise($scope.get('NotImplementedError'), "Mutable strings are not supported in Opal."); }, TMP_4.$$arity = -1); Opal.defn(self, '$%', TMP_5 = function(data) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](data)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = self).$format.apply($a, [self].concat(Opal.to_a(data))) } else { return self.$format(self, data) }; }, TMP_5.$$arity = 1); Opal.defn(self, '$*', TMP_6 = function(count) { var self = this; count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); if (count < 0) { self.$raise($scope.get('ArgumentError'), "negative argument") } if (count === 0) { return ''; } var result = '', string = self.toString(); // All credit for the bit-twiddling magic code below goes to Mozilla // polyfill implementation of String.prototype.repeat() posted here: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat if (string.length * count >= 1 << 28) { self.$raise($scope.get('RangeError'), "multiply count must not overflow maximum string size") } for (;;) { if ((count & 1) === 1) { result += string; } count >>>= 1; if (count === 0) { break; } string += string; } return result; ; }, TMP_6.$$arity = 1); Opal.defn(self, '$+', TMP_7 = function(other) { var self = this; other = $scope.get('Opal').$coerce_to(other, $scope.get('String'), "to_str"); return self + other.$to_s(); }, TMP_7.$$arity = 1); Opal.defn(self, '$<=>', TMP_8 = function(other) { var $a, self = this; if ((($a = other['$respond_to?']("to_str")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_str().$to_s(); return self > other ? 1 : (self < other ? -1 : 0); } else { var cmp = other['$<=>'](self); if (cmp === nil) { return nil; } else { return cmp > 0 ? -1 : (cmp < 0 ? 1 : 0); } ; }; }, TMP_8.$$arity = 1); Opal.defn(self, '$==', TMP_9 = function(other) { var self = this; if (other.$$is_string) { return self.toString() === other.toString(); } if ($scope.get('Opal')['$respond_to?'](other, "to_str")) { return other['$=='](self); } return false; ; }, TMP_9.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.alias(self, '===', '=='); Opal.defn(self, '$=~', TMP_10 = function(other) { var self = this; if (other.$$is_string) { self.$raise($scope.get('TypeError'), "type mismatch: String given"); } return other['$=~'](self); ; }, TMP_10.$$arity = 1); Opal.defn(self, '$[]', TMP_11 = function(index, length) { var self = this; var size = self.length, exclude; if (index.$$is_range) { exclude = index.exclude; length = $scope.get('Opal').$coerce_to(index.end, $scope.get('Integer'), "to_int"); index = $scope.get('Opal').$coerce_to(index.begin, $scope.get('Integer'), "to_int"); if (Math.abs(index) > size) { return nil; } if (index < 0) { index += size; } if (length < 0) { length += size; } if (!exclude) { length += 1; } length = length - index; if (length < 0) { length = 0; } return self.substr(index, length); } if (index.$$is_string) { if (length != null) { self.$raise($scope.get('TypeError')) } return self.indexOf(index) !== -1 ? index : nil; } if (index.$$is_regexp) { var match = self.match(index); if (match === null) { $gvars["~"] = nil return nil; } $gvars["~"] = $scope.get('MatchData').$new(index, match) if (length == null) { return match[0]; } length = $scope.get('Opal').$coerce_to(length, $scope.get('Integer'), "to_int"); if (length < 0 && -length < match.length) { return match[length += match.length]; } if (length >= 0 && length < match.length) { return match[length]; } return nil; } index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (index < 0) { index += size; } if (length == null) { if (index >= size || index < 0) { return nil; } return self.substr(index, 1); } length = $scope.get('Opal').$coerce_to(length, $scope.get('Integer'), "to_int"); if (length < 0) { return nil; } if (index > size || index < 0) { return nil; } return self.substr(index, length); }, TMP_11.$$arity = -2); Opal.alias(self, 'byteslice', '[]'); Opal.defn(self, '$capitalize', TMP_12 = function $$capitalize() { var self = this; return self.charAt(0).toUpperCase() + self.substr(1).toLowerCase(); }, TMP_12.$$arity = 0); Opal.defn(self, '$casecmp', TMP_13 = function $$casecmp(other) { var self = this; other = $scope.get('Opal').$coerce_to(other, $scope.get('String'), "to_str").$to_s(); var ascii_only = /^[\x00-\x7F]*$/; if (ascii_only.test(self) && ascii_only.test(other)) { self = self.toLowerCase(); other = other.toLowerCase(); } return self['$<=>'](other); }, TMP_13.$$arity = 1); Opal.defn(self, '$center', TMP_14 = function $$center(width, padstr) { var $a, self = this; if (padstr == null) { padstr = " "; } width = $scope.get('Opal').$coerce_to(width, $scope.get('Integer'), "to_int"); padstr = $scope.get('Opal').$coerce_to(padstr, $scope.get('String'), "to_str").$to_s(); if ((($a = padstr['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "zero width padding")}; if ((($a = width <= self.length) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; var ljustified = self.$ljust($rb_divide(($rb_plus(width, self.length)), 2).$ceil(), padstr), rjustified = self.$rjust($rb_divide(($rb_plus(width, self.length)), 2).$floor(), padstr); return rjustified + ljustified.slice(self.length); ; }, TMP_14.$$arity = -2); Opal.defn(self, '$chars', TMP_15 = function $$chars() { var $a, $b, self = this, $iter = TMP_15.$$p, block = $iter || nil; TMP_15.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$each_char().$to_a() }; return ($a = ($b = self).$each_char, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_15.$$arity = 0); Opal.defn(self, '$chomp', TMP_16 = function $$chomp(separator) { var $a, self = this; if ($gvars["/"] == null) $gvars["/"] = nil; if (separator == null) { separator = $gvars["/"]; } if ((($a = separator === nil || self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; separator = $scope.get('Opal')['$coerce_to!'](separator, $scope.get('String'), "to_str").$to_s(); if (separator === "\n") { return self.replace(/\r?\n?$/, ''); } else if (separator === "") { return self.replace(/(\r?\n)+$/, ''); } else if (self.length > separator.length) { var tail = self.substr(self.length - separator.length, separator.length); if (tail === separator) { return self.substr(0, self.length - separator.length); } } return self; }, TMP_16.$$arity = -1); Opal.defn(self, '$chop', TMP_17 = function $$chop() { var self = this; var length = self.length; if (length <= 1) { return ""; } if (self.charAt(length - 1) === "\n" && self.charAt(length - 2) === "\r") { return self.substr(0, length - 2); } else { return self.substr(0, length - 1); } }, TMP_17.$$arity = 0); Opal.defn(self, '$chr', TMP_18 = function $$chr() { var self = this; return self.charAt(0); }, TMP_18.$$arity = 0); Opal.defn(self, '$clone', TMP_19 = function $$clone() { var self = this, copy = nil; copy = self.slice(); copy.$copy_singleton_methods(self); copy.$initialize_clone(self); return copy; }, TMP_19.$$arity = 0); Opal.defn(self, '$dup', TMP_20 = function $$dup() { var self = this, copy = nil; copy = self.slice(); copy.$initialize_dup(self); return copy; }, TMP_20.$$arity = 0); Opal.defn(self, '$count', TMP_21 = function $$count($a_rest) { var self = this, sets; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } sets = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { sets[$arg_idx - 0] = arguments[$arg_idx]; } if (sets.length === 0) { self.$raise($scope.get('ArgumentError'), "ArgumentError: wrong number of arguments (0 for 1+)") } var char_class = char_class_from_char_sets(sets); if (char_class === null) { return 0; } return self.length - self.replace(new RegExp(char_class, 'g'), '').length; ; }, TMP_21.$$arity = -1); Opal.defn(self, '$delete', TMP_22 = function($a_rest) { var self = this, sets; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } sets = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { sets[$arg_idx - 0] = arguments[$arg_idx]; } if (sets.length === 0) { self.$raise($scope.get('ArgumentError'), "ArgumentError: wrong number of arguments (0 for 1+)") } var char_class = char_class_from_char_sets(sets); if (char_class === null) { return self; } return self.replace(new RegExp(char_class, 'g'), ''); ; }, TMP_22.$$arity = -1); Opal.defn(self, '$downcase', TMP_23 = function $$downcase() { var self = this; return self.toLowerCase(); }, TMP_23.$$arity = 0); Opal.defn(self, '$each_char', TMP_24 = function $$each_char() { var $a, $b, TMP_25, self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_25 = function(){var self = TMP_25.$$s || this; return self.$size()}, TMP_25.$$s = self, TMP_25.$$arity = 0, TMP_25), $a).call($b, "each_char") }; for (var i = 0, length = self.length; i < length; i++) { Opal.yield1(block, self.charAt(i)); } return self; }, TMP_24.$$arity = 0); Opal.defn(self, '$each_line', TMP_26 = function $$each_line(separator) { var self = this, $iter = TMP_26.$$p, block = $iter || nil; if ($gvars["/"] == null) $gvars["/"] = nil; if (separator == null) { separator = $gvars["/"]; } TMP_26.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("each_line", separator) }; if (separator === nil) { Opal.yield1(block, self); return self; } separator = $scope.get('Opal').$coerce_to(separator, $scope.get('String'), "to_str") var a, i, n, length, chomped, trailing, splitted; if (separator.length === 0) { for (a = self.split(/(\n{2,})/), i = 0, n = a.length; i < n; i += 2) { if (a[i] || a[i + 1]) { Opal.yield1(block, (a[i] || "") + (a[i + 1] || "")); } } return self; } chomped = self.$chomp(separator); trailing = self.length != chomped.length; splitted = chomped.split(separator); for (i = 0, length = splitted.length; i < length; i++) { if (i < length - 1 || trailing) { Opal.yield1(block, splitted[i] + separator); } else { Opal.yield1(block, splitted[i]); } } return self; }, TMP_26.$$arity = -1); Opal.defn(self, '$empty?', TMP_27 = function() { var self = this; return self.length === 0; }, TMP_27.$$arity = 0); Opal.defn(self, '$end_with?', TMP_28 = function($a_rest) { var self = this, suffixes; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } suffixes = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { suffixes[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = 0, length = suffixes.length; i < length; i++) { var suffix = $scope.get('Opal').$coerce_to(suffixes[i], $scope.get('String'), "to_str").$to_s(); if (self.length >= suffix.length && self.substr(self.length - suffix.length, suffix.length) == suffix) { return true; } } return false; }, TMP_28.$$arity = -1); Opal.alias(self, 'eql?', '=='); Opal.alias(self, 'equal?', '==='); Opal.defn(self, '$gsub', TMP_29 = function $$gsub(pattern, replacement) { var self = this, $iter = TMP_29.$$p, block = $iter || nil; TMP_29.$$p = null; if (replacement === undefined && block === nil) { return self.$enum_for("gsub", pattern); } var result = '', match_data = nil, index = 0, match, _replacement; if (pattern.$$is_regexp) { pattern = new RegExp(pattern.source, 'gm' + (pattern.ignoreCase ? 'i' : '')); } else { pattern = $scope.get('Opal').$coerce_to(pattern, $scope.get('String'), "to_str"); pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gm'); } while (true) { match = pattern.exec(self); if (match === null) { $gvars["~"] = nil result += self.slice(index); break; } match_data = $scope.get('MatchData').$new(pattern, match); if (replacement === undefined) { _replacement = block(match[0]); } else if (replacement.$$is_hash) { _replacement = (replacement)['$[]'](match[0]).$to_s(); } else { if (!replacement.$$is_string) { replacement = $scope.get('Opal').$coerce_to(replacement, $scope.get('String'), "to_str"); } _replacement = replacement.replace(/([\\]+)([0-9+&`'])/g, function (original, slashes, command) { if (slashes.length % 2 === 0) { return original; } switch (command) { case "+": for (var i = match.length - 1; i > 0; i--) { if (match[i] !== undefined) { return slashes.slice(1) + match[i]; } } return ''; case "&": return slashes.slice(1) + match[0]; case "`": return slashes.slice(1) + self.slice(0, match.index); case "'": return slashes.slice(1) + self.slice(match.index + match[0].length); default: return slashes.slice(1) + (match[command] || ''); } }).replace(/\\\\/g, '\\'); } if (pattern.lastIndex === match.index) { result += (_replacement + self.slice(index, match.index + 1)) pattern.lastIndex += 1; } else { result += (self.slice(index, match.index) + _replacement) } index = pattern.lastIndex; } $gvars["~"] = match_data return result; ; }, TMP_29.$$arity = -2); Opal.defn(self, '$hash', TMP_30 = function $$hash() { var self = this; return self.toString(); }, TMP_30.$$arity = 0); Opal.defn(self, '$hex', TMP_31 = function $$hex() { var self = this; return self.$to_i(16); }, TMP_31.$$arity = 0); Opal.defn(self, '$include?', TMP_32 = function(other) { var self = this; if (!other.$$is_string) { other = $scope.get('Opal').$coerce_to(other, $scope.get('String'), "to_str") } return self.indexOf(other) !== -1; ; }, TMP_32.$$arity = 1); Opal.defn(self, '$index', TMP_33 = function $$index(search, offset) { var self = this; var index, match, regex; if (offset === undefined) { offset = 0; } else { offset = $scope.get('Opal').$coerce_to(offset, $scope.get('Integer'), "to_int"); if (offset < 0) { offset += self.length; if (offset < 0) { return nil; } } } if (search.$$is_regexp) { regex = new RegExp(search.source, 'gm' + (search.ignoreCase ? 'i' : '')); while (true) { match = regex.exec(self); if (match === null) { $gvars["~"] = nil; index = -1; break; } if (match.index >= offset) { $gvars["~"] = $scope.get('MatchData').$new(regex, match) index = match.index; break; } regex.lastIndex = match.index + 1; } } else { search = $scope.get('Opal').$coerce_to(search, $scope.get('String'), "to_str"); if (search.length === 0 && offset > self.length) { index = -1; } else { index = self.indexOf(search, offset); } } return index === -1 ? nil : index; }, TMP_33.$$arity = -2); Opal.defn(self, '$inspect', TMP_34 = function $$inspect() { var self = this; var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, meta = { '\u0007': '\\a', '\u001b': '\\e', '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\v': '\\v', '"' : '\\"', '\\': '\\\\' }, escaped = self.replace(escapable, function (chr) { return meta[chr] || '\\u' + ('0000' + chr.charCodeAt(0).toString(16).toUpperCase()).slice(-4); }); return '"' + escaped.replace(/\#[\$\@\{]/g, '\\$&') + '"'; }, TMP_34.$$arity = 0); Opal.defn(self, '$intern', TMP_35 = function $$intern() { var self = this; return self; }, TMP_35.$$arity = 0); Opal.defn(self, '$lines', TMP_36 = function $$lines(separator) { var $a, $b, self = this, $iter = TMP_36.$$p, block = $iter || nil, e = nil; if ($gvars["/"] == null) $gvars["/"] = nil; if (separator == null) { separator = $gvars["/"]; } TMP_36.$$p = null; e = ($a = ($b = self).$each_line, $a.$$p = block.$to_proc(), $a).call($b, separator); if (block !== false && block !== nil && block != null) { return self } else { return e.$to_a() }; }, TMP_36.$$arity = -1); Opal.defn(self, '$length', TMP_37 = function $$length() { var self = this; return self.length; }, TMP_37.$$arity = 0); Opal.defn(self, '$ljust', TMP_38 = function $$ljust(width, padstr) { var $a, self = this; if (padstr == null) { padstr = " "; } width = $scope.get('Opal').$coerce_to(width, $scope.get('Integer'), "to_int"); padstr = $scope.get('Opal').$coerce_to(padstr, $scope.get('String'), "to_str").$to_s(); if ((($a = padstr['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "zero width padding")}; if ((($a = width <= self.length) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; var index = -1, result = ""; width -= self.length; while (++index < width) { result += padstr; } return self + result.slice(0, width); }, TMP_38.$$arity = -2); Opal.defn(self, '$lstrip', TMP_39 = function $$lstrip() { var self = this; return self.replace(/^\s*/, ''); }, TMP_39.$$arity = 0); Opal.defn(self, '$match', TMP_40 = function $$match(pattern, pos) { var $a, $b, self = this, $iter = TMP_40.$$p, block = $iter || nil; TMP_40.$$p = null; if ((($a = ((($b = $scope.get('String')['$==='](pattern)) !== false && $b !== nil && $b != null) ? $b : pattern['$respond_to?']("to_str"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { pattern = $scope.get('Regexp').$new(pattern.$to_str())}; if ((($a = $scope.get('Regexp')['$==='](pattern)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "wrong argument type " + (pattern.$class()) + " (expected Regexp)") }; return ($a = ($b = pattern).$match, $a.$$p = block.$to_proc(), $a).call($b, self, pos); }, TMP_40.$$arity = -2); Opal.defn(self, '$next', TMP_41 = function $$next() { var self = this; var i = self.length; if (i === 0) { return ''; } var result = self; var first_alphanum_char_index = self.search(/[a-zA-Z0-9]/); var carry = false; var code; while (i--) { code = self.charCodeAt(i); if ((code >= 48 && code <= 57) || (code >= 65 && code <= 90) || (code >= 97 && code <= 122)) { switch (code) { case 57: carry = true; code = 48; break; case 90: carry = true; code = 65; break; case 122: carry = true; code = 97; break; default: carry = false; code += 1; } } else { if (first_alphanum_char_index === -1) { if (code === 255) { carry = true; code = 0; } else { carry = false; code += 1; } } else { carry = true; } } result = result.slice(0, i) + String.fromCharCode(code) + result.slice(i + 1); if (carry && (i === 0 || i === first_alphanum_char_index)) { switch (code) { case 65: break; case 97: break; default: code += 1; } if (i === 0) { result = String.fromCharCode(code) + result; } else { result = result.slice(0, i) + String.fromCharCode(code) + result.slice(i); } carry = false; } if (!carry) { break; } } return result; }, TMP_41.$$arity = 0); Opal.defn(self, '$oct', TMP_42 = function $$oct() { var self = this; var result, string = self, radix = 8; if (/^\s*_/.test(string)) { return 0; } string = string.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/i, function (original, head, flag, tail) { switch (tail.charAt(0)) { case '+': case '-': return original; case '0': if (tail.charAt(1) === 'x' && flag === '0x') { return original; } } switch (flag) { case '0b': radix = 2; break; case '0': case '0o': radix = 8; break; case '0d': radix = 10; break; case '0x': radix = 16; break; } return head + tail; }); result = parseInt(string.replace(/_(?!_)/g, ''), radix); return isNaN(result) ? 0 : result; }, TMP_42.$$arity = 0); Opal.defn(self, '$ord', TMP_43 = function $$ord() { var self = this; return self.charCodeAt(0); }, TMP_43.$$arity = 0); Opal.defn(self, '$partition', TMP_44 = function $$partition(sep) { var self = this; var i, m; if (sep.$$is_regexp) { m = sep.exec(self); if (m === null) { i = -1; } else { $scope.get('MatchData').$new(sep, m); sep = m[0]; i = m.index; } } else { sep = $scope.get('Opal').$coerce_to(sep, $scope.get('String'), "to_str"); i = self.indexOf(sep); } if (i === -1) { return [self, '', '']; } return [ self.slice(0, i), self.slice(i, i + sep.length), self.slice(i + sep.length) ]; }, TMP_44.$$arity = 1); Opal.defn(self, '$reverse', TMP_45 = function $$reverse() { var self = this; return self.split('').reverse().join(''); }, TMP_45.$$arity = 0); Opal.defn(self, '$rindex', TMP_46 = function $$rindex(search, offset) { var self = this; var i, m, r, _m; if (offset === undefined) { offset = self.length; } else { offset = $scope.get('Opal').$coerce_to(offset, $scope.get('Integer'), "to_int"); if (offset < 0) { offset += self.length; if (offset < 0) { return nil; } } } if (search.$$is_regexp) { m = null; r = new RegExp(search.source, 'gm' + (search.ignoreCase ? 'i' : '')); while (true) { _m = r.exec(self); if (_m === null || _m.index > offset) { break; } m = _m; r.lastIndex = m.index + 1; } if (m === null) { $gvars["~"] = nil i = -1; } else { $scope.get('MatchData').$new(r, m); i = m.index; } } else { search = $scope.get('Opal').$coerce_to(search, $scope.get('String'), "to_str"); i = self.lastIndexOf(search, offset); } return i === -1 ? nil : i; }, TMP_46.$$arity = -2); Opal.defn(self, '$rjust', TMP_47 = function $$rjust(width, padstr) { var $a, self = this; if (padstr == null) { padstr = " "; } width = $scope.get('Opal').$coerce_to(width, $scope.get('Integer'), "to_int"); padstr = $scope.get('Opal').$coerce_to(padstr, $scope.get('String'), "to_str").$to_s(); if ((($a = padstr['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "zero width padding")}; if ((($a = width <= self.length) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; var chars = Math.floor(width - self.length), patterns = Math.floor(chars / padstr.length), result = Array(patterns + 1).join(padstr), remaining = chars - result.length; return result + padstr.slice(0, remaining) + self; }, TMP_47.$$arity = -2); Opal.defn(self, '$rpartition', TMP_48 = function $$rpartition(sep) { var self = this; var i, m, r, _m; if (sep.$$is_regexp) { m = null; r = new RegExp(sep.source, 'gm' + (sep.ignoreCase ? 'i' : '')); while (true) { _m = r.exec(self); if (_m === null) { break; } m = _m; r.lastIndex = m.index + 1; } if (m === null) { i = -1; } else { $scope.get('MatchData').$new(r, m); sep = m[0]; i = m.index; } } else { sep = $scope.get('Opal').$coerce_to(sep, $scope.get('String'), "to_str"); i = self.lastIndexOf(sep); } if (i === -1) { return ['', '', self]; } return [ self.slice(0, i), self.slice(i, i + sep.length), self.slice(i + sep.length) ]; }, TMP_48.$$arity = 1); Opal.defn(self, '$rstrip', TMP_49 = function $$rstrip() { var self = this; return self.replace(/[\s\u0000]*$/, ''); }, TMP_49.$$arity = 0); Opal.defn(self, '$scan', TMP_50 = function $$scan(pattern) { var self = this, $iter = TMP_50.$$p, block = $iter || nil; TMP_50.$$p = null; var result = [], match_data = nil, match; if (pattern.$$is_regexp) { pattern = new RegExp(pattern.source, 'gm' + (pattern.ignoreCase ? 'i' : '')); } else { pattern = $scope.get('Opal').$coerce_to(pattern, $scope.get('String'), "to_str"); pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gm'); } while ((match = pattern.exec(self)) != null) { match_data = $scope.get('MatchData').$new(pattern, match); if (block === nil) { match.length == 1 ? result.push(match[0]) : result.push((match_data).$captures()); } else { match.length == 1 ? block(match[0]) : block.call(self, (match_data).$captures()); } if (pattern.lastIndex === match.index) { pattern.lastIndex += 1; } } $gvars["~"] = match_data return (block !== nil ? self : result); }, TMP_50.$$arity = 1); Opal.alias(self, 'size', 'length'); Opal.alias(self, 'slice', '[]'); Opal.defn(self, '$split', TMP_51 = function $$split(pattern, limit) { var $a, self = this; if ($gvars[";"] == null) $gvars[";"] = nil; if (self.length === 0) { return []; } if (limit === undefined) { limit = 0; } else { limit = $scope.get('Opal')['$coerce_to!'](limit, $scope.get('Integer'), "to_int"); if (limit === 1) { return [self]; } } if (pattern === undefined || pattern === nil) { pattern = ((($a = $gvars[";"]) !== false && $a !== nil && $a != null) ? $a : " "); } var result = [], string = self.toString(), index = 0, match, i; if (pattern.$$is_regexp) { pattern = new RegExp(pattern.source, 'gm' + (pattern.ignoreCase ? 'i' : '')); } else { pattern = $scope.get('Opal').$coerce_to(pattern, $scope.get('String'), "to_str").$to_s(); if (pattern === ' ') { pattern = /\s+/gm; string = string.replace(/^\s+/, ''); } else { pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gm'); } } result = string.split(pattern); if (result.length === 1 && result[0] === string) { return result; } while ((i = result.indexOf(undefined)) !== -1) { result.splice(i, 1); } if (limit === 0) { while (result[result.length - 1] === '') { result.length -= 1; } return result; } match = pattern.exec(string); if (limit < 0) { if (match !== null && match[0] === '' && pattern.source.indexOf('(?=') === -1) { for (i = 0; i < match.length; i++) { result.push(''); } } return result; } if (match !== null && match[0] === '') { result.splice(limit - 1, result.length - 1, result.slice(limit - 1).join('')); return result; } if (limit >= result.length) { return result; } i = 0; while (match !== null) { i++; index = pattern.lastIndex; if (i + 1 === limit) { break; } match = pattern.exec(string); } result.splice(limit - 1, result.length - 1, string.slice(index)); return result; }, TMP_51.$$arity = -1); Opal.defn(self, '$squeeze', TMP_52 = function $$squeeze($a_rest) { var self = this, sets; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } sets = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { sets[$arg_idx - 0] = arguments[$arg_idx]; } if (sets.length === 0) { return self.replace(/(.)\1+/g, '$1'); } var char_class = char_class_from_char_sets(sets); if (char_class === null) { return self; } return self.replace(new RegExp('(' + char_class + ')\\1+', 'g'), '$1'); }, TMP_52.$$arity = -1); Opal.defn(self, '$start_with?', TMP_53 = function($a_rest) { var self = this, prefixes; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } prefixes = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { prefixes[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = 0, length = prefixes.length; i < length; i++) { var prefix = $scope.get('Opal').$coerce_to(prefixes[i], $scope.get('String'), "to_str").$to_s(); if (self.indexOf(prefix) === 0) { return true; } } return false; }, TMP_53.$$arity = -1); Opal.defn(self, '$strip', TMP_54 = function $$strip() { var self = this; return self.replace(/^\s*/, '').replace(/[\s\u0000]*$/, ''); }, TMP_54.$$arity = 0); Opal.defn(self, '$sub', TMP_55 = function $$sub(pattern, replacement) { var self = this, $iter = TMP_55.$$p, block = $iter || nil; TMP_55.$$p = null; if (!pattern.$$is_regexp) { pattern = $scope.get('Opal').$coerce_to(pattern, $scope.get('String'), "to_str"); pattern = new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); } var result = pattern.exec(self); if (result === null) { $gvars["~"] = nil return self.toString(); } $scope.get('MatchData').$new(pattern, result) if (replacement === undefined) { if (block === nil) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (1 for 2)") } return self.slice(0, result.index) + block(result[0]) + self.slice(result.index + result[0].length); } if (replacement.$$is_hash) { return self.slice(0, result.index) + (replacement)['$[]'](result[0]).$to_s() + self.slice(result.index + result[0].length); } replacement = $scope.get('Opal').$coerce_to(replacement, $scope.get('String'), "to_str"); replacement = replacement.replace(/([\\]+)([0-9+&`'])/g, function (original, slashes, command) { if (slashes.length % 2 === 0) { return original; } switch (command) { case "+": for (var i = result.length - 1; i > 0; i--) { if (result[i] !== undefined) { return slashes.slice(1) + result[i]; } } return ''; case "&": return slashes.slice(1) + result[0]; case "`": return slashes.slice(1) + self.slice(0, result.index); case "'": return slashes.slice(1) + self.slice(result.index + result[0].length); default: return slashes.slice(1) + (result[command] || ''); } }).replace(/\\\\/g, '\\'); return self.slice(0, result.index) + replacement + self.slice(result.index + result[0].length); ; }, TMP_55.$$arity = -2); Opal.alias(self, 'succ', 'next'); Opal.defn(self, '$sum', TMP_56 = function $$sum(n) { var self = this; if (n == null) { n = 16; } n = $scope.get('Opal').$coerce_to(n, $scope.get('Integer'), "to_int"); var result = 0, length = self.length, i = 0; for (; i < length; i++) { result += self.charCodeAt(i); } if (n <= 0) { return result; } return result & (Math.pow(2, n) - 1); ; }, TMP_56.$$arity = -1); Opal.defn(self, '$swapcase', TMP_57 = function $$swapcase() { var self = this; var str = self.replace(/([a-z]+)|([A-Z]+)/g, function($0,$1,$2) { return $1 ? $0.toUpperCase() : $0.toLowerCase(); }); if (self.constructor === String) { return str; } return self.$class().$new(str); }, TMP_57.$$arity = 0); Opal.defn(self, '$to_f', TMP_58 = function $$to_f() { var self = this; if (self.charAt(0) === '_') { return 0; } var result = parseFloat(self.replace(/_/g, '')); if (isNaN(result) || result == Infinity || result == -Infinity) { return 0; } else { return result; } }, TMP_58.$$arity = 0); Opal.defn(self, '$to_i', TMP_59 = function $$to_i(base) { var self = this; if (base == null) { base = 10; } var result, string = self.toLowerCase(), radix = $scope.get('Opal').$coerce_to(base, $scope.get('Integer'), "to_int"); if (radix === 1 || radix < 0 || radix > 36) { self.$raise($scope.get('ArgumentError'), "invalid radix " + (radix)) } if (/^\s*_/.test(string)) { return 0; } string = string.replace(/^(\s*[+-]?)(0[bodx]?)(.+)$/, function (original, head, flag, tail) { switch (tail.charAt(0)) { case '+': case '-': return original; case '0': if (tail.charAt(1) === 'x' && flag === '0x' && (radix === 0 || radix === 16)) { return original; } } switch (flag) { case '0b': if (radix === 0 || radix === 2) { radix = 2; return head + tail; } break; case '0': case '0o': if (radix === 0 || radix === 8) { radix = 8; return head + tail; } break; case '0d': if (radix === 0 || radix === 10) { radix = 10; return head + tail; } break; case '0x': if (radix === 0 || radix === 16) { radix = 16; return head + tail; } break; } return original }); result = parseInt(string.replace(/_(?!_)/g, ''), radix); return isNaN(result) ? 0 : result; ; }, TMP_59.$$arity = -1); Opal.defn(self, '$to_proc', TMP_61 = function $$to_proc() { var $a, $b, TMP_60, self = this, sym = nil; sym = self; return ($a = ($b = self).$proc, $a.$$p = (TMP_60 = function($c_rest){var self = TMP_60.$$s || this, block, args, $d, $e, obj = nil; block = TMP_60.$$p || nil, TMP_60.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($d = args['$empty?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { self.$raise($scope.get('ArgumentError'), "no receiver given")}; obj = args.$shift(); return ($d = ($e = obj).$__send__, $d.$$p = block.$to_proc(), $d).apply($e, [sym].concat(Opal.to_a(args)));}, TMP_60.$$s = self, TMP_60.$$arity = -1, TMP_60), $a).call($b); }, TMP_61.$$arity = 0); Opal.defn(self, '$to_s', TMP_62 = function $$to_s() { var self = this; return self.toString(); }, TMP_62.$$arity = 0); Opal.alias(self, 'to_str', 'to_s'); Opal.alias(self, 'to_sym', 'intern'); Opal.defn(self, '$tr', TMP_63 = function $$tr(from, to) { var self = this; from = $scope.get('Opal').$coerce_to(from, $scope.get('String'), "to_str").$to_s(); to = $scope.get('Opal').$coerce_to(to, $scope.get('String'), "to_str").$to_s(); if (from.length == 0 || from === to) { return self; } var i, in_range, c, ch, start, end, length; var subs = {}; var from_chars = from.split(''); var from_length = from_chars.length; var to_chars = to.split(''); var to_length = to_chars.length; var inverse = false; var global_sub = null; if (from_chars[0] === '^' && from_chars.length > 1) { inverse = true; from_chars.shift(); global_sub = to_chars[to_length - 1] from_length -= 1; } var from_chars_expanded = []; var last_from = null; in_range = false; for (i = 0; i < from_length; i++) { ch = from_chars[i]; if (last_from == null) { last_from = ch; from_chars_expanded.push(ch); } else if (ch === '-') { if (last_from === '-') { from_chars_expanded.push('-'); from_chars_expanded.push('-'); } else if (i == from_length - 1) { from_chars_expanded.push('-'); } else { in_range = true; } } else if (in_range) { start = last_from.charCodeAt(0); end = ch.charCodeAt(0); if (start > end) { self.$raise($scope.get('ArgumentError'), "invalid range \"" + (String.fromCharCode(start)) + "-" + (String.fromCharCode(end)) + "\" in string transliteration") } for (c = start + 1; c < end; c++) { from_chars_expanded.push(String.fromCharCode(c)); } from_chars_expanded.push(ch); in_range = null; last_from = null; } else { from_chars_expanded.push(ch); } } from_chars = from_chars_expanded; from_length = from_chars.length; if (inverse) { for (i = 0; i < from_length; i++) { subs[from_chars[i]] = true; } } else { if (to_length > 0) { var to_chars_expanded = []; var last_to = null; in_range = false; for (i = 0; i < to_length; i++) { ch = to_chars[i]; if (last_to == null) { last_to = ch; to_chars_expanded.push(ch); } else if (ch === '-') { if (last_to === '-') { to_chars_expanded.push('-'); to_chars_expanded.push('-'); } else if (i == to_length - 1) { to_chars_expanded.push('-'); } else { in_range = true; } } else if (in_range) { start = last_to.charCodeAt(0); end = ch.charCodeAt(0); if (start > end) { self.$raise($scope.get('ArgumentError'), "invalid range \"" + (String.fromCharCode(start)) + "-" + (String.fromCharCode(end)) + "\" in string transliteration") } for (c = start + 1; c < end; c++) { to_chars_expanded.push(String.fromCharCode(c)); } to_chars_expanded.push(ch); in_range = null; last_to = null; } else { to_chars_expanded.push(ch); } } to_chars = to_chars_expanded; to_length = to_chars.length; } var length_diff = from_length - to_length; if (length_diff > 0) { var pad_char = (to_length > 0 ? to_chars[to_length - 1] : ''); for (i = 0; i < length_diff; i++) { to_chars.push(pad_char); } } for (i = 0; i < from_length; i++) { subs[from_chars[i]] = to_chars[i]; } } var new_str = '' for (i = 0, length = self.length; i < length; i++) { ch = self.charAt(i); var sub = subs[ch]; if (inverse) { new_str += (sub == null ? global_sub : ch); } else { new_str += (sub != null ? sub : ch); } } return new_str; }, TMP_63.$$arity = 2); Opal.defn(self, '$tr_s', TMP_64 = function $$tr_s(from, to) { var self = this; from = $scope.get('Opal').$coerce_to(from, $scope.get('String'), "to_str").$to_s(); to = $scope.get('Opal').$coerce_to(to, $scope.get('String'), "to_str").$to_s(); if (from.length == 0) { return self; } var i, in_range, c, ch, start, end, length; var subs = {}; var from_chars = from.split(''); var from_length = from_chars.length; var to_chars = to.split(''); var to_length = to_chars.length; var inverse = false; var global_sub = null; if (from_chars[0] === '^' && from_chars.length > 1) { inverse = true; from_chars.shift(); global_sub = to_chars[to_length - 1] from_length -= 1; } var from_chars_expanded = []; var last_from = null; in_range = false; for (i = 0; i < from_length; i++) { ch = from_chars[i]; if (last_from == null) { last_from = ch; from_chars_expanded.push(ch); } else if (ch === '-') { if (last_from === '-') { from_chars_expanded.push('-'); from_chars_expanded.push('-'); } else if (i == from_length - 1) { from_chars_expanded.push('-'); } else { in_range = true; } } else if (in_range) { start = last_from.charCodeAt(0); end = ch.charCodeAt(0); if (start > end) { self.$raise($scope.get('ArgumentError'), "invalid range \"" + (String.fromCharCode(start)) + "-" + (String.fromCharCode(end)) + "\" in string transliteration") } for (c = start + 1; c < end; c++) { from_chars_expanded.push(String.fromCharCode(c)); } from_chars_expanded.push(ch); in_range = null; last_from = null; } else { from_chars_expanded.push(ch); } } from_chars = from_chars_expanded; from_length = from_chars.length; if (inverse) { for (i = 0; i < from_length; i++) { subs[from_chars[i]] = true; } } else { if (to_length > 0) { var to_chars_expanded = []; var last_to = null; in_range = false; for (i = 0; i < to_length; i++) { ch = to_chars[i]; if (last_from == null) { last_from = ch; to_chars_expanded.push(ch); } else if (ch === '-') { if (last_to === '-') { to_chars_expanded.push('-'); to_chars_expanded.push('-'); } else if (i == to_length - 1) { to_chars_expanded.push('-'); } else { in_range = true; } } else if (in_range) { start = last_from.charCodeAt(0); end = ch.charCodeAt(0); if (start > end) { self.$raise($scope.get('ArgumentError'), "invalid range \"" + (String.fromCharCode(start)) + "-" + (String.fromCharCode(end)) + "\" in string transliteration") } for (c = start + 1; c < end; c++) { to_chars_expanded.push(String.fromCharCode(c)); } to_chars_expanded.push(ch); in_range = null; last_from = null; } else { to_chars_expanded.push(ch); } } to_chars = to_chars_expanded; to_length = to_chars.length; } var length_diff = from_length - to_length; if (length_diff > 0) { var pad_char = (to_length > 0 ? to_chars[to_length - 1] : ''); for (i = 0; i < length_diff; i++) { to_chars.push(pad_char); } } for (i = 0; i < from_length; i++) { subs[from_chars[i]] = to_chars[i]; } } var new_str = '' var last_substitute = null for (i = 0, length = self.length; i < length; i++) { ch = self.charAt(i); var sub = subs[ch] if (inverse) { if (sub == null) { if (last_substitute == null) { new_str += global_sub; last_substitute = true; } } else { new_str += ch; last_substitute = null; } } else { if (sub != null) { if (last_substitute == null || last_substitute !== sub) { new_str += sub; last_substitute = sub; } } else { new_str += ch; last_substitute = null; } } } return new_str; }, TMP_64.$$arity = 2); Opal.defn(self, '$upcase', TMP_65 = function $$upcase() { var self = this; return self.toUpperCase(); }, TMP_65.$$arity = 0); Opal.defn(self, '$upto', TMP_66 = function $$upto(stop, excl) { var self = this, $iter = TMP_66.$$p, block = $iter || nil; if (excl == null) { excl = false; } TMP_66.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("upto", stop, excl) }; stop = $scope.get('Opal').$coerce_to(stop, $scope.get('String'), "to_str"); var a, b, s = self.toString(); if (s.length === 1 && stop.length === 1) { a = s.charCodeAt(0); b = stop.charCodeAt(0); while (a <= b) { if (excl && a === b) { break; } block(String.fromCharCode(a)); a += 1; } } else if (parseInt(s, 10).toString() === s && parseInt(stop, 10).toString() === stop) { a = parseInt(s, 10); b = parseInt(stop, 10); while (a <= b) { if (excl && a === b) { break; } block(a.toString()); a += 1; } } else { while (s.length <= stop.length && s <= stop) { if (excl && s === stop) { break; } block(s); s = (s).$succ(); } } return self; }, TMP_66.$$arity = -2); function char_class_from_char_sets(sets) { function explode_sequences_in_character_set(set) { var result = '', i, len = set.length, curr_char, skip_next_dash, char_code_from, char_code_upto, char_code; for (i = 0; i < len; i++) { curr_char = set.charAt(i); if (curr_char === '-' && i > 0 && i < (len - 1) && !skip_next_dash) { char_code_from = set.charCodeAt(i - 1); char_code_upto = set.charCodeAt(i + 1); if (char_code_from > char_code_upto) { self.$raise($scope.get('ArgumentError'), "invalid range \"" + (char_code_from) + "-" + (char_code_upto) + "\" in string transliteration") } for (char_code = char_code_from + 1; char_code < char_code_upto + 1; char_code++) { result += String.fromCharCode(char_code); } skip_next_dash = true; i++; } else { skip_next_dash = (curr_char === '\\'); result += curr_char; } } return result; } function intersection(setA, setB) { if (setA.length === 0) { return setB; } var result = '', i, len = setA.length, chr; for (i = 0; i < len; i++) { chr = setA.charAt(i); if (setB.indexOf(chr) !== -1) { result += chr; } } return result; } var i, len, set, neg, chr, tmp, pos_intersection = '', neg_intersection = ''; for (i = 0, len = sets.length; i < len; i++) { set = $scope.get('Opal').$coerce_to(sets[i], $scope.get('String'), "to_str"); neg = (set.charAt(0) === '^' && set.length > 1); set = explode_sequences_in_character_set(neg ? set.slice(1) : set); if (neg) { neg_intersection = intersection(neg_intersection, set); } else { pos_intersection = intersection(pos_intersection, set); } } if (pos_intersection.length > 0 && neg_intersection.length > 0) { tmp = ''; for (i = 0, len = pos_intersection.length; i < len; i++) { chr = pos_intersection.charAt(i); if (neg_intersection.indexOf(chr) === -1) { tmp += chr; } } pos_intersection = tmp; neg_intersection = ''; } if (pos_intersection.length > 0) { return '[' + $scope.get('Regexp').$escape(pos_intersection) + ']'; } if (neg_intersection.length > 0) { return '[^' + $scope.get('Regexp').$escape(neg_intersection) + ']'; } return null; } Opal.defn(self, '$instance_variables', TMP_67 = function $$instance_variables() { var self = this; return []; }, TMP_67.$$arity = 0); return (Opal.defs(self, '$_load', TMP_68 = function $$_load($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self).$new.apply($b, Opal.to_a(args)); }, TMP_68.$$arity = -1), nil) && '_load'; })($scope.base, String); return Opal.cdecl($scope, 'Symbol', $scope.get('String')); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/enumerable"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$each', '$destructure', '$raise', '$new', '$yield', '$dup', '$enum_for', '$enumerator_size', '$flatten', '$map', '$proc', '$==', '$nil?', '$respond_to?', '$coerce_to!', '$>', '$*', '$coerce_to', '$try_convert', '$<', '$+', '$-', '$to_enum', '$ceil', '$/', '$size', '$===', '$<<', '$[]', '$[]=', '$inspect', '$__send__', '$<=>', '$first', '$reverse', '$sort', '$to_proc', '$compare', '$call', '$to_a', '$lambda', '$sort!', '$map!', '$zip']); return (function($base) { var $Enumerable, self = $Enumerable = $module($base, 'Enumerable'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_4, TMP_7, TMP_10, TMP_12, TMP_15, TMP_19, TMP_21, TMP_23, TMP_24, TMP_25, TMP_27, TMP_29, TMP_31, TMP_33, TMP_35, TMP_36, TMP_38, TMP_43, TMP_44, TMP_45, TMP_48, TMP_49, TMP_51, TMP_52, TMP_53, TMP_54, TMP_56, TMP_57, TMP_59, TMP_61, TMP_62, TMP_65, TMP_68, TMP_70, TMP_72, TMP_74, TMP_76, TMP_78, TMP_83, TMP_84, TMP_86; Opal.defn(self, '$all?', TMP_1 = function() {try { var $a, $b, TMP_2, $c, TMP_3, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; if ((block !== nil)) { ($a = ($b = self).$each, $a.$$p = (TMP_2 = function($c_rest){var self = TMP_2.$$s || this, value, $d; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($d = Opal.yieldX(block, Opal.to_a(value))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return nil } else { Opal.ret(false) }}, TMP_2.$$s = self, TMP_2.$$arity = -1, TMP_2), $a).call($b) } else { ($a = ($c = self).$each, $a.$$p = (TMP_3 = function($d_rest){var self = TMP_3.$$s || this, value, $e; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($e = $scope.get('Opal').$destructure(value)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { return nil } else { Opal.ret(false) }}, TMP_3.$$s = self, TMP_3.$$arity = -1, TMP_3), $a).call($c) }; return true; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_1.$$arity = 0); Opal.defn(self, '$any?', TMP_4 = function() {try { var $a, $b, TMP_5, $c, TMP_6, self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; if ((block !== nil)) { ($a = ($b = self).$each, $a.$$p = (TMP_5 = function($c_rest){var self = TMP_5.$$s || this, value, $d; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($d = Opal.yieldX(block, Opal.to_a(value))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { Opal.ret(true) } else { return nil }}, TMP_5.$$s = self, TMP_5.$$arity = -1, TMP_5), $a).call($b) } else { ($a = ($c = self).$each, $a.$$p = (TMP_6 = function($d_rest){var self = TMP_6.$$s || this, value, $e; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($e = $scope.get('Opal').$destructure(value)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.ret(true) } else { return nil }}, TMP_6.$$s = self, TMP_6.$$arity = -1, TMP_6), $a).call($c) }; return false; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_4.$$arity = 0); Opal.defn(self, '$chunk', TMP_7 = function $$chunk(state) { var $a, $b, TMP_8, self = this, $iter = TMP_7.$$p, original_block = $iter || nil; TMP_7.$$p = null; if (original_block !== false && original_block !== nil && original_block != null) { } else { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "no block given") }; return ($a = ($b = Opal.get('Enumerator')).$new, $a.$$p = (TMP_8 = function(yielder){var self = TMP_8.$$s || this, $c, $d, TMP_9; if (yielder == null) yielder = nil; var block, previous = nil, accumulate = []; if (state == undefined || state === nil) { block = original_block; } else { block = ($c = ($d = $scope.get('Proc')).$new, $c.$$p = (TMP_9 = function(val){var self = TMP_9.$$s || this; if (val == null) val = nil; return original_block.$yield(val, state.$dup())}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $c).call($d) } function releaseAccumulate() { if (accumulate.length > 0) { yielder.$yield(previous, accumulate) } } self.$each.$$p = function(value) { var key = Opal.yield1(block, value); if (key === nil) { releaseAccumulate(); accumulate = []; previous = nil; } else { if (previous === nil || previous === key) { accumulate.push(value); } else { releaseAccumulate(); accumulate = [value]; } previous = key; } } self.$each(); releaseAccumulate(); ;}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $a).call($b); }, TMP_7.$$arity = -1); Opal.defn(self, '$collect', TMP_10 = function $$collect() { var $a, $b, TMP_11, self = this, $iter = TMP_10.$$p, block = $iter || nil; TMP_10.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this; return self.$enumerator_size()}, TMP_11.$$s = self, TMP_11.$$arity = 0, TMP_11), $a).call($b, "collect") }; var result = []; self.$each.$$p = function() { var value = Opal.yieldX(block, arguments); result.push(value); }; self.$each(); return result; }, TMP_10.$$arity = 0); Opal.defn(self, '$collect_concat', TMP_12 = function $$collect_concat() { var $a, $b, TMP_13, $c, TMP_14, self = this, $iter = TMP_12.$$p, block = $iter || nil; TMP_12.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_13 = function(){var self = TMP_13.$$s || this; return self.$enumerator_size()}, TMP_13.$$s = self, TMP_13.$$arity = 0, TMP_13), $a).call($b, "collect_concat") }; return ($a = ($c = self).$map, $a.$$p = (TMP_14 = function(item){var self = TMP_14.$$s || this; if (item == null) item = nil; return Opal.yield1(block, item);}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($c).$flatten(1); }, TMP_12.$$arity = 0); Opal.defn(self, '$count', TMP_15 = function $$count(object) { var $a, $b, TMP_16, $c, TMP_17, $d, TMP_18, self = this, $iter = TMP_15.$$p, block = $iter || nil, result = nil; TMP_15.$$p = null; result = 0; if ((($a = object != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block = ($a = ($b = self).$proc, $a.$$p = (TMP_16 = function($c_rest){var self = TMP_16.$$s || this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('Opal').$destructure(args)['$=='](object)}, TMP_16.$$s = self, TMP_16.$$arity = -1, TMP_16), $a).call($b) } else if ((($a = block['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block = ($a = ($c = self).$proc, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this; return true}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17), $a).call($c)}; ($a = ($d = self).$each, $a.$$p = (TMP_18 = function($e_rest){var self = TMP_18.$$s || this, args, $f; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($f = Opal.yieldX(block, args)) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { return result++; } else { return nil }}, TMP_18.$$s = self, TMP_18.$$arity = -1, TMP_18), $a).call($d); return result; }, TMP_15.$$arity = -1); Opal.defn(self, '$cycle', TMP_19 = function $$cycle(n) { var $a, $b, TMP_20, self = this, $iter = TMP_19.$$p, block = $iter || nil; if (n == null) { n = nil; } TMP_19.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_20 = function(){var self = TMP_20.$$s || this, $c; if (n['$=='](nil)) { if ((($c = self['$respond_to?']("size")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return (($scope.get('Float')).$$scope.get('INFINITY')) } else { return nil } } else { n = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if ((($c = $rb_gt(n, 0)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return $rb_times(self.$enumerator_size(), n) } else { return 0 }; }}, TMP_20.$$s = self, TMP_20.$$arity = 0, TMP_20), $a).call($b, "cycle", n) }; if ((($a = n['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { n = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if ((($a = n <= 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; }; var result, all = [], i, length, value; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); all.push(param); } self.$each(); if (result !== undefined) { return result; } if (all.length === 0) { return nil; } if (n === nil) { while (true) { for (i = 0, length = all.length; i < length; i++) { value = Opal.yield1(block, all[i]); } } } else { while (n > 1) { for (i = 0, length = all.length; i < length; i++) { value = Opal.yield1(block, all[i]); } n--; } } }, TMP_19.$$arity = -1); Opal.defn(self, '$detect', TMP_21 = function $$detect(ifnone) {try { var $a, $b, TMP_22, self = this, $iter = TMP_21.$$p, block = $iter || nil; TMP_21.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("detect", ifnone) }; ($a = ($b = self).$each, $a.$$p = (TMP_22 = function($c_rest){var self = TMP_22.$$s || this, args, $d, value = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } value = $scope.get('Opal').$destructure(args); if ((($d = Opal.yield1(block, value)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { Opal.ret(value) } else { return nil };}, TMP_22.$$s = self, TMP_22.$$arity = -1, TMP_22), $a).call($b); if (ifnone !== undefined) { if (typeof(ifnone) === 'function') { return ifnone(); } else { return ifnone; } } return nil; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_21.$$arity = -1); Opal.defn(self, '$drop', TMP_23 = function $$drop(number) { var $a, self = this; number = $scope.get('Opal').$coerce_to(number, $scope.get('Integer'), "to_int"); if ((($a = number < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "attempt to drop negative size")}; var result = [], current = 0; self.$each.$$p = function() { if (number <= current) { result.push($scope.get('Opal').$destructure(arguments)); } current++; }; self.$each() return result; }, TMP_23.$$arity = 1); Opal.defn(self, '$drop_while', TMP_24 = function $$drop_while() { var $a, self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("drop_while") }; var result = [], dropping = true; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments); if (dropping) { var value = Opal.yield1(block, param); if ((($a = value) === nil || $a == null || ($a.$$is_boolean && $a == false))) { dropping = false; result.push(param); } } else { result.push(param); } }; self.$each(); return result; }, TMP_24.$$arity = 0); Opal.defn(self, '$each_cons', TMP_25 = function $$each_cons(n) { var $a, $b, TMP_26, self = this, $iter = TMP_25.$$p, block = $iter || nil; TMP_25.$$p = null; if ((($a = arguments.length != 1) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arguments.length) + " for 1)")}; n = $scope.get('Opal').$try_convert(n, $scope.get('Integer'), "to_int"); if ((($a = n <= 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "invalid size")}; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_26 = function(){var self = TMP_26.$$s || this, $c, $d, enum_size = nil; enum_size = self.$enumerator_size(); if ((($c = enum_size['$nil?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return nil } else if ((($c = ((($d = enum_size['$=='](0)) !== false && $d !== nil && $d != null) ? $d : $rb_lt(enum_size, n))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return 0 } else { return $rb_plus($rb_minus(enum_size, n), 1) };}, TMP_26.$$s = self, TMP_26.$$arity = 0, TMP_26), $a).call($b, "each_cons", n) }; var buffer = [], result = nil; self.$each.$$p = function() { var element = $scope.get('Opal').$destructure(arguments); buffer.push(element); if (buffer.length > n) { buffer.shift(); } if (buffer.length == n) { Opal.yield1(block, buffer.slice(0, n)); } } self.$each(); return result; }, TMP_25.$$arity = 1); Opal.defn(self, '$each_entry', TMP_27 = function $$each_entry($a_rest) { var $b, $c, TMP_28, self = this, data, $iter = TMP_27.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } data = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { data[$arg_idx - 0] = arguments[$arg_idx]; } TMP_27.$$p = null; if ((block !== nil)) { } else { return ($b = ($c = self).$to_enum, $b.$$p = (TMP_28 = function(){var self = TMP_28.$$s || this; return self.$enumerator_size()}, TMP_28.$$s = self, TMP_28.$$arity = 0, TMP_28), $b).apply($c, ["each_entry"].concat(Opal.to_a(data))) }; self.$each.$$p = function() { var item = $scope.get('Opal').$destructure(arguments); Opal.yield1(block, item); } self.$each.apply(self, data); return self; ; }, TMP_27.$$arity = -1); Opal.defn(self, '$each_slice', TMP_29 = function $$each_slice(n) { var $a, $b, TMP_30, self = this, $iter = TMP_29.$$p, block = $iter || nil; TMP_29.$$p = null; n = $scope.get('Opal').$coerce_to(n, $scope.get('Integer'), "to_int"); if ((($a = n <= 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "invalid slice size")}; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_30 = function(){var self = TMP_30.$$s || this, $c; if ((($c = self['$respond_to?']("size")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return ($rb_divide(self.$size(), n)).$ceil() } else { return nil }}, TMP_30.$$s = self, TMP_30.$$arity = 0, TMP_30), $a).call($b, "each_slice", n) }; var result, slice = [] self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments); slice.push(param); if (slice.length === n) { Opal.yield1(block, slice); slice = []; } }; self.$each(); if (result !== undefined) { return result; } // our "last" group, if smaller than n then won't have been yielded if (slice.length > 0) { Opal.yield1(block, slice); } ; return nil; }, TMP_29.$$arity = 1); Opal.defn(self, '$each_with_index', TMP_31 = function $$each_with_index($a_rest) { var $b, $c, TMP_32, self = this, args, $iter = TMP_31.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_31.$$p = null; if ((block !== nil)) { } else { return ($b = ($c = self).$enum_for, $b.$$p = (TMP_32 = function(){var self = TMP_32.$$s || this; return self.$enumerator_size()}, TMP_32.$$s = self, TMP_32.$$arity = 0, TMP_32), $b).apply($c, ["each_with_index"].concat(Opal.to_a(args))) }; var result, index = 0; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments); block(param, index); index++; }; self.$each.apply(self, args); if (result !== undefined) { return result; } return self; }, TMP_31.$$arity = -1); Opal.defn(self, '$each_with_object', TMP_33 = function $$each_with_object(object) { var $a, $b, TMP_34, self = this, $iter = TMP_33.$$p, block = $iter || nil; TMP_33.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_34 = function(){var self = TMP_34.$$s || this; return self.$enumerator_size()}, TMP_34.$$s = self, TMP_34.$$arity = 0, TMP_34), $a).call($b, "each_with_object", object) }; var result; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments); block(param, object); }; self.$each(); if (result !== undefined) { return result; } return object; }, TMP_33.$$arity = 1); Opal.defn(self, '$entries', TMP_35 = function $$entries($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } var result = []; self.$each.$$p = function() { result.push($scope.get('Opal').$destructure(arguments)); }; self.$each.apply(self, args); return result; }, TMP_35.$$arity = -1); Opal.alias(self, 'find', 'detect'); Opal.defn(self, '$find_all', TMP_36 = function $$find_all() { var $a, $b, TMP_37, self = this, $iter = TMP_36.$$p, block = $iter || nil; TMP_36.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_37 = function(){var self = TMP_37.$$s || this; return self.$enumerator_size()}, TMP_37.$$s = self, TMP_37.$$arity = 0, TMP_37), $a).call($b, "find_all") }; var result = []; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); if ((($a = value) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result.push(param); } }; self.$each(); return result; }, TMP_36.$$arity = 0); Opal.defn(self, '$find_index', TMP_38 = function $$find_index(object) {try { var $a, $b, TMP_39, $c, TMP_40, self = this, $iter = TMP_38.$$p, block = $iter || nil, index = nil; TMP_38.$$p = null; if ((($a = object === undefined && block === nil) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$enum_for("find_index")}; index = 0; if ((($a = object != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = self).$each, $a.$$p = (TMP_39 = function($c_rest){var self = TMP_39.$$s || this, value; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ($scope.get('Opal').$destructure(value)['$=='](object)) { Opal.ret(index)}; return index += 1;}, TMP_39.$$s = self, TMP_39.$$arity = -1, TMP_39), $a).call($b) } else { ($a = ($c = self).$each, $a.$$p = (TMP_40 = function($d_rest){var self = TMP_40.$$s || this, value, $e; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($e = Opal.yieldX(block, Opal.to_a(value))) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.ret(index)}; return index += 1;}, TMP_40.$$s = self, TMP_40.$$arity = -1, TMP_40), $a).call($c) }; return nil; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_38.$$arity = -1); Opal.defn(self, '$first', TMP_43 = function $$first(number) {try { var $a, $b, TMP_41, $c, TMP_42, self = this, result = nil, current = nil; if ((($a = number === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$each, $a.$$p = (TMP_41 = function(value){var self = TMP_41.$$s || this; if (value == null) value = nil; Opal.ret(value)}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41), $a).call($b) } else { result = []; number = $scope.get('Opal').$coerce_to(number, $scope.get('Integer'), "to_int"); if ((($a = number < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "attempt to take negative size")}; if ((($a = number == 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return []}; current = 0; ($a = ($c = self).$each, $a.$$p = (TMP_42 = function($d_rest){var self = TMP_42.$$s || this, args, $e; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } result.push($scope.get('Opal').$destructure(args)); if ((($e = number <= ++current) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.ret(result) } else { return nil };}, TMP_42.$$s = self, TMP_42.$$arity = -1, TMP_42), $a).call($c); return result; }; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_43.$$arity = -1); Opal.alias(self, 'flat_map', 'collect_concat'); Opal.defn(self, '$grep', TMP_44 = function $$grep(pattern) { var $a, self = this, $iter = TMP_44.$$p, block = $iter || nil; TMP_44.$$p = null; var result = []; if (block !== nil) { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = pattern['$==='](param); if ((($a = value) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = Opal.yield1(block, param); result.push(value); } }; } else { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = pattern['$==='](param); if ((($a = value) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result.push(param); } }; } self.$each(); return result; ; }, TMP_44.$$arity = 1); Opal.defn(self, '$group_by', TMP_45 = function $$group_by() { var $a, $b, TMP_46, $c, $d, self = this, $iter = TMP_45.$$p, block = $iter || nil, hash = nil; TMP_45.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_46 = function(){var self = TMP_46.$$s || this; return self.$enumerator_size()}, TMP_46.$$s = self, TMP_46.$$arity = 0, TMP_46), $a).call($b, "group_by") }; hash = $scope.get('Hash').$new(); var result; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); (($a = value, $c = hash, ((($d = $c['$[]']($a)) !== false && $d !== nil && $d != null) ? $d : $c['$[]=']($a, []))))['$<<'](param); } self.$each(); if (result !== undefined) { return result; } return hash; }, TMP_45.$$arity = 0); Opal.defn(self, '$include?', TMP_48 = function(obj) {try { var $a, $b, TMP_47, self = this; ($a = ($b = self).$each, $a.$$p = (TMP_47 = function($c_rest){var self = TMP_47.$$s || this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ($scope.get('Opal').$destructure(args)['$=='](obj)) { Opal.ret(true) } else { return nil }}, TMP_47.$$s = self, TMP_47.$$arity = -1, TMP_47), $a).call($b); return false; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_48.$$arity = 1); Opal.defn(self, '$inject', TMP_49 = function $$inject(object, sym) { var self = this, $iter = TMP_49.$$p, block = $iter || nil; TMP_49.$$p = null; var result = object; if (block !== nil && sym === undefined) { self.$each.$$p = function() { var value = $scope.get('Opal').$destructure(arguments); if (result === undefined) { result = value; return; } value = Opal.yieldX(block, [result, value]); result = value; }; } else { if (sym === undefined) { if (!$scope.get('Symbol')['$==='](object)) { self.$raise($scope.get('TypeError'), "" + (object.$inspect()) + " is not a Symbol"); } sym = object; result = undefined; } self.$each.$$p = function() { var value = $scope.get('Opal').$destructure(arguments); if (result === undefined) { result = value; return; } result = (result).$__send__(sym, value); }; } self.$each(); return result == undefined ? nil : result; ; }, TMP_49.$$arity = -1); Opal.defn(self, '$lazy', TMP_51 = function $$lazy() { var $a, $b, TMP_50, self = this; return ($a = ($b = (($scope.get('Enumerator')).$$scope.get('Lazy'))).$new, $a.$$p = (TMP_50 = function(enum$, $c_rest){var self = TMP_50.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; return ($d = enum$).$yield.apply($d, Opal.to_a(args))}, TMP_50.$$s = self, TMP_50.$$arity = -2, TMP_50), $a).call($b, self, self.$enumerator_size()); }, TMP_51.$$arity = 0); Opal.defn(self, '$enumerator_size', TMP_52 = function $$enumerator_size() { var $a, self = this; if ((($a = self['$respond_to?']("size")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$size() } else { return nil }; }, TMP_52.$$arity = 0); Opal.alias(self, 'map', 'collect'); Opal.defn(self, '$max', TMP_53 = function $$max(n) { var $a, $b, self = this, $iter = TMP_53.$$p, block = $iter || nil; TMP_53.$$p = null; if (n === undefined || n === nil) { var result, value; self.$each.$$p = function() { var item = $scope.get('Opal').$destructure(arguments); if (result === undefined) { result = item; return; } if (block !== nil) { value = Opal.yieldX(block, [item, result]); } else { value = (item)['$<=>'](result); } if (value === nil) { self.$raise($scope.get('ArgumentError'), "comparison failed"); } if (value > 0) { result = item; } } self.$each(); if (result === undefined) { return nil; } else { return result; } } n = $scope.get('Opal').$coerce_to(n, $scope.get('Integer'), "to_int"); return ($a = ($b = self).$sort, $a.$$p = block.$to_proc(), $a).call($b).$reverse().$first(n); }, TMP_53.$$arity = -1); Opal.defn(self, '$max_by', TMP_54 = function $$max_by() { var $a, $b, TMP_55, self = this, $iter = TMP_54.$$p, block = $iter || nil; TMP_54.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_55 = function(){var self = TMP_55.$$s || this; return self.$enumerator_size()}, TMP_55.$$s = self, TMP_55.$$arity = 0, TMP_55), $a).call($b, "max_by") }; var result, by; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); if (result === undefined) { result = param; by = value; return; } if ((value)['$<=>'](by) > 0) { result = param by = value; } }; self.$each(); return result === undefined ? nil : result; }, TMP_54.$$arity = 0); Opal.alias(self, 'member?', 'include?'); Opal.defn(self, '$min', TMP_56 = function $$min() { var self = this, $iter = TMP_56.$$p, block = $iter || nil; TMP_56.$$p = null; var result; if (block !== nil) { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments); if (result === undefined) { result = param; return; } var value = block(param, result); if (value === nil) { self.$raise($scope.get('ArgumentError'), "comparison failed"); } if (value < 0) { result = param; } }; } else { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments); if (result === undefined) { result = param; return; } if ($scope.get('Opal').$compare(param, result) < 0) { result = param; } }; } self.$each(); return result === undefined ? nil : result; }, TMP_56.$$arity = 0); Opal.defn(self, '$min_by', TMP_57 = function $$min_by() { var $a, $b, TMP_58, self = this, $iter = TMP_57.$$p, block = $iter || nil; TMP_57.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_58 = function(){var self = TMP_58.$$s || this; return self.$enumerator_size()}, TMP_58.$$s = self, TMP_58.$$arity = 0, TMP_58), $a).call($b, "min_by") }; var result, by; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); if (result === undefined) { result = param; by = value; return; } if ((value)['$<=>'](by) < 0) { result = param by = value; } }; self.$each(); return result === undefined ? nil : result; }, TMP_57.$$arity = 0); Opal.defn(self, '$minmax', TMP_59 = function $$minmax() { var $a, $b, $c, TMP_60, self = this, $iter = TMP_59.$$p, block = $iter || nil; TMP_59.$$p = null; ((($a = block) !== false && $a !== nil && $a != null) ? $a : block = ($b = ($c = self).$proc, $b.$$p = (TMP_60 = function(a, b){var self = TMP_60.$$s || this; if (a == null) a = nil;if (b == null) b = nil; return a['$<=>'](b)}, TMP_60.$$s = self, TMP_60.$$arity = 2, TMP_60), $b).call($c)); var min = nil, max = nil, first_time = true; self.$each.$$p = function() { var element = $scope.get('Opal').$destructure(arguments); if (first_time) { min = max = element; first_time = false; } else { var min_cmp = block.$call(min, element); if (min_cmp === nil) { self.$raise($scope.get('ArgumentError'), "comparison failed") } else if (min_cmp > 0) { min = element; } var max_cmp = block.$call(max, element); if (max_cmp === nil) { self.$raise($scope.get('ArgumentError'), "comparison failed") } else if (max_cmp < 0) { max = element; } } } self.$each(); return [min, max]; }, TMP_59.$$arity = 0); Opal.defn(self, '$minmax_by', TMP_61 = function $$minmax_by() { var self = this, $iter = TMP_61.$$p, block = $iter || nil; TMP_61.$$p = null; return self.$raise($scope.get('NotImplementedError')); }, TMP_61.$$arity = 0); Opal.defn(self, '$none?', TMP_62 = function() {try { var $a, $b, TMP_63, $c, TMP_64, self = this, $iter = TMP_62.$$p, block = $iter || nil; TMP_62.$$p = null; if ((block !== nil)) { ($a = ($b = self).$each, $a.$$p = (TMP_63 = function($c_rest){var self = TMP_63.$$s || this, value, $d; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($d = Opal.yieldX(block, Opal.to_a(value))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { Opal.ret(false) } else { return nil }}, TMP_63.$$s = self, TMP_63.$$arity = -1, TMP_63), $a).call($b) } else { ($a = ($c = self).$each, $a.$$p = (TMP_64 = function($d_rest){var self = TMP_64.$$s || this, value, $e; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($e = $scope.get('Opal').$destructure(value)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.ret(false) } else { return nil }}, TMP_64.$$s = self, TMP_64.$$arity = -1, TMP_64), $a).call($c) }; return true; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_62.$$arity = 0); Opal.defn(self, '$one?', TMP_65 = function() {try { var $a, $b, TMP_66, $c, TMP_67, self = this, $iter = TMP_65.$$p, block = $iter || nil, count = nil; TMP_65.$$p = null; count = 0; if ((block !== nil)) { ($a = ($b = self).$each, $a.$$p = (TMP_66 = function($c_rest){var self = TMP_66.$$s || this, value, $d; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($d = Opal.yieldX(block, Opal.to_a(value))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { count = $rb_plus(count, 1); if ((($d = $rb_gt(count, 1)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { Opal.ret(false) } else { return nil }; } else { return nil }}, TMP_66.$$s = self, TMP_66.$$arity = -1, TMP_66), $a).call($b) } else { ($a = ($c = self).$each, $a.$$p = (TMP_67 = function($d_rest){var self = TMP_67.$$s || this, value, $e; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } if ((($e = $scope.get('Opal').$destructure(value)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { count = $rb_plus(count, 1); if ((($e = $rb_gt(count, 1)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.ret(false) } else { return nil }; } else { return nil }}, TMP_67.$$s = self, TMP_67.$$arity = -1, TMP_67), $a).call($c) }; return count['$=='](1); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_65.$$arity = 0); Opal.defn(self, '$partition', TMP_68 = function $$partition() { var $a, $b, TMP_69, self = this, $iter = TMP_68.$$p, block = $iter || nil; TMP_68.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_69 = function(){var self = TMP_69.$$s || this; return self.$enumerator_size()}, TMP_69.$$s = self, TMP_69.$$arity = 0, TMP_69), $a).call($b, "partition") }; var truthy = [], falsy = [], result; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); if ((($a = value) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { truthy.push(param); } else { falsy.push(param); } }; self.$each(); return [truthy, falsy]; }, TMP_68.$$arity = 0); Opal.alias(self, 'reduce', 'inject'); Opal.defn(self, '$reject', TMP_70 = function $$reject() { var $a, $b, TMP_71, self = this, $iter = TMP_70.$$p, block = $iter || nil; TMP_70.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_71 = function(){var self = TMP_71.$$s || this; return self.$enumerator_size()}, TMP_71.$$s = self, TMP_71.$$arity = 0, TMP_71), $a).call($b, "reject") }; var result = []; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); if ((($a = value) === nil || $a == null || ($a.$$is_boolean && $a == false))) { result.push(param); } }; self.$each(); return result; }, TMP_70.$$arity = 0); Opal.defn(self, '$reverse_each', TMP_72 = function $$reverse_each() { var $a, $b, TMP_73, self = this, $iter = TMP_72.$$p, block = $iter || nil; TMP_72.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_73 = function(){var self = TMP_73.$$s || this; return self.$enumerator_size()}, TMP_73.$$s = self, TMP_73.$$arity = 0, TMP_73), $a).call($b, "reverse_each") }; var result = []; self.$each.$$p = function() { result.push(arguments); }; self.$each(); for (var i = result.length - 1; i >= 0; i--) { Opal.yieldX(block, result[i]); } return result; }, TMP_72.$$arity = 0); Opal.alias(self, 'select', 'find_all'); Opal.defn(self, '$slice_before', TMP_74 = function $$slice_before(pattern) { var $a, $b, TMP_75, self = this, $iter = TMP_74.$$p, block = $iter || nil; TMP_74.$$p = null; if ((($a = pattern === undefined && block === nil || arguments.length > 1) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arguments.length) + " for 1)")}; return ($a = ($b = $scope.get('Enumerator')).$new, $a.$$p = (TMP_75 = function(e){var self = TMP_75.$$s || this, $c; if (e == null) e = nil; var slice = []; if (block !== nil) { if (pattern === undefined) { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = Opal.yield1(block, param); if ((($c = value) !== nil && $c != null && (!$c.$$is_boolean || $c == true)) && slice.length > 0) { e['$<<'](slice); slice = []; } slice.push(param); }; } else { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = block(param, pattern.$dup()); if ((($c = value) !== nil && $c != null && (!$c.$$is_boolean || $c == true)) && slice.length > 0) { e['$<<'](slice); slice = []; } slice.push(param); }; } } else { self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = pattern['$==='](param); if ((($c = value) !== nil && $c != null && (!$c.$$is_boolean || $c == true)) && slice.length > 0) { e['$<<'](slice); slice = []; } slice.push(param); }; } self.$each(); if (slice.length > 0) { e['$<<'](slice); } ;}, TMP_75.$$s = self, TMP_75.$$arity = 1, TMP_75), $a).call($b); }, TMP_74.$$arity = -1); Opal.defn(self, '$sort', TMP_76 = function $$sort() { var $a, $b, TMP_77, $c, self = this, $iter = TMP_76.$$p, block = $iter || nil, ary = nil; TMP_76.$$p = null; ary = self.$to_a(); if ((block !== nil)) { } else { block = ($a = ($b = self).$lambda, $a.$$p = (TMP_77 = function(a, b){var self = TMP_77.$$s || this; if (a == null) a = nil;if (b == null) b = nil; return a['$<=>'](b)}, TMP_77.$$s = self, TMP_77.$$arity = 2, TMP_77), $a).call($b) }; return ($a = ($c = ary).$sort, $a.$$p = block.$to_proc(), $a).call($c); }, TMP_76.$$arity = 0); Opal.defn(self, '$sort_by', TMP_78 = function $$sort_by() { var $a, $b, TMP_79, $c, TMP_80, $d, TMP_81, $e, TMP_82, self = this, $iter = TMP_78.$$p, block = $iter || nil, dup = nil; TMP_78.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_79 = function(){var self = TMP_79.$$s || this; return self.$enumerator_size()}, TMP_79.$$s = self, TMP_79.$$arity = 0, TMP_79), $a).call($b, "sort_by") }; dup = ($a = ($c = self).$map, $a.$$p = (TMP_80 = function(){var self = TMP_80.$$s || this, $yielded, arg = nil; arg = $scope.get('Opal').$destructure(arguments); ($yielded = Opal.yield1(block, arg));return [$yielded, arg];}, TMP_80.$$s = self, TMP_80.$$arity = 0, TMP_80), $a).call($c); ($a = ($d = dup)['$sort!'], $a.$$p = (TMP_81 = function(a, b){var self = TMP_81.$$s || this; if (a == null) a = nil;if (b == null) b = nil; return (a[0])['$<=>'](b[0])}, TMP_81.$$s = self, TMP_81.$$arity = 2, TMP_81), $a).call($d); return ($a = ($e = dup)['$map!'], $a.$$p = (TMP_82 = function(i){var self = TMP_82.$$s || this; if (i == null) i = nil; return i[1];}, TMP_82.$$s = self, TMP_82.$$arity = 1, TMP_82), $a).call($e); }, TMP_78.$$arity = 0); Opal.defn(self, '$take', TMP_83 = function $$take(num) { var self = this; return self.$first(num); }, TMP_83.$$arity = 1); Opal.defn(self, '$take_while', TMP_84 = function $$take_while() {try { var $a, $b, TMP_85, self = this, $iter = TMP_84.$$p, block = $iter || nil, result = nil; TMP_84.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$enum_for("take_while") }; result = []; return ($a = ($b = self).$each, $a.$$p = (TMP_85 = function($c_rest){var self = TMP_85.$$s || this, args, $d, value = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } value = $scope.get('Opal').$destructure(args); if ((($d = Opal.yield1(block, value)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { } else { Opal.ret(result) }; return result.push(value);}, TMP_85.$$s = self, TMP_85.$$arity = -1, TMP_85), $a).call($b); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_84.$$arity = 0); Opal.alias(self, 'to_a', 'entries'); Opal.defn(self, '$zip', TMP_86 = function $$zip($a_rest) { var $b, self = this, others, $iter = TMP_86.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } others = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { others[$arg_idx - 0] = arguments[$arg_idx]; } TMP_86.$$p = null; return ($b = self.$to_a()).$zip.apply($b, Opal.to_a(others)); }, TMP_86.$$arity = -1); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/enumerator"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$include', '$allocate', '$new', '$to_proc', '$coerce_to', '$nil?', '$empty?', '$+', '$class', '$__send__', '$===', '$call', '$enum_for', '$size', '$destructure', '$inspect', '$[]', '$raise', '$yield', '$each', '$enumerator_size', '$respond_to?', '$try_convert', '$<', '$for']); self.$require("corelib/enumerable"); return (function($base, $super) { function $Enumerator(){}; var self = $Enumerator = $klass($base, $super, 'Enumerator', $Enumerator); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_7; def.size = def.args = def.object = def.method = nil; self.$include($scope.get('Enumerable')); def.$$is_enumerator = true; Opal.defs(self, '$for', TMP_1 = function(object, method, $a_rest) { var self = this, args, $iter = TMP_1.$$p, block = $iter || nil; if (method == null) { method = "each"; } var $args_len = arguments.length, $rest_len = $args_len - 2; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 2; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 2] = arguments[$arg_idx]; } TMP_1.$$p = null; var obj = self.$allocate(); obj.object = object; obj.size = block; obj.method = method; obj.args = args; return obj; ; }, TMP_1.$$arity = -2); Opal.defn(self, '$initialize', TMP_2 = function $$initialize($a_rest) { var $b, $c, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; if (block !== false && block !== nil && block != null) { self.object = ($b = ($c = $scope.get('Generator')).$new, $b.$$p = block.$to_proc(), $b).call($c); self.method = "each"; self.args = []; self.size = arguments[0] || nil; if ((($b = self.size) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.size = $scope.get('Opal').$coerce_to(self.size, $scope.get('Integer'), "to_int") } else { return nil }; } else { self.object = arguments[0]; self.method = arguments[1] || "each"; self.args = $slice.call(arguments, 2); return self.size = nil; }; }, TMP_2.$$arity = -1); Opal.defn(self, '$each', TMP_3 = function $$each($a_rest) { var $b, $c, $d, self = this, args, $iter = TMP_3.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_3.$$p = null; if ((($b = ($c = block['$nil?'](), $c !== false && $c !== nil && $c != null ?args['$empty?']() : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self}; args = $rb_plus(self.args, args); if ((($b = block['$nil?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = self.$class()).$new.apply($b, [self.object, self.method].concat(Opal.to_a(args)))}; return ($c = ($d = self.object).$__send__, $c.$$p = block.$to_proc(), $c).apply($d, [self.method].concat(Opal.to_a(args))); }, TMP_3.$$arity = -1); Opal.defn(self, '$size', TMP_4 = function $$size() { var $a, self = this; if ((($a = $scope.get('Proc')['$==='](self.size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = self.size).$call.apply($a, Opal.to_a(self.args)) } else { return self.size }; }, TMP_4.$$arity = 0); Opal.defn(self, '$with_index', TMP_5 = function $$with_index(offset) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, block = $iter || nil; if (offset == null) { offset = 0; } TMP_5.$$p = null; if (offset !== false && offset !== nil && offset != null) { offset = $scope.get('Opal').$coerce_to(offset, $scope.get('Integer'), "to_int") } else { offset = 0 }; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return self.$size()}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($b, "with_index", offset) }; var result, index = offset; self.$each.$$p = function() { var param = $scope.get('Opal').$destructure(arguments), value = block(param, index); index++; return value; } return self.$each(); }, TMP_5.$$arity = -1); Opal.alias(self, 'with_object', 'each_with_object'); Opal.defn(self, '$inspect', TMP_7 = function $$inspect() { var $a, self = this, result = nil; result = "#<" + (self.$class()) + ": " + (self.object.$inspect()) + ":" + (self.method); if ((($a = self.args['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { result = $rb_plus(result, "(" + (self.args.$inspect()['$[]']($scope.get('Range').$new(1, -2))) + ")") }; return $rb_plus(result, ">"); }, TMP_7.$$arity = 0); (function($base, $super) { function $Generator(){}; var self = $Generator = $klass($base, $super, 'Generator', $Generator); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9; def.block = nil; self.$include($scope.get('Enumerable')); Opal.defn(self, '$initialize', TMP_8 = function $$initialize() { var self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('LocalJumpError'), "no block given") }; return self.block = block; }, TMP_8.$$arity = 0); return (Opal.defn(self, '$each', TMP_9 = function $$each($a_rest) { var $b, $c, self = this, args, $iter = TMP_9.$$p, block = $iter || nil, yielder = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_9.$$p = null; yielder = ($b = ($c = $scope.get('Yielder')).$new, $b.$$p = block.$to_proc(), $b).call($c); try { args.unshift(yielder); Opal.yieldX(self.block, args); } catch (e) { if (e === $breaker) { return $breaker.$v; } else { throw e; } } ; return self; }, TMP_9.$$arity = -1), nil) && 'each'; })($scope.base, null); (function($base, $super) { function $Yielder(){}; var self = $Yielder = $klass($base, $super, 'Yielder', $Yielder); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_11, TMP_12; def.block = nil; Opal.defn(self, '$initialize', TMP_10 = function $$initialize() { var self = this, $iter = TMP_10.$$p, block = $iter || nil; TMP_10.$$p = null; return self.block = block; }, TMP_10.$$arity = 0); Opal.defn(self, '$yield', TMP_11 = function($a_rest) { var self = this, values; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } values = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { values[$arg_idx - 0] = arguments[$arg_idx]; } var value = Opal.yieldX(self.block, values); if (value === $breaker) { throw $breaker; } return value; ; }, TMP_11.$$arity = -1); return (Opal.defn(self, '$<<', TMP_12 = function($a_rest) { var $b, self = this, values; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } values = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { values[$arg_idx - 0] = arguments[$arg_idx]; } ($b = self).$yield.apply($b, Opal.to_a(values)); return self; }, TMP_12.$$arity = -1), nil) && '<<'; })($scope.base, null); return (function($base, $super) { function $Lazy(){}; var self = $Lazy = $klass($base, $super, 'Lazy', $Lazy); var def = self.$$proto, $scope = self.$$scope, TMP_13, TMP_16, TMP_17, TMP_19, TMP_24, TMP_25, TMP_27, TMP_28, TMP_30, TMP_33, TMP_36, TMP_37, TMP_39; def.enumerator = nil; (function($base, $super) { function $StopLazyError(){}; var self = $StopLazyError = $klass($base, $super, 'StopLazyError', $StopLazyError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Exception')); Opal.defn(self, '$initialize', TMP_13 = function $$initialize(object, size) { var $a, $b, TMP_14, self = this, $iter = TMP_13.$$p, block = $iter || nil; if (size == null) { size = nil; } TMP_13.$$p = null; if ((block !== nil)) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy new without a block") }; self.enumerator = object; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_13, false)), $a.$$p = (TMP_14 = function(yielder, $c_rest){var self = TMP_14.$$s || this, each_args, $d, $e, TMP_15; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } each_args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { each_args[$arg_idx - 1] = arguments[$arg_idx]; }if (yielder == null) yielder = nil; try { return ($d = ($e = object).$each, $d.$$p = (TMP_15 = function($c_rest){var self = TMP_15.$$s || this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } args.unshift(yielder); Opal.yieldX(block, args); ;}, TMP_15.$$s = self, TMP_15.$$arity = -1, TMP_15), $d).apply($e, Opal.to_a(each_args)) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) { try { return nil } finally { Opal.pop_exception() } } else { throw $err; } }}, TMP_14.$$s = self, TMP_14.$$arity = -2, TMP_14), $a).call($b, size); }, TMP_13.$$arity = -2); Opal.alias(self, 'force', 'to_a'); Opal.defn(self, '$lazy', TMP_16 = function $$lazy() { var self = this; return self; }, TMP_16.$$arity = 0); Opal.defn(self, '$collect', TMP_17 = function $$collect() { var $a, $b, TMP_18, self = this, $iter = TMP_17.$$p, block = $iter || nil; TMP_17.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy map without a block") }; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_18 = function(enum$, $c_rest){var self = TMP_18.$$s || this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var value = Opal.yieldX(block, args); enum$.$yield(value); }, TMP_18.$$s = self, TMP_18.$$arity = -2, TMP_18), $a).call($b, self, self.$enumerator_size()); }, TMP_17.$$arity = 0); Opal.defn(self, '$collect_concat', TMP_19 = function $$collect_concat() { var $a, $b, TMP_20, self = this, $iter = TMP_19.$$p, block = $iter || nil; TMP_19.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy map without a block") }; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_20 = function(enum$, $c_rest){var self = TMP_20.$$s || this, args, $d, $e, TMP_21, $f, TMP_22; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var value = Opal.yieldX(block, args); if ((value)['$respond_to?']("force") && (value)['$respond_to?']("each")) { ($d = ($e = (value)).$each, $d.$$p = (TMP_21 = function(v){var self = TMP_21.$$s || this; if (v == null) v = nil; return enum$.$yield(v)}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21), $d).call($e) } else { var array = $scope.get('Opal').$try_convert(value, $scope.get('Array'), "to_ary"); if (array === nil) { enum$.$yield(value); } else { ($d = ($f = (value)).$each, $d.$$p = (TMP_22 = function(v){var self = TMP_22.$$s || this; if (v == null) v = nil; return enum$.$yield(v)}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $d).call($f); } } ;}, TMP_20.$$s = self, TMP_20.$$arity = -2, TMP_20), $a).call($b, self, nil); }, TMP_19.$$arity = 0); Opal.defn(self, '$drop', TMP_24 = function $$drop(n) { var $a, $b, TMP_23, self = this, current_size = nil, set_size = nil, dropped = nil; n = $scope.get('Opal').$coerce_to(n, $scope.get('Integer'), "to_int"); if ((($a = $rb_lt(n, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "attempt to drop negative size")}; current_size = self.$enumerator_size(); set_size = (function() {if ((($a = $scope.get('Integer')['$==='](current_size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_lt(n, current_size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return n } else { return current_size } } else { return current_size }; return nil; })(); dropped = 0; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_23 = function(enum$, $c_rest){var self = TMP_23.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; if ((($d = $rb_lt(dropped, n)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return dropped = $rb_plus(dropped, 1) } else { return ($d = enum$).$yield.apply($d, Opal.to_a(args)) }}, TMP_23.$$s = self, TMP_23.$$arity = -2, TMP_23), $a).call($b, self, set_size); }, TMP_24.$$arity = 1); Opal.defn(self, '$drop_while', TMP_25 = function $$drop_while() { var $a, $b, TMP_26, self = this, $iter = TMP_25.$$p, block = $iter || nil, succeeding = nil; TMP_25.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy drop_while without a block") }; succeeding = true; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_26 = function(enum$, $c_rest){var self = TMP_26.$$s || this, args, $d, $e; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; if (succeeding !== false && succeeding !== nil && succeeding != null) { var value = Opal.yieldX(block, args); if ((($d = value) === nil || $d == null || ($d.$$is_boolean && $d == false))) { succeeding = false; ($d = enum$).$yield.apply($d, Opal.to_a(args)); } } else { return ($e = enum$).$yield.apply($e, Opal.to_a(args)) }}, TMP_26.$$s = self, TMP_26.$$arity = -2, TMP_26), $a).call($b, self, nil); }, TMP_25.$$arity = 0); Opal.defn(self, '$enum_for', TMP_27 = function $$enum_for(method, $a_rest) { var $b, $c, self = this, args, $iter = TMP_27.$$p, block = $iter || nil; if (method == null) { method = "each"; } var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_27.$$p = null; return ($b = ($c = self.$class()).$for, $b.$$p = block.$to_proc(), $b).apply($c, [self, method].concat(Opal.to_a(args))); }, TMP_27.$$arity = -1); Opal.defn(self, '$find_all', TMP_28 = function $$find_all() { var $a, $b, TMP_29, self = this, $iter = TMP_28.$$p, block = $iter || nil; TMP_28.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy select without a block") }; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_29 = function(enum$, $c_rest){var self = TMP_29.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var value = Opal.yieldX(block, args); if ((($d = value) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { ($d = enum$).$yield.apply($d, Opal.to_a(args)); } ;}, TMP_29.$$s = self, TMP_29.$$arity = -2, TMP_29), $a).call($b, self, nil); }, TMP_28.$$arity = 0); Opal.alias(self, 'flat_map', 'collect_concat'); Opal.defn(self, '$grep', TMP_30 = function $$grep(pattern) { var $a, $b, TMP_31, $c, TMP_32, self = this, $iter = TMP_30.$$p, block = $iter || nil; TMP_30.$$p = null; if (block !== false && block !== nil && block != null) { return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_31 = function(enum$, $c_rest){var self = TMP_31.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var param = $scope.get('Opal').$destructure(args), value = pattern['$==='](param); if ((($d = value) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { value = Opal.yield1(block, param); enum$.$yield(Opal.yield1(block, param)); } ;}, TMP_31.$$s = self, TMP_31.$$arity = -2, TMP_31), $a).call($b, self, nil) } else { return ($a = ($c = $scope.get('Lazy')).$new, $a.$$p = (TMP_32 = function(enum$, $d_rest){var self = TMP_32.$$s || this, args, $e; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var param = $scope.get('Opal').$destructure(args), value = pattern['$==='](param); if ((($e = value) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { enum$.$yield(param); } ;}, TMP_32.$$s = self, TMP_32.$$arity = -2, TMP_32), $a).call($c, self, nil) }; }, TMP_30.$$arity = 1); Opal.alias(self, 'map', 'collect'); Opal.alias(self, 'select', 'find_all'); Opal.defn(self, '$reject', TMP_33 = function $$reject() { var $a, $b, TMP_34, self = this, $iter = TMP_33.$$p, block = $iter || nil; TMP_33.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy reject without a block") }; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_34 = function(enum$, $c_rest){var self = TMP_34.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var value = Opal.yieldX(block, args); if ((($d = value) === nil || $d == null || ($d.$$is_boolean && $d == false))) { ($d = enum$).$yield.apply($d, Opal.to_a(args)); } ;}, TMP_34.$$s = self, TMP_34.$$arity = -2, TMP_34), $a).call($b, self, nil); }, TMP_33.$$arity = 0); Opal.defn(self, '$take', TMP_36 = function $$take(n) { var $a, $b, TMP_35, self = this, current_size = nil, set_size = nil, taken = nil; n = $scope.get('Opal').$coerce_to(n, $scope.get('Integer'), "to_int"); if ((($a = $rb_lt(n, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "attempt to take negative size")}; current_size = self.$enumerator_size(); set_size = (function() {if ((($a = $scope.get('Integer')['$==='](current_size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_lt(n, current_size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return n } else { return current_size } } else { return current_size }; return nil; })(); taken = 0; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_35 = function(enum$, $c_rest){var self = TMP_35.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; if ((($d = $rb_lt(taken, n)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { ($d = enum$).$yield.apply($d, Opal.to_a(args)); return taken = $rb_plus(taken, 1); } else { return self.$raise($scope.get('StopLazyError')) }}, TMP_35.$$s = self, TMP_35.$$arity = -2, TMP_35), $a).call($b, self, set_size); }, TMP_36.$$arity = 1); Opal.defn(self, '$take_while', TMP_37 = function $$take_while() { var $a, $b, TMP_38, self = this, $iter = TMP_37.$$p, block = $iter || nil; TMP_37.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to call lazy take_while without a block") }; return ($a = ($b = $scope.get('Lazy')).$new, $a.$$p = (TMP_38 = function(enum$, $c_rest){var self = TMP_38.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; }if (enum$ == null) enum$ = nil; var value = Opal.yieldX(block, args); if ((($d = value) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { ($d = enum$).$yield.apply($d, Opal.to_a(args)); } else { self.$raise($scope.get('StopLazyError')); } ;}, TMP_38.$$s = self, TMP_38.$$arity = -2, TMP_38), $a).call($b, self, nil); }, TMP_37.$$arity = 0); Opal.alias(self, 'to_enum', 'enum_for'); return (Opal.defn(self, '$inspect', TMP_39 = function $$inspect() { var self = this; return "#<" + (self.$class()) + ": " + (self.enumerator.$inspect()) + ">"; }, TMP_39.$$arity = 0), nil) && 'inspect'; })($scope.base, self); })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/numeric"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$include', '$instance_of?', '$class', '$Float', '$coerce', '$===', '$raise', '$__send__', '$equal?', '$coerce_to!', '$-@', '$**', '$-', '$*', '$div', '$<', '$ceil', '$to_f', '$denominator', '$to_r', '$==', '$floor', '$/', '$%', '$Complex', '$zero?', '$numerator', '$abs', '$arg', '$round', '$to_i', '$truncate', '$>']); self.$require("corelib/comparable"); return (function($base, $super) { function $Numeric(){}; var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36; self.$include($scope.get('Comparable')); Opal.defn(self, '$coerce', TMP_1 = function $$coerce(other) { var $a, self = this; if ((($a = other['$instance_of?'](self.$class())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [other, self]}; return [self.$Float(other), self.$Float(self)]; }, TMP_1.$$arity = 1); Opal.defn(self, '$__coerced__', TMP_2 = function $$__coerced__(method, other) { var $a, $b, self = this, a = nil, b = nil, $case = nil; try { $b = other.$coerce(self), $a = Opal.to_ary($b), a = ($a[0] == null ? nil : $a[0]), b = ($a[1] == null ? nil : $a[1]), $b } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { $case = method;if ("+"['$===']($case) || "-"['$===']($case) || "*"['$===']($case) || "/"['$===']($case) || "%"['$===']($case) || "&"['$===']($case) || "|"['$===']($case) || "^"['$===']($case) || "**"['$===']($case)) {self.$raise($scope.get('TypeError'), "" + (other.$class()) + " can't be coerce into Numeric")}else if (">"['$===']($case) || ">="['$===']($case) || "<"['$===']($case) || "<="['$===']($case) || "<=>"['$===']($case)) {self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (other.$class()) + " failed")} } finally { Opal.pop_exception() } } else { throw $err; } }; return a.$__send__(method, b); }, TMP_2.$$arity = 2); Opal.defn(self, '$<=>', TMP_3 = function(other) { var $a, self = this; if ((($a = self['$equal?'](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 0}; return nil; }, TMP_3.$$arity = 1); Opal.defn(self, '$[]', TMP_4 = function(bit) { var self = this, min = nil, max = nil; bit = $scope.get('Opal')['$coerce_to!'](bit, $scope.get('Integer'), "to_int"); min = ((2)['$**'](30))['$-@'](); max = $rb_minus(((2)['$**'](30)), 1); return (bit < min || bit > max) ? 0 : (self >> bit) % 2; }, TMP_4.$$arity = 1); Opal.defn(self, '$+@', TMP_5 = function() { var self = this; return self; }, TMP_5.$$arity = 0); Opal.defn(self, '$-@', TMP_6 = function() { var self = this; return $rb_minus(0, self); }, TMP_6.$$arity = 0); Opal.defn(self, '$%', TMP_7 = function(other) { var self = this; return $rb_minus(self, $rb_times(other, self.$div(other))); }, TMP_7.$$arity = 1); Opal.defn(self, '$abs', TMP_8 = function $$abs() { var self = this; if ($rb_lt(self, 0)) { return self['$-@']() } else { return self }; }, TMP_8.$$arity = 0); Opal.defn(self, '$abs2', TMP_9 = function $$abs2() { var self = this; return $rb_times(self, self); }, TMP_9.$$arity = 0); Opal.defn(self, '$angle', TMP_10 = function $$angle() { var self = this; if ($rb_lt(self, 0)) { return (($scope.get('Math')).$$scope.get('PI')) } else { return 0 }; }, TMP_10.$$arity = 0); Opal.alias(self, 'arg', 'angle'); Opal.defn(self, '$ceil', TMP_11 = function $$ceil() { var self = this; return self.$to_f().$ceil(); }, TMP_11.$$arity = 0); Opal.defn(self, '$conj', TMP_12 = function $$conj() { var self = this; return self; }, TMP_12.$$arity = 0); Opal.alias(self, 'conjugate', 'conj'); Opal.defn(self, '$denominator', TMP_13 = function $$denominator() { var self = this; return self.$to_r().$denominator(); }, TMP_13.$$arity = 0); Opal.defn(self, '$div', TMP_14 = function $$div(other) { var self = this; if (other['$=='](0)) { self.$raise($scope.get('ZeroDivisionError'), "divided by o")}; return ($rb_divide(self, other)).$floor(); }, TMP_14.$$arity = 1); Opal.defn(self, '$divmod', TMP_15 = function $$divmod(other) { var self = this; return [self.$div(other), self['$%'](other)]; }, TMP_15.$$arity = 1); Opal.defn(self, '$fdiv', TMP_16 = function $$fdiv(other) { var self = this; return $rb_divide(self.$to_f(), other); }, TMP_16.$$arity = 1); Opal.defn(self, '$floor', TMP_17 = function $$floor() { var self = this; return self.$to_f().$floor(); }, TMP_17.$$arity = 0); Opal.defn(self, '$i', TMP_18 = function $$i() { var self = this; return self.$Complex(0, self); }, TMP_18.$$arity = 0); Opal.defn(self, '$imag', TMP_19 = function $$imag() { var self = this; return 0; }, TMP_19.$$arity = 0); Opal.alias(self, 'imaginary', 'imag'); Opal.defn(self, '$integer?', TMP_20 = function() { var self = this; return false; }, TMP_20.$$arity = 0); Opal.alias(self, 'magnitude', 'abs'); Opal.alias(self, 'modulo', '%'); Opal.defn(self, '$nonzero?', TMP_21 = function() { var $a, self = this; if ((($a = self['$zero?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self }; }, TMP_21.$$arity = 0); Opal.defn(self, '$numerator', TMP_22 = function $$numerator() { var self = this; return self.$to_r().$numerator(); }, TMP_22.$$arity = 0); Opal.alias(self, 'phase', 'arg'); Opal.defn(self, '$polar', TMP_23 = function $$polar() { var self = this; return [self.$abs(), self.$arg()]; }, TMP_23.$$arity = 0); Opal.defn(self, '$quo', TMP_24 = function $$quo(other) { var self = this; return $rb_divide($scope.get('Opal')['$coerce_to!'](self, $scope.get('Rational'), "to_r"), other); }, TMP_24.$$arity = 1); Opal.defn(self, '$real', TMP_25 = function $$real() { var self = this; return self; }, TMP_25.$$arity = 0); Opal.defn(self, '$real?', TMP_26 = function() { var self = this; return true; }, TMP_26.$$arity = 0); Opal.defn(self, '$rect', TMP_27 = function $$rect() { var self = this; return [self, 0]; }, TMP_27.$$arity = 0); Opal.alias(self, 'rectangular', 'rect'); Opal.defn(self, '$round', TMP_28 = function $$round(digits) { var self = this; return self.$to_f().$round(digits); }, TMP_28.$$arity = -1); Opal.defn(self, '$to_c', TMP_29 = function $$to_c() { var self = this; return self.$Complex(self, 0); }, TMP_29.$$arity = 0); Opal.defn(self, '$to_int', TMP_30 = function $$to_int() { var self = this; return self.$to_i(); }, TMP_30.$$arity = 0); Opal.defn(self, '$truncate', TMP_31 = function $$truncate() { var self = this; return self.$to_f().$truncate(); }, TMP_31.$$arity = 0); Opal.defn(self, '$zero?', TMP_32 = function() { var self = this; return self['$=='](0); }, TMP_32.$$arity = 0); Opal.defn(self, '$positive?', TMP_33 = function() { var self = this; return $rb_gt(self, 0); }, TMP_33.$$arity = 0); Opal.defn(self, '$negative?', TMP_34 = function() { var self = this; return $rb_lt(self, 0); }, TMP_34.$$arity = 0); Opal.defn(self, '$dup', TMP_35 = function $$dup() { var self = this; return self.$raise($scope.get('TypeError'), "can't dup " + (self.$class())); }, TMP_35.$$arity = 0); return (Opal.defn(self, '$clone', TMP_36 = function $$clone() { var self = this; return self.$raise($scope.get('TypeError'), "can't clone " + (self.$class())); }, TMP_36.$$arity = 0), nil) && 'clone'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/array"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$include', '$to_a', '$raise', '$===', '$replace', '$respond_to?', '$to_ary', '$coerce_to', '$coerce_to?', '$join', '$to_str', '$class', '$clone', '$hash', '$<=>', '$==', '$object_id', '$inspect', '$enum_for', '$coerce_to!', '$>', '$*', '$enumerator_size', '$empty?', '$size', '$eql?', '$length', '$begin', '$end', '$exclude_end?', '$flatten', '$__id__', '$[]', '$to_s', '$new', '$!', '$>=', '$**', '$delete_if', '$to_proc', '$each', '$reverse', '$rotate', '$rand', '$at', '$keep_if', '$shuffle!', '$dup', '$<', '$sort', '$sort_by', '$!=', '$times', '$[]=', '$<<', '$values', '$kind_of?', '$last', '$first', '$upto', '$reject', '$pristine']); self.$require("corelib/enumerable"); self.$require("corelib/numeric"); return (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_19, TMP_20, TMP_21, TMP_22, TMP_24, TMP_26, TMP_28, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_37, TMP_38, TMP_39, TMP_41, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51, TMP_52, TMP_53, TMP_54, TMP_55, TMP_56, TMP_58, TMP_59, TMP_60, TMP_62, TMP_64, TMP_65, TMP_66, TMP_67, TMP_68, TMP_70, TMP_72, TMP_73, TMP_74, TMP_75, TMP_77, TMP_78, TMP_79, TMP_82, TMP_83, TMP_85, TMP_87, TMP_88, TMP_89, TMP_90, TMP_91, TMP_92, TMP_93, TMP_95, TMP_96, TMP_97, TMP_98, TMP_101, TMP_102, TMP_103, TMP_104, TMP_107, TMP_108, TMP_109, TMP_111; def.length = nil; self.$include($scope.get('Enumerable')); def.$$is_array = true; function toArraySubclass(obj, klass) { if (klass.$$name === Opal.Array) { return obj; } else { return klass.$allocate().$replace((obj).$to_a()); } } Opal.defs(self, '$[]', TMP_1 = function($a_rest) { var self = this, objects; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } objects = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { objects[$arg_idx - 0] = arguments[$arg_idx]; } return toArraySubclass(objects, self); }, TMP_1.$$arity = -1); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(size, obj) { var $a, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (size == null) { size = nil; } if (obj == null) { obj = nil; } TMP_2.$$p = null; if ((($a = arguments.length > 2) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arguments.length) + " for 0..2)")}; if (arguments.length === 0) { self.splice(0, self.length); return self; } if ((($a = arguments.length === 1) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Array')['$==='](size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$replace(size.$to_a()); return self; } else if ((($a = size['$respond_to?']("to_ary")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$replace(size.$to_ary()); return self;}}; size = $scope.get('Opal').$coerce_to(size, $scope.get('Integer'), "to_int"); if ((($a = size < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "negative array size")}; self.splice(0, self.length); var i, value; if (block === nil) { for (i = 0; i < size; i++) { self.push(obj); } } else { for (i = 0, value; i < size; i++) { value = block(i); self[i] = value; } } return self; }, TMP_2.$$arity = -1); Opal.defs(self, '$try_convert', TMP_3 = function $$try_convert(obj) { var self = this; return $scope.get('Opal')['$coerce_to?'](obj, $scope.get('Array'), "to_ary"); }, TMP_3.$$arity = 1); Opal.defn(self, '$&', TMP_4 = function(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else { other = $scope.get('Opal').$coerce_to(other, $scope.get('Array'), "to_ary").$to_a() }; var result = [], hash = $hash2([], {}), i, length, item; for (i = 0, length = other.length; i < length; i++) { Opal.hash_put(hash, other[i], true); } for (i = 0, length = self.length; i < length; i++) { item = self[i]; if (Opal.hash_delete(hash, item) !== undefined) { result.push(item); } } return result; ; }, TMP_4.$$arity = 1); Opal.defn(self, '$|', TMP_5 = function(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else { other = $scope.get('Opal').$coerce_to(other, $scope.get('Array'), "to_ary").$to_a() }; var hash = $hash2([], {}), i, length, item; for (i = 0, length = self.length; i < length; i++) { Opal.hash_put(hash, self[i], true); } for (i = 0, length = other.length; i < length; i++) { Opal.hash_put(hash, other[i], true); } return hash.$keys(); ; }, TMP_5.$$arity = 1); Opal.defn(self, '$*', TMP_6 = function(other) { var $a, self = this; if ((($a = other['$respond_to?']("to_str")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$join(other.$to_str())}; other = $scope.get('Opal').$coerce_to(other, $scope.get('Integer'), "to_int"); if ((($a = other < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "negative argument")}; var result = [], converted = self.$to_a(); for (var i = 0; i < other; i++) { result = result.concat(converted); } return toArraySubclass(result, self.$class()); ; }, TMP_6.$$arity = 1); Opal.defn(self, '$+', TMP_7 = function(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else { other = $scope.get('Opal').$coerce_to(other, $scope.get('Array'), "to_ary").$to_a() }; return self.concat(other); }, TMP_7.$$arity = 1); Opal.defn(self, '$-', TMP_8 = function(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else { other = $scope.get('Opal').$coerce_to(other, $scope.get('Array'), "to_ary").$to_a() }; if ((($a = self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return []}; if ((($a = other.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$clone().$to_a()}; var result = [], hash = $hash2([], {}), i, length, item; for (i = 0, length = other.length; i < length; i++) { Opal.hash_put(hash, other[i], true); } for (i = 0, length = self.length; i < length; i++) { item = self[i]; if (Opal.hash_get(hash, item) === undefined) { result.push(item); } } return result; ; }, TMP_8.$$arity = 1); Opal.defn(self, '$<<', TMP_9 = function(object) { var self = this; self.push(object); return self; }, TMP_9.$$arity = 1); Opal.defn(self, '$<=>', TMP_10 = function(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else if ((($a = other['$respond_to?']("to_ary")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_ary().$to_a() } else { return nil }; if (self.$hash() === other.$hash()) { return 0; } var count = Math.min(self.length, other.length); for (var i = 0; i < count; i++) { var tmp = (self[i])['$<=>'](other[i]); if (tmp !== 0) { return tmp; } } return (self.length)['$<=>'](other.length); ; }, TMP_10.$$arity = 1); Opal.defn(self, '$==', TMP_11 = function(other) { var self = this; var recursed = {}; function _eqeq(array, other) { var i, length, a, b; if (array === other) return true; if (!other.$$is_array) { if ($scope.get('Opal')['$respond_to?'](other, "to_ary")) { return (other)['$=='](array); } else { return false; } } if (array.constructor !== Array) array = (array).$to_a(); if (other.constructor !== Array) other = (other).$to_a(); if (array.length !== other.length) { return false; } recursed[(array).$object_id()] = true; for (i = 0, length = array.length; i < length; i++) { a = array[i]; b = other[i]; if (a.$$is_array) { if (b.$$is_array && b.length !== a.length) { return false; } if (!recursed.hasOwnProperty((a).$object_id())) { if (!_eqeq(a, b)) { return false; } } } else { if (!(a)['$=='](b)) { return false; } } } return true; } return _eqeq(self, other); ; }, TMP_11.$$arity = 1); Opal.defn(self, '$[]', TMP_12 = function(index, length) { var self = this; var size = self.length, exclude, from, to, result; if (index.$$is_range) { exclude = index.exclude; from = $scope.get('Opal').$coerce_to(index.begin, $scope.get('Integer'), "to_int"); to = $scope.get('Opal').$coerce_to(index.end, $scope.get('Integer'), "to_int"); if (from < 0) { from += size; if (from < 0) { return nil; } } if (from > size) { return nil; } if (to < 0) { to += size; if (to < 0) { return []; } } if (!exclude) { to += 1; } result = self.slice(from, to) } else { index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (index < 0) { index += size; if (index < 0) { return nil; } } if (length === undefined) { if (index >= size || index < 0) { return nil; } return self[index]; } else { length = $scope.get('Opal').$coerce_to(length, $scope.get('Integer'), "to_int"); if (length < 0 || index > size || index < 0) { return nil; } result = self.slice(index, index + length); } } return toArraySubclass(result, self.$class()) ; }, TMP_12.$$arity = -2); Opal.defn(self, '$[]=', TMP_13 = function(index, value, extra) { var $a, self = this, data = nil, length = nil; var i, size = self.length; if ((($a = $scope.get('Range')['$==='](index)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Array')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = value.$to_a() } else if ((($a = value['$respond_to?']("to_ary")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = value.$to_ary().$to_a() } else { data = [value] }; var exclude = index.exclude, from = $scope.get('Opal').$coerce_to(index.begin, $scope.get('Integer'), "to_int"), to = $scope.get('Opal').$coerce_to(index.end, $scope.get('Integer'), "to_int"); if (from < 0) { from += size; if (from < 0) { self.$raise($scope.get('RangeError'), "" + (index.$inspect()) + " out of range"); } } if (to < 0) { to += size; } if (!exclude) { to += 1; } if (from > size) { for (i = size; i < from; i++) { self[i] = nil; } } if (to < 0) { self.splice.apply(self, [from, 0].concat(data)); } else { self.splice.apply(self, [from, to - from].concat(data)); } return value; ; } else { if ((($a = extra === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { length = 1 } else { length = value; value = extra; if ((($a = $scope.get('Array')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = value.$to_a() } else if ((($a = value['$respond_to?']("to_ary")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = value.$to_ary().$to_a() } else { data = [value] }; }; var old; index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); length = $scope.get('Opal').$coerce_to(length, $scope.get('Integer'), "to_int"); if (index < 0) { old = index; index += size; if (index < 0) { self.$raise($scope.get('IndexError'), "index " + (old) + " too small for array; minimum " + (-self.length)); } } if (length < 0) { self.$raise($scope.get('IndexError'), "negative length (" + (length) + ")") } if (index > size) { for (i = size; i < index; i++) { self[i] = nil; } } if (extra === undefined) { self[index] = value; } else { self.splice.apply(self, [index, length].concat(data)); } return value; }; }, TMP_13.$$arity = -3); Opal.defn(self, '$assoc', TMP_14 = function $$assoc(object) { var self = this; for (var i = 0, length = self.length, item; i < length; i++) { if (item = self[i], item.length && (item[0])['$=='](object)) { return item; } } return nil; }, TMP_14.$$arity = 1); Opal.defn(self, '$at', TMP_15 = function $$at(index) { var self = this; index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (index < 0) { index += self.length; } if (index < 0 || index >= self.length) { return nil; } return self[index]; }, TMP_15.$$arity = 1); Opal.defn(self, '$bsearch', TMP_16 = function $$bsearch() { var self = this, $iter = TMP_16.$$p, block = $iter || nil; TMP_16.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("bsearch") }; var min = 0, max = self.length, mid, val, ret, smaller = false, satisfied = nil; while (min < max) { mid = min + Math.floor((max - min) / 2); val = self[mid]; ret = block(val); if (ret === true) { satisfied = val; smaller = true; } else if (ret === false || ret === nil) { smaller = false; } else if (ret.$$is_number) { if (ret === 0) { return val; } smaller = (ret < 0); } else { self.$raise($scope.get('TypeError'), "wrong argument type " + ((ret).$class()) + " (must be numeric, true, false or nil)") } if (smaller) { max = mid; } else { min = mid + 1; } } return satisfied; }, TMP_16.$$arity = 0); Opal.defn(self, '$cycle', TMP_17 = function $$cycle(n) { var $a, $b, TMP_18, $c, self = this, $iter = TMP_17.$$p, block = $iter || nil; if (n == null) { n = nil; } TMP_17.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this, $c; if (n['$=='](nil)) { return (($scope.get('Float')).$$scope.get('INFINITY')) } else { n = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if ((($c = $rb_gt(n, 0)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return $rb_times(self.$enumerator_size(), n) } else { return 0 }; }}, TMP_18.$$s = self, TMP_18.$$arity = 0, TMP_18), $a).call($b, "cycle", n) }; if ((($a = ((($c = self['$empty?']()) !== false && $c !== nil && $c != null) ? $c : n['$=='](0))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; var i, length, value; if (n === nil) { while (true) { for (i = 0, length = self.length; i < length; i++) { value = Opal.yield1(block, self[i]); } } } else { n = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if (n <= 0) { return self; } while (n > 0) { for (i = 0, length = self.length; i < length; i++) { value = Opal.yield1(block, self[i]); } n--; } } return self; }, TMP_17.$$arity = -1); Opal.defn(self, '$clear', TMP_19 = function $$clear() { var self = this; self.splice(0, self.length); return self; }, TMP_19.$$arity = 0); Opal.defn(self, '$count', TMP_20 = function $$count(object) { var $a, $b, self = this, $iter = TMP_20.$$p, block = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; if (object == null) { object = nil; } TMP_20.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = object) !== false && $b !== nil && $b != null) ? $b : block)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'count', TMP_20, false)), $a.$$p = $iter, $a).apply($b, $zuper) } else { return self.$size() }; }, TMP_20.$$arity = -1); Opal.defn(self, '$initialize_copy', TMP_21 = function $$initialize_copy(other) { var self = this; return self.$replace(other); }, TMP_21.$$arity = 1); Opal.defn(self, '$collect', TMP_22 = function $$collect() { var $a, $b, TMP_23, self = this, $iter = TMP_22.$$p, block = $iter || nil; TMP_22.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_23 = function(){var self = TMP_23.$$s || this; return self.$size()}, TMP_23.$$s = self, TMP_23.$$arity = 0, TMP_23), $a).call($b, "collect") }; var result = []; for (var i = 0, length = self.length; i < length; i++) { var value = Opal.yield1(block, self[i]); result.push(value); } return result; }, TMP_22.$$arity = 0); Opal.defn(self, '$collect!', TMP_24 = function() { var $a, $b, TMP_25, self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_25 = function(){var self = TMP_25.$$s || this; return self.$size()}, TMP_25.$$s = self, TMP_25.$$arity = 0, TMP_25), $a).call($b, "collect!") }; for (var i = 0, length = self.length; i < length; i++) { var value = Opal.yield1(block, self[i]); self[i] = value; } return self; }, TMP_24.$$arity = 0); function binomial_coefficient(n, k) { if (n === k || k === 0) { return 1; } if (k > 0 && n > k) { return binomial_coefficient(n - 1, k - 1) + binomial_coefficient(n - 1, k); } return 0; } Opal.defn(self, '$combination', TMP_26 = function $$combination(n) { var $a, $b, TMP_27, self = this, $iter = TMP_26.$$p, $yield = $iter || nil, num = nil; TMP_26.$$p = null; num = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if (($yield !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_27 = function(){var self = TMP_27.$$s || this; return binomial_coefficient(self.length, num);}, TMP_27.$$s = self, TMP_27.$$arity = 0, TMP_27), $a).call($b, "combination", num) }; var i, length, stack, chosen, lev, done, next; if (num === 0) { Opal.yield1($yield, []) } else if (num === 1) { for (i = 0, length = self.length; i < length; i++) { Opal.yield1($yield, [self[i]]) } } else if (num === self.length) { Opal.yield1($yield, self.slice()) } else if (num >= 0 && num < self.length) { stack = []; for (i = 0; i <= num + 1; i++) { stack.push(0); } chosen = []; lev = 0; done = false; stack[0] = -1; while (!done) { chosen[lev] = self[stack[lev+1]]; while (lev < num - 1) { lev++; next = stack[lev+1] = stack[lev] + 1; chosen[lev] = self[next]; } Opal.yield1($yield, chosen.slice()) lev++; do { done = (lev === 0); stack[lev]++; lev--; } while ( stack[lev+1] + num === self.length + lev + 1 ); } } ; return self; }, TMP_26.$$arity = 1); Opal.defn(self, '$repeated_combination', TMP_28 = function $$repeated_combination(n) { var $a, $b, TMP_29, self = this, $iter = TMP_28.$$p, $yield = $iter || nil, num = nil; TMP_28.$$p = null; num = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if (($yield !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_29 = function(){var self = TMP_29.$$s || this; return binomial_coefficient(self.length + num - 1, num);}, TMP_29.$$s = self, TMP_29.$$arity = 0, TMP_29), $a).call($b, "repeated_combination", num) }; function iterate(max, from, buffer, self) { if (buffer.length == max) { var copy = buffer.slice(); Opal.yield1($yield, copy) return; } for (var i = from; i < self.length; i++) { buffer.push(self[i]); iterate(max, i, buffer, self); buffer.pop(); } } if (num >= 0) { iterate(num, 0, [], self); } return self; }, TMP_28.$$arity = 1); Opal.defn(self, '$compact', TMP_30 = function $$compact() { var self = this; var result = []; for (var i = 0, length = self.length, item; i < length; i++) { if ((item = self[i]) !== nil) { result.push(item); } } return result; }, TMP_30.$$arity = 0); Opal.defn(self, '$compact!', TMP_31 = function() { var self = this; var original = self.length; for (var i = 0, length = self.length; i < length; i++) { if (self[i] === nil) { self.splice(i, 1); length--; i--; } } return self.length === original ? nil : self; }, TMP_31.$$arity = 0); Opal.defn(self, '$concat', TMP_32 = function $$concat(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else { other = $scope.get('Opal').$coerce_to(other, $scope.get('Array'), "to_ary").$to_a() }; for (var i = 0, length = other.length; i < length; i++) { self.push(other[i]); } return self; }, TMP_32.$$arity = 1); Opal.defn(self, '$delete', TMP_33 = function(object) { var self = this, $iter = TMP_33.$$p, $yield = $iter || nil; TMP_33.$$p = null; var original = self.length; for (var i = 0, length = original; i < length; i++) { if ((self[i])['$=='](object)) { self.splice(i, 1); length--; i--; } } if (self.length === original) { if (($yield !== nil)) { return Opal.yieldX($yield, []); } return nil; } return object; ; }, TMP_33.$$arity = 1); Opal.defn(self, '$delete_at', TMP_34 = function $$delete_at(index) { var self = this; index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (index < 0) { index += self.length; } if (index < 0 || index >= self.length) { return nil; } var result = self[index]; self.splice(index, 1); return result; ; }, TMP_34.$$arity = 1); Opal.defn(self, '$delete_if', TMP_35 = function $$delete_if() { var $a, $b, TMP_36, self = this, $iter = TMP_35.$$p, block = $iter || nil; TMP_35.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_36 = function(){var self = TMP_36.$$s || this; return self.$size()}, TMP_36.$$s = self, TMP_36.$$arity = 0, TMP_36), $a).call($b, "delete_if") }; for (var i = 0, length = self.length, value; i < length; i++) { value = block(self[i]); if (value !== false && value !== nil) { self.splice(i, 1); length--; i--; } } return self; }, TMP_35.$$arity = 0); Opal.defn(self, '$drop', TMP_37 = function $$drop(number) { var self = this; if (number < 0) { self.$raise($scope.get('ArgumentError')) } return self.slice(number); ; }, TMP_37.$$arity = 1); Opal.defn(self, '$dup', TMP_38 = function $$dup() { var $a, $b, self = this, $iter = TMP_38.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_38.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ( self.$$class === Opal.Array && self.$allocate.$$pristine && self.$copy_instance_variables.$$pristine && self.$initialize_dup.$$pristine ) return self.slice(0); return ($a = ($b = self, Opal.find_super_dispatcher(self, 'dup', TMP_38, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_38.$$arity = 0); Opal.defn(self, '$each', TMP_39 = function $$each() { var $a, $b, TMP_40, self = this, $iter = TMP_39.$$p, block = $iter || nil; TMP_39.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_40 = function(){var self = TMP_40.$$s || this; return self.$size()}, TMP_40.$$s = self, TMP_40.$$arity = 0, TMP_40), $a).call($b, "each") }; for (var i = 0, length = self.length; i < length; i++) { var value = Opal.yield1(block, self[i]); } return self; }, TMP_39.$$arity = 0); Opal.defn(self, '$each_index', TMP_41 = function $$each_index() { var $a, $b, TMP_42, self = this, $iter = TMP_41.$$p, block = $iter || nil; TMP_41.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_42 = function(){var self = TMP_42.$$s || this; return self.$size()}, TMP_42.$$s = self, TMP_42.$$arity = 0, TMP_42), $a).call($b, "each_index") }; for (var i = 0, length = self.length; i < length; i++) { var value = Opal.yield1(block, i); } return self; }, TMP_41.$$arity = 0); Opal.defn(self, '$empty?', TMP_43 = function() { var self = this; return self.length === 0; }, TMP_43.$$arity = 0); Opal.defn(self, '$eql?', TMP_44 = function(other) { var self = this; var recursed = {}; function _eql(array, other) { var i, length, a, b; if (!other.$$is_array) { return false; } other = other.$to_a(); if (array.length !== other.length) { return false; } recursed[(array).$object_id()] = true; for (i = 0, length = array.length; i < length; i++) { a = array[i]; b = other[i]; if (a.$$is_array) { if (b.$$is_array && b.length !== a.length) { return false; } if (!recursed.hasOwnProperty((a).$object_id())) { if (!_eql(a, b)) { return false; } } } else { if (!(a)['$eql?'](b)) { return false; } } } return true; } return _eql(self, other); }, TMP_44.$$arity = 1); Opal.defn(self, '$fetch', TMP_45 = function $$fetch(index, defaults) { var self = this, $iter = TMP_45.$$p, block = $iter || nil; TMP_45.$$p = null; var original = index; index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (index < 0) { index += self.length; } if (index >= 0 && index < self.length) { return self[index]; } if (block !== nil) { return block(original); } if (defaults != null) { return defaults; } if (self.length === 0) { self.$raise($scope.get('IndexError'), "index " + (original) + " outside of array bounds: 0...0") } else { self.$raise($scope.get('IndexError'), "index " + (original) + " outside of array bounds: -" + (self.length) + "..." + (self.length)); } ; }, TMP_45.$$arity = -2); Opal.defn(self, '$fill', TMP_46 = function $$fill($a_rest) { var $b, $c, self = this, args, $iter = TMP_46.$$p, block = $iter || nil, one = nil, two = nil, obj = nil, left = nil, right = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_46.$$p = null; var i, length, value; if (block !== false && block !== nil && block != null) { if ((($b = args.length > 2) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (args.$length()) + " for 0..2)")}; $c = args, $b = Opal.to_ary($c), one = ($b[0] == null ? nil : $b[0]), two = ($b[1] == null ? nil : $b[1]), $c; } else { if ((($b = args.length == 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (0 for 1..3)") } else if ((($b = args.length > 3) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (args.$length()) + " for 1..3)")}; $c = args, $b = Opal.to_ary($c), obj = ($b[0] == null ? nil : $b[0]), one = ($b[1] == null ? nil : $b[1]), two = ($b[2] == null ? nil : $b[2]), $c; }; if ((($b = $scope.get('Range')['$==='](one)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (two !== false && two !== nil && two != null) { self.$raise($scope.get('TypeError'), "length invalid with range")}; left = $scope.get('Opal').$coerce_to(one.$begin(), $scope.get('Integer'), "to_int"); if ((($b = left < 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { left += self.length;}; if ((($b = left < 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('RangeError'), "" + (one.$inspect()) + " out of range")}; right = $scope.get('Opal').$coerce_to(one.$end(), $scope.get('Integer'), "to_int"); if ((($b = right < 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { right += self.length;}; if ((($b = one['$exclude_end?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { right += 1; }; if ((($b = right <= left) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self}; } else if (one !== false && one !== nil && one != null) { left = $scope.get('Opal').$coerce_to(one, $scope.get('Integer'), "to_int"); if ((($b = left < 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { left += self.length;}; if ((($b = left < 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { left = 0}; if (two !== false && two !== nil && two != null) { right = $scope.get('Opal').$coerce_to(two, $scope.get('Integer'), "to_int"); if ((($b = right == 0) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self}; right += left; } else { right = self.length }; } else { left = 0; right = self.length; }; if ((($b = left > self.length) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { for (i = self.length; i < right; i++) { self[i] = nil; } ;}; if ((($b = right > self.length) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.length = right}; if (block !== false && block !== nil && block != null) { for (length = self.length; left < right; left++) { value = block(left); self[left] = value; } ; } else { for (length = self.length; left < right; left++) { self[left] = obj; } ; }; return self; }, TMP_46.$$arity = -1); Opal.defn(self, '$first', TMP_47 = function $$first(count) { var self = this; if (count == null) { return self.length === 0 ? nil : self[0]; } count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); if (count < 0) { self.$raise($scope.get('ArgumentError'), "negative array size"); } return self.slice(0, count); }, TMP_47.$$arity = -1); Opal.defn(self, '$flatten', TMP_48 = function $$flatten(level) { var self = this; function _flatten(array, level) { var result = [], i, length, item, ary; array = (array).$to_a(); for (i = 0, length = array.length; i < length; i++) { item = array[i]; if (!$scope.get('Opal')['$respond_to?'](item, "to_ary")) { result.push(item); continue; } ary = (item).$to_ary(); if (ary === nil) { result.push(item); continue; } if (!ary.$$is_array) { self.$raise($scope.get('TypeError')); } if (ary === self) { self.$raise($scope.get('ArgumentError')); } switch (level) { case undefined: result = result.concat(_flatten(ary)); break; case 0: result.push(ary); break; default: result.push.apply(result, _flatten(ary, level - 1)); } } return result; } if (level !== undefined) { level = $scope.get('Opal').$coerce_to(level, $scope.get('Integer'), "to_int"); } return toArraySubclass(_flatten(self, level), self.$class()); }, TMP_48.$$arity = -1); Opal.defn(self, '$flatten!', TMP_49 = function(level) { var self = this; var flattened = self.$flatten(level); if (self.length == flattened.length) { for (var i = 0, length = self.length; i < length; i++) { if (self[i] !== flattened[i]) { break; } } if (i == length) { return nil; } } self.$replace(flattened); ; return self; }, TMP_49.$$arity = -1); Opal.defn(self, '$hash', TMP_50 = function $$hash() { var self = this; var top = (Opal.hash_ids == undefined), result = ['A'], hash_id = self.$object_id(), item, i, key; try { if (top) { Opal.hash_ids = {}; } if (Opal.hash_ids.hasOwnProperty(hash_id)) { return 'self'; } for (key in Opal.hash_ids) { if (Opal.hash_ids.hasOwnProperty(key)) { item = Opal.hash_ids[key]; if (self['$eql?'](item)) { return 'self'; } } } Opal.hash_ids[hash_id] = self; for (i = 0; i < self.length; i++) { item = self[i]; result.push(item.$hash()); } return result.join(','); } finally { if (top) { delete Opal.hash_ids; } } }, TMP_50.$$arity = 0); Opal.defn(self, '$include?', TMP_51 = function(member) { var self = this; for (var i = 0, length = self.length; i < length; i++) { if ((self[i])['$=='](member)) { return true; } } return false; }, TMP_51.$$arity = 1); Opal.defn(self, '$index', TMP_52 = function $$index(object) { var self = this, $iter = TMP_52.$$p, block = $iter || nil; TMP_52.$$p = null; var i, length, value; if (object != null) { for (i = 0, length = self.length; i < length; i++) { if ((self[i])['$=='](object)) { return i; } } } else if (block !== nil) { for (i = 0, length = self.length; i < length; i++) { value = block(self[i]); if (value !== false && value !== nil) { return i; } } } else { return self.$enum_for("index"); } return nil; }, TMP_52.$$arity = -1); Opal.defn(self, '$insert', TMP_53 = function $$insert(index, $a_rest) { var self = this, objects; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } objects = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { objects[$arg_idx - 1] = arguments[$arg_idx]; } index = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (objects.length > 0) { if (index < 0) { index += self.length + 1; if (index < 0) { self.$raise($scope.get('IndexError'), "" + (index) + " is out of bounds"); } } if (index > self.length) { for (var i = self.length; i < index; i++) { self.push(nil); } } self.splice.apply(self, [index, 0].concat(objects)); } ; return self; }, TMP_53.$$arity = -2); Opal.defn(self, '$inspect', TMP_54 = function $$inspect() { var self = this; var result = [], id = self.$__id__(); for (var i = 0, length = self.length; i < length; i++) { var item = self['$[]'](i); if ((item).$__id__() === id) { result.push('[...]'); } else { result.push((item).$inspect()); } } return '[' + result.join(', ') + ']'; ; }, TMP_54.$$arity = 0); Opal.defn(self, '$join', TMP_55 = function $$join(sep) { var $a, self = this; if ($gvars[","] == null) $gvars[","] = nil; if (sep == null) { sep = nil; } if ((($a = self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ""}; if ((($a = sep === nil) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sep = $gvars[","]}; var result = []; var i, length, item, tmp; for (i = 0, length = self.length; i < length; i++) { item = self[i]; if ($scope.get('Opal')['$respond_to?'](item, "to_str")) { tmp = (item).$to_str(); if (tmp !== nil) { result.push((tmp).$to_s()); continue; } } if ($scope.get('Opal')['$respond_to?'](item, "to_ary")) { tmp = (item).$to_ary(); if (tmp === self) { self.$raise($scope.get('ArgumentError')); } if (tmp !== nil) { result.push((tmp).$join(sep)); continue; } } if ($scope.get('Opal')['$respond_to?'](item, "to_s")) { tmp = (item).$to_s(); if (tmp !== nil) { result.push(tmp); continue; } } self.$raise($scope.get('NoMethodError').$new("" + ($scope.get('Opal').$inspect(item)) + " doesn't respond to #to_str, #to_ary or #to_s", "to_str")); } if (sep === nil) { return result.join(''); } else { return result.join($scope.get('Opal')['$coerce_to!'](sep, $scope.get('String'), "to_str").$to_s()); } ; }, TMP_55.$$arity = -1); Opal.defn(self, '$keep_if', TMP_56 = function $$keep_if() { var $a, $b, TMP_57, self = this, $iter = TMP_56.$$p, block = $iter || nil; TMP_56.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_57 = function(){var self = TMP_57.$$s || this; return self.$size()}, TMP_57.$$s = self, TMP_57.$$arity = 0, TMP_57), $a).call($b, "keep_if") }; for (var i = 0, length = self.length, value; i < length; i++) { value = block(self[i]); if (value === false || value === nil) { self.splice(i, 1); length--; i--; } } return self; }, TMP_56.$$arity = 0); Opal.defn(self, '$last', TMP_58 = function $$last(count) { var self = this; if (count == null) { return self.length === 0 ? nil : self[self.length - 1]; } count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); if (count < 0) { self.$raise($scope.get('ArgumentError'), "negative array size"); } if (count > self.length) { count = self.length; } return self.slice(self.length - count, self.length); }, TMP_58.$$arity = -1); Opal.defn(self, '$length', TMP_59 = function $$length() { var self = this; return self.length; }, TMP_59.$$arity = 0); Opal.alias(self, 'map', 'collect'); Opal.alias(self, 'map!', 'collect!'); // Returns the product of from, from-1, ..., from - how_many + 1. function descending_factorial(from, how_many) { var count = how_many >= 0 ? 1 : 0; while (how_many) { count *= from; from--; how_many--; } return count; } Opal.defn(self, '$permutation', TMP_60 = function $$permutation(num) { var $a, $b, TMP_61, self = this, $iter = TMP_60.$$p, block = $iter || nil, perm = nil, used = nil; TMP_60.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_61 = function(){var self = TMP_61.$$s || this; return descending_factorial(self.length, num === undefined ? self.length : num);}, TMP_61.$$s = self, TMP_61.$$arity = 0, TMP_61), $a).call($b, "permutation", num) }; var permute, offensive, output; if (num === undefined) { num = self.length; } else { num = $scope.get('Opal').$coerce_to(num, $scope.get('Integer'), "to_int") } if (num < 0 || self.length < num) { // no permutations, yield nothing } else if (num === 0) { // exactly one permutation: the zero-length array Opal.yield1(block, []) } else if (num === 1) { // this is a special, easy case for (var i = 0; i < self.length; i++) { Opal.yield1(block, [self[i]]) } } else { // this is the general case perm = $scope.get('Array').$new(num) used = $scope.get('Array').$new(self.length, false) permute = function(num, perm, index, used, blk) { self = this; for(var i = 0; i < self.length; i++){ if(used['$[]'](i)['$!']()) { perm[index] = i; if(index < num - 1) { used[i] = true; permute.call(self, num, perm, index + 1, used, blk); used[i] = false; } else { output = []; for (var j = 0; j < perm.length; j++) { output.push(self[perm[j]]); } Opal.yield1(blk, output); } } } } if ((block !== nil)) { // offensive (both definitions) copy. offensive = self.slice(); permute.call(offensive, num, perm, 0, used, block); } else { permute.call(self, num, perm, 0, used, block); } } ; return self; }, TMP_60.$$arity = -1); Opal.defn(self, '$repeated_permutation', TMP_62 = function $$repeated_permutation(n) { var $a, $b, TMP_63, self = this, $iter = TMP_62.$$p, $yield = $iter || nil, num = nil; TMP_62.$$p = null; num = $scope.get('Opal')['$coerce_to!'](n, $scope.get('Integer'), "to_int"); if (($yield !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_63 = function(){var self = TMP_63.$$s || this, $c; if ((($c = $rb_ge(num, 0)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$size()['$**'](num) } else { return 0 }}, TMP_63.$$s = self, TMP_63.$$arity = 0, TMP_63), $a).call($b, "repeated_permutation", num) }; function iterate(max, buffer, self) { if (buffer.length == max) { var copy = buffer.slice(); Opal.yield1($yield, copy) return; } for (var i = 0; i < self.length; i++) { buffer.push(self[i]); iterate(max, buffer, self); buffer.pop(); } } iterate(num, [], self.slice()); return self; }, TMP_62.$$arity = 1); Opal.defn(self, '$pop', TMP_64 = function $$pop(count) { var $a, self = this; if ((($a = count === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; return self.pop();}; count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); if ((($a = count < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "negative array size")}; if ((($a = self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return []}; if ((($a = count > self.length) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.splice(0, self.length); } else { return self.splice(self.length - count, self.length); }; }, TMP_64.$$arity = -1); Opal.defn(self, '$product', TMP_65 = function $$product($a_rest) { var self = this, args, $iter = TMP_65.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_65.$$p = null; var result = (block !== nil) ? null : [], n = args.length + 1, counters = new Array(n), lengths = new Array(n), arrays = new Array(n), i, m, subarray, len, resultlen = 1; arrays[0] = self; for (i = 1; i < n; i++) { arrays[i] = $scope.get('Opal').$coerce_to(args[i - 1], $scope.get('Array'), "to_ary"); } for (i = 0; i < n; i++) { len = arrays[i].length; if (len === 0) { return result || self; } resultlen *= len; if (resultlen > 2147483647) { self.$raise($scope.get('RangeError'), "too big to product") } lengths[i] = len; counters[i] = 0; } outer_loop: for (;;) { subarray = []; for (i = 0; i < n; i++) { subarray.push(arrays[i][counters[i]]); } if (result) { result.push(subarray); } else { Opal.yield1(block, subarray) } m = n - 1; counters[m]++; while (counters[m] === lengths[m]) { counters[m] = 0; if (--m < 0) break outer_loop; counters[m]++; } } return result || self; ; }, TMP_65.$$arity = -1); Opal.defn(self, '$push', TMP_66 = function $$push($a_rest) { var self = this, objects; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } objects = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { objects[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = 0, length = objects.length; i < length; i++) { self.push(objects[i]); } return self; }, TMP_66.$$arity = -1); Opal.defn(self, '$rassoc', TMP_67 = function $$rassoc(object) { var self = this; for (var i = 0, length = self.length, item; i < length; i++) { item = self[i]; if (item.length && item[1] !== undefined) { if ((item[1])['$=='](object)) { return item; } } } return nil; }, TMP_67.$$arity = 1); Opal.defn(self, '$reject', TMP_68 = function $$reject() { var $a, $b, TMP_69, self = this, $iter = TMP_68.$$p, block = $iter || nil; TMP_68.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_69 = function(){var self = TMP_69.$$s || this; return self.$size()}, TMP_69.$$s = self, TMP_69.$$arity = 0, TMP_69), $a).call($b, "reject") }; var result = []; for (var i = 0, length = self.length, value; i < length; i++) { value = block(self[i]); if (value === false || value === nil) { result.push(self[i]); } } return result; }, TMP_68.$$arity = 0); Opal.defn(self, '$reject!', TMP_70 = function() { var $a, $b, TMP_71, $c, self = this, $iter = TMP_70.$$p, block = $iter || nil, original = nil; TMP_70.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_71 = function(){var self = TMP_71.$$s || this; return self.$size()}, TMP_71.$$s = self, TMP_71.$$arity = 0, TMP_71), $a).call($b, "reject!") }; original = self.$length(); ($a = ($c = self).$delete_if, $a.$$p = block.$to_proc(), $a).call($c); if (self.$length()['$=='](original)) { return nil } else { return self }; }, TMP_70.$$arity = 0); Opal.defn(self, '$replace', TMP_72 = function $$replace(other) { var $a, self = this; if ((($a = $scope.get('Array')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { other = other.$to_a() } else { other = $scope.get('Opal').$coerce_to(other, $scope.get('Array'), "to_ary").$to_a() }; self.splice(0, self.length); self.push.apply(self, other); return self; }, TMP_72.$$arity = 1); Opal.defn(self, '$reverse', TMP_73 = function $$reverse() { var self = this; return self.slice(0).reverse(); }, TMP_73.$$arity = 0); Opal.defn(self, '$reverse!', TMP_74 = function() { var self = this; return self.reverse(); }, TMP_74.$$arity = 0); Opal.defn(self, '$reverse_each', TMP_75 = function $$reverse_each() { var $a, $b, TMP_76, $c, self = this, $iter = TMP_75.$$p, block = $iter || nil; TMP_75.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_76 = function(){var self = TMP_76.$$s || this; return self.$size()}, TMP_76.$$s = self, TMP_76.$$arity = 0, TMP_76), $a).call($b, "reverse_each") }; ($a = ($c = self.$reverse()).$each, $a.$$p = block.$to_proc(), $a).call($c); return self; }, TMP_75.$$arity = 0); Opal.defn(self, '$rindex', TMP_77 = function $$rindex(object) { var self = this, $iter = TMP_77.$$p, block = $iter || nil; TMP_77.$$p = null; var i, value; if (object != null) { for (i = self.length - 1; i >= 0; i--) { if (i >= self.length) { break; } if ((self[i])['$=='](object)) { return i; } } } else if (block !== nil) { for (i = self.length - 1; i >= 0; i--) { if (i >= self.length) { break; } value = block(self[i]); if (value !== false && value !== nil) { return i; } } } else if (object == null) { return self.$enum_for("rindex"); } return nil; }, TMP_77.$$arity = -1); Opal.defn(self, '$rotate', TMP_78 = function $$rotate(n) { var self = this; if (n == null) { n = 1; } n = $scope.get('Opal').$coerce_to(n, $scope.get('Integer'), "to_int"); var ary, idx, firstPart, lastPart; if (self.length === 1) { return self.slice(); } if (self.length === 0) { return []; } ary = self.slice(); idx = n % ary.length; firstPart = ary.slice(idx); lastPart = ary.slice(0, idx); return firstPart.concat(lastPart); }, TMP_78.$$arity = -1); Opal.defn(self, '$rotate!', TMP_79 = function(cnt) { var self = this, ary = nil; if (cnt == null) { cnt = 1; } if (self.length === 0 || self.length === 1) { return self; } cnt = $scope.get('Opal').$coerce_to(cnt, $scope.get('Integer'), "to_int"); ary = self.$rotate(cnt); return self.$replace(ary); }, TMP_79.$$arity = -1); (function($base, $super) { function $SampleRandom(){}; var self = $SampleRandom = $klass($base, $super, 'SampleRandom', $SampleRandom); var def = self.$$proto, $scope = self.$$scope, TMP_80, TMP_81; def.rng = nil; Opal.defn(self, '$initialize', TMP_80 = function $$initialize(rng) { var self = this; return self.rng = rng; }, TMP_80.$$arity = 1); return (Opal.defn(self, '$rand', TMP_81 = function $$rand(size) { var $a, self = this, random = nil; random = $scope.get('Opal').$coerce_to(self.rng.$rand(size), $scope.get('Integer'), "to_int"); if ((($a = random < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('RangeError'), "random value must be >= 0")}; if ((($a = random < size) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('RangeError'), "random value must be less than Array size") }; return random; }, TMP_81.$$arity = 1), nil) && 'rand'; })($scope.base, null); Opal.defn(self, '$sample', TMP_82 = function $$sample(count, options) { var $a, $b, self = this, o = nil, rng = nil; if ((($a = count === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$at($scope.get('Kernel').$rand(self.length))}; if ((($a = options === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = (o = $scope.get('Opal')['$coerce_to?'](count, $scope.get('Hash'), "to_hash"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { options = o; count = nil; } else { options = nil; count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); } } else { count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); options = $scope.get('Opal').$coerce_to(options, $scope.get('Hash'), "to_hash"); }; if ((($a = (($b = count !== false && count !== nil && count != null) ? count < 0 : count)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "count must be greater than 0")}; if (options !== false && options !== nil && options != null) { rng = options['$[]']("random")}; if ((($a = (($b = rng !== false && rng !== nil && rng != null) ? rng['$respond_to?']("rand") : rng)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { rng = $scope.get('SampleRandom').$new(rng) } else { rng = $scope.get('Kernel') }; if (count !== false && count !== nil && count != null) { } else { return self[rng.$rand(self.length)] }; var abandon, spin, result, i, j, k, targetIndex, oldValue; if (count > self.length) { count = self.length; } switch (count) { case 0: return []; break; case 1: return [self[rng.$rand(self.length)]]; break; case 2: i = rng.$rand(self.length); j = rng.$rand(self.length); if (i === j) { j = i === 0 ? i + 1 : i - 1; } return [self[i], self[j]]; break; default: if (self.length / count > 3) { abandon = false; spin = 0; result = $scope.get('Array').$new(count); i = 1; result[0] = rng.$rand(self.length); while (i < count) { k = rng.$rand(self.length); j = 0; while (j < i) { while (k === result[j]) { spin++; if (spin > 100) { abandon = true; break; } k = rng.$rand(self.length); } if (abandon) { break; } j++; } if (abandon) { break; } result[i] = k; i++; } if (!abandon) { i = 0; while (i < count) { result[i] = self[result[i]]; i++; } return result; } } result = self.slice(); for (var c = 0; c < count; c++) { targetIndex = rng.$rand(self.length); oldValue = result[c]; result[c] = result[targetIndex]; result[targetIndex] = oldValue; } return count === self.length ? result : (result)['$[]'](0, count); } }, TMP_82.$$arity = -1); Opal.defn(self, '$select', TMP_83 = function $$select() { var $a, $b, TMP_84, self = this, $iter = TMP_83.$$p, block = $iter || nil; TMP_83.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_84 = function(){var self = TMP_84.$$s || this; return self.$size()}, TMP_84.$$s = self, TMP_84.$$arity = 0, TMP_84), $a).call($b, "select") }; var result = []; for (var i = 0, length = self.length, item, value; i < length; i++) { item = self[i]; value = Opal.yield1(block, item); if (value !== false && value !== nil) { result.push(item); } } return result; }, TMP_83.$$arity = 0); Opal.defn(self, '$select!', TMP_85 = function() { var $a, $b, TMP_86, $c, self = this, $iter = TMP_85.$$p, block = $iter || nil; TMP_85.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_86 = function(){var self = TMP_86.$$s || this; return self.$size()}, TMP_86.$$s = self, TMP_86.$$arity = 0, TMP_86), $a).call($b, "select!") }; var original = self.length; ($a = ($c = self).$keep_if, $a.$$p = block.$to_proc(), $a).call($c); return self.length === original ? nil : self; }, TMP_85.$$arity = 0); Opal.defn(self, '$shift', TMP_87 = function $$shift(count) { var $a, self = this; if ((($a = count === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; return self.shift();}; count = $scope.get('Opal').$coerce_to(count, $scope.get('Integer'), "to_int"); if ((($a = count < 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "negative array size")}; if ((($a = self.length === 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return []}; return self.splice(0, count); }, TMP_87.$$arity = -1); Opal.alias(self, 'size', 'length'); Opal.defn(self, '$shuffle', TMP_88 = function $$shuffle(rng) { var self = this; return self.$dup().$to_a()['$shuffle!'](rng); }, TMP_88.$$arity = -1); Opal.defn(self, '$shuffle!', TMP_89 = function(rng) { var self = this; var randgen, i = self.length, j, tmp; if (rng !== undefined) { rng = $scope.get('Opal')['$coerce_to?'](rng, $scope.get('Hash'), "to_hash"); if (rng !== nil) { rng = rng['$[]']("random"); if (rng !== nil && rng['$respond_to?']("rand")) { randgen = rng; } } } while (i) { if (randgen) { j = randgen.$rand(i).$to_int(); if (j < 0) { self.$raise($scope.get('RangeError'), "random number too small " + (j)) } if (j >= i) { self.$raise($scope.get('RangeError'), "random number too big " + (j)) } } else { j = Math.floor(Math.random() * i); } tmp = self[--i]; self[i] = self[j]; self[j] = tmp; } return self; ; }, TMP_89.$$arity = -1); Opal.alias(self, 'slice', '[]'); Opal.defn(self, '$slice!', TMP_90 = function(index, length) { var $a, self = this, result = nil, range = nil, range_start = nil, range_end = nil, start = nil; result = nil; if ((($a = length === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Range')['$==='](index)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { range = index; result = self['$[]'](range); range_start = $scope.get('Opal').$coerce_to(range.$begin(), $scope.get('Integer'), "to_int"); range_end = $scope.get('Opal').$coerce_to(range.$end(), $scope.get('Integer'), "to_int"); if (range_start < 0) { range_start += self.length; } if (range_end < 0) { range_end += self.length; } else if (range_end >= self.length) { range_end = self.length - 1; if (range.exclude) { range_end += 1; } } var range_length = range_end - range_start; if (range.exclude) { range_end -= 1; } else { range_length += 1; } if (range_start < self.length && range_start >= 0 && range_end < self.length && range_end >= 0 && range_length > 0) { self.splice(range_start, range_length); } } else { start = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); if (start < 0) { start += self.length; } if (start < 0 || start >= self.length) { return nil; } result = self[start]; if (start === 0) { self.shift(); } else { self.splice(start, 1); } } } else { start = $scope.get('Opal').$coerce_to(index, $scope.get('Integer'), "to_int"); length = $scope.get('Opal').$coerce_to(length, $scope.get('Integer'), "to_int"); if (length < 0) { return nil; } var end = start + length; result = self['$[]'](start, length); if (start < 0) { start += self.length; } if (start + length > self.length) { length = self.length - start; } if (start < self.length && start >= 0) { self.splice(start, length); } }; return result; }, TMP_90.$$arity = -2); Opal.defn(self, '$sort', TMP_91 = function $$sort() { var $a, self = this, $iter = TMP_91.$$p, block = $iter || nil; TMP_91.$$p = null; if ((($a = self.length > 1) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return self }; if (block === nil) { block = function(a, b) { return (a)['$<=>'](b); }; } return self.slice().sort(function(x, y) { var ret = block(x, y); if (ret === nil) { self.$raise($scope.get('ArgumentError'), "comparison of " + ((x).$inspect()) + " with " + ((y).$inspect()) + " failed"); } return $rb_gt(ret, 0) ? 1 : ($rb_lt(ret, 0) ? -1 : 0); }); ; }, TMP_91.$$arity = 0); Opal.defn(self, '$sort!', TMP_92 = function() { var $a, $b, self = this, $iter = TMP_92.$$p, block = $iter || nil; TMP_92.$$p = null; var result; if ((block !== nil)) { result = ($a = ($b = (self.slice())).$sort, $a.$$p = block.$to_proc(), $a).call($b); } else { result = (self.slice()).$sort(); } self.length = 0; for(var i = 0, length = result.length; i < length; i++) { self.push(result[i]); } return self; ; }, TMP_92.$$arity = 0); Opal.defn(self, '$sort_by!', TMP_93 = function() { var $a, $b, TMP_94, $c, self = this, $iter = TMP_93.$$p, block = $iter || nil; TMP_93.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_94 = function(){var self = TMP_94.$$s || this; return self.$size()}, TMP_94.$$s = self, TMP_94.$$arity = 0, TMP_94), $a).call($b, "sort_by!") }; return self.$replace(($a = ($c = self).$sort_by, $a.$$p = block.$to_proc(), $a).call($c)); }, TMP_93.$$arity = 0); Opal.defn(self, '$take', TMP_95 = function $$take(count) { var self = this; if (count < 0) { self.$raise($scope.get('ArgumentError')); } return self.slice(0, count); ; }, TMP_95.$$arity = 1); Opal.defn(self, '$take_while', TMP_96 = function $$take_while() { var self = this, $iter = TMP_96.$$p, block = $iter || nil; TMP_96.$$p = null; var result = []; for (var i = 0, length = self.length, item, value; i < length; i++) { item = self[i]; value = block(item); if (value === false || value === nil) { return result; } result.push(item); } return result; }, TMP_96.$$arity = 0); Opal.defn(self, '$to_a', TMP_97 = function $$to_a() { var self = this; return self; }, TMP_97.$$arity = 0); Opal.alias(self, 'to_ary', 'to_a'); Opal.defn(self, '$to_h', TMP_98 = function $$to_h() { var self = this; var i, len = self.length, ary, key, val, hash = $hash2([], {}); for (i = 0; i < len; i++) { ary = $scope.get('Opal')['$coerce_to?'](self[i], $scope.get('Array'), "to_ary"); if (!ary.$$is_array) { self.$raise($scope.get('TypeError'), "wrong element type " + ((ary).$class()) + " at " + (i) + " (expected array)") } if (ary.length !== 2) { self.$raise($scope.get('ArgumentError'), "wrong array length at " + (i) + " (expected 2, was " + ((ary).$length()) + ")") } key = ary[0]; val = ary[1]; Opal.hash_put(hash, key, val); } return hash; ; }, TMP_98.$$arity = 0); Opal.alias(self, 'to_s', 'inspect'); Opal.defn(self, '$transpose', TMP_101 = function $$transpose() { var $a, $b, TMP_99, self = this, result = nil, max = nil; if ((($a = self['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return []}; result = []; max = nil; ($a = ($b = self).$each, $a.$$p = (TMP_99 = function(row){var self = TMP_99.$$s || this, $c, $d, TMP_100; if (row == null) row = nil; if ((($c = $scope.get('Array')['$==='](row)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { row = row.$to_a() } else { row = $scope.get('Opal').$coerce_to(row, $scope.get('Array'), "to_ary").$to_a() }; ((($c = max) !== false && $c !== nil && $c != null) ? $c : max = row.length); if ((($c = (row.length)['$!='](max)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$raise($scope.get('IndexError'), "element size differs (" + (row.length) + " should be " + (max))}; return ($c = ($d = (row.length)).$times, $c.$$p = (TMP_100 = function(i){var self = TMP_100.$$s || this, $e, $f, $g, entry = nil; if (i == null) i = nil; entry = (($e = i, $f = result, ((($g = $f['$[]']($e)) !== false && $g !== nil && $g != null) ? $g : $f['$[]=']($e, [])))); return entry['$<<'](row.$at(i));}, TMP_100.$$s = self, TMP_100.$$arity = 1, TMP_100), $c).call($d);}, TMP_99.$$s = self, TMP_99.$$arity = 1, TMP_99), $a).call($b); return result; }, TMP_101.$$arity = 0); Opal.defn(self, '$uniq', TMP_102 = function $$uniq() { var self = this, $iter = TMP_102.$$p, block = $iter || nil; TMP_102.$$p = null; var hash = $hash2([], {}), i, length, item, key; if (block === nil) { for (i = 0, length = self.length; i < length; i++) { item = self[i]; if (Opal.hash_get(hash, item) === undefined) { Opal.hash_put(hash, item, item); } } } else { for (i = 0, length = self.length; i < length; i++) { item = self[i]; key = Opal.yield1(block, item); if (Opal.hash_get(hash, key) === undefined) { Opal.hash_put(hash, key, item); } } } return toArraySubclass((hash).$values(), self.$class()); ; }, TMP_102.$$arity = 0); Opal.defn(self, '$uniq!', TMP_103 = function() { var self = this, $iter = TMP_103.$$p, block = $iter || nil; TMP_103.$$p = null; var original_length = self.length, hash = $hash2([], {}), i, length, item, key; for (i = 0, length = original_length; i < length; i++) { item = self[i]; key = (block === nil ? item : Opal.yield1(block, item)); if (Opal.hash_get(hash, key) === undefined) { Opal.hash_put(hash, key, item); continue; } self.splice(i, 1); length--; i--; } return self.length === original_length ? nil : self; ; }, TMP_103.$$arity = 0); Opal.defn(self, '$unshift', TMP_104 = function $$unshift($a_rest) { var self = this, objects; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } objects = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { objects[$arg_idx - 0] = arguments[$arg_idx]; } for (var i = objects.length - 1; i >= 0; i--) { self.unshift(objects[i]); } return self; }, TMP_104.$$arity = -1); Opal.defn(self, '$values_at', TMP_107 = function $$values_at($a_rest) { var $b, $c, TMP_105, self = this, args, out = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } out = []; ($b = ($c = args).$each, $b.$$p = (TMP_105 = function(elem){var self = TMP_105.$$s || this, $a, $d, TMP_106, finish = nil, start = nil, i = nil; if (elem == null) elem = nil; if ((($a = elem['$kind_of?']($scope.get('Range'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { finish = $scope.get('Opal').$coerce_to(elem.$last(), $scope.get('Integer'), "to_int"); start = $scope.get('Opal').$coerce_to(elem.$first(), $scope.get('Integer'), "to_int"); if (start < 0) { start = start + self.length; return nil;; } if (finish < 0) { finish = finish + self.length; } if (elem['$exclude_end?']()) { finish--; } if (finish < start) { return nil;; } return ($a = ($d = start).$upto, $a.$$p = (TMP_106 = function(i){var self = TMP_106.$$s || this; if (i == null) i = nil; return out['$<<'](self.$at(i))}, TMP_106.$$s = self, TMP_106.$$arity = 1, TMP_106), $a).call($d, finish); } else { i = $scope.get('Opal').$coerce_to(elem, $scope.get('Integer'), "to_int"); return out['$<<'](self.$at(i)); }}, TMP_105.$$s = self, TMP_105.$$arity = 1, TMP_105), $b).call($c); return out; }, TMP_107.$$arity = -1); Opal.defn(self, '$zip', TMP_108 = function $$zip($a_rest) { var $b, self = this, others, $iter = TMP_108.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } others = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { others[$arg_idx - 0] = arguments[$arg_idx]; } TMP_108.$$p = null; var result = [], size = self.length, part, o, i, j, jj; for (j = 0, jj = others.length; j < jj; j++) { o = others[j]; if (o.$$is_array) { continue; } if (o.$$is_enumerator) { if (o.$size() === Infinity) { others[j] = o.$take(size); } else { others[j] = o.$to_a(); } continue; } others[j] = (((($b = $scope.get('Opal')['$coerce_to?'](o, $scope.get('Array'), "to_ary")) !== false && $b !== nil && $b != null) ? $b : $scope.get('Opal')['$coerce_to!'](o, $scope.get('Enumerator'), "each"))).$to_a(); } for (i = 0; i < size; i++) { part = [self[i]]; for (j = 0, jj = others.length; j < jj; j++) { o = others[j][i]; if (o == null) { o = nil; } part[j + 1] = o; } result[i] = part; } if (block !== nil) { for (i = 0; i < size; i++) { block(result[i]); } return nil; } return result; }, TMP_108.$$arity = -1); Opal.defs(self, '$inherited', TMP_109 = function $$inherited(klass) { var self = this; klass.$$proto.$to_a = function() { return this.slice(0, this.length); } }, TMP_109.$$arity = 1); Opal.defn(self, '$instance_variables', TMP_111 = function $$instance_variables() { var $a, $b, TMP_110, $c, $d, self = this, $iter = TMP_111.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_111.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return ($a = ($b = ($c = ($d = self, Opal.find_super_dispatcher(self, 'instance_variables', TMP_111, false)), $c.$$p = $iter, $c).apply($d, $zuper)).$reject, $a.$$p = (TMP_110 = function(ivar){var self = TMP_110.$$s || this, $c; if (ivar == null) ivar = nil; return ((($c = /^@\d+$/.test(ivar)) !== false && $c !== nil && $c != null) ? $c : ivar['$==']("@length"))}, TMP_110.$$s = self, TMP_110.$$arity = 1, TMP_110), $a).call($b); }, TMP_111.$$arity = 0); return $scope.get('Opal').$pristine(self, "allocate", "copy_instance_variables", "initialize_dup"); })($scope.base, Array); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/hash"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$include', '$coerce_to?', '$[]', '$merge!', '$allocate', '$raise', '$==', '$coerce_to!', '$lambda?', '$abs', '$arity', '$call', '$enum_for', '$size', '$inspect', '$flatten', '$eql?', '$default', '$to_proc', '$dup', '$===', '$default_proc', '$default_proc=', '$default=', '$alias_method']); self.$require("corelib/enumerable"); return (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_18, TMP_20, TMP_22, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_44, TMP_46, TMP_47, TMP_49, TMP_51, TMP_52, TMP_53, TMP_54, TMP_55; self.$include($scope.get('Enumerable')); def.$$is_hash = true; Opal.defs(self, '$[]', TMP_1 = function($a_rest) { var self = this, argv; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } argv = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { argv[$arg_idx - 0] = arguments[$arg_idx]; } var hash, argc = argv.length, i; if (argc === 1) { hash = $scope.get('Opal')['$coerce_to?'](argv['$[]'](0), $scope.get('Hash'), "to_hash"); if (hash !== nil) { return self.$allocate()['$merge!'](hash); } argv = $scope.get('Opal')['$coerce_to?'](argv['$[]'](0), $scope.get('Array'), "to_ary"); if (argv === nil) { self.$raise($scope.get('ArgumentError'), "odd number of arguments for Hash") } argc = argv.length; hash = self.$allocate(); for (i = 0; i < argc; i++) { if (!argv[i].$$is_array) continue; switch(argv[i].length) { case 1: hash.$store(argv[i][0], nil); break; case 2: hash.$store(argv[i][0], argv[i][1]); break; default: self.$raise($scope.get('ArgumentError'), "invalid number of elements (" + (argv[i].length) + " for 1..2)") } } return hash; } if (argc % 2 !== 0) { self.$raise($scope.get('ArgumentError'), "odd number of arguments for Hash") } hash = self.$allocate(); for (i = 0; i < argc; i += 2) { hash.$store(argv[i], argv[i + 1]); } return hash; ; }, TMP_1.$$arity = -1); Opal.defs(self, '$allocate', TMP_2 = function $$allocate() { var self = this; var hash = new self.$$alloc(); Opal.hash_init(hash); hash.$$none = nil; hash.$$proc = nil; return hash; }, TMP_2.$$arity = 0); Opal.defs(self, '$try_convert', TMP_3 = function $$try_convert(obj) { var self = this; return $scope.get('Opal')['$coerce_to?'](obj, $scope.get('Hash'), "to_hash"); }, TMP_3.$$arity = 1); Opal.defn(self, '$initialize', TMP_4 = function $$initialize(defaults) { var self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; if (defaults !== undefined && block !== nil) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (1 for 0)") } self.$$none = (defaults === undefined ? nil : defaults); self.$$proc = block; ; return self; }, TMP_4.$$arity = -1); Opal.defn(self, '$==', TMP_5 = function(other) { var self = this; if (self === other) { return true; } if (!other.$$is_hash) { return false; } if (self.$$keys.length !== other.$$keys.length) { return false; } for (var i = 0, keys = self.$$keys, length = keys.length, key, value, other_value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; other_value = other.$$smap[key]; } else { value = key.value; other_value = Opal.hash_get(other, key.key); } if (other_value === undefined || !value['$eql?'](other_value)) { return false; } } return true; }, TMP_5.$$arity = 1); Opal.defn(self, '$[]', TMP_6 = function(key) { var self = this; var value = Opal.hash_get(self, key); if (value !== undefined) { return value; } return self.$default(key); }, TMP_6.$$arity = 1); Opal.defn(self, '$[]=', TMP_7 = function(key, value) { var self = this; Opal.hash_put(self, key, value); return value; }, TMP_7.$$arity = 2); Opal.defn(self, '$assoc', TMP_8 = function $$assoc(object) { var self = this; for (var i = 0, keys = self.$$keys, length = keys.length, key; i < length; i++) { key = keys[i]; if (key.$$is_string) { if ((key)['$=='](object)) { return [key, self.$$smap[key]]; } } else { if ((key.key)['$=='](object)) { return [key.key, key.value]; } } } return nil; }, TMP_8.$$arity = 1); Opal.defn(self, '$clear', TMP_9 = function $$clear() { var self = this; Opal.hash_init(self); return self; }, TMP_9.$$arity = 0); Opal.defn(self, '$clone', TMP_10 = function $$clone() { var self = this; var hash = new self.$$class.$$alloc(); Opal.hash_init(hash); Opal.hash_clone(self, hash); return hash; }, TMP_10.$$arity = 0); Opal.defn(self, '$default', TMP_11 = function(key) { var self = this; if (key !== undefined && self.$$proc !== nil && self.$$proc !== undefined) { return self.$$proc.$call(self, key); } if (self.$$none === undefined) { return nil; } return self.$$none; }, TMP_11.$$arity = -1); Opal.defn(self, '$default=', TMP_12 = function(object) { var self = this; self.$$proc = nil; self.$$none = object; return object; }, TMP_12.$$arity = 1); Opal.defn(self, '$default_proc', TMP_13 = function $$default_proc() { var self = this; if (self.$$proc !== undefined) { return self.$$proc; } return nil; }, TMP_13.$$arity = 0); Opal.defn(self, '$default_proc=', TMP_14 = function(proc) { var self = this; if (proc !== nil) { proc = $scope.get('Opal')['$coerce_to!'](proc, $scope.get('Proc'), "to_proc"); if (proc['$lambda?']() && proc.$arity().$abs() !== 2) { self.$raise($scope.get('TypeError'), "default_proc takes two arguments"); } } self.$$none = nil; self.$$proc = proc; return proc; ; }, TMP_14.$$arity = 1); Opal.defn(self, '$delete', TMP_15 = function(key) { var self = this, $iter = TMP_15.$$p, block = $iter || nil; TMP_15.$$p = null; var value = Opal.hash_delete(self, key); if (value !== undefined) { return value; } if (block !== nil) { return block.$call(key); } return nil; }, TMP_15.$$arity = 1); Opal.defn(self, '$delete_if', TMP_16 = function $$delete_if() { var $a, $b, TMP_17, self = this, $iter = TMP_16.$$p, block = $iter || nil; TMP_16.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this; return self.$size()}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17), $a).call($b, "delete_if") }; for (var i = 0, keys = self.$$keys, length = keys.length, key, value, obj; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } obj = block(key, value); if (obj !== false && obj !== nil) { if (Opal.hash_delete(self, key) !== undefined) { length--; i--; } } } return self; }, TMP_16.$$arity = 0); Opal.alias(self, 'dup', 'clone'); Opal.defn(self, '$each', TMP_18 = function $$each() { var $a, $b, TMP_19, self = this, $iter = TMP_18.$$p, block = $iter || nil; TMP_18.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this; return self.$size()}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $a).call($b, "each") }; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } Opal.yield1(block, [key, value]); } return self; }, TMP_18.$$arity = 0); Opal.defn(self, '$each_key', TMP_20 = function $$each_key() { var $a, $b, TMP_21, self = this, $iter = TMP_20.$$p, block = $iter || nil; TMP_20.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this; return self.$size()}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21), $a).call($b, "each_key") }; for (var i = 0, keys = self.$$keys, length = keys.length, key; i < length; i++) { key = keys[i]; block(key.$$is_string ? key : key.key); } return self; }, TMP_20.$$arity = 0); Opal.alias(self, 'each_pair', 'each'); Opal.defn(self, '$each_value', TMP_22 = function $$each_value() { var $a, $b, TMP_23, self = this, $iter = TMP_22.$$p, block = $iter || nil; TMP_22.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_23 = function(){var self = TMP_23.$$s || this; return self.$size()}, TMP_23.$$s = self, TMP_23.$$arity = 0, TMP_23), $a).call($b, "each_value") }; for (var i = 0, keys = self.$$keys, length = keys.length, key; i < length; i++) { key = keys[i]; block(key.$$is_string ? self.$$smap[key] : key.value); } return self; }, TMP_22.$$arity = 0); Opal.defn(self, '$empty?', TMP_24 = function() { var self = this; return self.$$keys.length === 0; }, TMP_24.$$arity = 0); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$fetch', TMP_25 = function $$fetch(key, defaults) { var self = this, $iter = TMP_25.$$p, block = $iter || nil; TMP_25.$$p = null; var value = Opal.hash_get(self, key); if (value !== undefined) { return value; } if (block !== nil) { return block(key); } if (defaults !== undefined) { return defaults; } return self.$raise($scope.get('KeyError'), "key not found: " + (key.$inspect())); }, TMP_25.$$arity = -2); Opal.defn(self, '$flatten', TMP_26 = function $$flatten(level) { var self = this; if (level == null) { level = 1; } level = $scope.get('Opal')['$coerce_to!'](level, $scope.get('Integer'), "to_int"); var result = []; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } result.push(key); if (value.$$is_array) { if (level === 1) { result.push(value); continue; } result = result.concat((value).$flatten(level - 2)); continue; } result.push(value); } return result; }, TMP_26.$$arity = -1); Opal.defn(self, '$has_key?', TMP_27 = function(key) { var self = this; return Opal.hash_get(self, key) !== undefined; }, TMP_27.$$arity = 1); Opal.defn(self, '$has_value?', TMP_28 = function(value) { var self = this; for (var i = 0, keys = self.$$keys, length = keys.length, key; i < length; i++) { key = keys[i]; if (((key.$$is_string ? self.$$smap[key] : key.value))['$=='](value)) { return true; } } return false; }, TMP_28.$$arity = 1); Opal.defn(self, '$hash', TMP_29 = function $$hash() { var self = this; var top = (Opal.hash_ids === undefined), hash_id = self.$object_id(), result = ['Hash'], key, item; try { if (top) { Opal.hash_ids = {}; } if (Opal.hash_ids.hasOwnProperty(hash_id)) { return 'self'; } for (key in Opal.hash_ids) { if (Opal.hash_ids.hasOwnProperty(key)) { item = Opal.hash_ids[key]; if (self['$eql?'](item)) { return 'self'; } } } Opal.hash_ids[hash_id] = self; for (var i = 0, keys = self.$$keys, length = keys.length; i < length; i++) { key = keys[i]; if (key.$$is_string) { result.push([key, self.$$smap[key].$hash()]); } else { result.push([key.key_hash, key.value.$hash()]); } } return result.sort().join(); } finally { if (top) { delete Opal.hash_ids; } } }, TMP_29.$$arity = 0); Opal.alias(self, 'include?', 'has_key?'); Opal.defn(self, '$index', TMP_30 = function $$index(object) { var self = this; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } if ((value)['$=='](object)) { return key; } } return nil; }, TMP_30.$$arity = 1); Opal.defn(self, '$indexes', TMP_31 = function $$indexes($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } var result = []; for (var i = 0, length = args.length, key, value; i < length; i++) { key = args[i]; value = Opal.hash_get(self, key); if (value === undefined) { result.push(self.$default()); continue; } result.push(value); } return result; }, TMP_31.$$arity = -1); Opal.alias(self, 'indices', 'indexes'); var inspect_ids; Opal.defn(self, '$inspect', TMP_32 = function $$inspect() { var self = this; var top = (inspect_ids === undefined), hash_id = self.$object_id(), result = []; try { if (top) { inspect_ids = {}; } if (inspect_ids.hasOwnProperty(hash_id)) { return '{...}'; } inspect_ids[hash_id] = true; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } result.push(key.$inspect() + '=>' + value.$inspect()); } return '{' + result.join(', ') + '}'; } finally { if (top) { inspect_ids = undefined; } } }, TMP_32.$$arity = 0); Opal.defn(self, '$invert', TMP_33 = function $$invert() { var self = this; var hash = Opal.hash(); for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } Opal.hash_put(hash, value, key); } return hash; }, TMP_33.$$arity = 0); Opal.defn(self, '$keep_if', TMP_34 = function $$keep_if() { var $a, $b, TMP_35, self = this, $iter = TMP_34.$$p, block = $iter || nil; TMP_34.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_35 = function(){var self = TMP_35.$$s || this; return self.$size()}, TMP_35.$$s = self, TMP_35.$$arity = 0, TMP_35), $a).call($b, "keep_if") }; for (var i = 0, keys = self.$$keys, length = keys.length, key, value, obj; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } obj = block(key, value); if (obj === false || obj === nil) { if (Opal.hash_delete(self, key) !== undefined) { length--; i--; } } } return self; }, TMP_34.$$arity = 0); Opal.alias(self, 'key', 'index'); Opal.alias(self, 'key?', 'has_key?'); Opal.defn(self, '$keys', TMP_36 = function $$keys() { var self = this; var result = []; for (var i = 0, keys = self.$$keys, length = keys.length, key; i < length; i++) { key = keys[i]; if (key.$$is_string) { result.push(key); } else { result.push(key.key); } } return result; }, TMP_36.$$arity = 0); Opal.defn(self, '$length', TMP_37 = function $$length() { var self = this; return self.$$keys.length; }, TMP_37.$$arity = 0); Opal.alias(self, 'member?', 'has_key?'); Opal.defn(self, '$merge', TMP_38 = function $$merge(other) { var $a, $b, self = this, $iter = TMP_38.$$p, block = $iter || nil; TMP_38.$$p = null; return ($a = ($b = self.$dup())['$merge!'], $a.$$p = block.$to_proc(), $a).call($b, other); }, TMP_38.$$arity = 1); Opal.defn(self, '$merge!', TMP_39 = function(other) { var self = this, $iter = TMP_39.$$p, block = $iter || nil; TMP_39.$$p = null; if (!$scope.get('Hash')['$==='](other)) { other = $scope.get('Opal')['$coerce_to!'](other, $scope.get('Hash'), "to_hash"); } var i, other_keys = other.$$keys, length = other_keys.length, key, value, other_value; if (block === nil) { for (i = 0; i < length; i++) { key = other_keys[i]; if (key.$$is_string) { other_value = other.$$smap[key]; } else { other_value = key.value; key = key.key; } Opal.hash_put(self, key, other_value); } return self; } for (i = 0; i < length; i++) { key = other_keys[i]; if (key.$$is_string) { other_value = other.$$smap[key]; } else { other_value = key.value; key = key.key; } value = Opal.hash_get(self, key); if (value === undefined) { Opal.hash_put(self, key, other_value); continue; } Opal.hash_put(self, key, block(key, value, other_value)); } return self; ; }, TMP_39.$$arity = 1); Opal.defn(self, '$rassoc', TMP_40 = function $$rassoc(object) { var self = this; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } if ((value)['$=='](object)) { return [key, value]; } } return nil; }, TMP_40.$$arity = 1); Opal.defn(self, '$rehash', TMP_41 = function $$rehash() { var self = this; Opal.hash_rehash(self); return self; }, TMP_41.$$arity = 0); Opal.defn(self, '$reject', TMP_42 = function $$reject() { var $a, $b, TMP_43, self = this, $iter = TMP_42.$$p, block = $iter || nil; TMP_42.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_43 = function(){var self = TMP_43.$$s || this; return self.$size()}, TMP_43.$$s = self, TMP_43.$$arity = 0, TMP_43), $a).call($b, "reject") }; var hash = Opal.hash(); for (var i = 0, keys = self.$$keys, length = keys.length, key, value, obj; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } obj = block(key, value); if (obj === false || obj === nil) { Opal.hash_put(hash, key, value); } } return hash; }, TMP_42.$$arity = 0); Opal.defn(self, '$reject!', TMP_44 = function() { var $a, $b, TMP_45, self = this, $iter = TMP_44.$$p, block = $iter || nil; TMP_44.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_45 = function(){var self = TMP_45.$$s || this; return self.$size()}, TMP_45.$$s = self, TMP_45.$$arity = 0, TMP_45), $a).call($b, "reject!") }; var changes_were_made = false; for (var i = 0, keys = self.$$keys, length = keys.length, key, value, obj; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } obj = block(key, value); if (obj !== false && obj !== nil) { if (Opal.hash_delete(self, key) !== undefined) { changes_were_made = true; length--; i--; } } } return changes_were_made ? self : nil; }, TMP_44.$$arity = 0); Opal.defn(self, '$replace', TMP_46 = function $$replace(other) { var $a, $b, self = this; other = $scope.get('Opal')['$coerce_to!'](other, $scope.get('Hash'), "to_hash"); Opal.hash_init(self); for (var i = 0, other_keys = other.$$keys, length = other_keys.length, key, value, other_value; i < length; i++) { key = other_keys[i]; if (key.$$is_string) { other_value = other.$$smap[key]; } else { other_value = key.value; key = key.key; } Opal.hash_put(self, key, other_value); } if ((($a = other.$default_proc()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [other.$default_proc()]), $b = self, $b['$default_proc='].apply($b, $a), $a[$a.length-1]) } else { (($a = [other.$default()]), $b = self, $b['$default='].apply($b, $a), $a[$a.length-1]) }; return self; }, TMP_46.$$arity = 1); Opal.defn(self, '$select', TMP_47 = function $$select() { var $a, $b, TMP_48, self = this, $iter = TMP_47.$$p, block = $iter || nil; TMP_47.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_48 = function(){var self = TMP_48.$$s || this; return self.$size()}, TMP_48.$$s = self, TMP_48.$$arity = 0, TMP_48), $a).call($b, "select") }; var hash = Opal.hash(); for (var i = 0, keys = self.$$keys, length = keys.length, key, value, obj; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } obj = block(key, value); if (obj !== false && obj !== nil) { Opal.hash_put(hash, key, value); } } return hash; }, TMP_47.$$arity = 0); Opal.defn(self, '$select!', TMP_49 = function() { var $a, $b, TMP_50, self = this, $iter = TMP_49.$$p, block = $iter || nil; TMP_49.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_50 = function(){var self = TMP_50.$$s || this; return self.$size()}, TMP_50.$$s = self, TMP_50.$$arity = 0, TMP_50), $a).call($b, "select!") }; var result = nil; for (var i = 0, keys = self.$$keys, length = keys.length, key, value, obj; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } obj = block(key, value); if (obj === false || obj === nil) { if (Opal.hash_delete(self, key) !== undefined) { length--; i--; } result = self; } } return result; }, TMP_49.$$arity = 0); Opal.defn(self, '$shift', TMP_51 = function $$shift() { var self = this; var keys = self.$$keys, key; if (keys.length > 0) { key = keys[0]; key = key.$$is_string ? key : key.key; return [key, Opal.hash_delete(self, key)]; } return self.$default(nil); }, TMP_51.$$arity = 0); Opal.alias(self, 'size', 'length'); self.$alias_method("store", "[]="); Opal.defn(self, '$to_a', TMP_52 = function $$to_a() { var self = this; var result = []; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } result.push([key, value]); } return result; }, TMP_52.$$arity = 0); Opal.defn(self, '$to_h', TMP_53 = function $$to_h() { var self = this; if (self.$$class === Opal.Hash) { return self; } var hash = new Opal.Hash.$$alloc(); Opal.hash_init(hash); Opal.hash_clone(self, hash); return hash; }, TMP_53.$$arity = 0); Opal.defn(self, '$to_hash', TMP_54 = function $$to_hash() { var self = this; return self; }, TMP_54.$$arity = 0); Opal.alias(self, 'to_s', 'inspect'); Opal.alias(self, 'update', 'merge!'); Opal.alias(self, 'value?', 'has_value?'); Opal.alias(self, 'values_at', 'indexes'); return (Opal.defn(self, '$values', TMP_55 = function $$values() { var self = this; var result = []; for (var i = 0, keys = self.$$keys, length = keys.length, key; i < length; i++) { key = keys[i]; if (key.$$is_string) { result.push(self.$$smap[key]); } else { result.push(key.value); } } return result; }, TMP_55.$$arity = 0), nil) && 'values'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/number"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$bridge', '$raise', '$class', '$Float', '$respond_to?', '$coerce_to!', '$__coerced__', '$===', '$!', '$>', '$**', '$new', '$<', '$to_f', '$==', '$nan?', '$infinite?', '$enum_for', '$+', '$-', '$gcd', '$lcm', '$/', '$frexp', '$to_i', '$ldexp', '$rationalize', '$*', '$<<', '$to_r', '$-@', '$size', '$<=', '$>=']); self.$require("corelib/numeric"); (function($base, $super) { function $Number(){}; var self = $Number = $klass($base, $super, 'Number', $Number); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51, TMP_52, TMP_54, TMP_55, TMP_56, TMP_57, TMP_58, TMP_59, TMP_61, TMP_62, TMP_63, TMP_64, TMP_65, TMP_66, TMP_67; $scope.get('Opal').$bridge(self, Number); Number.prototype.$$is_number = true; Opal.defn(self, '$coerce', TMP_1 = function $$coerce(other) { var self = this; if (other === nil) { self.$raise($scope.get('TypeError'), "can't convert " + (other.$class()) + " into Float"); } else if (other.$$is_string) { return [self.$Float(other), self]; } else if (other['$respond_to?']("to_f")) { return [$scope.get('Opal')['$coerce_to!'](other, $scope.get('Float'), "to_f"), self]; } else if (other.$$is_number) { return [other, self]; } else { self.$raise($scope.get('TypeError'), "can't convert " + (other.$class()) + " into Float"); } ; }, TMP_1.$$arity = 1); Opal.defn(self, '$__id__', TMP_2 = function $$__id__() { var self = this; return (self * 2) + 1; }, TMP_2.$$arity = 0); Opal.alias(self, 'object_id', '__id__'); Opal.defn(self, '$+', TMP_3 = function(other) { var self = this; if (other.$$is_number) { return self + other; } else { return self.$__coerced__("+", other); } }, TMP_3.$$arity = 1); Opal.defn(self, '$-', TMP_4 = function(other) { var self = this; if (other.$$is_number) { return self - other; } else { return self.$__coerced__("-", other); } }, TMP_4.$$arity = 1); Opal.defn(self, '$*', TMP_5 = function(other) { var self = this; if (other.$$is_number) { return self * other; } else { return self.$__coerced__("*", other); } }, TMP_5.$$arity = 1); Opal.defn(self, '$/', TMP_6 = function(other) { var self = this; if (other.$$is_number) { return self / other; } else { return self.$__coerced__("/", other); } }, TMP_6.$$arity = 1); Opal.alias(self, 'fdiv', '/'); Opal.defn(self, '$%', TMP_7 = function(other) { var self = this; if (other.$$is_number) { if (other == -Infinity) { return other; } else if (other == 0) { self.$raise($scope.get('ZeroDivisionError'), "divided by 0"); } else if (other < 0 || self < 0) { return (self % other + other) % other; } else { return self % other; } } else { return self.$__coerced__("%", other); } }, TMP_7.$$arity = 1); Opal.defn(self, '$&', TMP_8 = function(other) { var self = this; if (other.$$is_number) { return self & other; } else { return self.$__coerced__("&", other); } }, TMP_8.$$arity = 1); Opal.defn(self, '$|', TMP_9 = function(other) { var self = this; if (other.$$is_number) { return self | other; } else { return self.$__coerced__("|", other); } }, TMP_9.$$arity = 1); Opal.defn(self, '$^', TMP_10 = function(other) { var self = this; if (other.$$is_number) { return self ^ other; } else { return self.$__coerced__("^", other); } }, TMP_10.$$arity = 1); Opal.defn(self, '$<', TMP_11 = function(other) { var self = this; if (other.$$is_number) { return self < other; } else { return self.$__coerced__("<", other); } }, TMP_11.$$arity = 1); Opal.defn(self, '$<=', TMP_12 = function(other) { var self = this; if (other.$$is_number) { return self <= other; } else { return self.$__coerced__("<=", other); } }, TMP_12.$$arity = 1); Opal.defn(self, '$>', TMP_13 = function(other) { var self = this; if (other.$$is_number) { return self > other; } else { return self.$__coerced__(">", other); } }, TMP_13.$$arity = 1); Opal.defn(self, '$>=', TMP_14 = function(other) { var self = this; if (other.$$is_number) { return self >= other; } else { return self.$__coerced__(">=", other); } }, TMP_14.$$arity = 1); var spaceship_operator = function(self, other) { if (other.$$is_number) { if (isNaN(self) || isNaN(other)) { return nil; } if (self > other) { return 1; } else if (self < other) { return -1; } else { return 0; } } else { return self.$__coerced__("<=>", other); } } Opal.defn(self, '$<=>', TMP_15 = function(other) { var self = this; try { return spaceship_operator(self, other); } catch ($err) { if (Opal.rescue($err, [$scope.get('ArgumentError')])) { try { return nil } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_15.$$arity = 1); Opal.defn(self, '$<<', TMP_16 = function(count) { var self = this; count = $scope.get('Opal')['$coerce_to!'](count, $scope.get('Integer'), "to_int"); return count > 0 ? self << count : self >> -count; }, TMP_16.$$arity = 1); Opal.defn(self, '$>>', TMP_17 = function(count) { var self = this; count = $scope.get('Opal')['$coerce_to!'](count, $scope.get('Integer'), "to_int"); return count > 0 ? self >> count : self << -count; }, TMP_17.$$arity = 1); Opal.defn(self, '$[]', TMP_18 = function(bit) { var self = this; bit = $scope.get('Opal')['$coerce_to!'](bit, $scope.get('Integer'), "to_int"); if (bit < 0) { return 0; } if (bit >= 32) { return self < 0 ? 1 : 0; } return (self >> bit) & 1; ; }, TMP_18.$$arity = 1); Opal.defn(self, '$+@', TMP_19 = function() { var self = this; return +self; }, TMP_19.$$arity = 0); Opal.defn(self, '$-@', TMP_20 = function() { var self = this; return -self; }, TMP_20.$$arity = 0); Opal.defn(self, '$~', TMP_21 = function() { var self = this; return ~self; }, TMP_21.$$arity = 0); Opal.defn(self, '$**', TMP_22 = function(other) { var $a, $b, $c, self = this; if ((($a = $scope.get('Integer')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ((($b = ($scope.get('Integer')['$==='](self))['$!']()) !== false && $b !== nil && $b != null) ? $b : $rb_gt(other, 0))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return Math.pow(self, other); } else { return $scope.get('Rational').$new(self, 1)['$**'](other) } } else if ((($a = (($b = $rb_lt(self, 0)) ? (((($c = $scope.get('Float')['$==='](other)) !== false && $c !== nil && $c != null) ? $c : $scope.get('Rational')['$==='](other))) : $rb_lt(self, 0))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Complex').$new(self, 0)['$**'](other.$to_f()) } else if ((($a = other.$$is_number != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return Math.pow(self, other); } else { return self.$__coerced__("**", other) }; }, TMP_22.$$arity = 1); Opal.defn(self, '$==', TMP_23 = function(other) { var self = this; if (other.$$is_number) { return self == Number(other); } else if (other['$respond_to?']("==")) { return other['$=='](self); } else { return false; } ; }, TMP_23.$$arity = 1); Opal.defn(self, '$abs', TMP_24 = function $$abs() { var self = this; return Math.abs(self); }, TMP_24.$$arity = 0); Opal.defn(self, '$abs2', TMP_25 = function $$abs2() { var self = this; return Math.abs(self * self); }, TMP_25.$$arity = 0); Opal.defn(self, '$angle', TMP_26 = function $$angle() { var $a, self = this; if ((($a = self['$nan?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; if (self == 0) { if (1 / self > 0) { return 0; } else { return Math.PI; } } else if (self < 0) { return Math.PI; } else { return 0; } }, TMP_26.$$arity = 0); Opal.alias(self, 'arg', 'angle'); Opal.alias(self, 'phase', 'angle'); Opal.defn(self, '$bit_length', TMP_27 = function $$bit_length() { var $a, self = this; if ((($a = $scope.get('Integer')['$==='](self)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('NoMethodError').$new("undefined method `bit_length` for " + (self) + ":Float", "bit_length")) }; if (self === 0 || self === -1) { return 0; } var result = 0, value = self < 0 ? ~self : self; while (value != 0) { result += 1; value >>>= 1; } return result; }, TMP_27.$$arity = 0); Opal.defn(self, '$ceil', TMP_28 = function $$ceil() { var self = this; return Math.ceil(self); }, TMP_28.$$arity = 0); Opal.defn(self, '$chr', TMP_29 = function $$chr(encoding) { var self = this; return String.fromCharCode(self); }, TMP_29.$$arity = -1); Opal.defn(self, '$denominator', TMP_30 = function $$denominator() { var $a, $b, self = this, $iter = TMP_30.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_30.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : self['$infinite?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 1 } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'denominator', TMP_30, false)), $a.$$p = $iter, $a).apply($b, $zuper) }; }, TMP_30.$$arity = 0); Opal.defn(self, '$downto', TMP_31 = function $$downto(stop) { var $a, $b, TMP_32, self = this, $iter = TMP_31.$$p, block = $iter || nil; TMP_31.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_32 = function(){var self = TMP_32.$$s || this, $c; if ((($c = $scope.get('Numeric')['$==='](stop)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (stop.$class()) + " failed") }; if ((($c = $rb_gt(stop, self)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return 0 } else { return $rb_plus($rb_minus(self, stop), 1) };}, TMP_32.$$s = self, TMP_32.$$arity = 0, TMP_32), $a).call($b, "downto", stop) }; if (!stop.$$is_number) { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (stop.$class()) + " failed") } for (var i = self; i >= stop; i--) { block(i); } ; return self; }, TMP_31.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$equal?', TMP_33 = function(other) { var $a, self = this; return ((($a = self['$=='](other)) !== false && $a !== nil && $a != null) ? $a : isNaN(self) && isNaN(other)); }, TMP_33.$$arity = 1); Opal.defn(self, '$even?', TMP_34 = function() { var self = this; return self % 2 === 0; }, TMP_34.$$arity = 0); Opal.defn(self, '$floor', TMP_35 = function $$floor() { var self = this; return Math.floor(self); }, TMP_35.$$arity = 0); Opal.defn(self, '$gcd', TMP_36 = function $$gcd(other) { var $a, self = this; if ((($a = $scope.get('Integer')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "not an integer") }; var min = Math.abs(self), max = Math.abs(other); while (min > 0) { var tmp = min; min = max % min; max = tmp; } return max; }, TMP_36.$$arity = 1); Opal.defn(self, '$gcdlcm', TMP_37 = function $$gcdlcm(other) { var self = this; return [self.$gcd(), self.$lcm()]; }, TMP_37.$$arity = 1); Opal.defn(self, '$integer?', TMP_38 = function() { var self = this; return self % 1 === 0; }, TMP_38.$$arity = 0); Opal.defn(self, '$is_a?', TMP_39 = function(klass) { var $a, $b, self = this, $iter = TMP_39.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_39.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = (($b = klass['$==']($scope.get('Fixnum'))) ? $scope.get('Integer')['$==='](self) : klass['$==']($scope.get('Fixnum')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = (($b = klass['$==']($scope.get('Integer'))) ? $scope.get('Integer')['$==='](self) : klass['$==']($scope.get('Integer')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = (($b = klass['$==']($scope.get('Float'))) ? $scope.get('Float')['$==='](self) : klass['$==']($scope.get('Float')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'is_a?', TMP_39, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_39.$$arity = 1); Opal.alias(self, 'kind_of?', 'is_a?'); Opal.defn(self, '$instance_of?', TMP_40 = function(klass) { var $a, $b, self = this, $iter = TMP_40.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_40.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = (($b = klass['$==']($scope.get('Fixnum'))) ? $scope.get('Integer')['$==='](self) : klass['$==']($scope.get('Fixnum')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = (($b = klass['$==']($scope.get('Integer'))) ? $scope.get('Integer')['$==='](self) : klass['$==']($scope.get('Integer')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = (($b = klass['$==']($scope.get('Float'))) ? $scope.get('Float')['$==='](self) : klass['$==']($scope.get('Float')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'instance_of?', TMP_40, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_40.$$arity = 1); Opal.defn(self, '$lcm', TMP_41 = function $$lcm(other) { var $a, self = this; if ((($a = $scope.get('Integer')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "not an integer") }; if (self == 0 || other == 0) { return 0; } else { return Math.abs(self * other / self.$gcd(other)); } }, TMP_41.$$arity = 1); Opal.alias(self, 'magnitude', 'abs'); Opal.alias(self, 'modulo', '%'); Opal.defn(self, '$next', TMP_42 = function $$next() { var self = this; return self + 1; }, TMP_42.$$arity = 0); Opal.defn(self, '$nonzero?', TMP_43 = function() { var self = this; return self == 0 ? nil : self; }, TMP_43.$$arity = 0); Opal.defn(self, '$numerator', TMP_44 = function $$numerator() { var $a, $b, self = this, $iter = TMP_44.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_44.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : self['$infinite?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'numerator', TMP_44, false)), $a.$$p = $iter, $a).apply($b, $zuper) }; }, TMP_44.$$arity = 0); Opal.defn(self, '$odd?', TMP_45 = function() { var self = this; return self % 2 !== 0; }, TMP_45.$$arity = 0); Opal.defn(self, '$ord', TMP_46 = function $$ord() { var self = this; return self; }, TMP_46.$$arity = 0); Opal.defn(self, '$pred', TMP_47 = function $$pred() { var self = this; return self - 1; }, TMP_47.$$arity = 0); Opal.defn(self, '$quo', TMP_48 = function $$quo(other) { var $a, $b, self = this, $iter = TMP_48.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_48.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = $scope.get('Integer')['$==='](self)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'quo', TMP_48, false)), $a.$$p = $iter, $a).apply($b, $zuper) } else { return $rb_divide(self, other) }; }, TMP_48.$$arity = 1); Opal.defn(self, '$rationalize', TMP_49 = function $$rationalize(eps) { var $a, $b, self = this, f = nil, n = nil; if (arguments.length > 1) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arguments.length) + " for 0..1)"); } ; if ((($a = $scope.get('Integer')['$==='](self)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Rational').$new(self, 1) } else if ((($a = self['$infinite?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('FloatDomainError'), "Infinity") } else if ((($a = self['$nan?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('FloatDomainError'), "NaN") } else if ((($a = eps == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { $b = $scope.get('Math').$frexp(self), $a = Opal.to_ary($b), f = ($a[0] == null ? nil : $a[0]), n = ($a[1] == null ? nil : $a[1]), $b; f = $scope.get('Math').$ldexp(f, (($scope.get('Float')).$$scope.get('MANT_DIG'))).$to_i(); n = $rb_minus(n, (($scope.get('Float')).$$scope.get('MANT_DIG'))); return $scope.get('Rational').$new($rb_times(2, f), (1)['$<<'](($rb_minus(1, n)))).$rationalize($scope.get('Rational').$new(1, (1)['$<<'](($rb_minus(1, n))))); } else { return self.$to_r().$rationalize(eps) }; }, TMP_49.$$arity = -1); Opal.defn(self, '$round', TMP_50 = function $$round(ndigits) { var $a, $b, self = this, _ = nil, exp = nil; if ((($a = $scope.get('Integer')['$==='](self)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ndigits == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; if ((($a = ($b = $scope.get('Float')['$==='](ndigits), $b !== false && $b !== nil && $b != null ?ndigits['$infinite?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('RangeError'), "Infinity")}; ndigits = $scope.get('Opal')['$coerce_to!'](ndigits, $scope.get('Integer'), "to_int"); if ((($a = $rb_lt(ndigits, (($scope.get('Integer')).$$scope.get('MIN')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('RangeError'), "out of bounds")}; if ((($a = ndigits >= 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; ndigits = ndigits['$-@'](); if (0.415241 * ndigits - 0.125 > self.$size()) { return 0; } var f = Math.pow(10, ndigits), x = Math.floor((Math.abs(x) + f / 2) / f) * f; return self < 0 ? -x : x; ; } else { if ((($a = ($b = self['$nan?'](), $b !== false && $b !== nil && $b != null ?ndigits == null : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('FloatDomainError'), "NaN")}; ndigits = $scope.get('Opal')['$coerce_to!'](ndigits || 0, $scope.get('Integer'), "to_int"); if ((($a = $rb_le(ndigits, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self['$nan?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('RangeError'), "NaN") } else if ((($a = self['$infinite?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('FloatDomainError'), "Infinity")} } else if (ndigits['$=='](0)) { return Math.round(self) } else if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : self['$infinite?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; $b = $scope.get('Math').$frexp(self), $a = Opal.to_ary($b), _ = ($a[0] == null ? nil : $a[0]), exp = ($a[1] == null ? nil : $a[1]), $b; if ((($a = $rb_ge(ndigits, $rb_minus(($rb_plus((($scope.get('Float')).$$scope.get('DIG')), 2)), ((function() {if ((($b = $rb_gt(exp, 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return $rb_divide(exp, 4) } else { return $rb_minus($rb_divide(exp, 3), 1) }; return nil; })())))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self}; if ((($a = $rb_lt(ndigits, ((function() {if ((($b = $rb_gt(exp, 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return $rb_plus($rb_divide(exp, 3), 1) } else { return $rb_divide(exp, 4) }; return nil; })())['$-@']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 0}; return Math.round(self * Math.pow(10, ndigits)) / Math.pow(10, ndigits); }; }, TMP_50.$$arity = -1); Opal.defn(self, '$step', TMP_51 = function $$step(limit, step) { var $a, self = this, $iter = TMP_51.$$p, block = $iter || nil; if (step == null) { step = 1; } TMP_51.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$enum_for("step", limit, step) }; if ((($a = step == 0) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "step cannot be 0")}; var value = self; if (limit === Infinity || limit === -Infinity) { block(value); return self; } if (step > 0) { while (value <= limit) { block(value); value += step; } } else { while (value >= limit) { block(value); value += step; } } return self; }, TMP_51.$$arity = -2); Opal.alias(self, 'succ', 'next'); Opal.defn(self, '$times', TMP_52 = function $$times() { var $a, $b, TMP_53, self = this, $iter = TMP_52.$$p, block = $iter || nil; TMP_52.$$p = null; if (block !== false && block !== nil && block != null) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_53 = function(){var self = TMP_53.$$s || this; return self}, TMP_53.$$s = self, TMP_53.$$arity = 0, TMP_53), $a).call($b, "times") }; for (var i = 0; i < self; i++) { block(i); } return self; }, TMP_52.$$arity = 0); Opal.defn(self, '$to_f', TMP_54 = function $$to_f() { var self = this; return self; }, TMP_54.$$arity = 0); Opal.defn(self, '$to_i', TMP_55 = function $$to_i() { var self = this; return parseInt(self, 10); }, TMP_55.$$arity = 0); Opal.alias(self, 'to_int', 'to_i'); Opal.defn(self, '$to_r', TMP_56 = function $$to_r() { var $a, $b, self = this, f = nil, e = nil; if ((($a = $scope.get('Integer')['$==='](self)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Rational').$new(self, 1) } else { $b = $scope.get('Math').$frexp(self), $a = Opal.to_ary($b), f = ($a[0] == null ? nil : $a[0]), e = ($a[1] == null ? nil : $a[1]), $b; f = $scope.get('Math').$ldexp(f, (($scope.get('Float')).$$scope.get('MANT_DIG'))).$to_i(); e = $rb_minus(e, (($scope.get('Float')).$$scope.get('MANT_DIG'))); return ($rb_times(f, ((($scope.get('Float')).$$scope.get('RADIX'))['$**'](e)))).$to_r(); }; }, TMP_56.$$arity = 0); Opal.defn(self, '$to_s', TMP_57 = function $$to_s(base) { var $a, $b, self = this; if (base == null) { base = 10; } if ((($a = ((($b = $rb_lt(base, 2)) !== false && $b !== nil && $b != null) ? $b : $rb_gt(base, 36))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "base must be between 2 and 36")}; return self.toString(base); }, TMP_57.$$arity = -1); Opal.alias(self, 'truncate', 'to_i'); Opal.alias(self, 'inspect', 'to_s'); Opal.defn(self, '$divmod', TMP_58 = function $$divmod(other) { var $a, $b, self = this, $iter = TMP_58.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_58.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : other['$nan?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('FloatDomainError'), "NaN") } else if ((($a = self['$infinite?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('FloatDomainError'), "Infinity") } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'divmod', TMP_58, false)), $a.$$p = $iter, $a).apply($b, $zuper) }; }, TMP_58.$$arity = 1); Opal.defn(self, '$upto', TMP_59 = function $$upto(stop) { var $a, $b, TMP_60, self = this, $iter = TMP_59.$$p, block = $iter || nil; TMP_59.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_60 = function(){var self = TMP_60.$$s || this, $c; if ((($c = $scope.get('Numeric')['$==='](stop)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (stop.$class()) + " failed") }; if ((($c = $rb_lt(stop, self)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return 0 } else { return $rb_plus($rb_minus(stop, self), 1) };}, TMP_60.$$s = self, TMP_60.$$arity = 0, TMP_60), $a).call($b, "upto", stop) }; if (!stop.$$is_number) { self.$raise($scope.get('ArgumentError'), "comparison of " + (self.$class()) + " with " + (stop.$class()) + " failed") } for (var i = self; i <= stop; i++) { block(i); } ; return self; }, TMP_59.$$arity = 1); Opal.defn(self, '$zero?', TMP_61 = function() { var self = this; return self == 0; }, TMP_61.$$arity = 0); Opal.defn(self, '$size', TMP_62 = function $$size() { var self = this; return 4; }, TMP_62.$$arity = 0); Opal.defn(self, '$nan?', TMP_63 = function() { var self = this; return isNaN(self); }, TMP_63.$$arity = 0); Opal.defn(self, '$finite?', TMP_64 = function() { var self = this; return self != Infinity && self != -Infinity && !isNaN(self); }, TMP_64.$$arity = 0); Opal.defn(self, '$infinite?', TMP_65 = function() { var self = this; if (self == Infinity) { return +1; } else if (self == -Infinity) { return -1; } else { return nil; } }, TMP_65.$$arity = 0); Opal.defn(self, '$positive?', TMP_66 = function() { var self = this; return self == Infinity || 1 / self > 0; }, TMP_66.$$arity = 0); return (Opal.defn(self, '$negative?', TMP_67 = function() { var self = this; return self == -Infinity || 1 / self < 0; }, TMP_67.$$arity = 0), nil) && 'negative?'; })($scope.base, $scope.get('Numeric')); Opal.cdecl($scope, 'Fixnum', $scope.get('Number')); (function($base, $super) { function $Integer(){}; var self = $Integer = $klass($base, $super, 'Integer', $Integer); var def = self.$$proto, $scope = self.$$scope, TMP_68; Opal.defs(self, '$===', TMP_68 = function(other) { var self = this; if (!other.$$is_number) { return false; } return (other % 1) === 0; }, TMP_68.$$arity = 1); Opal.cdecl($scope, 'MAX', Math.pow(2, 30) - 1); return Opal.cdecl($scope, 'MIN', -Math.pow(2, 30)); })($scope.base, $scope.get('Numeric')); return (function($base, $super) { function $Float(){}; var self = $Float = $klass($base, $super, 'Float', $Float); var def = self.$$proto, $scope = self.$$scope, TMP_69, $a; Opal.defs(self, '$===', TMP_69 = function(other) { var self = this; return !!other.$$is_number; }, TMP_69.$$arity = 1); Opal.cdecl($scope, 'INFINITY', Infinity); Opal.cdecl($scope, 'MAX', Number.MAX_VALUE); Opal.cdecl($scope, 'MIN', Number.MIN_VALUE); Opal.cdecl($scope, 'NAN', NaN); Opal.cdecl($scope, 'DIG', 15); Opal.cdecl($scope, 'MANT_DIG', 53); Opal.cdecl($scope, 'RADIX', 2); if ((($a = (typeof(Number.EPSILON) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return Opal.cdecl($scope, 'EPSILON', Number.EPSILON) } else { return Opal.cdecl($scope, 'EPSILON', 2.2204460492503130808472633361816E-16) }; })($scope.base, $scope.get('Numeric')); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/range"] = function(Opal) { function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$include', '$attr_reader', '$<=>', '$raise', '$include?', '$<=', '$<', '$enum_for', '$upto', '$to_proc', '$succ', '$!', '$==', '$===', '$exclude_end?', '$eql?', '$begin', '$end', '$-', '$abs', '$to_i', '$inspect', '$[]']); self.$require("corelib/enumerable"); return (function($base, $super) { function $Range(){}; var self = $Range = $klass($base, $super, 'Range', $Range); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13; def.begin = def.exclude = def.end = nil; self.$include($scope.get('Enumerable')); def.$$is_range = true; self.$attr_reader("begin", "end"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(first, last, exclude) { var $a, self = this; if (exclude == null) { exclude = false; } if ((($a = first['$<=>'](last)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError')) }; self.begin = first; self.end = last; return self.exclude = exclude; }, TMP_1.$$arity = -3); Opal.defn(self, '$==', TMP_2 = function(other) { var self = this; if (!other.$$is_range) { return false; } return self.exclude === other.exclude && self.begin == other.begin && self.end == other.end; }, TMP_2.$$arity = 1); Opal.defn(self, '$===', TMP_3 = function(value) { var self = this; return self['$include?'](value); }, TMP_3.$$arity = 1); Opal.defn(self, '$cover?', TMP_4 = function(value) { var $a, $b, self = this; return ($a = $rb_le(self.begin, value), $a !== false && $a !== nil && $a != null ?((function() {if ((($b = self.exclude) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return $rb_lt(value, self.end) } else { return $rb_le(value, self.end) }; return nil; })()) : $a); }, TMP_4.$$arity = 1); Opal.defn(self, '$each', TMP_5 = function $$each() { var $a, $b, $c, self = this, $iter = TMP_5.$$p, block = $iter || nil, current = nil, last = nil; TMP_5.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("each") }; var i, limit; if (self.begin.$$is_number && self.end.$$is_number) { if (self.begin % 1 !== 0 || self.end % 1 !== 0) { self.$raise($scope.get('TypeError'), "can't iterate from Float") } for (i = self.begin, limit = self.end + (function() {if ((($a = self.exclude) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 0 } else { return 1 }; return nil; })(); i < limit; i++) { block(i); } return self; } if (self.begin.$$is_string && self.end.$$is_string) { ($a = ($b = self.begin).$upto, $a.$$p = block.$to_proc(), $a).call($b, self.end, self.exclude) return self; } ; current = self.begin; last = self.end; while ((($c = $rb_lt(current, last)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { Opal.yield1(block, current); current = current.$succ();}; if ((($a = ($c = self.exclude['$!'](), $c !== false && $c !== nil && $c != null ?current['$=='](last) : $c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.yield1(block, current)}; return self; }, TMP_5.$$arity = 0); Opal.defn(self, '$eql?', TMP_6 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Range')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; return ($a = ($b = self.exclude['$==='](other['$exclude_end?']()), $b !== false && $b !== nil && $b != null ?self.begin['$eql?'](other.$begin()) : $b), $a !== false && $a !== nil && $a != null ?self.end['$eql?'](other.$end()) : $a); }, TMP_6.$$arity = 1); Opal.defn(self, '$exclude_end?', TMP_7 = function() { var self = this; return self.exclude; }, TMP_7.$$arity = 0); Opal.alias(self, 'first', 'begin'); Opal.alias(self, 'include?', 'cover?'); Opal.alias(self, 'last', 'end'); Opal.defn(self, '$max', TMP_8 = function $$max() { var $a, $b, self = this, $iter = TMP_8.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_8.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (($yield !== nil)) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'max', TMP_8, false)), $a.$$p = $iter, $a).apply($b, $zuper) } else { return self.exclude ? self.end - 1 : self.end; }; }, TMP_8.$$arity = 0); Opal.alias(self, 'member?', 'cover?'); Opal.defn(self, '$min', TMP_9 = function $$min() { var $a, $b, self = this, $iter = TMP_9.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_9.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (($yield !== nil)) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'min', TMP_9, false)), $a.$$p = $iter, $a).apply($b, $zuper) } else { return self.begin }; }, TMP_9.$$arity = 0); Opal.alias(self, 'member?', 'include?'); Opal.defn(self, '$size', TMP_10 = function $$size() { var $a, $b, self = this, _begin = nil, _end = nil, infinity = nil; _begin = self.begin; _end = self.end; if ((($a = self.exclude) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { _end = $rb_minus(_end, 1)}; if ((($a = ($b = $scope.get('Numeric')['$==='](_begin), $b !== false && $b !== nil && $b != null ?$scope.get('Numeric')['$==='](_end) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = $rb_lt(_end, _begin)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 0}; infinity = (($scope.get('Float')).$$scope.get('INFINITY')); if ((($a = ((($b = infinity['$=='](_begin.$abs())) !== false && $b !== nil && $b != null) ? $b : _end.$abs()['$=='](infinity))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return infinity}; return ((Math.abs(_end - _begin) + 1)).$to_i(); }, TMP_10.$$arity = 0); Opal.defn(self, '$step', TMP_11 = function $$step(n) { var self = this; if (n == null) { n = 1; } return self.$raise($scope.get('NotImplementedError')); }, TMP_11.$$arity = -1); Opal.defn(self, '$to_s', TMP_12 = function $$to_s() { var self = this; return self.begin.$inspect() + (self.exclude ? '...' : '..') + self.end.$inspect(); }, TMP_12.$$arity = 0); Opal.alias(self, 'inspect', 'to_s'); return (Opal.defn(self, '$marshal_load', TMP_13 = function $$marshal_load(args) { var self = this; self.begin = args['$[]']("begin"); self.end = args['$[]']("end"); return self.exclude = args['$[]']("excl"); }, TMP_13.$$arity = 1), nil) && 'marshal_load'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/proc"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$raise', '$coerce_to!']); return (function($base, $super) { function $Proc(){}; var self = $Proc = $klass($base, $super, 'Proc', $Proc); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10; def.$$is_proc = true; def.$$is_lambda = false; Opal.defs(self, '$new', TMP_1 = function() { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "tried to create a Proc object without a block") }; return block; }, TMP_1.$$arity = 0); Opal.defn(self, '$call', TMP_2 = function $$call($a_rest) { var self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; if (block !== nil) { self.$$p = block; } var result, $brk = self.$$brk; if ($brk) { try { if (self.$$is_lambda) { result = self.apply(null, args); } else { result = Opal.yieldX(self, args); } } catch (err) { if (err === $brk) { return $brk.$v } else { throw err } } } else { if (self.$$is_lambda) { result = self.apply(null, args); } else { result = Opal.yieldX(self, args); } } return result; }, TMP_2.$$arity = -1); Opal.alias(self, '[]', 'call'); Opal.alias(self, '===', 'call'); Opal.alias(self, 'yield', 'call'); Opal.defn(self, '$to_proc', TMP_3 = function $$to_proc() { var self = this; return self; }, TMP_3.$$arity = 0); Opal.defn(self, '$lambda?', TMP_4 = function() { var self = this; return !!self.$$is_lambda; }, TMP_4.$$arity = 0); Opal.defn(self, '$arity', TMP_5 = function $$arity() { var self = this; if (self.$$is_curried) { return -1; } else { return self.$$arity; } }, TMP_5.$$arity = 0); Opal.defn(self, '$source_location', TMP_6 = function $$source_location() { var self = this; if (self.$$is_curried) { return nil; } return nil; }, TMP_6.$$arity = 0); Opal.defn(self, '$binding', TMP_7 = function $$binding() { var self = this; if (self.$$is_curried) { self.$raise($scope.get('ArgumentError'), "Can't create Binding") }; return nil; }, TMP_7.$$arity = 0); Opal.defn(self, '$parameters', TMP_8 = function $$parameters() { var self = this; if (self.$$is_curried) { return [["rest"]]; } else if (self.$$parameters) { if (self.$$is_lambda) { return self.$$parameters; } else { var result = [], i, length; for (i = 0, length = self.$$parameters.length; i < length; i++) { var parameter = self.$$parameters[i]; if (parameter[0] === 'req') { // required arguments always have name parameter = ['opt', parameter[1]]; } result.push(parameter); } return result; } } else { return []; } ; }, TMP_8.$$arity = 0); Opal.defn(self, '$curry', TMP_9 = function $$curry(arity) { var self = this; if (arity === undefined) { arity = self.length; } else { arity = $scope.get('Opal')['$coerce_to!'](arity, $scope.get('Integer'), "to_int"); if (self.$$is_lambda && arity !== self.length) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arity) + " for " + (self.length) + ")") } } function curried () { var args = $slice.call(arguments), length = args.length, result; if (length > arity && self.$$is_lambda && !self.$$is_curried) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (length) + " for " + (arity) + ")") } if (length >= arity) { return self.$call.apply(self, args); } result = function () { return curried.apply(null, args.concat($slice.call(arguments))); } result.$$is_lambda = self.$$is_lambda; result.$$is_curried = true; return result; }; curried.$$is_lambda = self.$$is_lambda; curried.$$is_curried = true; return curried; }, TMP_9.$$arity = -1); Opal.defn(self, '$dup', TMP_10 = function $$dup() { var self = this; var original_proc = self.$$original_proc || self, proc = function () { return original_proc.apply(this, arguments); }; for (var prop in self) { if (self.hasOwnProperty(prop)) { proc[prop] = self[prop]; } } return proc; }, TMP_10.$$arity = 0); return Opal.alias(self, 'clone', 'dup'); })($scope.base, Function) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/method"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$class', '$arity', '$new', '$name']); (function($base, $super) { function $Method(){}; var self = $Method = $klass($base, $super, 'Method', $Method); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; def.method = def.receiver = def.owner = def.name = nil; self.$attr_reader("owner", "receiver", "name"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(receiver, method, name) { var self = this; self.receiver = receiver; self.owner = receiver.$class(); self.name = name; return self.method = method; }, TMP_1.$$arity = 3); Opal.defn(self, '$arity', TMP_2 = function $$arity() { var self = this; return self.method.$arity(); }, TMP_2.$$arity = 0); Opal.defn(self, '$parameters', TMP_3 = function $$parameters() { var self = this; return self.method.$$parameters; }, TMP_3.$$arity = 0); Opal.defn(self, '$call', TMP_4 = function $$call($a_rest) { var self = this, args, $iter = TMP_4.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_4.$$p = null; self.method.$$p = block; return self.method.apply(self.receiver, args); ; }, TMP_4.$$arity = -1); Opal.alias(self, '[]', 'call'); Opal.defn(self, '$unbind', TMP_5 = function $$unbind() { var self = this; return $scope.get('UnboundMethod').$new(self.owner, self.method, self.name); }, TMP_5.$$arity = 0); Opal.defn(self, '$to_proc', TMP_6 = function $$to_proc() { var self = this; var proc = function () { return self.$call.apply(self, $slice.call(arguments)); }; proc.$$unbound = self.method; proc.$$is_lambda = true; return proc; }, TMP_6.$$arity = 0); return (Opal.defn(self, '$inspect', TMP_7 = function $$inspect() { var self = this; return "#"; }, TMP_7.$$arity = 0), nil) && 'inspect'; })($scope.base, null); return (function($base, $super) { function $UnboundMethod(){}; var self = $UnboundMethod = $klass($base, $super, 'UnboundMethod', $UnboundMethod); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; def.method = def.name = def.owner = nil; self.$attr_reader("owner", "name"); Opal.defn(self, '$initialize', TMP_8 = function $$initialize(owner, method, name) { var self = this; self.owner = owner; self.method = method; return self.name = name; }, TMP_8.$$arity = 3); Opal.defn(self, '$arity', TMP_9 = function $$arity() { var self = this; return self.method.$arity(); }, TMP_9.$$arity = 0); Opal.defn(self, '$parameters', TMP_10 = function $$parameters() { var self = this; return self.method.$$parameters; }, TMP_10.$$arity = 0); Opal.defn(self, '$bind', TMP_11 = function $$bind(object) { var self = this; return $scope.get('Method').$new(object, self.method, self.name); }, TMP_11.$$arity = 1); return (Opal.defn(self, '$inspect', TMP_12 = function $$inspect() { var self = this; return "#"; }, TMP_12.$$arity = 0), nil) && 'inspect'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/variables"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $gvars = Opal.gvars, $hash2 = Opal.hash2; Opal.add_stubs(['$new']); $gvars["&"] = $gvars["~"] = $gvars["`"] = $gvars["'"] = nil; $gvars.LOADED_FEATURES = $gvars["\""] = Opal.loaded_features; $gvars.LOAD_PATH = $gvars[":"] = []; $gvars["/"] = "\n"; $gvars[","] = nil; Opal.cdecl($scope, 'ARGV', []); Opal.cdecl($scope, 'ARGF', $scope.get('Object').$new()); Opal.cdecl($scope, 'ENV', $hash2([], {})); $gvars.VERBOSE = false; $gvars.DEBUG = false; return $gvars.SAFE = 0; }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/regexp_anchors"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$==', '$new']); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'REGEXP_START', (function() {if ($scope.get('RUBY_ENGINE')['$==']("opal")) { return "^"}; return nil; })()); Opal.cdecl($scope, 'REGEXP_END', (function() {if ($scope.get('RUBY_ENGINE')['$==']("opal")) { return "$"}; return nil; })()); Opal.cdecl($scope, 'FORBIDDEN_STARTING_IDENTIFIER_CHARS', "\\u0001-\\u002F\\u003A-\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F"); Opal.cdecl($scope, 'FORBIDDEN_ENDING_IDENTIFIER_CHARS', "\\u0001-\\u0020\\u0022-\\u002F\\u003A-\\u003E\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F"); Opal.cdecl($scope, 'INLINE_IDENTIFIER_REGEXP', $scope.get('Regexp').$new("[^" + ($scope.get('FORBIDDEN_STARTING_IDENTIFIER_CHARS')) + "]*[^" + ($scope.get('FORBIDDEN_ENDING_IDENTIFIER_CHARS')) + "]")); Opal.cdecl($scope, 'FORBIDDEN_CONST_NAME_CHARS', "\\u0001-\\u0020\\u0021-\\u002F\\u003B-\\u003F\\u0040\\u005B-\\u005E\\u0060\\u007B-\\u007F"); Opal.cdecl($scope, 'CONST_NAME_REGEXP', $scope.get('Regexp').$new("" + ($scope.get('REGEXP_START')) + "(::)?[A-Z][^" + ($scope.get('FORBIDDEN_CONST_NAME_CHARS')) + "]*" + ($scope.get('REGEXP_END')))); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/mini"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("opal/base"); self.$require("corelib/nil"); self.$require("corelib/boolean"); self.$require("corelib/string"); self.$require("corelib/comparable"); self.$require("corelib/enumerable"); self.$require("corelib/enumerator"); self.$require("corelib/array"); self.$require("corelib/hash"); self.$require("corelib/number"); self.$require("corelib/range"); self.$require("corelib/proc"); self.$require("corelib/method"); self.$require("corelib/regexp"); self.$require("corelib/variables"); return self.$require("opal/regexp_anchors"); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/string/inheritance"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$new', '$allocate', '$initialize', '$to_proc', '$__send__', '$class', '$clone', '$respond_to?', '$==', '$inspect', '$+', '$*', '$map', '$split', '$enum_for', '$each_line', '$to_a', '$%', '$-']); self.$require("corelib/string"); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defs(self, '$inherited', TMP_1 = function $$inherited(klass) { var self = this, replace = nil; replace = $scope.get('Class').$new((($scope.get('String')).$$scope.get('Wrapper'))); klass.$$proto = replace.$$proto; klass.$$proto.$$class = klass; klass.$$alloc = replace.$$alloc; klass.$$parent = (($scope.get('String')).$$scope.get('Wrapper')); klass.$allocate = replace.$allocate; klass.$new = replace.$new; }, TMP_1.$$arity = 1), nil) && 'inherited' })($scope.base, null); return (function($base, $super) { function $Wrapper(){}; var self = $Wrapper = $klass($base, $super, 'Wrapper', $Wrapper); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_15, TMP_16, TMP_17, TMP_19, TMP_20, TMP_21; def.literal = nil; def.$$is_string = true; Opal.defs(self, '$allocate', TMP_2 = function $$allocate(string) { var $a, $b, self = this, $iter = TMP_2.$$p, $yield = $iter || nil, obj = nil; if (string == null) { string = ""; } TMP_2.$$p = null; obj = ($a = ($b = self, Opal.find_super_dispatcher(self, 'allocate', TMP_2, false, $Wrapper)), $a.$$p = null, $a).call($b); obj.literal = string; return obj; }, TMP_2.$$arity = -1); Opal.defs(self, '$new', TMP_3 = function($a_rest) { var $b, $c, self = this, args, $iter = TMP_3.$$p, block = $iter || nil, obj = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_3.$$p = null; obj = self.$allocate(); ($b = ($c = obj).$initialize, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); return obj; }, TMP_3.$$arity = -1); Opal.defs(self, '$[]', TMP_4 = function($a_rest) { var self = this, objects; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } objects = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { objects[$arg_idx - 0] = arguments[$arg_idx]; } return self.$allocate(objects); }, TMP_4.$$arity = -1); Opal.defn(self, '$initialize', TMP_5 = function $$initialize(string) { var self = this; if (string == null) { string = ""; } return self.literal = string; }, TMP_5.$$arity = -1); Opal.defn(self, '$method_missing', TMP_6 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_6.$$p, block = $iter || nil, result = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_6.$$p = null; result = ($b = ($c = self.literal).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); if ((($b = result.$$is_string != null) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = result == self.literal) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self } else { return self.$class().$allocate(result) } } else { return result }; }, TMP_6.$$arity = -1); Opal.defn(self, '$initialize_copy', TMP_7 = function $$initialize_copy(other) { var self = this; return self.literal = (other.literal).$clone(); }, TMP_7.$$arity = 1); Opal.defn(self, '$respond_to?', TMP_8 = function(name, $a_rest) { var $b, $c, $d, self = this, $iter = TMP_8.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_8.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return ((($b = ($c = ($d = self, Opal.find_super_dispatcher(self, 'respond_to?', TMP_8, false)), $c.$$p = $iter, $c).apply($d, $zuper)) !== false && $b !== nil && $b != null) ? $b : self.literal['$respond_to?'](name)); }, TMP_8.$$arity = -2); Opal.defn(self, '$==', TMP_9 = function(other) { var self = this; return self.literal['$=='](other); }, TMP_9.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.alias(self, '===', '=='); Opal.defn(self, '$to_s', TMP_10 = function $$to_s() { var self = this; return self.literal; }, TMP_10.$$arity = 0); Opal.alias(self, 'to_str', 'to_s'); Opal.defn(self, '$inspect', TMP_11 = function $$inspect() { var self = this; return self.literal.$inspect(); }, TMP_11.$$arity = 0); Opal.defn(self, '$+', TMP_12 = function(other) { var self = this; return $rb_plus(self.literal, other); }, TMP_12.$$arity = 1); Opal.defn(self, '$*', TMP_13 = function(other) { var self = this; var result = $rb_times(self.literal, other); if (result.$$is_string) { return self.$class().$allocate(result) } else { return result; } ; }, TMP_13.$$arity = 1); Opal.defn(self, '$split', TMP_15 = function $$split(pattern, limit) { var $a, $b, TMP_14, self = this; return ($a = ($b = self.literal.$split(pattern, limit)).$map, $a.$$p = (TMP_14 = function(str){var self = TMP_14.$$s || this; if (str == null) str = nil; return self.$class().$allocate(str)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_15.$$arity = -1); Opal.defn(self, '$replace', TMP_16 = function $$replace(string) { var self = this; return self.literal = string; }, TMP_16.$$arity = 1); Opal.defn(self, '$each_line', TMP_17 = function $$each_line(separator) { var $a, $b, TMP_18, self = this, $iter = TMP_17.$$p, $yield = $iter || nil; if ($gvars["/"] == null) $gvars["/"] = nil; if (separator == null) { separator = $gvars["/"]; } TMP_17.$$p = null; if (($yield !== nil)) { } else { return self.$enum_for("each_line", separator) }; return ($a = ($b = self.literal).$each_line, $a.$$p = (TMP_18 = function(str){var self = TMP_18.$$s || this; if (str == null) str = nil; return Opal.yield1($yield, self.$class().$allocate(str));}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18), $a).call($b, separator); }, TMP_17.$$arity = -1); Opal.defn(self, '$lines', TMP_19 = function $$lines(separator) { var $a, $b, self = this, $iter = TMP_19.$$p, block = $iter || nil, e = nil; if ($gvars["/"] == null) $gvars["/"] = nil; if (separator == null) { separator = $gvars["/"]; } TMP_19.$$p = null; e = ($a = ($b = self).$each_line, $a.$$p = block.$to_proc(), $a).call($b, separator); if (block !== false && block !== nil && block != null) { return self } else { return e.$to_a() }; }, TMP_19.$$arity = -1); Opal.defn(self, '$%', TMP_20 = function(data) { var self = this; return self.literal['$%'](data); }, TMP_20.$$arity = 1); return (Opal.defn(self, '$instance_variables', TMP_21 = function $$instance_variables() { var $a, $b, self = this, $iter = TMP_21.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_21.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return $rb_minus(($a = ($b = self, Opal.find_super_dispatcher(self, 'instance_variables', TMP_21, false)), $a.$$p = $iter, $a).apply($b, $zuper), ["@literal"]); }, TMP_21.$$arity = 0), nil) && 'instance_variables'; })($scope.get('String'), null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/string/encoding"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var $a, $b, TMP_13, $c, TMP_16, $d, TMP_19, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$+', '$[]', '$new', '$to_proc', '$each', '$const_set', '$sub', '$upcase', '$const_get', '$===', '$==', '$name', '$include?', '$names', '$constants', '$raise', '$attr_accessor', '$attr_reader', '$register', '$length', '$bytes', '$to_a', '$each_byte', '$bytesize', '$enum_for', '$force_encoding', '$dup', '$coerce_to!', '$find', '$nil?', '$getbyte']); self.$require("corelib/string"); (function($base, $super) { function $Encoding(){}; var self = $Encoding = $klass($base, $super, 'Encoding', $Encoding); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; def.ascii = def.dummy = def.name = nil; Opal.defs(self, '$register', TMP_1 = function $$register(name, options) { var $a, $b, $c, TMP_2, self = this, $iter = TMP_1.$$p, block = $iter || nil, names = nil, encoding = nil; if (options == null) { options = $hash2([], {}); } TMP_1.$$p = null; names = $rb_plus([name], (((($a = options['$[]']("aliases")) !== false && $a !== nil && $a != null) ? $a : []))); encoding = ($a = ($b = $scope.get('Class')).$new, $a.$$p = block.$to_proc(), $a).call($b, self).$new(name, names, ((($a = options['$[]']("ascii")) !== false && $a !== nil && $a != null) ? $a : false), ((($a = options['$[]']("dummy")) !== false && $a !== nil && $a != null) ? $a : false)); return ($a = ($c = names).$each, $a.$$p = (TMP_2 = function(name){var self = TMP_2.$$s || this; if (name == null) name = nil; return self.$const_set(name.$sub("-", "_"), encoding)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($c); }, TMP_1.$$arity = -2); Opal.defs(self, '$find', TMP_4 = function $$find(name) {try { var $a, $b, TMP_3, self = this, upcase = nil; upcase = name.$upcase(); ($a = ($b = self.$constants()).$each, $a.$$p = (TMP_3 = function(const$){var self = TMP_3.$$s || this, $c, $d, encoding = nil; if (const$ == null) const$ = nil; encoding = self.$const_get(const$); if ((($c = $scope.get('Encoding')['$==='](encoding)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { return nil; }; if ((($c = ((($d = encoding.$name()['$=='](upcase)) !== false && $d !== nil && $d != null) ? $d : encoding.$names()['$include?'](upcase))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { Opal.ret(encoding) } else { return nil };}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b); return self.$raise($scope.get('ArgumentError'), "unknown encoding name - " + (name)); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_4.$$arity = 1); (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$attr_accessor("default_external") })(Opal.get_singleton_class(self)); self.$attr_reader("name", "names"); Opal.defn(self, '$initialize', TMP_5 = function $$initialize(name, names, ascii, dummy) { var self = this; self.name = name; self.names = names; self.ascii = ascii; return self.dummy = dummy; }, TMP_5.$$arity = 4); Opal.defn(self, '$ascii_compatible?', TMP_6 = function() { var self = this; return self.ascii; }, TMP_6.$$arity = 0); Opal.defn(self, '$dummy?', TMP_7 = function() { var self = this; return self.dummy; }, TMP_7.$$arity = 0); Opal.defn(self, '$to_s', TMP_8 = function $$to_s() { var self = this; return self.name; }, TMP_8.$$arity = 0); Opal.defn(self, '$inspect', TMP_9 = function $$inspect() { var $a, self = this; return "#"; }, TMP_9.$$arity = 0); Opal.defn(self, '$each_byte', TMP_10 = function $$each_byte($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_10.$$arity = -1); Opal.defn(self, '$getbyte', TMP_11 = function $$getbyte($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_11.$$arity = -1); Opal.defn(self, '$bytesize', TMP_12 = function $$bytesize($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_12.$$arity = -1); (function($base, $super) { function $EncodingError(){}; var self = $EncodingError = $klass($base, $super, 'EncodingError', $EncodingError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); return (function($base, $super) { function $CompatibilityError(){}; var self = $CompatibilityError = $klass($base, $super, 'CompatibilityError', $CompatibilityError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('EncodingError')); })($scope.base, null); ($a = ($b = $scope.get('Encoding')).$register, $a.$$p = (TMP_13 = function(){var self = TMP_13.$$s || this, TMP_14, TMP_15; Opal.def(self, '$each_byte', TMP_14 = function $$each_byte(string) { var self = this, $iter = TMP_14.$$p, block = $iter || nil; TMP_14.$$p = null; for (var i = 0, length = string.length; i < length; i++) { var code = string.charCodeAt(i); if (code <= 0x7f) { Opal.yield1(block, code); } else { var encoded = encodeURIComponent(string.charAt(i)).substr(1).split('%'); for (var j = 0, encoded_length = encoded.length; j < encoded_length; j++) { Opal.yield1(block, parseInt(encoded[j], 16)); } } } }, TMP_14.$$arity = 1); return (Opal.def(self, '$bytesize', TMP_15 = function $$bytesize() { var self = this; return self.$bytes().$length(); }, TMP_15.$$arity = 0), nil) && 'bytesize';}, TMP_13.$$s = self, TMP_13.$$arity = 0, TMP_13), $a).call($b, "UTF-8", $hash2(["aliases", "ascii"], {"aliases": ["CP65001"], "ascii": true})); ($a = ($c = $scope.get('Encoding')).$register, $a.$$p = (TMP_16 = function(){var self = TMP_16.$$s || this, TMP_17, TMP_18; Opal.def(self, '$each_byte', TMP_17 = function $$each_byte(string) { var self = this, $iter = TMP_17.$$p, block = $iter || nil; TMP_17.$$p = null; for (var i = 0, length = string.length; i < length; i++) { var code = string.charCodeAt(i); Opal.yield1(block, code & 0xff); Opal.yield1(block, code >> 8); } }, TMP_17.$$arity = 1); return (Opal.def(self, '$bytesize', TMP_18 = function $$bytesize() { var self = this; return self.$bytes().$length(); }, TMP_18.$$arity = 0), nil) && 'bytesize';}, TMP_16.$$s = self, TMP_16.$$arity = 0, TMP_16), $a).call($c, "UTF-16LE"); ($a = ($d = $scope.get('Encoding')).$register, $a.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this, TMP_20, TMP_21; Opal.def(self, '$each_byte', TMP_20 = function $$each_byte(string) { var self = this, $iter = TMP_20.$$p, block = $iter || nil; TMP_20.$$p = null; for (var i = 0, length = string.length; i < length; i++) { Opal.yield1(block, string.charCodeAt(i) & 0xff); } }, TMP_20.$$arity = 1); return (Opal.def(self, '$bytesize', TMP_21 = function $$bytesize() { var self = this; return self.$bytes().$length(); }, TMP_21.$$arity = 0), nil) && 'bytesize';}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $a).call($d, "ASCII-8BIT", $hash2(["aliases", "ascii"], {"aliases": ["BINARY"], "ascii": true})); return (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28; def.encoding = nil; String.prototype.encoding = (($scope.get('Encoding')).$$scope.get('UTF_16LE')); Opal.defn(self, '$bytes', TMP_22 = function $$bytes() { var self = this; return self.$each_byte().$to_a(); }, TMP_22.$$arity = 0); Opal.defn(self, '$bytesize', TMP_23 = function $$bytesize() { var self = this; return self.encoding.$bytesize(self); }, TMP_23.$$arity = 0); Opal.defn(self, '$each_byte', TMP_24 = function $$each_byte() { var $a, $b, self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("each_byte") }; ($a = ($b = self.encoding).$each_byte, $a.$$p = block.$to_proc(), $a).call($b, self); return self; }, TMP_24.$$arity = 0); Opal.defn(self, '$encode', TMP_25 = function $$encode(encoding) { var self = this; return self.$dup().$force_encoding(encoding); }, TMP_25.$$arity = 1); Opal.defn(self, '$encoding', TMP_26 = function $$encoding() { var self = this; return self.encoding; }, TMP_26.$$arity = 0); Opal.defn(self, '$force_encoding', TMP_27 = function $$force_encoding(encoding) { var $a, self = this; encoding = $scope.get('Opal')['$coerce_to!'](encoding, $scope.get('String'), "to_str"); encoding = $scope.get('Encoding').$find(encoding); if (encoding['$=='](self.encoding)) { return self}; if ((($a = encoding['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "unknown encoding name - " + (encoding))}; var result = new String(self); result.encoding = encoding; return result; }, TMP_27.$$arity = 1); return (Opal.defn(self, '$getbyte', TMP_28 = function $$getbyte(idx) { var self = this; return self.encoding.$getbyte(self, idx); }, TMP_28.$$arity = 1), nil) && 'getbyte'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/math"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$new', '$raise', '$Float', '$type_error', '$Integer', '$module_function', '$checked', '$float!', '$===', '$gamma', '$-', '$integer!', '$/', '$infinite?']); return (function($base) { var $Math, self = $Math = $module($base, 'Math'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, $a, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29; Opal.cdecl($scope, 'E', Math.E); Opal.cdecl($scope, 'PI', Math.PI); Opal.cdecl($scope, 'DomainError', $scope.get('Class').$new($scope.get('StandardError'))); Opal.defs(self, '$checked', TMP_1 = function $$checked(method, $a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } if (isNaN(args[0]) || (args.length == 2 && isNaN(args[1]))) { return NaN; } var result = Math[method].apply(null, args); if (isNaN(result)) { self.$raise($scope.get('DomainError'), "Numerical argument is out of domain - \"" + (method) + "\""); } return result; }, TMP_1.$$arity = -2); Opal.defs(self, '$float!', TMP_2 = function(value) { var self = this; try { return self.$Float(value) } catch ($err) { if (Opal.rescue($err, [$scope.get('ArgumentError')])) { try { return self.$raise($scope.get('Opal').$type_error(value, $scope.get('Float'))) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_2.$$arity = 1); Opal.defs(self, '$integer!', TMP_3 = function(value) { var self = this; try { return self.$Integer(value) } catch ($err) { if (Opal.rescue($err, [$scope.get('ArgumentError')])) { try { return self.$raise($scope.get('Opal').$type_error(value, $scope.get('Integer'))) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_3.$$arity = 1); self.$module_function(); Opal.defn(self, '$acos', TMP_4 = function $$acos(x) { var self = this; return $scope.get('Math').$checked("acos", $scope.get('Math')['$float!'](x)); }, TMP_4.$$arity = 1); if ((($a = (typeof(Math.acosh) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.acosh = function(x) { return Math.log(x + Math.sqrt(x * x - 1)); } }; Opal.defn(self, '$acosh', TMP_5 = function $$acosh(x) { var self = this; return $scope.get('Math').$checked("acosh", $scope.get('Math')['$float!'](x)); }, TMP_5.$$arity = 1); Opal.defn(self, '$asin', TMP_6 = function $$asin(x) { var self = this; return $scope.get('Math').$checked("asin", $scope.get('Math')['$float!'](x)); }, TMP_6.$$arity = 1); if ((($a = (typeof(Math.asinh) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.asinh = function(x) { return Math.log(x + Math.sqrt(x * x + 1)) } ; }; Opal.defn(self, '$asinh', TMP_7 = function $$asinh(x) { var self = this; return $scope.get('Math').$checked("asinh", $scope.get('Math')['$float!'](x)); }, TMP_7.$$arity = 1); Opal.defn(self, '$atan', TMP_8 = function $$atan(x) { var self = this; return $scope.get('Math').$checked("atan", $scope.get('Math')['$float!'](x)); }, TMP_8.$$arity = 1); Opal.defn(self, '$atan2', TMP_9 = function $$atan2(y, x) { var self = this; return $scope.get('Math').$checked("atan2", $scope.get('Math')['$float!'](y), $scope.get('Math')['$float!'](x)); }, TMP_9.$$arity = 2); if ((($a = (typeof(Math.atanh) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.atanh = function(x) { return 0.5 * Math.log((1 + x) / (1 - x)); } }; Opal.defn(self, '$atanh', TMP_10 = function $$atanh(x) { var self = this; return $scope.get('Math').$checked("atanh", $scope.get('Math')['$float!'](x)); }, TMP_10.$$arity = 1); if ((($a = (typeof(Math.cbrt) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.cbrt = function(x) { if (x == 0) { return 0; } if (x < 0) { return -Math.cbrt(-x); } var r = x, ex = 0; while (r < 0.125) { r *= 8; ex--; } while (r > 1.0) { r *= 0.125; ex++; } r = (-0.46946116 * r + 1.072302) * r + 0.3812513; while (ex < 0) { r *= 0.5; ex++; } while (ex > 0) { r *= 2; ex--; } r = (2.0 / 3.0) * r + (1.0 / 3.0) * x / (r * r); r = (2.0 / 3.0) * r + (1.0 / 3.0) * x / (r * r); r = (2.0 / 3.0) * r + (1.0 / 3.0) * x / (r * r); r = (2.0 / 3.0) * r + (1.0 / 3.0) * x / (r * r); return r; } }; Opal.defn(self, '$cbrt', TMP_11 = function $$cbrt(x) { var self = this; return $scope.get('Math').$checked("cbrt", $scope.get('Math')['$float!'](x)); }, TMP_11.$$arity = 1); Opal.defn(self, '$cos', TMP_12 = function $$cos(x) { var self = this; return $scope.get('Math').$checked("cos", $scope.get('Math')['$float!'](x)); }, TMP_12.$$arity = 1); if ((($a = (typeof(Math.cosh) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.cosh = function(x) { return (Math.exp(x) + Math.exp(-x)) / 2; } }; Opal.defn(self, '$cosh', TMP_13 = function $$cosh(x) { var self = this; return $scope.get('Math').$checked("cosh", $scope.get('Math')['$float!'](x)); }, TMP_13.$$arity = 1); if ((($a = (typeof(Math.erf) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.erf = function(x) { var A1 = 0.254829592, A2 = -0.284496736, A3 = 1.421413741, A4 = -1.453152027, A5 = 1.061405429, P = 0.3275911; var sign = 1; if (x < 0) { sign = -1; } x = Math.abs(x); var t = 1.0 / (1.0 + P * x); var y = 1.0 - (((((A5 * t + A4) * t) + A3) * t + A2) * t + A1) * t * Math.exp(-x * x); return sign * y; } }; Opal.defn(self, '$erf', TMP_14 = function $$erf(x) { var self = this; return $scope.get('Math').$checked("erf", $scope.get('Math')['$float!'](x)); }, TMP_14.$$arity = 1); if ((($a = (typeof(Math.erfc) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.erfc = function(x) { var z = Math.abs(x), t = 1.0 / (0.5 * z + 1.0); var A1 = t * 0.17087277 + -0.82215223, A2 = t * A1 + 1.48851587, A3 = t * A2 + -1.13520398, A4 = t * A3 + 0.27886807, A5 = t * A4 + -0.18628806, A6 = t * A5 + 0.09678418, A7 = t * A6 + 0.37409196, A8 = t * A7 + 1.00002368, A9 = t * A8, A10 = -z * z - 1.26551223 + A9; var a = t * Math.exp(A10); if (x < 0.0) { return 2.0 - a; } else { return a; } } }; Opal.defn(self, '$erfc', TMP_15 = function $$erfc(x) { var self = this; return $scope.get('Math').$checked("erfc", $scope.get('Math')['$float!'](x)); }, TMP_15.$$arity = 1); Opal.defn(self, '$exp', TMP_16 = function $$exp(x) { var self = this; return $scope.get('Math').$checked("exp", $scope.get('Math')['$float!'](x)); }, TMP_16.$$arity = 1); Opal.defn(self, '$frexp', TMP_17 = function $$frexp(x) { var self = this; x = $scope.get('Math')['$float!'](x); if (isNaN(x)) { return [NaN, 0]; } var ex = Math.floor(Math.log(Math.abs(x)) / Math.log(2)) + 1, frac = x / Math.pow(2, ex); return [frac, ex]; }, TMP_17.$$arity = 1); Opal.defn(self, '$gamma', TMP_18 = function $$gamma(n) { var self = this; n = $scope.get('Math')['$float!'](n); var i, t, x, value, result, twoN, threeN, fourN, fiveN; var G = 4.7421875; var P = [ 0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5 ]; if (isNaN(n)) { return NaN; } if (n === 0 && 1 / n < 0) { return -Infinity; } if (n === -1 || n === -Infinity) { self.$raise($scope.get('DomainError'), "Numerical argument is out of domain - \"gamma\""); } if ($scope.get('Integer')['$==='](n)) { if (n <= 0) { return isFinite(n) ? Infinity : NaN; } if (n > 171) { return Infinity; } value = n - 2; result = n - 1; while (value > 1) { result *= value; value--; } if (result == 0) { result = 1; } return result; } if (n < 0.5) { return Math.PI / (Math.sin(Math.PI * n) * $scope.get('Math').$gamma($rb_minus(1, n))); } if (n >= 171.35) { return Infinity; } if (n > 85.0) { twoN = n * n; threeN = twoN * n; fourN = threeN * n; fiveN = fourN * n; return Math.sqrt(2 * Math.PI / n) * Math.pow((n / Math.E), n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n)); } n -= 1; x = P[0]; for (i = 1; i < P.length; ++i) { x += P[i] / (n + i); } t = n + G + 0.5; return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x; }, TMP_18.$$arity = 1); if ((($a = (typeof(Math.hypot) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.hypot = function(x, y) { return Math.sqrt(x * x + y * y) } ; }; Opal.defn(self, '$hypot', TMP_19 = function $$hypot(x, y) { var self = this; return $scope.get('Math').$checked("hypot", $scope.get('Math')['$float!'](x), $scope.get('Math')['$float!'](y)); }, TMP_19.$$arity = 2); Opal.defn(self, '$ldexp', TMP_20 = function $$ldexp(mantissa, exponent) { var self = this; mantissa = $scope.get('Math')['$float!'](mantissa); exponent = $scope.get('Math')['$integer!'](exponent); if (isNaN(exponent)) { self.$raise($scope.get('RangeError'), "float NaN out of range of integer"); } return mantissa * Math.pow(2, exponent); ; }, TMP_20.$$arity = 2); Opal.defn(self, '$lgamma', TMP_21 = function $$lgamma(n) { var self = this; if (n == -1) { return [Infinity, 1]; } else { return [Math.log(Math.abs($scope.get('Math').$gamma(n))), $scope.get('Math').$gamma(n) < 0 ? -1 : 1]; } ; }, TMP_21.$$arity = 1); Opal.defn(self, '$log', TMP_22 = function $$log(x, base) { var $a, self = this; if ((($a = $scope.get('String')['$==='](x)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('Opal').$type_error(x, $scope.get('Float')))}; if ((($a = base == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Math').$checked("log", $scope.get('Math')['$float!'](x)) } else { if ((($a = $scope.get('String')['$==='](base)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('Opal').$type_error(base, $scope.get('Float')))}; return $rb_divide($scope.get('Math').$checked("log", $scope.get('Math')['$float!'](x)), $scope.get('Math').$checked("log", $scope.get('Math')['$float!'](base))); }; }, TMP_22.$$arity = -2); if ((($a = (typeof(Math.log10) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.log10 = function(x) { return Math.log(x) / Math.LN10; } }; Opal.defn(self, '$log10', TMP_23 = function $$log10(x) { var $a, self = this; if ((($a = $scope.get('String')['$==='](x)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('Opal').$type_error(x, $scope.get('Float')))}; return $scope.get('Math').$checked("log10", $scope.get('Math')['$float!'](x)); }, TMP_23.$$arity = 1); if ((($a = (typeof(Math.log2) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.log2 = function(x) { return Math.log(x) / Math.LN2; } }; Opal.defn(self, '$log2', TMP_24 = function $$log2(x) { var $a, self = this; if ((($a = $scope.get('String')['$==='](x)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('Opal').$type_error(x, $scope.get('Float')))}; return $scope.get('Math').$checked("log2", $scope.get('Math')['$float!'](x)); }, TMP_24.$$arity = 1); Opal.defn(self, '$sin', TMP_25 = function $$sin(x) { var self = this; return $scope.get('Math').$checked("sin", $scope.get('Math')['$float!'](x)); }, TMP_25.$$arity = 1); if ((($a = (typeof(Math.sinh) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.sinh = function(x) { return (Math.exp(x) - Math.exp(-x)) / 2; } }; Opal.defn(self, '$sinh', TMP_26 = function $$sinh(x) { var self = this; return $scope.get('Math').$checked("sinh", $scope.get('Math')['$float!'](x)); }, TMP_26.$$arity = 1); Opal.defn(self, '$sqrt', TMP_27 = function $$sqrt(x) { var self = this; return $scope.get('Math').$checked("sqrt", $scope.get('Math')['$float!'](x)); }, TMP_27.$$arity = 1); Opal.defn(self, '$tan', TMP_28 = function $$tan(x) { var $a, self = this; x = $scope.get('Math')['$float!'](x); if ((($a = x['$infinite?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Float')).$$scope.get('NAN'))}; return $scope.get('Math').$checked("tan", $scope.get('Math')['$float!'](x)); }, TMP_28.$$arity = 1); if ((($a = (typeof(Math.tanh) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Math.tanh = function(x) { if (x == Infinity) { return 1; } else if (x == -Infinity) { return -1; } else { return (Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x)); } } }; Opal.defn(self, '$tanh', TMP_29 = function $$tanh(x) { var self = this; return $scope.get('Math').$checked("tanh", $scope.get('Math')['$float!'](x)); }, TMP_29.$$arity = 1); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/complex"] = function(Opal) { function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module; Opal.add_stubs(['$require', '$===', '$real?', '$raise', '$new', '$*', '$cos', '$sin', '$attr_reader', '$class', '$==', '$real', '$imag', '$Complex', '$-@', '$+', '$__coerced__', '$-', '$nan?', '$/', '$conj', '$abs2', '$quo', '$polar', '$exp', '$log', '$>', '$!=', '$divmod', '$**', '$hypot', '$atan2', '$lcm', '$denominator', '$to_s', '$numerator', '$abs', '$arg', '$rationalize', '$to_f', '$to_i', '$to_r', '$inspect', '$positive?', '$infinite?']); self.$require("corelib/numeric"); (function($base, $super) { function $Complex(){}; var self = $Complex = $klass($base, $super, 'Complex', $Complex); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29; def.real = def.imag = nil; Opal.defs(self, '$rect', TMP_1 = function $$rect(real, imag) { var $a, $b, $c, $d, self = this; if (imag == null) { imag = 0; } if ((($a = ($b = ($c = ($d = $scope.get('Numeric')['$==='](real), $d !== false && $d !== nil && $d != null ?real['$real?']() : $d), $c !== false && $c !== nil && $c != null ?$scope.get('Numeric')['$==='](imag) : $c), $b !== false && $b !== nil && $b != null ?imag['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "not a real") }; return self.$new(real, imag); }, TMP_1.$$arity = -2); (function(self) { var $scope = self.$$scope, def = self.$$proto; return Opal.alias(self, 'rectangular', 'rect') })(Opal.get_singleton_class(self)); Opal.defs(self, '$polar', TMP_2 = function $$polar(r, theta) { var $a, $b, $c, $d, self = this; if (theta == null) { theta = 0; } if ((($a = ($b = ($c = ($d = $scope.get('Numeric')['$==='](r), $d !== false && $d !== nil && $d != null ?r['$real?']() : $d), $c !== false && $c !== nil && $c != null ?$scope.get('Numeric')['$==='](theta) : $c), $b !== false && $b !== nil && $b != null ?theta['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "not a real") }; return self.$new($rb_times(r, $scope.get('Math').$cos(theta)), $rb_times(r, $scope.get('Math').$sin(theta))); }, TMP_2.$$arity = -2); self.$attr_reader("real", "imag"); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(real, imag) { var self = this; if (imag == null) { imag = 0; } self.real = real; return self.imag = imag; }, TMP_3.$$arity = -2); Opal.defn(self, '$coerce', TMP_4 = function $$coerce(other) { var $a, $b, self = this; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [other, self] } else if ((($a = ($b = $scope.get('Numeric')['$==='](other), $b !== false && $b !== nil && $b != null ?other['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [$scope.get('Complex').$new(other, 0), self] } else { return self.$raise($scope.get('TypeError'), "" + (other.$class()) + " can't be coerced into Complex") }; }, TMP_4.$$arity = 1); Opal.defn(self, '$==', TMP_5 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($a = self.real['$=='](other.$real())) ? self.imag['$=='](other.$imag()) : self.real['$=='](other.$real())) } else if ((($a = ($b = $scope.get('Numeric')['$==='](other), $b !== false && $b !== nil && $b != null ?other['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($a = self.real['$=='](other)) ? self.imag['$=='](0) : self.real['$=='](other)) } else { return other['$=='](self) }; }, TMP_5.$$arity = 1); Opal.defn(self, '$-@', TMP_6 = function() { var self = this; return self.$Complex(self.real['$-@'](), self.imag['$-@']()); }, TMP_6.$$arity = 0); Opal.defn(self, '$+', TMP_7 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex($rb_plus(self.real, other.$real()), $rb_plus(self.imag, other.$imag())) } else if ((($a = ($b = $scope.get('Numeric')['$==='](other), $b !== false && $b !== nil && $b != null ?other['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex($rb_plus(self.real, other), self.imag) } else { return self.$__coerced__("+", other) }; }, TMP_7.$$arity = 1); Opal.defn(self, '$-', TMP_8 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex($rb_minus(self.real, other.$real()), $rb_minus(self.imag, other.$imag())) } else if ((($a = ($b = $scope.get('Numeric')['$==='](other), $b !== false && $b !== nil && $b != null ?other['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex($rb_minus(self.real, other), self.imag) } else { return self.$__coerced__("-", other) }; }, TMP_8.$$arity = 1); Opal.defn(self, '$*', TMP_9 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex($rb_minus($rb_times(self.real, other.$real()), $rb_times(self.imag, other.$imag())), $rb_plus($rb_times(self.real, other.$imag()), $rb_times(self.imag, other.$real()))) } else if ((($a = ($b = $scope.get('Numeric')['$==='](other), $b !== false && $b !== nil && $b != null ?other['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex($rb_times(self.real, other), $rb_times(self.imag, other)) } else { return self.$__coerced__("*", other) }; }, TMP_9.$$arity = 1); Opal.defn(self, '$/', TMP_10 = function(other) { var $a, $b, $c, $d, $e, self = this; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ((($b = ((($c = ((($d = (($e = $scope.get('Number')['$==='](self.real), $e !== false && $e !== nil && $e != null ?self.real['$nan?']() : $e))) !== false && $d !== nil && $d != null) ? $d : (($e = $scope.get('Number')['$==='](self.imag), $e !== false && $e !== nil && $e != null ?self.imag['$nan?']() : $e)))) !== false && $c !== nil && $c != null) ? $c : (($d = $scope.get('Number')['$==='](other.$real()), $d !== false && $d !== nil && $d != null ?other.$real()['$nan?']() : $d)))) !== false && $b !== nil && $b != null) ? $b : (($c = $scope.get('Number')['$==='](other.$imag()), $c !== false && $c !== nil && $c != null ?other.$imag()['$nan?']() : $c)))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Complex').$new((($scope.get('Float')).$$scope.get('NAN')), (($scope.get('Float')).$$scope.get('NAN'))) } else { return $rb_divide($rb_times(self, other.$conj()), other.$abs2()) } } else if ((($a = ($b = $scope.get('Numeric')['$==='](other), $b !== false && $b !== nil && $b != null ?other['$real?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Complex(self.real.$quo(other), self.imag.$quo(other)) } else { return self.$__coerced__("/", other) }; }, TMP_10.$$arity = 1); Opal.defn(self, '$**', TMP_11 = function(other) { var $a, $b, $c, $d, $e, self = this, r = nil, theta = nil, ore = nil, oim = nil, nr = nil, ntheta = nil, x = nil, z = nil, n = nil, div = nil, mod = nil; if (other['$=='](0)) { return $scope.get('Complex').$new(1, 0)}; if ((($a = $scope.get('Complex')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { $b = self.$polar(), $a = Opal.to_ary($b), r = ($a[0] == null ? nil : $a[0]), theta = ($a[1] == null ? nil : $a[1]), $b; ore = other.$real(); oim = other.$imag(); nr = $scope.get('Math').$exp($rb_minus($rb_times(ore, $scope.get('Math').$log(r)), $rb_times(oim, theta))); ntheta = $rb_plus($rb_times(theta, ore), $rb_times(oim, $scope.get('Math').$log(r))); return $scope.get('Complex').$polar(nr, ntheta); } else if ((($a = $scope.get('Integer')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_gt(other, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { x = self; z = x; n = $rb_minus(other, 1); while ((($b = n['$!='](0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { while ((($c = ($e = n.$divmod(2), $d = Opal.to_ary($e), div = ($d[0] == null ? nil : $d[0]), mod = ($d[1] == null ? nil : $d[1]), $e, mod['$=='](0))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { x = self.$Complex($rb_minus($rb_times(x.$real(), x.$real()), $rb_times(x.$imag(), x.$imag())), $rb_times($rb_times(2, x.$real()), x.$imag())); n = div;}; z = $rb_times(z, x); n = $rb_minus(n, 1);}; return z; } else { return ($rb_divide($scope.get('Rational').$new(1, 1), self))['$**'](other['$-@']()) } } else if ((($a = ((($b = $scope.get('Float')['$==='](other)) !== false && $b !== nil && $b != null) ? $b : $scope.get('Rational')['$==='](other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { $b = self.$polar(), $a = Opal.to_ary($b), r = ($a[0] == null ? nil : $a[0]), theta = ($a[1] == null ? nil : $a[1]), $b; return $scope.get('Complex').$polar(r['$**'](other), $rb_times(theta, other)); } else { return self.$__coerced__("**", other) }; }, TMP_11.$$arity = 1); Opal.defn(self, '$abs', TMP_12 = function $$abs() { var self = this; return $scope.get('Math').$hypot(self.real, self.imag); }, TMP_12.$$arity = 0); Opal.defn(self, '$abs2', TMP_13 = function $$abs2() { var self = this; return $rb_plus($rb_times(self.real, self.real), $rb_times(self.imag, self.imag)); }, TMP_13.$$arity = 0); Opal.defn(self, '$angle', TMP_14 = function $$angle() { var self = this; return $scope.get('Math').$atan2(self.imag, self.real); }, TMP_14.$$arity = 0); Opal.alias(self, 'arg', 'angle'); Opal.defn(self, '$conj', TMP_15 = function $$conj() { var self = this; return self.$Complex(self.real, self.imag['$-@']()); }, TMP_15.$$arity = 0); Opal.alias(self, 'conjugate', 'conj'); Opal.defn(self, '$denominator', TMP_16 = function $$denominator() { var self = this; return self.real.$denominator().$lcm(self.imag.$denominator()); }, TMP_16.$$arity = 0); Opal.alias(self, 'divide', '/'); Opal.defn(self, '$eql?', TMP_17 = function(other) { var $a, $b, self = this; return ($a = ($b = $scope.get('Complex')['$==='](other), $b !== false && $b !== nil && $b != null ?self.real.$class()['$=='](self.imag.$class()) : $b), $a !== false && $a !== nil && $a != null ?self['$=='](other) : $a); }, TMP_17.$$arity = 1); Opal.defn(self, '$fdiv', TMP_18 = function $$fdiv(other) { var $a, self = this; if ((($a = $scope.get('Numeric')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "" + (other.$class()) + " can't be coerced into Complex") }; return $rb_divide(self, other); }, TMP_18.$$arity = 1); Opal.defn(self, '$hash', TMP_19 = function $$hash() { var self = this; return "Complex:" + (self.real) + ":" + (self.imag); }, TMP_19.$$arity = 0); Opal.alias(self, 'imaginary', 'imag'); Opal.defn(self, '$inspect', TMP_20 = function $$inspect() { var self = this; return "(" + (self.$to_s()) + ")"; }, TMP_20.$$arity = 0); Opal.alias(self, 'magnitude', 'abs'); Opal.defn(self, '$numerator', TMP_21 = function $$numerator() { var self = this, d = nil; d = self.$denominator(); return self.$Complex($rb_times(self.real.$numerator(), ($rb_divide(d, self.real.$denominator()))), $rb_times(self.imag.$numerator(), ($rb_divide(d, self.imag.$denominator())))); }, TMP_21.$$arity = 0); Opal.alias(self, 'phase', 'arg'); Opal.defn(self, '$polar', TMP_22 = function $$polar() { var self = this; return [self.$abs(), self.$arg()]; }, TMP_22.$$arity = 0); Opal.alias(self, 'quo', '/'); Opal.defn(self, '$rationalize', TMP_23 = function $$rationalize(eps) { var $a, self = this; if (arguments.length > 1) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arguments.length) + " for 0..1)"); } ; if ((($a = self.imag['$!='](0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('RangeError'), "can't' convert " + (self) + " into Rational")}; return self.$real().$rationalize(eps); }, TMP_23.$$arity = -1); Opal.defn(self, '$real?', TMP_24 = function() { var self = this; return false; }, TMP_24.$$arity = 0); Opal.defn(self, '$rect', TMP_25 = function $$rect() { var self = this; return [self.real, self.imag]; }, TMP_25.$$arity = 0); Opal.alias(self, 'rectangular', 'rect'); Opal.defn(self, '$to_f', TMP_26 = function $$to_f() { var self = this; if (self.imag['$=='](0)) { } else { self.$raise($scope.get('RangeError'), "can't convert " + (self) + " into Float") }; return self.real.$to_f(); }, TMP_26.$$arity = 0); Opal.defn(self, '$to_i', TMP_27 = function $$to_i() { var self = this; if (self.imag['$=='](0)) { } else { self.$raise($scope.get('RangeError'), "can't convert " + (self) + " into Integer") }; return self.real.$to_i(); }, TMP_27.$$arity = 0); Opal.defn(self, '$to_r', TMP_28 = function $$to_r() { var self = this; if (self.imag['$=='](0)) { } else { self.$raise($scope.get('RangeError'), "can't convert " + (self) + " into Rational") }; return self.real.$to_r(); }, TMP_28.$$arity = 0); Opal.defn(self, '$to_s', TMP_29 = function $$to_s() { var $a, $b, $c, self = this, result = nil; result = self.real.$inspect(); if ((($a = ((($b = (($c = $scope.get('Number')['$==='](self.imag), $c !== false && $c !== nil && $c != null ?self.imag['$nan?']() : $c))) !== false && $b !== nil && $b != null) ? $b : self.imag['$positive?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, "+") } else { result = $rb_plus(result, "-") }; result = $rb_plus(result, self.imag.$abs().$inspect()); if ((($a = ($b = $scope.get('Number')['$==='](self.imag), $b !== false && $b !== nil && $b != null ?(((($c = self.imag['$nan?']()) !== false && $c !== nil && $c != null) ? $c : self.imag['$infinite?']())) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, "*")}; return $rb_plus(result, "i"); }, TMP_29.$$arity = 0); return Opal.cdecl($scope, 'I', self.$new(0, 1)); })($scope.base, $scope.get('Numeric')); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_30; Opal.defn(self, '$Complex', TMP_30 = function $$Complex(real, imag) { var self = this; if (imag == null) { imag = nil; } if (imag !== false && imag !== nil && imag != null) { return $scope.get('Complex').$new(real, imag) } else { return $scope.get('Complex').$new(real, 0) }; }, TMP_30.$$arity = -2) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/rational"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module; Opal.add_stubs(['$require', '$to_i', '$==', '$raise', '$<', '$-@', '$new', '$gcd', '$/', '$nil?', '$===', '$reduce', '$to_r', '$equal?', '$!', '$coerce_to!', '$attr_reader', '$to_f', '$numerator', '$denominator', '$<=>', '$-', '$*', '$__coerced__', '$+', '$Rational', '$>', '$**', '$abs', '$ceil', '$with_precision', '$floor', '$to_s', '$<=', '$truncate', '$send', '$convert']); self.$require("corelib/numeric"); (function($base, $super) { function $Rational(){}; var self = $Rational = $klass($base, $super, 'Rational', $Rational); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26; def.num = def.den = nil; Opal.defs(self, '$reduce', TMP_1 = function $$reduce(num, den) { var $a, self = this, gcd = nil; num = num.$to_i(); den = den.$to_i(); if (den['$=='](0)) { self.$raise($scope.get('ZeroDivisionError'), "divided by 0") } else if ((($a = $rb_lt(den, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { num = num['$-@'](); den = den['$-@'](); } else if (den['$=='](1)) { return self.$new(num, den)}; gcd = num.$gcd(den); return self.$new($rb_divide(num, gcd), $rb_divide(den, gcd)); }, TMP_1.$$arity = 2); Opal.defs(self, '$convert', TMP_2 = function $$convert(num, den) { var $a, $b, $c, self = this; if ((($a = ((($b = num['$nil?']()) !== false && $b !== nil && $b != null) ? $b : den['$nil?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('TypeError'), "cannot convert nil into Rational")}; if ((($a = ($b = $scope.get('Integer')['$==='](num), $b !== false && $b !== nil && $b != null ?$scope.get('Integer')['$==='](den) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$reduce(num, den)}; if ((($a = ((($b = ((($c = $scope.get('Float')['$==='](num)) !== false && $c !== nil && $c != null) ? $c : $scope.get('String')['$==='](num))) !== false && $b !== nil && $b != null) ? $b : $scope.get('Complex')['$==='](num))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { num = num.$to_r()}; if ((($a = ((($b = ((($c = $scope.get('Float')['$==='](den)) !== false && $c !== nil && $c != null) ? $c : $scope.get('String')['$==='](den))) !== false && $b !== nil && $b != null) ? $b : $scope.get('Complex')['$==='](den))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { den = den.$to_r()}; if ((($a = ($b = den['$equal?'](1), $b !== false && $b !== nil && $b != null ?($scope.get('Integer')['$==='](num))['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Opal')['$coerce_to!'](num, $scope.get('Rational'), "to_r") } else if ((($a = ($b = $scope.get('Numeric')['$==='](num), $b !== false && $b !== nil && $b != null ?$scope.get('Numeric')['$==='](den) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $rb_divide(num, den) } else { return self.$reduce(num, den) }; }, TMP_2.$$arity = 2); self.$attr_reader("numerator", "denominator"); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(num, den) { var self = this; self.num = num; return self.den = den; }, TMP_3.$$arity = 2); Opal.defn(self, '$numerator', TMP_4 = function $$numerator() { var self = this; return self.num; }, TMP_4.$$arity = 0); Opal.defn(self, '$denominator', TMP_5 = function $$denominator() { var self = this; return self.den; }, TMP_5.$$arity = 0); Opal.defn(self, '$coerce', TMP_6 = function $$coerce(other) { var self = this, $case = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {return [other, self]}else if ($scope.get('Integer')['$===']($case)) {return [other.$to_r(), self]}else if ($scope.get('Float')['$===']($case)) {return [other, self.$to_f()]}else { return nil }})(); }, TMP_6.$$arity = 1); Opal.defn(self, '$==', TMP_7 = function(other) { var $a, self = this, $case = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {return (($a = self.num['$=='](other.$numerator())) ? self.den['$=='](other.$denominator()) : self.num['$=='](other.$numerator()))}else if ($scope.get('Integer')['$===']($case)) {return (($a = self.num['$=='](other)) ? self.den['$=='](1) : self.num['$=='](other))}else if ($scope.get('Float')['$===']($case)) {return self.$to_f()['$=='](other)}else {return other['$=='](self)}})(); }, TMP_7.$$arity = 1); Opal.defn(self, '$<=>', TMP_8 = function(other) { var self = this, $case = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {return $rb_minus($rb_times(self.num, other.$denominator()), $rb_times(self.den, other.$numerator()))['$<=>'](0)}else if ($scope.get('Integer')['$===']($case)) {return $rb_minus(self.num, $rb_times(self.den, other))['$<=>'](0)}else if ($scope.get('Float')['$===']($case)) {return self.$to_f()['$<=>'](other)}else {return self.$__coerced__("<=>", other)}})(); }, TMP_8.$$arity = 1); Opal.defn(self, '$+', TMP_9 = function(other) { var self = this, $case = nil, num = nil, den = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {num = $rb_plus($rb_times(self.num, other.$denominator()), $rb_times(self.den, other.$numerator())); den = $rb_times(self.den, other.$denominator()); return self.$Rational(num, den);}else if ($scope.get('Integer')['$===']($case)) {return self.$Rational($rb_plus(self.num, $rb_times(other, self.den)), self.den)}else if ($scope.get('Float')['$===']($case)) {return $rb_plus(self.$to_f(), other)}else {return self.$__coerced__("+", other)}})(); }, TMP_9.$$arity = 1); Opal.defn(self, '$-', TMP_10 = function(other) { var self = this, $case = nil, num = nil, den = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {num = $rb_minus($rb_times(self.num, other.$denominator()), $rb_times(self.den, other.$numerator())); den = $rb_times(self.den, other.$denominator()); return self.$Rational(num, den);}else if ($scope.get('Integer')['$===']($case)) {return self.$Rational($rb_minus(self.num, $rb_times(other, self.den)), self.den)}else if ($scope.get('Float')['$===']($case)) {return $rb_minus(self.$to_f(), other)}else {return self.$__coerced__("-", other)}})(); }, TMP_10.$$arity = 1); Opal.defn(self, '$*', TMP_11 = function(other) { var self = this, $case = nil, num = nil, den = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {num = $rb_times(self.num, other.$numerator()); den = $rb_times(self.den, other.$denominator()); return self.$Rational(num, den);}else if ($scope.get('Integer')['$===']($case)) {return self.$Rational($rb_times(self.num, other), self.den)}else if ($scope.get('Float')['$===']($case)) {return $rb_times(self.$to_f(), other)}else {return self.$__coerced__("*", other)}})(); }, TMP_11.$$arity = 1); Opal.defn(self, '$/', TMP_12 = function(other) { var self = this, $case = nil, num = nil, den = nil; return (function() {$case = other;if ($scope.get('Rational')['$===']($case)) {num = $rb_times(self.num, other.$denominator()); den = $rb_times(self.den, other.$numerator()); return self.$Rational(num, den);}else if ($scope.get('Integer')['$===']($case)) {if (other['$=='](0)) { return $rb_divide(self.$to_f(), 0.0) } else { return self.$Rational(self.num, $rb_times(self.den, other)) }}else if ($scope.get('Float')['$===']($case)) {return $rb_divide(self.$to_f(), other)}else {return self.$__coerced__("/", other)}})(); }, TMP_12.$$arity = 1); Opal.defn(self, '$**', TMP_13 = function(other) { var $a, $b, self = this, $case = nil; return (function() {$case = other;if ($scope.get('Integer')['$===']($case)) {if ((($a = (($b = self['$=='](0)) ? $rb_lt(other, 0) : self['$=='](0))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Float')).$$scope.get('INFINITY')) } else if ((($a = $rb_gt(other, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Rational(self.num['$**'](other), self.den['$**'](other)) } else if ((($a = $rb_lt(other, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Rational(self.den['$**'](other['$-@']()), self.num['$**'](other['$-@']())) } else { return self.$Rational(1, 1) }}else if ($scope.get('Float')['$===']($case)) {return self.$to_f()['$**'](other)}else if ($scope.get('Rational')['$===']($case)) {if (other['$=='](0)) { return self.$Rational(1, 1) } else if (other.$denominator()['$=='](1)) { if ((($a = $rb_lt(other, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$Rational(self.den['$**'](other.$numerator().$abs()), self.num['$**'](other.$numerator().$abs())) } else { return self.$Rational(self.num['$**'](other.$numerator()), self.den['$**'](other.$numerator())) } } else if ((($a = (($b = self['$=='](0)) ? $rb_lt(other, 0) : self['$=='](0))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('ZeroDivisionError'), "divided by 0") } else { return self.$to_f()['$**'](other) }}else {return self.$__coerced__("**", other)}})(); }, TMP_13.$$arity = 1); Opal.defn(self, '$abs', TMP_14 = function $$abs() { var self = this; return self.$Rational(self.num.$abs(), self.den.$abs()); }, TMP_14.$$arity = 0); Opal.defn(self, '$ceil', TMP_15 = function $$ceil(precision) { var self = this; if (precision == null) { precision = 0; } if (precision['$=='](0)) { return (($rb_divide(self.num['$-@'](), self.den))['$-@']()).$ceil() } else { return self.$with_precision("ceil", precision) }; }, TMP_15.$$arity = -1); Opal.alias(self, 'divide', '/'); Opal.defn(self, '$floor', TMP_16 = function $$floor(precision) { var self = this; if (precision == null) { precision = 0; } if (precision['$=='](0)) { return (($rb_divide(self.num['$-@'](), self.den))['$-@']()).$floor() } else { return self.$with_precision("floor", precision) }; }, TMP_16.$$arity = -1); Opal.defn(self, '$hash', TMP_17 = function $$hash() { var self = this; return "Rational:" + (self.num) + ":" + (self.den); }, TMP_17.$$arity = 0); Opal.defn(self, '$inspect', TMP_18 = function $$inspect() { var self = this; return "(" + (self.$to_s()) + ")"; }, TMP_18.$$arity = 0); Opal.alias(self, 'quo', '/'); Opal.defn(self, '$rationalize', TMP_19 = function $$rationalize(eps) { var self = this; if (arguments.length > 1) { self.$raise($scope.get('ArgumentError'), "wrong number of arguments (" + (arguments.length) + " for 0..1)"); } if (eps == null) { return self; } var e = eps.$abs(), a = $rb_minus(self, e), b = $rb_plus(self, e); var p0 = 0, p1 = 1, q0 = 1, q1 = 0, p2, q2; var c, k, t; while (true) { c = (a).$ceil(); if ($rb_le(c, b)) { break; } k = c - 1; p2 = k * p1 + p0; q2 = k * q1 + q0; t = $rb_divide(1, ($rb_minus(b, k))); b = $rb_divide(1, ($rb_minus(a, k))); a = t; p0 = p1; q0 = q1; p1 = p2; q1 = q2; } return self.$Rational(c * p1 + p0, c * q1 + q0); ; }, TMP_19.$$arity = -1); Opal.defn(self, '$round', TMP_20 = function $$round(precision) { var $a, self = this, num = nil, den = nil, approx = nil; if (precision == null) { precision = 0; } if (precision['$=='](0)) { } else { return self.$with_precision("round", precision) }; if (self.num['$=='](0)) { return 0}; if (self.den['$=='](1)) { return self.num}; num = $rb_plus($rb_times(self.num.$abs(), 2), self.den); den = $rb_times(self.den, 2); approx = ($rb_divide(num, den)).$truncate(); if ((($a = $rb_lt(self.num, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return approx['$-@']() } else { return approx }; }, TMP_20.$$arity = -1); Opal.defn(self, '$to_f', TMP_21 = function $$to_f() { var self = this; return $rb_divide(self.num, self.den); }, TMP_21.$$arity = 0); Opal.defn(self, '$to_i', TMP_22 = function $$to_i() { var self = this; return self.$truncate(); }, TMP_22.$$arity = 0); Opal.defn(self, '$to_r', TMP_23 = function $$to_r() { var self = this; return self; }, TMP_23.$$arity = 0); Opal.defn(self, '$to_s', TMP_24 = function $$to_s() { var self = this; return "" + (self.num) + "/" + (self.den); }, TMP_24.$$arity = 0); Opal.defn(self, '$truncate', TMP_25 = function $$truncate(precision) { var $a, self = this; if (precision == null) { precision = 0; } if (precision['$=='](0)) { if ((($a = $rb_lt(self.num, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$ceil() } else { return self.$floor() } } else { return self.$with_precision("truncate", precision) }; }, TMP_25.$$arity = -1); return (Opal.defn(self, '$with_precision', TMP_26 = function $$with_precision(method, precision) { var $a, self = this, p = nil, s = nil; if ((($a = $scope.get('Integer')['$==='](precision)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "not an Integer") }; p = (10)['$**'](precision); s = $rb_times(self, p); if ((($a = $rb_lt(precision, 1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($rb_divide(s.$send(method), p)).$to_i() } else { return self.$Rational(s.$send(method), p) }; }, TMP_26.$$arity = 2), nil) && 'with_precision'; })($scope.base, $scope.get('Numeric')); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_27; Opal.defn(self, '$Rational', TMP_27 = function $$Rational(numerator, denominator) { var self = this; if (denominator == null) { denominator = 1; } return $scope.get('Rational').$convert(numerator, denominator); }, TMP_27.$$arity = -2) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/time"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$include', '$===', '$raise', '$coerce_to!', '$respond_to?', '$to_str', '$to_i', '$new', '$<=>', '$to_f', '$nil?', '$>', '$<', '$strftime', '$year', '$month', '$day', '$+', '$round', '$/', '$-', '$copy_instance_variables', '$initialize_dup', '$is_a?', '$zero?', '$wday', '$utc?', '$mon', '$yday', '$hour', '$min', '$sec', '$rjust', '$ljust', '$zone', '$to_s', '$[]', '$cweek_cyear', '$isdst', '$<=', '$!=', '$==', '$ceil']); self.$require("corelib/comparable"); return (function($base, $super) { function $Time(){}; var self = $Time = $klass($base, $super, 'Time', $Time); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42; self.$include($scope.get('Comparable')); var days_of_week = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], short_days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], short_months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], long_months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; ; Opal.defs(self, '$at', TMP_1 = function $$at(seconds, frac) { var self = this; var result; if ($scope.get('Time')['$==='](seconds)) { if (frac !== undefined) { self.$raise($scope.get('TypeError'), "can't convert Time into an exact number") } result = new Date(seconds.getTime()); result.is_utc = seconds.is_utc; return result; } if (!seconds.$$is_number) { seconds = $scope.get('Opal')['$coerce_to!'](seconds, $scope.get('Integer'), "to_int"); } if (frac === undefined) { return new Date(seconds * 1000); } if (!frac.$$is_number) { frac = $scope.get('Opal')['$coerce_to!'](frac, $scope.get('Integer'), "to_int"); } return new Date(seconds * 1000 + (frac / 1000)); ; }, TMP_1.$$arity = -2); function time_params(year, month, day, hour, min, sec) { if (year.$$is_string) { year = parseInt(year, 10); } else { year = $scope.get('Opal')['$coerce_to!'](year, $scope.get('Integer'), "to_int"); } if (month === nil) { month = 1; } else if (!month.$$is_number) { if ((month)['$respond_to?']("to_str")) { month = (month).$to_str(); switch (month.toLowerCase()) { case 'jan': month = 1; break; case 'feb': month = 2; break; case 'mar': month = 3; break; case 'apr': month = 4; break; case 'may': month = 5; break; case 'jun': month = 6; break; case 'jul': month = 7; break; case 'aug': month = 8; break; case 'sep': month = 9; break; case 'oct': month = 10; break; case 'nov': month = 11; break; case 'dec': month = 12; break; default: month = (month).$to_i(); } } else { month = $scope.get('Opal')['$coerce_to!'](month, $scope.get('Integer'), "to_int"); } } if (month < 1 || month > 12) { self.$raise($scope.get('ArgumentError'), "month out of range: " + (month)) } month = month - 1; if (day === nil) { day = 1; } else if (day.$$is_string) { day = parseInt(day, 10); } else { day = $scope.get('Opal')['$coerce_to!'](day, $scope.get('Integer'), "to_int"); } if (day < 1 || day > 31) { self.$raise($scope.get('ArgumentError'), "day out of range: " + (day)) } if (hour === nil) { hour = 0; } else if (hour.$$is_string) { hour = parseInt(hour, 10); } else { hour = $scope.get('Opal')['$coerce_to!'](hour, $scope.get('Integer'), "to_int"); } if (hour < 0 || hour > 24) { self.$raise($scope.get('ArgumentError'), "hour out of range: " + (hour)) } if (min === nil) { min = 0; } else if (min.$$is_string) { min = parseInt(min, 10); } else { min = $scope.get('Opal')['$coerce_to!'](min, $scope.get('Integer'), "to_int"); } if (min < 0 || min > 59) { self.$raise($scope.get('ArgumentError'), "min out of range: " + (min)) } if (sec === nil) { sec = 0; } else if (!sec.$$is_number) { if (sec.$$is_string) { sec = parseInt(sec, 10); } else { sec = $scope.get('Opal')['$coerce_to!'](sec, $scope.get('Integer'), "to_int"); } } if (sec < 0 || sec > 60) { self.$raise($scope.get('ArgumentError'), "sec out of range: " + (sec)) } return [year, month, day, hour, min, sec]; } ; Opal.defs(self, '$new', TMP_2 = function(year, month, day, hour, min, sec, utc_offset) { var self = this; if (month == null) { month = nil; } if (day == null) { day = nil; } if (hour == null) { hour = nil; } if (min == null) { min = nil; } if (sec == null) { sec = nil; } if (utc_offset == null) { utc_offset = nil; } var args, result; if (year === undefined) { return new Date(); } if (utc_offset !== nil) { self.$raise($scope.get('ArgumentError'), "Opal does not support explicitly specifying UTC offset for Time") } args = time_params(year, month, day, hour, min, sec); year = args[0]; month = args[1]; day = args[2]; hour = args[3]; min = args[4]; sec = args[5]; result = new Date(year, month, day, hour, min, 0, sec * 1000); if (year < 100) { result.setFullYear(year); } return result; }, TMP_2.$$arity = -1); Opal.defs(self, '$local', TMP_3 = function $$local(year, month, day, hour, min, sec, millisecond, _dummy1, _dummy2, _dummy3) { var self = this; if (month == null) { month = nil; } if (day == null) { day = nil; } if (hour == null) { hour = nil; } if (min == null) { min = nil; } if (sec == null) { sec = nil; } if (millisecond == null) { millisecond = nil; } if (_dummy1 == null) { _dummy1 = nil; } if (_dummy2 == null) { _dummy2 = nil; } if (_dummy3 == null) { _dummy3 = nil; } var args, result; if (arguments.length === 10) { args = $slice.call(arguments); year = args[5]; month = args[4]; day = args[3]; hour = args[2]; min = args[1]; sec = args[0]; } args = time_params(year, month, day, hour, min, sec); year = args[0]; month = args[1]; day = args[2]; hour = args[3]; min = args[4]; sec = args[5]; result = new Date(year, month, day, hour, min, 0, sec * 1000); if (year < 100) { result.setFullYear(year); } return result; }, TMP_3.$$arity = -2); Opal.defs(self, '$gm', TMP_4 = function $$gm(year, month, day, hour, min, sec, millisecond, _dummy1, _dummy2, _dummy3) { var self = this; if (month == null) { month = nil; } if (day == null) { day = nil; } if (hour == null) { hour = nil; } if (min == null) { min = nil; } if (sec == null) { sec = nil; } if (millisecond == null) { millisecond = nil; } if (_dummy1 == null) { _dummy1 = nil; } if (_dummy2 == null) { _dummy2 = nil; } if (_dummy3 == null) { _dummy3 = nil; } var args, result; if (arguments.length === 10) { args = $slice.call(arguments); year = args[5]; month = args[4]; day = args[3]; hour = args[2]; min = args[1]; sec = args[0]; } args = time_params(year, month, day, hour, min, sec); year = args[0]; month = args[1]; day = args[2]; hour = args[3]; min = args[4]; sec = args[5]; result = new Date(Date.UTC(year, month, day, hour, min, 0, sec * 1000)); if (year < 100) { result.setUTCFullYear(year); } result.is_utc = true; return result; }, TMP_4.$$arity = -2); (function(self) { var $scope = self.$$scope, def = self.$$proto; Opal.alias(self, 'mktime', 'local'); return Opal.alias(self, 'utc', 'gm'); })(Opal.get_singleton_class(self)); Opal.defs(self, '$now', TMP_5 = function $$now() { var self = this; return self.$new(); }, TMP_5.$$arity = 0); Opal.defn(self, '$+', TMP_6 = function(other) { var $a, self = this; if ((($a = $scope.get('Time')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('TypeError'), "time + time?")}; if (!other.$$is_number) { other = $scope.get('Opal')['$coerce_to!'](other, $scope.get('Integer'), "to_int"); } var result = new Date(self.getTime() + (other * 1000)); result.is_utc = self.is_utc; return result; ; }, TMP_6.$$arity = 1); Opal.defn(self, '$-', TMP_7 = function(other) { var $a, self = this; if ((($a = $scope.get('Time')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (self.getTime() - other.getTime()) / 1000}; if (!other.$$is_number) { other = $scope.get('Opal')['$coerce_to!'](other, $scope.get('Integer'), "to_int"); } var result = new Date(self.getTime() - (other * 1000)); result.is_utc = self.is_utc; return result; ; }, TMP_7.$$arity = 1); Opal.defn(self, '$<=>', TMP_8 = function(other) { var $a, self = this, r = nil; if ((($a = $scope.get('Time')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$to_f()['$<=>'](other.$to_f()) } else { r = other['$<=>'](self); if ((($a = r['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else if ((($a = $rb_gt(r, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return -1 } else if ((($a = $rb_lt(r, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return 1 } else { return 0 }; }; }, TMP_8.$$arity = 1); Opal.defn(self, '$==', TMP_9 = function(other) { var self = this; return self.$to_f() === other.$to_f(); }, TMP_9.$$arity = 1); Opal.defn(self, '$asctime', TMP_10 = function $$asctime() { var self = this; return self.$strftime("%a %b %e %H:%M:%S %Y"); }, TMP_10.$$arity = 0); Opal.alias(self, 'ctime', 'asctime'); Opal.defn(self, '$day', TMP_11 = function $$day() { var self = this; return self.is_utc ? self.getUTCDate() : self.getDate(); }, TMP_11.$$arity = 0); Opal.defn(self, '$yday', TMP_12 = function $$yday() { var self = this, start_of_year = nil, start_of_day = nil, one_day = nil; start_of_year = $scope.get('Time').$new(self.$year()).$to_i(); start_of_day = $scope.get('Time').$new(self.$year(), self.$month(), self.$day()).$to_i(); one_day = 86400; return $rb_plus(($rb_divide(($rb_minus(start_of_day, start_of_year)), one_day)).$round(), 1); }, TMP_12.$$arity = 0); Opal.defn(self, '$isdst', TMP_13 = function $$isdst() { var self = this; var jan = new Date(self.getFullYear(), 0, 1), jul = new Date(self.getFullYear(), 6, 1); return self.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); }, TMP_13.$$arity = 0); Opal.alias(self, 'dst?', 'isdst'); Opal.defn(self, '$dup', TMP_14 = function $$dup() { var self = this, copy = nil; copy = new Date(self.getTime()); copy.$copy_instance_variables(self); copy.$initialize_dup(self); return copy; }, TMP_14.$$arity = 0); Opal.defn(self, '$eql?', TMP_15 = function(other) { var $a, self = this; return ($a = other['$is_a?']($scope.get('Time')), $a !== false && $a !== nil && $a != null ?(self['$<=>'](other))['$zero?']() : $a); }, TMP_15.$$arity = 1); Opal.defn(self, '$friday?', TMP_16 = function() { var self = this; return self.$wday() == 5; }, TMP_16.$$arity = 0); Opal.defn(self, '$hash', TMP_17 = function $$hash() { var self = this; return 'Time:' + self.getTime(); }, TMP_17.$$arity = 0); Opal.defn(self, '$hour', TMP_18 = function $$hour() { var self = this; return self.is_utc ? self.getUTCHours() : self.getHours(); }, TMP_18.$$arity = 0); Opal.defn(self, '$inspect', TMP_19 = function $$inspect() { var $a, self = this; if ((($a = self['$utc?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$strftime("%Y-%m-%d %H:%M:%S UTC") } else { return self.$strftime("%Y-%m-%d %H:%M:%S %z") }; }, TMP_19.$$arity = 0); Opal.alias(self, 'mday', 'day'); Opal.defn(self, '$min', TMP_20 = function $$min() { var self = this; return self.is_utc ? self.getUTCMinutes() : self.getMinutes(); }, TMP_20.$$arity = 0); Opal.defn(self, '$mon', TMP_21 = function $$mon() { var self = this; return (self.is_utc ? self.getUTCMonth() : self.getMonth()) + 1; }, TMP_21.$$arity = 0); Opal.defn(self, '$monday?', TMP_22 = function() { var self = this; return self.$wday() == 1; }, TMP_22.$$arity = 0); Opal.alias(self, 'month', 'mon'); Opal.defn(self, '$saturday?', TMP_23 = function() { var self = this; return self.$wday() == 6; }, TMP_23.$$arity = 0); Opal.defn(self, '$sec', TMP_24 = function $$sec() { var self = this; return self.is_utc ? self.getUTCSeconds() : self.getSeconds(); }, TMP_24.$$arity = 0); Opal.defn(self, '$succ', TMP_25 = function $$succ() { var self = this; var result = new Date(self.getTime() + 1000); result.is_utc = self.is_utc; return result; }, TMP_25.$$arity = 0); Opal.defn(self, '$usec', TMP_26 = function $$usec() { var self = this; return self.getMilliseconds() * 1000; }, TMP_26.$$arity = 0); Opal.defn(self, '$zone', TMP_27 = function $$zone() { var self = this; var string = self.toString(), result; if (string.indexOf('(') == -1) { result = string.match(/[A-Z]{3,4}/)[0]; } else { result = string.match(/\([^)]+\)/)[0].match(/[A-Z]/g).join(''); } if (result == "GMT" && /(GMT\W*\d{4})/.test(string)) { return RegExp.$1; } else { return result; } }, TMP_27.$$arity = 0); Opal.defn(self, '$getgm', TMP_28 = function $$getgm() { var self = this; var result = new Date(self.getTime()); result.is_utc = true; return result; }, TMP_28.$$arity = 0); Opal.alias(self, 'getutc', 'getgm'); Opal.defn(self, '$gmtime', TMP_29 = function $$gmtime() { var self = this; self.is_utc = true; return self; }, TMP_29.$$arity = 0); Opal.alias(self, 'utc', 'gmtime'); Opal.defn(self, '$gmt?', TMP_30 = function() { var self = this; return self.is_utc === true; }, TMP_30.$$arity = 0); Opal.defn(self, '$gmt_offset', TMP_31 = function $$gmt_offset() { var self = this; return -self.getTimezoneOffset() * 60; }, TMP_31.$$arity = 0); Opal.defn(self, '$strftime', TMP_32 = function $$strftime(format) { var self = this; return format.replace(/%([\-_#^0]*:{0,2})(\d+)?([EO]*)(.)/g, function(full, flags, width, _, conv) { var result = "", zero = flags.indexOf('0') !== -1, pad = flags.indexOf('-') === -1, blank = flags.indexOf('_') !== -1, upcase = flags.indexOf('^') !== -1, invert = flags.indexOf('#') !== -1, colons = (flags.match(':') || []).length; width = parseInt(width, 10); if (zero && blank) { if (flags.indexOf('0') < flags.indexOf('_')) { zero = false; } else { blank = false; } } switch (conv) { case 'Y': result += self.$year(); break; case 'C': zero = !blank; result += Math.round(self.$year() / 100); break; case 'y': zero = !blank; result += (self.$year() % 100); break; case 'm': zero = !blank; result += self.$mon(); break; case 'B': result += long_months[self.$mon() - 1]; break; case 'b': case 'h': blank = !zero; result += short_months[self.$mon() - 1]; break; case 'd': zero = !blank result += self.$day(); break; case 'e': blank = !zero result += self.$day(); break; case 'j': result += self.$yday(); break; case 'H': zero = !blank; result += self.$hour(); break; case 'k': blank = !zero; result += self.$hour(); break; case 'I': zero = !blank; result += (self.$hour() % 12 || 12); break; case 'l': blank = !zero; result += (self.$hour() % 12 || 12); break; case 'P': result += (self.$hour() >= 12 ? "pm" : "am"); break; case 'p': result += (self.$hour() >= 12 ? "PM" : "AM"); break; case 'M': zero = !blank; result += self.$min(); break; case 'S': zero = !blank; result += self.$sec() break; case 'L': zero = !blank; width = isNaN(width) ? 3 : width; result += self.getMilliseconds(); break; case 'N': width = isNaN(width) ? 9 : width; result += (self.getMilliseconds().toString()).$rjust(3, "0"); result = (result).$ljust(width, "0"); break; case 'z': var offset = self.getTimezoneOffset(), hours = Math.floor(Math.abs(offset) / 60), minutes = Math.abs(offset) % 60; result += offset < 0 ? "+" : "-"; result += hours < 10 ? "0" : ""; result += hours; if (colons > 0) { result += ":"; } result += minutes < 10 ? "0" : ""; result += minutes; if (colons > 1) { result += ":00"; } break; case 'Z': result += self.$zone(); break; case 'A': result += days_of_week[self.$wday()]; break; case 'a': result += short_days[self.$wday()]; break; case 'u': result += (self.$wday() + 1); break; case 'w': result += self.$wday(); break; case 'V': result += self.$cweek_cyear()['$[]'](0).$to_s().$rjust(2, "0"); break; case 'G': result += self.$cweek_cyear()['$[]'](1); break; case 'g': result += self.$cweek_cyear()['$[]'](1)['$[]']($range(-2, -1, false)); break; case 's': result += self.$to_i(); break; case 'n': result += "\n"; break; case 't': result += "\t"; break; case '%': result += "%"; break; case 'c': result += self.$strftime("%a %b %e %T %Y"); break; case 'D': case 'x': result += self.$strftime("%m/%d/%y"); break; case 'F': result += self.$strftime("%Y-%m-%d"); break; case 'v': result += self.$strftime("%e-%^b-%4Y"); break; case 'r': result += self.$strftime("%I:%M:%S %p"); break; case 'R': result += self.$strftime("%H:%M"); break; case 'T': case 'X': result += self.$strftime("%H:%M:%S"); break; default: return full; } if (upcase) { result = result.toUpperCase(); } if (invert) { result = result.replace(/[A-Z]/, function(c) { c.toLowerCase() }). replace(/[a-z]/, function(c) { c.toUpperCase() }); } if (pad && (zero || blank)) { result = (result).$rjust(isNaN(width) ? 2 : width, blank ? " " : "0"); } return result; }); }, TMP_32.$$arity = 1); Opal.defn(self, '$sunday?', TMP_33 = function() { var self = this; return self.$wday() == 0; }, TMP_33.$$arity = 0); Opal.defn(self, '$thursday?', TMP_34 = function() { var self = this; return self.$wday() == 4; }, TMP_34.$$arity = 0); Opal.defn(self, '$to_a', TMP_35 = function $$to_a() { var self = this; return [self.$sec(), self.$min(), self.$hour(), self.$day(), self.$month(), self.$year(), self.$wday(), self.$yday(), self.$isdst(), self.$zone()]; }, TMP_35.$$arity = 0); Opal.defn(self, '$to_f', TMP_36 = function $$to_f() { var self = this; return self.getTime() / 1000; }, TMP_36.$$arity = 0); Opal.defn(self, '$to_i', TMP_37 = function $$to_i() { var self = this; return parseInt(self.getTime() / 1000, 10); }, TMP_37.$$arity = 0); Opal.alias(self, 'to_s', 'inspect'); Opal.defn(self, '$tuesday?', TMP_38 = function() { var self = this; return self.$wday() == 2; }, TMP_38.$$arity = 0); Opal.alias(self, 'tv_sec', 'sec'); Opal.alias(self, 'tv_usec', 'usec'); Opal.alias(self, 'utc?', 'gmt?'); Opal.alias(self, 'gmtoff', 'gmt_offset'); Opal.alias(self, 'utc_offset', 'gmt_offset'); Opal.defn(self, '$wday', TMP_39 = function $$wday() { var self = this; return self.is_utc ? self.getUTCDay() : self.getDay(); }, TMP_39.$$arity = 0); Opal.defn(self, '$wednesday?', TMP_40 = function() { var self = this; return self.$wday() == 3; }, TMP_40.$$arity = 0); Opal.defn(self, '$year', TMP_41 = function $$year() { var self = this; return self.is_utc ? self.getUTCFullYear() : self.getFullYear(); }, TMP_41.$$arity = 0); return (Opal.defn(self, '$cweek_cyear', TMP_42 = function $$cweek_cyear() { var $a, $b, self = this, jan01 = nil, jan01_wday = nil, first_monday = nil, year = nil, offset = nil, week = nil, dec31 = nil, dec31_wday = nil; jan01 = $scope.get('Time').$new(self.$year(), 1, 1); jan01_wday = jan01.$wday(); first_monday = 0; year = self.$year(); if ((($a = ($b = $rb_le(jan01_wday, 4), $b !== false && $b !== nil && $b != null ?jan01_wday['$!='](0) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { offset = $rb_minus(jan01_wday, 1) } else { offset = $rb_minus($rb_minus(jan01_wday, 7), 1); if (offset['$=='](-8)) { offset = -1}; }; week = ($rb_divide(($rb_plus(self.$yday(), offset)), 7.0)).$ceil(); if ((($a = $rb_le(week, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Time').$new($rb_minus(self.$year(), 1), 12, 31).$cweek_cyear() } else if (week['$=='](53)) { dec31 = $scope.get('Time').$new(self.$year(), 12, 31); dec31_wday = dec31.$wday(); if ((($a = ($b = $rb_le(dec31_wday, 3), $b !== false && $b !== nil && $b != null ?dec31_wday['$!='](0) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { week = 1; year = $rb_plus(year, 1);};}; return [week, year]; }, TMP_42.$$arity = 0), nil) && 'cweek_cyear'; })($scope.base, Date); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/struct"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$include', '$const_name!', '$unshift', '$map', '$coerce_to!', '$new', '$each', '$define_struct_attribute', '$allocate', '$initialize', '$module_eval', '$to_proc', '$const_set', '$==', '$raise', '$<<', '$members', '$define_method', '$instance_eval', '$>', '$length', '$class', '$each_with_index', '$[]=', '$[]', '$hash', '$===', '$<', '$-@', '$size', '$>=', '$include?', '$to_sym', '$instance_of?', '$__id__', '$eql?', '$enum_for', '$name', '$+', '$join', '$inspect', '$each_pair', '$inject', '$flatten', '$to_a', '$values_at']); self.$require("corelib/enumerable"); return (function($base, $super) { function $Struct(){}; var self = $Struct = $klass($base, $super, 'Struct', $Struct); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_8, TMP_9, TMP_11, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_23, TMP_26, TMP_28, TMP_30, TMP_32, TMP_34, TMP_35; self.$include($scope.get('Enumerable')); Opal.defs(self, '$new', TMP_1 = function(const_name, $a_rest) { var $b, $c, TMP_2, $d, TMP_3, $e, self = this, args, $iter = TMP_1.$$p, block = $iter || nil, klass = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_1.$$p = null; if (const_name !== false && const_name !== nil && const_name != null) { try { const_name = $scope.get('Opal')['$const_name!'](const_name) } catch ($err) { if (Opal.rescue($err, [$scope.get('TypeError'), $scope.get('NameError')])) { try { args.$unshift(const_name); const_name = nil; } finally { Opal.pop_exception() } } else { throw $err; } }}; ($b = ($c = args).$map, $b.$$p = (TMP_2 = function(arg){var self = TMP_2.$$s || this; if (arg == null) arg = nil; return $scope.get('Opal')['$coerce_to!'](arg, $scope.get('String'), "to_str")}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).call($c); klass = ($b = ($d = $scope.get('Class')).$new, $b.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this, $a, $e, TMP_4; ($a = ($e = args).$each, $a.$$p = (TMP_4 = function(arg){var self = TMP_4.$$s || this; if (arg == null) arg = nil; return self.$define_struct_attribute(arg)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($e); return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_5; Opal.defn(self, '$new', TMP_5 = function($a_rest) { var $b, self = this, args, instance = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } instance = self.$allocate(); instance.$$data = {};; ($b = instance).$initialize.apply($b, Opal.to_a(args)); return instance; }, TMP_5.$$arity = -1); return Opal.alias(self, '[]', 'new'); })(Opal.get_singleton_class(self));}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $b).call($d, self); if (block !== false && block !== nil && block != null) { ($b = ($e = klass).$module_eval, $b.$$p = block.$to_proc(), $b).call($e)}; if (const_name !== false && const_name !== nil && const_name != null) { $scope.get('Struct').$const_set(const_name, klass)}; return klass; }, TMP_1.$$arity = -2); Opal.defs(self, '$define_struct_attribute', TMP_8 = function $$define_struct_attribute(name) { var $a, $b, TMP_6, $c, TMP_7, self = this; if (self['$==']($scope.get('Struct'))) { self.$raise($scope.get('ArgumentError'), "you cannot define attributes to the Struct class")}; self.$members()['$<<'](name); ($a = ($b = self).$define_method, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return self.$$data[name];}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($b, name); return ($a = ($c = self).$define_method, $a.$$p = (TMP_7 = function(value){var self = TMP_7.$$s || this; if (value == null) value = nil; return self.$$data[name] = value;}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($c, "" + (name) + "="); }, TMP_8.$$arity = 1); Opal.defs(self, '$members', TMP_9 = function $$members() { var $a, self = this; if (self.members == null) self.members = nil; if (self['$==']($scope.get('Struct'))) { self.$raise($scope.get('ArgumentError'), "the Struct class has no members")}; return ((($a = self.members) !== false && $a !== nil && $a != null) ? $a : self.members = []); }, TMP_9.$$arity = 0); Opal.defs(self, '$inherited', TMP_11 = function $$inherited(klass) { var $a, $b, TMP_10, self = this, members = nil; if (self.members == null) self.members = nil; members = self.members; return ($a = ($b = klass).$instance_eval, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; return self.members = members}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $a).call($b); }, TMP_11.$$arity = 1); Opal.defn(self, '$initialize', TMP_13 = function $$initialize($a_rest) { var $b, $c, TMP_12, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $rb_gt(args.$length(), self.$class().$members().$length())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('ArgumentError'), "struct size differs")}; return ($b = ($c = self.$class().$members()).$each_with_index, $b.$$p = (TMP_12 = function(name, index){var self = TMP_12.$$s || this; if (name == null) name = nil;if (index == null) index = nil; return self['$[]='](name, args['$[]'](index))}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $b).call($c); }, TMP_13.$$arity = -1); Opal.defn(self, '$members', TMP_14 = function $$members() { var self = this; return self.$class().$members(); }, TMP_14.$$arity = 0); Opal.defn(self, '$hash', TMP_15 = function $$hash() { var self = this; return $scope.get('Hash').$new(self.$$data).$hash(); }, TMP_15.$$arity = 0); Opal.defn(self, '$[]', TMP_16 = function(name) { var $a, self = this; if ((($a = $scope.get('Integer')['$==='](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_lt(name, self.$class().$members().$size()['$-@']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('IndexError'), "offset " + (name) + " too small for struct(size:" + (self.$class().$members().$size()) + ")")}; if ((($a = $rb_ge(name, self.$class().$members().$size())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('IndexError'), "offset " + (name) + " too large for struct(size:" + (self.$class().$members().$size()) + ")")}; name = self.$class().$members()['$[]'](name); } else if ((($a = $scope.get('String')['$==='](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if(!self.$$data.hasOwnProperty(name)) { self.$raise($scope.get('NameError').$new("no member '" + (name) + "' in struct", name)) } ; } else { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (name.$class()) + " into Integer") }; name = $scope.get('Opal')['$coerce_to!'](name, $scope.get('String'), "to_str"); return self.$$data[name]; }, TMP_16.$$arity = 1); Opal.defn(self, '$[]=', TMP_17 = function(name, value) { var $a, self = this; if ((($a = $scope.get('Integer')['$==='](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_lt(name, self.$class().$members().$size()['$-@']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('IndexError'), "offset " + (name) + " too small for struct(size:" + (self.$class().$members().$size()) + ")")}; if ((($a = $rb_ge(name, self.$class().$members().$size())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('IndexError'), "offset " + (name) + " too large for struct(size:" + (self.$class().$members().$size()) + ")")}; name = self.$class().$members()['$[]'](name); } else if ((($a = $scope.get('String')['$==='](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$class().$members()['$include?'](name.$to_sym())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('NameError').$new("no member '" + (name) + "' in struct", name)) } } else { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (name.$class()) + " into Integer") }; name = $scope.get('Opal')['$coerce_to!'](name, $scope.get('String'), "to_str"); return self.$$data[name] = value; }, TMP_17.$$arity = 2); Opal.defn(self, '$==', TMP_18 = function(other) { var $a, self = this; if ((($a = other['$instance_of?'](self.$class())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; var recursed1 = {}, recursed2 = {}; function _eqeq(struct, other) { var key, a, b; recursed1[(struct).$__id__()] = true; recursed2[(other).$__id__()] = true; for (key in struct.$$data) { a = struct.$$data[key]; b = other.$$data[key]; if ($scope.get('Struct')['$==='](a)) { if (!recursed1.hasOwnProperty((a).$__id__()) || !recursed2.hasOwnProperty((b).$__id__())) { if (!_eqeq(a, b)) { return false; } } } else { if (!(a)['$=='](b)) { return false; } } } return true; } return _eqeq(self, other); ; }, TMP_18.$$arity = 1); Opal.defn(self, '$eql?', TMP_19 = function(other) { var $a, self = this; if ((($a = other['$instance_of?'](self.$class())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; var recursed1 = {}, recursed2 = {}; function _eqeq(struct, other) { var key, a, b; recursed1[(struct).$__id__()] = true; recursed2[(other).$__id__()] = true; for (key in struct.$$data) { a = struct.$$data[key]; b = other.$$data[key]; if ($scope.get('Struct')['$==='](a)) { if (!recursed1.hasOwnProperty((a).$__id__()) || !recursed2.hasOwnProperty((b).$__id__())) { if (!_eqeq(a, b)) { return false; } } } else { if (!(a)['$eql?'](b)) { return false; } } } return true; } return _eqeq(self, other); ; }, TMP_19.$$arity = 1); Opal.defn(self, '$each', TMP_20 = function $$each() { var $a, $b, TMP_21, $c, TMP_22, self = this, $iter = TMP_20.$$p, $yield = $iter || nil; TMP_20.$$p = null; if (($yield !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this; return self.$size()}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21), $a).call($b, "each") }; ($a = ($c = self.$class().$members()).$each, $a.$$p = (TMP_22 = function(name){var self = TMP_22.$$s || this; if (name == null) name = nil; return Opal.yield1($yield, self['$[]'](name));}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $a).call($c); return self; }, TMP_20.$$arity = 0); Opal.defn(self, '$each_pair', TMP_23 = function $$each_pair() { var $a, $b, TMP_24, $c, TMP_25, self = this, $iter = TMP_23.$$p, $yield = $iter || nil; TMP_23.$$p = null; if (($yield !== nil)) { } else { return ($a = ($b = self).$enum_for, $a.$$p = (TMP_24 = function(){var self = TMP_24.$$s || this; return self.$size()}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24), $a).call($b, "each_pair") }; ($a = ($c = self.$class().$members()).$each, $a.$$p = (TMP_25 = function(name){var self = TMP_25.$$s || this; if (name == null) name = nil; return Opal.yield1($yield, [name, self['$[]'](name)]);}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25), $a).call($c); return self; }, TMP_23.$$arity = 0); Opal.defn(self, '$length', TMP_26 = function $$length() { var self = this; return self.$class().$members().$length(); }, TMP_26.$$arity = 0); Opal.alias(self, 'size', 'length'); Opal.defn(self, '$to_a', TMP_28 = function $$to_a() { var $a, $b, TMP_27, self = this; return ($a = ($b = self.$class().$members()).$map, $a.$$p = (TMP_27 = function(name){var self = TMP_27.$$s || this; if (name == null) name = nil; return self['$[]'](name)}, TMP_27.$$s = self, TMP_27.$$arity = 1, TMP_27), $a).call($b); }, TMP_28.$$arity = 0); Opal.alias(self, 'values', 'to_a'); Opal.defn(self, '$inspect', TMP_30 = function $$inspect() { var $a, $b, TMP_29, self = this, result = nil; result = "#"); return result; }, TMP_30.$$arity = 0); Opal.alias(self, 'to_s', 'inspect'); Opal.defn(self, '$to_h', TMP_32 = function $$to_h() { var $a, $b, TMP_31, self = this; return ($a = ($b = self.$class().$members()).$inject, $a.$$p = (TMP_31 = function(h, name){var self = TMP_31.$$s || this; if (h == null) h = nil;if (name == null) name = nil; h['$[]='](name, self['$[]'](name)); return h;}, TMP_31.$$s = self, TMP_31.$$arity = 2, TMP_31), $a).call($b, $hash2([], {})); }, TMP_32.$$arity = 0); Opal.defn(self, '$values_at', TMP_34 = function $$values_at($a_rest) { var $b, $c, TMP_33, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } args = ($b = ($c = args).$map, $b.$$p = (TMP_33 = function(arg){var self = TMP_33.$$s || this; if (arg == null) arg = nil; return arg.$$is_range ? arg.$to_a() : arg;}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33), $b).call($c).$flatten(); var result = []; for (var i = 0, len = args.length; i < len; i++) { if (!args[i].$$is_number) { self.$raise($scope.get('TypeError'), "no implicit conversion of " + ((args[i]).$class()) + " into Integer") } result.push(self['$[]'](args[i])); } return result; ; }, TMP_34.$$arity = -1); return (Opal.defs(self, '$_load', TMP_35 = function $$_load(args) { var $a, $b, self = this, attributes = nil; attributes = ($a = args).$values_at.apply($a, Opal.to_a(self.$members())); return ($b = self).$new.apply($b, Opal.to_a(attributes)); }, TMP_35.$$arity = 1), nil) && '_load'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/io"] = function(Opal) { var $a, $b, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module, $gvars = Opal.gvars; Opal.add_stubs(['$attr_accessor', '$size', '$write', '$join', '$map', '$String', '$empty?', '$concat', '$chomp', '$getbyte', '$getc', '$raise', '$new', '$write_proc=', '$extend']); (function($base, $super) { function $IO(){}; var self = $IO = $klass($base, $super, 'IO', $IO); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def.tty = def.closed = nil; Opal.cdecl($scope, 'SEEK_SET', 0); Opal.cdecl($scope, 'SEEK_CUR', 1); Opal.cdecl($scope, 'SEEK_END', 2); Opal.defn(self, '$tty?', TMP_1 = function() { var self = this; return self.tty; }, TMP_1.$$arity = 0); Opal.defn(self, '$closed?', TMP_2 = function() { var self = this; return self.closed; }, TMP_2.$$arity = 0); self.$attr_accessor("write_proc"); Opal.defn(self, '$write', TMP_3 = function $$write(string) { var self = this; self.write_proc(string); return string.$size(); }, TMP_3.$$arity = 1); self.$attr_accessor("sync", "tty"); Opal.defn(self, '$flush', TMP_4 = function $$flush() { var self = this; return nil; }, TMP_4.$$arity = 0); (function($base) { var $Writable, self = $Writable = $module($base, 'Writable'); var def = self.$$proto, $scope = self.$$scope, TMP_5, TMP_7, TMP_9; Opal.defn(self, '$<<', TMP_5 = function(string) { var self = this; self.$write(string); return self; }, TMP_5.$$arity = 1); Opal.defn(self, '$print', TMP_7 = function $$print($a_rest) { var $b, $c, TMP_6, self = this, args; if ($gvars[","] == null) $gvars[","] = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.$write(($b = ($c = args).$map, $b.$$p = (TMP_6 = function(arg){var self = TMP_6.$$s || this; if (arg == null) arg = nil; return self.$String(arg)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $b).call($c).$join($gvars[","])); return nil; }, TMP_7.$$arity = -1); Opal.defn(self, '$puts', TMP_9 = function $$puts($a_rest) { var $b, $c, TMP_8, self = this, args, newline = nil; if ($gvars["/"] == null) $gvars["/"] = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } newline = $gvars["/"]; if ((($b = args['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$write($gvars["/"]) } else { self.$write(($b = ($c = args).$map, $b.$$p = (TMP_8 = function(arg){var self = TMP_8.$$s || this; if (arg == null) arg = nil; return self.$String(arg).$chomp()}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $b).call($c).$concat([nil]).$join(newline)) }; return nil; }, TMP_9.$$arity = -1); })($scope.base); return (function($base) { var $Readable, self = $Readable = $module($base, 'Readable'); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_11, TMP_12, TMP_13; Opal.defn(self, '$readbyte', TMP_10 = function $$readbyte() { var self = this; return self.$getbyte(); }, TMP_10.$$arity = 0); Opal.defn(self, '$readchar', TMP_11 = function $$readchar() { var self = this; return self.$getc(); }, TMP_11.$$arity = 0); Opal.defn(self, '$readline', TMP_12 = function $$readline(sep) { var self = this; if ($gvars["/"] == null) $gvars["/"] = nil; if (sep == null) { sep = $gvars["/"]; } return self.$raise($scope.get('NotImplementedError')); }, TMP_12.$$arity = -1); Opal.defn(self, '$readpartial', TMP_13 = function $$readpartial(integer, outbuf) { var self = this; if (outbuf == null) { outbuf = nil; } return self.$raise($scope.get('NotImplementedError')); }, TMP_13.$$arity = -2); })($scope.base); })($scope.base, null); Opal.cdecl($scope, 'STDERR', $gvars.stderr = $scope.get('IO').$new()); Opal.cdecl($scope, 'STDIN', $gvars.stdin = $scope.get('IO').$new()); Opal.cdecl($scope, 'STDOUT', $gvars.stdout = $scope.get('IO').$new()); (($a = [typeof(process) === 'object' ? function(s){process.stdout.write(s)} : function(s){console.log(s)}]), $b = $scope.get('STDOUT'), $b['$write_proc='].apply($b, $a), $a[$a.length-1]); (($a = [typeof(process) === 'object' ? function(s){process.stderr.write(s)} : function(s){console.warn(s)}]), $b = $scope.get('STDERR'), $b['$write_proc='].apply($b, $a), $a[$a.length-1]); $scope.get('STDOUT').$extend((($scope.get('IO')).$$scope.get('Writable'))); return $scope.get('STDERR').$extend((($scope.get('IO')).$$scope.get('Writable'))); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/main"] = function(Opal) { var TMP_1, TMP_2, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$include']); Opal.defs(self, '$to_s', TMP_1 = function $$to_s() { var self = this; return "main"; }, TMP_1.$$arity = 0); return (Opal.defs(self, '$include', TMP_2 = function $$include(mod) { var self = this; return $scope.get('Object').$include(mod); }, TMP_2.$$arity = 1), nil) && 'include'; }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/dir"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$[]']); return (function($base, $super) { function $Dir(){}; var self = $Dir = $klass($base, $super, 'Dir', $Dir); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2, TMP_3; Opal.defn(self, '$chdir', TMP_1 = function $$chdir(dir) { var self = this, $iter = TMP_1.$$p, $yield = $iter || nil, prev_cwd = nil; TMP_1.$$p = null; try { prev_cwd = Opal.current_dir; Opal.current_dir = dir; return Opal.yieldX($yield, []);; } finally { Opal.current_dir = prev_cwd; }; }, TMP_1.$$arity = 1); Opal.defn(self, '$pwd', TMP_2 = function $$pwd() { var self = this; return Opal.current_dir || '.'; }, TMP_2.$$arity = 0); Opal.alias(self, 'getwd', 'pwd'); return (Opal.defn(self, '$home', TMP_3 = function $$home() { var $a, self = this; return ((($a = $scope.get('ENV')['$[]']("HOME")) !== false && $a !== nil && $a != null) ? $a : "."); }, TMP_3.$$arity = 0), nil) && 'home'; })(Opal.get_singleton_class(self)) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/file"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$join', '$compact', '$split', '$==', '$first', '$[]=', '$home', '$pwd', '$each', '$pop', '$<<', '$raise', '$respond_to?', '$to_path', '$class', '$nil?', '$is_a?', '$basename', '$empty?', '$rindex', '$[]', '$+', '$-', '$length', '$gsub', '$find', '$=~']); return (function($base, $super) { function $File(){}; var self = $File = $klass($base, $super, 'File', $File); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'Separator', Opal.cdecl($scope, 'SEPARATOR', "/")); Opal.cdecl($scope, 'ALT_SEPARATOR', nil); Opal.cdecl($scope, 'PATH_SEPARATOR', ":"); Opal.cdecl($scope, 'FNM_SYSCASE', 0); return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_9, TMP_10; Opal.defn(self, '$expand_path', TMP_2 = function $$expand_path(path, basedir) { var $a, $b, TMP_1, self = this, parts = nil, new_parts = nil; if (basedir == null) { basedir = nil; } path = [basedir, path].$compact().$join($scope.get('SEPARATOR')); parts = path.$split($scope.get('SEPARATOR')); new_parts = []; if (parts.$first()['$==']("~")) { parts['$[]='](0, $scope.get('Dir').$home())}; if (parts.$first()['$=='](".")) { parts['$[]='](0, $scope.get('Dir').$pwd())}; ($a = ($b = parts).$each, $a.$$p = (TMP_1 = function(part){var self = TMP_1.$$s || this; if (part == null) part = nil; if (part['$==']("..")) { return new_parts.$pop() } else { return new_parts['$<<'](part) }}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); return new_parts.$join($scope.get('SEPARATOR')); }, TMP_2.$$arity = -2); Opal.alias(self, 'realpath', 'expand_path'); function chompdirsep(path) { var last; while (path.length > 0) { if (isDirSep(path)) { last = path; path = path.substring(1, path.length); while (path.length > 0 && isDirSep(path)) { path = inc(path); } if (path.length == 0) { return last; } } else { path = inc(path); } } return path; } function inc(a) { return a.substring(1, a.length); } function skipprefix(path) { return path; } function lastSeparator(path) { var tmp, last; while (path.length > 0) { if (isDirSep(path)) { tmp = path; path = inc(path); while (path.length > 0 && isDirSep(path)) { path = inc(path); } if (!path) { break; } last = tmp; } else { path = inc(path); } } return last; } function isDirSep(sep) { return sep.charAt(0) === $scope.get('SEPARATOR'); } function skipRoot(path) { while (path.length > 0 && isDirSep(path)) { path = inc(path); } return path; } function pointerSubtract(a, b) { if (a.length == 0) { return b.length; } return b.indexOf(a); } function handleSuffix(n, f, p, suffix, name, origName) { var suffixMatch; if (n >= 0) { if (suffix === nil) { f = n; } else { suffixMatch = suffix === '.*' ? '\\.\\w+' : suffix.replace(/\?/g, '\\?'); suffixMatch = new RegExp(suffixMatch + $scope.get('Separator') + '*$').exec(p); if (suffixMatch) { f = suffixMatch.index; } else { f = n; } } if (f === origName.length) { return name; } } return p.substring(0, f); } Opal.defn(self, '$dirname', TMP_3 = function $$dirname(path) { var self = this; if (path === nil) { self.$raise($scope.get('TypeError'), "no implicit conversion of nil into String") } if (path['$respond_to?']("to_path")) { path = path.$to_path(); } if (!path.$$is_string) { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (path.$class()) + " into String") } var root, p; root = skipRoot(path); // if (root > name + 1) in the C code if (root.length == 0) { path = path.substring(path.length - 1, path.length); } else if (root.length - path.length < 0) { path = path.substring(path.indexOf(root)-1, path.length); } p = lastSeparator(root); if (!p) { p = root; } if (p === path) { return '.'; } return path.substring(0, path.length - p.length); ; }, TMP_3.$$arity = 1); Opal.defn(self, '$basename', TMP_4 = function $$basename(name, suffix) { var self = this; if (suffix == null) { suffix = nil; } var p, q, e, f = 0, n = -1, tmp, pointerMath, origName; if (name === nil) { self.$raise($scope.get('TypeError'), "no implicit conversion of nil into String") } if (name['$respond_to?']("to_path")) { name = name.$to_path(); } if (!name.$$is_string) { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (name.$class()) + " into String") } if (suffix !== nil && !suffix.$$is_string) { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (suffix.$class()) + " into String") } if (name.length == 0) { return name; } origName = name; name = skipprefix(name); while (isDirSep(name)) { tmp = name; name = inc(name); } if (!name) { p = tmp; f = 1; } else { if (!(p = lastSeparator(name))) { p = name; } else { while (isDirSep(p)) { p = inc(p); } } n = pointerSubtract(chompdirsep(p), p); for (q = p; pointerSubtract(q, p) < n && q.charAt(0) === '.'; q = inc(q)) { } for (e = null; pointerSubtract(q, p) < n; q = inc(q)) { if (q.charAt(0) === '.') { e = q; } } if (e) { f = pointerSubtract(e, p); } else { f = n; } } return handleSuffix(n, f, p, suffix, name, origName); ; }, TMP_4.$$arity = -2); Opal.defn(self, '$extname', TMP_5 = function $$extname(path) { var $a, $b, self = this, filename = nil, last_dot_idx = nil; if ((($a = path['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('TypeError'), "no implicit conversion of nil into String")}; if ((($a = path['$respond_to?']("to_path")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { path = path.$to_path()}; if ((($a = path['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (path.$class()) + " into String") }; filename = self.$basename(path); if ((($a = filename['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ""}; last_dot_idx = filename['$[]']($range(1, -1, false)).$rindex("."); if ((($a = (((($b = last_dot_idx['$nil?']()) !== false && $b !== nil && $b != null) ? $b : $rb_plus(last_dot_idx, 1)['$==']($rb_minus(filename.$length(), 1))))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "" } else { return filename['$[]']($range(($rb_plus(last_dot_idx, 1)), -1, false)) }; }, TMP_5.$$arity = 1); Opal.defn(self, '$exist?', TMP_6 = function(path) { var self = this; return Opal.modules[path] != null; }, TMP_6.$$arity = 1); Opal.alias(self, 'exists?', 'exist?'); Opal.defn(self, '$directory?', TMP_8 = function(path) { var $a, $b, TMP_7, self = this, files = nil, file = nil; files = []; for (var key in Opal.modules) { files.push(key) } ; path = path.$gsub((new RegExp("(^." + $scope.get('SEPARATOR') + "+|" + $scope.get('SEPARATOR') + "+$)"))); file = ($a = ($b = files).$find, $a.$$p = (TMP_7 = function(file){var self = TMP_7.$$s || this; if (file == null) file = nil; return file['$=~']((new RegExp("^" + path)))}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); return file; }, TMP_8.$$arity = 1); Opal.defn(self, '$join', TMP_9 = function $$join($a_rest) { var self = this, paths; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } paths = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { paths[$arg_idx - 0] = arguments[$arg_idx]; } return paths.$join($scope.get('SEPARATOR')).$gsub((new RegExp("" + $scope.get('SEPARATOR') + "+")), $scope.get('SEPARATOR')); }, TMP_9.$$arity = -1); return (Opal.defn(self, '$split', TMP_10 = function $$split(path) { var self = this; return path.$split($scope.get('SEPARATOR')); }, TMP_10.$$arity = 1), nil) && 'split'; })(Opal.get_singleton_class(self)); })($scope.base, $scope.get('IO')) }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/process"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$to_f', '$now', '$new']); (function($base, $super) { function $Process(){}; var self = $Process = $klass($base, $super, 'Process', $Process); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; Opal.cdecl($scope, 'CLOCK_REALTIME', 0); Opal.cdecl($scope, 'CLOCK_MONOTONIC', 1); Opal.defs(self, '$pid', TMP_1 = function $$pid() { var self = this; return 0; }, TMP_1.$$arity = 0); Opal.defs(self, '$times', TMP_2 = function $$times() { var self = this, t = nil; t = $scope.get('Time').$now().$to_f(); return (($scope.get('Benchmark')).$$scope.get('Tms')).$new(t, t, t, t, t); }, TMP_2.$$arity = 0); return (Opal.defs(self, '$clock_gettime', TMP_3 = function $$clock_gettime(clock_id, unit) { var self = this; if (unit == null) { unit = nil; } return $scope.get('Time').$now().$to_f(); }, TMP_3.$$arity = -2), nil) && 'clock_gettime'; })($scope.base, null); (function($base, $super) { function $Signal(){}; var self = $Signal = $klass($base, $super, 'Signal', $Signal); var def = self.$$proto, $scope = self.$$scope, TMP_4; return (Opal.defs(self, '$trap', TMP_4 = function $$trap($a_rest) { var self = this; return nil; }, TMP_4.$$arity = -1), nil) && 'trap' })($scope.base, null); return (function($base, $super) { function $GC(){}; var self = $GC = $klass($base, $super, 'GC', $GC); var def = self.$$proto, $scope = self.$$scope, TMP_5; return (Opal.defs(self, '$start', TMP_5 = function $$start() { var self = this; return nil; }, TMP_5.$$arity = 0), nil) && 'start' })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["corelib/unsupported"] = function(Opal) { var TMP_30, TMP_31, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module; Opal.add_stubs(['$raise', '$warn', '$%']); var warnings = {}; function handle_unsupported_feature(message) { switch (Opal.config.unsupported_features_severity) { case 'error': $scope.get('Kernel').$raise($scope.get('NotImplementedError'), message) break; case 'warning': warn(message) break; default: // ignore // noop } } function warn(string) { if (warnings[string]) { return; } warnings[string] = true; self.$warn(string); } (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18; var ERROR = "String#%s not supported. Mutable String methods are not supported in Opal."; Opal.defn(self, '$<<', TMP_1 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("<<")); }, TMP_1.$$arity = -1); Opal.defn(self, '$capitalize!', TMP_2 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("capitalize!")); }, TMP_2.$$arity = -1); Opal.defn(self, '$chomp!', TMP_3 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("chomp!")); }, TMP_3.$$arity = -1); Opal.defn(self, '$chop!', TMP_4 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("chop!")); }, TMP_4.$$arity = -1); Opal.defn(self, '$downcase!', TMP_5 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("downcase!")); }, TMP_5.$$arity = -1); Opal.defn(self, '$gsub!', TMP_6 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("gsub!")); }, TMP_6.$$arity = -1); Opal.defn(self, '$lstrip!', TMP_7 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("lstrip!")); }, TMP_7.$$arity = -1); Opal.defn(self, '$next!', TMP_8 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("next!")); }, TMP_8.$$arity = -1); Opal.defn(self, '$reverse!', TMP_9 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("reverse!")); }, TMP_9.$$arity = -1); Opal.defn(self, '$slice!', TMP_10 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("slice!")); }, TMP_10.$$arity = -1); Opal.defn(self, '$squeeze!', TMP_11 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("squeeze!")); }, TMP_11.$$arity = -1); Opal.defn(self, '$strip!', TMP_12 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("strip!")); }, TMP_12.$$arity = -1); Opal.defn(self, '$sub!', TMP_13 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("sub!")); }, TMP_13.$$arity = -1); Opal.defn(self, '$succ!', TMP_14 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("succ!")); }, TMP_14.$$arity = -1); Opal.defn(self, '$swapcase!', TMP_15 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("swapcase!")); }, TMP_15.$$arity = -1); Opal.defn(self, '$tr!', TMP_16 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("tr!")); }, TMP_16.$$arity = -1); Opal.defn(self, '$tr_s!', TMP_17 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("tr_s!")); }, TMP_17.$$arity = -1); return (Opal.defn(self, '$upcase!', TMP_18 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), (ERROR)['$%']("upcase!")); }, TMP_18.$$arity = -1), nil) && 'upcase!'; })($scope.base, null); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_19, TMP_20; var ERROR = "Object freezing is not supported by Opal"; Opal.defn(self, '$freeze', TMP_19 = function $$freeze() { var self = this; handle_unsupported_feature(ERROR); return self; }, TMP_19.$$arity = 0); Opal.defn(self, '$frozen?', TMP_20 = function() { var self = this; handle_unsupported_feature(ERROR); return false; }, TMP_20.$$arity = 0); })($scope.base); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_21, TMP_22, TMP_23; var ERROR = "Object tainting is not supported by Opal"; Opal.defn(self, '$taint', TMP_21 = function $$taint() { var self = this; handle_unsupported_feature(ERROR); return self; }, TMP_21.$$arity = 0); Opal.defn(self, '$untaint', TMP_22 = function $$untaint() { var self = this; handle_unsupported_feature(ERROR); return self; }, TMP_22.$$arity = 0); Opal.defn(self, '$tainted?', TMP_23 = function() { var self = this; handle_unsupported_feature(ERROR); return false; }, TMP_23.$$arity = 0); })($scope.base); (function($base, $super) { function $Module(){}; var self = $Module = $klass($base, $super, 'Module', $Module); var def = self.$$proto, $scope = self.$$scope, TMP_24, TMP_25, TMP_26, TMP_27; Opal.defn(self, '$public', TMP_24 = function($a_rest) { var self = this, methods; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } methods = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { methods[$arg_idx - 0] = arguments[$arg_idx]; } if (methods.length === 0) { self.$$module_function = false; } return nil; }, TMP_24.$$arity = -1); Opal.alias(self, 'private', 'public'); Opal.alias(self, 'protected', 'public'); Opal.alias(self, 'nesting', 'public'); Opal.defn(self, '$private_class_method', TMP_25 = function $$private_class_method($a_rest) { var self = this; return self; }, TMP_25.$$arity = -1); Opal.alias(self, 'public_class_method', 'private_class_method'); Opal.defn(self, '$private_method_defined?', TMP_26 = function(obj) { var self = this; return false; }, TMP_26.$$arity = 1); Opal.defn(self, '$private_constant', TMP_27 = function $$private_constant($a_rest) { var self = this; return nil; }, TMP_27.$$arity = -1); Opal.alias(self, 'protected_method_defined?', 'private_method_defined?'); Opal.alias(self, 'public_instance_methods', 'instance_methods'); return Opal.alias(self, 'public_method_defined?', 'method_defined?'); })($scope.base, null); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_28; Opal.defn(self, '$private_methods', TMP_28 = function $$private_methods($a_rest) { var self = this; return []; }, TMP_28.$$arity = -1); Opal.alias(self, 'private_instance_methods', 'private_methods'); })($scope.base); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_29; Opal.defn(self, '$eval', TMP_29 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError'), "To use Kernel#eval, you must first require 'opal-parser'. " + ("See https://github.com/opal/opal/blob/" + ($scope.get('RUBY_ENGINE_VERSION')) + "/docs/opal_parser.md for details.")); }, TMP_29.$$arity = -1) })($scope.base); Opal.defs(self, '$public', TMP_30 = function($a_rest) { var self = this; return nil; }, TMP_30.$$arity = -1); return (Opal.defs(self, '$private', TMP_31 = function($a_rest) { var self = this; return nil; }, TMP_31.$$arity = -1), nil) && 'private'; }; /* Generated by Opal 0.10.3 */ Opal.modules["opal"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("opal/base"); self.$require("opal/mini"); self.$require("corelib/string/inheritance"); self.$require("corelib/string/encoding"); self.$require("corelib/math"); self.$require("corelib/complex"); self.$require("corelib/rational"); self.$require("corelib/time"); self.$require("corelib/struct"); self.$require("corelib/io"); self.$require("corelib/main"); self.$require("corelib/dir"); self.$require("corelib/file"); self.$require("corelib/process"); return self.$require("corelib/unsupported"); }; /* Generated by Opal 0.10.3 */ Opal.modules["set"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module; Opal.add_stubs(['$include', '$new', '$nil?', '$===', '$raise', '$each', '$add', '$call', '$merge', '$class', '$respond_to?', '$subtract', '$dup', '$join', '$to_a', '$equal?', '$instance_of?', '$==', '$instance_variable_get', '$is_a?', '$size', '$all?', '$include?', '$[]=', '$enum_for', '$[]', '$<<', '$replace', '$delete', '$select', '$each_key', '$to_proc', '$empty?', '$eql?', '$instance_eval', '$clear', '$<', '$<=', '$keys']); (function($base, $super) { function $Set(){}; var self = $Set = $klass($base, $super, 'Set', $Set); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4, TMP_5, TMP_6, TMP_8, TMP_9, TMP_10, TMP_13, TMP_15, TMP_16, TMP_17, TMP_20, TMP_21, TMP_22, TMP_24, TMP_25, TMP_26, TMP_28, TMP_29, TMP_30, TMP_32, TMP_33, TMP_35, TMP_37, TMP_39, TMP_41, TMP_42; def.hash = nil; self.$include($scope.get('Enumerable')); Opal.defs(self, '$[]', TMP_1 = function($a_rest) { var self = this, ary; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } ary = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { ary[$arg_idx - 0] = arguments[$arg_idx]; } return self.$new(ary); }, TMP_1.$$arity = -1); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(enum$) { var $a, $b, TMP_3, self = this, $iter = TMP_2.$$p, block = $iter || nil; if (enum$ == null) { enum$ = nil; } TMP_2.$$p = null; self.hash = $scope.get('Hash').$new(); if ((($a = enum$['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if ((($a = $scope.get('Enumerable')['$==='](enum$)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "value must be enumerable") }; if (block !== false && block !== nil && block != null) { return ($a = ($b = enum$).$each, $a.$$p = (TMP_3 = function(item){var self = TMP_3.$$s || this; if (item == null) item = nil; return self.$add(block.$call(item))}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b) } else { return self.$merge(enum$) }; }, TMP_2.$$arity = -1); Opal.defn(self, '$dup', TMP_4 = function $$dup() { var self = this, result = nil; result = self.$class().$new(); return result.$merge(self); }, TMP_4.$$arity = 0); Opal.defn(self, '$-', TMP_5 = function(enum$) { var $a, self = this; if ((($a = enum$['$respond_to?']("each")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "value must be enumerable") }; return self.$dup().$subtract(enum$); }, TMP_5.$$arity = 1); Opal.alias(self, 'difference', '-'); Opal.defn(self, '$inspect', TMP_6 = function $$inspect() { var self = this; return "#"; }, TMP_6.$$arity = 0); Opal.defn(self, '$==', TMP_8 = function(other) { var $a, $b, TMP_7, self = this; if ((($a = self['$equal?'](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true } else if ((($a = other['$instance_of?'](self.$class())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.hash['$=='](other.$instance_variable_get("@hash")) } else if ((($a = ($b = other['$is_a?']($scope.get('Set')), $b !== false && $b !== nil && $b != null ?self.$size()['$=='](other.$size()) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = other)['$all?'], $a.$$p = (TMP_7 = function(o){var self = TMP_7.$$s || this; if (self.hash == null) self.hash = nil; if (o == null) o = nil; return self.hash['$include?'](o)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b) } else { return false }; }, TMP_8.$$arity = 1); Opal.defn(self, '$add', TMP_9 = function $$add(o) { var self = this; self.hash['$[]='](o, true); return self; }, TMP_9.$$arity = 1); Opal.alias(self, '<<', 'add'); Opal.defn(self, '$classify', TMP_10 = function $$classify() { var $a, $b, TMP_11, $c, TMP_12, self = this, $iter = TMP_10.$$p, block = $iter || nil, result = nil; TMP_10.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("classify") }; result = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_11 = function(h, k){var self = TMP_11.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, self.$class().$new())}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11), $a).call($b); ($a = ($c = self).$each, $a.$$p = (TMP_12 = function(item){var self = TMP_12.$$s || this; if (item == null) item = nil; return result['$[]'](Opal.yield1(block, item)).$add(item)}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($c); return result; }, TMP_10.$$arity = 0); Opal.defn(self, '$collect!', TMP_13 = function() { var $a, $b, TMP_14, self = this, $iter = TMP_13.$$p, block = $iter || nil, result = nil; TMP_13.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("collect!") }; result = self.$class().$new(); ($a = ($b = self).$each, $a.$$p = (TMP_14 = function(item){var self = TMP_14.$$s || this; if (item == null) item = nil; return result['$<<'](Opal.yield1(block, item))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); return self.$replace(result); }, TMP_13.$$arity = 0); Opal.alias(self, 'map!', 'collect!'); Opal.defn(self, '$delete', TMP_15 = function(o) { var self = this; self.hash.$delete(o); return self; }, TMP_15.$$arity = 1); Opal.defn(self, '$delete?', TMP_16 = function(o) { var $a, self = this; if ((($a = self['$include?'](o)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$delete(o); return self; } else { return nil }; }, TMP_16.$$arity = 1); Opal.defn(self, '$delete_if', TMP_17 = function $$delete_if() {try { var $a, $b, TMP_18, $c, $d, TMP_19, self = this, $iter = TMP_17.$$p, $yield = $iter || nil; TMP_17.$$p = null; ((($a = ($yield !== nil)) !== false && $a !== nil && $a != null) ? $a : Opal.ret(self.$enum_for("delete_if"))); ($a = ($b = ($c = ($d = self).$select, $c.$$p = (TMP_19 = function(o){var self = TMP_19.$$s || this; if (o == null) o = nil; return Opal.yield1($yield, o);}, TMP_19.$$s = self, TMP_19.$$arity = 1, TMP_19), $c).call($d)).$each, $a.$$p = (TMP_18 = function(o){var self = TMP_18.$$s || this; if (self.hash == null) self.hash = nil; if (o == null) o = nil; return self.hash.$delete(o)}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18), $a).call($b); return self; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_17.$$arity = 0); Opal.defn(self, '$add?', TMP_20 = function(o) { var $a, self = this; if ((($a = self['$include?'](o)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$add(o) }; }, TMP_20.$$arity = 1); Opal.defn(self, '$each', TMP_21 = function $$each() { var $a, $b, self = this, $iter = TMP_21.$$p, block = $iter || nil; TMP_21.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("each") }; ($a = ($b = self.hash).$each_key, $a.$$p = block.$to_proc(), $a).call($b); return self; }, TMP_21.$$arity = 0); Opal.defn(self, '$empty?', TMP_22 = function() { var self = this; return self.hash['$empty?'](); }, TMP_22.$$arity = 0); Opal.defn(self, '$eql?', TMP_24 = function(other) { var $a, $b, TMP_23, self = this; return self.hash['$eql?'](($a = ($b = other).$instance_eval, $a.$$p = (TMP_23 = function(){var self = TMP_23.$$s || this; if (self.hash == null) self.hash = nil; return self.hash}, TMP_23.$$s = self, TMP_23.$$arity = 0, TMP_23), $a).call($b)); }, TMP_24.$$arity = 1); Opal.defn(self, '$clear', TMP_25 = function $$clear() { var self = this; self.hash.$clear(); return self; }, TMP_25.$$arity = 0); Opal.defn(self, '$include?', TMP_26 = function(o) { var self = this; return self.hash['$include?'](o); }, TMP_26.$$arity = 1); Opal.alias(self, 'member?', 'include?'); Opal.defn(self, '$merge', TMP_28 = function $$merge(enum$) { var $a, $b, TMP_27, self = this; ($a = ($b = enum$).$each, $a.$$p = (TMP_27 = function(item){var self = TMP_27.$$s || this; if (item == null) item = nil; return self.$add(item)}, TMP_27.$$s = self, TMP_27.$$arity = 1, TMP_27), $a).call($b); return self; }, TMP_28.$$arity = 1); Opal.defn(self, '$replace', TMP_29 = function $$replace(enum$) { var self = this; self.$clear(); self.$merge(enum$); return self; }, TMP_29.$$arity = 1); Opal.defn(self, '$size', TMP_30 = function $$size() { var self = this; return self.hash.$size(); }, TMP_30.$$arity = 0); Opal.alias(self, 'length', 'size'); Opal.defn(self, '$subtract', TMP_32 = function $$subtract(enum$) { var $a, $b, TMP_31, self = this; ($a = ($b = enum$).$each, $a.$$p = (TMP_31 = function(item){var self = TMP_31.$$s || this; if (item == null) item = nil; return self.$delete(item)}, TMP_31.$$s = self, TMP_31.$$arity = 1, TMP_31), $a).call($b); return self; }, TMP_32.$$arity = 1); Opal.defn(self, '$|', TMP_33 = function(enum$) { var $a, self = this; if ((($a = enum$['$respond_to?']("each")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "value must be enumerable") }; return self.$dup().$merge(enum$); }, TMP_33.$$arity = 1); Opal.defn(self, '$superset?', TMP_35 = function(set) { var $a, $b, TMP_34, self = this; ((($a = set['$is_a?']($scope.get('Set'))) !== false && $a !== nil && $a != null) ? $a : self.$raise($scope.get('ArgumentError'), "value must be a set")); if ((($a = $rb_lt(self.$size(), set.$size())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = set)['$all?'], $a.$$p = (TMP_34 = function(o){var self = TMP_34.$$s || this; if (o == null) o = nil; return self['$include?'](o)}, TMP_34.$$s = self, TMP_34.$$arity = 1, TMP_34), $a).call($b); }, TMP_35.$$arity = 1); Opal.alias(self, '>=', 'superset?'); Opal.defn(self, '$proper_superset?', TMP_37 = function(set) { var $a, $b, TMP_36, self = this; ((($a = set['$is_a?']($scope.get('Set'))) !== false && $a !== nil && $a != null) ? $a : self.$raise($scope.get('ArgumentError'), "value must be a set")); if ((($a = $rb_le(self.$size(), set.$size())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = set)['$all?'], $a.$$p = (TMP_36 = function(o){var self = TMP_36.$$s || this; if (o == null) o = nil; return self['$include?'](o)}, TMP_36.$$s = self, TMP_36.$$arity = 1, TMP_36), $a).call($b); }, TMP_37.$$arity = 1); Opal.alias(self, '>', 'proper_superset?'); Opal.defn(self, '$subset?', TMP_39 = function(set) { var $a, $b, TMP_38, self = this; ((($a = set['$is_a?']($scope.get('Set'))) !== false && $a !== nil && $a != null) ? $a : self.$raise($scope.get('ArgumentError'), "value must be a set")); if ((($a = $rb_lt(set.$size(), self.$size())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self)['$all?'], $a.$$p = (TMP_38 = function(o){var self = TMP_38.$$s || this; if (o == null) o = nil; return set['$include?'](o)}, TMP_38.$$s = self, TMP_38.$$arity = 1, TMP_38), $a).call($b); }, TMP_39.$$arity = 1); Opal.alias(self, '<=', 'subset?'); Opal.defn(self, '$proper_subset?', TMP_41 = function(set) { var $a, $b, TMP_40, self = this; ((($a = set['$is_a?']($scope.get('Set'))) !== false && $a !== nil && $a != null) ? $a : self.$raise($scope.get('ArgumentError'), "value must be a set")); if ((($a = $rb_le(set.$size(), self.$size())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self)['$all?'], $a.$$p = (TMP_40 = function(o){var self = TMP_40.$$s || this; if (o == null) o = nil; return set['$include?'](o)}, TMP_40.$$s = self, TMP_40.$$arity = 1, TMP_40), $a).call($b); }, TMP_41.$$arity = 1); Opal.alias(self, '<', 'proper_subset?'); Opal.alias(self, '+', '|'); Opal.alias(self, 'union', '|'); return (Opal.defn(self, '$to_a', TMP_42 = function $$to_a() { var self = this; return self.hash.$keys(); }, TMP_42.$$arity = 0), nil) && 'to_a'; })($scope.base, null); return (function($base) { var $Enumerable, self = $Enumerable = $module($base, 'Enumerable'); var def = self.$$proto, $scope = self.$$scope, TMP_43; Opal.defn(self, '$to_set', TMP_43 = function $$to_set(klass, $a_rest) { var $b, $c, self = this, args, $iter = TMP_43.$$p, block = $iter || nil; if (klass == null) { klass = $scope.get('Set'); } var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_43.$$p = null; return ($b = ($c = klass).$new, $b.$$p = block.$to_proc(), $b).apply($c, [self].concat(Opal.to_a(args))); }, TMP_43.$$arity = -1) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/parser/sexp"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_reader', '$attr_accessor', '$[]', '$[]=', '$send', '$to_proc', '$<<', '$push', '$concat', '$new', '$dup', '$is_a?', '$==', '$array', '$join', '$map', '$inspect', '$line']); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Sexp(){}; var self = $Sexp = $klass($base, $super, 'Sexp', $Sexp); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_16, TMP_18; def.array = def.meta = def.source = nil; self.$attr_reader("array"); self.$attr_accessor("source"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(args) { var self = this; return self.array = args; }, TMP_1.$$arity = 1); Opal.defn(self, '$type', TMP_2 = function $$type() { var self = this; return self.array['$[]'](0); }, TMP_2.$$arity = 0); Opal.defn(self, '$type=', TMP_3 = function(type) { var self = this; return self.array['$[]='](0, type); }, TMP_3.$$arity = 1); Opal.defn(self, '$children', TMP_4 = function $$children() { var self = this; return self.array['$[]']($range(1, -1, false)); }, TMP_4.$$arity = 0); Opal.defn(self, '$meta', TMP_5 = function $$meta() { var $a, self = this; return ((($a = self.meta) !== false && $a !== nil && $a != null) ? $a : self.meta = $hash2([], {})); }, TMP_5.$$arity = 0); Opal.defn(self, '$method_missing', TMP_6 = function $$method_missing(sym, $a_rest) { var $b, $c, self = this, args, $iter = TMP_6.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_6.$$p = null; return ($b = ($c = self.array).$send, $b.$$p = block.$to_proc(), $b).apply($c, [sym].concat(Opal.to_a(args))); }, TMP_6.$$arity = -2); Opal.defn(self, '$<<', TMP_7 = function(other) { var self = this; self.array['$<<'](other); return self; }, TMP_7.$$arity = 1); Opal.defn(self, '$push', TMP_8 = function $$push($a_rest) { var $b, self = this, parts; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } parts = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { parts[$arg_idx - 0] = arguments[$arg_idx]; } ($b = self.array).$push.apply($b, Opal.to_a(parts)); return self; }, TMP_8.$$arity = -1); Opal.defn(self, '$concat', TMP_9 = function $$concat(children) { var self = this; self.array.$concat(children); return self; }, TMP_9.$$arity = 1); Opal.defn(self, '$to_ary', TMP_10 = function $$to_ary() { var self = this; return self.array; }, TMP_10.$$arity = 0); Opal.defn(self, '$dup', TMP_11 = function $$dup() { var self = this; return $scope.get('Sexp').$new(self.array.$dup()); }, TMP_11.$$arity = 0); Opal.defn(self, '$==', TMP_12 = function(other) { var $a, self = this; if ((($a = other['$is_a?']($scope.get('Sexp'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.array['$=='](other.$array()) } else { return self.array['$=='](other) }; }, TMP_12.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$line', TMP_13 = function $$line() { var $a, self = this; return ($a = self.source, $a !== false && $a !== nil && $a != null ?self.source['$[]'](0) : $a); }, TMP_13.$$arity = 0); Opal.defn(self, '$column', TMP_14 = function $$column() { var $a, self = this; return ($a = self.source, $a !== false && $a !== nil && $a != null ?self.source['$[]'](1) : $a); }, TMP_14.$$arity = 0); Opal.defn(self, '$inspect', TMP_16 = function $$inspect() { var $a, $b, TMP_15, self = this; return "(" + (($a = ($b = self.array).$map, $a.$$p = (TMP_15 = function(e){var self = TMP_15.$$s || this; if (e == null) e = nil; return e.$inspect()}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $a).call($b).$join(", ")) + ")"; }, TMP_16.$$arity = 0); Opal.defn(self, '$pretty_inspect', TMP_18 = function $$pretty_inspect() { var $a, $b, TMP_17, self = this; return "(" + ((function() {if ((($a = self.$line()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "" + (self.$line()) + " " } else { return "" }; return nil; })()) + (($a = ($b = self.array).$map, $a.$$p = (TMP_17 = function(e){var self = TMP_17.$$s || this; if (e == null) e = nil; return e.$inspect()}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b).$join(", ")) + ")"; }, TMP_18.$$arity = 0); return Opal.alias(self, 'to_s', 'inspect'); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["strscan"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$anchor', '$scan_until', '$length', '$size', '$rest', '$pos=', '$private']); return (function($base, $super) { function $StringScanner(){}; var self = $StringScanner = $klass($base, $super, 'StringScanner', $StringScanner); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24; def.pos = def.string = def.working = def.matched = def.prev_pos = def.match = nil; self.$attr_reader("pos"); self.$attr_reader("matched"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(string) { var self = this; self.string = string; self.pos = 0; self.matched = nil; self.working = string; return self.match = []; }, TMP_1.$$arity = 1); self.$attr_reader("string"); Opal.defn(self, '$beginning_of_line?', TMP_2 = function() { var self = this; return self.pos === 0 || self.string.charAt(self.pos - 1) === "\n"; }, TMP_2.$$arity = 0); Opal.alias(self, 'bol?', 'beginning_of_line?'); Opal.defn(self, '$scan', TMP_3 = function $$scan(pattern) { var self = this; pattern = self.$anchor(pattern); var result = pattern.exec(self.working); if (result == null) { return self.matched = nil; } else if (typeof(result) === 'object') { self.prev_pos = self.pos; self.pos += result[0].length; self.working = self.working.substring(result[0].length); self.matched = result[0]; self.match = result; return result[0]; } else if (typeof(result) === 'string') { self.pos += result.length; self.working = self.working.substring(result.length); return result; } else { return nil; } ; }, TMP_3.$$arity = 1); Opal.defn(self, '$scan_until', TMP_4 = function $$scan_until(pattern) { var self = this; pattern = self.$anchor(pattern); var pos = self.pos, working = self.working, result; while (true) { result = pattern.exec(working); pos += 1; working = working.substr(1); if (result == null) { if (working.length === 0) { return self.matched = nil; } continue; } self.matched = self.string.substr(self.pos, pos - self.pos - 1 + result[0].length); self.prev_pos = pos - 1; self.pos = pos; self.working = working.substr(result[0].length); return self.matched; } ; }, TMP_4.$$arity = 1); Opal.defn(self, '$[]', TMP_5 = function(idx) { var self = this; var match = self.match; if (idx < 0) { idx += match.length; } if (idx < 0 || idx >= match.length) { return nil; } if (match[idx] == null) { return nil; } return match[idx]; ; }, TMP_5.$$arity = 1); Opal.defn(self, '$check', TMP_6 = function $$check(pattern) { var self = this; pattern = self.$anchor(pattern); var result = pattern.exec(self.working); if (result == null) { return self.matched = nil; } return self.matched = result[0]; ; }, TMP_6.$$arity = 1); Opal.defn(self, '$check_until', TMP_7 = function $$check_until(pattern) { var self = this; var prev_pos = self.prev_pos, pos = self.pos; var result = self.$scan_until(pattern); if (result !== nil) { self.matched = result.substr(-1); self.working = self.string.substr(pos); } self.prev_pos = prev_pos; self.pos = pos; return result; ; }, TMP_7.$$arity = 1); Opal.defn(self, '$peek', TMP_8 = function $$peek(length) { var self = this; return self.working.substring(0, length); }, TMP_8.$$arity = 1); Opal.defn(self, '$eos?', TMP_9 = function() { var self = this; return self.working.length === 0; }, TMP_9.$$arity = 0); Opal.defn(self, '$exist?', TMP_10 = function(pattern) { var self = this; var result = pattern.exec(self.working); if (result == null) { return nil; } else if (result.index == 0) { return 0; } else { return result.index + 1; } ; }, TMP_10.$$arity = 1); Opal.defn(self, '$skip', TMP_11 = function $$skip(pattern) { var self = this; pattern = self.$anchor(pattern); var result = pattern.exec(self.working); if (result == null) { return self.matched = nil; } else { var match_str = result[0]; var match_len = match_str.length; self.matched = match_str; self.prev_pos = self.pos; self.pos += match_len; self.working = self.working.substring(match_len); return match_len; } ; }, TMP_11.$$arity = 1); Opal.defn(self, '$skip_until', TMP_12 = function $$skip_until(pattern) { var self = this; var result = self.$scan_until(pattern); if (result === nil) { return nil; } else { self.matched = result.substr(-1); return result.length; } ; }, TMP_12.$$arity = 1); Opal.defn(self, '$get_byte', TMP_13 = function $$get_byte() { var self = this; var result = nil; if (self.pos < self.string.length) { self.prev_pos = self.pos; self.pos += 1; result = self.matched = self.working.substring(0, 1); self.working = self.working.substring(1); } else { self.matched = nil; } return result; ; }, TMP_13.$$arity = 0); Opal.alias(self, 'getch', 'get_byte'); Opal.defn(self, '$match?', TMP_14 = function(pattern) { var self = this; pattern = self.$anchor(pattern); var result = pattern.exec(self.working); if (result == null) { return nil; } else { self.prev_pos = self.pos; return result[0].length; } ; }, TMP_14.$$arity = 1); Opal.defn(self, '$pos=', TMP_15 = function(pos) { var self = this; if (pos < 0) { pos += self.string.$length(); } ; self.pos = pos; return self.working = self.string.slice(pos); }, TMP_15.$$arity = 1); Opal.defn(self, '$post_match', TMP_16 = function $$post_match() { var self = this; if (self.matched === nil) { return nil; } return self.string.substr(self.pos); ; }, TMP_16.$$arity = 0); Opal.defn(self, '$pre_match', TMP_17 = function $$pre_match() { var self = this; if (self.matched === nil) { return nil; } return self.string.substr(0, self.prev_pos); ; }, TMP_17.$$arity = 0); Opal.defn(self, '$reset', TMP_18 = function $$reset() { var self = this; self.working = self.string; self.matched = nil; return self.pos = 0; }, TMP_18.$$arity = 0); Opal.defn(self, '$rest', TMP_19 = function $$rest() { var self = this; return self.working; }, TMP_19.$$arity = 0); Opal.defn(self, '$rest?', TMP_20 = function() { var self = this; return self.working.length !== 0; }, TMP_20.$$arity = 0); Opal.defn(self, '$rest_size', TMP_21 = function $$rest_size() { var self = this; return self.$rest().$size(); }, TMP_21.$$arity = 0); Opal.defn(self, '$terminate', TMP_22 = function $$terminate() { var $a, $b, self = this; self.match = nil; return (($a = [self.string.$length()]), $b = self, $b['$pos='].apply($b, $a), $a[$a.length-1]); }, TMP_22.$$arity = 0); Opal.defn(self, '$unscan', TMP_23 = function $$unscan() { var self = this; self.pos = self.prev_pos; self.prev_pos = nil; self.match = nil; return self; }, TMP_23.$$arity = 0); self.$private(); return (Opal.defn(self, '$anchor', TMP_24 = function $$anchor(pattern) { var self = this; return new RegExp('^(?:' + pattern.toString().substr(1, pattern.toString().length - 2) + ')'); }, TMP_24.$$arity = 1), nil) && 'anchor'; })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/parser/keywords"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_accessor', '$map', '$new', '$each', '$[]=', '$name', '$[]']); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Keywords, self = $Keywords = $module($base, 'Keywords'); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_2, TMP_4, TMP_5; (function($base, $super) { function $KeywordTable(){}; var self = $KeywordTable = $klass($base, $super, 'KeywordTable', $KeywordTable); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$attr_accessor("name", "id", "state"); return (Opal.defn(self, '$initialize', TMP_1 = function $$initialize(name, id, state) { var self = this; self.name = name; self.id = id; return self.state = state; }, TMP_1.$$arity = 3), nil) && 'initialize'; })($scope.base, null); Opal.cdecl($scope, 'KEYWORDS', ($a = ($b = [["__LINE__", ["k__LINE__", "k__LINE__"], "expr_end"], ["__FILE__", ["k__FILE__", "k__FILE__"], "expr_end"], ["alias", ["kALIAS", "kALIAS"], "expr_fname"], ["and", ["kAND", "kAND"], "expr_beg"], ["begin", ["kBEGIN", "kBEGIN"], "expr_beg"], ["break", ["kBREAK", "kBREAK"], "expr_mid"], ["case", ["kCASE", "kCASE"], "expr_beg"], ["class", ["kCLASS", "kCLASS"], "expr_class"], ["def", ["kDEF", "kDEF"], "expr_fname"], ["defined?", ["kDEFINED", "kDEFINED"], "expr_arg"], ["do", ["kDO", "kDO"], "expr_beg"], ["else", ["kELSE", "kELSE"], "expr_beg"], ["elsif", ["kELSIF", "kELSIF"], "expr_beg"], ["end", ["kEND", "kEND"], "expr_end"], ["ensure", ["kENSURE", "kENSURE"], "expr_beg"], ["false", ["kFALSE", "kFALSE"], "expr_end"], ["for", ["kFOR", "kFOR"], "expr_beg"], ["if", ["kIF", "kIF_MOD"], "expr_beg"], ["in", ["kIN", "kIN"], "expr_beg"], ["module", ["kMODULE", "kMODULE"], "expr_beg"], ["nil", ["kNIL", "kNIL"], "expr_end"], ["next", ["kNEXT", "kNEXT"], "expr_mid"], ["not", ["kNOT", "kNOT"], "expr_beg"], ["or", ["kOR", "kOR"], "expr_beg"], ["redo", ["kREDO", "kREDO"], "expr_end"], ["rescue", ["kRESCUE", "kRESCUE_MOD"], "expr_mid"], ["return", ["kRETURN", "kRETURN"], "expr_mid"], ["self", ["kSELF", "kSELF"], "expr_end"], ["super", ["kSUPER", "kSUPER"], "expr_arg"], ["then", ["kTHEN", "kTHEN"], "expr_beg"], ["true", ["kTRUE", "kTRUE"], "expr_end"], ["undef", ["kUNDEF", "kUNDEF"], "expr_fname"], ["unless", ["kUNLESS", "kUNLESS_MOD"], "expr_beg"], ["until", ["kUNTIL", "kUNTIL_MOD"], "expr_beg"], ["when", ["kWHEN", "kWHEN"], "expr_beg"], ["while", ["kWHILE", "kWHILE_MOD"], "expr_beg"], ["yield", ["kYIELD", "kYIELD"], "expr_arg"]]).$map, $a.$$p = (TMP_2 = function(decl){var self = TMP_2.$$s || this, $c; if (decl == null) decl = nil; return ($c = $scope.get('KeywordTable')).$new.apply($c, Opal.to_a(decl))}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b)); Opal.defs(self, '$map', TMP_4 = function $$map() { var $a, $b, TMP_3, self = this; if (self.map == null) self.map = nil; if ((($a = self.map) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.map = $hash2([], {}); ($a = ($b = $scope.get('KEYWORDS')).$each, $a.$$p = (TMP_3 = function(k){var self = TMP_3.$$s || this; if (self.map == null) self.map = nil; if (k == null) k = nil; return self.map['$[]='](k.$name(), k)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b); }; return self.map; }, TMP_4.$$arity = 0); Opal.defs(self, '$keyword', TMP_5 = function $$keyword(kw) { var self = this; return self.$map()['$[]'](kw); }, TMP_5.$$arity = 1); })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/parser/lexer"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$|', '$attr_reader', '$attr_accessor', '$new', '$yylex', '$yylval', '$has_local?', '$scope', '$parser', '$to_sym', '$<<', '$&', '$>>', '$!=', '$include?', '$arg?', '$!', '$space?', '$check', '$after_operator?', '$scan', '$+', '$length', '$matched', '$pos=', '$-', '$pos', '$new_strterm', '$merge', '$yylval=', '$to_f', '$gsub', '$scanner', '$to_i', '$raise', '$peek', '$chr', '$%', '$[]', '$ord', '$downcase', '$escape', '$peek_variable_name', '$bol?', '$eos?', '$read_escape', '$join', '$count', '$lines', '$min', '$map', '$strterm', '$[]=', '$pushback', '$==', '$cond?', '$strterm=', '$match', '$add_string_content', '$line=', '$line', '$label_state?', '$end_with?', '$=~', '$keyword', '$state', '$name', '$id', '$last', '$pop', '$cmdarg?', '$here_document', '$parse_string', '$skip', '$empty?', '$new_op_asgn', '$set_arg_state', '$spcarg?', '$beg?', '$===', '$new_strterm2', '$cond_push', '$cmdarg_push', '$cond_lexpop', '$cmdarg_lexpop', '$end?', '$heredoc_identifier', '$push', '$sub', '$inspect', '$process_numeric', '$process_identifier', '$size']); self.$require("opal/regexp_anchors"); self.$require("strscan"); self.$require("opal/parser/keywords"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Lexer(){}; var self = $Lexer = $klass($base, $super, 'Lexer', $Lexer); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39; def.scanner = def.tok_line = def.tok_column = def.column = def.line = def.cond = def.lparen_arg_seen = def.cmdarg = def.lex_state = def.space_seen = def.yylval = def.scanner_stack = def.lambda_stack = def.paren_nest = def.file = nil; Opal.cdecl($scope, 'STR_FUNC_ESCAPE', 1); Opal.cdecl($scope, 'STR_FUNC_EXPAND', 2); Opal.cdecl($scope, 'STR_FUNC_REGEXP', 4); Opal.cdecl($scope, 'STR_FUNC_QWORDS', 8); Opal.cdecl($scope, 'STR_FUNC_SYMBOL', 16); Opal.cdecl($scope, 'STR_FUNC_INDENT', 32); Opal.cdecl($scope, 'STR_FUNC_XQUOTE', 64); Opal.cdecl($scope, 'STR_SQUOTE', 0); Opal.cdecl($scope, 'STR_DQUOTE', $scope.get('STR_FUNC_EXPAND')); Opal.cdecl($scope, 'STR_XQUOTE', $scope.get('STR_FUNC_EXPAND')['$|']($scope.get('STR_FUNC_XQUOTE'))); Opal.cdecl($scope, 'STR_REGEXP', $scope.get('STR_FUNC_REGEXP')['$|']($scope.get('STR_FUNC_ESCAPE'))['$|']($scope.get('STR_FUNC_EXPAND'))); Opal.cdecl($scope, 'STR_SWORD', $scope.get('STR_FUNC_QWORDS')); Opal.cdecl($scope, 'STR_DWORD', $scope.get('STR_FUNC_QWORDS')['$|']($scope.get('STR_FUNC_EXPAND'))); Opal.cdecl($scope, 'STR_SSYM', $scope.get('STR_FUNC_SYMBOL')); Opal.cdecl($scope, 'STR_DSYM', $scope.get('STR_FUNC_SYMBOL')['$|']($scope.get('STR_FUNC_EXPAND'))); self.$attr_reader("line", "column"); self.$attr_reader("scope"); self.$attr_reader("eof_content"); self.$attr_accessor("lex_state"); self.$attr_accessor("strterm"); self.$attr_accessor("scanner"); self.$attr_accessor("yylval"); self.$attr_accessor("parser"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(source, file) { var self = this; self.lex_state = "expr_beg"; self.cond = 0; self.cmdarg = 0; self.line = 1; self.tok_line = 1; self.column = 0; self.tok_column = 0; self.file = file; self.scanner = $scope.get('StringScanner').$new(source); self.scanner_stack = [self.scanner]; self.case_stmt = nil; self.paren_nest = 0; return self.lambda_stack = []; }, TMP_1.$$arity = 2); Opal.defn(self, '$next_token', TMP_2 = function $$next_token() { var self = this, token = nil, value = nil, location = nil; token = self.$yylex(); value = self.$yylval(); location = [self.tok_line, self.tok_column]; self.tok_column = self.column; self.tok_line = self.line; return [token, [value, location]]; }, TMP_2.$$arity = 0); Opal.defn(self, '$has_local?', TMP_3 = function(local) { var self = this; return self.$parser().$scope()['$has_local?'](local.$to_sym()); }, TMP_3.$$arity = 1); Opal.defn(self, '$cond_push', TMP_4 = function $$cond_push(n) { var self = this; return self.cond = (self.cond['$<<'](1))['$|']((n['$&'](1))); }, TMP_4.$$arity = 1); Opal.defn(self, '$cond_pop', TMP_5 = function $$cond_pop() { var self = this; return self.cond = self.cond['$>>'](1); }, TMP_5.$$arity = 0); Opal.defn(self, '$cond_lexpop', TMP_6 = function $$cond_lexpop() { var self = this; return self.cond = (self.cond['$>>'](1))['$|']((self.cond['$&'](1))); }, TMP_6.$$arity = 0); Opal.defn(self, '$cond?', TMP_7 = function() { var self = this; return (self.cond['$&'](1))['$!='](0); }, TMP_7.$$arity = 0); Opal.defn(self, '$cmdarg_push', TMP_8 = function $$cmdarg_push(n) { var $a, self = this; if ((($a = self.lparen_arg_seen) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.cmdarg = (self.cmdarg['$<<'](1))['$|']((n['$&'](1))) }; }, TMP_8.$$arity = 1); Opal.defn(self, '$cmdarg_pop', TMP_9 = function $$cmdarg_pop() { var self = this; return self.cmdarg = self.cmdarg['$>>'](1); }, TMP_9.$$arity = 0); Opal.defn(self, '$cmdarg_lexpop', TMP_10 = function $$cmdarg_lexpop() { var self = this; return self.cmdarg = (self.cmdarg['$>>'](1))['$|']((self.cmdarg['$&'](1))); }, TMP_10.$$arity = 0); Opal.defn(self, '$cmdarg?', TMP_11 = function() { var self = this; return (self.cmdarg['$&'](1))['$!='](0); }, TMP_11.$$arity = 0); Opal.defn(self, '$arg?', TMP_12 = function() { var self = this; return ["expr_arg", "expr_cmdarg"]['$include?'](self.lex_state); }, TMP_12.$$arity = 0); Opal.defn(self, '$end?', TMP_13 = function() { var self = this; return ["expr_end", "expr_endarg", "expr_endfn"]['$include?'](self.lex_state); }, TMP_13.$$arity = 0); Opal.defn(self, '$beg?', TMP_14 = function() { var self = this; return ["expr_beg", "expr_value", "expr_mid", "expr_class"]['$include?'](self.lex_state); }, TMP_14.$$arity = 0); Opal.defn(self, '$after_operator?', TMP_15 = function() { var self = this; return ["expr_fname", "expr_dot"]['$include?'](self.lex_state); }, TMP_15.$$arity = 0); Opal.defn(self, '$label_state?', TMP_16 = function() { var $a, self = this; return ((($a = ["expr_beg", "expr_endfn"]['$include?'](self.lex_state)) !== false && $a !== nil && $a != null) ? $a : self['$arg?']()); }, TMP_16.$$arity = 0); Opal.defn(self, '$spcarg?', TMP_17 = function() { var $a, $b, self = this; return ($a = ($b = self['$arg?'](), $b !== false && $b !== nil && $b != null ?self.space_seen : $b), $a !== false && $a !== nil && $a != null ?self['$space?']()['$!']() : $a); }, TMP_17.$$arity = 0); Opal.defn(self, '$space?', TMP_18 = function() { var self = this; return self.scanner.$check(/\s/); }, TMP_18.$$arity = 0); Opal.defn(self, '$set_arg_state', TMP_19 = function $$set_arg_state() { var $a, self = this; return self.lex_state = (function() {if ((($a = self['$after_operator?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "expr_arg" } else { return "expr_beg" }; return nil; })(); }, TMP_19.$$arity = 0); Opal.defn(self, '$scan', TMP_20 = function $$scan(regexp) { var $a, self = this, result = nil; if ((($a = result = self.scanner.$scan(regexp)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.column = $rb_plus(self.column, result.$length()); self.yylval = $rb_plus(self.yylval, self.scanner.$matched());}; return result; }, TMP_20.$$arity = 1); Opal.defn(self, '$skip', TMP_21 = function $$skip(regexp) { var $a, self = this, result = nil; if ((($a = result = self.scanner.$scan(regexp)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.column = $rb_plus(self.column, result.$length()); self.tok_column = self.column;}; return result; }, TMP_21.$$arity = 1); Opal.defn(self, '$check', TMP_22 = function $$check(regexp) { var self = this; return self.scanner.$check(regexp); }, TMP_22.$$arity = 1); Opal.defn(self, '$pushback', TMP_23 = function $$pushback(n) { var $a, self = this; return ($a = self.scanner, $a['$pos=']($rb_minus($a.$pos(), n))); }, TMP_23.$$arity = 1); Opal.defn(self, '$matched', TMP_24 = function $$matched() { var self = this; return self.scanner.$matched(); }, TMP_24.$$arity = 0); Opal.defn(self, '$line=', TMP_25 = function(line) { var self = this; self.column = self.tok_column = 0; return self.line = self.tok_line = line; }, TMP_25.$$arity = 1); Opal.defn(self, '$new_strterm', TMP_26 = function $$new_strterm(func, term, paren) { var self = this; return $hash2(["type", "func", "term", "paren"], {"type": "string", "func": func, "term": term, "paren": paren}); }, TMP_26.$$arity = 3); Opal.defn(self, '$new_strterm2', TMP_27 = function $$new_strterm2(func, term, paren) { var self = this; term = self.$new_strterm(func, term, paren); return term.$merge($hash2(["balance", "nesting"], {"balance": true, "nesting": 0})); }, TMP_27.$$arity = 3); Opal.defn(self, '$new_op_asgn', TMP_28 = function $$new_op_asgn(value) { var $a, $b, self = this; (($a = [value]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); self.lex_state = "expr_beg"; return "tOP_ASGN"; }, TMP_28.$$arity = 1); Opal.defn(self, '$process_numeric', TMP_29 = function $$process_numeric() { var $a, $b, self = this; self.lex_state = "expr_end"; if ((($a = self.$scan(/[\d_]+\.[\d_]+\b|[\d_]+(\.[\d_]+)?[eE][-+]?[\d_]+\b/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [self.$scanner().$matched().$gsub(/_/, "").$to_f()]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tFLOAT"; } else if ((($a = self.$scan(/([^0][\d_]*|0)\b/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [self.$scanner().$matched().$gsub(/_/, "").$to_i()]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tINTEGER"; } else if ((($a = self.$scan(/0[bB](0|1|_)+/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [self.$scanner().$matched().$to_i(2)]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tINTEGER"; } else if ((($a = self.$scan(/0[xX](\d|[a-f]|[A-F]|_)+/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [self.$scanner().$matched().$to_i(16)]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tINTEGER"; } else if ((($a = self.$scan(/0[oO]?([0-7]|_)+/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [self.$scanner().$matched().$to_i(8)]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tINTEGER"; } else if ((($a = self.$scan(/0[dD]([0-9]|_)+/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [self.$scanner().$matched().$gsub(/_/, "").$to_i()]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tINTEGER"; } else { return self.$raise("Lexing error on numeric type: `" + (self.$scanner().$peek(5)) + "`") }; }, TMP_29.$$arity = 0); Opal.defn(self, '$read_escape', TMP_30 = function $$read_escape() { var $a, self = this; if ((($a = self.$scan(/\\/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\\" } else if ((($a = self.$scan(/n/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\n" } else if ((($a = self.$scan(/t/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\t" } else if ((($a = self.$scan(/r/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\r" } else if ((($a = self.$scan(/f/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\f" } else if ((($a = self.$scan(/v/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\v" } else if ((($a = self.$scan(/a/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\u0007" } else if ((($a = self.$scan(/b/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\b" } else if ((($a = self.$scan(/e/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\u001b" } else if ((($a = self.$scan(/s/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return " " } else if ((($a = self.$scan(/[0-7]{1,3}/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (self.$matched().$to_i(8)['$%'](256)).$chr() } else if ((($a = self.$scan(/x([0-9a-fA-F]{1,2})/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$scanner()['$[]'](1).$to_i(16).$chr() } else if ((($a = self.$scan(/u([0-9a-zA-Z]{1,4})/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$scanner()['$[]'](1).$to_i(16).$chr((($scope.get('Encoding')).$$scope.get('UTF_8'))) } else if ((($a = self.$scan(/C-([a-zA-Z])/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($rb_plus($rb_minus(self.$scanner()['$[]'](1).$downcase().$ord(), "a".$ord()), "1".$to_i(16))).$chr((($scope.get('Encoding')).$$scope.get('UTF_8'))) } else if ((($a = self.$scan(/C-([0-9])/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($rb_plus($rb_minus(self.$scanner()['$[]'](1).$ord(), "0".$ord()), "10".$to_i(16))).$chr((($scope.get('Encoding')).$$scope.get('UTF_8'))) } else if ((($a = self.$scan(/M-\\C-([a-zA-Z])/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($rb_plus($rb_minus(self.$scanner()['$[]'](1).$downcase().$ord(), "a".$ord()), "81".$to_i(16))).$chr((($scope.get('Encoding')).$$scope.get('UTF_8'))) } else if ((($a = self.$scan(/M-\\C-([0-9])/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($rb_plus($rb_minus(self.$scanner()['$[]'](1).$ord(), "0".$ord()), "90".$to_i(16))).$chr((($scope.get('Encoding')).$$scope.get('UTF_8'))) } else { return self.$scan(/./) }; }, TMP_30.$$arity = 0); Opal.defn(self, '$peek_variable_name', TMP_31 = function $$peek_variable_name() { var $a, self = this; if ((($a = self.$check(/[@$]/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "tSTRING_DVAR" } else if ((($a = self.$scan(/\{/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "tSTRING_DBEG" } else { return nil }; }, TMP_31.$$arity = 0); Opal.defn(self, '$here_document', TMP_34 = function $$here_document(str_parse) { var $a, $b, $c, TMP_32, TMP_33, $d, self = this, eos_regx = nil, expand = nil, escape = nil, str_buffer = nil, tok = nil, reg = nil, complete_str = nil, lines = nil, min_indent = nil; eos_regx = (new RegExp("[ \\t]*" + $scope.get('Regexp').$escape(str_parse['$[]']("term")) + "(\\r*\\n|$)")); expand = (str_parse['$[]']("func")['$&']($scope.get('STR_FUNC_EXPAND')))['$!='](0); escape = str_parse['$[]']("func")['$!=']($scope.get('STR_SQUOTE')); if ((($a = self.$check(eos_regx)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$scan((new RegExp("[ \\t]*" + $scope.get('Regexp').$escape(str_parse['$[]']("term"))))); if ((($a = str_parse['$[]']("scanner")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.scanner_stack['$<<'](str_parse['$[]']("scanner")); self.scanner = str_parse['$[]']("scanner");}; return "tSTRING_END";}; str_buffer = []; if ((($a = self.$scan(/#/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = tok = self.$peek_variable_name()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return tok}; str_buffer['$<<']("#");}; while (!((($b = ($c = self.$check(eos_regx), $c !== false && $c !== nil && $c != null ?self.$scanner()['$bol?']() : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true)))) { if ((($b = self.$scanner()['$eos?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise("reached EOF while in heredoc")}; if ((($b = self.$scan(/\n/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { str_buffer['$<<'](self.$scanner().$matched()) } else if ((($b = (($c = expand !== false && expand !== nil && expand != null) ? self.$check(/#(?=[\$\@\{])/) : expand)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { break; } else if ((($b = self.$scan(/\\/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { str_buffer['$<<'](((function() {if (escape !== false && escape !== nil && escape != null) { return self.$read_escape() } else { return self.$scanner().$matched() }; return nil; })())) } else { reg = $scope.get('Regexp').$new("[^#\u0000\\\\\n]+|."); self.$scan(reg); str_buffer['$<<'](self.$scanner().$matched()); };}; complete_str = str_buffer.$join(""); self.line = $rb_plus(self.line, complete_str.$count("\n")); if ((($a = str_parse['$[]']("squiggly_heredoc")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { lines = complete_str.$lines(); min_indent = ($a = ($b = lines).$map, $a.$$p = (TMP_32 = function(line){var self = TMP_32.$$s || this; if (line == null) line = nil; return line.$scan((new RegExp("" + $scope.get('REGEXP_START') + "\\s+")))['$[]'](0).$length()}, TMP_32.$$s = self, TMP_32.$$arity = 1, TMP_32), $a).call($b).$min(); complete_str = ($a = ($c = lines).$map, $a.$$p = (TMP_33 = function(line){var self = TMP_33.$$s || this; if (line == null) line = nil; return line['$[]'](min_indent, line.$length())}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33), $a).call($c).$join();}; (($a = [complete_str]), $d = self, $d['$yylval='].apply($d, $a), $a[$a.length-1]); return "tSTRING_CONTENT"; }, TMP_34.$$arity = 1); Opal.defn(self, '$parse_string', TMP_35 = function $$parse_string() { var $a, $b, self = this, str_parse = nil, func = nil, space = nil, qwords = nil, expand = nil, regexp = nil, str_buffer = nil, complete_str = nil; str_parse = self.$strterm(); func = str_parse['$[]']("func"); space = false; qwords = (func['$&']($scope.get('STR_FUNC_QWORDS')))['$!='](0); expand = (func['$&']($scope.get('STR_FUNC_EXPAND')))['$!='](0); regexp = (func['$&']($scope.get('STR_FUNC_REGEXP')))['$!='](0); if ((($a = (($b = qwords !== false && qwords !== nil && qwords != null) ? self.$scan(/\s+/) : qwords)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { space = true}; str_buffer = []; if ((($a = self.$scan($scope.get('Regexp').$new($scope.get('Regexp').$escape(str_parse['$[]']("term"))))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = (($b = qwords !== false && qwords !== nil && qwords != null) ? str_parse['$[]']("done_last_space")['$!']() : qwords)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { str_parse['$[]=']("done_last_space", true); self.$pushback(1); (($a = [" "]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tSPACE";}; if ((($a = str_parse['$[]']("balance")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (str_parse['$[]']("nesting")['$=='](0)) { if (regexp !== false && regexp !== nil && regexp != null) { (($a = [self.$scan(/\w+/)]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tREGEXP_END";}; return (function() {if ((($a = ($b = self['$cond?']()['$!'](), $b !== false && $b !== nil && $b != null ?self.$scan(/:[^:]/) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "tLABEL_END" } else { return "tSTRING_END" }; return nil; })(); } else { str_buffer['$<<'](self.$scanner().$matched()); ($a = "nesting", $b = str_parse, $b['$[]=']($a, $rb_minus($b['$[]']($a), 1))); (($a = [str_parse]), $b = self, $b['$strterm='].apply($b, $a), $a[$a.length-1]); } } else if (regexp !== false && regexp !== nil && regexp != null) { self.lex_state = "expr_end"; (($a = [self.$scan(/\w+/)]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tREGEXP_END"; } else { if ((($a = str_parse['$[]']("scanner")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.scanner_stack['$<<'](str_parse['$[]']("scanner")); self.scanner = str_parse['$[]']("scanner");}; return (function() {if ((($a = ($b = self['$cond?']()['$!'](), $b !== false && $b !== nil && $b != null ?self.$scan(/:[^:]/) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "tLABEL_END" } else { return "tSTRING_END" }; return nil; })(); };}; if (space !== false && space !== nil && space != null) { (($a = [" "]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tSPACE";}; if ((($a = ($b = str_parse['$[]']("balance"), $b !== false && $b !== nil && $b != null ?self.$scan($scope.get('Regexp').$new($scope.get('Regexp').$escape(str_parse['$[]']("paren")))) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { str_buffer['$<<'](self.$scanner().$matched()); ($a = "nesting", $b = str_parse, $b['$[]=']($a, $rb_plus($b['$[]']($a), 1))); } else if ((($a = self.$check(/#[@$]/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$scan(/#/); if (expand !== false && expand !== nil && expand != null) { return "tSTRING_DVAR" } else { str_buffer['$<<'](self.$scanner().$matched()) }; } else if ((($a = self.$scan(/#\{/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (expand !== false && expand !== nil && expand != null) { return "tSTRING_DBEG" } else { str_buffer['$<<'](self.$scanner().$matched()); if ((($a = (($b = qwords !== false && qwords !== nil && qwords != null) ? self.$scanner().$matched().$match($scope.get('Regexp').$new($scope.get('Regexp').$escape(str_parse['$[]']("paren")))) : qwords)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = "nesting", $b = str_parse, $b['$[]=']($a, $rb_plus($b['$[]']($a), 1)))}; } } else if ((($a = self.$scan(/\#/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { str_buffer['$<<']("#")}; self.$add_string_content(str_buffer, str_parse); complete_str = str_buffer.$join(""); self.line = $rb_plus(self.line, complete_str.$count("\n")); (($a = [complete_str]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tSTRING_CONTENT"; }, TMP_35.$$arity = 0); Opal.defn(self, '$add_string_content', TMP_36 = function $$add_string_content(str_buffer, str_parse) { var $a, $b, $c, self = this, func = nil, end_str_re = nil, qwords = nil, expand = nil, regexp = nil, escape = nil, xquote = nil, c = nil, handled = nil, reg = nil; func = str_parse['$[]']("func"); end_str_re = $scope.get('Regexp').$new($scope.get('Regexp').$escape(str_parse['$[]']("term"))); qwords = (func['$&']($scope.get('STR_FUNC_QWORDS')))['$!='](0); expand = (func['$&']($scope.get('STR_FUNC_EXPAND')))['$!='](0); regexp = (func['$&']($scope.get('STR_FUNC_REGEXP')))['$!='](0); escape = (func['$&']($scope.get('STR_FUNC_ESCAPE')))['$!='](0); xquote = (func['$==']($scope.get('STR_XQUOTE'))); while (!((($b = self.$scanner()['$eos?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true)))) { c = nil; handled = true; if ((($b = self.$check(end_str_re)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ($c = str_parse['$[]']("balance"), $c !== false && $c !== nil && $c != null ?(str_parse['$[]']("nesting")['$!='](0)) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$scan(end_str_re); c = self.$scanner().$matched(); ($b = "nesting", $c = str_parse, $c['$[]=']($b, $rb_minus($c['$[]']($b), 1))); } else { break; } } else if ((($b = ($c = str_parse['$[]']("balance"), $c !== false && $c !== nil && $c != null ?self.$scan($scope.get('Regexp').$new($scope.get('Regexp').$escape(str_parse['$[]']("paren")))) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { ($b = "nesting", $c = str_parse, $c['$[]=']($b, $rb_plus($c['$[]']($b), 1))); c = self.$scanner().$matched(); } else if ((($b = (($c = qwords !== false && qwords !== nil && qwords != null) ? self.$scan(/\s/) : qwords)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$pushback(1); break;; } else if ((($b = (($c = expand !== false && expand !== nil && expand != null) ? self.$check(/#(?=[\$\@\{])/) : expand)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { break; } else if ((($b = (($c = qwords !== false && qwords !== nil && qwords != null) ? self.$scan(/\s/) : qwords)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$pushback(1); break;; } else if ((($b = self.$scan(/\\/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (xquote !== false && xquote !== nil && xquote != null) { c = $rb_plus("\\", self.$scan(/./)) } else if ((($b = (($c = qwords !== false && qwords !== nil && qwords != null) ? self.$scan(/\n/) : qwords)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { str_buffer['$<<']("\n"); continue;; } else if ((($b = (($c = expand !== false && expand !== nil && expand != null) ? self.$scan(/\n/) : expand)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { continue; } else if ((($b = (($c = qwords !== false && qwords !== nil && qwords != null) ? self.$scan(/\s/) : qwords)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { c = " " } else if (regexp !== false && regexp !== nil && regexp != null) { if ((($b = self.$scan(/(.)/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { c = $rb_plus("\\", self.$scanner().$matched())} } else if (expand !== false && expand !== nil && expand != null) { c = self.$read_escape() } else if ((($b = self.$scan(/\n/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else if ((($b = self.$scan(/\\/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (escape !== false && escape !== nil && escape != null) { c = "\\\\" } else { c = self.$scanner().$matched() } } else if ((($b = self.$scan(end_str_re)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { str_buffer['$<<']("\\") } } else { handled = false }; if (handled !== false && handled !== nil && handled != null) { } else { reg = (function() {if (qwords !== false && qwords !== nil && qwords != null) { return $scope.get('Regexp').$new("[^" + ($scope.get('Regexp').$escape(str_parse['$[]']("term"))) + "#\u0000\n \\\\]+|.") } else if ((($b = str_parse['$[]']("balance")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return $scope.get('Regexp').$new("[^" + ($scope.get('Regexp').$escape(str_parse['$[]']("term"))) + ($scope.get('Regexp').$escape(str_parse['$[]']("paren"))) + "#\u0000\\\\]+|.") } else { return $scope.get('Regexp').$new("[^" + ($scope.get('Regexp').$escape(str_parse['$[]']("term"))) + "#\u0000\\\\]+|.") }; return nil; })(); self.$scan(reg); c = self.$scanner().$matched(); }; ((($b = c) !== false && $b !== nil && $b != null) ? $b : c = self.$scanner().$matched()); str_buffer['$<<'](c);}; if ((($a = self.$scanner()['$eos?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise("reached EOF while in string") } else { return nil }; }, TMP_36.$$arity = 2); Opal.defn(self, '$heredoc_identifier', TMP_37 = function $$heredoc_identifier() { var $a, $b, self = this, starts_with_minus = nil, squiggly_heredoc = nil, escape_char = nil, regexp = nil, escape_method = nil, heredoc = nil, end_of_line = nil; starts_with_minus = self.$scan(/-/)['$!']()['$!'](); squiggly_heredoc = ($a = starts_with_minus['$!'](), $a !== false && $a !== nil && $a != null ?self.$scan(/~/)['$!']()['$!']() : $a); self.$scan(/(['"]?)/); escape_char = self.scanner['$[]'](0); if ((($a = escape_char['$!=']("")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { regexp = $scope.get('Regexp').$new("([^" + (escape_char) + "]+)") } else { regexp = /\w+/ }; if ((($a = self.$scan(regexp)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { escape_method = (function() {if ((($a = (escape_char['$==']("'"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('STR_SQUOTE') } else { return $scope.get('STR_DQUOTE') }; return nil; })(); heredoc = self.scanner['$[]'](0); (($a = [self.$new_strterm(escape_method, heredoc, heredoc)]), $b = self, $b['$strterm='].apply($b, $a), $a[$a.length-1]); self.$strterm()['$[]=']("type", "heredoc"); self.$strterm()['$[]=']("squiggly_heredoc", squiggly_heredoc); if (escape_char !== false && escape_char !== nil && escape_char != null) { self.$scan($scope.get('Regexp').$new(escape_char))}; end_of_line = self.$scan(/.*\n/); if ((($a = end_of_line['$!=']("\n")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$strterm()['$[]=']("scanner", $scope.get('StringScanner').$new(end_of_line))}; ($a = self, $a['$line=']($rb_plus($a.$line(), 1))); (($a = [heredoc]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tSTRING_BEG"; } else { return nil }; }, TMP_37.$$arity = 0); Opal.defn(self, '$process_identifier', TMP_38 = function $$process_identifier(matched, cmd_start) { var $a, $b, $c, self = this, last_state = nil, result = nil, kw = nil, old_state = nil; last_state = self.lex_state; if ((($a = ($b = ($c = self['$label_state?'](), $c !== false && $c !== nil && $c != null ?self.$check(/::/)['$!']() : $c), $b !== false && $b !== nil && $b != null ?self.$scan(/:/) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_beg"; (($a = [matched]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return "tLABEL";}; if (matched['$==']("defined?")) { if ((($a = self['$after_operator?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_end"; return "tIDENTIFIER";}; self.lex_state = "expr_arg"; return "kDEFINED";}; if ((($a = matched['$end_with?']("?", "!")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = "tIDENTIFIER" } else if (self.lex_state['$==']("expr_fname")) { if ((($a = ($b = self.$check(/\=\>/)['$!'](), $b !== false && $b !== nil && $b != null ?self.$scan(/\=/) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = "tIDENTIFIER"; matched = $rb_plus(matched, self.$scanner().$matched());} } else if ((($a = matched['$=~']((new RegExp("" + $scope.get('REGEXP_START') + "[A-Z]")))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = "tCONSTANT" } else { result = "tIDENTIFIER" }; if ((($a = ($b = self.lex_state['$!=']("expr_dot"), $b !== false && $b !== nil && $b != null ?kw = $scope.get('Keywords').$keyword(matched) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { old_state = self.lex_state; self.lex_state = kw.$state(); if (old_state['$==']("expr_fname")) { (($a = [kw.$name()]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return kw.$id()['$[]'](0);}; if (self.lex_state['$==']("expr_beg")) { cmd_start = true}; if (matched['$==']("do")) { if ((($a = self['$after_operator?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_end"; return "tIDENTIFIER";}; if (self.lambda_stack.$last()['$=='](self.paren_nest)) { self.lambda_stack.$pop(); self.lex_state = "expr_beg"; return "kDO_LAMBDA"; } else if ((($a = self['$cond?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_beg"; return "kDO_COND"; } else if ((($a = ($b = self['$cmdarg?'](), $b !== false && $b !== nil && $b != null ?self.lex_state['$!=']("expr_cmdarg") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_beg"; return "kDO_BLOCK"; } else if (last_state['$==']("expr_endarg")) { return "kDO_BLOCK" } else { self.lex_state = "expr_beg"; return "kDO"; }; } else if ((($a = ((($b = old_state['$==']("expr_beg")) !== false && $b !== nil && $b != null) ? $b : old_state['$==']("expr_value"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [matched]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return kw.$id()['$[]'](0); } else { if ((($a = kw.$id()['$[]'](0)['$!='](kw.$id()['$[]'](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_beg"}; (($a = [matched]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return kw.$id()['$[]'](1); };}; if ((($a = ["expr_beg", "expr_dot", "expr_mid", "expr_arg", "expr_cmdarg"]['$include?'](self.lex_state)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = (function() {if (cmd_start !== false && cmd_start !== nil && cmd_start != null) { return "expr_cmdarg" } else { return "expr_arg" }; return nil; })() } else if (self.lex_state['$==']("expr_fname")) { self.lex_state = "expr_endfn" } else { self.lex_state = "expr_end" }; if ((($a = ($b = ["expr_dot", "expr_fname"]['$include?'](last_state)['$!'](), $b !== false && $b !== nil && $b != null ?self['$has_local?'](matched) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.lex_state = "expr_end"}; (($a = [matched]), $b = self, $b['$yylval='].apply($b, $a), $a[$a.length-1]); return (function() {if ((($a = matched['$=~']((new RegExp("" + $scope.get('REGEXP_START') + "[A-Z]")))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "tCONSTANT" } else { return "tIDENTIFIER" }; return nil; })(); }, TMP_38.$$arity = 2); return (Opal.defn(self, '$yylex', TMP_39 = function $$yylex() {try { var $a, $b, $c, $d, $e, self = this, cmd_start = nil, c = nil, token = nil, line_count = nil, result = nil, str_type = nil, paren = nil, term = nil, $case = nil, func = nil, matched = nil, sign = nil, utype = nil; self.yylval = ""; self.space_seen = false; cmd_start = false; c = ""; if ((($a = self.$strterm()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (self.$strterm()['$[]']("type")['$==']("heredoc")) { token = self.$here_document(self.$strterm()) } else { token = self.$parse_string() }; if ((($a = ((($b = ((($c = token['$==']("tSTRING_END")) !== false && $c !== nil && $c != null) ? $c : token['$==']("tREGEXP_END"))) !== false && $b !== nil && $b != null) ? $b : token['$==']("tLABEL_END"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [nil]), $b = self, $b['$strterm='].apply($b, $a), $a[$a.length-1]); self.lex_state = "expr_end";}; return token;}; while ((($b = true) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$skip(/\ |\t|\r/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.space_seen = true; continue;; } else if ((($b = self.$skip(/(\n|#)/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { c = self.$scanner().$matched(); if (c['$==']("#")) { self.$skip(/(.*)/) } else { ($b = self, $b['$line=']($rb_plus($b.$line(), 1))) }; self.$skip(/(\n+)/); if ((($b = self.$scanner().$matched()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { ($b = self, $b['$line=']($rb_plus($b.$line(), self.$scanner().$matched().$length())))}; if ((($b = ["expr_beg", "expr_dot"]['$include?'](self.lex_state)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { continue;}; if ((($b = self.$skip(/([\ \t\r\f\v]*)\./)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scanner()['$[]'](1)['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { self.space_seen = true }; self.$pushback(1); if ((($b = self.$check(/\.\./)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { continue; };}; cmd_start = true; self.lex_state = "expr_beg"; (($b = ["\\n"]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return "tNL"; } else if ((($b = self.$scan(/\;/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tSEMI"; } else if ((($b = self.$check(/\*/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\*\*\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("**") } else if ((($b = self.$scan(/\*\*/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ["expr_beg", "expr_mid"]['$include?'](self.lex_state)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tDSTAR" } else { self.$set_arg_state(); return "tPOW"; } } else if ((($b = self.$scan(/\*\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("*") } else { self.$scan(/\*/); if ((($b = self['$after_operator?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_arg"; return "tSTAR2"; } else if ((($b = ($c = self.space_seen, $c !== false && $c !== nil && $c != null ?self.$check(/\S/) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tSTAR"; } else if ((($b = ["expr_beg", "expr_mid"]['$include?'](self.lex_state)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tSTAR"; } else { self.lex_state = "expr_beg"; return "tSTAR2"; }; } } else if ((($b = self.$scan(/\!/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self['$after_operator?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_arg"; if ((($b = self.$scan(/@/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ["tBANG", "!"]}; } else { self.lex_state = "expr_beg" }; if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tNEQ" } else if ((($b = self.$scan(/\~/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tNMATCH"}; return "tBANG"; } else if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = (($c = self.lex_state['$==']("expr_beg")) ? self.space_seen['$!']() : self.lex_state['$==']("expr_beg"))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ($c = self.$scan(/begin/), $c !== false && $c !== nil && $c != null ?self['$space?']() : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$scan(/(.*)/); line_count = 0; while ((($c = true) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = self.$scanner()['$eos?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$raise("embedded document meets end of file")}; if ((($c = ($d = self.$scan(/\=end/), $d !== false && $d !== nil && $d != null ?self['$space?']() : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.line = $rb_plus(self.line, line_count); return self.$yylex();}; if ((($c = self.$scan(/\n/)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { line_count = $rb_plus(line_count, 1); continue;;}; self.$scan(/(.*)/);};}}; self.$set_arg_state(); if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tEQQ"}; return "tEQ";}; if ((($b = self.$scan(/\~/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tMATCH" } else if ((($b = self.$scan(/\>/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tASSOC"}; return "tEQL"; } else if ((($b = self.$scan(/\"/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_DQUOTE'), "\"", "\x00")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return "tSTRING_BEG"; } else if ((($b = self.$scan(/\'/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_SQUOTE'), "'", "\x00")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return "tSTRING_BEG"; } else if ((($b = self.$scan(/\`/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_XQUOTE'), "`", "\x00")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return "tXSTRING_BEG"; } else if ((($b = self.$scan(/\&/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\&/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("&&")}; return "tANDOP"; } else if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("&")}; if ((($b = self['$spcarg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = "tAMPER" } else if ((($b = self['$beg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = "tAMPER" } else { result = "tAMPER2" }; self.$set_arg_state(); return result; } else if ((($b = self.$scan(/\|/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\|/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("||")}; return "tOROP"; } else if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("|")}; self.$set_arg_state(); return "tPIPE"; } else if ((($b = self.$scan(/\%[QqWwIixrs]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { str_type = self.$scanner().$matched()['$[]'](1, 1); paren = term = self.$scan(/./); $case = term;if ("("['$===']($case)) {term = ")"}else if ("["['$===']($case)) {term = "]"}else if ("{"['$===']($case)) {term = "}"}else if ("<"['$===']($case)) {term = ">"}else {paren = "\x00"}; $c = (function() {$case = str_type;if ("Q"['$===']($case)) {return ["tSTRING_BEG", $scope.get('STR_DQUOTE')]}else if ("q"['$===']($case)) {return ["tSTRING_BEG", $scope.get('STR_SQUOTE')]}else if ("W"['$===']($case) || "I"['$===']($case)) {self.$skip(/\s*/); return ["tWORDS_BEG", $scope.get('STR_DWORD')];}else if ("w"['$===']($case) || "i"['$===']($case)) {self.$skip(/\s*/); return ["tAWORDS_BEG", $scope.get('STR_SWORD')];}else if ("x"['$===']($case)) {return ["tXSTRING_BEG", $scope.get('STR_XQUOTE')]}else if ("r"['$===']($case)) {return ["tREGEXP_BEG", $scope.get('STR_REGEXP')]}else if ("s"['$===']($case)) {return ["tSTRING_BEG", $scope.get('STR_SQUOTE')]}else { return nil }})(), $b = Opal.to_ary($c), token = ($b[0] == null ? nil : $b[0]), func = ($b[1] == null ? nil : $b[1]), $c; (($b = [self.$new_strterm2(func, term, paren)]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return token; } else if ((($b = self.$scan(/\//)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self['$beg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_REGEXP'), "/", "/")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return "tREGEXP_BEG"; } else if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("/")}; if ((($b = self['$arg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ($c = self.$check(/\s/)['$!'](), $c !== false && $c !== nil && $c != null ?self.space_seen : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_REGEXP'), "/", "/")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return "tREGEXP_BEG";}}; if ((($b = self['$after_operator?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_arg" } else { self.lex_state = "expr_beg" }; return "tDIVIDE"; } else if ((($b = self.$scan(/\%/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ($c = self.$check(/\=/), $c !== false && $c !== nil && $c != null ?self.lex_state['$!=']("expr_beg") : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$scan(/\=/); return self.$new_op_asgn("%"); } else if ((($b = self.$check(/[^\s]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ((($c = ((($d = self.lex_state['$==']("expr_beg")) !== false && $d !== nil && $d != null) ? $d : (($e = self.lex_state['$==']("expr_arg")) ? self.space_seen : self.lex_state['$==']("expr_arg")))) !== false && $c !== nil && $c != null) ? $c : self.lex_state['$==']("expr_mid"))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { paren = term = self.$scan(/./); $case = term;if ("("['$===']($case)) {term = ")"}else if ("["['$===']($case)) {term = "]"}else if ("{"['$===']($case)) {term = "}"}else if ("<"['$===']($case)) {term = ">"}else {paren = "\x00"}; (($b = [self.$new_strterm2($scope.get('STR_DQUOTE'), term, paren)]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]); return "tSTRING_BEG";}}; self.$set_arg_state(); return "tPERCENT"; } else if ((($b = self.$scan(/\\/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\r?\n/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.space_seen = true; continue;;}; self.$raise($scope.get('SyntaxError'), "backslash must appear before newline :" + (self.file) + ":" + (self.line)); } else if ((($b = self.$scan(/\(/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = self.$scanner().$matched(); if ((($b = self['$beg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = "tLPAREN" } else if ((($b = ($c = self.space_seen, $c !== false && $c !== nil && $c != null ?self['$arg?']() : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lparen_arg_seen = true; result = "tLPAREN_ARG"; } else { result = "tLPAREN2" }; self.lex_state = "expr_beg"; self.$cond_push(0); self.$cmdarg_push(0); self.paren_nest = $rb_plus(self.paren_nest, 1); return result; } else if ((($b = self.$scan(/\)/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$cond_lexpop(); self.$cmdarg_lexpop(); self.paren_nest = $rb_minus(self.paren_nest, 1); self.lex_state = "expr_end"; self.lparen_arg_seen = false; return "tRPAREN"; } else if ((($b = self.$scan(/\[/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = self.$scanner().$matched(); if ((($b = self['$after_operator?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_arg"; if ((($b = self.$scan(/\]=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tASET" } else if ((($b = self.$scan(/\]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "tAREF" } else { self.$raise("Unexpected '[' token") }; } else if ((($b = self['$beg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = "tLBRACK" } else if ((($b = ($c = self['$arg?'](), $c !== false && $c !== nil && $c != null ?self.space_seen : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = "tLBRACK" } else { result = "tLBRACK2" }; self.lex_state = "expr_beg"; self.$cond_push(0); self.$cmdarg_push(0); return result; } else if ((($b = self.$scan(/\]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$cond_lexpop(); self.$cmdarg_lexpop(); self.lex_state = "expr_end"; return "tRBRACK"; } else if ((($b = self.$scan(/\}/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$cond_lexpop(); self.$cmdarg_lexpop(); self.lex_state = "expr_end"; return "tRCURLY"; } else if ((($b = self.$scan(/\.\.\./)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tDOT3"; } else if ((($b = self.$scan(/\.\./)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tDOT2"; } else if ((($b = ($c = self.lex_state['$!=']("expr_fname"), $c !== false && $c !== nil && $c != null ?self.$scan(/\.JS\[/) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; self.$cond_push(0); self.$cmdarg_push(0); return "tJSLBRACK"; } else if ((($b = ($c = self.lex_state['$!=']("expr_fname"), $c !== false && $c !== nil && $c != null ?self.$scan(/\.JS\./) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_dot"; return "tJSDOT"; } else if ((($b = self.$scan(/\./)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (self.lex_state['$==']("expr_fname")) { } else { self.lex_state = "expr_dot" }; return "tDOT"; } else if ((($b = self.$scan(/\:\:/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self['$beg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tCOLON3"; } else if ((($b = self['$spcarg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tCOLON3";}; self.lex_state = "expr_dot"; return "tCOLON2"; } else if ((($b = self.$scan(/\:/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ((($c = self['$end?']()) !== false && $c !== nil && $c != null) ? $c : self.$check(/\s/))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$check(/\w/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { self.lex_state = "expr_beg"; return "tCOLON"; }; self.lex_state = "expr_fname"; return "tSYMBEG";}; if ((($b = self.$scan(/\'/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_SSYM'), "'", "\x00")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1]) } else if ((($b = self.$scan(/\"/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [self.$new_strterm($scope.get('STR_DSYM'), "\"", "\x00")]), $c = self, $c['$strterm='].apply($c, $b), $b[$b.length-1])}; self.lex_state = "expr_fname"; return "tSYMBEG"; } else if ((($b = self.$scan(/\^\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn("^") } else if ((($b = self.$scan(/\^/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$set_arg_state(); return "tCARET"; } else if ((($b = self.$check(//)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self['$after_operator?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_arg" } else { if (self.lex_state['$==']("expr_class")) { cmd_start = true}; self.lex_state = "expr_beg"; }; return "tCMP"; } else if ((($b = self.$scan(/<\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$set_arg_state(); return "tLEQ"; } else if ((($b = self.$scan(//)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\>\>\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn(">>") } else if ((($b = self.$scan(/\>\>/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$set_arg_state(); return "tRSHFT"; } else if ((($b = self.$scan(/\>\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$set_arg_state(); return "tGEQ"; } else if ((($b = self.$scan(/\>/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$set_arg_state(); return "tGT";} } else if ((($b = self.$scan(/->/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; self.lambda_stack.$push(self.paren_nest); return "tLAMBDA"; } else if ((($b = self.$scan(/[+-]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { matched = self.$scanner().$matched(); $c = (function() {if (matched['$==']("+")) { return ["tPLUS", "tUPLUS"] } else { return ["tMINUS", "tUMINUS"] }; return nil; })(), $b = Opal.to_ary($c), sign = ($b[0] == null ? nil : $b[0]), utype = ($b[1] == null ? nil : $b[1]), $c; if ((($b = self['$beg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_mid"; (($b = [matched]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); if ((($b = ($c = self.$scanner().$peek(1)['$=~'](/\d/), $c !== false && $c !== nil && $c != null ?Opal.ret((function() {if (utype['$==']("tUMINUS")) { return "-@NUM" } else { return "+@NUM" }; return nil; })()) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { return utype }; } else if ((($b = self['$after_operator?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_arg"; if ((($b = self.$scan(/@/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { (($b = [$rb_plus(matched, "@")]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return "tIDENTIFIER";}; (($b = [matched]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return sign;}; if ((($b = self.$scan(/\=/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$new_op_asgn(matched)}; if ((($b = self['$spcarg?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_mid"; (($b = [matched]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); if ((($b = ($c = self.$scanner().$peek(1)['$=~'](/\d/), $c !== false && $c !== nil && $c != null ?Opal.ret((function() {if (utype['$==']("tUMINUS")) { return "-@NUM" } else { return "+@NUM" }; return nil; })()) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { return utype };}; self.lex_state = "expr_beg"; (($b = [matched]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return sign; } else if ((($b = self.$scan(/\?/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self['$end?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tEH";}; if ((($b = self.$check(/\ |\t|\r|\s/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tEH"; } else if ((($b = self.$scan(/\\/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; (($b = [self.$read_escape()]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return "tSTRING";}; self.lex_state = "expr_end"; (($b = [self.$scan(/./)]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return "tSTRING"; } else if ((($b = self.$scan(/\~/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$set_arg_state(); return "tTILDE"; } else if ((($b = self.$check(/\$/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$scan(/\$([1-9]\d*)/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; (($b = [self.$scanner().$matched().$sub("$", "")]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return "tNTH_REF"; } else if ((($b = self.$scan(/(\$_)(\w+)/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tGVAR"; } else if ((($b = self.$scan(/\$[\+\'\`\&!@\"~*$?\/\\:;=.,<>_]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tGVAR"; } else if ((($b = self.$scan(/\$\w+/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tGVAR"; } else if ((($b = self.$scan(/\$-[0-9a-zA-Z]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tGVAR"; } else { self.$raise("Bad gvar name: " + (self.$scanner().$peek(5).$inspect())) } } else if ((($b = self.$scan(/\$\w+/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tGVAR"; } else if ((($b = self.$scan(/\@\@\w*/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tCVAR"; } else if ((($b = self.$scan(/\@\w*/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_end"; return "tIVAR"; } else if ((($b = self.$scan(/\,/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lex_state = "expr_beg"; return "tCOMMA"; } else if ((($b = self.$scan(/\{/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (self.lambda_stack.$last()['$=='](self.paren_nest)) { self.lambda_stack.$pop(); self.lex_state = "expr_beg"; self.$cond_push(0); self.$cmdarg_push(0); return "tLAMBEG"; } else if ((($b = ((($c = self['$arg?']()) !== false && $c !== nil && $c != null) ? $c : self.lex_state['$==']("expr_end"))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.lparen_arg_seen) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.lparen_arg_seen = false; result = "tLBRACE_ARG"; } else { result = "tLCURLY" } } else if (self.lex_state['$==']("expr_endarg")) { result = "tLBRACE_ARG" } else { result = "tLBRACE" }; self.lex_state = "expr_beg"; self.$cond_push(0); self.$cmdarg_push(0); return result; } else if ((($b = ($c = self.$scanner()['$bol?'](), $c !== false && $c !== nil && $c != null ?self.$skip(/\__END__(\n|$)/) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { while ((($c = true) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = self.$scanner()['$eos?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.eof_content = self.$yylval(); return false;}; self.$scan(/(.*)/); self.$scan(/\n/);} } else if ((($b = self.$check(/[0-9]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$process_numeric() } else if ((($b = self.$scan($scope.get('INLINE_IDENTIFIER_REGEXP'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$process_identifier(self.$scanner().$matched(), cmd_start)}; if ((($b = self.$scanner()['$eos?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (self.scanner_stack.$size()['$=='](1)) { (($b = [false]), $c = self, $c['$yylval='].apply($c, $b), $b[$b.length-1]); return false; } else { self.scanner_stack.$pop(); self.scanner = self.scanner_stack.$last(); return self.$yylex(); }}; self.$raise("Unexpected content in parsing stream `" + (self.$scanner().$peek(5)) + "` :" + (self.file) + ":" + (self.line));}; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_39.$$arity = 0), nil) && 'yylex'; })($scope.base, null) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["racc/parser"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$[]', '$class', '$<', '$size', '$[]=', '$__send__', '$_racc_setup', '$raise', '$_racc_init_sysvars', '$catch', '$!=', '$next_token', '$racc_read_token', '$+', '$>=', '$==', '$_racc_evalact', '$!', '$>', '$-', '$push', '$racc_shift', '$-@', '$_racc_do_reduce', '$===', '$racc_accept', '$throw', '$on_error', '$<=', '$pop', '$racc_e_pop', '$inspect', '$racc_next_state', '$*', '$racc_reduce', '$sprintf', '$token_to_str', '$print', '$racc_token2str', '$puts', '$racc_print_stacks', '$empty?', '$each', '$racc_print_states', '$each_index']); (function($base) { var $Racc, self = $Racc = $module($base, 'Racc'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ParseError(){}; var self = $ParseError = $klass($base, $super, 'ParseError', $ParseError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')) })($scope.base); if ((($a = (Opal.Object.$$scope.ParseError == null ? nil : 'constant')) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Opal.cdecl($scope, 'ParseError', (($scope.get('Racc')).$$scope.get('ParseError'))) }; return (function($base) { var $Racc, self = $Racc = $module($base, 'Racc'); var def = self.$$proto, $scope = self.$$scope, $a; if ((($a = ($scope.Racc_No_Extensions != null)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Opal.cdecl($scope, 'Racc_No_Extensions', false) }; (function($base, $super) { function $Parser(){}; var self = $Parser = $klass($base, $super, 'Parser', $Parser); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_7, TMP_8, TMP_11, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_22, TMP_23, TMP_24, TMP_25, TMP_27, TMP_29, TMP_30, TMP_31; def.yydebug = def.racc_debug_out = def.racc_error_status = def.racc_t = def.racc_vstack = def.racc_val = def.racc_state = def.racc_tstack = nil; Opal.cdecl($scope, 'Racc_Runtime_Version', "1.4.6"); Opal.cdecl($scope, 'Racc_Runtime_Revision', ["originalRevision:", "1.8"]['$[]'](1)); Opal.cdecl($scope, 'Racc_Runtime_Core_Version_R', "1.4.6"); Opal.cdecl($scope, 'Racc_Runtime_Core_Revision_R', ["originalRevision:", "1.8"]['$[]'](1)); Opal.cdecl($scope, 'Racc_Main_Parsing_Routine', "_racc_do_parse_rb"); Opal.cdecl($scope, 'Racc_YY_Parse_Method', "_racc_yyparse_rb"); Opal.cdecl($scope, 'Racc_Runtime_Core_Version', $scope.get('Racc_Runtime_Core_Version_R')); Opal.cdecl($scope, 'Racc_Runtime_Core_Revision', $scope.get('Racc_Runtime_Core_Revision_R')); Opal.cdecl($scope, 'Racc_Runtime_Type', "ruby"); Opal.defs($scope.get('Parser'), '$racc_runtime_type', TMP_1 = function $$racc_runtime_type() { var self = this; return $scope.get('Racc_Runtime_Type'); }, TMP_1.$$arity = 0); Opal.defn(self, '$_racc_setup', TMP_2 = function $$_racc_setup() { var $a, $b, self = this, arg = nil; if ($gvars.stderr == null) $gvars.stderr = nil; if ((($a = ((self.$class()).$$scope.get('Racc_debug_parser'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.yydebug = false }; if ((($a = (($b = self['yydebug'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.yydebug = false }; if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = (($b = self['racc_debug_out'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.racc_debug_out = $gvars.stderr }; ((($a = self.racc_debug_out) !== false && $a !== nil && $a != null) ? $a : self.racc_debug_out = $gvars.stderr);}; arg = ((self.$class()).$$scope.get('Racc_arg')); if ((($a = $rb_lt(arg.$size(), 14)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { arg['$[]='](13, true)}; return arg; }, TMP_2.$$arity = 0); Opal.defn(self, '$_racc_init_sysvars', TMP_3 = function $$_racc_init_sysvars() { var self = this; self.racc_state = [0]; self.racc_tstack = []; self.racc_vstack = []; self.racc_t = nil; self.racc_val = nil; self.racc_read_next = true; self.racc_user_yyerror = false; return self.racc_error_status = 0; }, TMP_3.$$arity = 0); Opal.defn(self, '$do_parse', TMP_4 = function $$do_parse() { var self = this; return self.$__send__($scope.get('Racc_Main_Parsing_Routine'), self.$_racc_setup(), false); }, TMP_4.$$arity = 0); Opal.defn(self, '$next_token', TMP_5 = function $$next_token() { var self = this; return self.$raise($scope.get('NotImplementedError'), "" + (self.$class()) + "#next_token is not defined"); }, TMP_5.$$arity = 0); Opal.defn(self, '$_racc_do_parse_rb', TMP_7 = function $$_racc_do_parse_rb(arg, in_debug) { var $a, $b, TMP_6, self = this, action_table = nil, action_check = nil, action_default = nil, action_pointer = nil, _ = nil, token_table = nil, tok = nil, act = nil, i = nil; $b = arg, $a = Opal.to_ary($b), action_table = ($a[0] == null ? nil : $a[0]), action_check = ($a[1] == null ? nil : $a[1]), action_default = ($a[2] == null ? nil : $a[2]), action_pointer = ($a[3] == null ? nil : $a[3]), _ = ($a[4] == null ? nil : $a[4]), _ = ($a[5] == null ? nil : $a[5]), _ = ($a[6] == null ? nil : $a[6]), _ = ($a[7] == null ? nil : $a[7]), _ = ($a[8] == null ? nil : $a[8]), _ = ($a[9] == null ? nil : $a[9]), token_table = ($a[10] == null ? nil : $a[10]), _ = ($a[11] == null ? nil : $a[11]), _ = ($a[12] == null ? nil : $a[12]), _ = ($a[13] == null ? nil : $a[13]), $b; self.$_racc_init_sysvars(); tok = act = i = nil; return ($a = ($b = self).$catch, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this, $c, $d, $e, $f; if (self.racc_state == null) self.racc_state = nil; if (self.racc_read_next == null) self.racc_read_next = nil; if (self.racc_t == null) self.racc_t = nil; if (self.yydebug == null) self.yydebug = nil; if (self.racc_val == null) self.racc_val = nil; while ((($d = true) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { if ((($d = i = action_pointer['$[]'](self.racc_state['$[]'](-1))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { if ((($d = self.racc_read_next) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { if ((($d = self.racc_t['$!='](0)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { $e = self.$next_token(), $d = Opal.to_ary($e), tok = ($d[0] == null ? nil : $d[0]), self.racc_val = ($d[1] == null ? nil : $d[1]), $e; if (tok !== false && tok !== nil && tok != null) { self.racc_t = (((($d = token_table['$[]'](tok)) !== false && $d !== nil && $d != null) ? $d : 1)) } else { self.racc_t = 0 }; if ((($d = self.yydebug) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { self.$racc_read_token(self.racc_t, tok, self.racc_val)}; self.racc_read_next = false;}}; i = $rb_plus(i, self.racc_t); if ((($d = ($e = ($f = $rb_ge(i, 0), $f !== false && $f !== nil && $f != null ?act = action_table['$[]'](i) : $f), $e !== false && $e !== nil && $e != null ?action_check['$[]'](i)['$=='](self.racc_state['$[]'](-1)) : $e)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { } else { act = action_default['$[]'](self.racc_state['$[]'](-1)) }; } else { act = action_default['$[]'](self.racc_state['$[]'](-1)) }; while ((($e = act = self.$_racc_evalact(act, arg)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { };}}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($b, "racc_end_parse"); }, TMP_7.$$arity = 2); Opal.defn(self, '$yyparse', TMP_8 = function $$yyparse(recv, mid) { var self = this; return self.$__send__($scope.get('Racc_YY_Parse_Method'), recv, mid, self.$_racc_setup(), true); }, TMP_8.$$arity = 2); Opal.defn(self, '$_racc_yyparse_rb', TMP_11 = function $$_racc_yyparse_rb(recv, mid, arg, c_debug) { var $a, $b, TMP_9, self = this, action_table = nil, action_check = nil, action_default = nil, action_pointer = nil, _ = nil, token_table = nil, act = nil, i = nil; $b = arg, $a = Opal.to_ary($b), action_table = ($a[0] == null ? nil : $a[0]), action_check = ($a[1] == null ? nil : $a[1]), action_default = ($a[2] == null ? nil : $a[2]), action_pointer = ($a[3] == null ? nil : $a[3]), _ = ($a[4] == null ? nil : $a[4]), _ = ($a[5] == null ? nil : $a[5]), _ = ($a[6] == null ? nil : $a[6]), _ = ($a[7] == null ? nil : $a[7]), _ = ($a[8] == null ? nil : $a[8]), _ = ($a[9] == null ? nil : $a[9]), token_table = ($a[10] == null ? nil : $a[10]), _ = ($a[11] == null ? nil : $a[11]), _ = ($a[12] == null ? nil : $a[12]), _ = ($a[13] == null ? nil : $a[13]), $b; self.$_racc_init_sysvars(); act = nil; i = nil; return ($a = ($b = self).$catch, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this, $c, $d, $e, TMP_10; if (self.racc_state == null) self.racc_state = nil; while (!((($d = i = action_pointer['$[]'](self.racc_state['$[]'](-1))) !== nil && $d != null && (!$d.$$is_boolean || $d == true)))) { while ((($e = act = self.$_racc_evalact(action_default['$[]'](self.racc_state['$[]'](-1)), arg)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { }}; return ($c = ($d = recv).$__send__, $c.$$p = (TMP_10 = function(tok, val){var self = TMP_10.$$s || this, $f, $g, $h, $i, $j, $k; if (self.racc_t == null) self.racc_t = nil; if (self.racc_state == null) self.racc_state = nil; if (self.racc_read_next == null) self.racc_read_next = nil; if (tok == null) tok = nil;if (val == null) val = nil; if (tok !== false && tok !== nil && tok != null) { self.racc_t = (((($f = token_table['$[]'](tok)) !== false && $f !== nil && $f != null) ? $f : 1)) } else { self.racc_t = 0 }; self.racc_val = val; self.racc_read_next = false; i = $rb_plus(i, self.racc_t); if ((($f = ($g = ($h = $rb_ge(i, 0), $h !== false && $h !== nil && $h != null ?act = action_table['$[]'](i) : $h), $g !== false && $g !== nil && $g != null ?action_check['$[]'](i)['$=='](self.racc_state['$[]'](-1)) : $g)) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { } else { act = action_default['$[]'](self.racc_state['$[]'](-1)) }; while ((($g = act = self.$_racc_evalact(act, arg)) !== nil && $g != null && (!$g.$$is_boolean || $g == true))) { }; while ((($g = ((($h = ((($i = ((i = action_pointer['$[]'](self.racc_state['$[]'](-1))))['$!']()) !== false && $i !== nil && $i != null) ? $i : self.racc_read_next['$!']())) !== false && $h !== nil && $h != null) ? $h : self.racc_t['$=='](0))) !== nil && $g != null && (!$g.$$is_boolean || $g == true))) { if ((($g = ($h = ($i = ($j = (($k = i !== false && i !== nil && i != null) ? i = $rb_plus(i, self.racc_t) : i), $j !== false && $j !== nil && $j != null ?$rb_ge(i, 0) : $j), $i !== false && $i !== nil && $i != null ?act = action_table['$[]'](i) : $i), $h !== false && $h !== nil && $h != null ?action_check['$[]'](i)['$=='](self.racc_state['$[]'](-1)) : $h)) !== nil && $g != null && (!$g.$$is_boolean || $g == true))) { } else { act = action_default['$[]'](self.racc_state['$[]'](-1)) }; while ((($h = act = self.$_racc_evalact(act, arg)) !== nil && $h != null && (!$h.$$is_boolean || $h == true))) { };};}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $c).call($d, mid);}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $a).call($b, "racc_end_parse"); }, TMP_11.$$arity = 4); Opal.defn(self, '$_racc_evalact', TMP_13 = function $$_racc_evalact(act, arg) { var $a, $b, TMP_12, $c, $d, $e, self = this, action_table = nil, action_check = nil, _ = nil, action_pointer = nil, shift_n = nil, reduce_n = nil, code = nil, $case = nil, i = nil; $b = arg, $a = Opal.to_ary($b), action_table = ($a[0] == null ? nil : $a[0]), action_check = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]), action_pointer = ($a[3] == null ? nil : $a[3]), _ = ($a[4] == null ? nil : $a[4]), _ = ($a[5] == null ? nil : $a[5]), _ = ($a[6] == null ? nil : $a[6]), _ = ($a[7] == null ? nil : $a[7]), _ = ($a[8] == null ? nil : $a[8]), _ = ($a[9] == null ? nil : $a[9]), _ = ($a[10] == null ? nil : $a[10]), shift_n = ($a[11] == null ? nil : $a[11]), reduce_n = ($a[12] == null ? nil : $a[12]), _ = ($a[13] == null ? nil : $a[13]), _ = ($a[14] == null ? nil : $a[14]), $b; if ((($a = ($b = $rb_gt(act, 0), $b !== false && $b !== nil && $b != null ?$rb_lt(act, shift_n) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_gt(self.racc_error_status, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (self.racc_t['$=='](1)) { } else { self.racc_error_status = $rb_minus(self.racc_error_status, 1) }}; self.racc_vstack.$push(self.racc_val); self.racc_state.$push(act); self.racc_read_next = true; if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.racc_tstack.$push(self.racc_t); self.$racc_shift(self.racc_t, self.racc_tstack, self.racc_vstack);}; } else if ((($a = ($b = $rb_lt(act, 0), $b !== false && $b !== nil && $b != null ?$rb_gt(act, reduce_n['$-@']()) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { code = ($a = ($b = self).$catch, $a.$$p = (TMP_12 = function(){var self = TMP_12.$$s || this; if (self.racc_state == null) self.racc_state = nil; self.racc_state.$push(self.$_racc_do_reduce(arg, act)); return false;}, TMP_12.$$s = self, TMP_12.$$arity = 0, TMP_12), $a).call($b, "racc_jump"); if (code !== false && code !== nil && code != null) { $case = code;if ((1)['$===']($case)) {self.racc_user_yyerror = true; return reduce_n['$-@']();}else if ((2)['$===']($case)) {return shift_n}else {self.$raise("[Racc Bug] unknown jump code")}}; } else if (act['$=='](shift_n)) { if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$racc_accept()}; self.$throw("racc_end_parse", self.racc_vstack['$[]'](0)); } else if (act['$=='](reduce_n['$-@']())) { $case = self.racc_error_status;if ((0)['$===']($case)) {if ((($a = arg['$[]'](21)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$on_error(self.racc_t, self.racc_val, self.racc_vstack) }}else if ((3)['$===']($case)) {if (self.racc_t['$=='](0)) { self.$throw("racc_end_parse", nil)}; self.racc_read_next = true;}; self.racc_user_yyerror = false; self.racc_error_status = 3; while ((($c = true) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = i = action_pointer['$[]'](self.racc_state['$[]'](-1))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { i = $rb_plus(i, 1); if ((($c = ($d = ($e = $rb_ge(i, 0), $e !== false && $e !== nil && $e != null ?(act = action_table['$[]'](i)) : $e), $d !== false && $d !== nil && $d != null ?action_check['$[]'](i)['$=='](self.racc_state['$[]'](-1)) : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { break;};}; if ((($c = $rb_le(self.racc_state.$size(), 1)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$throw("racc_end_parse", nil)}; self.racc_state.$pop(); self.racc_vstack.$pop(); if ((($c = self.yydebug) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.racc_tstack.$pop(); self.$racc_e_pop(self.racc_state, self.racc_tstack, self.racc_vstack);};}; return act; } else { self.$raise("[Racc Bug] unknown action " + (act.$inspect())) }; if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$racc_next_state(self.racc_state['$[]'](-1), self.racc_state)}; return nil; }, TMP_13.$$arity = 2); Opal.defn(self, '$_racc_do_reduce', TMP_14 = function $$_racc_do_reduce(arg, act) { var $a, $b, $c, self = this, _ = nil, goto_table = nil, goto_check = nil, goto_default = nil, goto_pointer = nil, nt_base = nil, reduce_table = nil, use_result = nil, state = nil, vstack = nil, tstack = nil, i = nil, len = nil, reduce_to = nil, method_id = nil, void_array = nil, tmp_t = nil, tmp_v = nil, k1 = nil, curstate = nil; $b = arg, $a = Opal.to_ary($b), _ = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), _ = ($a[2] == null ? nil : $a[2]), _ = ($a[3] == null ? nil : $a[3]), goto_table = ($a[4] == null ? nil : $a[4]), goto_check = ($a[5] == null ? nil : $a[5]), goto_default = ($a[6] == null ? nil : $a[6]), goto_pointer = ($a[7] == null ? nil : $a[7]), nt_base = ($a[8] == null ? nil : $a[8]), reduce_table = ($a[9] == null ? nil : $a[9]), _ = ($a[10] == null ? nil : $a[10]), _ = ($a[11] == null ? nil : $a[11]), _ = ($a[12] == null ? nil : $a[12]), use_result = ($a[13] == null ? nil : $a[13]), $b; state = self.racc_state; vstack = self.racc_vstack; tstack = self.racc_tstack; i = $rb_times(act, -3); len = reduce_table['$[]'](i); reduce_to = reduce_table['$[]']($rb_plus(i, 1)); method_id = reduce_table['$[]']($rb_plus(i, 2)); void_array = []; if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { tmp_t = tstack['$[]'](len['$-@'](), len)}; tmp_v = vstack['$[]'](len['$-@'](), len); if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { tstack['$[]='](len['$-@'](), len, void_array)}; vstack['$[]='](len['$-@'](), len, void_array); state['$[]='](len['$-@'](), len, void_array); if (use_result !== false && use_result !== nil && use_result != null) { vstack.$push(self.$__send__(method_id, tmp_v, vstack, tmp_v['$[]'](0))) } else { vstack.$push(self.$__send__(method_id, tmp_v, vstack)) }; tstack.$push(reduce_to); if ((($a = self.yydebug) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$racc_reduce(tmp_t, reduce_to, tstack, vstack)}; k1 = $rb_minus(reduce_to, nt_base); if ((($a = i = goto_pointer['$[]'](k1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { i = $rb_plus(i, state['$[]'](-1)); if ((($a = ($b = ($c = $rb_ge(i, 0), $c !== false && $c !== nil && $c != null ?(curstate = goto_table['$[]'](i)) : $c), $b !== false && $b !== nil && $b != null ?goto_check['$[]'](i)['$=='](k1) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return curstate};}; return goto_default['$[]'](k1); }, TMP_14.$$arity = 2); Opal.defn(self, '$on_error', TMP_15 = function $$on_error(t, val, vstack) { var $a, self = this; return self.$raise($scope.get('ParseError'), self.$sprintf("\nparse error on value %s (%s)", val.$inspect(), ((($a = self.$token_to_str(t)) !== false && $a !== nil && $a != null) ? $a : "?"))); }, TMP_15.$$arity = 3); Opal.defn(self, '$yyerror', TMP_16 = function $$yyerror() { var self = this; return self.$throw("racc_jump", 1); }, TMP_16.$$arity = 0); Opal.defn(self, '$yyaccept', TMP_17 = function $$yyaccept() { var self = this; return self.$throw("racc_jump", 2); }, TMP_17.$$arity = 0); Opal.defn(self, '$yyerrok', TMP_18 = function $$yyerrok() { var self = this; return self.racc_error_status = 0; }, TMP_18.$$arity = 0); Opal.defn(self, '$racc_read_token', TMP_19 = function $$racc_read_token(t, tok, val) { var self = this; self.racc_debug_out.$print("read "); self.racc_debug_out.$print(tok.$inspect(), "(", self.$racc_token2str(t), ") "); self.racc_debug_out.$puts(val.$inspect()); return self.racc_debug_out.$puts(); }, TMP_19.$$arity = 3); Opal.defn(self, '$racc_shift', TMP_20 = function $$racc_shift(tok, tstack, vstack) { var self = this; self.racc_debug_out.$puts("shift " + (self.$racc_token2str(tok))); self.$racc_print_stacks(tstack, vstack); return self.racc_debug_out.$puts(); }, TMP_20.$$arity = 3); Opal.defn(self, '$racc_reduce', TMP_22 = function $$racc_reduce(toks, sim, tstack, vstack) { var $a, $b, TMP_21, self = this, out = nil; out = self.racc_debug_out; out.$print("reduce "); if ((($a = toks['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { out.$print(" ") } else { ($a = ($b = toks).$each, $a.$$p = (TMP_21 = function(t){var self = TMP_21.$$s || this; if (t == null) t = nil; return out.$print(" ", self.$racc_token2str(t))}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21), $a).call($b) }; out.$puts(" --> " + (self.$racc_token2str(sim))); self.$racc_print_stacks(tstack, vstack); return self.racc_debug_out.$puts(); }, TMP_22.$$arity = 4); Opal.defn(self, '$racc_accept', TMP_23 = function $$racc_accept() { var self = this; self.racc_debug_out.$puts("accept"); return self.racc_debug_out.$puts(); }, TMP_23.$$arity = 0); Opal.defn(self, '$racc_e_pop', TMP_24 = function $$racc_e_pop(state, tstack, vstack) { var self = this; self.racc_debug_out.$puts("error recovering mode: pop token"); self.$racc_print_states(state); self.$racc_print_stacks(tstack, vstack); return self.racc_debug_out.$puts(); }, TMP_24.$$arity = 3); Opal.defn(self, '$racc_next_state', TMP_25 = function $$racc_next_state(curstate, state) { var self = this; self.racc_debug_out.$puts("goto " + (curstate)); self.$racc_print_states(state); return self.racc_debug_out.$puts(); }, TMP_25.$$arity = 2); Opal.defn(self, '$racc_print_stacks', TMP_27 = function $$racc_print_stacks(t, v) { var $a, $b, TMP_26, self = this, out = nil; out = self.racc_debug_out; out.$print(" ["); ($a = ($b = t).$each_index, $a.$$p = (TMP_26 = function(i){var self = TMP_26.$$s || this; if (i == null) i = nil; return out.$print(" (", self.$racc_token2str(t['$[]'](i)), " ", v['$[]'](i).$inspect(), ")")}, TMP_26.$$s = self, TMP_26.$$arity = 1, TMP_26), $a).call($b); return out.$puts(" ]"); }, TMP_27.$$arity = 2); Opal.defn(self, '$racc_print_states', TMP_29 = function $$racc_print_states(s) { var $a, $b, TMP_28, self = this, out = nil; out = self.racc_debug_out; out.$print(" ["); ($a = ($b = s).$each, $a.$$p = (TMP_28 = function(st){var self = TMP_28.$$s || this; if (st == null) st = nil; return out.$print(" ", st)}, TMP_28.$$s = self, TMP_28.$$arity = 1, TMP_28), $a).call($b); return out.$puts(" ]"); }, TMP_29.$$arity = 1); Opal.defn(self, '$racc_token2str', TMP_30 = function $$racc_token2str(tok) { var $a, self = this; return ((($a = ((self.$class()).$$scope.get('Racc_token_to_s_table'))['$[]'](tok)) !== false && $a !== nil && $a != null) ? $a : self.$raise("[Racc Bug] can't convert token " + (tok) + " to string")); }, TMP_30.$$arity = 1); return (Opal.defn(self, '$token_to_str', TMP_31 = function $$token_to_str(t) { var self = this; return ((self.$class()).$$scope.get('Racc_token_to_s_table'))['$[]'](t); }, TMP_31.$$arity = 1), nil) && 'token_to_str'; })($scope.base, null); })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/parser/grammar"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash = Opal.hash, $range = Opal.range; Opal.add_stubs(['$require', '$new', '$each', '$empty?', '$[]=', '$to_i', '$+', '$split', '$new_compstmt', '$[]', '$new_block', '$<<', '$new_body', '$lex_state=', '$lexer', '$new_alias', '$s', '$to_sym', '$value', '$new_if', '$new_while', '$new_until', '$new_rescue_mod', '$new_op_asgn', '$op_to_setter', '$new_assign', '$new_unary_call', '$new_iter', '$new_call', '$new_js_call', '$new_super', '$new_yield', '$new_return', '$new_break', '$new_next', '$concat', '$children', '$new_assignable', '$new_js_attrasgn', '$new_attrasgn', '$new_colon2', '$new_colon3', '$new_const', '$new_sym', '$new_op_asgn1', '$raise', '$new_irange', '$new_erange', '$new_binary_call', '$new_int', '$new_float', '$include?', '$type', '$==', '$-@', '$to_f', '$new_and', '$new_or', '$cond_push', '$cond_pop', '$new_hash', '$add_block_pass', '$cmdarg_push', '$cmdarg_pop', '$new_block_pass', '$new_splat', '$line', '$new_nil', '$new_paren', '$new_array', '$new_method_call_with_block', '$new_class', '$new_sclass', '$new_module', '$push_scope', '$new_def', '$pop_scope', '$new_shadowarg', '$new_block_args', '$new_ident', '$new_optarg', '$new_restarg', '$push', '$intern', '$nil?', '$new_str', '$str_append', '$new_xstr', '$new_regexp', '$new_str_content', '$strterm', '$strterm=', '$new_evstr', '$cond_lexpop', '$cmdarg_lexpop', '$new_gvar', '$new_ivar', '$new_cvar', '$new_dsym', '$negate_num', '$new_self', '$new_true', '$new_false', '$new___FILE__', '$new___LINE__', '$new_var_ref', '$new_kwrestarg', '$new_kwoptarg', '$new_kwarg', '$new_args_tail', '$new_args', '$add_local', '$scope', '$insert', '$source', '$new_kwsplat']); self.$require("racc/parser.rb"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Parser(){}; var self = $Parser = $klass($base, $super, 'Parser', $Parser); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, $c, TMP_3, $d, TMP_5, $e, TMP_7, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51, TMP_52, TMP_53, TMP_54, TMP_55, TMP_56, TMP_57, TMP_58, TMP_59, TMP_60, TMP_61, TMP_62, TMP_63, TMP_64, TMP_65, TMP_66, TMP_67, TMP_68, TMP_69, TMP_70, TMP_71, TMP_72, TMP_73, TMP_74, TMP_75, TMP_76, TMP_77, TMP_78, TMP_79, TMP_80, TMP_81, TMP_82, TMP_83, TMP_84, TMP_85, TMP_86, TMP_87, TMP_88, TMP_89, TMP_90, TMP_91, TMP_92, TMP_93, TMP_94, TMP_95, TMP_96, TMP_97, TMP_98, TMP_99, TMP_100, TMP_101, TMP_102, TMP_103, TMP_104, TMP_105, TMP_106, TMP_107, TMP_108, TMP_109, TMP_110, TMP_111, TMP_112, TMP_113, TMP_114, TMP_115, TMP_116, TMP_117, TMP_118, TMP_119, TMP_120, TMP_121, TMP_122, TMP_123, TMP_124, TMP_125, TMP_126, TMP_127, TMP_128, TMP_129, TMP_130, TMP_131, TMP_132, TMP_133, TMP_134, TMP_135, TMP_136, TMP_137, TMP_138, TMP_139, TMP_140, TMP_141, TMP_142, TMP_143, TMP_144, TMP_145, TMP_146, TMP_147, TMP_148, TMP_149, TMP_150, TMP_151, TMP_152, TMP_153, TMP_154, TMP_155, TMP_156, TMP_157, TMP_158, TMP_159, TMP_160, TMP_161, TMP_162, TMP_163, TMP_164, TMP_165, TMP_166, TMP_167, TMP_168, TMP_169, TMP_170, TMP_171, TMP_172, TMP_173, TMP_174, TMP_175, TMP_176, TMP_177, TMP_178, TMP_179, TMP_180, TMP_181, TMP_182, TMP_183, TMP_184, TMP_185, TMP_186, TMP_187, TMP_188, TMP_189, TMP_190, TMP_191, TMP_192, TMP_193, TMP_194, TMP_195, TMP_196, TMP_197, TMP_198, TMP_199, TMP_200, TMP_201, TMP_202, TMP_203, TMP_204, TMP_205, TMP_206, TMP_207, TMP_208, TMP_209, TMP_210, TMP_211, TMP_212, TMP_213, TMP_214, TMP_215, TMP_216, TMP_217, TMP_218, TMP_219, TMP_220, TMP_221, TMP_222, TMP_223, TMP_224, TMP_225, TMP_226, TMP_227, TMP_228, TMP_229, TMP_230, TMP_231, TMP_232, TMP_233, TMP_234, TMP_235, TMP_236, TMP_237, TMP_238, TMP_239, TMP_240, TMP_241, TMP_242, TMP_243, TMP_244, TMP_245, TMP_246, TMP_247, TMP_248, TMP_249, TMP_250, TMP_251, TMP_252, TMP_253, TMP_254, TMP_255, TMP_256, TMP_257, TMP_258, TMP_259, TMP_260, TMP_261, TMP_262, TMP_263, TMP_264, TMP_265, TMP_266, TMP_267, TMP_268, TMP_269, TMP_270, TMP_271, TMP_272, TMP_273, TMP_274, TMP_275, TMP_276, TMP_277, TMP_278, TMP_279, TMP_280, TMP_281, TMP_282, TMP_283, TMP_284, TMP_285, TMP_286, TMP_287, TMP_288, TMP_289, TMP_290, TMP_291, TMP_292, TMP_293, TMP_294, TMP_295, TMP_296, TMP_297, TMP_298, TMP_299, TMP_300, TMP_301, TMP_302, TMP_303, TMP_304, TMP_305, TMP_306, TMP_307, TMP_308, TMP_309, TMP_310, TMP_311, TMP_312, TMP_313, TMP_314, TMP_315, TMP_316, TMP_317, TMP_318, TMP_319, TMP_320, TMP_321, TMP_322, TMP_323, TMP_324, TMP_325, TMP_326, TMP_327, TMP_328, TMP_329, TMP_330, TMP_331, TMP_332, TMP_333, TMP_334, TMP_335, TMP_336, TMP_337, TMP_338, TMP_339, TMP_340, TMP_341, TMP_342, TMP_343, TMP_344, TMP_345, TMP_346, TMP_347, TMP_348, TMP_349, TMP_350, TMP_351, TMP_352, TMP_353, TMP_354, TMP_355, TMP_356, TMP_357, TMP_358, TMP_359, TMP_360, TMP_361, TMP_362, TMP_363, TMP_364, TMP_365, TMP_366, TMP_367, TMP_368, TMP_369, TMP_370, TMP_371, TMP_372, TMP_373, TMP_374, TMP_375, TMP_376, TMP_377, TMP_378, TMP_379, TMP_380, TMP_381, TMP_382, TMP_383, TMP_384, TMP_385, TMP_386, TMP_387, TMP_388, TMP_389, TMP_390, TMP_391, TMP_392, TMP_393, TMP_394, TMP_395, TMP_396, TMP_397, TMP_398, TMP_399, TMP_400, TMP_401, TMP_402, TMP_403, TMP_404, TMP_405, TMP_406, TMP_407, TMP_408, TMP_409, TMP_410, clist = nil, racc_action_table = nil, arr = nil, idx = nil, racc_action_check = nil, racc_action_pointer = nil, racc_action_default = nil, racc_goto_table = nil, racc_goto_check = nil, racc_goto_pointer = nil, racc_goto_default = nil, racc_reduce_table = nil, racc_reduce_n = nil, racc_shift_n = nil, racc_token_table = nil, racc_nt_base = nil, racc_use_result_var = nil; clist = ["64,65,66,8,52,598,258,568,58,59,258,258,598,62,98,60,61,63,28,29,67", "68,-95,-477,-103,109,642,27,26,25,91,90,92,93,560,468,18,559,677,677", "-102,-87,7,42,6,9,95,94,85,51,87,86,88,-98,89,96,97,598,82,83,196,39", "40,-94,-100,-70,677,206,207,620,253,676,676,-95,-97,253,560,102,197", "562,206,207,101,37,598,-103,31,641,598,53,257,55,-95,33,257,257,-103", "41,74,676,-102,-82,206,207,-99,19,75,-87,-98,567,80,74,76,77,78,79,102", "198,597,75,81,101,-100,102,-87,597,-94,57,101,-94,54,64,65,66,673,52", "38,84,205,58,59,-97,-93,-87,62,-101,60,61,63,28,29,67,68,-87,311,-89", "835,247,27,26,25,91,90,92,93,-94,-91,18,102,-569,597,938,619,101,42", "-94,-88,95,94,85,51,87,86,88,546,89,96,97,-99,82,83,102,39,40,-93,102", "101,597,302,102,101,597,303,-95,101,-95,-90,-103,-95,-103,-570,-102", "-103,-102,211,311,-102,215,216,-98,53,-98,55,-101,-98,-465,630,400,41", "755,755,-89,-465,-100,-102,-100,19,560,-100,677,562,80,74,76,77,78,79", "-92,206,207,75,81,-97,-91,-97,755,-88,-97,57,403,-93,54,64,65,66,-569", "52,38,84,102,58,59,676,414,101,62,-90,60,61,63,28,29,67,68,-92,632,631", "628,801,27,26,25,91,90,92,93,-93,-89,220,-99,-570,-99,699,630,-99,42", "-93,427,95,94,85,51,87,86,88,467,89,96,97,-91,82,83,-88,39,40,228,102", "102,754,754,204,101,101,-89,-101,102,-101,469,-96,-101,101,-569,-90", "-89,630,211,206,207,215,-570,-92,53,102,55,754,-91,225,101,-88,41,227", "226,632,631,604,-91,605,219,-88,813,-94,795,80,74,76,77,78,79,-90,470", "-103,75,81,814,-468,907,-92,-477,-90,57,216,-468,54,64,65,66,-92,52", "38,84,-475,58,59,632,631,628,62,-475,60,61,63,28,29,67,68,560,-567,503", "562,-98,27,26,25,91,90,92,93,-87,516,220,249,250,518,-100,665,-96,42", "-95,251,95,94,85,51,87,86,88,274,89,96,97,630,82,83,520,39,40,228,232", "237,238,239,234,236,244,245,240,241,-468,-468,221,222,908,102,242,243", "-468,211,101,630,215,-567,635,53,228,55,-69,271,225,269,231,41,227,226", "223,224,235,233,229,219,230,-567,304,305,80,272,76,77,78,79,632,631", "633,75,81,225,246,546,-238,227,226,57,-97,-468,54,-468,275,341,-474", "528,38,84,64,65,66,-474,52,338,632,631,58,59,838,311,605,62,998,60,61", "63,28,29,67,68,412,413,529,-93,530,27,26,25,91,90,92,93,424,-102,220", "356,355,426,425,665,539,42,541,542,95,94,85,51,87,86,88,274,89,96,97", "630,82,83,262,39,40,228,232,237,238,239,234,236,244,245,240,241,339", "311,221,222,-473,253,242,243,341,211,630,-473,215,206,207,53,543,55", "338,271,225,269,231,41,227,226,223,224,235,233,229,219,230,206,207,547", "80,272,76,77,78,79,632,631,637,75,81,-470,246,652,356,355,-471,57,-470", "548,54,228,275,-471,-472,311,38,84,64,65,66,-472,52,632,631,643,58,59", "356,355,311,62,563,60,61,63,28,29,67,68,564,339,520,-89,571,27,26,25", "91,90,92,93,625,-98,220,203,201,102,653,626,574,42,101,202,95,94,85", "51,87,86,88,274,89,96,97,575,82,83,578,39,40,102,579,228,800,586,101", "348,346,345,586,347,348,346,345,102,347,581,-91,583,101,211,865,838", "215,865,838,53,-100,55,199,271,200,269,225,41,593,594,227,226,223,224", "416,219,-88,610,611,612,80,272,76,77,78,79,-97,636,640,75,81,-335,-335", "644,647,-264,649,57,650,-335,54,651,275,253,664,228,38,84,64,65,66,8", "52,748,228,228,58,59,930,228,311,62,688,60,61,63,28,29,67,68,104,105", "106,107,108,27,26,25,91,90,92,93,689,692,18,701,-335,-82,-335,702,7", "42,704,9,95,94,85,51,87,86,88,552,89,96,97,715,82,83,721,39,40,722,586", "311,348,346,345,586,347,348,346,345,341,347,897,898,724,729,899,96,97", "37,338,743,281,228,744,53,746,55,961,33,348,346,345,41,347,750,203,463", "589,605,758,19,797,350,464,592,80,74,76,77,78,79,356,355,225,75,81,-265", "227,226,223,224,503,57,503,503,54,64,65,66,816,52,38,84,817,58,59,824", "518,520,62,715,60,61,63,295,296,67,68,339,832,466,253,465,291,292,298", "91,90,92,93,253,833,220,538,535,253,715,228,228,293,838,536,95,94,85", "51,87,86,88,843,89,96,97,845,82,83,846,331,847,348,346,345,341,347,849", "538,549,104,105,106,107,108,338,550,586,578,348,346,345,289,347,852", "286,854,849,53,858,55,534,285,537,861,838,869,870,350,326,104,105,106", "107,108,353,352,356,355,80,74,76,77,78,79,589,872,873,75,81,-569,875", "592,466,884,465,57,578,887,54,64,65,66,889,52,299,84,891,58,59,893,895", "-266,62,339,60,61,63,295,296,67,68,910,911,311,913,914,291,292,298,91", "90,92,93,915,916,220,538,607,917,715,919,-264,293,923,608,95,94,85,51", "87,86,88,-570,89,96,97,932,82,83,933,331,935,348,346,345,341,347,941", "943,944,538,616,311,957,-267,338,963,586,614,348,346,345,289,347,849", "215,972,849,53,849,55,606,976,609,932,979,980,985,350,578,570,987,989", "991,993,353,352,356,355,80,74,76,77,78,79,589,993,1003,75,81,932,1011", "860,301,721,615,57,537,849,54,64,65,66,932,52,299,84,1026,58,59,1027", "993,993,62,339,60,61,63,295,296,67,68,993,1032,1033,993,,291,292,298", "91,90,92,93,,,220,538,616,,,,,42,,742,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,,586,,348,346,345,586,347,348,346,345,341,347,961,,348", "346,345,,347,211,338,,215,,,53,,55,615,,537,,,41,,,-288,-288,589,,,219", ",350,-288,,80,74,76,77,78,79,356,355,,75,81,,,,,,,57,,,54,64,65,66,", "52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,339,,-288,,-288,291,292", "298,91,90,92,93,,,220,538,616,,,,,42,,742,95,94,85,51,87,86,88,,89,96", "97,,82,83,,39,40,,586,,348,346,345,586,347,348,346,345,341,347,,,,,", ",,211,338,,215,,,53,,55,615,,537,,,41,,,-290,-290,589,,,219,,350,-290", ",80,74,76,77,78,79,356,355,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,", "58,59,,,,62,,60,61,63,295,296,67,68,339,,-290,,-290,291,292,298,91,90", "92,93,,,220,538,1001,,,,,42,,1002,95,94,85,51,87,86,88,,89,96,97,,82", "83,,39,40,,228,,,,,586,,348,346,345,341,347,,,,,,242,243,211,338,,215", ",,53,,55,1000,,609,225,,41,,227,226,223,224,,,219,,350,,,80,74,76,77", "78,79,356,355,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,28,29,67,68,339,,,,,27,26,25,91,90,92,93,,,18,,586,,348,346", "345,42,347,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,586,,348", "346,345,586,347,348,346,345,341,347,589,,,,242,243,,211,338,,215,,,53", ",55,,,225,,231,41,227,226,223,224,589,,229,19,230,350,,,80,74,76,77", "78,79,356,355,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,28,29,67,68,339,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,228,232,237,238,239,234", "236,244,245,240,241,-287,-287,221,222,,,242,243,-287,211,,,215,-570", ",53,,55,,271,225,,231,41,227,226,223,224,235,233,229,219,230,,,,80,272", "76,77,78,79,,,,75,81,,246,818,,,,57,,-287,54,-287,275,,,,38,84,64,65", "66,,52,,,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90", "92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39", "40,228,232,237,238,239,234,236,244,245,240,241,,,221,222,,,242,243,", "211,,,215,,,53,,55,,,225,,231,41,227,226,223,224,235,233,229,219,230", ",,,80,272,76,77,78,79,,,,75,81,,246,,,,,57,,,54,,275,,,,38,84,64,65", "66,,52,,,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93", ",,18,,586,,348,346,345,42,347,,95,94,85,51,87,86,88,,89,96,97,,82,83", ",39,40,228,,,,,,586,,348,346,345,341,347,589,,,,242,243,,211,338,,215", ",,53,,55,,,225,,231,41,227,226,223,224,,,229,19,230,350,,,80,74,76,77", "78,79,356,355,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,28,29,67,68,339,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,,,,,,586,,348,346,345", "341,347,,,,,242,243,,211,338,,215,,,53,,55,,,225,,231,41,227,226,223", "224,,,229,19,230,350,,,80,74,76,77,78,79,356,355,,75,81,,,,,,,57,,,54", "64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,339,,,,,27,26", "25,91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83", ",39,40,228,,,,,,586,,348,346,345,341,347,,,,,242,243,,211,338,,215,", ",53,,55,,,225,,231,41,227,226,223,224,,,229,19,230,350,,,80,74,76,77", "78,79,356,355,,75,81,102,,,,,101,57,,,54,64,65,66,,52,38,84,,58,59,", ",,62,,60,61,63,295,296,67,68,339,,,,,291,292,298,91,90,92,93,,,220,", ",,,,,293,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,331,,348,346,345,341", "347,,,,,,,,,338,,,,,,,368,,,31,,,53,,55,,33,,,,,,350,,,,,,,353,352,356", "355,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,299,84,,58", "59,,,,62,339,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220", ",,,,,,293,,,95,94,85,51,87,86,373,,89,96,97,228,82,83,,331,,348,346", "345,341,347,,,,,,,242,243,338,,,,379,,,374,,,215,,225,53,231,55,227", "226,223,224,,,,350,,,,,,,353,352,356,355,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,-566,-566,-566,,-566,299,84,,-566,-566,,,,-566,339,-566", "-566,-566,-566,-566,-566,-566,,-566,,,,-566,-566,-566,-566,-566,-566", "-566,,,-566,,,,,,,-566,,,-566,-566,-566,-566,-566,-566,-566,-566,-566", "-566,-566,,-566,-566,,-566,-566,228,232,237,238,239,234,236,244,245", "240,241,,,221,222,,,242,243,,-566,,,-566,-566,,-566,,-566,,-566,225", "-566,231,-566,227,226,223,224,235,233,229,-566,230,-566,,,-566,-566", "-566,-566,-566,-566,,,,-566,-566,,246,,,,,-566,,,-566,,-566,,,,-566", "-566,-567,-567,-567,,-567,,,,-567,-567,,,,-567,,-567,-567,-567,-567", "-567,-567,-567,,-567,,,,-567,-567,-567,-567,-567,-567,-567,,,-567,,", ",,,,-567,,,-567,-567,-567,-567,-567,-567,-567,-567,-567,-567,-567,,-567", "-567,,-567,-567,228,232,237,238,239,234,236,244,245,240,241,,,221,222", ",,242,243,,-567,,,-567,-567,,-567,,-567,,-567,225,-567,231,-567,227", "226,223,224,235,233,229,-567,230,-567,,,-567,-567,-567,-567,-567,-567", ",,,-567,-567,,246,,,,,-567,,,-567,,-567,,,,-567,-567,64,65,66,8,52,", ",,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,", ",,,,7,42,6,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,,,,,,586", ",348,346,345,341,347,,,,,242,243,,37,338,,31,,,53,,55,,33,225,,231,41", "227,226,223,224,,,,19,,350,,,80,74,76,77,78,79,356,355,,75,81,,,,,,416", "57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,339,,", ",,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,,,,,,,586,,348,346,345,341,347,,,,,,,,211,338,,215,,,53", ",55,,,,,,41,,,,,,,,19,,350,,,80,74,76,77,78,79,356,355,,75,81,,,,,,", "57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,339,,", ",,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,228,232,237,238,239,234,236,244,245,240,241,,,221,222", ",,242,243,,211,,,215,,,53,,55,,,225,,231,41,227,226,223,224,235,233", "229,19,230,,,,80,74,76,77,78,79,,,,75,81,,246,,,,,57,,,54,64,65,66,", "52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93", ",,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,232", "237,238,239,234,236,244,245,240,241,,,221,222,,,242,243,,211,,,215,", ",53,,55,,,225,,231,41,227,226,223,224,235,233,229,19,230,,,,80,74,76", "77,78,79,,,,75,81,,246,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,228,232,237,238,239,234,236,244", "245,240,241,,,221,222,,,242,243,,211,,,215,,,53,,55,,,225,,231,41,227", "226,223,224,235,233,229,19,230,,,,80,74,76,77,78,79,,,,75,81,,246,,", ",,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,", ",,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96", "97,,82,83,,39,40,228,232,237,238,239,234,236,244,245,240,241,,,221,222", ",,242,243,,37,,,31,,,53,,55,,33,225,,231,41,227,226,223,224,235,233", "229,19,230,,,,80,74,76,77,78,79,,,,75,81,,246,,,,,57,,,54,64,65,66,8", "52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93", ",,18,,,,,,7,42,6,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228", "232,237,238,239,234,236,244,245,240,241,,,221,222,,,242,243,,37,,,31", ",,53,,55,,33,225,,231,41,227,226,223,224,235,233,229,19,230,,,,80,74", "76,77,78,79,,,,75,81,,246,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,", "62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9", "95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,232,237,238,239,234", "236,244,245,240,241,,,221,222,,,242,243,,37,,,31,,,53,,55,,33,225,,231", "41,227,226,223,224,235,233,229,19,230,,,,80,74,76,77,78,79,,,,75,81", ",246,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67", "68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,", "89,96,97,,82,83,,39,40,228,232,237,238,239,234,236,244,245,240,241,", ",221,222,,,242,243,,211,,,215,,,53,,55,,432,225,,231,41,227,226,223", "224,235,233,229,219,230,,,,80,74,76,77,78,79,,,,75,81,,246,,,,,57,,", "54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26", "25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83", ",39,40,228,232,237,238,239,234,236,244,245,240,241,,,221,222,,,242,243", ",211,,,215,,,53,,55,,,225,,231,41,227,226,223,224,235,233,229,219,230", ",,,80,74,76,77,78,79,,,,75,81,,246,,,,,57,,,54,64,65,66,,52,38,84,,58", "59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,", ",42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,228,232,237,238", "239,234,236,244,245,240,241,,,221,222,,,242,243,,211,,,215,,,53,,55", ",271,225,,231,41,227,226,223,224,235,233,229,219,230,,,,80,272,76,77", "78,79,,,,75,81,,246,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58,59", ",,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42", ",,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,228,232,237,238,239", "234,236,244,245,240,241,,,221,222,,,242,243,,211,,,215,,,53,,55,,271", "225,,231,41,227,226,223,224,235,233,229,219,230,,,,80,272,76,77,78,79", ",,,75,81,,246,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58,59,,,,62", ",60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,232,237,238,239,234,236", "244,245,240,241,,,221,222,,,242,243,,211,,,215,,,53,,55,,,225,,231,41", "227,226,223,224,235,233,229,219,230,,,,80,74,76,77,78,79,,,,75,81,,246", ",,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,", ",,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96", "97,,82,83,,39,40,228,232,237,238,239,234,236,244,245,240,241,,,-590", "-590,,,242,243,,211,,,215,,,53,,55,,432,225,,231,41,227,226,223,224", "235,233,229,219,230,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65", "66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90", "92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228", "232,237,238,239,234,236,244,245,240,241,,,-590,-590,,,242,243,,211,", ",215,,,53,,55,,,225,,231,41,227,226,223,224,235,233,229,19,230,,,,80", "74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62", ",60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,228,-590,-590,-590,-590,234,236", ",,-590,-590,,,,,,,242,243,,211,,,215,,,53,,55,,,225,,231,41,227,226", "223,224,235,233,229,19,230,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,", "54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26", "25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82", "83,,39,40,228,-590,-590,-590,-590,234,236,,,-590,-590,,,,,,,242,243", ",37,,,31,,,53,,55,,33,225,,231,41,227,226,223,224,235,233,229,19,230", ",,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59", ",,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42", ",,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,-590,-590,-590,-590", "234,236,,,-590,-590,,,,,,,242,243,,211,,,215,,472,53,,55,,,225,,231", "41,227,226,223,224,235,233,229,19,230,,,,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68", ",,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,", "89,96,97,,82,83,,39,40,228,-590,-590,-590,-590,234,236,,,-590,-590,", ",,,,,242,243,,211,,,215,,,53,,55,,,225,,231,41,227,226,223,224,235,233", "229,219,230,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228", "-590,-590,-590,-590,234,236,,,-590,-590,,,,,,,242,243,,211,,,215,,,53", ",55,,,225,,231,41,227,226,223,224,235,233,229,219,230,,,,80,74,76,77", "78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61", "63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,228,-590,-590,-590,-590,234,236", ",,-590,-590,,,,,,,242,243,,211,,,215,,,53,,55,,,225,,231,41,227,226", "223,224,235,233,229,219,230,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,", ",54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291", "292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,228,232,237,238,239,234,236,,,240,241,,,,,,,242,243,,211", ",,215,,,53,,55,,,225,,231,41,227,226,223,224,235,233,229,219,230,,,", "80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,", ",,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,", ",,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,228,232,237,238", "239,234,236,244,,240,241,,,,,,,242,243,,211,,,215,,,53,,55,,,225,,231", "41,227,226,223,224,235,233,229,219,230,,,,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68", ",,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,", "89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41", ",,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,", "27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96", "97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,271,,269,,41", ",,,,,,,219,,,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38", "84,64,65,66,,52,,,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91", "90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,", "39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,271,,269,,41,,,,,,,,219", ",,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66", ",52,,,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,", ",220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,,", ",,,,,,,,,,,,,,,,211,,,215,,514,53,,55,,271,,269,,41,,,,,,,,219,,,,,80", "272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,", ",58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,", "220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,", ",,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63", "295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85", "51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,", "53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,", "54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291", "292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,", "219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84", ",58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,", "220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,", ",,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63", "28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51", "87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,281,,,53,", "55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54", "64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292", "298,91,90,92,93,,,220,,,,,,,293,,,95,94,85,51,87,86,88,,89,96,97,,82", "83,,789,,348,346,345,341,347,,,,,,,,,338,,,,,,,289,,,215,,,53,,55,,", ",,,,,350,778,,,,,,353,352,356,355,80,74,76,77,78,79,,,,75,81,,,,532", ",,57,,,54,64,65,66,8,52,299,84,,58,59,,,,62,339,60,61,63,28,29,67,68", ",,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,281,,,53,,55,,33,,,,41", ",,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,293,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,331,,348", "346,345,341,347,,,,,,,,,338,,,,,,,289,,,286,,,53,,55,,,,,,,,350,,,,", ",,353,352,356,355,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66", "311,52,299,84,,58,59,,,,62,339,60,61,63,295,296,67,68,,,,,,291,292,298", "91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,", "39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,552,,53,,55,,,,,,41,,,,,,,,219,", ",,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58", "59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7", "42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,", ",,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75", "81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67", "68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,293,,,95,94,85,51,87,86", "88,,89,96,97,,82,83,,789,,348,346,345,341,347,,,,,,,,,338,,,,,,,585", ",,215,,,53,,55,,,,,,,,350,,,,,,,353,352,356,355,80,74,76,77,78,79,,", ",75,81,,,,,,,57,,,54,64,65,66,,52,299,84,,58,59,,,,62,339,60,61,63,28", "29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86", "88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,", ",,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66", ",52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92", "93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,", ",,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,19,,,,,80,74,76,77", "78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61", "63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,293,,,95,94", "85,51,87,86,373,,89,96,97,,82,83,,331,,348,346,345,341,347,,,,,,,,,338", ",,,,,,374,,,215,,,53,,55,,,,,,,,350,,,,,,,353,352,356,355,80,74,76,77", "78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,299,84,,58,59,,,,62,339,60", "61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94,85", "51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,", "53,,55,,,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54", "64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292", "298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82", "83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219", ",,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,-571,-571,-571,,-571,38", "84,,-571,-571,,,,-571,,-571,-571,-571,-571,-571,-571,-571,,,,,,-571", "-571,-571,-571,-571,-571,-571,,,-571,,,,,,,-571,,,-571,-571,-571,-571", "-571,-571,-571,-571,-571,-571,-571,,-571,-571,,-571,-571,,,,,,,,,,,", ",,,,,,,,,-571,,,-571,-571,,-571,,-571,,-571,,-571,,-571,,,,,,,,-571", ",,,,-571,-571,-571,-571,-571,-571,,,,-571,-571,,,,,,,-571,,,-571,,-571", ",,,-571,-571,-572,-572,-572,,-572,,,,-572,-572,,,,-572,,-572,-572,-572", "-572,-572,-572,-572,,,,,,-572,-572,-572,-572,-572,-572,-572,,,-572,", ",,,,,-572,,,-572,-572,-572,-572,-572,-572,-572,-572,-572,-572,-572,", "-572,-572,,-572,-572,,,,,,,,,,,,,,,,,,,,,-572,,,-572,-572,,-572,,-572", ",-572,,-572,,-572,,,,,,,,-572,,,,,-572,-572,-572,-572,-572,-572,,,,-572", "-572,,,,,,,-572,,,-572,,-572,,,,-572,-572,64,65,66,,52,,,,58,59,,,,62", ",60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211", ",,215,,,53,,55,,271,,,,41,,,,,,,,219,,,,,80,272,76,77,78,79,,,,75,81", ",,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58,59,,,,62,,60,61,63,28", "29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86", "88,274,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55", ",271,,,,41,,,,,,,,219,,,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54", ",275,,,,38,84,64,65,66,,52,,,,58,59,,,,62,,60,61,63,295,296,67,68,,", ",,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40", ",,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,696,,269,,41,,,,,,,,219,,,,", "80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,,52", ",,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93", ",,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,269,,41,,,,,,,,219,,,,,80,272", "76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58", "59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220", ",,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,", ",,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79", ",,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28", "29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87", "86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,", "33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,416,57,,,54,64", "65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298", "91,90,92,93,,,220,,,,,,,293,,,95,94,85,51,87,86,88,,89,96,97,,82,83", ",789,,348,346,345,341,347,,,,,,,,,338,,,,,,,289,,,286,,,53,,55,,,,,", ",,350,,,,,,,353,352,356,355,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54", "64,65,66,,52,299,84,,58,59,,,,62,339,60,61,63,28,29,67,68,,,,,,27,26", "25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82", "83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,271,,,,41,,,,,,,,219", ",,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66", ",52,,,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,", ",220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,,", ",,,,,,,,,,,,,,,,211,,,215,,,53,,55,,271,,,,41,,,,,,,,219,,,,,80,272", "76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58", "59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220", ",,,,,,293,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,789,,348,346,345", "341,347,,,,,,,,,338,,,,,,,289,,,286,,,53,,55,,,,,,,,350,,,,,,,353,352", "356,355,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,299,84", ",58,59,,,,62,339,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93", ",,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,", ",,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77", "78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61", "63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215", ",,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57", ",,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291", "292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,", "219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84", ",58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,", ",,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,", ",,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,", "75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296", "67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86", "88,274,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55", ",696,,269,,41,,,,,,,,219,,,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,", "54,,275,,,,38,84,64,65,66,,52,,,,58,59,,,,62,,60,61,63,295,296,67,68", ",,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274", "89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41", ",,,,,,,219,,,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38", "84,64,65,66,8,52,,,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25", "91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83", ",39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,", "80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59", ",,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42", ",9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,", "37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68", ",,,,,291,292,298,91,90,92,93,,,220,,,,,,,293,,,95,94,85,51,87,86,88", ",89,96,97,,82,83,,789,,348,346,345,341,347,,,,,,,,,338,,,,,,,585,,,215", ",,53,,55,,,,,,,,350,778,,,,,,353,352,356,355,80,74,76,77,78,79,,,,75", "81,,,,,,,57,,,54,64,65,66,8,52,299,84,,58,59,,,,62,339,60,61,63,28,29", "67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86", "88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33", ",,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66", "8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92", "93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,", ",,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60", "61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,", ",53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57", ",,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26", "25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82", "83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,271,,,,41,,,,,,,,219", ",,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66", ",52,,,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,", ",220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,,", ",,,,,,,,,,,,,,,,211,,,215,,,53,,55,,271,,,,41,,,,,,,,219,,,,,80,272", "76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58", "59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,", ",42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,", ",,,,,,211,,,215,,,53,,55,,271,,,,41,,,,,,,,219,,,,,80,272,76,77,78,79", ",,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,,52,,,,58,59,,,,62,,60", "61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94,85", "51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,", "53,,55,,,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54", "64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25", "91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39", "40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,19,,,,,80,74", "76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,", ",95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211", ",,215,,,53,,55,,799,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68", ",,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,", ",220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,", ",,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63", "28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87", "86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55", ",,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65", "66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91", "90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39", "40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80", "74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62", ",60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,", ",,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52", "38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,", ",18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,", ",,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63", "28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51", "87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55", ",33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64", "65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298", "91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83", ",39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,696,,269,,41,,,,,,,,219", ",,,,80,272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66", ",52,,,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40", ",,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,269,,41,,,,,,,,219,,,,,80", "272,76,77,78,79,,,,75,81,,,,,,,57,,,54,,275,,,,38,84,64,65,66,8,52,", ",,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,", ",,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,", ",,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79", ",,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28", "29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87", "86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,", "33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65", "66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91", "90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39", "40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80", "74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62", ",60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42", ",,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211", ",,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,", ",,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,", ",,,,291,292,298,91,90,92,93,,,220,,,,,,,293,,,95,94,85,51,87,86,88,", "89,96,97,,82,83,,789,,348,346,345,341,347,,,,,,,,,338,,,,,,,289,,,286", ",,53,,55,,,,,,,,350,,,,,,,353,352,356,355,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,,52,299,84,,58,59,,,,62,339,60,61,63,295,296", "67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,293,,,95,94,85,51,87", "86,88,,89,96,97,,82,83,,,,,,,,,,,,,,,,,,,,,,,,289,,,286,,,53,,55,,,", ",,,,,,,,,,,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "299,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,432,,,,41,,,,,,,,219,,,,,80,74", "76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,", ",95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211", ",,215,,,53,,55,,271,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68", ",,,,,27,26,25,91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96", "97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,", ",,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38", "84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18", ",,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,", ",,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79", ",,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28", "29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87", "86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,", "33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65", "66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90", "92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40", ",,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60", "61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95", "94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,", "215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,", ",57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,", ",27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96", "97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,", ",,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84", ",58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,", "220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,", ",,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63", "28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87", "86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55", ",,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65", "66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90", "92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40", ",,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74", "76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,", "60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,", ",95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211", ",,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,", ",,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,", ",,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,", ",,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52", "38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92", "93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,", ",,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76", "77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60", "61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,", ",53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57", ",,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26", "25,91,90,92,93,,,18,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83", ",39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,19,,,,", "80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59", ",,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42", ",9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,", "37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81", ",,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68", ",,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89", "96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,", ",,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38", "84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93", ",,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,", ",,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77", "78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61", "63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94", "85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215", ",,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57", ",,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291", "292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97", ",82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,", "219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84", ",58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90,92,93,,", "220,,,,,,,42,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,", ",,,,,,,,,,,,211,,,215,,,53,,55,,,,,,41,,,,,,,,219,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,,,,62,,60,61,63", "295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85", "51,87,86,88,274,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215", ",,53,,55,,,,269,,41,,,,,,,,219,,,,,80,272,76,77,78,79,,,,75,81,,,,,", ",57,,,54,,275,,,,38,84,64,65,66,8,52,,,,58,59,,,,62,,60,61,63,28,29", "67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86", "88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33", ",,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66", ",52,38,84,,58,59,,,,62,,60,61,63,295,296,67,68,,,,,,291,292,298,91,90", "92,93,,,220,,,,,,,293,,,95,94,85,51,87,86,88,,89,96,97,,82,83,,,,,,", ",,,,,,,,,,,,,,,,,968,,,215,,,53,,55,,,,,,,,,,,,,,,,,,,80,74,76,77,78", "79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,299,84,,58,59,,,,62,,60,61,63", "295,296,67,68,,,,,,291,292,298,91,90,92,93,,,220,,,,,,,42,,,95,94,85", "51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,211,,,215,,", "53,,55,,696,,,,41,,,,,,,,219,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57", ",,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27", "26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,", "82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19", ",,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58", "59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7", "42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,", ",,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75", "81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67", "68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88", ",89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,", "41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8", "52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93", ",,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83,,39,40,,,,,", ",,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77", "78,79,,,,75,81,,,,,,,57,,,54,64,65,66,8,52,38,84,,58,59,,,,62,,60,61", "63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,18,,,,,,7,42,,9,95,94,85", "51,87,86,88,,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53", ",55,,33,,,,41,,,,,,,,19,,,,,80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54", "64,65,66,8,52,38,84,,58,59,,,,62,,60,61,63,28,29,67,68,,,,,,27,26,25", "91,90,92,93,,,18,,,,,,7,42,,9,95,94,85,51,87,86,88,,89,96,97,,82,83", ",39,40,,,,,,,,,,,,,,,,,,,,,37,,,31,,,53,,55,,33,,,,41,,,,,,,,19,,,,", "80,74,76,77,78,79,,,,75,81,,,,,,,57,,,54,64,65,66,,52,38,84,,58,59,", ",,62,,60,61,63,28,29,67,68,,,,,,27,26,25,91,90,92,93,,,220,,,,,,,42", ",,95,94,85,51,87,86,88,274,89,96,97,,82,83,,39,40,,,,,,,,,,,,,,,,,,", ",,211,,,215,,,53,,55,,271,,,,41,,,,,,,,219,,,,-573,80,272,76,77,78,79", "-573,-573,-573,75,81,,-573,-573,,-573,,57,,,54,,275,,-573,,38,84,,,", ",,,,-573,-573,,-573,-573,-573,-573,-573,,,,,,,,,,,,,,,,,,,,,,-573,-573", "-573,-573,-573,-573,-573,-573,-573,-573,-573,-573,-573,-573,-573,,,-573", "-573,-573,,658,,,,-573,,,,,,-573,,-573,,-573,-573,-573,-573,-573,-573", "-573,,-573,-573,-573,,,,,,,,,,,,,-573,-573,,-90,,-573,,-287,-573,,-573", ",,-99,-287,-287,-287,,,,-287,-287,,-287,,,,,,,,,,,,,,,,,,,,-287,-287", ",-287,-287,-287,-287,-287,,,,,,,,,,,,,,,,,,,,,,-287,-287,-287,-287,-287", "-287,-287,-287,-287,-287,-287,-287,-287,-287,-287,,,-287,-287,-287,", "661,,,,-287,,,,,,-287,,-287,,-287,-287,-287,-287,-287,-287,-287,,-287", ",-287,,,,,,,,,,,,,-287,-287,,-92,,-287,,-573,-287,,-287,,,-101,-573", "-573,-573,,,-573,-573,-573,,-573,,,,,,,,,-573,-573,-573,,,,,,,,,-573", "-573,,-573,-573,-573,-573,-573,,,,,,,,,,,,,,,,,,,,,,-573,-573,-573,-573", "-573,-573,-573,-573,-573,-573,-573,-573,-573,-573,-573,,,-573,-573,-573", ",815,-573,,,-573,,-573,,-573,,-573,,-573,,-573,-573,-573,-573,-573,-573", "-573,,-573,-573,-573,,,,,,,,,,,,,-573,-573,-573,-573,,-573,,-287,-573", ",-573,,,-99,-287,-287,-287,,,-287,-287,-287,,-287,,,,,,,,,,-287,-287", ",,,,,,,,-287,-287,,-287,-287,-287,-287,-287,,,,,,,,,,,,,,,,,,,,,,-287", "-287,-287,-287,-287,-287,-287,-287,-287,-287,-287,-287,-287,-287,-287", ",,-287,-287,-287,,661,-287,,,-287,,-287,,-287,,-287,,-287,,-287,-287", "-287,-287,-287,-287,-287,,-287,,-287,,,,,,,,,,,,,-287,-287,-287,-287", ",-287,,-401,-287,,-287,,,-101,-401,-401,-401,,,-401,-401,-401,,-401", ",,,,,,,,-401,-401,-401,,,,,,,,,-401,-401,,-401,-401,-401,-401,-401,", ",,,,,,,,,,,,,,,,,,,,-401,-401,-401,-401,-401,-401,-401,-401,-401,-401", "-401,-401,-401,-401,-401,,,-401,-401,-401,,,-401,,253,-401,,-401,,-401", ",-401,,-401,,-401,-401,-401,-401,-401,-401,-401,,-401,-401,-401,,,,", ",,,,,,,,-401,-401,-401,-401,-296,-401,,,-401,,-401,-296,-296,-296,,", "-296,-296,-296,,-296,,,,,,,,,,-296,-296,,,,,,,,,-296,-296,,-296,-296", "-296,-296,-296,,,,,,,,,,,,,,,,,,,,,,-296,-296,-296,-296,-296,-296,-296", "-296,-296,-296,-296,-296,-296,-296,-296,,,-296,-296,-296,,,-296,,262", "-296,,-296,,-296,,-296,,-296,,-296,-296,-296,-296,-296,-296,-296,,-296", ",-296,,,,,,,,,,,,,-296,-296,-296,-296,-279,-296,,,-296,,-296,-279,-279", "-279,,,-279,-279,-279,,-279,,,,,,,,,,-279,-279,-279,,,,,,,,-279,-279", ",-279,-279,-279,-279,-279,,,,,,,,,,,,,,,,,,,,,,-279,-279,-279,-279,-279", "-279,-279,-279,-279,-279,-279,-279,-279,-279,-279,,,-279,-279,-279,", ",-279,,,-279,,-279,,-279,,-279,,-279,,-279,-279,-279,-279,-279,-279", "-279,,-279,,-279,,,,,,,,,,,,,-279,-279,-279,-279,-589,-279,,-279,-279", ",-279,-589,-589,-589,,,-589,-589,-589,,-589,,,,,,,,,-589,-589,-589,", ",,,,,,,-589,-589,,-589,-589,-589,-589,-589,,,,,,,,,,,,,,,,,,,,,,-589", "-589,-589,-589,-589,-589,-589,-589,-589,-589,-589,-589,-589,-589,-589", ",,-589,-589,-589,,,-589,,253,-589,,-589,,-589,,-589,,-589,,-589,-589", "-589,-589,-589,-589,-589,,-589,-589,-589,,,,,,,,,,,,,-589,-589,-589", "-589,-589,-589,,,-589,,-589,-589,-589,-589,,,-589,-589,-589,,-589,,", ",,,,,,-589,-589,-589,,,,,,,,,-589,-589,,-589,-589,-589,-589,-589,,,", ",,,,,,,,,,,,,,,,,,-589,-589,-589,-589,-589,-589,-589,-589,-589,-589", "-589,-589,-589,-589,-589,,,-589,-589,-589,,,-589,,253,-589,,-589,,-589", ",-589,,-589,,-589,-589,-589,-589,-589,-589,-589,,-589,-589,-589,,,,", ",,,,,,,,-589,-589,-589,-589,-589,-589,,,-589,,-589,-589,-589,-589,,", "-589,-589,-589,,-589,,,,,,,,,,-589,,,,,,,,,,-589,-589,,-589,-589,-589", "-589,-589,,,,,,,,,,,,-589,,,,,,,-589,-589,-589,,,-589,-589,-589,,-589", ",,,,-589,-589,,,,-589,,,-589,,,,,253,-589,-589,-589,,-589,-589,-589", "-589,-589,,,,,,,,,,,,-589,,,,,,,,,,,,,-589,,-589,,,-589,,,-589,-589", ",-589,,,,,-589,,-589,-589,-589,253,-589,-589,-589,-589,,-589,,,,,,,", ",,-589,,,,,-589,,,,,-589,-589,,-589,-589,-589,-589,-589,-589,,-589,", ",-589,444,448,,,446,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125", "126,-589,-589,,,145,146,132,133,-589,,,,,253,-589,,,,,137,136,,121,142", "139,138,134,135,129,127,119,141,120,,-589,147,,,,,,,,,,,,-589,,-589", ",,-589,157,168,158,181,154,174,164,163,189,192,179,162,161,156,182,190", "191,166,155,169,173,175,167,160,,,,176,183,178,177,170,180,165,153,172", "171,184,185,186,187,188,152,159,150,151,148,149,112,114,111,,113,,,", ",,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145,146,132,133", ",,,,,,,,,,,137,136,,121,142,139,138,134,135,129,127,119,141,120,,,147", "193,,,,,,,,,,81,157,168,158,181,154,174,164,163,189,192,179,162,161", "156,182,190,191,166,155,169,173,175,167,160,,,,176,183,178,177,170,180", "165,153,172,171,184,185,186,187,188,152,159,150,151,148,149,112,114", ",,113,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145", "146,132,133,,,,,,,,,,,,137,136,,121,142,139,138,134,135,129,127,119", "141,120,,,147,193,,,,,,,,,,81,157,168,158,181,154,174,164,163,189,192", "179,162,161,156,182,190,191,166,155,169,173,175,167,160,,,,176,183,178", "177,170,180,165,153,172,171,184,185,186,187,188,152,159,150,151,148", "149,112,114,,,113,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125", "126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139,138,134,135", "129,127,119,141,120,,,147,193,,,,,,,,,,81,157,168,158,181,154,174,164", "163,189,192,179,162,161,156,182,190,191,166,155,169,173,175,167,160", ",,,176,183,178,177,170,180,165,153,172,171,184,185,186,187,188,152,159", "150,151,148,149,112,114,,,113,,,,,,,,,143,144,140,122,123,124,131,128", "130,,,125,126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139,138", "134,135,129,127,119,141,120,,,147,193,,,,,,,,,,81,157,168,158,181,154", "174,164,163,189,192,179,162,161,156,182,190,191,166,155,169,173,175", "167,160,,,,176,183,178,388,387,389,386,153,172,171,184,185,186,187,188", "152,159,150,151,384,385,382,114,87,86,383,,89,,,,,,,143,144,140,122", "123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,393,,,,,,137", "136,,121,142,139,138,134,135,129,127,119,141,120,,,147,157,168,158,181", "154,174,164,163,189,192,179,162,161,156,182,190,191,166,155,169,173", "175,167,160,,,,176,183,178,177,170,180,165,153,172,171,184,185,186,187", "188,152,159,150,151,148,149,112,114,410,409,113,,411,,,,,,,143,144,140", "122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,,,137", "136,,121,142,139,138,134,135,129,127,119,141,120,,,147,157,168,158,181", "154,174,164,163,189,192,179,162,161,156,182,190,191,166,155,169,173", "175,167,160,,,,176,183,178,177,170,180,165,153,172,171,184,185,186,187", "188,152,159,150,151,148,149,112,114,410,409,113,,411,,,,,,,143,144,140", "122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,,,137", "136,,121,142,139,138,134,135,129,127,119,141,120,,,147,157,168,158,181", "154,174,164,163,189,192,179,162,161,156,182,190,191,166,155,169,173", "175,167,160,,,,176,183,178,177,170,180,165,153,172,171,184,185,186,187", "188,152,159,150,151,148,149,112,114,,,113,,,,,,,,,143,144,140,122,123", "124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121", "142,139,138,134,135,129,127,119,141,120,438,442,147,,439,,,,,,,,,143", "144,140,122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,253", ",,,,,137,136,,121,142,139,138,134,135,129,127,119,141,120,451,442,147", ",452,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145,146", "132,133,,,,,,,,,,,,137,136,,121,142,139,138,134,135,129,127,119,141", "120,451,442,147,,452,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125", "126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139,138,134,135", "129,127,119,141,120,451,442,147,,452,,,,,,,,,143,144,140,122,123,124", "131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142", "139,138,134,135,129,127,119,141,120,451,442,147,,452,,,,,,,,,143,144", "140,122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,", ",137,136,,121,142,139,138,134,135,129,127,119,141,120,666,442,147,,667", ",,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145,146,132", "133,,,,,,253,,,,,,137,136,,121,142,139,138,134,135,129,127,119,141,120", "668,448,147,,669,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126", ",,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139,138,134,135,129", "127,119,141,120,706,442,147,,707,,,,,,,,,143,144,140,122,123,124,131", "128,130,,,125,126,,,,,145,146,132,133,,,,,,253,,,,,,137,136,,121,142", "139,138,134,135,129,127,119,141,120,709,448,147,,710,,,,,,,,,143,144", "140,122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,", ",137,136,,121,142,139,138,134,135,129,127,119,141,120,451,442,147,,452", ",,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145,146,132", "133,,,,,,,,,,,,137,136,,121,142,139,138,134,135,129,127,119,141,120", "666,442,147,,667,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126", ",,,,145,146,132,133,,,,,,253,,,,,,137,136,,121,142,139,138,134,135,129", "127,119,141,120,668,448,147,,669,,,,,,,,,143,144,140,122,123,124,131", "128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139", "138,134,135,129,127,119,141,120,762,442,147,,763,,,,,,,,,143,144,140", "122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,253,,,,,", "137,136,,121,142,139,138,134,135,129,127,119,141,120,764,448,147,,765", ",,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145,146,132", "133,,,,,,,,,,,,137,136,,121,142,139,138,134,135,129,127,119,141,120", "770,448,147,,768,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126", ",,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139,138,134,135,129", "127,119,141,120,451,442,147,,452,,,,,,,,,143,144,140,122,123,124,131", "128,130,,,125,126,,,,,145,146,132,133,,,,,,253,,,,,,137,136,,121,142", "139,138,134,135,129,127,119,141,120,770,448,147,,857,,,,,,,,,143,144", "140,122,123,124,131,128,130,,,125,126,,,,,145,146,132,133,,,,,,,,,,", ",137,136,,121,142,139,138,134,135,129,127,119,141,120,1020,442,147,", "1021,,,,,,,,,143,144,140,122,123,124,131,128,130,,,125,126,,,,,145,146", "132,133,,,,,,253,,,,,,137,136,,121,142,139,138,134,135,129,127,119,141", "120,1022,448,147,,1023,,,,,,,,,143,144,140,122,123,124,131,128,130,", ",125,126,,,,,145,146,132,133,,,,,,,,,,,,137,136,,121,142,139,138,134", "135,129,127,119,141,120,,,147"]; racc_action_table = arr = Opal.get('Array').$new(25645, nil); idx = 0; ($a = ($b = clist).$each, $a.$$p = (TMP_1 = function(str){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (str == null) str = nil; return ($c = ($d = str.$split(",", -1)).$each, $c.$$p = (TMP_2 = function(i){var self = TMP_2.$$s || this, $e; if (i == null) i = nil; if ((($e = i['$empty?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { } else { arr['$[]='](idx, i.$to_i()) }; return idx = $rb_plus(idx, 1);}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); clist = ["0,0,0,0,0,359,24,325,0,0,56,294,360,0,1,0,0,0,0,0,0,0,366,210,369,6", "404,0,0,0,0,0,0,0,317,212,0,317,499,503,610,287,0,0,0,0,0,0,0,0,0,0", "0,762,0,0,0,871,0,0,9,0,0,290,763,701,511,627,627,378,24,499,503,210", "872,294,318,3,11,318,471,471,3,0,922,212,0,404,934,0,24,0,966,0,56,294", "969,0,72,511,1003,701,719,719,764,0,72,287,1020,325,0,0,0,0,0,0,359", "12,359,0,0,359,1021,360,366,360,369,0,360,290,0,18,18,18,471,18,0,0", "15,18,18,1033,610,287,18,765,18,18,18,18,18,18,18,287,627,762,719,21", "18,18,18,18,18,18,18,290,763,18,871,764,871,871,378,871,18,290,872,18", "18,18,18,18,18,18,467,18,18,18,1022,18,18,378,18,18,539,922,378,922", "35,934,922,934,37,966,934,966,764,969,966,969,765,1003,969,1003,18,42", "1003,18,18,1020,18,1020,18,1023,1020,382,522,78,18,600,601,706,382,1021", "467,1021,18,321,1021,512,321,18,18,18,18,18,18,765,775,775,18,18,1033", "707,1033,874,832,1033,18,79,539,18,19,19,19,1022,19,18,18,278,19,19", "512,98,278,19,709,19,19,19,19,19,19,19,710,522,522,522,651,19,19,19", "19,19,19,19,539,706,19,1022,1023,1022,522,638,1022,19,539,194,19,19", "19,19,19,19,19,211,19,19,19,707,19,19,832,19,19,475,600,601,600,601", "14,600,601,706,1023,775,1023,213,651,1023,775,709,709,706,395,19,16", "16,19,710,710,19,874,19,874,707,475,874,832,19,475,475,638,638,364,707", "364,19,832,666,14,638,19,19,19,19,19,19,709,214,14,19,19,667,383,816", "710,36,709,19,220,383,19,27,27,27,710,27,19,19,384,27,27,395,395,395", "27,384,27,27,27,27,27,27,27,725,373,252,725,666,27,27,27,27,27,27,27", "36,266,27,23,23,267,667,459,816,27,36,23,27,27,27,27,27,27,27,27,27", "27,27,397,27,27,270,27,27,459,459,459,459,459,459,459,459,459,459,459", "373,373,459,459,817,363,459,459,373,27,363,399,27,373,399,27,476,27", "280,27,459,27,459,27,459,459,459,459,459,459,459,27,459,373,38,38,27", "27,27,27,27,27,397,397,397,27,27,476,459,303,459,476,476,27,817,373", "27,373,27,575,385,282,27,27,28,28,28,385,28,575,399,399,28,28,982,959", "982,28,959,28,28,28,28,28,28,28,84,84,283,303,284,28,28,28,28,28,28", "28,111,303,28,575,575,111,111,672,289,28,299,299,28,28,28,28,28,28,28", "28,28,28,28,401,28,28,292,28,28,672,672,672,672,672,672,672,672,672", "672,672,575,293,672,672,386,298,672,672,884,28,406,386,28,313,313,28", "300,28,884,28,672,28,672,28,672,672,672,672,672,672,672,28,672,358,358", "304,28,28,28,28,28,28,401,401,401,28,28,387,672,438,884,884,388,28,387", "305,28,308,28,388,389,314,28,28,29,29,29,389,29,406,406,406,29,29,578", "578,316,29,319,29,29,29,29,29,29,29,320,884,322,438,330,29,29,29,29", "29,29,29,391,438,29,13,13,620,439,391,331,29,620,13,29,29,29,29,29,29", "29,29,29,29,29,332,29,29,333,29,29,773,335,494,650,592,773,592,592,592", "860,592,860,860,860,779,860,336,439,340,779,29,749,749,29,1006,1006", "29,439,29,13,29,13,29,494,29,354,357,494,494,494,494,365,29,650,368", "370,374,29,29,29,29,29,29,650,400,403,29,29,43,43,422,428,430,433,29", "436,43,29,437,29,445,456,477,29,29,31,31,31,31,31,592,478,479,31,31", "860,480,505,31,508,31,31,31,31,31,31,31,5,5,5,5,5,31,31,31,31,31,31", "31,509,513,31,527,43,528,43,531,31,31,533,31,31,31,31,31,31,31,31,540", "31,31,31,544,31,31,553,31,31,554,350,555,350,350,350,581,350,581,581", "581,581,581,793,793,556,569,793,793,793,31,581,585,31,495,587,31,591", "31,910,31,910,910,910,31,910,596,209,209,350,602,603,31,642,581,209", "350,31,31,31,31,31,31,581,581,495,31,31,648,495,495,495,495,654,31,659", "662,31,32,32,32,670,32,31,31,671,32,32,687,693,695,32,703,32,32,32,32", "32,32,32,581,705,209,708,209,32,32,32,32,32,32,32,711,712,32,288,288", "713,714,717,718,32,720,288,32,32,32,32,32,32,32,723,32,32,32,727,32", "32,728,57,732,57,57,57,57,57,733,306,306,279,279,279,279,279,57,306", "589,735,589,589,589,32,589,738,32,739,741,32,745,32,288,32,288,747,751", "757,759,57,57,700,700,700,700,700,57,57,57,57,32,32,32,32,32,32,589", "761,766,32,32,770,771,589,306,782,306,32,783,785,32,33,33,33,786,33", "32,32,787,33,33,789,792,798,33,57,33,33,33,33,33,33,33,819,820,821,822", "823,33,33,33,33,33,33,33,825,826,33,367,367,827,831,836,839,33,840,367", "33,33,33,33,33,33,33,857,33,33,33,862,33,33,863,326,866,326,326,326", "326,326,876,879,880,376,376,881,901,902,326,912,746,376,746,746,746", "33,746,925,33,926,927,33,928,33,367,929,367,931,936,937,945,326,947", "326,949,950,951,952,326,326,326,326,33,33,33,33,33,33,746,954,968,33", "33,977,984,746,33,999,376,33,376,1004,33,39,39,39,1005,39,33,33,1010", "39,39,1012,1013,1014,39,326,39,39,39,39,39,39,39,1015,1016,1019,1034", ",39,39,39,39,39,39,39,,,39,584,584,,,,,39,,584,39,39,39,39,39,39,39", ",39,39,39,,39,39,,39,39,,748,,748,748,748,847,748,847,847,847,847,847", "998,,998,998,998,,998,39,847,,39,,,39,,39,584,,584,,,39,,,612,612,748", ",,39,,847,612,,39,39,39,39,39,39,847,847,,39,39,,,,,,,39,,,39,40,40", "40,,40,39,39,,40,40,,,,40,,40,40,40,40,40,40,40,847,,612,,612,40,40", "40,40,40,40,40,,,40,734,734,,,,,40,,734,40,40,40,40,40,40,40,,40,40", "40,,40,40,,40,40,,861,,861,861,861,849,861,849,849,849,849,849,,,,,", ",,40,849,,40,,,40,,40,734,,734,,,40,,,873,873,861,,,40,,849,873,,40", "40,40,40,40,40,849,849,,40,40,,,,,,,40,,,40,41,41,41,,41,40,40,,41,41", ",,,41,,41,41,41,41,41,41,41,849,,873,,873,41,41,41,41,41,41,41,,,41", "967,967,,,,,41,,967,41,41,41,41,41,41,41,,41,41,41,,41,41,,41,41,,483", ",,,,854,,854,854,854,854,854,,,,,,483,483,41,854,,41,,,41,,41,967,,967", "483,,41,,483,483,483,483,,,41,,854,,,41,41,41,41,41,41,854,854,,41,41", ",,,,,,41,,,41,53,53,53,,53,41,41,,53,53,,,,53,,53,53,53,53,53,53,53", "854,,,,,53,53,53,53,53,53,53,,,53,,930,,930,930,930,53,930,,53,53,53", "53,53,53,53,,53,53,53,,53,53,,53,53,485,932,,932,932,932,891,932,891", "891,891,891,891,930,,,,485,485,,53,891,,53,,,53,,53,,,485,,485,53,485", "485,485,485,932,,485,53,485,891,,,53,53,53,53,53,53,891,891,,53,53,", ",,,,,53,,,53,54,54,54,,54,53,53,,54,54,,,,54,,54,54,54,54,54,54,54,891", ",,,,54,54,54,54,54,54,54,,,54,,,,,,,54,,,54,54,54,54,54,54,54,54,54", "54,54,,54,54,,54,54,674,674,674,674,674,674,674,674,674,674,674,768", "768,674,674,,,674,674,768,54,,,54,768,,54,,54,,54,674,,674,54,674,674", "674,674,674,674,674,54,674,,,,54,54,54,54,54,54,,,,54,54,,674,674,,", ",54,,768,54,768,54,,,,54,54,55,55,55,,55,,,,55,55,,,,55,,55,55,55,55", "55,55,55,,,,,,55,55,55,55,55,55,55,,,55,,,,,,,55,,,55,55,55,55,55,55", "55,55,55,55,55,,55,55,,55,55,20,20,20,20,20,20,20,20,20,20,20,,,20,20", ",,20,20,,55,,,55,,,55,,55,,,20,,20,55,20,20,20,20,20,20,20,55,20,,,", "55,55,55,55,55,55,,,,55,55,,20,,,,,55,,,55,,55,,,,55,55,58,58,58,,58", ",,,58,58,,,,58,,58,58,58,58,58,58,58,,,,,,58,58,58,58,58,58,58,,,58", ",976,,976,976,976,58,976,,58,58,58,58,58,58,58,,58,58,58,,58,58,,58", "58,486,,,,,,972,,972,972,972,972,972,976,,,,486,486,,58,972,,58,,,58", ",58,,,486,,486,58,486,486,486,486,,,486,58,486,972,,,58,58,58,58,58", "58,972,972,,58,58,,,,,,,58,,,58,59,59,59,,59,58,58,,59,59,,,,59,,59", "59,59,59,59,59,59,972,,,,,59,59,59,59,59,59,59,,,59,,,,,,,59,,,59,59", "59,59,59,59,59,,59,59,59,,59,59,,59,59,487,,,,,,989,,989,989,989,989", "989,,,,,487,487,,59,989,,59,,,59,,59,,,487,,487,59,487,487,487,487,", ",487,59,487,989,,,59,59,59,59,59,59,989,989,,59,59,,,,,,,59,,,59,62", "62,62,,62,59,59,,62,62,,,,62,,62,62,62,62,62,62,62,989,,,,,62,62,62", "62,62,62,62,,,62,,,,,,,62,,,62,62,62,62,62,62,62,,62,62,62,,62,62,,62", "62,488,,,,,,991,,991,991,991,991,991,,,,,488,488,,62,991,,62,,,62,,62", ",,488,,488,62,488,488,488,488,,,488,62,488,991,,,62,62,62,62,62,62,991", "991,,62,62,62,,,,,62,62,,,62,63,63,63,,63,62,62,,63,63,,,,63,,63,63", "63,63,63,63,63,991,,,,,63,63,63,63,63,63,63,,,63,,,,,,,63,,,63,63,63", "63,63,63,63,,63,63,63,,63,63,,571,,571,571,571,571,571,,,,,,,,,571,", ",,,,,63,,,63,,,63,,63,,63,,,,,,571,,,,,,,571,571,571,571,63,63,63,63", "63,63,,,,63,63,,,,,,,63,,,63,64,64,64,,64,63,63,,64,64,,,,64,571,64", "64,64,64,64,64,64,,,,,,64,64,64,64,64,64,64,,,64,,,,,,,64,,,64,64,64", "64,64,64,64,,64,64,64,481,64,64,,579,,579,579,579,579,579,,,,,,,481", "481,579,,,,64,,,64,,,64,,481,64,481,64,481,481,481,481,,,,579,,,,,,", "579,579,579,579,64,64,64,64,64,64,,,,64,64,,,,,,,64,,,64,85,85,85,,85", "64,64,,85,85,,,,85,579,85,85,85,85,85,85,85,,85,,,,85,85,85,85,85,85", "85,,,85,,,,,,,85,,,85,85,85,85,85,85,85,85,85,85,85,,85,85,,85,85,264", "264,264,264,264,264,264,264,264,264,264,,,264,264,,,264,264,,85,,,85", "85,,85,,85,,85,264,85,264,85,264,264,264,264,264,264,264,85,264,85,", ",85,85,85,85,85,85,,,,85,85,,264,,,,,85,,,85,,85,,,,85,85,88,88,88,", "88,,,,88,88,,,,88,,88,88,88,88,88,88,88,,88,,,,88,88,88,88,88,88,88", ",,88,,,,,,,88,,,88,88,88,88,88,88,88,88,88,88,88,,88,88,,88,88,435,435", "435,435,435,435,435,435,435,435,435,,,435,435,,,435,435,,88,,,88,88", ",88,,88,,88,435,88,435,88,435,435,435,435,435,435,435,88,435,88,,,88", "88,88,88,88,88,,,,88,88,,435,,,,,88,,,88,,88,,,,88,88,100,100,100,100", "100,,,,100,100,,,,100,,100,100,100,100,100,100,100,,,,,,100,100,100", "100,100,100,100,,,100,,,,,,100,100,100,100,100,100,100,100,100,100,100", ",100,100,100,,100,100,,100,100,482,,,,,,993,,993,993,993,993,993,,,", ",482,482,,100,993,,100,,,100,,100,,100,482,,482,100,482,482,482,482", ",,,100,,993,,,100,100,100,100,100,100,993,993,,100,100,,,,,,100,100", ",,100,104,104,104,,104,100,100,,104,104,,,,104,,104,104,104,104,104", "104,104,993,,,,,104,104,104,104,104,104,104,,,104,,,,,,,104,,,104,104", "104,104,104,104,104,,104,104,104,,104,104,,104,104,,,,,,,1027,,1027", "1027,1027,1027,1027,,,,,,,,104,1027,,104,,,104,,104,,,,,,104,,,,,,,", "104,,1027,,,104,104,104,104,104,104,1027,1027,,104,104,,,,,,,104,,,104", "105,105,105,,105,104,104,,105,105,,,,105,,105,105,105,105,105,105,105", "1027,,,,,105,105,105,105,105,105,105,,,105,,,,,,,105,,,105,105,105,105", "105,105,105,,105,105,105,,105,105,,105,105,454,454,454,454,454,454,454", "454,454,454,454,,,454,454,,,454,454,,105,,,105,,,105,,105,,,454,,454", "105,454,454,454,454,454,454,454,105,454,,,,105,105,105,105,105,105,", ",,105,105,,454,,,,,105,,,105,106,106,106,,106,105,105,,106,106,,,,106", ",106,106,106,106,106,106,106,,,,,,106,106,106,106,106,106,106,,,106", ",,,,,,106,,,106,106,106,106,106,106,106,,106,106,106,,106,106,,106,106", "551,551,551,551,551,551,551,551,551,551,551,,,551,551,,,551,551,,106", ",,106,,,106,,106,,,551,,551,106,551,551,551,551,551,551,551,106,551", ",,,106,106,106,106,106,106,,,,106,106,,551,,,,,106,,,106,107,107,107", ",107,106,106,,107,107,,,,107,,107,107,107,107,107,107,107,,,,,,107,107", "107,107,107,107,107,,,107,,,,,,,107,,,107,107,107,107,107,107,107,,107", "107,107,,107,107,,107,107,716,716,716,716,716,716,716,716,716,716,716", ",,716,716,,,716,716,,107,,,107,,,107,,107,,,716,,716,107,716,716,716", "716,716,716,716,107,716,,,,107,107,107,107,107,107,,,,107,107,,716,", ",,,107,,,107,108,108,108,108,108,107,107,,108,108,,,,108,,108,108,108", "108,108,108,108,,,,,,108,108,108,108,108,108,108,,,108,,,,,,108,108", ",108,108,108,108,108,108,108,108,,108,108,108,,108,108,,108,108,803", "803,803,803,803,803,803,803,803,803,803,,,803,803,,,803,803,,108,,,108", ",,108,,108,,108,803,,803,108,803,803,803,803,803,803,803,108,803,,,", "108,108,108,108,108,108,,,,108,108,,803,,,,,108,,,108,109,109,109,109", "109,108,108,,109,109,,,,109,,109,109,109,109,109,109,109,,,,,,109,109", "109,109,109,109,109,,,109,,,,,,109,109,109,109,109,109,109,109,109,109", "109,,109,109,109,,109,109,,109,109,805,805,805,805,805,805,805,805,805", "805,805,,,805,805,,,805,805,,109,,,109,,,109,,109,,109,805,,805,109", "805,805,805,805,805,805,805,109,805,,,,109,109,109,109,109,109,,,,109", "109,,805,,,,,109,,,109,196,196,196,196,196,109,109,,196,196,,,,196,", "196,196,196,196,196,196,196,,,,,,196,196,196,196,196,196,196,,,196,", ",,,,196,196,,196,196,196,196,196,196,196,196,,196,196,196,,196,196,", "196,196,808,808,808,808,808,808,808,808,808,808,808,,,808,808,,,808", "808,,196,,,196,,,196,,196,,196,808,,808,196,808,808,808,808,808,808", "808,196,808,,,,196,196,196,196,196,196,,,,196,196,,808,,,,,196,,,196", "197,197,197,,197,196,196,,197,197,,,,197,,197,197,197,197,197,197,197", ",,,,,197,197,197,197,197,197,197,,,197,,,,,,,197,,,197,197,197,197,197", "197,197,,197,197,197,,197,197,,197,197,810,810,810,810,810,810,810,810", "810,810,810,,,810,810,,,810,810,,197,,,197,,,197,,197,,197,810,,810", "197,810,810,810,810,810,810,810,197,810,,,,197,197,197,197,197,197,", ",,197,197,,810,,,,,197,,,197,198,198,198,,198,197,197,,198,198,,,,198", ",198,198,198,198,198,198,198,,,,,,198,198,198,198,198,198,198,,,198", ",,,,,,198,,,198,198,198,198,198,198,198,,198,198,198,,198,198,,198,198", "812,812,812,812,812,812,812,812,812,812,812,,,812,812,,,812,812,,198", ",,198,,,198,,198,,,812,,812,198,812,812,812,812,812,812,812,198,812", ",,,198,198,198,198,198,198,,,,198,198,,812,,,,,198,,,198,199,199,199", ",199,198,198,,199,199,,,,199,,199,199,199,199,199,199,199,,,,,,199,199", "199,199,199,199,199,,,199,,,,,,,199,,,199,199,199,199,199,199,199,199", "199,199,199,,199,199,,199,199,904,904,904,904,904,904,904,904,904,904", "904,,,904,904,,,904,904,,199,,,199,,,199,,199,,199,904,,904,199,904", "904,904,904,904,904,904,199,904,,,,199,199,199,199,199,199,,,,199,199", ",904,,,,,199,,,199,,199,,,,199,199,200,200,200,,200,,,,200,200,,,,200", ",200,200,200,200,200,200,200,,,,,,200,200,200,200,200,200,200,,,200", ",,,,,,200,,,200,200,200,200,200,200,200,200,200,200,200,,200,200,,200", "200,906,906,906,906,906,906,906,906,906,906,906,,,906,906,,,906,906", ",200,,,200,,,200,,200,,200,906,,906,200,906,906,906,906,906,906,906", "200,906,,,,200,200,200,200,200,200,,,,200,200,,906,,,,,200,,,200,,200", ",,,200,200,204,204,204,,204,,,,204,204,,,,204,,204,204,204,204,204,204", "204,,,,,,204,204,204,204,204,204,204,,,204,,,,,,,204,,,204,204,204,204", "204,204,204,,204,204,204,,204,204,,204,204,958,958,958,958,958,958,958", "958,958,958,958,,,958,958,,,958,958,,204,,,204,,,204,,204,,,958,,958", "204,958,958,958,958,958,958,958,204,958,,,,204,204,204,204,204,204,", ",,204,204,,958,,,,,204,,,204,205,205,205,,205,204,204,,205,205,,,,205", ",205,205,205,205,205,205,205,,,,,,205,205,205,205,205,205,205,,,205", ",,,,,,205,,,205,205,205,205,205,205,205,,205,205,205,,205,205,,205,205", "473,473,473,473,473,473,473,473,473,473,473,,,473,473,,,473,473,,205", ",,205,,,205,,205,,205,473,,473,205,473,473,473,473,473,473,473,205,473", ",,,205,205,205,205,205,205,,,,205,205,,,,,,,205,,,205,206,206,206,,206", "205,205,,206,206,,,,206,,206,206,206,206,206,206,206,,,,,,206,206,206", "206,206,206,206,,,206,,,,,,,206,,,206,206,206,206,206,206,206,,206,206", "206,,206,206,,206,206,474,474,474,474,474,474,474,474,474,474,474,,", "474,474,,,474,474,,206,,,206,,,206,,206,,,474,,474,206,474,474,474,474", "474,474,474,206,474,,,,206,206,206,206,206,206,,,,206,206,,,,,,,206", ",,206,207,207,207,,207,206,206,,207,207,,,,207,,207,207,207,207,207", "207,207,,,,,,207,207,207,207,207,207,207,,,207,,,,,,,207,,,207,207,207", "207,207,207,207,,207,207,207,,207,207,,207,207,484,484,484,484,484,484", "484,,,484,484,,,,,,,484,484,,207,,,207,,,207,,207,,,484,,484,207,484", "484,484,484,484,484,484,207,484,,,,207,207,207,207,207,207,,,,207,207", ",,,,,,207,,,207,215,215,215,215,215,207,207,,215,215,,,,215,,215,215", "215,215,215,215,215,,,,,,215,215,215,215,215,215,215,,,215,,,,,,215", "215,,215,215,215,215,215,215,215,215,,215,215,215,,215,215,,215,215", "489,489,489,489,489,489,489,,,489,489,,,,,,,489,489,,215,,,215,,,215", ",215,,215,489,,489,215,489,489,489,489,489,489,489,215,489,,,,215,215", "215,215,215,215,,,,215,215,,,,,,,215,,,215,216,216,216,,216,215,215", ",216,216,,,,216,,216,216,216,216,216,216,216,,,,,,216,216,216,216,216", "216,216,,,216,,,,,,,216,,,216,216,216,216,216,216,216,,216,216,216,", "216,216,,216,216,490,490,490,490,490,490,490,,,490,490,,,,,,,490,490", ",216,,,216,,216,216,,216,,,490,,490,216,490,490,490,490,490,490,490", "216,490,,,,216,216,216,216,216,216,,,,216,216,,,,,,,216,,,216,219,219", "219,,219,216,216,,219,219,,,,219,,219,219,219,219,219,219,219,,,,,,219", "219,219,219,219,219,219,,,219,,,,,,,219,,,219,219,219,219,219,219,219", ",219,219,219,,219,219,,219,219,491,491,491,491,491,491,491,,,491,491", ",,,,,,491,491,,219,,,219,,,219,,219,,,491,,491,219,491,491,491,491,491", "491,491,219,491,,,,219,219,219,219,219,219,,,,219,219,,,,,,,219,,,219", "221,221,221,,221,219,219,,221,221,,,,221,,221,221,221,221,221,221,221", ",,,,,221,221,221,221,221,221,221,,,221,,,,,,,221,,,221,221,221,221,221", "221,221,,221,221,221,,221,221,,221,221,492,492,492,492,492,492,492,", ",492,492,,,,,,,492,492,,221,,,221,,,221,,221,,,492,,492,221,492,492", "492,492,492,492,492,221,492,,,,221,221,221,221,221,221,,,,221,221,,", ",,,,221,,,221,222,222,222,,222,221,221,,222,222,,,,222,,222,222,222", "222,222,222,222,,,,,,222,222,222,222,222,222,222,,,222,,,,,,,222,,,222", "222,222,222,222,222,222,,222,222,222,,222,222,,222,222,493,493,493,493", "493,493,493,,,493,493,,,,,,,493,493,,222,,,222,,,222,,222,,,493,,493", "222,493,493,493,493,493,493,493,222,493,,,,222,222,222,222,222,222,", ",,222,222,,,,,,,222,,,222,223,223,223,,223,222,222,,223,223,,,,223,", "223,223,223,223,223,223,223,,,,,,223,223,223,223,223,223,223,,,223,", ",,,,,223,,,223,223,223,223,223,223,223,,223,223,223,,223,223,,223,223", "496,496,496,496,496,496,496,,,496,496,,,,,,,496,496,,223,,,223,,,223", ",223,,,496,,496,223,496,496,496,496,496,496,496,223,496,,,,223,223,223", "223,223,223,,,,223,223,,,,,,,223,,,223,224,224,224,,224,223,223,,224", "224,,,,224,,224,224,224,224,224,224,224,,,,,,224,224,224,224,224,224", "224,,,224,,,,,,,224,,,224,224,224,224,224,224,224,,224,224,224,,224", "224,,224,224,497,497,497,497,497,497,497,497,,497,497,,,,,,,497,497", ",224,,,224,,,224,,224,,,497,,497,224,497,497,497,497,497,497,497,224", "497,,,,224,224,224,224,224,224,,,,224,224,,,,,,,224,,,224,225,225,225", ",225,224,224,,225,225,,,,225,,225,225,225,225,225,225,225,,,,,,225,225", "225,225,225,225,225,,,225,,,,,,,225,,,225,225,225,225,225,225,225,,225", "225,225,,225,225,,225,225,,,,,,,,,,,,,,,,,,,,,225,,,225,,,225,,225,", ",,,,225,,,,,,,,225,,,,,225,225,225,225,225,225,,,,225,225,,,,,,,225", ",,225,226,226,226,,226,225,225,,226,226,,,,226,,226,226,226,226,226", "226,226,,,,,,226,226,226,226,226,226,226,,,226,,,,,,,226,,,226,226,226", "226,226,226,226,,226,226,226,,226,226,,226,226,,,,,,,,,,,,,,,,,,,,,226", ",,226,,,226,,226,,,,,,226,,,,,,,,226,,,,,226,226,226,226,226,226,,,", "226,226,,,,,,,226,,,226,227,227,227,,227,226,226,,227,227,,,,227,,227", "227,227,227,227,227,227,,,,,,227,227,227,227,227,227,227,,,227,,,,,", ",227,,,227,227,227,227,227,227,227,,227,227,227,,227,227,,227,227,,", ",,,,,,,,,,,,,,,,,,227,,,227,,,227,,227,,,,,,227,,,,,,,,227,,,,,227,227", "227,227,227,227,,,,227,227,,,,,,,227,,,227,228,228,228,,228,227,227", ",228,228,,,,228,,228,228,228,228,228,228,228,,,,,,228,228,228,228,228", "228,228,,,228,,,,,,,228,,,228,228,228,228,228,228,228,,228,228,228,", "228,228,,228,228,,,,,,,,,,,,,,,,,,,,,228,,,228,,,228,,228,,,,,,228,", ",,,,,,228,,,,,228,228,228,228,228,228,,,,228,228,,,,,,,228,,,228,229", "229,229,,229,228,228,,229,229,,,,229,,229,229,229,229,229,229,229,,", ",,,229,229,229,229,229,229,229,,,229,,,,,,,229,,,229,229,229,229,229", "229,229,,229,229,229,,229,229,,229,229,,,,,,,,,,,,,,,,,,,,,229,,,229", ",,229,,229,,,,,,229,,,,,,,,229,,,,,229,229,229,229,229,229,,,,229,229", ",,,,,,229,,,229,230,230,230,,230,229,229,,230,230,,,,230,,230,230,230", "230,230,230,230,,,,,,230,230,230,230,230,230,230,,,230,,,,,,,230,,,230", "230,230,230,230,230,230,,230,230,230,,230,230,,230,230,,,,,,,,,,,,,", ",,,,,,,230,,,230,,,230,,230,,,,,,230,,,,,,,,230,,,,,230,230,230,230", "230,230,,,,230,230,,,,,,,230,,,230,231,231,231,,231,230,230,,231,231", ",,,231,,231,231,231,231,231,231,231,,,,,,231,231,231,231,231,231,231", ",,231,,,,,,,231,,,231,231,231,231,231,231,231,,231,231,231,,231,231", ",231,231,,,,,,,,,,,,,,,,,,,,,231,,,231,,,231,,231,,,,,,231,,,,,,,,231", ",,,,231,231,231,231,231,231,,,,231,231,,,,,,,231,,,231,232,232,232,", "232,231,231,,232,232,,,,232,,232,232,232,232,232,232,232,,,,,,232,232", "232,232,232,232,232,,,232,,,,,,,232,,,232,232,232,232,232,232,232,,232", "232,232,,232,232,,232,232,,,,,,,,,,,,,,,,,,,,,232,,,232,,,232,,232,", ",,,,232,,,,,,,,232,,,,,232,232,232,232,232,232,,,,232,232,,,,,,,232", ",,232,233,233,233,,233,232,232,,233,233,,,,233,,233,233,233,233,233", "233,233,,,,,,233,233,233,233,233,233,233,,,233,,,,,,,233,,,233,233,233", "233,233,233,233,,233,233,233,,233,233,,233,233,,,,,,,,,,,,,,,,,,,,,233", ",,233,,,233,,233,,,,,,233,,,,,,,,233,,,,,233,233,233,233,233,233,,,", "233,233,,,,,,,233,,,233,234,234,234,,234,233,233,,234,234,,,,234,,234", "234,234,234,234,234,234,,,,,,234,234,234,234,234,234,234,,,234,,,,,", ",234,,,234,234,234,234,234,234,234,,234,234,234,,234,234,,234,234,,", ",,,,,,,,,,,,,,,,,,234,,,234,,,234,,234,,,,,,234,,,,,,,,234,,,,,234,234", "234,234,234,234,,,,234,234,,,,,,,234,,,234,235,235,235,,235,234,234", ",235,235,,,,235,,235,235,235,235,235,235,235,,,,,,235,235,235,235,235", "235,235,,,235,,,,,,,235,,,235,235,235,235,235,235,235,,235,235,235,", "235,235,,235,235,,,,,,,,,,,,,,,,,,,,,235,,,235,,,235,,235,,,,,,235,", ",,,,,,235,,,,,235,235,235,235,235,235,,,,235,235,,,,,,,235,,,235,236", "236,236,,236,235,235,,236,236,,,,236,,236,236,236,236,236,236,236,,", ",,,236,236,236,236,236,236,236,,,236,,,,,,,236,,,236,236,236,236,236", "236,236,,236,236,236,,236,236,,236,236,,,,,,,,,,,,,,,,,,,,,236,,,236", ",,236,,236,,,,,,236,,,,,,,,236,,,,,236,236,236,236,236,236,,,,236,236", ",,,,,,236,,,236,237,237,237,,237,236,236,,237,237,,,,237,,237,237,237", "237,237,237,237,,,,,,237,237,237,237,237,237,237,,,237,,,,,,,237,,,237", "237,237,237,237,237,237,,237,237,237,,237,237,,237,237,,,,,,,,,,,,,", ",,,,,,,237,,,237,,,237,,237,,,,,,237,,,,,,,,237,,,,,237,237,237,237", "237,237,,,,237,237,,,,,,,237,,,237,238,238,238,,238,237,237,,238,238", ",,,238,,238,238,238,238,238,238,238,,,,,,238,238,238,238,238,238,238", ",,238,,,,,,,238,,,238,238,238,238,238,238,238,,238,238,238,,238,238", ",238,238,,,,,,,,,,,,,,,,,,,,,238,,,238,,,238,,238,,,,,,238,,,,,,,,238", ",,,,238,238,238,238,238,238,,,,238,238,,,,,,,238,,,238,239,239,239,", "239,238,238,,239,239,,,,239,,239,239,239,239,239,239,239,,,,,,239,239", "239,239,239,239,239,,,239,,,,,,,239,,,239,239,239,239,239,239,239,,239", "239,239,,239,239,,239,239,,,,,,,,,,,,,,,,,,,,,239,,,239,,,239,,239,", ",,,,239,,,,,,,,239,,,,,239,239,239,239,239,239,,,,239,239,,,,,,,239", ",,239,240,240,240,,240,239,239,,240,240,,,,240,,240,240,240,240,240", "240,240,,,,,,240,240,240,240,240,240,240,,,240,,,,,,,240,,,240,240,240", "240,240,240,240,,240,240,240,,240,240,,240,240,,,,,,,,,,,,,,,,,,,,,240", ",,240,,,240,,240,,,,,,240,,,,,,,,240,,,,,240,240,240,240,240,240,,,", "240,240,,,,,,,240,,,240,241,241,241,,241,240,240,,241,241,,,,241,,241", "241,241,241,241,241,241,,,,,,241,241,241,241,241,241,241,,,241,,,,,", ",241,,,241,241,241,241,241,241,241,,241,241,241,,241,241,,241,241,,", ",,,,,,,,,,,,,,,,,,241,,,241,,,241,,241,,,,,,241,,,,,,,,241,,,,,241,241", "241,241,241,241,,,,241,241,,,,,,,241,,,241,242,242,242,,242,241,241", ",242,242,,,,242,,242,242,242,242,242,242,242,,,,,,242,242,242,242,242", "242,242,,,242,,,,,,,242,,,242,242,242,242,242,242,242,,242,242,242,", "242,242,,242,242,,,,,,,,,,,,,,,,,,,,,242,,,242,,,242,,242,,,,,,242,", ",,,,,,242,,,,,242,242,242,242,242,242,,,,242,242,,,,,,,242,,,242,243", "243,243,,243,242,242,,243,243,,,,243,,243,243,243,243,243,243,243,,", ",,,243,243,243,243,243,243,243,,,243,,,,,,,243,,,243,243,243,243,243", "243,243,,243,243,243,,243,243,,243,243,,,,,,,,,,,,,,,,,,,,,243,,,243", ",,243,,243,,,,,,243,,,,,,,,243,,,,,243,243,243,243,243,243,,,,243,243", ",,,,,,243,,,243,244,244,244,,244,243,243,,244,244,,,,244,,244,244,244", "244,244,244,244,,,,,,244,244,244,244,244,244,244,,,244,,,,,,,244,,,244", "244,244,244,244,244,244,,244,244,244,,244,244,,244,244,,,,,,,,,,,,,", ",,,,,,,244,,,244,,,244,,244,,,,,,244,,,,,,,,244,,,,,244,244,244,244", "244,244,,,,244,244,,,,,,,244,,,244,245,245,245,,245,244,244,,245,245", ",,,245,,245,245,245,245,245,245,245,,,,,,245,245,245,245,245,245,245", ",,245,,,,,,,245,,,245,245,245,245,245,245,245,,245,245,245,,245,245", ",245,245,,,,,,,,,,,,,,,,,,,,,245,,,245,,,245,,245,,,,,,245,,,,,,,,245", ",,,,245,245,245,245,245,245,,,,245,245,,,,,,,245,,,245,253,253,253,", "253,245,245,,253,253,,,,253,,253,253,253,253,253,253,253,,,,,,253,253", "253,253,253,253,253,,,253,,,,,,,253,,,253,253,253,253,253,253,253,253", "253,253,253,,253,253,,253,253,,,,,,,,,,,,,,,,,,,,,253,,,253,,,253,,253", ",253,,253,,253,,,,,,,,253,,,,,253,253,253,253,253,253,,,,253,253,,,", ",,,253,,,253,,253,,,,253,253,254,254,254,,254,,,,254,254,,,,254,,254", "254,254,254,254,254,254,,,,,,254,254,254,254,254,254,254,,,254,,,,,", ",254,,,254,254,254,254,254,254,254,254,254,254,254,,254,254,,254,254", ",,,,,,,,,,,,,,,,,,,,254,,,254,,,254,,254,,254,,254,,254,,,,,,,,254,", ",,,254,254,254,254,254,254,,,,254,254,,,,,,,254,,,254,,254,,,,254,254", "262,262,262,,262,,,,262,262,,,,262,,262,262,262,262,262,262,262,,,,", ",262,262,262,262,262,262,262,,,262,,,,,,,262,,,262,262,262,262,262,262", "262,262,262,262,262,,262,262,,262,262,,,,,,,,,,,,,,,,,,,,,262,,,262", ",262,262,,262,,262,,262,,262,,,,,,,,262,,,,,262,262,262,262,262,262", ",,,262,262,,,,,,,262,,,262,,262,,,,262,262,269,269,269,,269,,,,269,269", ",,,269,,269,269,269,269,269,269,269,,,,,,269,269,269,269,269,269,269", ",,269,,,,,,,269,,,269,269,269,269,269,269,269,,269,269,269,,269,269", ",269,269,,,,,,,,,,,,,,,,,,,,,269,,,269,,,269,,269,,,,,,269,,,,,,,,269", ",,,,269,269,269,269,269,269,,,,269,269,,,,,,,269,,,269,271,271,271,", "271,269,269,,271,271,,,,271,,271,271,271,271,271,271,271,,,,,,271,271", "271,271,271,271,271,,,271,,,,,,,271,,,271,271,271,271,271,271,271,,271", "271,271,,271,271,,271,271,,,,,,,,,,,,,,,,,,,,,271,,,271,,,271,,271,", ",,,,271,,,,,,,,271,,,,,271,271,271,271,271,271,,,,271,271,,,,,,,271", ",,271,274,274,274,,274,271,271,,274,274,,,,274,,274,274,274,274,274", "274,274,,,,,,274,274,274,274,274,274,274,,,274,,,,,,,274,,,274,274,274", "274,274,274,274,,274,274,274,,274,274,,274,274,,,,,,,,,,,,,,,,,,,,,274", ",,274,,,274,,274,,,,,,274,,,,,,,,274,,,,,274,274,274,274,274,274,,,", "274,274,,,,,,,274,,,274,275,275,275,,275,274,274,,275,275,,,,275,,275", "275,275,275,275,275,275,,,,,,275,275,275,275,275,275,275,,,275,,,,,", ",275,,,275,275,275,275,275,275,275,,275,275,275,,275,275,,275,275,,", ",,,,,,,,,,,,,,,,,,275,,,275,,,275,,275,,,,,,275,,,,,,,,275,,,,,275,275", "275,275,275,275,,,,275,275,,,,,,,275,,,275,281,281,281,281,281,275,275", ",281,281,,,,281,,281,281,281,281,281,281,281,,,,,,281,281,281,281,281", "281,281,,,281,,,,,,281,281,,281,281,281,281,281,281,281,281,,281,281", "281,,281,281,,281,281,,,,,,,,,,,,,,,,,,,,,281,,,281,,,281,,281,,281", ",,,281,,,,,,,,281,,,,,281,281,281,281,281,281,,,,281,281,,,,,,,281,", ",281,285,285,285,,285,281,281,,285,285,,,,285,,285,285,285,285,285,285", "285,,,,,,285,285,285,285,285,285,285,,,285,,,,,,,285,,,285,285,285,285", "285,285,285,,285,285,285,,285,285,,623,,623,623,623,623,623,,,,,,,,", "623,,,,,,,285,,,285,,,285,,285,,,,,,,,623,623,,,,,,623,623,623,623,285", "285,285,285,285,285,,,,285,285,,,,285,,,285,,,285,286,286,286,286,286", "285,285,,286,286,,,,286,623,286,286,286,286,286,286,286,,,,,,286,286", "286,286,286,286,286,,,286,,,,,,286,286,,286,286,286,286,286,286,286", "286,,286,286,286,,286,286,,286,286,,,,,,,,,,,,,,,,,,,,,286,,,286,,,286", ",286,,286,,,,286,,,,,,,,286,,,,,286,286,286,286,286,286,,,,286,286,", ",,,,,286,,,286,301,301,301,,301,286,286,,301,301,,,,301,,301,301,301", "301,301,301,301,,,,,,301,301,301,301,301,301,301,,,301,,,,,,,301,,,301", "301,301,301,301,301,301,,301,301,301,,301,301,,676,,676,676,676,676", "676,,,,,,,,,676,,,,,,,301,,,301,,,301,,301,,,,,,,,676,,,,,,,676,676", "676,676,301,301,301,301,301,301,,,,301,301,,,,,,,301,,,301,310,310,310", "676,310,301,301,,310,310,,,,310,676,310,310,310,310,310,310,310,,,,", ",310,310,310,310,310,310,310,,,310,,,,,,,310,,,310,310,310,310,310,310", "310,,310,310,310,,310,310,,310,310,,,,,,,,,,,,,,,,,,,,,310,,,310,310", ",310,,310,,,,,,310,,,,,,,,310,,,,,310,310,310,310,310,310,,,,310,310", ",,,,,,310,,,310,312,312,312,312,312,310,310,,312,312,,,,312,,312,312", "312,312,312,312,312,,,,,,312,312,312,312,312,312,312,,,312,,,,,,312", "312,,312,312,312,312,312,312,312,312,,312,312,312,,312,312,,312,312", ",,,,,,,,,,,,,,,,,,,,312,,,312,,,312,,312,,312,,,,312,,,,,,,,312,,,,", "312,312,312,312,312,312,,,,312,312,,,,,,,312,,,312,342,342,342,,342", "312,312,,342,342,,,,342,,342,342,342,342,342,342,342,,,,,,342,342,342", "342,342,342,342,,,342,,,,,,,342,,,342,342,342,342,342,342,342,,342,342", "342,,342,342,,778,,778,778,778,778,778,,,,,,,,,778,,,,,,,342,,,342,", ",342,,342,,,,,,,,778,,,,,,,778,778,778,778,342,342,342,342,342,342,", ",,342,342,,,,,,,342,,,342,361,361,361,,361,342,342,,361,361,,,,361,778", "361,361,361,361,361,361,361,,,,,,361,361,361,361,361,361,361,,,361,", ",,,,,361,,,361,361,361,361,361,361,361,,361,361,361,,361,361,,361,361", ",,,,,,,,,,,,,,,,,,,,361,,,361,,,361,,361,,,,,,361,,,,,,,,361,,,,,361", "361,361,361,361,361,,,,361,361,,,,,,,361,,,361,362,362,362,,362,361", "361,,362,362,,,,362,,362,362,362,362,362,362,362,,,,,,362,362,362,362", "362,362,362,,,362,,,,,,,362,,,362,362,362,362,362,362,362,,362,362,362", ",362,362,,362,362,,,,,,,,,,,,,,,,,,,,,362,,,362,,,362,,362,,,,,,362", ",,,,,,,362,,,,,362,362,362,362,362,362,,,,362,362,,,,,,,362,,,362,381", "381,381,,381,362,362,,381,381,,,,381,,381,381,381,381,381,381,381,,", ",,,381,381,381,381,381,381,381,,,381,,,,,,,381,,,381,381,381,381,381", "381,381,,381,381,381,,381,381,,852,,852,852,852,852,852,,,,,,,,,852", ",,,,,,381,,,381,,,381,,381,,,,,,,,852,,,,,,,852,852,852,852,381,381", "381,381,381,381,,,,381,381,,,,,,,381,,,381,393,393,393,,393,381,381", ",393,393,,,,393,852,393,393,393,393,393,393,393,,,,,,393,393,393,393", "393,393,393,,,393,,,,,,,393,,,393,393,393,393,393,393,393,,393,393,393", ",393,393,,393,393,,,,,,,,,,,,,,,,,,,,,393,,,393,,,393,,393,,,,,,393", ",,,,,,,393,,,,,393,393,393,393,393,393,,,,393,393,,,,,,,393,,,393,432", "432,432,,432,393,393,,432,432,,,,432,,432,432,432,432,432,432,432,,", ",,,432,432,432,432,432,432,432,,,432,,,,,,,432,,,432,432,432,432,432", "432,432,,432,432,432,,432,432,,432,432,,,,,,,,,,,,,,,,,,,,,432,,,432", ",,432,,432,,,,,,432,,,,,,,,432,,,,,432,432,432,432,432,432,,,,432,432", ",,,,,,432,,,432,448,448,448,,448,432,432,,448,448,,,,448,,448,448,448", "448,448,448,448,,,,,,448,448,448,448,448,448,448,,,448,,,,,,,448,,,448", "448,448,448,448,448,448,448,448,448,448,,448,448,,448,448,,,,,,,,,,", ",,,,,,,,,,448,,,448,448,,448,,448,,448,,448,,448,,,,,,,,448,,,,,448", "448,448,448,448,448,,,,448,448,,,,,,,448,,,448,,448,,,,448,448,449,449", "449,,449,,,,449,449,,,,449,,449,449,449,449,449,449,449,,,,,,449,449", "449,449,449,449,449,,,449,,,,,,,449,,,449,449,449,449,449,449,449,449", "449,449,449,,449,449,,449,449,,,,,,,,,,,,,,,,,,,,,449,,,449,449,,449", ",449,,449,,449,,449,,,,,,,,449,,,,,449,449,449,449,449,449,,,,449,449", ",,,,,,449,,,449,,449,,,,449,449,465,465,465,,465,,,,465,465,,,,465,", "465,465,465,465,465,465,465,,,,,,465,465,465,465,465,465,465,,,465,", ",,,,,465,,,465,465,465,465,465,465,465,465,465,465,465,,465,465,,465", "465,,,,,,,,,,,,,,,,,,,,,465,,,465,,,465,,465,,465,,,,465,,,,,,,,465", ",,,,465,465,465,465,465,465,,,,465,465,,,,,,,465,,,465,,465,,,,465,465", "466,466,466,,466,,,,466,466,,,,466,,466,466,466,466,466,466,466,,,,", ",466,466,466,466,466,466,466,,,466,,,,,,,466,,,466,466,466,466,466,466", "466,466,466,466,466,,466,466,,466,466,,,,,,,,,,,,,,,,,,,,,466,,,466", ",,466,,466,,466,,,,466,,,,,,,,466,,,,,466,466,466,466,466,466,,,,466", "466,,,,,,,466,,,466,,466,,,,466,466,468,468,468,,468,,,,468,468,,,,468", ",468,468,468,468,468,468,468,,,,,,468,468,468,468,468,468,468,,,468", ",,,,,,468,,,468,468,468,468,468,468,468,,468,468,468,,468,468,,468,468", ",,,,,,,,,,,,,,,,,,,,468,,,468,,,468,,468,,,,,,468,,,,,,,,468,,,,,468", "468,468,468,468,468,,,,468,468,,,,,,,468,,,468,469,469,469,,469,468", "468,,469,469,,,,469,,469,469,469,469,469,469,469,,,,,,469,469,469,469", "469,469,469,,,469,,,,,,,469,,,469,469,469,469,469,469,469,,469,469,469", ",469,469,,469,469,,,,,,,,,,,,,,,,,,,,,469,,,469,,,469,,469,,,,,,469", ",,,,,,,469,,,,,469,469,469,469,469,469,,,,469,469,,,,,,,469,,,469,470", "470,470,,470,469,469,,470,470,,,,470,,470,470,470,470,470,470,470,,", ",,,470,470,470,470,470,470,470,,,470,,,,,,,470,,,470,470,470,470,470", "470,470,,470,470,470,,470,470,,470,470,,,,,,,,,,,,,,,,,,,,,470,,,470", ",,470,,470,,,,,,470,,,,,,,,470,,,,,470,470,470,470,470,470,,,,470,470", ",,,,,,470,,,470,498,498,498,,498,470,470,,498,498,,,,498,,498,498,498", "498,498,498,498,,,,,,498,498,498,498,498,498,498,,,498,,,,,,,498,,,498", "498,498,498,498,498,498,,498,498,498,,498,498,,498,498,,,,,,,,,,,,,", ",,,,,,,498,,,498,,,498,,498,,,,,,498,,,,,,,,498,,,,,498,498,498,498", "498,498,,,,498,498,,,,,,,498,,,498,516,516,516,,516,498,498,,516,516", ",,,516,,516,516,516,516,516,516,516,,,,,,516,516,516,516,516,516,516", ",,516,,,,,,,516,,,516,516,516,516,516,516,516,516,516,516,516,,516,516", ",516,516,,,,,,,,,,,,,,,,,,,,,516,,,516,,,516,,516,,516,,516,,516,,,", ",,,,516,,,,,516,516,516,516,516,516,,,,516,516,,,,,,,516,,,516,,516", ",,,516,516,518,518,518,,518,,,,518,518,,,,518,,518,518,518,518,518,518", "518,,,,,,518,518,518,518,518,518,518,,,518,,,,,,,518,,,518,518,518,518", "518,518,518,518,518,518,518,,518,518,,518,518,,,,,,,,,,,,,,,,,,,,,518", ",,518,,,518,,518,,,,518,,518,,,,,,,,518,,,,,518,518,518,518,518,518", ",,,518,518,,,,,,,518,,,518,,518,,,,518,518,520,520,520,,520,,,,520,520", ",,,520,,520,520,520,520,520,520,520,,,,,,520,520,520,520,520,520,520", ",,520,,,,,,,520,,,520,520,520,520,520,520,520,,520,520,520,,520,520", ",520,520,,,,,,,,,,,,,,,,,,,,,520,,,520,,,520,,520,,,,,,520,,,,,,,,520", ",,,,520,520,520,520,520,520,,,,520,520,,,,,,,520,,,520,526,526,526,526", "526,520,520,,526,526,,,,526,,526,526,526,526,526,526,526,,,,,,526,526", "526,526,526,526,526,,,526,,,,,,526,526,,526,526,526,526,526,526,526", "526,,526,526,526,,526,526,,526,526,,,,,,,,,,,,,,,,,,,,,526,,,526,,,526", ",526,,526,,,,526,,,,,,,,526,,,,,526,526,526,526,526,526,,,,526,526,", ",,,,526,526,,,526,532,532,532,,532,526,526,,532,532,,,,532,,532,532", "532,532,532,532,532,,,,,,532,532,532,532,532,532,532,,,532,,,,,,,532", ",,532,532,532,532,532,532,532,,532,532,532,,532,532,,887,,887,887,887", "887,887,,,,,,,,,887,,,,,,,532,,,532,,,532,,532,,,,,,,,887,,,,,,,887", "887,887,887,532,532,532,532,532,532,,,,532,532,,,,,,,532,,,532,534,534", "534,,534,532,532,,534,534,,,,534,887,534,534,534,534,534,534,534,,,", ",,534,534,534,534,534,534,534,,,534,,,,,,,534,,,534,534,534,534,534", "534,534,534,534,534,534,,534,534,,534,534,,,,,,,,,,,,,,,,,,,,,534,,", "534,,,534,,534,,534,,,,534,,,,,,,,534,,,,,534,534,534,534,534,534,,", ",534,534,,,,,,,534,,,534,,534,,,,534,534,537,537,537,,537,,,,537,537", ",,,537,,537,537,537,537,537,537,537,,,,,,537,537,537,537,537,537,537", ",,537,,,,,,,537,,,537,537,537,537,537,537,537,537,537,537,537,,537,537", ",537,537,,,,,,,,,,,,,,,,,,,,,537,,,537,,,537,,537,,537,,,,537,,,,,,", ",537,,,,,537,537,537,537,537,537,,,,537,537,,,,,,,537,,,537,,537,,,", "537,537,543,543,543,,543,,,,543,543,,,,543,,543,543,543,543,543,543", "543,,,,,,543,543,543,543,543,543,543,,,543,,,,,,,543,,,543,543,543,543", "543,543,543,,543,543,543,,543,543,,889,,889,889,889,889,889,,,,,,,,", "889,,,,,,,543,,,543,,,543,,543,,,,,,,,889,,,,,,,889,889,889,889,543", "543,543,543,543,543,,,,543,543,,,,,,,543,,,543,546,546,546,,546,543", "543,,546,546,,,,546,889,546,546,546,546,546,546,546,,,,,,546,546,546", "546,546,546,546,,,546,,,,,,,546,,,546,546,546,546,546,546,546,,546,546", "546,,546,546,,546,546,,,,,,,,,,,,,,,,,,,,,546,,,546,,,546,,546,,,,,", "546,,,,,,,,546,,,,,546,546,546,546,546,546,,,,546,546,,,,,,,546,,,546", "547,547,547,,547,546,546,,547,547,,,,547,,547,547,547,547,547,547,547", ",,,,,547,547,547,547,547,547,547,,,547,,,,,,,547,,,547,547,547,547,547", "547,547,,547,547,547,,547,547,,547,547,,,,,,,,,,,,,,,,,,,,,547,,,547", ",,547,,547,,,,,,547,,,,,,,,547,,,,,547,547,547,547,547,547,,,,547,547", ",,,,,,547,,,547,548,548,548,,548,547,547,,548,548,,,,548,,548,548,548", "548,548,548,548,,,,,,548,548,548,548,548,548,548,,,548,,,,,,,548,,,548", "548,548,548,548,548,548,,548,548,548,,548,548,,548,548,,,,,,,,,,,,,", ",,,,,,,548,,,548,,,548,,548,,,,,,548,,,,,,,,548,,,,,548,548,548,548", "548,548,,,,548,548,,,,,,,548,,,548,552,552,552,,552,548,548,,552,552", ",,,552,,552,552,552,552,552,552,552,,,,,,552,552,552,552,552,552,552", ",,552,,,,,,,552,,,552,552,552,552,552,552,552,,552,552,552,,552,552", ",552,552,,,,,,,,,,,,,,,,,,,,,552,,,552,,,552,,552,,,,,,552,,,,,,,,552", ",,,,552,552,552,552,552,552,,,,552,552,,,,,,,552,,,552,559,559,559,", "559,552,552,,559,559,,,,559,,559,559,559,559,559,559,559,,,,,,559,559", "559,559,559,559,559,,,559,,,,,,,559,,,559,559,559,559,559,559,559,559", "559,559,559,,559,559,,559,559,,,,,,,,,,,,,,,,,,,,,559,,,559,,,559,,559", ",559,,559,,559,,,,,,,,559,,,,,559,559,559,559,559,559,,,,559,559,,,", ",,,559,,,559,,559,,,,559,559,562,562,562,,562,,,,562,562,,,,562,,562", "562,562,562,562,562,562,,,,,,562,562,562,562,562,562,562,,,562,,,,,", ",562,,,562,562,562,562,562,562,562,562,562,562,562,,562,562,,562,562", ",,,,,,,,,,,,,,,,,,,,562,,,562,,,562,,562,,,,,,562,,,,,,,,562,,,,,562", "562,562,562,562,562,,,,562,562,,,,,,,562,,,562,,562,,,,562,562,567,567", "567,567,567,,,,567,567,,,,567,,567,567,567,567,567,567,567,,,,,,567", "567,567,567,567,567,567,,,567,,,,,,567,567,,567,567,567,567,567,567", "567,567,,567,567,567,,567,567,,567,567,,,,,,,,,,,,,,,,,,,,,567,,,567", ",,567,,567,,567,,,,567,,,,,,,,567,,,,,567,567,567,567,567,567,,,,567", "567,,,,,,,567,,,567,568,568,568,568,568,567,567,,568,568,,,,568,,568", "568,568,568,568,568,568,,,,,,568,568,568,568,568,568,568,,,568,,,,,", "568,568,,568,568,568,568,568,568,568,568,,568,568,568,,568,568,,568", "568,,,,,,,,,,,,,,,,,,,,,568,,,568,,,568,,568,,568,,,,568,,,,,,,,568", ",,,,568,568,568,568,568,568,,,,568,568,,,,,,,568,,,568,574,574,574,", "574,568,568,,574,574,,,,574,,574,574,574,574,574,574,574,,,,,,574,574", "574,574,574,574,574,,,574,,,,,,,574,,,574,574,574,574,574,574,574,,574", "574,574,,574,574,,956,,956,956,956,956,956,,,,,,,,,956,,,,,,,574,,,574", ",,574,,574,,,,,,,,956,956,,,,,,956,956,956,956,574,574,574,574,574,574", ",,,574,574,,,,,,,574,,,574,595,595,595,595,595,574,574,,595,595,,,,595", "956,595,595,595,595,595,595,595,,,,,,595,595,595,595,595,595,595,,,595", ",,,,,595,595,,595,595,595,595,595,595,595,595,,595,595,595,,595,595", ",595,595,,,,,,,,,,,,,,,,,,,,,595,,,595,,,595,,595,,595,,,,595,,,,,,", ",595,,,,,595,595,595,595,595,595,,,,595,595,,,,,,,595,,,595,599,599", "599,599,599,595,595,,599,599,,,,599,,599,599,599,599,599,599,599,,,", ",,599,599,599,599,599,599,599,,,599,,,,,,599,599,,599,599,599,599,599", "599,599,599,,599,599,599,,599,599,,599,599,,,,,,,,,,,,,,,,,,,,,599,", ",599,,,599,,599,,599,,,,599,,,,,,,,599,,,,,599,599,599,599,599,599,", ",,599,599,,,,,,,599,,,599,604,604,604,604,604,599,599,,604,604,,,,604", ",604,604,604,604,604,604,604,,,,,,604,604,604,604,604,604,604,,,604", ",,,,,604,604,,604,604,604,604,604,604,604,604,,604,604,604,,604,604", ",604,604,,,,,,,,,,,,,,,,,,,,,604,,,604,,,604,,604,,604,,,,604,,,,,,", ",604,,,,,604,604,604,604,604,604,,,,604,604,,,,,,,604,,,604,606,606", "606,,606,604,604,,606,606,,,,606,,606,606,606,606,606,606,606,,,,,,606", "606,606,606,606,606,606,,,606,,,,,,,606,,,606,606,606,606,606,606,606", "606,606,606,606,,606,606,,606,606,,,,,,,,,,,,,,,,,,,,,606,,,606,,,606", ",606,,606,,,,606,,,,,,,,606,,,,,606,606,606,606,606,606,,,,606,606,", ",,,,,606,,,606,,606,,,,606,606,609,609,609,,609,,,,609,609,,,,609,,609", "609,609,609,609,609,609,,,,,,609,609,609,609,609,609,609,,,609,,,,,", ",609,,,609,609,609,609,609,609,609,609,609,609,609,,609,609,,609,609", ",,,,,,,,,,,,,,,,,,,,609,,,609,,,609,,609,,609,,,,609,,,,,,,,609,,,,", "609,609,609,609,609,609,,,,609,609,,,,,,,609,,,609,,609,,,,609,609,615", "615,615,,615,,,,615,615,,,,615,,615,615,615,615,615,615,615,,,,,,615", "615,615,615,615,615,615,,,615,,,,,,,615,,,615,615,615,615,615,615,615", "615,615,615,615,,615,615,,615,615,,,,,,,,,,,,,,,,,,,,,615,,,615,,,615", ",615,,615,,,,615,,,,,,,,615,,,,,615,615,615,615,615,615,,,,615,615,", ",,,,,615,,,615,,615,,,,615,615,619,619,619,,619,,,,619,619,,,,619,,619", "619,619,619,619,619,619,,,,,,619,619,619,619,619,619,619,,,619,,,,,", ",619,,,619,619,619,619,619,619,619,,619,619,619,,619,619,,619,619,,", ",,,,,,,,,,,,,,,,,,619,,,619,,,619,,619,,,,,,619,,,,,,,,619,,,,,619,619", "619,619,619,619,,,,619,619,,,,,,,619,,,619,621,621,621,,621,619,619", ",621,621,,,,621,,621,621,621,621,621,621,621,,,,,,621,621,621,621,621", "621,621,,,621,,,,,,,621,,,621,621,621,621,621,621,621,,621,621,621,", "621,621,,621,621,,,,,,,,,,,,,,,,,,,,,621,,,621,,,621,,621,,,,,,621,", ",,,,,,621,,,,,621,621,621,621,621,621,,,,621,621,,,,,,,621,,,621,649", "649,649,,649,621,621,,649,649,,,,649,,649,649,649,649,649,649,649,,", ",,,649,649,649,649,649,649,649,,,649,,,,,,,649,,,649,649,649,649,649", "649,649,,649,649,649,,649,649,,649,649,,,,,,,,,,,,,,,,,,,,,649,,,649", ",,649,,649,,649,,,,649,,,,,,,,649,,,,,649,649,649,649,649,649,,,,649", "649,,,,,,,649,,,649,652,652,652,,652,649,649,,652,652,,,,652,,652,652", "652,652,652,652,652,,,,,,652,652,652,652,652,652,652,,,652,,,,,,,652", ",,652,652,652,652,652,652,652,,652,652,652,,652,652,,652,652,,,,,,,", ",,,,,,,,,,,,,652,,,652,,,652,,652,,,,,,652,,,,,,,,652,,,,,652,652,652", "652,652,652,,,,652,652,,,,,,,652,,,652,653,653,653,,653,652,652,,653", "653,,,,653,,653,653,653,653,653,653,653,,,,,,653,653,653,653,653,653", "653,,,653,,,,,,,653,,,653,653,653,653,653,653,653,,653,653,653,,653", "653,,653,653,,,,,,,,,,,,,,,,,,,,,653,,,653,,,653,,653,,,,,,653,,,,,", ",,653,,,,,653,653,653,653,653,653,,,,653,653,,,,,,,653,,,653,658,658", "658,,658,653,653,,658,658,,,,658,,658,658,658,658,658,658,658,,,,,,658", "658,658,658,658,658,658,,,658,,,,,,,658,,,658,658,658,658,658,658,658", ",658,658,658,,658,658,,658,658,,,,,,,,,,,,,,,,,,,,,658,,,658,,,658,", "658,,,,,,658,,,,,,,,658,,,,,658,658,658,658,658,658,,,,658,658,,,,,", ",658,,,658,661,661,661,,661,658,658,,661,661,,,,661,,661,661,661,661", "661,661,661,,,,,,661,661,661,661,661,661,661,,,661,,,,,,,661,,,661,661", "661,661,661,661,661,,661,661,661,,661,661,,661,661,,,,,,,,,,,,,,,,,", ",,,661,,,661,,,661,,661,,,,,,661,,,,,,,,661,,,,,661,661,661,661,661", "661,,,,661,661,,,,,,,661,,,661,664,664,664,,664,661,661,,664,664,,,", "664,,664,664,664,664,664,664,664,,,,,,664,664,664,664,664,664,664,,", "664,,,,,,,664,,,664,664,664,664,664,664,664,,664,664,664,,664,664,,664", "664,,,,,,,,,,,,,,,,,,,,,664,,,664,,,664,,664,,,,,,664,,,,,,,,664,,,", ",664,664,664,664,664,664,,,,664,664,,,,,,,664,,,664,665,665,665,,665", "664,664,,665,665,,,,665,,665,665,665,665,665,665,665,,,,,,665,665,665", "665,665,665,665,,,665,,,,,,,665,,,665,665,665,665,665,665,665,,665,665", "665,,665,665,,665,665,,,,,,,,,,,,,,,,,,,,,665,,,665,,,665,,665,,,,,", "665,,,,,,,,665,,,,,665,665,665,665,665,665,,,,665,665,,,,,,,665,,,665", "678,678,678,678,678,665,665,,678,678,,,,678,,678,678,678,678,678,678", "678,,,,,,678,678,678,678,678,678,678,,,678,,,,,,678,678,,678,678,678", "678,678,678,678,678,,678,678,678,,678,678,,678,678,,,,,,,,,,,,,,,,,", ",,,678,,,678,,,678,,678,,678,,,,678,,,,,,,,678,,,,,678,678,678,678,678", "678,,,,678,678,,,,,,,678,,,678,685,685,685,685,685,678,678,,685,685", ",,,685,,685,685,685,685,685,685,685,,,,,,685,685,685,685,685,685,685", ",,685,,,,,,685,685,,685,685,685,685,685,685,685,685,,685,685,685,,685", "685,,685,685,,,,,,,,,,,,,,,,,,,,,685,,,685,,,685,,685,,685,,,,685,,", ",,,,,685,,,,,685,685,685,685,685,685,,,,685,685,,,,,,,685,,,685,688", "688,688,,688,685,685,,688,688,,,,688,,688,688,688,688,688,688,688,,", ",,,688,688,688,688,688,688,688,,,688,,,,,,,688,,,688,688,688,688,688", "688,688,688,688,688,688,,688,688,,688,688,,,,,,,,,,,,,,,,,,,,,688,,", "688,,,688,,688,,688,,688,,688,,,,,,,,688,,,,,688,688,688,688,688,688", ",,,688,688,,,,,,,688,,,688,,688,,,,688,688,689,689,689,,689,,,,689,689", ",,,689,,689,689,689,689,689,689,689,,,,,,689,689,689,689,689,689,689", ",,689,,,,,,,689,,,689,689,689,689,689,689,689,689,689,689,689,,689,689", ",689,689,,,,,,,,,,,,,,,,,,,,,689,,,689,,,689,,689,,,,689,,689,,,,,,", ",689,,,,,689,689,689,689,689,689,,,,689,689,,,,,,,689,,,689,,689,,,", "689,689,690,690,690,690,690,,,,690,690,,,,690,,690,690,690,690,690,690", "690,,,,,,690,690,690,690,690,690,690,,,690,,,,,,690,690,,690,690,690", "690,690,690,690,690,,690,690,690,,690,690,,690,690,,,,,,,,,,,,,,,,,", ",,,690,,,690,,,690,,690,,690,,,,690,,,,,,,,690,,,,,690,690,690,690,690", "690,,,,690,690,,,,,,,690,,,690,691,691,691,691,691,690,690,,691,691", ",,,691,,691,691,691,691,691,691,691,,,,,,691,691,691,691,691,691,691", ",,691,,,,,,691,691,,691,691,691,691,691,691,691,691,,691,691,691,,691", "691,,691,691,,,,,,,,,,,,,,,,,,,,,691,,,691,,,691,,691,,691,,,,691,,", ",,,,,691,,,,,691,691,691,691,691,691,,,,691,691,,,,,,,691,,,691,696", "696,696,,696,691,691,,696,696,,,,696,,696,696,696,696,696,696,696,,", ",,,696,696,696,696,696,696,696,,,696,,,,,,,696,,,696,696,696,696,696", "696,696,,696,696,696,,696,696,,696,696,,,,,,,,,,,,,,,,,,,,,696,,,696", ",,696,,696,,,,,,696,,,,,,,,696,,,,,696,696,696,696,696,696,,,,696,696", ",,,,,,696,,,696,699,699,699,,699,696,696,,699,699,,,,699,,699,699,699", "699,699,699,699,,,,,,699,699,699,699,699,699,699,,,699,,,,,,,699,,,699", "699,699,699,699,699,699,,699,699,699,,699,699,,699,699,,,,,,,,,,,,,", ",,,,,,,699,,,699,,,699,,699,,,,,,699,,,,,,,,699,,,,,699,699,699,699", "699,699,,,,699,699,,,,,,,699,,,699,702,702,702,,702,699,699,,702,702", ",,,702,,702,702,702,702,702,702,702,,,,,,702,702,702,702,702,702,702", ",,702,,,,,,,702,,,702,702,702,702,702,702,702,,702,702,702,,702,702", ",987,,987,987,987,987,987,,,,,,,,,987,,,,,,,702,,,702,,,702,,702,,,", ",,,,987,,,,,,,987,987,987,987,702,702,702,702,702,702,,,,702,702,,,", ",,,702,,,702,715,715,715,,715,702,702,,715,715,,,,715,987,715,715,715", "715,715,715,715,,,,,,715,715,715,715,715,715,715,,,715,,,,,,,715,,,715", "715,715,715,715,715,715,,715,715,715,,715,715,,,,,,,,,,,,,,,,,,,,,,", ",715,,,715,,,715,,715,,,,,,,,,,,,,,,,,,,715,715,715,715,715,715,,,,715", "715,,,,,,,715,,,715,721,721,721,,721,715,715,,721,721,,,,721,,721,721", "721,721,721,721,721,,,,,,721,721,721,721,721,721,721,,,721,,,,,,,721", ",,721,721,721,721,721,721,721,,721,721,721,,721,721,,721,721,,,,,,,", ",,,,,,,,,,,,,721,,,721,,,721,,721,,721,,,,721,,,,,,,,721,,,,,721,721", "721,721,721,721,,,,721,721,,,,,,,721,,,721,760,760,760,,760,721,721", ",760,760,,,,760,,760,760,760,760,760,760,760,,,,,,760,760,760,760,760", "760,760,,,760,,,,,,,760,,,760,760,760,760,760,760,760,,760,760,760,", "760,760,,760,760,,,,,,,,,,,,,,,,,,,,,760,,,760,,,760,,760,,760,,,,760", ",,,,,,,760,,,,,760,760,760,760,760,760,,,,760,760,,,,,,,760,,,760,767", "767,767,,767,760,760,,767,767,,,,767,,767,767,767,767,767,767,767,,", ",,,767,767,767,767,767,767,767,,,767,,,,,,,767,,,767,767,767,767,767", "767,767,,767,767,767,,767,767,,767,767,,,,,,,,,,,,,,,,,,,,,767,,,767", ",,767,,767,,,,,,767,,,,,,,,767,,,,,767,767,767,767,767,767,,,,767,767", ",,,,,,767,,,767,772,772,772,772,772,767,767,,772,772,,,,772,,772,772", "772,772,772,772,772,,,,,,772,772,772,772,772,772,772,,,772,,,,,,772", "772,,772,772,772,772,772,772,772,772,,772,772,772,,772,772,,772,772", ",,,,,,,,,,,,,,,,,,,,772,,,772,,,772,,772,,772,,,,772,,,,,,,,772,,,,", "772,772,772,772,772,772,,,,772,772,,,,,,,772,,,772,776,776,776,776,776", "772,772,,776,776,,,,776,,776,776,776,776,776,776,776,,,,,,776,776,776", "776,776,776,776,,,776,,,,,,776,776,,776,776,776,776,776,776,776,776", ",776,776,776,,776,776,,776,776,,,,,,,,,,,,,,,,,,,,,776,,,776,,,776,", "776,,776,,,,776,,,,,,,,776,,,,,776,776,776,776,776,776,,,,776,776,,", ",,,,776,,,776,777,777,777,777,777,776,776,,777,777,,,,777,,777,777,777", "777,777,777,777,,,,,,777,777,777,777,777,777,777,,,777,,,,,,777,777", ",777,777,777,777,777,777,777,777,,777,777,777,,777,777,,777,777,,,,", ",,,,,,,,,,,,,,,,777,,,777,,,777,,777,,777,,,,777,,,,,,,,777,,,,,777", "777,777,777,777,777,,,,777,777,,,,,,,777,,,777,780,780,780,,780,777", "777,,780,780,,,,780,,780,780,780,780,780,780,780,,,,,,780,780,780,780", "780,780,780,,,780,,,,,,,780,,,780,780,780,780,780,780,780,,780,780,780", ",780,780,,780,780,,,,,,,,,,,,,,,,,,,,,780,,,780,,,780,,780,,,,,,780", ",,,,,,,780,,,,,780,780,780,780,780,780,,,,780,780,,,,,,,780,,,780,794", "794,794,794,794,780,780,,794,794,,,,794,,794,794,794,794,794,794,794", ",,,,,794,794,794,794,794,794,794,,,794,,,,,,794,794,,794,794,794,794", "794,794,794,794,,794,794,794,,794,794,,794,794,,,,,,,,,,,,,,,,,,,,,794", ",,794,,,794,,794,,794,,,,794,,,,,,,,794,,,,,794,794,794,794,794,794", ",,,794,794,,,,,,,794,,,794,799,799,799,,799,794,794,,799,799,,,,799", ",799,799,799,799,799,799,799,,,,,,799,799,799,799,799,799,799,,,799", ",,,,,,799,,,799,799,799,799,799,799,799,,799,799,799,,799,799,,799,799", ",,,,,,,,,,,,,,,,,,,,799,,,799,,,799,,799,,,,,,799,,,,,,,,799,,,,,799", "799,799,799,799,799,,,,799,799,,,,,,,799,,,799,800,800,800,,800,799", "799,,800,800,,,,800,,800,800,800,800,800,800,800,,,,,,800,800,800,800", "800,800,800,,,800,,,,,,,800,,,800,800,800,800,800,800,800,,800,800,800", ",800,800,,800,800,,,,,,,,,,,,,,,,,,,,,800,,,800,,,800,,800,,,,,,800", ",,,,,,,800,,,,,800,800,800,800,800,800,,,,800,800,,,,,,,800,,,800,801", "801,801,,801,800,800,,801,801,,,,801,,801,801,801,801,801,801,801,,", ",,,801,801,801,801,801,801,801,,,801,,,,,,,801,,,801,801,801,801,801", "801,801,,801,801,801,,801,801,,801,801,,,,,,,,,,,,,,,,,,,,,801,,,801", ",,801,,801,,,,,,801,,,,,,,,801,,,,,801,801,801,801,801,801,,,,801,801", ",,,,,,801,,,801,813,813,813,,813,801,801,,813,813,,,,813,,813,813,813", "813,813,813,813,,,,,,813,813,813,813,813,813,813,,,813,,,,,,,813,,,813", "813,813,813,813,813,813,,813,813,813,,813,813,,813,813,,,,,,,,,,,,,", ",,,,,,,813,,,813,,,813,,813,,,,,,813,,,,,,,,813,,,,,813,813,813,813", "813,813,,,,813,813,,,,,,,813,,,813,814,814,814,,814,813,813,,814,814", ",,,814,,814,814,814,814,814,814,814,,,,,,814,814,814,814,814,814,814", ",,814,,,,,,,814,,,814,814,814,814,814,814,814,,814,814,814,,814,814", ",814,814,,,,,,,,,,,,,,,,,,,,,814,,,814,,,814,,814,,,,,,814,,,,,,,,814", ",,,,814,814,814,814,814,814,,,,814,814,,,,,,,814,,,814,815,815,815,", "815,814,814,,815,815,,,,815,,815,815,815,815,815,815,815,,,,,,815,815", "815,815,815,815,815,,,815,,,,,,,815,,,815,815,815,815,815,815,815,,815", "815,815,,815,815,,815,815,,,,,,,,,,,,,,,,,,,,,815,,,815,,,815,,815,", ",,,,815,,,,,,,,815,,,,,815,815,815,815,815,815,,,,815,815,,,,,,,815", ",,815,838,838,838,838,838,815,815,,838,838,,,,838,,838,838,838,838,838", "838,838,,,,,,838,838,838,838,838,838,838,,,838,,,,,,838,838,,838,838", "838,838,838,838,838,838,,838,838,838,,838,838,,838,838,,,,,,,,,,,,,", ",,,,,,,838,,,838,,,838,,838,,838,,,,838,,,,,,,,838,,,,,838,838,838,838", "838,838,,,,838,838,,,,,,,838,,,838,865,865,865,,865,838,838,,865,865", ",,,865,,865,865,865,865,865,865,865,,,,,,865,865,865,865,865,865,865", ",,865,,,,,,,865,,,865,865,865,865,865,865,865,,865,865,865,,865,865", ",865,865,,,,,,,,,,,,,,,,,,,,,865,,,865,,,865,,865,,,,,,865,,,,,,,,865", ",,,,865,865,865,865,865,865,,,,865,865,,,,,,,865,,,865,867,867,867,867", "867,865,865,,867,867,,,,867,,867,867,867,867,867,867,867,,,,,,867,867", "867,867,867,867,867,,,867,,,,,,867,867,,867,867,867,867,867,867,867", "867,,867,867,867,,867,867,,867,867,,,,,,,,,,,,,,,,,,,,,867,,,867,,,867", ",867,,867,,,,867,,,,,,,,867,,,,,867,867,867,867,867,867,,,,867,867,", ",,,,,867,,,867,868,868,868,868,868,867,867,,868,868,,,,868,,868,868", "868,868,868,868,868,,,,,,868,868,868,868,868,868,868,,,868,,,,,,868", "868,,868,868,868,868,868,868,868,868,,868,868,868,,868,868,,868,868", ",,,,,,,,,,,,,,,,,,,,868,,,868,,,868,,868,,868,,,,868,,,,,,,,868,,,,", "868,868,868,868,868,868,,,,868,868,,,,,,,868,,,868,893,893,893,,893", "868,868,,893,893,,,,893,,893,893,893,893,893,893,893,,,,,,893,893,893", "893,893,893,893,,,893,,,,,,,893,,,893,893,893,893,893,893,893,,893,893", "893,,893,893,,893,893,,,,,,,,,,,,,,,,,,,,,893,,,893,,,893,,893,,,,,", "893,,,,,,,,893,,,,,893,893,893,893,893,893,,,,893,893,,,,,,,893,,,893", "907,907,907,,907,893,893,,907,907,,,,907,,907,907,907,907,907,907,907", ",,,,,907,907,907,907,907,907,907,,,907,,,,,,,907,,,907,907,907,907,907", "907,907,,907,907,907,,907,907,,907,907,,,,,,,,,,,,,,,,,,,,,907,,,907", ",,907,,907,,,,,,907,,,,,,,,907,,,,,907,907,907,907,907,907,,,,907,907", ",,,,,,907,,,907,908,908,908,,908,907,907,,908,908,,,,908,,908,908,908", "908,908,908,908,,,,,,908,908,908,908,908,908,908,,,908,,,,,,,908,,,908", "908,908,908,908,908,908,,908,908,908,,908,908,,908,908,,,,,,,,,,,,,", ",,,,,,,908,,,908,,,908,,908,,,,,,908,,,,,,,,908,,,,,908,908,908,908", "908,908,,,,908,908,,,,,,,908,,,908,909,909,909,,909,908,908,,909,909", ",,,909,,909,909,909,909,909,909,909,,,,,,909,909,909,909,909,909,909", ",,909,,,,,,,909,,,909,909,909,909,909,909,909,,909,909,909,,909,909", ",909,909,,,,,,,,,,,,,,,,,,,,,909,,,909,,,909,,909,,,,,,909,,,,,,,,909", ",,,,909,909,909,909,909,909,,,,909,909,,,,,,,909,,,909,915,915,915,", "915,909,909,,915,915,,,,915,,915,915,915,915,915,915,915,,,,,,915,915", "915,915,915,915,915,,,915,,,,,,,915,,,915,915,915,915,915,915,915,915", "915,915,915,,915,915,,915,915,,,,,,,,,,,,,,,,,,,,,915,,,915,,,915,,915", ",,,915,,915,,,,,,,,915,,,,,915,915,915,915,915,915,,,,915,915,,,,,,", "915,,,915,,915,,,,915,915,919,919,919,919,919,,,,919,919,,,,919,,919", "919,919,919,919,919,919,,,,,,919,919,919,919,919,919,919,,,919,,,,,", "919,919,,919,919,919,919,919,919,919,919,,919,919,919,,919,919,,919", "919,,,,,,,,,,,,,,,,,,,,,919,,,919,,,919,,919,,919,,,,919,,,,,,,,919", ",,,,919,919,919,919,919,919,,,,919,919,,,,,,,919,,,919,923,923,923,", "923,919,919,,923,923,,,,923,,923,923,923,923,923,923,923,,,,,,923,923", "923,923,923,923,923,,,923,,,,,,,923,,,923,923,923,923,923,923,923,,923", "923,923,,923,923,,,,,,,,,,,,,,,,,,,,,,,,923,,,923,,,923,,923,,,,,,,", ",,,,,,,,,,,923,923,923,923,923,923,,,,923,923,,,,,,,923,,,923,938,938", "938,,938,923,923,,938,938,,,,938,,938,938,938,938,938,938,938,,,,,,938", "938,938,938,938,938,938,,,938,,,,,,,938,,,938,938,938,938,938,938,938", ",938,938,938,,938,938,,938,938,,,,,,,,,,,,,,,,,,,,,938,,,938,,,938,", "938,,938,,,,938,,,,,,,,938,,,,,938,938,938,938,938,938,,,,938,938,,", ",,,,938,,,938,939,939,939,939,939,938,938,,939,939,,,,939,,939,939,939", "939,939,939,939,,,,,,939,939,939,939,939,939,939,,,939,,,,,,939,939", ",939,939,939,939,939,939,939,939,,939,939,939,,939,939,,939,939,,,,", ",,,,,,,,,,,,,,,,939,,,939,,,939,,939,,939,,,,939,,,,,,,,939,,,,,939", "939,939,939,939,939,,,,939,939,,,,,,,939,,,939,942,942,942,942,942,939", "939,,942,942,,,,942,,942,942,942,942,942,942,942,,,,,,942,942,942,942", "942,942,942,,,942,,,,,,942,942,,942,942,942,942,942,942,942,942,,942", "942,942,,942,942,,942,942,,,,,,,,,,,,,,,,,,,,,942,,,942,,,942,,942,", "942,,,,942,,,,,,,,942,,,,,942,942,942,942,942,942,,,,942,942,,,,,,,942", ",,942,965,965,965,965,965,942,942,,965,965,,,,965,,965,965,965,965,965", "965,965,,,,,,965,965,965,965,965,965,965,,,965,,,,,,965,965,,965,965", "965,965,965,965,965,965,,965,965,965,,965,965,,965,965,,,,,,,,,,,,,", ",,,,,,,965,,,965,,,965,,965,,965,,,,965,,,,,,,,965,,,,,965,965,965,965", "965,965,,,,965,965,,,,,,,965,,,965,978,978,978,978,978,965,965,,978", "978,,,,978,,978,978,978,978,978,978,978,,,,,,978,978,978,978,978,978", "978,,,978,,,,,,978,978,,978,978,978,978,978,978,978,978,,978,978,978", ",978,978,,978,978,,,,,,,,,,,,,,,,,,,,,978,,,978,,,978,,978,,978,,,,978", ",,,,,,,978,,,,,978,978,978,978,978,978,,,,978,978,,,,,,,978,,,978,983", "983,983,983,983,978,978,,983,983,,,,983,,983,983,983,983,983,983,983", ",,,,,983,983,983,983,983,983,983,,,983,,,,,,983,983,,983,983,983,983", "983,983,983,983,,983,983,983,,983,983,,983,983,,,,,,,,,,,,,,,,,,,,,983", ",,983,,,983,,983,,983,,,,983,,,,,,,,983,,,,,983,983,983,983,983,983", ",,,983,983,,,,,,,983,,,983,996,996,996,996,996,983,983,,996,996,,,,996", ",996,996,996,996,996,996,996,,,,,,996,996,996,996,996,996,996,,,996", ",,,,,996,996,,996,996,996,996,996,996,996,996,,996,996,996,,996,996", ",996,996,,,,,,,,,,,,,,,,,,,,,996,,,996,,,996,,996,,996,,,,996,,,,,,", ",996,,,,,996,996,996,996,996,996,,,,996,996,,,,,,,996,,,996,1000,1000", "1000,,1000,996,996,,1000,1000,,,,1000,,1000,1000,1000,1000,1000,1000", "1000,,,,,,1000,1000,1000,1000,1000,1000,1000,,,1000,,,,,,,1000,,,1000", "1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,,1000,1000,,1000,1000", ",,,,,,,,,,,,,,,,,,,,1000,,,1000,,,1000,,1000,,1000,,,,1000,,,,,,,,1000", ",,,444,1000,1000,1000,1000,1000,1000,444,444,444,1000,1000,,444,444", ",444,,1000,,,1000,,1000,,444,,1000,1000,,,,,,,,444,444,,444,444,444", "444,444,,,,,,,,,,,,,,,,,,,,,,444,444,444,444,444,444,444,444,444,444", "444,444,444,444,444,,,444,444,444,,444,,,,444,,,,,,444,,444,,444,444", "444,444,444,444,444,,444,444,444,,,,,,,,,,,,,444,444,,444,,444,,446", "444,,444,,,444,446,446,446,,,,446,446,,446,,,,,,,,,,,,,,,,,,,,446,446", ",446,446,446,446,446,,,,,,,,,,,,,,,,,,,,,,446,446,446,446,446,446,446", "446,446,446,446,446,446,446,446,,,446,446,446,,446,,,,446,,,,,,446,", "446,,446,446,446,446,446,446,446,,446,,446,,,,,,,,,,,,,446,446,,446", ",446,,668,446,,446,,,446,668,668,668,,,668,668,668,,668,,,,,,,,,668", "668,668,,,,,,,,,668,668,,668,668,668,668,668,,,,,,,,,,,,,,,,,,,,,,668", "668,668,668,668,668,668,668,668,668,668,668,668,668,668,,,668,668,668", ",668,668,,,668,,668,,668,,668,,668,,668,668,668,668,668,668,668,,668", "668,668,,,,,,,,,,,,,668,668,668,668,,668,,669,668,,668,,,668,669,669", "669,,,669,669,669,,669,,,,,,,,,,669,669,,,,,,,,,669,669,,669,669,669", "669,669,,,,,,,,,,,,,,,,,,,,,,669,669,669,669,669,669,669,669,669,669", "669,669,669,669,669,,,669,669,669,,669,669,,,669,,669,,669,,669,,669", ",669,669,669,669,669,669,669,,669,,669,,,,,,,,,,,,,669,669,669,669,", "669,,25,669,,669,,,669,25,25,25,,,25,25,25,,25,,,,,,,,,25,25,25,,,,", ",,,,25,25,,25,25,25,25,25,,,,,,,,,,,,,,,,,,,,,,25,25,25,25,25,25,25", "25,25,25,25,25,25,25,25,,,25,25,25,,,25,,25,25,,25,,25,,25,,25,,25,25", "25,25,25,25,25,,25,25,25,,,,,,,,,,,,,25,25,25,25,26,25,,,25,,25,26,26", "26,,,26,26,26,,26,,,,,,,,,,26,26,,,,,,,,,26,26,,26,26,26,26,26,,,,,", ",,,,,,,,,,,,,,,,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,,,26,26", "26,,,26,,26,26,,26,,26,,26,,26,,26,26,26,26,26,26,26,,26,,26,,,,,,,", ",,,,,26,26,26,26,51,26,,,26,,26,51,51,51,,,51,51,51,,51,,,,,,,,,,51", "51,51,,,,,,,,51,51,,51,51,51,51,51,,,,,,,,,,,,,,,,,,,,,,51,51,51,51", "51,51,51,51,51,51,51,51,51,51,51,,,51,51,51,,,51,,,51,,51,,51,,51,,51", ",51,51,51,51,51,51,51,,51,,51,,,,,,,,,,,,,51,51,51,51,440,51,,51,51", ",51,440,440,440,,,440,440,440,,440,,,,,,,,,440,440,440,,,,,,,,,440,440", ",440,440,440,440,440,,,,,,,,,,,,,,,,,,,,,,440,440,440,440,440,440,440", "440,440,440,440,440,440,440,440,,,440,440,440,,,440,,440,440,,440,,440", ",440,,440,,440,440,440,440,440,440,440,,440,440,440,,,,,,,,,,,,,440", "440,440,440,450,440,,,440,,440,450,450,450,,,450,450,450,,450,,,,,,", ",,450,450,450,,,,,,,,,450,450,,450,450,450,450,450,,,,,,,,,,,,,,,,,", ",,,,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,,,450", "450,450,,,450,,450,450,,450,,450,,450,,450,,450,450,450,450,450,450", "450,,450,450,450,,,,,,,,,,,,,450,450,450,450,500,450,,,450,,450,500", "500,500,,,500,500,500,,500,,,,,,,,,,500,,,,,,,,,,500,500,,500,500,500", "500,500,,,,,,,,,,,,501,,,,,,,501,501,501,,,501,501,501,,501,,,,,500", "500,,,,501,,,500,,,,,500,500,501,501,,501,501,501,501,501,,,,,,,,,,", ",500,,,,,,,,,,,,,500,,500,,,500,,,501,501,,502,,,,,501,,502,502,502", "501,501,502,502,502,,502,,,,,,,,,,502,,,,,501,,,,,502,502,,502,502,502", "502,502,501,,501,,,501,202,202,,,202,,,,,,,,,202,202,202,202,202,202", "202,202,202,,,202,202,502,502,,,202,202,202,202,502,,,,,502,502,,,,", "202,202,,202,202,202,202,202,202,202,202,202,202,202,,502,202,,,,,,", ",,,,,502,,502,,,502,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7", ",,,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,,7,,,,,,,,,7,7,7", "7,7,7,7,7,7,,,7,7,,,,,7,7,7,7,,,,,,,,,,,,7,7,,7,7,7,7,7,7,7,7,7,7,7", ",,7,7,,,,,,,,,,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,,,", "8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,,,8,,,,,,,,,8,8,8,8,8", "8,8,8,8,,,8,8,,,,,8,8,8,8,,,,,,,,,,,,8,8,,8,8,8,8,8,8,8,8,8,8,8,,,8", "8,,,,,,,,,,8,423,423,423,423,423,423,423,423,423,423,423,423,423,423", "423,423,423,423,423,423,423,423,423,423,,,,423,423,423,423,423,423,423", "423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,,,423", ",,,,,,,,423,423,423,423,423,423,423,423,423,,,423,423,,,,,423,423,423", "423,,,,,,,,,,,,423,423,,423,423,423,423,423,423,423,423,423,423,423", ",,423,423,,,,,,,,,,423,427,427,427,427,427,427,427,427,427,427,427,427", "427,427,427,427,427,427,427,427,427,427,427,427,,,,427,427,427,427,427", "427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427", "427,,,427,,,,,,,,,427,427,427,427,427,427,427,427,427,,,427,427,,,,", "427,427,427,427,,,,,,,,,,,,427,427,,427,427,427,427,427,427,427,427", "427,427,427,,,427,427,,,,,,,,,,427,66,66,66,66,66,66,66,66,66,66,66", "66,66,66,66,66,66,66,66,66,66,66,66,66,,,,66,66,66,66,66,66,66,66,66", "66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,,66,,,,,,,66,66,66", "66,66,66,66,66,66,,,66,66,,,,,66,66,66,66,,,,,,66,,,,,,66,66,,66,66", "66,66,66,66,66,66,66,66,66,,,66,80,80,80,80,80,80,80,80,80,80,80,80", "80,80,80,80,80,80,80,80,80,80,80,80,,,,80,80,80,80,80,80,80,80,80,80", "80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,,80,,,,,,,80,80,80,80", "80,80,80,80,80,,,80,80,,,,,80,80,80,80,,,,,,,,,,,,80,80,,80,80,80,80", "80,80,80,80,80,80,80,,,80,193,193,193,193,193,193,193,193,193,193,193", "193,193,193,193,193,193,193,193,193,193,193,193,193,,,,193,193,193,193", "193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193", "193,193,193,193,193,,193,,,,,,,193,193,193,193,193,193,193,193,193,", ",193,193,,,,,193,193,193,193,,,,,,,,,,,,193,193,,193,193,193,193,193", "193,193,193,193,193,193,,,193,791,791,791,791,791,791,791,791,791,791", "791,791,791,791,791,791,791,791,791,791,791,791,791,791,,,,791,791,791", "791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791", "791,791,791,,,791,,,,,,,,,791,791,791,791,791,791,791,791,791,,,791", "791,,,,,791,791,791,791,,,,,,,,,,,,791,791,,791,791,791,791,791,791", "791,791,791,791,791,201,201,791,,201,,,,,,,,,201,201,201,201,201,201", "201,201,201,,,201,201,,,,,201,201,201,201,,,,,,201,,,,,,201,201,,201", "201,201,201,201,201,201,201,201,201,201,203,203,201,,203,,,,,,,,,203", "203,203,203,203,203,203,203,203,,,203,203,,,,,203,203,203,203,,,,,,", ",,,,,203,203,,203,203,203,203,203,203,203,203,203,203,203,249,249,203", ",249,,,,,,,,,249,249,249,249,249,249,249,249,249,,,249,249,,,,,249,249", "249,249,,,,,,,,,,,,249,249,,249,249,249,249,249,249,249,249,249,249", "249,250,250,249,,250,,,,,,,,,250,250,250,250,250,250,250,250,250,,,250", "250,,,,,250,250,250,250,,,,,,,,,,,,250,250,,250,250,250,250,250,250", "250,250,250,250,250,251,251,250,,251,,,,,,,,,251,251,251,251,251,251", "251,251,251,,,251,251,,,,,251,251,251,251,,,,,,,,,,,,251,251,,251,251", "251,251,251,251,251,251,251,251,251,463,463,251,,463,,,,,,,,,463,463", "463,463,463,463,463,463,463,,,463,463,,,,,463,463,463,463,,,,,,463,", ",,,,463,463,,463,463,463,463,463,463,463,463,463,463,463,464,464,463", ",464,,,,,,,,,464,464,464,464,464,464,464,464,464,,,464,464,,,,,464,464", "464,464,,,,,,,,,,,,464,464,,464,464,464,464,464,464,464,464,464,464", "464,535,535,464,,535,,,,,,,,,535,535,535,535,535,535,535,535,535,,,535", "535,,,,,535,535,535,535,,,,,,535,,,,,,535,535,,535,535,535,535,535,535", "535,535,535,535,535,536,536,535,,536,,,,,,,,,536,536,536,536,536,536", "536,536,536,,,536,536,,,,,536,536,536,536,,,,,,,,,,,,536,536,,536,536", "536,536,536,536,536,536,536,536,536,538,538,536,,538,,,,,,,,,538,538", "538,538,538,538,538,538,538,,,538,538,,,,,538,538,538,538,,,,,,,,,,", ",538,538,,538,538,538,538,538,538,538,538,538,538,538,549,549,538,,549", ",,,,,,,,549,549,549,549,549,549,549,549,549,,,549,549,,,,,549,549,549", "549,,,,,,549,,,,,,549,549,,549,549,549,549,549,549,549,549,549,549,549", "550,550,549,,550,,,,,,,,,550,550,550,550,550,550,550,550,550,,,550,550", ",,,,550,550,550,550,,,,,,,,,,,,550,550,,550,550,550,550,550,550,550", "550,550,550,550,607,607,550,,607,,,,,,,,,607,607,607,607,607,607,607", "607,607,,,607,607,,,,,607,607,607,607,,,,,,607,,,,,,607,607,,607,607", "607,607,607,607,607,607,607,607,607,608,608,607,,608,,,,,,,,,608,608", "608,608,608,608,608,608,608,,,608,608,,,,,608,608,608,608,,,,,,,,,,", ",608,608,,608,608,608,608,608,608,608,608,608,608,608,614,614,608,,614", ",,,,,,,,614,614,614,614,614,614,614,614,614,,,614,614,,,,,614,614,614", "614,,,,,,,,,,,,614,614,,614,614,614,614,614,614,614,614,614,614,614", "616,616,614,,616,,,,,,,,,616,616,616,616,616,616,616,616,616,,,616,616", ",,,,616,616,616,616,,,,,,616,,,,,,616,616,,616,616,616,616,616,616,616", "616,616,616,616,742,742,616,,742,,,,,,,,,742,742,742,742,742,742,742", "742,742,,,742,742,,,,,742,742,742,742,,,,,,,,,,,,742,742,,742,742,742", "742,742,742,742,742,742,742,742,1001,1001,742,,1001,,,,,,,,,1001,1001", "1001,1001,1001,1001,1001,1001,1001,,,1001,1001,,,,,1001,1001,1001,1001", ",,,,,1001,,,,,,1001,1001,,1001,1001,1001,1001,1001,1001,1001,1001,1001", "1001,1001,1002,1002,1001,,1002,,,,,,,,,1002,1002,1002,1002,1002,1002", "1002,1002,1002,,,1002,1002,,,,,1002,1002,1002,1002,,,,,,,,,,,,1002,1002", ",1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,,,1002"]; racc_action_check = arr = Opal.get('Array').$new(25645, nil); idx = 0; ($a = ($c = clist).$each, $a.$$p = (TMP_3 = function(str){var self = TMP_3.$$s || this, $d, $e, TMP_4; if (str == null) str = nil; return ($d = ($e = str.$split(",", -1)).$each, $d.$$p = (TMP_4 = function(i){var self = TMP_4.$$s || this, $f; if (i == null) i = nil; if ((($f = i['$empty?']()) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { } else { arr['$[]='](idx, i.$to_i()) }; return idx = $rb_plus(idx, 1);}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $d).call($e)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($c); racc_action_pointer = [-2, 14, nil, -46, nil, 790, -84, 23598, 23719, -49, nil, -58, 31, 630, 244, 2, 310, nil, 129, 260, 1860, 130, nil, 354, -19, 22702, 22829, 391, 529, 667, nil, 805, 936, 1067, nil, 72, 301, 148, 441, 1198, 1329, 1460, 92, 714, nil, nil, nil, nil, nil, nil, nil, 22956, nil, 1591, 1722, 1860, -15, 949, 1998, 2129, nil, nil, 2260, 2391, 2522, nil, 24082, nil, nil, nil, nil, nil, -15, nil, nil, nil, nil, nil, 100, 132, 24192, nil, nil, nil, 493, 2653, nil, nil, 2791, nil, nil, nil, nil, nil, nil, nil, nil, nil, 273, nil, 2929, nil, nil, nil, 3060, 3191, 3322, 3453, 3584, 3715, nil, 513, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 24302, 181, nil, 3846, 3977, 4108, 4239, 4377, 24471, 23471, 24530, 4515, 4646, 4777, 4908, nil, 831, -63, 261, -51, 201, 293, 5039, 5170, nil, nil, 5301, 301, 5432, 5563, 5694, 5825, 5956, 6087, 6218, 6349, 6480, 6611, 6742, 6873, 7004, 7135, 7266, 7397, 7528, 7659, 7790, 7921, 8052, 8183, 8314, 8445, 8576, nil, nil, nil, 24589, 24648, 24707, 323, 8707, 8845, nil, nil, nil, nil, nil, nil, nil, 8983, nil, 2653, nil, 302, 306, nil, 9121, 366, 9252, nil, nil, 9383, 9514, nil, nil, 146, 970, 395, 9645, 438, 465, 431, 9776, 9907, 17, 899, 519, 39, nil, 502, 483, -14, nil, nil, nil, 521, 515, 495, 10038, nil, 430, 575, 595, 931, nil, 597, nil, 10169, nil, 10300, 582, 543, nil, 558, -89, -47, 591, 581, 114, 606, nil, nil, -21, 1080, nil, nil, nil, 569, 575, 600, 603, nil, 607, 622, nil, nil, nil, 700, nil, 10431, nil, nil, nil, nil, nil, nil, nil, 821, nil, nil, nil, 717, nil, nil, 718, 602, -7, 0, 10562, 10693, 349, 350, 645, -2, 1030, 722, 0, 753, nil, nil, 391, 724, nil, 1064, nil, 68, nil, nil, 10824, 148, 307, 323, 450, 532, 575, 580, 588, nil, 626, nil, 10955, nil, 285, nil, 391, nil, 419, 666, 529, nil, 667, -33, nil, 556, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 682, 23840, nil, nil, nil, 23961, 683, nil, 668, nil, 11086, 669, nil, 2791, 705, 708, 568, 623, 23083, nil, nil, nil, 22182, 713, 22312, nil, 11217, 11355, 23210, nil, nil, nil, 3191, nil, 667, nil, nil, 391, nil, nil, nil, 24766, 24825, 11493, 11631, 98, 11769, 11900, 12031, 44, nil, 4646, 4777, 260, 418, 739, 748, 749, 753, 2516, 2929, 1461, 4908, 1591, 1998, 2129, 2260, 5039, 5170, 5301, 5432, 5563, 669, 829, 5694, 5825, 12162, -35, 23337, 23392, 23471, -34, nil, 696, nil, nil, 695, 715, nil, -7, 166, 752, nil, nil, 12293, nil, 12431, nil, 12569, nil, 167, nil, nil, nil, 12700, 754, 720, nil, nil, 722, 12831, 761, 12962, 24884, 24943, 13100, 25002, 170, 771, nil, nil, 13238, 738, nil, 13369, 13500, 13631, 25061, 25120, 3322, 13762, 860, 861, 749, 795, nil, nil, 13893, nil, nil, 14031, nil, nil, nil, nil, 14169, 14300, 796, nil, 2404, nil, nil, 14431, 471, nil, nil, 582, 2535, nil, 826, nil, nil, 1161, 838, nil, 805, nil, 966, nil, 771, 686, nil, nil, 14562, 894, nil, nil, 14693, 203, 204, 894, 902, 14824, nil, 14955, 25179, 25238, 15093, 16, nil, 1224, nil, 25297, 15231, 25356, nil, nil, 15369, 585, 15500, nil, 9789, nil, nil, nil, 31, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 244, nil, nil, nil, 786, nil, nil, nil, nil, nil, 802, 15631, 649, 202, 15762, 15893, 839, nil, nil, nil, 16024, 841, nil, 16155, 842, nil, 16286, 16417, 283, 297, 22442, 22572, 849, 853, 529, nil, 1722, nil, 10051, nil, 16548, nil, nil, nil, nil, nil, nil, 16679, nil, 858, 16810, 16948, 17086, 17217, nil, 823, nil, 863, 17348, nil, nil, 17479, 1000, -25, 17610, 826, nil, 869, 207, 229, 874, 252, 260, 883, 881, 888, 852, 17741, 3453, 914, 915, 66, 968, 17872, nil, 901, nil, 292, nil, 885, 989, nil, nil, nil, 874, 880, 1292, 891, nil, nil, 897, 899, nil, 900, 25415, nil, nil, 938, 1097, 907, 1214, 740, nil, 1020, nil, nil, nil, nil, nil, 1026, nil, 1027, 18003, 963, 29, 40, 80, 121, 964, 18134, 1722, nil, 970, 968, 18265, 609, nil, 212, 18396, 18527, 10444, 623, 18658, nil, 937, 940, nil, 941, 946, 950, nil, 943, nil, 24412, 990, 831, 18789, nil, nil, nil, 955, 18920, 19051, 19182, nil, 3584, nil, 3715, nil, nil, 3846, nil, 3977, nil, 4108, 19313, 19444, 19575, 299, 385, nil, 963, 986, 970, 1085, 985, nil, 977, 994, 1099, nil, nil, nil, 983, 232, nil, nil, nil, 1102, nil, 19706, 985, 1026, nil, nil, nil, nil, nil, nil, 1219, nil, 1350, nil, nil, 10837, nil, 1481, nil, nil, 1033, nil, nil, 691, 1345, 1000, 1120, nil, 19837, 1122, 19968, 20099, nil, nil, 45, 50, 1355, 229, nil, 1128, nil, nil, 1129, 1130, 1019, nil, nil, 558, nil, nil, 12844, nil, 13251, nil, 1612, nil, 20230, nil, nil, nil, nil, nil, nil, nil, 1033, 1018, nil, 4239, nil, 4377, 20361, 20492, 20623, 849, nil, 1040, nil, nil, 20754, nil, nil, nil, 20892, nil, nil, 72, 21023, nil, 1028, 1030, 1031, 1033, 1036, 1581, 1038, 1607, nil, 76, nil, 1156, 1157, 21154, 21285, nil, nil, 21416, nil, nil, 1077, nil, 1043, nil, 1045, 1046, 1047, 1048, nil, 1060, nil, 14444, nil, 4515, 419, nil, nil, nil, nil, nil, 21547, 80, 1423, 1133, 84, nil, nil, 2019, nil, nil, nil, 1988, 1064, 21678, nil, nil, nil, 527, 21809, 1182, nil, nil, 17623, nil, 2150, nil, 2281, nil, 2950, nil, nil, 21940, nil, 1226, 1187, 22071, 25474, 25533, 88, 1072, 1077, 743, nil, nil, nil, 1198, nil, 1084, 1085, 1086, 1096, 1214, nil, nil, 1132, 96, 110, 176, 211, nil, nil, nil, 3081, nil, nil, nil, nil, nil, 129, 1099, nil]; racc_action_default = [-3, -590, -1, -578, -4, -6, -590, -590, -590, -590, -25, -590, -590, -590, -278, -590, -37, -40, -590, -590, -45, -47, -48, -49, -259, -259, -259, -293, -331, -332, -67, -10, -71, -79, -81, -590, -476, -590, -590, -590, -590, -590, -580, -237, -271, -272, -273, -274, -275, -276, -277, -568, -280, -284, -589, -558, -301, -589, -590, -590, -306, -309, -578, -590, -590, -323, -590, -333, -334, -419, -420, -421, -422, -423, -589, -426, -589, -589, -589, -589, -589, -453, -459, -460, -590, -465, -466, -467, -468, -469, -470, -471, -472, -473, -474, -475, -478, -479, -590, -2, -579, -585, -586, -587, -590, -590, -590, -590, -590, -3, -13, -590, -108, -109, -110, -111, -112, -113, -114, -117, -118, -119, -120, -121, -122, -123, -124, -125, -126, -127, -128, -129, -130, -131, -132, -133, -134, -135, -136, -137, -138, -139, -140, -141, -142, -143, -144, -145, -146, -147, -148, -149, -150, -151, -152, -153, -154, -155, -156, -157, -158, -159, -160, -161, -162, -163, -164, -165, -166, -167, -168, -169, -170, -171, -172, -173, -174, -175, -176, -177, -178, -179, -180, -181, -182, -183, -184, -185, -186, -187, -188, -189, -190, -590, -18, -115, -10, -590, -590, -589, -589, -590, -590, -590, -590, -590, -590, -590, -43, -590, -476, -590, -278, -590, -590, -10, -590, -44, -227, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -590, -234, -388, -390, -590, -590, -590, -54, -589, -590, -300, -394, -402, -404, -62, -400, -63, -590, -64, -238, -254, -263, -263, -258, -590, -264, -590, -589, -560, -590, -590, -65, -66, -578, -11, -67, -10, -590, -590, -72, -75, -10, -476, -590, -590, -278, -293, -296, -580, -590, -331, -332, -335, -401, -590, -77, -590, -83, -288, -461, -462, -590, -212, -213, -228, -590, -581, -10, -282, -580, -239, -580, -582, -582, -590, -590, -582, -590, -302, -303, -590, -590, -352, -353, -360, -589, -520, -555, -555, -370, -589, -589, -387, -485, -486, -488, -489, -493, -494, -519, -521, -522, -523, -524, -525, -590, -542, -547, -548, -550, -551, -552, -590, -46, -590, -590, -590, -590, -578, -590, -579, -476, -590, -590, -278, -590, -527, -528, -104, -590, -106, -590, -278, -590, -320, -476, -590, -108, -109, -146, -147, -163, -168, -175, -178, -326, -590, -556, -590, -424, -590, -439, -590, -441, -590, -590, -590, -431, -590, -590, -437, -590, -452, -454, -455, -456, -457, -463, -464, 1036, -5, -588, -19, -20, -21, -22, -23, -590, -590, -15, -16, -17, -590, -590, -26, -35, -36, -590, -590, -27, -193, -590, -590, -569, -570, -259, -397, -571, -572, -569, -259, -570, -399, -574, -575, -259, -569, -570, -33, -201, -34, -590, -38, -39, -191, -264, -41, -42, -590, -590, -589, -589, -288, -590, -590, -590, -590, -299, -202, -203, -204, -205, -206, -207, -208, -209, -214, -215, -216, -217, -218, -219, -220, -221, -222, -223, -224, -225, -226, -229, -230, -231, -232, -590, -589, -259, -259, -259, -589, -55, -580, -249, -250, -263, -263, -260, -589, -589, -590, -295, -255, -590, -256, -590, -261, -590, -265, -590, -563, -565, -9, -579, -590, -68, -286, -84, -73, -590, -590, -589, -590, -590, -589, -590, -288, -590, -461, -462, -590, -80, -85, -590, -590, -590, -590, -590, -233, -590, -411, -590, -580, -590, -240, -241, -584, -583, -243, -584, -291, -292, -559, -349, -10, -10, -590, -351, -590, -372, -383, -590, -590, -368, -369, -590, -378, -380, -590, -385, -487, -492, -590, -520, -590, -529, -590, -531, -533, -540, -549, -553, -10, -336, -337, -338, -10, -590, -590, -590, -590, -10, -406, -589, -590, -590, -589, -288, -315, -104, -105, -590, -589, -590, -318, -480, -590, -590, -590, -324, -518, -328, -576, -577, -580, -425, -440, -443, -444, -446, -427, -442, -428, -429, -430, -590, -433, -435, -436, -590, -458, -7, -14, -116, -24, -270, -590, -289, -290, -590, -590, -58, -247, -248, -395, -590, -60, -398, -590, -56, -396, -590, -590, -569, -570, -569, -570, -590, -590, -191, -298, -590, -363, -580, -365, -10, -50, -391, -51, -392, -52, -393, -10, -245, -590, -251, -253, -10, -10, -294, -263, -262, -266, -590, -561, -562, -590, -12, -68, -590, -76, -82, -590, -569, -570, -589, -573, -287, -590, -590, -589, -78, -590, -200, -210, -211, -590, -589, -589, -281, -590, -285, -582, -244, -590, -590, -350, -361, -371, -589, -589, -362, -555, -495, -554, -589, -589, -543, -589, -590, -288, -526, -590, -590, -538, -590, -589, -339, -589, -307, -340, -341, -342, -310, -590, -313, -590, -590, -590, -569, -570, -573, -287, -590, -590, -104, -107, -573, -590, -10, -590, -482, -590, -10, -10, -518, -590, -491, -496, -555, -555, -501, -503, -503, -503, -517, -520, -545, -590, -590, -590, -10, -432, -434, -438, -268, -590, -590, -590, -30, -196, -31, -197, -59, -32, -198, -61, -199, -57, -192, -590, -590, -590, -290, -289, -235, -343, -590, -580, -590, -590, -246, -263, -590, -590, -257, -267, -564, -74, -289, -290, -86, -297, -589, -358, -10, -412, -589, -413, -414, -283, -242, -354, -355, -590, -381, -590, -384, -367, -590, -375, -590, -377, -386, -287, -530, -532, -536, -590, -541, -590, -356, -590, -590, -10, -10, -312, -314, -590, -289, -96, -590, -289, -590, -481, -321, -590, -590, -580, -484, -490, -590, -499, -500, -590, -510, -590, -513, -590, -515, -590, -329, -557, -445, -448, -449, -450, -451, -590, -269, -28, -194, -29, -195, -590, -590, -590, -590, -364, -590, -389, -53, -252, -403, -405, -8, -10, -418, -359, -590, -590, -416, -589, -589, -589, -589, -534, -590, -539, -590, -304, -590, -305, -590, -590, -590, -10, -316, -319, -10, -325, -327, -590, -497, -555, -502, -503, -503, -503, -503, -546, -503, -544, -518, -447, -236, -580, -345, -347, -348, -366, -417, -10, -476, -590, -590, -278, -415, -382, -590, -373, -376, -379, -590, -537, -10, -308, -311, -266, -589, -10, -590, -483, -498, -590, -506, -590, -508, -590, -511, -590, -514, -516, -10, -344, -590, -411, -589, -590, -590, -288, -589, -535, -589, -407, -408, -409, -590, -322, -503, -503, -503, -503, -590, -346, -410, -590, -569, -570, -573, -287, -374, -357, -317, -590, -504, -507, -509, -512, -330, -289, -503, -505]; clist = ["13,390,5,265,265,265,603,115,115,256,260,554,504,327,720,408,310,544", "209,209,319,12,284,337,297,297,378,209,209,209,316,13,288,288,100,359", "360,458,103,363,863,431,517,440,445,450,777,576,577,455,730,300,12,209", "209,297,297,99,209,209,740,280,209,367,376,836,115,752,756,266,266,266", "110,195,395,595,599,788,613,2,115,417,418,419,420,118,118,587,859,953", "217,500,501,502,558,561,866,103,565,282,13,960,5,962,209,209,209,209", "13,13,421,5,663,629,14,820,364,1,862,639,415,12,918,697,267,267,267", "194,408,12,12,397,399,372,423,406,678,263,276,277,685,498,694,909,694", "14,290,290,690,691,505,686,321,573,392,320,323,324,580,582,370,617,680", "682,684,436,437,697,391,624,312,555,314,361,867,316,316,369,377,362", "868,767,983,772,621,726,942,953,422,1017,381,962,776,115,623,791,13", "209,209,209,209,956,449,959,209,209,209,209,325,566,738,248,499,511", "14,13,209,12,888,890,892,512,14,14,1007,760,840,922,394,265,265,931", "788,401,638,404,12,896,265,433,629,793,794,881,757,946,736,433,703,949", ",588,,209,209,,,,15,714,912,,209,252,259,261,,540,429,434,,,522,,859", "453,457,297,,256,,13,569,260,517,288,13,,556,15,557,545,337,297,697", "508,266,1025,,,977,288,12,531,266,440,445,12,,526,14,280,13,103,694", "694,280,,769,,945,371,,,,,745,1008,,14,740,730,525,12,297,,,,600,601", ",940,584,622,,,1005,,,527,509,267,732,,533,,796,322,15,267,739,209,209", "507,510,,15,15,740,,,,513,297,,663,,708,,996,713,376,988,990,992,994", ",995,,,,708,,209,,14,,,103,290,14,,,,787,,,,,,788,,,618,806,290,,602", "831,809,,283,811,115,,656,14,115,,,660,670,671,,,656,,,,,,316,316,,", "1028,1029,1030,1031,708,851,,,,15,,377,,708,,1018,,,456,449,209,209", "1035,828,,,876,,15,740,879,880,,,687,,,,,,656,656,656,645,,588,,646", "747,,377,458,885,886,430,705,118,844,712,,118,,460,,,316,,,316,,,,,", ",697,,545,,297,,13,,700,723,,,288,545,209,297,449,209,,15,,694,,288", "15,,,12,,,449,,209,,,848,850,,,787,,853,855,,856,841,297,13,13,,15,519", "761,521,734,766,523,524,,,,771,316,,,316,428,939,12,12,,316,,,,13,773", ",,13,828,792,,,13,283,209,,449,209,,,,693,449,209,12,,,209,12,209,,", "1009,12,,,,,,,821,926,,753,753,,965,,14,984,337,,,,290,588,,588,978", ",209,209,,774,725,290,209,,,,986,,209,,,,950,,951,283,,,,,283,,13,654", ",14,14,,659,13,,,377,662,13,13,545,656,297,1016,660,,656,12,,,288,,", "834,12,297,,14,,12,12,14,,288,,,14,,,,,802,804,,894,,,807,,,,,648,457", ",787,,679,681,683,449,,874,,,,971,973,974,975,,,,,,,,,,929,588,433,", ",,209,1012,,,,13,,,,13,13,,,,,,,15,825,,,,,,115,14,12,13,,,12,12,14", "209,209,871,,14,14,,,877,,878,,,,882,12,290,36,695,,322,,698,,,15,15", "1024,,290,,588,,588,,,,,13,,,,934,708,,,,,36,287,287,,,15,,,,15,,12", ",695,15,,322,209,,13,13,,,903,905,,,,,588,,,366,380,,380,,,14,735,12", "12,14,14,733,,,,,,,,,,741,,,,,900,14,753,780,,,,,297,,36,,13,,,456,967", ",36,36,,,,,,,997,,783,15,,,13,12,,13,15,785,,,,15,15,,798,14,,,,,727", "728,,12,,,12,,13,1019,,,,,,,,,,316,,13,,,14,14,13,,749,12,,,751,695", "322,,,759,,13,,829,12,209,830,449,,12,,,,,,,,,36,,,,12,,,208,,,839,", ",,,,,15,,36,14,15,15,,969,,,,,,,,,,,,,,,15,14,,313,14,,,,358,358,460", ",358,780,,,822,,,,,,,823,,,,14,826,827,883,,,737,,,737,,783,,14,,,,15", "14,36,785,,902,287,36,,,358,358,358,358,14,,,,,,,,287,,,,,,,15,15,315", ",36,328,,,784,,,,,,,,,,,,,,396,,398,398,402,405,398,,,,,,380,,,,,,,", ",925,,,780,,927,780,928,780,15,780,,,970,,,901,,,,,,,,,,,955,947,15", "380,783,15,783,,783,,,,,461,462,952,,954,,,,,322,471,,,,,15,218,,,,921", ",,,264,264,264,,15,,,,981,15,,780,307,308,309,,,,,,,,15,,,936,937,264", "264,,,,,,,,783,,,,315,315,780,,780,785,780,,780,,,,,,,,784,,,,,1004", ",,,,,783,,783,,783,,783,,,1013,964,1014,,1015,,780,,,,,,,,,,,,506,,", "982,,,,,,,,,,783,,,,36,,396,,,1034,287,,,,,,999,,,,,287,,,358,358,,", ",1006,,,,,1010,,,,,,,,,,,36,36,,,,,,380,,,737,627,,784,,784,,784,264", "435,264,264,,,,454,459,,36,,,,36,,,,,36,,,218,,473,474,475,476,477,478", "479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495", "496,497,,,,,,,,264,264,,,,,,,784,264,,,,,,,264,,264,,,264,264,,,,,,", ",,,,,,,,36,,784,,784,,784,36,784,,,,36,36,,,,,655,,551,,,,287,,,,655", ",,,,,,,,287,,,,,784,315,315,,,,,,,,,,,,,,,719,,,,,,,,,,,,,,,,,,675,655", "655,655,675,,,,,,,,675,675,,,,36,,,,36,36,,,,,,,,,,,,,315,,,315,36,", ",,,,,,,,358,,775,,,,,,,,,,,,,,264,,,,,,,,,,,,,,,,,,36,,,,,,,,,,,,,,", "264,264,,454,672,435,,,,315,,,315,,36,36,,,315,,,,,,,,,,,,,,,674,,,", ",,,,,,,,,,,,,,264,,264,,264,,,,,,,,,,,36,,,264,966,,264,,,,,,,,,716", "717,718,,,36,,,36,,,,,264,,,264,,358,,,,,,,,,,,,655,36,,,,655,,,,,,", "837,842,36,,,,,36,,,,,,,,,,,264,,36,264,,,,,,264,,837,,837,,,,,,,,,", ",,,,,,,294,294,,,,,,294,294,294,,,,264,,,803,805,,,,,808,294,,810,358", ",672,812,,294,294,,,,,,,,,,,,,,,,,,,,264,264,,,,,,,264,,,264,,,,,920", ",,,924,,,,,,,,,,,,,264,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,264,,,", ",,,,,,,,,,,,,,,,264,,,,,,,,,,,,,,,,,,,264,904,906,,,,,,,,,,,,803,805", "808,,,,,,,,294,,294,294,294,294,294,294,294,294,294,294,294,294,294", "294,294,294,294,294,294,294,294,294,294,294,294,837,,,,,,,,,,,,,,,,", ",315,,,,,294,837,294,,,294,294,,,,,,,,,,294,,,,264,,,,,,,,,,,,294,,906", "904,958,,,,,294,264,,,,,,,,,,,,,,,,,,,,,,,264,,,,,,,,294,,,,,,,,,,,", ",,,,,,,,,,,,,,,,,,,,,,,,,,,294,,,,,,,,,,,,,,,264,,,,,,,,,,,,,,,,,,,", ",,,,,,,,,,,,,,,,294,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,294,294,294,", ",,,,,,,,,,,,,,,,,,,,,,,,,,294,,,,,,,,,,,,,,,,,,294,,294,,294,,,,,,,", ",,,,294,,,,,,,,,,,294,,,294,294,294,,,,,,,,,,,294,,,294,,,,,,,,,,,,294", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", ",,,,,,294,,,,,,,,,,,,294,,,,294,,,,,,,,,,,,,,,,,,,,,,,294,294,,,,,,", "294,,,294,,,294,,,,,,,,,,,,,294,,,,,,294,,,,,,,,,,,,,,,,,,,,,,,,,,,", ",,,,,,,,,,,294,,,,,,,,,,,,,,,,,,,,294,,,,,,,,,,,,,,,,,,,294,,,,,,,,", ",,,,,294,294,294,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", ",,,,,,,,,,,,,,,,,,,,,,,,,,294,,,,,,,,,,,,,,294,294,294,,,,,,294,,,,", ",,,294,,,,,,,,,,,,,,,294"]; racc_goto_table = arr = Opal.get('Array').$new(2748, nil); idx = 0; ($a = ($d = clist).$each, $a.$$p = (TMP_5 = function(str){var self = TMP_5.$$s || this, $e, $f, TMP_6; if (str == null) str = nil; return ($e = ($f = str.$split(",", -1)).$each, $e.$$p = (TMP_6 = function(i){var self = TMP_6.$$s || this, $g; if (i == null) i = nil; if ((($g = i['$empty?']()) !== nil && $g != null && (!$g.$$is_boolean || $g == true))) { } else { arr['$[]='](idx, i.$to_i()) }; return idx = $rb_plus(idx, 1);}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $e).call($f)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($d); clist = ["21,48,7,30,30,30,81,49,49,61,61,8,35,111,10,48,52,44,21,21,22,20,42", "114,53,53,47,21,21,21,30,21,21,21,6,16,16,17,84,16,79,25,65,33,33,33", "85,117,117,25,113,43,20,21,21,53,53,4,21,21,155,39,21,21,21,11,49,80", "80,57,57,57,14,14,135,78,78,151,46,2,49,16,16,16,16,51,51,156,157,159", "19,33,33,33,58,58,11,84,58,40,21,107,7,108,21,21,21,21,21,21,7,7,64", "139,23,105,4,1,158,139,5,20,12,162,59,59,59,15,48,20,20,136,136,18,28", "136,36,38,38,38,36,54,60,55,60,23,23,23,36,36,62,63,59,119,73,74,75", "77,119,119,82,83,64,64,64,22,22,162,86,87,88,89,90,91,92,30,30,23,23", "93,94,95,96,97,98,60,99,159,2,107,100,108,101,49,102,103,21,21,21,21", "21,104,49,106,21,21,21,21,109,110,112,122,123,125,23,21,21,20,152,152", "152,126,23,23,127,128,129,130,134,30,30,158,151,137,138,140,20,141,30", "57,139,142,143,145,81,148,149,57,44,153,,154,,21,21,,,,24,44,105,,21", "34,34,34,,52,19,19,,,135,,157,19,19,53,,61,,21,111,61,65,21,21,,52,24", "52,42,114,53,162,57,57,79,,,158,21,20,43,57,33,33,20,,6,23,39,21,84", "60,60,39,,46,,105,24,,,,,156,11,,23,155,113,4,20,53,,,,16,16,,80,21", "47,,,158,,,40,59,59,121,,40,,139,26,24,59,121,21,21,38,38,,24,24,155", ",,,38,53,,64,,33,,85,33,21,152,152,152,152,,152,,,,33,,21,,23,,,84,23", "23,,,,121,,,,,,151,,,84,35,23,,4,44,35,,9,35,49,,61,23,49,,,61,22,22", ",,61,,,,,,30,30,,,152,152,152,152,33,117,,,,24,,23,,33,,10,,,24,49,21", "21,152,65,,,8,,24,155,8,8,,,52,,,,,,61,61,61,14,,154,,14,154,,23,17", "117,117,26,22,51,58,22,,51,,26,,,30,,,30,,,,,,,162,,42,,53,,21,,7,52", ",,21,42,21,53,49,21,,24,,60,,21,24,,,20,,,49,,21,,,119,119,,,121,,119", "119,,119,25,53,21,21,,24,26,22,26,21,22,26,26,,,,22,30,,,30,9,78,20", "20,,30,,,,21,16,,,21,65,52,,,21,9,21,,49,21,,,,59,49,21,20,,,21,20,21", ",,81,20,,,,,,,111,121,,84,84,,78,,23,8,114,,,,23,154,,154,78,,21,21", ",84,59,23,21,,,,117,,21,,,,121,,121,9,,,,,9,,21,34,,23,23,,34,21,,,23", "34,21,21,42,61,53,8,61,,61,20,,,21,,,42,20,53,,23,,20,20,23,,21,,,23", ",,,,19,19,,48,,,19,,,,,26,19,,121,,34,34,34,49,,16,,,,119,119,119,119", ",,,,,,,,,154,154,57,,,,21,121,,,,21,,,,21,21,,,,,,,24,59,,,,,,49,23", "20,21,,,20,20,23,21,21,57,,23,23,,,84,,84,,,,84,20,23,45,26,,26,,26", ",,24,24,119,,23,,154,,154,,,,,21,,,,16,33,,,,,45,45,45,,,24,,,,24,,20", ",26,24,,26,21,,21,21,,,19,19,,,,,154,,,45,45,,45,,,23,116,20,20,23,23", "120,,,,,,,,,,120,,,,,23,23,84,147,,,,,53,,45,,21,,,24,21,,45,45,,,,", ",,52,,116,24,,,21,20,,21,24,120,,,,24,24,,26,23,,,,,9,9,,20,,,20,,21", "22,,,,,,,,,,30,,21,,,23,23,21,,9,20,,,9,26,26,,,9,,21,,26,20,21,26,49", ",20,,,,,,,,,45,,,,20,,,27,,,26,,,,,,,24,,45,23,24,24,,23,,,,,,,,,,,", ",,,24,23,,27,23,,,,27,27,26,,27,147,,,9,,,,,,,9,,,,23,9,9,26,,,118,", ",118,,116,,23,,,,24,23,45,120,,26,45,45,,,27,27,27,27,23,,,,,,,,45,", ",,,,,24,24,56,,45,56,,,118,,,,,,,,,,,,,,56,,56,56,56,56,56,,,,,,45,", ",,,,,,,120,,,147,,120,147,120,147,24,147,,,24,,,9,,,,,,,,,,,26,116,24", "45,116,24,116,,116,,,,,27,27,120,,120,,,,,26,27,,,,,24,29,,,,9,,,,29", "29,29,,24,,,,26,24,,147,29,29,29,,,,,,,,24,,,9,9,29,29,,,,,,,,116,,", ",56,56,147,,147,120,147,,147,,,,,,,,118,,,,,120,,,,,,116,,116,,116,", "116,,,120,9,120,,120,,147,,,,,,,,,,,,56,,,9,,,,,,,,,,116,,,,45,,56,", ",120,45,,,,,,9,,,,,45,,,27,27,,,,9,,,,,9,,,,,,,,,,,45,45,,,,,,45,,,118", "27,,118,,118,,118,29,29,29,29,,,,29,29,,45,,,,45,,,,,45,,,29,,29,29", "29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29", ",,,,,,,29,29,,,,,,,118,29,,,,,,,29,,29,,,29,29,,,,,,,,,,,,,,,45,,118", ",118,,118,45,118,,,,45,45,,,,,56,,29,,,,45,,,,56,,,,,,,,,45,,,,,118", "56,56,,,,,,,,,,,,,,,27,,,,,,,,,,,,,,,,,,56,56,56,56,56,,,,,,,,56,56", ",,,45,,,,45,45,,,,,,,,,,,,,56,,,56,45,,,,,,,,,,27,,27,,,,,,,,,,,,,,29", ",,,,,,,,,,,,,,,,,45,,,,,,,,,,,,,,,29,29,,29,29,29,,,,56,,,56,,45,45", ",,56,,,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,29,,29,,29,,,,,,,,,,,45,,,29", "45,,29,,,,,,,,,29,29,29,,,45,,,45,,,,,29,,,29,,27,,,,,,,,,,,,56,45,", ",,56,,,,,,,56,56,45,,,,,45,,,,,,,,,,,29,,45,29,,,,,,29,,56,,56,,,,,", ",,,,,,,,,,,37,37,,,,,,37,37,37,,,,29,,,29,29,,,,,29,37,,29,27,,29,29", ",37,37,,,,,,,,,,,,,,,,,,,,29,29,,,,,,,29,,,29,,,,,56,,,,56,,,,,,,,,", ",,,29,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,,,29", ",,,,,,,,,,,,,,,,,,29,29,29,,,,,,,,,,,,29,29,29,,,,,,,,37,,37,37,37,37", "37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,56,,", ",,,,,,,,,,,,,,,56,,,,,37,56,37,,,37,37,,,,,,,,,,37,,,,29,,,,,,,,,,,", "37,,29,29,29,,,,,37,29,,,,,,,,,,,,,,,,,,,,,,,29,,,,,,,,37,,,,,,,,,,", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,37,,,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,,,", ",,,,,,,,,,,,,,,37,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,37,37,37,,,,,,", ",,,,,,,,,,,,,,,,,,,,,37,,,,,,,,,,,,,,,,,,37,,37,,37,,,,,,,,,,,,37,,", ",,,,,,,,37,,,37,37,37,,,,,,,,,,,37,,,37,,,,,,,,,,,,37,,,,,,,,,,,,,,", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,37,,,,,", ",,,,,,37,,,,37,,,,,,,,,,,,,,,,,,,,,,,37,37,,,,,,,37,,,37,,,37,,,,,,", ",,,,,,37,,,,,,37,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,37,,,,,,,,,,", ",,,,,,,,,37,,,,,,,,,,,,,,,,,,,37,,,,,,,,,,,,,,37,37,37,,,,,,,,,,,,,", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,37,", ",,,,,,,,,,,,37,37,37,,,,,,37,,,,,,,,37,,,,,,,,,,,,,,,37"]; racc_goto_check = arr = Opal.get('Array').$new(2748, nil); idx = 0; ($a = ($e = clist).$each, $a.$$p = (TMP_7 = function(str){var self = TMP_7.$$s || this, $f, $g, TMP_8; if (str == null) str = nil; return ($f = ($g = str.$split(",", -1)).$each, $f.$$p = (TMP_8 = function(i){var self = TMP_8.$$s || this, $h; if (i == null) i = nil; if ((($h = i['$empty?']()) !== nil && $h != null && (!$h.$$is_boolean || $h == true))) { } else { arr['$[]='](idx, i.$to_i()) }; return idx = $rb_plus(idx, 1);}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $f).call($g)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($e); racc_goto_pointer = [nil, 117, 79, nil, 54, 20, 31, 2, -301, 390, -539, -655, -714, nil, 65, 119, -23, -168, 70, 71, 21, 0, -34, 114, 258, -156, 302, 1002, 24, 1205, -24, nil, nil, -158, 239, -240, -363, 1809, 110, 30, 68, nil, -10, 18, -284, 817, -296, -38, -65, 0, nil, 78, -26, -8, -105, -675, 1073, 42, -223, 97, -374, -15, -103, -354, -338, -225, nil, nil, nil, nil, nil, nil, nil, 88, 100, 100, nil, 100, -284, -709, -533, -358, 97, -217, 35, -577, 102, -222, 118, -142, 119, 113, -578, 118, -576, -430, -758, -434, -195, -692, 125, -430, -196, -429, -693, -561, -707, -809, -807, 151, -116, -44, -369, -521, -34, nil, 312, -285, 510, -177, 321, -219, 190, -35, nil, -44, -37, -758, -380, -495, -613, nil, nil, nil, 156, 0, 55, 155, -167, -282, 156, -556, -390, -390, nil, -535, nil, 287, -639, -329, nil, -546, -567, -638, -99, -519, -263, -658, -630, -800, nil, nil, -395]; racc_goto_default = [nil, nil, nil, 3, nil, 4, 365, 279, nil, 553, nil, 864, nil, 278, nil, nil, nil, 10, 11, 17, 214, 306, nil, 212, 213, nil, 270, 16, nil, 20, 21, 22, 23, 711, nil, nil, nil, 24, nil, 30, nil, 32, 35, 34, nil, 210, 375, nil, 117, 443, 116, 70, 819, 43, nil, nil, 572, 317, nil, 318, 268, 441, nil, nil, 657, 515, 254, 44, 45, 46, 47, 48, 49, 50, nil, 255, 56, nil, nil, nil, nil, nil, nil, nil, 596, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 344, nil, nil, nil, 330, 329, 731, 332, 333, nil, 334, nil, 335, 336, nil, nil, 447, nil, nil, nil, nil, nil, nil, 69, 71, 72, 73, nil, nil, nil, nil, 634, nil, nil, nil, nil, 407, 779, 340, 342, 781, 343, 782, 948, nil, 786, 349, 351, nil, 590, 591, 790, 354, 357, 273]; racc_reduce_table = [0, 0, "racc_error", 1, 141, "_reduce_none", 2, 142, "_reduce_2", 0, 143, "_reduce_3", 1, 143, "_reduce_4", 3, 143, "_reduce_5", 1, 145, "_reduce_none", 4, 145, "_reduce_7", 4, 148, "_reduce_8", 2, 149, "_reduce_9", 0, 153, "_reduce_10", 1, 153, "_reduce_11", 3, 153, "_reduce_12", 0, 168, "_reduce_13", 4, 147, "_reduce_14", 3, 147, "_reduce_15", 3, 147, "_reduce_none", 3, 147, "_reduce_17", 2, 147, "_reduce_18", 3, 147, "_reduce_19", 3, 147, "_reduce_20", 3, 147, "_reduce_21", 3, 147, "_reduce_22", 3, 147, "_reduce_23", 4, 147, "_reduce_none", 1, 147, "_reduce_none", 3, 147, "_reduce_26", 3, 147, "_reduce_27", 6, 147, "_reduce_none", 6, 147, "_reduce_none", 5, 147, "_reduce_30", 5, 147, "_reduce_none", 5, 147, "_reduce_none", 3, 147, "_reduce_none", 3, 147, "_reduce_34", 3, 147, "_reduce_35", 3, 147, "_reduce_36", 1, 147, "_reduce_none", 3, 157, "_reduce_38", 3, 157, "_reduce_39", 1, 167, "_reduce_none", 3, 167, "_reduce_41", 3, 167, "_reduce_42", 2, 167, "_reduce_43", 2, 167, "_reduce_44", 1, 167, "_reduce_none", 1, 156, "_reduce_none", 1, 159, "_reduce_none", 1, 159, "_reduce_none", 1, 171, "_reduce_none", 4, 171, "_reduce_none", 4, 171, "_reduce_none", 4, 171, "_reduce_none", 4, 175, "_reduce_53", 2, 170, "_reduce_54", 3, 170, "_reduce_55", 4, 170, "_reduce_56", 5, 170, "_reduce_57", 4, 170, "_reduce_58", 5, 170, "_reduce_59", 4, 170, "_reduce_60", 5, 170, "_reduce_61", 2, 170, "_reduce_62", 2, 170, "_reduce_63", 2, 170, "_reduce_64", 2, 170, "_reduce_65", 2, 170, "_reduce_66", 1, 158, "_reduce_67", 3, 158, "_reduce_68", 1, 180, "_reduce_69", 3, 180, "_reduce_70", 1, 179, "_reduce_71", 2, 179, "_reduce_72", 3, 179, "_reduce_73", 5, 179, "_reduce_74", 2, 179, "_reduce_75", 4, 179, "_reduce_76", 2, 179, "_reduce_77", 4, 179, "_reduce_78", 1, 179, "_reduce_79", 3, 179, "_reduce_80", 1, 182, "_reduce_81", 3, 182, "_reduce_82", 2, 181, "_reduce_83", 3, 181, "_reduce_84", 1, 184, "_reduce_85", 3, 184, "_reduce_86", 1, 183, "_reduce_87", 4, 183, "_reduce_88", 3, 183, "_reduce_89", 3, 183, "_reduce_none", 3, 183, "_reduce_none", 3, 183, "_reduce_none", 2, 183, "_reduce_none", 1, 183, "_reduce_none", 1, 164, "_reduce_95", 4, 164, "_reduce_96", 4, 164, "_reduce_97", 3, 164, "_reduce_98", 3, 164, "_reduce_99", 3, 164, "_reduce_100", 3, 164, "_reduce_101", 2, 164, "_reduce_102", 1, 164, "_reduce_none", 1, 186, "_reduce_none", 2, 187, "_reduce_105", 1, 187, "_reduce_106", 3, 187, "_reduce_107", 1, 188, "_reduce_none", 1, 188, "_reduce_none", 1, 188, "_reduce_none", 1, 188, "_reduce_111", 1, 188, "_reduce_112", 1, 154, "_reduce_113", 1, 154, "_reduce_none", 1, 155, "_reduce_115", 3, 155, "_reduce_116", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 189, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 1, 190, "_reduce_none", 3, 169, "_reduce_191", 5, 169, "_reduce_192", 3, 169, "_reduce_193", 6, 169, "_reduce_194", 6, 169, "_reduce_195", 5, 169, "_reduce_196", 5, 169, "_reduce_none", 5, 169, "_reduce_none", 5, 169, "_reduce_none", 4, 169, "_reduce_none", 3, 169, "_reduce_none", 3, 169, "_reduce_202", 3, 169, "_reduce_203", 3, 169, "_reduce_204", 3, 169, "_reduce_205", 3, 169, "_reduce_206", 3, 169, "_reduce_207", 3, 169, "_reduce_208", 3, 169, "_reduce_209", 4, 169, "_reduce_210", 4, 169, "_reduce_211", 2, 169, "_reduce_212", 2, 169, "_reduce_213", 3, 169, "_reduce_214", 3, 169, "_reduce_215", 3, 169, "_reduce_216", 3, 169, "_reduce_217", 3, 169, "_reduce_218", 3, 169, "_reduce_219", 3, 169, "_reduce_220", 3, 169, "_reduce_221", 3, 169, "_reduce_222", 3, 169, "_reduce_223", 3, 169, "_reduce_224", 3, 169, "_reduce_225", 3, 169, "_reduce_226", 2, 169, "_reduce_227", 2, 169, "_reduce_228", 3, 169, "_reduce_229", 3, 169, "_reduce_230", 3, 169, "_reduce_231", 3, 169, "_reduce_232", 3, 169, "_reduce_233", 0, 194, "_reduce_234", 0, 195, "_reduce_235", 7, 169, "_reduce_236", 1, 169, "_reduce_none", 1, 166, "_reduce_none", 1, 162, "_reduce_239", 2, 162, "_reduce_240", 2, 162, "_reduce_241", 4, 162, "_reduce_242", 2, 162, "_reduce_243", 3, 162, "_reduce_244", 3, 201, "_reduce_245", 2, 203, "_reduce_none", 1, 204, "_reduce_247", 1, 204, "_reduce_none", 1, 202, "_reduce_249", 1, 202, "_reduce_none", 2, 202, "_reduce_251", 4, 202, "_reduce_252", 2, 202, "_reduce_253", 1, 178, "_reduce_254", 2, 178, "_reduce_255", 2, 178, "_reduce_256", 4, 178, "_reduce_257", 1, 178, "_reduce_258", 0, 206, "_reduce_259", 2, 174, "_reduce_260", 2, 200, "_reduce_261", 2, 205, "_reduce_262", 0, 205, "_reduce_263", 1, 197, "_reduce_264", 2, 197, "_reduce_265", 3, 197, "_reduce_266", 4, 197, "_reduce_267", 3, 165, "_reduce_268", 4, 165, "_reduce_269", 2, 165, "_reduce_270", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 1, 193, "_reduce_none", 0, 228, "_reduce_280", 4, 193, "_reduce_281", 0, 229, "_reduce_282", 5, 193, "_reduce_283", 0, 230, "_reduce_284", 4, 193, "_reduce_285", 3, 193, "_reduce_286", 3, 193, "_reduce_287", 2, 193, "_reduce_288", 4, 193, "_reduce_289", 4, 193, "_reduce_290", 3, 193, "_reduce_291", 3, 193, "_reduce_292", 1, 193, "_reduce_293", 4, 193, "_reduce_294", 3, 193, "_reduce_295", 1, 193, "_reduce_296", 5, 193, "_reduce_297", 4, 193, "_reduce_298", 3, 193, "_reduce_299", 2, 193, "_reduce_300", 1, 193, "_reduce_none", 2, 193, "_reduce_302", 2, 193, "_reduce_303", 6, 193, "_reduce_304", 6, 193, "_reduce_305", 0, 231, "_reduce_306", 0, 232, "_reduce_307", 7, 193, "_reduce_308", 0, 233, "_reduce_309", 0, 234, "_reduce_310", 7, 193, "_reduce_311", 5, 193, "_reduce_312", 4, 193, "_reduce_313", 5, 193, "_reduce_314", 0, 235, "_reduce_315", 0, 236, "_reduce_316", 9, 193, "_reduce_317", 0, 237, "_reduce_318", 6, 193, "_reduce_319", 0, 238, "_reduce_320", 0, 239, "_reduce_321", 8, 193, "_reduce_322", 0, 240, "_reduce_323", 0, 241, "_reduce_324", 6, 193, "_reduce_325", 0, 242, "_reduce_326", 6, 193, "_reduce_327", 0, 243, "_reduce_328", 0, 244, "_reduce_329", 9, 193, "_reduce_330", 1, 193, "_reduce_331", 1, 193, "_reduce_332", 1, 193, "_reduce_333", 1, 193, "_reduce_none", 1, 161, "_reduce_none", 1, 218, "_reduce_none", 1, 218, "_reduce_none", 1, 218, "_reduce_none", 2, 218, "_reduce_none", 1, 220, "_reduce_none", 1, 220, "_reduce_none", 1, 220, "_reduce_none", 1, 245, "_reduce_343", 4, 245, "_reduce_344", 1, 246, "_reduce_345", 3, 246, "_reduce_346", 1, 247, "_reduce_347", 1, 247, "_reduce_none", 2, 217, "_reduce_349", 3, 249, "_reduce_350", 2, 249, "_reduce_351", 1, 249, "_reduce_352", 1, 249, "_reduce_none", 3, 250, "_reduce_354", 3, 250, "_reduce_355", 1, 219, "_reduce_356", 5, 219, "_reduce_357", 1, 151, "_reduce_none", 2, 151, "_reduce_359", 1, 252, "_reduce_360", 3, 252, "_reduce_361", 3, 253, "_reduce_362", 1, 176, "_reduce_none", 3, 176, "_reduce_364", 1, 176, "_reduce_365", 4, 176, "_reduce_366", 4, 254, "_reduce_367", 2, 254, "_reduce_368", 2, 254, "_reduce_369", 1, 254, "_reduce_370", 2, 259, "_reduce_371", 1, 259, "_reduce_372", 6, 251, "_reduce_373", 8, 251, "_reduce_374", 4, 251, "_reduce_375", 6, 251, "_reduce_376", 4, 251, "_reduce_377", 2, 251, "_reduce_378", 6, 251, "_reduce_379", 2, 251, "_reduce_380", 4, 251, "_reduce_381", 6, 251, "_reduce_382", 2, 251, "_reduce_383", 4, 251, "_reduce_384", 2, 251, "_reduce_385", 4, 251, "_reduce_386", 1, 251, "_reduce_387", 0, 263, "_reduce_388", 5, 262, "_reduce_389", 2, 172, "_reduce_390", 4, 172, "_reduce_none", 4, 172, "_reduce_none", 4, 172, "_reduce_none", 2, 216, "_reduce_394", 4, 216, "_reduce_395", 4, 216, "_reduce_396", 3, 216, "_reduce_397", 4, 216, "_reduce_398", 3, 216, "_reduce_399", 2, 216, "_reduce_400", 1, 216, "_reduce_401", 0, 265, "_reduce_402", 5, 215, "_reduce_403", 0, 266, "_reduce_404", 5, 215, "_reduce_405", 0, 268, "_reduce_406", 6, 221, "_reduce_407", 1, 267, "_reduce_408", 1, 267, "_reduce_none", 6, 150, "_reduce_410", 0, 150, "_reduce_411", 1, 269, "_reduce_412", 1, 269, "_reduce_none", 1, 269, "_reduce_none", 2, 270, "_reduce_415", 1, 270, "_reduce_416", 2, 152, "_reduce_417", 1, 152, "_reduce_none", 1, 207, "_reduce_none", 1, 207, "_reduce_none", 1, 207, "_reduce_none", 1, 208, "_reduce_422", 1, 273, "_reduce_none", 2, 273, "_reduce_424", 3, 274, "_reduce_425", 1, 274, "_reduce_426", 3, 209, "_reduce_427", 3, 210, "_reduce_428", 3, 211, "_reduce_429", 3, 211, "_reduce_430", 1, 277, "_reduce_431", 3, 277, "_reduce_432", 1, 278, "_reduce_433", 2, 278, "_reduce_434", 3, 212, "_reduce_435", 3, 212, "_reduce_436", 1, 280, "_reduce_437", 3, 280, "_reduce_438", 1, 275, "_reduce_439", 2, 275, "_reduce_440", 1, 276, "_reduce_441", 2, 276, "_reduce_442", 1, 279, "_reduce_443", 0, 282, "_reduce_444", 3, 279, "_reduce_445", 0, 283, "_reduce_446", 4, 279, "_reduce_447", 1, 281, "_reduce_448", 1, 281, "_reduce_449", 1, 281, "_reduce_450", 1, 281, "_reduce_none", 2, 191, "_reduce_452", 1, 191, "_reduce_453", 1, 284, "_reduce_none", 1, 284, "_reduce_none", 1, 284, "_reduce_none", 1, 284, "_reduce_none", 3, 272, "_reduce_458", 1, 271, "_reduce_459", 1, 271, "_reduce_460", 2, 271, "_reduce_461", 2, 271, "_reduce_462", 2, 271, "_reduce_463", 2, 271, "_reduce_464", 1, 185, "_reduce_465", 1, 185, "_reduce_466", 1, 185, "_reduce_467", 1, 185, "_reduce_468", 1, 185, "_reduce_469", 1, 185, "_reduce_470", 1, 185, "_reduce_471", 1, 185, "_reduce_472", 1, 185, "_reduce_473", 1, 185, "_reduce_474", 1, 185, "_reduce_475", 1, 213, "_reduce_476", 1, 160, "_reduce_477", 1, 163, "_reduce_478", 1, 163, "_reduce_none", 1, 223, "_reduce_480", 3, 223, "_reduce_481", 2, 223, "_reduce_482", 4, 225, "_reduce_483", 2, 225, "_reduce_484", 1, 286, "_reduce_none", 1, 286, "_reduce_none", 2, 256, "_reduce_487", 1, 256, "_reduce_488", 1, 287, "_reduce_489", 2, 288, "_reduce_490", 1, 288, "_reduce_491", 2, 289, "_reduce_492", 1, 289, "_reduce_493", 1, 255, "_reduce_494", 3, 255, "_reduce_495", 1, 290, "_reduce_496", 3, 290, "_reduce_497", 4, 291, "_reduce_498", 2, 291, "_reduce_499", 2, 291, "_reduce_500", 1, 291, "_reduce_501", 2, 292, "_reduce_502", 0, 292, "_reduce_503", 6, 285, "_reduce_504", 8, 285, "_reduce_505", 4, 285, "_reduce_506", 6, 285, "_reduce_507", 4, 285, "_reduce_508", 6, 285, "_reduce_509", 2, 285, "_reduce_510", 4, 285, "_reduce_511", 6, 285, "_reduce_512", 2, 285, "_reduce_513", 4, 285, "_reduce_514", 2, 285, "_reduce_515", 4, 285, "_reduce_516", 1, 285, "_reduce_517", 0, 285, "_reduce_518", 1, 294, "_reduce_none", 1, 294, "_reduce_520", 1, 248, "_reduce_521", 1, 248, "_reduce_522", 1, 248, "_reduce_523", 1, 248, "_reduce_524", 1, 295, "_reduce_525", 3, 295, "_reduce_526", 1, 222, "_reduce_none", 1, 222, "_reduce_none", 1, 297, "_reduce_529", 3, 297, "_reduce_530", 1, 298, "_reduce_531", 3, 298, "_reduce_532", 1, 296, "_reduce_none", 4, 296, "_reduce_534", 6, 296, "_reduce_535", 3, 296, "_reduce_536", 5, 296, "_reduce_537", 2, 296, "_reduce_538", 4, 296, "_reduce_539", 1, 296, "_reduce_540", 3, 296, "_reduce_541", 1, 260, "_reduce_542", 3, 260, "_reduce_543", 3, 299, "_reduce_544", 1, 293, "_reduce_545", 3, 293, "_reduce_546", 1, 300, "_reduce_none", 1, 300, "_reduce_none", 2, 261, "_reduce_549", 1, 261, "_reduce_550", 1, 301, "_reduce_none", 1, 301, "_reduce_none", 2, 258, "_reduce_553", 2, 257, "_reduce_554", 0, 257, "_reduce_555", 1, 226, "_reduce_556", 4, 226, "_reduce_557", 0, 214, "_reduce_558", 2, 214, "_reduce_559", 1, 199, "_reduce_560", 3, 199, "_reduce_561", 3, 302, "_reduce_562", 2, 302, "_reduce_563", 4, 302, "_reduce_564", 2, 302, "_reduce_565", 1, 177, "_reduce_none", 1, 177, "_reduce_none", 1, 177, "_reduce_none", 1, 173, "_reduce_none", 1, 173, "_reduce_none", 1, 173, "_reduce_none", 1, 173, "_reduce_none", 1, 264, "_reduce_none", 1, 264, "_reduce_none", 1, 264, "_reduce_none", 1, 227, "_reduce_none", 1, 227, "_reduce_none", 0, 144, "_reduce_none", 1, 144, "_reduce_none", 0, 192, "_reduce_none", 1, 192, "_reduce_none", 0, 198, "_reduce_none", 1, 198, "_reduce_none", 1, 198, "_reduce_none", 1, 224, "_reduce_none", 1, 224, "_reduce_none", 1, 146, "_reduce_none", 2, 146, "_reduce_none", 0, 196, "_reduce_589"]; racc_reduce_n = 590; racc_shift_n = 1036; racc_token_table = $hash(false, 0, "error", 1, "kCLASS", 2, "kMODULE", 3, "kDEF", 4, "kUNDEF", 5, "kBEGIN", 6, "kRESCUE", 7, "kENSURE", 8, "kEND", 9, "kIF", 10, "kUNLESS", 11, "kTHEN", 12, "kELSIF", 13, "kELSE", 14, "kCASE", 15, "kWHEN", 16, "kWHILE", 17, "kUNTIL", 18, "kFOR", 19, "kBREAK", 20, "kNEXT", 21, "kREDO", 22, "kRETRY", 23, "kIN", 24, "kDO", 25, "kDO_COND", 26, "kDO_BLOCK", 27, "kDO_LAMBDA", 28, "kRETURN", 29, "kYIELD", 30, "kSUPER", 31, "kSELF", 32, "kNIL", 33, "kTRUE", 34, "kFALSE", 35, "kAND", 36, "kOR", 37, "kNOT", 38, "kIF_MOD", 39, "kUNLESS_MOD", 40, "kWHILE_MOD", 41, "kUNTIL_MOD", 42, "kRESCUE_MOD", 43, "kALIAS", 44, "kDEFINED", 45, "klBEGIN", 46, "klEND", 47, "k__LINE__", 48, "k__FILE__", 49, "tIDENTIFIER", 50, "tFID", 51, "tGVAR", 52, "tIVAR", 53, "tCONSTANT", 54, "tLABEL", 55, "tCVAR", 56, "tNTH_REF", 57, "tBACK_REF", 58, "tSTRING_CONTENT", 59, "tINTEGER", 60, "tFLOAT", 61, "tREGEXP_END", 62, "tUPLUS", 63, "tUMINUS", 64, "tPOW", 65, "tCMP", 66, "tEQ", 67, "tEQQ", 68, "tNEQ", 69, "tGEQ", 70, "tLEQ", 71, "tANDOP", 72, "tOROP", 73, "tMATCH", 74, "tNMATCH", 75, "tJSDOT", 76, "tDOT", 77, "tDOT2", 78, "tDOT3", 79, "tAREF", 80, "tASET", 81, "tLSHFT", 82, "tRSHFT", 83, "tCOLON2", 84, "tCOLON3", 85, "tOP_ASGN", 86, "tASSOC", 87, "tLPAREN", 88, "tLPAREN2", 89, "tRPAREN", 90, "tLPAREN_ARG", 91, "tRBRACK", 92, "tLBRACE", 93, "tLBRACE_ARG", 94, "tSTAR", 95, "tSTAR2", 96, "tAMPER", 97, "tAMPER2", 98, "tTILDE", 99, "tPERCENT", 100, "tDIVIDE", 101, "tPLUS", 102, "tMINUS", 103, "tLT", 104, "tGT", 105, "tPIPE", 106, "tBANG", 107, "tCARET", 108, "tLCURLY", 109, "tRCURLY", 110, "tBACK_REF2", 111, "tSYMBEG", 112, "tSTRING_BEG", 113, "tXSTRING_BEG", 114, "tREGEXP_BEG", 115, "tWORDS_BEG", 116, "tAWORDS_BEG", 117, "tSTRING_DBEG", 118, "tSTRING_DVAR", 119, "tSTRING_END", 120, "tSTRING", 121, "tSYMBOL", 122, "tNL", 123, "tEH", 124, "tCOLON", 125, "tCOMMA", 126, "tSPACE", 127, "tSEMI", 128, "tLAMBDA", 129, "tLAMBEG", 130, "tLBRACK2", 131, "tLBRACK", 132, "tJSLBRACK", 133, "tDSTAR", 134, "tLABEL_END", 135, "tEQL", 136, "tLOWEST", 137, "-@NUM", 138, "+@NUM", 139); racc_nt_base = 140; racc_use_result_var = true; Opal.cdecl($scope, 'Racc_arg', [racc_action_table, racc_action_check, racc_action_default, racc_action_pointer, racc_goto_table, racc_goto_check, racc_goto_default, racc_goto_pointer, racc_nt_base, racc_reduce_table, racc_token_table, racc_shift_n, racc_reduce_n, racc_use_result_var]); Opal.cdecl($scope, 'Racc_token_to_s_table', ["$end", "error", "kCLASS", "kMODULE", "kDEF", "kUNDEF", "kBEGIN", "kRESCUE", "kENSURE", "kEND", "kIF", "kUNLESS", "kTHEN", "kELSIF", "kELSE", "kCASE", "kWHEN", "kWHILE", "kUNTIL", "kFOR", "kBREAK", "kNEXT", "kREDO", "kRETRY", "kIN", "kDO", "kDO_COND", "kDO_BLOCK", "kDO_LAMBDA", "kRETURN", "kYIELD", "kSUPER", "kSELF", "kNIL", "kTRUE", "kFALSE", "kAND", "kOR", "kNOT", "kIF_MOD", "kUNLESS_MOD", "kWHILE_MOD", "kUNTIL_MOD", "kRESCUE_MOD", "kALIAS", "kDEFINED", "klBEGIN", "klEND", "k__LINE__", "k__FILE__", "tIDENTIFIER", "tFID", "tGVAR", "tIVAR", "tCONSTANT", "tLABEL", "tCVAR", "tNTH_REF", "tBACK_REF", "tSTRING_CONTENT", "tINTEGER", "tFLOAT", "tREGEXP_END", "tUPLUS", "tUMINUS", "tPOW", "tCMP", "tEQ", "tEQQ", "tNEQ", "tGEQ", "tLEQ", "tANDOP", "tOROP", "tMATCH", "tNMATCH", "tJSDOT", "tDOT", "tDOT2", "tDOT3", "tAREF", "tASET", "tLSHFT", "tRSHFT", "tCOLON2", "tCOLON3", "tOP_ASGN", "tASSOC", "tLPAREN", "tLPAREN2", "tRPAREN", "tLPAREN_ARG", "tRBRACK", "tLBRACE", "tLBRACE_ARG", "tSTAR", "tSTAR2", "tAMPER", "tAMPER2", "tTILDE", "tPERCENT", "tDIVIDE", "tPLUS", "tMINUS", "tLT", "tGT", "tPIPE", "tBANG", "tCARET", "tLCURLY", "tRCURLY", "tBACK_REF2", "tSYMBEG", "tSTRING_BEG", "tXSTRING_BEG", "tREGEXP_BEG", "tWORDS_BEG", "tAWORDS_BEG", "tSTRING_DBEG", "tSTRING_DVAR", "tSTRING_END", "tSTRING", "tSYMBOL", "tNL", "tEH", "tCOLON", "tCOMMA", "tSPACE", "tSEMI", "tLAMBDA", "tLAMBEG", "tLBRACK2", "tLBRACK", "tJSLBRACK", "tDSTAR", "tLABEL_END", "tEQL", "tLOWEST", "\"-@NUM\"", "\"+@NUM\"", "$start", "program", "top_compstmt", "top_stmts", "opt_terms", "top_stmt", "terms", "stmt", "bodystmt", "compstmt", "opt_rescue", "opt_else", "opt_ensure", "stmts", "fitem", "undef_list", "expr_value", "command_asgn", "mlhs", "command_call", "var_lhs", "primary_value", "aref_args", "backref", "lhs", "mrhs", "arg_value", "expr", "@1", "arg", "command", "block_command", "block_call", "operation2", "command_args", "cmd_brace_block", "opt_block_var", "operation", "call_args", "mlhs_basic", "mlhs_entry", "mlhs_head", "mlhs_item", "mlhs_node", "mlhs_post", "variable", "cname", "cpath", "fname", "op", "reswords", "symbol", "opt_nl", "primary", "@2", "@3", "none", "args", "trailer", "assocs", "block_arg", "paren_args", "opt_call_args", "rparen", "opt_paren_args", "opt_block_arg", "@4", "literal", "strings", "xstring", "regexp", "words", "awords", "var_ref", "assoc_list", "brace_block", "method_call", "lambda", "then", "if_tail", "do", "case_body", "for_var", "superclass", "term", "f_arglist", "singleton", "dot_or_colon", "@5", "@6", "@7", "@8", "@9", "@10", "@11", "@12", "@13", "@14", "@15", "@16", "@17", "@18", "@19", "@20", "@21", "opt_bv_decl", "bv_decls", "bvar", "f_bad_arg", "f_larglist", "lambda_body", "block_param", "f_block_optarg", "f_block_opt", "block_args_tail", "f_block_kwarg", "f_kwrest", "opt_f_block_arg", "f_block_arg", "opt_block_args_tail", "f_arg", "f_rest_arg", "do_block", "@22", "operation3", "@23", "@24", "cases", "@25", "exc_list", "exc_var", "numeric", "dsym", "string", "string1", "string_contents", "xstring_contents", "word_list", "word", "string_content", "qword_list", "string_dvar", "@26", "@27", "sym", "f_args", "kwrest_mark", "f_label", "f_kw", "f_block_kw", "f_kwarg", "args_tail", "opt_args_tail", "f_optarg", "f_norm_arg", "f_arg_item", "f_margs", "f_marg", "f_marg_list", "f_opt", "restarg_mark", "blkarg_mark", "assoc"]); Opal.cdecl($scope, 'Racc_debug_parser', false); Opal.defn(self, '$_reduce_2', TMP_9 = function $$_reduce_2(val, _values, result) { var self = this; result = self.$new_compstmt(val['$[]'](0)); return result; }, TMP_9.$$arity = 3); Opal.defn(self, '$_reduce_3', TMP_10 = function $$_reduce_3(val, _values, result) { var self = this; result = self.$new_block(); return result; }, TMP_10.$$arity = 3); Opal.defn(self, '$_reduce_4', TMP_11 = function $$_reduce_4(val, _values, result) { var self = this; result = self.$new_block(val['$[]'](0)); return result; }, TMP_11.$$arity = 3); Opal.defn(self, '$_reduce_5', TMP_12 = function $$_reduce_5(val, _values, result) { var self = this; val['$[]'](0)['$<<'](val['$[]'](2)); result = val['$[]'](0); return result; }, TMP_12.$$arity = 3); Opal.defn(self, '$_reduce_7', TMP_13 = function $$_reduce_7(val, _values, result) { var self = this; result = val['$[]'](2); return result; }, TMP_13.$$arity = 3); Opal.defn(self, '$_reduce_8', TMP_14 = function $$_reduce_8(val, _values, result) { var self = this; result = self.$new_body(val['$[]'](0), val['$[]'](1), val['$[]'](2), val['$[]'](3)); return result; }, TMP_14.$$arity = 3); Opal.defn(self, '$_reduce_9', TMP_15 = function $$_reduce_9(val, _values, result) { var self = this; result = self.$new_compstmt(val['$[]'](0)); return result; }, TMP_15.$$arity = 3); Opal.defn(self, '$_reduce_10', TMP_16 = function $$_reduce_10(val, _values, result) { var self = this; result = self.$new_block(); return result; }, TMP_16.$$arity = 3); Opal.defn(self, '$_reduce_11', TMP_17 = function $$_reduce_11(val, _values, result) { var self = this; result = self.$new_block(val['$[]'](0)); return result; }, TMP_17.$$arity = 3); Opal.defn(self, '$_reduce_12', TMP_18 = function $$_reduce_12(val, _values, result) { var self = this; val['$[]'](0)['$<<'](val['$[]'](2)); result = val['$[]'](0); return result; }, TMP_18.$$arity = 3); Opal.defn(self, '$_reduce_13', TMP_19 = function $$_reduce_13(val, _values, result) { var $a, $b, self = this; (($a = ["expr_fname"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_19.$$arity = 3); Opal.defn(self, '$_reduce_14', TMP_20 = function $$_reduce_14(val, _values, result) { var self = this; result = self.$new_alias(val['$[]'](0), val['$[]'](1), val['$[]'](3)); return result; }, TMP_20.$$arity = 3); Opal.defn(self, '$_reduce_15', TMP_21 = function $$_reduce_15(val, _values, result) { var self = this; result = self.$s("valias", self.$value(val['$[]'](1)).$to_sym(), self.$value(val['$[]'](2)).$to_sym()); return result; }, TMP_21.$$arity = 3); Opal.defn(self, '$_reduce_17', TMP_22 = function $$_reduce_17(val, _values, result) { var self = this; result = self.$s("valias", self.$value(val['$[]'](1)).$to_sym(), self.$value(val['$[]'](2)).$to_sym()); return result; }, TMP_22.$$arity = 3); Opal.defn(self, '$_reduce_18', TMP_23 = function $$_reduce_18(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_23.$$arity = 3); Opal.defn(self, '$_reduce_19', TMP_24 = function $$_reduce_19(val, _values, result) { var self = this; result = self.$new_if(val['$[]'](1), val['$[]'](2), val['$[]'](0), nil); return result; }, TMP_24.$$arity = 3); Opal.defn(self, '$_reduce_20', TMP_25 = function $$_reduce_20(val, _values, result) { var self = this; result = self.$new_if(val['$[]'](1), val['$[]'](2), nil, val['$[]'](0)); return result; }, TMP_25.$$arity = 3); Opal.defn(self, '$_reduce_21', TMP_26 = function $$_reduce_21(val, _values, result) { var self = this; result = self.$new_while(val['$[]'](1), val['$[]'](2), val['$[]'](0)); return result; }, TMP_26.$$arity = 3); Opal.defn(self, '$_reduce_22', TMP_27 = function $$_reduce_22(val, _values, result) { var self = this; result = self.$new_until(val['$[]'](1), val['$[]'](2), val['$[]'](0)); return result; }, TMP_27.$$arity = 3); Opal.defn(self, '$_reduce_23', TMP_28 = function $$_reduce_23(val, _values, result) { var self = this; result = self.$new_rescue_mod(val['$[]'](1), val['$[]'](0), val['$[]'](2)); return result; }, TMP_28.$$arity = 3); Opal.defn(self, '$_reduce_26', TMP_29 = function $$_reduce_26(val, _values, result) { var self = this; result = self.$s("masgn", val['$[]'](0), self.$s("to_ary", val['$[]'](2))); return result; }, TMP_29.$$arity = 3); Opal.defn(self, '$_reduce_27', TMP_30 = function $$_reduce_27(val, _values, result) { var self = this; result = self.$new_op_asgn(val['$[]'](1), val['$[]'](0), val['$[]'](2)); return result; }, TMP_30.$$arity = 3); Opal.defn(self, '$_reduce_30', TMP_31 = function $$_reduce_30(val, _values, result) { var self = this; result = self.$s("op_asgn2", val['$[]'](0), self.$op_to_setter(val['$[]'](2)), self.$value(val['$[]'](3)).$to_sym(), val['$[]'](4)); return result; }, TMP_31.$$arity = 3); Opal.defn(self, '$_reduce_34', TMP_32 = function $$_reduce_34(val, _values, result) { var self = this; result = self.$new_assign(val['$[]'](0), val['$[]'](1), self.$s("svalue", val['$[]'](2))); return result; }, TMP_32.$$arity = 3); Opal.defn(self, '$_reduce_35', TMP_33 = function $$_reduce_35(val, _values, result) { var self = this; result = self.$s("masgn", val['$[]'](0), self.$s("to_ary", val['$[]'](2))); return result; }, TMP_33.$$arity = 3); Opal.defn(self, '$_reduce_36', TMP_34 = function $$_reduce_36(val, _values, result) { var self = this; result = self.$s("masgn", val['$[]'](0), val['$[]'](2)); return result; }, TMP_34.$$arity = 3); Opal.defn(self, '$_reduce_38', TMP_35 = function $$_reduce_38(val, _values, result) { var self = this; result = self.$new_assign(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_35.$$arity = 3); Opal.defn(self, '$_reduce_39', TMP_36 = function $$_reduce_39(val, _values, result) { var self = this; result = self.$new_assign(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_36.$$arity = 3); Opal.defn(self, '$_reduce_41', TMP_37 = function $$_reduce_41(val, _values, result) { var self = this; result = self.$s("and", val['$[]'](0), val['$[]'](2)); return result; }, TMP_37.$$arity = 3); Opal.defn(self, '$_reduce_42', TMP_38 = function $$_reduce_42(val, _values, result) { var self = this; result = self.$s("or", val['$[]'](0), val['$[]'](2)); return result; }, TMP_38.$$arity = 3); Opal.defn(self, '$_reduce_43', TMP_39 = function $$_reduce_43(val, _values, result) { var self = this; result = self.$new_unary_call(["!", []], val['$[]'](1)); return result; }, TMP_39.$$arity = 3); Opal.defn(self, '$_reduce_44', TMP_40 = function $$_reduce_44(val, _values, result) { var self = this; result = self.$new_unary_call(val['$[]'](0), val['$[]'](1)); return result; }, TMP_40.$$arity = 3); Opal.defn(self, '$_reduce_53', TMP_41 = function $$_reduce_53(val, _values, result) { var self = this; result = self.$new_iter(val['$[]'](1), val['$[]'](2)); return result; }, TMP_41.$$arity = 3); Opal.defn(self, '$_reduce_54', TMP_42 = function $$_reduce_54(val, _values, result) { var self = this; result = self.$new_call(nil, val['$[]'](0), val['$[]'](1)); return result; }, TMP_42.$$arity = 3); Opal.defn(self, '$_reduce_55', TMP_43 = function $$_reduce_55(val, _values, result) { var self = this; result = self.$new_call(nil, val['$[]'](0), val['$[]'](1))['$<<'](val['$[]'](2)); return result; }, TMP_43.$$arity = 3); Opal.defn(self, '$_reduce_56', TMP_44 = function $$_reduce_56(val, _values, result) { var self = this; result = self.$new_js_call(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_44.$$arity = 3); Opal.defn(self, '$_reduce_57', TMP_45 = function $$_reduce_57(val, _values, result) { var self = this; result = self.$new_js_call(val['$[]'](0), val['$[]'](2), val['$[]'](3))['$<<'](val['$[]'](4)); return result; }, TMP_45.$$arity = 3); Opal.defn(self, '$_reduce_58', TMP_46 = function $$_reduce_58(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_46.$$arity = 3); Opal.defn(self, '$_reduce_59', TMP_47 = function $$_reduce_59(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), val['$[]'](3))['$<<'](val['$[]'](4)); return result; }, TMP_47.$$arity = 3); Opal.defn(self, '$_reduce_60', TMP_48 = function $$_reduce_60(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_48.$$arity = 3); Opal.defn(self, '$_reduce_61', TMP_49 = function $$_reduce_61(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), val['$[]'](3))['$<<'](val['$[]'](4)); return result; }, TMP_49.$$arity = 3); Opal.defn(self, '$_reduce_62', TMP_50 = function $$_reduce_62(val, _values, result) { var self = this; result = self.$new_super(val['$[]'](0), val['$[]'](1)); return result; }, TMP_50.$$arity = 3); Opal.defn(self, '$_reduce_63', TMP_51 = function $$_reduce_63(val, _values, result) { var self = this; result = self.$new_yield(val['$[]'](1)); return result; }, TMP_51.$$arity = 3); Opal.defn(self, '$_reduce_64', TMP_52 = function $$_reduce_64(val, _values, result) { var self = this; result = self.$new_return(val['$[]'](0), val['$[]'](1)); return result; }, TMP_52.$$arity = 3); Opal.defn(self, '$_reduce_65', TMP_53 = function $$_reduce_65(val, _values, result) { var self = this; result = self.$new_break(val['$[]'](0), val['$[]'](1)); return result; }, TMP_53.$$arity = 3); Opal.defn(self, '$_reduce_66', TMP_54 = function $$_reduce_66(val, _values, result) { var self = this; result = self.$new_next(val['$[]'](0), val['$[]'](1)); return result; }, TMP_54.$$arity = 3); Opal.defn(self, '$_reduce_67', TMP_55 = function $$_reduce_67(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_55.$$arity = 3); Opal.defn(self, '$_reduce_68', TMP_56 = function $$_reduce_68(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_56.$$arity = 3); Opal.defn(self, '$_reduce_69', TMP_57 = function $$_reduce_69(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_57.$$arity = 3); Opal.defn(self, '$_reduce_70', TMP_58 = function $$_reduce_70(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_58.$$arity = 3); Opal.defn(self, '$_reduce_71', TMP_59 = function $$_reduce_71(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_59.$$arity = 3); Opal.defn(self, '$_reduce_72', TMP_60 = function $$_reduce_72(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](1)); return result; }, TMP_60.$$arity = 3); Opal.defn(self, '$_reduce_73', TMP_61 = function $$_reduce_73(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](self.$s("splat", val['$[]'](2))); return result; }, TMP_61.$$arity = 3); Opal.defn(self, '$_reduce_74', TMP_62 = function $$_reduce_74(val, _values, result) { var self = this; result = (val['$[]'](0)['$<<'](self.$s("splat", val['$[]'](2)))).$concat(val['$[]'](4).$children()); return result; }, TMP_62.$$arity = 3); Opal.defn(self, '$_reduce_75', TMP_63 = function $$_reduce_75(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](self.$s("splat")); return result; }, TMP_63.$$arity = 3); Opal.defn(self, '$_reduce_76', TMP_64 = function $$_reduce_76(val, _values, result) { var self = this; result = (val['$[]'](0)['$<<'](self.$s("splat"))).$concat(val['$[]'](3).$children()); return result; }, TMP_64.$$arity = 3); Opal.defn(self, '$_reduce_77', TMP_65 = function $$_reduce_77(val, _values, result) { var self = this; result = self.$s("array", self.$s("splat", val['$[]'](1))); return result; }, TMP_65.$$arity = 3); Opal.defn(self, '$_reduce_78', TMP_66 = function $$_reduce_78(val, _values, result) { var self = this; result = self.$s("array", self.$s("splat", val['$[]'](1))).$concat(val['$[]'](3).$children()); return result; }, TMP_66.$$arity = 3); Opal.defn(self, '$_reduce_79', TMP_67 = function $$_reduce_79(val, _values, result) { var self = this; result = self.$s("array", self.$s("splat")); return result; }, TMP_67.$$arity = 3); Opal.defn(self, '$_reduce_80', TMP_68 = function $$_reduce_80(val, _values, result) { var self = this; result = self.$s("array", self.$s("splat")).$concat(val['$[]'](2).$children()); return result; }, TMP_68.$$arity = 3); Opal.defn(self, '$_reduce_81', TMP_69 = function $$_reduce_81(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_69.$$arity = 3); Opal.defn(self, '$_reduce_82', TMP_70 = function $$_reduce_82(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_70.$$arity = 3); Opal.defn(self, '$_reduce_83', TMP_71 = function $$_reduce_83(val, _values, result) { var self = this; result = self.$s("array", val['$[]'](0)); return result; }, TMP_71.$$arity = 3); Opal.defn(self, '$_reduce_84', TMP_72 = function $$_reduce_84(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](1)); return result; }, TMP_72.$$arity = 3); Opal.defn(self, '$_reduce_85', TMP_73 = function $$_reduce_85(val, _values, result) { var self = this; result = self.$s("array", val['$[]'](0)); return result; }, TMP_73.$$arity = 3); Opal.defn(self, '$_reduce_86', TMP_74 = function $$_reduce_86(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](2)); return result; }, TMP_74.$$arity = 3); Opal.defn(self, '$_reduce_87', TMP_75 = function $$_reduce_87(val, _values, result) { var self = this; result = self.$new_assignable(val['$[]'](0)); return result; }, TMP_75.$$arity = 3); Opal.defn(self, '$_reduce_88', TMP_76 = function $$_reduce_88(val, _values, result) { var $a, self = this, args = nil; args = (function() {if ((($a = val['$[]'](2)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return val['$[]'](2) } else { return [] }; return nil; })(); result = self.$s("attrasgn", val['$[]'](0), "[]=", ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args)))); return result; }, TMP_76.$$arity = 3); Opal.defn(self, '$_reduce_89', TMP_77 = function $$_reduce_89(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), []); return result; }, TMP_77.$$arity = 3); Opal.defn(self, '$_reduce_95', TMP_78 = function $$_reduce_95(val, _values, result) { var self = this; result = self.$new_assignable(val['$[]'](0)); return result; }, TMP_78.$$arity = 3); Opal.defn(self, '$_reduce_96', TMP_79 = function $$_reduce_96(val, _values, result) { var self = this; result = self.$new_js_attrasgn(val['$[]'](0), val['$[]'](2)); return result; }, TMP_79.$$arity = 3); Opal.defn(self, '$_reduce_97', TMP_80 = function $$_reduce_97(val, _values, result) { var self = this; result = self.$new_attrasgn(val['$[]'](0), "[]=", val['$[]'](2)); return result; }, TMP_80.$$arity = 3); Opal.defn(self, '$_reduce_98', TMP_81 = function $$_reduce_98(val, _values, result) { var self = this; result = self.$new_attrasgn(val['$[]'](0), self.$op_to_setter(val['$[]'](2))); return result; }, TMP_81.$$arity = 3); Opal.defn(self, '$_reduce_99', TMP_82 = function $$_reduce_99(val, _values, result) { var self = this; result = self.$new_attrasgn(val['$[]'](0), self.$op_to_setter(val['$[]'](2))); return result; }, TMP_82.$$arity = 3); Opal.defn(self, '$_reduce_100', TMP_83 = function $$_reduce_100(val, _values, result) { var self = this; result = self.$new_attrasgn(val['$[]'](0), self.$op_to_setter(val['$[]'](2))); return result; }, TMP_83.$$arity = 3); Opal.defn(self, '$_reduce_101', TMP_84 = function $$_reduce_101(val, _values, result) { var self = this; result = self.$new_colon2(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_84.$$arity = 3); Opal.defn(self, '$_reduce_102', TMP_85 = function $$_reduce_102(val, _values, result) { var self = this; result = self.$new_colon3(val['$[]'](0), val['$[]'](1)); return result; }, TMP_85.$$arity = 3); Opal.defn(self, '$_reduce_105', TMP_86 = function $$_reduce_105(val, _values, result) { var self = this; result = self.$new_colon3(val['$[]'](0), val['$[]'](1)); return result; }, TMP_86.$$arity = 3); Opal.defn(self, '$_reduce_106', TMP_87 = function $$_reduce_106(val, _values, result) { var self = this; result = self.$new_const(val['$[]'](0)); return result; }, TMP_87.$$arity = 3); Opal.defn(self, '$_reduce_107', TMP_88 = function $$_reduce_107(val, _values, result) { var self = this; result = self.$new_colon2(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_88.$$arity = 3); Opal.defn(self, '$_reduce_111', TMP_89 = function $$_reduce_111(val, _values, result) { var $a, $b, self = this; (($a = ["expr_end"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); result = val['$[]'](0); return result; }, TMP_89.$$arity = 3); Opal.defn(self, '$_reduce_112', TMP_90 = function $$_reduce_112(val, _values, result) { var $a, $b, self = this; (($a = ["expr_end"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); result = val['$[]'](0); return result; }, TMP_90.$$arity = 3); Opal.defn(self, '$_reduce_113', TMP_91 = function $$_reduce_113(val, _values, result) { var self = this; result = self.$new_sym(val['$[]'](0)); return result; }, TMP_91.$$arity = 3); Opal.defn(self, '$_reduce_115', TMP_92 = function $$_reduce_115(val, _values, result) { var self = this; result = self.$s("undef", val['$[]'](0)); return result; }, TMP_92.$$arity = 3); Opal.defn(self, '$_reduce_116', TMP_93 = function $$_reduce_116(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](2)); return result; }, TMP_93.$$arity = 3); Opal.defn(self, '$_reduce_191', TMP_94 = function $$_reduce_191(val, _values, result) { var self = this; result = self.$new_assign(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_94.$$arity = 3); Opal.defn(self, '$_reduce_192', TMP_95 = function $$_reduce_192(val, _values, result) { var self = this; result = self.$new_assign(val['$[]'](0), val['$[]'](1), self.$s("rescue_mod", val['$[]'](2), val['$[]'](4))); return result; }, TMP_95.$$arity = 3); Opal.defn(self, '$_reduce_193', TMP_96 = function $$_reduce_193(val, _values, result) { var self = this; result = self.$new_op_asgn(val['$[]'](1), val['$[]'](0), val['$[]'](2)); return result; }, TMP_96.$$arity = 3); Opal.defn(self, '$_reduce_194', TMP_97 = function $$_reduce_194(val, _values, result) { var self = this; result = self.$new_op_asgn1(val['$[]'](0), val['$[]'](2), val['$[]'](4), val['$[]'](5)); return result; }, TMP_97.$$arity = 3); Opal.defn(self, '$_reduce_195', TMP_98 = function $$_reduce_195(val, _values, result) { var self = this; self.$raise(".JS[...] " + (val['$[]'](4)) + " is not supported"); return result; }, TMP_98.$$arity = 3); Opal.defn(self, '$_reduce_196', TMP_99 = function $$_reduce_196(val, _values, result) { var self = this; result = self.$s("op_asgn2", val['$[]'](0), self.$op_to_setter(val['$[]'](2)), self.$value(val['$[]'](3)).$to_sym(), val['$[]'](4)); return result; }, TMP_99.$$arity = 3); Opal.defn(self, '$_reduce_202', TMP_100 = function $$_reduce_202(val, _values, result) { var self = this; result = self.$new_irange(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_100.$$arity = 3); Opal.defn(self, '$_reduce_203', TMP_101 = function $$_reduce_203(val, _values, result) { var self = this; result = self.$new_erange(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_101.$$arity = 3); Opal.defn(self, '$_reduce_204', TMP_102 = function $$_reduce_204(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_102.$$arity = 3); Opal.defn(self, '$_reduce_205', TMP_103 = function $$_reduce_205(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_103.$$arity = 3); Opal.defn(self, '$_reduce_206', TMP_104 = function $$_reduce_206(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_104.$$arity = 3); Opal.defn(self, '$_reduce_207', TMP_105 = function $$_reduce_207(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_105.$$arity = 3); Opal.defn(self, '$_reduce_208', TMP_106 = function $$_reduce_208(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_106.$$arity = 3); Opal.defn(self, '$_reduce_209', TMP_107 = function $$_reduce_209(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_107.$$arity = 3); Opal.defn(self, '$_reduce_210', TMP_108 = function $$_reduce_210(val, _values, result) { var self = this; result = self.$new_call(self.$new_binary_call(self.$new_int(val['$[]'](1)), val['$[]'](2), val['$[]'](3)), ["-@", []], []); return result; }, TMP_108.$$arity = 3); Opal.defn(self, '$_reduce_211', TMP_109 = function $$_reduce_211(val, _values, result) { var self = this; result = self.$new_call(self.$new_binary_call(self.$new_float(val['$[]'](1)), val['$[]'](2), val['$[]'](3)), ["-@", []], []); return result; }, TMP_109.$$arity = 3); Opal.defn(self, '$_reduce_212', TMP_110 = function $$_reduce_212(val, _values, result) { var $a, self = this; result = self.$new_call(val['$[]'](1), ["+@", []], []); if ((($a = ["int", "float"]['$include?'](val['$[]'](1).$type())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = val['$[]'](1)}; return result; }, TMP_110.$$arity = 3); Opal.defn(self, '$_reduce_213', TMP_111 = function $$_reduce_213(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](1), ["-@", []], []); if (val['$[]'](1).$type()['$==']("int")) { val['$[]'](1)['$[]='](1, val['$[]'](1)['$[]'](1)['$-@']()); result = val['$[]'](1); } else if (val['$[]'](1).$type()['$==']("float")) { val['$[]'](1)['$[]='](1, val['$[]'](1)['$[]'](1).$to_f()['$-@']()); result = val['$[]'](1);}; return result; }, TMP_111.$$arity = 3); Opal.defn(self, '$_reduce_214', TMP_112 = function $$_reduce_214(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_112.$$arity = 3); Opal.defn(self, '$_reduce_215', TMP_113 = function $$_reduce_215(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_113.$$arity = 3); Opal.defn(self, '$_reduce_216', TMP_114 = function $$_reduce_216(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_114.$$arity = 3); Opal.defn(self, '$_reduce_217', TMP_115 = function $$_reduce_217(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_115.$$arity = 3); Opal.defn(self, '$_reduce_218', TMP_116 = function $$_reduce_218(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_116.$$arity = 3); Opal.defn(self, '$_reduce_219', TMP_117 = function $$_reduce_219(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_117.$$arity = 3); Opal.defn(self, '$_reduce_220', TMP_118 = function $$_reduce_220(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_118.$$arity = 3); Opal.defn(self, '$_reduce_221', TMP_119 = function $$_reduce_221(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_119.$$arity = 3); Opal.defn(self, '$_reduce_222', TMP_120 = function $$_reduce_222(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_120.$$arity = 3); Opal.defn(self, '$_reduce_223', TMP_121 = function $$_reduce_223(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_121.$$arity = 3); Opal.defn(self, '$_reduce_224', TMP_122 = function $$_reduce_224(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_122.$$arity = 3); Opal.defn(self, '$_reduce_225', TMP_123 = function $$_reduce_225(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_123.$$arity = 3); Opal.defn(self, '$_reduce_226', TMP_124 = function $$_reduce_226(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_124.$$arity = 3); Opal.defn(self, '$_reduce_227', TMP_125 = function $$_reduce_227(val, _values, result) { var self = this; result = self.$new_unary_call(val['$[]'](0), val['$[]'](1)); return result; }, TMP_125.$$arity = 3); Opal.defn(self, '$_reduce_228', TMP_126 = function $$_reduce_228(val, _values, result) { var self = this; result = self.$new_unary_call(val['$[]'](0), val['$[]'](1)); return result; }, TMP_126.$$arity = 3); Opal.defn(self, '$_reduce_229', TMP_127 = function $$_reduce_229(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_127.$$arity = 3); Opal.defn(self, '$_reduce_230', TMP_128 = function $$_reduce_230(val, _values, result) { var self = this; result = self.$new_binary_call(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_128.$$arity = 3); Opal.defn(self, '$_reduce_231', TMP_129 = function $$_reduce_231(val, _values, result) { var self = this; result = self.$new_and(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_129.$$arity = 3); Opal.defn(self, '$_reduce_232', TMP_130 = function $$_reduce_232(val, _values, result) { var self = this; result = self.$new_or(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_130.$$arity = 3); Opal.defn(self, '$_reduce_233', TMP_131 = function $$_reduce_233(val, _values, result) { var self = this; result = self.$s("defined", val['$[]'](2)); return result; }, TMP_131.$$arity = 3); Opal.defn(self, '$_reduce_234', TMP_132 = function $$_reduce_234(val, _values, result) { var self = this; self.$lexer().$cond_push(1); return result; }, TMP_132.$$arity = 3); Opal.defn(self, '$_reduce_235', TMP_133 = function $$_reduce_235(val, _values, result) { var self = this; self.$lexer().$cond_pop(); return result; }, TMP_133.$$arity = 3); Opal.defn(self, '$_reduce_236', TMP_134 = function $$_reduce_236(val, _values, result) { var self = this; result = self.$new_if(val['$[]'](1), val['$[]'](0), val['$[]'](3), val['$[]'](6)); return result; }, TMP_134.$$arity = 3); Opal.defn(self, '$_reduce_239', TMP_135 = function $$_reduce_239(val, _values, result) { var self = this; result = nil; return result; }, TMP_135.$$arity = 3); Opal.defn(self, '$_reduce_240', TMP_136 = function $$_reduce_240(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_136.$$arity = 3); Opal.defn(self, '$_reduce_241', TMP_137 = function $$_reduce_241(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_137.$$arity = 3); Opal.defn(self, '$_reduce_242', TMP_138 = function $$_reduce_242(val, _values, result) { var $a, self = this; val['$[]'](0)['$<<'](($a = self).$s.apply($a, ["hash"].concat(Opal.to_a(val['$[]'](2))))); result = val['$[]'](0); return result; }, TMP_138.$$arity = 3); Opal.defn(self, '$_reduce_243', TMP_139 = function $$_reduce_243(val, _values, result) { var $a, self = this; result = [($a = self).$s.apply($a, ["hash"].concat(Opal.to_a(val['$[]'](0))))]; return result; }, TMP_139.$$arity = 3); Opal.defn(self, '$_reduce_244', TMP_140 = function $$_reduce_244(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](2)); return result; }, TMP_140.$$arity = 3); Opal.defn(self, '$_reduce_245', TMP_141 = function $$_reduce_245(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_141.$$arity = 3); Opal.defn(self, '$_reduce_247', TMP_142 = function $$_reduce_247(val, _values, result) { var self = this; result = []; return result; }, TMP_142.$$arity = 3); Opal.defn(self, '$_reduce_249', TMP_143 = function $$_reduce_249(val, _values, result) { var self = this; result = []; return result; }, TMP_143.$$arity = 3); Opal.defn(self, '$_reduce_251', TMP_144 = function $$_reduce_251(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_144.$$arity = 3); Opal.defn(self, '$_reduce_252', TMP_145 = function $$_reduce_252(val, _values, result) { var self = this; result = val['$[]'](0); result['$<<'](self.$new_hash(nil, val['$[]'](2), nil)); return result; }, TMP_145.$$arity = 3); Opal.defn(self, '$_reduce_253', TMP_146 = function $$_reduce_253(val, _values, result) { var self = this; result = [self.$new_hash(nil, val['$[]'](0), nil)]; return result; }, TMP_146.$$arity = 3); Opal.defn(self, '$_reduce_254', TMP_147 = function $$_reduce_254(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_147.$$arity = 3); Opal.defn(self, '$_reduce_255', TMP_148 = function $$_reduce_255(val, _values, result) { var self = this; result = val['$[]'](0); self.$add_block_pass(val['$[]'](0), val['$[]'](1)); return result; }, TMP_148.$$arity = 3); Opal.defn(self, '$_reduce_256', TMP_149 = function $$_reduce_256(val, _values, result) { var self = this; result = [self.$new_hash(nil, val['$[]'](0), nil)]; self.$add_block_pass(result, val['$[]'](1)); return result; }, TMP_149.$$arity = 3); Opal.defn(self, '$_reduce_257', TMP_150 = function $$_reduce_257(val, _values, result) { var $a, self = this; result = val['$[]'](0); result['$<<'](self.$new_hash(nil, val['$[]'](2), nil)); if ((($a = val['$[]'](3)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result['$<<'](val['$[]'](3))}; return result; }, TMP_150.$$arity = 3); Opal.defn(self, '$_reduce_258', TMP_151 = function $$_reduce_258(val, _values, result) { var self = this; result = []; self.$add_block_pass(result, val['$[]'](0)); return result; }, TMP_151.$$arity = 3); Opal.defn(self, '$_reduce_259', TMP_152 = function $$_reduce_259(val, _values, result) { var self = this; self.$lexer().$cmdarg_push(1); return result; }, TMP_152.$$arity = 3); Opal.defn(self, '$_reduce_260', TMP_153 = function $$_reduce_260(val, _values, result) { var self = this; self.$lexer().$cmdarg_pop(); result = val['$[]'](1); return result; }, TMP_153.$$arity = 3); Opal.defn(self, '$_reduce_261', TMP_154 = function $$_reduce_261(val, _values, result) { var self = this; result = self.$new_block_pass(val['$[]'](0), val['$[]'](1)); return result; }, TMP_154.$$arity = 3); Opal.defn(self, '$_reduce_262', TMP_155 = function $$_reduce_262(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_155.$$arity = 3); Opal.defn(self, '$_reduce_263', TMP_156 = function $$_reduce_263(val, _values, result) { var self = this; result = nil; return result; }, TMP_156.$$arity = 3); Opal.defn(self, '$_reduce_264', TMP_157 = function $$_reduce_264(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_157.$$arity = 3); Opal.defn(self, '$_reduce_265', TMP_158 = function $$_reduce_265(val, _values, result) { var self = this; result = [self.$new_splat(val['$[]'](0), val['$[]'](1))]; return result; }, TMP_158.$$arity = 3); Opal.defn(self, '$_reduce_266', TMP_159 = function $$_reduce_266(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](2)); return result; }, TMP_159.$$arity = 3); Opal.defn(self, '$_reduce_267', TMP_160 = function $$_reduce_267(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](self.$new_splat(val['$[]'](2), val['$[]'](3))); return result; }, TMP_160.$$arity = 3); Opal.defn(self, '$_reduce_268', TMP_161 = function $$_reduce_268(val, _values, result) { var $a, self = this; val['$[]'](0)['$<<'](val['$[]'](2)); result = ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(val['$[]'](0)))); return result; }, TMP_161.$$arity = 3); Opal.defn(self, '$_reduce_269', TMP_162 = function $$_reduce_269(val, _values, result) { var $a, self = this; val['$[]'](0)['$<<'](self.$s("splat", val['$[]'](3))); result = ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(val['$[]'](0)))); return result; }, TMP_162.$$arity = 3); Opal.defn(self, '$_reduce_270', TMP_163 = function $$_reduce_270(val, _values, result) { var self = this; result = self.$s("splat", val['$[]'](1)); return result; }, TMP_163.$$arity = 3); Opal.defn(self, '$_reduce_280', TMP_164 = function $$_reduce_280(val, _values, result) { var self = this; result = self.$lexer().$line(); return result; }, TMP_164.$$arity = 3); Opal.defn(self, '$_reduce_281', TMP_165 = function $$_reduce_281(val, _values, result) { var self = this; result = self.$s("begin", val['$[]'](2)); return result; }, TMP_165.$$arity = 3); Opal.defn(self, '$_reduce_282', TMP_166 = function $$_reduce_282(val, _values, result) { var $a, $b, self = this; (($a = ["expr_endarg"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_166.$$arity = 3); Opal.defn(self, '$_reduce_283', TMP_167 = function $$_reduce_283(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_167.$$arity = 3); Opal.defn(self, '$_reduce_284', TMP_168 = function $$_reduce_284(val, _values, result) { var $a, $b, self = this; (($a = ["expr_endarg"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_168.$$arity = 3); Opal.defn(self, '$_reduce_285', TMP_169 = function $$_reduce_285(val, _values, result) { var self = this; result = self.$new_nil(val['$[]'](0)); return result; }, TMP_169.$$arity = 3); Opal.defn(self, '$_reduce_286', TMP_170 = function $$_reduce_286(val, _values, result) { var self = this; result = self.$new_paren(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_170.$$arity = 3); Opal.defn(self, '$_reduce_287', TMP_171 = function $$_reduce_287(val, _values, result) { var self = this; result = self.$new_colon2(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_171.$$arity = 3); Opal.defn(self, '$_reduce_288', TMP_172 = function $$_reduce_288(val, _values, result) { var self = this; result = self.$new_colon3(val['$[]'](0), val['$[]'](1)); return result; }, TMP_172.$$arity = 3); Opal.defn(self, '$_reduce_289', TMP_173 = function $$_reduce_289(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), ["[]", []], val['$[]'](2)); return result; }, TMP_173.$$arity = 3); Opal.defn(self, '$_reduce_290', TMP_174 = function $$_reduce_290(val, _values, result) { var self = this; result = self.$new_js_call(val['$[]'](0), ["[]", []], val['$[]'](2)); return result; }, TMP_174.$$arity = 3); Opal.defn(self, '$_reduce_291', TMP_175 = function $$_reduce_291(val, _values, result) { var self = this; result = self.$new_array(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_175.$$arity = 3); Opal.defn(self, '$_reduce_292', TMP_176 = function $$_reduce_292(val, _values, result) { var self = this; result = self.$new_hash(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_176.$$arity = 3); Opal.defn(self, '$_reduce_293', TMP_177 = function $$_reduce_293(val, _values, result) { var self = this; result = self.$new_return(val['$[]'](0)); return result; }, TMP_177.$$arity = 3); Opal.defn(self, '$_reduce_294', TMP_178 = function $$_reduce_294(val, _values, result) { var self = this; result = self.$new_yield(val['$[]'](2)); return result; }, TMP_178.$$arity = 3); Opal.defn(self, '$_reduce_295', TMP_179 = function $$_reduce_295(val, _values, result) { var self = this; result = self.$s("yield"); return result; }, TMP_179.$$arity = 3); Opal.defn(self, '$_reduce_296', TMP_180 = function $$_reduce_296(val, _values, result) { var self = this; result = self.$s("yield"); return result; }, TMP_180.$$arity = 3); Opal.defn(self, '$_reduce_297', TMP_181 = function $$_reduce_297(val, _values, result) { var self = this; result = self.$s("defined", val['$[]'](3)); return result; }, TMP_181.$$arity = 3); Opal.defn(self, '$_reduce_298', TMP_182 = function $$_reduce_298(val, _values, result) { var self = this; result = self.$new_unary_call(["!", []], val['$[]'](2)); return result; }, TMP_182.$$arity = 3); Opal.defn(self, '$_reduce_299', TMP_183 = function $$_reduce_299(val, _values, result) { var self = this; result = self.$new_unary_call(["!", []], self.$new_nil(val['$[]'](0))); return result; }, TMP_183.$$arity = 3); Opal.defn(self, '$_reduce_300', TMP_184 = function $$_reduce_300(val, _values, result) { var self = this; result = self.$new_call(nil, val['$[]'](0), []); result['$<<'](val['$[]'](1)); return result; }, TMP_184.$$arity = 3); Opal.defn(self, '$_reduce_302', TMP_185 = function $$_reduce_302(val, _values, result) { var self = this; result = self.$new_method_call_with_block(val['$[]'](0), val['$[]'](1)); return result; }, TMP_185.$$arity = 3); Opal.defn(self, '$_reduce_303', TMP_186 = function $$_reduce_303(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_186.$$arity = 3); Opal.defn(self, '$_reduce_304', TMP_187 = function $$_reduce_304(val, _values, result) { var self = this; result = self.$new_if(val['$[]'](0), val['$[]'](1), val['$[]'](3), val['$[]'](4)); return result; }, TMP_187.$$arity = 3); Opal.defn(self, '$_reduce_305', TMP_188 = function $$_reduce_305(val, _values, result) { var self = this; result = self.$new_if(val['$[]'](0), val['$[]'](1), val['$[]'](4), val['$[]'](3)); return result; }, TMP_188.$$arity = 3); Opal.defn(self, '$_reduce_306', TMP_189 = function $$_reduce_306(val, _values, result) { var self = this; self.$lexer().$cond_push(1); result = self.$lexer().$line(); return result; }, TMP_189.$$arity = 3); Opal.defn(self, '$_reduce_307', TMP_190 = function $$_reduce_307(val, _values, result) { var self = this; self.$lexer().$cond_pop(); return result; }, TMP_190.$$arity = 3); Opal.defn(self, '$_reduce_308', TMP_191 = function $$_reduce_308(val, _values, result) { var self = this; result = self.$s("while", val['$[]'](2), val['$[]'](5)); return result; }, TMP_191.$$arity = 3); Opal.defn(self, '$_reduce_309', TMP_192 = function $$_reduce_309(val, _values, result) { var self = this; self.$lexer().$cond_push(1); result = self.$lexer().$line(); return result; }, TMP_192.$$arity = 3); Opal.defn(self, '$_reduce_310', TMP_193 = function $$_reduce_310(val, _values, result) { var self = this; self.$lexer().$cond_pop(); return result; }, TMP_193.$$arity = 3); Opal.defn(self, '$_reduce_311', TMP_194 = function $$_reduce_311(val, _values, result) { var self = this; result = self.$s("until", val['$[]'](2), val['$[]'](5)); return result; }, TMP_194.$$arity = 3); Opal.defn(self, '$_reduce_312', TMP_195 = function $$_reduce_312(val, _values, result) { var $a, self = this; result = ($a = self).$s.apply($a, ["case", val['$[]'](1)].concat(Opal.to_a(val['$[]'](3)))); return result; }, TMP_195.$$arity = 3); Opal.defn(self, '$_reduce_313', TMP_196 = function $$_reduce_313(val, _values, result) { var $a, self = this; result = ($a = self).$s.apply($a, ["case", nil].concat(Opal.to_a(val['$[]'](2)))); return result; }, TMP_196.$$arity = 3); Opal.defn(self, '$_reduce_314', TMP_197 = function $$_reduce_314(val, _values, result) { var self = this; result = self.$s("case", nil, val['$[]'](3)); return result; }, TMP_197.$$arity = 3); Opal.defn(self, '$_reduce_315', TMP_198 = function $$_reduce_315(val, _values, result) { var self = this; self.$lexer().$cond_push(1); result = self.$lexer().$line(); return result; }, TMP_198.$$arity = 3); Opal.defn(self, '$_reduce_316', TMP_199 = function $$_reduce_316(val, _values, result) { var self = this; self.$lexer().$cond_pop(); return result; }, TMP_199.$$arity = 3); Opal.defn(self, '$_reduce_317', TMP_200 = function $$_reduce_317(val, _values, result) { var self = this; result = self.$s("for", val['$[]'](4), val['$[]'](1), val['$[]'](7)); return result; }, TMP_200.$$arity = 3); Opal.defn(self, '$_reduce_318', TMP_201 = function $$_reduce_318(val, _values, result) { var self = this; return result; }, TMP_201.$$arity = 3); Opal.defn(self, '$_reduce_319', TMP_202 = function $$_reduce_319(val, _values, result) { var self = this; result = self.$new_class(val['$[]'](0), val['$[]'](1), val['$[]'](2), val['$[]'](4), val['$[]'](5)); return result; }, TMP_202.$$arity = 3); Opal.defn(self, '$_reduce_320', TMP_203 = function $$_reduce_320(val, _values, result) { var self = this; result = self.$lexer().$line(); return result; }, TMP_203.$$arity = 3); Opal.defn(self, '$_reduce_321', TMP_204 = function $$_reduce_321(val, _values, result) { var self = this; return result; }, TMP_204.$$arity = 3); Opal.defn(self, '$_reduce_322', TMP_205 = function $$_reduce_322(val, _values, result) { var self = this; result = self.$new_sclass(val['$[]'](0), val['$[]'](3), val['$[]'](6), val['$[]'](7)); return result; }, TMP_205.$$arity = 3); Opal.defn(self, '$_reduce_323', TMP_206 = function $$_reduce_323(val, _values, result) { var self = this; result = self.$lexer().$line(); return result; }, TMP_206.$$arity = 3); Opal.defn(self, '$_reduce_324', TMP_207 = function $$_reduce_324(val, _values, result) { var self = this; return result; }, TMP_207.$$arity = 3); Opal.defn(self, '$_reduce_325', TMP_208 = function $$_reduce_325(val, _values, result) { var self = this; result = self.$new_module(val['$[]'](0), val['$[]'](2), val['$[]'](4), val['$[]'](5)); return result; }, TMP_208.$$arity = 3); Opal.defn(self, '$_reduce_326', TMP_209 = function $$_reduce_326(val, _values, result) { var self = this; self.$push_scope(); return result; }, TMP_209.$$arity = 3); Opal.defn(self, '$_reduce_327', TMP_210 = function $$_reduce_327(val, _values, result) { var self = this; result = self.$new_def(val['$[]'](0), nil, val['$[]'](1), val['$[]'](3), val['$[]'](4), val['$[]'](5)); self.$pop_scope(); return result; }, TMP_210.$$arity = 3); Opal.defn(self, '$_reduce_328', TMP_211 = function $$_reduce_328(val, _values, result) { var $a, $b, self = this; (($a = ["expr_fname"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_211.$$arity = 3); Opal.defn(self, '$_reduce_329', TMP_212 = function $$_reduce_329(val, _values, result) { var $a, $b, self = this; self.$push_scope(); (($a = ["expr_endfn"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_212.$$arity = 3); Opal.defn(self, '$_reduce_330', TMP_213 = function $$_reduce_330(val, _values, result) { var self = this; result = self.$new_def(val['$[]'](0), val['$[]'](1), val['$[]'](4), val['$[]'](6), val['$[]'](7), val['$[]'](8)); self.$pop_scope(); return result; }, TMP_213.$$arity = 3); Opal.defn(self, '$_reduce_331', TMP_214 = function $$_reduce_331(val, _values, result) { var self = this; result = self.$new_break(val['$[]'](0)); return result; }, TMP_214.$$arity = 3); Opal.defn(self, '$_reduce_332', TMP_215 = function $$_reduce_332(val, _values, result) { var self = this; result = self.$s("next"); return result; }, TMP_215.$$arity = 3); Opal.defn(self, '$_reduce_333', TMP_216 = function $$_reduce_333(val, _values, result) { var self = this; result = self.$s("redo"); return result; }, TMP_216.$$arity = 3); Opal.defn(self, '$_reduce_343', TMP_217 = function $$_reduce_343(val, _values, result) { var self = this; result = []; return result; }, TMP_217.$$arity = 3); Opal.defn(self, '$_reduce_344', TMP_218 = function $$_reduce_344(val, _values, result) { var self = this; result = val['$[]'](2); return result; }, TMP_218.$$arity = 3); Opal.defn(self, '$_reduce_345', TMP_219 = function $$_reduce_345(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_219.$$arity = 3); Opal.defn(self, '$_reduce_346', TMP_220 = function $$_reduce_346(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](val['$[]'](2)); return result; }, TMP_220.$$arity = 3); Opal.defn(self, '$_reduce_347', TMP_221 = function $$_reduce_347(val, _values, result) { var self = this; result = self.$new_shadowarg(val['$[]'](0)); return result; }, TMP_221.$$arity = 3); Opal.defn(self, '$_reduce_349', TMP_222 = function $$_reduce_349(val, _values, result) { var self = this; result = self.$new_call(nil, ["lambda", []], []); result['$<<'](self.$new_iter(val['$[]'](0), val['$[]'](1))); return result; }, TMP_222.$$arity = 3); Opal.defn(self, '$_reduce_350', TMP_223 = function $$_reduce_350(val, _values, result) { var $a, self = this; result = ($a = self).$new_block_args.apply($a, Opal.to_a(val['$[]'](1))); return result; }, TMP_223.$$arity = 3); Opal.defn(self, '$_reduce_351', TMP_224 = function $$_reduce_351(val, _values, result) { var self = this; result = nil; return result; }, TMP_224.$$arity = 3); Opal.defn(self, '$_reduce_352', TMP_225 = function $$_reduce_352(val, _values, result) { var $a, self = this; result = ($a = self).$new_block_args.apply($a, Opal.to_a(val['$[]'](0))); return result; }, TMP_225.$$arity = 3); Opal.defn(self, '$_reduce_354', TMP_226 = function $$_reduce_354(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_226.$$arity = 3); Opal.defn(self, '$_reduce_355', TMP_227 = function $$_reduce_355(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_227.$$arity = 3); Opal.defn(self, '$_reduce_356', TMP_228 = function $$_reduce_356(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_228.$$arity = 3); Opal.defn(self, '$_reduce_357', TMP_229 = function $$_reduce_357(val, _values, result) { var self = this; result = self.$new_if(val['$[]'](0), val['$[]'](1), val['$[]'](3), val['$[]'](4)); return result; }, TMP_229.$$arity = 3); Opal.defn(self, '$_reduce_359', TMP_230 = function $$_reduce_359(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_230.$$arity = 3); Opal.defn(self, '$_reduce_360', TMP_231 = function $$_reduce_360(val, _values, result) { var self = this; result = self.$s("block", val['$[]'](0)); return result; }, TMP_231.$$arity = 3); Opal.defn(self, '$_reduce_361', TMP_232 = function $$_reduce_361(val, _values, result) { var self = this; val['$[]'](0)['$<<'](val['$[]'](2)); result = val['$[]'](0); return result; }, TMP_232.$$arity = 3); Opal.defn(self, '$_reduce_362', TMP_233 = function $$_reduce_362(val, _values, result) { var self = this; result = self.$new_assign(self.$new_assignable(self.$new_ident(val['$[]'](0))), val['$[]'](1), val['$[]'](2)); return result; }, TMP_233.$$arity = 3); Opal.defn(self, '$_reduce_364', TMP_234 = function $$_reduce_364(val, _values, result) { var self = this; result = self.$new_block_args(nil, [val['$[]'](1)]); return result; }, TMP_234.$$arity = 3); Opal.defn(self, '$_reduce_365', TMP_235 = function $$_reduce_365(val, _values, result) { var self = this; result = nil; return result; }, TMP_235.$$arity = 3); Opal.defn(self, '$_reduce_366', TMP_236 = function $$_reduce_366(val, _values, result) { var $a, self = this; val['$[]'](1)['$<<'](val['$[]'](2)); result = ($a = self).$new_block_args.apply($a, Opal.to_a(val['$[]'](1))); return result; }, TMP_236.$$arity = 3); Opal.defn(self, '$_reduce_367', TMP_237 = function $$_reduce_367(val, _values, result) { var self = this; result = [val['$[]'](0), val['$[]'](2), val['$[]'](3)]; return result; }, TMP_237.$$arity = 3); Opal.defn(self, '$_reduce_368', TMP_238 = function $$_reduce_368(val, _values, result) { var self = this; result = [val['$[]'](0), nil, val['$[]'](1)]; return result; }, TMP_238.$$arity = 3); Opal.defn(self, '$_reduce_369', TMP_239 = function $$_reduce_369(val, _values, result) { var self = this; result = [nil, val['$[]'](0), val['$[]'](1)]; return result; }, TMP_239.$$arity = 3); Opal.defn(self, '$_reduce_370', TMP_240 = function $$_reduce_370(val, _values, result) { var self = this; result = [nil, nil, val['$[]'](0)]; return result; }, TMP_240.$$arity = 3); Opal.defn(self, '$_reduce_371', TMP_241 = function $$_reduce_371(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_241.$$arity = 3); Opal.defn(self, '$_reduce_372', TMP_242 = function $$_reduce_372(val, _values, result) { var self = this; nil; return result; }, TMP_242.$$arity = 3); Opal.defn(self, '$_reduce_373', TMP_243 = function $$_reduce_373(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](2)); restarg = self.$new_restarg(val['$[]'](4)); result = [$rb_plus($rb_plus(val['$[]'](0), optarg), restarg), val['$[]'](5)]; return result; }, TMP_243.$$arity = 3); Opal.defn(self, '$_reduce_374', TMP_244 = function $$_reduce_374(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](2)); restarg = self.$new_restarg(val['$[]'](4)); result = [$rb_plus($rb_plus($rb_plus(val['$[]'](0), optarg), restarg), val['$[]'](6)), val['$[]'](7)]; return result; }, TMP_244.$$arity = 3); Opal.defn(self, '$_reduce_375', TMP_245 = function $$_reduce_375(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](2)); result = [$rb_plus(val['$[]'](0), optarg), val['$[]'](3)]; return result; }, TMP_245.$$arity = 3); Opal.defn(self, '$_reduce_376', TMP_246 = function $$_reduce_376(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](2)); result = [$rb_plus($rb_plus(val['$[]'](0), optarg), val['$[]'](4)), val['$[]'](5)]; return result; }, TMP_246.$$arity = 3); Opal.defn(self, '$_reduce_377', TMP_247 = function $$_reduce_377(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](2)); result = [$rb_plus(val['$[]'](0), restarg), val['$[]'](3)]; return result; }, TMP_247.$$arity = 3); Opal.defn(self, '$_reduce_378', TMP_248 = function $$_reduce_378(val, _values, result) { var self = this; val['$[]'](0)['$<<'](nil); result = [val['$[]'](0), nil]; return result; }, TMP_248.$$arity = 3); Opal.defn(self, '$_reduce_379', TMP_249 = function $$_reduce_379(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](2)); result = [$rb_plus($rb_plus(val['$[]'](0), restarg), val['$[]'](4)), val['$[]'](5)]; return result; }, TMP_249.$$arity = 3); Opal.defn(self, '$_reduce_380', TMP_250 = function $$_reduce_380(val, _values, result) { var self = this; result = [val['$[]'](0), val['$[]'](1)]; return result; }, TMP_250.$$arity = 3); Opal.defn(self, '$_reduce_381', TMP_251 = function $$_reduce_381(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](0)); restarg = self.$new_restarg(val['$[]'](2)); result = [$rb_plus(optarg, restarg), val['$[]'](3)]; return result; }, TMP_251.$$arity = 3); Opal.defn(self, '$_reduce_382', TMP_252 = function $$_reduce_382(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](0)); restarg = self.$new_restarg(val['$[]'](2)); result = [$rb_plus($rb_plus(optarg, restarg), val['$[]'](4)), val['$[]'](5)]; return result; }, TMP_252.$$arity = 3); Opal.defn(self, '$_reduce_383', TMP_253 = function $$_reduce_383(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](0)); result = [optarg, val['$[]'](1)]; return result; }, TMP_253.$$arity = 3); Opal.defn(self, '$_reduce_384', TMP_254 = function $$_reduce_384(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](0)); result = [$rb_plus(optarg, val['$[]'](2)), val['$[]'](3)]; return result; }, TMP_254.$$arity = 3); Opal.defn(self, '$_reduce_385', TMP_255 = function $$_reduce_385(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](0)); result = [restarg, val['$[]'](1)]; return result; }, TMP_255.$$arity = 3); Opal.defn(self, '$_reduce_386', TMP_256 = function $$_reduce_386(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](0)); result = [$rb_plus(restarg, val['$[]'](2)), val['$[]'](3)]; return result; }, TMP_256.$$arity = 3); Opal.defn(self, '$_reduce_387', TMP_257 = function $$_reduce_387(val, _values, result) { var self = this; result = [nil, val['$[]'](0)]; return result; }, TMP_257.$$arity = 3); Opal.defn(self, '$_reduce_388', TMP_258 = function $$_reduce_388(val, _values, result) { var self = this; self.$push_scope("block"); result = self.$lexer().$line(); return result; }, TMP_258.$$arity = 3); Opal.defn(self, '$_reduce_389', TMP_259 = function $$_reduce_389(val, _values, result) { var self = this; result = self.$new_iter(val['$[]'](2), val['$[]'](3)); self.$pop_scope(); return result; }, TMP_259.$$arity = 3); Opal.defn(self, '$_reduce_390', TMP_260 = function $$_reduce_390(val, _values, result) { var self = this; val['$[]'](0)['$<<'](val['$[]'](1)); result = val['$[]'](0); return result; }, TMP_260.$$arity = 3); Opal.defn(self, '$_reduce_394', TMP_261 = function $$_reduce_394(val, _values, result) { var self = this; result = self.$new_call(nil, val['$[]'](0), val['$[]'](1)); return result; }, TMP_261.$$arity = 3); Opal.defn(self, '$_reduce_395', TMP_262 = function $$_reduce_395(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_262.$$arity = 3); Opal.defn(self, '$_reduce_396', TMP_263 = function $$_reduce_396(val, _values, result) { var self = this; result = self.$new_js_call(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_263.$$arity = 3); Opal.defn(self, '$_reduce_397', TMP_264 = function $$_reduce_397(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), ["call", []], val['$[]'](2)); return result; }, TMP_264.$$arity = 3); Opal.defn(self, '$_reduce_398', TMP_265 = function $$_reduce_398(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_265.$$arity = 3); Opal.defn(self, '$_reduce_399', TMP_266 = function $$_reduce_399(val, _values, result) { var self = this; result = self.$new_call(val['$[]'](0), val['$[]'](2)); return result; }, TMP_266.$$arity = 3); Opal.defn(self, '$_reduce_400', TMP_267 = function $$_reduce_400(val, _values, result) { var self = this; result = self.$new_super(val['$[]'](0), val['$[]'](1)); return result; }, TMP_267.$$arity = 3); Opal.defn(self, '$_reduce_401', TMP_268 = function $$_reduce_401(val, _values, result) { var self = this; result = self.$new_super(val['$[]'](0), nil); return result; }, TMP_268.$$arity = 3); Opal.defn(self, '$_reduce_402', TMP_269 = function $$_reduce_402(val, _values, result) { var self = this; self.$push_scope("block"); result = self.$lexer().$line(); return result; }, TMP_269.$$arity = 3); Opal.defn(self, '$_reduce_403', TMP_270 = function $$_reduce_403(val, _values, result) { var self = this; result = self.$new_iter(val['$[]'](2), val['$[]'](3)); self.$pop_scope(); return result; }, TMP_270.$$arity = 3); Opal.defn(self, '$_reduce_404', TMP_271 = function $$_reduce_404(val, _values, result) { var self = this; self.$push_scope("block"); result = self.$lexer().$line(); return result; }, TMP_271.$$arity = 3); Opal.defn(self, '$_reduce_405', TMP_272 = function $$_reduce_405(val, _values, result) { var self = this; result = self.$new_iter(val['$[]'](2), val['$[]'](3)); self.$pop_scope(); return result; }, TMP_272.$$arity = 3); Opal.defn(self, '$_reduce_406', TMP_273 = function $$_reduce_406(val, _values, result) { var self = this; result = self.$lexer().$line(); return result; }, TMP_273.$$arity = 3); Opal.defn(self, '$_reduce_407', TMP_274 = function $$_reduce_407(val, _values, result) { var $a, $b, self = this, part = nil; part = self.$s("when", ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(val['$[]'](2)))), val['$[]'](4)); result = [part]; if ((($b = val['$[]'](5)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { ($b = result).$push.apply($b, Opal.to_a(val['$[]'](5)))}; return result; }, TMP_274.$$arity = 3); Opal.defn(self, '$_reduce_408', TMP_275 = function $$_reduce_408(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_275.$$arity = 3); Opal.defn(self, '$_reduce_410', TMP_276 = function $$_reduce_410(val, _values, result) { var $a, self = this, exc = nil; exc = ((($a = val['$[]'](1)) !== false && $a !== nil && $a != null) ? $a : self.$s("array")); if ((($a = val['$[]'](2)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { exc['$<<'](self.$new_assign(val['$[]'](2), val['$[]'](2), self.$s("gvar", "$!".$intern())))}; result = [self.$s("resbody", exc, val['$[]'](4))]; if ((($a = val['$[]'](5)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result.$concat(val['$[]'](5))}; return result; }, TMP_276.$$arity = 3); Opal.defn(self, '$_reduce_411', TMP_277 = function $$_reduce_411(val, _values, result) { var self = this; result = nil; return result; }, TMP_277.$$arity = 3); Opal.defn(self, '$_reduce_412', TMP_278 = function $$_reduce_412(val, _values, result) { var self = this; result = self.$s("array", val['$[]'](0)); return result; }, TMP_278.$$arity = 3); Opal.defn(self, '$_reduce_415', TMP_279 = function $$_reduce_415(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_279.$$arity = 3); Opal.defn(self, '$_reduce_416', TMP_280 = function $$_reduce_416(val, _values, result) { var self = this; result = nil; return result; }, TMP_280.$$arity = 3); Opal.defn(self, '$_reduce_417', TMP_281 = function $$_reduce_417(val, _values, result) { var $a, self = this; result = (function() {if ((($a = val['$[]'](1)['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$s("nil") } else { return val['$[]'](1) }; return nil; })(); return result; }, TMP_281.$$arity = 3); Opal.defn(self, '$_reduce_422', TMP_282 = function $$_reduce_422(val, _values, result) { var self = this; result = self.$new_str(val['$[]'](0)); return result; }, TMP_282.$$arity = 3); Opal.defn(self, '$_reduce_424', TMP_283 = function $$_reduce_424(val, _values, result) { var self = this; result = self.$str_append(val['$[]'](0), val['$[]'](1)); return result; }, TMP_283.$$arity = 3); Opal.defn(self, '$_reduce_425', TMP_284 = function $$_reduce_425(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_284.$$arity = 3); Opal.defn(self, '$_reduce_426', TMP_285 = function $$_reduce_426(val, _values, result) { var self = this; result = self.$s("str", self.$value(val['$[]'](0))); return result; }, TMP_285.$$arity = 3); Opal.defn(self, '$_reduce_427', TMP_286 = function $$_reduce_427(val, _values, result) { var self = this; result = self.$new_xstr(val['$[]'](0), val['$[]'](1), val['$[]'](2)); return result; }, TMP_286.$$arity = 3); Opal.defn(self, '$_reduce_428', TMP_287 = function $$_reduce_428(val, _values, result) { var self = this; result = self.$new_regexp(val['$[]'](1), val['$[]'](2)); return result; }, TMP_287.$$arity = 3); Opal.defn(self, '$_reduce_429', TMP_288 = function $$_reduce_429(val, _values, result) { var self = this; result = self.$s("array"); return result; }, TMP_288.$$arity = 3); Opal.defn(self, '$_reduce_430', TMP_289 = function $$_reduce_430(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_289.$$arity = 3); Opal.defn(self, '$_reduce_431', TMP_290 = function $$_reduce_431(val, _values, result) { var self = this; result = self.$s("array"); return result; }, TMP_290.$$arity = 3); Opal.defn(self, '$_reduce_432', TMP_291 = function $$_reduce_432(val, _values, result) { var self = this, part = nil; part = val['$[]'](1); if (part.$type()['$==']("evstr")) { part = self.$s("dstr", "", val['$[]'](1))}; result = val['$[]'](0)['$<<'](part); return result; }, TMP_291.$$arity = 3); Opal.defn(self, '$_reduce_433', TMP_292 = function $$_reduce_433(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_292.$$arity = 3); Opal.defn(self, '$_reduce_434', TMP_293 = function $$_reduce_434(val, _values, result) { var self = this; result = val['$[]'](0).$concat([val['$[]'](1)]); return result; }, TMP_293.$$arity = 3); Opal.defn(self, '$_reduce_435', TMP_294 = function $$_reduce_435(val, _values, result) { var self = this; result = self.$s("array"); return result; }, TMP_294.$$arity = 3); Opal.defn(self, '$_reduce_436', TMP_295 = function $$_reduce_436(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_295.$$arity = 3); Opal.defn(self, '$_reduce_437', TMP_296 = function $$_reduce_437(val, _values, result) { var self = this; result = self.$s("array"); return result; }, TMP_296.$$arity = 3); Opal.defn(self, '$_reduce_438', TMP_297 = function $$_reduce_438(val, _values, result) { var self = this; result = val['$[]'](0)['$<<'](self.$s("str", self.$value(val['$[]'](1)))); return result; }, TMP_297.$$arity = 3); Opal.defn(self, '$_reduce_439', TMP_298 = function $$_reduce_439(val, _values, result) { var self = this; result = nil; return result; }, TMP_298.$$arity = 3); Opal.defn(self, '$_reduce_440', TMP_299 = function $$_reduce_440(val, _values, result) { var self = this; result = self.$str_append(val['$[]'](0), val['$[]'](1)); return result; }, TMP_299.$$arity = 3); Opal.defn(self, '$_reduce_441', TMP_300 = function $$_reduce_441(val, _values, result) { var self = this; result = nil; return result; }, TMP_300.$$arity = 3); Opal.defn(self, '$_reduce_442', TMP_301 = function $$_reduce_442(val, _values, result) { var self = this; result = self.$str_append(val['$[]'](0), val['$[]'](1)); return result; }, TMP_301.$$arity = 3); Opal.defn(self, '$_reduce_443', TMP_302 = function $$_reduce_443(val, _values, result) { var self = this; result = self.$new_str_content(val['$[]'](0)); return result; }, TMP_302.$$arity = 3); Opal.defn(self, '$_reduce_444', TMP_303 = function $$_reduce_444(val, _values, result) { var $a, $b, self = this; result = self.$lexer().$strterm(); (($a = [nil]), $b = self.$lexer(), $b['$strterm='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_303.$$arity = 3); Opal.defn(self, '$_reduce_445', TMP_304 = function $$_reduce_445(val, _values, result) { var $a, $b, self = this; (($a = [val['$[]'](1)]), $b = self.$lexer(), $b['$strterm='].apply($b, $a), $a[$a.length-1]); result = self.$new_evstr(val['$[]'](2)); return result; }, TMP_304.$$arity = 3); Opal.defn(self, '$_reduce_446', TMP_305 = function $$_reduce_446(val, _values, result) { var $a, $b, self = this; self.$lexer().$cond_push(0); self.$lexer().$cmdarg_push(0); result = self.$lexer().$strterm(); (($a = [nil]), $b = self.$lexer(), $b['$strterm='].apply($b, $a), $a[$a.length-1]); (($a = ["expr_beg"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_305.$$arity = 3); Opal.defn(self, '$_reduce_447', TMP_306 = function $$_reduce_447(val, _values, result) { var $a, $b, self = this; (($a = [val['$[]'](1)]), $b = self.$lexer(), $b['$strterm='].apply($b, $a), $a[$a.length-1]); self.$lexer().$cond_lexpop(); self.$lexer().$cmdarg_lexpop(); result = self.$new_evstr(val['$[]'](2)); return result; }, TMP_306.$$arity = 3); Opal.defn(self, '$_reduce_448', TMP_307 = function $$_reduce_448(val, _values, result) { var self = this; result = self.$new_gvar(val['$[]'](0)); return result; }, TMP_307.$$arity = 3); Opal.defn(self, '$_reduce_449', TMP_308 = function $$_reduce_449(val, _values, result) { var self = this; result = self.$new_ivar(val['$[]'](0)); return result; }, TMP_308.$$arity = 3); Opal.defn(self, '$_reduce_450', TMP_309 = function $$_reduce_450(val, _values, result) { var self = this; result = self.$new_cvar(val['$[]'](0)); return result; }, TMP_309.$$arity = 3); Opal.defn(self, '$_reduce_452', TMP_310 = function $$_reduce_452(val, _values, result) { var $a, $b, self = this; result = self.$new_sym(val['$[]'](1)); (($a = ["expr_end"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_310.$$arity = 3); Opal.defn(self, '$_reduce_453', TMP_311 = function $$_reduce_453(val, _values, result) { var self = this; result = self.$new_sym(val['$[]'](0)); return result; }, TMP_311.$$arity = 3); Opal.defn(self, '$_reduce_458', TMP_312 = function $$_reduce_458(val, _values, result) { var self = this; result = self.$new_dsym(val['$[]'](1)); return result; }, TMP_312.$$arity = 3); Opal.defn(self, '$_reduce_459', TMP_313 = function $$_reduce_459(val, _values, result) { var self = this; result = self.$new_int(val['$[]'](0)); return result; }, TMP_313.$$arity = 3); Opal.defn(self, '$_reduce_460', TMP_314 = function $$_reduce_460(val, _values, result) { var self = this; result = self.$new_float(val['$[]'](0)); return result; }, TMP_314.$$arity = 3); Opal.defn(self, '$_reduce_461', TMP_315 = function $$_reduce_461(val, _values, result) { var self = this; result = self.$negate_num(self.$new_int(val['$[]'](1))); return result; }, TMP_315.$$arity = 3); Opal.defn(self, '$_reduce_462', TMP_316 = function $$_reduce_462(val, _values, result) { var self = this; result = self.$negate_num(self.$new_float(val['$[]'](1))); return result; }, TMP_316.$$arity = 3); Opal.defn(self, '$_reduce_463', TMP_317 = function $$_reduce_463(val, _values, result) { var self = this; result = self.$new_int(val['$[]'](1)); return result; }, TMP_317.$$arity = 3); Opal.defn(self, '$_reduce_464', TMP_318 = function $$_reduce_464(val, _values, result) { var self = this; result = self.$new_float(val['$[]'](1)); return result; }, TMP_318.$$arity = 3); Opal.defn(self, '$_reduce_465', TMP_319 = function $$_reduce_465(val, _values, result) { var self = this; result = self.$new_ident(val['$[]'](0)); return result; }, TMP_319.$$arity = 3); Opal.defn(self, '$_reduce_466', TMP_320 = function $$_reduce_466(val, _values, result) { var self = this; result = self.$new_ivar(val['$[]'](0)); return result; }, TMP_320.$$arity = 3); Opal.defn(self, '$_reduce_467', TMP_321 = function $$_reduce_467(val, _values, result) { var self = this; result = self.$new_gvar(val['$[]'](0)); return result; }, TMP_321.$$arity = 3); Opal.defn(self, '$_reduce_468', TMP_322 = function $$_reduce_468(val, _values, result) { var self = this; result = self.$new_const(val['$[]'](0)); return result; }, TMP_322.$$arity = 3); Opal.defn(self, '$_reduce_469', TMP_323 = function $$_reduce_469(val, _values, result) { var self = this; result = self.$new_cvar(val['$[]'](0)); return result; }, TMP_323.$$arity = 3); Opal.defn(self, '$_reduce_470', TMP_324 = function $$_reduce_470(val, _values, result) { var self = this; result = self.$new_nil(val['$[]'](0)); return result; }, TMP_324.$$arity = 3); Opal.defn(self, '$_reduce_471', TMP_325 = function $$_reduce_471(val, _values, result) { var self = this; result = self.$new_self(val['$[]'](0)); return result; }, TMP_325.$$arity = 3); Opal.defn(self, '$_reduce_472', TMP_326 = function $$_reduce_472(val, _values, result) { var self = this; result = self.$new_true(val['$[]'](0)); return result; }, TMP_326.$$arity = 3); Opal.defn(self, '$_reduce_473', TMP_327 = function $$_reduce_473(val, _values, result) { var self = this; result = self.$new_false(val['$[]'](0)); return result; }, TMP_327.$$arity = 3); Opal.defn(self, '$_reduce_474', TMP_328 = function $$_reduce_474(val, _values, result) { var self = this; result = self.$new___FILE__(val['$[]'](0)); return result; }, TMP_328.$$arity = 3); Opal.defn(self, '$_reduce_475', TMP_329 = function $$_reduce_475(val, _values, result) { var self = this; result = self.$new___LINE__(val['$[]'](0)); return result; }, TMP_329.$$arity = 3); Opal.defn(self, '$_reduce_476', TMP_330 = function $$_reduce_476(val, _values, result) { var self = this; result = self.$new_var_ref(val['$[]'](0)); return result; }, TMP_330.$$arity = 3); Opal.defn(self, '$_reduce_477', TMP_331 = function $$_reduce_477(val, _values, result) { var self = this; result = self.$new_assignable(val['$[]'](0)); return result; }, TMP_331.$$arity = 3); Opal.defn(self, '$_reduce_478', TMP_332 = function $$_reduce_478(val, _values, result) { var self = this; result = self.$s("nth_ref", self.$value(val['$[]'](0))); return result; }, TMP_332.$$arity = 3); Opal.defn(self, '$_reduce_480', TMP_333 = function $$_reduce_480(val, _values, result) { var self = this; result = nil; return result; }, TMP_333.$$arity = 3); Opal.defn(self, '$_reduce_481', TMP_334 = function $$_reduce_481(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_334.$$arity = 3); Opal.defn(self, '$_reduce_482', TMP_335 = function $$_reduce_482(val, _values, result) { var self = this; result = nil; return result; }, TMP_335.$$arity = 3); Opal.defn(self, '$_reduce_483', TMP_336 = function $$_reduce_483(val, _values, result) { var $a, $b, self = this; result = val['$[]'](1); (($a = ["expr_beg"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_336.$$arity = 3); Opal.defn(self, '$_reduce_484', TMP_337 = function $$_reduce_484(val, _values, result) { var $a, $b, self = this; result = val['$[]'](0); (($a = ["expr_beg"]), $b = self.$lexer(), $b['$lex_state='].apply($b, $a), $a[$a.length-1]); return result; }, TMP_337.$$arity = 3); Opal.defn(self, '$_reduce_487', TMP_338 = function $$_reduce_487(val, _values, result) { var self = this; result = self.$new_kwrestarg(val['$[]'](1)); return result; }, TMP_338.$$arity = 3); Opal.defn(self, '$_reduce_488', TMP_339 = function $$_reduce_488(val, _values, result) { var self = this; result = self.$new_kwrestarg(); return result; }, TMP_339.$$arity = 3); Opal.defn(self, '$_reduce_489', TMP_340 = function $$_reduce_489(val, _values, result) { var self = this; result = self.$new_sym(val['$[]'](0)); return result; }, TMP_340.$$arity = 3); Opal.defn(self, '$_reduce_490', TMP_341 = function $$_reduce_490(val, _values, result) { var self = this; result = self.$new_kwoptarg(val['$[]'](0), val['$[]'](1)); return result; }, TMP_341.$$arity = 3); Opal.defn(self, '$_reduce_491', TMP_342 = function $$_reduce_491(val, _values, result) { var self = this; result = self.$new_kwarg(val['$[]'](0)); return result; }, TMP_342.$$arity = 3); Opal.defn(self, '$_reduce_492', TMP_343 = function $$_reduce_492(val, _values, result) { var self = this; result = self.$new_kwoptarg(val['$[]'](0), val['$[]'](1)); return result; }, TMP_343.$$arity = 3); Opal.defn(self, '$_reduce_493', TMP_344 = function $$_reduce_493(val, _values, result) { var self = this; result = self.$new_kwarg(val['$[]'](0)); return result; }, TMP_344.$$arity = 3); Opal.defn(self, '$_reduce_494', TMP_345 = function $$_reduce_494(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_345.$$arity = 3); Opal.defn(self, '$_reduce_495', TMP_346 = function $$_reduce_495(val, _values, result) { var self = this; result = val['$[]'](0); result['$<<'](val['$[]'](2)); return result; }, TMP_346.$$arity = 3); Opal.defn(self, '$_reduce_496', TMP_347 = function $$_reduce_496(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_347.$$arity = 3); Opal.defn(self, '$_reduce_497', TMP_348 = function $$_reduce_497(val, _values, result) { var self = this; result = val['$[]'](0); result['$<<'](val['$[]'](2)); return result; }, TMP_348.$$arity = 3); Opal.defn(self, '$_reduce_498', TMP_349 = function $$_reduce_498(val, _values, result) { var self = this; result = self.$new_args_tail(val['$[]'](0), val['$[]'](2), val['$[]'](3)); return result; }, TMP_349.$$arity = 3); Opal.defn(self, '$_reduce_499', TMP_350 = function $$_reduce_499(val, _values, result) { var self = this; result = self.$new_args_tail(val['$[]'](0), nil, val['$[]'](1)); return result; }, TMP_350.$$arity = 3); Opal.defn(self, '$_reduce_500', TMP_351 = function $$_reduce_500(val, _values, result) { var self = this; result = self.$new_args_tail(nil, val['$[]'](0), val['$[]'](1)); return result; }, TMP_351.$$arity = 3); Opal.defn(self, '$_reduce_501', TMP_352 = function $$_reduce_501(val, _values, result) { var self = this; result = self.$new_args_tail(nil, nil, val['$[]'](0)); return result; }, TMP_352.$$arity = 3); Opal.defn(self, '$_reduce_502', TMP_353 = function $$_reduce_502(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_353.$$arity = 3); Opal.defn(self, '$_reduce_503', TMP_354 = function $$_reduce_503(val, _values, result) { var self = this; result = self.$new_args_tail(nil, nil, nil); return result; }, TMP_354.$$arity = 3); Opal.defn(self, '$_reduce_504', TMP_355 = function $$_reduce_504(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](2)); restarg = self.$new_restarg(val['$[]'](4)); result = self.$new_args($rb_plus($rb_plus(val['$[]'](0), optarg), restarg), val['$[]'](5)); return result; }, TMP_355.$$arity = 3); Opal.defn(self, '$_reduce_505', TMP_356 = function $$_reduce_505(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](2)); restarg = self.$new_restarg(val['$[]'](4)); result = self.$new_args($rb_plus($rb_plus($rb_plus(val['$[]'](0), optarg), restarg), val['$[]'](6)), val['$[]'](7)); return result; }, TMP_356.$$arity = 3); Opal.defn(self, '$_reduce_506', TMP_357 = function $$_reduce_506(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](2)); result = self.$new_args($rb_plus(val['$[]'](0), optarg), val['$[]'](3)); return result; }, TMP_357.$$arity = 3); Opal.defn(self, '$_reduce_507', TMP_358 = function $$_reduce_507(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](2)); result = self.$new_args($rb_plus($rb_plus(val['$[]'](0), optarg), val['$[]'](4)), val['$[]'](5)); return result; }, TMP_358.$$arity = 3); Opal.defn(self, '$_reduce_508', TMP_359 = function $$_reduce_508(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](2)); result = self.$new_args($rb_plus(val['$[]'](0), restarg), val['$[]'](3)); return result; }, TMP_359.$$arity = 3); Opal.defn(self, '$_reduce_509', TMP_360 = function $$_reduce_509(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](2)); result = self.$new_args($rb_plus($rb_plus(val['$[]'](0), restarg), val['$[]'](4)), val['$[]'](5)); return result; }, TMP_360.$$arity = 3); Opal.defn(self, '$_reduce_510', TMP_361 = function $$_reduce_510(val, _values, result) { var self = this; result = self.$new_args(val['$[]'](0), val['$[]'](1)); return result; }, TMP_361.$$arity = 3); Opal.defn(self, '$_reduce_511', TMP_362 = function $$_reduce_511(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](0)); restarg = self.$new_restarg(val['$[]'](2)); result = self.$new_args($rb_plus(optarg, restarg), val['$[]'](3)); return result; }, TMP_362.$$arity = 3); Opal.defn(self, '$_reduce_512', TMP_363 = function $$_reduce_512(val, _values, result) { var self = this, optarg = nil, restarg = nil; optarg = self.$new_optarg(val['$[]'](0)); restarg = self.$new_restarg(val['$[]'](2)); result = self.$new_args($rb_plus($rb_plus(optarg, restarg), val['$[]'](4)), val['$[]'](5)); return result; }, TMP_363.$$arity = 3); Opal.defn(self, '$_reduce_513', TMP_364 = function $$_reduce_513(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](0)); result = self.$new_args(optarg, val['$[]'](1)); return result; }, TMP_364.$$arity = 3); Opal.defn(self, '$_reduce_514', TMP_365 = function $$_reduce_514(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_optarg(val['$[]'](0)); result = self.$new_args($rb_plus(optarg, val['$[]'](2)), val['$[]'](3)); return result; }, TMP_365.$$arity = 3); Opal.defn(self, '$_reduce_515', TMP_366 = function $$_reduce_515(val, _values, result) { var self = this, optarg = nil; optarg = self.$new_restarg(val['$[]'](0)); result = self.$new_args(optarg, val['$[]'](1)); return result; }, TMP_366.$$arity = 3); Opal.defn(self, '$_reduce_516', TMP_367 = function $$_reduce_516(val, _values, result) { var self = this, restarg = nil; restarg = self.$new_restarg(val['$[]'](0)); result = self.$new_args($rb_plus(restarg, val['$[]'](2)), val['$[]'](3)); return result; }, TMP_367.$$arity = 3); Opal.defn(self, '$_reduce_517', TMP_368 = function $$_reduce_517(val, _values, result) { var self = this; result = self.$new_args(nil, val['$[]'](0)); return result; }, TMP_368.$$arity = 3); Opal.defn(self, '$_reduce_518', TMP_369 = function $$_reduce_518(val, _values, result) { var self = this; result = self.$new_args(nil, nil); return result; }, TMP_369.$$arity = 3); Opal.defn(self, '$_reduce_520', TMP_370 = function $$_reduce_520(val, _values, result) { var self = this; result = self.$value(val['$[]'](0)).$to_sym(); self.$scope().$add_local(result); return result; }, TMP_370.$$arity = 3); Opal.defn(self, '$_reduce_521', TMP_371 = function $$_reduce_521(val, _values, result) { var self = this; self.$raise("formal argument cannot be a constant"); return result; }, TMP_371.$$arity = 3); Opal.defn(self, '$_reduce_522', TMP_372 = function $$_reduce_522(val, _values, result) { var self = this; self.$raise("formal argument cannot be an instance variable"); return result; }, TMP_372.$$arity = 3); Opal.defn(self, '$_reduce_523', TMP_373 = function $$_reduce_523(val, _values, result) { var self = this; self.$raise("formal argument cannot be a class variable"); return result; }, TMP_373.$$arity = 3); Opal.defn(self, '$_reduce_524', TMP_374 = function $$_reduce_524(val, _values, result) { var self = this; self.$raise("formal argument cannot be a global variable"); return result; }, TMP_374.$$arity = 3); Opal.defn(self, '$_reduce_525', TMP_375 = function $$_reduce_525(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_375.$$arity = 3); Opal.defn(self, '$_reduce_526', TMP_376 = function $$_reduce_526(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_376.$$arity = 3); Opal.defn(self, '$_reduce_529', TMP_377 = function $$_reduce_529(val, _values, result) { var self = this; result = self.$s("arg", val['$[]'](0)); return result; }, TMP_377.$$arity = 3); Opal.defn(self, '$_reduce_530', TMP_378 = function $$_reduce_530(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_378.$$arity = 3); Opal.defn(self, '$_reduce_531', TMP_379 = function $$_reduce_531(val, _values, result) { var self = this; result = self.$s("mlhs", val['$[]'](0)); return result; }, TMP_379.$$arity = 3); Opal.defn(self, '$_reduce_532', TMP_380 = function $$_reduce_532(val, _values, result) { var self = this; val['$[]'](0)['$<<'](val['$[]'](2)); result = val['$[]'](0); return result; }, TMP_380.$$arity = 3); Opal.defn(self, '$_reduce_534', TMP_381 = function $$_reduce_534(val, _values, result) { var self = this; result = val['$[]'](0).$push(self.$s("restarg", val['$[]'](3))); return result; }, TMP_381.$$arity = 3); Opal.defn(self, '$_reduce_535', TMP_382 = function $$_reduce_535(val, _values, result) { var self = this; result = val['$[]'](0).$push(self.$s("restarg", val['$[]'](3))).$concat(val['$[]'](5)['$[]']($range(1, -1, false))); return result; }, TMP_382.$$arity = 3); Opal.defn(self, '$_reduce_536', TMP_383 = function $$_reduce_536(val, _values, result) { var self = this; result = val['$[]'](0).$push(self.$s("restarg")); return result; }, TMP_383.$$arity = 3); Opal.defn(self, '$_reduce_537', TMP_384 = function $$_reduce_537(val, _values, result) { var self = this; result = val['$[]'](0).$push(self.$s("restarg")).$concat(val['$[]'](4)['$[]']($range(1, -1, false))); return result; }, TMP_384.$$arity = 3); Opal.defn(self, '$_reduce_538', TMP_385 = function $$_reduce_538(val, _values, result) { var self = this; result = self.$s("mlhs", self.$s("restarg", val['$[]'](1))); return result; }, TMP_385.$$arity = 3); Opal.defn(self, '$_reduce_539', TMP_386 = function $$_reduce_539(val, _values, result) { var self = this; val['$[]'](3).$insert(1, self.$s("restarg", val['$[]'](1))); result = val['$[]'](3); return result; }, TMP_386.$$arity = 3); Opal.defn(self, '$_reduce_540', TMP_387 = function $$_reduce_540(val, _values, result) { var self = this; result = self.$s("mlhs", self.$s("restarg")); return result; }, TMP_387.$$arity = 3); Opal.defn(self, '$_reduce_541', TMP_388 = function $$_reduce_541(val, _values, result) { var self = this; val['$[]'](2).$insert(1, self.$s("restarg")); result = val['$[]'](2); return result; }, TMP_388.$$arity = 3); Opal.defn(self, '$_reduce_542', TMP_389 = function $$_reduce_542(val, _values, result) { var self = this; result = [val['$[]'](0)]; return result; }, TMP_389.$$arity = 3); Opal.defn(self, '$_reduce_543', TMP_390 = function $$_reduce_543(val, _values, result) { var self = this; val['$[]'](0)['$<<'](val['$[]'](2)); result = val['$[]'](0); return result; }, TMP_390.$$arity = 3); Opal.defn(self, '$_reduce_544', TMP_391 = function $$_reduce_544(val, _values, result) { var self = this; result = self.$new_assign(self.$new_assignable(self.$new_ident(val['$[]'](0))), val['$[]'](1), val['$[]'](2)); return result; }, TMP_391.$$arity = 3); Opal.defn(self, '$_reduce_545', TMP_392 = function $$_reduce_545(val, _values, result) { var self = this; result = self.$s("block", val['$[]'](0)); return result; }, TMP_392.$$arity = 3); Opal.defn(self, '$_reduce_546', TMP_393 = function $$_reduce_546(val, _values, result) { var self = this; result = val['$[]'](0); val['$[]'](0)['$<<'](val['$[]'](2)); return result; }, TMP_393.$$arity = 3); Opal.defn(self, '$_reduce_549', TMP_394 = function $$_reduce_549(val, _values, result) { var self = this; result = (("*") + (self.$value(val['$[]'](1)))).$to_sym(); return result; }, TMP_394.$$arity = 3); Opal.defn(self, '$_reduce_550', TMP_395 = function $$_reduce_550(val, _values, result) { var self = this; result = "*"; return result; }, TMP_395.$$arity = 3); Opal.defn(self, '$_reduce_553', TMP_396 = function $$_reduce_553(val, _values, result) { var self = this; result = (("&") + (self.$value(val['$[]'](1)))).$to_sym(); return result; }, TMP_396.$$arity = 3); Opal.defn(self, '$_reduce_554', TMP_397 = function $$_reduce_554(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_397.$$arity = 3); Opal.defn(self, '$_reduce_555', TMP_398 = function $$_reduce_555(val, _values, result) { var self = this; result = nil; return result; }, TMP_398.$$arity = 3); Opal.defn(self, '$_reduce_556', TMP_399 = function $$_reduce_556(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_399.$$arity = 3); Opal.defn(self, '$_reduce_557', TMP_400 = function $$_reduce_557(val, _values, result) { var self = this; result = val['$[]'](1); return result; }, TMP_400.$$arity = 3); Opal.defn(self, '$_reduce_558', TMP_401 = function $$_reduce_558(val, _values, result) { var self = this; result = []; return result; }, TMP_401.$$arity = 3); Opal.defn(self, '$_reduce_559', TMP_402 = function $$_reduce_559(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_402.$$arity = 3); Opal.defn(self, '$_reduce_560', TMP_403 = function $$_reduce_560(val, _values, result) { var self = this; result = val['$[]'](0); return result; }, TMP_403.$$arity = 3); Opal.defn(self, '$_reduce_561', TMP_404 = function $$_reduce_561(val, _values, result) { var self = this; result = val['$[]'](0).$concat(val['$[]'](2)); return result; }, TMP_404.$$arity = 3); Opal.defn(self, '$_reduce_562', TMP_405 = function $$_reduce_562(val, _values, result) { var self = this; result = [val['$[]'](0), val['$[]'](2)]; return result; }, TMP_405.$$arity = 3); Opal.defn(self, '$_reduce_563', TMP_406 = function $$_reduce_563(val, _values, result) { var self = this; result = [self.$new_sym(val['$[]'](0)), val['$[]'](1)]; return result; }, TMP_406.$$arity = 3); Opal.defn(self, '$_reduce_564', TMP_407 = function $$_reduce_564(val, _values, result) { var self = this; result = [self.$s("sym", self.$source(val['$[]'](1)).$to_sym()), val['$[]'](3)]; return result; }, TMP_407.$$arity = 3); Opal.defn(self, '$_reduce_565', TMP_408 = function $$_reduce_565(val, _values, result) { var self = this; result = [self.$new_kwsplat(val['$[]'](1))]; return result; }, TMP_408.$$arity = 3); Opal.defn(self, '$_reduce_589', TMP_409 = function $$_reduce_589(val, _values, result) { var self = this; result = nil; return result; }, TMP_409.$$arity = 3); return (Opal.defn(self, '$_reduce_none', TMP_410 = function $$_reduce_none(val, _values, result) { var self = this; return val['$[]'](0); }, TMP_410.$$arity = 3), nil) && '_reduce_none'; })($scope.base, (($scope.get('Racc')).$$scope.get('Parser'))) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/parser/parser_scope"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$attr_accessor', '$==', '$<<', '$include?', '$has_local?']); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ParserScope(){}; var self = $ParserScope = $klass($base, $super, 'ParserScope', $ParserScope); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def.locals = def.parent = def.block = nil; self.$attr_reader("locals"); self.$attr_accessor("parent"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(type) { var self = this; self.block = type['$==']("block"); self.locals = []; return self.parent = nil; }, TMP_1.$$arity = 1); Opal.defn(self, '$add_local', TMP_2 = function $$add_local(local) { var self = this; return self.locals['$<<'](local); }, TMP_2.$$arity = 1); return (Opal.defn(self, '$has_local?', TMP_3 = function(local) { var $a, $b, self = this; if ((($a = self.locals['$include?'](local)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = ($b = self.parent, $b !== false && $b !== nil && $b != null ?self.block : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.parent['$has_local?'](local)}; return false; }, TMP_3.$$arity = 1), nil) && 'has_local?'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/parser"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$attr_reader', '$!', '$[]', '$new', '$parser=', '$parse_to_sexp', '$join', '$message', '$line', '$lexer', '$column', '$split', '$-', '$+', '$*', '$>', '$raise', '$class', '$backtrace', '$push_scope', '$do_parse', '$pop_scope', '$next_token', '$last', '$parent=', '$<<', '$pop', '$inspect', '$value', '$token_to_str', '$s', '$source=', '$s0', '$source', '$s1', '$file', '$to_sym', '$nil?', '$==', '$length', '$size', '$type', '$each', '$!=', '$empty?', '$add_local', '$scope', '$map', '$is_a?', '$to_s', '$children', '$===', '$new_splat', '$[]=', '$meta', '$concat', '$new_call', '$array', '$-@', '$new_gettable', '$type=', '$has_local?']); self.$require("opal/parser/sexp"); self.$require("opal/parser/lexer"); self.$require("opal/parser/grammar"); self.$require("opal/parser/parser_scope"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Parser(){}; var self = $Parser = $klass($base, $super, 'Parser', $Parser); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_52, TMP_53, TMP_56, TMP_57, TMP_58, TMP_59, TMP_60, TMP_61, TMP_62, TMP_65, TMP_66, TMP_67, TMP_68, TMP_69, TMP_70, TMP_71, TMP_72, TMP_73, TMP_74, TMP_75, TMP_76, TMP_77, TMP_78, TMP_79, TMP_80, TMP_81, TMP_82, TMP_83, TMP_84, TMP_85, TMP_86, TMP_87, TMP_88, TMP_89, TMP_90, TMP_91, TMP_92, TMP_93, TMP_94, TMP_95; def.lexer = def.file = def.scopes = nil; self.$attr_reader("lexer", "file", "scope"); Opal.defn(self, '$parse', TMP_1 = function $$parse(source, file) { var $a, $b, self = this, error = nil, message = nil; if (file == null) { file = "(string)"; } try { if ((($a = $scope.get('ENV')['$[]']("RACC_DEBUG")['$!']()['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.yydebug = true}; self.file = file; self.scopes = []; self.lexer = $scope.get('Lexer').$new(source, file); (($a = [self]), $b = self.lexer, $b['$parser='].apply($b, $a), $a[$a.length-1]); return self.$parse_to_sexp(); } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) {error = $err; try { message = [nil, error.$message(), "Source: " + (self.file) + ":" + (self.$lexer().$line()) + ":" + (self.$lexer().$column()), source.$split("\n")['$[]']($rb_minus(self.$lexer().$line(), 1)), $rb_plus($rb_times("~", ((function() {if ((($a = $rb_gt($rb_minus(self.$lexer().$column(), 1), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $rb_minus(self.$lexer().$column(), 1) } else { return 0 }; return nil; })())), "^")].$join("\n"); return self.$raise(error.$class(), message, error.$backtrace()); } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_1.$$arity = -2); Opal.defn(self, '$parse_to_sexp', TMP_2 = function $$parse_to_sexp() { var self = this, result = nil; self.$push_scope(); result = self.$do_parse(); self.$pop_scope(); return result; }, TMP_2.$$arity = 0); Opal.defn(self, '$next_token', TMP_3 = function $$next_token() { var self = this; return self.lexer.$next_token(); }, TMP_3.$$arity = 0); Opal.defn(self, '$s', TMP_4 = function $$s($a_rest) { var self = this, parts; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } parts = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { parts[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('Sexp').$new(parts); }, TMP_4.$$arity = -1); Opal.defn(self, '$push_scope', TMP_5 = function $$push_scope(type) { var $a, $b, self = this, top = nil, scope = nil; if (type == null) { type = nil; } top = self.scopes.$last(); scope = $scope.get('ParserScope').$new(type); (($a = [top]), $b = scope, $b['$parent='].apply($b, $a), $a[$a.length-1]); self.scopes['$<<'](scope); return self.scope = scope; }, TMP_5.$$arity = -1); Opal.defn(self, '$pop_scope', TMP_6 = function $$pop_scope() { var self = this; self.scopes.$pop(); return self.scope = self.scopes.$last(); }, TMP_6.$$arity = 0); Opal.defn(self, '$on_error', TMP_7 = function $$on_error(t, val, vstack) { var $a, self = this; return self.$raise("parse error on value " + (self.$value(val).$inspect()) + " (" + (((($a = self.$token_to_str(t)) !== false && $a !== nil && $a != null) ? $a : "?")) + ") :" + (self.file) + ":" + (self.$lexer().$line())); }, TMP_7.$$arity = 3); Opal.defn(self, '$value', TMP_8 = function $$value(tok) { var self = this; return tok['$[]'](0); }, TMP_8.$$arity = 1); Opal.defn(self, '$source', TMP_9 = function $$source(tok) { var self = this; if (tok !== false && tok !== nil && tok != null) { return tok['$[]'](1) } else { return nil }; }, TMP_9.$$arity = 1); Opal.defn(self, '$s0', TMP_10 = function $$s0(type, source) { var $a, $b, self = this, sexp = nil; sexp = self.$s(type); (($a = [source]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_10.$$arity = 2); Opal.defn(self, '$s1', TMP_11 = function $$s1(type, first, source) { var $a, $b, self = this, sexp = nil; sexp = self.$s(type, first); (($a = [source]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_11.$$arity = 3); Opal.defn(self, '$new_nil', TMP_12 = function $$new_nil(tok) { var self = this; return self.$s0("nil", self.$source(tok)); }, TMP_12.$$arity = 1); Opal.defn(self, '$new_self', TMP_13 = function $$new_self(tok) { var self = this; return self.$s0("self", self.$source(tok)); }, TMP_13.$$arity = 1); Opal.defn(self, '$new_true', TMP_14 = function $$new_true(tok) { var self = this; return self.$s0("true", self.$source(tok)); }, TMP_14.$$arity = 1); Opal.defn(self, '$new_false', TMP_15 = function $$new_false(tok) { var self = this; return self.$s0("false", self.$source(tok)); }, TMP_15.$$arity = 1); Opal.defn(self, '$new___FILE__', TMP_16 = function $$new___FILE__(tok) { var self = this; return self.$s1("str", self.$file(), self.$source(tok)); }, TMP_16.$$arity = 1); Opal.defn(self, '$new___LINE__', TMP_17 = function $$new___LINE__(tok) { var self = this; return self.$s1("int", self.$lexer().$line(), self.$source(tok)); }, TMP_17.$$arity = 1); Opal.defn(self, '$new_ident', TMP_18 = function $$new_ident(tok) { var self = this; return self.$s1("identifier", self.$value(tok).$to_sym(), self.$source(tok)); }, TMP_18.$$arity = 1); Opal.defn(self, '$new_int', TMP_19 = function $$new_int(tok) { var self = this; return self.$s1("int", self.$value(tok), self.$source(tok)); }, TMP_19.$$arity = 1); Opal.defn(self, '$new_float', TMP_20 = function $$new_float(tok) { var self = this; return self.$s1("float", self.$value(tok), self.$source(tok)); }, TMP_20.$$arity = 1); Opal.defn(self, '$new_ivar', TMP_21 = function $$new_ivar(tok) { var self = this; return self.$s1("ivar", self.$value(tok).$to_sym(), self.$source(tok)); }, TMP_21.$$arity = 1); Opal.defn(self, '$new_gvar', TMP_22 = function $$new_gvar(tok) { var self = this; return self.$s1("gvar", self.$value(tok).$to_sym(), self.$source(tok)); }, TMP_22.$$arity = 1); Opal.defn(self, '$new_cvar', TMP_23 = function $$new_cvar(tok) { var self = this; return self.$s1("cvar", self.$value(tok).$to_sym(), self.$source(tok)); }, TMP_23.$$arity = 1); Opal.defn(self, '$new_const', TMP_24 = function $$new_const(tok) { var self = this; return self.$s1("const", self.$value(tok).$to_sym(), self.$source(tok)); }, TMP_24.$$arity = 1); Opal.defn(self, '$new_colon2', TMP_25 = function $$new_colon2(lhs, tok, name) { var $a, $b, self = this, sexp = nil; sexp = self.$s("colon2", lhs, self.$value(name).$to_sym()); (($a = [self.$source(tok)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_25.$$arity = 3); Opal.defn(self, '$new_colon3', TMP_26 = function $$new_colon3(tok, name) { var self = this; return self.$s1("colon3", self.$value(name).$to_sym(), self.$source(name)); }, TMP_26.$$arity = 2); Opal.defn(self, '$new_sym', TMP_27 = function $$new_sym(tok) { var self = this; return self.$s1("sym", self.$value(tok).$to_sym(), self.$source(tok)); }, TMP_27.$$arity = 1); Opal.defn(self, '$new_alias', TMP_28 = function $$new_alias(kw, new$, old) { var $a, $b, self = this, sexp = nil; sexp = self.$s("alias", new$, old); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_28.$$arity = 3); Opal.defn(self, '$new_break', TMP_29 = function $$new_break(kw, args) { var $a, self = this, sexp = nil; if (args == null) { args = nil; } if ((($a = args['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sexp = self.$s("break") } else if (args.$length()['$=='](1)) { sexp = self.$s("break", args['$[]'](0)) } else { sexp = self.$s("break", ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(args)))) }; return sexp; }, TMP_29.$$arity = -2); Opal.defn(self, '$new_return', TMP_30 = function $$new_return(kw, args) { var $a, self = this, sexp = nil; if (args == null) { args = nil; } if ((($a = args['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sexp = self.$s("return") } else if (args.$length()['$=='](1)) { sexp = self.$s("return", args['$[]'](0)) } else { sexp = self.$s("return", ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(args)))) }; return sexp; }, TMP_30.$$arity = -2); Opal.defn(self, '$new_next', TMP_31 = function $$new_next(kw, args) { var $a, self = this, sexp = nil; if (args == null) { args = []; } if (args.$length()['$=='](1)) { sexp = self.$s("next", args['$[]'](0)) } else { sexp = self.$s("next", ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(args)))) }; return sexp; }, TMP_31.$$arity = -2); Opal.defn(self, '$new_block', TMP_32 = function $$new_block(stmt) { var self = this, sexp = nil; if (stmt == null) { stmt = nil; } sexp = self.$s("block"); if (stmt !== false && stmt !== nil && stmt != null) { sexp['$<<'](stmt)}; return sexp; }, TMP_32.$$arity = -1); Opal.defn(self, '$new_compstmt', TMP_33 = function $$new_compstmt(block) { var $a, $b, $c, self = this, comp = nil, result = nil; comp = (function() {if (block.$size()['$=='](1)) { return nil } else if (block.$size()['$=='](2)) { return block['$[]'](1) } else { return block }; return nil; })(); if ((($a = ($b = (($c = comp !== false && comp !== nil && comp != null) ? comp.$type()['$==']("begin") : comp), $b !== false && $b !== nil && $b != null ?comp.$size()['$=='](2) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = comp['$[]'](1) } else { result = comp }; return result; }, TMP_33.$$arity = 1); Opal.defn(self, '$new_body', TMP_35 = function $$new_body(compstmt, res, els, ens) { var $a, $b, TMP_34, self = this, s = nil; s = ((($a = compstmt) !== false && $a !== nil && $a != null) ? $a : self.$s("block")); if (res !== false && res !== nil && res != null) { s = self.$s("rescue", s); ($a = ($b = res).$each, $a.$$p = (TMP_34 = function(r){var self = TMP_34.$$s || this; if (r == null) r = nil; return s['$<<'](r)}, TMP_34.$$s = self, TMP_34.$$arity = 1, TMP_34), $a).call($b); if (els !== false && els !== nil && els != null) { s['$<<'](els)};}; if (ens !== false && ens !== nil && ens != null) { return self.$s("ensure", s, ens) } else { return s }; }, TMP_35.$$arity = 4); Opal.defn(self, '$new_def', TMP_36 = function $$new_def(kw, recv, name, args, body, end_tok) { var $a, $b, self = this, sexp = nil; if ((($a = body.$type()['$!=']("block")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { body = self.$s("block", body)}; if (body.$size()['$=='](1)) { body['$<<'](self.$s("nil"))}; sexp = self.$s("def", recv, self.$value(name).$to_sym(), args, body); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_36.$$arity = 6); Opal.defn(self, '$new_class', TMP_37 = function $$new_class(start, path, sup, body, endt) { var $a, $b, self = this, sexp = nil; sexp = self.$s("class", path, sup, body); (($a = [self.$source(start)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_37.$$arity = 5); Opal.defn(self, '$new_sclass', TMP_38 = function $$new_sclass(kw, expr, body, end_tok) { var $a, $b, self = this, sexp = nil; sexp = self.$s("sclass", expr, body); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_38.$$arity = 4); Opal.defn(self, '$new_module', TMP_39 = function $$new_module(kw, path, body, end_tok) { var $a, $b, self = this, sexp = nil; sexp = self.$s("module", path, body); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_39.$$arity = 4); Opal.defn(self, '$new_iter', TMP_40 = function $$new_iter(args, body) { var $a, self = this, s = nil; ((($a = args) !== false && $a !== nil && $a != null) ? $a : args = nil); s = self.$s("iter", args); if (body !== false && body !== nil && body != null) { s['$<<'](body)}; return s; }, TMP_40.$$arity = 2); Opal.defn(self, '$new_if', TMP_41 = function $$new_if(if_tok, expr, stmt, tail) { var $a, $b, self = this, sexp = nil; sexp = self.$s("if", expr, stmt, tail); (($a = [self.$source(if_tok)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_41.$$arity = 4); Opal.defn(self, '$new_while', TMP_42 = function $$new_while(kw, test, body) { var $a, $b, self = this, sexp = nil; sexp = self.$s("while", test, body); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_42.$$arity = 3); Opal.defn(self, '$new_until', TMP_43 = function $$new_until(kw, test, body) { var $a, $b, self = this, sexp = nil; sexp = self.$s("until", test, body); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_43.$$arity = 3); Opal.defn(self, '$new_rescue_mod', TMP_44 = function $$new_rescue_mod(kw, expr, resc) { var $a, $b, self = this, sexp = nil; sexp = self.$s("rescue_mod", expr, resc); (($a = [self.$source(kw)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_44.$$arity = 3); Opal.defn(self, '$new_array', TMP_45 = function $$new_array(start, args, finish) { var $a, $b, $c, self = this, sexp = nil; ((($a = args) !== false && $a !== nil && $a != null) ? $a : args = []); sexp = ($a = self).$s.apply($a, ["array"].concat(Opal.to_a(args))); (($b = [self.$source(start)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); return sexp; }, TMP_45.$$arity = 3); Opal.defn(self, '$new_hash', TMP_46 = function $$new_hash(open, assocs, close) { var $a, $b, $c, self = this, sexp = nil; sexp = ($a = self).$s.apply($a, ["hash"].concat(Opal.to_a(assocs))); (($b = [self.$source(open)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); return sexp; }, TMP_46.$$arity = 3); Opal.defn(self, '$new_not', TMP_47 = function $$new_not(kw, expr) { var self = this; return self.$s1("not", expr, self.$source(kw)); }, TMP_47.$$arity = 2); Opal.defn(self, '$new_paren', TMP_48 = function $$new_paren(open, expr, close) { var $a, $b, self = this; if ((($a = ((($b = expr['$nil?']()) !== false && $b !== nil && $b != null) ? $b : expr['$=='](["block"]))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$s1("paren", self.$s0("nil", self.$source(open)), self.$source(open)) } else { return self.$s1("paren", expr, self.$source(open)) }; }, TMP_48.$$arity = 3); Opal.defn(self, '$new_args_tail', TMP_49 = function $$new_args_tail(kwarg, kwrest, block) { var self = this; return [kwarg, kwrest, block]; }, TMP_49.$$arity = 3); Opal.defn(self, '$new_restarg', TMP_50 = function $$new_restarg(rest) { var $a, self = this, restname = nil; restname = rest['$[]']($range(1, -1, false)); if ((($a = restname['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [self.$s("restarg")] } else { self.$scope().$add_local(restname.$to_sym()); return [self.$s("restarg", restname.$to_sym())]; }; }, TMP_50.$$arity = 1); Opal.defn(self, '$new_optarg', TMP_52 = function $$new_optarg(opt) { var $a, $b, TMP_51, self = this; if (opt !== false && opt !== nil && opt != null) { return ($a = ($b = opt['$[]']($range(1, -1, false))).$map, $a.$$p = (TMP_51 = function(_opt){var self = TMP_51.$$s || this; if (_opt == null) _opt = nil; return self.$s("optarg", _opt['$[]'](1), _opt['$[]'](2))}, TMP_51.$$s = self, TMP_51.$$arity = 1, TMP_51), $a).call($b) } else { return nil }; }, TMP_52.$$arity = 1); Opal.defn(self, '$new_shadowarg', TMP_53 = function $$new_shadowarg(shadowarg) { var self = this, shadowname = nil; if (shadowarg !== false && shadowarg !== nil && shadowarg != null) { shadowname = self.$value(shadowarg).$to_sym(); self.$scope().$add_local(shadowname); return self.$s("shadowarg", shadowname); } else { return nil }; }, TMP_53.$$arity = 1); Opal.defn(self, '$new_args', TMP_56 = function $$new_args(norm, tail) { var $a, $b, TMP_54, $c, TMP_55, $d, self = this, res = nil, blockname = nil; res = self.$s("args"); if (norm !== false && norm !== nil && norm != null) { ($a = ($b = norm).$each, $a.$$p = (TMP_54 = function(arg){var self = TMP_54.$$s || this, $c; if (arg == null) arg = nil; if ((($c = arg['$is_a?']($scope.get('Sexp'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return res['$<<'](arg) } else { self.$scope().$add_local(arg); return res['$<<'](self.$s("arg", arg)); }}, TMP_54.$$s = self, TMP_54.$$arity = 1, TMP_54), $a).call($b)}; if ((($a = (($c = tail !== false && tail !== nil && tail != null) ? tail['$[]'](0) : tail)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($c = tail['$[]'](0)).$each, $a.$$p = (TMP_55 = function(kwarg){var self = TMP_55.$$s || this; if (kwarg == null) kwarg = nil; return res['$<<'](kwarg)}, TMP_55.$$s = self, TMP_55.$$arity = 1, TMP_55), $a).call($c)}; if ((($a = (($d = tail !== false && tail !== nil && tail != null) ? tail['$[]'](1) : tail)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { res['$<<'](tail['$[]'](1))}; if ((($a = (($d = tail !== false && tail !== nil && tail != null) ? tail['$[]'](2) : tail)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { blockname = tail['$[]'](2).$to_s()['$[]']($range(1, -1, false)).$to_sym(); self.$scope().$add_local(blockname); res['$<<'](self.$s("blockarg", blockname));}; return res; }, TMP_56.$$arity = 2); Opal.defn(self, '$new_kwarg', TMP_57 = function $$new_kwarg(name) { var self = this; self.$scope().$add_local(name['$[]'](1)); return self.$s("kwarg", name['$[]'](1)); }, TMP_57.$$arity = 1); Opal.defn(self, '$new_kwoptarg', TMP_58 = function $$new_kwoptarg(name, val) { var self = this; self.$scope().$add_local(name['$[]'](1)); return self.$s("kwoptarg", name['$[]'](1), val); }, TMP_58.$$arity = 2); Opal.defn(self, '$new_kwrestarg', TMP_59 = function $$new_kwrestarg(name) { var self = this, result = nil; if (name == null) { name = nil; } result = self.$s("kwrestarg"); if (name !== false && name !== nil && name != null) { self.$scope().$add_local(name['$[]'](0).$to_sym()); result['$<<'](name['$[]'](0).$to_sym());}; return result; }, TMP_59.$$arity = -1); Opal.defn(self, '$new_kwsplat', TMP_60 = function $$new_kwsplat(hash) { var self = this; return self.$s("kwsplat", hash); }, TMP_60.$$arity = 1); Opal.defn(self, '$new_method_call_with_block', TMP_61 = function $$new_method_call_with_block(method_call, block_arg) { var $a, $b, self = this, receiver = nil, method_name = nil, call_args = nil, last_arg = nil; $a = Opal.to_a(method_call.$children()), receiver = ($a[0] == null ? nil : $a[0]), method_name = ($a[1] == null ? nil : $a[1]), call_args = ($a[2] == null ? nil : $a[2]), $a; if ((($a = (($b = call_args !== false && call_args !== nil && call_args != null) ? block_arg : call_args)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { last_arg = call_args.$last(); if ((($a = ($b = $scope.get('Sexp')['$==='](last_arg), $b !== false && $b !== nil && $b != null ?last_arg.$type()['$==']("block_pass") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise("both block argument and literal block are passed")};}; return method_call['$<<'](block_arg); }, TMP_61.$$arity = 2); Opal.defn(self, '$new_block_arg_splat', TMP_62 = function $$new_block_arg_splat(rest) { var self = this, r = nil; if (rest !== false && rest !== nil && rest != null) { r = rest.$to_s()['$[]']($range(1, -1, false)).$to_sym(); self.$scope().$add_local(r); return self.$new_splat(nil, self.$s("lasgn", r)); } else { return nil }; }, TMP_62.$$arity = 1); Opal.defn(self, '$new_block_args', TMP_65 = function $$new_block_args(norm, tail, shadow_args) { var $a, $b, TMP_63, $c, TMP_64, $d, self = this, res = nil, block = nil; if (shadow_args == null) { shadow_args = nil; } res = self.$s("args"); if (norm !== false && norm !== nil && norm != null) { ($a = ($b = norm).$each, $a.$$p = (TMP_63 = function(arg){var self = TMP_63.$$s || this, $c; if (arg == null) arg = nil; if ((($c = arg['$is_a?']($scope.get('Symbol'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$scope().$add_local(arg); return res['$<<'](self.$s("arg", arg)); } else if ((($c = arg['$is_a?']($scope.get('Sexp'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return res['$<<'](arg) } else if ((($c = arg['$nil?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return res.$meta()['$[]=']("has_trailing_comma", true) } else { return nil }}, TMP_63.$$s = self, TMP_63.$$arity = 1, TMP_63), $a).call($b)}; if ((($a = (($c = tail !== false && tail !== nil && tail != null) ? tail['$[]'](0) : tail)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($c = tail['$[]'](0)).$each, $a.$$p = (TMP_64 = function(kwarg){var self = TMP_64.$$s || this; if (kwarg == null) kwarg = nil; return res['$<<'](kwarg)}, TMP_64.$$s = self, TMP_64.$$arity = 1, TMP_64), $a).call($c)}; if ((($a = (($d = tail !== false && tail !== nil && tail != null) ? tail['$[]'](1) : tail)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { res['$<<'](tail['$[]'](1))}; if ((($a = (($d = tail !== false && tail !== nil && tail != null) ? tail['$[]'](2) : tail)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block = tail['$[]'](2).$to_s()['$[]']($range(1, -1, false)).$to_sym(); res['$<<'](self.$s("block_pass", self.$s("lasgn", block))); self.$scope().$add_local(block);}; if (shadow_args !== false && shadow_args !== nil && shadow_args != null) { res.$concat(shadow_args)}; return self.$s("masgn", res); }, TMP_65.$$arity = -3); Opal.defn(self, '$new_call', TMP_66 = function $$new_call(recv, meth, args) { var $a, $b, $c, self = this, sexp = nil; if (args == null) { args = nil; } ((($a = args) !== false && $a !== nil && $a != null) ? $a : args = []); sexp = self.$s("call", recv, self.$value(meth).$to_sym(), ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args)))); (($b = [self.$source(meth)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); return sexp; }, TMP_66.$$arity = -3); Opal.defn(self, '$new_js_call', TMP_67 = function $$new_js_call(recv, meth, args) { var $a, $b, $c, self = this, sexp = nil; if (args == null) { args = nil; } if (args !== false && args !== nil && args != null) { sexp = self.$s("jscall", recv, self.$value(meth).$to_sym(), ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args)))); (($b = [self.$source(meth)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); } else { sexp = self.$s("jscall", recv, self.$value(meth).$to_sym(), nil); (($b = [self.$source(meth)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); }; return sexp; }, TMP_67.$$arity = -3); Opal.defn(self, '$new_binary_call', TMP_68 = function $$new_binary_call(recv, meth, arg) { var self = this; return self.$new_call(recv, meth, [arg]); }, TMP_68.$$arity = 3); Opal.defn(self, '$new_unary_call', TMP_69 = function $$new_unary_call(op, recv) { var self = this; return self.$new_call(recv, op, []); }, TMP_69.$$arity = 2); Opal.defn(self, '$new_and', TMP_70 = function $$new_and(lhs, tok, rhs) { var $a, $b, self = this, sexp = nil; sexp = self.$s("and", lhs, rhs); (($a = [self.$source(tok)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_70.$$arity = 3); Opal.defn(self, '$new_or', TMP_71 = function $$new_or(lhs, tok, rhs) { var $a, $b, self = this, sexp = nil; sexp = self.$s("or", lhs, rhs); (($a = [self.$source(tok)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_71.$$arity = 3); Opal.defn(self, '$new_irange', TMP_72 = function $$new_irange(beg, op, finish) { var $a, $b, self = this, sexp = nil; sexp = self.$s("irange", beg, finish); (($a = [self.$source(op)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_72.$$arity = 3); Opal.defn(self, '$new_erange', TMP_73 = function $$new_erange(beg, op, finish) { var $a, $b, self = this, sexp = nil; sexp = self.$s("erange", beg, finish); (($a = [self.$source(op)]), $b = sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return sexp; }, TMP_73.$$arity = 3); Opal.defn(self, '$negate_num', TMP_74 = function $$negate_num(sexp) { var self = this; sexp.$array()['$[]='](1, sexp.$array()['$[]'](1)['$-@']()); return sexp; }, TMP_74.$$arity = 1); Opal.defn(self, '$add_block_pass', TMP_75 = function $$add_block_pass(arglist, block) { var self = this; if (block !== false && block !== nil && block != null) { arglist['$<<'](block)}; return arglist; }, TMP_75.$$arity = 2); Opal.defn(self, '$new_block_pass', TMP_76 = function $$new_block_pass(amper_tok, val) { var self = this; return self.$s1("block_pass", val, self.$source(amper_tok)); }, TMP_76.$$arity = 2); Opal.defn(self, '$new_splat', TMP_77 = function $$new_splat(tok, value) { var self = this; return self.$s1("splat", value, self.$source(tok)); }, TMP_77.$$arity = 2); Opal.defn(self, '$new_op_asgn', TMP_78 = function $$new_op_asgn(op, lhs, rhs) { var self = this, $case = nil, result = nil; $case = self.$value(op).$to_sym();if ("||"['$===']($case)) {result = self.$s("op_asgn_or", self.$new_gettable(lhs)); result['$<<']((lhs['$<<'](rhs)));}else if ("&&"['$===']($case)) {result = self.$s("op_asgn_and", self.$new_gettable(lhs)); result['$<<']((lhs['$<<'](rhs)));}else {result = lhs; result['$<<'](self.$new_call(self.$new_gettable(lhs), op, [rhs]));}; return result; }, TMP_78.$$arity = 3); Opal.defn(self, '$new_op_asgn1', TMP_79 = function $$new_op_asgn1(lhs, args, op, rhs) { var $a, $b, $c, self = this, arglist = nil, sexp = nil; arglist = ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args))); sexp = self.$s("op_asgn1", lhs, arglist, self.$value(op), rhs); (($b = [self.$source(op)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); return sexp; }, TMP_79.$$arity = 4); Opal.defn(self, '$op_to_setter', TMP_80 = function $$op_to_setter(op) { var self = this; return ((("") + (self.$value(op))) + "=").$to_sym(); }, TMP_80.$$arity = 1); Opal.defn(self, '$new_attrasgn', TMP_81 = function $$new_attrasgn(recv, op, args) { var $a, self = this, arglist = nil, sexp = nil; if (args == null) { args = []; } arglist = ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args))); sexp = self.$s("attrasgn", recv, op, arglist); return sexp; }, TMP_81.$$arity = -3); Opal.defn(self, '$new_js_attrasgn', TMP_82 = function $$new_js_attrasgn(recv, args) { var $a, self = this, arglist = nil, sexp = nil; arglist = ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args))); sexp = self.$s("jsattrasgn", recv, nil, arglist); return sexp; }, TMP_82.$$arity = 2); Opal.defn(self, '$new_assign', TMP_83 = function $$new_assign(lhs, tok, rhs) { var $a, $b, self = this, $case = nil; return (function() {$case = lhs.$type();if ("iasgn"['$===']($case) || "cdecl"['$===']($case) || "lasgn"['$===']($case) || "gasgn"['$===']($case) || "cvdecl"['$===']($case) || "nth_ref"['$===']($case)) {lhs['$<<'](rhs); return lhs;}else if ("call"['$===']($case) || "attrasgn"['$===']($case) || "jsattrasgn"['$===']($case)) {lhs.$last()['$<<'](rhs); return lhs;}else if ("colon2"['$===']($case)) {lhs['$<<'](rhs); (($a = ["casgn"]), $b = lhs, $b['$type='].apply($b, $a), $a[$a.length-1]); return lhs;}else if ("colon3"['$===']($case)) {lhs['$<<'](rhs); (($a = ["casgn3"]), $b = lhs, $b['$type='].apply($b, $a), $a[$a.length-1]); return lhs;}else {return self.$raise("Bad lhs for new_assign: " + (lhs.$type()))}})(); }, TMP_83.$$arity = 3); Opal.defn(self, '$new_assignable', TMP_84 = function $$new_assignable(ref) { var $a, $b, self = this, $case = nil; $case = ref.$type();if ("ivar"['$===']($case)) {(($a = ["iasgn"]), $b = ref, $b['$type='].apply($b, $a), $a[$a.length-1])}else if ("const"['$===']($case)) {(($a = ["cdecl"]), $b = ref, $b['$type='].apply($b, $a), $a[$a.length-1])}else if ("identifier"['$===']($case)) {if ((($a = self.$scope()['$has_local?'](ref['$[]'](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$scope().$add_local(ref['$[]'](1)) }; (($a = ["lasgn"]), $b = ref, $b['$type='].apply($b, $a), $a[$a.length-1]);}else if ("gvar"['$===']($case)) {(($a = ["gasgn"]), $b = ref, $b['$type='].apply($b, $a), $a[$a.length-1])}else if ("cvar"['$===']($case)) {(($a = ["cvdecl"]), $b = ref, $b['$type='].apply($b, $a), $a[$a.length-1])}else {self.$raise($scope.get('SyntaxError'), "Bad new_assignable type: " + (ref.$type()))}; return ref; }, TMP_84.$$arity = 1); Opal.defn(self, '$new_gettable', TMP_85 = function $$new_gettable(ref) { var $a, $b, self = this, res = nil, $case = nil; res = (function() {$case = ref.$type();if ("lasgn"['$===']($case)) {return self.$s("lvar", ref['$[]'](1))}else if ("iasgn"['$===']($case)) {return self.$s("ivar", ref['$[]'](1))}else if ("gasgn"['$===']($case)) {return self.$s("gvar", ref['$[]'](1))}else if ("cvdecl"['$===']($case)) {return self.$s("cvar", ref['$[]'](1))}else if ("cdecl"['$===']($case)) {return self.$s("const", ref['$[]'](1))}else {return self.$raise("Bad new_gettable ref: " + (ref.$type()))}})(); (($a = [ref.$source()]), $b = res, $b['$source='].apply($b, $a), $a[$a.length-1]); return res; }, TMP_85.$$arity = 1); Opal.defn(self, '$new_var_ref', TMP_86 = function $$new_var_ref(ref) { var $a, $b, self = this, $case = nil, result = nil; return (function() {$case = ref.$type();if ("self"['$===']($case) || "nil"['$===']($case) || "true"['$===']($case) || "false"['$===']($case) || "line"['$===']($case) || "file"['$===']($case)) {return ref}else if ("const"['$===']($case)) {return ref}else if ("ivar"['$===']($case) || "gvar"['$===']($case) || "cvar"['$===']($case)) {return ref}else if ("int"['$===']($case)) {return ref}else if ("str"['$===']($case)) {return ref}else if ("identifier"['$===']($case)) {result = (function() {if ((($a = self.$scope()['$has_local?'](ref['$[]'](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$s("lvar", ref['$[]'](1)) } else { return self.$s("call", nil, ref['$[]'](1), self.$s("arglist")) }; return nil; })(); (($a = [ref.$source()]), $b = result, $b['$source='].apply($b, $a), $a[$a.length-1]); return result;}else {return self.$raise("Bad var_ref type: " + (ref.$type()))}})(); }, TMP_86.$$arity = 1); Opal.defn(self, '$new_super', TMP_87 = function $$new_super(kw, args) { var $a, $b, $c, self = this, sexp = nil; if ((($a = args['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sexp = self.$s("super", nil) } else { sexp = self.$s("super", ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(args)))) }; (($b = [self.$source(kw)]), $c = sexp, $c['$source='].apply($c, $b), $b[$b.length-1]); return sexp; }, TMP_87.$$arity = 2); Opal.defn(self, '$new_yield', TMP_88 = function $$new_yield(args) { var $a, self = this; ((($a = args) !== false && $a !== nil && $a != null) ? $a : args = []); return ($a = self).$s.apply($a, ["yield"].concat(Opal.to_a(args))); }, TMP_88.$$arity = 1); Opal.defn(self, '$new_xstr', TMP_89 = function $$new_xstr(start_t, str, end_t) { var $a, $b, self = this, $case = nil; if (str !== false && str !== nil && str != null) { } else { return self.$s("xstr", "") }; $case = str.$type();if ("str"['$===']($case)) {(($a = ["xstr"]), $b = str, $b['$type='].apply($b, $a), $a[$a.length-1])}else if ("dstr"['$===']($case)) {(($a = ["dxstr"]), $b = str, $b['$type='].apply($b, $a), $a[$a.length-1])}else if ("evstr"['$===']($case)) {str = self.$s("dxstr", "", str)}; (($a = [self.$source(start_t)]), $b = str, $b['$source='].apply($b, $a), $a[$a.length-1]); return str; }, TMP_89.$$arity = 3); Opal.defn(self, '$new_dsym', TMP_90 = function $$new_dsym(str) { var $a, $b, self = this, $case = nil; if (str !== false && str !== nil && str != null) { } else { return self.$s("sym", "") }; $case = str.$type();if ("str"['$===']($case)) {(($a = ["sym"]), $b = str, $b['$type='].apply($b, $a), $a[$a.length-1]); str['$[]='](1, str['$[]'](1).$to_sym());}else if ("dstr"['$===']($case)) {(($a = ["dsym"]), $b = str, $b['$type='].apply($b, $a), $a[$a.length-1])}else if ("evstr"['$===']($case)) {str = self.$s("dsym", str)}; return str; }, TMP_90.$$arity = 1); Opal.defn(self, '$new_evstr', TMP_91 = function $$new_evstr(str) { var self = this; return self.$s("evstr", str); }, TMP_91.$$arity = 1); Opal.defn(self, '$new_str', TMP_92 = function $$new_str(str) { var $a, $b, $c, self = this; if (str !== false && str !== nil && str != null) { } else { return self.$s("str", "") }; if ((($a = ($b = (($c = str.$size()['$=='](3)) ? str['$[]'](1)['$==']("") : str.$size()['$=='](3)), $b !== false && $b !== nil && $b != null ?str.$type()['$==']("str") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return str['$[]'](2) } else if ((($a = (($b = str.$type()['$==']("str")) ? $rb_gt(str.$size(), 3) : str.$type()['$==']("str"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = ["dstr"]), $b = str, $b['$type='].apply($b, $a), $a[$a.length-1]); return str; } else if (str.$type()['$==']("evstr")) { return self.$s("dstr", "", str) } else { return str }; }, TMP_92.$$arity = 1); Opal.defn(self, '$new_regexp', TMP_93 = function $$new_regexp(reg, ending) { var $a, $b, self = this, $case = nil; if (reg !== false && reg !== nil && reg != null) { } else { return self.$s("regexp", "") }; return (function() {$case = reg.$type();if ("str"['$===']($case)) {return self.$s("regexp", reg['$[]'](1), self.$value(ending))}else if ("evstr"['$===']($case)) {return self.$s("dregx", "", reg)}else if ("dstr"['$===']($case)) {(($a = ["dregx"]), $b = reg, $b['$type='].apply($b, $a), $a[$a.length-1]); return reg;}else { return nil }})(); }, TMP_93.$$arity = 2); Opal.defn(self, '$str_append', TMP_94 = function $$str_append(str, str2) { var self = this; if (str !== false && str !== nil && str != null) { } else { return str2 }; if (str2 !== false && str2 !== nil && str2 != null) { } else { return str }; if (str.$type()['$==']("evstr")) { str = self.$s("dstr", "", str) } else if (str.$type()['$==']("str")) { str = self.$s("dstr", str['$[]'](1))}; str['$<<'](str2); return str; }, TMP_94.$$arity = 2); return (Opal.defn(self, '$new_str_content', TMP_95 = function $$new_str_content(tok) { var self = this; return self.$s1("str", self.$value(tok), self.$source(tok)); }, TMP_95.$$arity = 1), nil) && 'new_str_content'; })($scope.base, (($scope.get('Racc')).$$scope.get('Parser'))) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/fragment"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$to_s', '$inspect', '$def?', '$find_parent_def', '$mid', '$line', '$column']); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Fragment(){}; var self = $Fragment = $klass($base, $super, 'Fragment', $Fragment); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; def.code = def.scope = def.sexp = nil; self.$attr_reader("code"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(code, scope, sexp) { var self = this; if (sexp == null) { sexp = nil; } self.code = code.$to_s(); self.sexp = sexp; return self.scope = scope; }, TMP_1.$$arity = -3); Opal.defn(self, '$inspect', TMP_2 = function $$inspect() { var self = this; return "f(" + (self.code.$inspect()) + ")"; }, TMP_2.$$arity = 0); Opal.defn(self, '$source_map_name', TMP_3 = function $$source_map_name() { var $a, self = this, def_node = nil; if ((($a = self.scope) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; def_node = (function() {if ((($a = self.scope['$def?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.scope } else { return self.scope.$find_parent_def() }; return nil; })(); return (($a = def_node !== false && def_node !== nil && def_node != null) ? def_node.$mid() : def_node); }, TMP_3.$$arity = 0); Opal.defn(self, '$line', TMP_4 = function $$line() { var $a, self = this; if ((($a = self.sexp) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.sexp.$line() } else { return nil }; }, TMP_4.$$arity = 0); return (Opal.defn(self, '$column', TMP_5 = function $$column() { var $a, self = this; if ((($a = self.sexp) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.sexp.$column() } else { return nil }; }, TMP_5.$$arity = 0), nil) && 'column'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/helpers"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$require', '$valid_name?', '$inspect', '$=~', '$!', '$to_s', '$valid_ivar_name?', '$to_sym', '$+', '$indent', '$to_proc', '$compiler', '$parser_indent', '$push', '$current_indent', '$js_truthy_optimize', '$with_temp', '$fragment', '$expr', '$==', '$type', '$[]', '$uses_block!', '$scope', '$block_name', '$handlers', '$include?', '$truthy_optimize?', '$dup']); self.$require("opal/regexp_anchors"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Helpers, self = $Helpers = $module($base, 'Helpers'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_13, TMP_15, TMP_16; Opal.cdecl($scope, 'ES51_RESERVED_WORD', (new RegExp("" + $scope.get('REGEXP_START') + "(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)" + $scope.get('REGEXP_END')))); Opal.cdecl($scope, 'ES3_RESERVED_WORD_EXCLUSIVE', (new RegExp("" + $scope.get('REGEXP_START') + "(?:int|byte|char|goto|long|final|float|short|double|native|throws|boolean|abstract|volatile|transient|synchronized)" + $scope.get('REGEXP_END')))); Opal.cdecl($scope, 'PROTO_SPECIAL_PROPS', (new RegExp("" + $scope.get('REGEXP_START') + "(?:constructor|displayName|__proto__|__parent__|__noSuchMethod__|__count__)" + $scope.get('REGEXP_END')))); Opal.cdecl($scope, 'PROTO_SPECIAL_METHODS', (new RegExp("" + $scope.get('REGEXP_START') + "(?:hasOwnProperty|valueOf)" + $scope.get('REGEXP_END')))); Opal.cdecl($scope, 'IMMUTABLE_PROPS', (new RegExp("" + $scope.get('REGEXP_START') + "(?:NaN|Infinity|undefined)" + $scope.get('REGEXP_END')))); Opal.cdecl($scope, 'BASIC_IDENTIFIER_RULES', (new RegExp("" + $scope.get('REGEXP_START') + "[$_a-z][$_a-z\\d]*" + $scope.get('REGEXP_END')))); Opal.cdecl($scope, 'RESERVED_FUNCTION_NAMES', (new RegExp("" + $scope.get('REGEXP_START') + "(?:Array)" + $scope.get('REGEXP_END')))); Opal.defn(self, '$property', TMP_1 = function $$property(name) { var $a, self = this; if ((($a = self['$valid_name?'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "." + (name) } else { return "[" + (name.$inspect()) + "]" }; }, TMP_1.$$arity = 1); Opal.defn(self, '$valid_name?', TMP_2 = function(name) { var $a, $b, $c, self = this; return ($a = $scope.get('BASIC_IDENTIFIER_RULES')['$=~'](name), $a !== false && $a !== nil && $a != null ?(((($b = ((($c = $scope.get('ES51_RESERVED_WORD')['$=~'](name)) !== false && $c !== nil && $c != null) ? $c : $scope.get('ES3_RESERVED_WORD_EXCLUSIVE')['$=~'](name))) !== false && $b !== nil && $b != null) ? $b : $scope.get('IMMUTABLE_PROPS')['$=~'](name)))['$!']() : $a); }, TMP_2.$$arity = 1); Opal.defn(self, '$variable', TMP_3 = function $$variable(name) { var $a, self = this; if ((($a = self['$valid_name?'](name.$to_s())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return name } else { return "" + (name) + "$" }; }, TMP_3.$$arity = 1); Opal.defn(self, '$valid_ivar_name?', TMP_4 = function(name) { var $a, self = this; return (((($a = $scope.get('PROTO_SPECIAL_PROPS')['$=~'](name)) !== false && $a !== nil && $a != null) ? $a : $scope.get('PROTO_SPECIAL_METHODS')['$=~'](name)))['$!'](); }, TMP_4.$$arity = 1); Opal.defn(self, '$ivar', TMP_5 = function $$ivar(name) { var $a, self = this; if ((($a = self['$valid_ivar_name?'](name.$to_s())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return name } else { return "" + (name) + "$" }; }, TMP_5.$$arity = 1); Opal.defn(self, '$lvar_to_js', TMP_6 = function $$lvar_to_js(var$) { var $a, self = this, var$ = nil; if ((($a = self['$valid_name?'](var$.$to_s())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { var$ = "" + (var$) + "$" }; return var$.$to_sym(); }, TMP_6.$$arity = 1); Opal.defn(self, '$mid_to_jsid', TMP_7 = function $$mid_to_jsid(mid) { var $a, self = this; if ((($a = /\=|\+|\-|\*|\/|\!|\?|<|\>|\&|\||\^|\%|\~|\[/['$=~'](mid.$to_s())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "['$" + (mid) + "']" } else { return $rb_plus(".$", mid) }; }, TMP_7.$$arity = 1); Opal.defn(self, '$indent', TMP_8 = function $$indent() { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; return ($a = ($b = self.$compiler()).$indent, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_8.$$arity = 0); Opal.defn(self, '$current_indent', TMP_9 = function $$current_indent() { var self = this; return self.$compiler().$parser_indent(); }, TMP_9.$$arity = 0); Opal.defn(self, '$line', TMP_10 = function $$line($a_rest) { var $b, self = this, strs; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } strs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { strs[$arg_idx - 0] = arguments[$arg_idx]; } self.$push("\n" + (self.$current_indent())); return ($b = self).$push.apply($b, Opal.to_a(strs)); }, TMP_10.$$arity = -1); Opal.defn(self, '$empty_line', TMP_11 = function $$empty_line() { var self = this; return self.$push("\n"); }, TMP_11.$$arity = 0); Opal.defn(self, '$js_truthy', TMP_13 = function $$js_truthy(sexp) { var $a, $b, TMP_12, self = this, optimize = nil; if ((($a = optimize = self.$js_truthy_optimize(sexp)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return optimize}; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_12 = function(tmp){var self = TMP_12.$$s || this; if (tmp == null) tmp = nil; return [self.$fragment("((" + (tmp) + " = "), self.$expr(sexp), self.$fragment(") !== nil && " + (tmp) + " != null && (!" + (tmp) + ".$$is_boolean || " + (tmp) + " == true))")]}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($b); }, TMP_13.$$arity = 1); Opal.defn(self, '$js_falsy', TMP_15 = function $$js_falsy(sexp) { var $a, $b, TMP_14, self = this, mid = nil; if (sexp.$type()['$==']("call")) { mid = sexp['$[]'](2); if (mid['$==']("block_given?")) { self.$scope()['$uses_block!'](); return "" + (self.$scope().$block_name()) + " === nil";};}; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_14 = function(tmp){var self = TMP_14.$$s || this; if (tmp == null) tmp = nil; return [self.$fragment("((" + (tmp) + " = "), self.$expr(sexp), self.$fragment(") === nil || " + (tmp) + " == null || (" + (tmp) + ".$$is_boolean && " + (tmp) + " == false))")]}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_15.$$arity = 1); Opal.defn(self, '$js_truthy_optimize', TMP_16 = function $$js_truthy_optimize(sexp) { var $a, $b, $c, self = this, mid = nil, receiver_handler_class = nil, receiver = nil, allow_optimization_on_type = nil; if (sexp.$type()['$==']("call")) { mid = sexp['$[]'](2); receiver_handler_class = ($a = (receiver = sexp['$[]'](1)), $a !== false && $a !== nil && $a != null ?self.$compiler().$handlers()['$[]'](receiver.$type()) : $a); allow_optimization_on_type = ($a = ($b = (($scope.get('Compiler')).$$scope.get('COMPARE'))['$include?'](mid.$to_s()), $b !== false && $b !== nil && $b != null ?receiver_handler_class : $b), $a !== false && $a !== nil && $a != null ?receiver_handler_class['$truthy_optimize?']() : $a); if ((($a = ((($b = ((($c = allow_optimization_on_type) !== false && $c !== nil && $c != null) ? $c : mid['$==']("block_given?"))) !== false && $b !== nil && $b != null) ? $b : mid['$==']("=="))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(sexp) } else { return nil }; } else if ((($a = ["lvar", "self"]['$include?'](sexp.$type())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [self.$expr(sexp.$dup()), self.$fragment(" !== false && "), self.$expr(sexp.$dup()), self.$fragment(" !== nil && "), self.$expr(sexp.$dup()), self.$fragment(" != null")] } else { return nil }; }, TMP_16.$$arity = 1); })($scope.base) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/base"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $range = Opal.range; Opal.add_stubs(['$require', '$include', '$each', '$[]=', '$handlers', '$each_with_index', '$define_method', '$[]', '$+', '$attr_reader', '$type', '$compile', '$raise', '$is_a?', '$fragment', '$<<', '$unshift', '$reverse', '$push', '$new', '$scope', '$error', '$s', '$==', '$process', '$expr', '$add_scope_local', '$to_sym', '$add_scope_ivar', '$add_scope_gvar', '$add_scope_temp', '$helper', '$with_temp', '$to_proc', '$in_while?', '$instance_variable_get', '$has_rescue_else?', '$in_ensure', '$in_ensure?']); self.$require("opal/nodes/helpers"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Base(){}; var self = $Base = $klass($base, $super, 'Base', $Base); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_13, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39; def.sexp = def.fragments = def.compiler = def.level = nil; self.$include($scope.get('Helpers')); Opal.defs(self, '$handlers', TMP_1 = function $$handlers() { var $a, self = this; if (self.handlers == null) self.handlers = nil; return ((($a = self.handlers) !== false && $a !== nil && $a != null) ? $a : self.handlers = $hash2([], {})); }, TMP_1.$$arity = 0); Opal.defs(self, '$handle', TMP_3 = function $$handle($a_rest) { var $b, $c, TMP_2, self = this, types; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } types = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { types[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = types).$each, $b.$$p = (TMP_2 = function(type){var self = TMP_2.$$s || this; if (type == null) type = nil; return $scope.get('Base').$handlers()['$[]='](type, self)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).call($c); }, TMP_3.$$arity = -1); Opal.defs(self, '$children', TMP_6 = function $$children($a_rest) { var $b, $c, TMP_4, self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = names).$each_with_index, $b.$$p = (TMP_4 = function(name, idx){var self = TMP_4.$$s || this, $a, $d, TMP_5; if (name == null) name = nil;if (idx == null) idx = nil; return ($a = ($d = self).$define_method, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; if (self.sexp == null) self.sexp = nil; return self.sexp['$[]']($rb_plus(idx, 1))}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $a).call($d, name)}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4), $b).call($c); }, TMP_6.$$arity = -1); Opal.defs(self, '$truthy_optimize?', TMP_7 = function() { var self = this; return false; }, TMP_7.$$arity = 0); self.$attr_reader("compiler", "type"); Opal.defn(self, '$initialize', TMP_8 = function $$initialize(sexp, level, compiler) { var self = this; self.sexp = sexp; self.type = sexp.$type(); self.level = level; return self.compiler = compiler; }, TMP_8.$$arity = 3); Opal.defn(self, '$children', TMP_9 = function $$children() { var self = this; return self.sexp['$[]']($range(1, -1, false)); }, TMP_9.$$arity = 0); Opal.defn(self, '$compile_to_fragments', TMP_10 = function $$compile_to_fragments() { var $a, $b, self = this; if ((($a = (($b = self['fragments'], $b != null && $b !== nil) ? 'instance-variable' : nil)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.fragments}; self.fragments = []; self.$compile(); return self.fragments; }, TMP_10.$$arity = 0); Opal.defn(self, '$compile', TMP_11 = function $$compile() { var self = this; return self.$raise("Not Implemented"); }, TMP_11.$$arity = 0); Opal.defn(self, '$push', TMP_13 = function $$push($a_rest) { var $b, $c, TMP_12, self = this, strs; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } strs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { strs[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = strs).$each, $b.$$p = (TMP_12 = function(str){var self = TMP_12.$$s || this, $a; if (self.fragments == null) self.fragments = nil; if (str == null) str = nil; if ((($a = str['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { str = self.$fragment(str)}; return self.fragments['$<<'](str);}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $b).call($c); }, TMP_13.$$arity = -1); Opal.defn(self, '$unshift', TMP_15 = function $$unshift($a_rest) { var $b, $c, TMP_14, self = this, strs; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } strs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { strs[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = strs.$reverse()).$each, $b.$$p = (TMP_14 = function(str){var self = TMP_14.$$s || this, $a; if (self.fragments == null) self.fragments = nil; if (str == null) str = nil; if ((($a = str['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { str = self.$fragment(str)}; return self.fragments.$unshift(str);}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $b).call($c); }, TMP_15.$$arity = -1); Opal.defn(self, '$wrap', TMP_16 = function $$wrap(pre, post) { var self = this; self.$unshift(pre); return self.$push(post); }, TMP_16.$$arity = 2); Opal.defn(self, '$fragment', TMP_17 = function $$fragment(str) { var self = this; return (($scope.get('Opal')).$$scope.get('Fragment')).$new(str, self.$scope(), self.sexp); }, TMP_17.$$arity = 1); Opal.defn(self, '$error', TMP_18 = function $$error(msg) { var self = this; return self.compiler.$error(msg); }, TMP_18.$$arity = 1); Opal.defn(self, '$scope', TMP_19 = function $$scope() { var self = this; return self.compiler.$scope(); }, TMP_19.$$arity = 0); Opal.defn(self, '$s', TMP_20 = function $$s($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self.compiler).$s.apply($b, Opal.to_a(args)); }, TMP_20.$$arity = -1); Opal.defn(self, '$expr?', TMP_21 = function() { var self = this; return self.level['$==']("expr"); }, TMP_21.$$arity = 0); Opal.defn(self, '$recv?', TMP_22 = function() { var self = this; return self.level['$==']("recv"); }, TMP_22.$$arity = 0); Opal.defn(self, '$stmt?', TMP_23 = function() { var self = this; return self.level['$==']("stmt"); }, TMP_23.$$arity = 0); Opal.defn(self, '$process', TMP_24 = function $$process(sexp, level) { var self = this; if (level == null) { level = "expr"; } return self.compiler.$process(sexp, level); }, TMP_24.$$arity = -2); Opal.defn(self, '$expr', TMP_25 = function $$expr(sexp) { var self = this; return self.compiler.$process(sexp, "expr"); }, TMP_25.$$arity = 1); Opal.defn(self, '$recv', TMP_26 = function $$recv(sexp) { var self = this; return self.compiler.$process(sexp, "recv"); }, TMP_26.$$arity = 1); Opal.defn(self, '$stmt', TMP_27 = function $$stmt(sexp) { var self = this; return self.compiler.$process(sexp, "stmt"); }, TMP_27.$$arity = 1); Opal.defn(self, '$expr_or_nil', TMP_28 = function $$expr_or_nil(sexp) { var self = this; if (sexp !== false && sexp !== nil && sexp != null) { return self.$expr(sexp) } else { return "nil" }; }, TMP_28.$$arity = 1); Opal.defn(self, '$add_local', TMP_29 = function $$add_local(name) { var self = this; return self.$scope().$add_scope_local(name.$to_sym()); }, TMP_29.$$arity = 1); Opal.defn(self, '$add_ivar', TMP_30 = function $$add_ivar(name) { var self = this; return self.$scope().$add_scope_ivar(name); }, TMP_30.$$arity = 1); Opal.defn(self, '$add_gvar', TMP_31 = function $$add_gvar(name) { var self = this; return self.$scope().$add_scope_gvar(name); }, TMP_31.$$arity = 1); Opal.defn(self, '$add_temp', TMP_32 = function $$add_temp(temp) { var self = this; return self.$scope().$add_scope_temp(temp); }, TMP_32.$$arity = 1); Opal.defn(self, '$helper', TMP_33 = function $$helper(name) { var self = this; return self.compiler.$helper(name); }, TMP_33.$$arity = 1); Opal.defn(self, '$with_temp', TMP_34 = function $$with_temp() { var $a, $b, self = this, $iter = TMP_34.$$p, block = $iter || nil; TMP_34.$$p = null; return ($a = ($b = self.compiler).$with_temp, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_34.$$arity = 0); Opal.defn(self, '$in_while?', TMP_35 = function() { var self = this; return self.compiler['$in_while?'](); }, TMP_35.$$arity = 0); Opal.defn(self, '$while_loop', TMP_36 = function $$while_loop() { var self = this; return self.compiler.$instance_variable_get("@while_loop"); }, TMP_36.$$arity = 0); Opal.defn(self, '$has_rescue_else?', TMP_37 = function() { var self = this; return self.$scope()['$has_rescue_else?'](); }, TMP_37.$$arity = 0); Opal.defn(self, '$in_ensure', TMP_38 = function $$in_ensure() { var $a, $b, self = this, $iter = TMP_38.$$p, block = $iter || nil; TMP_38.$$p = null; return ($a = ($b = self.$scope()).$in_ensure, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_38.$$arity = 0); return (Opal.defn(self, '$in_ensure?', TMP_39 = function() { var self = this; return self.$scope()['$in_ensure?'](); }, TMP_39.$$arity = 0), nil) && 'in_ensure?'; })($scope.base, null) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/literal"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$handle', '$push', '$to_s', '$type', '$children', '$value', '$recv?', '$wrap', '$join', '$keys', '$gsub', '$even?', '$length', '$+', '$chop', '$[]', '$translate_escape_chars', '$inspect', '$===', '$new', '$flags', '$each_line', '$==', '$s', '$source=', '$line', '$include', '$stmt?', '$!', '$include?', '$compile_split_lines', '$needs_semicolon?', '$each_with_index', '$expr', '$raise', '$last', '$each', '$requires_semicolon', '$helper', '$start', '$finish']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ValueNode(){}; var self = $ValueNode = $klass($base, $super, 'ValueNode', $ValueNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; self.$handle("true", "false", "self", "nil"); Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this; return self.$push(self.$type().$to_s()); }, TMP_1.$$arity = 0); return (Opal.defs(self, '$truthy_optimize?', TMP_2 = function() { var self = this; return true; }, TMP_2.$$arity = 0), nil) && 'truthy_optimize?'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $NumericNode(){}; var self = $NumericNode = $klass($base, $super, 'NumericNode', $NumericNode); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4; self.$handle("int", "float"); self.$children("value"); Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, self = this; self.$push(self.$value().$to_s()); if ((($a = self['$recv?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(", ")") } else { return nil }; }, TMP_3.$$arity = 0); return (Opal.defs(self, '$truthy_optimize?', TMP_4 = function() { var self = this; return true; }, TMP_4.$$arity = 0), nil) && 'truthy_optimize?'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $StringNode(){}; var self = $StringNode = $klass($base, $super, 'StringNode', $StringNode); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7; self.$handle("str"); self.$children("value"); Opal.cdecl($scope, 'ESCAPE_CHARS', $hash2(["a", "e"], {"a": "\\u0007", "e": "\\u001b"})); Opal.cdecl($scope, 'ESCAPE_REGEX', (new RegExp("(\\\\+)([" + $scope.get('ESCAPE_CHARS').$keys().$join("") + "])"))); Opal.defn(self, '$translate_escape_chars', TMP_6 = function $$translate_escape_chars(inspect_string) { var $a, $b, TMP_5, self = this; return ($a = ($b = inspect_string).$gsub, $a.$$p = (TMP_5 = function(original){var self = TMP_5.$$s || this, $c, $d; if (original == null) original = nil; if ((($c = (($d = $gvars['~']) === nil ? nil : $d['$[]'](1)).$length()['$even?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return original } else { return $rb_plus((($c = $gvars['~']) === nil ? nil : $c['$[]'](1)).$chop(), $scope.get('ESCAPE_CHARS')['$[]']((($c = $gvars['~']) === nil ? nil : $c['$[]'](2)))) }}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($b, $scope.get('ESCAPE_REGEX')); }, TMP_6.$$arity = 1); return (Opal.defn(self, '$compile', TMP_7 = function $$compile() { var self = this; return self.$push(self.$translate_escape_chars(self.$value().$inspect())); }, TMP_7.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $SymbolNode(){}; var self = $SymbolNode = $klass($base, $super, 'SymbolNode', $SymbolNode); var def = self.$$proto, $scope = self.$$scope, TMP_8; self.$handle("sym"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_8 = function $$compile() { var self = this; return self.$push(self.$value().$to_s().$inspect()); }, TMP_8.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $RegexpNode(){}; var self = $RegexpNode = $klass($base, $super, 'RegexpNode', $RegexpNode); var def = self.$$proto, $scope = self.$$scope, TMP_9; self.$handle("regexp"); self.$children("value", "flags"); return (Opal.defn(self, '$compile', TMP_9 = function $$compile() { var self = this, $case = nil, message = nil; return (function() {$case = self.$value();if (""['$===']($case)) {return self.$push("/(?:)/")}else if (/\?<\w+\>/['$===']($case)) {message = "named captures are not supported in javascript: " + (self.$value().$inspect()); return self.$push("self.$raise(new SyntaxError('" + (message) + "'))");}else {return self.$push("" + ($scope.get('Regexp').$new(self.$value()).$inspect()) + (self.$flags()))}})(); }, TMP_9.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base) { var $XStringLineSplitter, self = $XStringLineSplitter = $module($base, 'XStringLineSplitter'); var def = self.$$proto, $scope = self.$$scope, TMP_11; Opal.defn(self, '$compile_split_lines', TMP_11 = function $$compile_split_lines(value, sexp) { var $a, $b, TMP_10, self = this, idx = nil; idx = 0; return ($a = ($b = value).$each_line, $a.$$p = (TMP_10 = function(line){var self = TMP_10.$$s || this, $c, $d, line_sexp = nil, frag = nil; if (line == null) line = nil; if (idx['$=='](0)) { self.$push(line) } else { line_sexp = self.$s(); (($c = [[$rb_plus(sexp.$line(), idx), 0]]), $d = line_sexp, $d['$source='].apply($d, $c), $c[$c.length-1]); frag = $scope.get('Fragment').$new(line, line_sexp); self.$push(frag); }; return idx = $rb_plus(idx, 1);}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $a).call($b); }, TMP_11.$$arity = 2) })($scope.base); (function($base, $super) { function $XStringNode(){}; var self = $XStringNode = $klass($base, $super, 'XStringNode', $XStringNode); var def = self.$$proto, $scope = self.$$scope, TMP_12, TMP_13, TMP_14; def.sexp = nil; self.$include($scope.get('XStringLineSplitter')); self.$handle("xstr"); self.$children("value"); Opal.defn(self, '$needs_semicolon?', TMP_12 = function() { var $a, self = this; return ($a = self['$stmt?'](), $a !== false && $a !== nil && $a != null ?self.$value().$to_s()['$include?'](";")['$!']() : $a); }, TMP_12.$$arity = 0); Opal.defn(self, '$compile', TMP_13 = function $$compile() { var $a, self = this; self.$compile_split_lines(self.$value().$to_s(), self.sexp); if ((($a = self['$needs_semicolon?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(";")}; if ((($a = self['$recv?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(", ")") } else { return nil }; }, TMP_13.$$arity = 0); return (Opal.defn(self, '$start_line', TMP_14 = function $$start_line() { var self = this; return self.sexp.$line(); }, TMP_14.$$arity = 0), nil) && 'start_line'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $DynamicStringNode(){}; var self = $DynamicStringNode = $klass($base, $super, 'DynamicStringNode', $DynamicStringNode); var def = self.$$proto, $scope = self.$$scope, TMP_16; self.$handle("dstr"); return (Opal.defn(self, '$compile', TMP_16 = function $$compile() { var $a, $b, TMP_15, self = this; return ($a = ($b = self.$children()).$each_with_index, $a.$$p = (TMP_15 = function(part, idx){var self = TMP_15.$$s || this, $c; if (part == null) part = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(" + ") }; if ((($c = $scope.get('String')['$==='](part)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$push(part.$inspect()) } else if (part.$type()['$==']("evstr")) { self.$push("("); self.$push((function() {if ((($c = part['$[]'](1)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$expr(part['$[]'](1)) } else { return "\"\"" }; return nil; })()); self.$push(")"); } else if (part.$type()['$==']("str")) { self.$push(part['$[]'](1).$inspect()) } else if (part.$type()['$==']("dstr")) { self.$push("("); self.$push(self.$expr(part)); self.$push(")"); } else { self.$raise("Bad dstr part " + (part.$inspect())) }; if ((($c = self['$recv?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$wrap("(", ")") } else { return nil };}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $a).call($b); }, TMP_16.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $DynamicSymbolNode(){}; var self = $DynamicSymbolNode = $klass($base, $super, 'DynamicSymbolNode', $DynamicSymbolNode); var def = self.$$proto, $scope = self.$$scope, TMP_18; self.$handle("dsym"); return (Opal.defn(self, '$compile', TMP_18 = function $$compile() { var $a, $b, TMP_17, self = this; ($a = ($b = self.$children()).$each_with_index, $a.$$p = (TMP_17 = function(part, idx){var self = TMP_17.$$s || this, $c; if (part == null) part = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(" + ") }; if ((($c = $scope.get('String')['$==='](part)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$push(part.$inspect()) } else if (part.$type()['$==']("evstr")) { return self.$push(self.$expr(self.$s("call", part.$last(), "to_s", self.$s("arglist")))) } else if (part.$type()['$==']("str")) { return self.$push(part.$last().$inspect()) } else { return self.$raise("Bad dsym part") };}, TMP_17.$$s = self, TMP_17.$$arity = 2, TMP_17), $a).call($b); return self.$wrap("(", ")"); }, TMP_18.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $DynamicXStringNode(){}; var self = $DynamicXStringNode = $klass($base, $super, 'DynamicXStringNode', $DynamicXStringNode); var def = self.$$proto, $scope = self.$$scope, TMP_19, TMP_21; self.$include($scope.get('XStringLineSplitter')); self.$handle("dxstr"); Opal.defn(self, '$requires_semicolon', TMP_19 = function $$requires_semicolon(code) { var $a, self = this; return ($a = self['$stmt?'](), $a !== false && $a !== nil && $a != null ?code['$include?'](";")['$!']() : $a); }, TMP_19.$$arity = 1); return (Opal.defn(self, '$compile', TMP_21 = function $$compile() { var $a, $b, TMP_20, self = this, needs_semicolon = nil; needs_semicolon = false; ($a = ($b = self.$children()).$each, $a.$$p = (TMP_20 = function(part){var self = TMP_20.$$s || this, $c; if (self.sexp == null) self.sexp = nil; if (part == null) part = nil; if ((($c = $scope.get('String')['$==='](part)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$compile_split_lines(part.$to_s(), self.sexp); if ((($c = self.$requires_semicolon(part.$to_s())) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return needs_semicolon = true } else { return nil }; } else if (part.$type()['$==']("evstr")) { return self.$push(self.$expr(part['$[]'](1))) } else if (part.$type()['$==']("str")) { self.$compile_split_lines(part.$last().$to_s(), part); if ((($c = self.$requires_semicolon(part.$last().$to_s())) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return needs_semicolon = true } else { return nil }; } else { return self.$raise("Bad dxstr part") }}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $a).call($b); if (needs_semicolon !== false && needs_semicolon !== nil && needs_semicolon != null) { self.$push(";")}; if ((($a = self['$recv?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(", ")") } else { return nil }; }, TMP_21.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $DynamicRegexpNode(){}; var self = $DynamicRegexpNode = $klass($base, $super, 'DynamicRegexpNode', $DynamicRegexpNode); var def = self.$$proto, $scope = self.$$scope, TMP_23; self.$handle("dregx"); return (Opal.defn(self, '$compile', TMP_23 = function $$compile() { var $a, $b, TMP_22, self = this; ($a = ($b = self.$children()).$each_with_index, $a.$$p = (TMP_22 = function(part, idx){var self = TMP_22.$$s || this, $c; if (part == null) part = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(" + ") }; if ((($c = $scope.get('String')['$==='](part)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$push(part.$inspect()) } else if (part.$type()['$==']("str")) { return self.$push(part['$[]'](1).$inspect()) } else { return self.$push(self.$expr(part['$[]'](1))) };}, TMP_22.$$s = self, TMP_22.$$arity = 2, TMP_22), $a).call($b); return self.$wrap("(new RegExp(", "))"); }, TMP_23.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $InclusiveRangeNode(){}; var self = $InclusiveRangeNode = $klass($base, $super, 'InclusiveRangeNode', $InclusiveRangeNode); var def = self.$$proto, $scope = self.$$scope, TMP_24; self.$handle("irange"); self.$children("start", "finish"); return (Opal.defn(self, '$compile', TMP_24 = function $$compile() { var self = this; self.$helper("range"); return self.$push("$range(", self.$expr(self.$start()), ", ", self.$expr(self.$finish()), ", false)"); }, TMP_24.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ExclusiveRangeNode(){}; var self = $ExclusiveRangeNode = $klass($base, $super, 'ExclusiveRangeNode', $ExclusiveRangeNode); var def = self.$$proto, $scope = self.$$scope, TMP_25; self.$handle("erange"); self.$children("start", "finish"); return (Opal.defn(self, '$compile', TMP_25 = function $$compile() { var self = this; self.$helper("range"); return self.$push("$range(", self.$expr(self.$start()), ", ", self.$expr(self.$finish()), ", true)"); }, TMP_25.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/variables"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$irb?', '$compiler', '$top?', '$scope', '$using_irb?', '$push', '$variable', '$to_s', '$var_name', '$with_temp', '$property', '$wrap', '$add_local', '$expr', '$value', '$recv?', '$[]', '$name', '$ivar', '$add_ivar', '$helper', '$==', '$handle_global_match', '$handle_post_match', '$handle_pre_match', '$add_gvar', '$index']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $LocalVariableNode(){}; var self = $LocalVariableNode = $klass($base, $super, 'LocalVariableNode', $LocalVariableNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3; self.$handle("lvar"); self.$children("var_name"); Opal.defn(self, '$using_irb?', TMP_1 = function() { var $a, self = this; return ($a = self.$compiler()['$irb?'](), $a !== false && $a !== nil && $a != null ?self.$scope()['$top?']() : $a); }, TMP_1.$$arity = 0); return (Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, $b, TMP_2, self = this; if ((($a = self['$using_irb?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return self.$push(self.$variable(self.$var_name().$to_s())) }; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_2 = function(tmp){var self = TMP_2.$$s || this; if (tmp == null) tmp = nil; self.$push(self.$property(self.$var_name().$to_s())); return self.$wrap("((" + (tmp) + " = Opal.irb_vars", ") == null ? nil : " + (tmp) + ")");}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); }, TMP_3.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $LocalAssignNode(){}; var self = $LocalAssignNode = $klass($base, $super, 'LocalAssignNode', $LocalAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5; self.$handle("lasgn"); self.$children("var_name", "value"); Opal.defn(self, '$using_irb?', TMP_4 = function() { var $a, self = this; return ($a = self.$compiler()['$irb?'](), $a !== false && $a !== nil && $a != null ?self.$scope()['$top?']() : $a); }, TMP_4.$$arity = 0); return (Opal.defn(self, '$compile', TMP_5 = function $$compile() { var $a, self = this; if ((($a = self['$using_irb?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push("Opal.irb_vars" + (self.$property(self.$var_name().$to_s())) + " = ") } else { self.$add_local(self.$variable(self.$var_name().$to_s())); self.$push("" + (self.$variable(self.$var_name().$to_s())) + " = "); }; self.$push(self.$expr(self.$value())); if ((($a = self['$recv?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(", ")") } else { return nil }; }, TMP_5.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $InstanceVariableNode(){}; var self = $InstanceVariableNode = $klass($base, $super, 'InstanceVariableNode', $InstanceVariableNode); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7; self.$handle("ivar"); self.$children("name"); Opal.defn(self, '$var_name', TMP_6 = function $$var_name() { var self = this; return self.$name().$to_s()['$[]']($range(1, -1, false)); }, TMP_6.$$arity = 0); return (Opal.defn(self, '$compile', TMP_7 = function $$compile() { var self = this, name = nil; name = self.$property(self.$ivar(self.$var_name())); self.$add_ivar(name); return self.$push("self" + (name)); }, TMP_7.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $InstanceAssignNode(){}; var self = $InstanceAssignNode = $klass($base, $super, 'InstanceAssignNode', $InstanceAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9; self.$handle("iasgn"); self.$children("name", "value"); Opal.defn(self, '$var_name', TMP_8 = function $$var_name() { var self = this; return self.$name().$to_s()['$[]']($range(1, -1, false)); }, TMP_8.$$arity = 0); return (Opal.defn(self, '$compile', TMP_9 = function $$compile() { var self = this, name = nil; name = self.$property(self.$ivar(self.$var_name())); self.$push("self" + (name) + " = "); return self.$push(self.$expr(self.$value())); }, TMP_9.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $GlobalVariableNode(){}; var self = $GlobalVariableNode = $klass($base, $super, 'GlobalVariableNode', $GlobalVariableNode); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_11, TMP_13, TMP_15, TMP_17; self.$handle("gvar"); self.$children("name"); Opal.defn(self, '$var_name', TMP_10 = function $$var_name() { var self = this; return self.$name().$to_s()['$[]']($range(1, -1, false)); }, TMP_10.$$arity = 0); Opal.defn(self, '$compile', TMP_11 = function $$compile() { var self = this, name = nil; self.$helper("gvars"); if (self.$var_name()['$==']("&")) { return self.$handle_global_match() } else if (self.$var_name()['$==']("'")) { return self.$handle_post_match() } else if (self.$var_name()['$==']("`")) { return self.$handle_pre_match()}; name = self.$property(self.$var_name()); self.$add_gvar(name); return self.$push("$gvars" + (name)); }, TMP_11.$$arity = 0); Opal.defn(self, '$handle_global_match', TMP_13 = function $$handle_global_match() { var $a, $b, TMP_12, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_12 = function(tmp){var self = TMP_12.$$s || this; if (tmp == null) tmp = nil; return self.$push("((" + (tmp) + " = $gvars['~']) === nil ? nil : " + (tmp) + "['$[]'](0))")}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($b); }, TMP_13.$$arity = 0); Opal.defn(self, '$handle_pre_match', TMP_15 = function $$handle_pre_match() { var $a, $b, TMP_14, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_14 = function(tmp){var self = TMP_14.$$s || this; if (tmp == null) tmp = nil; return self.$push("((" + (tmp) + " = $gvars['~']) === nil ? nil : " + (tmp) + ".$pre_match())")}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_15.$$arity = 0); return (Opal.defn(self, '$handle_post_match', TMP_17 = function $$handle_post_match() { var $a, $b, TMP_16, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_16 = function(tmp){var self = TMP_16.$$s || this; if (tmp == null) tmp = nil; return self.$push("((" + (tmp) + " = $gvars['~']) === nil ? nil : " + (tmp) + ".$post_match())")}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b); }, TMP_17.$$arity = 0), nil) && 'handle_post_match'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $GlobalAssignNode(){}; var self = $GlobalAssignNode = $klass($base, $super, 'GlobalAssignNode', $GlobalAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_18, TMP_19; self.$handle("gasgn"); self.$children("name", "value"); Opal.defn(self, '$var_name', TMP_18 = function $$var_name() { var self = this; return self.$name().$to_s()['$[]']($range(1, -1, false)); }, TMP_18.$$arity = 0); return (Opal.defn(self, '$compile', TMP_19 = function $$compile() { var self = this, name = nil; self.$helper("gvars"); name = self.$property(self.$var_name()); self.$push("$gvars" + (name) + " = "); return self.$push(self.$expr(self.$value())); }, TMP_19.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $BackrefNode(){}; var self = $BackrefNode = $klass($base, $super, 'BackrefNode', $BackrefNode); var def = self.$$proto, $scope = self.$$scope, TMP_21; self.$handle("nth_ref"); self.$children("index"); return (Opal.defn(self, '$compile', TMP_21 = function $$compile() { var $a, $b, TMP_20, self = this; self.$helper("gvars"); return ($a = ($b = self).$with_temp, $a.$$p = (TMP_20 = function(tmp){var self = TMP_20.$$s || this; if (tmp == null) tmp = nil; return self.$push("((" + (tmp) + " = $gvars['~']) === nil ? nil : " + (tmp) + "['$[]'](" + (self.$index()) + "))")}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $a).call($b); }, TMP_21.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ClassVariableNode(){}; var self = $ClassVariableNode = $klass($base, $super, 'ClassVariableNode', $ClassVariableNode); var def = self.$$proto, $scope = self.$$scope, TMP_23; self.$handle("cvar"); self.$children("name"); return (Opal.defn(self, '$compile', TMP_23 = function $$compile() { var $a, $b, TMP_22, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_22 = function(tmp){var self = TMP_22.$$s || this; if (tmp == null) tmp = nil; return self.$push("((" + (tmp) + " = Opal.cvars['" + (self.$name()) + "']) == null ? nil : " + (tmp) + ")")}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $a).call($b); }, TMP_23.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ClassVarAssignNode(){}; var self = $ClassVarAssignNode = $klass($base, $super, 'ClassVarAssignNode', $ClassVarAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_24; self.$handle("casgn"); self.$children("name", "value"); return (Opal.defn(self, '$compile', TMP_24 = function $$compile() { var self = this; self.$push("(Opal.cvars['" + (self.$name()) + "'] = "); self.$push(self.$expr(self.$value())); return self.$push(")"); }, TMP_24.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ClassVarDeclNode(){}; var self = $ClassVarDeclNode = $klass($base, $super, 'ClassVarDeclNode', $ClassVarDeclNode); var def = self.$$proto, $scope = self.$$scope, TMP_25; self.$handle("cvdecl"); self.$children("name", "value"); return (Opal.defn(self, '$compile', TMP_25 = function $$compile() { var self = this; self.$push("(Opal.cvars['" + (self.$name()) + "'] = "); self.$push(self.$expr(self.$value())); return self.$push(")"); }, TMP_25.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/constants"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$==', '$name', '$eof_content', '$compiler', '$push', '$expr', '$base', '$wrap', '$value']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ConstNode(){}; var self = $ConstNode = $klass($base, $super, 'ConstNode', $ConstNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$handle("const"); self.$children("name"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var $a, $b, self = this; if ((($a = (($b = self.$name()['$==']("DATA")) ? self.$compiler().$eof_content() : self.$name()['$==']("DATA"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("$__END__") } else { return self.$push("$scope.get('" + (self.$name()) + "')") }; }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ConstDeclarationNode(){}; var self = $ConstDeclarationNode = $klass($base, $super, 'ConstDeclarationNode', $ConstDeclarationNode); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.$handle("cdecl"); self.$children("name", "base"); return (Opal.defn(self, '$compile', TMP_2 = function $$compile() { var self = this; self.$push(self.$expr(self.$base())); return self.$wrap("Opal.cdecl($scope, '" + (self.$name()) + "', ", ")"); }, TMP_2.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ConstAssignNode(){}; var self = $ConstAssignNode = $klass($base, $super, 'ConstAssignNode', $ConstAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_3; self.$handle("casgn"); self.$children("base", "name", "value"); return (Opal.defn(self, '$compile', TMP_3 = function $$compile() { var self = this; self.$push("Opal.casgn("); self.$push(self.$expr(self.$base())); self.$push(", '" + (self.$name()) + "', "); self.$push(self.$expr(self.$value())); return self.$push(")"); }, TMP_3.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ConstGetNode(){}; var self = $ConstGetNode = $klass($base, $super, 'ConstGetNode', $ConstGetNode); var def = self.$$proto, $scope = self.$$scope, TMP_4; self.$handle("colon2"); self.$children("base", "name"); return (Opal.defn(self, '$compile', TMP_4 = function $$compile() { var self = this; self.$push("(("); self.$push(self.$expr(self.$base())); return self.$push(").$$scope.get('" + (self.$name()) + "'))"); }, TMP_4.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $TopConstNode(){}; var self = $TopConstNode = $klass($base, $super, 'TopConstNode', $TopConstNode); var def = self.$$proto, $scope = self.$$scope, TMP_5; self.$handle("colon3"); self.$children("name"); return (Opal.defn(self, '$compile', TMP_5 = function $$compile() { var self = this; return self.$push("Opal.get('" + (self.$name()) + "')"); }, TMP_5.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $TopConstAssignNode(){}; var self = $TopConstAssignNode = $klass($base, $super, 'TopConstAssignNode', $TopConstAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_6; self.$handle("casgn3"); self.$children("name", "value"); return (Opal.defn(self, '$compile', TMP_6 = function $$compile() { var self = this; self.$push("Opal.casgn(Opal.Object, '" + (self.$name()) + "', "); self.$push(self.$expr(self.$value())); return self.$push(")"); }, TMP_6.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["pathname"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range, $module = Opal.module; Opal.add_stubs(['$require', '$include', '$quote', '$===', '$to_s', '$path', '$respond_to?', '$to_path', '$is_a?', '$nil?', '$raise', '$class', '$==', '$attr_reader', '$!', '$relative?', '$chop_basename', '$basename', '$=~', '$new', '$source', '$[]', '$rindex', '$sub', '$absolute?', '$expand_path', '$plus', '$unshift', '$length', '$!=', '$empty?', '$first', '$shift', '$+', '$join', '$dirname', '$pop', '$reverse_each', '$directory?', '$extname', '$<=>', '$nonzero?', '$proc', '$casecmp', '$cleanpath', '$inspect', '$include?', '$fill', '$map', '$entries']); self.$require("corelib/comparable"); (function($base, $super) { function $Pathname(){}; var self = $Pathname = $klass($base, $super, 'Pathname', $Pathname); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, $a, $b, TMP_23, $c, TMP_24, TMP_25, TMP_27; def.path = nil; self.$include($scope.get('Comparable')); Opal.cdecl($scope, 'SEPARATOR_PAT', (new RegExp("" + $scope.get('Regexp').$quote((($scope.get('File')).$$scope.get('SEPARATOR')))))); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(path) { var $a, self = this; if ((($a = $scope.get('Pathname')['$==='](path)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.path = path.$path().$to_s() } else if ((($a = path['$respond_to?']("to_path")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.path = path.$to_path() } else if ((($a = path['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.path = path } else if ((($a = path['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('TypeError'), "no implicit conversion of nil into String") } else { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (path.$class()) + " into String") }; if (self.path['$==']("\x00")) { return self.$raise($scope.get('ArgumentError')) } else { return nil }; }, TMP_1.$$arity = 1); self.$attr_reader("path"); Opal.defn(self, '$==', TMP_2 = function(other) { var self = this; return other.$path()['$=='](self.path); }, TMP_2.$$arity = 1); Opal.defn(self, '$absolute?', TMP_3 = function() { var self = this; return self['$relative?']()['$!'](); }, TMP_3.$$arity = 0); Opal.defn(self, '$relative?', TMP_4 = function() { var $a, $b, $c, self = this, path = nil, r = nil; path = self.path; while ((($b = r = self.$chop_basename(path)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $c = r, $b = Opal.to_ary($c), path = ($b[0] == null ? nil : $b[0]), $c}; return path['$=='](""); }, TMP_4.$$arity = 0); Opal.defn(self, '$chop_basename', TMP_5 = function $$chop_basename(path) { var $a, self = this, base = nil; base = $scope.get('File').$basename(path); if ((($a = $scope.get('Regexp').$new("^" + ((($scope.get('Pathname')).$$scope.get('SEPARATOR_PAT')).$source()) + "?$")['$=~'](base)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return [path['$[]'](0, path.$rindex(base)), base] }; }, TMP_5.$$arity = 1); Opal.defn(self, '$root?', TMP_6 = function() { var self = this; return self.path['$==']("/"); }, TMP_6.$$arity = 0); Opal.defn(self, '$parent', TMP_7 = function $$parent() { var $a, self = this, new_path = nil; new_path = self.path.$sub(/\/([^\/]+\/?$)/, ""); if (new_path['$==']("")) { new_path = (function() {if ((($a = self['$absolute?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "/" } else { return "." }; return nil; })()}; return $scope.get('Pathname').$new(new_path); }, TMP_7.$$arity = 0); Opal.defn(self, '$sub', TMP_8 = function $$sub($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('Pathname').$new(($b = self.path).$sub.apply($b, Opal.to_a(args))); }, TMP_8.$$arity = -1); Opal.defn(self, '$cleanpath', TMP_9 = function $$cleanpath() { var self = this; return Opal.normalize(self.path); }, TMP_9.$$arity = 0); Opal.defn(self, '$to_path', TMP_10 = function $$to_path() { var self = this; return self.path; }, TMP_10.$$arity = 0); Opal.defn(self, '$hash', TMP_11 = function $$hash() { var self = this; return self.path; }, TMP_11.$$arity = 0); Opal.defn(self, '$expand_path', TMP_12 = function $$expand_path() { var self = this; return $scope.get('File').$expand_path(self.path); }, TMP_12.$$arity = 0); Opal.defn(self, '$+', TMP_13 = function(other) { var $a, self = this; if ((($a = $scope.get('Pathname')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { other = $scope.get('Pathname').$new(other) }; return $scope.get('Pathname').$new(self.$plus(self.path, other.$to_s())); }, TMP_13.$$arity = 1); Opal.defn(self, '$plus', TMP_14 = function $$plus(path1, path2) { var $a, $b, $c, $d, self = this, prefix2 = nil, index_list2 = nil, basename_list2 = nil, r2 = nil, basename2 = nil, prefix1 = nil, r1 = nil, basename1 = nil, suffix2 = nil; prefix2 = path2; index_list2 = []; basename_list2 = []; while ((($b = r2 = self.$chop_basename(prefix2)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $c = r2, $b = Opal.to_ary($c), prefix2 = ($b[0] == null ? nil : $b[0]), basename2 = ($b[1] == null ? nil : $b[1]), $c; index_list2.$unshift(prefix2.$length()); basename_list2.$unshift(basename2);}; if ((($a = prefix2['$!=']("")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return path2}; prefix1 = path1; while ((($b = true) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { while ((($c = ($d = basename_list2['$empty?']()['$!'](), $d !== false && $d !== nil && $d != null ?basename_list2.$first()['$=='](".") : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { index_list2.$shift(); basename_list2.$shift();}; if ((($b = r1 = self.$chop_basename(prefix1)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { break; }; $c = r1, $b = Opal.to_ary($c), prefix1 = ($b[0] == null ? nil : $b[0]), basename1 = ($b[1] == null ? nil : $b[1]), $c; if (basename1['$=='](".")) { continue;}; if ((($b = ((($c = ((($d = basename1['$==']("..")) !== false && $d !== nil && $d != null) ? $d : basename_list2['$empty?']())) !== false && $c !== nil && $c != null) ? $c : basename_list2.$first()['$!='](".."))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { prefix1 = $rb_plus(prefix1, basename1); break;;}; index_list2.$shift(); basename_list2.$shift();}; r1 = self.$chop_basename(prefix1); if ((($a = ($b = r1['$!'](), $b !== false && $b !== nil && $b != null ?(new RegExp("" + $scope.get('SEPARATOR_PAT')))['$=~']($scope.get('File').$basename(prefix1)) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { while ((($b = ($c = basename_list2['$empty?']()['$!'](), $c !== false && $c !== nil && $c != null ?basename_list2.$first()['$==']("..") : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { index_list2.$shift(); basename_list2.$shift();}}; if ((($a = basename_list2['$empty?']()['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { suffix2 = path2['$[]']($range(index_list2.$first(), -1, false)); if (r1 !== false && r1 !== nil && r1 != null) { return $scope.get('File').$join(prefix1, suffix2) } else { return $rb_plus(prefix1, suffix2) }; } else if (r1 !== false && r1 !== nil && r1 != null) { return prefix1 } else { return $scope.get('File').$dirname(prefix1) }; }, TMP_14.$$arity = 2); Opal.defn(self, '$join', TMP_16 = function $$join($a_rest) {try { var $b, $c, TMP_15, self = this, args, result = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = args['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self}; result = args.$pop(); if ((($b = $scope.get('Pathname')['$==='](result)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { result = $scope.get('Pathname').$new(result) }; if ((($b = result['$absolute?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return result}; ($b = ($c = args).$reverse_each, $b.$$p = (TMP_15 = function(arg){var self = TMP_15.$$s || this, $a; if (arg == null) arg = nil; if ((($a = $scope.get('Pathname')['$==='](arg)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { arg = $scope.get('Pathname').$new(arg) }; result = $rb_plus(arg, result); if ((($a = result['$absolute?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.ret(result) } else { return nil };}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $b).call($c); return $rb_plus(self, result); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_16.$$arity = -1); Opal.defn(self, '$split', TMP_17 = function $$split() { var self = this; return [self.$dirname(), self.$basename()]; }, TMP_17.$$arity = 0); Opal.defn(self, '$dirname', TMP_18 = function $$dirname() { var self = this; return $scope.get('Pathname').$new($scope.get('File').$dirname(self.path)); }, TMP_18.$$arity = 0); Opal.defn(self, '$basename', TMP_19 = function $$basename() { var self = this; return $scope.get('Pathname').$new($scope.get('File').$basename(self.path)); }, TMP_19.$$arity = 0); Opal.defn(self, '$directory?', TMP_20 = function() { var self = this; return $scope.get('File')['$directory?'](self.path); }, TMP_20.$$arity = 0); Opal.defn(self, '$extname', TMP_21 = function $$extname() { var self = this; return $scope.get('File').$extname(self.path); }, TMP_21.$$arity = 0); Opal.defn(self, '$<=>', TMP_22 = function(other) { var self = this; return self.$path()['$<=>'](other.$path()); }, TMP_22.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.alias(self, '===', '=='); Opal.alias(self, 'to_str', 'to_path'); Opal.alias(self, 'to_s', 'to_path'); Opal.cdecl($scope, 'SAME_PATHS', (function() {if ((($a = (($scope.get('File')).$$scope.get('FNM_SYSCASE'))['$nonzero?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$proc, $a.$$p = (TMP_23 = function(a, b){var self = TMP_23.$$s || this; if (a == null) a = nil;if (b == null) b = nil; return a.$casecmp(b)['$=='](0)}, TMP_23.$$s = self, TMP_23.$$arity = 2, TMP_23), $a).call($b) } else { return ($a = ($c = self).$proc, $a.$$p = (TMP_24 = function(a, b){var self = TMP_24.$$s || this; if (a == null) a = nil;if (b == null) b = nil; return a['$=='](b)}, TMP_24.$$s = self, TMP_24.$$arity = 2, TMP_24), $a).call($c) }; return nil; })()); Opal.defn(self, '$relative_path_from', TMP_25 = function $$relative_path_from(base_directory) { var $a, $b, $c, $d, self = this, dest_directory = nil, dest_prefix = nil, dest_names = nil, r = nil, basename = nil, base_prefix = nil, base_names = nil, relpath_names = nil; dest_directory = self.$cleanpath().$to_s(); base_directory = base_directory.$cleanpath().$to_s(); dest_prefix = dest_directory; dest_names = []; while ((($b = r = self.$chop_basename(dest_prefix)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $c = r, $b = Opal.to_ary($c), dest_prefix = ($b[0] == null ? nil : $b[0]), basename = ($b[1] == null ? nil : $b[1]), $c; if ((($b = basename['$!='](".")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { dest_names.$unshift(basename)};}; base_prefix = base_directory; base_names = []; while ((($b = r = self.$chop_basename(base_prefix)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $c = r, $b = Opal.to_ary($c), base_prefix = ($b[0] == null ? nil : $b[0]), basename = ($b[1] == null ? nil : $b[1]), $c; if ((($b = basename['$!='](".")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { base_names.$unshift(basename)};}; if ((($a = $scope.get('SAME_PATHS')['$[]'](dest_prefix, base_prefix)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError'), "different prefix: " + (dest_prefix.$inspect()) + " and " + (base_directory.$inspect())) }; while ((($b = ($c = ($d = dest_names['$empty?']()['$!'](), $d !== false && $d !== nil && $d != null ?base_names['$empty?']()['$!']() : $d), $c !== false && $c !== nil && $c != null ?$scope.get('SAME_PATHS')['$[]'](dest_names.$first(), base_names.$first()) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { dest_names.$shift(); base_names.$shift();}; if ((($a = base_names['$include?']("..")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "base_directory has ..: " + (base_directory.$inspect()))}; base_names.$fill(".."); relpath_names = $rb_plus(base_names, dest_names); if ((($a = relpath_names['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Pathname').$new(".") } else { return $scope.get('Pathname').$new(($a = $scope.get('File')).$join.apply($a, Opal.to_a(relpath_names))) }; }, TMP_25.$$arity = 1); return (Opal.defn(self, '$entries', TMP_27 = function $$entries() { var $a, $b, TMP_26, self = this; return ($a = ($b = $scope.get('Dir').$entries(self.path)).$map, $a.$$p = (TMP_26 = function(f){var self = TMP_26.$$s || this; if (f == null) f = nil; return self.$class().$new(f)}, TMP_26.$$s = self, TMP_26.$$arity = 1, TMP_26), $a).call($b); }, TMP_27.$$arity = 0), nil) && 'entries'; })($scope.base, null); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_28; Opal.defn(self, '$Pathname', TMP_28 = function $$Pathname(path) { var self = this; return $scope.get('Pathname').$new(path); }, TMP_28.$$arity = 1) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/runtime_helpers"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$new', '$children', '$==', '$include?', '$to_sym', '$<<', '$define_method', '$to_proc', '$meth', '$__send__', '$raise', '$helper', '$[]', '$arglist', '$js_truthy', '$js_falsy']); self.$require("set"); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $RuntimeHelpers(){}; var self = $RuntimeHelpers = $klass($base, $super, 'RuntimeHelpers', $RuntimeHelpers); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, $a, $b, TMP_4, $c, TMP_5; Opal.cdecl($scope, 'HELPERS', $scope.get('Set').$new()); self.$children("recvr", "meth", "arglist"); Opal.defs(self, '$compatible?', TMP_1 = function(recvr, meth, arglist) { var $a, self = this; return (($a = recvr['$=='](["const", "Opal"])) ? $scope.get('HELPERS')['$include?'](meth.$to_sym()) : recvr['$=='](["const", "Opal"])); }, TMP_1.$$arity = 3); Opal.defs(self, '$helper', TMP_2 = function $$helper(name) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; $scope.get('HELPERS')['$<<'](name); return ($a = ($b = self).$define_method, $a.$$p = block.$to_proc(), $a).call($b, "compile_" + (name)); }, TMP_2.$$arity = 1); Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, self = this; if ((($a = $scope.get('HELPERS')['$include?'](self.$meth().$to_sym())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$__send__("compile_" + (self.$meth())) } else { return self.$raise("Helper not supported: " + (self.$meth())) }; }, TMP_3.$$arity = 0); ($a = ($b = self).$helper, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this, $c, sexp = nil; if ((($c = sexp = self.$arglist()['$[]'](1)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { self.$raise("truthy? requires an object") }; return self.$js_truthy(sexp);}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b, "truthy?"); return ($a = ($c = self).$helper, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, $d, sexp = nil; if ((($d = sexp = self.$arglist()['$[]'](1)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { } else { self.$raise("falsy? requires an object") }; return self.$js_falsy(sexp);}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $a).call($c, "falsy?"); })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/call"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$[]=', '$define_method', '$to_proc', '$handle_special', '$compile_default?', '$record_method?', '$<<', '$method_calls', '$compiler', '$to_sym', '$meth', '$using_irb?', '$compile_irb_var', '$default_compile', '$private', '$block_being_passed', '$new_temp', '$scope', '$splat?', '$has_break?', '$expr', '$add_method', '$add_block', '$add_invocation', '$unshift', '$line', '$queue_temp', '$!=', '$receiver_fragment', '$arguments_fragment', '$redefine_this?', '$arguments_array?', '$push', '$apply_call_target', '$any?', '$method_jsid', '$==', '$first', '$arguments_without_block', '$recvr', '$s', '$recv', '$recv_sexp', '$arguments_sexp', '$[]', '$arglist', '$===', '$last', '$type', '$pop', '$iter', '$mid_to_jsid', '$to_s', '$=~', '$with_temp', '$variable', '$intern', '$+', '$irb?', '$top?', '$nil?', '$include?', '$__send__', '$compatible?', '$compile', '$new', '$each', '$add_special', '$inline_operators?', '$operator_helpers', '$fragment', '$compile_default!', '$resolve', '$requires', '$file', '$dirname', '$cleanpath', '$join', '$Pathname', '$inspect', '$process', '$class_scope?', '$required_trees', '$handle_block_given_call', '$def?', '$mid', '$arity_check?', '$handle_part', '$map', '$expand_path', '$split', '$dynamic_require_severity', '$error', '$warning', '$inject']); self.$require("set"); self.$require("pathname"); self.$require("opal/nodes/base"); self.$require("opal/nodes/runtime_helpers"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CallNode(){}; var self = $CallNode = $klass($base, $super, 'CallNode', $CallNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_23, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, $a, $b, TMP_31, $c, TMP_33, $d, TMP_34, $e, TMP_35, $f, TMP_36, $g, TMP_37, $h, TMP_38, $i, TMP_39, $j, TMP_40, $k, TMP_41; def.arguments_without_block = def.block_being_passed = def.assignment = def.compiler = def.sexp = def.level = def.compile_default = nil; self.$handle("call"); self.$children("recvr", "meth", "arglist", "iter"); Opal.cdecl($scope, 'SPECIALS', $hash2([], {})); Opal.cdecl($scope, 'OPERATORS', $hash2(["+", "-", "*", "/", "<", "<=", ">", ">="], {"+": "plus", "-": "minus", "*": "times", "/": "divide", "<": "lt", "<=": "le", ">": "gt", ">=": "ge"})); Opal.defs(self, '$add_special', TMP_1 = function $$add_special(name, options) { var $a, $b, self = this, $iter = TMP_1.$$p, handler = $iter || nil; if (options == null) { options = $hash2([], {}); } TMP_1.$$p = null; $scope.get('SPECIALS')['$[]='](name, options); return ($a = ($b = self).$define_method, $a.$$p = handler.$to_proc(), $a).call($b, "handle_" + (name)); }, TMP_1.$$arity = -2); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, self = this; self.$handle_special(); if ((($a = self['$compile_default?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = self['$record_method?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$compiler().$method_calls()['$<<'](self.$meth().$to_sym())}; if ((($a = self['$using_irb?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_irb_var()}; return self.$default_compile(); }, TMP_2.$$arity = 0); self.$private(); Opal.defn(self, '$default_compile', TMP_4 = function $$default_compile() { var $a, $b, TMP_3, self = this, block_temp = nil, temporary_receiver = nil, has_break = nil; if ((($a = self.$block_being_passed()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block_temp = self.$scope().$new_temp()}; if ((($a = ((($b = self['$splat?']()) !== false && $b !== nil && $b != null) ? $b : block_temp)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { temporary_receiver = self.$scope().$new_temp()}; if ((($a = self.$block_being_passed()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { has_break = ($a = ($b = self.$compiler())['$has_break?'], $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; if (self.block_being_passed == null) self.block_being_passed = nil; return self.block_being_passed = self.$expr(self.block_being_passed)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($b)}; self.$add_method(temporary_receiver); if (block_temp !== false && block_temp !== nil && block_temp != null) { self.$add_block(block_temp)}; self.$add_invocation(temporary_receiver); if (has_break !== false && has_break !== nil && has_break != null) { self.$unshift("return "); self.$unshift("(function(){var $brk = Opal.new_brk(); try {"); self.$line("} catch (err) { if (err === $brk) { return err.$v } else { throw err } }})()");}; if (block_temp !== false && block_temp !== nil && block_temp != null) { return self.$scope().$queue_temp(block_temp) } else { return nil }; }, TMP_4.$$arity = 0); Opal.defn(self, '$redefine_this?', TMP_5 = function(temporary_receiver) { var self = this; return temporary_receiver['$!='](nil); }, TMP_5.$$arity = 1); Opal.defn(self, '$apply_call_target', TMP_6 = function $$apply_call_target(temporary_receiver) { var $a, self = this; return ((($a = temporary_receiver) !== false && $a !== nil && $a != null) ? $a : self.$receiver_fragment()); }, TMP_6.$$arity = 1); Opal.defn(self, '$arguments_array?', TMP_7 = function() { var self = this; return self['$splat?'](); }, TMP_7.$$arity = 0); Opal.defn(self, '$add_invocation', TMP_8 = function $$add_invocation(temporary_receiver) { var $a, $b, self = this, args = nil; args = self.$arguments_fragment(); if ((($a = ((($b = self['$redefine_this?'](temporary_receiver)) !== false && $b !== nil && $b != null) ? $b : self['$arguments_array?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self['$arguments_array?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(".apply(") } else { self.$push(".call(") }; self.$push(self.$apply_call_target(temporary_receiver)); if ((($a = args['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(", ", args)}; return self.$push(")"); } else { return self.$push("(", args, ")") }; }, TMP_8.$$arity = 1); Opal.defn(self, '$add_method', TMP_9 = function $$add_method(temporary_receiver) { var self = this; if (temporary_receiver !== false && temporary_receiver !== nil && temporary_receiver != null) { return self.$push("(" + (temporary_receiver) + " = ", self.$receiver_fragment(), ")" + (self.$method_jsid())) } else { return self.$push(self.$receiver_fragment(), self.$method_jsid()) }; }, TMP_9.$$arity = 1); Opal.defn(self, '$add_block', TMP_10 = function $$add_block(block_temp) { var self = this; self.$unshift("(" + (block_temp) + " = "); return self.$push(", " + (block_temp) + ".$$p = ", self.$block_being_passed(), ", " + (block_temp) + ")"); }, TMP_10.$$arity = 1); Opal.defn(self, '$splat?', TMP_12 = function() { var $a, $b, TMP_11, self = this; return ($a = ($b = self.$arguments_without_block())['$any?'], $a.$$p = (TMP_11 = function(a){var self = TMP_11.$$s || this; if (a == null) a = nil; return a.$first()['$==']("splat")}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b); }, TMP_12.$$arity = 0); Opal.defn(self, '$recv_sexp', TMP_13 = function $$recv_sexp() { var $a, self = this; return ((($a = self.$recvr()) !== false && $a !== nil && $a != null) ? $a : self.$s("self")); }, TMP_13.$$arity = 0); Opal.defn(self, '$receiver_fragment', TMP_14 = function $$receiver_fragment() { var self = this; return self.$recv(self.$recv_sexp()); }, TMP_14.$$arity = 0); Opal.defn(self, '$arguments_fragment', TMP_15 = function $$arguments_fragment() { var self = this; return self.$expr(self.$arguments_sexp()); }, TMP_15.$$arity = 0); Opal.defn(self, '$arguments_sexp', TMP_16 = function $$arguments_sexp() { var $a, self = this, only_args = nil; only_args = self.$arguments_without_block(); return ($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(only_args))); }, TMP_16.$$arity = 0); Opal.defn(self, '$arguments_without_block', TMP_17 = function $$arguments_without_block() { var $a, self = this; return ((($a = self.arguments_without_block) !== false && $a !== nil && $a != null) ? $a : self.arguments_without_block = self.$arglist()['$[]']($range(1, -1, false))); }, TMP_17.$$arity = 0); Opal.defn(self, '$block_being_passed', TMP_18 = function $$block_being_passed() { var $a, $b, $c, self = this, args = nil; return ((($a = self.block_being_passed) !== false && $a !== nil && $a != null) ? $a : self.block_being_passed = (function() {args = self.$arguments_without_block(); if ((($b = ($c = $scope.get('Sexp')['$==='](args.$last()), $c !== false && $c !== nil && $c != null ?args.$last().$type()['$==']("block_pass") : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return args.$pop() } else { return self.$iter() };})()); }, TMP_18.$$arity = 0); Opal.defn(self, '$method_jsid', TMP_19 = function $$method_jsid() { var self = this; return self.$mid_to_jsid(self.$meth().$to_s()); }, TMP_19.$$arity = 0); Opal.defn(self, '$record_method?', TMP_20 = function() { var self = this; return true; }, TMP_20.$$arity = 0); Opal.defn(self, '$attr_assignment?', TMP_21 = function() { var $a, self = this; return ((($a = self.assignment) !== false && $a !== nil && $a != null) ? $a : self.assignment = self.$meth().$to_s()['$=~']((new RegExp("" + $scope.get('REGEXP_START') + "[\\da-z]+\\=" + $scope.get('REGEXP_END'))))); }, TMP_21.$$arity = 0); Opal.defn(self, '$compile_irb_var', TMP_23 = function $$compile_irb_var() { var $a, $b, TMP_22, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_22 = function(tmp){var self = TMP_22.$$s || this, lvar = nil, call = nil; if (tmp == null) tmp = nil; lvar = self.$variable(self.$meth()); call = self.$s("call", self.$s("self"), self.$meth().$intern(), self.$s("arglist")); return self.$push("((" + (tmp) + " = Opal.irb_vars." + (lvar) + ") == null ? ", self.$expr(call), " : " + (tmp) + ")");}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $a).call($b); }, TMP_23.$$arity = 0); Opal.defn(self, '$compile_assignment', TMP_26 = function $$compile_assignment() { var $a, $b, TMP_24, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_24 = function(args_tmp){var self = TMP_24.$$s || this, $c, $d, TMP_25; if (args_tmp == null) args_tmp = nil; return ($c = ($d = self).$with_temp, $c.$$p = (TMP_25 = function(recv_tmp){var self = TMP_25.$$s || this, args = nil, mid = nil; if (recv_tmp == null) recv_tmp = nil; args = self.$expr(self.$arglist()); mid = self.$mid_to_jsid(self.$meth().$to_s()); return self.$push("((" + (args_tmp) + " = [", args, $rb_plus("]), ", "" + (recv_tmp) + " = "), self.$recv(self.$recv_sexp()), ", ", recv_tmp, mid, $rb_plus(".apply(" + (recv_tmp) + ", " + (args_tmp) + "), ", "" + (args_tmp) + "[" + (args_tmp) + ".length-1])"));}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25), $c).call($d)}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24), $a).call($b); }, TMP_26.$$arity = 0); Opal.defn(self, '$using_irb?', TMP_27 = function() { var $a, $b, $c, $d, self = this; return ($a = ($b = ($c = ($d = self.compiler['$irb?'](), $d !== false && $d !== nil && $d != null ?self.$scope()['$top?']() : $d), $c !== false && $c !== nil && $c != null ?self.$arglist()['$=='](self.$s("arglist")) : $c), $b !== false && $b !== nil && $b != null ?self.$recvr()['$nil?']() : $b), $a !== false && $a !== nil && $a != null ?self.$iter()['$nil?']() : $a); }, TMP_27.$$arity = 0); Opal.defn(self, '$handle_special', TMP_28 = function $$handle_special() { var $a, self = this; self.compile_default = true; if ((($a = $scope.get('SPECIALS')['$include?'](self.$meth())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.compile_default = false; return self.$__send__("handle_" + (self.$meth())); } else if ((($a = $scope.get('RuntimeHelpers')['$compatible?'](self.$recvr(), self.$meth(), self.$arglist())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.compile_default = false; return self.$push($scope.get('RuntimeHelpers').$new(self.sexp, self.level, self.compiler).$compile()); } else { return nil }; }, TMP_28.$$arity = 0); Opal.defn(self, '$compile_default!', TMP_29 = function() { var self = this; return self.compile_default = true; }, TMP_29.$$arity = 0); Opal.defn(self, '$compile_default?', TMP_30 = function() { var self = this; return self.compile_default; }, TMP_30.$$arity = 0); ($a = ($b = $scope.get('OPERATORS')).$each, $a.$$p = (TMP_31 = function(operator, name){var self = TMP_31.$$s || this, $c, $d, TMP_32; if (operator == null) operator = nil;if (name == null) name = nil; return ($c = ($d = self).$add_special, $c.$$p = (TMP_32 = function(){var self = TMP_32.$$s || this, $e, lhs = nil, rhs = nil; if ((($e = self.$compiler()['$inline_operators?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { if ((($e = self['$record_method?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$compiler().$method_calls()['$<<'](operator.$to_sym())}; self.$compiler().$operator_helpers()['$<<'](operator.$to_sym()); $e = [self.$expr(self.$recvr()), self.$expr(self.$arglist()['$[]'](1))], lhs = $e[0], rhs = $e[1], $e; self.$push(self.$fragment("$rb_" + (name) + "(")); self.$push(lhs); self.$push(self.$fragment(", ")); self.$push(rhs); return self.$push(self.$fragment(")")); } else { return self['$compile_default!']() }}, TMP_32.$$s = self, TMP_32.$$arity = 0, TMP_32), $c).call($d, operator.$to_sym())}, TMP_31.$$s = self, TMP_31.$$arity = 2, TMP_31), $a).call($b); ($a = ($c = self).$add_special, $a.$$p = (TMP_33 = function(){var self = TMP_33.$$s || this, $d, str = nil; self['$compile_default!'](); str = $scope.get('DependencyResolver').$new(self.$compiler(), self.$arglist()['$[]'](1)).$resolve(); if ((($d = str['$nil?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { } else { self.$compiler().$requires()['$<<'](str) }; return self.$push(self.$fragment(""));}, TMP_33.$$s = self, TMP_33.$$arity = 0, TMP_33), $a).call($c, "require"); ($a = ($d = self).$add_special, $a.$$p = (TMP_34 = function(){var self = TMP_34.$$s || this, arg = nil, file = nil, dir = nil; arg = self.$arglist()['$[]'](1); file = self.$compiler().$file(); if (arg['$[]'](0)['$==']("str")) { dir = $scope.get('File').$dirname(file); self.$compiler().$requires()['$<<'](self.$Pathname(dir).$join(arg['$[]'](1)).$cleanpath().$to_s());}; self.$push(self.$fragment("self.$require(" + (file.$inspect()) + "+ '/../' + ")); self.$push(self.$process(self.$arglist())); return self.$push(self.$fragment(")"));}, TMP_34.$$s = self, TMP_34.$$arity = 0, TMP_34), $a).call($d, "require_relative"); ($a = ($e = self).$add_special, $a.$$p = (TMP_35 = function(){var self = TMP_35.$$s || this, $f, str = nil; if ((($f = self.$scope()['$class_scope?']()) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { self['$compile_default!'](); str = $scope.get('DependencyResolver').$new(self.$compiler(), self.$arglist()['$[]'](2)).$resolve(); if ((($f = str['$nil?']()) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { } else { self.$compiler().$requires()['$<<'](str) }; return self.$push(self.$fragment("")); } else { return nil }}, TMP_35.$$s = self, TMP_35.$$arity = 0, TMP_35), $a).call($e, "autoload"); ($a = ($f = self).$add_special, $a.$$p = (TMP_36 = function(){var self = TMP_36.$$s || this, arg = nil, relative_path = nil, dir = nil, full_path = nil; arg = self.$arglist()['$[]'](1); if (arg['$[]'](0)['$==']("str")) { relative_path = arg['$[]'](1); self.$compiler().$required_trees()['$<<'](relative_path); dir = $scope.get('File').$dirname(self.$compiler().$file()); full_path = self.$Pathname(dir).$join(relative_path).$cleanpath().$to_s(); arg['$[]='](1, full_path);}; self['$compile_default!'](); return self.$push(self.$fragment(""));}, TMP_36.$$s = self, TMP_36.$$arity = 0, TMP_36), $a).call($f, "require_tree"); ($a = ($g = self).$add_special, $a.$$p = (TMP_37 = function(){var self = TMP_37.$$s || this; if (self.sexp == null) self.sexp = nil; return self.$push(self.$compiler().$handle_block_given_call(self.sexp))}, TMP_37.$$s = self, TMP_37.$$arity = 0, TMP_37), $a).call($g, "block_given?"); ($a = ($h = self).$add_special, $a.$$p = (TMP_38 = function(){var self = TMP_38.$$s || this, $i; if ((($i = self.$scope()['$def?']()) !== nil && $i != null && (!$i.$$is_boolean || $i == true))) { return self.$push(self.$fragment(self.$scope().$mid().$to_s().$inspect())) } else { return self.$push(self.$fragment("nil")) }}, TMP_38.$$s = self, TMP_38.$$arity = 0, TMP_38), $a).call($h, "__callee__"); ($a = ($i = self).$add_special, $a.$$p = (TMP_39 = function(){var self = TMP_39.$$s || this, $j; if ((($j = self.$scope()['$def?']()) !== nil && $j != null && (!$j.$$is_boolean || $j == true))) { return self.$push(self.$fragment(self.$scope().$mid().$to_s().$inspect())) } else { return self.$push(self.$fragment("nil")) }}, TMP_39.$$s = self, TMP_39.$$arity = 0, TMP_39), $a).call($i, "__method__"); ($a = ($j = self).$add_special, $a.$$p = (TMP_40 = function(){var self = TMP_40.$$s || this; return self.$push(self.$fragment("debugger"))}, TMP_40.$$s = self, TMP_40.$$arity = 0, TMP_40), $a).call($j, "debugger"); ($a = ($k = self).$add_special, $a.$$p = (TMP_41 = function(){var self = TMP_41.$$s || this; return self.$push(self.$fragment("Opal.hash({ arity_check: " + (self.$compiler()['$arity_check?']()) + " })"))}, TMP_41.$$s = self, TMP_41.$$arity = 0, TMP_41), $a).call($k, "__OPAL_COMPILER_CONFIG__"); return (function($base, $super) { function $DependencyResolver(){}; var self = $DependencyResolver = $klass($base, $super, 'DependencyResolver', $DependencyResolver); var def = self.$$proto, $scope = self.$$scope, TMP_42, TMP_43, TMP_45, TMP_47; def.sexp = def.compiler = nil; Opal.defn(self, '$initialize', TMP_42 = function $$initialize(compiler, sexp) { var self = this; self.compiler = compiler; return self.sexp = sexp; }, TMP_42.$$arity = 2); Opal.defn(self, '$resolve', TMP_43 = function $$resolve() { var self = this; return self.$handle_part(self.sexp); }, TMP_43.$$arity = 0); Opal.defn(self, '$handle_part', TMP_45 = function $$handle_part(sexp) { var $a, $b, TMP_44, self = this, type = nil, _ = nil, recv = nil, meth = nil, args = nil, parts = nil, msg = nil, $case = nil; type = sexp.$type(); if (type['$==']("str")) { return sexp['$[]'](1) } else if (type['$==']("call")) { $b = sexp, $a = Opal.to_ary($b), _ = ($a[0] == null ? nil : $a[0]), recv = ($a[1] == null ? nil : $a[1]), meth = ($a[2] == null ? nil : $a[2]), args = ($a[3] == null ? nil : $a[3]), $b; parts = ($a = ($b = args['$[]']($range(1, -1, false))).$map, $a.$$p = (TMP_44 = function(s){var self = TMP_44.$$s || this; if (s == null) s = nil; return self.$handle_part(s)}, TMP_44.$$s = self, TMP_44.$$arity = 1, TMP_44), $a).call($b); if (recv['$=='](["const", "File"])) { if (meth['$==']("expand_path")) { return ($a = self).$expand_path.apply($a, Opal.to_a(parts)) } else if (meth['$==']("join")) { return self.$expand_path(parts.$join("/")) } else if (meth['$==']("dirname")) { return self.$expand_path(parts['$[]'](0).$split("/")['$[]']($range(0, -1, true)).$join("/"))}};}; msg = "Cannot handle dynamic require"; return (function() {$case = self.compiler.$dynamic_require_severity();if ("error"['$===']($case)) {return self.compiler.$error(msg, self.sexp.$line())}else if ("warning"['$===']($case)) {return self.compiler.$warning(msg, self.sexp.$line())}else { return nil }})(); }, TMP_45.$$arity = 1); return (Opal.defn(self, '$expand_path', TMP_47 = function $$expand_path(path, base) { var $a, $b, TMP_46, self = this; if (base == null) { base = ""; } return ($a = ($b = (((("") + (base)) + "/") + (path)).$split("/")).$inject, $a.$$p = (TMP_46 = function(p, part){var self = TMP_46.$$s || this; if (p == null) p = nil;if (part == null) part = nil; if (part['$==']("")) { } else if (part['$==']("..")) { p.$pop() } else { p['$<<'](part) }; return p;}, TMP_46.$$s = self, TMP_46.$$arity = 2, TMP_46), $a).call($b, []).$join("/"); }, TMP_47.$$arity = -2), nil) && 'expand_path'; })($scope.base, null); })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/call_special"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$!~', '$to_s', '$meth', '$with_temp', '$expr', '$arglist', '$mid_to_jsid', '$push', '$+', '$recv', '$recv_sexp', '$[]', '$==', '$any?', '$first', '$===', '$last', '$type', '$pop', '$iter', '$new_temp', '$scope', '$s', '$unshift', '$queue_temp', '$lhs', '$rhs', '$process', '$recvr', '$args', '$op', '$compile_or', '$compile_and', '$compile_operator', '$to_sym', '$first_arg', '$mid']); self.$require("opal/nodes/base"); self.$require("opal/nodes/call"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $AttrAssignNode(){}; var self = $AttrAssignNode = $klass($base, $super, 'AttrAssignNode', $AttrAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$handle("attrasgn"); self.$children("recvr", "meth", "arglist"); return (Opal.defn(self, '$default_compile', TMP_1 = function $$default_compile() { var $a, $b, $c, TMP_2, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = self.$meth().$to_s()['$!~']((new RegExp("" + $scope.get('REGEXP_START') + "\\w+=" + $scope.get('REGEXP_END'))))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'default_compile', TMP_1, false)), $a.$$p = $iter, $a).apply($b, $zuper)}; return ($a = ($c = self).$with_temp, $a.$$p = (TMP_2 = function(args_tmp){var self = TMP_2.$$s || this, $d, $e, TMP_3; if (args_tmp == null) args_tmp = nil; return ($d = ($e = self).$with_temp, $d.$$p = (TMP_3 = function(recv_tmp){var self = TMP_3.$$s || this, args = nil, mid = nil; if (recv_tmp == null) recv_tmp = nil; args = self.$expr(self.$arglist()); mid = self.$mid_to_jsid(self.$meth().$to_s()); return self.$push("((" + (args_tmp) + " = [", args, $rb_plus("]), ", "" + (recv_tmp) + " = "), self.$recv(self.$recv_sexp()), ", ", recv_tmp, mid, $rb_plus(".apply(" + (recv_tmp) + ", " + (args_tmp) + "), ", "" + (args_tmp) + "[" + (args_tmp) + ".length-1])"));}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $d).call($e)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($c); }, TMP_1.$$arity = 0), nil) && 'default_compile'; })($scope.base, $scope.get('CallNode')); (function($base, $super) { function $JsAttrAssignNode(){}; var self = $JsAttrAssignNode = $klass($base, $super, 'JsAttrAssignNode', $JsAttrAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5; self.$handle("jsattrasgn"); Opal.defn(self, '$record_method?', TMP_4 = function() { var self = this; return false; }, TMP_4.$$arity = 0); return (Opal.defn(self, '$default_compile', TMP_5 = function $$default_compile() { var self = this; return self.$push(self.$recv(self.$recv_sexp()), "[", self.$expr(self.$arglist()['$[]'](1)), "]", "=", self.$expr(self.$arglist()['$[]'](2))); }, TMP_5.$$arity = 0), nil) && 'default_compile'; })($scope.base, $scope.get('CallNode')); (function($base, $super) { function $JsCallNode(){}; var self = $JsCallNode = $klass($base, $super, 'JsCallNode', $JsCallNode); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_8; self.$handle("jscall"); Opal.defn(self, '$record_method?', TMP_6 = function() { var self = this; return false; }, TMP_6.$$arity = 0); return (Opal.defn(self, '$default_compile', TMP_8 = function $$default_compile() { var $a, $b, TMP_7, $c, self = this, mid = nil, splat = nil, block = nil, blktmp = nil, tmprecv = nil, recv_code = nil, call_recv = nil, args = nil; if (self.$meth()['$==']("[]")) { return self.$push(self.$recv(self.$recv_sexp()), "[", self.$expr(self.$arglist()), "]") } else { mid = "." + (self.$meth()); splat = ($a = ($b = self.$arglist()['$[]']($range(1, -1, false)))['$any?'], $a.$$p = (TMP_7 = function(a){var self = TMP_7.$$s || this; if (a == null) a = nil; return a.$first()['$==']("splat")}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); if ((($a = ($c = $scope.get('Sexp')['$==='](self.$arglist().$last()), $c !== false && $c !== nil && $c != null ?self.$arglist().$last().$type()['$==']("block_pass") : $c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block = self.$arglist().$pop() } else if ((($a = self.$iter()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block = self.$iter()}; if (block !== false && block !== nil && block != null) { blktmp = self.$scope().$new_temp()}; if (splat !== false && splat !== nil && splat != null) { tmprecv = self.$scope().$new_temp()}; if (block !== false && block !== nil && block != null) { block = self.$expr(block)}; recv_code = self.$recv(self.$recv_sexp()); call_recv = self.$s("js_tmp", ((($a = blktmp) !== false && $a !== nil && $a != null) ? $a : recv_code)); if (blktmp !== false && blktmp !== nil && blktmp != null) { self.$arglist().$push(call_recv)}; args = self.$expr(self.$arglist()); if (tmprecv !== false && tmprecv !== nil && tmprecv != null) { self.$push("(" + (tmprecv) + " = ", recv_code, ")" + (mid)) } else { self.$push(recv_code, mid) }; if (blktmp !== false && blktmp !== nil && blktmp != null) { self.$unshift("(" + (blktmp) + " = ", block, ", "); self.$push(")");}; if (splat !== false && splat !== nil && splat != null) { self.$push(".apply(", tmprecv, ", ", args, ")") } else { self.$push("(", args, ")") }; if (blktmp !== false && blktmp !== nil && blktmp != null) { return self.$scope().$queue_temp(blktmp) } else { return nil }; }; }, TMP_8.$$arity = 0), nil) && 'default_compile'; })($scope.base, $scope.get('CallNode')); (function($base, $super) { function $Match3Node(){}; var self = $Match3Node = $klass($base, $super, 'Match3Node', $Match3Node); var def = self.$$proto, $scope = self.$$scope, TMP_9; def.level = nil; self.$handle("match3"); self.$children("lhs", "rhs"); return (Opal.defn(self, '$compile', TMP_9 = function $$compile() { var self = this, sexp = nil; sexp = self.$s("call", self.$lhs(), "=~", self.$s("arglist", self.$rhs())); return self.$push(self.$process(sexp, self.level)); }, TMP_9.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $OpAsgnOrNode(){}; var self = $OpAsgnOrNode = $klass($base, $super, 'OpAsgnOrNode', $OpAsgnOrNode); var def = self.$$proto, $scope = self.$$scope, TMP_10; self.$handle("op_asgn_or"); self.$children("recvr", "rhs"); return (Opal.defn(self, '$compile', TMP_10 = function $$compile() { var self = this, sexp = nil; sexp = self.$s("or", self.$recvr(), self.$rhs()); return self.$push(self.$expr(sexp)); }, TMP_10.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $OpAsgnAndNode(){}; var self = $OpAsgnAndNode = $klass($base, $super, 'OpAsgnAndNode', $OpAsgnAndNode); var def = self.$$proto, $scope = self.$$scope, TMP_11; self.$handle("op_asgn_and"); self.$children("recvr", "rhs"); return (Opal.defn(self, '$compile', TMP_11 = function $$compile() { var self = this, sexp = nil; sexp = self.$s("and", self.$recvr(), self.$rhs()); return self.$push(self.$expr(sexp)); }, TMP_11.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $OpAsgn1Node(){}; var self = $OpAsgn1Node = $klass($base, $super, 'OpAsgn1Node', $OpAsgn1Node); var def = self.$$proto, $scope = self.$$scope, TMP_12, TMP_13, TMP_16, TMP_19, TMP_22; self.$handle("op_asgn1"); self.$children("lhs", "args", "op", "rhs"); Opal.defn(self, '$first_arg', TMP_12 = function $$first_arg() { var self = this; return self.$args()['$[]'](1); }, TMP_12.$$arity = 0); Opal.defn(self, '$compile', TMP_13 = function $$compile() { var self = this, $case = nil; return (function() {$case = self.$op().$to_s();if ("||"['$===']($case)) {return self.$compile_or()}else if ("&&"['$===']($case)) {return self.$compile_and()}else {return self.$compile_operator()}})(); }, TMP_13.$$arity = 0); Opal.defn(self, '$compile_operator', TMP_16 = function $$compile_operator() { var $a, $b, TMP_14, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_14 = function(a){var self = TMP_14.$$s || this, $c, $d, TMP_15; if (a == null) a = nil; return ($c = ($d = self).$with_temp, $c.$$p = (TMP_15 = function(r){var self = TMP_15.$$s || this, cur = nil, rhs = nil, call = nil; if (r == null) r = nil; cur = self.$s("call", self.$s("js_tmp", r), "[]", self.$s("arglist", self.$s("js_tmp", a))); rhs = self.$s("call", cur, self.$op().$to_sym(), self.$s("arglist", self.$rhs())); call = self.$s("call", self.$s("js_tmp", r), "[]=", self.$s("arglist", self.$s("js_tmp", a), rhs)); self.$push("(" + (a) + " = ", self.$expr(self.$first_arg()), ", " + (r) + " = ", self.$expr(self.$lhs())); return self.$push(", ", self.$expr(call), ")");}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $c).call($d)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_16.$$arity = 0); Opal.defn(self, '$compile_or', TMP_19 = function $$compile_or() { var $a, $b, TMP_17, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_17 = function(a){var self = TMP_17.$$s || this, $c, $d, TMP_18; if (a == null) a = nil; return ($c = ($d = self).$with_temp, $c.$$p = (TMP_18 = function(r){var self = TMP_18.$$s || this, aref = nil, aset = nil, orop = nil; if (r == null) r = nil; aref = self.$s("call", self.$s("js_tmp", r), "[]", self.$s("arglist", self.$s("js_tmp", a))); aset = self.$s("call", self.$s("js_tmp", r), "[]=", self.$s("arglist", self.$s("js_tmp", a), self.$rhs())); orop = self.$s("or", aref, aset); self.$push("(" + (a) + " = ", self.$expr(self.$first_arg()), ", " + (r) + " = ", self.$expr(self.$lhs())); return self.$push(", ", self.$expr(orop), ")");}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18), $c).call($d)}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b); }, TMP_19.$$arity = 0); return (Opal.defn(self, '$compile_and', TMP_22 = function $$compile_and() { var $a, $b, TMP_20, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_20 = function(a){var self = TMP_20.$$s || this, $c, $d, TMP_21; if (a == null) a = nil; return ($c = ($d = self).$with_temp, $c.$$p = (TMP_21 = function(r){var self = TMP_21.$$s || this, aref = nil, aset = nil, andop = nil; if (r == null) r = nil; aref = self.$s("call", self.$s("js_tmp", r), "[]", self.$s("arglist", self.$s("js_tmp", a))); aset = self.$s("call", self.$s("js_tmp", r), "[]=", self.$s("arglist", self.$s("js_tmp", a), self.$rhs())); andop = self.$s("and", aref, aset); self.$push("(" + (a) + " = ", self.$expr(self.$first_arg()), ", " + (r) + " = ", self.$expr(self.$lhs())); return self.$push(", ", self.$expr(andop), ")");}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21), $c).call($d)}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $a).call($b); }, TMP_22.$$arity = 0), nil) && 'compile_and'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $OpAsgn2Node(){}; var self = $OpAsgn2Node = $klass($base, $super, 'OpAsgn2Node', $OpAsgn2Node); var def = self.$$proto, $scope = self.$$scope, TMP_23, TMP_24, TMP_26, TMP_28, TMP_30; self.$handle("op_asgn2"); self.$children("lhs", "mid", "op", "rhs"); Opal.defn(self, '$meth', TMP_23 = function $$meth() { var self = this; return self.$mid().$to_s()['$[]']($range(0, -2, false)); }, TMP_23.$$arity = 0); Opal.defn(self, '$compile', TMP_24 = function $$compile() { var self = this, $case = nil; return (function() {$case = self.$op().$to_s();if ("||"['$===']($case)) {return self.$compile_or()}else if ("&&"['$===']($case)) {return self.$compile_and()}else {return self.$compile_operator()}})(); }, TMP_24.$$arity = 0); Opal.defn(self, '$compile_or', TMP_26 = function $$compile_or() { var $a, $b, TMP_25, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_25 = function(tmp){var self = TMP_25.$$s || this, getr = nil, asgn = nil, orop = nil; if (tmp == null) tmp = nil; getr = self.$s("call", self.$s("js_tmp", tmp), self.$meth(), self.$s("arglist")); asgn = self.$s("call", self.$s("js_tmp", tmp), self.$mid(), self.$s("arglist", self.$rhs())); orop = self.$s("or", getr, asgn); return self.$push("(" + (tmp) + " = ", self.$expr(self.$lhs()), ", ", self.$expr(orop), ")");}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25), $a).call($b); }, TMP_26.$$arity = 0); Opal.defn(self, '$compile_and', TMP_28 = function $$compile_and() { var $a, $b, TMP_27, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_27 = function(tmp){var self = TMP_27.$$s || this, getr = nil, asgn = nil, andop = nil; if (tmp == null) tmp = nil; getr = self.$s("call", self.$s("js_tmp", tmp), self.$meth(), self.$s("arglist")); asgn = self.$s("call", self.$s("js_tmp", tmp), self.$mid(), self.$s("arglist", self.$rhs())); andop = self.$s("and", getr, asgn); return self.$push("(" + (tmp) + " = ", self.$expr(self.$lhs()), ", ", self.$expr(andop), ")");}, TMP_27.$$s = self, TMP_27.$$arity = 1, TMP_27), $a).call($b); }, TMP_28.$$arity = 0); return (Opal.defn(self, '$compile_operator', TMP_30 = function $$compile_operator() { var $a, $b, TMP_29, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_29 = function(tmp){var self = TMP_29.$$s || this, getr = nil, oper = nil, asgn = nil; if (tmp == null) tmp = nil; getr = self.$s("call", self.$s("js_tmp", tmp), self.$meth(), self.$s("arglist")); oper = self.$s("call", getr, self.$op(), self.$s("arglist", self.$rhs())); asgn = self.$s("call", self.$s("js_tmp", tmp), self.$mid(), self.$s("arglist", oper)); return self.$push("(" + (tmp) + " = ", self.$expr(self.$lhs()), ", ", self.$expr(asgn), ")");}, TMP_29.$$s = self, TMP_29.$$arity = 1, TMP_29), $a).call($b); }, TMP_30.$$arity = 0), nil) && 'compile_operator'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/scope"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$attr_accessor', '$attr_reader', '$indent', '$scope', '$compiler', '$scope=', '$call', '$==', '$!', '$class?', '$dup', '$push', '$map', '$ivars', '$gvars', '$parser_indent', '$empty?', '$join', '$+', '$proto', '$%', '$fragment', '$def_in_class?', '$add_proto_ivar', '$include?', '$<<', '$has_local?', '$has_temp?', '$pop', '$next_temp', '$succ', '$uses_block!', '$identify!', '$unique_temp', '$add_scope_temp', '$parent', '$def?', '$type', '$mid', '$rescue_else_sexp']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ScopeNode(){}; var self = $ScopeNode = $klass($base, $super, 'ScopeNode', $ScopeNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40; def.type = def.defs = def.parent = def.temps = def.locals = def.compiler = def.proto_ivars = def.ivars = def.gvars = def.args = def.queue = def.unique = def.while_stack = def.identity = def.uses_block = def.in_ensure = nil; self.$attr_accessor("parent"); self.$attr_accessor("name"); self.$attr_accessor("block_name"); self.$attr_reader("scope_name"); self.$attr_reader("locals"); self.$attr_reader("ivars"); self.$attr_reader("gvars"); self.$attr_accessor("mid"); self.$attr_accessor("defs"); self.$attr_reader("methods"); self.$attr_accessor("uses_super"); self.$attr_accessor("uses_zuper"); self.$attr_accessor("catch_return", "has_break"); self.$attr_accessor("rescue_else_sexp"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize($a_rest) { var $b, $c, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } ($b = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $b.$$p = $iter, $b).apply($c, $zuper); self.locals = []; self.temps = []; self.args = []; self.ivars = []; self.gvars = []; self.parent = nil; self.queue = []; self.unique = "a"; self.while_stack = []; self.identity = nil; self.defs = nil; self.methods = []; self.uses_block = false; return self.proto_ivars = []; }, TMP_1.$$arity = -1); Opal.defn(self, '$in_scope', TMP_2 = function $$in_scope() { var $a, $b, TMP_3, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; return ($a = ($b = self).$indent, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this, $c, $d; if (self.parent == null) self.parent = nil; self.parent = self.$compiler().$scope(); (($c = [self]), $d = self.$compiler(), $d['$scope='].apply($d, $c), $c[$c.length-1]); block.$call(self); return (($c = [self.parent]), $d = self.$compiler(), $d['$scope='].apply($d, $c), $c[$c.length-1]);}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($b); }, TMP_2.$$arity = 0); Opal.defn(self, '$class_scope?', TMP_4 = function() { var $a, self = this; return ((($a = self.type['$==']("class")) !== false && $a !== nil && $a != null) ? $a : self.type['$==']("module")); }, TMP_4.$$arity = 0); Opal.defn(self, '$class?', TMP_5 = function() { var self = this; return self.type['$==']("class"); }, TMP_5.$$arity = 0); Opal.defn(self, '$module?', TMP_6 = function() { var self = this; return self.type['$==']("module"); }, TMP_6.$$arity = 0); Opal.defn(self, '$sclass?', TMP_7 = function() { var self = this; return self.type['$==']("sclass"); }, TMP_7.$$arity = 0); Opal.defn(self, '$top?', TMP_8 = function() { var self = this; return self.type['$==']("top"); }, TMP_8.$$arity = 0); Opal.defn(self, '$iter?', TMP_9 = function() { var self = this; return self.type['$==']("iter"); }, TMP_9.$$arity = 0); Opal.defn(self, '$def?', TMP_10 = function() { var self = this; return self.type['$==']("def"); }, TMP_10.$$arity = 0); Opal.defn(self, '$def_in_class?', TMP_11 = function() { var $a, $b, $c, self = this; return ($a = ($b = ($c = self.defs['$!'](), $c !== false && $c !== nil && $c != null ?self.type['$==']("def") : $c), $b !== false && $b !== nil && $b != null ?self.parent : $b), $a !== false && $a !== nil && $a != null ?self.parent['$class?']() : $a); }, TMP_11.$$arity = 0); Opal.defn(self, '$proto', TMP_12 = function $$proto() { var self = this; return "def"; }, TMP_12.$$arity = 0); Opal.defn(self, '$to_vars', TMP_17 = function $$to_vars() { var $a, $b, $c, TMP_13, $d, TMP_14, $e, TMP_15, $f, TMP_16, self = this, vars = nil, iv = nil, gv = nil, indent = nil, str = nil, pvars = nil, result = nil; vars = self.temps.$dup(); ($a = vars).$push.apply($a, Opal.to_a(($b = ($c = self.locals).$map, $b.$$p = (TMP_13 = function(l){var self = TMP_13.$$s || this; if (l == null) l = nil; return "" + (l) + " = nil"}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $b).call($c))); iv = ($b = ($d = self.$ivars()).$map, $b.$$p = (TMP_14 = function(ivar){var self = TMP_14.$$s || this; if (ivar == null) ivar = nil; return "if (self" + (ivar) + " == null) self" + (ivar) + " = nil;\n"}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $b).call($d); gv = ($b = ($e = self.$gvars()).$map, $b.$$p = (TMP_15 = function(gvar){var self = TMP_15.$$s || this; if (gvar == null) gvar = nil; return "if ($gvars" + (gvar) + " == null) $gvars" + (gvar) + " = nil;\n"}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $b).call($e); indent = self.compiler.$parser_indent(); str = (function() {if ((($b = vars['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return "" } else { return "var " + (vars.$join(", ")) + ";\n" }; return nil; })(); if ((($b = self.$ivars()['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { str = $rb_plus(str, "" + (indent) + (iv.$join(indent))) }; if ((($b = self.$gvars()['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { str = $rb_plus(str, "" + (indent) + (gv.$join(indent))) }; if ((($b = ($f = self['$class?'](), $f !== false && $f !== nil && $f != null ?self.proto_ivars['$empty?']()['$!']() : $f)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { pvars = ($b = ($f = self.proto_ivars).$map, $b.$$p = (TMP_16 = function(i){var self = TMP_16.$$s || this; if (i == null) i = nil; return "" + (self.$proto()) + (i)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $b).call($f).$join(" = "); result = "%s\n%s%s = nil;"['$%']([str, indent, pvars]); } else { result = str }; return self.$fragment(result); }, TMP_17.$$arity = 0); Opal.defn(self, '$add_scope_ivar', TMP_18 = function $$add_scope_ivar(ivar) { var $a, self = this; if ((($a = self['$def_in_class?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.parent.$add_proto_ivar(ivar) } else if ((($a = self.ivars['$include?'](ivar)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.ivars['$<<'](ivar) }; }, TMP_18.$$arity = 1); Opal.defn(self, '$add_scope_gvar', TMP_19 = function $$add_scope_gvar(gvar) { var $a, self = this; if ((($a = self.gvars['$include?'](gvar)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.gvars['$<<'](gvar) }; }, TMP_19.$$arity = 1); Opal.defn(self, '$add_proto_ivar', TMP_20 = function $$add_proto_ivar(ivar) { var $a, self = this; if ((($a = self.proto_ivars['$include?'](ivar)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.proto_ivars['$<<'](ivar) }; }, TMP_20.$$arity = 1); Opal.defn(self, '$add_arg', TMP_21 = function $$add_arg(arg) { var $a, self = this; if ((($a = self.args['$include?'](arg)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.args['$<<'](arg) }; return arg; }, TMP_21.$$arity = 1); Opal.defn(self, '$add_scope_local', TMP_22 = function $$add_scope_local(local) { var $a, self = this; if ((($a = self['$has_local?'](local)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; return self.locals['$<<'](local); }, TMP_22.$$arity = 1); Opal.defn(self, '$has_local?', TMP_23 = function(local) { var $a, $b, $c, self = this; if ((($a = ((($b = ((($c = self.locals['$include?'](local)) !== false && $c !== nil && $c != null) ? $c : self.args['$include?'](local))) !== false && $b !== nil && $b != null) ? $b : self.temps['$include?'](local))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return true}; if ((($a = ($b = self.parent, $b !== false && $b !== nil && $b != null ?self.type['$==']("iter") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.parent['$has_local?'](local)}; return false; }, TMP_23.$$arity = 1); Opal.defn(self, '$add_scope_temp', TMP_24 = function $$add_scope_temp(tmp) { var $a, self = this; if ((($a = self['$has_temp?'](tmp)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; return self.temps.$push(tmp); }, TMP_24.$$arity = 1); Opal.defn(self, '$has_temp?', TMP_25 = function(tmp) { var self = this; return self.temps['$include?'](tmp); }, TMP_25.$$arity = 1); Opal.defn(self, '$new_temp', TMP_26 = function $$new_temp() { var $a, self = this, tmp = nil; if ((($a = self.queue['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return self.queue.$pop() }; tmp = self.$next_temp(); self.temps['$<<'](tmp); return tmp; }, TMP_26.$$arity = 0); Opal.defn(self, '$next_temp', TMP_27 = function $$next_temp() { var $a, $b, self = this, tmp = nil; while ((($b = true) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { tmp = "$" + (self.unique); self.unique = self.unique.$succ(); if ((($b = self['$has_local?'](tmp)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { break; };}; return tmp; }, TMP_27.$$arity = 0); Opal.defn(self, '$queue_temp', TMP_28 = function $$queue_temp(name) { var self = this; return self.queue['$<<'](name); }, TMP_28.$$arity = 1); Opal.defn(self, '$push_while', TMP_29 = function $$push_while() { var self = this, info = nil; info = $hash2([], {}); self.while_stack.$push(info); return info; }, TMP_29.$$arity = 0); Opal.defn(self, '$pop_while', TMP_30 = function $$pop_while() { var self = this; return self.while_stack.$pop(); }, TMP_30.$$arity = 0); Opal.defn(self, '$in_while?', TMP_31 = function() { var self = this; return self.while_stack['$empty?']()['$!'](); }, TMP_31.$$arity = 0); Opal.defn(self, '$uses_block!', TMP_32 = function() { var $a, $b, self = this; if ((($a = (($b = self.type['$==']("iter")) ? self.parent : self.type['$==']("iter"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.parent['$uses_block!']() } else { self.uses_block = true; return self['$identify!'](); }; }, TMP_32.$$arity = 0); Opal.defn(self, '$identify!', TMP_33 = function() { var $a, self = this; if ((($a = self.identity) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.identity}; self.identity = self.compiler.$unique_temp(); if ((($a = self.parent) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.parent.$add_scope_temp(self.identity)}; return self.identity; }, TMP_33.$$arity = 0); Opal.defn(self, '$identity', TMP_34 = function $$identity() { var self = this; return self.identity; }, TMP_34.$$arity = 0); Opal.defn(self, '$find_parent_def', TMP_35 = function $$find_parent_def() { var $a, $b, self = this, scope = nil; scope = self; while ((($b = scope = scope.$parent()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = scope['$def?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return scope}}; return nil; }, TMP_35.$$arity = 0); Opal.defn(self, '$get_super_chain', TMP_36 = function $$get_super_chain() { var $a, $b, self = this, chain = nil, scope = nil, defn = nil, mid = nil; $a = [[], self, "null", "null"], chain = $a[0], scope = $a[1], defn = $a[2], mid = $a[3], $a; while (scope !== false && scope !== nil && scope != null) { if (scope.$type()['$==']("iter")) { chain['$<<'](scope['$identify!']()); if ((($b = scope.$parent()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { scope = scope.$parent()}; } else if (scope.$type()['$==']("def")) { defn = scope['$identify!'](); mid = "'" + (scope.$mid()) + "'"; break;; } else { break; }}; return [chain, defn, mid]; }, TMP_36.$$arity = 0); Opal.defn(self, '$uses_block?', TMP_37 = function() { var self = this; return self.uses_block; }, TMP_37.$$arity = 0); Opal.defn(self, '$has_rescue_else?', TMP_38 = function() { var self = this; return self.$rescue_else_sexp()['$!']()['$!'](); }, TMP_38.$$arity = 0); Opal.defn(self, '$in_ensure', TMP_39 = function $$in_ensure() { var self = this, $iter = TMP_39.$$p, $yield = $iter || nil, result = nil; TMP_39.$$p = null; if (($yield !== nil)) { } else { return nil }; self.in_ensure = true; result = Opal.yieldX($yield, []); return self.in_ensure = false; }, TMP_39.$$arity = 0); return (Opal.defn(self, '$in_ensure?', TMP_40 = function() { var self = this; return self.in_ensure['$!']()['$!'](); }, TMP_40.$$arity = 0), nil) && 'in_ensure?'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/module"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$name_and_base', '$helper', '$push', '$line', '$in_scope', '$name=', '$scope', '$add_temp', '$proto', '$stmt', '$body', '$s', '$empty_line', '$to_vars', '$==', '$type', '$cid', '$to_s', '$[]', '$expr', '$raise']); self.$require("opal/nodes/scope"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ModuleNode(){}; var self = $ModuleNode = $klass($base, $super, 'ModuleNode', $ModuleNode); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; self.$handle("module"); self.$children("cid", "body"); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this, name = nil, base = nil; $b = self.$name_and_base(), $a = Opal.to_ary($b), name = ($a[0] == null ? nil : $a[0]), base = ($a[1] == null ? nil : $a[1]), $b; self.$helper("module"); self.$push("(function($base) {"); self.$line(" var $" + (name) + ", self = $" + (name) + " = $module($base, '" + (name) + "');"); ($a = ($b = self).$in_scope, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, $d, body_code = nil; (($c = [name]), $d = self.$scope(), $d['$name='].apply($d, $c), $c[$c.length-1]); self.$add_temp("" + (self.$scope().$proto()) + " = self.$$proto"); self.$add_temp("$scope = self.$$scope"); body_code = self.$stmt(((($c = self.$body()) !== false && $c !== nil && $c != null) ? $c : self.$s("nil"))); self.$empty_line(); self.$line(self.$scope().$to_vars()); return self.$line(body_code);}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); return self.$line("})(", base, ")"); }, TMP_2.$$arity = 0); return (Opal.defn(self, '$name_and_base', TMP_3 = function $$name_and_base() { var self = this; if (self.$cid().$type()['$==']("const")) { return [self.$cid()['$[]'](1).$to_s(), "$scope.base"] } else if (self.$cid().$type()['$==']("colon2")) { return [self.$cid()['$[]'](2).$to_s(), self.$expr(self.$cid()['$[]'](1))] } else if (self.$cid().$type()['$==']("colon3")) { return [self.$cid()['$[]'](1).$to_s(), "Opal.Object"] } else { return self.$raise("Bad receiver in module") }; }, TMP_3.$$arity = 0), nil) && 'name_and_base'; })($scope.base, $scope.get('ScopeNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/class"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$name_and_base', '$helper', '$push', '$line', '$in_scope', '$name=', '$scope', '$add_temp', '$proto', '$body_code', '$empty_line', '$to_vars', '$super_code', '$sup', '$expr', '$stmt', '$returns', '$compiler', '$body', '$s']); self.$require("opal/nodes/module"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ClassNode(){}; var self = $ClassNode = $klass($base, $super, 'ClassNode', $ClassNode); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4; self.$handle("class"); self.$children("cid", "sup", "body"); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this, name = nil, base = nil; $b = self.$name_and_base(), $a = Opal.to_ary($b), name = ($a[0] == null ? nil : $a[0]), base = ($a[1] == null ? nil : $a[1]), $b; self.$helper("klass"); self.$push("(function($base, $super) {"); self.$line(" function $" + (name) + "(){};"); self.$line(" var self = $" + (name) + " = $klass($base, $super, '" + (name) + "', $" + (name) + ");"); ($a = ($b = self).$in_scope, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, $d, body_code = nil; (($c = [name]), $d = self.$scope(), $d['$name='].apply($d, $c), $c[$c.length-1]); self.$add_temp("" + (self.$scope().$proto()) + " = self.$$proto"); self.$add_temp("$scope = self.$$scope"); body_code = self.$body_code(); self.$empty_line(); self.$line(self.$scope().$to_vars()); return self.$line(body_code);}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); return self.$line("})(", base, ", ", self.$super_code(), ")"); }, TMP_2.$$arity = 0); Opal.defn(self, '$super_code', TMP_3 = function $$super_code() { var $a, self = this; if ((($a = self.$sup()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(self.$sup()) } else { return "null" }; }, TMP_3.$$arity = 0); return (Opal.defn(self, '$body_code', TMP_4 = function $$body_code() { var $a, self = this; return self.$stmt(self.$compiler().$returns(((($a = self.$body()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil")))); }, TMP_4.$$arity = 0), nil) && 'body_code'; })($scope.base, $scope.get('ModuleNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/singleton_class"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$push', '$in_scope', '$add_temp', '$stmt', '$returns', '$compiler', '$body', '$line', '$to_vars', '$scope', '$recv', '$object']); self.$require("opal/nodes/scope"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $SingletonClassNode(){}; var self = $SingletonClassNode = $klass($base, $super, 'SingletonClassNode', $SingletonClassNode); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.$handle("sclass"); self.$children("object", "body"); return (Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this; self.$push("(function(self) {"); ($a = ($b = self).$in_scope, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, body_stmt = nil; self.$add_temp("$scope = self.$$scope"); self.$add_temp("def = self.$$proto"); body_stmt = self.$stmt(self.$compiler().$returns(self.$body())); self.$line(self.$scope().$to_vars()); return self.$line(body_stmt);}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); return self.$line("})(Opal.get_singleton_class(", self.$recv(self.$object()), "))"); }, TMP_2.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('ScopeNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/inline_args"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$push', '$join', '$arg_names', '$inject', '$type', '$===', '$<<', '$add_arg', '$next_temp', '$scope', '$[]=', '$mlhs_mapping', '$to_s', '$variable', '$[]', '$!', '$meta', '$!=', '$+', '$raise', '$inspect', '$children', '$to_sym']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $InlineArgs(){}; var self = $InlineArgs = $klass($base, $super, 'InlineArgs', $InlineArgs); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_4; self.$handle("inline_args"); Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this; return self.$push(self.$arg_names().$join(", ")); }, TMP_1.$$arity = 0); Opal.defn(self, '$arg_names', TMP_3 = function $$arg_names() { var $a, $b, TMP_2, self = this, done_kwargs = nil; done_kwargs = false; return ($a = ($b = self.$children()).$inject, $a.$$p = (TMP_2 = function(result, child){var self = TMP_2.$$s || this, $c, $d, $case = nil, tmp = nil, arg_name = nil, tmp_arg_name = nil; if (result == null) result = nil;if (child == null) child = nil; $case = child.$type();if ("kwarg"['$===']($case) || "kwoptarg"['$===']($case) || "kwrestarg"['$===']($case)) {if (done_kwargs !== false && done_kwargs !== nil && done_kwargs != null) { } else { done_kwargs = true; result['$<<']("$kwargs"); }; self.$add_arg(child);}else if ("mlhs"['$===']($case)) {tmp = self.$scope().$next_temp(); result['$<<'](tmp); self.$scope().$mlhs_mapping()['$[]='](child, tmp);}else if ("arg"['$===']($case) || "optarg"['$===']($case)) {arg_name = self.$variable(child['$[]'](1)).$to_s(); if ((($c = ($d = child.$meta()['$[]']("inline")['$!'](), $d !== false && $d !== nil && $d != null ?arg_name['$[]'](0)['$!=']("$") : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { arg_name = "$" + (arg_name)}; result['$<<'](arg_name); self.$add_arg(child);}else if ("restarg"['$===']($case)) {tmp_arg_name = $rb_plus(self.$scope().$next_temp(), "_rest"); result['$<<'](tmp_arg_name); self.$add_arg(child);}else {self.$raise("Unknown argument type " + (child.$inspect()))}; return result;}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $a).call($b, []); }, TMP_3.$$arity = 0); return (Opal.defn(self, '$add_arg', TMP_4 = function $$add_arg(arg) { var $a, self = this, arg_name = nil; if ((($a = arg['$[]'](1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { arg_name = self.$variable(arg['$[]'](1).$to_sym()); return self.$scope().$add_arg(arg_name); } else { return nil }; }, TMP_4.$$arity = 1), nil) && 'add_arg'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/normarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$to_sym', '$[]', '$variable', '$meta', '$add_temp', '$line', '$working_arguments', '$scope', '$in_mlhs?']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $NormargNode(){}; var self = $NormargNode = $klass($base, $super, 'NormargNode', $NormargNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.sexp = nil; self.$handle("arg"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var $a, self = this, arg_name = nil, var_name = nil; arg_name = self.sexp['$[]'](1).$to_sym(); var_name = self.$variable(arg_name); if ((($a = self.sexp.$meta()['$[]']("post")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$add_temp(var_name); self.$line("" + (var_name) + " = " + (self.$scope().$working_arguments()) + ".splice(0,1)[0];");}; if ((($a = self.$scope()['$in_mlhs?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$line("if (" + (var_name) + " == null) {"); self.$line(" " + (var_name) + " = nil;"); return self.$line("}"); } else { return nil }; }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/optarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$to_sym', '$[]', '$variable', '$==', '$line', '$expr', '$push']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $OptargNode(){}; var self = $OptargNode = $klass($base, $super, 'OptargNode', $OptargNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.sexp = nil; self.$handle("optarg"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this, optarg_name = nil, default_value = nil, var_name = nil; optarg_name = self.sexp['$[]'](1).$to_sym(); default_value = self.sexp['$[]'](2); var_name = self.$variable(optarg_name); if (default_value['$[]'](2)['$==']("undefined")) { return nil}; self.$line("if (" + (var_name) + " == null) {"); self.$line(" " + (var_name) + " = ", self.$expr(default_value)); self.$push(";"); return self.$line("}"); }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/mlhsarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$s', '$children', '$[]', '$meta', '$mlhs_name', '$[]=', '$with_inline_args', '$push', '$process', '$scope', '$mlhs_mapping', '$line', '$in_mlhs', '$each', '$type', '$===', '$<<', '$join', '$to_s', '$take_while', '$!=']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MlhsArgNode(){}; var self = $MlhsArgNode = $klass($base, $super, 'MlhsArgNode', $MlhsArgNode); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_6, TMP_8; def.sexp = def.mlhs_name = def.inline_args = nil; self.$handle("mlhs"); Opal.defn(self, '$compile', TMP_4 = function $$compile() { var $a, $b, $c, TMP_1, $d, TMP_2, self = this, args_sexp = nil, mlhs_sexp = nil, var_name = nil; args_sexp = ($a = self).$s.apply($a, ["post_args"].concat(Opal.to_a(self.$children()))); if ((($b = self.sexp.$meta()['$[]']("post")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { mlhs_sexp = self.$s("arg", self.$mlhs_name()); mlhs_sexp.$meta()['$[]=']("post", true); ($b = ($c = self.$scope()).$with_inline_args, $b.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; return self.$push(self.$process(mlhs_sexp))}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $b).call($c, []); var_name = args_sexp.$meta()['$[]=']("js_source", self.$mlhs_name()); } else { var_name = args_sexp.$meta()['$[]=']("js_source", self.$scope().$mlhs_mapping()['$[]'](self.sexp)) }; self.$line("if (" + (var_name) + " == null) {"); self.$line(" " + (var_name) + " = nil;"); self.$line("}"); self.$line("" + (var_name) + " = Opal.to_ary(" + (var_name) + ");"); return ($b = ($d = self.$scope()).$with_inline_args, $b.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $e, $f, TMP_3; return ($e = ($f = self.$scope()).$in_mlhs, $e.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return self.$push(self.$process(args_sexp))}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $e).call($f)}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $b).call($d, []); }, TMP_4.$$arity = 0); Opal.defn(self, '$mlhs_name', TMP_6 = function $$mlhs_name() { var $a, $b, $c, TMP_5, self = this, result = nil; return ((($a = self.mlhs_name) !== false && $a !== nil && $a != null) ? $a : self.mlhs_name = (function() {if ((($b = self.sexp.$meta()['$[]']("post")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result = ["$mlhs_of"]; ($b = ($c = self.$children()).$each, $b.$$p = (TMP_5 = function(child){var self = TMP_5.$$s || this, $case = nil; if (child == null) child = nil; return (function() {$case = child.$type();if ("arg"['$===']($case)) {return result['$<<'](child['$[]'](1))}else if ("mlhs"['$===']($case)) {return result['$<<']("mlhs")}else { return nil }})()}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $b).call($c); return result.$join("_"); } else { return self.sexp['$[]'](1).$to_s() }; return nil; })()); }, TMP_6.$$arity = 0); return (Opal.defn(self, '$inline_args', TMP_8 = function $$inline_args() { var $a, $b, $c, TMP_7, self = this; return ((($a = self.inline_args) !== false && $a !== nil && $a != null) ? $a : self.inline_args = ($b = ($c = self.$children()).$take_while, $b.$$p = (TMP_7 = function(arg){var self = TMP_7.$$s || this, $d; if (arg == null) arg = nil; return ($d = arg.$type()['$!=']("restarg"), $d !== false && $d !== nil && $d != null ?arg.$type()['$!=']("optarg") : $d)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $b).call($c)); }, TMP_8.$$arity = 0), nil) && 'inline_args'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/restarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$[]', '$variable', '$to_sym', '$add_temp', '$meta', '$line', '$working_arguments', '$scope']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $RestargNode(){}; var self = $RestargNode = $klass($base, $super, 'RestargNode', $RestargNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.sexp = nil; self.$handle("restarg"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var $a, self = this, restarg_name = nil, var_name = nil, offset = nil; restarg_name = self.sexp['$[]'](1); if (restarg_name !== false && restarg_name !== nil && restarg_name != null) { } else { return nil }; var_name = self.$variable(restarg_name.$to_sym()); self.$add_temp(var_name); if ((($a = self.sexp.$meta()['$[]']("post")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$line("" + (var_name) + " = " + (self.$scope().$working_arguments()) + ";") } else { offset = self.sexp.$meta()['$[]']("offset"); self.$line("var $args_len = arguments.length, $rest_len = $args_len - " + (offset) + ";"); self.$line("if ($rest_len < 0) { $rest_len = 0; }"); self.$line("" + (var_name) + " = new Array($rest_len);"); self.$line("for (var $arg_idx = " + (offset) + "; $arg_idx < $args_len; $arg_idx++) {"); self.$line(" " + (var_name) + "[$arg_idx - " + (offset) + "] = arguments[$arg_idx];"); return self.$line("}"); }; }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/initialize_kwargs"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$kwargs_initialized', '$scope', '$helper', '$line', '$kwargs_initialized=']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $InitializeKwargsNode(){}; var self = $InitializeKwargsNode = $klass($base, $super, 'InitializeKwargsNode', $InitializeKwargsNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$initialize_kw_args_if_needed', TMP_1 = function $$initialize_kw_args_if_needed() { var $a, $b, self = this; if ((($a = self.$scope().$kwargs_initialized()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; self.$helper("hash2"); self.$line("if ($kwargs == null || !$kwargs.$$is_hash) {"); self.$line(" if ($kwargs == null) {"); self.$line(" $kwargs = $hash2([], {});"); self.$line(" } else {"); self.$line(" throw Opal.ArgumentError.$new('expected kwargs');"); self.$line(" }"); self.$line("}"); return (($a = [true]), $b = self.$scope(), $b['$kwargs_initialized='].apply($b, $a), $a[$a.length-1]); }, TMP_1.$$arity = 0), nil) && 'initialize_kw_args_if_needed' })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/kwarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$initialize_kw_args_if_needed', '$to_sym', '$[]', '$variable', '$add_temp', '$line', '$<<', '$used_kwargs', '$scope']); self.$require("opal/nodes/args/initialize_kwargs"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $KwargNode(){}; var self = $KwargNode = $klass($base, $super, 'KwargNode', $KwargNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.sexp = nil; self.$handle("kwarg"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this, kwarg_name = nil, var_name = nil; self.$initialize_kw_args_if_needed(); kwarg_name = self.sexp['$[]'](1).$to_sym(); var_name = self.$variable(kwarg_name); self.$add_temp(var_name); self.$line("if (!$kwargs.$$smap.hasOwnProperty('" + (kwarg_name) + "')) {"); self.$line(" throw Opal.ArgumentError.$new('missing keyword: " + (kwarg_name) + "');"); self.$line("}"); self.$line("" + (var_name) + " = $kwargs.$$smap['" + (kwarg_name) + "'];"); return self.$scope().$used_kwargs()['$<<'](kwarg_name); }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('InitializeKwargsNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/kwoptarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$initialize_kw_args_if_needed', '$to_sym', '$[]', '$variable', '$add_temp', '$line', '$expr', '$<<', '$used_kwargs', '$scope']); self.$require("opal/nodes/args/initialize_kwargs"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $KwoptArgNode(){}; var self = $KwoptArgNode = $klass($base, $super, 'KwoptArgNode', $KwoptArgNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.sexp = nil; self.$handle("kwoptarg"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this, kwoptarg_name = nil, default_value = nil, var_name = nil; self.$initialize_kw_args_if_needed(); kwoptarg_name = self.sexp['$[]'](1).$to_sym(); default_value = self.sexp['$[]'](2); var_name = self.$variable(kwoptarg_name); self.$add_temp(var_name); self.$line("if ((" + (var_name) + " = $kwargs.$$smap['" + (kwoptarg_name) + "']) == null) {"); self.$line(" " + (var_name) + " = ", self.$expr(default_value)); self.$line("}"); return self.$scope().$used_kwargs()['$<<'](kwoptarg_name); }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('InitializeKwargsNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/kwrestarg"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$initialize_kw_args_if_needed', '$[]', '$used_kwargs', '$variable', '$to_sym', '$add_temp', '$line', '$map', '$scope', '$join']); self.$require("opal/nodes/args/initialize_kwargs"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $KwrestArgNode(){}; var self = $KwrestArgNode = $klass($base, $super, 'KwrestArgNode', $KwrestArgNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3; def.sexp = nil; self.$handle("kwrestarg"); Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this, kwrestarg_name = nil, extract_code = nil, var_name = nil; self.$initialize_kw_args_if_needed(); kwrestarg_name = self.sexp['$[]'](1); extract_code = "Opal.kwrestargs($kwargs, " + (self.$used_kwargs()) + ");"; if (kwrestarg_name !== false && kwrestarg_name !== nil && kwrestarg_name != null) { var_name = self.$variable(kwrestarg_name.$to_sym()); self.$add_temp(var_name); return self.$line("" + (var_name) + " = " + (extract_code)); } else { return nil }; }, TMP_1.$$arity = 0); return (Opal.defn(self, '$used_kwargs', TMP_3 = function $$used_kwargs() { var $a, $b, TMP_2, self = this, args = nil; args = ($a = ($b = self.$scope().$used_kwargs()).$map, $a.$$p = (TMP_2 = function(arg_name){var self = TMP_2.$$s || this; if (arg_name == null) arg_name = nil; return "'" + (arg_name) + "': true"}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); return "{" + (args.$join(",")) + "}"; }, TMP_3.$$arity = 0), nil) && 'used_kwargs'; })($scope.base, $scope.get('InitializeKwargsNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/post_kwargs"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$empty?', '$children', '$initialize_kw_args', '$each', '$push', '$process', '$line', '$working_arguments', '$scope']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $PostKwargsNode(){}; var self = $PostKwargsNode = $klass($base, $super, 'PostKwargsNode', $PostKwargsNode); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; self.$handle("post_kwargs"); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this; if ((($a = self.$children()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; self.$initialize_kw_args(); return ($a = ($b = self.$children()).$each, $a.$$p = (TMP_1 = function(arg){var self = TMP_1.$$s || this; if (arg == null) arg = nil; return self.$push(self.$process(arg))}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); }, TMP_2.$$arity = 0); return (Opal.defn(self, '$initialize_kw_args', TMP_3 = function $$initialize_kw_args() { var self = this; return self.$line("$kwargs = Opal.extract_kwargs(" + (self.$scope().$working_arguments()) + ");"); }, TMP_3.$$arity = 0), nil) && 'initialize_kw_args'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/args/post_args"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$attr_reader', '$each', '$[]=', '$meta', '$type', '$===', '$<<', '$children', '$empty?', '$working_arguments', '$scope', '$[]', '$working_arguments=', '$add_temp', '$line', '$size', '$inline_args', '$extract_arguments', '$push', '$process', '$kwargs_sexp', '$compile_required_arg', '$required_left_args', '$compile_optarg', '$optargs', '$compile_restarg', '$required_right_args', '$variable', '$to_sym', '$indent', '$restarg', '$extract_restarg', '$extract_blank_restarg', '$s', '$kwargs']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $PostArgsNode(){}; var self = $PostArgsNode = $klass($base, $super, 'PostArgsNode', $PostArgsNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_7, TMP_9, TMP_10, TMP_13, TMP_14, TMP_15, TMP_16; def.sexp = nil; self.$handle("post_args"); self.$attr_reader("kwargs"); self.$attr_reader("required_left_args"); self.$attr_reader("optargs"); self.$attr_reader("restarg"); self.$attr_reader("required_right_args"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize($a_rest) { var $b, $c, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } ($b = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $b.$$p = $iter, $b).apply($c, $zuper); self.kwargs = []; self.required_left_args = []; self.optargs = []; self.restarg = nil; return self.required_right_args = []; }, TMP_1.$$arity = -1); Opal.defn(self, '$extract_arguments', TMP_3 = function $$extract_arguments() { var $a, $b, TMP_2, self = this, found_opt_or_rest = nil; found_opt_or_rest = false; return ($a = ($b = self.$children()).$each, $a.$$p = (TMP_2 = function(arg){var self = TMP_2.$$s || this, $case = nil; if (self.kwargs == null) self.kwargs = nil; if (self.optargs == null) self.optargs = nil; if (self.required_right_args == null) self.required_right_args = nil; if (self.required_left_args == null) self.required_left_args = nil; if (arg == null) arg = nil; arg.$meta()['$[]=']("post", true); return (function() {$case = arg.$type();if ("kwarg"['$===']($case) || "kwoptarg"['$===']($case) || "kwrestarg"['$===']($case)) {return self.kwargs['$<<'](arg)}else if ("restarg"['$===']($case)) {self.restarg = arg; return found_opt_or_rest = true;}else if ("optarg"['$===']($case)) {self.optargs['$<<'](arg); return found_opt_or_rest = true;}else if ("arg"['$===']($case) || "mlhs"['$===']($case)) {if (found_opt_or_rest !== false && found_opt_or_rest !== nil && found_opt_or_rest != null) { return self.required_right_args['$<<'](arg) } else { return self.required_left_args['$<<'](arg) }}else { return nil }})();}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); }, TMP_3.$$arity = 0); Opal.defn(self, '$compile', TMP_7 = function $$compile() { var $a, $b, TMP_4, $c, TMP_5, $d, TMP_6, $e, self = this, old_working_arguments = nil, js_source = nil; if ((($a = self.$children()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; old_working_arguments = self.$scope().$working_arguments(); if ((($a = self.sexp.$meta()['$[]']("js_source")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { js_source = self.sexp.$meta()['$[]']("js_source"); (($a = ["" + (js_source) + "_args"]), $b = self.$scope(), $b['$working_arguments='].apply($b, $a), $a[$a.length-1]); } else { js_source = "arguments"; (($a = ["$post_args"]), $b = self.$scope(), $b['$working_arguments='].apply($b, $a), $a[$a.length-1]); }; self.$add_temp("" + (self.$scope().$working_arguments())); self.$line("" + (self.$scope().$working_arguments()) + " = Opal.slice.call(" + (js_source) + ", " + (self.$scope().$inline_args().$size()) + ", " + (js_source) + ".length);"); self.$extract_arguments(); self.$push(self.$process(self.$kwargs_sexp())); ($a = ($b = self.$required_left_args()).$each, $a.$$p = (TMP_4 = function(arg){var self = TMP_4.$$s || this; if (arg == null) arg = nil; return self.$compile_required_arg(arg)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b); ($a = ($c = self.$optargs()).$each, $a.$$p = (TMP_5 = function(optarg){var self = TMP_5.$$s || this; if (optarg == null) optarg = nil; return self.$compile_optarg(optarg)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($c); self.$compile_restarg(); ($a = ($d = self.$required_right_args()).$each, $a.$$p = (TMP_6 = function(arg){var self = TMP_6.$$s || this; if (arg == null) arg = nil; return self.$compile_required_arg(arg)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($d); return (($a = [old_working_arguments]), $e = self.$scope(), $e['$working_arguments='].apply($e, $a), $a[$a.length-1]); }, TMP_7.$$arity = 0); Opal.defn(self, '$compile_optarg', TMP_9 = function $$compile_optarg(optarg) { var $a, $b, TMP_8, self = this, var_name = nil; var_name = self.$variable(optarg['$[]'](1).$to_sym()); self.$add_temp(var_name); self.$line("if (" + (self.$required_right_args().$size()) + " < " + (self.$scope().$working_arguments()) + ".length) {"); ($a = ($b = self).$indent, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this; return self.$line("" + (var_name) + " = " + (self.$scope().$working_arguments()) + ".splice(0,1)[0];")}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $a).call($b); self.$line("}"); return self.$push(self.$process(optarg)); }, TMP_9.$$arity = 1); Opal.defn(self, '$compile_required_arg', TMP_10 = function $$compile_required_arg(arg) { var self = this; return self.$push(self.$process(arg)); }, TMP_10.$$arity = 1); Opal.defn(self, '$compile_restarg', TMP_13 = function $$compile_restarg() { var $a, $b, TMP_11, $c, TMP_12, self = this; if ((($a = self.$restarg()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; self.$line("if (" + (self.$required_right_args().$size()) + " < " + (self.$scope().$working_arguments()) + ".length) {"); ($a = ($b = self).$indent, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this; return self.$extract_restarg()}, TMP_11.$$s = self, TMP_11.$$arity = 0, TMP_11), $a).call($b); self.$line("} else {"); ($a = ($c = self).$indent, $a.$$p = (TMP_12 = function(){var self = TMP_12.$$s || this; return self.$extract_blank_restarg()}, TMP_12.$$s = self, TMP_12.$$arity = 0, TMP_12), $a).call($c); return self.$line("}"); }, TMP_13.$$arity = 0); Opal.defn(self, '$extract_restarg', TMP_14 = function $$extract_restarg() { var $a, self = this, extract_code = nil, var_name = nil; extract_code = "" + (self.$scope().$working_arguments()) + ".splice(0, " + (self.$scope().$working_arguments()) + ".length - " + (self.$required_right_args().$size()) + ");"; if ((($a = self.$restarg()['$[]'](1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { var_name = self.$variable(self.$restarg()['$[]'](1).$to_sym()); self.$add_temp(var_name); return self.$line("" + (var_name) + " = " + (extract_code)); } else { return self.$line(extract_code) }; }, TMP_14.$$arity = 0); Opal.defn(self, '$extract_blank_restarg', TMP_15 = function $$extract_blank_restarg() { var $a, self = this, var_name = nil; if ((($a = self.$restarg()['$[]'](1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { var_name = self.$variable(self.$restarg()['$[]'](1).$to_sym()); self.$add_temp(var_name); return self.$line("" + (var_name) + " = [];"); } else { return nil }; }, TMP_15.$$arity = 0); return (Opal.defn(self, '$kwargs_sexp', TMP_16 = function $$kwargs_sexp() { var $a, self = this; return ($a = self).$s.apply($a, ["post_kwargs"].concat(Opal.to_a(self.$kwargs()))); }, TMP_16.$$arity = 0), nil) && 'kwargs_sexp'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/node_with_args"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $range = Opal.range; Opal.add_stubs(['$require', '$attr_accessor', '$attr_writer', '$attr_reader', '$[]', '$args', '$each_with_index', '$==', '$-', '$length', '$type', '$===', '$<<', '$any?', '$!=', '$each', '$[]=', '$meta', '$inline_args', '$optimize_args!', '$select', '$first', '$find', '$include?', '$s', '$post_args', '$push', '$process', '$post_args_sexp', '$uses_block?', '$scope', '$identity', '$block_name', '$add_temp', '$line', '$inline_args=', '$pop', '$keyword_args', '$all?', '$rest_arg', '$opt_args', '$has_only_optional_kwargs?', '$negative_arity', '$positive_arity', '$children', '$size', '$has_required_kwargs?', '$+', '$-@', '$map', '$build_parameter', '$block_arg', '$join', '$!', '$empty?', '$<', '$>']); self.$require("opal/nodes/scope"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $NodeWithArgs(){}; var self = $NodeWithArgs = $klass($base, $super, 'NodeWithArgs', $NodeWithArgs); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_5, TMP_7, TMP_9, TMP_11, TMP_12, TMP_13, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_23, TMP_25, TMP_26, TMP_28, TMP_29, TMP_30, TMP_32, TMP_33; def.opt_args = def.rest_arg = def.keyword_args = def.in_mlhs = def.arity_checks = nil; self.$attr_accessor("mlhs_args"); self.$attr_accessor("used_kwargs"); self.$attr_accessor("mlhs_mapping"); self.$attr_accessor("working_arguments"); self.$attr_writer("inline_args"); self.$attr_accessor("kwargs_initialized"); self.$attr_reader("inline_args", "post_args"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize($a_rest) { var $b, $c, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } ($b = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $b.$$p = $iter, $b).apply($c, $zuper); self.mlhs_args = $hash2([], {}); self.used_kwargs = []; self.mlhs_mapping = $hash2([], {}); self.working_arguments = nil; self.in_mlhs = false; self.kwargs_initialized = false; self.inline_args = []; self.post_args = []; return self.post_args_started = false; }, TMP_1.$$arity = -1); Opal.defn(self, '$split_args', TMP_5 = function $$split_args() { var $a, $b, TMP_2, $c, TMP_4, self = this, args = nil; args = self.$args()['$[]']($range(1, -1, false)); ($a = ($b = args).$each_with_index, $a.$$p = (TMP_2 = function(arg, idx){var self = TMP_2.$$s || this, $c, $d, $e, TMP_3, last_argument = nil, $case = nil; if (self.post_args_started == null) self.post_args_started = nil; if (self.post_args == null) self.post_args = nil; if (self.inline_args == null) self.inline_args = nil; if (arg == null) arg = nil;if (idx == null) idx = nil; last_argument = (idx['$==']($rb_minus(args.$length(), 1))); return (function() {$case = arg.$type();if ("arg"['$===']($case) || "mlhs"['$===']($case) || "kwarg"['$===']($case) || "kwoptarg"['$===']($case) || "kwrestarg"['$===']($case)) {if ((($c = self.post_args_started) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.post_args['$<<'](arg) } else { return self.inline_args['$<<'](arg) }}else if ("restarg"['$===']($case)) {self.post_args_started = true; return self.post_args['$<<'](arg);}else if ("optarg"['$===']($case)) {if ((($c = ($d = ($e = args['$[]'](idx, args.$length()))['$any?'], $d.$$p = (TMP_3 = function(next_arg){var self = TMP_3.$$s || this, $f; if (next_arg == null) next_arg = nil; return ($f = next_arg.$type()['$!=']("optarg"), $f !== false && $f !== nil && $f != null ?next_arg.$type()['$!=']("restarg") : $f)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $d).call($e)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.post_args_started = true}; if ((($c = self.post_args_started) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.post_args['$<<'](arg) } else { return self.inline_args['$<<'](arg) };}else { return nil }})();}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $a).call($b); ($a = ($c = self.$inline_args()).$each, $a.$$p = (TMP_4 = function(inline_arg){var self = TMP_4.$$s || this; if (inline_arg == null) inline_arg = nil; return inline_arg.$meta()['$[]=']("inline", true)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($c); return self['$optimize_args!'](); }, TMP_5.$$arity = 0); Opal.defn(self, '$opt_args', TMP_7 = function $$opt_args() { var $a, $b, $c, TMP_6, self = this; return ((($a = self.opt_args) !== false && $a !== nil && $a != null) ? $a : self.opt_args = ($b = ($c = self.$args()['$[]']($range(1, -1, false))).$select, $b.$$p = (TMP_6 = function(arg){var self = TMP_6.$$s || this; if (arg == null) arg = nil; return arg.$first()['$==']("optarg")}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $b).call($c)); }, TMP_7.$$arity = 0); Opal.defn(self, '$rest_arg', TMP_9 = function $$rest_arg() { var $a, $b, $c, TMP_8, self = this; return ((($a = self.rest_arg) !== false && $a !== nil && $a != null) ? $a : self.rest_arg = ($b = ($c = self.$args()['$[]']($range(1, -1, false))).$find, $b.$$p = (TMP_8 = function(arg){var self = TMP_8.$$s || this; if (arg == null) arg = nil; return arg.$first()['$==']("restarg")}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $b).call($c)); }, TMP_9.$$arity = 0); Opal.defn(self, '$keyword_args', TMP_11 = function $$keyword_args() { var $a, $b, $c, TMP_10, self = this; return ((($a = self.keyword_args) !== false && $a !== nil && $a != null) ? $a : self.keyword_args = ($b = ($c = self.$args()['$[]']($range(1, -1, false))).$select, $b.$$p = (TMP_10 = function(arg){var self = TMP_10.$$s || this; if (arg == null) arg = nil; return ["kwarg", "kwoptarg", "kwrestarg"]['$include?'](arg.$first())}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $b).call($c)); }, TMP_11.$$arity = 0); Opal.defn(self, '$inline_args_sexp', TMP_12 = function $$inline_args_sexp() { var $a, self = this; return ($a = self).$s.apply($a, ["inline_args"].concat(Opal.to_a(self.$args()['$[]']($range(1, -1, false))))); }, TMP_12.$$arity = 0); Opal.defn(self, '$post_args_sexp', TMP_13 = function $$post_args_sexp() { var $a, self = this; return ($a = self).$s.apply($a, ["post_args"].concat(Opal.to_a(self.$post_args()))); }, TMP_13.$$arity = 0); Opal.defn(self, '$compile_inline_args', TMP_15 = function $$compile_inline_args() { var $a, $b, TMP_14, self = this; return ($a = ($b = self.$inline_args()).$each, $a.$$p = (TMP_14 = function(inline_arg){var self = TMP_14.$$s || this; if (inline_arg == null) inline_arg = nil; return self.$push(self.$process(inline_arg))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_15.$$arity = 0); Opal.defn(self, '$compile_post_args', TMP_16 = function $$compile_post_args() { var self = this; return self.$push(self.$process(self.$post_args_sexp())); }, TMP_16.$$arity = 0); Opal.defn(self, '$compile_block_arg', TMP_17 = function $$compile_block_arg() { var $a, self = this, scope_name = nil, yielder = nil; if ((($a = self.$scope()['$uses_block?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { scope_name = self.$scope().$identity(); yielder = self.$scope().$block_name(); self.$add_temp("$iter = " + (scope_name) + ".$$p"); self.$add_temp("" + (yielder) + " = $iter || nil"); return self.$line("" + (scope_name) + ".$$p = null;"); } else { return nil }; }, TMP_17.$$arity = 0); Opal.defn(self, '$with_inline_args', TMP_18 = function $$with_inline_args(args) { var $a, $b, self = this, $iter = TMP_18.$$p, $yield = $iter || nil, old_inline_args = nil; TMP_18.$$p = null; old_inline_args = self.$inline_args(); (($a = [args]), $b = self, $b['$inline_args='].apply($b, $a), $a[$a.length-1]); Opal.yieldX($yield, []); return (($a = [old_inline_args]), $b = self, $b['$inline_args='].apply($b, $a), $a[$a.length-1]); }, TMP_18.$$arity = 1); Opal.defn(self, '$in_mlhs', TMP_19 = function $$in_mlhs() { var self = this, $iter = TMP_19.$$p, $yield = $iter || nil, old_mlhs = nil; TMP_19.$$p = null; old_mlhs = self.in_mlhs; self.in_mlhs = true; Opal.yieldX($yield, []); return self.in_mlhs = old_mlhs; }, TMP_19.$$arity = 0); Opal.defn(self, '$in_mlhs?', TMP_20 = function() { var self = this; return self.in_mlhs; }, TMP_20.$$arity = 0); Opal.defn(self, '$optimize_args!', TMP_21 = function() { var $a, $b, self = this, rest_arg = nil; if ((($a = (($b = self.$post_args().$length()['$=='](1)) ? self.$post_args().$first().$type()['$==']("restarg") : self.$post_args().$length()['$=='](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { rest_arg = self.$post_args().$pop(); rest_arg.$meta()['$[]=']("offset", self.$inline_args().$length()); return self.$inline_args()['$<<'](rest_arg); } else { return nil }; }, TMP_21.$$arity = 0); Opal.defn(self, '$has_only_optional_kwargs?', TMP_23 = function() { var $a, $b, $c, TMP_22, self = this; return ($a = self.$keyword_args()['$any?'](), $a !== false && $a !== nil && $a != null ?($b = ($c = self.$keyword_args())['$all?'], $b.$$p = (TMP_22 = function(arg){var self = TMP_22.$$s || this; if (arg == null) arg = nil; return ["kwoptarg", "kwrestarg"]['$include?'](arg.$type())}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $b).call($c) : $a); }, TMP_23.$$arity = 0); Opal.defn(self, '$has_required_kwargs?', TMP_25 = function() { var $a, $b, TMP_24, self = this; return ($a = ($b = self.$keyword_args())['$any?'], $a.$$p = (TMP_24 = function(arg){var self = TMP_24.$$s || this; if (arg == null) arg = nil; return arg.$type()['$==']("kwarg")}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24), $a).call($b); }, TMP_25.$$arity = 0); Opal.defn(self, '$arity', TMP_26 = function $$arity() { var $a, $b, $c, self = this; if ((($a = ((($b = ((($c = self.$rest_arg()) !== false && $c !== nil && $c != null) ? $c : self.$opt_args()['$any?']())) !== false && $b !== nil && $b != null) ? $b : self['$has_only_optional_kwargs?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$negative_arity() } else { return self.$positive_arity() }; }, TMP_26.$$arity = 0); Opal.defn(self, '$negative_arity', TMP_28 = function $$negative_arity() { var $a, $b, TMP_27, self = this, required_plain_args = nil, result = nil; required_plain_args = ($a = ($b = self.$args().$children()).$select, $a.$$p = (TMP_27 = function(arg){var self = TMP_27.$$s || this; if (arg == null) arg = nil; return ["arg", "mlhs"]['$include?'](arg.$type())}, TMP_27.$$s = self, TMP_27.$$arity = 1, TMP_27), $a).call($b); result = required_plain_args.$size(); if ((($a = self['$has_required_kwargs?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, 1)}; result = $rb_minus(result['$-@'](), 1); return result; }, TMP_28.$$arity = 0); Opal.defn(self, '$positive_arity', TMP_29 = function $$positive_arity() { var $a, self = this, result = nil; result = $rb_minus(self.$args().$size(), 1); result = $rb_minus(result, self.$keyword_args().$size()); if ((($a = self.$keyword_args()['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, 1)}; return result; }, TMP_29.$$arity = 0); Opal.defn(self, '$build_parameter', TMP_30 = function $$build_parameter(parameter_type, parameter_name) { var self = this; if (parameter_name !== false && parameter_name !== nil && parameter_name != null) { return "['" + (parameter_type) + "', '" + (parameter_name) + "']" } else { return "['" + (parameter_type) + "']" }; }, TMP_30.$$arity = 2); Opal.cdecl($scope, 'SEXP_TO_PARAMETERS', $hash2(["arg", "mlhs", "optarg", "restarg", "kwarg", "kwoptarg", "kwrestarg"], {"arg": "req", "mlhs": "req", "optarg": "opt", "restarg": "rest", "kwarg": "keyreq", "kwoptarg": "key", "kwrestarg": "keyrest"})); Opal.defn(self, '$parameters_code', TMP_32 = function $$parameters_code() { var $a, $b, TMP_31, self = this, stringified_parameters = nil; stringified_parameters = ($a = ($b = self.$args().$children()).$map, $a.$$p = (TMP_31 = function(arg){var self = TMP_31.$$s || this, value = nil; if (arg == null) arg = nil; value = (function() {if (arg.$type()['$==']("mlhs")) { return nil } else { return arg['$[]'](1) }; return nil; })(); return self.$build_parameter($scope.get('SEXP_TO_PARAMETERS')['$[]'](arg.$type()), value);}, TMP_31.$$s = self, TMP_31.$$arity = 1, TMP_31), $a).call($b); if ((($a = self.$block_arg()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { stringified_parameters['$<<']("['block', '" + (self.$block_arg()) + "']")}; return "[" + (stringified_parameters.$join(", ")) + "]"; }, TMP_32.$$arity = 0); return (Opal.defn(self, '$arity_checks', TMP_33 = function $$arity_checks() { var $a, $b, $c, self = this, arity = nil, aritycode = nil, min_arity = nil, max_arity = nil; if ((($a = self.arity_checks) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.arity_checks}; arity = $rb_minus(self.$args().$size(), 1); arity = $rb_minus(arity, (self.$opt_args().$size())); if ((($a = self.$rest_arg()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { arity = $rb_minus(arity, 1)}; arity = $rb_minus(arity, (self.$keyword_args().$size())); if ((($a = ((($b = ((($c = self.$opt_args()['$empty?']()['$!']()) !== false && $c !== nil && $c != null) ? $c : self.$keyword_args()['$empty?']()['$!']())) !== false && $b !== nil && $b != null) ? $b : self.$rest_arg())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { arity = $rb_minus(arity['$-@'](), 1)}; aritycode = "var $arity = arguments.length;"; self.arity_checks = []; if ((($a = $rb_lt(arity, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { min_arity = ($rb_plus(arity, 1))['$-@'](); max_arity = $rb_minus(self.$args().$size(), 1); if ((($a = $rb_gt(min_arity, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.arity_checks['$<<']("$arity < " + (min_arity))}; if ((($a = (($b = max_arity !== false && max_arity !== nil && max_arity != null) ? (self.$rest_arg())['$!']() : max_arity)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.arity_checks['$<<']("$arity > " + (max_arity))}; } else { self.arity_checks['$<<']("$arity !== " + (arity)) }; return self.arity_checks; }, TMP_33.$$arity = 0), nil) && 'arity_checks'; })($scope.base, $scope.get('ScopeNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/iter"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$attr_accessor', '$extract_block_arg', '$extract_shadow_args', '$split_args', '$in_scope', '$process', '$inline_args_sexp', '$identify!', '$scope', '$add_temp', '$compile_block_arg', '$compile_shadow_args', '$compile_inline_args', '$compile_post_args', '$compile_norm_args', '$arity_check?', '$compiler', '$compile_arity_check', '$stmt', '$body', '$to_vars', '$line', '$unshift', '$push', '$has_break?', '$arity', '$parameters_code', '$has_top_level_mlhs_arg?', '$has_trailing_comma_in_args?', '$select', '$==', '$type', '$[]', '$args', '$each', '$variable', '$norm_args', '$block_arg', '$to_s', '$block_name=', '$is_a?', '$last', '$block_arg=', '$to_sym', '$pop', '$add_local', '$shadow_args', '$each_with_index', '$<<', '$delete', '$===', '$args_sexp', '$nil?', '$s', '$delete_at', '$returns', '$body_sexp', '$keys', '$mlhs_mapping', '$any?', '$meta', '$>', '$size', '$arity_checks', '$!', '$top?', '$def?', '$class_scope?', '$parent', '$mid', '$class?', '$name', '$module?', '$identity', '$join']); self.$require("opal/nodes/node_with_args"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $IterNode(){}; var self = $IterNode = $klass($base, $super, 'IterNode', $IterNode); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_4, TMP_6, TMP_7, TMP_8, TMP_10, TMP_12, TMP_14, TMP_15, TMP_16, TMP_18, TMP_19, TMP_20; def.norm_args = nil; self.$handle("iter"); self.$children("args_sexp", "body_sexp"); self.$attr_accessor("block_arg", "shadow_args"); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this, inline_params = nil, to_vars = nil, identity = nil, body_code = nil; inline_params = nil; self.$extract_block_arg(); self.$extract_shadow_args(); self.$split_args(); to_vars = identity = body_code = nil; ($a = ($b = self).$in_scope, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c; inline_params = self.$process(self.$inline_args_sexp()); identity = self.$scope()['$identify!'](); self.$add_temp("self = " + (identity) + ".$$s || this"); self.$compile_block_arg(); self.$compile_shadow_args(); self.$compile_inline_args(); self.$compile_post_args(); self.$compile_norm_args(); if ((($c = self.$compiler()['$arity_check?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$compile_arity_check()}; body_code = self.$stmt(self.$body()); return to_vars = self.$scope().$to_vars();}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); self.$line(body_code); self.$unshift(to_vars); self.$unshift("(" + (identity) + " = function(", inline_params, "){"); self.$push("}, " + (identity) + ".$$s = self,"); if ((($a = self.$compiler()['$has_break?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(" " + (identity) + ".$$brk = $brk,")}; self.$push(" " + (identity) + ".$$arity = " + (self.$arity()) + ","); if ((($a = self.$compiler()['$arity_check?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(" " + (identity) + ".$$parameters = " + (self.$parameters_code()) + ",")}; if ((($a = self['$has_top_level_mlhs_arg?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(" " + (identity) + ".$$has_top_level_mlhs_arg = true,")}; if ((($a = self['$has_trailing_comma_in_args?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(" " + (identity) + ".$$has_trailing_comma_in_args = true,")}; return self.$push(" " + (identity) + ")"); }, TMP_2.$$arity = 0); Opal.defn(self, '$norm_args', TMP_4 = function $$norm_args() { var $a, $b, $c, TMP_3, self = this; return ((($a = self.norm_args) !== false && $a !== nil && $a != null) ? $a : self.norm_args = ($b = ($c = self.$args()['$[]']($range(1, -1, false))).$select, $b.$$p = (TMP_3 = function(arg){var self = TMP_3.$$s || this; if (arg == null) arg = nil; return arg.$type()['$==']("arg")}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $b).call($c)); }, TMP_4.$$arity = 0); Opal.defn(self, '$compile_norm_args', TMP_6 = function $$compile_norm_args() { var $a, $b, TMP_5, self = this; return ($a = ($b = self.$norm_args()).$each, $a.$$p = (TMP_5 = function(arg){var self = TMP_5.$$s || this; if (arg == null) arg = nil; arg = self.$variable(arg['$[]'](1)); return self.$push("if (" + (arg) + " == null) " + (arg) + " = nil;");}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($b); }, TMP_6.$$arity = 0); Opal.defn(self, '$compile_block_arg', TMP_7 = function $$compile_block_arg() { var $a, $b, self = this, block_arg = nil, scope_name = nil; if ((($a = self.$block_arg()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block_arg = self.$variable(self.$block_arg().$to_s()); (($a = [block_arg]), $b = self.$scope(), $b['$block_name='].apply($b, $a), $a[$a.length-1]); self.$scope().$add_temp(block_arg); scope_name = self.$scope()['$identify!'](); return self.$line("" + (block_arg) + " = " + (scope_name) + ".$$p || nil, " + (scope_name) + ".$$p = null;"); } else { return nil }; }, TMP_7.$$arity = 0); Opal.defn(self, '$extract_block_arg', TMP_8 = function $$extract_block_arg() { var $a, $b, $c, self = this; if ((($a = ($b = ($c = self.$args()['$is_a?']($scope.get('Sexp')), $c !== false && $c !== nil && $c != null ?self.$args().$last()['$is_a?']($scope.get('Sexp')) : $c), $b !== false && $b !== nil && $b != null ?self.$args().$last().$type()['$==']("block_pass") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($a = [self.$args().$pop()['$[]'](1)['$[]'](1).$to_sym()]), $b = self, $b['$block_arg='].apply($b, $a), $a[$a.length-1]) } else { return nil }; }, TMP_8.$$arity = 0); Opal.defn(self, '$compile_shadow_args', TMP_10 = function $$compile_shadow_args() { var $a, $b, TMP_9, self = this; return ($a = ($b = self.$shadow_args()).$each, $a.$$p = (TMP_9 = function(shadow_arg){var self = TMP_9.$$s || this; if (shadow_arg == null) shadow_arg = nil; return self.$scope().$add_local(shadow_arg.$last())}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $a).call($b); }, TMP_10.$$arity = 0); Opal.defn(self, '$extract_shadow_args', TMP_12 = function $$extract_shadow_args() { var $a, $b, TMP_11, self = this; if ((($a = self.$args()['$is_a?']($scope.get('Sexp'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.shadow_args = []; return ($a = ($b = self.$args().$children()).$each_with_index, $a.$$p = (TMP_11 = function(arg, idx){var self = TMP_11.$$s || this; if (self.shadow_args == null) self.shadow_args = nil; if (arg == null) arg = nil;if (idx == null) idx = nil; if (arg.$type()['$==']("shadowarg")) { return self.shadow_args['$<<'](self.$args().$delete(arg)) } else { return nil }}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11), $a).call($b); } else { return nil }; }, TMP_12.$$arity = 0); Opal.defn(self, '$args', TMP_14 = function $$args() { var $a, $b, $c, TMP_13, self = this, sexp = nil, caught_blank_argument = nil; sexp = (function() {if ((($a = ((($b = $scope.get('Fixnum')['$==='](self.$args_sexp())) !== false && $b !== nil && $b != null) ? $b : self.$args_sexp()['$nil?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$s("args") } else if ((($a = ($b = self.$args_sexp()['$is_a?']($scope.get('Sexp')), $b !== false && $b !== nil && $b != null ?self.$args_sexp().$type()['$==']("lasgn") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$s("args", ($a = self).$s.apply($a, ["arg"].concat(Opal.to_a(self.$args_sexp()['$[]'](1))))) } else { return self.$args_sexp()['$[]'](1) }; return nil; })(); caught_blank_argument = false; ($b = ($c = sexp).$each_with_index, $b.$$p = (TMP_13 = function(part, idx){var self = TMP_13.$$s || this, $d, $e; if (part == null) part = nil;if (idx == null) idx = nil; if ((($d = ($e = part['$is_a?']($scope.get('Sexp')), $e !== false && $e !== nil && $e != null ?part.$last()['$==']("_") : $e)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { if (caught_blank_argument !== false && caught_blank_argument !== nil && caught_blank_argument != null) { sexp.$delete_at(idx)}; return caught_blank_argument = true; } else { return nil }}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13), $b).call($c); return sexp; }, TMP_14.$$arity = 0); Opal.defn(self, '$body', TMP_15 = function $$body() { var $a, self = this; return self.$compiler().$returns(((($a = self.$body_sexp()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil"))); }, TMP_15.$$arity = 0); Opal.defn(self, '$mlhs_args', TMP_16 = function $$mlhs_args() { var self = this; return self.$scope().$mlhs_mapping().$keys(); }, TMP_16.$$arity = 0); Opal.defn(self, '$has_top_level_mlhs_arg?', TMP_18 = function() { var $a, $b, TMP_17, self = this; return ($a = ($b = self.$args().$children())['$any?'], $a.$$p = (TMP_17 = function(arg){var self = TMP_17.$$s || this; if (arg == null) arg = nil; return arg.$type()['$==']("mlhs")}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b); }, TMP_18.$$arity = 0); Opal.defn(self, '$has_trailing_comma_in_args?', TMP_19 = function() { var self = this; return self.$args().$meta()['$[]']("has_trailing_comma"); }, TMP_19.$$arity = 0); return (Opal.defn(self, '$compile_arity_check', TMP_20 = function $$compile_arity_check() { var $a, $b, $c, $d, self = this, parent_scope = nil, context = nil, identity = nil; if ((($a = $rb_gt(self.$arity_checks().$size(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { parent_scope = self.$scope(); while ((($b = (((($c = ((($d = parent_scope['$top?']()) !== false && $d !== nil && $d != null) ? $d : parent_scope['$def?']())) !== false && $c !== nil && $c != null) ? $c : parent_scope['$class_scope?']()))['$!']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { parent_scope = parent_scope.$parent()}; context = (function() {if ((($a = parent_scope['$top?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "'
'" } else if ((($a = parent_scope['$def?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "'" + (parent_scope.$mid()) + "'" } else if ((($a = parent_scope['$class?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "''" } else if ((($a = parent_scope['$module?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "''" } else { return nil }; return nil; })(); identity = self.$scope().$identity(); self.$line("if (" + (identity) + ".$$is_lambda || " + (identity) + ".$$define_meth) {"); self.$line(" var $arity = arguments.length;"); self.$line(" if (" + (self.$arity_checks().$join(" || ")) + ") { Opal.block_ac($arity, " + (self.$arity()) + ", " + (context) + "); }"); return self.$line("}"); } else { return nil }; }, TMP_20.$$arity = 0), nil) && 'compile_arity_check'; })($scope.base, $scope.get('NodeWithArgs')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/def"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$attr_accessor', '$is_a?', '$last', '$args', '$==', '$type', '$[]', '$pop', '$extract_block_arg', '$split_args', '$block_arg', '$to_sym', '$variable', '$in_scope', '$mid=', '$mid', '$scope', '$recvr', '$defs=', '$uses_block!', '$add_arg', '$block_name=', '$process', '$inline_args_sexp', '$stmt', '$returns', '$compiler', '$stmts', '$add_temp', '$compile_inline_args', '$compile_post_args', '$identify!', '$identity', '$compile_block_arg', '$arity_check?', '$compile_arity_check', '$uses_zuper', '$add_local', '$line', '$unshift', '$current_indent', '$to_vars', '$catch_return', '$push', '$valid_name?', '$arity', '$parameters_code', '$recv', '$iter?', '$module?', '$class?', '$sclass?', '$defs', '$eval?', '$top?', '$def?', '$raise', '$expr?', '$wrap', '$>', '$size', '$arity_checks', '$inspect', '$to_s', '$join']); self.$require("opal/nodes/node_with_args"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DefNode(){}; var self = $DefNode = $klass($base, $super, 'DefNode', $DefNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_4; self.$handle("def"); self.$children("recvr", "mid", "args", "stmts"); self.$attr_accessor("block_arg"); Opal.defn(self, '$extract_block_arg', TMP_1 = function $$extract_block_arg() { var $a, $b, self = this; if ((($a = ($b = self.$args().$last()['$is_a?']($scope.get('Sexp')), $b !== false && $b !== nil && $b != null ?self.$args().$last().$type()['$==']("blockarg") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.block_arg = self.$args().$pop()['$[]'](1) } else { return nil }; }, TMP_1.$$arity = 0); Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, $b, TMP_2, $c, self = this, inline_params = nil, scope_name = nil, block_name = nil, function_name = nil; self.$extract_block_arg(); self.$split_args(); inline_params = nil; scope_name = nil; if ((($a = self.$block_arg()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block_name = self.$variable(self.$block_arg()).$to_sym()}; ($a = ($b = self).$in_scope, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $c, $d, $e, stmt_code = nil; (($c = [self.$mid()]), $d = self.$scope(), $d['$mid='].apply($d, $c), $c[$c.length-1]); if ((($c = self.$recvr()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { (($c = [true]), $d = self.$scope(), $d['$defs='].apply($d, $c), $c[$c.length-1])}; if (block_name !== false && block_name !== nil && block_name != null) { self.$scope()['$uses_block!'](); self.$scope().$add_arg(block_name);}; (($c = [((($e = block_name) !== false && $e !== nil && $e != null) ? $e : "$yield")]), $d = self.$scope(), $d['$block_name='].apply($d, $c), $c[$c.length-1]); inline_params = self.$process(self.$inline_args_sexp()); stmt_code = self.$stmt(self.$compiler().$returns(self.$stmts())); self.$add_temp("self = this"); self.$compile_inline_args(); self.$compile_post_args(); self.$scope()['$identify!'](); scope_name = self.$scope().$identity(); self.$compile_block_arg(); if ((($c = self.$compiler()['$arity_check?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$compile_arity_check()}; if ((($c = self.$scope().$uses_zuper()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$add_local("$zuper"); self.$add_local("$zuper_index"); self.$add_local("$zuper_length"); self.$line("$zuper = [];"); self.$line(); self.$line("for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) {"); self.$line(" $zuper[$zuper_index] = arguments[$zuper_index];"); self.$line("}");}; self.$unshift("\n" + (self.$current_indent()), self.$scope().$to_vars()); self.$line(stmt_code); if ((($c = self.$scope().$catch_return()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$unshift("try {\n"); self.$line("} catch ($returner) { if ($returner === Opal.returner) { return $returner.$v }"); return self.$push(" throw $returner; }"); } else { return nil };}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $a).call($b); function_name = (function() {if ((($a = self['$valid_name?'](self.$mid())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return " $$" + (self.$mid()) } else { return "" }; return nil; })(); self.$unshift(") {"); self.$unshift(inline_params); self.$unshift("function" + (function_name) + "("); if (scope_name !== false && scope_name !== nil && scope_name != null) { self.$unshift("" + (scope_name) + " = ")}; self.$line("}"); self.$push(", " + (scope_name) + ".$$arity = " + (self.$arity())); if ((($a = self.$compiler()['$arity_check?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(", " + (scope_name) + ".$$parameters = " + (self.$parameters_code()))}; if ((($a = self.$recvr()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.defs(", self.$recv(self.$recvr()), ", '$" + (self.$mid()) + "', ") } else if ((($a = self.$scope()['$iter?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.def(self, '$" + (self.$mid()) + "', ") } else if ((($a = ((($c = self.$scope()['$module?']()) !== false && $c !== nil && $c != null) ? $c : self.$scope()['$class?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.defn(self, '$" + (self.$mid()) + "', ") } else if ((($a = ($c = self.$scope()['$sclass?'](), $c !== false && $c !== nil && $c != null ?self.$scope().$defs() : $c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.defs(self, '$" + (self.$mid()) + "', ") } else if ((($a = self.$scope()['$sclass?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.defn(self, '$" + (self.$mid()) + "', ") } else if ((($a = self.$compiler()['$eval?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.def(self, '$" + (self.$mid()) + "', ") } else if ((($a = self.$scope()['$top?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.defn(Opal.Object, '$" + (self.$mid()) + "', ") } else if ((($a = self.$scope()['$def?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$unshift("Opal.def(self, '$" + (self.$mid()) + "', ") } else { self.$raise("Unsupported use of `def`; please file a bug at https://github.com/opal/opal/issues/new reporting this message.") }; self.$push(")"); if ((($a = self['$expr?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(", ", nil) && '" + (self.$mid()) + "'") } else { return nil }; }, TMP_3.$$arity = 0); return (Opal.defn(self, '$compile_arity_check', TMP_4 = function $$compile_arity_check() { var $a, self = this, meth = nil; if ((($a = $rb_gt(self.$arity_checks().$size(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { meth = self.$scope().$mid().$to_s().$inspect(); self.$line("var $arity = arguments.length;"); return self.$push(" if (" + (self.$arity_checks().$join(" || ")) + ") { Opal.ac($arity, " + (self.$arity()) + ", this, " + (meth) + "); }"); } else { return nil }; }, TMP_4.$$arity = 0), nil) && 'compile_arity_check'; })($scope.base, $scope.get('NodeWithArgs')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/if"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$truthy', '$falsy', '$skip_check_present?', '$skip_check_present_not?', '$push', '$js_truthy', '$test', '$indent', '$line', '$stmt', '$==', '$type', '$needs_wrapper?', '$wrap', '$returns', '$compiler', '$true_body', '$s', '$false_body', '$expr?', '$recv?']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $IfNode(){}; var self = $IfNode = $klass($base, $super, 'IfNode', $IfNode); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; self.$handle("if"); self.$children("test", "true_body", "false_body"); Opal.cdecl($scope, 'RUBY_ENGINE_CHECK', ["call", ["const", "RUBY_ENGINE"], "==", ["arglist", ["str", "opal"]]]); Opal.cdecl($scope, 'RUBY_ENGINE_CHECK_NOT', ["call", ["const", "RUBY_ENGINE"], "!=", ["arglist", ["str", "opal"]]]); Opal.cdecl($scope, 'RUBY_PLATFORM_CHECK', ["call", ["const", "RUBY_PLATFORM"], "==", ["arglist", ["str", "opal"]]]); Opal.cdecl($scope, 'RUBY_PLATFORM_CHECK_NOT', ["call", ["const", "RUBY_PLATFORM"], "!=", ["arglist", ["str", "opal"]]]); Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, $b, TMP_1, $c, TMP_2, self = this, truthy = nil, falsy = nil; $a = [self.$truthy(), self.$falsy()], truthy = $a[0], falsy = $a[1], $a; if ((($a = self['$skip_check_present?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { falsy = nil}; if ((($a = self['$skip_check_present_not?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { truthy = nil}; self.$push("if (", self.$js_truthy(self.$test()), ") {"); if (truthy !== false && truthy !== nil && truthy != null) { ($a = ($b = self).$indent, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; return self.$line(self.$stmt(truthy))}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b)}; if (falsy !== false && falsy !== nil && falsy != null) { if (falsy.$type()['$==']("if")) { self.$line("} else ", self.$stmt(falsy)) } else { ($a = ($c = self).$indent, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; self.$line("} else {"); return self.$line(self.$stmt(falsy));}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $a).call($c); self.$line("}"); } } else { self.$push("}") }; if ((($a = self['$needs_wrapper?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(function() {", "; return nil; })()") } else { return nil }; }, TMP_3.$$arity = 0); Opal.defn(self, '$skip_check_present?', TMP_4 = function() { var $a, self = this; return ((($a = self.$test()['$==']($scope.get('RUBY_ENGINE_CHECK'))) !== false && $a !== nil && $a != null) ? $a : self.$test()['$==']($scope.get('RUBY_PLATFORM_CHECK'))); }, TMP_4.$$arity = 0); Opal.defn(self, '$skip_check_present_not?', TMP_5 = function() { var $a, self = this; return ((($a = self.$test()['$==']($scope.get('RUBY_ENGINE_CHECK_NOT'))) !== false && $a !== nil && $a != null) ? $a : self.$test()['$==']($scope.get('RUBY_PLATFORM_CHECK_NOT'))); }, TMP_5.$$arity = 0); Opal.defn(self, '$truthy', TMP_6 = function $$truthy() { var $a, self = this; if ((($a = self['$needs_wrapper?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compiler().$returns(((($a = self.$true_body()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil"))) } else { return self.$true_body() }; }, TMP_6.$$arity = 0); Opal.defn(self, '$falsy', TMP_7 = function $$falsy() { var $a, self = this; if ((($a = self['$needs_wrapper?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compiler().$returns(((($a = self.$false_body()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil"))) } else { return self.$false_body() }; }, TMP_7.$$arity = 0); return (Opal.defn(self, '$needs_wrapper?', TMP_8 = function() { var $a, self = this; return ((($a = self['$expr?']()) !== false && $a !== nil && $a != null) ? $a : self['$recv?']()); }, TMP_8.$$arity = 0), nil) && 'needs_wrapper?'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/logic"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$in_while?', '$push', '$expr_or_nil', '$value', '$wrap', '$compile_while', '$iter?', '$scope', '$compile_iter', '$error', '$[]', '$while_loop', '$stmt?', '$has_break!', '$compiler', '$line', '$break_val', '$nil?', '$expr', '$s', '$>', '$size', '$[]=', '$identity', '$with_temp', '$==', '$empty_splat?', '$type', '$recv', '$rhs', '$compile_if', '$compile_ternary', '$raise', '$lhs', '$indent', '$js_truthy_optimize', '$find_parent_def', '$expr?', '$def?', '$return_in_iter?', '$return_expr_in_def?', '$scope_to_catch_return', '$catch_return=', '$return_val', '$to_s']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $NextNode(){}; var self = $NextNode = $klass($base, $super, 'NextNode', $NextNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$handle("next"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var $a, self = this; if ((($a = self['$in_while?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("continue;")}; self.$push(self.$expr_or_nil(self.$value())); return self.$wrap("return ", ";"); }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $BreakNode(){}; var self = $BreakNode = $klass($base, $super, 'BreakNode', $BreakNode); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; self.$handle("break"); self.$children("value"); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, self = this; if ((($a = self['$in_while?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_while() } else if ((($a = self.$scope()['$iter?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_iter() } else { return self.$error("void value expression: cannot use break outside of iter/while") }; }, TMP_2.$$arity = 0); Opal.defn(self, '$compile_while', TMP_3 = function $$compile_while() { var $a, self = this; if ((($a = self.$while_loop()['$[]']("closure")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("return ", self.$expr_or_nil(self.$value())) } else { return self.$push("break;") }; }, TMP_3.$$arity = 0); Opal.defn(self, '$compile_iter', TMP_4 = function $$compile_iter() { var $a, self = this; if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$error("break must be used as a statement") }; self.$compiler()['$has_break!'](); return self.$line("Opal.brk(", self.$break_val(), ", $brk)"); }, TMP_4.$$arity = 0); return (Opal.defn(self, '$break_val', TMP_5 = function $$break_val() { var $a, self = this; if ((($a = self.$value()['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(self.$s("nil")) } else if ((($a = $rb_gt(self.$children().$size(), 1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(($a = self).$s.apply($a, ["array"].concat(Opal.to_a(self.$children())))) } else { return self.$expr(self.$value()) }; }, TMP_5.$$arity = 0), nil) && 'break_val'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $RedoNode(){}; var self = $RedoNode = $klass($base, $super, 'RedoNode', $RedoNode); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7, TMP_8; self.$handle("redo"); Opal.defn(self, '$compile', TMP_6 = function $$compile() { var $a, self = this; if ((($a = self['$in_while?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_while() } else if ((($a = self.$scope()['$iter?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_iter() } else { return self.$push("REDO()") }; }, TMP_6.$$arity = 0); Opal.defn(self, '$compile_while', TMP_7 = function $$compile_while() { var self = this; self.$while_loop()['$[]=']("use_redo", true); return self.$push("" + (self.$while_loop()['$[]']("redo_var")) + " = true"); }, TMP_7.$$arity = 0); return (Opal.defn(self, '$compile_iter', TMP_8 = function $$compile_iter() { var self = this; return self.$push("return " + (self.$scope().$identity()) + ".apply(null, $slice.call(arguments))"); }, TMP_8.$$arity = 0), nil) && 'compile_iter'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $NotNode(){}; var self = $NotNode = $klass($base, $super, 'NotNode', $NotNode); var def = self.$$proto, $scope = self.$$scope, TMP_10; self.$handle("not"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_10 = function $$compile() { var $a, $b, TMP_9, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_9 = function(tmp){var self = TMP_9.$$s || this; if (tmp == null) tmp = nil; self.$push(self.$expr(self.$value())); return self.$wrap("(" + (tmp) + " = ", ", (" + (tmp) + " === nil || " + (tmp) + " === false || " + (tmp) + " == null))");}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $a).call($b); }, TMP_10.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $SplatNode(){}; var self = $SplatNode = $klass($base, $super, 'SplatNode', $SplatNode); var def = self.$$proto, $scope = self.$$scope, TMP_11, TMP_12; self.$handle("splat"); self.$children("value"); Opal.defn(self, '$empty_splat?', TMP_11 = function() { var $a, self = this; return ((($a = self.$value()['$=='](["nil"])) !== false && $a !== nil && $a != null) ? $a : self.$value()['$=='](["paren", ["nil"]])); }, TMP_11.$$arity = 0); return (Opal.defn(self, '$compile', TMP_12 = function $$compile() { var $a, self = this; if ((($a = self['$empty_splat?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("[]") } else if (self.$value().$type()['$==']("sym")) { return self.$push("[", self.$expr(self.$value()), "]") } else { return self.$push("Opal.to_a(", self.$recv(self.$value()), ")") }; }, TMP_12.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $BinaryOp(){}; var self = $BinaryOp = $klass($base, $super, 'BinaryOp', $BinaryOp); var def = self.$$proto, $scope = self.$$scope, TMP_13, TMP_14, TMP_15; Opal.defn(self, '$compile', TMP_13 = function $$compile() { var self = this; if (self.$rhs().$type()['$==']("break")) { return self.$compile_if() } else { return self.$compile_ternary() }; }, TMP_13.$$arity = 0); Opal.defn(self, '$compile_ternary', TMP_14 = function $$compile_ternary() { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_14.$$arity = 0); return (Opal.defn(self, '$compile_if', TMP_15 = function $$compile_if() { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_15.$$arity = 0), nil) && 'compile_if'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $OrNode(){}; var self = $OrNode = $klass($base, $super, 'OrNode', $OrNode); var def = self.$$proto, $scope = self.$$scope, TMP_17, TMP_21; self.$handle("or"); self.$children("lhs", "rhs"); Opal.defn(self, '$compile_ternary', TMP_17 = function $$compile_ternary() { var $a, $b, TMP_16, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_16 = function(tmp){var self = TMP_16.$$s || this; if (tmp == null) tmp = nil; self.$push("(((" + (tmp) + " = "); self.$push(self.$expr(self.$lhs())); self.$push(") !== false && " + (tmp) + " !== nil && " + (tmp) + " != null) ? " + (tmp) + " : "); self.$push(self.$expr(self.$rhs())); return self.$push(")");}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b); }, TMP_17.$$arity = 0); return (Opal.defn(self, '$compile_if', TMP_21 = function $$compile_if() { var $a, $b, TMP_18, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_18 = function(tmp){var self = TMP_18.$$s || this, $c, $d, TMP_19, $e, TMP_20; if (tmp == null) tmp = nil; self.$push("if (" + (tmp) + " = ", self.$expr(self.$lhs()), ", " + (tmp) + " !== false && " + (tmp) + " !== nil && " + (tmp) + " != null) {"); ($c = ($d = self).$indent, $c.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this; return self.$line(tmp)}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $c).call($d); self.$line("} else {"); ($c = ($e = self).$indent, $c.$$p = (TMP_20 = function(){var self = TMP_20.$$s || this; return self.$line(self.$expr(self.$rhs()))}, TMP_20.$$s = self, TMP_20.$$arity = 0, TMP_20), $c).call($e); return self.$line("}");}, TMP_18.$$s = self, TMP_18.$$arity = 1, TMP_18), $a).call($b); }, TMP_21.$$arity = 0), nil) && 'compile_if'; })($scope.base, $scope.get('BinaryOp')); (function($base, $super) { function $AndNode(){}; var self = $AndNode = $klass($base, $super, 'AndNode', $AndNode); var def = self.$$proto, $scope = self.$$scope, TMP_23, TMP_27; self.$handle("and"); self.$children("lhs", "rhs"); Opal.defn(self, '$compile_ternary', TMP_23 = function $$compile_ternary() { var $a, $b, TMP_22, self = this, truthy_opt = nil; truthy_opt = nil; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_22 = function(tmp){var self = TMP_22.$$s || this, $c; if (tmp == null) tmp = nil; if ((($c = truthy_opt = self.$js_truthy_optimize(self.$lhs())) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$push("((" + (tmp) + " = ", truthy_opt); self.$push(") ? "); self.$push(self.$expr(self.$rhs())); return self.$push(" : ", self.$expr(self.$lhs()), ")"); } else { self.$push("(" + (tmp) + " = "); self.$push(self.$expr(self.$lhs())); self.$push(", " + (tmp) + " !== false && " + (tmp) + " !== nil && " + (tmp) + " != null ?"); self.$push(self.$expr(self.$rhs())); return self.$push(" : " + (tmp) + ")"); }}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $a).call($b); }, TMP_23.$$arity = 0); return (Opal.defn(self, '$compile_if', TMP_27 = function $$compile_if() { var $a, $b, TMP_24, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_24 = function(tmp){var self = TMP_24.$$s || this, $c, $d, TMP_25, $e, TMP_26, truthy_opt = nil; if (tmp == null) tmp = nil; if ((($c = truthy_opt = self.$js_truthy_optimize(self.$lhs())) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$push("if (" + (tmp) + " = ", truthy_opt, ") {") } else { self.$push("if (" + (tmp) + " = ", self.$expr(self.$lhs()), ", " + (tmp) + " !== false && " + (tmp) + " !== nil && " + (tmp) + " != null) {") }; ($c = ($d = self).$indent, $c.$$p = (TMP_25 = function(){var self = TMP_25.$$s || this; return self.$line(self.$expr(self.$rhs()))}, TMP_25.$$s = self, TMP_25.$$arity = 0, TMP_25), $c).call($d); self.$line("} else {"); ($c = ($e = self).$indent, $c.$$p = (TMP_26 = function(){var self = TMP_26.$$s || this; return self.$line(self.$expr(self.$lhs()))}, TMP_26.$$s = self, TMP_26.$$arity = 0, TMP_26), $c).call($e); return self.$line("}");}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24), $a).call($b); }, TMP_27.$$arity = 0), nil) && 'compile_if'; })($scope.base, $scope.get('BinaryOp')); (function($base, $super) { function $ReturnNode(){}; var self = $ReturnNode = $klass($base, $super, 'ReturnNode', $ReturnNode); var def = self.$$proto, $scope = self.$$scope, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32; self.$handle("return"); self.$children("value"); Opal.defn(self, '$return_val', TMP_28 = function $$return_val() { var $a, self = this; if ((($a = self.$value()['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(self.$s("nil")) } else if ((($a = $rb_gt(self.$children().$size(), 1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(($a = self).$s.apply($a, ["array"].concat(Opal.to_a(self.$children())))) } else { return self.$expr(self.$value()) }; }, TMP_28.$$arity = 0); Opal.defn(self, '$return_in_iter?', TMP_29 = function() { var $a, $b, self = this, parent_def = nil; if ((($a = ($b = self.$scope()['$iter?'](), $b !== false && $b !== nil && $b != null ?parent_def = self.$scope().$find_parent_def() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return parent_def } else { return nil }; }, TMP_29.$$arity = 0); Opal.defn(self, '$return_expr_in_def?', TMP_30 = function() { var $a, $b, self = this; if ((($a = ($b = self['$expr?'](), $b !== false && $b !== nil && $b != null ?self.$scope()['$def?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$scope() } else { return nil }; }, TMP_30.$$arity = 0); Opal.defn(self, '$scope_to_catch_return', TMP_31 = function $$scope_to_catch_return() { var $a, self = this; return ((($a = self['$return_in_iter?']()) !== false && $a !== nil && $a != null) ? $a : self['$return_expr_in_def?']()); }, TMP_31.$$arity = 0); return (Opal.defn(self, '$compile', TMP_32 = function $$compile() { var $a, $b, self = this, def_scope = nil; if ((($a = def_scope = self.$scope_to_catch_return()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [true]), $b = def_scope, $b['$catch_return='].apply($b, $a), $a[$a.length-1]); return self.$push("Opal.ret(", self.$return_val(), ")"); } else if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("return ", self.$return_val()) } else { return self.$raise($scope.get('SyntaxError'), "void value expression: cannot return as an expression") }; }, TMP_32.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $JSReturnNode(){}; var self = $JSReturnNode = $klass($base, $super, 'JSReturnNode', $JSReturnNode); var def = self.$$proto, $scope = self.$$scope, TMP_33; self.$handle("js_return"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_33 = function $$compile() { var self = this; self.$push("return "); return self.$push(self.$expr(self.$value())); }, TMP_33.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $JSTempNode(){}; var self = $JSTempNode = $klass($base, $super, 'JSTempNode', $JSTempNode); var def = self.$$proto, $scope = self.$$scope, TMP_34; self.$handle("js_tmp"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_34 = function $$compile() { var self = this; return self.$push(self.$value().$to_s()); }, TMP_34.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $BlockPassNode(){}; var self = $BlockPassNode = $klass($base, $super, 'BlockPassNode', $BlockPassNode); var def = self.$$proto, $scope = self.$$scope, TMP_35; self.$handle("block_pass"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_35 = function $$compile() { var self = this; return self.$push(self.$expr(self.$s("call", self.$value(), "to_proc", self.$s("arglist")))); }, TMP_35.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/definitions"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$push', '$process', '$value', '$each', '$[]', '$==', '$<<', '$expr', '$s', '$to_s', '$>', '$length', '$!=', '$first', '$line', '$mid_to_jsid', '$new_name', '$old_name', '$class?', '$scope', '$module?', '$methods', '$!', '$stmt?', '$type', '$body', '$stmt', '$returns', '$compiler', '$wrap', '$each_with_index', '$empty?', '$stmt_join', '$find_inline_yield', '$child_is_expr?', '$class_scope?', '$current_indent', '$raw_expression?', '$include?', '$===', '$[]=', '$+', '$has_temp?', '$add_temp']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $SvalueNode(){}; var self = $SvalueNode = $klass($base, $super, 'SvalueNode', $SvalueNode); var def = self.$$proto, $scope = self.$$scope, TMP_1; def.level = nil; self.$handle("svalue"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this; return self.$push(self.$process(self.$value(), self.level)); }, TMP_1.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $UndefNode(){}; var self = $UndefNode = $klass($base, $super, 'UndefNode', $UndefNode); var def = self.$$proto, $scope = self.$$scope, TMP_3; self.$handle("undef"); return (Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, $b, TMP_2, self = this; return ($a = ($b = self.$children()).$each, $a.$$p = (TMP_2 = function(child){var self = TMP_2.$$s || this, $c, $d, value = nil, statements = nil; if (child == null) child = nil; value = child['$[]'](1); statements = []; if (child['$[]'](0)['$==']("js_return")) { value = value['$[]'](1); statements['$<<'](self.$expr(self.$s("js_return")));}; statements['$<<']("Opal.udef(self, '$" + (value.$to_s()) + "');"); if ((($c = ($d = $rb_gt(self.$children().$length(), 1), $d !== false && $d !== nil && $d != null ?child['$!='](self.$children().$first()) : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return ($c = self).$line.apply($c, Opal.to_a(statements)) } else { return ($d = self).$push.apply($d, Opal.to_a(statements)) };}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); }, TMP_3.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $AliasNode(){}; var self = $AliasNode = $klass($base, $super, 'AliasNode', $AliasNode); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5, TMP_6; self.$handle("alias"); self.$children("new_name", "old_name"); Opal.defn(self, '$new_mid', TMP_4 = function $$new_mid() { var self = this; return self.$mid_to_jsid(self.$new_name()['$[]'](1).$to_s()); }, TMP_4.$$arity = 0); Opal.defn(self, '$old_mid', TMP_5 = function $$old_mid() { var self = this; return self.$mid_to_jsid(self.$old_name()['$[]'](1).$to_s()); }, TMP_5.$$arity = 0); return (Opal.defn(self, '$compile', TMP_6 = function $$compile() { var $a, $b, self = this; if ((($a = ((($b = self.$scope()['$class?']()) !== false && $b !== nil && $b != null) ? $b : self.$scope()['$module?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$scope().$methods()['$<<']("$" + (self.$new_name()['$[]'](1)))}; return self.$push("Opal.alias(self, '" + (self.$new_name()['$[]'](1)) + "', '" + (self.$old_name()['$[]'](1)) + "')"); }, TMP_6.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $BeginNode(){}; var self = $BeginNode = $klass($base, $super, 'BeginNode', $BeginNode); var def = self.$$proto, $scope = self.$$scope, TMP_7; def.level = nil; self.$handle("begin"); self.$children("body"); return (Opal.defn(self, '$compile', TMP_7 = function $$compile() { var $a, $b, self = this; if ((($a = ($b = self['$stmt?']()['$!'](), $b !== false && $b !== nil && $b != null ?self.$body().$type()['$==']("block") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(self.$stmt(self.$compiler().$returns(self.$body()))); return self.$wrap("(function() {", "})()"); } else { return self.$push(self.$process(self.$body(), self.level)) }; }, TMP_7.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ParenNode(){}; var self = $ParenNode = $klass($base, $super, 'ParenNode', $ParenNode); var def = self.$$proto, $scope = self.$$scope, TMP_9; def.level = nil; self.$handle("paren"); self.$children("body"); return (Opal.defn(self, '$compile', TMP_9 = function $$compile() { var $a, $b, TMP_8, self = this; if (self.$body().$type()['$==']("block")) { ($a = ($b = self.$body().$children()).$each_with_index, $a.$$p = (TMP_8 = function(child, idx){var self = TMP_8.$$s || this; if (child == null) child = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(", ") }; return self.$push(self.$expr(child));}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8), $a).call($b); return self.$wrap("(", ")"); } else { self.$push(self.$process(self.$body(), self.level)); if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$wrap("(", ")") }; }; }, TMP_9.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $BlockNode(){}; var self = $BlockNode = $klass($base, $super, 'BlockNode', $BlockNode); var def = self.$$proto, $scope = self.$$scope, TMP_11, TMP_12, TMP_13, TMP_14, TMP_17; def.level = nil; self.$handle("block"); Opal.defn(self, '$compile', TMP_11 = function $$compile() { var $a, $b, TMP_10, self = this; if ((($a = self.$children()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("nil")}; return ($a = ($b = self.$children()).$each_with_index, $a.$$p = (TMP_10 = function(child, idx){var self = TMP_10.$$s || this, $c, yasgn = nil; if (self.level == null) self.level = nil; if (child == null) child = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(self.$stmt_join()) }; if ((($c = yasgn = self.$find_inline_yield(child)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$push(self.$compiler().$process(yasgn, self.level)); self.$push(";");}; self.$push(self.$compiler().$process(child, self.level)); if ((($c = self['$child_is_expr?'](child)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$push(";") } else { return nil };}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $a).call($b); }, TMP_11.$$arity = 0); Opal.defn(self, '$stmt_join', TMP_12 = function $$stmt_join() { var $a, self = this; if ((($a = self.$scope()['$class_scope?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "\n\n" + (self.$current_indent()) } else { return "\n" + (self.$current_indent()) }; }, TMP_12.$$arity = 0); Opal.defn(self, '$child_is_expr?', TMP_13 = function(child) { var $a, self = this; return ($a = self['$raw_expression?'](child), $a !== false && $a !== nil && $a != null ?["stmt", "stmt_closure"]['$include?'](self.level) : $a); }, TMP_13.$$arity = 1); Opal.defn(self, '$raw_expression?', TMP_14 = function(child) { var self = this; return ["xstr", "dxstr"]['$include?'](child.$type())['$!'](); }, TMP_14.$$arity = 1); return (Opal.defn(self, '$find_inline_yield', TMP_17 = function $$find_inline_yield(stmt) { var $a, $b, TMP_15, $c, TMP_16, self = this, found = nil, $case = nil, arglist = nil; found = nil; $case = stmt.$first();if ("js_return"['$===']($case)) {if ((($a = found = self.$find_inline_yield(stmt['$[]'](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { found = found['$[]'](2)}}else if ("array"['$===']($case)) {($a = ($b = stmt['$[]']($range(1, -1, false))).$each_with_index, $a.$$p = (TMP_15 = function(el, idx){var self = TMP_15.$$s || this; if (el == null) el = nil;if (idx == null) idx = nil; if (el.$first()['$==']("yield")) { found = el; return stmt['$[]=']($rb_plus(idx, 1), self.$s("js_tmp", "$yielded")); } else { return nil }}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $a).call($b)}else if ("call"['$===']($case)) {arglist = stmt['$[]'](3); ($a = ($c = arglist['$[]']($range(1, -1, false))).$each_with_index, $a.$$p = (TMP_16 = function(el, idx){var self = TMP_16.$$s || this; if (el == null) el = nil;if (idx == null) idx = nil; if (el.$first()['$==']("yield")) { found = el; return arglist['$[]=']($rb_plus(idx, 1), self.$s("js_tmp", "$yielded")); } else { return nil }}, TMP_16.$$s = self, TMP_16.$$arity = 2, TMP_16), $a).call($c);}; if (found !== false && found !== nil && found != null) { if ((($a = self.$scope()['$has_temp?']("$yielded")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$scope().$add_temp("$yielded") }; return self.$s("yasgn", "$yielded", found); } else { return nil }; }, TMP_17.$$arity = 1), nil) && 'find_inline_yield'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/yield"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$find_yielding_scope', '$uses_block!', '$block_name', '$yields_single_arg?', '$push', '$expr', '$first', '$wrap', '$s', '$uses_splat?', '$scope', '$def?', '$parent', '$!', '$==', '$size', '$any?', '$type', '$handle', '$compile_call', '$children', '$[]', '$yield_args', '$var_name']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BaseYieldNode(){}; var self = $BaseYieldNode = $klass($base, $super, 'BaseYieldNode', $BaseYieldNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_5; Opal.defn(self, '$compile_call', TMP_1 = function $$compile_call(children, level) { var $a, $b, self = this, yielding_scope = nil, block_name = nil; yielding_scope = self.$find_yielding_scope(); yielding_scope['$uses_block!'](); block_name = ((($a = yielding_scope.$block_name()) !== false && $a !== nil && $a != null) ? $a : "$yield"); if ((($a = self['$yields_single_arg?'](children)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(self.$expr(children.$first())); return self.$wrap("Opal.yield1(" + (block_name) + ", ", ")"); } else { self.$push(self.$expr(($a = self).$s.apply($a, ["arglist"].concat(Opal.to_a(children))))); if ((($b = self['$uses_splat?'](children)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$wrap("Opal.yieldX(" + (block_name) + ", ", ")") } else { return self.$wrap("Opal.yieldX(" + (block_name) + ", [", "])") }; }; }, TMP_1.$$arity = 2); Opal.defn(self, '$find_yielding_scope', TMP_2 = function $$find_yielding_scope() { var $a, $b, $c, self = this, working = nil; working = self.$scope(); while (working !== false && working !== nil && working != null) { if ((($b = ((($c = working.$block_name()) !== false && $c !== nil && $c != null) ? $c : working['$def?']())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { break;}; working = working.$parent();}; return working; }, TMP_2.$$arity = 0); Opal.defn(self, '$yields_single_arg?', TMP_3 = function(children) { var $a, self = this; return ($a = self['$uses_splat?'](children)['$!'](), $a !== false && $a !== nil && $a != null ?children.$size()['$=='](1) : $a); }, TMP_3.$$arity = 1); return (Opal.defn(self, '$uses_splat?', TMP_5 = function(children) { var $a, $b, TMP_4, self = this; return ($a = ($b = children)['$any?'], $a.$$p = (TMP_4 = function(child){var self = TMP_4.$$s || this; if (child == null) child = nil; return child.$type()['$==']("splat")}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b); }, TMP_5.$$arity = 1), nil) && 'uses_splat?'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $YieldNode(){}; var self = $YieldNode = $klass($base, $super, 'YieldNode', $YieldNode); var def = self.$$proto, $scope = self.$$scope, TMP_6; def.level = nil; self.$handle("yield"); return (Opal.defn(self, '$compile', TMP_6 = function $$compile() { var self = this; return self.$compile_call(self.$children(), self.level); }, TMP_6.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('BaseYieldNode')); (function($base, $super) { function $YasgnNode(){}; var self = $YasgnNode = $klass($base, $super, 'YasgnNode', $YasgnNode); var def = self.$$proto, $scope = self.$$scope, TMP_7; self.$handle("yasgn"); self.$children("var_name", "yield_args"); return (Opal.defn(self, '$compile', TMP_7 = function $$compile() { var $a, self = this; self.$compile_call(($a = self).$s.apply($a, Opal.to_a(self.$yield_args()['$[]']($range(1, -1, false)))), "stmt"); return self.$wrap("(" + (self.$var_name()) + " = ", ")"); }, TMP_7.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('BaseYieldNode')); (function($base, $super) { function $ReturnableYieldNode(){}; var self = $ReturnableYieldNode = $klass($base, $super, 'ReturnableYieldNode', $ReturnableYieldNode); var def = self.$$proto, $scope = self.$$scope, TMP_8; def.level = nil; self.$handle("returnable_yield"); return (Opal.defn(self, '$compile', TMP_8 = function $$compile() { var self = this; self.$compile_call(self.$children(), self.level); return self.$wrap("return ", ";"); }, TMP_8.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('BaseYieldNode')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/rescue"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$stmt?', '$lhs', '$returns', '$compiler', '$rhs', '$line', '$expr', '$body', '$indent', '$new', '$rescue_val', '$wrap', '$push', '$in_ensure', '$process', '$body_sexp', '$has_rescue_else?', '$unshift', '$rescue_else_sexp', '$scope', '$ensr_sexp', '$wrap_in_closure?', '$begn', '$==', '$type', '$s', '$ensr', '$recv?', '$expr?', '$rescue_else_sexp=', '$detect', '$!=', '$[]', '$handle_rescue_else_manually?', '$body_code', '$each_with_index', '$!', '$in_ensure?', '$empty?', '$rescue_exprs', '$rescue_variable', '$[]=', '$rescue_body', '$===', '$include?', '$rescue_variable?', '$last', '$args', '$dup', '$pop']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $RescueModNode(){}; var self = $RescueModNode = $klass($base, $super, 'RescueModNode', $RescueModNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4; self.$handle("rescue_mod"); self.$children("lhs", "rhs"); Opal.defn(self, '$body', TMP_1 = function $$body() { var $a, self = this; if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$lhs() } else { return self.$compiler().$returns(self.$lhs()) }; }, TMP_1.$$arity = 0); Opal.defn(self, '$rescue_val', TMP_2 = function $$rescue_val() { var $a, self = this; if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$rhs() } else { return self.$compiler().$returns(self.$rhs()) }; }, TMP_2.$$arity = 0); return (Opal.defn(self, '$compile', TMP_4 = function $$compile() { var $a, $b, TMP_3, self = this; self.$line("try {", self.$expr(self.$body()), " } catch ($err) { "); ($a = ($b = self).$indent, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; self.$line("if (Opal.rescue($err, [", self.$expr($scope.get('Sexp').$new(["const", "StandardError"])), "])) {"); self.$line(self.$expr(self.$rescue_val())); return self.$line("} else { throw $err; } }");}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($b); if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$wrap("(function() {", "})()") }; }, TMP_4.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $EnsureNode(){}; var self = $EnsureNode = $klass($base, $super, 'EnsureNode', $EnsureNode); var def = self.$$proto, $scope = self.$$scope, TMP_9, TMP_10, TMP_11, TMP_12; self.$handle("ensure"); self.$children("begn", "ensr"); Opal.defn(self, '$compile', TMP_9 = function $$compile() { var $a, $b, TMP_5, $c, TMP_6, self = this; self.$push("try {"); ($a = ($b = self).$in_ensure, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; if (self.level == null) self.level = nil; return self.$line(self.$compiler().$process(self.$body_sexp(), self.level))}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $a).call($b); self.$line("} finally {"); ($a = ($c = self).$indent, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this, $d, $e, TMP_7; if (self.level == null) self.level = nil; if ((($d = self['$has_rescue_else?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { self.$unshift("var $no_errors = true; "); self.$line("var $rescue_else_result;"); self.$line("if ($no_errors) { "); ($d = ($e = self).$indent, $d.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this, $f, $g, TMP_8; self.$line("$rescue_else_result = (function() {"); ($f = ($g = self).$indent, $f.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this; if (self.level == null) self.level = nil; return self.$line(self.$compiler().$process(self.$compiler().$returns(self.$scope().$rescue_else_sexp()), self.level))}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $f).call($g); return self.$line("})();");}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $d).call($e); self.$line("}"); self.$line(self.$compiler().$process(self.$ensr_sexp(), self.level)); return self.$line("if ($no_errors) { return $rescue_else_result; }"); } else { return self.$line(self.$compiler().$process(self.$ensr_sexp(), self.level)) }}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($c); self.$line("}"); if ((($a = self['$wrap_in_closure?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(function() { ", "; })()") } else { return nil }; }, TMP_9.$$arity = 0); Opal.defn(self, '$body_sexp', TMP_10 = function $$body_sexp() { var $a, self = this, sexp = nil; if ((($a = self['$wrap_in_closure?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sexp = self.$compiler().$returns(self.$begn()); if (sexp.$type()['$==']("rescue")) { return self.$s("js_return", sexp) } else { return sexp }; } else { return sexp = self.$begn() }; }, TMP_10.$$arity = 0); Opal.defn(self, '$ensr_sexp', TMP_11 = function $$ensr_sexp() { var $a, self = this; return ((($a = self.$ensr()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil")); }, TMP_11.$$arity = 0); return (Opal.defn(self, '$wrap_in_closure?', TMP_12 = function() { var $a, $b, self = this; return ((($a = ((($b = self['$recv?']()) !== false && $b !== nil && $b != null) ? $b : self['$expr?']())) !== false && $a !== nil && $a != null) ? $a : self['$has_rescue_else?']()); }, TMP_12.$$arity = 0), nil) && 'wrap_in_closure?'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $RescueNode(){}; var self = $RescueNode = $klass($base, $super, 'RescueNode', $RescueNode); var def = self.$$proto, $scope = self.$$scope, TMP_20, TMP_21, TMP_22; self.$handle("rescue"); self.$children("body"); Opal.defn(self, '$compile', TMP_20 = function $$compile() { var $a, $b, $c, $d, TMP_13, TMP_14, TMP_15, $e, TMP_17, $f, self = this, has_rescue_handlers = nil; (($a = [($c = ($d = self.$children()['$[]']($range(1, -1, false))).$detect, $c.$$p = (TMP_13 = function(sexp){var self = TMP_13.$$s || this; if (sexp == null) sexp = nil; return sexp.$type()['$!=']("resbody")}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $c).call($d)]), $b = self.$scope(), $b['$rescue_else_sexp='].apply($b, $a), $a[$a.length-1]); has_rescue_handlers = false; if ((($a = self['$handle_rescue_else_manually?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$line("var $no_errors = true;")}; self.$push("try {"); ($a = ($b = self).$indent, $a.$$p = (TMP_14 = function(){var self = TMP_14.$$s || this; if (self.level == null) self.level = nil; return self.$line(self.$process(self.$body_code(), self.level))}, TMP_14.$$s = self, TMP_14.$$arity = 0, TMP_14), $a).call($b); self.$line("} catch ($err) {"); ($a = ($c = self).$indent, $a.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this, $e, $f, TMP_16; if ((($e = self['$has_rescue_else?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$line("$no_errors = false;")}; ($e = ($f = self.$children()['$[]']($range(1, -1, false))).$each_with_index, $e.$$p = (TMP_16 = function(child, idx){var self = TMP_16.$$s || this; if (self.level == null) self.level = nil; if (child == null) child = nil;if (idx == null) idx = nil; if (child.$type()['$==']("resbody")) { has_rescue_handlers = true; if (idx['$=='](0)) { } else { self.$push(" else ") }; return self.$line(self.$process(child, self.level)); } else { return nil }}, TMP_16.$$s = self, TMP_16.$$arity = 2, TMP_16), $e).call($f); return self.$push(" else { throw $err; }");}, TMP_15.$$s = self, TMP_15.$$arity = 0, TMP_15), $a).call($c); self.$line("}"); if ((($a = self['$handle_rescue_else_manually?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push("finally {"); ($a = ($e = self).$indent, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this, $f, $g, TMP_18; self.$line("if ($no_errors) { "); ($f = ($g = self).$indent, $f.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this, $h, $i, TMP_19; self.$line("return (function() {"); ($h = ($i = self).$indent, $h.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this; if (self.level == null) self.level = nil; return self.$line(self.$compiler().$process(self.$compiler().$returns(self.$scope().$rescue_else_sexp()), self.level))}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $h).call($i); return self.$line("})();");}, TMP_18.$$s = self, TMP_18.$$arity = 0, TMP_18), $f).call($g); return self.$line("}");}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17), $a).call($e); self.$push("}");}; if ((($a = ((($f = self['$expr?']()) !== false && $f !== nil && $f != null) ? $f : self['$recv?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(function() { ", "})()") } else { return nil }; }, TMP_20.$$arity = 0); Opal.defn(self, '$body_code', TMP_21 = function $$body_code() { var $a, self = this, body_code = nil; body_code = ((function() {if (self.$body().$type()['$==']("resbody")) { return self.$s("nil") } else { return self.$body() }; return nil; })()); if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { body_code = self.$compiler().$returns(body_code) }; return body_code; }, TMP_21.$$arity = 0); return (Opal.defn(self, '$handle_rescue_else_manually?', TMP_22 = function() { var $a, self = this; return ($a = self.$scope()['$in_ensure?']()['$!'](), $a !== false && $a !== nil && $a != null ?self.$scope()['$has_rescue_else?']() : $a); }, TMP_22.$$arity = 0), nil) && 'handle_rescue_else_manually?'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $ResBodyNode(){}; var self = $ResBodyNode = $klass($base, $super, 'ResBodyNode', $ResBodyNode); var def = self.$$proto, $scope = self.$$scope, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30; self.$handle("resbody"); self.$children("args", "body"); Opal.defn(self, '$compile', TMP_26 = function $$compile() { var $a, $b, TMP_23, $c, TMP_24, self = this; self.$push("if (Opal.rescue($err, ["); if ((($a = self.$rescue_exprs()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$push(self.$expr($scope.get('Sexp').$new(["const", "StandardError"]))) } else { ($a = ($b = self.$rescue_exprs()).$each_with_index, $a.$$p = (TMP_23 = function(rexpr, idx){var self = TMP_23.$$s || this; if (rexpr == null) rexpr = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(", ") }; return self.$push(self.$expr(rexpr));}, TMP_23.$$s = self, TMP_23.$$arity = 2, TMP_23), $a).call($b) }; self.$push("])) {"); ($a = ($c = self).$indent, $a.$$p = (TMP_24 = function(){var self = TMP_24.$$s || this, $d, $e, TMP_25, variable = nil; if ((($d = variable = self.$rescue_variable()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { variable['$[]='](2, self.$s("js_tmp", "$err")); self.$push(self.$expr(variable), ";");}; self.$line("try {"); ($d = ($e = self).$indent, $d.$$p = (TMP_25 = function(){var self = TMP_25.$$s || this; if (self.level == null) self.level = nil; return self.$line(self.$process(self.$rescue_body(), self.level))}, TMP_25.$$s = self, TMP_25.$$arity = 0, TMP_25), $d).call($e); return self.$line("} finally { Opal.pop_exception() }");}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24), $a).call($c); return self.$line("}"); }, TMP_26.$$arity = 0); Opal.defn(self, '$rescue_variable?', TMP_27 = function(variable) { var $a, self = this; return ($a = $scope.get('Sexp')['$==='](variable), $a !== false && $a !== nil && $a != null ?["lasgn", "iasgn"]['$include?'](variable.$type()) : $a); }, TMP_27.$$arity = 1); Opal.defn(self, '$rescue_variable', TMP_28 = function $$rescue_variable() { var $a, self = this; if ((($a = self['$rescue_variable?'](self.$args().$last())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$args().$last().$dup() } else { return nil }; }, TMP_28.$$arity = 0); Opal.defn(self, '$rescue_exprs', TMP_29 = function $$rescue_exprs() { var $a, self = this, exprs = nil; exprs = self.$args().$dup(); if ((($a = self['$rescue_variable?'](exprs.$last())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { exprs.$pop()}; return exprs.$children(); }, TMP_29.$$arity = 0); return (Opal.defn(self, '$rescue_body', TMP_30 = function $$rescue_body() { var $a, self = this, body_code = nil; body_code = (((($a = self.$body()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil"))); if ((($a = self['$stmt?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { body_code = self.$compiler().$returns(body_code) }; return body_code; }, TMP_30.$$arity = 0), nil) && 'rescue_body'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/case"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$in_case', '$condition', '$[]=', '$case_stmt', '$add_local', '$push', '$expr', '$each_with_index', '$==', '$type', '$needs_closure?', '$returns', '$compiler', '$stmt', '$case_parts', '$!', '$wrap', '$stmt?', '$[]', '$s', '$js_truthy', '$when_checks', '$process', '$body_code', '$whens', '$body']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CaseNode(){}; var self = $CaseNode = $klass($base, $super, 'CaseNode', $CaseNode); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6; self.$handle("case"); self.$children("condition"); Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, $b, TMP_1, self = this, handled_else = nil; handled_else = false; return ($a = ($b = self.$compiler()).$in_case, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, $d, TMP_2, $e; if ((($c = self.$condition()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$case_stmt()['$[]=']("cond", true); self.$add_local("$case"); self.$push("$case = ", self.$expr(self.$condition()), ";");}; ($c = ($d = self.$case_parts()).$each_with_index, $c.$$p = (TMP_2 = function(wen, idx){var self = TMP_2.$$s || this, $e, $f; if (wen == null) wen = nil;if (idx == null) idx = nil; if ((($e = (($f = wen !== false && wen !== nil && wen != null) ? wen.$type()['$==']("when") : wen)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { if ((($e = self['$needs_closure?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$compiler().$returns(wen)}; if (idx['$=='](0)) { } else { self.$push("else ") }; return self.$push(self.$stmt(wen)); } else if (wen !== false && wen !== nil && wen != null) { handled_else = true; if ((($e = self['$needs_closure?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { wen = self.$compiler().$returns(wen)}; return self.$push("else {", self.$stmt(wen), "}"); } else { return nil }}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $c).call($d); if ((($c = ($e = self['$needs_closure?'](), $e !== false && $e !== nil && $e != null ?handled_else['$!']() : $e)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$push("else { return nil }")}; if ((($c = self['$needs_closure?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$wrap("(function() {", "})()") } else { return nil };}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); }, TMP_3.$$arity = 0); Opal.defn(self, '$needs_closure?', TMP_4 = function() { var self = this; return self['$stmt?']()['$!'](); }, TMP_4.$$arity = 0); Opal.defn(self, '$case_parts', TMP_5 = function $$case_parts() { var self = this; return self.$children()['$[]']($range(1, -1, false)); }, TMP_5.$$arity = 0); return (Opal.defn(self, '$case_stmt', TMP_6 = function $$case_stmt() { var self = this; return self.$compiler().$case_stmt(); }, TMP_6.$$arity = 0), nil) && 'case_stmt'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $WhenNode(){}; var self = $WhenNode = $klass($base, $super, 'WhenNode', $WhenNode); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9, TMP_10, TMP_11; def.level = nil; self.$handle("when"); self.$children("whens", "body"); Opal.defn(self, '$compile', TMP_8 = function $$compile() { var $a, $b, TMP_7, self = this; self.$push("if ("); ($a = ($b = self.$when_checks()).$each_with_index, $a.$$p = (TMP_7 = function(check, idx){var self = TMP_7.$$s || this, $c, call = nil; if (check == null) check = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(" || ") }; if (check.$type()['$==']("splat")) { self.$push("(function($splt) { for (var i = 0; i < $splt.length; i++) {"); self.$push("if ($splt[i]['$===']($case)) { return true; }"); return self.$push("} return false; })(", self.$expr(check['$[]'](1)), ")"); } else if ((($c = self.$case_stmt()['$[]']("cond")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { call = self.$s("call", check, "===", self.$s("arglist", self.$s("js_tmp", "$case"))); return self.$push(self.$expr(call)); } else { return self.$push(self.$js_truthy(check)) };}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7), $a).call($b); return self.$push(") {", self.$process(self.$body_code(), self.level), "}"); }, TMP_8.$$arity = 0); Opal.defn(self, '$when_checks', TMP_9 = function $$when_checks() { var self = this; return self.$whens().$children(); }, TMP_9.$$arity = 0); Opal.defn(self, '$case_stmt', TMP_10 = function $$case_stmt() { var self = this; return self.$compiler().$case_stmt(); }, TMP_10.$$arity = 0); return (Opal.defn(self, '$body_code', TMP_11 = function $$body_code() { var $a, self = this; return ((($a = self.$body()) !== false && $a !== nil && $a != null) ? $a : self.$s("nil")); }, TMP_11.$$arity = 0), nil) && 'body_code'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/super"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$children', '$def?', '$scope', '$uses_block!', '$default_compile', '$private', '$s', '$raw_iter', '$arglist', '$raise', '$find_parent_def', '$containing_def_scope', '$to_s', '$mid', '$identify!', '$defs', '$name', '$parent', '$defined_check_param', '$get_super_chain', '$join', '$map', '$implicit_arguments_param', '$super_method_invocation', '$iter?', '$super_block_invocation', '$push', '$receiver_fragment', '$handle', '$add_method', '$method_missing?', '$compiler', '$wrap', '$==', '$uses_zuper=', '$formal_block_parameter', '$!', '$iter', '$[]', '$<<', '$===', '$extract_block_arg', '$block_arg']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BaseSuperNode(){}; var self = $BaseSuperNode = $klass($base, $super, 'BaseSuperNode', $BaseSuperNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_12, TMP_13; def.iter = def.implicit_args = nil; self.$children("arglist", "raw_iter"); Opal.defn(self, '$compile', TMP_1 = function $$compile() { var $a, self = this; if ((($a = self.$scope()['$def?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$scope()['$uses_block!']()}; return self.$default_compile(); }, TMP_1.$$arity = 0); self.$private(); Opal.defn(self, '$recvr', TMP_2 = function $$recvr() { var self = this; return self.$s("self"); }, TMP_2.$$arity = 0); Opal.defn(self, '$iter', TMP_3 = function $$iter() { var $a, $b, self = this; return ((($a = self.iter) !== false && $a !== nil && $a != null) ? $a : self.iter = (function() {if ((($b = self.$raw_iter()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$raw_iter() } else if ((($b = self.$arglist()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$s("js_tmp", "null") } else { self.$scope()['$uses_block!'](); return self.$s("js_tmp", "$iter"); }; return nil; })()); }, TMP_3.$$arity = 0); Opal.defn(self, '$method_jsid', TMP_4 = function $$method_jsid() { var self = this; return self.$raise("Not implemented, see #add_method"); }, TMP_4.$$arity = 0); Opal.defn(self, '$redefine_this?', TMP_5 = function(temporary_receiver) { var self = this; return true; }, TMP_5.$$arity = 1); Opal.defn(self, '$arguments_array?', TMP_6 = function() { var $a, $b, $c, self = this, $iter = TMP_6.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_6.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return ((($a = ($b = ($c = self, Opal.find_super_dispatcher(self, 'arguments_array?', TMP_6, false)), $b.$$p = $iter, $b).apply($c, $zuper)) !== false && $a !== nil && $a != null) ? $a : self.implicit_args); }, TMP_6.$$arity = 0); Opal.defn(self, '$containing_def_scope', TMP_7 = function $$containing_def_scope() { var $a, self = this; if ((($a = self.$scope()['$def?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$scope()}; return self.$scope().$find_parent_def(); }, TMP_7.$$arity = 0); Opal.defn(self, '$defined_check_param', TMP_8 = function $$defined_check_param() { var self = this; return "false"; }, TMP_8.$$arity = 0); Opal.defn(self, '$implicit_arguments_param', TMP_9 = function $$implicit_arguments_param() { var $a, self = this; if ((($a = self.implicit_args) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "true" } else { return "false" }; }, TMP_9.$$arity = 0); Opal.defn(self, '$super_method_invocation', TMP_10 = function $$super_method_invocation() { var $a, self = this, def_scope = nil, method_jsid = nil, current_func = nil, class_name = nil; def_scope = self.$containing_def_scope(); method_jsid = def_scope.$mid().$to_s(); current_func = def_scope['$identify!'](); if ((($a = def_scope.$defs()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { class_name = (function() {if ((($a = def_scope.$parent().$name()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "$" + (def_scope.$parent().$name()) } else { return "self.$$class.$$proto" }; return nil; })(); return "Opal.find_super_dispatcher(self, '" + (method_jsid) + "', " + (current_func) + ", " + (self.$defined_check_param()) + ", " + (class_name) + ")"; } else { return "Opal.find_super_dispatcher(self, '" + (method_jsid) + "', " + (current_func) + ", " + (self.$defined_check_param()) + ")" }; }, TMP_10.$$arity = 0); Opal.defn(self, '$super_block_invocation', TMP_12 = function $$super_block_invocation() { var $a, $b, TMP_11, self = this, chain = nil, cur_defn = nil, mid = nil, trys = nil, implicit = nil; $b = self.$scope().$get_super_chain(), $a = Opal.to_ary($b), chain = ($a[0] == null ? nil : $a[0]), cur_defn = ($a[1] == null ? nil : $a[1]), mid = ($a[2] == null ? nil : $a[2]), $b; trys = ($a = ($b = chain).$map, $a.$$p = (TMP_11 = function(c){var self = TMP_11.$$s || this; if (c == null) c = nil; return "" + (c) + ".$$def"}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b).$join(" || "); implicit = self.implicit_args.$to_s(); return "Opal.find_iter_super_dispatcher(self, " + (mid) + ", (" + (trys) + " || " + (cur_defn) + "), " + (self.$defined_check_param()) + ", " + (self.$implicit_arguments_param()) + ")"; }, TMP_12.$$arity = 0); return (Opal.defn(self, '$add_method', TMP_13 = function $$add_method(temporary_receiver) { var $a, self = this, super_call = nil; super_call = (function() {if ((($a = self.$scope()['$def?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$super_method_invocation() } else if ((($a = self.$scope()['$iter?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$super_block_invocation() } else { return self.$raise("unexpected compilation error") }; return nil; })(); if (temporary_receiver !== false && temporary_receiver !== nil && temporary_receiver != null) { return self.$push("(" + (temporary_receiver) + " = ", self.$receiver_fragment(), ", ", super_call, ")") } else { return self.$push(super_call) }; }, TMP_13.$$arity = 1), nil) && 'add_method'; })($scope.base, $scope.get('CallNode')); (function($base, $super) { function $DefinedSuperNode(){}; var self = $DefinedSuperNode = $klass($base, $super, 'DefinedSuperNode', $DefinedSuperNode); var def = self.$$proto, $scope = self.$$scope, TMP_14, TMP_15; self.$handle("defined_super"); Opal.defn(self, '$defined_check_param', TMP_14 = function $$defined_check_param() { var self = this; return "true"; }, TMP_14.$$arity = 0); return (Opal.defn(self, '$compile', TMP_15 = function $$compile() { var $a, self = this; self.$add_method(nil); if ((($a = self.$compiler()['$method_missing?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(!(", ".$$stub) ? \"super\" : nil)") } else { return self.$wrap("((", ") != null ? \"super\" : nil)") }; }, TMP_15.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('BaseSuperNode')); (function($base, $super) { function $SuperNode(){}; var self = $SuperNode = $klass($base, $super, 'SuperNode', $SuperNode); var def = self.$$proto, $scope = self.$$scope, TMP_16, TMP_17; def.arguments_without_block = nil; self.$handle("super"); Opal.defn(self, '$compile', TMP_16 = function $$compile() { var $a, $b, self = this, $iter = TMP_16.$$p, $yield = $iter || nil, block_arg = nil, expr = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_16.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (self.$arglist()['$=='](nil)) { self.implicit_args = true; if ((($a = self.$containing_def_scope()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [true]), $b = self.$containing_def_scope(), $b['$uses_zuper='].apply($b, $a), $a[$a.length-1]); self.arguments_without_block = [self.$s("js_tmp", "$zuper")]; if ((($a = ($b = (block_arg = self.$formal_block_parameter()), $b !== false && $b !== nil && $b != null ?self.$iter()['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { expr = self.$s("block_pass", self.$s("lvar", block_arg['$[]'](1))); self.arguments_without_block['$<<'](expr);}; } else { self.arguments_without_block = [] };}; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'compile', TMP_16, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_16.$$arity = 0); self.$private(); return (Opal.defn(self, '$formal_block_parameter', TMP_17 = function $$formal_block_parameter() { var self = this, $case = nil; return (function() {$case = self.$containing_def_scope();if ((((($scope.get('Opal')).$$scope.get('Nodes'))).$$scope.get('IterNode'))['$===']($case)) {return self.$containing_def_scope().$extract_block_arg()}else if ((((($scope.get('Opal')).$$scope.get('Nodes'))).$$scope.get('DefNode'))['$===']($case)) {return self.$containing_def_scope().$block_arg()}else {return self.$raise("Don't know what to do with scope " + (self.$containing_def_scope()))}})(); }, TMP_17.$$arity = 0), nil) && 'formal_block_parameter'; })($scope.base, $scope.get('BaseSuperNode')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'VERSION', "0.10.3") })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/top"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$push', '$version_comment', '$opening', '$in_scope', '$stmt', '$stmts', '$is_a?', '$eval?', '$compiler', '$add_temp', '$add_used_helpers', '$add_used_operators', '$line', '$to_vars', '$scope', '$compile_method_stubs', '$compile_irb_vars', '$compile_end_construct', '$closing', '$requirable?', '$to_s', '$cleanpath', '$Pathname', '$file', '$inspect', '$returns', '$body', '$irb?', '$to_a', '$helpers', '$each', '$operator_helpers', '$[]', '$method_missing?', '$method_calls', '$join', '$map', '$empty?', '$eof_content']); self.$require("pathname"); self.$require("opal/version"); self.$require("opal/nodes/scope"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $TopNode(){}; var self = $TopNode = $klass($base, $super, 'TopNode', $TopNode); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_10, TMP_12, TMP_13, TMP_14; self.$handle("top"); self.$children("body"); Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this; self.$push(self.$version_comment()); self.$opening(); ($a = ($b = self).$in_scope, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, body_code = nil; body_code = self.$stmt(self.$stmts()); if ((($c = body_code['$is_a?']($scope.get('Array'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { body_code = [body_code] }; if ((($c = self.$compiler()['$eval?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { self.$add_temp("self = Opal.top") }; self.$add_temp((function() {if ((($c = self.$compiler()['$eval?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return "$scope = (self.$$scope || self.$$class.$$scope)" } else { return "$scope = Opal" }; return nil; })()); self.$add_temp("nil = Opal.nil"); self.$add_used_helpers(); self.$add_used_operators(); self.$line(self.$scope().$to_vars()); self.$compile_method_stubs(); self.$compile_irb_vars(); self.$compile_end_construct(); return self.$line(body_code);}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); return self.$closing(); }, TMP_2.$$arity = 0); Opal.defn(self, '$opening', TMP_3 = function $$opening() { var $a, self = this, path = nil; if ((($a = self.$compiler()['$requirable?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { path = self.$Pathname(self.$compiler().$file()).$cleanpath().$to_s(); return self.$line("Opal.modules[" + (path.$inspect()) + "] = function(Opal) {"); } else if ((($a = self.$compiler()['$eval?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$line("(function(Opal, self) {") } else { return self.$line("(function(Opal) {") }; }, TMP_3.$$arity = 0); Opal.defn(self, '$closing', TMP_4 = function $$closing() { var $a, self = this; if ((($a = self.$compiler()['$requirable?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$line("};\n") } else if ((($a = self.$compiler()['$eval?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$line("})(Opal, self)") } else { return self.$line("})(Opal);\n") }; }, TMP_4.$$arity = 0); Opal.defn(self, '$stmts', TMP_5 = function $$stmts() { var self = this; return self.$compiler().$returns(self.$body()); }, TMP_5.$$arity = 0); Opal.defn(self, '$compile_irb_vars', TMP_6 = function $$compile_irb_vars() { var $a, self = this; if ((($a = self.$compiler()['$irb?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$line("if (!Opal.irb_vars) { Opal.irb_vars = {}; }") } else { return nil }; }, TMP_6.$$arity = 0); Opal.defn(self, '$add_used_helpers', TMP_8 = function $$add_used_helpers() { var $a, $b, TMP_7, self = this, helpers = nil; helpers = self.$compiler().$helpers().$to_a(); return ($a = ($b = helpers.$to_a()).$each, $a.$$p = (TMP_7 = function(h){var self = TMP_7.$$s || this; if (h == null) h = nil; return self.$add_temp("$" + (h) + " = Opal." + (h))}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); }, TMP_8.$$arity = 0); Opal.defn(self, '$add_used_operators', TMP_10 = function $$add_used_operators() { var $a, $b, TMP_9, self = this, operators = nil; operators = self.$compiler().$operator_helpers().$to_a(); return ($a = ($b = operators).$each, $a.$$p = (TMP_9 = function(op){var self = TMP_9.$$s || this, name = nil; if (op == null) op = nil; name = (((($scope.get('Nodes')).$$scope.get('CallNode'))).$$scope.get('OPERATORS'))['$[]'](op); self.$line("function $rb_" + (name) + "(lhs, rhs) {"); self.$line(" return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs " + (op) + " rhs : lhs['$" + (op) + "'](rhs);"); return self.$line("}");}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $a).call($b); }, TMP_10.$$arity = 0); Opal.defn(self, '$compile_method_stubs', TMP_12 = function $$compile_method_stubs() { var $a, $b, TMP_11, self = this, calls = nil, stubs = nil; if ((($a = self.$compiler()['$method_missing?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { calls = self.$compiler().$method_calls(); stubs = ($a = ($b = calls.$to_a()).$map, $a.$$p = (TMP_11 = function(k){var self = TMP_11.$$s || this; if (k == null) k = nil; return "'$" + (k) + "'"}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b).$join(", "); if ((($a = stubs['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$line("Opal.add_stubs([" + (stubs) + "]);") }; } else { return nil }; }, TMP_12.$$arity = 0); Opal.defn(self, '$compile_end_construct', TMP_13 = function $$compile_end_construct() { var $a, self = this, content = nil; if ((($a = content = self.$compiler().$eof_content()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$line("var $__END__ = Opal.Object.$new();"); return self.$line("$__END__.$read = function() { return " + (content.$inspect()) + "; };"); } else { return nil }; }, TMP_13.$$arity = 0); return (Opal.defn(self, '$version_comment', TMP_14 = function $$version_comment() { var self = this; return "/* Generated by Opal " + ((($scope.get('Opal')).$$scope.get('VERSION'))) + " */"; }, TMP_14.$$arity = 0), nil) && 'version_comment'; })($scope.base, $scope.get('ScopeNode')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/while"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$with_temp', '$js_truthy', '$test', '$in_while', '$wrap_in_closure?', '$[]=', '$while_loop', '$stmt', '$body', '$uses_redo?', '$push', '$while_open', '$while_close', '$line', '$compiler', '$wrap', '$[]', '$expr?', '$recv?']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $WhileNode(){}; var self = $WhileNode = $klass($base, $super, 'WhileNode', $WhileNode); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; self.$handle("while"); self.$children("test", "body"); Opal.defn(self, '$compile', TMP_3 = function $$compile() { var $a, $b, TMP_1, self = this; ($a = ($b = self).$with_temp, $a.$$p = (TMP_1 = function(redo_var){var self = TMP_1.$$s || this, $c, $d, TMP_2, test_code = nil; if (redo_var == null) redo_var = nil; test_code = self.$js_truthy(self.$test()); return ($c = ($d = self.$compiler()).$in_while, $c.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $e, body_code = nil; if ((($e = self['$wrap_in_closure?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$while_loop()['$[]=']("closure", true)}; self.$while_loop()['$[]=']("redo_var", redo_var); body_code = self.$stmt(self.$body()); if ((($e = self['$uses_redo?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$push("" + (redo_var) + " = false; " + (self.$while_open()) + (redo_var) + " || "); self.$push(test_code); self.$push(self.$while_close()); } else { self.$push(self.$while_open(), test_code, self.$while_close()) }; if ((($e = self['$uses_redo?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$push("" + (redo_var) + " = false;")}; return self.$line(body_code, "}");}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $c).call($d);}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); if ((($a = self['$wrap_in_closure?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$wrap("(function() {", "; return nil; })()") } else { return nil }; }, TMP_3.$$arity = 0); Opal.defn(self, '$while_open', TMP_4 = function $$while_open() { var self = this; return "while ("; }, TMP_4.$$arity = 0); Opal.defn(self, '$while_close', TMP_5 = function $$while_close() { var self = this; return ") {"; }, TMP_5.$$arity = 0); Opal.defn(self, '$uses_redo?', TMP_6 = function() { var self = this; return self.$while_loop()['$[]']("use_redo"); }, TMP_6.$$arity = 0); return (Opal.defn(self, '$wrap_in_closure?', TMP_7 = function() { var $a, self = this; return ((($a = self['$expr?']()) !== false && $a !== nil && $a != null) ? $a : self['$recv?']()); }, TMP_7.$$arity = 0), nil) && 'wrap_in_closure?'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $UntilNode(){}; var self = $UntilNode = $klass($base, $super, 'UntilNode', $UntilNode); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9; self.$handle("until"); Opal.defn(self, '$while_open', TMP_8 = function $$while_open() { var self = this; return "while (!("; }, TMP_8.$$arity = 0); return (Opal.defn(self, '$while_close', TMP_9 = function $$while_close() { var self = this; return ")) {"; }, TMP_9.$$arity = 0), nil) && 'while_close'; })($scope.base, $scope.get('WhileNode')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/for"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$with_temp', '$==', '$type', '$args_sexp', '$s', '$<<', '$body_sexp', '$first', '$insert', '$each', '$[]', '$===', '$add_local', '$value', '$push', '$expr']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ForNode(){}; var self = $ForNode = $klass($base, $super, 'ForNode', $ForNode); var def = self.$$proto, $scope = self.$$scope, TMP_4; self.$handle("for"); self.$children("value", "args_sexp", "body_sexp"); return (Opal.defn(self, '$compile', TMP_4 = function $$compile() { var $a, $b, TMP_1, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_1 = function(loop_var){var self = TMP_1.$$s || this, $c, $d, TMP_2, assign = nil, iter = nil, sexp = nil; if (loop_var == null) loop_var = nil; if (self.$args_sexp().$type()['$==']("array")) { assign = self.$s("masgn", self.$args_sexp()); assign['$<<'](self.$s("to_ary", self.$s("js_tmp", loop_var))); } else { assign = self.$args_sexp()['$<<'](self.$s("js_tmp", loop_var)) }; if ((($c = self.$body_sexp()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if (self.$body_sexp().$first()['$==']("block")) { self.$body_sexp().$insert(1, assign); assign = self.$body_sexp(); } else { assign = self.$s("block", assign, self.$body_sexp()) }}; ($c = ($d = assign.$children()).$each, $c.$$p = (TMP_2 = function(sexp){var self = TMP_2.$$s || this, $e, $f, TMP_3, $case = nil; if (sexp == null) sexp = nil; return (function() {$case = sexp['$[]'](0);if ("lasgn"['$===']($case)) {return self.$add_local(sexp['$[]'](1))}else if ("masgn"['$===']($case)) {if (sexp['$[]'](1)['$[]'](0)['$==']("array")) { return ($e = ($f = sexp['$[]'](1)['$[]'](1)).$each, $e.$$p = (TMP_3 = function(sexp){var self = TMP_3.$$s || this; if (sexp == null) sexp = nil; if (sexp['$[]'](0)['$==']("lasgn")) { return self.$add_local(sexp['$[]'](1)) } else { return nil }}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $e).call($f) } else { return nil }}else { return nil }})()}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d); iter = self.$s("iter", self.$s("lasgn", loop_var), assign); sexp = self.$s("call", self.$value(), "each", self.$s("arglist"), iter); return self.$push(self.$expr(sexp));}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); }, TMP_4.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/hash"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$handle', '$attr_accessor', '$each', '$==', '$type', '$has_kwsplat=', '$<<', '$values', '$keys', '$children', '$all?', '$include?', '$extract_kv_pairs_and_kwsplats', '$has_kwsplat', '$compile_merge', '$simple_keys?', '$compile_hash2', '$compile_hash', '$helper', '$empty?', '$expr', '$s', '$each_with_index', '$push', '$wrap', '$times', '$inspect', '$to_s', '$[]', '$[]=', '$size', '$join', '$value']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $HashNode(){}; var self = $HashNode = $klass($base, $super, 'HashNode', $HashNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_5, TMP_6, TMP_9, TMP_11, TMP_14; self.$handle("hash"); self.$attr_accessor("has_kwsplat", "keys", "values"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize($a_rest) { var $b, $c, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } ($b = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $b.$$p = $iter, $b).apply($c, $zuper); self.has_kwsplat = false; self.keys = []; return self.values = []; }, TMP_1.$$arity = -1); Opal.defn(self, '$extract_kv_pairs_and_kwsplats', TMP_3 = function $$extract_kv_pairs_and_kwsplats() { var $a, $b, TMP_2, self = this, found_key = nil; found_key = false; ($a = ($b = self.$children()).$each, $a.$$p = (TMP_2 = function(obj){var self = TMP_2.$$s || this, $c, $d; if (obj == null) obj = nil; if (obj.$type()['$==']("kwsplat")) { return (($c = [true]), $d = self, $d['$has_kwsplat='].apply($d, $c), $c[$c.length-1]) } else if (found_key !== false && found_key !== nil && found_key != null) { self.$values()['$<<'](obj); return found_key = false; } else { self.$keys()['$<<'](obj); return found_key = true; }}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); return [self.$keys(), self.$values()]; }, TMP_3.$$arity = 0); Opal.defn(self, '$simple_keys?', TMP_5 = function() { var $a, $b, TMP_4, self = this; return ($a = ($b = self.$keys())['$all?'], $a.$$p = (TMP_4 = function(key){var self = TMP_4.$$s || this; if (key == null) key = nil; return ["sym", "str"]['$include?'](key.$type())}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b); }, TMP_5.$$arity = 0); Opal.defn(self, '$compile', TMP_6 = function $$compile() { var $a, self = this; self.$extract_kv_pairs_and_kwsplats(); if ((($a = self.$has_kwsplat()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_merge() } else if ((($a = self['$simple_keys?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$compile_hash2() } else { return self.$compile_hash() }; }, TMP_6.$$arity = 0); Opal.defn(self, '$compile_merge', TMP_9 = function $$compile_merge() { var $a, $b, TMP_7, $c, $d, TMP_8, self = this, result = nil, seq = nil; self.$helper("hash"); $a = [[], []], result = $a[0], seq = $a[1], $a; ($a = ($b = self.$children()).$each, $a.$$p = (TMP_7 = function(child){var self = TMP_7.$$s || this, $c; if (child == null) child = nil; if (child.$type()['$==']("kwsplat")) { if ((($c = seq['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { result['$<<'](self.$expr(($c = self).$s.apply($c, ["hash"].concat(Opal.to_a(seq))))) }; result['$<<'](self.$expr(child)); return seq = []; } else { return seq['$<<'](child) }}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); if ((($a = seq['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { result['$<<'](self.$expr(($a = self).$s.apply($a, ["hash"].concat(Opal.to_a(seq))))) }; return ($c = ($d = result).$each_with_index, $c.$$p = (TMP_8 = function(fragment, idx){var self = TMP_8.$$s || this; if (fragment == null) fragment = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { return self.$push(fragment) } else { return self.$push(".$merge(", fragment, ")") }}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8), $c).call($d); }, TMP_9.$$arity = 0); Opal.defn(self, '$compile_hash', TMP_11 = function $$compile_hash() { var $a, $b, TMP_10, self = this; self.$helper("hash"); ($a = ($b = self.$children()).$each_with_index, $a.$$p = (TMP_10 = function(child, idx){var self = TMP_10.$$s || this; if (child == null) child = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(", ") }; return self.$push(self.$expr(child));}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $a).call($b); return self.$wrap("$hash(", ")"); }, TMP_11.$$arity = 0); return (Opal.defn(self, '$compile_hash2', TMP_14 = function $$compile_hash2() { var $a, $b, TMP_12, $c, TMP_13, self = this, hash_obj = nil, hash_keys = nil; $a = [$hash2([], {}), []], hash_obj = $a[0], hash_keys = $a[1], $a; self.$helper("hash2"); ($a = ($b = self.$keys().$size()).$times, $a.$$p = (TMP_12 = function(idx){var self = TMP_12.$$s || this, $c, key = nil; if (idx == null) idx = nil; key = self.$keys()['$[]'](idx)['$[]'](1).$to_s().$inspect(); if ((($c = hash_obj['$include?'](key)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { hash_keys['$<<'](key) }; return hash_obj['$[]='](key, self.$expr(self.$values()['$[]'](idx)));}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($b); ($a = ($c = hash_keys).$each_with_index, $a.$$p = (TMP_13 = function(key, idx){var self = TMP_13.$$s || this; if (key == null) key = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { } else { self.$push(", ") }; self.$push("" + (key) + ": "); return self.$push(hash_obj['$[]'](key));}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13), $a).call($c); return self.$wrap("$hash2([" + (hash_keys.$join(", ")) + "], {", "})"); }, TMP_14.$$arity = 0), nil) && 'compile_hash2'; })($scope.base, $scope.get('Base')); (function($base, $super) { function $KwSplatNode(){}; var self = $KwSplatNode = $klass($base, $super, 'KwSplatNode', $KwSplatNode); var def = self.$$proto, $scope = self.$$scope, TMP_15; self.$handle("kwsplat"); self.$children("value"); return (Opal.defn(self, '$compile', TMP_15 = function $$compile() { var self = this; return self.$push("Opal.to_hash(", self.$expr(self.$value()), ")"); }, TMP_15.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/array"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$empty?', '$children', '$push', '$each', '$==', '$type', '$expr', '$<<', '$fragment']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ArrayNode(){}; var self = $ArrayNode = $klass($base, $super, 'ArrayNode', $ArrayNode); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.$handle("array"); return (Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this, code = nil, work = nil, join = nil; if ((($a = self.$children()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("[]")}; $a = [[], []], code = $a[0], work = $a[1], $a; ($a = ($b = self.$children()).$each, $a.$$p = (TMP_1 = function(child){var self = TMP_1.$$s || this, $c, splat = nil, part = nil; if (child == null) child = nil; splat = child.$type()['$==']("splat"); part = self.$expr(child); if (splat !== false && splat !== nil && splat != null) { if ((($c = work['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = code['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { code['$<<'](self.$fragment("[].concat("))['$<<'](part)['$<<'](self.$fragment(")")) } else { code['$<<'](self.$fragment(".concat("))['$<<'](part)['$<<'](self.$fragment(")")) } } else { if ((($c = code['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { code['$<<'](self.$fragment("["))['$<<'](work)['$<<'](self.$fragment("]")) } else { code['$<<'](self.$fragment(".concat(["))['$<<'](work)['$<<'](self.$fragment("])")) }; code['$<<'](self.$fragment(".concat("))['$<<'](part)['$<<'](self.$fragment(")")); }; return work = []; } else { if ((($c = work['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { work['$<<'](self.$fragment(", ")) }; return work['$<<'](part); };}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); if ((($a = work['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { join = [self.$fragment("["), work, self.$fragment("]")]; if ((($a = code['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { code = join } else { code.$push([self.$fragment(".concat("), join, self.$fragment(")")]) }; }; return self.$push(code); }, TMP_2.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/defined"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$handle', '$children', '$type', '$value', '$===', '$push', '$inspect', '$to_s', '$expr', '$s', '$[]', '$respond_to?', '$__send__', '$mid_to_jsid', '$with_temp', '$handle_block_given_call', '$compiler', '$wrap', '$include?']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DefinedNode(){}; var self = $DefinedNode = $klass($base, $super, 'DefinedNode', $DefinedNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_14, TMP_16; def.sexp = nil; self.$handle("defined"); self.$children("value"); Opal.defn(self, '$compile', TMP_1 = function $$compile() { var $a, self = this, type = nil, $case = nil; type = self.$value().$type(); return (function() {$case = type;if ("self"['$===']($case) || "nil"['$===']($case) || "false"['$===']($case) || "true"['$===']($case)) {return self.$push(type.$to_s().$inspect())}else if ("lasgn"['$===']($case) || "iasgn"['$===']($case) || "gasgn"['$===']($case) || "cvdecl"['$===']($case) || "masgn"['$===']($case) || "op_asgn_or"['$===']($case) || "op_asgn_and"['$===']($case)) {return self.$push("'assignment'")}else if ("paren"['$===']($case) || "not"['$===']($case)) {return self.$push(self.$expr(self.$s("defined", self.$value()['$[]'](1))))}else if ("lvar"['$===']($case)) {return self.$push("'local-variable'")}else {if ((($a = self['$respond_to?']("compile_" + (type))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$__send__("compile_" + (type)) } else { return self.$push("'expression'") }}})(); }, TMP_1.$$arity = 0); Opal.defn(self, '$compile_call', TMP_3 = function $$compile_call() { var $a, $b, TMP_2, self = this, mid = nil, recv = nil; mid = self.$mid_to_jsid(self.$value()['$[]'](2).$to_s()); recv = (function() {if ((($a = self.$value()['$[]'](1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$expr(self.$value()['$[]'](1)) } else { return "self" }; return nil; })(); return ($a = ($b = self).$with_temp, $a.$$p = (TMP_2 = function(tmp){var self = TMP_2.$$s || this; if (tmp == null) tmp = nil; self.$push("(((" + (tmp) + " = ", recv, "" + (mid) + ") && !" + (tmp) + ".$$stub) || ", recv); return self.$push("['$respond_to_missing?']('" + (self.$value()['$[]'](2).$to_s()) + "') ? 'method' : nil)");}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); }, TMP_3.$$arity = 0); Opal.defn(self, '$compile_ivar', TMP_5 = function $$compile_ivar() { var $a, $b, TMP_4, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_4 = function(tmp){var self = TMP_4.$$s || this, name = nil; if (tmp == null) tmp = nil; name = self.$value()['$[]'](1).$to_s()['$[]']($range(1, -1, false)); self.$push("((" + (tmp) + " = self['" + (name) + "'], " + (tmp) + " != null && " + (tmp) + " !== nil) ? "); return self.$push("'instance-variable' : nil)");}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b); }, TMP_5.$$arity = 0); Opal.defn(self, '$compile_super', TMP_6 = function $$compile_super() { var self = this; return self.$push(self.$expr(self.$s("defined_super", self.$value()))); }, TMP_6.$$arity = 0); Opal.defn(self, '$compile_yield', TMP_7 = function $$compile_yield() { var self = this; self.$push(self.$compiler().$handle_block_given_call(self.sexp)); return self.$wrap("((", ") != null ? \"yield\" : nil)"); }, TMP_7.$$arity = 0); Opal.defn(self, '$compile_xstr', TMP_8 = function $$compile_xstr() { var self = this; self.$push(self.$expr(self.$value())); return self.$wrap("(typeof(", ") !== \"undefined\")"); }, TMP_8.$$arity = 0); Opal.alias(self, 'compile_dxstr', 'compile_xstr'); Opal.defn(self, '$compile_const', TMP_9 = function $$compile_const() { var self = this; return self.$push("($scope." + (self.$value()['$[]'](1)) + " != null)"); }, TMP_9.$$arity = 0); Opal.defn(self, '$compile_colon2', TMP_10 = function $$compile_colon2() { var self = this; self.$push("(function(){ try { return (("); self.$push(self.$expr(self.$value())); self.$push(") != null ? 'constant' : nil); } catch (err) { if (err.$$class"); return self.$push(" === Opal.NameError) { return nil; } else { throw(err); }}; })()"); }, TMP_10.$$arity = 0); Opal.defn(self, '$compile_colon3', TMP_11 = function $$compile_colon3() { var self = this; return self.$push("(Opal.Object.$$scope." + (self.$value()['$[]'](1)) + " == null ? nil : 'constant')"); }, TMP_11.$$arity = 0); Opal.defn(self, '$compile_cvar', TMP_12 = function $$compile_cvar() { var self = this; return self.$push("(Opal.cvars['" + (self.$value()['$[]'](1)) + "'] != null ? 'class variable' : nil)"); }, TMP_12.$$arity = 0); Opal.defn(self, '$compile_gvar', TMP_14 = function $$compile_gvar() { var $a, $b, TMP_13, self = this, name = nil; name = self.$value()['$[]'](1).$to_s()['$[]']($range(1, -1, false)); if ((($a = ["~", "!"]['$include?'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$push("'global-variable'") } else if ((($a = ["`", "'", "+", "&"]['$include?'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$with_temp, $a.$$p = (TMP_13 = function(tmp){var self = TMP_13.$$s || this; if (tmp == null) tmp = nil; self.$push("((" + (tmp) + " = $gvars['~'], " + (tmp) + " != null && " + (tmp) + " !== nil) ? "); return self.$push("'global-variable' : nil)");}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $a).call($b) } else { return self.$push("($gvars[" + (name.$inspect()) + "] != null ? 'global-variable' : nil)") }; }, TMP_14.$$arity = 0); return (Opal.defn(self, '$compile_nth_ref', TMP_16 = function $$compile_nth_ref() { var $a, $b, TMP_15, self = this; return ($a = ($b = self).$with_temp, $a.$$p = (TMP_15 = function(tmp){var self = TMP_15.$$s || this; if (tmp == null) tmp = nil; self.$push("((" + (tmp) + " = $gvars['~'], " + (tmp) + " != null && " + (tmp) + " != nil) ? "); return self.$push("'global-variable' : nil)");}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $a).call($b); }, TMP_16.$$arity = 0), nil) && 'compile_nth_ref'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/masgn"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$children', '$new_temp', '$scope', '$==', '$type', '$rhs', '$push', '$expr', '$compile_masgn', '$lhs', '$-', '$size', '$[]', '$queue_temp', '$raise', '$take_while', '$!=', '$drop', '$each_with_index', '$compile_assignment', '$empty?', '$shift', '$<<', '$dup', '$s', '$!', '$>=', '$include?', '$[]=', '$to_sym', '$last']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MassAssignNode(){}; var self = $MassAssignNode = $klass($base, $super, 'MassAssignNode', $MassAssignNode); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_5, TMP_6; Opal.cdecl($scope, 'SIMPLE_ASSIGNMENT', ["lasgn", "iasgn", "lvar", "gasgn", "cdecl"]); self.$handle("masgn"); self.$children("lhs", "rhs"); Opal.defn(self, '$compile', TMP_1 = function $$compile() { var self = this, array = nil, retval = nil; array = self.$scope().$new_temp(); if (self.$rhs().$type()['$==']("array")) { self.$push("" + (array) + " = ", self.$expr(self.$rhs())); self.$compile_masgn(self.$lhs().$children(), array, $rb_minus(self.$rhs().$size(), 1)); self.$push(", " + (array)); } else if (self.$rhs().$type()['$==']("to_ary")) { retval = self.$scope().$new_temp(); self.$push("" + (retval) + " = ", self.$expr(self.$rhs()['$[]'](1))); self.$push(", " + (array) + " = Opal.to_ary(" + (retval) + ")"); self.$compile_masgn(self.$lhs().$children(), array); self.$push(", " + (retval)); self.$scope().$queue_temp(retval); } else if (self.$rhs().$type()['$==']("splat")) { self.$push("" + (array) + " = Opal.to_a(", self.$expr(self.$rhs()['$[]'](1)), ")"); self.$compile_masgn(self.$lhs().$children(), array); self.$push(", " + (array)); } else { self.$raise("unsupported mlhs type") }; return self.$scope().$queue_temp(array); }, TMP_1.$$arity = 0); Opal.defn(self, '$compile_masgn', TMP_5 = function $$compile_masgn(lhs_items, array, len) { var $a, $b, TMP_2, $c, TMP_3, $d, TMP_4, self = this, pre_splat = nil, post_splat = nil, splat = nil, part = nil, tmp = nil; if (len == null) { len = nil; } pre_splat = ($a = ($b = lhs_items).$take_while, $a.$$p = (TMP_2 = function(child){var self = TMP_2.$$s || this; if (child == null) child = nil; return child.$type()['$!=']("splat")}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); post_splat = lhs_items.$drop(pre_splat.$size()); ($a = ($c = pre_splat).$each_with_index, $a.$$p = (TMP_3 = function(child, idx){var self = TMP_3.$$s || this; if (child == null) child = nil;if (idx == null) idx = nil; return self.$compile_assignment(child, array, idx, len)}, TMP_3.$$s = self, TMP_3.$$arity = 2, TMP_3), $a).call($c); if ((($a = post_splat['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { splat = post_splat.$shift(); if ((($a = post_splat['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = part = splat['$[]'](1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { part = part.$dup()['$<<'](self.$s("js_tmp", "$slice.call(" + (array) + ", " + (pre_splat.$size()) + ")")); self.$push(", "); return self.$push(self.$expr(part)); } else { return nil } } else { tmp = self.$scope().$new_temp(); self.$push(", " + (tmp) + " = " + (array) + ".length - " + (post_splat.$size())); self.$push(", " + (tmp) + " = (" + (tmp) + " < " + (pre_splat.$size()) + ") ? " + (pre_splat.$size()) + " : " + (tmp)); if ((($a = part = splat['$[]'](1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { part = part.$dup()['$<<'](self.$s("js_tmp", "$slice.call(" + (array) + ", " + (pre_splat.$size()) + ", " + (tmp) + ")")); self.$push(", "); self.$push(self.$expr(part));}; ($a = ($d = post_splat).$each_with_index, $a.$$p = (TMP_4 = function(child, idx){var self = TMP_4.$$s || this; if (child == null) child = nil;if (idx == null) idx = nil; if (idx['$=='](0)) { return self.$compile_assignment(child, array, tmp) } else { return self.$compile_assignment(child, array, "" + (tmp) + " + " + (idx)) }}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4), $a).call($d); return self.$scope().$queue_temp(tmp); }; }; }, TMP_5.$$arity = -3); return (Opal.defn(self, '$compile_assignment', TMP_6 = function $$compile_assignment(child, array, idx, len) { var $a, $b, self = this, assign = nil, part = nil, tmp = nil; if (len == null) { len = nil; } if ((($a = ((($b = len['$!']()) !== false && $b !== nil && $b != null) ? $b : $rb_ge(idx, len))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { assign = self.$s("js_tmp", "(" + (array) + "[" + (idx) + "] == null ? nil : " + (array) + "[" + (idx) + "])") } else { assign = self.$s("js_tmp", "" + (array) + "[" + (idx) + "]") }; part = child.$dup(); if ((($a = $scope.get('SIMPLE_ASSIGNMENT')['$include?'](child.$type())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { part['$<<'](assign) } else if (child.$type()['$==']("call")) { part['$[]='](2, ((("") + (part['$[]'](2))) + "=").$to_sym()); part.$last()['$<<'](assign); } else if (child.$type()['$==']("attrasgn")) { part.$last()['$<<'](assign) } else if (child.$type()['$==']("array")) { tmp = self.$scope().$new_temp(); self.$push(", (" + (tmp) + " = Opal.to_ary(" + (assign['$[]'](1)) + ")"); self.$compile_masgn(child.$children(), tmp); self.$push(")"); self.$scope().$queue_temp(tmp); return nil; } else { self.$raise("Bad child node in masgn LHS: " + (child) + ". LHS: " + (self.$lhs())) }; self.$push(", "); return self.$push(self.$expr(part)); }, TMP_6.$$arity = -4), nil) && 'compile_assignment'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes/arglist"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$handle', '$each', '$==', '$first', '$expr', '$empty?', '$<<', '$fragment', '$children', '$push']); self.$require("opal/nodes/base"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Nodes, self = $Nodes = $module($base, 'Nodes'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ArglistNode(){}; var self = $ArglistNode = $klass($base, $super, 'ArglistNode', $ArglistNode); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.$handle("arglist"); return (Opal.defn(self, '$compile', TMP_2 = function $$compile() { var $a, $b, TMP_1, self = this, code = nil, work = nil, join = nil; $a = [[], []], code = $a[0], work = $a[1], $a; ($a = ($b = self.$children()).$each, $a.$$p = (TMP_1 = function(current){var self = TMP_1.$$s || this, $c, splat = nil, arg = nil; if (current == null) current = nil; splat = current.$first()['$==']("splat"); arg = self.$expr(current); if (splat !== false && splat !== nil && splat != null) { if ((($c = work['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = code['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { code['$<<'](arg) } else { code['$<<'](self.$fragment(".concat("))['$<<'](arg)['$<<'](self.$fragment(")")) } } else { if ((($c = code['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { code['$<<'](self.$fragment("["))['$<<'](work)['$<<'](self.$fragment("]")) } else { code['$<<'](self.$fragment(".concat(["))['$<<'](work)['$<<'](self.$fragment("])")) }; code['$<<'](self.$fragment(".concat("))['$<<'](arg)['$<<'](self.$fragment(")")); }; return work = []; } else { if ((($c = work['$empty?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { work['$<<'](self.$fragment(", ")) }; return work['$<<'](arg); };}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); if ((($a = work['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { join = work; if ((($a = code['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { code = join } else { code['$<<'](self.$fragment(".concat("))['$<<'](join)['$<<'](self.$fragment(")")) }; }; return ($a = self).$push.apply($a, Opal.to_a(code)); }, TMP_2.$$arity = 0), nil) && 'compile'; })($scope.base, $scope.get('Base')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/nodes"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("opal/nodes/base"); self.$require("opal/nodes/literal"); self.$require("opal/nodes/variables"); self.$require("opal/nodes/constants"); self.$require("opal/nodes/call"); self.$require("opal/nodes/call_special"); self.$require("opal/nodes/module"); self.$require("opal/nodes/class"); self.$require("opal/nodes/singleton_class"); self.$require("opal/nodes/inline_args"); self.$require("opal/nodes/args/normarg"); self.$require("opal/nodes/args/optarg"); self.$require("opal/nodes/args/mlhsarg"); self.$require("opal/nodes/args/restarg"); self.$require("opal/nodes/args/kwarg"); self.$require("opal/nodes/args/kwoptarg"); self.$require("opal/nodes/args/kwrestarg"); self.$require("opal/nodes/args/post_kwargs"); self.$require("opal/nodes/args/post_args"); self.$require("opal/nodes/iter"); self.$require("opal/nodes/def"); self.$require("opal/nodes/if"); self.$require("opal/nodes/logic"); self.$require("opal/nodes/definitions"); self.$require("opal/nodes/yield"); self.$require("opal/nodes/rescue"); self.$require("opal/nodes/case"); self.$require("opal/nodes/super"); self.$require("opal/nodes/top"); self.$require("opal/nodes/while"); self.$require("opal/nodes/for"); self.$require("opal/nodes/hash"); self.$require("opal/nodes/array"); self.$require("opal/nodes/defined"); self.$require("opal/nodes/masgn"); return self.$require("opal/nodes/arglist"); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/compiler"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2, $klass = Opal.klass; Opal.add_stubs(['$require', '$compile', '$new', '$[]', '$define_method', '$fetch', '$!', '$include?', '$raise', '$+', '$inspect', '$compiler_option', '$attr_reader', '$attr_accessor', '$parse', '$file', '$message', '$backtrace', '$s', '$eof_content', '$lexer', '$flatten', '$process', '$join', '$map', '$to_proc', '$class', '$warn', '$<<', '$helpers', '$new_temp', '$queue_temp', '$push_while', '$pop_while', '$==', '$in_while?', '$fragment', '$scope', '$handlers', '$type', '$compile_to_fragments', '$returns', '$===', '$pop', '$[]=', '$>', '$length', '$=~', '$source=', '$source', '$uses_block!', '$block_name', '$find_parent_def']); self.$require("set"); self.$require("opal/parser"); self.$require("opal/fragment"); self.$require("opal/nodes"); return (function($base) { var $Opal, self = $Opal = $module($base, 'Opal'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defs(self, '$compile', TMP_1 = function $$compile(source, options) { var self = this; if (options == null) { options = $hash2([], {}); } return $scope.get('Compiler').$new(source, options).$compile(); }, TMP_1.$$arity = -2); (function($base, $super) { function $Compiler(){}; var self = $Compiler = $klass($base, $super, 'Compiler', $Compiler); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32; def.parser = def.source = def.sexp = def.fragments = def.helpers = def.operator_helpers = def.method_calls = def.indent = def.unique = def.scope = def.in_ensure = def.break_detected = def.case_stmt = def.handlers = def.requires = def.required_trees = nil; Opal.cdecl($scope, 'INDENT', " "); Opal.cdecl($scope, 'COMPARE', ["<", ">", "<=", ">="]); Opal.defs(self, '$compiler_option', TMP_4 = function $$compiler_option(name, default_value, options) { var $a, $b, TMP_2, $c, self = this, mid = nil, valid_values = nil; if (options == null) { options = $hash2([], {}); } mid = options['$[]']("as"); valid_values = options['$[]']("valid_values"); return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $c, $d, TMP_3, $e, value = nil; if (self.options == null) self.options = nil; value = ($c = ($d = self.options).$fetch, $c.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return default_value}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $c).call($d, name); if ((($c = (($e = valid_values !== false && valid_values !== nil && valid_values != null) ? (valid_values['$include?'](value))['$!']() : valid_values)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$raise($scope.get('ArgumentError'), $rb_plus("invalid value " + (value.$inspect()) + " for option " + (name.$inspect()) + " ", "(valid values: " + (valid_values.$inspect()) + ")"))}; return value;}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $a).call($b, ((($c = mid) !== false && $c !== nil && $c != null) ? $c : name)); }, TMP_4.$$arity = -3); self.$compiler_option("file", "(file)"); self.$compiler_option("method_missing", true, $hash2(["as"], {"as": "method_missing?"})); self.$compiler_option("arity_check", false, $hash2(["as"], {"as": "arity_check?"})); self.$compiler_option("freezing", true, $hash2(["as"], {"as": "freezing?"})); self.$compiler_option("tainting", true, $hash2(["as"], {"as": "tainting?"})); self.$compiler_option("irb", false, $hash2(["as"], {"as": "irb?"})); self.$compiler_option("dynamic_require_severity", "warning", $hash2(["valid_values"], {"valid_values": ["error", "warning", "ignore"]})); self.$compiler_option("requirable", false, $hash2(["as"], {"as": "requirable?"})); self.$compiler_option("inline_operators", true, $hash2(["as"], {"as": "inline_operators?"})); self.$compiler_option("eval", false, $hash2(["as"], {"as": "eval?"})); self.$attr_reader("result"); self.$attr_reader("fragments"); self.$attr_accessor("scope"); self.$attr_reader("case_stmt"); self.$attr_reader("eof_content"); Opal.defn(self, '$initialize', TMP_5 = function $$initialize(source, options) { var self = this; if (options == null) { options = $hash2([], {}); } self.source = source; self.indent = ""; self.unique = 0; return self.options = options; }, TMP_5.$$arity = -2); Opal.defn(self, '$compile', TMP_6 = function $$compile() { var $a, $b, self = this, parsed = nil, error = nil, message = nil; try { self.parser = $scope.get('Parser').$new(); parsed = (function() { try { return self.parser.$parse(self.source, self.$file()) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) {error = $err; try { return self.$raise($scope.get('SyntaxError'), error.$message(), error.$backtrace()) } finally { Opal.pop_exception() } } else { throw $err; } }})(); self.sexp = self.$s("top", ((($a = parsed) !== false && $a !== nil && $a != null) ? $a : self.$s("nil"))); self.eof_content = self.parser.$lexer().$eof_content(); self.fragments = self.$process(self.sexp).$flatten(); return self.result = ($a = ($b = self.fragments).$map, $a.$$p = "code".$to_proc(), $a).call($b).$join(""); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {error = $err; try { message = "An error occurred while compiling: " + (self.$file()) + "\n" + (error.$message()); return self.$raise(error.$class(), message, error.$backtrace()); } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_6.$$arity = 0); Opal.defn(self, '$source_map', TMP_7 = function $$source_map(source_file) { var $a, self = this; if (source_file == null) { source_file = nil; } return (($scope.get('Opal')).$$scope.get('SourceMap')).$new(self.fragments, ((($a = source_file) !== false && $a !== nil && $a != null) ? $a : self.$file())); }, TMP_7.$$arity = -1); Opal.defn(self, '$helpers', TMP_8 = function $$helpers() { var $a, self = this; return ((($a = self.helpers) !== false && $a !== nil && $a != null) ? $a : self.helpers = $scope.get('Set').$new(["breaker", "slice"])); }, TMP_8.$$arity = 0); Opal.defn(self, '$operator_helpers', TMP_9 = function $$operator_helpers() { var $a, self = this; return ((($a = self.operator_helpers) !== false && $a !== nil && $a != null) ? $a : self.operator_helpers = $scope.get('Set').$new()); }, TMP_9.$$arity = 0); Opal.defn(self, '$method_calls', TMP_10 = function $$method_calls() { var $a, self = this; return ((($a = self.method_calls) !== false && $a !== nil && $a != null) ? $a : self.method_calls = $scope.get('Set').$new()); }, TMP_10.$$arity = 0); Opal.defn(self, '$error', TMP_11 = function $$error(msg, line) { var self = this; if (line == null) { line = nil; } return self.$raise($scope.get('SyntaxError'), "" + (msg) + " :" + (self.$file()) + ":" + (line)); }, TMP_11.$$arity = -2); Opal.defn(self, '$warning', TMP_12 = function $$warning(msg, line) { var self = this; if (line == null) { line = nil; } return self.$warn("WARNING: " + (msg) + " -- " + (self.$file()) + ":" + (line)); }, TMP_12.$$arity = -2); Opal.defn(self, '$parser_indent', TMP_13 = function $$parser_indent() { var self = this; return self.indent; }, TMP_13.$$arity = 0); Opal.defn(self, '$s', TMP_14 = function $$s($a_rest) { var self = this, parts; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } parts = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { parts[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('Sexp').$new(parts); }, TMP_14.$$arity = -1); Opal.defn(self, '$fragment', TMP_15 = function $$fragment(str, scope, sexp) { var self = this; if (sexp == null) { sexp = nil; } return $scope.get('Fragment').$new(str, scope, sexp); }, TMP_15.$$arity = -3); Opal.defn(self, '$unique_temp', TMP_16 = function $$unique_temp() { var self = this; return "TMP_" + (self.unique = $rb_plus(self.unique, 1)); }, TMP_16.$$arity = 0); Opal.defn(self, '$helper', TMP_17 = function $$helper(name) { var self = this; return self.$helpers()['$<<'](name); }, TMP_17.$$arity = 1); Opal.defn(self, '$indent', TMP_18 = function $$indent() { var self = this, $iter = TMP_18.$$p, block = $iter || nil, indent = nil, res = nil; TMP_18.$$p = null; indent = self.indent; self.indent = $rb_plus(self.indent, $scope.get('INDENT')); self.space = "\n" + (self.indent); res = Opal.yieldX(block, []); self.indent = indent; self.space = "\n" + (self.indent); return res; }, TMP_18.$$arity = 0); Opal.defn(self, '$with_temp', TMP_19 = function $$with_temp() { var self = this, $iter = TMP_19.$$p, block = $iter || nil, tmp = nil, res = nil; TMP_19.$$p = null; tmp = self.scope.$new_temp(); res = Opal.yield1(block, tmp); self.scope.$queue_temp(tmp); return res; }, TMP_19.$$arity = 0); Opal.defn(self, '$in_while', TMP_20 = function $$in_while() { var self = this, $iter = TMP_20.$$p, $yield = $iter || nil, result = nil; TMP_20.$$p = null; if (($yield !== nil)) { } else { return nil }; self.while_loop = self.scope.$push_while(); result = Opal.yieldX($yield, []); self.scope.$pop_while(); return result; }, TMP_20.$$arity = 0); Opal.defn(self, '$in_ensure', TMP_21 = function $$in_ensure() { var self = this, $iter = TMP_21.$$p, $yield = $iter || nil, result = nil; TMP_21.$$p = null; if (($yield !== nil)) { } else { return nil }; self.in_ensure = true; result = Opal.yieldX($yield, []); self.in_ensure = false; return result; }, TMP_21.$$arity = 0); Opal.defn(self, '$in_ensure?', TMP_22 = function() { var self = this; return self.in_ensure; }, TMP_22.$$arity = 0); Opal.defn(self, '$has_break?', TMP_23 = function() { var self = this, $iter = TMP_23.$$p, $yield = $iter || nil, result = nil, detected = nil; TMP_23.$$p = null; if (($yield !== nil)) { } else { return self.break_detected }; self.break_detected = false; result = Opal.yieldX($yield, []); detected = self.break_detected; self.break_detected = nil; return detected; }, TMP_23.$$arity = 0); Opal.defn(self, '$has_break!', TMP_24 = function() { var self = this; if (self.break_detected['$=='](false)) { return self.break_detected = true } else { return nil }; }, TMP_24.$$arity = 0); Opal.defn(self, '$in_case', TMP_25 = function $$in_case() { var self = this, $iter = TMP_25.$$p, $yield = $iter || nil, old = nil; TMP_25.$$p = null; if (($yield !== nil)) { } else { return nil }; old = self.case_stmt; self.case_stmt = $hash2([], {}); Opal.yieldX($yield, []); return self.case_stmt = old; }, TMP_25.$$arity = 0); Opal.defn(self, '$in_while?', TMP_26 = function() { var self = this; return self.scope['$in_while?'](); }, TMP_26.$$arity = 0); Opal.defn(self, '$process', TMP_27 = function $$process(sexp, level) { var $a, self = this, handler = nil; if (level == null) { level = "expr"; } if (sexp['$=='](nil)) { return self.$fragment("", self.$scope())}; if ((($a = handler = self.$handlers()['$[]'](sexp.$type())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return handler.$new(sexp, level, self).$compile_to_fragments() } else { return self.$raise("Unsupported sexp: " + (sexp.$type())) }; }, TMP_27.$$arity = -2); Opal.defn(self, '$handlers', TMP_28 = function $$handlers() { var $a, self = this; return ((($a = self.handlers) !== false && $a !== nil && $a != null) ? $a : self.handlers = (((($scope.get('Opal')).$$scope.get('Nodes'))).$$scope.get('Base')).$handlers()); }, TMP_28.$$arity = 0); Opal.defn(self, '$requires', TMP_29 = function $$requires() { var $a, self = this; return ((($a = self.requires) !== false && $a !== nil && $a != null) ? $a : self.requires = []); }, TMP_29.$$arity = 0); Opal.defn(self, '$required_trees', TMP_30 = function $$required_trees() { var $a, self = this; return ((($a = self.required_trees) !== false && $a !== nil && $a != null) ? $a : self.required_trees = []); }, TMP_30.$$arity = 0); Opal.defn(self, '$returns', TMP_31 = function $$returns(sexp) { var $a, $b, self = this, $case = nil, last = nil, return_sexp = nil; if (sexp !== false && sexp !== nil && sexp != null) { } else { return self.$returns(self.$s("nil")) }; return (function() {$case = sexp.$type();if ("undef"['$===']($case)) {last = sexp.$pop(); return sexp['$<<'](self.$returns(last));}else if ("break"['$===']($case) || "next"['$===']($case) || "redo"['$===']($case)) {return sexp}else if ("yield"['$===']($case)) {sexp['$[]='](0, "returnable_yield"); return sexp;}else if ("scope"['$===']($case)) {sexp['$[]='](1, self.$returns(sexp['$[]'](1))); return sexp;}else if ("block"['$===']($case)) {if ((($a = $rb_gt(sexp.$length(), 1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sexp['$[]='](-1, self.$returns(sexp['$[]'](-1))) } else { sexp['$<<'](self.$returns(self.$s("nil"))) }; return sexp;}else if ("when"['$===']($case)) {sexp['$[]='](2, self.$returns(sexp['$[]'](2))); return sexp;}else if ("rescue"['$===']($case)) {sexp['$[]='](1, self.$returns(sexp['$[]'](1))); if ((($a = ($b = sexp['$[]'](2), $b !== false && $b !== nil && $b != null ?sexp['$[]'](2)['$[]'](0)['$==']("resbody") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = sexp['$[]'](2)['$[]'](2)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { sexp['$[]'](2)['$[]='](2, self.$returns(sexp['$[]'](2)['$[]'](2))) } else { sexp['$[]'](2)['$[]='](2, self.$returns(self.$s("nil"))) }}; return sexp;}else if ("ensure"['$===']($case)) {sexp['$[]='](1, self.$returns(sexp['$[]'](1))); return sexp;}else if ("begin"['$===']($case)) {sexp['$[]='](1, self.$returns(sexp['$[]'](1))); return sexp;}else if ("rescue_mod"['$===']($case)) {sexp['$[]='](1, self.$returns(sexp['$[]'](1))); sexp['$[]='](2, self.$returns(sexp['$[]'](2))); return sexp;}else if ("while"['$===']($case)) {return sexp}else if ("return"['$===']($case) || "js_return"['$===']($case)) {return sexp}else if ("xstr"['$===']($case)) {if ((($a = /return|;/['$=~'](sexp['$[]'](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { sexp['$[]='](1, "return " + (sexp['$[]'](1)) + ";") }; return sexp;}else if ("dxstr"['$===']($case)) {if ((($a = /return|;|\n/['$=~'](sexp['$[]'](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { sexp['$[]='](1, "return " + (sexp['$[]'](1))) }; return sexp;}else if ("if"['$===']($case)) {sexp['$[]='](2, self.$returns(((($a = sexp['$[]'](2)) !== false && $a !== nil && $a != null) ? $a : self.$s("nil")))); sexp['$[]='](3, self.$returns(((($a = sexp['$[]'](3)) !== false && $a !== nil && $a != null) ? $a : self.$s("nil")))); return sexp;}else {return_sexp = self.$s("js_return", sexp); (($a = [sexp.$source()]), $b = return_sexp, $b['$source='].apply($b, $a), $a[$a.length-1]); return return_sexp;}})(); }, TMP_31.$$arity = 1); return (Opal.defn(self, '$handle_block_given_call', TMP_32 = function $$handle_block_given_call(sexp) { var $a, $b, self = this, scope = nil; self.scope['$uses_block!'](); if ((($a = self.scope.$block_name()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$fragment("(" + (self.scope.$block_name()) + " !== nil)", self.$scope(), sexp) } else if ((($a = ($b = scope = self.scope.$find_parent_def(), $b !== false && $b !== nil && $b != null ?scope.$block_name() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$fragment("(" + (scope.$block_name()) + " !== nil)", scope, sexp) } else { return self.$fragment("false", scope, sexp) }; }, TMP_32.$$arity = 1), nil) && 'handle_block_given_call'; })($scope.base, null); })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["native"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $range = Opal.range, $hash2 = Opal.hash2, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$try_convert', '$native?', '$respond_to?', '$to_n', '$raise', '$inspect', '$Native', '$proc', '$map!', '$end_with?', '$define_method', '$[]', '$convert', '$call', '$to_proc', '$new', '$each', '$native_reader', '$native_writer', '$extend', '$is_a?', '$map', '$alias_method', '$to_a', '$_Array', '$include', '$method_missing', '$bind', '$instance_method', '$[]=', '$slice', '$-', '$length', '$enum_for', '$===', '$>=', '$<<', '$each_pair', '$_initialize', '$name', '$exiting_mid', '$native_module']); (function($base) { var $Native, self = $Native = $module($base, 'Native'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_19, TMP_20, TMP_21; Opal.defs(self, '$is_a?', TMP_1 = function(object, klass) { var self = this; try { return object instanceof self.$try_convert(klass); } catch (e) { return false; } ; }, TMP_1.$$arity = 2); Opal.defs(self, '$try_convert', TMP_2 = function $$try_convert(value, default$) { var self = this; if (default$ == null) { default$ = nil; } if (self['$native?'](value)) { return value; } else if (value['$respond_to?']("to_n")) { return value.$to_n(); } else { return default$; } ; }, TMP_2.$$arity = -2); Opal.defs(self, '$convert', TMP_3 = function $$convert(value) { var self = this; if (self['$native?'](value)) { return value; } else if (value['$respond_to?']("to_n")) { return value.$to_n(); } else { self.$raise($scope.get('ArgumentError'), "" + (value.$inspect()) + " isn't native"); } ; }, TMP_3.$$arity = 1); Opal.defs(self, '$call', TMP_4 = function $$call(obj, key, $a_rest) { var self = this, args, $iter = TMP_4.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 2; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 2; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 2] = arguments[$arg_idx]; } TMP_4.$$p = null; var prop = obj[key]; if (prop instanceof Function) { var converted = new Array(args.length); for (var i = 0, l = args.length; i < l; i++) { var item = args[i], conv = self.$try_convert(item); converted[i] = conv === nil ? item : conv; } if (block !== nil) { converted.push(block); } return self.$Native(prop.apply(obj, converted)); } else { return self.$Native(prop); } ; }, TMP_4.$$arity = -3); Opal.defs(self, '$proc', TMP_5 = function $$proc() { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('LocalJumpError'), "no block given") }; return ($a = ($b = $scope.get('Kernel')).$proc, $a.$$p = (TMP_6 = function($c_rest){var self = TMP_6.$$s || this, args, $d, $e, TMP_7, instance = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } ($d = ($e = args)['$map!'], $d.$$p = (TMP_7 = function(arg){var self = TMP_7.$$s || this; if (arg == null) arg = nil; return self.$Native(arg)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $d).call($e); instance = self.$Native(this); // if global is current scope, run the block in the scope it was defined if (this === Opal.global) { return block.apply(self, args); } var self_ = block.$$s; block.$$s = null; try { return block.apply(instance, args); } finally { block.$$s = self_; } ;}, TMP_6.$$s = self, TMP_6.$$arity = -1, TMP_6), $a).call($b); }, TMP_5.$$arity = 0); (function($base) { var $Helpers, self = $Helpers = $module($base, 'Helpers'); var def = self.$$proto, $scope = self.$$scope, TMP_11, TMP_14, TMP_17, TMP_18; Opal.defn(self, '$alias_native', TMP_11 = function $$alias_native(new$, $old, $kwargs) { var $a, $b, TMP_8, $c, TMP_9, $d, TMP_10, self = this, $post_args, as, old; $post_args = Opal.slice.call(arguments, 1, arguments.length); $kwargs = Opal.extract_kwargs($post_args); if ($kwargs == null || !$kwargs.$$is_hash) { if ($kwargs == null) { $kwargs = $hash2([], {}); } else { throw Opal.ArgumentError.$new('expected kwargs'); } } if ((as = $kwargs.$$smap['as']) == null) { as = nil } if (0 < $post_args.length) { old = $post_args.splice(0,1)[0]; } if (old == null) { old = new$; } if ((($a = old['$end_with?']("=")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$define_method, $a.$$p = (TMP_8 = function(value){var self = TMP_8.$$s || this; if (self["native"] == null) self["native"] = nil; if (value == null) value = nil; self["native"][old['$[]']($range(0, -2, false))] = $scope.get('Native').$convert(value); return value;}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $a).call($b, new$) } else if (as !== false && as !== nil && as != null) { return ($a = ($c = self).$define_method, $a.$$p = (TMP_9 = function($d_rest){var self = TMP_9.$$s || this, block, args, $e, $f, $g, value = nil; if (self["native"] == null) self["native"] = nil; block = TMP_9.$$p || nil, TMP_9.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($e = value = ($f = ($g = $scope.get('Native')).$call, $f.$$p = block.$to_proc(), $f).apply($g, [self["native"], old].concat(Opal.to_a(args)))) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { return as.$new(value.$to_n()) } else { return nil }}, TMP_9.$$s = self, TMP_9.$$arity = -1, TMP_9), $a).call($c, new$) } else { return ($a = ($d = self).$define_method, $a.$$p = (TMP_10 = function($e_rest){var self = TMP_10.$$s || this, block, args, $f, $g; if (self["native"] == null) self["native"] = nil; block = TMP_10.$$p || nil, TMP_10.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($f = ($g = $scope.get('Native')).$call, $f.$$p = block.$to_proc(), $f).apply($g, [self["native"], old].concat(Opal.to_a(args)))}, TMP_10.$$s = self, TMP_10.$$arity = -1, TMP_10), $a).call($d, new$) }; }, TMP_11.$$arity = -2); Opal.defn(self, '$native_reader', TMP_14 = function $$native_reader($a_rest) { var $b, $c, TMP_12, self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = names).$each, $b.$$p = (TMP_12 = function(name){var self = TMP_12.$$s || this, $a, $d, TMP_13; if (name == null) name = nil; return ($a = ($d = self).$define_method, $a.$$p = (TMP_13 = function(){var self = TMP_13.$$s || this; if (self["native"] == null) self["native"] = nil; return self.$Native(self["native"][name])}, TMP_13.$$s = self, TMP_13.$$arity = 0, TMP_13), $a).call($d, name)}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $b).call($c); }, TMP_14.$$arity = -1); Opal.defn(self, '$native_writer', TMP_17 = function $$native_writer($a_rest) { var $b, $c, TMP_15, self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = names).$each, $b.$$p = (TMP_15 = function(name){var self = TMP_15.$$s || this, $a, $d, TMP_16; if (name == null) name = nil; return ($a = ($d = self).$define_method, $a.$$p = (TMP_16 = function(value){var self = TMP_16.$$s || this; if (self["native"] == null) self["native"] = nil; if (value == null) value = nil; return self.$Native(self["native"][name] = value)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($d, "" + (name) + "=")}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $b).call($c); }, TMP_17.$$arity = -1); Opal.defn(self, '$native_accessor', TMP_18 = function $$native_accessor($a_rest) { var $b, $c, self = this, names; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } ($b = self).$native_reader.apply($b, Opal.to_a(names)); return ($c = self).$native_writer.apply($c, Opal.to_a(names)); }, TMP_18.$$arity = -1); })($scope.base); Opal.defs(self, '$included', TMP_19 = function $$included(klass) { var self = this; return klass.$extend($scope.get('Helpers')); }, TMP_19.$$arity = 1); Opal.defn(self, '$initialize', TMP_20 = function $$initialize(native$) { var $a, self = this; if ((($a = $scope.get('Kernel')['$native?'](native$)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { $scope.get('Kernel').$raise($scope.get('ArgumentError'), "" + (native$.$inspect()) + " isn't native") }; return self["native"] = native$; }, TMP_20.$$arity = 1); Opal.defn(self, '$to_n', TMP_21 = function $$to_n() { var self = this; if (self["native"] == null) self["native"] = nil; return self["native"]; }, TMP_21.$$arity = 0); })($scope.base); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_22, TMP_25, TMP_26; Opal.defn(self, '$native?', TMP_22 = function(value) { var self = this; return value == null || !value.$$class; }, TMP_22.$$arity = 1); Opal.defn(self, '$Native', TMP_25 = function $$Native(obj) { var $a, $b, TMP_23, $c, TMP_24, self = this; if ((($a = obj == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else if ((($a = self['$native?'](obj)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Native')).$$scope.get('Object')).$new(obj) } else if ((($a = obj['$is_a?']($scope.get('Array'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = obj).$map, $a.$$p = (TMP_23 = function(o){var self = TMP_23.$$s || this; if (o == null) o = nil; return self.$Native(o)}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23), $a).call($b) } else if ((($a = obj['$is_a?']($scope.get('Proc'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = self).$proc, $a.$$p = (TMP_24 = function($d_rest){var self = TMP_24.$$s || this, block, args, $e, $f; block = TMP_24.$$p || nil, TMP_24.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return self.$Native(($e = ($f = obj).$call, $e.$$p = block.$to_proc(), $e).apply($f, Opal.to_a(args)))}, TMP_24.$$s = self, TMP_24.$$arity = -1, TMP_24), $a).call($c) } else { return obj }; }, TMP_25.$$arity = 1); self.$alias_method("_Array", "Array"); Opal.defn(self, '$Array', TMP_26 = function $$Array(object, $a_rest) { var $b, $c, self = this, args, $iter = TMP_26.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_26.$$p = null; if ((($b = self['$native?'](object)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = (($scope.get('Native')).$$scope.get('Array'))).$new, $b.$$p = block.$to_proc(), $b).apply($c, [object].concat(Opal.to_a(args))).$to_a()}; return self.$_Array(object); }, TMP_26.$$arity = -2); })($scope.base); (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41; def["native"] = nil; self.$include(Opal.get('Native')); Opal.defn(self, '$==', TMP_27 = function(other) { var self = this; return self["native"] === $scope.get('Native').$try_convert(other); }, TMP_27.$$arity = 1); Opal.defn(self, '$has_key?', TMP_28 = function(name) { var self = this; return Opal.hasOwnProperty.call(self["native"], name); }, TMP_28.$$arity = 1); Opal.alias(self, 'key?', 'has_key?'); Opal.alias(self, 'include?', 'has_key?'); Opal.alias(self, 'member?', 'has_key?'); Opal.defn(self, '$each', TMP_29 = function $$each($a_rest) { var $b, self = this, args, $iter = TMP_29.$$p, $yield = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_29.$$p = null; if (($yield !== nil)) { for (var key in self["native"]) { Opal.yieldX($yield, [key, self["native"][key]]) } ; return self; } else { return ($b = self).$method_missing.apply($b, ["each"].concat(Opal.to_a(args))) }; }, TMP_29.$$arity = -1); Opal.defn(self, '$[]', TMP_30 = function(key) { var self = this; var prop = self["native"][key]; if (prop instanceof Function) { return prop; } else { return Opal.get('Native').$call(self["native"], key) } ; }, TMP_30.$$arity = 1); Opal.defn(self, '$[]=', TMP_31 = function(key, value) { var $a, self = this, native$ = nil; native$ = $scope.get('Native').$try_convert(value); if ((($a = native$ === nil) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"][key] = value; } else { return self["native"][key] = native$; }; }, TMP_31.$$arity = 2); Opal.defn(self, '$merge!', TMP_32 = function(other) { var self = this; other = $scope.get('Native').$convert(other); for (var prop in other) { self["native"][prop] = other[prop]; } ; return self; }, TMP_32.$$arity = 1); Opal.defn(self, '$respond_to?', TMP_33 = function(name, include_all) { var self = this; if (include_all == null) { include_all = false; } return $scope.get('Kernel').$instance_method("respond_to?").$bind(self).$call(name, include_all); }, TMP_33.$$arity = -2); Opal.defn(self, '$respond_to_missing?', TMP_34 = function(name, include_all) { var self = this; if (include_all == null) { include_all = false; } return Opal.hasOwnProperty.call(self["native"], name); }, TMP_34.$$arity = -2); Opal.defn(self, '$method_missing', TMP_35 = function $$method_missing(mid, $a_rest) { var $b, $c, self = this, args, $iter = TMP_35.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_35.$$p = null; if (mid.charAt(mid.length - 1) === '=') { return self['$[]='](mid.$slice(0, $rb_minus(mid.$length(), 1)), args['$[]'](0)); } else { return ($b = ($c = Opal.get('Native')).$call, $b.$$p = block.$to_proc(), $b).apply($c, [self["native"], mid].concat(Opal.to_a(args))); } ; }, TMP_35.$$arity = -2); Opal.defn(self, '$nil?', TMP_36 = function() { var self = this; return false; }, TMP_36.$$arity = 0); Opal.defn(self, '$is_a?', TMP_37 = function(klass) { var self = this; return Opal.is_a(self, klass); }, TMP_37.$$arity = 1); Opal.alias(self, 'kind_of?', 'is_a?'); Opal.defn(self, '$instance_of?', TMP_38 = function(klass) { var self = this; return self.$$class === klass; }, TMP_38.$$arity = 1); Opal.defn(self, '$class', TMP_39 = function() { var self = this; return self.$$class; }, TMP_39.$$arity = 0); Opal.defn(self, '$to_a', TMP_40 = function $$to_a(options) { var $a, $b, self = this, $iter = TMP_40.$$p, block = $iter || nil; if (options == null) { options = $hash2([], {}); } TMP_40.$$p = null; return ($a = ($b = (($scope.get('Native')).$$scope.get('Array'))).$new, $a.$$p = block.$to_proc(), $a).call($b, self["native"], options).$to_a(); }, TMP_40.$$arity = -1); return (Opal.defn(self, '$inspect', TMP_41 = function $$inspect() { var self = this; return "#"; }, TMP_41.$$arity = 0), nil) && 'inspect'; })($scope.get('Native'), $scope.get('BasicObject')); (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48; def.named = def["native"] = def.get = def.block = def.set = def.length = nil; self.$include($scope.get('Native')); self.$include($scope.get('Enumerable')); Opal.defn(self, '$initialize', TMP_42 = function $$initialize(native$, options) { var $a, $b, self = this, $iter = TMP_42.$$p, block = $iter || nil; if (options == null) { options = $hash2([], {}); } TMP_42.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_42, false)), $a.$$p = null, $a).call($b, native$); self.get = ((($a = options['$[]']("get")) !== false && $a !== nil && $a != null) ? $a : options['$[]']("access")); self.named = options['$[]']("named"); self.set = ((($a = options['$[]']("set")) !== false && $a !== nil && $a != null) ? $a : options['$[]']("access")); self.length = ((($a = options['$[]']("length")) !== false && $a !== nil && $a != null) ? $a : "length"); self.block = block; if ((($a = self.$length() == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('ArgumentError'), "no length found on the array-like object") } else { return nil }; }, TMP_42.$$arity = -2); Opal.defn(self, '$each', TMP_43 = function $$each() { var self = this, $iter = TMP_43.$$p, block = $iter || nil; TMP_43.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$enum_for("each") }; for (var i = 0, length = self.$length(); i < length; i++) { Opal.yield1(block, self['$[]'](i)); } ; return self; }, TMP_43.$$arity = 0); Opal.defn(self, '$[]', TMP_44 = function(index) { var $a, self = this, result = nil, $case = nil; result = (function() {$case = index;if ($scope.get('String')['$===']($case) || $scope.get('Symbol')['$===']($case)) {if ((($a = self.named) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"][self.named](index); } else { return self["native"][index]; }}else if ($scope.get('Integer')['$===']($case)) {if ((($a = self.get) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"][self.get](index); } else { return self["native"][index]; }}else { return nil }})(); if (result !== false && result !== nil && result != null) { if ((($a = self.block) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.block.$call(result) } else { return self.$Native(result) } } else { return nil }; }, TMP_44.$$arity = 1); Opal.defn(self, '$[]=', TMP_45 = function(index, value) { var $a, self = this; if ((($a = self.set) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"][self.set](index, $scope.get('Native').$convert(value)); } else { return self["native"][index] = $scope.get('Native').$convert(value); }; }, TMP_45.$$arity = 2); Opal.defn(self, '$last', TMP_46 = function $$last(count) { var $a, $b, self = this, index = nil, result = nil; if (count == null) { count = nil; } if (count !== false && count !== nil && count != null) { index = $rb_minus(self.$length(), 1); result = []; while ((($b = $rb_ge(index, 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { result['$<<'](self['$[]'](index)); index = $rb_minus(index, 1);}; return result; } else { return self['$[]']($rb_minus(self.$length(), 1)) }; }, TMP_46.$$arity = -1); Opal.defn(self, '$length', TMP_47 = function $$length() { var self = this; return self["native"][self.length]; }, TMP_47.$$arity = 0); Opal.alias(self, 'to_ary', 'to_a'); return (Opal.defn(self, '$inspect', TMP_48 = function $$inspect() { var self = this; return self.$to_a().$inspect(); }, TMP_48.$$arity = 0), nil) && 'inspect'; })($scope.get('Native'), null); (function($base, $super) { function $Numeric(){}; var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); var def = self.$$proto, $scope = self.$$scope, TMP_49; return (Opal.defn(self, '$to_n', TMP_49 = function $$to_n() { var self = this; return self.valueOf(); }, TMP_49.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Proc(){}; var self = $Proc = $klass($base, $super, 'Proc', $Proc); var def = self.$$proto, $scope = self.$$scope, TMP_50; return (Opal.defn(self, '$to_n', TMP_50 = function $$to_n() { var self = this; return self; }, TMP_50.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_51; return (Opal.defn(self, '$to_n', TMP_51 = function $$to_n() { var self = this; return self.valueOf(); }, TMP_51.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Regexp(){}; var self = $Regexp = $klass($base, $super, 'Regexp', $Regexp); var def = self.$$proto, $scope = self.$$scope, TMP_52; return (Opal.defn(self, '$to_n', TMP_52 = function $$to_n() { var self = this; return self.valueOf(); }, TMP_52.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $MatchData(){}; var self = $MatchData = $klass($base, $super, 'MatchData', $MatchData); var def = self.$$proto, $scope = self.$$scope, TMP_53; def.matches = nil; return (Opal.defn(self, '$to_n', TMP_53 = function $$to_n() { var self = this; return self.matches; }, TMP_53.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Struct(){}; var self = $Struct = $klass($base, $super, 'Struct', $Struct); var def = self.$$proto, $scope = self.$$scope, TMP_55; return (Opal.defn(self, '$to_n', TMP_55 = function $$to_n() { var $a, $b, TMP_54, self = this, result = nil; result = {}; ($a = ($b = self).$each_pair, $a.$$p = (TMP_54 = function(name, value){var self = TMP_54.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return result[name] = $scope.get('Native').$try_convert(value, value);}, TMP_54.$$s = self, TMP_54.$$arity = 2, TMP_54), $a).call($b); return result; }, TMP_55.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, TMP_56; return (Opal.defn(self, '$to_n', TMP_56 = function $$to_n() { var self = this; var result = []; for (var i = 0, length = self.length; i < length; i++) { var obj = self[i]; result.push($scope.get('Native').$try_convert(obj, obj)); } return result; }, TMP_56.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Boolean(){}; var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean); var def = self.$$proto, $scope = self.$$scope, TMP_57; return (Opal.defn(self, '$to_n', TMP_57 = function $$to_n() { var self = this; return self.valueOf(); }, TMP_57.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Time(){}; var self = $Time = $klass($base, $super, 'Time', $Time); var def = self.$$proto, $scope = self.$$scope, TMP_58; return (Opal.defn(self, '$to_n', TMP_58 = function $$to_n() { var self = this; return self; }, TMP_58.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $NilClass(){}; var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); var def = self.$$proto, $scope = self.$$scope, TMP_59; return (Opal.defn(self, '$to_n', TMP_59 = function $$to_n() { var self = this; return null; }, TMP_59.$$arity = 0), nil) && 'to_n' })($scope.base, null); (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_60, TMP_61; self.$alias_method("_initialize", "initialize"); Opal.defn(self, '$initialize', TMP_60 = function $$initialize(defaults) { var $a, $b, self = this, $iter = TMP_60.$$p, block = $iter || nil; TMP_60.$$p = null; if (defaults != null && defaults.constructor === Object) { var smap = self.$$smap, keys = self.$$keys, key, value; for (key in defaults) { value = defaults[key]; if (value && value.constructor === Object) { smap[key] = $scope.get('Hash').$new(value); } else if (value && value.$$is_array) { value = value.map(function(item) { if (item && item.constructor === Object) { return $scope.get('Hash').$new(item); } return item; }); smap[key] = value } else { smap[key] = self.$Native(value); } keys.push(key); } return self; } return ($a = ($b = self).$_initialize, $a.$$p = block.$to_proc(), $a).call($b, defaults); }, TMP_60.$$arity = -1); return (Opal.defn(self, '$to_n', TMP_61 = function $$to_n() { var self = this; var result = {}, keys = self.$$keys, smap = self.$$smap, key, value; for (var i = 0, length = keys.length; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = smap[key]; } else { key = key.key; value = key.value; } result[key] = $scope.get('Native').$try_convert(value, value); } return result; }, TMP_61.$$arity = 0), nil) && 'to_n'; })($scope.base, null); (function($base, $super) { function $Module(){}; var self = $Module = $klass($base, $super, 'Module', $Module); var def = self.$$proto, $scope = self.$$scope, TMP_62; return (Opal.defn(self, '$native_module', TMP_62 = function $$native_module() { var self = this; return Opal.global[self.$name()] = self; }, TMP_62.$$arity = 0), nil) && 'native_module' })($scope.base, null); (function($base, $super) { function $Class(){}; var self = $Class = $klass($base, $super, 'Class', $Class); var def = self.$$proto, $scope = self.$$scope, TMP_63, TMP_64; Opal.defn(self, '$native_alias', TMP_63 = function $$native_alias(new_jsid, existing_mid) { var self = this; var aliased = self.$$proto['$' + existing_mid]; if (!aliased) { self.$raise($scope.get('NameError').$new("undefined method `" + (existing_mid) + "' for class `" + (self.$inspect()) + "'", self.$exiting_mid())); } self.$$proto[new_jsid] = aliased; ; }, TMP_63.$$arity = 2); return (Opal.defn(self, '$native_class', TMP_64 = function $$native_class() { var self = this; self.$native_module(); self["new"] = self.$new; }, TMP_64.$$arity = 0), nil) && 'native_class'; })($scope.base, null); return $gvars.$ = $gvars.global = self.$Native(Opal.global); }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/utils"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $module = Opal.module; Opal.add_stubs(['$size', '$min', '$scan', '$gsub', '$proc', '$===', '$merge', '$to_proc', '$merge!']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base) { var $Utils, self = $Utils = $module($base, 'Utils'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_5; Opal.defs(self, '$heredoc', TMP_1 = function $$heredoc(string) { var self = this, indent = nil; indent = (function() { try {return string.$scan(/^[ \t]*(?=\S)/).$min().$size() } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return 0 } else { throw $err; } }})(); return string.$gsub((new RegExp("^[ \\t]{" + indent + "}")), ""); }, TMP_1.$$arity = 1); Opal.defs(self, '$deep_merge', TMP_3 = function $$deep_merge(a, b) { var $a, $b, TMP_2, $c, self = this, merger = nil; merger = ($a = ($b = self).$proc, $a.$$p = (TMP_2 = function(key, v1, v2){var self = TMP_2.$$s || this, $c, $d; if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil; if ((($c = ($d = $scope.get('Hash')['$==='](v1), $d !== false && $d !== nil && $d != null ?$scope.get('Hash')['$==='](v2) : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return ($c = ($d = v1).$merge, $c.$$p = merger.$to_proc(), $c).call($d, v2) } else { return v2 }}, TMP_2.$$s = self, TMP_2.$$arity = 3, TMP_2), $a).call($b); return ($a = ($c = a).$merge, $a.$$p = merger.$to_proc(), $a).call($c, b); }, TMP_3.$$arity = 2); Opal.defs(self, '$deep_merge!', TMP_5 = function(a, b) { var $a, $b, TMP_4, $c, self = this, merger = nil; merger = ($a = ($b = self).$proc, $a.$$p = (TMP_4 = function(key, v1, v2){var self = TMP_4.$$s || this, $c, $d; if (key == null) key = nil;if (v1 == null) v1 = nil;if (v2 == null) v2 = nil; if ((($c = ($d = $scope.get('Hash')['$==='](v1), $d !== false && $d !== nil && $d != null ?$scope.get('Hash')['$==='](v2) : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { ($c = ($d = v1)['$merge!'], $c.$$p = merger.$to_proc(), $c).call($d, v2); return v1; } else { return v2 }}, TMP_4.$$s = self, TMP_4.$$arity = 3, TMP_4), $a).call($b); return ($a = ($c = a)['$merge!'], $a.$$p = merger.$to_proc(), $a).call($c, b); }, TMP_5.$$arity = 2); })($scope.base) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/helpers"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$define_method', '$instance_exec', '$to_proc', '$do', '$defhelper', '$[]=']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_4; Opal.defs(self, '$defhelper', TMP_1 = function $$defhelper(name) { var $a, $b, TMP_2, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; return ($a = ($b = self).$define_method, $a.$$p = (TMP_2 = function($c_rest){var self = TMP_2.$$s || this, body, args, $d, $e, $f; body = TMP_2.$$p || nil, TMP_2.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } ($d = ($e = self).$instance_exec, $d.$$p = block.$to_proc(), $d).apply($e, Opal.to_a(args)); if (body !== false && body !== nil && body != null) { ($d = ($f = self).$do, $d.$$p = body.$to_proc(), $d).call($f)}; return self;}, TMP_2.$$s = self, TMP_2.$$arity = -1, TMP_2), $a).call($b, name); }, TMP_1.$$arity = 1); return (Opal.defs(self, '$defhelper!', TMP_4 = function(name, attribute) { var $a, $b, TMP_3, self = this; if (attribute == null) { attribute = name; } return ($a = ($b = self).$defhelper, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; if (self.attributes == null) self.attributes = nil; return self.attributes['$[]='](attribute, true)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($b, "" + (name) + "!"); }, TMP_4.$$arity = -2), nil) && 'defhelper!'; })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/a"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s', '$defhelper!', '$<<']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $A(){}; var self = $A = $klass($base, $super, 'A', $A); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, $c, TMP_3; ($a = ($b = $hash2(["href", "url", "rel", "relative", "target", "type", "lang", "language", "media"], {"href": "href", "url": "href", "rel": "rel", "relative": "rel", "target": "target", "type": "type", "lang": "hreflang", "language": "hreflang", "media": "media"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b); self['$defhelper!']("download"); self['$defhelper!']("ping"); return ($a = ($c = self).$defhelper, $a.$$p = (TMP_3 = function(string){var self = TMP_3.$$s || this; if (string == null) string = nil; return self['$<<'](string)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($c, "text"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/base"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Base(){}; var self = $Base = $klass($base, $super, 'Base', $Base); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = $hash2(["href", "url", "target"], {"href": "href", "url": "href", "target": "target"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/blockquote"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$defhelper', '$[]=', '$to_s']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Blockquote(){}; var self = $Blockquote = $klass($base, $super, 'Blockquote', $Blockquote); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = self).$defhelper, $a.$$p = (TMP_1 = function(value){var self = TMP_1.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]=']("cite", value.$to_s())}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b, "cite") })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/button"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s', '$defhelper!']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Button(){}; var self = $Button = $klass($base, $super, 'Button', $Button); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; ($a = ($b = $hash2(["form", "name", "type", "value", "action", "encoding", "method", "target"], {"form": "form", "name": "name", "type": "type", "value": "value", "action": "formaction", "encoding": "formenctype", "method": "formmethod", "target": "formtarget"})).$each, $a.$$p = (TMP_1 = function(name, attributes){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attributes == null) attributes = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b); self['$defhelper!']("autofocus"); return self['$defhelper!']("disabled"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/canvas"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Canvas(){}; var self = $Canvas = $klass($base, $super, 'Canvas', $Canvas); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = $hash2(["width", "height"], {"width": "width", "height": "height"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/embed"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Embed(){}; var self = $Embed = $klass($base, $super, 'Embed', $Embed); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = $hash2(["type", "height", "width"], {"type": "type", "height": "height", "width": "width"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/img"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Img(){}; var self = $Img = $klass($base, $super, 'Img', $Img); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, $c, TMP_3; ($a = ($b = $hash2(["src", "url", "alt", "description", "height", "width", "map"], {"src": "src", "url": "src", "alt": "alt", "description": "alt", "height": "height", "width": "width", "map": "usemap"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b); return ($a = ($c = self).$defhelper, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; if (self.attributes == null) self.attributes = nil; return self.attributes['$[]=']("ismap", true)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($c, "map!"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/input"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Input(){}; var self = $Input = $klass($base, $super, 'Input', $Input); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = $hash2(["type", "name", "value", "size", "place_holder", "read_only", "required", "limit"], {"type": "type", "name": "name", "value": "value", "size": "size", "place_holder": "placeholder", "read_only": "readonly", "required": "required", "limit": "maxlength"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/link"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$to_s']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Link(){}; var self = $Link = $klass($base, $super, 'Link', $Link); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = $hash2(["cross_origin", "href", "href_lang", "media", "rel", "sizes", "type"], {"cross_origin": "crossorigin", "href": "href", "href_lang": "hreflang", "media": "media", "rel": "rel", "sizes": "sizes", "type": "type"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/object"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$each', '$defhelper', '$[]=']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; return ($a = ($b = $hash2(["type", "data", "name", "height", "width"], {"type": "type", "data": "data", "name": "name", "height": "height", "width": "width"})).$each, $a.$$p = (TMP_1 = function(name, attribute){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil;if (attribute == null) attribute = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/option"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$defhelper!']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Option(){}; var self = $Option = $klass($base, $super, 'Option', $Option); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; ($a = ($b = ["label", "value"]).$each, $a.$$p = (TMP_1 = function(name){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); self['$defhelper!']("disabled"); return self['$defhelper!']("selected"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/optgroup"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$defhelper!']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Optgroup(){}; var self = $Optgroup = $klass($base, $super, 'Optgroup', $Optgroup); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; ($a = ($b = ["label", "value"]).$each, $a.$$p = (TMP_1 = function(name){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); self['$defhelper!']("disabled"); return self['$defhelper!']("selected"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/select"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$each', '$defhelper', '$[]=', '$defhelper!']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Select(){}; var self = $Select = $klass($base, $super, 'Select', $Select); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; ($a = ($b = ["form", "name", "size"]).$each, $a.$$p = (TMP_1 = function(name){var self = TMP_1.$$s || this, $c, $d, TMP_2; if (name == null) name = nil; return ($c = ($d = self).$defhelper, $c.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $c).call($d, name)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); self['$defhelper!']("auto_focus", "autofocus"); self['$defhelper!']("disabled"); return self['$defhelper!']("required"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element/td"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$defhelper', '$[]=', '$to_s', '$join']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Td(){}; var self = $Td = $klass($base, $super, 'Td', $Td); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, $c, TMP_2, $d, TMP_3; ($a = ($b = self).$defhelper, $a.$$p = (TMP_1 = function(value){var self = TMP_1.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]=']("colspan", value.$to_s())}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b, "columns"); ($a = ($c = self).$defhelper, $a.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this; if (self.attributes == null) self.attributes = nil; if (value == null) value = nil; return self.attributes['$[]=']("rowspan", value.$to_s())}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($c, "rows"); return ($a = ($d = self).$defhelper, $a.$$p = (TMP_3 = function($e_rest){var self = TMP_3.$$s || this, args; if (self.attributes == null) self.attributes = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return self.attributes['$[]=']("headers", args.$join(" "))}, TMP_3.$$s = self, TMP_3.$$arity = -1, TMP_3), $a).call($d, "headers"); })($scope.base, self) })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html/element"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2, $range = Opal.range; Opal.add_stubs(['$require', '$==', '$capitalize', '$const_defined?', '$new', '$const_get', '$each', '$to_proc', '$<<', '$end_with?', '$to_s', '$[]=', '$[]', '$===', '$has_key?', '$unshift', '$|', '$split', '$delete', '$to_a', '$deep_merge!', '$>>', '$extend!', '$pop', '$join', '$heredoc', '$defhelper', '$map', '$empty?', '$upcase', '$inspect']); self.$require("paggio/html/element/a"); self.$require("paggio/html/element/base"); self.$require("paggio/html/element/blockquote"); self.$require("paggio/html/element/button"); self.$require("paggio/html/element/canvas"); self.$require("paggio/html/element/embed"); self.$require("paggio/html/element/img"); self.$require("paggio/html/element/input"); self.$require("paggio/html/element/link"); self.$require("paggio/html/element/object"); self.$require("paggio/html/element/option"); self.$require("paggio/html/element/optgroup"); self.$require("paggio/html/element/select"); self.$require("paggio/html/element/td"); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, $a, $b, TMP_9, $c, TMP_11, TMP_13; def.children = def.attributes = def.class_names = def.owner = def.name = nil; Opal.defs(self, '$new', TMP_1 = function(owner, name, attributes) { var $a, $b, $c, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, const$ = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; if (attributes == null) { attributes = $hash2([], {}); } TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (self['$==']($scope.get('Element'))) { } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_1, false, $Element)), $a.$$p = $iter, $a).apply($b, $zuper) }; const$ = name.$capitalize(); if ((($a = self['$const_defined?'](const$)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$const_get(const$).$new(owner, name, attributes) } else { return ($a = ($c = self, Opal.find_super_dispatcher(self, 'new', TMP_1, false, $Element)), $a.$$p = $iter, $a).apply($c, $zuper) }; }, TMP_1.$$arity = -3); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(owner, name, attributes) { var self = this; if (attributes == null) { attributes = $hash2([], {}); } self.owner = owner; self.name = name; self.attributes = attributes; self.children = []; return self.class_names = []; }, TMP_2.$$arity = -3); Opal.defn(self, '$each', TMP_3 = function $$each() { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; return ($a = ($b = self.children).$each, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_3.$$arity = 0); Opal.defn(self, '$<<', TMP_4 = function(what) { var self = this; self.children['$<<'](what); return self; }, TMP_4.$$arity = 1); Opal.defn(self, '$method_missing', TMP_5 = function $$method_missing(name, content) { var $a, $b, $c, self = this, $iter = TMP_5.$$p, block = $iter || nil; if (content == null) { content = nil; } TMP_5.$$p = null; if ((($a = name.$to_s()['$end_with?']("!")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.attributes['$[]=']("id", name['$[]']($range(0, -2, false))) } else { self.class_names['$<<'](name) }; if ((($a = Opal.get('Hash')['$==='](content)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ((($b = content['$has_key?']("class")) !== false && $b !== nil && $b != null) ? $b : content['$has_key?']("classes"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = self.class_names).$unshift.apply($a, Opal.to_a((content.$delete("class").$to_s().$split()['$|'](content.$delete("classes").$to_a()))))}; ((Opal.get('Paggio')).$$scope.get('Utils'))['$deep_merge!'](self.attributes, content); } else if (content !== false && content !== nil && content != null) { self['$>>'](content)}; if (block !== false && block !== nil && block != null) { ($b = ($c = self.owner)['$extend!'], $b.$$p = block.$to_proc(), $b).call($c, self)}; return self; }, TMP_5.$$arity = -2); Opal.defn(self, '$[]', TMP_6 = function($a_rest) { var $b, self = this, names, last = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = last = self.class_names.$pop()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.class_names['$<<']([last].concat(Opal.to_a(names)).$join("-"))}; return self; }, TMP_6.$$arity = -1); Opal.defn(self, '$do', TMP_7 = function() { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; ($a = ($b = self.owner)['$extend!'], $a.$$p = block.$to_proc(), $a).call($b, self); return self; }, TMP_7.$$arity = 0); Opal.defn(self, '$>>', TMP_8 = function(content) { var self = this; self['$<<'](((Opal.get('Paggio')).$$scope.get('Utils')).$heredoc(content.$to_s())); return self; }, TMP_8.$$arity = 1); ($a = ($b = self).$defhelper, $a.$$p = (TMP_9 = function(hash){var self = TMP_9.$$s || this, $c, $d, TMP_10; if (self.attributes == null) self.attributes = nil; if (hash == null) hash = nil; return self.attributes['$[]=']("style", ($c = ($d = hash).$map, $c.$$p = (TMP_10 = function(name, value){var self = TMP_10.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return "" + (name) + ": " + (value)}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $c).call($d).$join(";"))}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $a).call($b, "style"); ($a = ($c = self).$defhelper, $a.$$p = (TMP_11 = function(hash){var self = TMP_11.$$s || this, $d, $e, TMP_12; if (hash == null) hash = nil; return ($d = ($e = hash).$each, $d.$$p = (TMP_12 = function(name, value){var self = TMP_12.$$s || this; if (self.attributes == null) self.attributes = nil; if (name == null) name = nil;if (value == null) value = nil; return self.attributes['$[]=']("data-" + (name), value.$to_s())}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $d).call($e)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($c, "data"); return (Opal.defn(self, '$inspect', TMP_13 = function $$inspect() { var $a, self = this; if ((($a = self.children['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "#" } else { return "#" }; }, TMP_13.$$arity = 0), nil) && 'inspect'; })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/html"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$attr_reader', '$raise', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$<<', '$first', '$===', '$instance_eval', '$each', '$end_with?', '$to_s', '$empty?', '$heredoc', '$shift', '$new', '$[]', '$inspect']); self.$require("paggio/html/helpers"); self.$require("paggio/html/element"); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_9, TMP_11; def.current = def.roots = def.version = nil; self.$attr_reader("version"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(version) { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; if (version == null) { version = 5; } TMP_1.$$p = null; if (block !== false && block !== nil && block != null) { } else { Opal.get('Kernel').$raise(Opal.get('ArgumentError'), "no block given") }; self.version = version; self.roots = []; self.current = nil; if (block.$arity()['$=='](0)) { return ($a = ($b = self).$instance_exec, $a.$$p = block.$to_proc(), $a).call($b) } else { return block.$call(self) }; }, TMP_1.$$arity = -1); Opal.defn(self, '$<<', TMP_2 = function(what) { var $a, self = this; return (((($a = self.current) !== false && $a !== nil && $a != null) ? $a : self.roots))['$<<'](what); }, TMP_2.$$arity = 1); Opal.defn(self, '$root!', TMP_3 = function() { var self = this; return self.roots.$first(); }, TMP_3.$$arity = 0); Opal.defn(self, '$roots!', TMP_4 = function() { var self = this; return self.roots; }, TMP_4.$$arity = 0); Opal.defn(self, '$element!', TMP_5 = function() { var self = this; return self.current; }, TMP_5.$$arity = 0); Opal.defn(self, '$extend!', TMP_6 = function(element) { var $a, $b, TMP_7, self = this, $iter = TMP_6.$$p, block = $iter || nil, old = nil, result = nil; if (element == null) { element = nil; } TMP_6.$$p = null; $a = [self.current, element], old = $a[0], self.current = $a[1], $a; result = block.$call(self); if ((($a = Opal.get('String')['$==='](result)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = self.current).$instance_eval, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return self.inner_html = result}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $a).call($b)}; self.current = old; return self; }, TMP_6.$$arity = -1); Opal.defn(self, '$each', TMP_8 = function $$each() { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; return ($a = ($b = self.roots).$each, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_8.$$arity = 0); Opal.defn(self, '$method_missing', TMP_9 = function $$method_missing(name, $a_rest) { var $b, $c, $d, $e, TMP_10, self = this, args, $iter = TMP_9.$$p, block = $iter || nil, content = nil, element = nil, parent = nil, result = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_9.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($b = name.$to_s()['$end_with?']("!")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = self, Opal.find_super_dispatcher(self, 'method_missing', TMP_9, false)), $b.$$p = $iter, $b).apply($c, $zuper)}; if ((($b = ((($d = args['$empty?']()) !== false && $d !== nil && $d != null) ? $d : Opal.get('Hash')['$==='](args.$first()))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { content = ((Opal.get('Paggio')).$$scope.get('Utils')).$heredoc(args.$shift().$to_s()) }; element = ($b = $scope.get('Element')).$new.apply($b, [self, name].concat(Opal.to_a(args))); if (content !== false && content !== nil && content != null) { element['$<<'](content)}; if (block !== false && block !== nil && block != null) { parent = self.current; self.current = element; result = block.$call(self); self.current = parent; if ((($d = Opal.get('String')['$==='](result)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { ($d = ($e = element).$instance_eval, $d.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; return self.inner_html = result}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $d).call($e)};}; self['$<<'](element); return element; }, TMP_9.$$arity = -2); return (Opal.defn(self, '$inspect', TMP_11 = function $$inspect() { var $a, self = this; if ((($a = self.roots['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "#" } else { return "#" }; }, TMP_11.$$arity = 0), nil) && 'inspect'; })($scope.base, $scope.get('BasicObject')) })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css/unit"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } var $a, $b, TMP_23, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$map', '$to_proc', '$attr_reader', '$===', '$respond_to?', '$raise', '$class', '$to_u', '$new', '$==', '$convert', '$type', '$number', '$hash', '$each', '$define_method', '$+', '$compatible?', '$-', '$*', '$/', '$to_i', '$to_f', '$private', '$include?', '$class_eval', '$old_percent', '$match', '$[]', '$__send__', '$downcase']); (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Unit(){}; var self = $Unit = $klass($base, $super, 'Unit', $Unit); var def = self.$$proto, $scope = self.$$scope, $a, $b, $c, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, $d, TMP_6, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19; def.type = def.number = nil; Opal.cdecl($scope, 'TYPES', ($a = ($b = ["em", "ex", "ch", "rem", "vh", "vw", "vmin", "vmax", "px", "mm", "cm", "in", "pt", "pc", "s", "deg"]).$map, $a.$$p = "to_sym".$to_proc(), $a).call($b)); Opal.cdecl($scope, 'COMPATIBLE', ($a = ($c = ["in", "pt", "mm", "cm", "px", "pc"]).$map, $a.$$p = "to_sym".$to_proc(), $a).call($c)); self.$attr_reader("type", "number"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(number, type) { var self = this; self.number = number; return self.type = type; }, TMP_1.$$arity = 2); Opal.defn(self, '$coerce', TMP_2 = function $$coerce(other) { var self = this; return [self, other]; }, TMP_2.$$arity = 1); Opal.defn(self, '$==', TMP_3 = function(other) { var $a, self = this; if ((($a = $scope.get('Unit')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { if ((($a = other['$respond_to?']("to_u")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('TypeError'), "no implicit conversion of " + (other.$class()) + " into Unit") }; other = other.$to_u(); }; if ((($a = $scope.get('Unit')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { other = $scope.get('Unit').$new(other, self.type) }; return self.number['$=='](self.$convert(other, self.type)); }, TMP_3.$$arity = 1); Opal.defn(self, '$===', TMP_4 = function(other) { var $a, self = this; return (($a = self.type['$=='](other.$type())) ? self.number['$=='](other.$number()) : self.type['$=='](other.$type())); }, TMP_4.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$hash', TMP_5 = function $$hash() { var self = this; return [self.number, self.type].$hash(); }, TMP_5.$$arity = 0); ($a = ($d = $scope.get('TYPES')).$each, $a.$$p = (TMP_6 = function(name){var self = TMP_6.$$s || this, $e, $f, TMP_7; if (name == null) name = nil; return ($e = ($f = self).$define_method, $e.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return $scope.get('Unit').$new(self.$convert(self, name), name)}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $e).call($f, name)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($d); Opal.defn(self, '$+', TMP_8 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Unit')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return $scope.get('Unit').$new($rb_plus(self.number, other), self.type) }; if (self.type['$=='](other.$type())) { return $scope.get('Unit').$new($rb_plus(self.number, other.$number()), self.type) } else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil && $b != null ?self['$compatible?'](other) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Unit').$new($rb_plus(self.number, self.$convert(other, self.type)), self.type) } else { return self.$raise($scope.get('ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) }; }, TMP_8.$$arity = 1); Opal.defn(self, '$-', TMP_9 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Unit')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return $scope.get('Unit').$new($rb_minus(self.number, other), self.type) }; if (self.type['$=='](other.$type())) { return $scope.get('Unit').$new($rb_minus(self.number, other.$number()), self.type) } else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil && $b != null ?self['$compatible?'](other) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Unit').$new($rb_minus(self.number, self.$convert(other, self.type)), self.type) } else { return self.$raise($scope.get('ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) }; }, TMP_9.$$arity = 1); Opal.defn(self, '$*', TMP_10 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Unit')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return $scope.get('Unit').$new($rb_times(self.number, other), self.type) }; if (self.type['$=='](other.$type())) { return $scope.get('Unit').$new($rb_times(self.number, other.$number()), self.type) } else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil && $b != null ?self['$compatible?'](other) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Unit').$new($rb_times(self.number, self.$convert(other, self.type)), self.type) } else { return self.$raise($scope.get('ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) }; }, TMP_10.$$arity = 1); Opal.defn(self, '$/', TMP_11 = function(other) { var $a, $b, self = this; if ((($a = $scope.get('Unit')['$==='](other)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return $scope.get('Unit').$new($rb_divide(self.number, other), self.type) }; if (self.type['$=='](other.$type())) { return $scope.get('Unit').$new($rb_divide(self.number, other.$number()), self.type) } else if ((($a = ($b = self['$compatible?'](self), $b !== false && $b !== nil && $b != null ?self['$compatible?'](other) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Unit').$new($rb_divide(self.number, self.$convert(other, self.type)), self.type) } else { return self.$raise($scope.get('ArgumentError'), "" + (other.$type()) + " isn't compatible with " + (self.type)) }; }, TMP_11.$$arity = 1); Opal.defn(self, '$-@', TMP_12 = function() { var self = this; return $scope.get('Unit').$new($rb_times(self.number, -1), self.type); }, TMP_12.$$arity = 0); Opal.defn(self, '$+@', TMP_13 = function() { var self = this; return $scope.get('Unit').$new(self.number, self.type); }, TMP_13.$$arity = 0); Opal.defn(self, '$to_i', TMP_14 = function $$to_i() { var self = this; return self.number.$to_i(); }, TMP_14.$$arity = 0); Opal.defn(self, '$to_f', TMP_15 = function $$to_f() { var self = this; return self.number.$to_f(); }, TMP_15.$$arity = 0); Opal.defn(self, '$to_u', TMP_16 = function $$to_u() { var self = this; return self; }, TMP_16.$$arity = 0); Opal.defn(self, '$to_s', TMP_17 = function $$to_s() { var self = this; return "" + (self.number) + (self.type); }, TMP_17.$$arity = 0); Opal.alias(self, 'to_str', 'to_s'); Opal.alias(self, 'inspect', 'to_s'); self.$private(); Opal.defn(self, '$compatible?', TMP_18 = function(unit) { var self = this; return $scope.get('COMPATIBLE')['$include?'](unit.$type()); }, TMP_18.$$arity = 1); return (Opal.defn(self, '$convert', TMP_19 = function $$convert(unit, type) { var self = this, value = nil, px = nil, $case = nil; value = unit.$number(); if (unit.$type()['$=='](type)) { return value}; px = (function() {$case = unit.$type();if ("in"['$===']($case)) {return $rb_times(value, 96)}else if ("pt"['$===']($case)) {return $rb_divide($rb_times(value, 4.0), 3.0)}else if ("pc"['$===']($case)) {return $rb_divide($rb_times($rb_divide(value, 12), 4.0), 3.0)}else if ("mm"['$===']($case)) {return $rb_times(value, 3.77953)}else if ("cm"['$===']($case)) {return $rb_times($rb_times(value, 10), 3.77953)}else if ("px"['$===']($case)) {return value}else { return nil }})(); return (function() {$case = type;if ("in"['$===']($case)) {return $rb_divide(px, 96.0)}else if ("pt"['$===']($case)) {return $rb_divide($rb_divide(px, 4.0), 3.0)}else if ("pc"['$===']($case)) {return $rb_divide($rb_divide($rb_times(px, 12), 4.0), 3.0)}else if ("mm"['$===']($case)) {return $rb_divide(px, 3.77953)}else if ("cm"['$===']($case)) {return $rb_divide($rb_divide(px, 10), 3.77953)}else if ("px"['$===']($case)) {return px}else { return nil }})(); }, TMP_19.$$arity = 2), nil) && 'convert'; })($scope.base, null) })($scope.base, $scope.get('BasicObject')) })($scope.base, null); (function($base, $super) { function $Numeric(){}; var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_20, TMP_22; ($a = ($b = (((((($scope.get('Paggio')).$$scope.get('CSS'))).$$scope.get('Unit'))).$$scope.get('TYPES'))).$each, $a.$$p = (TMP_20 = function(name){var self = TMP_20.$$s || this, $c, $d, TMP_21; if (name == null) name = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this; return (((($scope.get('Paggio')).$$scope.get('CSS'))).$$scope.get('Unit')).$new(self, name)}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21), $c).call($d, name)}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $a).call($b); return (Opal.defn(self, '$to_u', TMP_22 = function $$to_u() { var self = this; return self; }, TMP_22.$$arity = 0), nil) && 'to_u'; })($scope.base, null); ($a = ($b = [$scope.get('Fixnum'), $scope.get('Float')]).$each, $a.$$p = (TMP_23 = function(klass){var self = TMP_23.$$s || this, $c, $d, TMP_24; if (klass == null) klass = nil; return ($c = ($d = klass).$class_eval, $c.$$p = (TMP_24 = function(){var self = TMP_24.$$s || this, TMP_25; Opal.alias(self, 'old_percent', '%'); return (Opal.def(self, '$%', TMP_25 = function(other) { var self = this; if (other == null) { other = nil; } if (other !== false && other !== nil && other != null) { return self.$old_percent(other) } else { return (((($scope.get('Paggio')).$$scope.get('CSS'))).$$scope.get('Unit')).$new(self, "%") }; }, TMP_25.$$arity = -1), nil) && '%';}, TMP_24.$$s = self, TMP_24.$$arity = 0, TMP_24), $c).call($d)}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23), $a).call($b); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_26; return (Opal.defn(self, '$to_u', TMP_26 = function $$to_u() { var $a, self = this, matches = nil, value = nil, unit = nil; if ((($a = matches = self.$match(/^([\d+.]+)(.+)?$/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = matches['$[]'](1).$to_f(); if ((($a = unit = matches['$[]'](2)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return value.$__send__(unit.$downcase()) } else { return value }; } else { return 0 }; }, TMP_26.$$arity = 0), nil) && 'to_u' })($scope.base, null); return (function($base, $super) { function $NilClass(){}; var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); var def = self.$$proto, $scope = self.$$scope, TMP_27; return (Opal.defn(self, '$to_u', TMP_27 = function $$to_u() { var self = this; return 0; }, TMP_27.$$arity = 0), nil) && 'to_u' })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css/color"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$each', '$define_method', '$new', '$map', '$to_proc']); (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Color(){}; var self = $Color = $klass($base, $super, 'Color', $Color); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$initialize', TMP_1 = function $$initialize(value, type) { var self = this; self.internal = value; return self.type = type; }, TMP_1.$$arity = 2), nil) && 'initialize' })($scope.base, null) })($scope.base, $scope.get('BasicObject')) })($scope.base, null); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_2, $c, $d; return ($a = ($b = ($c = ($d = ["rgb", "rgba", "hsl", "hsla"]).$map, $c.$$p = "to_sym".$to_proc(), $c).call($d)).$each, $a.$$p = (TMP_2 = function(name){var self = TMP_2.$$s || this, $c, $d, TMP_3; if (name == null) name = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return (((($scope.get('Paggio')).$$scope.get('CSS'))).$$scope.get('Color')).$new(self, name)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $c).call($d, name)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b) })($scope.base, null); return (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_4, $c, $d; return ($a = ($b = ($c = ($d = ["rgb", "rgba", "hsl", "hsla"]).$map, $c.$$p = "to_sym".$to_proc(), $c).call($d)).$each, $a.$$p = (TMP_4 = function(name){var self = TMP_4.$$s || this, $c, $d, TMP_5; if (name == null) name = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return (((($scope.get('Paggio')).$$scope.get('CSS'))).$$scope.get('Color')).$new(self, name)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $c).call($d, name)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b) })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css/definition"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range, $hash2 = Opal.hash2; Opal.add_stubs(['$new', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$empty?', '$each', '$inspect', '$to_s', '$define_method', '$a', '$===', '$first', '$>', '$length', '$raise', '$style', '$name', '$value', '$[]', '$join', '$map', '$to_i', '$*', '$end_with?', '$__send__', '$<<', '$last', '$pop', '$!', '$other', '$shift', '$horizontal?', '$private']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, $a, $b, TMP_6, TMP_8, TMP_9, $c, TMP_10, $d, TMP_12, TMP_16, TMP_22, TMP_25, TMP_26, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_35, TMP_36; def.style = def.important = nil; Opal.cdecl($scope, 'Style', Opal.get('Struct').$new("name", "value", "important")); Opal.defn(self, '$initialize', TMP_1 = function $$initialize() { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; self.style = []; if (block !== false && block !== nil && block != null) { if (block.$arity()['$=='](0)) { return ($a = ($b = self).$instance_exec, $a.$$p = block.$to_proc(), $a).call($b) } else { return block.$call(self) } } else { return nil }; }, TMP_1.$$arity = 0); Opal.defn(self, '$empty?', TMP_2 = function() { var self = this; return self.style['$empty?'](); }, TMP_2.$$arity = 0); Opal.defn(self, '$each', TMP_3 = function $$each() { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; return ($a = ($b = self.style).$each, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_3.$$arity = 0); Opal.defn(self, '$gradient', TMP_4 = function $$gradient($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $scope.get('Gradient')).$new.apply($b, Opal.to_a(args)); }, TMP_4.$$arity = -1); Opal.defn(self, '$url', TMP_5 = function $$url(value) { var self = this; return "url(" + (value.$to_s().$inspect()) + ")"; }, TMP_5.$$arity = 1); ($a = ($b = ["url", "blur", "brightness", "rotate", "contrast", "grayscale", "invert", "opacity", "saturate", "sepia"]).$each, $a.$$p = (TMP_6 = function(name){var self = TMP_6.$$s || this, $c, $d, TMP_7; if (name == null) name = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_7 = function(value){var self = TMP_7.$$s || this; if (value == null) value = nil; return "" + (name) + "(" + (value) + ")"}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $c).call($d, name)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b); Opal.defn(self, '$rgb', TMP_8 = function $$rgb(r, g, b) { var self = this; return "rgb(" + (r) + ", " + (g) + ", " + (b) + ", " + (self.$a()) + ")"; }, TMP_8.$$arity = 3); Opal.defn(self, '$rgba', TMP_9 = function $$rgba(r, g, b, a) { var self = this; return "rgba(" + (r) + ", " + (g) + ", " + (b) + ", " + (a) + ")"; }, TMP_9.$$arity = 4); ($a = ($c = ["scale", "skew", "translate"]).$each, $a.$$p = (TMP_10 = function(name){var self = TMP_10.$$s || this, $d, $e, TMP_11; if (name == null) name = nil; return ($d = ($e = self).$define_method, $d.$$p = (TMP_11 = function(a, b){var self = TMP_11.$$s || this; if (b == null) { b = nil; }if (a == null) a = nil; if (b !== false && b !== nil && b != null) { return "" + (name) + "(" + (a) + ", " + (b) + ")" } else { return "" + (name) + "(" + (a) + ")" }}, TMP_11.$$s = self, TMP_11.$$arity = -2, TMP_11), $d).call($e, name)}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $a).call($c); ($a = ($d = ["translateX", "translateY", "translateZ", "rotateX", "rotateY", "rotateZ", "skewX", "skewY", "scaleX", "scaleY"]).$each, $a.$$p = (TMP_12 = function(name){var self = TMP_12.$$s || this, $e, $f, TMP_13; if (name == null) name = nil; return ($e = ($f = self).$define_method, $e.$$p = (TMP_13 = function(value){var self = TMP_13.$$s || this; if (value == null) value = nil; return "" + (name) + "(" + (value) + ")"}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $e).call($f, name)}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($d); Opal.defn(self, '$background', TMP_16 = function $$background($a_rest) { var $b, $c, TMP_14, $d, TMP_15, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('Gradient')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = $rb_gt(args.$length(), 1)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('NotImplementedError'), "multiple gradients not implemented yet")}; return ($b = ($c = args.$first()).$each, $b.$$p = (TMP_14 = function(s){var self = TMP_14.$$s || this, $a; if (s == null) s = nil; return self.$style(((($a = s.$name()) !== false && $a !== nil && $a != null) ? $a : "background-image"), s.$value())}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $b).call($c); } else if ((($b = Opal.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($d = args.$first()).$each, $b.$$p = (TMP_15 = function(sub, value){var self = TMP_15.$$s || this; if (sub == null) sub = nil;if (value == null) value = nil; return self.$style("background-" + (sub), value)}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $b).call($d) } else { return self.$style("background", args) }; }, TMP_16.$$arity = -1); Opal.defn(self, '$border', TMP_22 = function $$border($a_rest) { var $b, $c, TMP_17, self = this, args, options = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = Opal.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (args.$length()['$=='](1)) { options = args.$first()}; return ($b = ($c = options).$each, $b.$$p = (TMP_17 = function(name, value){var self = TMP_17.$$s || this, $a, $d, TMP_18, $e, TMP_19, $f, TMP_21, $case = nil; if (name == null) name = nil;if (value == null) value = nil; return (function() {$case = name;if ("top"['$===']($case) || "bottom"['$===']($case) || "left"['$===']($case) || "right"['$===']($case)) {if ((($a = Opal.get('Hash')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($d = value).$each, $a.$$p = (TMP_18 = function(n, v){var self = TMP_18.$$s || this; if (n == null) n = nil;if (v == null) v = nil; return self.$style("border-" + (name) + "-" + (n), v)}, TMP_18.$$s = self, TMP_18.$$arity = 2, TMP_18), $a).call($d) } else { return self.$style("border-" + (name), value) }}else if ("radius"['$===']($case)) {if ((($a = Opal.get('Hash')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($e = value).$each, $a.$$p = (TMP_19 = function(horizontal, value){var self = TMP_19.$$s || this, $f, $g, TMP_20; if (horizontal == null) horizontal = nil;if (value == null) value = nil; return ($f = ($g = value).$each, $f.$$p = (TMP_20 = function(vertical, value){var self = TMP_20.$$s || this; if (vertical == null) vertical = nil;if (value == null) value = nil; self.$style("-moz-border-radius-" + (horizontal) + (vertical), value); self.$style("-webkit-border-" + (horizontal) + "-" + (vertical) + "-radius", value); return self.$style("border-" + (horizontal) + "-" + (vertical) + "-radius", value);}, TMP_20.$$s = self, TMP_20.$$arity = 2, TMP_20), $f).call($g)}, TMP_19.$$s = self, TMP_19.$$arity = 2, TMP_19), $a).call($e) } else { self.$style("-moz-border-radius", value); self.$style("-webkit-border-radius", value); return self.$style("border-radius", value); }}else if ("color"['$===']($case)) {if ((($a = Opal.get('Hash')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($f = value).$each, $a.$$p = (TMP_21 = function(name, value){var self = TMP_21.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return self.$style("border-" + (name) + "-color", value)}, TMP_21.$$s = self, TMP_21.$$arity = 2, TMP_21), $a).call($f) } else { return self.$style("border-color", value) }}else {return self.$style("border-" + (name), value)}})()}, TMP_17.$$s = self, TMP_17.$$arity = 2, TMP_17), $b).call($c); } else { return self.$style("border", args) }; }, TMP_22.$$arity = -1); Opal.defn(self, '$box', TMP_25 = function $$box(options) { var $a, $b, TMP_23, self = this; if ((($a = Opal.get('Hash')['$==='](options)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = options).$each, $a.$$p = (TMP_23 = function(name, value){var self = TMP_23.$$s || this, $c, $d, TMP_24, $case = nil; if (name == null) name = nil;if (value == null) value = nil; return (function() {$case = name;if ("shadow"['$===']($case)) {if ((($c = Opal.get('Array')['$==='](value)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = Opal.get('Array')['$==='](value['$[]'](0))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { value = ($c = ($d = value).$map, $c.$$p = (TMP_24 = function(v){var self = TMP_24.$$s || this; if (v == null) v = nil; return v.$join(" ")}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24), $c).call($d).$join(", ") } else { value = value.$join(" ") }}; self.$style("-moz-box-shadow", value); self.$style("-webkit-box-shadow", value); return self.$style("box-shadow", value);}else {return self.$style("box-" + (name), value)}})()}, TMP_23.$$s = self, TMP_23.$$arity = 2, TMP_23), $a).call($b) } else { return self.$style("box", options) }; }, TMP_25.$$arity = 1); Opal.defn(self, '$opacity', TMP_26 = function $$opacity(value) { var self = this; self.$style("opacity", value); self.$style("-moz-opacity", value); self.$style("-ms-filter", "\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (($rb_times(value, 100)).$to_i()) + ")\""); return self.$style("filter", "alpha(opacity=" + (($rb_times(value, 100)).$to_i()) + ")"); }, TMP_26.$$arity = 1); Opal.defn(self, '$animation', TMP_28 = function $$animation($a_rest) { var $b, $c, TMP_27, self = this, args, options = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if (args.$length()['$=='](1)) { options = args.$first()}; return ($b = ($c = options).$each, $b.$$p = (TMP_27 = function(name, value){var self = TMP_27.$$s || this; if (name == null) name = nil;if (value == null) value = nil; self.$style("-webkit-animation-" + (name), value); return self.$style("animation-" + (name), value);}, TMP_27.$$s = self, TMP_27.$$arity = 2, TMP_27), $b).call($c); } else { self.$style("animation", args); return self.$style("-webkit-animation", args); }; }, TMP_28.$$arity = -1); Opal.defn(self, '$transition', TMP_29 = function $$transition($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.$style("transition", args); self.$style("-webkit-transition", args); return self.$style("-moz-transition", args); }, TMP_29.$$arity = -1); Opal.defn(self, '$user_select', TMP_30 = function $$user_select($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.$style("user-select", args); self.$style("-webkit-user-select", args); self.$style("-moz-user-select", args); return self.$style("-ms-user-select", args); }, TMP_30.$$arity = -1); Opal.defn(self, '$transform', TMP_31 = function $$transform($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.$style("transform", args); self.$style("-webkit-transform", args); self.$style("-moz-transform", args); self.$style("-ms-transform", args); return self.$style("-o-transform", args); }, TMP_31.$$arity = -1); Opal.defn(self, '$filter', TMP_32 = function $$filter($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.$style("filter", args); self.$style("-webkit-filter", args); self.$style("-moz-filter", args); self.$style("-ms-filter", args); return self.$style("-o-filter", args); }, TMP_32.$$arity = -1); Opal.defn(self, '$method_missing', TMP_33 = function $$method_missing(name, $a_rest) { var $b, $c, $d, TMP_34, self = this, args, $iter = TMP_33.$$p, block = $iter || nil, argument = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_33.$$p = null; name = name.$to_s(); if ((($b = name['$end_with?']("!")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { name = name['$[]']($range(0, -2, false)); self.important = true; ($b = ($c = self).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, [name].concat(Opal.to_a(args))); self.important = false; return nil;}; if (args.$length()['$=='](1)) { argument = args.$first(); if ((($b = Opal.get('Hash')['$==='](argument)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { ($b = ($d = argument).$each, $b.$$p = (TMP_34 = function(sub, value){var self = TMP_34.$$s || this; if (sub == null) sub = nil;if (value == null) value = nil; return self.$style("" + (name) + "-" + (sub), value)}, TMP_34.$$s = self, TMP_34.$$arity = 2, TMP_34), $b).call($d) } else { self.$style(name, argument) }; } else { self.$style(name, args.$join(" ")) }; self.important = false; return self; }, TMP_33.$$arity = -2); Opal.defn(self, '$style', TMP_35 = function $$style(name, value, important) { var $a, self = this; if (value == null) { value = nil; } if (important == null) { important = self.important; } if ((($a = Opal.get('Array')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = value.$join(" ")}; if ((($a = $scope.get('Style')['$==='](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.style['$<<'](name) } else { return self.style['$<<']($scope.get('Style').$new(name, value, important)) }; }, TMP_35.$$arity = -2); Opal.defn(self, '$style!', TMP_36 = function(name, value) { var self = this; if (value == null) { value = nil; } return self.$style(name, value, true); }, TMP_36.$$arity = -2); return (function($base, $super) { function $Gradient(){}; var self = $Gradient = $klass($base, $super, 'Gradient', $Gradient); var def = self.$$proto, $scope = self.$$scope, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42; def.to = def.from = def.start = def.end = nil; Opal.defn(self, '$initialize', TMP_37 = function $$initialize($a_rest) { var $b, $c, self = this, args, options = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } options = (function() {if ((($b = Opal.get('Hash')['$==='](args.$last())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return args.$pop() } else { return $hash2([], {}) }; return nil; })(); self.to = options['$[]']("to"); self.from = options['$[]']("from"); if ((($b = ($c = self.to, $c !== false && $c !== nil && $c != null ?self.from['$!']() : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.from = self.$other(self.to) } else if ((($b = ($c = self.from, $c !== false && $c !== nil && $c != null ?self.to['$!']() : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.to = self.$other(self.from)}; self.start = args.$shift(); return self.end = args.$shift(); }, TMP_37.$$arity = -1); Opal.defn(self, '$each', TMP_38 = function $$each() { var $a, self = this, $iter = TMP_38.$$p, block = $iter || nil; TMP_38.$$p = null; block.$call(self.$style("-moz-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); if ((($a = self['$horizontal?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block.$call(self.$style("-webkit-gradient(linear, " + (self.from) + " top, " + (self.to) + " top, color-stop(0%, " + (self.start) + "), color-stop(100%, " + (self.end) + "))")) } else { block.$call(self.$style("-webkit-gradient(linear, left " + (self.from) + ", left " + (self.to) + ", color-stop(0%, " + (self.start) + "), color-stop(100%, " + (self.end) + "))")) }; block.$call(self.$style("-webkit-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); block.$call(self.$style("-o-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); block.$call(self.$style("-ms-linear-gradient(" + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); return block.$call(self.$style("linear-gradient(to " + (self.to) + ", " + (self.start) + " 0%, " + (self.end) + " 100%)")); }, TMP_38.$$arity = 0); Opal.defn(self, '$horizontal?', TMP_39 = function() { var $a, self = this; return ((($a = self.to['$==']("left")) !== false && $a !== nil && $a != null) ? $a : self.to['$==']("right")); }, TMP_39.$$arity = 0); Opal.defn(self, '$vertical?', TMP_40 = function() { var $a, self = this; return ((($a = self.to['$==']("top")) !== false && $a !== nil && $a != null) ? $a : self.to['$==']("bottom")); }, TMP_40.$$arity = 0); self.$private(); Opal.defn(self, '$other', TMP_41 = function $$other(side) { var self = this, $case = nil; return (function() {$case = side;if ("left"['$===']($case)) {return "right"}else if ("right"['$===']($case)) {return "left"}else if ("top"['$===']($case)) {return "bottom"}else if ("bottom"['$===']($case)) {return "top"}else { return nil }})(); }, TMP_41.$$arity = 1); return (Opal.defn(self, '$style', TMP_42 = function $$style($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if (args.$length()['$=='](1)) { return $scope.get('Style').$new(nil, args.$first()) } else { return ($b = $scope.get('Style')).$new.apply($b, Opal.to_a(args)) }; }, TMP_42.$$arity = -1), nil) && 'style'; })($scope.base, null); })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css/rule"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$new', '$__send__', '$to_proc']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Rule(){}; var self = $Rule = $klass($base, $super, 'Rule', $Rule); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.definition = nil; self.$attr_reader("selector", "media"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(selector, media) { var self = this; self.selector = selector; self.media = media; return self.definition = $scope.get('Definition').$new(); }, TMP_1.$$arity = 2); return (Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; return ($b = ($c = self.definition).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_2.$$arity = -1), nil) && 'method_missing'; })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css/font"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_reader', '$new', '$font', '$__send__', '$to_proc']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Font(){}; var self = $Font = $klass($base, $super, 'Font', $Font); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.definition = nil; self.$attr_reader("name"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(name) { var self = this; self.name = name; self.definition = $scope.get('Definition').$new(); return self.$font($hash2(["family"], {"family": name})); }, TMP_1.$$arity = 1); return (Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; return ($b = ($c = self.definition).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_2.$$arity = -1), nil) && 'method_missing'; })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css/animation"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$new', '$__send__', '$to_proc', '$<<', '$call', '$%', '$last']); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Animation(){}; var self = $Animation = $klass($base, $super, 'Animation', $Animation); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; def.steps = nil; (function($base, $super) { function $Step(){}; var self = $Step = $klass($base, $super, 'Step', $Step); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.definition = nil; self.$attr_reader("value"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(value) { var self = this; self.value = value; return self.definition = $scope.get('Definition').$new(); }, TMP_1.$$arity = 1); return (Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; return ($b = ($c = self.definition).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_2.$$arity = -1), nil) && 'method_missing'; })($scope.base, $scope.get('BasicObject')); self.$attr_reader("name", "steps"); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(name) { var self = this; self.name = name; return self.steps = []; }, TMP_3.$$arity = 1); Opal.defn(self, '$step', TMP_4 = function $$step(value) { var self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; self.steps['$<<']($scope.get('Step').$new(value)); return block.$call(); }, TMP_4.$$arity = 1); Opal.defn(self, '$from', TMP_5 = function $$from(value) { var self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; self.steps['$<<']($scope.get('Step').$new((0)['$%']())); return block.$call(); }, TMP_5.$$arity = 1); Opal.defn(self, '$to', TMP_6 = function $$to(value) { var self = this, $iter = TMP_6.$$p, block = $iter || nil; TMP_6.$$p = null; self.steps['$<<']($scope.get('Step').$new((100)['$%']())); return block.$call(); }, TMP_6.$$arity = 1); return (Opal.defn(self, '$method_missing', TMP_7 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_7.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_7.$$p = null; return ($b = ($c = self.steps.$last()).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_7.$$arity = -1), nil) && 'method_missing'; })($scope.base, $scope.get('BasicObject')) })($scope.base, $scope.get('BasicObject')) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/css"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$each', '$start_with?', '$+', '$[]', '$==', '$attr_reader', '$raise', '$arity', '$instance_exec', '$to_proc', '$call', '$any?', '$include?', '$<<', '$new', '$selector', '$pop', '$method_missing', '$__send__', '$last']); self.$require("paggio/css/unit"); self.$require("paggio/css/color"); self.$require("paggio/css/definition"); self.$require("paggio/css/rule"); self.$require("paggio/css/font"); self.$require("paggio/css/animation"); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CSS(){}; var self = $CSS = $klass($base, $super, 'CSS', $CSS); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_7, TMP_8, TMP_9, TMP_10; def.media = def.current = def.fonts = def.animations = nil; Opal.defs(self, '$selector', TMP_2 = function $$selector(list) { var $a, $b, TMP_1, self = this, result = nil; result = ""; ($a = ($b = list).$each, $a.$$p = (TMP_1 = function(part){var self = TMP_1.$$s || this, $c; if (part == null) part = nil; if ((($c = part['$start_with?']("&")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return result = $rb_plus(result, part['$[]']($range(1, -1, false))) } else { return result = $rb_plus(result, $rb_plus(" ", part)) }}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); if (result['$[]'](0)['$=='](" ")) { return result['$[]']($range(1, -1, false)) } else { return result }; }, TMP_2.$$arity = 1); self.$attr_reader("rules", "media", "fonts", "animations"); Opal.defn(self, '$initialize', TMP_3 = function $$initialize() { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; if (block !== false && block !== nil && block != null) { } else { Opal.get('Kernel').$raise(Opal.get('ArgumentError'), "no block given") }; self.selector = []; self.current = []; self.rules = []; self.fonts = []; self.animations = []; if (block.$arity()['$=='](0)) { return ($a = ($b = self).$instance_exec, $a.$$p = block.$to_proc(), $a).call($b) } else { return block.$call(self) }; }, TMP_3.$$arity = 0); Opal.defn(self, '$rule', TMP_4 = function $$rule($a_rest) { var $b, $c, $d, TMP_5, TMP_6, self = this, names, $iter = TMP_4.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } TMP_4.$$p = null; if (block !== false && block !== nil && block != null) { } else { return nil }; if ((($b = ($c = ($d = names)['$any?'], $c.$$p = (TMP_5 = function(n){var self = TMP_5.$$s || this; if (n == null) n = nil; return n['$include?'](",")}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $c).call($d)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { Opal.get('Kernel').$raise(Opal.get('ArgumentError'), "selectors cannot contain commas")}; return ($b = ($c = names).$each, $b.$$p = (TMP_6 = function(name){var self = TMP_6.$$s || this; if (self.selector == null) self.selector = nil; if (self.current == null) self.current = nil; if (self.media == null) self.media = nil; if (self.rules == null) self.rules = nil; if (name == null) name = nil; self.selector['$<<'](name); self.current['$<<']($scope.get('Rule').$new($scope.get('CSS').$selector(self.selector), self.media)); block.$call(); self.selector.$pop(); return self.rules['$<<'](self.current.$pop());}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $b).call($c); }, TMP_4.$$arity = -1); Opal.defn(self, '$media', TMP_7 = function $$media(query, $a_rest) { var $b, self = this, args, $iter = TMP_7.$$p, block = $iter || nil, old = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_7.$$p = null; if (block !== false && block !== nil && block != null) { $b = [self.media, query], old = $b[0], self.media = $b[1], $b; block.$call(); return self.media = old; } else { return ($b = self).$method_missing.apply($b, ["media", query].concat(Opal.to_a(args))) }; }, TMP_7.$$arity = -2); Opal.defn(self, '$font', TMP_8 = function $$font(name, $a_rest) { var $b, self = this, args, $iter = TMP_8.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_8.$$p = null; if (block !== false && block !== nil && block != null) { self.current['$<<']($scope.get('Font').$new(name)); block.$call(); return self.fonts['$<<'](self.current.$pop()); } else { return ($b = self).$method_missing.apply($b, ["font", name].concat(Opal.to_a(args))) }; }, TMP_8.$$arity = -2); Opal.defn(self, '$animation', TMP_9 = function $$animation(name, $a_rest) { var $b, self = this, args, $iter = TMP_9.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_9.$$p = null; if (block !== false && block !== nil && block != null) { self.current['$<<']($scope.get('Animation').$new(name)); block.$call(); return self.animations['$<<'](self.current.$pop()); } else { return ($b = self).$method_missing.apply($b, ["animation", name].concat(Opal.to_a(args))) }; }, TMP_9.$$arity = -2); return (Opal.defn(self, '$method_missing', TMP_10 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_10.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_10.$$p = null; return ($b = ($c = self.current.$last()).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_10.$$arity = -1), nil) && 'method_missing'; })($scope.base, $scope.get('BasicObject')); return (function($base, $super) { function $HTML(){}; var self = $HTML = $klass($base, $super, 'HTML', $HTML); var def = self.$$proto, $scope = self.$$scope, TMP_11; def.current = def.roots = nil; return (Opal.defn(self, '$style', TMP_11 = function $$style() { var $a, $b, self = this, $iter = TMP_11.$$p, block = $iter || nil; TMP_11.$$p = null; return (((($a = self.current) !== false && $a !== nil && $a != null) ? $a : self.roots))['$<<'](($a = ($b = $scope.get('CSS')).$new, $a.$$p = block.$to_proc(), $a).call($b)); }, TMP_11.$$arity = 0), nil) && 'style' })($scope.base, $scope.get('BasicObject')); })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["stringio"] = function(Opal) { function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$include', '$new', '$call', '$close', '$attr_accessor', '$length', '$include?', '$!', '$check_readable', '$==', '$===', '$>=', '$raise', '$>', '$+', '$-', '$seek', '$enum_for', '$eof?', '$ord', '$[]', '$check_writable', '$String', '$write', '$closed_write?', '$closed_read?']); return (function($base, $super) { function $StringIO(){}; var self = $StringIO = $klass($base, $super, 'StringIO', $StringIO); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18; def.position = def.string = def.closed = nil; self.$include((($scope.get('IO')).$$scope.get('Readable'))); self.$include((($scope.get('IO')).$$scope.get('Writable'))); Opal.defs(self, '$open', TMP_1 = function $$open(string, mode) { var self = this, $iter = TMP_1.$$p, block = $iter || nil, io = nil, res = nil; if (string == null) { string = ""; } if (mode == null) { mode = nil; } TMP_1.$$p = null; io = self.$new(string, mode); res = block.$call(io); io.$close(); return res; }, TMP_1.$$arity = -1); self.$attr_accessor("string"); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(string, mode) { var $a, $b, self = this; if (string == null) { string = ""; } if (mode == null) { mode = "rw"; } self.string = string; self.position = string.$length(); if ((($a = ($b = mode['$include?']("r"), $b !== false && $b !== nil && $b != null ?mode['$include?']("w")['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.closed = "write" } else if ((($a = ($b = mode['$include?']("w"), $b !== false && $b !== nil && $b != null ?mode['$include?']("r")['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.closed = "read" } else { return nil }; }, TMP_2.$$arity = -1); Opal.defn(self, '$eof?', TMP_3 = function() { var self = this; self.$check_readable(); return self.position['$=='](self.string.$length()); }, TMP_3.$$arity = 0); Opal.alias(self, 'eof', 'eof?'); Opal.defn(self, '$seek', TMP_4 = function $$seek(pos, whence) { var $a, self = this, $case = nil; if (whence == null) { whence = (($scope.get('IO')).$$scope.get('SEEK_SET')); } $case = whence;if ((($scope.get('IO')).$$scope.get('SEEK_SET'))['$===']($case)) {if ((($a = $rb_ge(pos, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise((($scope.get('Errno')).$$scope.get('EINVAL'))) }; self.position = pos;}else if ((($scope.get('IO')).$$scope.get('SEEK_CUR'))['$===']($case)) {if ((($a = $rb_gt($rb_plus(self.position, pos), self.string.$length())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.position = self.string.$length() } else { self.position = $rb_plus(self.position, pos) }}else if ((($scope.get('IO')).$$scope.get('SEEK_END'))['$===']($case)) {if ((($a = $rb_gt(pos, self.string.$length())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.position = 0 } else { self.position = $rb_minus(self.position, pos) }}; return 0; }, TMP_4.$$arity = -2); Opal.defn(self, '$tell', TMP_5 = function $$tell() { var self = this; return self.position; }, TMP_5.$$arity = 0); Opal.alias(self, 'pos', 'tell'); Opal.alias(self, 'pos=', 'seek'); Opal.defn(self, '$rewind', TMP_6 = function $$rewind() { var self = this; return self.$seek(0); }, TMP_6.$$arity = 0); Opal.defn(self, '$each_byte', TMP_7 = function $$each_byte() { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil, i = nil; TMP_7.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$enum_for("each_byte") }; self.$check_readable(); i = self.position; while (!((($b = self['$eof?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true)))) { block.$call(self.string['$[]'](i).$ord()); i = $rb_plus(i, 1);}; return self; }, TMP_7.$$arity = 0); Opal.defn(self, '$each_char', TMP_8 = function $$each_char() { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil, i = nil; TMP_8.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$enum_for("each_char") }; self.$check_readable(); i = self.position; while (!((($b = self['$eof?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true)))) { block.$call(self.string['$[]'](i)); i = $rb_plus(i, 1);}; return self; }, TMP_8.$$arity = 0); Opal.defn(self, '$write', TMP_9 = function $$write(string) { var self = this, before = nil, after = nil; self.$check_writable(); string = self.$String(string); if (self.string.$length()['$=='](self.position)) { self.string = $rb_plus(self.string, string); return self.position = $rb_plus(self.position, string.$length()); } else { before = self.string['$[]']($range(0, $rb_minus(self.position, 1), false)); after = self.string['$[]']($range($rb_plus(self.position, string.$length()), -1, false)); self.string = $rb_plus($rb_plus(before, string), after); return self.position = $rb_plus(self.position, string.$length()); }; }, TMP_9.$$arity = 1); Opal.defn(self, '$read', TMP_10 = function $$read(length, outbuf) { var $a, self = this, string = nil, str = nil; if (length == null) { length = nil; } if (outbuf == null) { outbuf = nil; } self.$check_readable(); if ((($a = self['$eof?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; string = (function() {if (length !== false && length !== nil && length != null) { str = self.string['$[]'](self.position, length); self.position = $rb_plus(self.position, length); return str; } else { str = self.string['$[]']($range(self.position, -1, false)); self.position = self.string.$length(); return str; }; return nil; })(); if (outbuf !== false && outbuf !== nil && outbuf != null) { return outbuf.$write(string) } else { return string }; }, TMP_10.$$arity = -1); Opal.defn(self, '$close', TMP_11 = function $$close() { var self = this; return self.closed = "both"; }, TMP_11.$$arity = 0); Opal.defn(self, '$close_read', TMP_12 = function $$close_read() { var self = this; if (self.closed['$==']("write")) { return self.closed = "both" } else { return self.closed = "read" }; }, TMP_12.$$arity = 0); Opal.defn(self, '$close_write', TMP_13 = function $$close_write() { var self = this; if (self.closed['$==']("read")) { return self.closed = "both" } else { return self.closed = "write" }; }, TMP_13.$$arity = 0); Opal.defn(self, '$closed?', TMP_14 = function() { var self = this; return self.closed['$==']("both"); }, TMP_14.$$arity = 0); Opal.defn(self, '$closed_read?', TMP_15 = function() { var $a, self = this; return ((($a = self.closed['$==']("read")) !== false && $a !== nil && $a != null) ? $a : self.closed['$==']("both")); }, TMP_15.$$arity = 0); Opal.defn(self, '$closed_write?', TMP_16 = function() { var $a, self = this; return ((($a = self.closed['$==']("write")) !== false && $a !== nil && $a != null) ? $a : self.closed['$==']("both")); }, TMP_16.$$arity = 0); Opal.defn(self, '$check_writable', TMP_17 = function $$check_writable() { var $a, self = this; if ((($a = self['$closed_write?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('IOError'), "not opened for writing") } else { return nil }; }, TMP_17.$$arity = 0); return (Opal.defn(self, '$check_readable', TMP_18 = function $$check_readable() { var $a, self = this; if ((($a = self['$closed_read?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('IOError'), "not opened for reading") } else { return nil }; }, TMP_18.$$arity = 0), nil) && 'check_readable'; })($scope.base, $scope.get('IO')) }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio/formatter"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } function $rb_times(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs * rhs : lhs['$*'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$[]=', '$to_h', '$[]', '$dup', '$deep_merge!', '$call', '$replace', '$===', '$new', '$merge', '$each', '$string', '$indent?', '$+', '$-', '$puts', '$*', '$chomp', '$lines', '$print', '$gsub', '$to_s', '$for', '$version', '$indent', '$format', '$instance_eval', '$empty?', '$map', '$escape', '$<<', '$join', '$include?', '$downcase', '$name', '$value', '$important', '$fonts', '$steps', '$animations', '$media', '$selector', '$deindent', '$reverse', '$rules']); self.$require("stringio"); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_14, $c, TMP_17, $d, TMP_24, $e, TMP_25; (function($base, $super) { function $Formatter(){}; var self = $Formatter = $klass($base, $super, 'Formatter', $Formatter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_12, TMP_13; def.options = def.io = nil; Opal.defs(self, '$to_h', TMP_1 = function $$to_h() { var $a, self = this; if (self.formatters == null) self.formatters = nil; return ((($a = self.formatters) !== false && $a !== nil && $a != null) ? $a : self.formatters = $hash2([], {})); }, TMP_1.$$arity = 0); Opal.defs(self, '$for', TMP_2 = function(klass) { var self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; if (block !== false && block !== nil && block != null) { return self.$to_h()['$[]='](klass, block) } else { return self.$to_h()['$[]'](klass) }; }, TMP_2.$$arity = 1); Opal.defs(self, '$options', TMP_3 = function $$options(options) { var self = this, $iter = TMP_3.$$p, block = $iter || nil, old = nil, result = nil; TMP_3.$$p = null; old = $scope.get('OPTIONS').$dup(); $scope.get('Utils')['$deep_merge!']($scope.get('OPTIONS'), options); result = block.$call(); $scope.get('OPTIONS').$replace(old); return result; }, TMP_3.$$arity = 1); Opal.cdecl($scope, 'OPTIONS', $hash2(["indent"], {"indent": $hash2(["level", "with"], {"level": 0, "with": "\t"})})); Opal.defn(self, '$initialize', TMP_4 = function $$initialize(io, options) { var $a, self = this; if (io == null) { io = nil; } if (options == null) { options = $hash2([], {}); } if ((($a = $scope.get('Hash')['$==='](io)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.io = $scope.get('StringIO').$new(); self.options = io; } else { self.io = ((($a = io) !== false && $a !== nil && $a != null) ? $a : $scope.get('StringIO').$new()); self.options = options; }; return self.options = $scope.get('OPTIONS').$merge(self.options); }, TMP_4.$$arity = -1); Opal.defn(self, '$format', TMP_6 = function $$format(item) { var $a, $b, TMP_5, self = this; (function(){var $brk = Opal.new_brk(); try {return ($a = ($b = $scope.get('Formatter').$to_h()).$each, $a.$$p = (TMP_5 = function(klass, block){var self = TMP_5.$$s || this, $c; if (klass == null) klass = nil;if (block == null) block = nil; if ((($c = klass['$==='](item)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { block.$call(self, item); Opal.brk(nil, $brk); } else { return nil }}, TMP_5.$$s = self, TMP_5.$$brk = $brk, TMP_5.$$arity = 2, TMP_5), $a).call($b) } catch (err) { if (err === $brk) { return err.$v } else { throw err } }})(); return self; }, TMP_6.$$arity = 1); Opal.defn(self, '$to_s', TMP_7 = function $$to_s() { var self = this; return self.io.$string(); }, TMP_7.$$arity = 0); Opal.defn(self, '$indent?', TMP_8 = function() { var self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; try { return self.options['$[]']("indent")['$[]']("level") } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return false } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_8.$$arity = 0); Opal.defn(self, '$indent', TMP_9 = function $$indent() { var $a, $b, self = this, $iter = TMP_9.$$p, block = $iter || nil; TMP_9.$$p = null; if ((($a = self['$indent?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (block !== false && block !== nil && block != null) { ($a = "level", $b = self.options['$[]']("indent"), $b['$[]=']($a, $rb_plus($b['$[]']($a), 1))); block.$call(); return ($a = "level", $b = self.options['$[]']("indent"), $b['$[]=']($a, $rb_minus($b['$[]']($a), 1))); } else { return ($a = "level", $b = self.options['$[]']("indent"), $b['$[]=']($a, $rb_plus($b['$[]']($a), 1))) } } else if (block !== false && block !== nil && block != null) { return block.$call() } else { return nil }; }, TMP_9.$$arity = 0); Opal.defn(self, '$deindent', TMP_10 = function $$deindent() { var $a, $b, self = this; if ((($a = self['$indent?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = "level", $b = self.options['$[]']("indent"), $b['$[]=']($a, $rb_minus($b['$[]']($a), 1))) } else { return nil }; }, TMP_10.$$arity = 0); Opal.defn(self, '$print', TMP_12 = function $$print(text) { var $a, $b, TMP_11, self = this, level = nil; if ((($a = level = self['$indent?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = text.$lines()).$each, $a.$$p = (TMP_11 = function(line){var self = TMP_11.$$s || this; if (self.io == null) self.io = nil; if (self.options == null) self.options = nil; if (line == null) line = nil; return self.io.$puts("" + ($rb_times(self.options['$[]']("indent")['$[]']("with"), level)) + (line.$chomp()))}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b) } else { return self.io.$print(text) }; }, TMP_12.$$arity = 1); return (Opal.defn(self, '$escape', TMP_13 = function $$escape(string) { var self = this; return string.$to_s().$gsub(/["><']|&(?!([a-zA-Z]+|(#\d+));)/, $hash2(["&", ">", "<", "\"", "'"], {"&": "&", ">": ">", "<": "<", "\"": """, "'": "'"})); }, TMP_13.$$arity = 1), nil) && 'escape'; })($scope.base, null); ($a = ($b = $scope.get('Formatter')).$for, $a.$$p = (TMP_14 = function(f, item){var self = TMP_14.$$s || this, $c, $d, TMP_15, $case = nil; if (f == null) f = nil;if (item == null) item = nil; $case = item.$version();if ((5)['$===']($case)) {f.$print("")}; f.$print(""); ($c = ($d = f).$indent, $c.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this, $e, $f, TMP_16; return ($e = ($f = item).$each, $e.$$p = (TMP_16 = function(root){var self = TMP_16.$$s || this; if (root == null) root = nil; return f.$format(root)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $e).call($f)}, TMP_15.$$s = self, TMP_15.$$arity = 0, TMP_15), $c).call($d); return f.$print("");}, TMP_14.$$s = self, TMP_14.$$arity = 2, TMP_14), $a).call($b, $scope.get('HTML')); ($a = ($c = $scope.get('Formatter')).$for, $a.$$p = (TMP_17 = function(f, item){var self = TMP_17.$$s || this, $d, $e, $f, $g, TMP_18, TMP_19, TMP_20, name = nil, attributes = nil, class_names = nil, attrs = nil; if (f == null) f = nil;if (item == null) item = nil; $e = ($f = ($g = item).$instance_eval, $f.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this; if (self.name == null) self.name = nil; if (self.attributes == null) self.attributes = nil; if (self.class_names == null) self.class_names = nil; return [self.name, self.attributes, self.class_names]}, TMP_18.$$s = self, TMP_18.$$arity = 0, TMP_18), $f).call($g), $d = Opal.to_ary($e), name = ($d[0] == null ? nil : $d[0]), attributes = ($d[1] == null ? nil : $d[1]), class_names = ($d[2] == null ? nil : $d[2]), $e; if ((($d = ($e = attributes['$empty?'](), $e !== false && $e !== nil && $e != null ?class_names['$empty?']() : $e)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { f.$print("<" + (name) + ">") } else { attrs = ($d = ($e = attributes).$map, $d.$$p = (TMP_19 = function(key, value){var self = TMP_19.$$s || this; if (key == null) key = nil;if (value == null) value = nil; return "" + (f.$escape(key)) + "=\"" + (f.$escape(value)) + "\""}, TMP_19.$$s = self, TMP_19.$$arity = 2, TMP_19), $d).call($e); if ((($d = class_names['$empty?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { } else { attrs['$<<']("class=\"" + (f.$escape(class_names.$join(" "))) + "\"") }; f.$print("<" + (name) + " " + (attrs.$join(" ")) + ">"); }; if ((($d = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"]['$include?'](name.$to_s().$downcase())) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return nil;}; ($d = ($f = f).$indent, $d.$$p = (TMP_20 = function(){var self = TMP_20.$$s || this, $h, $i, $j, TMP_21, TMP_22, inner = nil; if ((($h = inner = ($i = ($j = item).$instance_eval, $i.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this; if (self.inner_html == null) self.inner_html = nil; return self.inner_html}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21), $i).call($j)) !== nil && $h != null && (!$h.$$is_boolean || $h == true))) { return f.$print(inner) } else { return ($h = ($i = item).$each, $h.$$p = (TMP_22 = function(child){var self = TMP_22.$$s || this, $k, $l, TMP_23, $case = nil; if (child == null) child = nil; return (function() {$case = child;if ($scope.get('String')['$===']($case)) {return f.$print(f.$escape(child))}else if ($scope.get('CSS')['$===']($case)) {f.$print("");}else {return f.$format(child)}})()}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $h).call($i) }}, TMP_20.$$s = self, TMP_20.$$arity = 0, TMP_20), $d).call($f); return f.$print("");}, TMP_17.$$s = self, TMP_17.$$arity = 2, TMP_17), $a).call($c, (($scope.get('HTML')).$$scope.get('Element'))); ($a = ($d = $scope.get('Formatter')).$for, $a.$$p = (TMP_24 = function(f, style){var self = TMP_24.$$s || this, $e; if (f == null) f = nil;if (style == null) style = nil; return f.$print("" + (style.$name()) + ": " + (style.$value()) + ((function() {if ((($e = style.$important()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { return " !important" } else { return nil }; return nil; })()) + ";")}, TMP_24.$$s = self, TMP_24.$$arity = 2, TMP_24), $a).call($d, (((($scope.get('CSS')).$$scope.get('Definition'))).$$scope.get('Style'))); return ($a = ($e = $scope.get('Formatter')).$for, $a.$$p = (TMP_25 = function(f, item){var self = TMP_25.$$s || this, $f, $g, TMP_26, $h, TMP_29, $i, TMP_33; if (f == null) f = nil;if (item == null) item = nil; ($f = ($g = item.$fonts()).$each, $f.$$p = (TMP_26 = function(font){var self = TMP_26.$$s || this, $h, $i, TMP_27; if (font == null) font = nil; f.$print("@font-face {"); ($h = ($i = f).$indent, $h.$$p = (TMP_27 = function(){var self = TMP_27.$$s || this, $j, $k, TMP_28; return ($j = ($k = font).$each, $j.$$p = (TMP_28 = function(style){var self = TMP_28.$$s || this; if (style == null) style = nil; return f.$format(style)}, TMP_28.$$s = self, TMP_28.$$arity = 1, TMP_28), $j).call($k)}, TMP_27.$$s = self, TMP_27.$$arity = 0, TMP_27), $h).call($i); return f.$print("}");}, TMP_26.$$s = self, TMP_26.$$arity = 1, TMP_26), $f).call($g); ($f = ($h = item.$animations()).$each, $f.$$p = (TMP_29 = function(animation){var self = TMP_29.$$s || this, $i, $j, TMP_30; if (animation == null) animation = nil; return ($i = ($j = ["", "-webkit-", "-moz-", "-o-"]).$each, $i.$$p = (TMP_30 = function(platform){var self = TMP_30.$$s || this, $k, $l, TMP_31; if (platform == null) platform = nil; f.$print("@" + (platform) + "keyframes " + (animation.$name()) + " {"); ($k = ($l = animation.$steps()).$each, $k.$$p = (TMP_31 = function(step){var self = TMP_31.$$s || this, $m, $n, TMP_32; if (step == null) step = nil; f.$print("" + (step.$value()) + " {"); ($m = ($n = step).$each, $m.$$p = (TMP_32 = function(style){var self = TMP_32.$$s || this; if (style == null) style = nil; return f.$format(style)}, TMP_32.$$s = self, TMP_32.$$arity = 1, TMP_32), $m).call($n); return f.$print("}");}, TMP_31.$$s = self, TMP_31.$$arity = 1, TMP_31), $k).call($l); return f.$print("}");}, TMP_30.$$s = self, TMP_30.$$arity = 1, TMP_30), $i).call($j)}, TMP_29.$$s = self, TMP_29.$$arity = 1, TMP_29), $f).call($h); return ($f = ($i = item.$rules().$reverse()).$each, $f.$$p = (TMP_33 = function(rule){var self = TMP_33.$$s || this, $j, $k, TMP_34, m = nil; if (rule == null) rule = nil; if ((($j = rule['$empty?']()) !== nil && $j != null && (!$j.$$is_boolean || $j == true))) { return nil;}; if ((($j = m = rule.$media()) !== nil && $j != null && (!$j.$$is_boolean || $j == true))) { f.$print("@media " + (m) + " {"); f.$indent();}; f.$print("" + (rule.$selector()) + " {"); ($j = ($k = f).$indent, $j.$$p = (TMP_34 = function(){var self = TMP_34.$$s || this, $l, $m, TMP_35; return ($l = ($m = rule).$each, $l.$$p = (TMP_35 = function(style){var self = TMP_35.$$s || this; if (style == null) style = nil; return f.$format(style)}, TMP_35.$$s = self, TMP_35.$$arity = 1, TMP_35), $l).call($m)}, TMP_34.$$s = self, TMP_34.$$arity = 0, TMP_34), $j).call($k); f.$print("}"); if ((($j = rule.$media()) !== nil && $j != null && (!$j.$$is_boolean || $j == true))) { f.$print("}"); return f.$deindent(); } else { return nil };}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33), $f).call($i);}, TMP_25.$$s = self, TMP_25.$$arity = 2, TMP_25), $a).call($e, $scope.get('CSS')); })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["paggio"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$options', '$to_proc', '$to_s', '$format', '$new', '$tap', '$each']); self.$require("paggio/utils"); self.$require("paggio/html"); self.$require("paggio/css"); self.$require("paggio/formatter"); return (function($base, $super) { function $Paggio(){}; var self = $Paggio = $klass($base, $super, 'Paggio', $Paggio); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; Opal.defs(self, '$options', TMP_1 = function $$options(options) { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; return ($a = ($b = $scope.get('Formatter')).$options, $a.$$p = block.$to_proc(), $a).call($b, options); }, TMP_1.$$arity = 1); Opal.defs(self, '$indent', TMP_2 = function $$indent(options) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; return ($a = ($b = self).$options, $a.$$p = block.$to_proc(), $a).call($b, $hash2(["indent"], {"indent": options})); }, TMP_2.$$arity = 1); Opal.defs(self, '$css', TMP_3 = function $$css($a_rest) { var $b, $c, self = this, args, $iter = TMP_3.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_3.$$p = null; return $scope.get('Formatter').$new().$format(($b = ($c = $scope.get('CSS')).$new, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args))).$to_s(); }, TMP_3.$$arity = -1); Opal.defs(self, '$html', TMP_4 = function $$html($a_rest) { var $b, $c, self = this, args, $iter = TMP_4.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_4.$$p = null; return $scope.get('Formatter').$new().$format(($b = ($c = $scope.get('HTML')).$new, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args))).$to_s(); }, TMP_4.$$arity = -1); return (Opal.defs(self, '$html!', TMP_5 = function() { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; return ($a = ($b = $scope.get('Formatter').$new()).$tap, $a.$$p = (TMP_6 = function(f){var self = TMP_6.$$s || this, $c, $d, TMP_7, $e, $f; if (f == null) f = nil; return ($c = ($d = ($e = ($f = $scope.get('HTML')).$new, $e.$$p = block.$to_proc(), $e).call($f)).$each, $c.$$p = (TMP_7 = function(root){var self = TMP_7.$$s || this; if (root == null) root = nil; return f.$format(root)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $c).call($d)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b).$to_s(); }, TMP_5.$$arity = 0), nil) && 'html!'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'VERSION', "0.2.0") })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/utils"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$new', '$encode_uri', '$to_s', '$encode_uri_component', '$[]', '$map', '$split', '$decode_uri_component', '$join']); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'Size', $scope.get('Struct').$new("width", "height")); Opal.cdecl($scope, 'Position', $scope.get('Struct').$new("x", "y")); })($scope.base); (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; Opal.defn(self, '$encode_uri', TMP_1 = function $$encode_uri() { var self = this; return self.$to_s().$encode_uri(); }, TMP_1.$$arity = 0); return (Opal.defn(self, '$encode_uri_component', TMP_2 = function $$encode_uri_component() { var self = this; return self.$to_s().$encode_uri_component(); }, TMP_2.$$arity = 0), nil) && 'encode_uri_component'; })($scope.base, null); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6; Opal.defn(self, '$encode_uri_component', TMP_3 = function $$encode_uri_component() { var self = this; return encodeURIComponent(self); }, TMP_3.$$arity = 0); Opal.defn(self, '$encode_uri', TMP_4 = function $$encode_uri() { var self = this; return encodeURI(self); }, TMP_4.$$arity = 0); Opal.defn(self, '$decode_uri_component', TMP_5 = function $$decode_uri_component() { var self = this; return decodeURIComponent(self); }, TMP_5.$$arity = 0); return (Opal.defn(self, '$decode_uri', TMP_6 = function $$decode_uri() { var self = this; return decodeURI(self); }, TMP_6.$$arity = 0), nil) && 'decode_uri'; })($scope.base, null); return (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_10; Opal.defs(self, '$decode_uri', TMP_8 = function $$decode_uri(string) { var $a, $b, TMP_7, self = this; return self['$[]'](($a = ($b = string.$split("&")).$map, $a.$$p = (TMP_7 = function(part){var self = TMP_7.$$s || this, $c, $d, name = nil, value = nil; if (part == null) part = nil; $d = part.$split("="), $c = Opal.to_ary($d), name = ($c[0] == null ? nil : $c[0]), value = ($c[1] == null ? nil : $c[1]), $d; return [name.$decode_uri_component(), value.$decode_uri_component()];}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b)); }, TMP_8.$$arity = 1); return (Opal.defn(self, '$encode_uri', TMP_10 = function $$encode_uri() { var $a, $b, TMP_9, self = this; return ($a = ($b = self).$map, $a.$$p = (TMP_9 = function(name, value){var self = TMP_9.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return "" + (name.$to_s().$encode_uri_component()) + "=" + (value.$to_s().$encode_uri_component())}, TMP_9.$$s = self, TMP_9.$$arity = 2, TMP_9), $a).call($b).$join("&"); }, TMP_10.$$arity = 0), nil) && 'encode_uri'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/support"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $gvars = Opal.gvars; Opal.add_stubs(['$downcase', '$===', '$!', '$supports?']); Opal.cdecl($scope, 'BROWSER_ENGINE', (function() { try {return (/MSIE|WebKit|Presto|Gecko/.exec(navigator.userAgent)[0]).$downcase() } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return "unknown" } else { throw $err; } }})()); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; self.support = {}; Opal.defs(self, '$supports?', TMP_1 = function(feature) { var $a, $b, self = this, support = nil, $case = nil; if (self.support == null) self.support = nil; if ((($a = (typeof(self.support[feature]) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.support[feature]}; support = (function() {$case = feature;if ("MutationObserver"['$===']($case)) {return (typeof(window.MutationObserver) !== "undefined")}else if ("WebSocket"['$===']($case)) {return (typeof(window.WebSocket) !== "undefined")}else if ("EventSource"['$===']($case)) {return (typeof(window.EventSource) !== "undefined")}else if ("XHR"['$===']($case)) {return (typeof(window.XMLHttpRequest) !== "undefined")}else if ("ActiveX"['$===']($case)) {return (typeof(window.ActiveXObject) !== "undefined")}else if ("WebSQL"['$===']($case)) {return (typeof(window.openDatabase) !== "undefined")}else if ("Query.css"['$===']($case)) {return (typeof(document.querySelectorAll) !== "undefined")}else if ("Query.xpath"['$===']($case)) {return (typeof(document.evaluate) !== "undefined")}else if ("Storage.local"['$===']($case)) {return (typeof(window.localStorage) !== "undefined")}else if ("Storage.global"['$===']($case)) {return (typeof(window.globalStorage) !== "undefined")}else if ("Storage.session"['$===']($case)) {return (typeof(window.sessionStorage) !== "undefined")}else if ("Immediate"['$===']($case)) {return (typeof(window.setImmediate) !== "undefined")}else if ("Immediate (Internet Explorer)"['$===']($case)) {return (typeof(window.msSetImmediate) !== "undefined")}else if ("Immediate (Firefox)"['$===']($case)) {return (typeof(window.mozSetImmediate) !== "undefined")}else if ("Immediate (Opera)"['$===']($case)) {return (typeof(window.oSetImmediate) !== "undefined")}else if ("Immediate (Chrome)"['$===']($case) || "setImmediate (Safari)"['$===']($case)) {return (typeof(window.webkitSetImmediate) !== "undefined")}else if ("CSS.computed"['$===']($case)) {return (typeof(window.getComputedStyle) !== "undefined")}else if ("CSS.current"['$===']($case)) {return (typeof(document.documentElement.currentStyle) !== "undefined")}else if ("Window.send"['$===']($case)) {return (typeof(window.postMessage) !== "undefined")}else if ("Window.send (Asynchronous)"['$===']($case)) {if ((($a = ($b = (typeof(window.postMessage) !== "undefined"), $b !== false && $b !== nil && $b != null ?(typeof(window.importScripts) !== "undefined")['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { var ok = true, old = window.onmessage; window.onmessage = function() { ok = false; }; window.postMessage("", "*") window.onmessage = old; return ok; } else { return nil }}else if ("Window.send (Synchronous)"['$===']($case)) {return self['$supports?']("Window.send (Asynchronous)")['$!']()}else if ("Window.innerSize"['$===']($case)) {return (typeof(window.innerHeight) !== "undefined")}else if ("Window.outerSize"['$===']($case)) {return (typeof(window.outerHeight) !== "undefined")}else if ("Window.scroll"['$===']($case)) {return (typeof(document.documentElement.scrollLeft) !== "undefined")}else if ("Window.pageOffset"['$===']($case)) {return (typeof(window.pageXOffset) !== "undefined")}else if ("Attr.isId"['$===']($case)) { var div = document.createElement('div'); div.setAttribute('id', 'xxxxxxxxxxxxx'); return typeof(div.attributes['id'].isId) !== "undefined"; }else if ("Element.addBehavior"['$===']($case)) {return (typeof(document.documentElement.addBehavior) !== "undefined")}else if ("Element.className"['$===']($case)) { var div = document.createElement("div"); div.setAttribute('className', 'x'); return div.className === 'x'; }else if ("Element.class"['$===']($case)) { var div = document.createElement("div"); div.setAttribute('class', 'x'); return div.className === 'x'; }else if ("Element.for"['$===']($case)) { var label = document.createElement("label"); label.setAttribute('for', 'x'); return label.htmlFor === 'x'; }else if ("Element.htmlFor"['$===']($case)) { var label = document.createElement("label"); label.setAttribute('htmlFor', 'x'); return label.htmlFor === 'x'; }else if ("Element.clientSize"['$===']($case)) {return (typeof(document.documentElement.clientHeight) !== "undefined")}else if ("Element.scroll"['$===']($case)) {return (typeof(document.documentElement.scrollLeft) !== "undefined")}else if ("Element.textContent"['$===']($case)) {return (typeof(document.documentElement.textContent) !== "undefined")}else if ("Element.innerText"['$===']($case)) {return (typeof(document.documentElement.innerText) !== "undefined")}else if ("Element.matches"['$===']($case)) {return (typeof(document.documentElement.matches) !== "undefined")}else if ("Element.matches (Internet Explorer)"['$===']($case)) {return (typeof(document.documentElement.msMatchesSelector) !== "undefined")}else if ("Element.matches (Firefox)"['$===']($case)) {return (typeof(document.documentElement.mozMatchesSelector) !== "undefined")}else if ("Element.matches (Opera)"['$===']($case)) {return (typeof(document.documentElement.oMatchesSelector) !== "undefined")}else if ("Element.matches (Chrome)"['$===']($case) || "Element.matches (Safari)"['$===']($case)) {return (typeof(document.documentElement.webkitMatchesSelector) !== "undefined")}else if ("Element.getBoundingClientRect"['$===']($case)) {return (typeof(document.documentElement.getBoundingClientRect) !== "undefined")}else if ("Event.readystatechange"['$===']($case)) {return "onreadystatechange" in window.document.createElement("script");}else if ("Event.constructor"['$===']($case)) {try { new MouseEvent("click"); return true; } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return false } finally { Opal.pop_exception() } } else { throw $err; } }}else if ("Event.create"['$===']($case)) {return (typeof(document.createEvent) !== "undefined")}else if ("Event.createObject"['$===']($case)) {return (typeof(document.createEventObject) !== "undefined")}else if ("Event.addListener"['$===']($case)) {return (typeof(document.addEventListener) !== "undefined")}else if ("Event.attach"['$===']($case)) {return (typeof(document.attachEvent) !== "undefined")}else if ("Event.removeListener"['$===']($case)) {return (typeof(document.removeEventListener) !== "undefined")}else if ("Event.detach"['$===']($case)) {return (typeof(document.detachEvent) !== "undefined")}else if ("Event.dispatch"['$===']($case)) {return (typeof(document.dispatchEvent) !== "undefined")}else if ("Event.fire"['$===']($case)) {return (typeof(document.fireEvent) !== "undefined")}else if (/^Event\.([A-Z].*?)$/['$===']($case)) {return ((($a = $gvars['~']) === nil ? nil : $a['$[]'](1)) + "Event") in window;}else if ("Document.view"['$===']($case)) {return (typeof(document.defaultView) !== "undefined")}else if ("Document.window"['$===']($case)) {return (typeof(document.parentWindow) !== "undefined")}else if ("History"['$===']($case)) {return (typeof(window.history.pushState) !== "undefined")}else if ("History.state"['$===']($case)) {return (typeof(window.history.state) !== "undefined")}else if ("Animation.request"['$===']($case)) {return (typeof(window.requestAnimationFrame) !== "undefined")}else if ("Animation.request (Internet Explorer)"['$===']($case)) {return (typeof(window.msRequestAnimationFrame) !== "undefined")}else if ("Animation.request (Firefox)"['$===']($case)) {return (typeof(window.mozRequestAnimationFrame) !== "undefined")}else if ("Animation.request (Opera)"['$===']($case)) {return (typeof(window.oRequestAnimationFrame) !== "undefined")}else if ("Animation.request (Chrome)"['$===']($case) || "Animation.request (Safari)"['$===']($case)) {return (typeof(window.webkitRequestAnimationFrame) !== "undefined")}else if ("Animation.cancel"['$===']($case)) {return (typeof(window.cancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Internet Explorer)"['$===']($case)) {return (typeof(window.msCancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Firefox)"['$===']($case)) {return (typeof(window.mozCancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Opera)"['$===']($case)) {return (typeof(window.oCancelAnimationFrame) !== "undefined")}else if ("Animation.cancel (Chrome)"['$===']($case) || "Animation.cancel (Safari)"['$===']($case)) {return (typeof(window.webkitCancelAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest"['$===']($case)) {return (typeof(window.cancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Internet Explorer)"['$===']($case)) {return (typeof(window.msCancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Firefox)"['$===']($case)) {return (typeof(window.mozCancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Opera)"['$===']($case)) {return (typeof(window.oCancelRequestAnimationFrame) !== "undefined")}else if ("Animation.cancelRequest (Chrome)"['$===']($case) || "Animation.cancelRequest (Safari)"['$===']($case)) {return (typeof(window.webkitCancelRequestAnimationFrame) !== "undefined")}else { return nil }})(); return self.support[feature] = support; }, TMP_1.$$arity = 1); Opal.defs(self, '$loaded?', TMP_2 = function(name) { var self = this, $case = nil; return (function() {$case = name;if ("Sizzle"['$===']($case)) {return (typeof(window.Sizzle) !== "undefined")}else if ("wicked-good-xpath"['$===']($case)) {return (typeof(window.wgxpath) !== "undefined")}else { return nil }})(); }, TMP_2.$$arity = 1); })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/base"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$include', '$call', '$to_n', '$<<', '$converters', '$native?', '$each', '$instance_eval', '$register', '$to_proc', '$attr_reader', '$lambda', '$new', '$stopped?', '$arguments', '$!', '$prevented?', '$class_for', '$off', '$target', '$[]', '$delegated', '$delete', '$last', '$empty?', '$first', '$raise', '$name_for', '$handlers', '$[]=', '$include?', '$callback=', '$on!', '$delegate', '$on', '$handlers=', '$push', '$callbacks', '$attach', '$attach!', '$supports?', '$name', '$==', '$event', '$===', '$warn', '$detach', '$gsub', '$delete_if', '$=~', '$clear', '$none?', '$is_a?', '$create', '$dispatch', '$trigger', '$bubbles=', '$private', '$nil?', '$dup', '$on=', '$parent']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; self.$include($scope.get('Native')); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def["native"] = nil; self.$include($scope.get('Native')); Opal.defs(self, '$new', TMP_1 = function() { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil, data = nil; TMP_1.$$p = null; data = ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_1, false, $Definition)), $a.$$p = null, $a).call($b, { bubbles: true, cancelable: true }); if (block !== false && block !== nil && block != null) { block.$call(data)}; return data.$to_n(); }, TMP_1.$$arity = 0); Opal.defn(self, '$bubbles=', TMP_2 = function(value) { var self = this; return self["native"].bubbles = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$cancelable=', TMP_3 = function(value) { var self = this; return self["native"].cancelable = value; }, TMP_3.$$arity = 1), nil) && 'cancelable='; })($scope.base, null); return (function($base) { var $Target, self = $Target = $module($base, 'Target'); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5, TMP_7, TMP_10, TMP_19, TMP_22, $a, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_32, TMP_33, TMP_35, TMP_36, TMP_37, TMP_38, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_46; Opal.defs(self, '$converters', TMP_4 = function $$converters() { var $a, self = this; if (self.converters == null) self.converters = nil; return ((($a = self.converters) !== false && $a !== nil && $a != null) ? $a : self.converters = []); }, TMP_4.$$arity = 0); Opal.defs(self, '$register', TMP_5 = function $$register() { var self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; return self.$converters()['$<<'](block); }, TMP_5.$$arity = 0); Opal.defs(self, '$convert', TMP_7 = function $$convert(value) {try { var $a, $b, TMP_6, self = this; if ((($a = self['$native?'](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return value }; ($a = ($b = self.$converters()).$each, $a.$$p = (TMP_6 = function(block){var self = TMP_6.$$s || this, $c, result = nil; if (block == null) block = nil; if ((($c = result = block.$call(value)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { Opal.ret(result) } else { return nil }}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b); return nil; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_7.$$arity = 1); Opal.defs(self, '$included', TMP_10 = function $$included(klass) { var $a, $b, TMP_8, self = this; return ($a = ($b = klass).$instance_eval, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, TMP_9; return (Opal.defs(self, '$target', TMP_9 = function $$target() { var $a, $b, self = this, $iter = TMP_9.$$p, block = $iter || nil; TMP_9.$$p = null; return ($a = ($b = (($scope.get('Event')).$$scope.get('Target'))).$register, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_9.$$arity = 0), nil) && 'target'}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $a).call($b); }, TMP_10.$$arity = 1); (function($base, $super) { function $Callback(){}; var self = $Callback = $klass($base, $super, 'Callback', $Callback); var def = self.$$proto, $scope = self.$$scope, TMP_11, TMP_12, TMP_14, TMP_15, TMP_16; def.proc = def.name = nil; self.$attr_reader("target", "name", "selector"); Opal.defn(self, '$initialize', TMP_11 = function $$initialize(target, name, selector) { var self = this, $iter = TMP_11.$$p, block = $iter || nil; if (selector == null) { selector = nil; } TMP_11.$$p = null; self.target = target; self.name = name; self.selector = selector; return self.block = block; }, TMP_11.$$arity = -3); Opal.defn(self, '$call', TMP_12 = function $$call(event) { var self = this; return self.$to_proc().$call(event); }, TMP_12.$$arity = 1); Opal.defn(self, '$to_proc', TMP_14 = function $$to_proc() { var $a, $b, $c, TMP_13, self = this; return ((($a = self.proc) !== false && $a !== nil && $a != null) ? $a : self.proc = ($b = ($c = self).$lambda, $b.$$p = (TMP_13 = function(event){var self = TMP_13.$$s || this, $d; if (self.block == null) self.block = nil; if (event == null) event = nil; if (!event.currentTarget) { event.currentTarget = self.target.native; } event = $scope.get('Event').$new(event, self); if ((($d = event['$stopped?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { } else { ($d = self.block).$call.apply($d, [event].concat(Opal.to_a(event.$arguments()))) }; return event['$prevented?']()['$!']();}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $b).call($c)); }, TMP_14.$$arity = 0); Opal.defn(self, '$event', TMP_15 = function $$event() { var self = this; return $scope.get('Event').$class_for(self.name); }, TMP_15.$$arity = 0); return (Opal.defn(self, '$off', TMP_16 = function $$off() { var self = this; return self.$target().$off(self); }, TMP_16.$$arity = 0), nil) && 'off'; })($scope.base, null); (function($base, $super) { function $Delegate(){}; var self = $Delegate = $klass($base, $super, 'Delegate', $Delegate); var def = self.$$proto, $scope = self.$$scope, TMP_17, TMP_18; def.target = def.name = def.pair = nil; Opal.defn(self, '$initialize', TMP_17 = function $$initialize(target, name, pair) { var self = this; self.target = target; self.name = name; return self.pair = pair; }, TMP_17.$$arity = 3); return (Opal.defn(self, '$off', TMP_18 = function $$off() { var $a, self = this, delegate = nil; delegate = self.target.$delegated()['$[]'](self.name); delegate.$last().$delete(self.pair); if ((($a = delegate.$last()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { delegate.$first().$off(); return delegate.$delete(self.name); } else { return nil }; }, TMP_18.$$arity = 0), nil) && 'off'; })($scope.base, null); Opal.cdecl($scope, 'Delegates', $scope.get('Struct').$new("callback", "handlers")); Opal.defn(self, '$on', TMP_19 = function $$on(name, selector) { var $a, $b, $c, $d, TMP_20, $e, TMP_21, self = this, $iter = TMP_19.$$p, block = $iter || nil, delegate = nil, pair = nil, callback = nil; if (selector == null) { selector = nil; } TMP_19.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block has been given") }; name = $scope.get('Event').$name_for(name); if (selector !== false && selector !== nil && selector != null) { if ((($a = delegate = self.$delegated()['$[]'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { pair = [selector, block]; delegate.$handlers()['$<<'](pair); return $scope.get('Delegate').$new(self, name, pair); } else { delegate = self.$delegated()['$[]='](name, $scope.get('Delegates').$new()); if ((($a = ["blur", "focus"]['$include?'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($a = [($c = ($d = self)['$on!'], $c.$$p = (TMP_20 = function(e){var self = TMP_20.$$s || this; if (e == null) e = nil; return self.$delegate(delegate, e)}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $c).call($d, name)]), $b = delegate, $b['$callback='].apply($b, $a), $a[$a.length-1]) } else { (($a = [($c = ($e = self).$on, $c.$$p = (TMP_21 = function(e){var self = TMP_21.$$s || this; if (e == null) e = nil; return self.$delegate(delegate, e)}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21), $c).call($e, name)]), $b = delegate, $b['$callback='].apply($b, $a), $a[$a.length-1]) }; pair = [selector, block]; (($a = [[pair]]), $b = delegate, $b['$handlers='].apply($b, $a), $a[$a.length-1]); return $scope.get('Delegate').$new(self, name, pair); } } else { callback = ($a = ($b = $scope.get('Callback')).$new, $a.$$p = block.$to_proc(), $a).call($b, self, name, selector); self.$callbacks().$push(callback); return self.$attach(callback); }; }, TMP_19.$$arity = -2); Opal.defn(self, '$on!', TMP_22 = function(name) { var $a, $b, self = this, $iter = TMP_22.$$p, block = $iter || nil, callback = nil; TMP_22.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block has been given") }; name = $scope.get('Event').$name_for(name); callback = ($a = ($b = $scope.get('Callback')).$new, $a.$$p = block.$to_proc(), $a).call($b, self, name); self.$callbacks().$push(callback); return self['$attach!'](callback); }, TMP_22.$$arity = 1); if ((($a = $scope.get('Browser')['$supports?']("Event.addListener")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$attach', TMP_23 = function $$attach(callback) { var self = this; if (self["native"] == null) self["native"] = nil; self["native"].addEventListener(callback.$name(), callback.$to_proc()); return callback; }, TMP_23.$$arity = 1); Opal.defn(self, '$attach!', TMP_24 = function(callback) { var self = this; if (self["native"] == null) self["native"] = nil; self["native"].addEventListener(callback.$name(), callback.$to_proc(), true); return callback; }, TMP_24.$$arity = 1); } else if ((($a = $scope.get('Browser')['$supports?']("Event.attach")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$attach', TMP_25 = function $$attach(callback) { var self = this; if (self["native"] == null) self["native"] = nil; if (callback.$event()['$==']($scope.get('Custom'))) { if (!self["native"].$custom) { self["native"].$custom = function(event) { for (var i = 0, length = self["native"].$callbacks.length; i < length; i++) { var callback = self["native"].$callbacks[i]; if ((callback).$event()['$==']($scope.get('Custom'))) { event.type = callback.name; (callback).$call(event); } } }; self["native"].attachEvent("ondataavailable", self["native"].$custom); } ; } else { self["native"].attachEvent("on" + callback.$name(), callback.$to_proc()); }; return callback; }, TMP_25.$$arity = 1); Opal.defn(self, '$attach!', TMP_26 = function(callback) { var self = this, $case = nil; if (self["native"] == null) self["native"] = nil; $case = callback.$name();if ("blur"['$===']($case)) {self["native"].attachEvent("onfocusout", callback.$to_proc());}else if ("focus"['$===']($case)) {self["native"].attachEvent("onfocusin", callback.$to_proc());}else {self.$warn("attach: capture doesn't work on this browser"); self.$attach(callback);}; return callback; }, TMP_26.$$arity = 1); } else { Opal.defn(self, '$attach', TMP_27 = function $$attach($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_27.$$arity = -1); Opal.defn(self, '$attach!', TMP_28 = function($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_28.$$arity = -1); }; Opal.defn(self, '$off', TMP_32 = function $$off(what) { var $a, $b, TMP_29, $c, TMP_30, $d, TMP_31, self = this, $case = nil; if (what == null) { what = nil; } return (function() {$case = what;if ($scope.get('Callback')['$===']($case)) {self.$callbacks().$delete(what); return self.$detach(what);}else if ($scope.get('String')['$===']($case)) {if ((($a = ((($b = what['$include?']("*")) !== false && $b !== nil && $b != null) ? $b : what['$include?']("?"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$off($scope.get('Regexp').$new(what.$gsub(/\*/, ".*?").$gsub(/\?/, "."))) } else { what = $scope.get('Event').$name_for(what); return ($a = ($b = self.$callbacks()).$delete_if, $a.$$p = (TMP_29 = function(callback){var self = TMP_29.$$s || this; if (callback == null) callback = nil; if (callback.$name()['$=='](what)) { self.$detach(callback); return true; } else { return nil }}, TMP_29.$$s = self, TMP_29.$$arity = 1, TMP_29), $a).call($b); }}else if ($scope.get('Regexp')['$===']($case)) {return ($a = ($c = self.$callbacks()).$delete_if, $a.$$p = (TMP_30 = function(callback){var self = TMP_30.$$s || this, $d; if (callback == null) callback = nil; if ((($d = callback.$name()['$=~'](what)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { self.$detach(callback); return true; } else { return nil }}, TMP_30.$$s = self, TMP_30.$$arity = 1, TMP_30), $a).call($c)}else {($a = ($d = self.$callbacks()).$each, $a.$$p = (TMP_31 = function(callback){var self = TMP_31.$$s || this; if (callback == null) callback = nil; return self.$detach(callback)}, TMP_31.$$s = self, TMP_31.$$arity = 1, TMP_31), $a).call($d); return self.$callbacks().$clear();}})(); }, TMP_32.$$arity = -1); if ((($a = $scope.get('Browser')['$supports?']("Event.removeListener")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$detach', TMP_33 = function $$detach(callback) { var self = this; if (self["native"] == null) self["native"] = nil; return self["native"].removeEventListener(callback.$name(), callback.$to_proc(), false); }, TMP_33.$$arity = 1) } else if ((($a = $scope.get('Browser')['$supports?']("Event.detach")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$detach', TMP_35 = function $$detach(callback) { var $a, $b, $c, TMP_34, self = this; if (self["native"] == null) self["native"] = nil; if (callback.$event()['$==']($scope.get('Custom'))) { if ((($a = ($b = ($c = self.$callbacks())['$none?'], $b.$$p = (TMP_34 = function(c){var self = TMP_34.$$s || this; if (c == null) c = nil; return c.$event()['$==']($scope.get('Custom'))}, TMP_34.$$s = self, TMP_34.$$arity = 1, TMP_34), $b).call($c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self["native"].detachEvent("ondataavailable", self["native"].$custom); delete self["native"].$custom; ; } else { return nil } } else { return self["native"].detachEvent("on" + callback.$name(), callback.$to_proc()); }; }, TMP_35.$$arity = 1) } else { Opal.defn(self, '$detach', TMP_36 = function $$detach(callback) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_36.$$arity = 1) }; Opal.defn(self, '$trigger', TMP_37 = function $$trigger(event, $a_rest) { var $b, $c, self = this, args, $iter = TMP_37.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_37.$$p = null; if ((($b = event['$is_a?']($scope.get('String'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { event = ($b = ($c = $scope.get('Event')).$create, $b.$$p = block.$to_proc(), $b).apply($c, [event].concat(Opal.to_a(args)))}; return self.$dispatch(event); }, TMP_37.$$arity = -2); Opal.defn(self, '$trigger!', TMP_38 = function(event, $a_rest) { var $b, $c, TMP_39, self = this, args, $iter = TMP_38.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_38.$$p = null; return ($b = ($c = self).$trigger, $b.$$p = (TMP_39 = function(e){var self = TMP_39.$$s || this, $a, $d; if (e == null) e = nil; if (block !== false && block !== nil && block != null) { block.$call(e)}; return (($a = [false]), $d = e, $d['$bubbles='].apply($d, $a), $a[$a.length-1]);}, TMP_39.$$s = self, TMP_39.$$arity = 1, TMP_39), $b).apply($c, [event].concat(Opal.to_a(args))); }, TMP_38.$$arity = -2); if ((($a = $scope.get('Browser')['$supports?']("Event.dispatch")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$dispatch', TMP_40 = function $$dispatch(event) { var self = this; if (self["native"] == null) self["native"] = nil; return self["native"].dispatchEvent(event.$to_n()); }, TMP_40.$$arity = 1) } else if ((($a = $scope.get('Browser')['$supports?']("Event.fire")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$dispatch', TMP_41 = function $$dispatch(event) { var $a, self = this; if (self["native"] == null) self["native"] = nil; if ((($a = $scope.get('Custom')['$==='](event)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"].fireEvent("ondataavailable", event.$to_n()); } else { return self["native"].fireEvent("on" + event.$name(), event.$to_n()); }; }, TMP_41.$$arity = 1) } else { Opal.defn(self, '$dispatch', TMP_42 = function $$dispatch($a_rest) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_42.$$arity = -1) }; self.$private(); Opal.defn(self, '$callbacks', TMP_43 = function $$callbacks() { var self = this; if (self["native"] == null) self["native"] = nil; if (!self["native"].$callbacks) { self["native"].$callbacks = []; } return self["native"].$callbacks; ; }, TMP_43.$$arity = 0); Opal.defn(self, '$delegated', TMP_44 = function $$delegated() { var self = this; if (self["native"] == null) self["native"] = nil; if (!self["native"].$delegated) { self["native"].$delegated = $hash2([], {}); } return self["native"].$delegated; ; }, TMP_44.$$arity = 0); Opal.defn(self, '$delegate', TMP_46 = function $$delegate(delegates, event, element) { var $a, $b, TMP_45, self = this; if (element == null) { element = event.$target(); } if ((($a = ((($b = element['$nil?']()) !== false && $b !== nil && $b != null) ? $b : element['$=='](event.$on()))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; ($a = ($b = delegates.$handlers()).$each, $a.$$p = (TMP_45 = function(selector, block){var self = TMP_45.$$s || this, $c, $d, new$ = nil; if (selector == null) selector = nil;if (block == null) block = nil; if ((($c = element['$=~'](selector)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { new$ = event.$dup(); (($c = [element]), $d = new$, $d['$on='].apply($d, $c), $c[$c.length-1]); return ($c = block).$call.apply($c, [new$].concat(Opal.to_a(new$.$arguments()))); } else { return nil }}, TMP_45.$$s = self, TMP_45.$$arity = 2, TMP_45), $a).call($b); return self.$delegate(delegates, event, element.$parent()); }, TMP_46.$$arity = -3); })($scope.base); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/ui"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $UI(){}; var self = $UI = $klass($base, $super, 'UI', $UI); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_4, TMP_5; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.UI"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$detail=', TMP_2 = function(value) { var self = this; return self["native"].detail = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$view=', TMP_3 = function(value) { var self = this; return self["native"].view = value; }, TMP_3.$$arity = 1), nil) && 'view='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; return new UIEvent(name, desc); }, TMP_4.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; var event = document.createEvent("UIEvent"); event.initUIEvent(name, desc.bubbles, desc.cancelable, desc.view || window, desc.detail || 0); return event; }, TMP_5.$$arity = 2)}}; self.$alias_native("detail"); return self.$alias_native("view"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/mouse"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$!', '$nil?', '$[]', '$include', '$new', '$try_convert', '$supported?', '$supports?', '$alias_native', '$x', '$screen', '$y', '$DOM', '$==', '$downcase', '$name']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Mouse(){}; var self = $Mouse = $klass($base, $super, 'Mouse', $Mouse); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; if ($gvars.$ == null) $gvars.$ = nil; return $gvars.$['$[]']("MouseEvent")['$nil?']()['$!'](); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28; def["native"] = nil; (function($base, $super) { function $Client(){}; var self = $Client = $klass($base, $super, 'Client', $Client); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_2 = function(value) { var self = this; return self["native"].clientX = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$y=', TMP_3 = function(value) { var self = this; return self["native"].clientY = value; }, TMP_3.$$arity = 1), nil) && 'y='; })($scope.base, null); (function($base, $super) { function $Layer(){}; var self = $Layer = $klass($base, $super, 'Layer', $Layer); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_4 = function(value) { var self = this; return self["native"].layerX = value; }, TMP_4.$$arity = 1); return (Opal.defn(self, '$y=', TMP_5 = function(value) { var self = this; return self["native"].layerY = value; }, TMP_5.$$arity = 1), nil) && 'y='; })($scope.base, null); (function($base, $super) { function $Offset(){}; var self = $Offset = $klass($base, $super, 'Offset', $Offset); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_6 = function(value) { var self = this; return self["native"].offsetX = value; }, TMP_6.$$arity = 1); return (Opal.defn(self, '$y=', TMP_7 = function(value) { var self = this; return self["native"].offsetY= value; }, TMP_7.$$arity = 1), nil) && 'y='; })($scope.base, null); (function($base, $super) { function $Page(){}; var self = $Page = $klass($base, $super, 'Page', $Page); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_8 = function(value) { var self = this; return self["native"].pageX = value; }, TMP_8.$$arity = 1); return (Opal.defn(self, '$y=', TMP_9 = function(value) { var self = this; return self["native"].pageY = value; }, TMP_9.$$arity = 1), nil) && 'y='; })($scope.base, null); (function($base, $super) { function $Screen(){}; var self = $Screen = $klass($base, $super, 'Screen', $Screen); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_11; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_10 = function(value) { var self = this; return self["native"].screenX = value; }, TMP_10.$$arity = 1); return (Opal.defn(self, '$y=', TMP_11 = function(value) { var self = this; return self["native"].screenY = value; }, TMP_11.$$arity = 1), nil) && 'y='; })($scope.base, null); (function($base, $super) { function $Ancestor(){}; var self = $Ancestor = $klass($base, $super, 'Ancestor', $Ancestor); var def = self.$$proto, $scope = self.$$scope, TMP_12, TMP_13; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_12 = function(value) { var self = this; return self["native"].x = value; }, TMP_12.$$arity = 1); return (Opal.defn(self, '$y=', TMP_13 = function(value) { var self = this; return self["native"].y = value; }, TMP_13.$$arity = 1), nil) && 'y='; })($scope.base, null); Opal.defn(self, '$x=', TMP_14 = function(value) { var self = this; return self["native"].screenX = value; }, TMP_14.$$arity = 1); Opal.defn(self, '$y=', TMP_15 = function(value) { var self = this; return self["native"].screenY = value; }, TMP_15.$$arity = 1); Opal.defn(self, '$alt!', TMP_16 = function() { var self = this; return self["native"].altKey = true; }, TMP_16.$$arity = 0); Opal.defn(self, '$ctrl!', TMP_17 = function() { var self = this; return self["native"].ctrlKey = true; }, TMP_17.$$arity = 0); Opal.defn(self, '$meta!', TMP_18 = function() { var self = this; return self["native"].metaKey = true; }, TMP_18.$$arity = 0); Opal.defn(self, '$button=', TMP_19 = function(value) { var self = this; return self["native"].button = value; }, TMP_19.$$arity = 1); Opal.defn(self, '$client', TMP_20 = function $$client() { var self = this; return $scope.get('Client').$new(self["native"]); }, TMP_20.$$arity = 0); Opal.defn(self, '$layer', TMP_21 = function $$layer() { var self = this; return $scope.get('Layer').$new(self["native"]); }, TMP_21.$$arity = 0); Opal.defn(self, '$offset', TMP_22 = function $$offset() { var self = this; return $scope.get('Offset').$new(self["native"]); }, TMP_22.$$arity = 0); Opal.defn(self, '$page', TMP_23 = function $$page() { var self = this; return $scope.get('Page').$new(self["native"]); }, TMP_23.$$arity = 0); Opal.defn(self, '$screen', TMP_24 = function $$screen() { var self = this; return $scope.get('Screen').$new(self["native"]); }, TMP_24.$$arity = 0); Opal.defn(self, '$ancestor', TMP_25 = function $$ancestor() { var self = this; return $scope.get('Ancestor').$new(self["native"]); }, TMP_25.$$arity = 0); Opal.defn(self, '$related=', TMP_26 = function(elem) { var self = this; return self["native"].relatedTarget = $scope.get('Native').$try_convert(elem); }, TMP_26.$$arity = 1); Opal.defn(self, '$from=', TMP_27 = function(elem) { var self = this; return self["native"].fromElement = $scope.get('Native').$try_convert(elem); }, TMP_27.$$arity = 1); return (Opal.defn(self, '$to=', TMP_28 = function(elem) { var self = this; return self["native"].toElement = $scope.get('Native').$try_convert(elem); }, TMP_28.$$arity = 1), nil) && 'to='; })($scope.base, (($scope.get('UI')).$$scope.get('Definition'))); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_29 = function $$construct(name, desc) { var self = this; return new MouseEvent(name, desc); }, TMP_29.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_30 = function $$construct(name, desc) { var self = this; var event = document.createEvent("MouseEvent"); event.initMouseEvent(name, desc.bubbles, desc.cancelable, desc.view || window, desc.detail || 0, desc.screenX || 0, desc.screenY || 0, desc.clientX || 0, desc.clientY || 0, desc.ctrlKey || false, desc.altKey || false, desc.shiftKey || false, desc.metaKey || false, desc.button || 0, desc.relatedTarget || null); return event; }, TMP_30.$$arity = 2)}}; self.$alias_native("alt?", "altKey"); self.$alias_native("ctrl?", "ctrlKey"); self.$alias_native("meta?", "metaKey"); self.$alias_native("shift?", "shiftKey"); self.$alias_native("button"); Opal.defn(self, '$client', TMP_31 = function $$client() { var self = this; return $scope.get('Position').$new(self["native"].clientX, self["native"].clientY); }, TMP_31.$$arity = 0); Opal.defn(self, '$layer', TMP_32 = function $$layer() { var $a, self = this; if ((($a = self["native"].layerX == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return $scope.get('Position').$new(self["native"].layerX, self["native"].layerY) }; }, TMP_32.$$arity = 0); Opal.defn(self, '$offset', TMP_33 = function $$offset() { var $a, self = this; if ((($a = self["native"].offsetX == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return $scope.get('Position').$new(self["native"].offsetX, self["native"].offsetY) }; }, TMP_33.$$arity = 0); Opal.defn(self, '$page', TMP_34 = function $$page() { var $a, self = this; if ((($a = self["native"].pageX == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return $scope.get('Position').$new(self["native"].pageX, self["native"].pageY) }; }, TMP_34.$$arity = 0); Opal.defn(self, '$screen', TMP_35 = function $$screen() { var $a, self = this; if ((($a = self["native"].screenX == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return $scope.get('Position').$new(self["native"].screenX, self["native"].screenY) }; }, TMP_35.$$arity = 0); Opal.defn(self, '$ancestor', TMP_36 = function $$ancestor() { var $a, self = this; if ((($a = self["native"].x == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return $scope.get('Position').$new(self["native"].x, self["native"].y) }; }, TMP_36.$$arity = 0); Opal.defn(self, '$x', TMP_37 = function $$x() { var self = this; return self.$screen().$x(); }, TMP_37.$$arity = 0); Opal.defn(self, '$y', TMP_38 = function $$y() { var self = this; return self.$screen().$y(); }, TMP_38.$$arity = 0); Opal.defn(self, '$related', TMP_39 = function $$related() { var $a, self = this; if ((($a = self["native"].relatedTarget == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$DOM(self["native"].relatedTarget) }; }, TMP_39.$$arity = 0); Opal.defn(self, '$from', TMP_40 = function $$from() { var $a, self = this; if ((($a = self["native"].fromElement == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$DOM(self["native"].fromElement) }; }, TMP_40.$$arity = 0); Opal.defn(self, '$to', TMP_41 = function $$to() { var $a, self = this; if ((($a = self["native"].toElement == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.$DOM(self["native"].toElement) }; }, TMP_41.$$arity = 0); Opal.defn(self, '$click?', TMP_42 = function() { var self = this; return self.$name().$downcase()['$==']("click"); }, TMP_42.$$arity = 0); Opal.defn(self, '$double_click?', TMP_43 = function() { var self = this; return self.$name().$downcase()['$==']("dblclick"); }, TMP_43.$$arity = 0); Opal.defn(self, '$down?', TMP_44 = function() { var self = this; return self.$name().$downcase()['$==']("mousedown"); }, TMP_44.$$arity = 0); Opal.defn(self, '$enter?', TMP_45 = function() { var self = this; return self.$name().$downcase()['$==']("mouseenter"); }, TMP_45.$$arity = 0); Opal.defn(self, '$leave?', TMP_46 = function() { var self = this; return self.$name().$downcase()['$==']("mouseleave"); }, TMP_46.$$arity = 0); Opal.defn(self, '$move?', TMP_47 = function() { var self = this; return self.$name().$downcase()['$==']("mousemove"); }, TMP_47.$$arity = 0); Opal.defn(self, '$out?', TMP_48 = function() { var self = this; return self.$name().$downcase()['$==']("mouseout"); }, TMP_48.$$arity = 0); Opal.defn(self, '$over?', TMP_49 = function() { var self = this; return self.$name().$downcase()['$==']("mouseover"); }, TMP_49.$$arity = 0); Opal.defn(self, '$up?', TMP_50 = function() { var self = this; return self.$name().$downcase()['$==']("mouseup"); }, TMP_50.$$arity = 0); return (Opal.defn(self, '$show?', TMP_51 = function() { var self = this; return self.$name().$downcase()['$==']("show"); }, TMP_51.$$arity = 0), nil) && 'show?'; })($scope.base, $scope.get('UI')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/keyboard"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native', '$code', '$chr', '$==', '$downcase', '$name']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Keyboard(){}; var self = $Keyboard = $klass($base, $super, 'Keyboard', $Keyboard); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Keyboard"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10; def["native"] = nil; Opal.defn(self, '$alt!', TMP_2 = function() { var self = this; return self["native"].altKey = true; }, TMP_2.$$arity = 0); Opal.defn(self, '$ctrl!', TMP_3 = function() { var self = this; return self["native"].ctrlKey = true; }, TMP_3.$$arity = 0); Opal.defn(self, '$meta!', TMP_4 = function() { var self = this; return self["native"].metaKey = true; }, TMP_4.$$arity = 0); Opal.defn(self, '$shift!', TMP_5 = function() { var self = this; return self["native"].shiftKey = true; }, TMP_5.$$arity = 0); Opal.defn(self, '$code=', TMP_6 = function(code) { var self = this; return self["native"].keyCode = self["native"].which = code; }, TMP_6.$$arity = 1); Opal.defn(self, '$key=', TMP_7 = function(key) { var self = this; return self["native"].key = key; }, TMP_7.$$arity = 1); Opal.defn(self, '$char=', TMP_8 = function(char$) { var self = this; return self["native"].char = self["native"].charCode = char$; }, TMP_8.$$arity = 1); Opal.defn(self, '$repeat!', TMP_9 = function() { var self = this; return self["native"].repeat = true; }, TMP_9.$$arity = 0); return (Opal.defn(self, '$locale=', TMP_10 = function(value) { var self = this; return self["native"].locale = value; }, TMP_10.$$arity = 1), nil) && 'locale='; })($scope.base, (($scope.get('UI')).$$scope.get('Definition'))); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_11 = function $$construct(name, desc) { var self = this; return new KeyboardEvent(name, desc); }, TMP_11.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_12 = function $$construct(name, desc) { var self = this; var modifiers = ""; if (desc.altKey) { modifiers += "Alt "; } if (desc.ctrlKey) { modifiers += "Ctrl "; } if (desc.shiftKey) { modifiers += "Shift" ; } if (desc.metaKey) { modifiers += "Meta "; } var event = document.createEvent("KeyboardEvent"); event.initKeyboardEvent(name, desc.bubbles, desc.cancelable, desc.view || window, desc.which, 0, modifiers, desc.repeat, desc.locale); return event; }, TMP_12.$$arity = 2)}}; self.$alias_native("alt?", "altKey"); self.$alias_native("ctrl?", "ctrlKey"); self.$alias_native("meta?", "metaKey"); self.$alias_native("shift?", "shiftKey"); self.$alias_native("locale"); self.$alias_native("repeat?", "repeat"); Opal.defn(self, '$key', TMP_13 = function $$key() { var self = this; return self["native"].key || self["native"].keyIdentifier || nil; }, TMP_13.$$arity = 0); Opal.defn(self, '$code', TMP_14 = function $$code() { var self = this; return self["native"].keyCode || self["native"].which || nil; }, TMP_14.$$arity = 0); Opal.defn(self, '$char', TMP_15 = function() { var $a, self = this; return self["native"].char || self["native"].charCode || (function() {if ((($a = self.$code()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$code().$chr() } else { return nil }; return nil; })(); }, TMP_15.$$arity = 0); Opal.alias(self, 'to_i', 'key'); Opal.defn(self, '$down?', TMP_16 = function() { var self = this; return self.$name().$downcase()['$==']("keydown"); }, TMP_16.$$arity = 0); Opal.defn(self, '$press?', TMP_17 = function() { var self = this; return self.$name().$downcase()['$==']("keypress"); }, TMP_17.$$arity = 0); return (Opal.defn(self, '$up?', TMP_18 = function() { var self = this; return self.$name().$downcase()['$==']("keyup"); }, TMP_18.$$arity = 0), nil) && 'up?'; })($scope.base, $scope.get('UI')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/focus"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$convert', '$supported?', '$DOM']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Focus(){}; var self = $Focus = $klass($base, $super, 'Focus', $Focus); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_4, TMP_5, TMP_6; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Focus"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$view=', TMP_2 = function(value) { var self = this; return self["native"].view = $scope.get('Native').$convert(value); }, TMP_2.$$arity = 1); return (Opal.defn(self, '$related=', TMP_3 = function(elem) { var self = this; return self["native"].relatedTarget = $scope.get('Native').$convert(elem); }, TMP_3.$$arity = 1), nil) && 'related='; })($scope.base, (($scope.get('UI')).$$scope.get('Definition'))); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; return new FocusEvent(name, desc); }, TMP_4.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; var event = document.createEvent("FocusEvent"); event.initFocusEvent(name, desc.bubbles, desc.cancelable, desc.view || window, 0, desc.relatedTarget); return event; }, TMP_5.$$arity = 2)}}; return (Opal.defn(self, '$related', TMP_6 = function $$related() { var self = this; return self.$DOM(self["native"].relatedTarget); }, TMP_6.$$arity = 0), nil) && 'related'; })($scope.base, $scope.get('UI')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/wheel"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$!', '$nil?', '$[]', '$===', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Wheel(){}; var self = $Wheel = $klass($base, $super, 'Wheel', $Wheel); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_6, TMP_7; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; if ($gvars.$ == null) $gvars.$ = nil; return $gvars.$['$[]']("WheelEvent")['$nil?']()['$!'](); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$x=', TMP_2 = function(value) { var self = this; return self["native"].deltaX = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$y=', TMP_3 = function(value) { var self = this; return self["native"].deltaY = value; }, TMP_3.$$arity = 1); Opal.defn(self, '$z=', TMP_4 = function(value) { var self = this; return self["native"].deltaZ = value; }, TMP_4.$$arity = 1); return (Opal.defn(self, '$mode=', TMP_5 = function(value) { var self = this, $case = nil; value = (function() {$case = value;if ("pixel"['$===']($case)) {return WheelEvent.DOM_DELTA_PIXEL;}else if ("line"['$===']($case)) {return WheelEvent.DOM_DELTA_LINE;}else if ("page"['$===']($case)) {return WheelEvent.DOM_DELTA_PAGE;}else { return nil }})(); return self["native"].deltaMode = value; }, TMP_5.$$arity = 1), nil) && 'mode='; })($scope.base, $scope.get('Definition')); Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return new WheelEvent(name, desc); }, TMP_6.$$arity = 2); self.$alias_native("x", "deltaX"); self.$alias_native("y", "deltaY"); self.$alias_native("z", "deltaZ"); return (Opal.defn(self, '$mode', TMP_7 = function $$mode() { var self = this, $case = nil; return (function() {$case = self["native"].deltaMode;if ((WheelEvent.DOM_DELTA_PIXEL)['$===']($case)) {return "pixel"}else if ((WheelEvent.DOM_DELTA_LINE)['$===']($case)) {return "line"}else if ((WheelEvent.DOM_DELTA_PAGE)['$===']($case)) {return "page"}else { return nil }})(); }, TMP_7.$$arity = 0), nil) && 'mode'; })($scope.base, $scope.get('UI')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/composition"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native', '$==', '$downcase', '$name']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Composition(){}; var self = $Composition = $klass($base, $super, 'Composition', $Composition); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Composition"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$data=', TMP_2 = function(value) { var self = this; return self["native"].data = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$locale=', TMP_3 = function(value) { var self = this; return self["native"].locale = value; }, TMP_3.$$arity = 1), nil) && 'locale='; })($scope.base, (($scope.get('UI')).$$scope.get('Definition'))); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; return new CompositionEvent(name, desc); }, TMP_4.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; var event = document.createEvent("CompositionEvent"); event.initCompositionEvent(name, desc.bubbles, desc.cancelable, desc.view || window, desc.data, desc.locale); return event; }, TMP_5.$$arity = 2)}}; self.$alias_native("data"); self.$alias_native("locale"); Opal.defn(self, '$start?', TMP_6 = function() { var self = this; return self.$name().$downcase()['$==']("compositionstart"); }, TMP_6.$$arity = 0); Opal.defn(self, '$update?', TMP_7 = function() { var self = this; return self.$name().$downcase()['$==']("compositionupdate"); }, TMP_7.$$arity = 0); return (Opal.defn(self, '$end?', TMP_8 = function() { var self = this; return self.$name().$downcase()['$==']("compositionend"); }, TMP_8.$$arity = 0), nil) && 'end?'; })($scope.base, $scope.get('UI')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/animation"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Animation(){}; var self = $Animation = $klass($base, $super, 'Animation', $Animation); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_4, TMP_5; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Animation"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$animation=', TMP_2 = function(value) { var self = this; return self["native"].animationName = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$elapsed=', TMP_3 = function(value) { var self = this; return self["native"].elapsedTime = value; }, TMP_3.$$arity = 1), nil) && 'elapsed='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; return new AnimationEvent(name, desc); }, TMP_4.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; var event = document.createEvent("AnimationEvent"); event.initAnimationEvent(name, desc.bubbles, desc.cancelable, desc.animationName, desc.elapsedTime); return event; }, TMP_5.$$arity = 2)}}; self.$alias_native("name", "animationName"); return self.$alias_native("elapsed", "elapsedTime"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/audio_processing"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $AudioProcessing(){}; var self = $AudioProcessing = $klass($base, $super, 'AudioProcessing', $AudioProcessing); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_5; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.AudioProcessing"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defn(self, '$time=', TMP_2 = function(value) { var self = this; return self["native"].playbackTime = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$input=', TMP_3 = function(value) { var self = this; return self["native"].inputBuffer = value; }, TMP_3.$$arity = 1); return (Opal.defn(self, '$output=', TMP_4 = function(value) { var self = this; return self["native"].outputBuffer = value; }, TMP_4.$$arity = 1), nil) && 'output='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; return new AudioProcessingEvent(name, desc); }, TMP_5.$$arity = 2)}}; self.$alias_native("time", "playbackTime"); self.$alias_native("input", "inputBuffer"); return self.$alias_native("output", "outputBuffer"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/before_unload"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $BeforeUnload(){}; var self = $BeforeUnload = $klass($base, $super, 'BeforeUnload', $BeforeUnload); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.BeforeUnload"); }, TMP_1.$$arity = 0); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (Opal.defs(self, '$construct', TMP_2 = function $$construct(name, desc) { var self = this; return new BeforeUnloadEvent(name, desc); }, TMP_2.$$arity = 2), nil) && 'construct' } else { return nil } } else { return nil }; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/clipboard"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Clipboard(){}; var self = $Clipboard = $klass($base, $super, 'Clipboard', $Clipboard); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_4; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Clipboard"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$data=', TMP_2 = function(value) { var self = this; return self["native"].data = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$type=', TMP_3 = function(value) { var self = this; return self["native"].dataType = value; }, TMP_3.$$arity = 1), nil) && 'type='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; return new ClipboardEvent(name, desc); }, TMP_4.$$arity = 2)}}; self.$alias_native("data"); return self.$alias_native("type", "dataType"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/device_light"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $DeviceLight(){}; var self = $DeviceLight = $klass($base, $super, 'DeviceLight', $DeviceLight); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_3; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.DeviceLight"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2; def["native"] = nil; return (Opal.defn(self, '$value=', TMP_2 = function(value) { var self = this; return self["native"].value = value; }, TMP_2.$$arity = 1), nil) && 'value=' })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_3 = function $$construct(name, desc) { var self = this; return new DeviceLightEvent(name, desc); }, TMP_3.$$arity = 2)}}; return self.$alias_native("value"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/device_motion"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$new', '$to_n', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $DeviceMotion(){}; var self = $DeviceMotion = $klass($base, $super, 'DeviceMotion', $DeviceMotion); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_6, TMP_7; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.DeviceMotion"); }, TMP_1.$$arity = 0); Opal.cdecl($scope, 'Acceleration', $scope.get('Struct').$new("x", "y", "z")); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$acceleration=', TMP_2 = function(value) { var self = this; return self["native"].acceleration = value.$to_n(); }, TMP_2.$$arity = 1); Opal.defn(self, '$acceleration_with_gravity=', TMP_3 = function(value) { var self = this; return self["native"].accelerationIncludingGravity = value.$to_n(); }, TMP_3.$$arity = 1); Opal.defn(self, '$rotation=', TMP_4 = function(value) { var self = this; return self["native"].rotationRate = value; }, TMP_4.$$arity = 1); return (Opal.defn(self, '$interval=', TMP_5 = function(value) { var self = this; return self["native"].interval = value; }, TMP_5.$$arity = 1), nil) && 'interval='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return new DeviceMotionEvent(name, desc); }, TMP_6.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_7 = function $$construct(name, desc) { var self = this; var event = document.createEvent("DeviceMotionEvent"); event.initDeviceMotionEvent(name, desc.bubbles, desc.cancelable, desc.acceleration, desc.accelerationIncludingGravity, desc.rotationRate, desc.interval); return event; }, TMP_7.$$arity = 2)}}; self.$alias_native("acceleration"); self.$alias_native("acceleration_with_gravity", "accelerationIncludingGravity"); self.$alias_native("rotation", "rotationRate"); return self.$alias_native("interval"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/device_orientation"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $DeviceOrientation(){}; var self = $DeviceOrientation = $klass($base, $super, 'DeviceOrientation', $DeviceOrientation); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_6, TMP_7; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.DeviceOrientation"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$absolute=', TMP_2 = function(value) { var self = this; return self["native"].absolute = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$alpha=', TMP_3 = function(value) { var self = this; return self["native"].alpha = value; }, TMP_3.$$arity = 1); Opal.defn(self, '$beta=', TMP_4 = function(value) { var self = this; return self["native"].beta = value; }, TMP_4.$$arity = 1); return (Opal.defn(self, '$gamma=', TMP_5 = function(value) { var self = this; return self["native"].gamma = value; }, TMP_5.$$arity = 1), nil) && 'gamma='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return new DeviceOrientationEvent(name, desc); }, TMP_6.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_7 = function $$construct(name, desc) { var self = this; var event = document.createEvent("DeviceOrientationEvent"); event.initDeviceOrientationEvent(name, desc.bubbles, desc.cancelable, desc.alpha, desc.beta, desc.gamma, desc.absolute); return event; }, TMP_7.$$arity = 2)}}; self.$alias_native("absolute"); self.$alias_native("alpha"); self.$alias_native("beta"); return self.$alias_native("gamma"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/device_proximity"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $DeviceProximity(){}; var self = $DeviceProximity = $klass($base, $super, 'DeviceProximity', $DeviceProximity); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_5; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.DeviceProximity"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defn(self, '$value=', TMP_2 = function(value) { var self = this; return self["native"].value = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$min=', TMP_3 = function(value) { var self = this; return self["native"].min = value; }, TMP_3.$$arity = 1); return (Opal.defn(self, '$max=', TMP_4 = function(value) { var self = this; return self["native"].max = value; }, TMP_4.$$arity = 1), nil) && 'max='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; return new DeviceProximityEvent(name, desc); }, TMP_5.$$arity = 2)}}; self.$alias_native("value"); self.$alias_native("min"); return self.$alias_native("max"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/drag"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$include', '$new', '$convert', '$elem', '$supported?', '$alias_native', '$x', '$screen', '$y', '$DOM', '$raise']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Drag(){}; var self = $Drag = $klass($base, $super, 'Drag', $Drag); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Drag"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13; def["native"] = nil; (function($base, $super) { function $Client(){}; var self = $Client = $klass($base, $super, 'Client', $Client); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_2 = function(value) { var self = this; return self["native"].clientX = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$y=', TMP_3 = function(value) { var self = this; return self["native"].clientY = value; }, TMP_3.$$arity = 1), nil) && 'y='; })($scope.base, null); (function($base, $super) { function $Screen(){}; var self = $Screen = $klass($base, $super, 'Screen', $Screen); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$x=', TMP_4 = function(value) { var self = this; return self["native"].screenX = value; }, TMP_4.$$arity = 1); return (Opal.defn(self, '$y=', TMP_5 = function(value) { var self = this; return self["native"].screenY = value; }, TMP_5.$$arity = 1), nil) && 'y='; })($scope.base, null); Opal.defn(self, '$alt!', TMP_6 = function() { var self = this; return self["native"].altKey = true; }, TMP_6.$$arity = 0); Opal.defn(self, '$ctrl!', TMP_7 = function() { var self = this; return self["native"].ctrlKey = true; }, TMP_7.$$arity = 0); Opal.defn(self, '$meta!', TMP_8 = function() { var self = this; return self["native"].metaKey = true; }, TMP_8.$$arity = 0); Opal.defn(self, '$button=', TMP_9 = function(value) { var self = this; return self["native"].button = value; }, TMP_9.$$arity = 1); Opal.defn(self, '$client', TMP_10 = function $$client() { var self = this; return $scope.get('Client').$new(self["native"]); }, TMP_10.$$arity = 0); Opal.defn(self, '$screen', TMP_11 = function $$screen() { var self = this; return $scope.get('Screen').$new(self["native"]); }, TMP_11.$$arity = 0); Opal.defn(self, '$related=', TMP_12 = function(elem) { var self = this; return self["native"].relatedTarget = $scope.get('Native').$convert(elem); }, TMP_12.$$arity = 1); return (Opal.defn(self, '$transfer=', TMP_13 = function(value) { var self = this; return self["native"].dataTransfer = $scope.get('Native').$convert(self.$elem()); }, TMP_13.$$arity = 1), nil) && 'transfer='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_14 = function $$construct(name, desc) { var self = this; return new DragEvent(name, desc); }, TMP_14.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_15 = function $$construct(name, desc) { var self = this; var event = document.createEvent("DragEvent"); event.initDragEvent(name, desc.bubbles, desc.cancelable, desc.view || window, 0, desc.screenX || 0, desc.screenY || 0, desc.clientX || 0, desc.clientY || 0, desc.ctrlKey, desc.altKey, desc.shiftKey, desc.metaKey, desc.button || 0, desc.relatedTarget, desc.dataTransfer); return event; }, TMP_15.$$arity = 2)}}; self.$alias_native("alt?", "altKey"); self.$alias_native("ctrl?", "ctrlKey"); self.$alias_native("meta?", "metaKey"); self.$alias_native("shift?", "shiftKey"); self.$alias_native("button"); Opal.defn(self, '$client', TMP_16 = function $$client() { var self = this; return $scope.get('Position').$new(self["native"].clientX, self["native"].clientY); }, TMP_16.$$arity = 0); Opal.defn(self, '$screen', TMP_17 = function $$screen() { var $a, self = this; if ((($a = (typeof(self["native"].screenX) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Position').$new(self["native"].screenX, self["native"].screenY) } else { return nil }; }, TMP_17.$$arity = 0); Opal.defn(self, '$x', TMP_18 = function $$x() { var self = this; return self.$screen().$x(); }, TMP_18.$$arity = 0); Opal.defn(self, '$y', TMP_19 = function $$y() { var self = this; return self.$screen().$y(); }, TMP_19.$$arity = 0); Opal.defn(self, '$related', TMP_20 = function $$related() { var self = this; return self.$DOM(self["native"].relatedTarget); }, TMP_20.$$arity = 0); return (Opal.defn(self, '$transfer', TMP_21 = function $$transfer() { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_21.$$arity = 0), nil) && 'transfer'; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/gamepad"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Gamepad(){}; var self = $Gamepad = $klass($base, $super, 'Gamepad', $Gamepad); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Gamepad"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; def["native"] = nil; Opal.defn(self, '$id=', TMP_2 = function(value) { var self = this; return self["native"].id = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$index=', TMP_3 = function(value) { var self = this; return self["native"].index = value; }, TMP_3.$$arity = 1); Opal.defn(self, '$at=', TMP_4 = function(value) { var self = this; return self["native"].timestamp = value; }, TMP_4.$$arity = 1); Opal.defn(self, '$axes=', TMP_5 = function(value) { var self = this; return self["native"].axes = value; }, TMP_5.$$arity = 1); return (Opal.defn(self, '$buttons=', TMP_6 = function(value) { var self = this; return self["native"].buttons = value; }, TMP_6.$$arity = 1), nil) && 'buttons='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_7 = function $$construct(name, desc) { var self = this; return new GamepadEvent(name, { bubbles: desc.bubbles, cancelable: desc.cancelable, gamepad: desc }); }, TMP_7.$$arity = 2)}}; Opal.defn(self, '$id', TMP_8 = function $$id() { var self = this; return self["native"].gamepad.id; }, TMP_8.$$arity = 0); Opal.defn(self, '$index', TMP_9 = function $$index() { var self = this; return self["native"].gamepad.index; }, TMP_9.$$arity = 0); Opal.defn(self, '$at', TMP_10 = function $$at() { var self = this; return self["native"].gamepad.timestamp; }, TMP_10.$$arity = 0); Opal.defn(self, '$axes', TMP_11 = function $$axes() { var self = this; return self["native"].gamepad.axes; }, TMP_11.$$arity = 0); return (Opal.defn(self, '$buttons', TMP_12 = function $$buttons() { var self = this; return self["native"].gamepad.buttons; }, TMP_12.$$arity = 0), nil) && 'buttons'; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/hash_change"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $HashChange(){}; var self = $HashChange = $klass($base, $super, 'HashChange', $HashChange); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_4; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.HashChange"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$old=', TMP_2 = function(value) { var self = this; return self["native"].oldURL = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$new=', TMP_3 = function(value) { var self = this; return self["native"].newURL = value; }, TMP_3.$$arity = 1), nil) && 'new='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; return new HashChangeEvent(name, desc); }, TMP_4.$$arity = 2)}}; self.$alias_native("old", "oldURL"); return self.$alias_native("new", "newURL"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/progress"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Progress(){}; var self = $Progress = $klass($base, $super, 'Progress', $Progress); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_5, TMP_6; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Progress"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defn(self, '$computable=', TMP_2 = function(value) { var self = this; return self["native"].computableLength = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$loaded=', TMP_3 = function(value) { var self = this; return self["native"].loaded = value; }, TMP_3.$$arity = 1); return (Opal.defn(self, '$total=', TMP_4 = function(value) { var self = this; return self["native"].total = value; }, TMP_4.$$arity = 1), nil) && 'total='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; return new ProgressEvent(name, desc); }, TMP_5.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; var event = document.createEvent("ProgressEvent"); event.initProgressEvent(name, desc.bubbles, desc.cancelable, desc.computable, desc.loaded, desc.total); return event; }, TMP_6.$$arity = 2)}}; self.$alias_native("computable?", "computableLength"); self.$alias_native("loaded"); return self.$alias_native("total"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/page_transition"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $PageTransition(){}; var self = $PageTransition = $klass($base, $super, 'PageTransition', $PageTransition); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_3; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.PageTransition"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2; def["native"] = nil; return (Opal.defn(self, '$persisted=', TMP_2 = function(value) { var self = this; return self["native"].persisted = value; }, TMP_2.$$arity = 1), nil) && 'persisted=' })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.PageTransition")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_3 = function $$construct(name, desc) { var self = this; return new PageTransitionEvent(name, desc); }, TMP_3.$$arity = 2)}}; return self.$alias_native("persisted?", "persisted"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/pop_state"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $PopState(){}; var self = $PopState = $klass($base, $super, 'PopState', $PopState); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_3, TMP_4; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.PopState"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2; def["native"] = nil; return (Opal.defn(self, '$state=', TMP_2 = function(value) { var self = this; return self["native"].state = value; }, TMP_2.$$arity = 1), nil) && 'state=' })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_3 = function $$construct(name, desc) { var self = this; return new PopStateEvent(name, desc); }, TMP_3.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; var event = document.createEvent('PopStateEvent'); event.initPopStateEvent(name, desc.bubbles, desc.cancelable, desc.state); return event; }, TMP_4.$$arity = 2)}}; return self.$alias_native("state"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/storage"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Storage(){}; var self = $Storage = $klass($base, $super, 'Storage', $Storage); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_7; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Storage"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; def["native"] = nil; Opal.defn(self, '$key=', TMP_2 = function(value) { var self = this; return self["native"].key = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$new=', TMP_3 = function(value) { var self = this; return self["native"].newValue = value; }, TMP_3.$$arity = 1); Opal.defn(self, '$old=', TMP_4 = function(value) { var self = this; return self["native"].oldValue = value; }, TMP_4.$$arity = 1); Opal.defn(self, '$area=', TMP_5 = function(value) { var self = this; return self["native"].storageArea = value; }, TMP_5.$$arity = 1); return (Opal.defn(self, '$url=', TMP_6 = function(value) { var self = this; return self["native"].url = value; }, TMP_6.$$arity = 1), nil) && 'url='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_7 = function $$construct(name, desc) { var self = this; return new StorageEvent(name, desc); }, TMP_7.$$arity = 2)}}; self.$alias_native("key"); self.$alias_native("new", "newValue"); self.$alias_native("old", "oldValue"); self.$alias_native("area", "storageArea"); return self.$alias_native("url"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/touch"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native', '$==', '$downcase', '$name']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Touch(){}; var self = $Touch = $klass($base, $super, 'Touch', $Touch); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Touch"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$alt!', TMP_2 = function() { var self = this; return self["native"].altKey = true; }, TMP_2.$$arity = 0); Opal.defn(self, '$ctrl!', TMP_3 = function() { var self = this; return self["native"].ctrlKey = true; }, TMP_3.$$arity = 0); Opal.defn(self, '$meta!', TMP_4 = function() { var self = this; return self["native"].metaKey = true; }, TMP_4.$$arity = 0); return (Opal.defn(self, '$shift!', TMP_5 = function() { var self = this; return self["native"].shiftKey = true; }, TMP_5.$$arity = 0), nil) && 'shift!'; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return new TouchEvent(name, desc); }, TMP_6.$$arity = 2)}}; self.$alias_native("alt?", "altKey"); self.$alias_native("ctrl?", "ctrlKey"); self.$alias_native("meta?", "metaKey"); self.$alias_native("shift?", "shiftKey"); Opal.defn(self, '$cancel?', TMP_7 = function() { var self = this; return self.$name().$downcase()['$==']("touchcancel"); }, TMP_7.$$arity = 0); Opal.defn(self, '$end?', TMP_8 = function() { var self = this; return self.$name().$downcase()['$==']("touchend"); }, TMP_8.$$arity = 0); Opal.defn(self, '$leave?', TMP_9 = function() { var self = this; return self.$name().$downcase()['$==']("touchleave"); }, TMP_9.$$arity = 0); Opal.defn(self, '$move?', TMP_10 = function() { var self = this; return self.$name().$downcase()['$==']("touchmove"); }, TMP_10.$$arity = 0); return (Opal.defn(self, '$start?', TMP_11 = function() { var self = this; return self.$name().$downcase()['$==']("touchstart"); }, TMP_11.$$arity = 0), nil) && 'start?'; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/sensor"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Sensor(){}; var self = $Sensor = $klass($base, $super, 'Sensor', $Sensor); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Sensor"); }, TMP_1.$$arity = 0); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (Opal.defs(self, '$construct', TMP_2 = function $$construct(name, desc) { var self = this; return new SensorEvent(name, desc); }, TMP_2.$$arity = 2), nil) && 'construct' } else { return nil } } else { return nil }; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["ostruct"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2, $range = Opal.range; Opal.add_stubs(['$each_pair', '$[]=', '$new_ostruct_member', '$[]', '$to_sym', '$>', '$length', '$raise', '$new', '$end_with?', '$!=', '$enum_for', '$is_a?', '$==', '$instance_variable_get', '$===', '$eql?', '$dup', '$to_n', '$hash', '$attr_reader', '$__send__', '$singleton_class', '$delete', '$respond_to?', '$define_singleton_method', '$__id__', '$class', '$any?', '$+', '$join', '$map', '$inspect']); return (function($base, $super) { function $OpenStruct(){}; var self = $OpenStruct = $klass($base, $super, 'OpenStruct', $OpenStruct); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_17, TMP_19; def.table = nil; Opal.defn(self, '$initialize', TMP_2 = function $$initialize(hash) { var $a, $b, TMP_1, self = this; if (hash == null) { hash = nil; } self.table = $hash2([], {}); if (hash !== false && hash !== nil && hash != null) { return ($a = ($b = hash).$each_pair, $a.$$p = (TMP_1 = function(key, value){var self = TMP_1.$$s || this; if (self.table == null) self.table = nil; if (key == null) key = nil;if (value == null) value = nil; return self.table['$[]='](self.$new_ostruct_member(key), value)}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b) } else { return nil }; }, TMP_2.$$arity = -1); Opal.defn(self, '$[]', TMP_3 = function(name) { var self = this; return self.table['$[]'](name.$to_sym()); }, TMP_3.$$arity = 1); Opal.defn(self, '$[]=', TMP_4 = function(name, value) { var self = this; return self.table['$[]='](self.$new_ostruct_member(name), value); }, TMP_4.$$arity = 2); Opal.defn(self, '$method_missing', TMP_5 = function $$method_missing(name, $a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } if ((($b = $rb_gt(args.$length(), 2)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('NoMethodError').$new("undefined method `" + (name) + "' for #", name))}; if ((($b = name['$end_with?']("=")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = args.$length()['$!='](1)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$raise($scope.get('ArgumentError').$new("wrong number of arguments (0 for 1)"))}; return self.table['$[]='](self.$new_ostruct_member(name['$[]']($range(0, -2, false))), args['$[]'](0)); } else { return self.table['$[]'](name.$to_sym()) }; }, TMP_5.$$arity = -2); Opal.defn(self, '$each_pair', TMP_6 = function $$each_pair() { var $a, $b, TMP_7, self = this, $iter = TMP_6.$$p, $yield = $iter || nil; TMP_6.$$p = null; if (($yield !== nil)) { } else { return self.$enum_for("each_pair") }; return ($a = ($b = self.table).$each_pair, $a.$$p = (TMP_7 = function(pair){var self = TMP_7.$$s || this; if (pair == null) pair = nil; return Opal.yield1($yield, pair);}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); }, TMP_6.$$arity = 0); Opal.defn(self, '$==', TMP_8 = function(other) { var $a, self = this; if ((($a = other['$is_a?']($scope.get('OpenStruct'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; return self.table['$=='](other.$instance_variable_get("@table")); }, TMP_8.$$arity = 1); Opal.defn(self, '$===', TMP_9 = function(other) { var $a, self = this; if ((($a = other['$is_a?']($scope.get('OpenStruct'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; return self.table['$==='](other.$instance_variable_get("@table")); }, TMP_9.$$arity = 1); Opal.defn(self, '$eql?', TMP_10 = function(other) { var $a, self = this; if ((($a = other['$is_a?']($scope.get('OpenStruct'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return false }; return self.table['$eql?'](other.$instance_variable_get("@table")); }, TMP_10.$$arity = 1); Opal.defn(self, '$to_h', TMP_11 = function $$to_h() { var self = this; return self.table.$dup(); }, TMP_11.$$arity = 0); Opal.defn(self, '$to_n', TMP_12 = function $$to_n() { var self = this; return self.table.$to_n(); }, TMP_12.$$arity = 0); Opal.defn(self, '$hash', TMP_13 = function $$hash() { var self = this; return self.table.$hash(); }, TMP_13.$$arity = 0); self.$attr_reader("table"); Opal.defn(self, '$delete_field', TMP_14 = function $$delete_field(name) { var self = this, sym = nil; sym = name.$to_sym(); try { self.$singleton_class().$__send__("remove_method", sym, "" + (sym) + "=") } catch ($err) { if (Opal.rescue($err, [$scope.get('NameError')])) { try { nil } finally { Opal.pop_exception() } } else { throw $err; } }; return self.table.$delete(sym); }, TMP_14.$$arity = 1); Opal.defn(self, '$new_ostruct_member', TMP_17 = function $$new_ostruct_member(name) { var $a, $b, TMP_15, $c, TMP_16, self = this; name = name.$to_sym(); if ((($a = self['$respond_to?'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { ($a = ($b = self).$define_singleton_method, $a.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this; if (self.table == null) self.table = nil; return self.table['$[]'](name)}, TMP_15.$$s = self, TMP_15.$$arity = 0, TMP_15), $a).call($b, name); ($a = ($c = self).$define_singleton_method, $a.$$p = (TMP_16 = function(x){var self = TMP_16.$$s || this; if (self.table == null) self.table = nil; if (x == null) x = nil; return self.table['$[]='](name, x)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($c, "" + (name) + "="); }; return name; }, TMP_17.$$arity = 1); var ostruct_ids; Opal.defn(self, '$inspect', TMP_19 = function $$inspect() { var $a, $b, TMP_18, self = this, result = nil; var top = (ostruct_ids === undefined), ostruct_id = self.$__id__(); ; try { result = "#<" + (self.$class()); if (top) { ostruct_ids = {}; } if (ostruct_ids.hasOwnProperty(ostruct_id)) { return result + ' ...>'; } ostruct_ids[ostruct_id] = true; if ((($a = self.table['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, " ")}; result = $rb_plus(result, ($a = ($b = self.$each_pair()).$map, $a.$$p = (TMP_18 = function(name, value){var self = TMP_18.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return "" + (name) + "=" + (value.$inspect())}, TMP_18.$$s = self, TMP_18.$$arity = 2, TMP_18), $a).call($b).$join(", ")); result = $rb_plus(result, ">"); return result; } finally { if (top) { ostruct_ids = undefined; } }; }, TMP_19.$$arity = 0); return Opal.alias(self, 'to_s', 'inspect'); })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/custom"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$require', '$supports?', '$end_with?', '$[]', '$to_n', '$merge!', '$Native', '$new', '$has_key?']); self.$require("ostruct"); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Custom(){}; var self = $Custom = $klass($base, $super, 'Custom', $Custom); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; def.detail = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Custom"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2; def["native"] = nil; return (Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing(name, value) { var $a, self = this; if ((($a = name['$end_with?']("=")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"][name['$[]']($range(0, -2, false))] = value; } else { return nil }; }, TMP_2.$$arity = 2), nil) && 'method_missing' })($scope.base, $scope.get('Definition')); if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_3 = function $$construct(name, desc) { var self = this; return new CustomEvent(name, { bubbles: desc.bubbles, cancelable: desc.cancelable, detail: desc }); }, TMP_3.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_4 = function $$construct(name, desc) { var self = this; var event = document.createEvent("CustomEvent"); event.initCustomEvent(name, desc.bubbles, desc.cancelable, desc); return event; }, TMP_4.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.createObject")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; return self.$Native(document.createEventObject())['$merge!']({ type: name, bubbles: desc.bubbles, cancelable: desc.cancelable, detail: desc }).$to_n(); }, TMP_5.$$arity = 2) } else { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return self.$Native(desc)['$merge!']({ type: name, bubbles: desc.bubbles, cancelable: desc.cancelable, detail: desc }).$to_n(); }, TMP_6.$$arity = 2) }; Opal.defn(self, '$initialize', TMP_7 = function $$initialize(event, callback) { var $a, $b, self = this, $iter = TMP_7.$$p, $yield = $iter || nil; if (callback == null) { callback = nil; } TMP_7.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_7, false)), $a.$$p = null, $a).call($b, event, callback); return self.detail = $scope.get('Hash').$new(event.detail); }, TMP_7.$$arity = -2); return (Opal.defn(self, '$method_missing', TMP_8 = function $$method_missing(id, $a_rest) { var $b, $c, self = this, $iter = TMP_8.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_8.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($b = self.detail['$has_key?'](id)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.detail['$[]'](id)}; return ($b = ($c = self, Opal.find_super_dispatcher(self, 'method_missing', TMP_8, false)), $b.$$p = $iter, $b).apply($c, $zuper); }, TMP_8.$$arity = -2), nil) && 'method_missing'; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["buffer/array"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$[]', '$name_for', '$include', '$attr_reader', '$==', '$for', '$to_n', '$enum_for']); return (function($base, $super) { function $Buffer(){}; var self = $Buffer = $klass($base, $super, 'Buffer', $Buffer); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9; def["native"] = nil; Opal.defs(self, '$for', TMP_1 = function(bits, type) { var self = this; if ($gvars.$ == null) $gvars.$ = nil; return $gvars.$['$[]']("" + ($scope.get('Buffer').$name_for(bits, type)) + "Array"); }, TMP_1.$$arity = 2); self.$include($scope.get('Enumerable')); self.$attr_reader("buffer", "type"); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(buffer, bits, type) { var $a, $b, $c, self = this, $iter = TMP_2.$$p, $yield = $iter || nil; if (bits == null) { bits = nil; } if (type == null) { type = nil; } TMP_2.$$p = null; if ($scope.get('Native')['$=='](buffer)) { ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_2, false)), $a.$$p = null, $a).call($b, buffer) } else { var klass = $scope.get('Array').$for(bits, type); ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_2, false)), $a.$$p = null, $a).call($c, new klass(buffer.$to_n())) ; }; self.buffer = buffer; return self.type = type; }, TMP_2.$$arity = -2); Opal.defn(self, '$bits', TMP_3 = function $$bits() { var self = this; return self["native"].BYTES_PER_ELEMENT * 8; }, TMP_3.$$arity = 0); Opal.defn(self, '$[]', TMP_4 = function(index, offset) { var self = this; if (offset == null) { offset = nil; } if (offset !== false && offset !== nil && offset != null) { return self["native"].subarray(index, offset); } else { return self["native"][index]; }; }, TMP_4.$$arity = -2); Opal.defn(self, '$[]=', TMP_5 = function(index, value) { var self = this; return self["native"][index] = value; }, TMP_5.$$arity = 2); Opal.defn(self, '$bytesize', TMP_6 = function $$bytesize() { var self = this; return self["native"].byteLength; }, TMP_6.$$arity = 0); Opal.defn(self, '$each', TMP_7 = function $$each() { var self = this, $iter = TMP_7.$$p, $yield = $iter || nil; TMP_7.$$p = null; if (($yield !== nil)) { } else { return self.$enum_for("each") }; for (var i = 0, length = self["native"].length; i < length; i++) { Opal.yield1($yield, self["native"][i]) } ; return self; }, TMP_7.$$arity = 0); Opal.defn(self, '$length', TMP_8 = function $$length() { var self = this; return self["native"].length; }, TMP_8.$$arity = 0); Opal.defn(self, '$merge!', TMP_9 = function(other, offset) { var self = this; return self["native"].set(other.$to_n(), offset); }, TMP_9.$$arity = -2); return Opal.alias(self, 'size', 'length'); })($scope.base, $scope.get('Native')) })($scope.base, $scope.get('Native')) }; /* Generated by Opal 0.10.3 */ Opal.modules["buffer/view"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$include', '$!', '$nil?', '$[]', '$attr_reader', '$native?', '$to_n', '$name_for']); return (function($base, $super) { function $Buffer(){}; var self = $Buffer = $klass($base, $super, 'Buffer', $Buffer); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $View(){}; var self = $View = $klass($base, $super, 'View', $View); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21; def["native"] = nil; self.$include($scope.get('Native')); Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; if ($gvars.$ == null) $gvars.$ = nil; return $gvars.$['$[]']("DataView")['$nil?']()['$!'](); }, TMP_1.$$arity = 0); self.$attr_reader("buffer", "offset"); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(buffer, offset, length) { var $a, $b, $c, $d, $e, self = this, $iter = TMP_2.$$p, $yield = $iter || nil; if (offset == null) { offset = nil; } if (length == null) { length = nil; } TMP_2.$$p = null; if ((($a = self['$native?'](buffer)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_2, false)), $a.$$p = null, $a).call($b, buffer) } else if ((($a = (($c = offset !== false && offset !== nil && offset != null) ? length : offset)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_2, false)), $a.$$p = null, $a).call($c, new DataView(buffer.$to_n(), offset.$to_n(), length.$to_n())) } else if (offset !== false && offset !== nil && offset != null) { ($a = ($d = self, Opal.find_super_dispatcher(self, 'initialize', TMP_2, false)), $a.$$p = null, $a).call($d, new DataView(buffer.$to_n(), offset.$to_n())) } else { ($a = ($e = self, Opal.find_super_dispatcher(self, 'initialize', TMP_2, false)), $a.$$p = null, $a).call($e, new DataView(buffer.$to_n())) }; self.buffer = buffer; return self.offset = offset; }, TMP_2.$$arity = -2); Opal.defn(self, '$length', TMP_3 = function $$length() { var self = this; return self["native"].byteLength; }, TMP_3.$$arity = 0); Opal.alias(self, 'size', 'length'); Opal.defn(self, '$get', TMP_4 = function $$get(offset, bits, type, little) { var self = this; if (bits == null) { bits = 8; } if (type == null) { type = "unsigned"; } if (little == null) { little = false; } return self["native"]["get" + $scope.get('Buffer').$name_for(bits, type)](offset, little); }, TMP_4.$$arity = -2); Opal.alias(self, '[]', 'get'); Opal.defn(self, '$set', TMP_5 = function $$set(offset, value, bits, type, little) { var self = this; if (bits == null) { bits = 8; } if (type == null) { type = "unsigned"; } if (little == null) { little = false; } return self["native"]["set" + $scope.get('Buffer').$name_for(bits, type)](offset, value, little); }, TMP_5.$$arity = -3); Opal.alias(self, '[]=', 'set'); Opal.defn(self, '$get_int8', TMP_6 = function $$get_int8(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getInt8(offset, little); }, TMP_6.$$arity = -2); Opal.defn(self, '$set_int8', TMP_7 = function $$set_int8(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setInt8(offset, value, little); }, TMP_7.$$arity = -3); Opal.defn(self, '$get_uint8', TMP_8 = function $$get_uint8(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getUint8(offset, little); }, TMP_8.$$arity = -2); Opal.defn(self, '$set_uint8', TMP_9 = function $$set_uint8(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setUint8(offset, value, little); }, TMP_9.$$arity = -3); Opal.defn(self, '$get_int16', TMP_10 = function $$get_int16(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getInt16(offset, little); }, TMP_10.$$arity = -2); Opal.defn(self, '$set_int16', TMP_11 = function $$set_int16(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setInt16(offset, value, little); }, TMP_11.$$arity = -3); Opal.defn(self, '$get_uint16', TMP_12 = function $$get_uint16(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getUint16(offset, little); }, TMP_12.$$arity = -2); Opal.defn(self, '$set_uint16', TMP_13 = function $$set_uint16(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setUint16(offset, value, little); }, TMP_13.$$arity = -3); Opal.defn(self, '$get_int32', TMP_14 = function $$get_int32(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getInt32(offset, little); }, TMP_14.$$arity = -2); Opal.defn(self, '$set_int32', TMP_15 = function $$set_int32(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setInt32(offset, value, little); }, TMP_15.$$arity = -3); Opal.defn(self, '$get_uint32', TMP_16 = function $$get_uint32(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getUint32(offset, little); }, TMP_16.$$arity = -2); Opal.defn(self, '$set_uint32', TMP_17 = function $$set_uint32(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setUint32(offset, value, little); }, TMP_17.$$arity = -3); Opal.defn(self, '$get_float32', TMP_18 = function $$get_float32(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getFloat32(offset, little); }, TMP_18.$$arity = -2); Opal.defn(self, '$set_float32', TMP_19 = function $$set_float32(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setFloat32(offset, value, little); }, TMP_19.$$arity = -3); Opal.defn(self, '$get_float64', TMP_20 = function $$get_float64(offset, little) { var self = this; if (little == null) { little = false; } return self["native"].getFloat64(offset, little); }, TMP_20.$$arity = -2); return (Opal.defn(self, '$set_float64', TMP_21 = function $$set_float64(offset, value, little) { var self = this; if (little == null) { little = false; } return self["native"].setFloat64(offset, value, little); }, TMP_21.$$arity = -3), nil) && 'set_float64'; })($scope.base, null) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["buffer"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$include', '$!', '$nil?', '$[]', '$===', '$native?', '$new']); self.$require("native"); self.$require("buffer/array"); self.$require("buffer/view"); return (function($base, $super) { function $Buffer(){}; var self = $Buffer = $klass($base, $super, 'Buffer', $Buffer); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; def["native"] = nil; self.$include($scope.get('Native')); Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; if ($gvars.$ == null) $gvars.$ = nil; return $gvars.$['$[]']("ArrayBuffer")['$nil?']()['$!'](); }, TMP_1.$$arity = 0); Opal.defs(self, '$name_for', TMP_2 = function $$name_for(bits, type) { var self = this, $case = nil; return "" + ((function() {$case = type;if ("unsigned"['$===']($case)) {return "Uint"}else if ("signed"['$===']($case)) {return "Int"}else if ("float"['$===']($case)) {return "Float"}else { return nil }})()) + (bits); }, TMP_2.$$arity = 2); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(size, bits) { var $a, $b, $c, self = this, $iter = TMP_3.$$p, $yield = $iter || nil; if (bits == null) { bits = 8; } TMP_3.$$p = null; if ((($a = self['$native?'](size)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($b, size) } else { return ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($c, new ArrayBuffer(size * (bits / 8))) }; }, TMP_3.$$arity = -2); Opal.defn(self, '$length', TMP_4 = function $$length() { var self = this; return self["native"].byteLength; }, TMP_4.$$arity = 0); Opal.alias(self, 'size', 'length'); Opal.defn(self, '$to_a', TMP_5 = function $$to_a(bits, type) { var self = this; if (bits == null) { bits = 8; } if (type == null) { type = "unsigned"; } return $scope.get('Array').$new(self, bits, type); }, TMP_5.$$arity = -1); return (Opal.defn(self, '$view', TMP_6 = function $$view(offset, length) { var self = this; if (offset == null) { offset = nil; } if (length == null) { length = nil; } return $scope.get('View').$new(self, offset, length); }, TMP_6.$$arity = -1), nil) && 'view'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/message"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$supports?', '$convert', '$supported?', '$new', '$alias_native']); self.$require("buffer"); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Message(){}; var self = $Message = $klass($base, $super, 'Message', $Message); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_5, TMP_6, TMP_7, TMP_8; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Message"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defn(self, '$data=', TMP_2 = function(value) { var self = this; return self["native"].data = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$origin=', TMP_3 = function(value) { var self = this; return self["native"].origin = value; }, TMP_3.$$arity = 1); return (Opal.defn(self, '$source=', TMP_4 = function(value) { var self = this; return self["native"].source = $scope.get('Native').$convert(value); }, TMP_4.$$arity = 1), nil) && 'source='; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_5 = function $$construct(name, desc) { var self = this; return new MessageEvent(name, desc); }, TMP_5.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; var event = document.createEvent("MessageEvent"); event.initMessageEvent(name, desc.bubbles, desc.cancelable, desc.data, desc.origin, "", desc.source || window); return event; }, TMP_6.$$arity = 2)}}; Opal.defn(self, '$data', TMP_7 = function $$data() { var self = this; if (window.ArrayBuffer && self["native"].data instanceof ArrayBuffer) { return $scope.get('Buffer').$new(self["native"].data); } else if (window.Blob && self["native"].data instanceof Blob) { return $scope.get('Blob').$new(self["native"].data); } else { return self["native"].data; } ; }, TMP_7.$$arity = 0); self.$alias_native("origin"); return (Opal.defn(self, '$source', TMP_8 = function $$source() { var self = this; var source = self["native"].source; if (window.Window && source instanceof window.Window) { return $scope.get('Window').$new(source); } else { return nil; } ; }, TMP_8.$$arity = 0), nil) && 'source'; })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event/close"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$supported?', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Close(){}; var self = $Close = $klass($base, $super, 'Close', $Close); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_6, TMP_7; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("Event.Close"); }, TMP_1.$$arity = 0); (function($base, $super) { function $Definition(){}; var self = $Definition = $klass($base, $super, 'Definition', $Definition); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$code=', TMP_2 = function(value) { var self = this; return self["native"].code = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$reason=', TMP_3 = function(value) { var self = this; return self["native"].reason = value; }, TMP_3.$$arity = 1); Opal.defn(self, '$clean!', TMP_4 = function(value) { var self = this; return self["native"].wasClean = true; }, TMP_4.$$arity = 1); return (Opal.defn(self, '$not_clean!', TMP_5 = function(value) { var self = this; return self["native"].wasClean = false; }, TMP_5.$$arity = 1), nil) && 'not_clean!'; })($scope.base, $scope.get('Definition')); if ((($a = self['$supported?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return new CloseEvent(name, desc); }, TMP_6.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_7 = function $$construct(name, desc) { var self = this; var event = document.createEvent("CloseEvent"); event.initCloseEvent(name, desc.bubbles, desc.cancelable, desc.wasClean, desc.code, desc.reason); return event; }, TMP_7.$$arity = 2)}}; self.$alias_native("code"); self.$alias_native("reason"); return self.$alias_native("clean?", "wasClean"); })($scope.base, $scope.get('Event')) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/event"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$gsub', '$[]', '$aliases', '$name_for', '$===', '$class_for', '$new', '$construct', '$to_proc', '$const_get', '$arguments=', '$supports?', '$merge!', '$Native', '$to_n', '$==', '$name', '$attr_reader', '$attr_writer', '$convert', '$alias_native', '$off', '$prevent', '$stop']); self.$require("browser/event/base"); self.$require("browser/event/ui"); self.$require("browser/event/mouse"); self.$require("browser/event/keyboard"); self.$require("browser/event/focus"); self.$require("browser/event/wheel"); self.$require("browser/event/composition"); self.$require("browser/event/animation"); self.$require("browser/event/audio_processing"); self.$require("browser/event/before_unload"); self.$require("browser/event/composition"); self.$require("browser/event/clipboard"); self.$require("browser/event/device_light"); self.$require("browser/event/device_motion"); self.$require("browser/event/device_orientation"); self.$require("browser/event/device_proximity"); self.$require("browser/event/drag"); self.$require("browser/event/gamepad"); self.$require("browser/event/hash_change"); self.$require("browser/event/progress"); self.$require("browser/event/page_transition"); self.$require("browser/event/pop_state"); self.$require("browser/event/storage"); self.$require("browser/event/touch"); self.$require("browser/event/sensor"); self.$require("browser/event/custom"); self.$require("browser/event/message"); self.$require("browser/event/close"); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, $a, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22; def["native"] = def.on = def.callback = nil; Opal.defs(self, '$aliases', TMP_1 = function $$aliases() { var $a, self = this; if (self.aliases == null) self.aliases = nil; return ((($a = self.aliases) !== false && $a !== nil && $a != null) ? $a : self.aliases = $hash2(["dom:load", "hover"], {"dom:load": "DOMContentLoaded", "hover": "mouse:over"})); }, TMP_1.$$arity = 0); Opal.defs(self, '$name_for', TMP_2 = function $$name_for(name) { var $a, self = this; return (((($a = self.$aliases()['$[]'](name)) !== false && $a !== nil && $a != null) ? $a : name)).$gsub(":", ""); }, TMP_2.$$arity = 1); Opal.defs(self, '$class_for', TMP_3 = function $$class_for(name) { var self = this, $case = nil; return (function() {$case = self.$name_for(name);if ("animationend"['$===']($case) || "animationiteration"['$===']($case) || "animationstart"['$===']($case)) {return $scope.get('Animation')}else if ("audioprocess"['$===']($case)) {return $scope.get('AudioProcessing')}else if ("beforeunload"['$===']($case)) {return $scope.get('BeforeUnload')}else if ("compositionend"['$===']($case) || "compositionstart"['$===']($case) || "compositionupdate"['$===']($case)) {return $scope.get('Composition')}else if ("copy"['$===']($case) || "cut"['$===']($case)) {return $scope.get('Clipboard')}else if ("devicelight"['$===']($case)) {return $scope.get('DeviceLight')}else if ("devicemotion"['$===']($case)) {return $scope.get('DeviceMotion')}else if ("deviceorientation"['$===']($case)) {return $scope.get('DeviceOrientation')}else if ("deviceproximity"['$===']($case)) {return $scope.get('DeviceProximity')}else if ("drag"['$===']($case) || "dragend"['$===']($case) || "dragleave"['$===']($case) || "dragover"['$===']($case) || "dragstart"['$===']($case) || "drop"['$===']($case)) {return $scope.get('Drag')}else if ("gamepadconnected"['$===']($case) || "gamepaddisconnected"['$===']($case)) {return $scope.get('Gamepad')}else if ("hashchange"['$===']($case)) {return $scope.get('HashChange')}else if ("load"['$===']($case) || "loadend"['$===']($case) || "loadstart"['$===']($case)) {return $scope.get('Progress')}else if ("pagehide"['$===']($case) || "pageshow"['$===']($case)) {return $scope.get('PageTransition')}else if ("popstate"['$===']($case)) {return $scope.get('PopState')}else if ("storage"['$===']($case)) {return $scope.get('Storage')}else if ("touchcancel"['$===']($case) || "touchend"['$===']($case) || "touchleave"['$===']($case) || "touchmove"['$===']($case) || "touchstart"['$===']($case)) {return $scope.get('Touch')}else if ("compassneedscalibration"['$===']($case) || "userproximity"['$===']($case)) {return $scope.get('Sensor')}else if ("message"['$===']($case)) {return $scope.get('Message')}else if ("close"['$===']($case)) {return $scope.get('Close')}else if ("click"['$===']($case) || "contextmenu"['$===']($case) || "dblclick"['$===']($case) || "mousedown"['$===']($case) || "mouseenter"['$===']($case) || "mouseleave"['$===']($case) || "mousemove"['$===']($case) || "mouseout"['$===']($case) || "mouseover"['$===']($case) || "mouseup"['$===']($case) || "show"['$===']($case)) {return $scope.get('Mouse')}else if ("keydown"['$===']($case) || "keypress"['$===']($case) || "keyup"['$===']($case)) {return $scope.get('Keyboard')}else if ("blur"['$===']($case) || "focus"['$===']($case) || "focusin"['$===']($case) || "focusout"['$===']($case)) {return $scope.get('Focus')}else if ("wheel"['$===']($case)) {return $scope.get('Wheel')}else if ("abort"['$===']($case) || "afterprint"['$===']($case) || "beforeprint"['$===']($case) || "cached"['$===']($case) || "canplay"['$===']($case) || "canplaythrough"['$===']($case) || "change"['$===']($case) || "chargingchange"['$===']($case) || "chargingtimechange"['$===']($case) || "checking"['$===']($case) || "close"['$===']($case) || "dischargingtimechange"['$===']($case) || "DOMContentLoaded"['$===']($case) || "downloading"['$===']($case) || "durationchange"['$===']($case) || "emptied"['$===']($case) || "ended"['$===']($case) || "error"['$===']($case) || "fullscreenchange"['$===']($case) || "fullscreenerror"['$===']($case) || "input"['$===']($case) || "invalid"['$===']($case) || "levelchange"['$===']($case) || "loadeddata"['$===']($case) || "loadedmetadata"['$===']($case) || "noupdate"['$===']($case) || "obsolete"['$===']($case) || "offline"['$===']($case) || "online"['$===']($case) || "open"['$===']($case) || "orientationchange"['$===']($case) || "pause"['$===']($case) || "pointerlockchange"['$===']($case) || "pointerlockerror"['$===']($case) || "play"['$===']($case) || "playing"['$===']($case) || "ratechange"['$===']($case) || "readystatechange"['$===']($case) || "reset"['$===']($case) || "seeked"['$===']($case) || "seeking"['$===']($case) || "stalled"['$===']($case) || "submit"['$===']($case) || "success"['$===']($case) || "suspend"['$===']($case) || "timeupdate"['$===']($case) || "updateready"['$===']($case) || "visibilitychange"['$===']($case) || "volumechange"['$===']($case) || "waiting"['$===']($case)) {return $scope.get('Event')}else {return $scope.get('Custom')}})(); }, TMP_3.$$arity = 1); Opal.defs(self, '$supported?', TMP_4 = function() { var self = this; return true; }, TMP_4.$$arity = 0); Opal.defs(self, '$create', TMP_5 = function $$create(name, $a_rest) { var $b, $c, $d, self = this, args, $iter = TMP_5.$$p, block = $iter || nil, klass = nil, event = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_5.$$p = null; name = self.$name_for(name); klass = self.$class_for(name); event = klass.$new(klass.$construct(name, ($b = ($c = klass.$const_get("Definition")).$new, $b.$$p = block.$to_proc(), $b).call($c))); (($b = [args]), $d = event, $d['$arguments='].apply($d, $b), $b[$b.length-1]); return event; }, TMP_5.$$arity = -2); if ((($a = $scope.get('Browser')['$supports?']("Event.constructor")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_6 = function $$construct(name, desc) { var self = this; return new Event(name, desc); }, TMP_6.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.create")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_7 = function $$construct(name, desc) {try { var self = this; var event = document.createEvent("HTMLEvents"); event.initEvent(name, desc.bubbles, desc.cancelable); Opal.ret(self.$Native(event)['$merge!'](desc)); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_7.$$arity = 2) } else if ((($a = $scope.get('Browser')['$supports?']("Event.createObject")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defs(self, '$construct', TMP_8 = function $$construct(name, desc) { var self = this; return self.$Native(document.createEventObject())['$merge!'](desc)['$merge!']({ type: name }).$to_n(); }, TMP_8.$$arity = 2) } else { Opal.defs(self, '$construct', TMP_9 = function $$construct(name, desc) { var self = this; return self.$Native(desc)['$merge!']({ type: name }).$to_n(); }, TMP_9.$$arity = 2) }; Opal.defs(self, '$new', TMP_10 = function(value, callback) { var $a, $b, $c, self = this, $iter = TMP_10.$$p, $yield = $iter || nil, klass = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; if (callback == null) { callback = nil; } TMP_10.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (self['$==']($scope.get('Event'))) { } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_10, false, $Event)), $a.$$p = $iter, $a).apply($b, $zuper) }; klass = self.$class_for((function() {if (callback !== false && callback !== nil && callback != null) { return callback.$name() } else { return value.type; }; return nil; })()); if (klass['$==']($scope.get('Event'))) { return ($a = ($c = self, Opal.find_super_dispatcher(self, 'new', TMP_10, false, $Event)), $a.$$p = $iter, $a).apply($c, $zuper) } else { return klass.$new(value, callback) }; }, TMP_10.$$arity = -2); self.$attr_reader("callback"); self.$attr_writer("on"); Opal.defn(self, '$initialize', TMP_11 = function $$initialize(event, callback) { var $a, $b, self = this, $iter = TMP_11.$$p, $yield = $iter || nil; if (callback == null) { callback = nil; } TMP_11.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_11, false)), $a.$$p = null, $a).call($b, event); return self.callback = callback; }, TMP_11.$$arity = -2); Opal.defn(self, '$name', TMP_12 = function $$name() { var self = this; return self["native"].type; }, TMP_12.$$arity = 0); Opal.defn(self, '$on', TMP_13 = function $$on() { var $a, self = this; return ((($a = self.on) !== false && $a !== nil && $a != null) ? $a : $scope.get('Target').$convert(self["native"].currentTarget)); }, TMP_13.$$arity = 0); Opal.defn(self, '$target', TMP_14 = function $$target() { var self = this; return $scope.get('Target').$convert(self["native"].srcElement || self["native"].target); }, TMP_14.$$arity = 0); Opal.defn(self, '$arguments', TMP_15 = function() { var self = this; return self["native"].arguments || []; }, TMP_15.$$arity = 0); Opal.defn(self, '$arguments=', TMP_16 = function(args) { var self = this; return self["native"].arguments = args; }, TMP_16.$$arity = 1); self.$alias_native("bubbles?", "bubbles"); self.$alias_native("cancelable?", "cancelable"); self.$alias_native("data"); self.$alias_native("phase", "eventPhase"); self.$alias_native("at", "timeStamp"); Opal.defn(self, '$off', TMP_17 = function $$off() { var $a, self = this; if ((($a = self.callback) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.callback.$off() } else { return nil }; }, TMP_17.$$arity = 0); Opal.defn(self, '$stopped?', TMP_18 = function() { var self = this; return !!self["native"].stopped; }, TMP_18.$$arity = 0); Opal.defn(self, '$stop', TMP_19 = function $$stop() { var $a, self = this; if ((($a = (typeof(self["native"].stopPropagation) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self["native"].stopPropagation();}; return self["native"].stopped = true; }, TMP_19.$$arity = 0); Opal.defn(self, '$prevent', TMP_20 = function $$prevent() { var $a, self = this; if ((($a = (typeof(self["native"].preventDefault) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self["native"].preventDefault();}; return self["native"].prevented = true; }, TMP_20.$$arity = 0); Opal.defn(self, '$prevented?', TMP_21 = function() { var self = this; return !!self["native"].prevented; }, TMP_21.$$arity = 0); return (Opal.defn(self, '$stop!', TMP_22 = function() { var self = this; self.$prevent(); return self.$stop(); }, TMP_22.$$arity = 0), nil) && 'stop!'; })($scope.base, null) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/window/view"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$to_n', '$supports?', '$raise']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $View(){}; var self = $View = $klass($base, $super, 'View', $View); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; def["native"] = nil; Opal.defn(self, '$initialize', TMP_1 = function $$initialize(window) { var self = this; self.window = window; return self["native"] = window.$to_n(); }, TMP_1.$$arity = 1); if ((($a = $scope.get('Browser')['$supports?']("Window.innerSize")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$width', TMP_2 = function $$width() { var self = this; return self["native"].innerWidth; }, TMP_2.$$arity = 0); return (Opal.defn(self, '$height', TMP_3 = function $$height() { var self = this; return self["native"].innerHeight; }, TMP_3.$$arity = 0), nil) && 'height'; } else if ((($a = $scope.get('Browser')['$supports?']("Element.clientSize")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$height', TMP_4 = function $$height() { var self = this; return self["native"].document.documentElement.clientHeight; }, TMP_4.$$arity = 0); return (Opal.defn(self, '$width', TMP_5 = function $$width() { var self = this; return self["native"].document.documentElement.clientWidth; }, TMP_5.$$arity = 0), nil) && 'width'; } else { Opal.defn(self, '$width', TMP_6 = function $$width() { var self = this; return self.$raise($scope.get('NotImplementedError'), "window size unsupported"); }, TMP_6.$$arity = 0); return (Opal.defn(self, '$height', TMP_7 = function $$height() { var self = this; return self.$raise($scope.get('NotImplementedError'), "window size unsupported"); }, TMP_7.$$arity = 0), nil) && 'height'; }; })($scope.base, null) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/window/size"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$to_n', '$===', '$first', '$values_at', '$width', '$height', '$supports?', '$raise', '$set']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Size(){}; var self = $Size = $klass($base, $super, 'Size', $Size); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, $a, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; def["native"] = nil; Opal.defn(self, '$initialize', TMP_1 = function $$initialize(window) { var self = this; self.window = window; return self["native"] = window.$to_n(); }, TMP_1.$$arity = 1); Opal.defn(self, '$set', TMP_2 = function $$set($a_rest) { var $b, $c, self = this, args, width = nil, height = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $c = args.$first().$values_at("width", "height"), $b = Opal.to_ary($c), width = ($b[0] == null ? nil : $b[0]), height = ($b[1] == null ? nil : $b[1]), $c } else { $c = args, $b = Opal.to_ary($c), width = ($b[0] == null ? nil : $b[0]), height = ($b[1] == null ? nil : $b[1]), $c }; ((($b = width) !== false && $b !== nil && $b != null) ? $b : width = self.$width()); ((($b = height) !== false && $b !== nil && $b != null) ? $b : height = self.$height()); self["native"].resizeTo(width, height); return self; }, TMP_2.$$arity = -1); if ((($a = $scope.get('Browser')['$supports?']("Window.outerSize")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$width', TMP_3 = function $$width() { var self = this; return self["native"].outerWidth; }, TMP_3.$$arity = 0); Opal.defn(self, '$height', TMP_4 = function $$height() { var self = this; return self["native"].outerHeight; }, TMP_4.$$arity = 0); } else { Opal.defn(self, '$width', TMP_5 = function $$width() { var self = this; return self.$raise($scope.get('NotImplementedError'), "window outer size not supported"); }, TMP_5.$$arity = 0); Opal.defn(self, '$height', TMP_6 = function $$height() { var self = this; return self.$raise($scope.get('NotImplementedError'), "window outer size not supported"); }, TMP_6.$$arity = 0); }; Opal.defn(self, '$width=', TMP_7 = function(value) { var self = this; return self.$set($hash2(["width"], {"width": value})); }, TMP_7.$$arity = 1); return (Opal.defn(self, '$height=', TMP_8 = function(value) { var self = this; return self.$set($hash2(["height"], {"height": value})); }, TMP_8.$$arity = 1), nil) && 'height='; })($scope.base, null) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/window/scroll"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$to_n', '$supports?', '$new', '$raise', '$x', '$position', '$y', '$[]']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Scroll(){}; var self = $Scroll = $klass($base, $super, 'Scroll', $Scroll); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; def["native"] = nil; Opal.defn(self, '$initialize', TMP_1 = function $$initialize(window) { var self = this; self.window = window; return self["native"] = window.$to_n(); }, TMP_1.$$arity = 1); if ((($a = $scope.get('Browser')['$supports?']("Window.scroll")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$position', TMP_2 = function $$position() { var self = this; var doc = self["native"].document, root = doc.documentElement, body = doc.body; var x = root.scrollLeft || body.scrollLeft, y = root.scrollTop || body.scrollTop; ; return $scope.get('Position').$new(x, y); }, TMP_2.$$arity = 0) } else if ((($a = $scope.get('Browser')['$supports?']("Window.pageOffset")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$position', TMP_3 = function $$position() { var self = this; return $scope.get('Position').$new(self["native"].pageXOffset, self["native"].pageYOffset); }, TMP_3.$$arity = 0) } else { Opal.defn(self, '$position', TMP_4 = function $$position() { var self = this; return self.$raise($scope.get('NotImplementedError'), "window scroll unsupported"); }, TMP_4.$$arity = 0) }; Opal.defn(self, '$x', TMP_5 = function $$x() { var self = this; return self.$position().$x(); }, TMP_5.$$arity = 0); Opal.defn(self, '$y', TMP_6 = function $$y() { var self = this; return self.$position().$y(); }, TMP_6.$$arity = 0); Opal.defn(self, '$to', TMP_7 = function $$to(what) { var $a, self = this, x = nil, y = nil; x = ((($a = what['$[]']("x")) !== false && $a !== nil && $a != null) ? $a : self.$x()); y = ((($a = what['$[]']("y")) !== false && $a !== nil && $a != null) ? $a : self.$y()); self["native"].scrollTo(x, y); return self; }, TMP_7.$$arity = 1); return (Opal.defn(self, '$by', TMP_8 = function $$by(what) { var $a, self = this, x = nil, y = nil; x = ((($a = what['$[]']("x")) !== false && $a !== nil && $a != null) ? $a : 0); y = ((($a = what['$[]']("y")) !== false && $a !== nil && $a != null) ? $a : 0); self["native"].scrollBy(x, y); return self; }, TMP_8.$$arity = 1), nil) && 'by'; })($scope.base, null) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/window"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$delete', '$join', '$map', '$===', '$new', '$include', '$target', '$supports?', '$[]', '$raise', '$alert', '$prompt', '$confirm']); self.$require("browser/window/view"); self.$require("browser/window/size"); self.$require("browser/window/scroll"); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope, TMP_2, $a, $b, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; def["native"] = nil; Opal.defs(self, '$open', TMP_2 = function $$open(url, options) { var $a, $b, TMP_1, self = this, name = nil, features = nil; name = options.$delete("name"); features = ($a = ($b = options).$map, $a.$$p = (TMP_1 = function(key, value){var self = TMP_1.$$s || this, $case = nil; if (key == null) key = nil;if (value == null) value = nil; value = (function() {$case = value;if (true['$===']($case)) {return "yes"}else if (false['$===']($case)) {return "no"}else {return value}})(); return "" + (key) + "=" + (value);}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b).$join(","); var win = window.open(url, name, features); if (win == null) { return nil; } return self.$new(win); ; }, TMP_2.$$arity = 2); self.$include($scope.get('Native')); self.$include((($scope.get('Event')).$$scope.get('Target'))); ($a = ($b = self).$target, $a.$$p = (TMP_3 = function(value){var self = TMP_3.$$s || this, $c; if ($gvars.window == null) $gvars.window = nil; if (value == null) value = nil; if ((($c = value == window) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return $gvars.window } else { return nil }}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b); Opal.defn(self, '$alert', TMP_4 = function $$alert(value) { var self = this; self["native"].alert(value); return value; }, TMP_4.$$arity = 1); Opal.defn(self, '$prompt', TMP_5 = function $$prompt(value) { var self = this; return self["native"].prompt(value) || nil; }, TMP_5.$$arity = 1); Opal.defn(self, '$confirm', TMP_6 = function $$confirm(value) { var self = this; return self["native"].confirm(value) || false; }, TMP_6.$$arity = 1); Opal.defn(self, '$view', TMP_7 = function $$view() { var self = this; return $scope.get('View').$new(self); }, TMP_7.$$arity = 0); Opal.defn(self, '$size', TMP_8 = function $$size() { var self = this; return $scope.get('Size').$new(self); }, TMP_8.$$arity = 0); Opal.defn(self, '$scroll', TMP_9 = function $$scroll() { var self = this; return $scope.get('Scroll').$new(self); }, TMP_9.$$arity = 0); if ((($a = $scope.get('Browser')['$supports?']("Window.send")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$send', TMP_10 = function $$send(message, options) { var $a, self = this; if (options == null) { options = $hash2([], {}); } return self["native"].postMessage(message, ((($a = options['$[]']("to")) !== false && $a !== nil && $a != null) ? $a : "*")); }, TMP_10.$$arity = -2) } else { Opal.defn(self, '$send', TMP_11 = function $$send(message, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$raise($scope.get('NotImplementedError'), "message sending unsupported"); }, TMP_11.$$arity = -2) }; return (Opal.defn(self, '$close', TMP_12 = function $$close() { var self = this; return (window.open('', '_self', '') && window.close()) || (window.opener = null && window.close()) || (window.opener = '' && window.close()); }, TMP_12.$$arity = 0), nil) && 'close'; })($scope.base, null) })($scope.base); $gvars.window = (($scope.get('Browser')).$$scope.get('Window')).$new(window); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_13, TMP_14, TMP_15; Opal.defn(self, '$alert', TMP_13 = function $$alert(value) { var self = this; if ($gvars.window == null) $gvars.window = nil; return $gvars.window.$alert(value); }, TMP_13.$$arity = 1); Opal.defn(self, '$prompt', TMP_14 = function $$prompt(value) { var self = this; if ($gvars.window == null) $gvars.window = nil; return $gvars.window.$prompt(value); }, TMP_14.$$arity = 1); Opal.defn(self, '$confirm', TMP_15 = function $$confirm(value) { var self = this; if ($gvars.window == null) $gvars.window = nil; return $gvars.window.$confirm(value); }, TMP_15.$$arity = 1); })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/node_set"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$new', '$uniq', '$map', '$DOM', '$convert', '$flatten', '$respond_to?', '$each', '$__send__', '$to_proc', '$===', '$at_css', '$at_xpath', '$[]', '$css', '$select', '$=~', '$search', '$xpath']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $NodeSet(){}; var self = $NodeSet = $klass($base, $super, 'NodeSet', $NodeSet); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_7, TMP_9, TMP_11, TMP_13, TMP_15, TMP_17, TMP_18; def.literal = nil; Opal.defs(self, '$[]', TMP_2 = function($a_rest) { var $b, $c, TMP_1, self = this, nodes; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } nodes = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { nodes[$arg_idx - 0] = arguments[$arg_idx]; } return self.$new(($b = ($c = nodes.$flatten()).$map, $b.$$p = (TMP_1 = function(x){var self = TMP_1.$$s || this; if (x == null) x = nil; return self.$DOM($scope.get('Native').$convert(x))}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $b).call($c).$uniq()); }, TMP_2.$$arity = -1); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(literal) { var self = this; return self.literal = literal; }, TMP_3.$$arity = 1); Opal.defn(self, '$method_missing', TMP_4 = function $$method_missing(name, $a_rest) { var $b, $c, TMP_5, $d, self = this, args, $iter = TMP_4.$$p, block = $iter || nil, result = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_4.$$p = null; if ((($b = self.literal['$respond_to?'](name)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { ($b = ($c = self).$each, $b.$$p = (TMP_5 = function(el){var self = TMP_5.$$s || this, $a, $d; if (el == null) el = nil; return ($a = ($d = el).$__send__, $a.$$p = block.$to_proc(), $a).apply($d, [name].concat(Opal.to_a(args)))}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $b).call($c); return self; }; result = ($b = ($d = self.literal).$__send__, $b.$$p = block.$to_proc(), $b).apply($d, [name].concat(Opal.to_a(args))); if ((($b = result === self.literal) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self } else if ((($b = $scope.get('Array')['$==='](result)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return $scope.get('NodeSet').$new(result) } else { return result }; }, TMP_4.$$arity = -2); Opal.defn(self, '$at_css', TMP_7 = function $$at_css($a_rest) {try { var $b, $c, TMP_6, self = this, rules; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } rules = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { rules[$arg_idx - 0] = arguments[$arg_idx]; } ($b = ($c = self).$each, $b.$$p = (TMP_6 = function(node){var self = TMP_6.$$s || this, $a, $d; if (node == null) node = nil; if ((($a = node = ($d = node).$at_css.apply($d, Opal.to_a(rules))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.ret(node) } else { return nil }}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $b).call($c); return nil; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_7.$$arity = -1); Opal.defn(self, '$at_xpath', TMP_9 = function $$at_xpath($a_rest) {try { var $b, $c, TMP_8, self = this, paths; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } paths = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { paths[$arg_idx - 0] = arguments[$arg_idx]; } ($b = ($c = self).$each, $b.$$p = (TMP_8 = function(node){var self = TMP_8.$$s || this, $a, $d; if (node == null) node = nil; if ((($a = node = ($d = node).$at_xpath.apply($d, Opal.to_a(paths))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.ret(node) } else { return nil }}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $b).call($c); return nil; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_9.$$arity = -1); Opal.defn(self, '$css', TMP_11 = function $$css(path) { var $a, $b, TMP_10, self = this; return $scope.get('NodeSet')['$[]'](($a = ($b = self.literal).$map, $a.$$p = (TMP_10 = function(node){var self = TMP_10.$$s || this; if (node == null) node = nil; return node.$css(path)}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $a).call($b)); }, TMP_11.$$arity = 1); Opal.defn(self, '$filter', TMP_13 = function $$filter(expression) { var $a, $b, TMP_12, self = this; return ($a = ($b = self.literal).$select, $a.$$p = (TMP_12 = function(node){var self = TMP_12.$$s || this; if (node == null) node = nil; return node['$=~'](expression)}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($b); }, TMP_13.$$arity = 1); Opal.defn(self, '$search', TMP_15 = function $$search($a_rest) { var $b, $c, TMP_14, self = this, what; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } what = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { what[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('NodeSet')['$[]'](($b = ($c = self.literal).$map, $b.$$p = (TMP_14 = function(node){var self = TMP_14.$$s || this, $a; if (node == null) node = nil; return ($a = node).$search.apply($a, Opal.to_a(what))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $b).call($c)); }, TMP_15.$$arity = -1); Opal.defn(self, '$xpath', TMP_17 = function $$xpath(path) { var $a, $b, TMP_16, self = this; return $scope.get('NodeSet')['$[]'](($a = ($b = self.literal).$map, $a.$$p = (TMP_16 = function(node){var self = TMP_16.$$s || this; if (node == null) node = nil; return node.$xpath(path)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b)); }, TMP_17.$$arity = 1); return (Opal.defn(self, '$to_ary', TMP_18 = function $$to_ary() { var self = this; return self.literal; }, TMP_18.$$arity = 0), nil) && 'to_ary'; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/node"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$include', '$==', '$[]', '$new', '$raise', '$convert', '$respond_to?', '$each', '$<<', '$native?', '$===', '$>>', '$DOM', '$to_proc', '$parent', '$last', '$pop', '$select!', '$=~', '$remove_child', '$remove', '$children', '$supports?', '$node_type', '$first', '$select', '$element_children', '$to_s', '$next', '$!', '$element?', '$previous', '$try_convert', '$name']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Node(){}; var self = $Node = $klass($base, $super, 'Node', $Node); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_12, TMP_13, TMP_14, $a, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, TMP_51, TMP_52, TMP_53, TMP_54, TMP_55; def["native"] = nil; self.$include($scope.get('Native')); Opal.cdecl($scope, 'ELEMENT_NODE', 1); Opal.cdecl($scope, 'ATTRIBUTE_NODE', 2); Opal.cdecl($scope, 'TEXT_NODE', 3); Opal.cdecl($scope, 'CDATA_SECTION_NODE', 4); Opal.cdecl($scope, 'ENTITY_REFERENCE_NOCE', 5); Opal.cdecl($scope, 'ENTITY_NODE', 6); Opal.cdecl($scope, 'PROCESSING_INSTRUCTION_NODE', 7); Opal.cdecl($scope, 'COMMENT_NODE', 8); Opal.cdecl($scope, 'DOCUMENT_NODE', 9); Opal.cdecl($scope, 'DOCUMENT_TYPE_NODE', 10); Opal.cdecl($scope, 'DOCUMENT_FRAGMENT_NODE', 11); Opal.cdecl($scope, 'NOTATION_NODE', 12); Opal.defs(self, '$new', TMP_1 = function(value) { var $a, $b, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, klass = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; if (self.classes == null) self.classes = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (self['$==']($scope.get('Node'))) { ((($a = self.classes) !== false && $a !== nil && $a != null) ? $a : self.classes = [nil, $scope.get('Element'), $scope.get('Attribute'), $scope.get('Text'), $scope.get('CDATA'), nil, nil, nil, $scope.get('Comment'), $scope.get('Document'), nil, $scope.get('DocumentFragment')]); if ((($a = klass = self.classes['$[]'](value.nodeType)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return klass.$new(value) } else { return self.$raise($scope.get('ArgumentError'), "cannot instantiate a non derived Node object") }; } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_1, false, $Node)), $a.$$p = $iter, $a).apply($b, $zuper) }; }, TMP_1.$$arity = 1); Opal.defn(self, '$==', TMP_2 = function(other) { var self = this; return self["native"] === $scope.get('Native').$convert(other); }, TMP_2.$$arity = 1); Opal.defn(self, '$<<', TMP_4 = function(node) { var $a, $b, TMP_3, self = this; if ((($a = $scope.get('Opal')['$respond_to?'](node, "each")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = node).$each, $a.$$p = (TMP_3 = function(n){var self = TMP_3.$$s || this; if (n == null) n = nil; return self['$<<'](n)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b); return self;}; if ((($a = self['$native?'](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else if ((($a = $scope.get('String')['$==='](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { node = self["native"].ownerDocument.createTextNode(node) } else { node = $scope.get('Native').$convert(node) }; self["native"].appendChild(node); return self; }, TMP_4.$$arity = 1); Opal.defn(self, '$>>', TMP_6 = function(node) { var $a, $b, TMP_5, self = this; if ((($a = $scope.get('Opal')['$respond_to?'](node, "each")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = node).$each, $a.$$p = (TMP_5 = function(n){var self = TMP_5.$$s || this; if (n == null) n = nil; return self['$>>'](n)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($b); return self;}; if ((($a = self['$native?'](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else if ((($a = $scope.get('String')['$==='](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { node = self["native"].ownerDocument.createTextNode(node) } else { node = $scope.get('Native').$convert(node) }; if ((($a = self["native"].firstChild == null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self["native"].appendChild(node); } else { self["native"].insertBefore(node, self["native"].firstChild); }; return self; }, TMP_6.$$arity = 1); Opal.defn(self, '$add_child', TMP_7 = function $$add_child(node) { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; if (node == null) { node = nil; } TMP_7.$$p = null; if (node !== false && node !== nil && node != null) { } else { node = ($a = ($b = self).$DOM, $a.$$p = block.$to_proc(), $a).call($b) }; return self['$<<'](node); }, TMP_7.$$arity = -1); Opal.defn(self, '$add_next_sibling', TMP_8 = function $$add_next_sibling(node) { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; if (node == null) { node = nil; } TMP_8.$$p = null; if (node !== false && node !== nil && node != null) { } else { node = ($a = ($b = self).$DOM, $a.$$p = block.$to_proc(), $a).call($b) }; if ((($a = self['$native?'](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else if ((($a = $scope.get('String')['$==='](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { node = self["native"].ownerDocument.createTextNode(node) } else { node = $scope.get('Native').$convert(node) }; return self["native"].parentNode.insertBefore(node, self["native"].nextSibling); }, TMP_8.$$arity = -1); Opal.defn(self, '$add_previous_sibling', TMP_9 = function $$add_previous_sibling(node) { var $a, $b, self = this, $iter = TMP_9.$$p, block = $iter || nil; if (node == null) { node = nil; } TMP_9.$$p = null; if (node !== false && node !== nil && node != null) { } else { node = ($a = ($b = self).$DOM, $a.$$p = block.$to_proc(), $a).call($b) }; if ((($a = self['$native?'](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else if ((($a = $scope.get('String')['$==='](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { node = self["native"].ownerDocument.createTextNode(node) } else { node = $scope.get('Native').$convert(node) }; return self["native"].parentNode.insertBefore(node, self["native"]); }, TMP_9.$$arity = -1); Opal.alias(self, 'after', 'add_next_sibling'); Opal.defn(self, '$append_to', TMP_10 = function $$append_to(node) { var self = this; return node['$<<'](self); }, TMP_10.$$arity = 1); Opal.defn(self, '$ancestors', TMP_12 = function $$ancestors(expression) { var $a, $b, TMP_11, self = this, parents = nil, parent = nil; if (expression == null) { expression = nil; } if ((($a = self.$parent()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return $scope.get('NodeSet')['$[]']() }; parents = [self.$parent()]; while ((($b = parent = parents.$last().$parent()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { parents['$<<'](parent)}; if ((($a = $scope.get('Document')['$==='](parents.$last())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { parents.$pop()}; if (expression !== false && expression !== nil && expression != null) { ($a = ($b = parents)['$select!'], $a.$$p = (TMP_11 = function(p){var self = TMP_11.$$s || this; if (p == null) p = nil; return p['$=~'](expression)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b)}; return $scope.get('NodeSet').$new(parents); }, TMP_12.$$arity = -1); Opal.alias(self, 'before', 'add_previous_sibling'); Opal.defn(self, '$remove', TMP_13 = function $$remove() { var $a, self = this; if ((($a = self.$parent()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$parent().$remove_child(self) } else { return nil }; }, TMP_13.$$arity = 0); Opal.defn(self, '$clear', TMP_14 = function $$clear() { var self = this; return self.$children().$remove(); }, TMP_14.$$arity = 0); if ((($a = $scope.get('Browser')['$supports?']("Element.textContent")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$content', TMP_15 = function $$content() { var self = this; return self["native"].textContent; }, TMP_15.$$arity = 0); Opal.defn(self, '$content=', TMP_16 = function(value) { var self = this; return self["native"].textContent = value; }, TMP_16.$$arity = 1); } else if ((($a = $scope.get('Browser')['$supports?']("Element.innerText")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$content', TMP_17 = function $$content() { var self = this; return self["native"].innerText; }, TMP_17.$$arity = 0); Opal.defn(self, '$content=', TMP_18 = function(value) { var self = this; return self["native"].innerText = value; }, TMP_18.$$arity = 1); } else { Opal.defn(self, '$content', TMP_19 = function $$content() { var self = this; return self.$raise($scope.get('NotImplementedError'), "node text content unsupported"); }, TMP_19.$$arity = 0); Opal.defn(self, '$content=', TMP_20 = function(value) { var self = this; return self.$raise($scope.get('NotImplementedError'), "node text content unsupported"); }, TMP_20.$$arity = 1); }; Opal.defn(self, '$blank?', TMP_21 = function() { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_21.$$arity = 0); Opal.defn(self, '$cdata?', TMP_22 = function() { var self = this; return self.$node_type()['$==']($scope.get('CDATA_SECTION_NODE')); }, TMP_22.$$arity = 0); Opal.defn(self, '$child', TMP_23 = function $$child() { var self = this; return self.$children().$first(); }, TMP_23.$$arity = 0); Opal.defn(self, '$children', TMP_24 = function $$children() { var self = this; return $scope.get('NodeSet')['$[]']((($scope.get('Native')).$$scope.get('Array')).$new(self["native"].childNodes)); }, TMP_24.$$arity = 0); Opal.defn(self, '$children=', TMP_25 = function(node) { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_25.$$arity = 1); Opal.defn(self, '$comment?', TMP_26 = function() { var self = this; return self.$node_type()['$==']($scope.get('COMMENT_NODE')); }, TMP_26.$$arity = 0); Opal.defn(self, '$document', TMP_27 = function $$document() { var $a, self = this; if ((($a = (typeof(self["native"].ownerDocument) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$DOM(self["native"].ownerDocument) } else { return nil }; }, TMP_27.$$arity = 0); Opal.defn(self, '$document?', TMP_28 = function() { var self = this; return self.$node_type()['$==']($scope.get('DOCUMENT_NODE')); }, TMP_28.$$arity = 0); Opal.defn(self, '$elem?', TMP_29 = function() { var self = this; return self.$node_type()['$==']($scope.get('ELEMENT_NODE')); }, TMP_29.$$arity = 0); Opal.alias(self, 'element?', 'elem?'); Opal.defn(self, '$element_children', TMP_30 = function $$element_children() { var $a, $b, self = this; return ($a = ($b = self.$children()).$select, $a.$$p = "element?".$to_proc(), $a).call($b); }, TMP_30.$$arity = 0); Opal.alias(self, 'elements', 'element_children'); Opal.defn(self, '$first_element_child', TMP_31 = function $$first_element_child() { var self = this; return self.$element_children().$first(); }, TMP_31.$$arity = 0); Opal.defn(self, '$fragment?', TMP_32 = function() { var self = this; return self.$node_type()['$==']($scope.get('DOCUMENT_FRAGMENT_NODE')); }, TMP_32.$$arity = 0); Opal.defn(self, '$inner_html', TMP_33 = function $$inner_html() { var self = this; return self["native"].innerHTML; }, TMP_33.$$arity = 0); Opal.defn(self, '$inner_html=', TMP_34 = function(value) { var self = this; return self["native"].innerHTML = value; }, TMP_34.$$arity = 1); Opal.alias(self, 'inner_text', 'content'); Opal.alias(self, 'inner_text=', 'content='); Opal.defn(self, '$last_element_child', TMP_35 = function $$last_element_child() { var self = this; return self.$element_children().$last(); }, TMP_35.$$arity = 0); Opal.defn(self, '$name', TMP_36 = function $$name() { var self = this; return self["native"].nodeName || nil; }, TMP_36.$$arity = 0); Opal.defn(self, '$name=', TMP_37 = function(value) { var self = this; return self["native"].nodeName = value.$to_s(); }, TMP_37.$$arity = 1); Opal.defn(self, '$namespace', TMP_38 = function $$namespace() { var self = this; return self["native"].namespaceURI || nil; }, TMP_38.$$arity = 0); Opal.defn(self, '$next', TMP_39 = function $$next() { var $a, self = this; if ((($a = self["native"].nextSibling != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$DOM(self["native"].nextSibling) } else { return nil }; }, TMP_39.$$arity = 0); Opal.alias(self, 'next=', 'add_next_sibling'); Opal.defn(self, '$next_element', TMP_40 = function $$next_element() { var $a, $b, $c, self = this, current = nil; current = self.$next(); while ((($b = (($c = current !== false && current !== nil && current != null) ? current['$element?']()['$!']() : current)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { current = current.$next()}; return current; }, TMP_40.$$arity = 0); Opal.alias(self, 'next_sibling', 'next'); Opal.alias(self, 'node_name', 'name'); Opal.alias(self, 'node_name=', 'name='); Opal.defn(self, '$node_type', TMP_41 = function $$node_type() { var self = this; return self["native"].nodeType; }, TMP_41.$$arity = 0); Opal.defn(self, '$parent', TMP_42 = function $$parent() { var $a, self = this; if ((($a = self["native"].parentNode != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$DOM(self["native"].parentNode) } else { return nil }; }, TMP_42.$$arity = 0); Opal.defn(self, '$parent=', TMP_43 = function(node) { var self = this; return self["native"].parentNode = $scope.get('Native').$convert(node); }, TMP_43.$$arity = 1); Opal.defn(self, '$parse', TMP_44 = function $$parse(text, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$raise($scope.get('NotImplementedError')); }, TMP_44.$$arity = -2); Opal.defn(self, '$path', TMP_45 = function $$path() { var self = this; return self.$raise($scope.get('NotImplementedError')); }, TMP_45.$$arity = 0); Opal.defn(self, '$prepend_to', TMP_46 = function $$prepend_to(node) { var self = this; return node['$>>'](self); }, TMP_46.$$arity = 1); Opal.defn(self, '$previous', TMP_47 = function $$previous() { var $a, self = this; if ((($a = self["native"].previousSibling != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$DOM(self["native"].previousSibling) } else { return nil }; }, TMP_47.$$arity = 0); Opal.alias(self, 'previous=', 'add_previous_sibling'); Opal.defn(self, '$previous_element', TMP_48 = function $$previous_element() { var $a, $b, $c, self = this, current = nil; current = self.$previous(); while ((($b = (($c = current !== false && current !== nil && current != null) ? current['$element?']()['$!']() : current)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { current = current.$previous()}; return current; }, TMP_48.$$arity = 0); Opal.alias(self, 'previous_sibling', 'previous'); Opal.defn(self, '$remove_child', TMP_49 = function $$remove_child(node) { var self = this; return self["native"].removeChild($scope.get('Native').$try_convert(node)); }, TMP_49.$$arity = 1); Opal.defn(self, '$replace', TMP_50 = function $$replace(node) { var $a, self = this; if ((($a = self['$native?'](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else if ((($a = $scope.get('String')['$==='](node)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { node = self["native"].ownerDocument.createTextNode(node) } else { node = $scope.get('Native').$convert(node) }; self["native"].parentNode.replaceChild(node, self["native"]); return node; }, TMP_50.$$arity = 1); Opal.alias(self, 'replace_with', 'replace'); Opal.alias(self, 'text', 'content'); Opal.alias(self, 'text=', 'content='); Opal.defn(self, '$text?', TMP_51 = function() { var self = this; return self.$node_type()['$==']($scope.get('TEXT_NODE')); }, TMP_51.$$arity = 0); Opal.defn(self, '$traverse', TMP_52 = function $$traverse() { var self = this, $iter = TMP_52.$$p, block = $iter || nil; TMP_52.$$p = null; return self.$raise($scope.get('NotImplementedError')); }, TMP_52.$$arity = 0); Opal.alias(self, 'type', 'node_type'); Opal.defn(self, '$value', TMP_53 = function $$value() { var self = this; return self["native"].nodeValue || nil; }, TMP_53.$$arity = 0); Opal.defn(self, '$value=', TMP_54 = function(value) { var self = this; return self["native"].nodeValue = value; }, TMP_54.$$arity = 1); return (Opal.defn(self, '$inspect', TMP_55 = function $$inspect() { var self = this; return "#"; }, TMP_55.$$arity = 0), nil) && 'inspect'; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/attribute"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$alias_native', '$supports?', '$==', '$name']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Attribute(){}; var self = $Attribute = $klass($base, $super, 'Attribute', $Attribute); var def = self.$$proto, $scope = self.$$scope, $a, TMP_1; self.$include($scope.get('Native')); self.$alias_native("name"); self.$alias_native("value"); self.$alias_native("value="); if ((($a = $scope.get('Browser')['$supports?']("Attr.isId")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$alias_native("id?", "isId") } else { return (Opal.defn(self, '$id?', TMP_1 = function() { var self = this; return self.$name()['$==']("id"); }, TMP_1.$$arity = 0), nil) && 'id?' }; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/character_data"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CharacterData(){}; var self = $CharacterData = $klass($base, $super, 'CharacterData', $CharacterData); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6; def["native"] = nil; Opal.defn(self, '$append', TMP_1 = function $$append(string) { var self = this; self["native"].appendData(string); return self; }, TMP_1.$$arity = 1); Opal.defn(self, '$data', TMP_2 = function $$data() { var self = this; return self["native"].data; }, TMP_2.$$arity = 0); Opal.defn(self, '$delete', TMP_3 = function(count, offset) { var self = this; if (offset == null) { offset = 0; } self["native"].deleteData(offset, count); return self; }, TMP_3.$$arity = -2); Opal.defn(self, '$insert', TMP_4 = function $$insert(string, offset) { var self = this; if (offset == null) { offset = 0; } self["native"].insertData(offset, string); return self; }, TMP_4.$$arity = -2); self.$alias_native("length"); Opal.defn(self, '$replace', TMP_5 = function $$replace(string, offset, count) { var self = this; if (offset == null) { offset = 0; } if (count == null) { count = self["native"].length; } self["native"].replaceData(offset, count, string); return self; }, TMP_5.$$arity = -2); return (Opal.defn(self, '$substring', TMP_6 = function $$substring(count, offset) { var self = this; if (offset == null) { offset = 0; } return self["native"].substringData(offset, count); }, TMP_6.$$arity = -2), nil) && 'substring'; })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/text"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$create_text', '$DOM', '$data']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Text(){}; var self = $Text = $klass($base, $super, 'Text', $Text); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defs(self, '$create', TMP_1 = function $$create($a_rest) { var $b, self = this, args; if ($gvars.document == null) $gvars.document = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $gvars.document).$create_text.apply($b, Opal.to_a(args)); }, TMP_1.$$arity = -1); Opal.defn(self, '$whole', TMP_2 = function $$whole() { var self = this; return self["native"].wholeText; }, TMP_2.$$arity = 0); Opal.defn(self, '$split', TMP_3 = function $$split(offset) { var self = this; return self.$DOM(self["native"].splitText(offset)); }, TMP_3.$$arity = 1); return (Opal.defn(self, '$inspect', TMP_4 = function $$inspect() { var self = this; return "#"; }, TMP_4.$$arity = 0), nil) && 'inspect'; })($scope.base, $scope.get('CharacterData')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/cdata"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$value']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $CDATA(){}; var self = $CDATA = $klass($base, $super, 'CDATA', $CDATA); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$inspect', TMP_1 = function $$inspect() { var self = this; return "#"; }, TMP_1.$$arity = 0), nil) && 'inspect' })($scope.base, $scope.get('Text')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/comment"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$value']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Comment(){}; var self = $Comment = $klass($base, $super, 'Comment', $Comment); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$inspect', TMP_1 = function $$inspect() { var self = this; return "#"; }, TMP_1.$$arity = 0), nil) && 'inspect' })($scope.base, $scope.get('CharacterData')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/attributes"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_reader', '$to_n', '$[]', '$supports?', '$==', '$to_s', '$include', '$enum_for', '$each', '$name', '$value', '$attribute_nodes', '$!', '$[]=']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Attributes(){}; var self = $Attributes = $klass($base, $super, 'Attributes', $Attributes); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, $b, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_10; def.namespace = def["native"] = def.element = nil; self.$attr_reader("namespace"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(element, options) { var self = this; self.element = element; self["native"] = element.$to_n(); return self.namespace = options['$[]']("namespace"); }, TMP_1.$$arity = 2); if ((($a = ((($b = $scope.get('Browser')['$supports?']("Element.className")) !== false && $b !== nil && $b != null) ? $b : $scope.get('Browser')['$supports?']("Element.htmlFor"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$[]', TMP_2 = function(name, options) { var $a, $b, self = this, namespace = nil; if (options == null) { options = $hash2([], {}); } if ((($a = (($b = name['$==']("class")) ? $scope.get('Browser')['$supports?']("Element.className") : name['$==']("class"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { name = "className" } else if ((($a = (($b = name['$==']("for")) ? $scope.get('Browser')['$supports?']("Element.htmlFor") : name['$==']("for"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { name = "htmlFor"}; if ((($a = namespace = ((($b = options['$[]']("namespace")) !== false && $b !== nil && $b != null) ? $b : self.namespace)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"].getAttributeNS(namespace.$to_s(), name.$to_s()) || nil; } else { return self["native"].getAttribute(name.$to_s()) || nil; }; }, TMP_2.$$arity = -2); Opal.defn(self, '$[]=', TMP_3 = function(name, value, options) { var $a, $b, self = this, namespace = nil; if (options == null) { options = $hash2([], {}); } if ((($a = (($b = name['$==']("class")) ? $scope.get('Browser')['$supports?']("Element.className") : name['$==']("class"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { name = "className" } else if ((($a = (($b = name['$==']("for")) ? $scope.get('Browser')['$supports?']("Element.htmlFor") : name['$==']("for"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { name = "htmlFor"}; if ((($a = namespace = ((($b = options['$[]']("namespace")) !== false && $b !== nil && $b != null) ? $b : self.namespace)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"].setAttributeNS(namespace.$to_s(), name.$to_s(), value); } else { return self["native"].setAttribute(name.$to_s(), value.$to_s()); }; }, TMP_3.$$arity = -3); } else { Opal.defn(self, '$[]', TMP_4 = function(name, options) { var $a, $b, self = this, namespace = nil; if (options == null) { options = $hash2([], {}); } if ((($a = namespace = ((($b = options['$[]']("namespace")) !== false && $b !== nil && $b != null) ? $b : self.namespace)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"].getAttributeNS(namespace.$to_s(), name.$to_s()) || nil; } else { return self["native"].getAttribute(name.$to_s()) || nil; }; }, TMP_4.$$arity = -2); Opal.defn(self, '$[]=', TMP_5 = function(name, value, options) { var $a, $b, self = this, namespace = nil; if (options == null) { options = $hash2([], {}); } if ((($a = namespace = ((($b = options['$[]']("namespace")) !== false && $b !== nil && $b != null) ? $b : self.namespace)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self["native"].setAttributeNS(namespace.$to_s(), name.$to_s(), value); } else { return self["native"].setAttribute(name.$to_s(), value.$to_s()); }; }, TMP_5.$$arity = -3); }; self.$include($scope.get('Enumerable')); Opal.defn(self, '$each', TMP_6 = function $$each() { var $a, $b, TMP_7, self = this, $iter = TMP_6.$$p, block = $iter || nil; TMP_6.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("each") }; ($a = ($b = self.element.$attribute_nodes()).$each, $a.$$p = (TMP_7 = function(attr){var self = TMP_7.$$s || this; if (attr == null) attr = nil; return Opal.yieldX(block, [attr.$name(), attr.$value()]);}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); return self; }, TMP_6.$$arity = 0); Opal.alias(self, 'get', '[]'); Opal.defn(self, '$has_key?', TMP_8 = function(name) { var self = this; return self['$[]'](name)['$!']()['$!'](); }, TMP_8.$$arity = 1); Opal.defn(self, '$merge!', TMP_10 = function(hash) { var $a, $b, TMP_9, self = this; ($a = ($b = hash).$each, $a.$$p = (TMP_9 = function(name, value){var self = TMP_9.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return self['$[]='](name, value)}, TMP_9.$$s = self, TMP_9.$$arity = 2, TMP_9), $a).call($b); return self; }, TMP_10.$$arity = 1); return Opal.alias(self, 'set', '[]='); })($scope.base, null) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/data"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$attr_reader', '$to_n', '$include', '$enum_for', '$call', '$each', '$=~', '$attributes', '$[]']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Data(){}; var self = $Data = $klass($base, $super, 'Data', $Data); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_5, TMP_6, TMP_7; def["native"] = def.element = nil; self.$attr_reader("element"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(element) { var $a, self = this; self.element = element; self["native"] = element.$to_n(); if ((($a = (typeof(self["native"].$data) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self["native"].$data = {}; }; }, TMP_1.$$arity = 1); self.$include($scope.get('Enumerable')); Opal.defn(self, '$each', TMP_2 = function $$each() { var $a, $b, TMP_3, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; if (block !== false && block !== nil && block != null) { } else { return self.$enum_for("each") }; var data = self["native"].$data; for (var key in data) { block.$call(key, data[key]); } ; ($a = ($b = self.element.$attributes()).$each, $a.$$p = (TMP_3 = function(name, value){var self = TMP_3.$$s || this, $c; if (name == null) name = nil;if (value == null) value = nil; if ((($c = name['$=~'](/^data-(.*)$/)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return block.$call((($c = $gvars['~']) === nil ? nil : $c['$[]'](1)), value) } else { return nil }}, TMP_3.$$s = self, TMP_3.$$arity = 2, TMP_3), $a).call($b); return self; }, TMP_2.$$arity = 0); Opal.defn(self, '$assign', TMP_5 = function $$assign(data) { var $a, $b, TMP_4, self = this; ($a = ($b = data).$each, $a.$$p = (TMP_4 = function(name, value){var self = TMP_4.$$s || this; if (self["native"] == null) self["native"] = nil; if (name == null) name = nil;if (value == null) value = nil; return self["native"].$data[name] = value;}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4), $a).call($b); return self; }, TMP_5.$$arity = 1); Opal.defn(self, '$[]', TMP_6 = function(name) { var $a, self = this, data = nil; if ((($a = data = self.element['$[]']("data-" + (name))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return data}; var value = self["native"].$data[name]; if (value === undefined) { return nil; } else { return value; } ; }, TMP_6.$$arity = 1); return (Opal.defn(self, '$[]=', TMP_7 = function(name, value) { var self = this; return self["native"].$data[name] = value; }, TMP_7.$$arity = 2), nil) && '[]='; })($scope.base, null) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/position"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$to_n', '$offset', '$get', '$parent', '$new', '$==', '$[]', '$style', '$=~', '$x=', '$+', '$x', '$to_i', '$y=', '$y', '$-']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Position(){}; var self = $Position = $klass($base, $super, 'Position', $Position); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def.element = nil; self.$attr_reader("element"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(element) { var self = this; self.element = element; return self["native"] = element.$to_n(); }, TMP_1.$$arity = 1); Opal.defn(self, '$get', TMP_2 = function $$get() { var $a, self = this, offset = nil, position = nil, parent = nil, parent_offset = nil; offset = self.element.$offset(); position = offset.$get(); parent = offset.$parent(); parent_offset = (($scope.get('Browser')).$$scope.get('Position')).$new(0, 0); if (self.element.$style()['$[]']("position")['$==']("fixed")) { if ((($a = parent['$=~']("html")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { parent_offset = parent.$offset() }; ($a = parent_offset, $a['$x=']($rb_plus($a.$x(), parent.$style()['$[]']("border-top-width").$to_i()))); ($a = parent_offset, $a['$y=']($rb_plus($a.$y(), parent.$style()['$[]']("border-left-width").$to_i())));}; return (($scope.get('Browser')).$$scope.get('Position')).$new($rb_minus($rb_minus(position.$x(), parent_offset.$x()), self.element.$style()['$[]']("margin-left").$to_i()), $rb_minus($rb_minus(position.$y(), parent_offset.$y()), self.element.$style()['$[]']("margin-top").$to_i())); }, TMP_2.$$arity = 0); Opal.defn(self, '$x', TMP_3 = function $$x() { var self = this; return self.$get().$x(); }, TMP_3.$$arity = 0); return (Opal.defn(self, '$y', TMP_4 = function $$y() { var self = this; return self.$get().$y(); }, TMP_4.$$arity = 0), nil) && 'y'; })($scope.base, null) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/offset"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$to_n', '$DOM', '$root', '$document', '$x', '$get', '$set', '$y', '$supports?', '$window', '$new', '$[]', '$style!', '$==', '$[]=', '$style', '$to_u', '$===', '$first', '$+', '$-', '$px']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Offset(){}; var self = $Offset = $klass($base, $super, 'Offset', $Offset); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, $a, TMP_7, TMP_8, TMP_9; def["native"] = def.element = nil; self.$attr_reader("element"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(element) { var self = this; self.element = element; return self["native"] = element.$to_n(); }, TMP_1.$$arity = 1); Opal.defn(self, '$parent', TMP_2 = function $$parent() { var self = this; return self.$DOM(self["native"].offsetParent || self.element.$document().$root().$to_n()); }, TMP_2.$$arity = 0); Opal.defn(self, '$x', TMP_3 = function $$x() { var self = this; return self.$get().$x(); }, TMP_3.$$arity = 0); Opal.defn(self, '$x=', TMP_4 = function(value) { var self = this; return self.$set(value, nil); }, TMP_4.$$arity = 1); Opal.defn(self, '$y', TMP_5 = function $$y() { var self = this; return self.$get().$y(); }, TMP_5.$$arity = 0); Opal.defn(self, '$y=', TMP_6 = function(value) { var self = this; return self.$set(nil, value); }, TMP_6.$$arity = 1); if ((($a = $scope.get('Browser')['$supports?']("Element.getBoundingClientRect")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$get', TMP_7 = function $$get() { var self = this, doc = nil, root = nil, win = nil; doc = self.element.$document(); root = doc.$root().$to_n(); win = doc.$window().$to_n(); var box = self["native"].getBoundingClientRect(), y = box.top + (win.pageYOffset || root.scrollTop) - (root.clientTop || 0), x = box.left + (win.pageXOffset || root.scrollLeft) - (root.clientLeft || 0); ; return (($scope.get('Browser')).$$scope.get('Position')).$new(x, y); }, TMP_7.$$arity = 0) } else { Opal.defn(self, '$get', TMP_8 = function $$get() { var self = this, doc = nil, root = nil, win = nil; doc = self.$document(); root = doc.$root().$to_n(); win = doc.$window().$to_n(); var y = (win.pageYOffset || root.scrollTop) - (root.clientTop || 0), x = (win.pageXOffset || root.scrollLeft) - (root.clientLeft || 0); ; return (($scope.get('Browser')).$$scope.get('Position')).$new(x, y); }, TMP_8.$$arity = 0) }; return (Opal.defn(self, '$set', TMP_9 = function $$set($a_rest) { var $b, $c, self = this, value, position = nil, offset = nil, top = nil, left = nil, x = nil, y = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } value = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { value[$arg_idx - 0] = arguments[$arg_idx]; } position = self.element['$style!']()['$[]']("position"); if (position['$==']("static")) { self.element.$style()['$[]=']("position", "relative")}; offset = self.$get(); top = self.element['$style!']()['$[]']("top").$to_u(); left = self.element['$style!']()['$[]']("left").$to_u(); if ((($b = (($scope.get('Browser')).$$scope.get('Position'))['$==='](value.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $b = [value.$first().$x(), value.$first().$y()], x = $b[0], y = $b[1], $b } else if ((($b = $scope.get('Hash')['$==='](value.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { $b = [value.$first()['$[]']("x"), value.$first()['$[]']("y")], x = $b[0], y = $b[1], $b } else { $c = value, $b = Opal.to_ary($c), x = ($b[0] == null ? nil : $b[0]), y = ($b[1] == null ? nil : $b[1]), $c }; if (x !== false && x !== nil && x != null) { self.element.$style()['$[]=']("left", $rb_plus(($rb_minus(x.$px(), offset.$x())), left))}; if (y !== false && y !== nil && y != null) { return self.element.$style()['$[]=']("top", $rb_plus(($rb_minus(y.$px(), offset.$y())), top)) } else { return nil }; }, TMP_9.$$arity = -1), nil) && 'set'; })($scope.base, null) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/scroll"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$to_n', '$supports?', '$===', '$first', '$[]', '$x', '$y', '$new', '$raise', '$position']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Scroll(){}; var self = $Scroll = $klass($base, $super, 'Scroll', $Scroll); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15; def["native"] = nil; self.$attr_reader("element"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(element) { var self = this; self.element = element; return self["native"] = element.$to_n(); }, TMP_1.$$arity = 1); if ((($a = $scope.get('Browser')['$supports?']("Element.scroll")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$to', TMP_2 = function $$to($a_rest) { var $b, $c, self = this, args, x = nil, y = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { x = ((($b = args.$first()['$[]']("x")) !== false && $b !== nil && $b != null) ? $b : self.$x()); y = ((($b = args.$first()['$[]']("y")) !== false && $b !== nil && $b != null) ? $b : self.$y()); } else { $c = args, $b = Opal.to_ary($c), x = ($b[0] == null ? nil : $b[0]), y = ($b[1] == null ? nil : $b[1]), $c }; self["native"].scrollTop = y; return self["native"].scrollLeft = x; }, TMP_2.$$arity = -1); Opal.defn(self, '$position', TMP_3 = function $$position() { var self = this; return (($scope.get('Browser')).$$scope.get('Position')).$new(self["native"].scrollLeft, self["native"].scrollTop); }, TMP_3.$$arity = 0); } else if ((($a = $scope.get('Browser')['$supports?']("Element.pageOffset")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$to', TMP_4 = function $$to($a_rest) { var $b, $c, self = this, args, x = nil, y = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { x = ((($b = args.$first()['$[]']("x")) !== false && $b !== nil && $b != null) ? $b : self.$x()); y = ((($b = args.$first()['$[]']("y")) !== false && $b !== nil && $b != null) ? $b : self.$y()); } else { $c = args, $b = Opal.to_ary($c), x = ($b[0] == null ? nil : $b[0]), y = ($b[1] == null ? nil : $b[1]), $c }; self["native"].pageYOffset = y; return self["native"].pageXOffset = x; }, TMP_4.$$arity = -1); Opal.defn(self, '$position', TMP_5 = function $$position() { var self = this; return $scope.get('Position').$new(self["native"].pageXOffset, self["native"].pageYOffset); }, TMP_5.$$arity = 0); } else { Opal.defn(self, '$to', TMP_6 = function $$to($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return self.$raise($scope.get('NotImplementedError'), "scroll on element unsupported"); }, TMP_6.$$arity = -1); Opal.defn(self, '$position', TMP_7 = function $$position() { var self = this; return self.$raise($scope.get('NotImplementedError'), "scroll on element unsupported"); }, TMP_7.$$arity = 0); }; Opal.defn(self, '$x', TMP_8 = function $$x() { var self = this; return self.$position().$x(); }, TMP_8.$$arity = 0); Opal.defn(self, '$y', TMP_9 = function $$y() { var self = this; return self.$position().$y(); }, TMP_9.$$arity = 0); Opal.defn(self, '$height', TMP_10 = function $$height() { var self = this; return self["native"].scrollHeight; }, TMP_10.$$arity = 0); Opal.defn(self, '$width', TMP_11 = function $$width() { var self = this; return self["native"].scrollWidth; }, TMP_11.$$arity = 0); Opal.defn(self, '$by', TMP_12 = function $$by($a_rest) { var $b, $c, self = this, args, x = nil, y = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('Hash')['$==='](args.$first())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { x = ((($b = args.$first()['$[]']("x")) !== false && $b !== nil && $b != null) ? $b : 0); y = ((($b = args.$first()['$[]']("y")) !== false && $b !== nil && $b != null) ? $b : 0); } else { $c = args, $b = Opal.to_ary($c), x = ($b[0] == null ? nil : $b[0]), y = ($b[1] == null ? nil : $b[1]), $c }; self["native"].scrollBy(x, y); return self; }, TMP_12.$$arity = -1); if ((($a = $scope.get('Browser')['$supports?']("Element.scrollIntoViewIfNeeded")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$to', TMP_13 = function $$to(align) { var self = this; if (align == null) { align = true; } return self["native"].scrollIntoViewIfNeeded(align); }, TMP_13.$$arity = -1) } else { Opal.defn(self, '$to', TMP_14 = function $$to(align) { var self = this; if (align == null) { align = true; } return self.$raise($scope.get('NotImplementedError')); }, TMP_14.$$arity = -1) }; return (Opal.defn(self, '$to!', TMP_15 = function(align) { var self = this; if (align == null) { align = true; } return self["native"].scrollIntoView(align); }, TMP_15.$$arity = -1), nil) && 'to!'; })($scope.base, null) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/size"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$to_n', '$[]=', '$style']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Size(){}; var self = $Size = $klass($base, $super, 'Size', $Size); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = def.element = nil; self.$attr_reader("element"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(element, $a_rest) { var self = this, inc; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } inc = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { inc[$arg_idx - 1] = arguments[$arg_idx]; } self.element = element; self["native"] = element.$to_n(); return self.include = inc; }, TMP_1.$$arity = -2); Opal.defn(self, '$width', TMP_2 = function $$width() { var self = this; return self["native"].offsetWidth; }, TMP_2.$$arity = 0); Opal.defn(self, '$width=', TMP_3 = function(value) { var self = this; return self.element.$style()['$[]=']("width", value); }, TMP_3.$$arity = 1); Opal.defn(self, '$height', TMP_4 = function $$height() { var self = this; return self["native"].offsetHeight; }, TMP_4.$$arity = 0); return (Opal.defn(self, '$height=', TMP_5 = function(value) { var self = this; return self.element.$style()['$[]=']("height", value); }, TMP_5.$$arity = 1), nil) && 'height='; })($scope.base, null) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/input"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Input(){}; var self = $Input = $klass($base, $super, 'Input', $Input); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defn(self, '$value', TMP_1 = function $$value() { var self = this; if (self["native"].value == "") { return nil; } else { return self["native"].value; } ; }, TMP_1.$$arity = 0); Opal.defn(self, '$value=', TMP_2 = function(value) { var self = this; return self["native"].value = value; }, TMP_2.$$arity = 1); Opal.defn(self, '$checked?', TMP_3 = function() { var self = this; return self["native"].checked; }, TMP_3.$$arity = 0); return (Opal.defn(self, '$clear', TMP_4 = function $$clear() { var self = this; return self["native"].value = ''; }, TMP_4.$$arity = 0), nil) && 'clear'; })($scope.base, $scope.get('Element')) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/select"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$[]', '$new', '$DOM', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Select(){}; var self = $Select = $klass($base, $super, 'Select', $Select); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$value', TMP_1 = function $$value() { var self = this; if (self["native"].value == "") { return nil; } else { return self["native"].value; } ; }, TMP_1.$$arity = 0); Opal.defn(self, '$labels', TMP_2 = function $$labels() { var self = this; return $scope.get('NodeSet')['$[]']((($scope.get('Native')).$$scope.get('Array')).$new(self["native"].labels)); }, TMP_2.$$arity = 0); Opal.defn(self, '$options', TMP_3 = function $$options() { var self = this; return $scope.get('NodeSet')['$[]']((($scope.get('Native')).$$scope.get('Array')).$new(self["native"].options)); }, TMP_3.$$arity = 0); Opal.defn(self, '$option', TMP_4 = function $$option() { var self = this; return self.$DOM(self["native"].options[self["native"].selectedIndex]); }, TMP_4.$$arity = 0); Opal.defn(self, '$index', TMP_5 = function $$index() { var self = this; return self["native"].selectedIndex; }, TMP_5.$$arity = 0); self.$alias_native("multiple?", "multiple"); self.$alias_native("required?", "required"); return self.$alias_native("length"); })($scope.base, $scope.get('Element')) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/image"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Image(){}; var self = $Image = $klass($base, $super, 'Image', $Image); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def["native"] = nil; Opal.defn(self, '$complete?', TMP_1 = function() { var self = this; return self["native"].complete; }, TMP_1.$$arity = 0); Opal.defn(self, '$cross?', TMP_2 = function() { var self = this; return self["native"].crossOrigin; }, TMP_2.$$arity = 0); Opal.defn(self, '$height', TMP_3 = function $$height() { var self = this; return self["native"].naturalHeight; }, TMP_3.$$arity = 0); return (Opal.defn(self, '$width', TMP_4 = function $$width() { var self = this; return self["native"].naturalWidth; }, TMP_4.$$arity = 0), nil) && 'width'; })($scope.base, $scope.get('Element')); return Opal.cdecl($scope, 'Img', $scope.get('Image')); })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/template"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$DOM']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Template(){}; var self = $Template = $klass($base, $super, 'Template', $Template); var def = self.$$proto, $scope = self.$$scope, TMP_1; def["native"] = nil; return (Opal.defn(self, '$content', TMP_1 = function $$content() { var self = this; return self.$DOM(self["native"].content); }, TMP_1.$$arity = 0), nil) && 'content' })($scope.base, $scope.get('Element')) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element/textarea"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Textarea(){}; var self = $Textarea = $klass($base, $super, 'Textarea', $Textarea); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def["native"] = nil; Opal.defn(self, '$value', TMP_1 = function $$value() { var self = this; if (self["native"].value == "") { return nil; } else { return self["native"].value; } ; }, TMP_1.$$arity = 0); Opal.defn(self, '$value=', TMP_2 = function(value) { var self = this; return self["native"].value = value; }, TMP_2.$$arity = 1); return (Opal.defn(self, '$clear', TMP_3 = function $$clear() { var self = this; return self["native"].value = ''; }, TMP_3.$$arity = 0), nil) && 'clear'; })($scope.base, $scope.get('Element')) })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/element"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$create_element', '$==', '$capitalize', '$include?', '$constants', '$new', '$const_get', '$include', '$target', '$DOM', '$supports?', '$loaded?', '$raise', '$[]', '$map', '$xpath', '$get', '$attributes', '$set', '$+', '$class_names', '$empty?', '$join', '$uniq', '$first', '$css', '$each', '$alias_native', '$reject', '$to_proc', '$split', '$===', '$assign', '$height', '$size', '$height=', '$to_s', '$clear', '$document', '$<<', '$to_a', '$downcase', '$name', '$id', '$offset', '$flatten', '$concat', '$replace', '$apply', '$to_n', '$window', '$-', '$width', '$width=']); self.$require("browser/dom/element/attributes"); self.$require("browser/dom/element/data"); self.$require("browser/dom/element/position"); self.$require("browser/dom/element/offset"); self.$require("browser/dom/element/scroll"); self.$require("browser/dom/element/size"); self.$require("browser/dom/element/input"); self.$require("browser/dom/element/select"); self.$require("browser/dom/element/image"); self.$require("browser/dom/element/template"); self.$require("browser/dom/element/textarea"); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, $a, $b, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_18, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50, $c, TMP_51, TMP_52; def["native"] = nil; Opal.defs(self, '$create', TMP_1 = function $$create($a_rest) { var $b, self = this, args; if ($gvars.document == null) $gvars.document = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $gvars.document).$create_element.apply($b, Opal.to_a(args)); }, TMP_1.$$arity = -1); Opal.defs(self, '$new', TMP_2 = function(node) { var $a, $b, $c, self = this, $iter = TMP_2.$$p, $yield = $iter || nil, name = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_2.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if (self['$==']($scope.get('Element'))) { name = (node.nodeName).$capitalize(); if ((($a = $scope.get('Element').$constants()['$include?'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Element').$const_get(name).$new(node) } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_2, false, $Element)), $a.$$p = $iter, $a).apply($b, $zuper) }; } else { return ($a = ($c = self, Opal.find_super_dispatcher(self, 'new', TMP_2, false, $Element)), $a.$$p = $iter, $a).apply($c, $zuper) }; }, TMP_2.$$arity = 1); self.$include((($scope.get('Event')).$$scope.get('Target'))); ($a = ($b = self).$target, $a.$$p = (TMP_3 = function(value){var self = TMP_3.$$s || this; if (value == null) value = nil; try {return self.$DOM(value) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return nil } else { throw $err; } }}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b); if ((($a = $scope.get('Browser')['$supports?']("Element.matches")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$=~', TMP_4 = function(selector) { var self = this; return self["native"].matches(selector); }, TMP_4.$$arity = 1) } else if ((($a = $scope.get('Browser')['$supports?']("Element.matches (Opera)")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$=~', TMP_5 = function(selector) { var self = this; return self["native"].oMatchesSelector(selector); }, TMP_5.$$arity = 1) } else if ((($a = $scope.get('Browser')['$supports?']("Element.matches (Internet Explorer)")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$=~', TMP_6 = function(selector) { var self = this; return self["native"].msMatchesSelector(selector); }, TMP_6.$$arity = 1) } else if ((($a = $scope.get('Browser')['$supports?']("Element.matches (Firefox)")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$=~', TMP_7 = function(selector) { var self = this; return self["native"].mozMatchesSelector(selector); }, TMP_7.$$arity = 1) } else if ((($a = $scope.get('Browser')['$supports?']("Element.matches (Chrome)")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$=~', TMP_8 = function(selector) { var self = this; return self["native"].webkitMatchesSelector(selector); }, TMP_8.$$arity = 1) } else if ((($a = $scope.get('Browser')['$loaded?']("Sizzle")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$=~', TMP_9 = function(selector) { var self = this; return Sizzle.matchesSelector(self["native"], selector); }, TMP_9.$$arity = 1) } else { Opal.defn(self, '$=~', TMP_10 = function(selector) { var self = this; return self.$raise($scope.get('NotImplementedError'), "selector matching unsupported"); }, TMP_10.$$arity = 1) }; Opal.defn(self, '$/', TMP_12 = function($a_rest) { var $b, $c, TMP_11, self = this, paths; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } paths = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { paths[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('NodeSet')['$[]'](($b = ($c = paths).$map, $b.$$p = (TMP_11 = function(path){var self = TMP_11.$$s || this; if (path == null) path = nil; return self.$xpath(path)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $b).call($c)); }, TMP_12.$$arity = -1); Opal.defn(self, '$[]', TMP_13 = function(name, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$attributes().$get(name, options); }, TMP_13.$$arity = -2); Opal.defn(self, '$[]=', TMP_14 = function(name, value, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$attributes().$set(name, value, options); }, TMP_14.$$arity = -3); Opal.defn(self, '$add_class', TMP_15 = function $$add_class($a_rest) { var $b, self = this, names, classes = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } classes = $rb_plus(self.$class_names(), names); if ((($b = classes['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { self["native"].className = classes.$uniq().$join(" "); }; return self; }, TMP_15.$$arity = -1); Opal.defn(self, '$at', TMP_16 = function $$at(path_or_selector) { var $a, self = this; return ((($a = self.$xpath(path_or_selector).$first()) !== false && $a !== nil && $a != null) ? $a : self.$css(path_or_selector).$first()); }, TMP_16.$$arity = 1); Opal.defn(self, '$at_css', TMP_18 = function $$at_css($a_rest) { var $b, $c, TMP_17, self = this, rules, result = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } rules = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { rules[$arg_idx - 0] = arguments[$arg_idx]; } result = nil; (function(){var $brk = Opal.new_brk(); try {return ($b = ($c = rules).$each, $b.$$p = (TMP_17 = function(rule){var self = TMP_17.$$s || this, $a; if (rule == null) rule = nil; if ((($a = result = self.$css(rule).$first()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.brk(nil, $brk) } else { return nil }}, TMP_17.$$s = self, TMP_17.$$brk = $brk, TMP_17.$$arity = 1, TMP_17), $b).call($c) } catch (err) { if (err === $brk) { return err.$v } else { throw err } }})(); return result; }, TMP_18.$$arity = -1); Opal.defn(self, '$at_xpath', TMP_20 = function $$at_xpath($a_rest) { var $b, $c, TMP_19, self = this, paths, result = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } paths = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { paths[$arg_idx - 0] = arguments[$arg_idx]; } result = nil; (function(){var $brk = Opal.new_brk(); try {return ($b = ($c = paths).$each, $b.$$p = (TMP_19 = function(path){var self = TMP_19.$$s || this, $a; if (path == null) path = nil; if ((($a = result = self.$xpath(path).$first()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.brk(nil, $brk) } else { return nil }}, TMP_19.$$s = self, TMP_19.$$brk = $brk, TMP_19.$$arity = 1, TMP_19), $b).call($c) } catch (err) { if (err === $brk) { return err.$v } else { throw err } }})(); return result; }, TMP_20.$$arity = -1); Opal.alias(self, 'attr', '[]'); Opal.alias(self, 'attribute', '[]'); Opal.defn(self, '$attributes', TMP_21 = function $$attributes(options) { var self = this; if (options == null) { options = $hash2([], {}); } return $scope.get('Attributes').$new(self, options); }, TMP_21.$$arity = -1); Opal.defn(self, '$attribute_nodes', TMP_22 = function $$attribute_nodes() { var self = this; return $scope.get('NodeSet')['$[]']((($scope.get('Native')).$$scope.get('Array')).$new(self["native"].attributes, $hash2(["get"], {"get": "item"}))); }, TMP_22.$$arity = 0); self.$alias_native("class_name", "className"); Opal.defn(self, '$class_names', TMP_23 = function $$class_names() { var $a, $b, self = this; return ($a = ($b = (self["native"].className).$split(/\s+/)).$reject, $a.$$p = "empty?".$to_proc(), $a).call($b); }, TMP_23.$$arity = 0); if ((($a = $scope.get('Browser')['$supports?']("Query.css")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$css', TMP_24 = function $$css(path) { var self = this; try { return $scope.get('NodeSet')['$[]']((($scope.get('Native')).$$scope.get('Array')).$new(self["native"].querySelectorAll(path))) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return $scope.get('NodeSet')['$[]']() } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_24.$$arity = 1) } else if ((($a = $scope.get('Browser')['$loaded?']("Sizzle")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$css', TMP_25 = function $$css(path) { var self = this; try { return $scope.get('NodeSet')['$[]'](Sizzle(path, self["native"])) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return $scope.get('NodeSet')['$[]']() } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_25.$$arity = 1) } else { Opal.defn(self, '$css', TMP_26 = function $$css(selector) { var self = this; return self.$raise($scope.get('NotImplementedError'), "query by CSS selector unsupported"); }, TMP_26.$$arity = 1) }; Opal.defn(self, '$data', TMP_27 = function $$data(value) { var $a, self = this, data = nil; if (value == null) { value = nil; } data = $scope.get('Data').$new(self); if (value !== false && value !== nil && value != null) { } else { return data }; if ((($a = $scope.get('Hash')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data.$assign(value) } else { self.$raise($scope.get('ArgumentError'), "unknown data type") }; return self; }, TMP_27.$$arity = -1); Opal.alias(self, 'get_attribute', '[]'); Opal.alias(self, 'get', '[]'); Opal.defn(self, '$height', TMP_28 = function $$height() { var self = this; return self.$size().$height(); }, TMP_28.$$arity = 0); Opal.defn(self, '$height=', TMP_29 = function(value) { var $a, $b, self = this; return (($a = [value]), $b = self.$size(), $b['$height='].apply($b, $a), $a[$a.length-1]); }, TMP_29.$$arity = 1); Opal.defn(self, '$id', TMP_30 = function $$id() { var self = this; var id = self["native"].id; if (id === "") { return nil; } else { return id; } ; }, TMP_30.$$arity = 0); Opal.defn(self, '$id=', TMP_31 = function(value) { var self = this; return self["native"].id = value.$to_s(); }, TMP_31.$$arity = 1); Opal.defn(self, '$inner_dom', TMP_32 = function $$inner_dom() { var $a, $b, self = this, $iter = TMP_32.$$p, block = $iter || nil, doc = nil; TMP_32.$$p = null; self.$clear(); doc = self.$document(); return self['$<<'](($a = ($b = $scope.get('Builder')).$new, $a.$$p = block.$to_proc(), $a).call($b, doc, self).$to_a()); }, TMP_32.$$arity = 0); Opal.defn(self, '$inner_dom=', TMP_33 = function(node) { var self = this; self.$clear(); return self['$<<'](node); }, TMP_33.$$arity = 1); Opal.defn(self, '$inspect', TMP_34 = function $$inspect() { var $a, self = this, inspect = nil; inspect = self.$name().$downcase(); if ((($a = self.$id()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { inspect = $rb_plus(inspect, $rb_plus($rb_plus(".", self.$id()), "!"))}; if ((($a = self.$class_names()['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { inspect = $rb_plus(inspect, $rb_plus(".", self.$class_names().$join("."))) }; return "#"; }, TMP_34.$$arity = 0); Opal.defn(self, '$offset', TMP_35 = function $$offset($a_rest) { var $b, self = this, values, off = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } values = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { values[$arg_idx - 0] = arguments[$arg_idx]; } off = $scope.get('Offset').$new(self); if ((($b = values['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { ($b = off).$set.apply($b, Opal.to_a(values)) }; return off; }, TMP_35.$$arity = -1); Opal.defn(self, '$offset=', TMP_36 = function(value) { var $a, self = this; return ($a = self.$offset()).$set.apply($a, Opal.to_a(value)); }, TMP_36.$$arity = 1); Opal.defn(self, '$position', TMP_37 = function $$position() { var self = this; return $scope.get('Position').$new(self); }, TMP_37.$$arity = 0); Opal.defn(self, '$scroll', TMP_38 = function $$scroll() { var self = this; return $scope.get('Scroll').$new(self); }, TMP_38.$$arity = 0); Opal.defn(self, '$search', TMP_40 = function $$search($a_rest) { var $b, $c, TMP_39, self = this, selectors; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } selectors = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { selectors[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('NodeSet').$new(($b = ($c = selectors).$map, $b.$$p = (TMP_39 = function(selector){var self = TMP_39.$$s || this; if (selector == null) selector = nil; return self.$xpath(selector).$to_a().$concat(self.$css(selector).$to_a())}, TMP_39.$$s = self, TMP_39.$$arity = 1, TMP_39), $b).call($c).$flatten().$uniq()); }, TMP_40.$$arity = -1); Opal.alias(self, 'set', '[]='); Opal.alias(self, 'set_attribute', '[]='); Opal.defn(self, '$style', TMP_41 = function $$style(data) { var $a, $b, self = this, $iter = TMP_41.$$p, block = $iter || nil, style = nil; if (data == null) { data = nil; } TMP_41.$$p = null; style = (($scope.get('CSS')).$$scope.get('Declaration')).$new(self["native"].style); if ((($a = ((($b = data) !== false && $b !== nil && $b != null) ? $b : block)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return style }; if ((($a = $scope.get('String')['$==='](data)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { style.$replace(data) } else if ((($a = $scope.get('Hash')['$==='](data)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { style.$assign(data) } else if (block !== false && block !== nil && block != null) { ($a = ($b = style).$apply, $a.$$p = block.$to_proc(), $a).call($b) } else { self.$raise($scope.get('ArgumentError'), "unknown data type") }; return self; }, TMP_41.$$arity = -1); if ((($a = $scope.get('Browser')['$supports?']("CSS.computed")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$style!', TMP_42 = function() { var self = this; return (($scope.get('CSS')).$$scope.get('Declaration')).$new(self.$window().$to_n().getComputedStyle(self["native"], null)); }, TMP_42.$$arity = 0) } else if ((($a = $scope.get('Browser')['$supports?']("CSS.current")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$style!', TMP_43 = function() { var self = this; return (($scope.get('CSS')).$$scope.get('Declaration')).$new(self["native"].currentStyle); }, TMP_43.$$arity = 0) } else { Opal.defn(self, '$style!', TMP_44 = function() { var self = this; return self.$raise($scope.get('NotImplementedError'), "computed style unsupported"); }, TMP_44.$$arity = 0) }; Opal.defn(self, '$remove_attribute', TMP_45 = function $$remove_attribute(name) { var self = this; return self["native"].removeAttribute(name); }, TMP_45.$$arity = 1); Opal.defn(self, '$remove_class', TMP_46 = function $$remove_class($a_rest) { var $b, self = this, names, classes = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { names[$arg_idx - 0] = arguments[$arg_idx]; } classes = $rb_minus(self.$class_names(), names); if ((($b = classes['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self["native"].removeAttribute('class'); } else { self["native"].className = classes.$join(" "); }; return self; }, TMP_46.$$arity = -1); Opal.defn(self, '$size', TMP_47 = function $$size($a_rest) { var $b, self = this, inc; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } inc = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { inc[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $scope.get('Size')).$new.apply($b, [self].concat(Opal.to_a(inc))); }, TMP_47.$$arity = -1); Opal.defn(self, '$width', TMP_48 = function $$width() { var self = this; return self.$size().$width(); }, TMP_48.$$arity = 0); Opal.defn(self, '$width=', TMP_49 = function(value) { var $a, $b, self = this; return (($a = [value]), $b = self.$size(), $b['$width='].apply($b, $a), $a[$a.length-1]); }, TMP_49.$$arity = 1); Opal.defn(self, '$window', TMP_50 = function $$window() { var self = this; return self.$document().$window(); }, TMP_50.$$arity = 0); if ((($a = ((($c = $scope.get('Browser')['$supports?']("Query.xpath")) !== false && $c !== nil && $c != null) ? $c : $scope.get('Browser')['$loaded?']("wicked-good-xpath"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $scope.get('Browser')['$loaded?']("wicked-good-xpath")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { wgxpath.install();}; return (Opal.defn(self, '$xpath', TMP_51 = function $$xpath(path) { var self = this; try { return $scope.get('NodeSet')['$[]']((($scope.get('Native')).$$scope.get('Array')).$new((self["native"].ownerDocument || self["native"]).evaluate(path, self["native"], null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null), $hash2(["get", "length"], {"get": "snapshotItem", "length": "snapshotLength"}))) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return $scope.get('NodeSet')['$[]']() } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_51.$$arity = 1), nil) && 'xpath'; } else { return (Opal.defn(self, '$xpath', TMP_52 = function $$xpath(path) { var self = this; return self.$raise($scope.get('NotImplementedError'), "query by XPath unsupported"); }, TMP_52.$$arity = 1), nil) && 'xpath' }; })($scope.base, $scope.get('Node')) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/document"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$DOM', '$first', '$css', '$xpath', '$[]', '$supports?', '$raise', '$ready?', '$call', '$on', '$off', '$convert', '$new']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Document(){}; var self = $Document = $klass($base, $super, 'Document', $Document); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, $a, TMP_8, TMP_10, TMP_12, TMP_13, TMP_14, TMP_15, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22; def["native"] = nil; Opal.defn(self, '$[]', TMP_1 = function(what) { var $a, self = this; var result = self["native"].getElementById(what); if (result) { return self.$DOM(result); } ; return ((($a = self.$css(what).$first()) !== false && $a !== nil && $a != null) ? $a : self.$xpath(what).$first()); }, TMP_1.$$arity = 1); Opal.alias(self, 'at', '[]'); Opal.defn(self, '$body', TMP_2 = function $$body() { var self = this; return self.$DOM(self["native"].body); }, TMP_2.$$arity = 0); Opal.defn(self, '$create_element', TMP_3 = function $$create_element(name, options) { var $a, self = this, ns = nil; if (options == null) { options = $hash2([], {}); } if ((($a = ns = options['$[]']("namespace")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$DOM(self["native"].createElementNS(ns, name)) } else { return self.$DOM(self["native"].createElement(name)) }; }, TMP_3.$$arity = -2); Opal.defn(self, '$create_text', TMP_4 = function $$create_text(content) { var self = this; return self.$DOM(self["native"].createTextNode(content)); }, TMP_4.$$arity = 1); Opal.defn(self, '$document', TMP_5 = function $$document() { var self = this; return self; }, TMP_5.$$arity = 0); Opal.defn(self, '$head', TMP_6 = function $$head() { var self = this; return self.$DOM(self["native"].getElementsByTagName("head")[0]); }, TMP_6.$$arity = 0); Opal.defn(self, '$inspect', TMP_7 = function $$inspect() { var self = this; return "#"; }, TMP_7.$$arity = 0); if ((($a = $scope.get('Browser')['$supports?']("Event.addListener")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$ready', TMP_8 = function $$ready() { var $a, $b, TMP_9, self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block given") }; if ((($a = self['$ready?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return block.$call()}; return ($a = ($b = self).$on, $a.$$p = (TMP_9 = function(e){var self = TMP_9.$$s || this; if (e == null) e = nil; e.$off(); return block.$call();}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $a).call($b, "dom:load"); }, TMP_8.$$arity = 0) } else if ((($a = $scope.get('Browser')['$supports?']("Event.attach")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$ready', TMP_10 = function $$ready() { var $a, $b, TMP_11, self = this, $iter = TMP_10.$$p, block = $iter || nil; TMP_10.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block given") }; if ((($a = self['$ready?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return block.$call()}; return ($a = ($b = self).$on, $a.$$p = (TMP_11 = function(e){var self = TMP_11.$$s || this, $c; if (e == null) e = nil; if ((($c = self['$ready?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { e.$off(); return block.$call(); } else { return nil }}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b, "ready:state:change"); }, TMP_10.$$arity = 0) } else { Opal.defn(self, '$ready', TMP_12 = function $$ready() { var self = this, $iter = TMP_12.$$p, block = $iter || nil; TMP_12.$$p = null; return self.$raise($scope.get('NotImplementedError'), "document ready unsupported"); }, TMP_12.$$arity = 0) }; Opal.defn(self, '$ready?', TMP_13 = function() { var self = this; return self["native"].readyState === "complete"; }, TMP_13.$$arity = 0); Opal.defn(self, '$root', TMP_14 = function $$root() { var self = this; return self.$DOM(self["native"].documentElement); }, TMP_14.$$arity = 0); Opal.defn(self, '$root=', TMP_15 = function(element) { var self = this; return self["native"].documentElement = $scope.get('Native').$convert(element); }, TMP_15.$$arity = 1); Opal.defn(self, '$style_sheets', TMP_17 = function $$style_sheets() { var $a, $b, TMP_16, self = this; return ($a = ($b = (($scope.get('Native')).$$scope.get('Array'))).$new, $a.$$p = (TMP_16 = function(e){var self = TMP_16.$$s || this; if (e == null) e = nil; return (($scope.get('CSS')).$$scope.get('StyleSheet')).$new(e)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b, self["native"].styleSheets); }, TMP_17.$$arity = 0); Opal.defn(self, '$title', TMP_18 = function $$title() { var self = this; return self["native"].title; }, TMP_18.$$arity = 0); Opal.defn(self, '$title=', TMP_19 = function(value) { var self = this; return self["native"].title = value; }, TMP_19.$$arity = 1); if ((($a = $scope.get('Browser')['$supports?']("Document.view")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (Opal.defn(self, '$window', TMP_20 = function $$window() { var self = this; return $scope.get('Window').$new(self["native"].defaultView); }, TMP_20.$$arity = 0), nil) && 'window' } else if ((($a = $scope.get('Browser')['$supports?']("Document.window")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (Opal.defn(self, '$window', TMP_21 = function $$window() { var self = this; return $scope.get('Window').$new(self["native"].parentWindow); }, TMP_21.$$arity = 0), nil) && 'window' } else { return (Opal.defn(self, '$window', TMP_22 = function $$window() { var self = this; return self.$raise($scope.get('NotImplementedError'), "window from document unsupported"); }, TMP_22.$$arity = 0), nil) && 'window' }; })($scope.base, $scope.get('Element')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/document_fragment"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DocumentFragment(){}; var self = $DocumentFragment = $klass($base, $super, 'DocumentFragment', $DocumentFragment); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Element')) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/builder"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$<<', '$[]=', '$to_h', '$[]', '$each', '$===', '$call', '$raise', '$attr_reader', '$new', '$to_proc', '$map', '$build', '$for', '$create_text', '$document', '$create_element', '$merge!', '$attributes', '$add_class', '$on', '$inner_html=']); (function($base) { var $Utils, self = $Utils = $module($base, 'Utils'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defs(self, '$heredoc', TMP_1 = function $$heredoc(string) { var self = this; return string; }, TMP_1.$$arity = 1) })($scope.get('Paggio')); (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope, TMP_2; def.on = nil; return (Opal.defn(self, '$on', TMP_2 = function $$on($a_rest) { var $b, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; return (((($b = self.on) !== false && $b !== nil && $b != null) ? $b : self.on = []))['$<<']([args, block]); }, TMP_2.$$arity = -1), nil) && 'on' })((($scope.get('Paggio')).$$scope.get('HTML')), $scope.get('BasicObject')); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_10, $c, TMP_11, $d, TMP_15; (function($base, $super) { function $Builder(){}; var self = $Builder = $klass($base, $super, 'Builder', $Builder); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_6, TMP_7, TMP_9; def.builder = def.roots = nil; Opal.defs(self, '$to_h', TMP_3 = function $$to_h() { var $a, self = this; if (self.builders == null) self.builders = nil; return ((($a = self.builders) !== false && $a !== nil && $a != null) ? $a : self.builders = $hash2([], {})); }, TMP_3.$$arity = 0); Opal.defs(self, '$for', TMP_4 = function(klass) { var self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; if (block !== false && block !== nil && block != null) { return self.$to_h()['$[]='](klass, block) } else { return self.$to_h()['$[]'](klass) }; }, TMP_4.$$arity = 1); Opal.defs(self, '$build', TMP_6 = function $$build(builder, item) {try { var $a, $b, TMP_5, self = this; ($a = ($b = self.$to_h()).$each, $a.$$p = (TMP_5 = function(klass, block){var self = TMP_5.$$s || this, $c; if (klass == null) klass = nil;if (block == null) block = nil; if ((($c = klass['$==='](item)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { Opal.ret(block.$call(builder, item)) } else { return nil }}, TMP_5.$$s = self, TMP_5.$$arity = 2, TMP_5), $a).call($b); return self.$raise($scope.get('ArgumentError'), "cannot build unknown item " + (item)); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_6.$$arity = 2); self.$attr_reader("document", "element"); Opal.defn(self, '$initialize', TMP_7 = function $$initialize(document) { var $a, $b, $c, TMP_8, self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; self.document = document; self.builder = ($a = ($b = (($scope.get('Paggio')).$$scope.get('HTML'))).$new, $a.$$p = block.$to_proc(), $a).call($b); return self.roots = ($a = ($c = self.builder.$each()).$map, $a.$$p = (TMP_8 = function(e){var self = TMP_8.$$s || this; if (e == null) e = nil; return $scope.get('Builder').$build(self, e)}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $a).call($c); }, TMP_7.$$arity = 1); return (Opal.defn(self, '$to_a', TMP_9 = function $$to_a() { var self = this; return self.roots; }, TMP_9.$$arity = 0), nil) && 'to_a'; })($scope.base, null); ($a = ($b = $scope.get('Builder')).$for, $a.$$p = (TMP_10 = function(b, item){var self = TMP_10.$$s || this; if (b == null) b = nil;if (item == null) item = nil; return b.$document().$create_text(item)}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $a).call($b, $scope.get('String')); ($a = ($c = $scope.get('Builder')).$for, $a.$$p = (TMP_11 = function(b, item){var self = TMP_11.$$s || this, $d, $e, TMP_12, $f, TMP_13, $g, TMP_14, dom = nil, on = nil, inner = nil; if (b == null) b = nil;if (item == null) item = nil; dom = b.$document().$create_element(item.name); if ((($d = $scope.get('Hash')['$==='](item.attributes)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { dom.$attributes()['$merge!'](item.attributes)}; ($d = ($e = (item.class_names)).$each, $d.$$p = (TMP_12 = function(value){var self = TMP_12.$$s || this; if (value == null) value = nil; return dom.$add_class(value)}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $d).call($e); if ((($d = on = item.on || nil) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { ($d = ($f = on).$each, $d.$$p = (TMP_13 = function(args, block){var self = TMP_13.$$s || this, $g, $h; if (args == null) args = nil;if (block == null) block = nil; return ($g = ($h = dom).$on, $g.$$p = block.$to_proc(), $g).apply($h, Opal.to_a(args))}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13), $d).call($f)}; if ((($d = inner = item.inner_html || nil) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { (($d = [inner]), $g = dom, $g['$inner_html='].apply($g, $d), $d[$d.length-1]) } else { ($d = ($g = item).$each, $d.$$p = (TMP_14 = function(child){var self = TMP_14.$$s || this; if (child == null) child = nil; return dom['$<<']($scope.get('Builder').$build(b, child))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $d).call($g) }; return dom;}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11), $a).call($c, (((($scope.get('Paggio')).$$scope.get('HTML'))).$$scope.get('Element'))); ($a = ($d = $scope.get('Builder')).$for, $a.$$p = (TMP_15 = function(b, item){var self = TMP_15.$$s || this; if (b == null) b = nil;if (item == null) item = nil; return item}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $a).call($d, (($scope.get('DOM')).$$scope.get('Node'))); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom/mutation_observer"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$supports?', '$include', '$===', '$==', '$type', '$new', '$[]', '$DOM', '$alias_native', '$call', '$map', '$convert', '$private', '$Native', '$[]=', '$to_n']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DOM, self = $DOM = $module($base, 'DOM'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MutationObserver(){}; var self = $MutationObserver = $klass($base, $super, 'MutationObserver', $MutationObserver); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_9, TMP_11, TMP_13, TMP_14, TMP_15; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("MutationObserver"); }, TMP_1.$$arity = 0); self.$include($scope.get('Native')); (function($base, $super) { function $Record(){}; var self = $Record = $klass($base, $super, 'Record', $Record); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$type', TMP_2 = function $$type() { var self = this, $case = nil; return (function() {$case = self["native"].type;if ("attributes"['$===']($case)) {return "attribute"}else if ("childList"['$===']($case)) {return "tree"}else if ("characterData"['$===']($case)) {return "cdata"}else { return nil }})(); }, TMP_2.$$arity = 0); Opal.defn(self, '$attribute?', TMP_3 = function() { var self = this; return self.$type()['$==']("attribute"); }, TMP_3.$$arity = 0); Opal.defn(self, '$tree?', TMP_4 = function() { var self = this; return self.$type()['$==']("tree"); }, TMP_4.$$arity = 0); Opal.defn(self, '$cdata?', TMP_5 = function() { var self = this; return self.$type()['$==']("cdata"); }, TMP_5.$$arity = 0); Opal.defn(self, '$added', TMP_6 = function $$added() { var $a, self = this, array = nil; array = (function() {if ((($a = self["native"].addedNodes != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Native')).$$scope.get('Array')).$new(self["native"].addedNodes) } else { return [] }; return nil; })(); return $scope.get('NodeSet')['$[]'](array); }, TMP_6.$$arity = 0); Opal.defn(self, '$removed', TMP_7 = function $$removed() { var $a, self = this, array = nil; array = (function() {if ((($a = self["native"].removedNodes != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Native')).$$scope.get('Array')).$new(self["native"].removedNodes) } else { return [] }; return nil; })(); return $scope.get('NodeSet')['$[]'](array); }, TMP_7.$$arity = 0); Opal.defn(self, '$target', TMP_8 = function $$target() { var self = this; return self.$DOM(self["native"].target); }, TMP_8.$$arity = 0); self.$alias_native("old", "oldValue"); self.$alias_native("name", "attributeName"); return self.$alias_native("namespace", "attributeNamespace"); })($scope.base, null); Opal.defn(self, '$initialize', TMP_9 = function $$initialize() { var $a, $b, TMP_10, $c, self = this, $iter = TMP_9.$$p, block = $iter || nil; TMP_9.$$p = null; var func = function(records) { return block.$call(($a = ($b = (records)).$map, $a.$$p = (TMP_10 = function(r){var self = TMP_10.$$s || this; if (r == null) r = nil; return (((((($scope.get('Browser')).$$scope.get('DOM'))).$$scope.get('MutationObserver'))).$$scope.get('Record')).$new(r)}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $a).call($b)); } ; return ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_9, false)), $a.$$p = null, $a).call($c, new window.MutationObserver(func)); }, TMP_9.$$arity = 0); Opal.defn(self, '$observe', TMP_11 = function $$observe(target, options) { var self = this; if (options == null) { options = nil; } if (options !== false && options !== nil && options != null) { } else { options = $hash2(["children", "tree", "attributes", "cdata"], {"children": true, "tree": true, "attributes": "old", "cdata": "old"}) }; self["native"].observe($scope.get('Native').$convert(target), self.$convert(options)); return self; }, TMP_11.$$arity = -2); Opal.defn(self, '$take', TMP_13 = function $$take() { var $a, $b, TMP_12, self = this; return ($a = ($b = (self["native"].takeRecords())).$map, $a.$$p = (TMP_12 = function(r){var self = TMP_12.$$s || this; if (r == null) r = nil; return $scope.get('Record').$new(r)}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($b); }, TMP_13.$$arity = 0); Opal.defn(self, '$disconnect', TMP_14 = function $$disconnect() { var self = this; return self["native"].disconnect(); }, TMP_14.$$arity = 0); self.$private(); return (Opal.defn(self, '$convert', TMP_15 = function $$convert(hash) { var $a, self = this, options = nil, attrs = nil, filter = nil, cdata = nil; options = self.$Native({}); if ((($a = hash['$[]']("children")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { options['$[]=']("childList", true)}; if ((($a = hash['$[]']("tree")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { options['$[]=']("subtree", true)}; if ((($a = attrs = hash['$[]']("attributes")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { options['$[]=']("attributes", true); if (attrs['$==']("old")) { options['$[]=']("attributeOldValue", true)};}; if ((($a = filter = hash['$[]']("filter")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { options['$[]=']("attributeFilter", filter)}; if ((($a = cdata = hash['$[]']("cdata")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { options['$[]=']("characterData", true); if (cdata['$==']("old")) { options['$[]=']("characterDataOldValue", true)};}; return options.$to_n(); }, TMP_15.$$arity = 1), nil) && 'convert'; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/dom"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $gvars = Opal.gvars, $klass = Opal.klass; if ($gvars.window == null) $gvars.window = nil; Opal.add_stubs(['$require', '$DOM', '$shift', '$to_a', '$new', '$to_proc', '$==', '$length', '$first', '$native?', '$===', '$try_convert', '$raise', '$document']); self.$require("browser/dom/node_set"); self.$require("browser/dom/node"); self.$require("browser/dom/attribute"); self.$require("browser/dom/character_data"); self.$require("browser/dom/text"); self.$require("browser/dom/cdata"); self.$require("browser/dom/comment"); self.$require("browser/dom/element"); self.$require("browser/dom/document"); self.$require("browser/dom/document_fragment"); self.$require("browser/dom/builder"); self.$require("browser/dom/mutation_observer"); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; Opal.defn(self, '$XML', TMP_1 = function $$XML(what) { var self = this; var doc; if (window.DOMParser) { doc = new DOMParser().parseFromString(what, 'text/xml'); } else { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = 'false'; doc.loadXML(what); } return self.$DOM(doc); }, TMP_1.$$arity = 1); Opal.defn(self, '$DOM', TMP_2 = function $$DOM($a_rest) { var $b, $c, self = this, args, $iter = TMP_2.$$p, block = $iter || nil, document = nil, roots = nil, what = nil; if ($gvars.document == null) $gvars.document = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; if (block !== false && block !== nil && block != null) { document = ((($b = args.$shift()) !== false && $b !== nil && $b != null) ? $b : $gvars.document); roots = ($b = ($c = (((($scope.get('Browser')).$$scope.get('DOM'))).$$scope.get('Builder'))).$new, $b.$$p = block.$to_proc(), $b).call($c, document).$to_a(); if (roots.$length()['$=='](1)) { return roots.$first() } else { return (((($scope.get('Browser')).$$scope.get('DOM'))).$$scope.get('NodeSet')).$new(roots) }; } else { what = args.$shift(); document = ((($b = args.$shift()) !== false && $b !== nil && $b != null) ? $b : $gvars.document); if ((($b = self['$native?'](what)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return (((($scope.get('Browser')).$$scope.get('DOM'))).$$scope.get('Node')).$new(what) } else if ((($b = (((($scope.get('Browser')).$$scope.get('DOM'))).$$scope.get('Node'))['$==='](what)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return what } else if ((($b = $scope.get('String')['$==='](what)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { var doc = $scope.get('Native').$try_convert(document).createElement('div'); doc.innerHTML = what; return self.$DOM(doc.childNodes.length == 1 ? doc.childNodes[0] : doc); ; } else { return self.$raise($scope.get('ArgumentError'), "argument not DOM convertible") }; }; }, TMP_2.$$arity = -1); })($scope.base); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope, TMP_3; def["native"] = nil; return (Opal.defn(self, '$document', TMP_3 = function $$document() { var self = this; return self.$DOM(self["native"].document); }, TMP_3.$$arity = 0), nil) && 'document' })($scope.base, null) })($scope.base); return $gvars.document = $gvars.window.$document(); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/css/declaration"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$include', '$new', '$each', '$[]=', '$important', '$name', '$value', '$to_proc', '$to_s', '$enum_for', '$[]', '$alias_native', '$end_with?']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $CSS, self = $CSS = $module($base, 'CSS'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Declaration(){}; var self = $Declaration = $klass($base, $super, 'Declaration', $Declaration); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, TMP_4, TMP_5, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; def["native"] = nil; self.$include($scope.get('Native')); self.$include($scope.get('Enumerable')); Opal.defn(self, '$rule', TMP_1 = function $$rule() { var $a, self = this; if ((($a = (typeof(self["native"].parentRule) !== "undefined")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Rule').$new(self["native"].parentRule) } else { return nil }; }, TMP_1.$$arity = 0); Opal.defn(self, '$assign', TMP_3 = function $$assign(data) { var $a, $b, TMP_2, self = this; ($a = ($b = data).$each, $a.$$p = (TMP_2 = function(name, value){var self = TMP_2.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return self['$[]='](name, value)}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $a).call($b); return self; }, TMP_3.$$arity = 1); Opal.defn(self, '$replace', TMP_4 = function $$replace(string) { var self = this; return self["native"].cssText = string; }, TMP_4.$$arity = 1); Opal.defn(self, '$apply', TMP_5 = function $$apply() { var $a, $b, TMP_6, $c, $d, self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; return ($a = ($b = ($c = ($d = (((($scope.get('Paggio')).$$scope.get('CSS'))).$$scope.get('Definition'))).$new, $c.$$p = block.$to_proc(), $c).call($d)).$each, $a.$$p = (TMP_6 = function(style){var self = TMP_6.$$s || this, $c; if (self["native"] == null) self["native"] = nil; if (style == null) style = nil; if ((($c = style.$important()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self["native"].setProperty(style.$name(), style.$value(), "important"); } else { return self["native"].setProperty(style.$name(), style.$value(), ""); }}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b); }, TMP_5.$$arity = 0); Opal.defn(self, '$delete', TMP_7 = function(name) { var self = this; return self["native"].removeProperty(name); }, TMP_7.$$arity = 1); Opal.defn(self, '$[]', TMP_8 = function(name) { var self = this; var result = self["native"].getPropertyValue(name); if (result == null || result === "") { return nil; } return result; ; }, TMP_8.$$arity = 1); Opal.defn(self, '$[]=', TMP_9 = function(name, value) { var self = this; return self["native"].setProperty(name, value.$to_s(), ""); }, TMP_9.$$arity = 2); Opal.defn(self, '$important?', TMP_10 = function(name) { var self = this; return self["native"].getPropertyPriority(name) == "important"; }, TMP_10.$$arity = 1); Opal.defn(self, '$each', TMP_11 = function $$each() { var self = this, $iter = TMP_11.$$p, block = $iter || nil; TMP_11.$$p = null; if ((block !== nil)) { } else { return self.$enum_for("each") }; for (var i = 0, length = self["native"].length; i < length; i++) { var name = self["native"].item(i); Opal.yieldX(block, [name, self['$[]'](name)]) } ; return self; }, TMP_11.$$arity = 0); self.$alias_native("length"); self.$alias_native("to_s", "cssText"); return (Opal.defn(self, '$method_missing', TMP_12 = function $$method_missing(name, value) { var $a, self = this; if (value == null) { value = nil; } if ((($a = name['$end_with?']("=")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self['$[]='](name['$[]']($range(0, -2, false)), value) } else { return self['$[]'](name) }; }, TMP_12.$$arity = -2), nil) && 'method_missing'; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/css/style_sheet"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$is_a?', '$to_n', '$alias_native', '$new', '$DOM', '$===', '$join', '$map', '$insert', '$length', '$find', '$log', '$==', '$id', '$rules', '$__send__', '$to_proc']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $CSS, self = $CSS = $module($base, 'CSS'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StyleSheet(){}; var self = $StyleSheet = $klass($base, $super, 'StyleSheet', $StyleSheet); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_6, TMP_7, TMP_8, TMP_10, TMP_12, TMP_13; def["native"] = nil; self.$include($scope.get('Native')); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(what) { var $a, $b, $c, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; if ((($a = what['$is_a?']((($scope.get('DOM')).$$scope.get('Element')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $a.$$p = null, $a).call($b, what.$to_n().sheet) } else { return ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $a.$$p = null, $a).call($c, what) }; }, TMP_1.$$arity = 1); self.$alias_native("disabled?", "disabled"); self.$alias_native("href"); self.$alias_native("title"); self.$alias_native("type"); Opal.defn(self, '$media', TMP_2 = function $$media() { var $a, self = this; if ((($a = self["native"].media != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Media').$new(self["native"].media) } else { return nil }; }, TMP_2.$$arity = 0); Opal.defn(self, '$owner', TMP_3 = function $$owner() { var self = this; return self.$DOM(self["native"].ownerNode); }, TMP_3.$$arity = 0); Opal.defn(self, '$parent', TMP_4 = function $$parent() { var $a, self = this; if ((($a = self["native"].parentStyleSheet != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Sheet').$new(self["native"].parentStyleSheet) } else { return nil }; }, TMP_4.$$arity = 0); Opal.defn(self, '$rules', TMP_6 = function $$rules() { var $a, $b, TMP_5, self = this; return ($a = ($b = (($scope.get('Native')).$$scope.get('Array'))).$new, $a.$$p = (TMP_5 = function(e){var self = TMP_5.$$s || this; if (e == null) e = nil; return $scope.get('Rule').$new(e)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($b, self["native"].cssRules); }, TMP_6.$$arity = 0); Opal.defn(self, '$delete', TMP_7 = function(index) { var self = this; return self["native"].deleteRule(index); }, TMP_7.$$arity = 1); Opal.defn(self, '$insert', TMP_8 = function $$insert(index, rule) { var self = this; return self["native"].insertRule(rule, index); }, TMP_8.$$arity = 2); Opal.defn(self, '$rule', TMP_10 = function $$rule(selector, body) { var $a, $b, TMP_9, self = this; if ((($a = $scope.get('String')['$==='](selector)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { selector = selector.$join(", ") }; if ((($a = $scope.get('String')['$==='](body)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { body = ($a = ($b = body).$map, $a.$$p = (TMP_9 = function(name, value){var self = TMP_9.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return "" + (name) + ": " + (value) + ";"}, TMP_9.$$s = self, TMP_9.$$arity = 2, TMP_9), $a).call($b).$join("\n") }; return self.$insert(self.$length(), "" + (selector) + " { " + (body) + " }"); }, TMP_10.$$arity = 2); Opal.defn(self, '$[]', TMP_12 = function(id) { var $a, $b, TMP_11, self = this; return ($a = ($b = self.$rules()).$find, $a.$$p = (TMP_11 = function(r){var self = TMP_11.$$s || this; if (r == null) r = nil; self.$log(r); return r.$id()['$=='](id);}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b); }, TMP_12.$$arity = 1); Opal.defn(self, '$method_missing', TMP_13 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_13.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_13.$$p = null; return ($b = ($c = self.$rules()).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_13.$$arity = -1); return (function($base, $super) { function $Media(){}; var self = $Media = $klass($base, $super, 'Media', $Media); var def = self.$$proto, $scope = self.$$scope, TMP_14, TMP_15; def["native"] = nil; self.$alias_native("text", "mediaText"); self.$alias_native("to_s", "mediaText"); Opal.defn(self, '$push', TMP_14 = function $$push(medium) { var self = this; self["native"].appendMedium(medium); return self; }, TMP_14.$$arity = 1); return (Opal.defn(self, '$delete', TMP_15 = function(medium) { var self = this; return self["native"].deleteMedium(medium); }, TMP_15.$$arity = 1), nil) && 'delete'; })($scope.base, (($scope.get('Native')).$$scope.get('Array'))); })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/css/rule"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$==', '$[]', '$new', '$raise', '$alias_native']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $CSS, self = $CSS = $module($base, 'CSS'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Rule(){}; var self = $Rule = $klass($base, $super, 'Rule', $Rule); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def["native"] = nil; self.$include($scope.get('Native')); Opal.cdecl($scope, 'STYLE_RULE', 1); Opal.cdecl($scope, 'CHARSET_RULE', 2); Opal.cdecl($scope, 'IMPORT_RULE', 3); Opal.cdecl($scope, 'MEDIA_RULE', 4); Opal.cdecl($scope, 'FONT_FACE_RULE', 5); Opal.cdecl($scope, 'PAGE_RULE', 6); Opal.cdecl($scope, 'KEYFRAMES_RULE', 7); Opal.cdecl($scope, 'KEYFRAME_RULE', 8); Opal.cdecl($scope, 'NAMESPACE_RULE', 10); Opal.cdecl($scope, 'COUNTER_STYLE_RULE', 11); Opal.cdecl($scope, 'SUPPORTS_RULE', 12); Opal.cdecl($scope, 'DOCUMENT_RULE', 13); Opal.cdecl($scope, 'FONT_FEATURE_VALUES_RULE', 14); Opal.cdecl($scope, 'VIEWPORT_RULE', 15); Opal.cdecl($scope, 'REGION_STYLE_RULE', 16); Opal.defs(self, '$new', TMP_1 = function(rule) { var $a, $b, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, klass = nil; if (self.classes == null) self.classes = nil; TMP_1.$$p = null; if (self['$==']($scope.get('Rule'))) { ((($a = self.classes) !== false && $a !== nil && $a != null) ? $a : self.classes = [nil, $scope.get('Style')]); if ((($a = klass = self.classes['$[]'](rule.type)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return klass.$new(rule) } else { return self.$raise($scope.get('ArgumentError'), "cannot instantiate a non derived Rule object") }; } else { return ($a = ($b = self, Opal.find_super_dispatcher(self, 'new', TMP_1, false, $Rule)), $a.$$p = null, $a).call($b, rule) }; }, TMP_1.$$arity = 1); self.$alias_native("text", "cssText"); self.$alias_native("to_s", "cssText"); Opal.defn(self, '$parent', TMP_2 = function $$parent() { var $a, self = this; if ((($a = self["native"].parentRule != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Rule').$new(self["native"].parentRule) } else { return nil }; }, TMP_2.$$arity = 0); return (Opal.defn(self, '$style_sheet', TMP_3 = function $$style_sheet() { var $a, self = this; if ((($a = self["native"].parentStyleSheet != null) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('StyleSheet').$new(self["native"].parentStyleSheet) } else { return nil }; }, TMP_3.$$arity = 0), nil) && 'style_sheet'; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/css/rule/style"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$alias_native', '$new', '$__send__', '$to_proc', '$declaration']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $CSS, self = $CSS = $module($base, 'CSS'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Rule(){}; var self = $Rule = $klass($base, $super, 'Rule', $Rule); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Style(){}; var self = $Style = $klass($base, $super, 'Style', $Style); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def["native"] = nil; self.$alias_native("selector", "selectorText"); self.$alias_native("id", "selectorText"); Opal.defn(self, '$declaration', TMP_1 = function $$declaration() { var self = this; return $scope.get('Declaration').$new(self["native"].style); }, TMP_1.$$arity = 0); return (Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing($a_rest) { var $b, $c, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; return ($b = ($c = self.$declaration()).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_2.$$arity = -1), nil) && 'method_missing'; })($scope.base, $scope.get('Rule')) })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/css"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$create_element', '$[]=', '$inner_text=', '$css', '$to_proc']); self.$require("browser/css/declaration"); self.$require("browser/css/style_sheet"); self.$require("browser/css/rule"); self.$require("browser/css/rule/style"); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defn(self, '$CSS', TMP_1 = function $$CSS(text) { var $a, $b, $c, $d, self = this, $iter = TMP_1.$$p, block = $iter || nil, style = nil; if ($gvars.document == null) $gvars.document = nil; if (text == null) { text = nil; } TMP_1.$$p = null; style = $gvars.document.$create_element("style"); style['$[]=']("type", "text/css"); if (block !== false && block !== nil && block != null) { (($a = [($c = ($d = $scope.get('Paggio')).$css, $c.$$p = block.$to_proc(), $c).call($d)]), $b = style, $b['$inner_text='].apply($b, $a), $a[$a.length-1]) } else { (($a = [text]), $b = style, $b['$inner_text='].apply($b, $a), $a[$a.length-1]) }; return style; }, TMP_1.$$arity = -1) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("native"); self.$require("paggio"); self.$require("browser/version"); self.$require("browser/utils"); self.$require("browser/support"); self.$require("browser/event"); self.$require("browser/window"); self.$require("browser/dom"); return self.$require("browser/css"); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/socket"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$supports?', '$include', '$target', '$is_a?', '$new', '$native?', '$to_s', '$to_n', '$==', '$arity', '$instance_exec', '$to_proc', '$call', '$alias_native', '$split', '$state']); return (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Socket(){}; var self = $Socket = $klass($base, $super, 'Socket', $Socket); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, $b, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9; def["native"] = nil; Opal.defs(self, '$supported?', TMP_1 = function() { var self = this; return $scope.get('Browser')['$supports?']("WebSocket"); }, TMP_1.$$arity = 0); self.$include($scope.get('Native')); self.$include((($scope.get('IO')).$$scope.get('Writable'))); self.$include((($scope.get('Event')).$$scope.get('Target'))); ($a = ($b = self).$target, $a.$$p = (TMP_2 = function(value){var self = TMP_2.$$s || this, $c; if (value == null) value = nil; if ((($c = $scope.get('Native')['$is_a?'](value, window.WebSocket)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return $scope.get('Socket').$new(value) } else { return nil }}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(url, protocol) { var $a, $b, $c, $d, $e, self = this, $iter = TMP_3.$$p, block = $iter || nil; if (protocol == null) { protocol = nil; } TMP_3.$$p = null; if ((($a = self['$native?'](url)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($b, url) } else if (protocol !== false && protocol !== nil && protocol != null) { ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($c, new window.WebSocket(url.$to_s(), protocol.$to_n())) } else { ($a = ($d = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($d, new window.WebSocket(url.$to_s())) }; if (block !== false && block !== nil && block != null) { if (block.$arity()['$=='](0)) { return ($a = ($e = self).$instance_exec, $a.$$p = block.$to_proc(), $a).call($e) } else { return block.$call(self) } } else { return nil }; }, TMP_3.$$arity = -2); self.$alias_native("protocol"); self.$alias_native("url"); self.$alias_native("buffered", "bufferedAmount"); Opal.defn(self, '$type', TMP_4 = function $$type() { var self = this; switch (self["native"].binaryType) { case "blob": return "blob"; case "arraybuffer": return "buffer"; default: return "string"; } ; }, TMP_4.$$arity = 0); Opal.defn(self, '$state', TMP_5 = function $$state() { var self = this; switch (self["native"].readyState) { case window.WebSocket.CONNECTING: return "connecting"; case window.WebSocket.OPEN: return "open"; case window.WebSocket.CLOSING: return "closing"; case window.WebSocket.CLOSED: return "closed"; } ; }, TMP_5.$$arity = 0); Opal.defn(self, '$extensions', TMP_6 = function $$extensions() { var self = this; return (self["native"].extensions).$split(/\s*,\s*/); }, TMP_6.$$arity = 0); Opal.defn(self, '$alive?', TMP_7 = function() { var self = this; return self.$state()['$==']("open"); }, TMP_7.$$arity = 0); Opal.defn(self, '$write', TMP_8 = function $$write(data) { var self = this; return self["native"].send(data.$to_n()); }, TMP_8.$$arity = 1); Opal.alias(self, '<<', 'write'); Opal.alias(self, 'send', 'write'); return (Opal.defn(self, '$close', TMP_9 = function $$close(code, reason) { var self = this; if (code == null) { code = nil; } if (reason == null) { reason = nil; } return self["native"].close(code.$to_n(), reason.$to_n()); }, TMP_9.$$arity = -1), nil) && 'close'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/interval"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$attr_reader', '$convert', '$nil?', '$stopped?', '$aborted?', '$raise', '$call', '$tap', '$to_proc', '$new', '$every', '$every!']); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Interval(){}; var self = $Interval = $klass($base, $super, 'Interval', $Interval); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; def.id = def.aborted = def.window = def.block = def.every = nil; self.$attr_reader("every"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(window, time) { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; self.window = $scope.get('Native').$convert(window); self.every = time; self.block = block; return self.aborted = false; }, TMP_1.$$arity = 2); Opal.defn(self, '$stopped?', TMP_2 = function() { var self = this; return self.id['$nil?'](); }, TMP_2.$$arity = 0); Opal.defn(self, '$aborted?', TMP_3 = function() { var self = this; return self.aborted; }, TMP_3.$$arity = 0); Opal.defn(self, '$abort', TMP_4 = function $$abort() { var self = this; self.window.clearInterval(self.id); self.aborted = true; return self.id = nil; }, TMP_4.$$arity = 0); Opal.defn(self, '$stop', TMP_5 = function $$stop() { var $a, self = this; if ((($a = self['$stopped?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; self.window.clearInterval(self.id); self.stopped = true; return self.id = nil; }, TMP_5.$$arity = 0); Opal.defn(self, '$start', TMP_6 = function $$start() { var $a, self = this; if ((($a = self['$aborted?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise("the interval has been aborted")}; if ((($a = self['$stopped?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; return self.id = self.window.setInterval(self.block, self.every * 1000); }, TMP_6.$$arity = 0); return (Opal.defn(self, '$call', TMP_7 = function $$call() { var self = this; return self.block.$call(); }, TMP_7.$$arity = 0), nil) && 'call'; })($scope.base, null); (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9; def["native"] = nil; Opal.defn(self, '$every', TMP_8 = function $$every(time) { var $a, $b, $c, $d, self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; return ($a = ($b = ($c = ($d = $scope.get('Interval')).$new, $c.$$p = block.$to_proc(), $c).call($d, self["native"], time)).$tap, $a.$$p = "start".$to_proc(), $a).call($b); }, TMP_8.$$arity = 1); return (Opal.defn(self, '$every!', TMP_9 = function(time) { var $a, $b, self = this, $iter = TMP_9.$$p, block = $iter || nil; TMP_9.$$p = null; return ($a = ($b = $scope.get('Interval')).$new, $a.$$p = block.$to_proc(), $a).call($b, self["native"], time); }, TMP_9.$$arity = 1), nil) && 'every!'; })($scope.base, null); })($scope.base); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_10, TMP_11; Opal.defn(self, '$every', TMP_10 = function $$every(time) { var $a, $b, self = this, $iter = TMP_10.$$p, block = $iter || nil; if ($gvars.window == null) $gvars.window = nil; TMP_10.$$p = null; return ($a = ($b = $gvars.window).$every, $a.$$p = block.$to_proc(), $a).call($b, time); }, TMP_10.$$arity = 1); Opal.defn(self, '$every!', TMP_11 = function(time) { var $a, $b, self = this, $iter = TMP_11.$$p, block = $iter || nil; if ($gvars.window == null) $gvars.window = nil; TMP_11.$$p = null; return ($a = ($b = $gvars.window)['$every!'], $a.$$p = block.$to_proc(), $a).call($b, time); }, TMP_11.$$arity = 1); })($scope.base); return (function($base, $super) { function $Proc(){}; var self = $Proc = $klass($base, $super, 'Proc', $Proc); var def = self.$$proto, $scope = self.$$scope, TMP_12, TMP_13; Opal.defn(self, '$every', TMP_12 = function $$every(time) { var $a, $b, self = this; if ($gvars.window == null) $gvars.window = nil; return ($a = ($b = $gvars.window).$every, $a.$$p = self.$to_proc(), $a).call($b, time); }, TMP_12.$$arity = 1); return (Opal.defn(self, '$every!', TMP_13 = function(time) { var $a, $b, self = this; if ($gvars.window == null) $gvars.window = nil; return ($a = ($b = $gvars.window)['$every!'], $a.$$p = self.$to_proc(), $a).call($b, time); }, TMP_13.$$arity = 1), nil) && 'every!'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["browser/delay"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$attr_reader', '$convert', '$to_n', '$tap', '$to_proc', '$new', '$after', '$after!']); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Delay(){}; var self = $Delay = $klass($base, $super, 'Delay', $Delay); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def.window = def.id = def.block = def.after = nil; self.$attr_reader("after"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(window, time) { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; self.window = $scope.get('Native').$convert(window); self.after = time; return self.block = block; }, TMP_1.$$arity = 2); Opal.defn(self, '$abort', TMP_2 = function $$abort() { var self = this; return self.window.clearTimeout(self.id); }, TMP_2.$$arity = 0); return (Opal.defn(self, '$start', TMP_3 = function $$start() { var self = this; return self.id = self.window.setTimeout(self.block.$to_n(), self.after * 1000); }, TMP_3.$$arity = 0), nil) && 'start'; })($scope.base, null); (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope, TMP_4, TMP_5; def["native"] = nil; Opal.defn(self, '$after', TMP_4 = function $$after(time) { var $a, $b, $c, $d, self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; return ($a = ($b = ($c = ($d = $scope.get('Delay')).$new, $c.$$p = block.$to_proc(), $c).call($d, self["native"], time)).$tap, $a.$$p = "start".$to_proc(), $a).call($b); }, TMP_4.$$arity = 1); return (Opal.defn(self, '$after!', TMP_5 = function(time) { var $a, $b, self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; return ($a = ($b = $scope.get('Delay')).$new, $a.$$p = block.$to_proc(), $a).call($b, self["native"], time); }, TMP_5.$$arity = 1), nil) && 'after!'; })($scope.base, null); })($scope.base); (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_6, TMP_7; Opal.defn(self, '$after', TMP_6 = function $$after(time) { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; if ($gvars.window == null) $gvars.window = nil; TMP_6.$$p = null; return ($a = ($b = $gvars.window).$after, $a.$$p = block.$to_proc(), $a).call($b, time); }, TMP_6.$$arity = 1); Opal.defn(self, '$after!', TMP_7 = function(time) { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; if ($gvars.window == null) $gvars.window = nil; TMP_7.$$p = null; return ($a = ($b = $gvars.window)['$after!'], $a.$$p = block.$to_proc(), $a).call($b, time); }, TMP_7.$$arity = 1); })($scope.base); return (function($base, $super) { function $Proc(){}; var self = $Proc = $klass($base, $super, 'Proc', $Proc); var def = self.$$proto, $scope = self.$$scope, TMP_8, TMP_9; Opal.defn(self, '$after', TMP_8 = function $$after(time) { var $a, $b, self = this; if ($gvars.window == null) $gvars.window = nil; return ($a = ($b = $gvars.window).$after, $a.$$p = self.$to_proc(), $a).call($b, time); }, TMP_8.$$arity = 1); return (Opal.defn(self, '$after!', TMP_9 = function(time) { var $a, $b, self = this; if ($gvars.window == null) $gvars.window = nil; return ($a = ($b = $gvars.window)['$after!'], $a.$$p = self.$to_proc(), $a).call($b, time); }, TMP_9.$$arity = 1), nil) && 'after!'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/constants"] = function(Opal) { var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require', '$raise']); self.$require("native"); if ((($a = ($scope.JQUERY_CLASS != null)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return (function() {if ((($a = !!Opal.global.jQuery) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {return Opal.cdecl($scope, 'JQUERY_CLASS', Opal.cdecl($scope, 'JQUERY_SELECTOR', Opal.global.jQuery))}else if ((($a = !!Opal.global.Zepto) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {Opal.cdecl($scope, 'JQUERY_SELECTOR', Opal.global.Zepto); return Opal.cdecl($scope, 'JQUERY_CLASS', Opal.global.Zepto.zepto.Z);}else {return self.$raise($scope.get('NameError'), "Can't find jQuery or Zepto. jQuery must be included before opal-jquery")}})() }; }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/element"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$to_n', '$include', '$each', '$alias_native', '$attr_reader', '$nil?', '$[]', '$[]=', '$raise', '$is_a?', '$has_key?', '$delete', '$call', '$gsub', '$upcase', '$compact', '$map', '$respond_to?', '$<<', '$Native', '$new']); self.$require("native"); self.$require("opal/jquery/constants"); return (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45; var $ = $scope.get('JQUERY_SELECTOR').$to_n(); self.$include($scope.get('Enumerable')); Opal.defs(self, '$find', TMP_1 = function $$find(selector) { var self = this; return $(selector); }, TMP_1.$$arity = 1); Opal.defs(self, '$[]', TMP_2 = function(selector) { var self = this; return $(selector); }, TMP_2.$$arity = 1); Opal.defs(self, '$id', TMP_3 = function $$id(id) { var self = this; var el = document.getElementById(id); if (!el) { return nil; } return $(el); }, TMP_3.$$arity = 1); Opal.defs(self, '$new', TMP_4 = function(tag) { var self = this; if (tag == null) { tag = "div"; } return $(document.createElement(tag)); }, TMP_4.$$arity = -1); Opal.defs(self, '$parse', TMP_5 = function $$parse(str) { var self = this; return $.parseHTML ? $($.parseHTML(str)) : $(str); }, TMP_5.$$arity = 1); Opal.defs(self, '$expose', TMP_7 = function $$expose($a_rest) { var $b, $c, TMP_6, self = this, methods; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } methods = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { methods[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = methods).$each, $b.$$p = (TMP_6 = function(method){var self = TMP_6.$$s || this; if (method == null) method = nil; return self.$alias_native(method)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $b).call($c); }, TMP_7.$$arity = -1); self.$attr_reader("selector"); self.$alias_native("after"); self.$alias_native("before"); self.$alias_native("parent"); self.$alias_native("parents"); self.$alias_native("prev"); self.$alias_native("remove"); self.$alias_native("hide"); self.$alias_native("show"); self.$alias_native("toggle"); self.$alias_native("children"); self.$alias_native("blur"); self.$alias_native("closest"); self.$alias_native("detach"); self.$alias_native("focus"); self.$alias_native("find"); self.$alias_native("next"); self.$alias_native("siblings"); self.$alias_native("text"); self.$alias_native("trigger"); self.$alias_native("append"); self.$alias_native("prepend"); self.$alias_native("serialize"); self.$alias_native("is"); self.$alias_native("filter"); self.$alias_native("not"); self.$alias_native("last"); self.$alias_native("wrap"); self.$alias_native("stop"); self.$alias_native("clone"); self.$alias_native("empty"); self.$alias_native("get"); self.$alias_native("prop"); Opal.alias(self, 'succ', 'next'); Opal.alias(self, '<<', 'append'); self.$alias_native("add_class", "addClass"); self.$alias_native("append_to", "appendTo"); self.$alias_native("has_class?", "hasClass"); self.$alias_native("html=", "html"); self.$alias_native("index"); self.$alias_native("is?", "is"); self.$alias_native("remove_attr", "removeAttr"); self.$alias_native("remove_class", "removeClass"); self.$alias_native("submit"); self.$alias_native("text=", "text"); self.$alias_native("toggle_class", "toggleClass"); self.$alias_native("value=", "val"); self.$alias_native("scroll_top=", "scrollTop"); self.$alias_native("scroll_top", "scrollTop"); self.$alias_native("scroll_left=", "scrollLeft"); self.$alias_native("scroll_left", "scrollLeft"); self.$alias_native("remove_attribute", "removeAttr"); self.$alias_native("slide_down", "slideDown"); self.$alias_native("slide_up", "slideUp"); self.$alias_native("slide_toggle", "slideToggle"); self.$alias_native("fade_toggle", "fadeToggle"); self.$alias_native("height=", "height"); self.$alias_native("width=", "width"); self.$alias_native("outer_width", "outerWidth"); self.$alias_native("outer_height", "outerHeight"); Opal.defn(self, '$to_n', TMP_8 = function $$to_n() { var self = this; return self; }, TMP_8.$$arity = 0); Opal.defn(self, '$[]', TMP_9 = function(name) { var self = this; var value = self.attr(name); if(value === undefined) return nil; return value; }, TMP_9.$$arity = 1); Opal.defn(self, '$[]=', TMP_10 = function(name, value) { var $a, self = this; if ((($a = value['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.removeAttr(name);}; return self.attr(name, value); }, TMP_10.$$arity = 2); Opal.defn(self, '$attr', TMP_11 = function $$attr($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } var size = args.length; switch (size) { case 1: return self['$[]'](args[0]); break; case 2: return self['$[]='](args[0], args[1]); break; default: self.$raise($scope.get('ArgumentError'), "#attr only accepts 1 or 2 arguments") } ; }, TMP_11.$$arity = -1); Opal.defn(self, '$has_attribute?', TMP_12 = function(name) { var self = this; return self.attr(name) !== undefined; }, TMP_12.$$arity = 1); Opal.defn(self, '$append_to_body', TMP_13 = function $$append_to_body() { var self = this; return self.appendTo(document.body); }, TMP_13.$$arity = 0); Opal.defn(self, '$append_to_head', TMP_14 = function $$append_to_head() { var self = this; return self.appendTo(document.head); }, TMP_14.$$arity = 0); Opal.defn(self, '$at', TMP_15 = function $$at(index) { var self = this; var length = self.length; if (index < 0) { index += length; } if (index < 0 || index >= length) { return nil; } return $(self[index]); }, TMP_15.$$arity = 1); Opal.defn(self, '$class_name', TMP_16 = function $$class_name() { var self = this; var first = self[0]; return (first && first.className) || ""; }, TMP_16.$$arity = 0); Opal.defn(self, '$class_name=', TMP_17 = function(name) { var self = this; for (var i = 0, length = self.length; i < length; i++) { self[i].className = name; } return self; }, TMP_17.$$arity = 1); Opal.defn(self, '$css', TMP_18 = function $$css(name, value) { var $a, $b, self = this; if (value == null) { value = nil; } if ((($a = ($b = value['$nil?'](), $b !== false && $b !== nil && $b != null ?name['$is_a?']($scope.get('String')) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.css(name) } else if ((($a = name['$is_a?']($scope.get('Hash'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.css(name.$to_n()); } else { self.css(name, value); }; return self; }, TMP_18.$$arity = -2); Opal.defn(self, '$animate', TMP_19 = function $$animate(params) { var $a, self = this, $iter = TMP_19.$$p, block = $iter || nil, speed = nil; TMP_19.$$p = null; speed = (function() {if ((($a = params['$has_key?']("speed")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return params.$delete("speed") } else { return 400 }; return nil; })(); self.animate(params.$to_n(), speed, function() { (function() {if ((block !== nil)) { return block.$call() } else { return nil }; return nil; })() }) ; }, TMP_19.$$arity = 1); Opal.defn(self, '$data', TMP_20 = function $$data($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } var result = self.data.apply(self, args); return result == null ? nil : result; }, TMP_20.$$arity = -1); Opal.defn(self, '$effect', TMP_21 = function $$effect(name, $a_rest) { var $b, $c, TMP_22, $d, TMP_23, self = this, args, $iter = TMP_21.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_21.$$p = null; name = ($b = ($c = name).$gsub, $b.$$p = (TMP_22 = function(match){var self = TMP_22.$$s || this; if (match == null) match = nil; return match['$[]'](1).$upcase()}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $b).call($c, /_\w/); args = ($b = ($d = args).$map, $b.$$p = (TMP_23 = function(a){var self = TMP_23.$$s || this, $a; if (a == null) a = nil; if ((($a = a['$respond_to?']("to_n")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return a.$to_n() } else { return nil }}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23), $b).call($d).$compact(); args['$<<'](function() { (function() {if ((block !== nil)) { return block.$call() } else { return nil }; return nil; })() }); return self[name].apply(self, args); }, TMP_21.$$arity = -2); Opal.defn(self, '$visible?', TMP_24 = function() { var self = this; return self.is(':visible'); }, TMP_24.$$arity = 0); Opal.defn(self, '$offset', TMP_25 = function $$offset() { var self = this; return self.$Native(self.offset()); }, TMP_25.$$arity = 0); Opal.defn(self, '$each', TMP_26 = function $$each() { var self = this, $iter = TMP_26.$$p, $yield = $iter || nil; TMP_26.$$p = null; for (var i = 0, length = self.length; i < length; i++) { Opal.yield1($yield, $(self[i])); }; return self; }, TMP_26.$$arity = 0); Opal.defn(self, '$first', TMP_27 = function $$first() { var self = this; return self.length ? self.first() : nil; }, TMP_27.$$arity = 0); Opal.defn(self, '$html', TMP_28 = function $$html(content) { var self = this; if (content != null) { return self.html(content); } return self.html() || ''; }, TMP_28.$$arity = -1); Opal.defn(self, '$id', TMP_29 = function $$id() { var self = this; var first = self[0]; return (first && first.id) || ""; }, TMP_29.$$arity = 0); Opal.defn(self, '$id=', TMP_30 = function(id) { var self = this; var first = self[0]; if (first) { first.id = id; } return self; }, TMP_30.$$arity = 1); Opal.defn(self, '$tag_name', TMP_31 = function $$tag_name() { var self = this; return self.length > 0 ? self[0].tagName.toLowerCase() : nil; }, TMP_31.$$arity = 0); Opal.defn(self, '$inspect', TMP_32 = function $$inspect() { var self = this; if (self[0] === document) return '#' else if (self[0] === window ) return '#' var val, el, str, result = []; for (var i = 0, length = self.length; i < length; i++) { el = self[i]; if (!el.tagName) { return '#'); } return '#'; }, TMP_32.$$arity = 0); Opal.defn(self, '$to_s', TMP_33 = function $$to_s() { var self = this; var val, el, result = []; for (var i = 0, length = self.length; i < length; i++) { el = self[i]; result.push(el.outerHTML) } return result.join(', '); }, TMP_33.$$arity = 0); Opal.defn(self, '$length', TMP_34 = function $$length() { var self = this; return self.length; }, TMP_34.$$arity = 0); Opal.defn(self, '$any?', TMP_35 = function() { var self = this; return self.length > 0; }, TMP_35.$$arity = 0); Opal.defn(self, '$empty?', TMP_36 = function() { var self = this; return self.length === 0; }, TMP_36.$$arity = 0); Opal.alias(self, 'empty?', 'none?'); Opal.defn(self, '$on', TMP_37 = function $$on(name, sel) { var self = this, $iter = TMP_37.$$p, block = $iter || nil; if (sel == null) { sel = nil; } TMP_37.$$p = null; var wrapper = function(evt) { if (evt.preventDefault) { evt = $scope.get('Event').$new(evt); } return block.apply(null, arguments); }; block._jq_wrap = wrapper; if (sel == nil) { self.on(name, wrapper); } else { self.on(name, sel, wrapper); } ; return block; }, TMP_37.$$arity = -2); Opal.defn(self, '$one', TMP_38 = function $$one(name, sel) { var self = this, $iter = TMP_38.$$p, block = $iter || nil; if (sel == null) { sel = nil; } TMP_38.$$p = null; var wrapper = function(evt) { if (evt.preventDefault) { evt = $scope.get('Event').$new(evt); } return block.apply(null, arguments); }; block._jq_wrap = wrapper; if (sel == nil) { self.one(name, wrapper); } else { self.one(name, sel, wrapper); } ; return block; }, TMP_38.$$arity = -2); Opal.defn(self, '$off', TMP_39 = function $$off(name, sel, block) { var self = this; if (block == null) { block = nil; } if (sel == null) { return self.off(name); } else if (block === nil) { return self.off(name, sel._jq_wrap); } else { return self.off(name, sel, block._jq_wrap); } }, TMP_39.$$arity = -3); Opal.defn(self, '$serialize_array', TMP_41 = function $$serialize_array() { var $a, $b, TMP_40, self = this; return ($a = ($b = (self.serializeArray())).$map, $a.$$p = (TMP_40 = function(e){var self = TMP_40.$$s || this; if (e == null) e = nil; return $scope.get('Hash').$new(e)}, TMP_40.$$s = self, TMP_40.$$arity = 1, TMP_40), $a).call($b); }, TMP_41.$$arity = 0); Opal.alias(self, 'size', 'length'); Opal.defn(self, '$value', TMP_42 = function $$value() { var self = this; return self.val() || ""; }, TMP_42.$$arity = 0); Opal.defn(self, '$height', TMP_43 = function $$height() { var self = this; return self.height() || nil; }, TMP_43.$$arity = 0); Opal.defn(self, '$width', TMP_44 = function $$width() { var self = this; return self.width() || nil; }, TMP_44.$$arity = 0); return (Opal.defn(self, '$position', TMP_45 = function $$position() { var self = this; return self.$Native(self.position()); }, TMP_45.$$arity = 0), nil) && 'position'; })($scope.base, $scope.get('JQUERY_CLASS').$to_n()); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/window"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$include', '$find', '$on', '$to_proc', '$element', '$off', '$trigger', '$new']); self.$require("opal/jquery/element"); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Window(){}; var self = $Window = $klass($base, $super, 'Window', $Window); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def.element = nil; self.$include($scope.get('Native')); Opal.defn(self, '$element', TMP_1 = function $$element() { var $a, self = this; return ((($a = self.element) !== false && $a !== nil && $a != null) ? $a : self.element = $scope.get('Element').$find(window)); }, TMP_1.$$arity = 0); Opal.defn(self, '$on', TMP_2 = function $$on($a_rest) { var $b, $c, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; return ($b = ($c = self.$element()).$on, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_2.$$arity = -1); Opal.defn(self, '$off', TMP_3 = function $$off($a_rest) { var $b, $c, self = this, args, $iter = TMP_3.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_3.$$p = null; return ($b = ($c = self.$element()).$off, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_3.$$arity = -1); return (Opal.defn(self, '$trigger', TMP_4 = function $$trigger($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self.$element()).$trigger.apply($b, Opal.to_a(args)); }, TMP_4.$$arity = -1), nil) && 'trigger'; })($scope.base, null) })($scope.base); Opal.cdecl($scope, 'Window', (($scope.get('Browser')).$$scope.get('Window')).$new(window)); return $gvars.window = $scope.get('Window'); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/document"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $gvars = Opal.gvars; Opal.add_stubs(['$require', '$to_n', '$call', '$new', '$ready?', '$resolve', '$module_function', '$find', '$extend']); self.$require("opal/jquery/constants"); self.$require("opal/jquery/element"); (function($base) { var $Browser, self = $Browser = $module($base, 'Browser'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DocumentMethods, self = $DocumentMethods = $module($base, 'DocumentMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3, $a, $b, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; var $ = $scope.get('JQUERY_SELECTOR').$to_n(); Opal.defn(self, '$ready?', TMP_1 = function() { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; if ((block !== nil)) { if ((($a = (($b = Opal.cvars['@@__isReady']) == null ? nil : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return block.$call() } else { return $(block); } } else { return nil }; }, TMP_1.$$arity = 0); Opal.defn(self, '$ready', TMP_3 = function $$ready() { var $a, $b, TMP_2, self = this, promise = nil; promise = $scope.get('Promise').$new(); ($a = ($b = $scope.get('Document'))['$ready?'], $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return promise.$resolve()}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $a).call($b); return promise; }, TMP_3.$$arity = 0); self.$module_function("ready?"); ($a = ($b = self)['$ready?'], $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return (Opal.cvars['@@__isReady'] = true)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b); Opal.defn(self, '$title', TMP_5 = function $$title() { var self = this; return document.title; }, TMP_5.$$arity = 0); Opal.defn(self, '$title=', TMP_6 = function(title) { var self = this; return document.title = title; }, TMP_6.$$arity = 1); Opal.defn(self, '$head', TMP_7 = function $$head() { var self = this; return $scope.get('Element').$find(document.head); }, TMP_7.$$arity = 0); Opal.defn(self, '$body', TMP_8 = function $$body() { var self = this; return $scope.get('Element').$find(document.body); }, TMP_8.$$arity = 0); })($scope.base) })($scope.base); Opal.cdecl($scope, 'Document', $scope.get('Element').$find(document)); $scope.get('Document').$extend((($scope.get('Browser')).$$scope.get('DocumentMethods'))); return $gvars.document = $scope.get('Document'); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/event"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$to_n', '$stop', '$prevent']); self.$require("opal/jquery/constants"); return (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22; def["native"] = nil; var $ = $scope.get('JQUERY_SELECTOR').$to_n(); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(native$) { var self = this; return self["native"] = native$; }, TMP_1.$$arity = 1); Opal.defn(self, '$to_n', TMP_2 = function $$to_n() { var self = this; return self["native"]; }, TMP_2.$$arity = 0); Opal.defn(self, '$[]', TMP_3 = function(name) { var self = this; return self["native"][name]; }, TMP_3.$$arity = 1); Opal.defn(self, '$type', TMP_4 = function $$type() { var self = this; return self["native"].type; }, TMP_4.$$arity = 0); Opal.defn(self, '$element', TMP_5 = function $$element() { var self = this; return $(self["native"].currentTarget); }, TMP_5.$$arity = 0); Opal.alias(self, 'current_target', 'element'); Opal.defn(self, '$target', TMP_6 = function $$target() { var self = this; return $(self["native"].target); }, TMP_6.$$arity = 0); Opal.defn(self, '$prevented?', TMP_7 = function() { var self = this; return self["native"].isDefaultPrevented(); }, TMP_7.$$arity = 0); Opal.defn(self, '$prevent', TMP_8 = function $$prevent() { var self = this; return self["native"].preventDefault(); }, TMP_8.$$arity = 0); Opal.defn(self, '$stopped?', TMP_9 = function() { var self = this; return self["native"].isPropagationStopped(); }, TMP_9.$$arity = 0); Opal.defn(self, '$stop', TMP_10 = function $$stop() { var self = this; return self["native"].stopPropagation(); }, TMP_10.$$arity = 0); Opal.defn(self, '$stop_immediate', TMP_11 = function $$stop_immediate() { var self = this; return self["native"].stopImmediatePropagation(); }, TMP_11.$$arity = 0); Opal.defn(self, '$kill', TMP_12 = function $$kill() { var self = this; self.$stop(); return self.$prevent(); }, TMP_12.$$arity = 0); Opal.defn(self, '$page_x', TMP_13 = function $$page_x() { var self = this; return self["native"].pageX; }, TMP_13.$$arity = 0); Opal.defn(self, '$page_y', TMP_14 = function $$page_y() { var self = this; return self["native"].pageY; }, TMP_14.$$arity = 0); Opal.defn(self, '$touch_x', TMP_15 = function $$touch_x() { var self = this; return self["native"].originalEvent.touches[0].pageX; }, TMP_15.$$arity = 0); Opal.defn(self, '$touch_y', TMP_16 = function $$touch_y() { var self = this; return self["native"].originalEvent.touches[0].pageY; }, TMP_16.$$arity = 0); Opal.defn(self, '$ctrl_key', TMP_17 = function $$ctrl_key() { var self = this; return self["native"].ctrlKey; }, TMP_17.$$arity = 0); Opal.defn(self, '$meta_key', TMP_18 = function $$meta_key() { var self = this; return self["native"].metaKey; }, TMP_18.$$arity = 0); Opal.defn(self, '$alt_key', TMP_19 = function $$alt_key() { var self = this; return self["native"].altKey; }, TMP_19.$$arity = 0); Opal.defn(self, '$shift_key', TMP_20 = function $$shift_key() { var self = this; return self["native"].shiftKey; }, TMP_20.$$arity = 0); Opal.defn(self, '$key_code', TMP_21 = function $$key_code() { var self = this; return self["native"].keyCode; }, TMP_21.$$arity = 0); Opal.defn(self, '$which', TMP_22 = function $$which() { var self = this; return self["native"].which; }, TMP_22.$$arity = 0); Opal.alias(self, 'default_prevented?', 'prevented?'); Opal.alias(self, 'prevent_default', 'prevent'); Opal.alias(self, 'propagation_stopped?', 'stopped?'); Opal.alias(self, 'stop_propagation', 'stop'); return Opal.alias(self, 'stop_immediate_propagation', 'stop_immediate'); })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["json"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2, $klass = Opal.klass; Opal.add_stubs(['$new', '$push', '$[]=', '$[]', '$create_id', '$json_create', '$attr_accessor', '$create_id=', '$===', '$parse', '$generate', '$from_object', '$merge', '$to_json', '$responds_to?', '$to_io', '$write', '$to_s', '$to_a', '$strftime']); (function($base) { var $JSON, self = $JSON = $module($base, 'JSON'); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7; var $parse = JSON.parse, $hasOwn = Opal.hasOwnProperty; function to_opal(value, options) { var klass, arr, hash, i, ii, k; switch (typeof value) { case 'string': return value; case 'number': return value; case 'boolean': return !!value; case 'null': return nil; case 'object': if (!value) return nil; if (value.$$is_array) { arr = (options.array_class).$new(); for (i = 0, ii = value.length; i < ii; i++) { (arr).$push(to_opal(value[i], options)); } return arr; } else { hash = (options.object_class).$new(); for (k in value) { if ($hasOwn.call(value, k)) { (hash)['$[]='](k, to_opal(value[k], options)); } } if (!options.parse && (klass = (hash)['$[]']($scope.get('JSON').$create_id())) != nil) { klass = Opal.get(klass); return (klass).$json_create(hash); } else { return hash; } } } }; (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$attr_accessor("create_id") })(Opal.get_singleton_class(self)); (($a = ["json_class"]), $b = self, $b['$create_id='].apply($b, $a), $a[$a.length-1]); Opal.defs(self, '$[]', TMP_1 = function(value, options) { var $a, self = this; if (options == null) { options = $hash2([], {}); } if ((($a = $scope.get('String')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$parse(value, options) } else { return self.$generate(value, options) }; }, TMP_1.$$arity = -2); Opal.defs(self, '$parse', TMP_2 = function $$parse(source, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$from_object($parse(source), options.$merge($hash2(["parse"], {"parse": true}))); }, TMP_2.$$arity = -2); Opal.defs(self, '$parse!', TMP_3 = function(source, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$parse(source, options); }, TMP_3.$$arity = -2); Opal.defs(self, '$load', TMP_4 = function $$load(source, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.$from_object($parse(source), options); }, TMP_4.$$arity = -2); Opal.defs(self, '$from_object', TMP_5 = function $$from_object(js_object, options) { var $a, $b, $c, self = this; if (options == null) { options = $hash2([], {}); } ($a = "object_class", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil && $c != null) ? $c : $b['$[]=']($a, $scope.get('Hash')))); ($a = "array_class", $b = options, ((($c = $b['$[]']($a)) !== false && $c !== nil && $c != null) ? $c : $b['$[]=']($a, $scope.get('Array')))); return to_opal(js_object, options.$$smap); }, TMP_5.$$arity = -2); Opal.defs(self, '$generate', TMP_6 = function $$generate(obj, options) { var self = this; if (options == null) { options = $hash2([], {}); } return obj.$to_json(options); }, TMP_6.$$arity = -2); Opal.defs(self, '$dump', TMP_7 = function $$dump(obj, io, limit) { var $a, self = this, string = nil; if (io == null) { io = nil; } if (limit == null) { limit = nil; } string = self.$generate(obj); if (io !== false && io !== nil && io != null) { if ((($a = io['$responds_to?']("to_io")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { io = io.$to_io()}; io.$write(string); return io; } else { return string }; }, TMP_7.$$arity = -2); })($scope.base); (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, TMP_8; return (Opal.defn(self, '$to_json', TMP_8 = function $$to_json() { var self = this; return self.$to_s().$to_json(); }, TMP_8.$$arity = 0), nil) && 'to_json' })($scope.base, null); (function($base) { var $Enumerable, self = $Enumerable = $module($base, 'Enumerable'); var def = self.$$proto, $scope = self.$$scope, TMP_9; Opal.defn(self, '$to_json', TMP_9 = function $$to_json() { var self = this; return self.$to_a().$to_json(); }, TMP_9.$$arity = 0) })($scope.base); (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, TMP_10; return (Opal.defn(self, '$to_json', TMP_10 = function $$to_json() { var self = this; var result = []; for (var i = 0, length = self.length; i < length; i++) { result.push((self[i]).$to_json()); } return '[' + result.join(', ') + ']'; }, TMP_10.$$arity = 0), nil) && 'to_json' })($scope.base, null); (function($base, $super) { function $Boolean(){}; var self = $Boolean = $klass($base, $super, 'Boolean', $Boolean); var def = self.$$proto, $scope = self.$$scope, TMP_11; return (Opal.defn(self, '$to_json', TMP_11 = function $$to_json() { var self = this; return (self == true) ? 'true' : 'false'; }, TMP_11.$$arity = 0), nil) && 'to_json' })($scope.base, null); (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_12; return (Opal.defn(self, '$to_json', TMP_12 = function $$to_json() { var self = this; var result = []; for (var i = 0, keys = self.$$keys, length = keys.length, key, value; i < length; i++) { key = keys[i]; if (key.$$is_string) { value = self.$$smap[key]; } else { value = key.value; key = key.key; } result.push((key).$to_s().$to_json() + ':' + (value).$to_json()); } return '{' + result.join(', ') + '}'; ; }, TMP_12.$$arity = 0), nil) && 'to_json' })($scope.base, null); (function($base, $super) { function $NilClass(){}; var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); var def = self.$$proto, $scope = self.$$scope, TMP_13; return (Opal.defn(self, '$to_json', TMP_13 = function $$to_json() { var self = this; return "null"; }, TMP_13.$$arity = 0), nil) && 'to_json' })($scope.base, null); (function($base, $super) { function $Numeric(){}; var self = $Numeric = $klass($base, $super, 'Numeric', $Numeric); var def = self.$$proto, $scope = self.$$scope, TMP_14; return (Opal.defn(self, '$to_json', TMP_14 = function $$to_json() { var self = this; return self.toString(); }, TMP_14.$$arity = 0), nil) && 'to_json' })($scope.base, null); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope; return Opal.alias(self, 'to_json', 'inspect') })($scope.base, null); (function($base, $super) { function $Time(){}; var self = $Time = $klass($base, $super, 'Time', $Time); var def = self.$$proto, $scope = self.$$scope, TMP_15; return (Opal.defn(self, '$to_json', TMP_15 = function $$to_json() { var self = this; return self.$strftime("%FT%T%z").$to_json(); }, TMP_15.$$arity = 0), nil) && 'to_json' })($scope.base, null); return (function($base, $super) { function $Date(){}; var self = $Date = $klass($base, $super, 'Date', $Date); var def = self.$$proto, $scope = self.$$scope, TMP_16, TMP_17; Opal.defn(self, '$to_json', TMP_16 = function $$to_json() { var self = this; return self.$to_s().$to_json(); }, TMP_16.$$arity = 0); return (Opal.defn(self, '$as_json', TMP_17 = function $$as_json() { var self = this; return self.$to_s(); }, TMP_17.$$arity = 0), nil) && 'as_json'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["promise"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$resolve', '$new', '$reject', '$attr_reader', '$===', '$value', '$has_key?', '$keys', '$!', '$==', '$<<', '$>>', '$exception?', '$[]', '$resolved?', '$rejected?', '$error', '$include?', '$action', '$realized?', '$raise', '$^', '$call', '$resolve!', '$exception!', '$any?', '$each', '$reject!', '$there_can_be_only_one!', '$then', '$to_proc', '$fail', '$always', '$trace', '$class', '$object_id', '$+', '$inspect', '$act?', '$nil?', '$prev', '$push', '$concat', '$it', '$proc', '$reverse', '$pop', '$<=', '$length', '$shift', '$-', '$wait', '$map', '$reduce', '$try', '$tap', '$all?', '$find']); return (function($base, $super) { function $Promise(){}; var self = $Promise = $klass($base, $super, 'Promise', $Promise); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_17, TMP_18, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31; def.value = def.action = def.exception = def.realized = def.next = def.delayed = def.error = def.prev = nil; Opal.defs(self, '$value', TMP_1 = function $$value(value) { var self = this; return self.$new().$resolve(value); }, TMP_1.$$arity = 1); Opal.defs(self, '$error', TMP_2 = function $$error(value) { var self = this; return self.$new().$reject(value); }, TMP_2.$$arity = 1); Opal.defs(self, '$when', TMP_3 = function $$when($a_rest) { var self = this, promises; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } promises = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { promises[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('When').$new(promises); }, TMP_3.$$arity = -1); self.$attr_reader("error", "prev", "next"); Opal.defn(self, '$initialize', TMP_4 = function $$initialize(action) { var self = this; if (action == null) { action = $hash2([], {}); } self.action = action; self.realized = false; self.exception = false; self.value = nil; self.error = nil; self.delayed = false; self.prev = nil; return self.next = []; }, TMP_4.$$arity = -1); Opal.defn(self, '$value', TMP_5 = function $$value() { var $a, self = this; if ((($a = $scope.get('Promise')['$==='](self.value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.value.$value() } else { return self.value }; }, TMP_5.$$arity = 0); Opal.defn(self, '$act?', TMP_6 = function() { var $a, self = this; return ((($a = self.action['$has_key?']("success")) !== false && $a !== nil && $a != null) ? $a : self.action['$has_key?']("always")); }, TMP_6.$$arity = 0); Opal.defn(self, '$action', TMP_7 = function $$action() { var self = this; return self.action.$keys(); }, TMP_7.$$arity = 0); Opal.defn(self, '$exception?', TMP_8 = function() { var self = this; return self.exception; }, TMP_8.$$arity = 0); Opal.defn(self, '$realized?', TMP_9 = function() { var self = this; return self.realized['$!']()['$!'](); }, TMP_9.$$arity = 0); Opal.defn(self, '$resolved?', TMP_10 = function() { var self = this; return self.realized['$==']("resolve"); }, TMP_10.$$arity = 0); Opal.defn(self, '$rejected?', TMP_11 = function() { var self = this; return self.realized['$==']("reject"); }, TMP_11.$$arity = 0); Opal.defn(self, '$^', TMP_12 = function(promise) { var self = this; promise['$<<'](self); self['$>>'](promise); return promise; }, TMP_12.$$arity = 1); Opal.defn(self, '$<<', TMP_13 = function(promise) { var self = this; self.prev = promise; return self; }, TMP_13.$$arity = 1); Opal.defn(self, '$>>', TMP_14 = function(promise) { var $a, $b, $c, self = this; self.next['$<<'](promise); if ((($a = self['$exception?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$reject(self.delayed['$[]'](0)) } else if ((($a = self['$resolved?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$resolve((function() {if ((($a = self.delayed) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.delayed['$[]'](0) } else { return self.$value() }; return nil; })()) } else if ((($a = self['$rejected?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ((($b = self.action['$has_key?']("failure")['$!']()) !== false && $b !== nil && $b != null) ? $b : $scope.get('Promise')['$==='](((function() {if ((($c = self.delayed) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.delayed['$[]'](0) } else { return self.error }; return nil; })())))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$reject((function() {if ((($a = self.delayed) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.delayed['$[]'](0) } else { return self.$error() }; return nil; })()) } else if ((($a = promise.$action()['$include?']("always")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$reject((function() {if ((($a = self.delayed) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.delayed['$[]'](0) } else { return self.$error() }; return nil; })())}}; return self; }, TMP_14.$$arity = 1); Opal.defn(self, '$resolve', TMP_15 = function $$resolve(value) { var $a, $b, self = this, block = nil, e = nil; if (value == null) { value = nil; } if ((($a = self['$realized?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "the promise has already been realized")}; if ((($a = $scope.get('Promise')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (value['$<<'](self.prev))['$^'](self)}; try { if ((($a = block = ((($b = self.action['$[]']("success")) !== false && $b !== nil && $b != null) ? $b : self.action['$[]']("always"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = block.$call(value)}; self['$resolve!'](value); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { self['$exception!'](e) } finally { Opal.pop_exception() } } else { throw $err; } }; return self; }, TMP_15.$$arity = -1); Opal.defn(self, '$resolve!', TMP_17 = function(value) { var $a, $b, TMP_16, self = this; self.realized = "resolve"; self.value = value; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.next).$each, $a.$$p = (TMP_16 = function(p){var self = TMP_16.$$s || this; if (p == null) p = nil; return p.$resolve(value)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b) } else { return self.delayed = [value] }; }, TMP_17.$$arity = 1); Opal.defn(self, '$reject', TMP_18 = function $$reject(value) { var $a, $b, self = this, block = nil, e = nil; if (value == null) { value = nil; } if ((($a = self['$realized?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "the promise has already been realized")}; if ((($a = $scope.get('Promise')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (value['$<<'](self.prev))['$^'](self)}; try { if ((($a = block = ((($b = self.action['$[]']("failure")) !== false && $b !== nil && $b != null) ? $b : self.action['$[]']("always"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = block.$call(value)}; if ((($a = self.action['$has_key?']("always")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self['$resolve!'](value) } else { self['$reject!'](value) }; } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { self['$exception!'](e) } finally { Opal.pop_exception() } } else { throw $err; } }; return self; }, TMP_18.$$arity = -1); Opal.defn(self, '$reject!', TMP_20 = function(value) { var $a, $b, TMP_19, self = this; self.realized = "reject"; self.error = value; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.next).$each, $a.$$p = (TMP_19 = function(p){var self = TMP_19.$$s || this; if (p == null) p = nil; return p.$reject(value)}, TMP_19.$$s = self, TMP_19.$$arity = 1, TMP_19), $a).call($b) } else { return self.delayed = [value] }; }, TMP_20.$$arity = 1); Opal.defn(self, '$exception!', TMP_21 = function(error) { var self = this; self.exception = true; return self['$reject!'](error); }, TMP_21.$$arity = 1); Opal.defn(self, '$then', TMP_22 = function $$then() { var self = this, $iter = TMP_22.$$p, block = $iter || nil; TMP_22.$$p = null; return self['$^']($scope.get('Promise').$new($hash2(["success"], {"success": block}))); }, TMP_22.$$arity = 0); Opal.defn(self, '$then!', TMP_23 = function() { var $a, $b, self = this, $iter = TMP_23.$$p, block = $iter || nil; TMP_23.$$p = null; self['$there_can_be_only_one!'](); return ($a = ($b = self).$then, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_23.$$arity = 0); Opal.alias(self, 'do', 'then'); Opal.alias(self, 'do!', 'then!'); Opal.defn(self, '$fail', TMP_24 = function $$fail() { var self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; return self['$^']($scope.get('Promise').$new($hash2(["failure"], {"failure": block}))); }, TMP_24.$$arity = 0); Opal.defn(self, '$fail!', TMP_25 = function() { var $a, $b, self = this, $iter = TMP_25.$$p, block = $iter || nil; TMP_25.$$p = null; self['$there_can_be_only_one!'](); return ($a = ($b = self).$fail, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_25.$$arity = 0); Opal.alias(self, 'rescue', 'fail'); Opal.alias(self, 'catch', 'fail'); Opal.alias(self, 'rescue!', 'fail!'); Opal.alias(self, 'catch!', 'fail!'); Opal.defn(self, '$always', TMP_26 = function $$always() { var self = this, $iter = TMP_26.$$p, block = $iter || nil; TMP_26.$$p = null; return self['$^']($scope.get('Promise').$new($hash2(["always"], {"always": block}))); }, TMP_26.$$arity = 0); Opal.defn(self, '$always!', TMP_27 = function() { var $a, $b, self = this, $iter = TMP_27.$$p, block = $iter || nil; TMP_27.$$p = null; self['$there_can_be_only_one!'](); return ($a = ($b = self).$always, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_27.$$arity = 0); Opal.alias(self, 'finally', 'always'); Opal.alias(self, 'ensure', 'always'); Opal.alias(self, 'finally!', 'always!'); Opal.alias(self, 'ensure!', 'always!'); Opal.defn(self, '$trace', TMP_28 = function $$trace(depth) { var self = this, $iter = TMP_28.$$p, block = $iter || nil; if (depth == null) { depth = nil; } TMP_28.$$p = null; return self['$^']($scope.get('Trace').$new(depth, block)); }, TMP_28.$$arity = -1); Opal.defn(self, '$trace!', TMP_29 = function($a_rest) { var $b, $c, self = this, args, $iter = TMP_29.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_29.$$p = null; self['$there_can_be_only_one!'](); return ($b = ($c = self).$trace, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_29.$$arity = -1); Opal.defn(self, '$there_can_be_only_one!', TMP_30 = function() { var $a, self = this; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('ArgumentError'), "a promise has already been chained") } else { return nil }; }, TMP_30.$$arity = 0); Opal.defn(self, '$inspect', TMP_31 = function $$inspect() { var $a, self = this, result = nil; result = "#<" + (self.$class()) + "(" + (self.$object_id()) + ")"; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, " >> " + (self.next.$inspect()))}; if ((($a = self['$realized?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, ": " + ((((($a = self.value) !== false && $a !== nil && $a != null) ? $a : self.error)).$inspect()) + ">") } else { result = $rb_plus(result, ">") }; return result; }, TMP_31.$$arity = 0); (function($base, $super) { function $Trace(){}; var self = $Trace = $klass($base, $super, 'Trace', $Trace); var def = self.$$proto, $scope = self.$$scope, TMP_32, TMP_33; Opal.defs(self, '$it', TMP_32 = function $$it(promise) { var $a, $b, self = this, current = nil, prev = nil; current = []; if ((($a = ((($b = promise['$act?']()) !== false && $b !== nil && $b != null) ? $b : promise.$prev()['$nil?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { current.$push(promise.$value())}; if ((($a = prev = promise.$prev()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return current.$concat(self.$it(prev)) } else { return current }; }, TMP_32.$$arity = 1); return (Opal.defn(self, '$initialize', TMP_33 = function $$initialize(depth, block) { var $a, $b, $c, $d, TMP_34, self = this, $iter = TMP_33.$$p, $yield = $iter || nil; TMP_33.$$p = null; self.depth = depth; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_33, false)), $a.$$p = null, $a).call($b, $hash2(["success"], {"success": ($c = ($d = self).$proc, $c.$$p = (TMP_34 = function(){var self = TMP_34.$$s || this, $e, $f, trace = nil; trace = $scope.get('Trace').$it(self).$reverse(); trace.$pop(); if ((($e = (($f = depth !== false && depth !== nil && depth != null) ? $rb_le(depth, trace.$length()) : depth)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { trace.$shift($rb_minus(trace.$length(), depth))}; return ($e = block).$call.apply($e, Opal.to_a(trace));}, TMP_34.$$s = self, TMP_34.$$arity = 0, TMP_34), $c).call($d)})); }, TMP_33.$$arity = 2), nil) && 'initialize'; })($scope.base, self); return (function($base, $super) { function $When(){}; var self = $When = $klass($base, $super, 'When', $When); var def = self.$$proto, $scope = self.$$scope, TMP_35, TMP_37, TMP_39, TMP_41, TMP_44, TMP_46, TMP_47; def.wait = nil; Opal.defn(self, '$initialize', TMP_35 = function $$initialize(promises) { var $a, $b, $c, TMP_36, self = this, $iter = TMP_35.$$p, $yield = $iter || nil; if (promises == null) { promises = []; } TMP_35.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_35, false)), $a.$$p = null, $a).call($b); self.wait = []; return ($a = ($c = promises).$each, $a.$$p = (TMP_36 = function(promise){var self = TMP_36.$$s || this; if (promise == null) promise = nil; return self.$wait(promise)}, TMP_36.$$s = self, TMP_36.$$arity = 1, TMP_36), $a).call($c); }, TMP_35.$$arity = -1); Opal.defn(self, '$each', TMP_37 = function $$each() { var $a, $b, TMP_38, self = this, $iter = TMP_37.$$p, block = $iter || nil; TMP_37.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block given") }; return ($a = ($b = self).$then, $a.$$p = (TMP_38 = function(values){var self = TMP_38.$$s || this, $c, $d; if (values == null) values = nil; return ($c = ($d = values).$each, $c.$$p = block.$to_proc(), $c).call($d)}, TMP_38.$$s = self, TMP_38.$$arity = 1, TMP_38), $a).call($b); }, TMP_37.$$arity = 0); Opal.defn(self, '$collect', TMP_39 = function $$collect() { var $a, $b, TMP_40, self = this, $iter = TMP_39.$$p, block = $iter || nil; TMP_39.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block given") }; return ($a = ($b = self).$then, $a.$$p = (TMP_40 = function(values){var self = TMP_40.$$s || this, $c, $d; if (values == null) values = nil; return $scope.get('When').$new(($c = ($d = values).$map, $c.$$p = block.$to_proc(), $c).call($d))}, TMP_40.$$s = self, TMP_40.$$arity = 1, TMP_40), $a).call($b); }, TMP_39.$$arity = 0); Opal.defn(self, '$inject', TMP_41 = function $$inject($a_rest) { var $b, $c, TMP_42, self = this, args, $iter = TMP_41.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_41.$$p = null; return ($b = ($c = self).$then, $b.$$p = (TMP_42 = function(values){var self = TMP_42.$$s || this, $a, $d; if (values == null) values = nil; return ($a = ($d = values).$reduce, $a.$$p = block.$to_proc(), $a).apply($d, Opal.to_a(args))}, TMP_42.$$s = self, TMP_42.$$arity = 1, TMP_42), $b).call($c); }, TMP_41.$$arity = -1); Opal.alias(self, 'map', 'collect'); Opal.alias(self, 'reduce', 'inject'); Opal.defn(self, '$wait', TMP_44 = function $$wait(promise) { var $a, $b, TMP_43, self = this; if ((($a = $scope.get('Promise')['$==='](promise)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { promise = $scope.get('Promise').$value(promise) }; if ((($a = promise['$act?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise = promise.$then()}; self.wait['$<<'](promise); ($a = ($b = promise).$always, $a.$$p = (TMP_43 = function(){var self = TMP_43.$$s || this, $c; if (self.next == null) self.next = nil; if ((($c = self.next['$any?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$try() } else { return nil }}, TMP_43.$$s = self, TMP_43.$$arity = 0, TMP_43), $a).call($b); return self; }, TMP_44.$$arity = 1); Opal.alias(self, 'and', 'wait'); Opal.defn(self, '$>>', TMP_46 = function($a_rest) { var $b, $c, TMP_45, $d, $e, self = this, $iter = TMP_46.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_46.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return ($b = ($c = ($d = ($e = self, Opal.find_super_dispatcher(self, '>>', TMP_46, false)), $d.$$p = $iter, $d).apply($e, $zuper)).$tap, $b.$$p = (TMP_45 = function(){var self = TMP_45.$$s || this; return self.$try()}, TMP_45.$$s = self, TMP_45.$$arity = 0, TMP_45), $b).call($c); }, TMP_46.$$arity = -1); return (Opal.defn(self, '$try', TMP_47 = function() { var $a, $b, $c, $d, self = this, promise = nil; if ((($a = ($b = ($c = self.wait)['$all?'], $b.$$p = "realized?".$to_proc(), $b).call($c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = promise = ($b = ($d = self.wait).$find, $b.$$p = "rejected?".$to_proc(), $b).call($d)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$reject(promise.$error()) } else { return self.$resolve(($a = ($b = self.wait).$map, $a.$$p = "value".$to_proc(), $a).call($b)) } } else { return nil }; }, TMP_47.$$arity = 0), nil) && 'try'; })($scope.base, self); })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/http"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$to_n', '$each', '$define_singleton_method', '$send', '$new', '$define_method', '$attr_reader', '$delete', '$update', '$upcase', '$succeed', '$fail', '$promise', '$parse', '$private', '$tap', '$proc', '$ok?', '$resolve', '$reject', '$from_object', '$call']); self.$require("json"); self.$require("native"); self.$require("promise"); self.$require("opal/jquery/constants"); return (function($base, $super) { function $HTTP(){}; var self = $HTTP = $klass($base, $super, 'HTTP', $HTTP); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_13, TMP_14, TMP_15; def.settings = def.payload = def.url = def.method = def.handler = def.json = def.body = def.ok = def.xhr = def.promise = def.status_code = nil; var $ = $scope.get('JQUERY_SELECTOR').$to_n(); Opal.cdecl($scope, 'ACTIONS', ["get", "post", "put", "delete", "patch", "head"]); ($a = ($b = $scope.get('ACTIONS')).$each, $a.$$p = (TMP_1 = function(action){var self = TMP_1.$$s || this, $c, $d, TMP_2, $e, TMP_3; if (action == null) action = nil; ($c = ($d = self).$define_singleton_method, $c.$$p = (TMP_2 = function(url, options){var self = TMP_2.$$s || this, block; block = TMP_2.$$p || nil, TMP_2.$$p = null; if (options == null) { options = $hash2([], {}); }if (url == null) url = nil; return self.$new().$send(action, url, options, block)}, TMP_2.$$s = self, TMP_2.$$arity = -2, TMP_2), $c).call($d, action); return ($c = ($e = self).$define_method, $c.$$p = (TMP_3 = function(url, options){var self = TMP_3.$$s || this, block; block = TMP_3.$$p || nil, TMP_3.$$p = null; if (options == null) { options = $hash2([], {}); }if (url == null) url = nil; return self.$send(action, url, options, block)}, TMP_3.$$s = self, TMP_3.$$arity = -2, TMP_3), $c).call($e, action);}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); Opal.defs(self, '$setup', TMP_4 = function $$setup() { var self = this; return $scope.get('Hash').$new($.ajaxSetup()); }, TMP_4.$$arity = 0); Opal.defs(self, '$setup=', TMP_5 = function(settings) { var self = this; return $.ajaxSetup(settings.$to_n()); }, TMP_5.$$arity = 1); self.$attr_reader("body", "error_message", "method", "status_code", "url", "xhr"); Opal.defn(self, '$initialize', TMP_6 = function $$initialize() { var self = this; self.settings = $hash2([], {}); return self.ok = true; }, TMP_6.$$arity = 0); Opal.defn(self, '$send', TMP_7 = function $$send(method, url, options, block) { var $a, self = this, settings = nil, payload = nil; self.method = method; self.url = url; self.payload = options.$delete("payload"); self.handler = block; self.settings.$update(options); $a = [self.settings.$to_n(), self.payload], settings = $a[0], payload = $a[1], $a; if (typeof(payload) === 'string') { settings.data = payload; } else if (payload != nil) { settings.data = payload.$to_json(); settings.contentType = 'application/json'; } settings.url = self.url; settings.type = self.method.$upcase(); settings.success = function(data, status, xhr) { return self.$succeed(data, status, xhr); }; settings.error = function(xhr, status, error) { return self.$fail(xhr, status, error); }; $.ajax(settings); ; if ((($a = self.handler) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self } else { return self.$promise() }; }, TMP_7.$$arity = 4); Opal.defn(self, '$json', TMP_8 = function $$json() { var $a, self = this; return ((($a = self.json) !== false && $a !== nil && $a != null) ? $a : self.json = $scope.get('JSON').$parse(self.body)); }, TMP_8.$$arity = 0); Opal.defn(self, '$ok?', TMP_9 = function() { var self = this; return self.ok; }, TMP_9.$$arity = 0); Opal.defn(self, '$get_header', TMP_10 = function $$get_header(key) { var self = this; var value = self.xhr.getResponseHeader(key); return (value === null) ? nil : value; ; }, TMP_10.$$arity = 1); self.$private(); Opal.defn(self, '$promise', TMP_13 = function $$promise() { var $a, $b, TMP_11, self = this; if ((($a = self.promise) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.promise}; return self.promise = ($a = ($b = $scope.get('Promise').$new()).$tap, $a.$$p = (TMP_11 = function(promise){var self = TMP_11.$$s || this, $c, $d, TMP_12; if (promise == null) promise = nil; return self.handler = ($c = ($d = self).$proc, $c.$$p = (TMP_12 = function(res){var self = TMP_12.$$s || this, $e; if (res == null) res = nil; if ((($e = res['$ok?']()) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { return promise.$resolve(res) } else { return promise.$reject(res) }}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $c).call($d)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b); }, TMP_13.$$arity = 0); Opal.defn(self, '$succeed', TMP_14 = function $$succeed(data, status, xhr) { var $a, self = this; self.body = data; self.xhr = xhr; self.status_code = xhr.status; if (typeof(data) === 'object') { self.json = $scope.get('JSON').$from_object(data); } ; if ((($a = self.handler) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.handler.$call(self) } else { return nil }; }, TMP_14.$$arity = 3); return (Opal.defn(self, '$fail', TMP_15 = function $$fail(xhr, status, error) { var $a, self = this; self.body = xhr.responseText; self.xhr = xhr; self.status_code = xhr.status; ; self.ok = false; if ((($a = self.handler) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.handler.$call(self) } else { return nil }; }, TMP_15.$$arity = 3), nil) && 'fail'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery/kernel"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defn(self, '$alert', TMP_1 = function $$alert(msg) { var self = this; alert(msg); return nil; }, TMP_1.$$arity = 1) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["opal/jquery"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$==', '$require']); if ($scope.get('RUBY_ENGINE')['$==']("opal")) { self.$require("opal/jquery/window"); self.$require("opal/jquery/document"); self.$require("opal/jquery/element"); self.$require("opal/jquery/event"); self.$require("opal/jquery/http"); return self.$require("opal/jquery/kernel");} }; /* Generated by Opal 0.10.3 */ Opal.modules["opal-jquery"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); return self.$require("opal/jquery") }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return Opal.cdecl($scope, 'VERSION', "0.5.0") })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop/client_stubs"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2, TMP_3; Opal.defn(self, '$import', TMP_1 = function($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return nil; }, TMP_1.$$arity = -1); Opal.defn(self, '$imports', TMP_2 = function $$imports($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return nil; }, TMP_2.$$arity = -1); return (Opal.defn(self, '$import_tree', TMP_3 = function $$import_tree($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return nil; }, TMP_3.$$arity = -1), nil) && 'import_tree'; })(Opal.get_singleton_class(self)) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop/on_client"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$==', '$!']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defs(self, '$on_client?', TMP_1 = function() { var self = this; if ($scope.get('RUBY_ENGINE')['$==']("opal")) { return ((typeof Opal.global.document === 'undefined'))['$!']()}; }, TMP_1.$$arity = 0) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop-config"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$==', '$require']); if ($scope.get('RUBY_ENGINE')['$==']("opal")) { self.$require("hyperloop/client_stubs"); return self.$require("hyperloop/on_client");} }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/inflector/inflections"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$extend', '$instance', '$split', '$empty?', '$const_get', '$>', '$size', '$first', '$shift', '$inject', '$==', '$const_defined?', '$ancestors', '$apply_inflections', '$plurals', '$inflections', '$singulars', '$to_s', '$include?', '$uncountables', '$downcase', '$each', '$sub', '$new', '$attr_reader', '$unshift', '$<<']); self.$require("set"); return (function($base) { var $ActiveSupport, self = $ActiveSupport = $module($base, 'ActiveSupport'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Inflector, self = $Inflector = $module($base, 'Inflector'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_4, TMP_5, TMP_6, TMP_8; self.$extend(self); Opal.defn(self, '$inflections', TMP_1 = function $$inflections() { var self = this, $iter = TMP_1.$$p, $yield = $iter || nil; TMP_1.$$p = null; if (($yield !== nil)) { return Opal.yield1($yield, $scope.get('Inflections').$instance()); } else { return $scope.get('Inflections').$instance() }; }, TMP_1.$$arity = 0); Opal.defn(self, '$constantize', TMP_4 = function $$constantize(camel_cased_word) { var $a, $b, TMP_2, self = this, names = nil; names = camel_cased_word.$split("::"); if ((($a = names['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { $scope.get('Object').$const_get(camel_cased_word)}; if ((($a = ($b = $rb_gt(names.$size(), 1), $b !== false && $b !== nil && $b != null ?names.$first()['$empty?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { names.$shift()}; return ($a = ($b = names).$inject, $a.$$p = (TMP_2 = function(constant, name){var self = TMP_2.$$s || this, $c, $d, TMP_3, candidate = nil; if (constant == null) constant = nil;if (name == null) name = nil; if (constant['$==']($scope.get('Object'))) { return constant.$const_get(name) } else { candidate = constant.$const_get(name); if ((($c = constant['$const_defined?'](name, false)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return candidate;}; if ((($c = $scope.get('Object')['$const_defined?'](name)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { return candidate; }; constant = (function(){var $brk = Opal.new_brk(); try {return ($c = ($d = constant.$ancestors()).$inject, $c.$$p = (TMP_3 = function(const$, ancestor){var self = TMP_3.$$s || this, $e; if (const$ == null) const$ = nil;if (ancestor == null) ancestor = nil; if (ancestor['$==']($scope.get('Object'))) { Opal.brk(const$, $brk)}; if ((($e = ancestor['$const_defined?'](name, false)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.brk(ancestor, $brk)}; return const$;}, TMP_3.$$s = self, TMP_3.$$brk = $brk, TMP_3.$$arity = 2, TMP_3), $c).call($d) } catch (err) { if (err === $brk) { return err.$v } else { throw err } }})(); return constant.$const_get(name, false); }}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $a).call($b, $scope.get('Object')); }, TMP_4.$$arity = 1); Opal.defn(self, '$pluralize', TMP_5 = function $$pluralize(word) { var self = this; return self.$apply_inflections(word, self.$inflections().$plurals()); }, TMP_5.$$arity = 1); Opal.defn(self, '$singularize', TMP_6 = function $$singularize(word) { var self = this; return self.$apply_inflections(word, self.$inflections().$singulars()); }, TMP_6.$$arity = 1); Opal.defn(self, '$apply_inflections', TMP_8 = function $$apply_inflections(word, rules) { var $a, $b, TMP_7, self = this, result = nil; result = word.$to_s(); if ((($a = self.$inflections().$uncountables()['$include?'](result.$downcase())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return result } else { (function(){var $brk = Opal.new_brk(); try {return ($a = ($b = rules).$each, $a.$$p = (TMP_7 = function(rule, replacement){var self = TMP_7.$$s || this, changed = nil; if (rule == null) rule = nil;if (replacement == null) replacement = nil; changed = result.$sub(rule, replacement); if (changed['$=='](result)) { return nil } else { result = changed; Opal.brk(nil, $brk); };}, TMP_7.$$s = self, TMP_7.$$brk = $brk, TMP_7.$$arity = 2, TMP_7), $a).call($b) } catch (err) { if (err === $brk) { return err.$v } else { throw err } }})(); return result; }; }, TMP_8.$$arity = 2); (function($base, $super) { function $Inflections(){}; var self = $Inflections = $klass($base, $super, 'Inflections', $Inflections); var def = self.$$proto, $scope = self.$$scope, TMP_9, TMP_10, TMP_11, TMP_12, TMP_14, TMP_15; def.plurals = def.singulars = nil; Opal.defs(self, '$instance', TMP_9 = function $$instance() { var $a, self = this; if (self.__instance__ == null) self.__instance__ = nil; return ((($a = self.__instance__) !== false && $a !== nil && $a != null) ? $a : self.__instance__ = self.$new()); }, TMP_9.$$arity = 0); self.$attr_reader("plurals", "singulars", "uncountables"); Opal.defn(self, '$initialize', TMP_10 = function $$initialize() { var $a, self = this; return $a = [[], [], $scope.get('Set').$new()], self.plurals = $a[0], self.singulars = $a[1], self.uncountables = $a[2], $a; }, TMP_10.$$arity = 0); Opal.defn(self, '$plural', TMP_11 = function $$plural(rule, replacement) { var self = this; return self.plurals.$unshift([rule, replacement]); }, TMP_11.$$arity = 2); Opal.defn(self, '$singular', TMP_12 = function $$singular(rule, replacement) { var self = this; return self.singulars.$unshift([rule, replacement]); }, TMP_12.$$arity = 2); Opal.defn(self, '$uncountable', TMP_14 = function $$uncountable(words) { var $a, $b, TMP_13, self = this; return ($a = ($b = words).$each, $a.$$p = (TMP_13 = function(w){var self = TMP_13.$$s || this; if (self.uncountables == null) self.uncountables = nil; if (w == null) w = nil; return self.uncountables['$<<'](w.$downcase())}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $a).call($b); }, TMP_14.$$arity = 1); return (Opal.defn(self, '$irregular', TMP_15 = function $$irregular() { var self = this; return nil; }, TMP_15.$$arity = 0), nil) && 'irregular'; })($scope.base, null); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/inflections"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$inflections', '$plural', '$singular', '$irregular', '$uncountable']); return (function($base) { var $ActiveSupport, self = $ActiveSupport = $module($base, 'ActiveSupport'); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1; ($a = ($b = $scope.get('Inflector')).$inflections, $a.$$p = (TMP_1 = function(inflect){var self = TMP_1.$$s || this; if (inflect == null) inflect = nil; inflect.$plural(/$/, "s"); inflect.$plural(/s$/i, "s"); inflect.$plural(/^(ax|test)is$/i, "\\1es"); inflect.$plural(/(octop|vir)us$/i, "\\1i"); inflect.$plural(/(octop|vir)i$/i, "\\1i"); inflect.$plural(/(alias|status)$/i, "\\1es"); inflect.$plural(/(bu)s$/i, "\\1ses"); inflect.$plural(/(buffal|tomat)o$/i, "\\1oes"); inflect.$plural(/([ti])um$/i, "\\1a"); inflect.$plural(/([ti])a$/i, "\\1a"); inflect.$plural(/sis$/i, "ses"); inflect.$plural(/(?:([^f])fe|([lr])f)$/i, "\\1\\2ves"); inflect.$plural(/(hive)$/i, "\\1s"); inflect.$plural(/([^aeiouy]|qu)y$/i, "\\1ies"); inflect.$plural(/(x|ch|ss|sh)$/i, "\\1es"); inflect.$plural(/(matr|vert|ind)(?:ix|ex)$/i, "\\1ices"); inflect.$plural(/^(m|l)ouse$/i, "\\1ice"); inflect.$plural(/^(m|l)ice$/i, "\\1ice"); inflect.$plural(/^(ox)$/i, "\\1en"); inflect.$plural(/^(oxen)$/i, "\\1"); inflect.$plural(/(quiz)$/i, "\\1zes"); inflect.$singular(/s$/i, ""); inflect.$singular(/(ss)$/i, "\\1"); inflect.$singular(/(n)ews$/i, "\\1ews"); inflect.$singular(/([ti])a$/i, "\\1um"); inflect.$singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, "\\1sis"); inflect.$singular(/(^analy)(sis|ses)$/i, "\\1sis"); inflect.$singular(/([^f])ves$/i, "\\1fe"); inflect.$singular(/(hive)s$/i, "\\1"); inflect.$singular(/(tive)s$/i, "\\1"); inflect.$singular(/([lr])ves$/i, "\\1f"); inflect.$singular(/([^aeiouy]|qu)ies$/i, "\\1y"); inflect.$singular(/(s)eries$/i, "\\1eries"); inflect.$singular(/(m)ovies$/i, "\\1ovie"); inflect.$singular(/(x|ch|ss|sh)es$/i, "\\1"); inflect.$singular(/^(m|l)ice$/i, "\\1ouse"); inflect.$singular(/(bus)(es)?$/i, "\\1"); inflect.$singular(/(o)es$/i, "\\1"); inflect.$singular(/(shoe)s$/i, "\\1"); inflect.$singular(/(cris|test)(is|es)$/i, "\\1is"); inflect.$singular(/^(a)x[ie]s$/i, "\\1xis"); inflect.$singular(/(octop|vir)(us|i)$/i, "\\1us"); inflect.$singular(/(alias|status)(es)?$/i, "\\1"); inflect.$singular(/^(ox)en/i, "\\1"); inflect.$singular(/(vert|ind)ices$/i, "\\1ex"); inflect.$singular(/(matr)ices$/i, "\\1ix"); inflect.$singular(/(quiz)zes$/i, "\\1"); inflect.$singular(/(database)s$/i, "\\1"); inflect.$irregular("person", "people"); inflect.$irregular("man", "men"); inflect.$irregular("child", "children"); inflect.$irregular("sex", "sexes"); inflect.$irregular("move", "moves"); inflect.$irregular("zombie", "zombies"); return inflect.$uncountable(["equipment", "information", "rice", "money", "species", "series", "fish", "sheep", "jeans", "police"]);}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b, "en") })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/inflector"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$require']); self.$require("active_support/inflector/inflections"); return self.$require("active_support/inflections"); }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/string/inflections"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$pluralize', '$singularize', '$constantize']); self.$require("active_support/inflector"); return (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; Opal.defn(self, '$pluralize', TMP_1 = function $$pluralize() { var self = this; return (($scope.get('ActiveSupport')).$$scope.get('Inflector')).$pluralize(self); }, TMP_1.$$arity = 0); Opal.defn(self, '$singularize', TMP_2 = function $$singularize() { var self = this; return (($scope.get('ActiveSupport')).$$scope.get('Inflector')).$singularize(self); }, TMP_2.$$arity = 0); return (Opal.defn(self, '$constantize', TMP_3 = function $$constantize() { var self = this; return (($scope.get('ActiveSupport')).$$scope.get('Inflector')).$constantize(self); }, TMP_3.$$arity = 0), nil) && 'constantize'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/string"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$gsub', '$strip', '$downcase', '$underscore', '$alias_method']); self.$require("active_support/core_ext/string/inflections"); return (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; Opal.defn(self, '$parameterize', TMP_1 = function $$parameterize() { var self = this; return self.$downcase().$strip().$gsub(/\W+/, "-"); }, TMP_1.$$arity = 0); Opal.defn(self, '$dasherize', TMP_2 = function $$dasherize() { var self = this; return self.replace(/[-_\s]+/g, '-') .replace(/([A-Z\d]+)([A-Z][a-z])/g, '$1-$2') .replace(/([a-z\d])([A-Z])/g, '$1-$2') .toLowerCase(); }, TMP_2.$$arity = 0); Opal.defn(self, '$demodulize', TMP_3 = function $$demodulize() { var self = this; var idx = self.lastIndexOf('::'); if (idx > -1) { return self.substr(idx + 2); } return self; ; }, TMP_3.$$arity = 0); Opal.defn(self, '$underscore', TMP_4 = function $$underscore() { var self = this; return self.replace(/[-\s]+/g, '_') .replace(/([A-Z\d]+)([A-Z][a-z])/g, '$1_$2') .replace(/([a-z\d])([A-Z])/g, '$1_$2') .replace(/-/g, '_') .toLowerCase(); }, TMP_4.$$arity = 0); Opal.defn(self, '$camelize', TMP_5 = function $$camelize(first_letter) { var self = this; if (first_letter == null) { first_letter = "upper"; } return self.$underscore().replace(/(^|_)([^_]+)/g, function(match, pre, word, index) { var capitalize = first_letter === "upper" || index > 0; return capitalize ? word.substr(0,1).toUpperCase()+word.substr(1) : word; }); }, TMP_5.$$arity = -1); return self.$alias_method("camelcase", "camelize"); })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/hash_with_indifferent_access"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$dup', '$respond_to?', '$update', '$to_hash', '$tap', '$default=', '$default', '$default_proc', '$default_proc=', '$new']); return (function($base) { var $ActiveSupport, self = $ActiveSupport = $module($base, 'ActiveSupport'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $HashWithIndifferentAccess(){}; var self = $HashWithIndifferentAccess = $klass($base, $super, 'HashWithIndifferentAccess', $HashWithIndifferentAccess); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_6; Opal.defn(self, '$extractable_options?', TMP_1 = function() { var self = this; return true; }, TMP_1.$$arity = 0); Opal.defn(self, '$with_indifferent_access', TMP_2 = function $$with_indifferent_access() { var self = this; return self.$dup(); }, TMP_2.$$arity = 0); Opal.defn(self, '$nested_under_indifferent_access', TMP_3 = function $$nested_under_indifferent_access() { var self = this; return self; }, TMP_3.$$arity = 0); Opal.defn(self, '$initialize', TMP_4 = function $$initialize(constructor) { var $a, $b, $c, self = this, $iter = TMP_4.$$p, $yield = $iter || nil; if (constructor == null) { constructor = $hash2([], {}); } TMP_4.$$p = null; if ((($a = constructor['$respond_to?']("to_hash")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_4, false)), $a.$$p = null, $a).call($b); return self.$update(constructor); } else { return ($a = ($c = self, Opal.find_super_dispatcher(self, 'initialize', TMP_4, false)), $a.$$p = null, $a).call($c, constructor) }; }, TMP_4.$$arity = -1); return (Opal.defs(self, '$new_from_hash_copying_default', TMP_6 = function $$new_from_hash_copying_default(hash) { var $a, $b, TMP_5, self = this; hash = hash.$to_hash(); return ($a = ($b = self.$new(hash)).$tap, $a.$$p = (TMP_5 = function(new_hash){var self = TMP_5.$$s || this, $c, $d; if (new_hash == null) new_hash = nil; (($c = [hash.$default()]), $d = new_hash, $d['$default='].apply($d, $c), $c[$c.length-1]); if ((($c = hash.$default_proc()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return (($c = [hash.$default_proc()]), $d = new_hash, $d['$default_proc='].apply($d, $c), $c[$c.length-1]) } else { return nil };}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($b); }, TMP_6.$$arity = 1), nil) && 'new_from_hash_copying_default'; })($scope.base, $scope.get('Hash')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/hash/indifferent_access"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$new_from_hash_copying_default']); self.$require("active_support/hash_with_indifferent_access"); return (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defn(self, '$with_indifferent_access', TMP_1 = function $$with_indifferent_access() { var self = this; return (($scope.get('ActiveSupport')).$$scope.get('HashWithIndifferentAccess')).$new_from_hash_copying_default(self); }, TMP_1.$$arity = 0); return Opal.alias(self, 'nested_under_indifferent_access', 'with_indifferent_access'); })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["date"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$include', '$<=>', '$nonzero?', '$d', '$zero?', '$new', '$class', '$-@', '$+@', '$===', '$coerce', '$==', '$>', '$+', '$allocate', '$join', '$compact', '$map', '$to_proc', '$downcase', '$wrap', '$raise', '$clone', '$jd', '$>>', '$wday', '$-', '$to_s', '$alias_method']); return (function($base, $super) { function $Date(){}; var self = $Date = $klass($base, $super, 'Date', $Date); var def = self.$$proto, $scope = self.$$scope, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_33, TMP_34, TMP_35, TMP_36, TMP_37, TMP_38, TMP_39, TMP_40, TMP_41, TMP_42, TMP_43, TMP_44, TMP_45, TMP_46, TMP_47, TMP_48, TMP_49, TMP_50; def.date = nil; (function($base, $super) { function $Infinity(){}; var self = $Infinity = $klass($base, $super, 'Infinity', $Infinity); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12; def.d = nil; self.$include($scope.get('Comparable')); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(d) { var self = this; if (d == null) { d = 1; } return self.d = d['$<=>'](0); }, TMP_1.$$arity = -1); Opal.defn(self, '$d', TMP_2 = function $$d() { var self = this; return self.d; }, TMP_2.$$arity = 0); Opal.defn(self, '$zero?', TMP_3 = function() { var self = this; return false; }, TMP_3.$$arity = 0); Opal.defn(self, '$finite?', TMP_4 = function() { var self = this; return false; }, TMP_4.$$arity = 0); Opal.defn(self, '$infinite?', TMP_5 = function() { var self = this; return self.$d()['$nonzero?'](); }, TMP_5.$$arity = 0); Opal.defn(self, '$nan?', TMP_6 = function() { var self = this; return self.$d()['$zero?'](); }, TMP_6.$$arity = 0); Opal.defn(self, '$abs', TMP_7 = function $$abs() { var self = this; return self.$class().$new(); }, TMP_7.$$arity = 0); Opal.defn(self, '$-@', TMP_8 = function() { var self = this; return self.$class().$new(self.$d()['$-@']()); }, TMP_8.$$arity = 0); Opal.defn(self, '$+@', TMP_9 = function() { var self = this; return self.$class().$new(self.$d()['$+@']()); }, TMP_9.$$arity = 0); Opal.defn(self, '$<=>', TMP_10 = function(other) { var $a, $b, self = this, $case = nil, l = nil, r = nil; $case = other;if ($scope.get('Infinity')['$===']($case)) {return self.$d()['$<=>'](other.$d())}else if ($scope.get('Numeric')['$===']($case)) {return self.$d()}else {try { $b = other.$coerce(self), $a = Opal.to_ary($b), l = ($a[0] == null ? nil : $a[0]), r = ($a[1] == null ? nil : $a[1]), $b; return l['$<=>'](r); } catch ($err) { if (Opal.rescue($err, [$scope.get('NoMethodError')])) { try { nil } finally { Opal.pop_exception() } } else { throw $err; } }}; return nil; }, TMP_10.$$arity = 1); Opal.defn(self, '$coerce', TMP_11 = function $$coerce(other) { var $a, $b, self = this, $iter = TMP_11.$$p, $yield = $iter || nil, $case = nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_11.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return (function() {$case = other;if ($scope.get('Numeric')['$===']($case)) {return [self.$d()['$-@'](), self.$d()]}else {return ($a = ($b = self, Opal.find_super_dispatcher(self, 'coerce', TMP_11, false)), $a.$$p = $iter, $a).apply($b, $zuper)}})(); }, TMP_11.$$arity = 1); return (Opal.defn(self, '$to_f', TMP_12 = function $$to_f() { var $a, self = this; if (self.d['$=='](0)) { return 0}; if ((($a = $rb_gt(self.d, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('Float')).$$scope.get('INFINITY')) } else { return (($scope.get('Float')).$$scope.get('INFINITY'))['$-@']() }; }, TMP_12.$$arity = 0), nil) && 'to_f'; })($scope.base, $scope.get('Numeric')); Opal.cdecl($scope, 'JULIAN', $scope.get('Infinity').$new()); Opal.cdecl($scope, 'GREGORIAN', $scope.get('Infinity').$new()['$-@']()); Opal.cdecl($scope, 'ITALY', 2299161); Opal.cdecl($scope, 'ENGLAND', 2361222); Opal.cdecl($scope, 'MONTHNAMES', $rb_plus([nil], ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"])); Opal.cdecl($scope, 'ABBR_MONTHNAMES', ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"]); Opal.cdecl($scope, 'DAYNAMES', ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); Opal.cdecl($scope, 'ABBR_DAYNAMES', ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_13, TMP_14, TMP_15, TMP_16; Opal.alias(self, 'civil', 'new'); Opal.defn(self, '$wrap', TMP_13 = function $$wrap(native$) { var self = this, instance = nil; instance = self.$allocate(); instance.date = native$; return instance; }, TMP_13.$$arity = 1); Opal.defn(self, '$parse', TMP_14 = function $$parse(string, comp) { var $a, $b, $c, self = this; if (comp == null) { comp = true; } var current_date = new Date(); var current_day = current_date.getDate(), current_month = current_date.getMonth(), current_year = current_date.getFullYear(), current_wday = current_date.getDay(), full_month_name_regexp = $scope.get('MONTHNAMES').$compact().$join("|"); function match1(match) { return match[1]; } function match2(match) { return match[2]; } function match3(match) { return match[3]; } function match4(match) { return match[4]; } // Converts passed short year (0..99) // to a 4-digits year in the range (1969..2068) function fromShortYear(fn) { return function(match) { var short_year = fn(match); if (short_year >= 69) { short_year += 1900; } else { short_year += 2000; } return short_year; } } // Converts month abbr (nov) to a month number function fromMonthAbbr(fn) { return function(match) { var abbr = fn(match); return $scope.get('ABBR_MONTHNAMES').indexOf(abbr) + 1; } } function toInt(fn) { return function(match) { var value = fn(match); return parseInt(value, 10); } } // Depending on the 'comp' value appends 20xx to a passed year function to2000(fn) { return function(match) { var value = fn(match); if (comp) { return value + 2000; } else { return value; } } } // Converts passed week day name to a day number function fromDayName(fn) { return function(match) { var dayname = fn(match), wday = ($a = ($b = $scope.get('DAYNAMES')).$map, $a.$$p = "downcase".$to_proc(), $a).call($b).indexOf((dayname).$downcase()); return current_day - current_wday + wday; } } // Converts passed month name to a month number function fromFullMonthName(fn) { return function(match) { var month_name = fn(match); return ($a = ($c = $scope.get('MONTHNAMES').$compact()).$map, $a.$$p = "downcase".$to_proc(), $a).call($c).indexOf((month_name).$downcase()) + 1; } } var rules = [ { // DD as month day number regexp: /^(\d{2})$/, year: current_year, month: current_month, day: toInt(match1) }, { // DDD as year day number regexp: /^(\d{3})$/, year: current_year, month: 0, day: toInt(match1) }, { // MMDD as month and day regexp: /^(\d{2})(\d{2})$/, year: current_year, month: toInt(match1), day: toInt(match2) }, { // YYDDD as year and day number in 1969--2068 regexp: /^(\d{2})(\d{3})$/, year: fromShortYear(toInt(match1)), month: 0, day: toInt(match2) }, { // YYMMDD as year, month and day in 1969--2068 regexp: /^(\d{2})(\d{2})(\d{2})$/, year: fromShortYear(toInt(match1)), month: toInt(match2), day: toInt(match3) }, { // YYYYDDD as year and day number regexp: /^(\d{4})(\d{3})$/, year: toInt(match1), month: 0, day: toInt(match2) }, { // YYYYMMDD as year, month and day number regexp: /^(\d{4})(\d{2})(\d{2})$/, year: toInt(match1), month: toInt(match2), day: toInt(match3) }, { // mmm YYYY regexp: /^([a-z]{3})[\s\.\/\-](\d{3,4})$/, year: toInt(match2), month: fromMonthAbbr(match1), day: 1 }, { // DD mmm YYYY regexp: /^(\d{1,2})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{3,4})$/i, year: toInt(match3), month: fromMonthAbbr(match2), day: toInt(match1) }, { // mmm DD YYYY regexp: /^([a-z]{3})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{3,4})$/i, year: toInt(match3), month: fromMonthAbbr(match1), day: toInt(match2) }, { // YYYY mmm DD regexp: /^(\d{3,4})[\s\.\/\-]([a-z]{3})[\s\.\/\-](\d{1,2})$/i, year: toInt(match1), month: fromMonthAbbr(match2), day: toInt(match3) }, { // YYYY-MM-DD YYYY/MM/DD YYYY.MM.DD regexp: /^(\-?\d{3,4})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/, year: toInt(match1), month: toInt(match2), day: toInt(match3) }, { // YY-MM-DD regexp: /^(\d{2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{1,2})$/, year: to2000(toInt(match1)), month: toInt(match2), day: toInt(match3) }, { // DD-MM-YYYY regexp: /^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\-?\d{3,4})$/, year: toInt(match3), month: toInt(match2), day: toInt(match1) }, { // ddd regexp: new RegExp("^(" + $scope.get('DAYNAMES').$join("|") + ")$", 'i'), year: current_year, month: current_month, day: fromDayName(match1) }, { // monthname daynumber YYYY regexp: new RegExp("^(" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](\\-?\\d{3,4})$", "i"), year: toInt(match4), month: fromFullMonthName(match1), day: toInt(match2) }, { // monthname daynumber regexp: new RegExp("^(" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)", "i"), year: current_year, month: fromFullMonthName(match1), day: toInt(match2) }, { // daynumber monthname YYYY regexp: new RegExp("^(\\d{1,2})(th|nd|rd)[\\s\\.\\/\\-](" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\-?\\d{3,4})$", "i"), year: toInt(match4), month: fromFullMonthName(match3), day: toInt(match1) }, { // YYYY monthname daynumber regexp: new RegExp("^(\\-?\\d{3,4})[\\s\\.\\/\\-](" + full_month_name_regexp + ")[\\s\\.\\/\\-](\\d{1,2})(th|nd|rd)$", "i"), year: toInt(match1), month: fromFullMonthName(match2), day: toInt(match3) } ] var rule, i, match; for (i = 0; i < rules.length; i++) { rule = rules[i]; match = rule.regexp.exec(string); if (match) { var year = rule.year; if (typeof(year) === 'function') { year = year(match); } var month = rule.month; if (typeof(month) === 'function') { month = month(match) - 1 } var day = rule.day; if (typeof(day) === 'function') { day = day(match); } var result = new Date(year, month, day); // an edge case, JS can't handle 'new Date(1)', minimal year is 1970 if (year >= 0 && year <= 1970) { result.setFullYear(year); } return self.$wrap(result); } } ; return self.$raise($scope.get('ArgumentError'), "invalid date"); }, TMP_14.$$arity = -2); Opal.defn(self, '$today', TMP_15 = function $$today() { var self = this; return self.$wrap(new Date()); }, TMP_15.$$arity = 0); return (Opal.defn(self, '$gregorian_leap?', TMP_16 = function(year) { var self = this; return (new Date(year, 1, 29).getMonth()-1) === 0; }, TMP_16.$$arity = 1), nil) && 'gregorian_leap?'; })(Opal.get_singleton_class(self)); Opal.defn(self, '$initialize', TMP_17 = function $$initialize(year, month, day, start) { var self = this; if (year == null) { year = -4712; } if (month == null) { month = 1; } if (day == null) { day = 1; } if (start == null) { start = $scope.get('ITALY'); } return self.date = new Date(year, month - 1, day); }, TMP_17.$$arity = -1); Opal.defn(self, '$-', TMP_18 = function(date) { var self = this; if (date.$$is_number) { var result = self.$clone(); result.date.setDate(self.date.getDate() - date); return result; } else if (date.date) { return Math.round((self.date - date.date) / (1000 * 60 * 60 * 24)); } else { self.$raise($scope.get('TypeError')); } ; }, TMP_18.$$arity = 1); Opal.defn(self, '$+', TMP_19 = function(date) { var self = this; if (date.$$is_number) { var result = self.$clone(); result.date.setDate(self.date.getDate() + date); return result; } else { self.$raise($scope.get('TypeError')); } ; }, TMP_19.$$arity = 1); Opal.defn(self, '$<', TMP_20 = function(other) { var self = this; var a = self.date, b = other.date; a.setHours(0, 0, 0, 0); b.setHours(0, 0, 0, 0); return a < b; ; }, TMP_20.$$arity = 1); Opal.defn(self, '$<=', TMP_21 = function(other) { var self = this; var a = self.date, b = other.date; a.setHours(0, 0, 0, 0); b.setHours(0, 0, 0, 0); return a <= b; ; }, TMP_21.$$arity = 1); Opal.defn(self, '$>', TMP_22 = function(other) { var self = this; var a = self.date, b = other.date; a.setHours(0, 0, 0, 0); b.setHours(0, 0, 0, 0); return a > b; ; }, TMP_22.$$arity = 1); Opal.defn(self, '$>=', TMP_23 = function(other) { var self = this; var a = self.date, b = other.date; a.setHours(0, 0, 0, 0); b.setHours(0, 0, 0, 0); return a >= b; ; }, TMP_23.$$arity = 1); Opal.defn(self, '$<=>', TMP_24 = function(other) { var self = this; if (other.$$is_number) { return self.$jd()['$<=>'](other) } var a = self.date, b = other.date; a.setHours(0, 0, 0, 0); b.setHours(0, 0, 0, 0); if (a < b) { return -1; } else if (a > b) { return 1; } else { return 0; } ; }, TMP_24.$$arity = 1); Opal.defn(self, '$==', TMP_25 = function(other) { var self = this; var a = self.date, b = other.date; return (a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()); ; }, TMP_25.$$arity = 1); Opal.defn(self, '$>>', TMP_26 = function(n) { var self = this; if (!n.$$is_number) { self.$raise($scope.get('TypeError')); } var result = self.$clone(), date = result.date, cur = date.getDate(); date.setDate(1); date.setMonth(date.getMonth() + n); date.setDate(Math.min(cur, days_in_month(date.getFullYear(), date.getMonth()))); return result; ; }, TMP_26.$$arity = 1); Opal.defn(self, '$<<', TMP_27 = function(n) { var self = this; if (!n.$$is_number) { self.$raise($scope.get('TypeError')); } return self['$>>'](-n); ; }, TMP_27.$$arity = 1); Opal.alias(self, 'eql?', '=='); Opal.defn(self, '$clone', TMP_28 = function $$clone() { var self = this; return $scope.get('Date').$wrap(new Date(self.date.getTime())); }, TMP_28.$$arity = 0); Opal.defn(self, '$day', TMP_29 = function $$day() { var self = this; return self.date.getDate(); }, TMP_29.$$arity = 0); Opal.defn(self, '$friday?', TMP_30 = function() { var self = this; return self.$wday()['$=='](5); }, TMP_30.$$arity = 0); Opal.defn(self, '$jd', TMP_31 = function $$jd() { var self = this; //Adapted from http://www.physics.sfasu.edu/astro/javascript/julianday.html var mm = self.date.getMonth() + 1, dd = self.date.getDate(), yy = self.date.getFullYear(), hr = 12, mn = 0, sc = 0, ggg, s, a, j1, jd; hr = hr + (mn / 60) + (sc/3600); ggg = 1; if (yy <= 1585) { ggg = 0; } jd = -1 * Math.floor(7 * (Math.floor((mm + 9) / 12) + yy) / 4); s = 1; if ((mm - 9) < 0) { s =- 1; } a = Math.abs(mm - 9); j1 = Math.floor(yy + s * Math.floor(a / 7)); j1 = -1 * Math.floor((Math.floor(j1 / 100) + 1) * 3 / 4); jd = jd + Math.floor(275 * mm / 9) + dd + (ggg * j1); jd = jd + 1721027 + 2 * ggg + 367 * yy - 0.5; jd = jd + (hr / 24); return jd; ; }, TMP_31.$$arity = 0); Opal.defn(self, '$julian?', TMP_32 = function() { var self = this; return self.date < new Date(1582, 10 - 1, 15, 12); }, TMP_32.$$arity = 0); Opal.defn(self, '$monday?', TMP_33 = function() { var self = this; return self.$wday()['$=='](1); }, TMP_33.$$arity = 0); Opal.defn(self, '$month', TMP_34 = function $$month() { var self = this; return self.date.getMonth() + 1; }, TMP_34.$$arity = 0); Opal.defn(self, '$next', TMP_35 = function $$next() { var self = this; return $rb_plus(self, 1); }, TMP_35.$$arity = 0); Opal.defn(self, '$next_day', TMP_36 = function $$next_day(n) { var self = this; if (n == null) { n = 1; } return $rb_plus(self, n); }, TMP_36.$$arity = -1); Opal.defn(self, '$next_month', TMP_37 = function $$next_month() { var self = this; var result = self.$clone(), date = result.date, cur = date.getDate(); date.setDate(1); date.setMonth(date.getMonth() + 1); date.setDate(Math.min(cur, days_in_month(date.getFullYear(), date.getMonth()))); return result; ; }, TMP_37.$$arity = 0); Opal.defn(self, '$prev_day', TMP_38 = function $$prev_day(n) { var self = this; if (n == null) { n = 1; } return $rb_minus(self, n); }, TMP_38.$$arity = -1); Opal.defn(self, '$prev_month', TMP_39 = function $$prev_month() { var self = this; var result = self.$clone(), date = result.date, cur = date.getDate(); date.setDate(1); date.setMonth(date.getMonth() - 1); date.setDate(Math.min(cur, days_in_month(date.getFullYear(), date.getMonth()))); return result; ; }, TMP_39.$$arity = 0); Opal.defn(self, '$saturday?', TMP_40 = function() { var self = this; return self.$wday()['$=='](6); }, TMP_40.$$arity = 0); Opal.defn(self, '$strftime', TMP_41 = function $$strftime(format) { var self = this; if (format == null) { format = ""; } if (format == '') { return self.$to_s(); } return self.date.$strftime(format); ; }, TMP_41.$$arity = -1); self.$alias_method("succ", "next"); Opal.defn(self, '$sunday?', TMP_42 = function() { var self = this; return self.$wday()['$=='](0); }, TMP_42.$$arity = 0); Opal.defn(self, '$thursday?', TMP_43 = function() { var self = this; return self.$wday()['$=='](4); }, TMP_43.$$arity = 0); Opal.defn(self, '$to_s', TMP_44 = function $$to_s() { var self = this; var d = self.date, year = d.getFullYear(), month = d.getMonth() + 1, day = d.getDate(); if (month < 10) { month = '0' + month; } if (day < 10) { day = '0' + day; } return year + '-' + month + '-' + day; ; }, TMP_44.$$arity = 0); Opal.defn(self, '$tuesday?', TMP_45 = function() { var self = this; return self.$wday()['$=='](2); }, TMP_45.$$arity = 0); Opal.defn(self, '$wday', TMP_46 = function $$wday() { var self = this; return self.date.getDay(); }, TMP_46.$$arity = 0); Opal.defn(self, '$wednesday?', TMP_47 = function() { var self = this; return self.$wday()['$=='](3); }, TMP_47.$$arity = 0); Opal.defn(self, '$year', TMP_48 = function $$year() { var self = this; return self.date.getFullYear(); }, TMP_48.$$arity = 0); Opal.defn(self, '$cwday', TMP_49 = function $$cwday() { var self = this; return self.date.getDay() || 7;; }, TMP_49.$$arity = 0); Opal.defn(self, '$cweek', TMP_50 = function $$cweek() { var self = this; var d = new Date(self.date); d.setHours(0,0,0); d.setDate(d.getDate()+4-(d.getDay()||7)); return Math.ceil((((d-new Date(d.getFullYear(),0,1))/8.64e7)+1)/7); ; }, TMP_50.$$arity = 0); function days_in_month(year, month) { var leap = ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0); return [31, (leap ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] } })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["time"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$strftime']); return (function($base, $super) { function $Time(){}; var self = $Time = $klass($base, $super, 'Time', $Time); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; Opal.defs(self, '$parse', TMP_1 = function $$parse(str) { var self = this; return new Date(Date.parse(str)); }, TMP_1.$$arity = 1); return (Opal.defn(self, '$iso8601', TMP_2 = function $$iso8601() { var self = this; return self.$strftime("%FT%T%z"); }, TMP_2.$$arity = 0), nil) && 'iso8601'; })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["js"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$insert', '$<<', '$global', '$extend']); return (function($base) { var $JS, self = $JS = $module($base, 'JS'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, $a, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9; Opal.defn(self, '$delete', TMP_1 = function(object, property) { var self = this; return delete object[property]; }, TMP_1.$$arity = 2); Opal.defn(self, '$global', TMP_2 = function $$global() { var self = this; return Opal.global; }, TMP_2.$$arity = 0); Opal.defn(self, '$in', TMP_3 = function(property, object) { var self = this; return property in object; }, TMP_3.$$arity = 2); Opal.defn(self, '$instanceof', TMP_4 = function(value, func) { var self = this; return value instanceof func; }, TMP_4.$$arity = 2); if ((($a = typeof Function.prototype.bind == 'function') !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Opal.defn(self, '$new', TMP_5 = function(func, $a_rest) { var self = this, args, $iter = TMP_5.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_5.$$p = null; args.$insert(0, this); if (block !== false && block !== nil && block != null) { args['$<<'](block)}; return new (func.bind.apply(func, args))(); }, TMP_5.$$arity = -2) } else { Opal.defn(self, '$new', TMP_6 = function(func, $a_rest) { var self = this, args, $iter = TMP_6.$$p, block = $iter || nil, f = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_6.$$p = null; if (block !== false && block !== nil && block != null) { args['$<<'](block)}; f = function(){return func.apply(this, args)}; f["prototype"]=func["prototype"]; return new f(); }, TMP_6.$$arity = -2) }; Opal.defn(self, '$typeof', TMP_7 = function(value) { var self = this; return typeof value; }, TMP_7.$$arity = 1); Opal.defn(self, '$void', TMP_8 = function(expr) { var self = this; return void expr; }, TMP_8.$$arity = 1); Opal.defn(self, '$call', TMP_9 = function $$call(func, $a_rest) { var self = this, args, $iter = TMP_9.$$p, block = $iter || nil, g = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_9.$$p = null; g = self.$global(); if (block !== false && block !== nil && block != null) { args['$<<'](block)}; return g[func].apply(g, args); }, TMP_9.$$arity = -2); Opal.alias(self, 'method_missing', 'call'); self.$extend(self); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["bigdecimal/kernel"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$new']); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defn(self, '$BigDecimal', TMP_1 = function $$BigDecimal(initial, digits) { var self = this; if (digits == null) { digits = 0; } return $scope.get('BigDecimal').$new(initial, digits); }, TMP_1.$$arity = -2) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["bigdecimal/bignumber"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; return (function($base, $super) { function $BigDecimal(){}; var self = $BigDecimal = $klass($base, $super, 'BigDecimal', $BigDecimal); var def = self.$$proto, $scope = self.$$scope; var define = function (f) { Opal.casgn(self, 'BigNumber', f()); }; define.amd = true; /* jshint ignore:start */ /* bignumber.js v2.1.4 https://github.com/MikeMcl/bignumber.js/LICENCE */ !function(e){"use strict";function n(e){function E(e,n){var t,r,i,o,u,s,f=this;if(!(f instanceof E))return j&&L(26,"constructor call without new",e),new E(e,n);if(null!=n&&H(n,2,64,M,"base")){if(n=0|n,s=e+"",10==n)return f=new E(e instanceof E?e:s),U(f,P+f.e+1,k);if((o="number"==typeof e)&&0*e!=0||!new RegExp("^-?"+(t="["+N.slice(0,n)+"]+")+"(?:\\."+t+")?$",37>n?"i":"").test(s))return h(f,s,o,n);o?(f.s=0>1/e?(s=s.slice(1),-1):1,j&&s.replace(/^0\.0*|\./,"").length>15&&L(M,v,e),o=!1):f.s=45===s.charCodeAt(0)?(s=s.slice(1),-1):1,s=D(s,10,n,f.s)}else{if(e instanceof E)return f.s=e.s,f.e=e.e,f.c=(e=e.c)?e.slice():e,void(M=0);if((o="number"==typeof e)&&0*e==0){if(f.s=0>1/e?(e=-e,-1):1,e===~~e){for(r=0,i=e;i>=10;i/=10,r++);return f.e=r,f.c=[e],void(M=0)}s=e+""}else{if(!g.test(s=e+""))return h(f,s,o);f.s=45===s.charCodeAt(0)?(s=s.slice(1),-1):1}}for((r=s.indexOf("."))>-1&&(s=s.replace(".","")),(i=s.search(/e/i))>0?(0>r&&(r=i),r+=+s.slice(i+1),s=s.substring(0,i)):0>r&&(r=s.length),i=0;48===s.charCodeAt(i);i++);for(u=s.length;48===s.charCodeAt(--u););if(s=s.slice(i,u+1))if(u=s.length,o&&j&&u>15&&L(M,v,f.s*e),r=r-i-1,r>z)f.c=f.e=null;else if(G>r)f.c=[f.e=0];else{if(f.e=r,f.c=[],i=(r+1)%O,0>r&&(i+=O),u>i){for(i&&f.c.push(+s.slice(0,i)),u-=O;u>i;)f.c.push(+s.slice(i,i+=O));s=s.slice(i),i=O-s.length}else i-=u;for(;i--;s+="0");f.c.push(+s)}else f.c=[f.e=0];M=0}function D(e,n,t,i){var o,u,f,c,a,h,g,p=e.indexOf("."),d=P,m=k;for(37>t&&(e=e.toLowerCase()),p>=0&&(f=J,J=0,e=e.replace(".",""),g=new E(t),a=g.pow(e.length-p),J=f,g.c=s(l(r(a.c),a.e),10,n),g.e=g.c.length),h=s(e,t,n),u=f=h.length;0==h[--f];h.pop());if(!h[0])return"0";if(0>p?--u:(a.c=h,a.e=u,a.s=i,a=C(a,g,d,m,n),h=a.c,c=a.r,u=a.e),o=u+d+1,p=h[o],f=n/2,c=c||0>o||null!=h[o+1],c=4>m?(null!=p||c)&&(0==m||m==(a.s<0?3:2)):p>f||p==f&&(4==m||c||6==m&&1&h[o-1]||m==(a.s<0?8:7)),1>o||!h[0])e=c?l("1",-d):"0";else{if(h.length=o,c)for(--n;++h[--o]>n;)h[o]=0,o||(++u,h.unshift(1));for(f=h.length;!h[--f];);for(p=0,e="";f>=p;e+=N.charAt(h[p++]));e=l(e,u)}return e}function F(e,n,t,i){var o,u,s,c,a;if(t=null!=t&&H(t,0,8,i,w)?0|t:k,!e.c)return e.toString();if(o=e.c[0],s=e.e,null==n)a=r(e.c),a=19==i||24==i&&B>=s?f(a,s):l(a,s);else if(e=U(new E(e),n,t),u=e.e,a=r(e.c),c=a.length,19==i||24==i&&(u>=n||B>=u)){for(;n>c;a+="0",c++);a=f(a,u)}else if(n-=s,a=l(a,u),u+1>c){if(--n>0)for(a+=".";n--;a+="0");}else if(n+=u-c,n>0)for(u+1==c&&(a+=".");n--;a+="0");return e.s<0&&o?"-"+a:a}function _(e,n){var t,r,i=0;for(u(e[0])&&(e=e[0]),t=new E(e[0]);++ie||e>t||e!=c(e))&&L(r,(i||"decimal places")+(n>e||e>t?" out of range":" not an integer"),e),!0}function I(e,n,t){for(var r=1,i=n.length;!n[--i];n.pop());for(i=n[0];i>=10;i/=10,r++);return(t=r+t*O-1)>z?e.c=e.e=null:G>t?e.c=[e.e=0]:(e.e=t,e.c=n),e}function L(e,n,t){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][e]+"() "+n+": "+t);throw r.name="BigNumber Error",M=0,r}function U(e,n,t,r){var i,o,u,s,f,l,c,a=e.c,h=S;if(a){e:{for(i=1,s=a[0];s>=10;s/=10,i++);if(o=n-i,0>o)o+=O,u=n,f=a[l=0],c=f/h[i-u-1]%10|0;else if(l=p((o+1)/O),l>=a.length){if(!r)break e;for(;a.length<=l;a.push(0));f=c=0,i=1,o%=O,u=o-O+1}else{for(f=s=a[l],i=1;s>=10;s/=10,i++);o%=O,u=o-O+i,c=0>u?0:f/h[i-u-1]%10|0}if(r=r||0>n||null!=a[l+1]||(0>u?f:f%h[i-u-1]),r=4>t?(c||r)&&(0==t||t==(e.s<0?3:2)):c>5||5==c&&(4==t||r||6==t&&(o>0?u>0?f/h[i-u]:0:a[l-1])%10&1||t==(e.s<0?8:7)),1>n||!a[0])return a.length=0,r?(n-=e.e+1,a[0]=h[(O-n%O)%O],e.e=-n||0):a[0]=e.e=0,e;if(0==o?(a.length=l,s=1,l--):(a.length=l+1,s=h[O-o],a[l]=u>0?d(f/h[i-u]%h[u])*s:0),r)for(;;){if(0==l){for(o=1,u=a[0];u>=10;u/=10,o++);for(u=a[0]+=s,s=1;u>=10;u/=10,s++);o!=s&&(e.e++,a[0]==b&&(a[0]=1));break}if(a[l]+=s,a[l]!=b)break;a[l--]=0,s=1}for(o=a.length;0===a[--o];a.pop());}e.e>z?e.c=e.e=null:e.et?null!=(e=i[t++]):void 0};return f(n="DECIMAL_PLACES")&&H(e,0,A,2,n)&&(P=0|e),r[n]=P,f(n="ROUNDING_MODE")&&H(e,0,8,2,n)&&(k=0|e),r[n]=k,f(n="EXPONENTIAL_AT")&&(u(e)?H(e[0],-A,0,2,n)&&H(e[1],0,A,2,n)&&(B=0|e[0],$=0|e[1]):H(e,-A,A,2,n)&&(B=-($=0|(0>e?-e:e)))),r[n]=[B,$],f(n="RANGE")&&(u(e)?H(e[0],-A,-1,2,n)&&H(e[1],1,A,2,n)&&(G=0|e[0],z=0|e[1]):H(e,-A,A,2,n)&&(0|e?G=-(z=0|(0>e?-e:e)):j&&L(2,n+" cannot be zero",e))),r[n]=[G,z],f(n="ERRORS")&&(e===!!e||1===e||0===e?(M=0,H=(j=!!e)?x:o):j&&L(2,n+m,e)),r[n]=j,f(n="CRYPTO")&&(e===!!e||1===e||0===e?(V=!(!e||!a),e&&!V&&j&&L(2,"crypto unavailable",a)):j&&L(2,n+m,e)),r[n]=V,f(n="MODULO_MODE")&&H(e,0,9,2,n)&&(W=0|e),r[n]=W,f(n="POW_PRECISION")&&H(e,0,A,2,n)&&(J=0|e),r[n]=J,f(n="FORMAT")&&("object"==typeof e?X=e:j&&L(2,n+" not an object",e)),r[n]=X,r},E.max=function(){return _(arguments,T.lt)},E.min=function(){return _(arguments,T.gt)},E.random=function(){var e=9007199254740992,n=Math.random()*e&2097151?function(){return d(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var t,r,i,o,u,s=0,f=[],l=new E(q);if(e=null!=e&&H(e,0,A,14)?0|e:P,o=p(e/O),V)if(a&&a.getRandomValues){for(t=a.getRandomValues(new Uint32Array(o*=2));o>s;)u=131072*t[s]+(t[s+1]>>>11),u>=9e15?(r=a.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(f.push(u%1e14),s+=2);s=o/2}else if(a&&a.randomBytes){for(t=a.randomBytes(o*=7);o>s;)u=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6],u>=9e15?a.randomBytes(7).copy(t,s):(f.push(u%1e14),s+=7);s=o/7}else j&&L(14,"crypto unavailable",a);if(!s)for(;o>s;)u=n(),9e15>u&&(f[s++]=u%1e14);for(o=f[--s],e%=O,o&&e&&(u=S[O-e],f[s]=d(o/u)*u);0===f[s];f.pop(),s--);if(0>s)f=[i=0];else{for(i=-1;0===f[0];f.shift(),i-=O);for(s=1,u=f[0];u>=10;u/=10,s++);O>s&&(i-=O-s)}return l.e=i,l.c=f,l}}(),C=function(){function e(e,n,t){var r,i,o,u,s=0,f=e.length,l=n%R,c=n/R|0;for(e=e.slice();f--;)o=e[f]%R,u=e[f]/R|0,r=c*o+u*l,i=l*o+r%R*R+s,s=(i/t|0)+(r/R|0)+c*u,e[f]=i%t;return s&&e.unshift(s),e}function n(e,n,t,r){var i,o;if(t!=r)o=t>r?1:-1;else for(i=o=0;t>i;i++)if(e[i]!=n[i]){o=e[i]>n[i]?1:-1;break}return o}function r(e,n,t,r){for(var i=0;t--;)e[t]-=i,i=e[t]1;e.shift());}return function(i,o,u,s,f){var l,c,a,h,g,p,m,w,v,N,y,S,R,A,D,F,_,x=i.s==o.s?1:-1,I=i.c,L=o.c;if(!(I&&I[0]&&L&&L[0]))return new E(i.s&&o.s&&(I?!L||I[0]!=L[0]:L)?I&&0==I[0]||!L?0*x:x/0:NaN);for(w=new E(x),v=w.c=[],c=i.e-o.e,x=u+c+1,f||(f=b,c=t(i.e/O)-t(o.e/O),x=x/O|0),a=0;L[a]==(I[a]||0);a++);if(L[a]>(I[a]||0)&&c--,0>x)v.push(1),h=!0;else{for(A=I.length,F=L.length,a=0,x+=2,g=d(f/(L[0]+1)),g>1&&(L=e(L,g,f),I=e(I,g,f),F=L.length,A=I.length),R=F,N=I.slice(0,F),y=N.length;F>y;N[y++]=0);_=L.slice(),_.unshift(0),D=L[0],L[1]>=f/2&&D++;do{if(g=0,l=n(L,N,F,y),0>l){if(S=N[0],F!=y&&(S=S*f+(N[1]||0)),g=d(S/D),g>1)for(g>=f&&(g=f-1),p=e(L,g,f),m=p.length,y=N.length;1==n(p,N,m,y);)g--,r(p,m>F?_:L,m,f),m=p.length,l=1;else 0==g&&(l=g=1),p=L.slice(),m=p.length;if(y>m&&p.unshift(0),r(N,p,y,f),y=N.length,-1==l)for(;n(L,N,F,y)<1;)g++,r(N,y>F?_:L,y,f),y=N.length}else 0===l&&(g++,N=[0]);v[a++]=g,N[0]?N[y++]=I[R]||0:(N=[I[R]],y=1)}while((R++=10;x/=10,a++);U(w,u+(w.e=a+c*O-1)+1,s,h)}else w.e=c,w.r=+h;return w}}(),h=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,t=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,u,s,f){var l,c=s?u:u.replace(i,"");if(r.test(c))o.s=isNaN(c)?null:0>c?-1:1;else{if(!s&&(c=c.replace(e,function(e,n,t){return l="x"==(t=t.toLowerCase())?16:"b"==t?2:8,f&&f!=l?e:n}),f&&(l=f,c=c.replace(n,"$1").replace(t,"0.$1")),u!=c))return new E(c,l);j&&L(M,"not a"+(f?" base "+f:"")+" number",u),o.s=null}o.c=o.e=null,M=0}}(),T.absoluteValue=T.abs=function(){var e=new E(this);return e.s<0&&(e.s=1),e},T.ceil=function(){return U(new E(this),this.e+1,2)},T.comparedTo=T.cmp=function(e,n){return M=1,i(this,new E(e,n))},T.decimalPlaces=T.dp=function(){var e,n,r=this.c;if(!r)return null;if(e=((n=r.length-1)-t(this.e/O))*O,n=r[n])for(;n%10==0;n/=10,e--);return 0>e&&(e=0),e},T.dividedBy=T.div=function(e,n){return M=3,C(this,new E(e,n),P,k)},T.dividedToIntegerBy=T.divToInt=function(e,n){return M=4,C(this,new E(e,n),0,1)},T.equals=T.eq=function(e,n){return M=5,0===i(this,new E(e,n))},T.floor=function(){return U(new E(this),this.e+1,3)},T.greaterThan=T.gt=function(e,n){return M=6,i(this,new E(e,n))>0},T.greaterThanOrEqualTo=T.gte=function(e,n){return M=7,1===(n=i(this,new E(e,n)))||0===n},T.isFinite=function(){return!!this.c},T.isInteger=T.isInt=function(){return!!this.c&&t(this.e/O)>this.c.length-2},T.isNaN=function(){return!this.s},T.isNegative=T.isNeg=function(){return this.s<0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.lessThan=T.lt=function(e,n){return M=8,i(this,new E(e,n))<0},T.lessThanOrEqualTo=T.lte=function(e,n){return M=9,-1===(n=i(this,new E(e,n)))||0===n},T.minus=T.sub=function(e,n){var r,i,o,u,s=this,f=s.s;if(M=10,e=new E(e,n),n=e.s,!f||!n)return new E(NaN);if(f!=n)return e.s=-n,s.plus(e);var l=s.e/O,c=e.e/O,a=s.c,h=e.c;if(!l||!c){if(!a||!h)return a?(e.s=-n,e):new E(h?s:NaN);if(!a[0]||!h[0])return h[0]?(e.s=-n,e):new E(a[0]?s:3==k?-0:0)}if(l=t(l),c=t(c),a=a.slice(),f=l-c){for((u=0>f)?(f=-f,o=a):(c=l,o=h),o.reverse(),n=f;n--;o.push(0));o.reverse()}else for(i=(u=(f=a.length)<(n=h.length))?f:n,f=n=0;i>n;n++)if(a[n]!=h[n]){u=a[n]0)for(;n--;a[r++]=0);for(n=b-1;i>f;){if(a[--i]0?(s=u,r=l):(o=-o,r=f),r.reverse();o--;r.push(0));r.reverse()}for(o=f.length,n=l.length,0>o-n&&(r=l,l=f,f=r,n=o),o=0;n;)o=(f[--n]=f[n]+l[n]+o)/b|0,f[n]%=b;return o&&(f.unshift(o),++s),I(e,f,s)},T.precision=T.sd=function(e){var n,t,r=this,i=r.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(j&&L(13,"argument"+m,e),e!=!!e&&(e=null)),!i)return null;if(t=i.length-1,n=t*O+1,t=i[t]){for(;t%10==0;t/=10,n--);for(t=i[0];t>=10;t/=10,n++);}return e&&r.e+1>n&&(n=r.e+1),n},T.round=function(e,n){var t=new E(this);return(null==e||H(e,0,A,15))&&U(t,~~e+this.e+1,null!=n&&H(n,0,8,15,w)?0|n:k),t},T.shift=function(e){var n=this;return H(e,-y,y,16,"argument")?n.times("1e"+c(e)):new E(n.c&&n.c[0]&&(-y>e||e>y)?n.s*(0>e?0:1/0):n)},T.squareRoot=T.sqrt=function(){var e,n,i,o,u,s=this,f=s.c,l=s.s,c=s.e,a=P+4,h=new E("0.5");if(1!==l||!f||!f[0])return new E(!l||0>l&&(!f||f[0])?NaN:f?s:1/0);if(l=Math.sqrt(+s),0==l||l==1/0?(n=r(f),(n.length+c)%2==0&&(n+="0"),l=Math.sqrt(n),c=t((c+1)/2)-(0>c||c%2),l==1/0?n="1e"+c:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+c),i=new E(n)):i=new E(l+""),i.c[0])for(c=i.e,l=c+a,3>l&&(l=0);;)if(u=i,i=h.times(u.plus(C(s,u,a,1))),r(u.c).slice(0,l)===(n=r(i.c)).slice(0,l)){if(i.el&&(d=N,N=y,y=d,o=l,l=h,h=o),o=l+h,d=[];o--;d.push(0));for(m=b,w=R,o=h;--o>=0;){for(r=0,g=y[o]%w,p=y[o]/w|0,s=l,u=o+s;u>o;)c=N[--s]%w,a=N[s]/w|0,f=p*c+a*g,c=g*c+f%w*w+d[u]+r,r=(c/m|0)+(f/w|0)+p*a,d[u--]=c%m;d[u]=r}return r?++i:d.shift(),I(e,d,i)},T.toDigits=function(e,n){var t=new E(this);return e=null!=e&&H(e,1,A,18,"precision")?0|e:null,n=null!=n&&H(n,0,8,18,w)?0|n:k,e?U(t,e,n):t},T.toExponential=function(e,n){return F(this,null!=e&&H(e,0,A,19)?~~e+1:null,n,19)},T.toFixed=function(e,n){return F(this,null!=e&&H(e,0,A,20)?~~e+this.e+1:null,n,20)},T.toFormat=function(e,n){var t=F(this,null!=e&&H(e,0,A,21)?~~e+this.e+1:null,n,21);if(this.c){var r,i=t.split("."),o=+X.groupSize,u=+X.secondaryGroupSize,s=X.groupSeparator,f=i[0],l=i[1],c=this.s<0,a=c?f.slice(1):f,h=a.length;if(u&&(r=o,o=u,u=r,h-=r),o>0&&h>0){for(r=h%o||o,f=a.substr(0,r);h>r;r+=o)f+=s+a.substr(r,o);u>0&&(f+=s+a.slice(r)),c&&(f="-"+f)}t=l?f+X.decimalSeparator+((u=+X.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+X.fractionGroupSeparator):l):f}return t},T.toFraction=function(e){var n,t,i,o,u,s,f,l,c,a=j,h=this,g=h.c,p=new E(q),d=t=new E(q),m=f=new E(q);if(null!=e&&(j=!1,s=new E(e),j=a,(!(a=s.isInt())||s.lt(q))&&(j&&L(22,"max denominator "+(a?"out of range":"not an integer"),e),e=!a&&s.c&&U(s,s.e+1,1).gte(q)?s:null)),!g)return h.toString();for(c=r(g),o=p.e=c.length-h.e-1,p.c[0]=S[(u=o%O)<0?O+u:u],e=!e||s.cmp(p)>0?o>0?p:d:s,u=z,z=1/0,s=new E(c),f.c[0]=0;l=C(s,p,0,1),i=t.plus(l.times(m)),1!=i.cmp(e);)t=m,m=i,d=f.plus(l.times(i=d)),f=i,p=s.minus(l.times(i=p)),s=i;return i=C(e.minus(t),m,0,1),f=f.plus(i.times(d)),t=t.plus(i.times(m)),f.s=d.s=h.s,o*=2,n=C(d,m,o,k).minus(h).abs().cmp(C(f,t,o,k).minus(h).abs())<1?[d.toString(),m.toString()]:[f.toString(),t.toString()],z=u,n},T.toNumber=function(){return+this},T.toPower=T.pow=function(e){var n,t,r=d(0>e?-e:+e),i=this;if(!H(e,-y,y,23,"exponent")&&(!isFinite(e)||r>y&&(e/=0)||parseFloat(e)!=e&&!(e=NaN)))return new E(Math.pow(+i,e));for(n=J?p(J/O+2):0,t=new E(q);;){if(r%2){if(t=t.times(i),!t.c)break;n&&t.c.length>n&&(t.c.length=n)}if(r=d(r/2),!r)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return 0>e&&(t=q.div(t)),n?U(t,J,k):t},T.toPrecision=function(e,n){return F(this,null!=e&&H(e,1,A,24,"precision")?0|e:null,n,24)},T.toString=function(e){var n,t=this,i=t.s,o=t.e;return null===o?i?(n="Infinity",0>i&&(n="-"+n)):n="NaN":(n=r(t.c),n=null!=e&&H(e,2,64,25,"base")?D(l(n,o),0|e,10,i):B>=o||o>=$?f(n,o):l(n,o),0>i&&t.c[0]&&(n="-"+n)),n},T.truncated=T.trunc=function(){return U(new E(this),this.e+1,1)},T.valueOf=T.toJSON=function(){var e,n=this,t=n.e;return null===t?n.toString():(e=r(n.c),e=B>=t||t>=$?f(e,t):l(e,t),n.s<0?"-"+e:e)},null!=e&&E.config(e),E}function t(e){var n=0|e;return e>0||e===n?n:n-1}function r(e){for(var n,t,r=1,i=e.length,o=e[0]+"";i>r;){for(n=e[r++]+"",t=O-n.length;t--;n="0"+n);o+=n}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function i(e,n){var t,r,i=e.c,o=n.c,u=e.s,s=n.s,f=e.e,l=n.e;if(!u||!s)return null;if(t=i&&!i[0],r=o&&!o[0],t||r)return t?r?0:-s:u;if(u!=s)return u;if(t=0>u,r=f==l,!i||!o)return r?0:!i^t?1:-1;if(!r)return f>l^t?1:-1;for(s=(f=i.length)<(l=o.length)?f:l,u=0;s>u;u++)if(i[u]!=o[u])return i[u]>o[u]^t?1:-1;return f==l?0:f>l^t?1:-1}function o(e,n,t){return(e=c(e))>=n&&t>=e}function u(e){return"[object Array]"==Object.prototype.toString.call(e)}function s(e,n,t){for(var r,i,o=[0],u=0,s=e.length;s>u;){for(i=o.length;i--;o[i]*=n);for(o[r=0]+=N.indexOf(e.charAt(u++));rt-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}function f(e,n){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(0>n?"e":"e+")+n}function l(e,n){var t,r;if(0>n){for(r="0.";++n;r+="0");e=r+e}else if(t=e.length,++n>t){for(r="0",n-=t;--n;r+="0");e+=r}else t>n&&(e=e.slice(0,n)+"."+e.slice(n));return e}function c(e){return e=parseFloat(e),0>e?p(e):d(e)}var a,h,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,p=Math.ceil,d=Math.floor,m=" not a boolean or binary digit",w="rounding mode",v="number type has more than 15 significant digits",N="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",b=1e14,O=14,y=9007199254740991,S=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],R=1e7,A=1e9;if("undefined"!=typeof crypto&&(a=crypto),"function"==typeof define&&define.amd)define(function(){return n()});else if("undefined"!=typeof module&&module.exports){if(module.exports=n(),!a)try{a=require("crypto")}catch(E){}}else e||(e="undefined"!=typeof self?self:Function("return this")()),e.BigNumber=n()}(this); /* jshint ignore:end */ })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["bigdecimal"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } function $rb_divide(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs / rhs : lhs['$/'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$===', '$attr_reader', '$new', '$class', '$bignumber', '$nan?', '$==', '$raise', '$<', '$coerce', '$>', '$mode', '$>=', '$/', '$zero?', '$infinite?', '$finite?']); (function($base, $super) { function $BigDecimal(){}; var self = $BigDecimal = $klass($base, $super, 'BigDecimal', $BigDecimal); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Numeric')); self.$require("js"); self.$require("bigdecimal/kernel"); self.$require("bigdecimal/bignumber.js"); return (function($base, $super) { function $BigDecimal(){}; var self = $BigDecimal = $klass($base, $super, 'BigDecimal', $BigDecimal); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25; Opal.cdecl($scope, 'ROUND_MODE', 256); Opal.cdecl($scope, 'ROUND_UP', 0); Opal.cdecl($scope, 'ROUND_DOWN', 1); Opal.cdecl($scope, 'ROUND_CEILING', 2); Opal.cdecl($scope, 'ROUND_FLOOR', 3); Opal.cdecl($scope, 'ROUND_HALF_UP', 4); Opal.cdecl($scope, 'ROUND_HALF_DOWN', 5); Opal.cdecl($scope, 'ROUND_HALF_EVEN', 6); Opal.cdecl($scope, 'SIGN_NaN', 0); Opal.cdecl($scope, 'SIGN_POSITIVE_ZERO', 1); Opal.cdecl($scope, 'SIGN_NEGATIVE_ZERO', -1); Opal.cdecl($scope, 'SIGN_POSITIVE_FINITE', 2); Opal.cdecl($scope, 'SIGN_NEGATIVE_FINITE', -2); Opal.cdecl($scope, 'SIGN_POSITIVE_INFINITE', 3); Opal.cdecl($scope, 'SIGN_NEGATIVE_INFINITE', -3); Opal.defs(self, '$limit', TMP_1 = function $$limit(digits) { var self = this; if (self.digits == null) self.digits = nil; if (digits == null) { digits = nil; } if (digits !== false && digits !== nil && digits != null) { self.digits = digits}; return self.digits; }, TMP_1.$$arity = -1); Opal.defs(self, '$mode', TMP_2 = function $$mode(mode, value) { var $a, self = this, $case = nil; if (self.round_mode == null) self.round_mode = nil; if (value == null) { value = nil; } return (function() {$case = mode;if ($scope.get('ROUND_MODE')['$===']($case)) {if (value !== false && value !== nil && value != null) { self.round_mode = value}; return ((($a = self.round_mode) !== false && $a !== nil && $a != null) ? $a : $scope.get('ROUND_HALF_UP'));}else { return nil }})(); }, TMP_2.$$arity = -2); self.$attr_reader("bignumber"); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(initial, digits) { var self = this; if (digits == null) { digits = 0; } return self.bignumber = $scope.get('JS').$new($scope.get('BigNumber'), initial); }, TMP_3.$$arity = -2); Opal.defn(self, '$==', TMP_4 = function(other) { var self = this, $case = nil; return (function() {$case = other;if (self.$class()['$===']($case)) {return self.$bignumber().equals(other.$bignumber())}else if ($scope.get('Number')['$===']($case)) {return self.$bignumber().equals(other)}else {return false}})(); }, TMP_4.$$arity = 1); Opal.alias(self, '===', '=='); Opal.defn(self, '$<=>', TMP_5 = function(other) { var self = this, $case = nil, result = nil; $case = other;if (self.$class()['$===']($case)) {result = self.$bignumber().comparedTo(other.$bignumber())}else if ($scope.get('Number')['$===']($case)) {result = self.$bignumber().comparedTo(other)}else {result = nil}; return result === null ? nil : result; }, TMP_5.$$arity = 1); Opal.defn(self, '$<', TMP_6 = function(other) { var $a, $b, $c, self = this, $iter = TMP_6.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_6.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : (($c = other !== false && other !== nil && other != null) ? other['$nan?']() : other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self, Opal.find_super_dispatcher(self, '<', TMP_6, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_6.$$arity = 1); Opal.defn(self, '$<=', TMP_7 = function(other) { var $a, $b, $c, self = this, $iter = TMP_7.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_7.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : (($c = other !== false && other !== nil && other != null) ? other['$nan?']() : other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self, Opal.find_super_dispatcher(self, '<=', TMP_7, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_7.$$arity = 1); Opal.defn(self, '$>', TMP_8 = function(other) { var $a, $b, $c, self = this, $iter = TMP_8.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_8.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : (($c = other !== false && other !== nil && other != null) ? other['$nan?']() : other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self, Opal.find_super_dispatcher(self, '>', TMP_8, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_8.$$arity = 1); Opal.defn(self, '$>=', TMP_9 = function(other) { var $a, $b, $c, self = this, $iter = TMP_9.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_9.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : (($c = other !== false && other !== nil && other != null) ? other['$nan?']() : other))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return false}; return ($a = ($b = self, Opal.find_super_dispatcher(self, '>=', TMP_9, false)), $a.$$p = $iter, $a).apply($b, $zuper); }, TMP_9.$$arity = 1); Opal.defn(self, '$abs', TMP_10 = function $$abs() { var self = this; return self.$class().$new(self.$bignumber().abs()); }, TMP_10.$$arity = 0); Opal.defn(self, '$add', TMP_11 = function $$add(other, digits) { var $a, $b, self = this, _ = nil, result = nil; if (digits == null) { digits = 0; } if (digits['$=='](nil)) { self.$raise($scope.get('TypeError'), "wrong argument type nil (expected Fixnum)")}; if ((($a = $rb_lt(digits, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "argument must be positive")}; $b = self.$coerce(other), $a = Opal.to_ary($b), other = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), $b; result = self.$bignumber().plus(other.$bignumber()); if ((($a = $rb_gt(digits, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = result.toDigits(digits, self.$class().$mode($scope.get('ROUND_MODE')))}; return self.$class().$new(result); }, TMP_11.$$arity = -2); Opal.alias(self, '+', 'add'); Opal.defn(self, '$ceil', TMP_12 = function $$ceil(n) { var $a, self = this; if (n == null) { n = nil; } if ((($a = self.$bignumber().isFinite()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('FloatDomainError'), "Computation results to 'Infinity'") }; if (n['$=='](nil)) { return self.$bignumber().round(0, $scope.get('ROUND_CEILING')).toNumber() } else if ((($a = $rb_ge(n, 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$class().$new(self.$bignumber().round(n, $scope.get('ROUND_CEILING'))) } else { return self.$class().$new(self.$bignumber().round(0, $scope.get('ROUND_CEILING'))) }; }, TMP_12.$$arity = -1); Opal.defn(self, '$coerce', TMP_13 = function $$coerce(other) { var self = this, $case = nil; return (function() {$case = other;if (self.$class()['$===']($case)) {return [other, self]}else if ($scope.get('Number')['$===']($case)) {return [self.$class().$new(other), self]}else {return self.$raise($scope.get('TypeError'), "" + (other.$class()) + " can't be coerced into " + (self.$class()))}})(); }, TMP_13.$$arity = 1); Opal.defn(self, '$div', TMP_14 = function $$div(other, digits) { var $a, $b, self = this, _ = nil; if (digits == null) { digits = nil; } if (digits['$=='](0)) { return $rb_divide(self, other)}; $b = self.$coerce(other), $a = Opal.to_ary($b), other = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), $b; if ((($a = ((($b = self['$nan?']()) !== false && $b !== nil && $b != null) ? $b : other['$nan?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('FloatDomainError'), "Computation results to 'NaN'(Not a Number)")}; if (digits['$=='](nil)) { if ((($a = other['$zero?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ZeroDivisionError'), "divided by 0")}; if ((($a = self['$infinite?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('FloatDomainError'), "Computation results to 'Infinity'")}; return self.$class().$new(self.$bignumber().dividedToIntegerBy(other.$bignumber()));}; return self.$class().$new(self.$bignumber().dividedBy(other.$bignumber()).round(digits, self.$class().$mode($scope.get('ROUND_MODE')))); }, TMP_14.$$arity = -2); Opal.defn(self, '$finite?', TMP_15 = function() { var self = this; return self.$bignumber().isFinite(); }, TMP_15.$$arity = 0); Opal.defn(self, '$infinite?', TMP_16 = function() { var $a, $b, self = this; if ((($a = ((($b = self['$finite?']()) !== false && $b !== nil && $b != null) ? $b : self['$nan?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if ((($a = self.$bignumber().isNegative()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return -1 } else { return 1 }; }, TMP_16.$$arity = 0); Opal.defn(self, '$minus', TMP_17 = function $$minus(other) { var $a, $b, self = this, _ = nil; $b = self.$coerce(other), $a = Opal.to_ary($b), other = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), $b; return self.$class().$new(self.$bignumber().minus(other.$bignumber())); }, TMP_17.$$arity = 1); Opal.alias(self, '-', 'minus'); Opal.defn(self, '$mult', TMP_18 = function $$mult(other, digits) { var $a, $b, self = this, _ = nil; if (digits == null) { digits = nil; } $b = self.$coerce(other), $a = Opal.to_ary($b), other = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), $b; if (digits['$=='](nil)) { return self.$class().$new(self.$bignumber().times(other.$bignumber()))}; return self.$class().$new(self.$bignumber().times(other.$bignumber()).round(digits, self.$class().$mode($scope.get('ROUND_MODE')))); }, TMP_18.$$arity = -2); Opal.alias(self, '*', 'mult'); Opal.defn(self, '$nan?', TMP_19 = function() { var self = this; return self.$bignumber().isNaN(); }, TMP_19.$$arity = 0); Opal.defn(self, '$quo', TMP_20 = function $$quo(other) { var $a, $b, self = this, _ = nil; $b = self.$coerce(other), $a = Opal.to_ary($b), other = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), $b; return self.$class().$new(self.$bignumber().dividedBy(other.$bignumber())); }, TMP_20.$$arity = 1); Opal.alias(self, '/', 'quo'); Opal.defn(self, '$sign', TMP_21 = function $$sign() { var $a, self = this; if ((($a = self.$bignumber().isNaN()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('SIGN_NaN')}; if ((($a = self.$bignumber().isZero()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (function() {if ((($a = self.$bignumber().isNegative()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('SIGN_NEGATIVE_ZERO') } else { return $scope.get('SIGN_POSITIVE_ZERO') }; return nil; })() } else { return nil }; }, TMP_21.$$arity = 0); Opal.defn(self, '$sub', TMP_22 = function $$sub(other, precision) { var $a, $b, self = this, _ = nil; $b = self.$coerce(other), $a = Opal.to_ary($b), other = ($a[0] == null ? nil : $a[0]), _ = ($a[1] == null ? nil : $a[1]), $b; return self.$class().$new(self.$bignumber().minus(other.$bignumber())); }, TMP_22.$$arity = 2); Opal.defn(self, '$to_f', TMP_23 = function $$to_f() { var self = this; return self.$bignumber().toNumber(); }, TMP_23.$$arity = 0); Opal.defn(self, '$to_s', TMP_24 = function $$to_s(s) { var self = this; if (s == null) { s = ""; } return self.$bignumber().toString(); }, TMP_24.$$arity = -1); return (Opal.defn(self, '$zero?', TMP_25 = function() { var self = this; return self.$bignumber().isZero(); }, TMP_25.$$arity = 0), nil) && 'zero?'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'VERSION', "0.8.1") })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/exception"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_accessor', '$errors=', '$join', '$message_list', '$errors']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ValidationException(){}; var self = $ValidationException = $klass($base, $super, 'ValidationException', $ValidationException); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; self.$attr_accessor("errors"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(errors) { var $a, $b, self = this; return (($a = [errors]), $b = self, $b['$errors='].apply($b, $a), $a[$a.length-1]); }, TMP_1.$$arity = 1); return (Opal.defn(self, '$to_s', TMP_2 = function $$to_s() { var self = this; return "" + (self.$errors().$message_list().$join("; ")); }, TMP_2.$$arity = 0), nil) && 'to_s'; })($scope.base, Opal.get('StandardError')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/errors"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$tap', '$merge!', '$new', '$[]', '$titleize', '$to_s', '$message', '$error_message_creator', '$Array', '$each', '$[]=', '$symbolic', '$concat', '$message_list', '$map', '$flatten', '$compact']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DefaultErrorMessageCreator(){}; var self = $DefaultErrorMessageCreator = $klass($base, $super, 'DefaultErrorMessageCreator', $DefaultErrorMessageCreator); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_1, TMP_2; Opal.cdecl($scope, 'MESSAGES', ($a = ($b = $scope.get('Hash').$new("is invalid")).$tap, $a.$$p = (TMP_1 = function(h){var self = TMP_1.$$s || this; if (h == null) h = nil; return h['$merge!']($hash2(["nils", "required", "string", "integer", "boolean", "hash", "array", "model", "date", "before", "after", "empty", "max_length", "min_length", "matches", "in", "class", "min", "max", "new_records"], {"nils": "can't be nil", "required": "is required", "string": "isn't a string", "integer": "isn't an integer", "boolean": "isn't a boolean", "hash": "isn't a hash", "array": "isn't an array", "model": "isn't the right class", "date": "date doesn't exist", "before": "isn't before given date", "after": "isn't after given date", "empty": "can't be blank", "max_length": "is too long", "min_length": "is too short", "matches": "isn't in the right format", "in": "isn't an option", "class": "isn't the right class", "min": "is too small", "max": "is too big", "new_records": "isn't a saved model"}))}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b)); return (Opal.defn(self, '$message', TMP_2 = function $$message(key, error_symbol, options) { var $a, self = this; if (options == null) { options = $hash2([], {}); } if ((($a = options['$[]']("index")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "" + ((((($a = key) !== false && $a !== nil && $a != null) ? $a : "array")).$to_s().$titleize()) + "[" + (options['$[]']("index")) + "] " + ($scope.get('MESSAGES')['$[]'](error_symbol)) } else { return "" + (key.$to_s().$titleize()) + " " + ($scope.get('MESSAGES')['$[]'](error_symbol)) }; }, TMP_2.$$arity = -3), nil) && 'message'; })($scope.base, null); (function($base, $super) { function $ErrorAtom(){}; var self = $ErrorAtom = $klass($base, $super, 'ErrorAtom', $ErrorAtom); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6; def.symbol = def.message = def.key = def.index = nil; Opal.defn(self, '$initialize', TMP_3 = function $$initialize(key, error_symbol, options) { var self = this; if (options == null) { options = $hash2([], {}); } self.key = key; self.symbol = error_symbol; self.message = options['$[]']("message"); return self.index = options['$[]']("index"); }, TMP_3.$$arity = -3); Opal.defn(self, '$symbolic', TMP_4 = function $$symbolic() { var self = this; return self.symbol; }, TMP_4.$$arity = 0); Opal.defn(self, '$message', TMP_5 = function $$message() { var $a, self = this; return ((($a = self.message) !== false && $a !== nil && $a != null) ? $a : self.message = $scope.get('Mutations').$error_message_creator().$message(self.key, self.symbol, $hash2(["index"], {"index": self.index}))); }, TMP_5.$$arity = 0); return (Opal.defn(self, '$message_list', TMP_6 = function $$message_list() { var self = this; return self.$Array(self.$message()); }, TMP_6.$$arity = 0), nil) && 'message_list'; })($scope.base, null); (function($base, $super) { function $ErrorHash(){}; var self = $ErrorHash = $klass($base, $super, 'ErrorHash', $ErrorHash); var def = self.$$proto, $scope = self.$$scope, TMP_9, TMP_12, TMP_14; Opal.defn(self, '$symbolic', TMP_9 = function $$symbolic() { var $a, $b, TMP_7, self = this; return ($a = ($b = $scope.get('HashWithIndifferentAccess').$new()).$tap, $a.$$p = (TMP_7 = function(hash){var self = TMP_7.$$s || this, $c, $d, TMP_8; if (hash == null) hash = nil; return ($c = ($d = self).$each, $c.$$p = (TMP_8 = function(k, v){var self = TMP_8.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return hash['$[]='](k, v.$symbolic())}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8), $c).call($d)}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($b); }, TMP_9.$$arity = 0); Opal.defn(self, '$message', TMP_12 = function $$message() { var $a, $b, TMP_10, self = this; return ($a = ($b = $scope.get('HashWithIndifferentAccess').$new()).$tap, $a.$$p = (TMP_10 = function(hash){var self = TMP_10.$$s || this, $c, $d, TMP_11; if (hash == null) hash = nil; return ($c = ($d = self).$each, $c.$$p = (TMP_11 = function(k, v){var self = TMP_11.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return hash['$[]='](k, v.$message())}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11), $c).call($d)}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $a).call($b); }, TMP_12.$$arity = 0); return (Opal.defn(self, '$message_list', TMP_14 = function $$message_list() { var $a, $b, TMP_13, self = this, list = nil; list = []; ($a = ($b = self).$each, $a.$$p = (TMP_13 = function(k, v){var self = TMP_13.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return list.$concat(v.$message_list())}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13), $a).call($b); return list; }, TMP_14.$$arity = 0), nil) && 'message_list'; })($scope.base, $scope.get('Hash')); (function($base, $super) { function $ErrorArray(){}; var self = $ErrorArray = $klass($base, $super, 'ErrorArray', $ErrorArray); var def = self.$$proto, $scope = self.$$scope, TMP_16, TMP_18, TMP_20; Opal.defn(self, '$symbolic', TMP_16 = function $$symbolic() { var $a, $b, TMP_15, self = this; return ($a = ($b = self).$map, $a.$$p = (TMP_15 = function(e){var self = TMP_15.$$s || this, $c; if (e == null) e = nil; return (($c = e !== false && e !== nil && e != null) ? e.$symbolic() : e)}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $a).call($b); }, TMP_16.$$arity = 0); Opal.defn(self, '$message', TMP_18 = function $$message() { var $a, $b, TMP_17, self = this; return ($a = ($b = self).$map, $a.$$p = (TMP_17 = function(e){var self = TMP_17.$$s || this, $c; if (e == null) e = nil; return (($c = e !== false && e !== nil && e != null) ? e.$message() : e)}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b); }, TMP_18.$$arity = 0); return (Opal.defn(self, '$message_list', TMP_20 = function $$message_list() { var $a, $b, TMP_19, self = this; return ($a = ($b = self.$compact()).$map, $a.$$p = (TMP_19 = function(e){var self = TMP_19.$$s || this; if (e == null) e = nil; return e.$message_list()}, TMP_19.$$s = self, TMP_19.$$arity = 1, TMP_19), $a).call($b).$flatten(); }, TMP_20.$$arity = 0), nil) && 'message_list'; })($scope.base, $scope.get('Array')); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/input_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_accessor', '$options=', '$merge', '$default_options', '$class', '$has_key?', '$options', '$[]', '$!']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $InputFilter(){}; var self = $InputFilter = $klass($base, $super, 'InputFilter', $InputFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; Opal.defs(self, '$default_options', TMP_1 = function $$default_options() { var $a, self = this; if (self.default_options == null) self.default_options = nil; return ((($a = self.default_options) !== false && $a !== nil && $a != null) ? $a : self.default_options = $hash2([], {})); }, TMP_1.$$arity = 0); self.$attr_accessor("options"); Opal.defn(self, '$initialize', TMP_2 = function $$initialize(opts) { var $a, $b, $c, self = this; if (opts == null) { opts = $hash2([], {}); } return (($a = [(((($c = self.$class().$default_options()) !== false && $c !== nil && $c != null) ? $c : $hash2([], {}))).$merge(opts)]), $b = self, $b['$options='].apply($b, $a), $a[$a.length-1]); }, TMP_2.$$arity = -1); Opal.defn(self, '$filter', TMP_3 = function $$filter(data) { var self = this; return [data, nil]; }, TMP_3.$$arity = 1); Opal.defn(self, '$has_default?', TMP_4 = function() { var self = this; return self.$options()['$has_key?']("default"); }, TMP_4.$$arity = 0); Opal.defn(self, '$default', TMP_5 = function() { var self = this; return self.$options()['$[]']("default"); }, TMP_5.$$arity = 0); Opal.defn(self, '$discard_nils?', TMP_6 = function() { var self = this; return self.$options()['$[]']("nils")['$!'](); }, TMP_6.$$arity = 0); Opal.defn(self, '$discard_empty?', TMP_7 = function() { var self = this; return self.$options()['$[]']("discard_empty"); }, TMP_7.$$arity = 0); return (Opal.defn(self, '$discard_invalid?', TMP_8 = function() { var self = this; return self.$options()['$[]']("discard_invalid"); }, TMP_8.$$arity = 0), nil) && 'discard_invalid?'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/hash_filter"] = function(Opal) { function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$define_method', '$[]', '$[]=', '$to_sym', '$new', '$to_proc', '$attr_accessor', '$instance_eval', '$each_pair', '$optional_inputs', '$required_inputs', '$keys', '$nil?', '$options', '$is_a?', '$with_indifferent_access', '$each', '$==', '$has_key?', '$filter', '$!', '$discard_invalid?', '$delete', '$discard_empty?', '$discard_nils?', '$has_default?', '$default', '$-', '$any?']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $HashFilter(){}; var self = $HashFilter = $klass($base, $super, 'HashFilter', $HashFilter); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_17; def.required_inputs = def.optional_inputs = def.current_inputs = nil; Opal.defs(self, '$register_additional_filter', TMP_2 = function $$register_additional_filter(type_class, type_name) { var $a, $b, TMP_1, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function($c_rest){var self = TMP_1.$$s || this, block, args, $d, $e, name = nil, options = nil; if (self.current_inputs == null) self.current_inputs = nil; block = TMP_1.$$p || nil, TMP_1.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } name = args['$[]'](0); options = ((($d = args['$[]'](1)) !== false && $d !== nil && $d != null) ? $d : $hash2([], {})); return self.current_inputs['$[]='](name.$to_sym(), ($d = ($e = type_class).$new, $d.$$p = block.$to_proc(), $d).call($e, options));}, TMP_1.$$s = self, TMP_1.$$arity = -1, TMP_1), $a).call($b, type_name); }, TMP_2.$$arity = 2); self.default_options = $hash2(["nils"], {"nils": false}); self.$attr_accessor("optional_inputs"); self.$attr_accessor("required_inputs"); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(opts) { var $a, $b, $c, self = this, $iter = TMP_3.$$p, block = $iter || nil; if (opts == null) { opts = $hash2([], {}); } TMP_3.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($b, opts); self.optional_inputs = $hash2([], {}); self.required_inputs = $hash2([], {}); self.current_inputs = self.required_inputs; if ((block !== nil)) { return ($a = ($c = self).$instance_eval, $a.$$p = block.$to_proc(), $a).call($c) } else { return nil }; }, TMP_3.$$arity = -1); Opal.defn(self, '$dup', TMP_6 = function $$dup() { var $a, $b, TMP_4, $c, TMP_5, self = this, dupped = nil; dupped = $scope.get('HashFilter').$new(); ($a = ($b = self.optional_inputs).$each_pair, $a.$$p = (TMP_4 = function(k, v){var self = TMP_4.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return dupped.$optional_inputs()['$[]='](k, v)}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4), $a).call($b); ($a = ($c = self.required_inputs).$each_pair, $a.$$p = (TMP_5 = function(k, v){var self = TMP_5.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return dupped.$required_inputs()['$[]='](k, v)}, TMP_5.$$s = self, TMP_5.$$arity = 2, TMP_5), $a).call($c); return dupped; }, TMP_6.$$arity = 0); Opal.defn(self, '$required', TMP_7 = function $$required() { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; self.current_inputs = self.required_inputs; return ($a = ($b = self).$instance_eval, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_7.$$arity = 0); Opal.defn(self, '$optional', TMP_8 = function $$optional() { var $a, $b, self = this, $iter = TMP_8.$$p, block = $iter || nil; TMP_8.$$p = null; self.current_inputs = self.optional_inputs; return ($a = ($b = self).$instance_eval, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_8.$$arity = 0); Opal.defn(self, '$required_keys', TMP_9 = function $$required_keys() { var self = this; return self.required_inputs.$keys(); }, TMP_9.$$arity = 0); Opal.defn(self, '$optional_keys', TMP_10 = function $$optional_keys() { var self = this; return self.optional_inputs.$keys(); }, TMP_10.$$arity = 0); Opal.defn(self, '$hash', TMP_11 = function $$hash(name, options) { var $a, $b, self = this, $iter = TMP_11.$$p, block = $iter || nil; if (options == null) { options = $hash2([], {}); } TMP_11.$$p = null; return self.current_inputs['$[]='](name.$to_sym(), ($a = ($b = $scope.get('HashFilter')).$new, $a.$$p = block.$to_proc(), $a).call($b, options)); }, TMP_11.$$arity = -2); Opal.defn(self, '$model', TMP_12 = function $$model(name, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.current_inputs['$[]='](name.$to_sym(), $scope.get('ModelFilter').$new(name.$to_sym(), options)); }, TMP_12.$$arity = -2); Opal.defn(self, '$array', TMP_13 = function $$array(name, options) { var $a, $b, self = this, $iter = TMP_13.$$p, block = $iter || nil, name_sym = nil; if (options == null) { options = $hash2([], {}); } TMP_13.$$p = null; name_sym = name.$to_sym(); return self.current_inputs['$[]='](name.$to_sym(), ($a = ($b = $scope.get('ArrayFilter')).$new, $a.$$p = block.$to_proc(), $a).call($b, name_sym, options)); }, TMP_13.$$arity = -2); return (Opal.defn(self, '$filter', TMP_17 = function $$filter(data) { var $a, $b, TMP_14, $c, TMP_16, self = this, errors = nil, filtered_data = nil, wildcard_filterer = nil, filtered_keys = nil; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if ((($a = data['$is_a?']($scope.get('Hash'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return [data, "hash"] }; if ((($a = data['$is_a?']($scope.get('HashWithIndifferentAccess'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { data = data.$with_indifferent_access() }; errors = $scope.get('ErrorHash').$new(); filtered_data = $scope.get('HashWithIndifferentAccess').$new(); wildcard_filterer = nil; ($a = ($b = [[self.required_inputs, true], [self.optional_inputs, false]]).$each, $a.$$p = (TMP_14 = function($c){var self = TMP_14.$$s || this, $c_args, inputs, is_required, $d, $e, TMP_15; if ($c == null) { $c = nil; } $c = Opal.to_ary($c); $c_args = Opal.slice.call($c, 0, $c.length); inputs = $c_args.splice(0,1)[0]; if (inputs == null) { inputs = nil; } is_required = $c_args.splice(0,1)[0]; if (is_required == null) { is_required = nil; } return ($d = ($e = inputs).$each_pair, $d.$$p = (TMP_15 = function(key, filterer){var self = TMP_15.$$s || this, $c, $f, $g, data_element = nil, sub_data = nil, sub_error = nil; if (key == null) key = nil;if (filterer == null) filterer = nil; if (key['$==']("*")) { wildcard_filterer = filterer; return nil;;}; data_element = data['$[]'](key); if ((($c = data['$has_key?'](key)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { $f = filterer.$filter(data_element), $c = Opal.to_ary($f), sub_data = ($c[0] == null ? nil : $c[0]), sub_error = ($c[1] == null ? nil : $c[1]), $f; if ((($c = sub_error['$nil?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { filtered_data['$[]='](key, sub_data) } else if ((($c = ($f = is_required['$!'](), $f !== false && $f !== nil && $f != null ?filterer['$discard_invalid?']() : $f)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { data.$delete(key) } else if ((($c = ($f = ($g = is_required['$!'](), $g !== false && $g !== nil && $g != null ?sub_error['$==']("empty") : $g), $f !== false && $f !== nil && $f != null ?filterer['$discard_empty?']() : $f)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { data.$delete(key) } else if ((($c = ($f = ($g = is_required['$!'](), $g !== false && $g !== nil && $g != null ?sub_error['$==']("nils") : $g), $f !== false && $f !== nil && $f != null ?filterer['$discard_nils?']() : $f)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { data.$delete(key) } else { if ((($c = sub_error['$is_a?']($scope.get('Symbol'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { sub_error = $scope.get('ErrorAtom').$new(key, sub_error)}; errors['$[]='](key, sub_error); };}; if ((($c = data['$has_key?'](key)['$!']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = filterer['$has_default?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return filtered_data['$[]='](key, filterer.$default()) } else if (is_required !== false && is_required !== nil && is_required != null) { return errors['$[]='](key, $scope.get('ErrorAtom').$new(key, "required")) } else { return nil } } else { return nil };}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $d).call($e)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14.$$has_top_level_mlhs_arg = true, TMP_14), $a).call($b); if (wildcard_filterer !== false && wildcard_filterer !== nil && wildcard_filterer != null) { filtered_keys = $rb_minus(data.$keys(), filtered_data.$keys()); ($a = ($c = filtered_keys).$each, $a.$$p = (TMP_16 = function(key){var self = TMP_16.$$s || this, $d, $e, data_element = nil, sub_data = nil, sub_error = nil; if (key == null) key = nil; data_element = data['$[]'](key); $e = wildcard_filterer.$filter(data_element), $d = Opal.to_ary($e), sub_data = ($d[0] == null ? nil : $d[0]), sub_error = ($d[1] == null ? nil : $d[1]), $e; if ((($d = sub_error['$nil?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return filtered_data['$[]='](key, sub_data) } else if ((($d = wildcard_filterer['$discard_invalid?']()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return data.$delete(key) } else if ((($d = (($e = sub_error['$==']("empty")) ? wildcard_filterer['$discard_empty?']() : sub_error['$==']("empty"))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return data.$delete(key) } else if ((($d = (($e = sub_error['$==']("nils")) ? wildcard_filterer['$discard_nils?']() : sub_error['$==']("nils"))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return data.$delete(key) } else { if ((($d = sub_error['$is_a?']($scope.get('Symbol'))) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { sub_error = $scope.get('ErrorAtom').$new(key, sub_error)}; return errors['$[]='](key, sub_error); };}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($c);}; if ((($a = errors['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, errors] } else { return [filtered_data, nil] }; }, TMP_17.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('InputFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/array_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$define_method', '$[]', '$new', '$to_proc', '$instance_eval', '$options', '$raise', '$to_sym', '$nil?', '$!', '$is_a?', '$==', '$Array', '$each_with_index', '$filter_element', '$<<', '$discard_invalid?', '$filter', '$constantize']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ArrayFilter(){}; var self = $ArrayFilter = $klass($base, $super, 'ArrayFilter', $ArrayFilter); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_9; def.element_filter = nil; Opal.defs(self, '$register_additional_filter', TMP_2 = function $$register_additional_filter(type_class, type_name) { var $a, $b, TMP_1, self = this; return ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function($c_rest){var self = TMP_1.$$s || this, block, args, $d, $e, options = nil; block = TMP_1.$$p || nil, TMP_1.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } options = ((($d = args['$[]'](0)) !== false && $d !== nil && $d != null) ? $d : $hash2([], {})); return self.element_filter = ($d = ($e = type_class).$new, $d.$$p = block.$to_proc(), $d).call($e, options);}, TMP_1.$$s = self, TMP_1.$$arity = -1, TMP_1), $a).call($b, type_name); }, TMP_2.$$arity = 2); self.default_options = $hash2(["nils", "class", "arrayize"], {"nils": false, "class": nil, "arrayize": false}); Opal.defn(self, '$initialize', TMP_3 = function $$initialize(name, opts) { var $a, $b, $c, $d, self = this, $iter = TMP_3.$$p, block = $iter || nil; if (opts == null) { opts = $hash2([], {}); } TMP_3.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_3, false)), $a.$$p = null, $a).call($b, opts); self.name = name; self.element_filter = nil; if ((block !== nil)) { ($a = ($c = self).$instance_eval, $a.$$p = block.$to_proc(), $a).call($c)}; if ((($a = ($d = self.element_filter, $d !== false && $d !== nil && $d != null ?self.$options()['$[]']("class") : $d)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('ArgumentError').$new("Can't supply both a class and a filter")) } else { return nil }; }, TMP_3.$$arity = -2); Opal.defn(self, '$hash', TMP_4 = function $$hash(options) { var $a, $b, self = this, $iter = TMP_4.$$p, block = $iter || nil; if (options == null) { options = $hash2([], {}); } TMP_4.$$p = null; return self.element_filter = ($a = ($b = $scope.get('HashFilter')).$new, $a.$$p = block.$to_proc(), $a).call($b, options); }, TMP_4.$$arity = -1); Opal.defn(self, '$model', TMP_5 = function $$model(name, options) { var self = this; if (options == null) { options = $hash2([], {}); } return self.element_filter = $scope.get('ModelFilter').$new(name.$to_sym(), options); }, TMP_5.$$arity = -2); Opal.defn(self, '$array', TMP_6 = function $$array(options) { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; if (options == null) { options = $hash2([], {}); } TMP_6.$$p = null; return self.element_filter = ($a = ($b = $scope.get('ArrayFilter')).$new, $a.$$p = block.$to_proc(), $a).call($b, nil, options); }, TMP_6.$$arity = -1); Opal.defn(self, '$filter', TMP_8 = function $$filter(data) { var $a, $b, TMP_7, $c, $d, self = this, errors = nil, filtered_data = nil, found_error = nil; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if ((($a = ($b = data['$is_a?']($scope.get('Array'))['$!'](), $b !== false && $b !== nil && $b != null ?self.$options()['$[]']("arrayize") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (data['$==']("")) { return [[], nil]}; data = self.$Array(data);}; if ((($a = data['$is_a?']($scope.get('Array'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { errors = $scope.get('ErrorArray').$new(); filtered_data = []; found_error = false; ($a = ($b = data).$each_with_index, $a.$$p = (TMP_7 = function(el, i){var self = TMP_7.$$s || this, $c, $d, el_filtered = nil, el_error = nil; if (self.name == null) self.name = nil; if (el == null) el = nil;if (i == null) i = nil; $d = self.$filter_element(el), $c = Opal.to_ary($d), el_filtered = ($c[0] == null ? nil : $c[0]), el_error = ($c[1] == null ? nil : $c[1]), $d; if ((($c = el_error['$is_a?']($scope.get('Symbol'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { el_error = $scope.get('ErrorAtom').$new(self.name, el_error, $hash2(["index"], {"index": i}))}; errors['$<<'](el_error); if (el_error !== false && el_error !== nil && el_error != null) { return found_error = true } else { return filtered_data['$<<'](el_filtered) };}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7), $a).call($b); if ((($a = (($c = found_error !== false && found_error !== nil && found_error != null) ? (($d = self.element_filter, $d !== false && $d !== nil && $d != null ?self.element_filter['$discard_invalid?']() : $d))['$!']() : found_error)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, errors] } else { return [filtered_data, nil] }; } else { return [data, "array"] }; }, TMP_8.$$arity = 1); return (Opal.defn(self, '$filter_element', TMP_9 = function $$filter_element(data) { var $a, $b, self = this, el_errors = nil, class_const = nil; if ((($a = self.element_filter) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { $b = self.element_filter.$filter(data), $a = Opal.to_ary($b), data = ($a[0] == null ? nil : $a[0]), el_errors = ($a[1] == null ? nil : $a[1]), $b; if (el_errors !== false && el_errors !== nil && el_errors != null) { return [data, el_errors]}; } else if ((($a = self.$options()['$[]']("class")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { class_const = self.$options()['$[]']("class"); if ((($a = class_const['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { class_const = class_const.$constantize()}; if ((($a = data['$is_a?'](class_const)['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "class"]};}; return [data, nil]; }, TMP_9.$$arity = 1), nil) && 'filter_element'; })($scope.base, $scope.get('InputFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/additional_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$underscore', '$[]', '$name', '$register_additional_filter']); self.$require("mutations/hash_filter"); self.$require("mutations/array_filter"); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $AdditionalFilter(){}; var self = $AdditionalFilter = $klass($base, $super, 'AdditionalFilter', $AdditionalFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defs(self, '$inherited', TMP_1 = function $$inherited(subclass) { var self = this, type_name = nil; type_name = subclass.$name()['$[]'](/^Mutations::([a-zA-Z]*)Filter$/, 1).$underscore(); (($scope.get('Mutations')).$$scope.get('HashFilter')).$register_additional_filter(subclass, type_name); return (($scope.get('Mutations')).$$scope.get('ArrayFilter')).$register_additional_filter(subclass, type_name); }, TMP_1.$$arity = 1), nil) && 'inherited' })($scope.base, $scope.get('InputFilter')) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/string_filter"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$!', '$any?', '$is_a?', '$to_s', '$gsub', '$strip', '$==', '$<', '$length', '$>', '$include?', '$!~']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StringFilter(){}; var self = $StringFilter = $klass($base, $super, 'StringFilter', $StringFilter); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.default_options = $hash2(["strip", "strict", "nils", "empty", "min_length", "max_length", "matches", "in", "discard_empty", "allow_control_characters"], {"strip": true, "strict": false, "nils": false, "empty": false, "min_length": nil, "max_length": nil, "matches": nil, "in": nil, "discard_empty": false, "allow_control_characters": false}); return (Opal.defn(self, '$filter', TMP_2 = function $$filter(data) { var $a, $b, $c, $d, TMP_1, self = this; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if ((($a = ($b = self.$options()['$[]']("strict")['$!'](), $b !== false && $b !== nil && $b != null ?($c = ($d = [$scope.get('TrueClass'), $scope.get('FalseClass'), $scope.get('Integer'), $scope.get('Float'), $scope.get('BigDecimal'), $scope.get('Symbol')])['$any?'], $c.$$p = (TMP_1 = function(klass){var self = TMP_1.$$s || this; if (klass == null) klass = nil; return data['$is_a?'](klass)}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $c).call($d) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = data.$to_s()}; if ((($a = data['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return [data, "string"] }; if ((($a = self.$options()['$[]']("allow_control_characters")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { data = data.$gsub(/[^[:print:]\t\r\n]+/, " ") }; if ((($a = self.$options()['$[]']("strip")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = data.$strip()}; if (data['$==']("")) { if ((($a = self.$options()['$[]']("empty")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, nil] } else { return [data, "empty"] }}; if ((($a = ($b = self.$options()['$[]']("min_length"), $b !== false && $b !== nil && $b != null ?$rb_lt(data.$length(), self.$options()['$[]']("min_length")) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "min_length"]}; if ((($a = ($b = self.$options()['$[]']("max_length"), $b !== false && $b !== nil && $b != null ?$rb_gt(data.$length(), self.$options()['$[]']("max_length")) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "max_length"]}; if ((($a = ($b = self.$options()['$[]']("in"), $b !== false && $b !== nil && $b != null ?self.$options()['$[]']("in")['$include?'](data)['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "in"]}; if ((($a = ($b = self.$options()['$[]']("matches"), $b !== false && $b !== nil && $b != null ?(self.$options()['$[]']("matches")['$!~'](data)) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "matches"]}; return [data, nil]; }, TMP_2.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/integer_filter"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$[]', '$options', '$==', '$nil?', '$!', '$is_a?', '$=~', '$to_i', '$<', '$>', '$include?']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $IntegerFilter(){}; var self = $IntegerFilter = $klass($base, $super, 'IntegerFilter', $IntegerFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.default_options = $hash2(["nils", "empty_is_nil", "min", "max", "in"], {"nils": false, "empty_is_nil": false, "min": nil, "max": nil, "in": nil}); return (Opal.defn(self, '$filter', TMP_1 = function $$filter(data) { var $a, $b, self = this; if ((($a = ($b = self.$options()['$[]']("empty_is_nil"), $b !== false && $b !== nil && $b != null ?data['$==']("") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = nil}; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if (data['$==']("")) { return [data, "empty"]}; if ((($a = data['$is_a?']($scope.get('Integer'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ($b = data['$is_a?']($scope.get('String')), $b !== false && $b !== nil && $b != null ?data['$=~'](/^-?\d/) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = data.$to_i() } else { return [data, "integer"] }}; if ((($a = ($b = self.$options()['$[]']("min"), $b !== false && $b !== nil && $b != null ?$rb_lt(data, self.$options()['$[]']("min")) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "min"]}; if ((($a = ($b = self.$options()['$[]']("max"), $b !== false && $b !== nil && $b != null ?$rb_gt(data, self.$options()['$[]']("max")) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "max"]}; if ((($a = ($b = self.$options()['$[]']("in"), $b !== false && $b !== nil && $b != null ?self.$options()['$[]']("in")['$include?'](data)['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "in"]}; return [data, nil]; }, TMP_1.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/float_filter"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$!', '$is_a?', '$=~', '$to_f', '$<', '$>']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $FloatFilter(){}; var self = $FloatFilter = $klass($base, $super, 'FloatFilter', $FloatFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.default_options = $hash2(["nils", "min", "max"], {"nils": false, "min": nil, "max": nil}); return (Opal.defn(self, '$filter', TMP_1 = function $$filter(data) { var $a, $b, self = this; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if (data['$==']("")) { return [data, "empty"]}; if ((($a = data['$is_a?']($scope.get('Float'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ($b = data['$is_a?']($scope.get('String')), $b !== false && $b !== nil && $b != null ?data['$=~'](/^[-+]?\d*\.?\d+/) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = data.$to_f() } else if ((($a = data['$is_a?']($scope.get('Integer'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = data.$to_f() } else { return [data, "float"] }}; if ((($a = ($b = self.$options()['$[]']("min"), $b !== false && $b !== nil && $b != null ?$rb_lt(data, self.$options()['$[]']("min")) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "min"]}; if ((($a = ($b = self.$options()['$[]']("max"), $b !== false && $b !== nil && $b != null ?$rb_gt(data, self.$options()['$[]']("max")) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "max"]}; return [data, nil]; }, TMP_1.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/boolean_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$is_a?', '$to_s', '$downcase']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BooleanFilter(){}; var self = $BooleanFilter = $klass($base, $super, 'BooleanFilter', $BooleanFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.default_options = $hash2(["nils"], {"nils": false}); Opal.cdecl($scope, 'BOOL_MAP', $hash2(["true", "1", "false", "0"], {"true": true, "1": true, "false": false, "0": false})); return (Opal.defn(self, '$filter', TMP_1 = function $$filter(data) { var $a, $b, self = this, res = nil; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if (data['$==']("")) { return [data, "empty"]}; if ((($a = ((($b = data['$=='](true)) !== false && $b !== nil && $b != null) ? $b : data['$=='](false))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, nil]}; if ((($a = data['$is_a?']($scope.get('Integer'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = data.$to_s()}; if ((($a = data['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { res = $scope.get('BOOL_MAP')['$[]'](data.$downcase()); if ((($a = res['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return [res, nil] }; return [data, "boolean"]; } else { return [data, "boolean"] }; }, TMP_1.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/duck_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$each', '$respond_to?', '$Array']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DuckFilter(){}; var self = $DuckFilter = $klass($base, $super, 'DuckFilter', $DuckFilter); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.default_options = $hash2(["nils", "methods"], {"nils": false, "methods": nil}); return (Opal.defn(self, '$filter', TMP_2 = function $$filter(data) {try { var $a, $b, TMP_1, self = this; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; ($a = ($b = self.$Array(self.$options()['$[]']("methods"))).$each, $a.$$p = (TMP_1 = function(method){var self = TMP_1.$$s || this, $c; if (method == null) method = nil; if ((($c = data['$respond_to?'](method)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return nil } else { Opal.ret([data, "duck"]) }}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); return [data, nil]; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_2.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/date_filter"] = function(Opal) { function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$is_a?', '$strptime', '$parse', '$respond_to?', '$to_date', '$<=', '$>=']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $DateFilter(){}; var self = $DateFilter = $klass($base, $super, 'DateFilter', $DateFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.default_options = $hash2(["nils", "format", "after", "before"], {"nils": false, "format": nil, "after": nil, "before": nil}); return (Opal.defn(self, '$filter', TMP_1 = function $$filter(data) { var $a, self = this, actual_date = nil; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if (""['$=='](data)) { return [data, "empty"]}; if ((($a = data['$is_a?']($scope.get('Date'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { actual_date = data } else if ((($a = data['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { try { actual_date = (function() {if ((($a = self.$options()['$[]']("format")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Date').$strptime(data, self.$options()['$[]']("format")) } else { return $scope.get('Date').$parse(data) }; return nil; })() } catch ($err) { if (Opal.rescue($err, [$scope.get('ArgumentError')])) { try { return [nil, "date"] } finally { Opal.pop_exception() } } else { throw $err; } } } else if ((($a = data['$respond_to?']("to_date")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { actual_date = data.$to_date() } else { return [nil, "date"] }; if ((($a = self.$options()['$[]']("after")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_le(actual_date, self.$options()['$[]']("after"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, "after"]}}; if ((($a = self.$options()['$[]']("before")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_ge(actual_date, self.$options()['$[]']("before"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, "before"]}}; return [actual_date, nil]; }, TMP_1.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/time_filter"] = function(Opal) { function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_ge(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs >= rhs : lhs['$>='](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$is_a?', '$strptime', '$parse', '$respond_to?', '$to_time', '$<=', '$>=']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $TimeFilter(){}; var self = $TimeFilter = $klass($base, $super, 'TimeFilter', $TimeFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.default_options = $hash2(["nils", "format", "after", "before"], {"nils": false, "format": nil, "after": nil, "before": nil}); return (Opal.defn(self, '$filter', TMP_1 = function $$filter(data) { var $a, self = this, actual_time = nil; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if (""['$=='](data)) { return [data, "empty"]}; if ((($a = data['$is_a?']($scope.get('Time'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { actual_time = data } else if ((($a = data['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { try { actual_time = (function() {if ((($a = self.$options()['$[]']("format")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Time').$strptime(data, self.$options()['$[]']("format")) } else { return $scope.get('Time').$parse(data) }; return nil; })() } catch ($err) { if (Opal.rescue($err, [$scope.get('ArgumentError')])) { try { return [nil, "time"] } finally { Opal.pop_exception() } } else { throw $err; } } } else if ((($a = data['$respond_to?']("to_time")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { actual_time = data.$to_time() } else { return [nil, "time"] }; if ((($a = self.$options()['$[]']("after")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_le(actual_time, self.$options()['$[]']("after"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, "after"]}}; if ((($a = self.$options()['$[]']("before")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_ge(actual_time, self.$options()['$[]']("before"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, "before"]}}; return [actual_time, nil]; }, TMP_1.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/file_filter"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$nil?', '$[]', '$options', '$==', '$concat', '$each', '$respond_to?', '$is_a?', '$>', '$size']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $FileFilter(){}; var self = $FileFilter = $klass($base, $super, 'FileFilter', $FileFilter); var def = self.$$proto, $scope = self.$$scope, TMP_2; self.default_options = $hash2(["nils", "upload", "size"], {"nils": false, "upload": false, "size": nil}); return (Opal.defn(self, '$filter', TMP_2 = function $$filter(data) {try { var $a, $b, TMP_1, self = this, methods = nil; if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if (data['$==']("")) { return [data, "empty"]}; methods = ["read", "size"]; if ((($a = self.$options()['$[]']("upload")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { methods.$concat(["original_filename", "content_type"])}; ($a = ($b = methods).$each, $a.$$p = (TMP_1 = function(method){var self = TMP_1.$$s || this, $c; if (method == null) method = nil; if ((($c = data['$respond_to?'](method)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return nil } else { Opal.ret([data, "file"]) }}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); if ((($a = self.$options()['$[]']("size")['$is_a?']($scope.get('Integer'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = $rb_gt(data.$size(), self.$options()['$[]']("size"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "size"]}}; return [data, nil]; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_2.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/model_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$[]', '$options', '$camelize', '$to_s', '$is_a?', '$constantize', '$[]=', '$cache_constants?', '$initialize_constants!', '$nil?', '$run', '$success?', '$result', '$errors', '$!', '$respond_to?', '$new_record?']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ModelFilter(){}; var self = $ModelFilter = $klass($base, $super, 'ModelFilter', $ModelFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; def.initialize_constants = def.name = nil; self.default_options = $hash2(["nils", "class", "builder", "new_records"], {"nils": false, "class": nil, "builder": nil, "new_records": false}); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(name, opts) { var $a, $b, self = this, $iter = TMP_1.$$p, $yield = $iter || nil; if (opts == null) { opts = $hash2([], {}); } TMP_1.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_1, false)), $a.$$p = null, $a).call($b, opts); return self.name = name; }, TMP_1.$$arity = -2); Opal.defn(self, '$initialize_constants!', TMP_2 = function() { var $a, $b, self = this, class_const = nil; ((($a = self.initialize_constants) !== false && $a !== nil && $a != null) ? $a : self.initialize_constants = (function() {class_const = ((($b = self.$options()['$[]']("class")) !== false && $b !== nil && $b != null) ? $b : self.name.$to_s().$camelize()); if ((($b = class_const['$is_a?']($scope.get('String'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { class_const = class_const.$constantize()}; self.$options()['$[]=']("class", class_const); if ((($b = self.$options()['$[]']("builder")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = self.$options()['$[]']("builder")['$is_a?']($scope.get('String'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$options()['$[]=']("builder", self.$options()['$[]']("builder").$constantize())}}; return true;})()); if ((($a = $scope.get('Mutations')['$cache_constants?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { if ((($a = self.$options()['$[]']("class")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$options()['$[]=']("class", self.$options()['$[]']("class").$to_s().$constantize())}; if ((($a = self.$options()['$[]']("builder")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$options()['$[]=']("builder", self.$options()['$[]']("builder").$to_s().$constantize()) } else { return nil }; }; }, TMP_2.$$arity = 0); return (Opal.defn(self, '$filter', TMP_3 = function $$filter(data) { var $a, $b, $c, self = this, ret = nil; self['$initialize_constants!'](); if ((($a = data['$nil?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self.$options()['$[]']("nils")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [nil, nil]}; return [nil, "nils"];}; if ((($a = ($b = data['$is_a?']($scope.get('Hash')), $b !== false && $b !== nil && $b != null ?self.$options()['$[]']("builder") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ret = self.$options()['$[]']("builder").$run(data); if ((($a = ret['$success?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { data = ret.$result() } else { return [data, ret.$errors()] };}; if ((($a = data['$is_a?'](self.$options()['$[]']("class"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ($b = self.$options()['$[]']("new_records")['$!'](), $b !== false && $b !== nil && $b != null ?(($c = data['$respond_to?']("new_record?"), $c !== false && $c !== nil && $c != null ?data['$new_record?']() : $c)) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [data, "new_records"]}; return [data, nil];}; return [data, "model"]; }, TMP_3.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('InputFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/outcome"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Outcome(){}; var self = $Outcome = $klass($base, $super, 'Outcome', $Outcome); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; def.success = nil; self.$attr_reader("result", "errors", "inputs"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(is_success, result, errors, inputs) { var $a, self = this; return $a = [is_success, result, errors, inputs], self.success = $a[0], self.result = $a[1], self.errors = $a[2], self.inputs = $a[3], $a; }, TMP_1.$$arity = 4); return (Opal.defn(self, '$success?', TMP_2 = function() { var self = this; return self.success; }, TMP_2.$$arity = 0), nil) && 'success?'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations/command"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$send', '$to_proc', '$input_filters', '$each', '$define_method', '$[]', '$has_key?', '$[]=', '$private', '$create_attr_methods', '$run', '$new', '$run!', '$validation_outcome', '$==', '$superclass', '$dup', '$inject', '$is_a?', '$raise', '$merge!', '$with_indifferent_access', '$filter', '$has_errors?', '$validate', '$class', '$!', '$nil?', '$execute', '$success?', '$result', '$errors', '$protected', '$attr_reader', '$tap', '$split', '$to_s', '$pop', '$to_sym', '$any?']); return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Command(){}; var self = $Command = $klass($base, $super, 'Command', $Command); var def = self.$$proto, $scope = self.$$scope, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_23, TMP_24; def.raw_inputs = def.errors = def.inputs = nil; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11; Opal.defn(self, '$create_attr_methods', TMP_1 = function $$create_attr_methods(meth) { var $a, $b, $c, TMP_2, self = this, $iter = TMP_1.$$p, block = $iter || nil, keys = nil; TMP_1.$$p = null; ($a = ($b = self.$input_filters()).$send, $a.$$p = block.$to_proc(), $a).call($b, meth); keys = self.$input_filters().$send("" + (meth) + "_keys"); return ($a = ($c = keys).$each, $a.$$p = (TMP_2 = function(key){var self = TMP_2.$$s || this, $d, $e, TMP_3, $f, TMP_4, $g, TMP_5; if (key == null) key = nil; ($d = ($e = self).$define_method, $d.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; if (self.inputs == null) self.inputs = nil; return self.inputs['$[]'](key)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $d).call($e, key); ($d = ($f = self).$define_method, $d.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; if (self.inputs == null) self.inputs = nil; return self.inputs['$has_key?'](key)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $d).call($f, "" + (key) + "_present?"); return ($d = ($g = self).$define_method, $d.$$p = (TMP_5 = function(v){var self = TMP_5.$$s || this; if (self.inputs == null) self.inputs = nil; if (v == null) v = nil; return self.inputs['$[]='](key, v)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $d).call($g, "" + (key) + "=");}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($c); }, TMP_1.$$arity = 1); self.$private("create_attr_methods"); Opal.defn(self, '$required', TMP_6 = function $$required() { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; TMP_6.$$p = null; return ($a = ($b = self).$create_attr_methods, $a.$$p = block.$to_proc(), $a).call($b, "required"); }, TMP_6.$$arity = 0); Opal.defn(self, '$optional', TMP_7 = function $$optional() { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; return ($a = ($b = self).$create_attr_methods, $a.$$p = block.$to_proc(), $a).call($b, "optional"); }, TMP_7.$$arity = 0); Opal.defn(self, '$run', TMP_8 = function $$run($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self).$new.apply($b, Opal.to_a(args)).$run(); }, TMP_8.$$arity = -1); Opal.defn(self, '$run!', TMP_9 = function($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self).$new.apply($b, Opal.to_a(args))['$run!'](); }, TMP_9.$$arity = -1); Opal.defn(self, '$validate', TMP_10 = function $$validate($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self).$new.apply($b, Opal.to_a(args)).$validation_outcome(); }, TMP_10.$$arity = -1); return (Opal.defn(self, '$input_filters', TMP_11 = function $$input_filters() { var $a, self = this; if (self.input_filters == null) self.input_filters = nil; return ((($a = self.input_filters) !== false && $a !== nil && $a != null) ? $a : self.input_filters = (function() {if ($scope.get('Command')['$=='](self.$superclass())) { return $scope.get('HashFilter').$new() } else { return self.$superclass().$input_filters().$dup() }; return nil; })()); }, TMP_11.$$arity = 0), nil) && 'input_filters'; })(Opal.get_singleton_class(self)); Opal.defn(self, '$initialize', TMP_13 = function $$initialize($a_rest) { var $b, $c, TMP_12, $d, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.raw_inputs = ($b = ($c = args).$inject, $b.$$p = (TMP_12 = function(h, arg){var self = TMP_12.$$s || this, $a; if (h == null) h = nil;if (arg == null) arg = nil; if ((($a = arg['$is_a?']($scope.get('Hash'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError').$new("All arguments must be hashes")) }; return h['$merge!'](arg);}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $b).call($c, $hash2([], {}).$with_indifferent_access()); $d = self.$input_filters().$filter(self.raw_inputs), $b = Opal.to_ary($d), self.inputs = ($b[0] == null ? nil : $b[0]), self.errors = ($b[1] == null ? nil : $b[1]), $d; if ((($b = self['$has_errors?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return nil } else { return self.$validate() }; }, TMP_13.$$arity = -1); Opal.defn(self, '$input_filters', TMP_14 = function $$input_filters() { var self = this; return self.$class().$input_filters(); }, TMP_14.$$arity = 0); Opal.defn(self, '$has_errors?', TMP_15 = function() { var self = this; return self.errors['$nil?']()['$!'](); }, TMP_15.$$arity = 0); Opal.defn(self, '$run', TMP_16 = function $$run() { var $a, self = this; if ((($a = self['$has_errors?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$validation_outcome()}; return self.$validation_outcome(self.$execute()); }, TMP_16.$$arity = 0); Opal.defn(self, '$run!', TMP_17 = function() { var $a, self = this, outcome = nil; outcome = self.$run(); if ((($a = outcome['$success?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return outcome.$result() } else { return self.$raise($scope.get('ValidationException').$new(outcome.$errors())) }; }, TMP_17.$$arity = 0); Opal.defn(self, '$validation_outcome', TMP_18 = function $$validation_outcome(result) { var $a, self = this; if (result == null) { result = nil; } return $scope.get('Outcome').$new(self['$has_errors?']()['$!'](), (function() {if ((($a = self['$has_errors?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return result }; return nil; })(), self.errors, self.inputs); }, TMP_18.$$arity = -1); self.$protected(); self.$attr_reader("inputs", "raw_inputs"); Opal.defn(self, '$validate', TMP_19 = function $$validate() { var self = this; return nil; }, TMP_19.$$arity = 0); Opal.defn(self, '$execute', TMP_20 = function $$execute() { var self = this; return nil; }, TMP_20.$$arity = 0); Opal.defn(self, '$add_error', TMP_23 = function $$add_error(key, kind, message) { var $a, $b, TMP_21, self = this; if (message == null) { message = nil; } if ((($a = kind['$is_a?']($scope.get('Symbol'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError').$new("Invalid kind")) }; ((($a = self.errors) !== false && $a !== nil && $a != null) ? $a : self.errors = $scope.get('ErrorHash').$new()); return ($a = ($b = self.errors).$tap, $a.$$p = (TMP_21 = function(errs){var self = TMP_21.$$s || this, $c, $d, TMP_22, path = nil, last = nil, inner = nil; if (errs == null) errs = nil; path = key.$to_s().$split("."); last = path.$pop(); inner = ($c = ($d = path).$inject, $c.$$p = (TMP_22 = function(cur_errors, part){var self = TMP_22.$$s || this, $e, $f, $g; if (cur_errors == null) cur_errors = nil;if (part == null) part = nil; return ($e = part.$to_sym(), $f = cur_errors, ((($g = $f['$[]']($e)) !== false && $g !== nil && $g != null) ? $g : $f['$[]=']($e, $scope.get('ErrorHash').$new())))}, TMP_22.$$s = self, TMP_22.$$arity = 2, TMP_22), $c).call($d, errs); return inner['$[]='](last, $scope.get('ErrorAtom').$new(key, kind, $hash2(["message"], {"message": message})));}, TMP_21.$$s = self, TMP_21.$$arity = 1, TMP_21), $a).call($b); }, TMP_23.$$arity = -3); return (Opal.defn(self, '$merge_errors', TMP_24 = function $$merge_errors(hash) { var $a, self = this; if ((($a = hash['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ((($a = self.errors) !== false && $a !== nil && $a != null) ? $a : self.errors = $scope.get('ErrorHash').$new()); return self.errors['$merge!'](hash); } else { return nil }; }, TMP_24.$$arity = 1), nil) && 'merge_errors'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["mutations"] = function(Opal) { var $a, $b, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$require', '$new', '$cache_constants=']); self.$require("active_support/core_ext/hash/indifferent_access"); self.$require("active_support/core_ext/string/inflections"); self.$require("date"); self.$require("time"); self.$require("bigdecimal"); self.$require("mutations/version"); self.$require("mutations/exception"); self.$require("mutations/errors"); self.$require("mutations/input_filter"); self.$require("mutations/additional_filter"); self.$require("mutations/string_filter"); self.$require("mutations/integer_filter"); self.$require("mutations/float_filter"); self.$require("mutations/boolean_filter"); self.$require("mutations/duck_filter"); self.$require("mutations/date_filter"); self.$require("mutations/time_filter"); self.$require("mutations/file_filter"); self.$require("mutations/model_filter"); self.$require("mutations/array_filter"); self.$require("mutations/hash_filter"); self.$require("mutations/outcome"); self.$require("mutations/command"); (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2, TMP_3, TMP_4; Opal.defn(self, '$error_message_creator', TMP_1 = function $$error_message_creator() { var $a, self = this; if (self.error_message_creator == null) self.error_message_creator = nil; return ((($a = self.error_message_creator) !== false && $a !== nil && $a != null) ? $a : self.error_message_creator = $scope.get('DefaultErrorMessageCreator').$new()); }, TMP_1.$$arity = 0); Opal.defn(self, '$error_message_creator=', TMP_2 = function(creator) { var self = this; return self.error_message_creator = creator; }, TMP_2.$$arity = 1); Opal.defn(self, '$cache_constants=', TMP_3 = function(val) { var self = this; return self.cache_constants = val; }, TMP_3.$$arity = 1); return (Opal.defn(self, '$cache_constants?', TMP_4 = function() { var self = this; if (self.cache_constants == null) self.cache_constants = nil; return self.cache_constants; }, TMP_4.$$arity = 0), nil) && 'cache_constants?'; })(Opal.get_singleton_class(self)) })($scope.base); return (($a = [true]), $b = $scope.get('Mutations'), $b['$cache_constants='].apply($b, $a), $a[$a.length-1]); }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/filters/outbound_filter"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; return (function($base) { var $Mutations, self = $Mutations = $module($base, 'Mutations'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $OutboundFilter(){}; var self = $OutboundFilter = $klass($base, $super, 'OutboundFilter', $OutboundFilter); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.default_options = $hash2([], {}); return (Opal.defn(self, '$filter', TMP_1 = function $$filter(data) { var self = this; return [data, "outbound"]; }, TMP_1.$$arity = 1), nil) && 'filter'; })($scope.base, $scope.get('AdditionalFilter')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop/component/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Component(){}; var self = $Component = $klass($base, $super, 'Component', $Component); var def = self.$$proto, $scope = self.$$scope; return Opal.cdecl($scope, 'VERSION', "0.12.3") })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/hash"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$alias_method', '$_pre_react_patch_initialize', '$to_proc']); return (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$alias_method("_pre_react_patch_initialize", "initialize"); return (Opal.defn(self, '$initialize', TMP_1 = function $$initialize(defaults) { var $a, $b, $c, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; if ((($a = (defaults===null)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$_pre_react_patch_initialize, $a.$$p = block.$to_proc(), $a).call($b) } else { return ($a = ($c = self).$_pre_react_patch_initialize, $a.$$p = block.$to_proc(), $a).call($c, defaults) }; }, TMP_1.$$arity = -1), nil) && 'initialize'; })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/object/try"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$empty?', '$respond_to?', '$first', '$try!', '$to_proc', '$zero?', '$arity', '$instance_eval', '$public_send']); (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; Opal.defn(self, '$try', TMP_1 = function($a_rest) { var $b, $c, self = this, a, $iter = TMP_1.$$p, b = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } a = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { a[$arg_idx - 0] = arguments[$arg_idx]; } TMP_1.$$p = null; if ((($b = ((($c = a['$empty?']()) !== false && $c !== nil && $c != null) ? $c : self['$respond_to?'](a.$first()))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = self)['$try!'], $b.$$p = b.$to_proc(), $b).apply($c, Opal.to_a(a)) } else { return nil }; }, TMP_1.$$arity = -1); return (Opal.defn(self, '$try!', TMP_2 = function($a_rest) { var $b, $c, $d, self = this, a, $iter = TMP_2.$$p, b = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } a = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { a[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; if ((($b = ($c = a['$empty?'](), $c !== false && $c !== nil && $c != null ?(b !== nil) : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = b.$arity()['$zero?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = self).$instance_eval, $b.$$p = b.$to_proc(), $b).call($c) } else { return Opal.yield1(b, self); } } else { return ($b = ($d = self).$public_send, $b.$$p = b.$to_proc(), $b).apply($d, Opal.to_a(a)) }; }, TMP_2.$$arity = -1), nil) && 'try!'; })($scope.base, null); return (function($base, $super) { function $NilClass(){}; var self = $NilClass = $klass($base, $super, 'NilClass', $NilClass); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4; Opal.defn(self, '$try', TMP_3 = function($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return nil; }, TMP_3.$$arity = -1); return (Opal.defn(self, '$try!', TMP_4 = function($a_rest) { var self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return nil; }, TMP_4.$$arity = -1), nil) && 'try!'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/tags"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$+', '$render', '$to_proc', '$each', '$define_method', '$==', '$count', '$is_a?', '$first', '$p', '$!=', '$alias_method', '$upcase', '$const_set', '$downcase', '$=~', '$include?', '$create_element', '$find_component', '$method_missing', '$find_name_and_parent', '$new', '$build_only', '$extend', '$private', '$name', '$split', '$>', '$length', '$last', '$[]', '$inject', '$const_get', '$lookup_const', '$!', '$method_defined?', '$raise', '$reverse', '$to_s', '$class', '$detect', '$const_defined?']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Tags, self = $Tags = $module($base, 'Tags'); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, $b, TMP_2, TMP_4, TMP_5, TMP_12, TMP_15; Opal.cdecl($scope, 'HTML_TAGS', $rb_plus(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"], ["circle", "clipPath", "defs", "ellipse", "g", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"])); Opal.defn(self, '$present', TMP_1 = function $$present(component, $a_rest) { var $b, $c, self = this, params, $iter = TMP_1.$$p, children = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } params = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { params[$arg_idx - 1] = arguments[$arg_idx]; } TMP_1.$$p = null; return ($b = ($c = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $b.$$p = children.$to_proc(), $b).apply($c, [component].concat(Opal.to_a(params))); }, TMP_1.$$arity = -2); ($a = ($b = $scope.get('HTML_TAGS')).$each, $a.$$p = (TMP_2 = function(tag){var self = TMP_2.$$s || this, $c, $d, TMP_3; if (tag == null) tag = nil; ($c = ($d = self).$define_method, $c.$$p = (TMP_3 = function($e_rest){var self = TMP_3.$$s || this, children, params, $f, $g, $h, $i; children = TMP_3.$$p || nil, TMP_3.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } params = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { params[$arg_idx - 0] = arguments[$arg_idx]; } if (tag['$==']("p")) { if ((($f = ((($g = ((($h = children) !== false && $h !== nil && $h != null) ? $h : params.$count()['$=='](0))) !== false && $g !== nil && $g != null) ? $g : ((($h = params.$count()['$=='](1)) ? params.$first()['$is_a?']($scope.get('Hash')) : params.$count()['$=='](1))))) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { return ($f = ($g = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $f.$$p = children.$to_proc(), $f).apply($g, [tag].concat(Opal.to_a(params))) } else { return ($f = $scope.get('Kernel')).$p.apply($f, Opal.to_a(params)) } } else { return ($h = ($i = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $h.$$p = children.$to_proc(), $h).apply($i, [tag].concat(Opal.to_a(params))) }}, TMP_3.$$s = self, TMP_3.$$arity = -1, TMP_3), $c).call($d, tag); if ((($c = tag['$!=']("div")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$alias_method(tag.$upcase(), tag); return self.$const_set(tag.$upcase(), tag); } else { return self.$alias_method(tag.$upcase(), tag) };}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $a).call($b); Opal.defs(self, '$html_tag_class_for', TMP_4 = function $$html_tag_class_for(tag) { var $a, $b, self = this, downcased_tag = nil; downcased_tag = tag.$downcase(); if ((($a = ($b = tag['$=~'](/[A-Z]+/), $b !== false && $b !== nil && $b != null ?$scope.get('HTML_TAGS')['$include?'](downcased_tag) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('Object').$const_set(tag, $scope.get('React').$create_element(downcased_tag)) } else { return nil }; }, TMP_4.$$arity = 1); Opal.defn(self, '$method_missing', TMP_5 = function $$method_missing(name, $a_rest) { var $b, $c, $d, self = this, params, $iter = TMP_5.$$p, children = $iter || nil, component = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } params = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { params[$arg_idx - 1] = arguments[$arg_idx]; } TMP_5.$$p = null; component = self.$find_component(name); if (component !== false && component !== nil && component != null) { return ($b = ($c = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $b.$$p = children.$to_proc(), $b).apply($c, [component].concat(Opal.to_a(params)))}; return ($b = ($d = $scope.get('Object')).$method_missing, $b.$$p = children.$to_proc(), $b).apply($d, [name].concat(Opal.to_a(params))); }, TMP_5.$$arity = -2); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_9, TMP_11; Opal.defn(self, '$included', TMP_9 = function $$included(component) { var $a, $b, TMP_6, self = this, name = nil, parent = nil, tag_names_module = nil; $b = self.$find_name_and_parent(component), $a = Opal.to_ary($b), name = ($a[0] == null ? nil : $a[0]), parent = ($a[1] == null ? nil : $a[1]), $b; tag_names_module = ($a = ($b = $scope.get('Module')).$new, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this, $c, $d, TMP_7, $e, TMP_8; ($c = ($d = self).$define_method, $c.$$p = (TMP_7 = function($e_rest){var self = TMP_7.$$s || this, children, params, $f, $g; children = TMP_7.$$p || nil, TMP_7.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } params = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { params[$arg_idx - 0] = arguments[$arg_idx]; } return ($f = ($g = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $f.$$p = children.$to_proc(), $f).apply($g, [component].concat(Opal.to_a(params)))}, TMP_7.$$s = self, TMP_7.$$arity = -1, TMP_7), $c).call($d, name); return ($c = ($e = self).$define_method, $c.$$p = (TMP_8 = function($f_rest){var self = TMP_8.$$s || this, children, params, $g, $h; children = TMP_8.$$p || nil, TMP_8.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } params = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { params[$arg_idx - 0] = arguments[$arg_idx]; } return ($g = ($h = (($scope.get('React')).$$scope.get('RenderingContext'))).$build_only, $g.$$p = children.$to_proc(), $g).apply($h, [component].concat(Opal.to_a(params)))}, TMP_8.$$s = self, TMP_8.$$arity = -1, TMP_8), $c).call($e, "" + (name) + "_as_node");}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($b); return parent.$extend(tag_names_module); }, TMP_9.$$arity = 1); self.$private(); return (Opal.defn(self, '$find_name_and_parent', TMP_11 = function $$find_name_and_parent(component) { var $a, $b, TMP_10, self = this, split_name = nil; split_name = ($a = component.$name(), $a !== false && $a !== nil && $a != null ?component.$name().$split("::") : $a); if ((($a = (($b = split_name !== false && split_name !== nil && split_name != null) ? $rb_gt(split_name.$length(), 1) : split_name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return [split_name.$last(), ($a = ($b = split_name).$inject, $a.$$p = (TMP_10 = function(a, e){var self = TMP_10.$$s || this; if (a == null) a = nil;if (e == null) e = nil; return $rb_plus(a, [a.$last().$const_get(e)])}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $a).call($b, [$scope.get('Module')])['$[]'](-2)] } else { return nil }; }, TMP_11.$$arity = 1), nil) && 'find_name_and_parent'; })(Opal.get_singleton_class(self)); self.$private(); Opal.defn(self, '$find_component', TMP_12 = function $$find_component(name) { var $a, $b, self = this, component = nil; component = self.$lookup_const(name); if ((($a = (($b = component !== false && component !== nil && component != null) ? component['$method_defined?']("render")['$!']() : component)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise("" + (name) + " does not appear to be a react component.")}; return component; }, TMP_12.$$arity = 1); Opal.defn(self, '$lookup_const', TMP_15 = function $$lookup_const(name) { var $a, $b, TMP_13, $c, TMP_14, self = this, scopes = nil, scope = nil; if ((($a = name['$=~'](/^[A-Z]/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; scopes = ($a = ($b = self.$class().$name().$to_s().$split("::")).$inject, $a.$$p = (TMP_13 = function(nesting, next_const){var self = TMP_13.$$s || this; if (nesting == null) nesting = nil;if (next_const == null) next_const = nil; return $rb_plus(nesting, [nesting.$last().$const_get(next_const)])}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13), $a).call($b, [$scope.get('Module')]).$reverse(); scope = ($a = ($c = scopes).$detect, $a.$$p = (TMP_14 = function(s){var self = TMP_14.$$s || this; if (s == null) s = nil; return s['$const_defined?'](name)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($c); if (scope !== false && scope !== nil && scope != null) { return scope.$const_get(name) } else { return nil }; }, TMP_15.$$arity = 1); })($scope.base) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/base"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$==', '$to_s', '$deprecation_warning', '$include']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Base(){}; var self = $Base = $klass($base, $super, 'Base', $Base); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defs(self, '$inherited', TMP_1 = function $$inherited(child) { var self = this; if (child.$to_s()['$==']("React::Component::HyperTestDummy")) { } else { (($scope.get('React')).$$scope.get('Component')).$deprecation_warning(child, "The class name React::Component::Base has been deprecated. Use Hyperloop::Component instead.") }; return child.$include($scope.get('ComponentNoNotice')); }, TMP_1.$$arity = 1), nil) && 'inherited' })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/top_level"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$+', '$create_element', '$to_proc', '$!', '$Native', '$to_n', '$raise', '$include', '$class', '$kind_of?', '$build']); self.$require("native"); self.$require("active_support/core_ext/object/try"); self.$require("react/component/tags"); self.$require("react/component/base"); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_9, TMP_12, TMP_13; Opal.cdecl($scope, 'ATTRIBUTES', $rb_plus(["accept", "acceptCharset", "accessKey", "action", "allowFullScreen", "allowTransparency", "alt", "async", "autoComplete", "autoPlay", "cellPadding", "cellSpacing", "charSet", "checked", "classID", "className", "cols", "colSpan", "content", "contentEditable", "contextMenu", "controls", "coords", "crossOrigin", "data", "dateTime", "defer", "dir", "disabled", "download", "draggable", "encType", "form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "frameBorder", "height", "hidden", "href", "hrefLang", "htmlFor", "httpEquiv", "icon", "id", "label", "lang", "list", "loop", "manifest", "marginHeight", "marginWidth", "max", "maxLength", "media", "mediaGroup", "method", "min", "multiple", "muted", "name", "noValidate", "open", "pattern", "placeholder", "poster", "preload", "radioGroup", "readOnly", "rel", "required", "role", "rows", "rowSpan", "sandbox", "scope", "scrolling", "seamless", "selected", "shape", "size", "sizes", "span", "spellCheck", "src", "srcDoc", "srcSet", "start", "step", "style", "tabIndex", "target", "title", "type", "useMap", "value", "width", "wmode", "dangerouslySetInnerHTML"], ["clipPath", "cx", "cy", "d", "dx", "dy", "fill", "fillOpacity", "fontFamily", "fontSize", "fx", "fy", "gradientTransform", "gradientUnits", "markerEnd", "markerMid", "markerStart", "offset", "opacity", "patternContentUnits", "patternUnits", "points", "preserveAspectRatio", "r", "rx", "ry", "spreadMethod", "stopColor", "stopOpacity", "stroke", "strokeDasharray", "strokeLinecap", "strokeOpacity", "strokeWidth", "textAnchor", "transform", "version", "viewBox", "x1", "x2", "x", "xlinkActuate", "xlinkArcrole", "xlinkHref", "xlinkRole", "xlinkShow", "xlinkTitle", "xlinkType", "xmlBase", "xmlLang", "xmlSpace", "y1", "y2", "y"])); Opal.cdecl($scope, 'HASH_ATTRIBUTES', ["data", "aria"]); Opal.cdecl($scope, 'HTML_TAGS', (((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('Tags'))).$$scope.get('HTML_TAGS'))); Opal.defs(self, '$html_tag?', TMP_1 = function(name) { var self = this, tags = nil; tags = $scope.get('HTML_TAGS'); for(var i = 0; i < tags.length; i++) { if(tags[i] === name) return true; } return false; }, TMP_1.$$arity = 1); Opal.defs(self, '$html_attr?', TMP_2 = function(name) { var self = this, attrs = nil; attrs = $scope.get('ATTRIBUTES'); for(var i = 0; i < attrs.length; i++) { if(attrs[i] === name) return true; } return false; }, TMP_2.$$arity = 1); Opal.defs(self, '$create_element', TMP_3 = function $$create_element(type, properties) { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; if (properties == null) { properties = $hash2([], {}); } TMP_3.$$p = null; return ($a = ($b = (($scope.get('React')).$$scope.get('API'))).$create_element, $a.$$p = block.$to_proc(), $a).call($b, type, properties); }, TMP_3.$$arity = -2); Opal.defs(self, '$render', TMP_4 = function $$render(element, container) { var $a, self = this, $iter = TMP_4.$$p, $yield = $iter || nil, component = nil; TMP_4.$$p = null; console.error( "Warning: Using deprecated behavior of `React.render`,", "require \"react/top_level_render\" to get the correct behavior." ); container = container.$$class ? container[0] : container; if ((($a = ((typeof ReactDOM === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { component = self.$Native(ReactDOM.render(element.$to_n(), container, function(){(function() {if (($yield !== nil)) { return Opal.yieldX($yield, []); } else { return nil }; return nil; })()})) } else if ((($a = ((typeof React.renderToString === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { component = self.$Native(React.render(element.$to_n(), container, function(){(function() {if (($yield !== nil)) { return Opal.yieldX($yield, []); } else { return nil }; return nil; })()})) } else { self.$raise("render is not defined. In React >= v15 you must import it with ReactDOM") }; component.$class().$include((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('API'))); return component; }, TMP_4.$$arity = 2); Opal.defs(self, '$is_valid_element', TMP_5 = function $$is_valid_element(element) { var $a, self = this; console.error("Warning: `is_valid_element` is deprecated in favor of `is_valid_element?`."); return ($a = element['$kind_of?']((($scope.get('React')).$$scope.get('Element'))), $a !== false && $a !== nil && $a != null ?React.isValidElement(element.$to_n()) : $a); }, TMP_5.$$arity = 1); Opal.defs(self, '$is_valid_element?', TMP_6 = function(element) { var $a, self = this; return ($a = element['$kind_of?']((($scope.get('React')).$$scope.get('Element'))), $a !== false && $a !== nil && $a != null ?React.isValidElement(element.$to_n()) : $a); }, TMP_6.$$arity = 1); Opal.defs(self, '$render_to_string', TMP_9 = function $$render_to_string(element) { var $a, $b, TMP_7, $c, TMP_8, self = this; console.error("Warning: `React.render_to_string` is deprecated in favor of `React::Server.render_to_string`."); if ((($a = ((typeof ReactDOMServer === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = (($scope.get('React')).$$scope.get('RenderingContext'))).$build, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return ReactDOMServer.renderToString(element.$to_n());}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $a).call($b) } else if ((($a = ((typeof React.renderToString === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = (($scope.get('React')).$$scope.get('RenderingContext'))).$build, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this; return React.renderToString(element.$to_n());}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $a).call($c) } else { return self.$raise("renderToString is not defined. In React >= v15 you must import it with ReactDOMServer") }; }, TMP_9.$$arity = 1); Opal.defs(self, '$render_to_static_markup', TMP_12 = function $$render_to_static_markup(element) { var $a, $b, TMP_10, $c, TMP_11, self = this; console.error("Warning: `React.render_to_static_markup` is deprecated in favor of `React::Server.render_to_static_markup`."); if ((($a = ((typeof ReactDOMServer === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = (($scope.get('React')).$$scope.get('RenderingContext'))).$build, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; return ReactDOMServer.renderToStaticMarkup(element.$to_n());}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $a).call($b) } else if ((($a = ((typeof React.renderToString === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = (($scope.get('React')).$$scope.get('RenderingContext'))).$build, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this; return React.renderToStaticMarkup(element.$to_n());}, TMP_11.$$s = self, TMP_11.$$arity = 0, TMP_11), $a).call($c) } else { return self.$raise("renderToStaticMarkup is not defined. In React >= v15 you must import it with ReactDOMServer") }; }, TMP_12.$$arity = 1); Opal.defs(self, '$unmount_component_at_node', TMP_13 = function $$unmount_component_at_node(node) { var $a, self = this; if ((($a = ((typeof ReactDOM === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ReactDOM.unmountComponentAtNode(node.$$class ? node[0] : node); } else if ((($a = ((typeof React.renderToString === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return React.unmountComponentAtNode(node.$$class ? node[0] : node); } else { return self.$raise("unmountComponentAtNode is not defined. In React >= v15 you must import it with ReactDOM") }; }, TMP_13.$$arity = 1); })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/observable"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$tap', '$call', '$send', '$to_proc', '$include?', '$respond_to?', '$lambda']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Observable(){}; var self = $Observable = $klass($base, $super, 'Observable', $Observable); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4, TMP_5, TMP_7; def.value = def.on_change = nil; Opal.defn(self, '$initialize', TMP_1 = function $$initialize(value, on_change) { var $a, self = this, $iter = TMP_1.$$p, block = $iter || nil; if (on_change == null) { on_change = nil; } TMP_1.$$p = null; self.value = value; return self.on_change = ((($a = on_change) !== false && $a !== nil && $a != null) ? $a : block); }, TMP_1.$$arity = -2); Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing(method_sym, $a_rest) { var $b, $c, TMP_3, $d, $e, self = this, args, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_2.$$p = null; return ($b = ($c = ($d = ($e = self.value).$send, $d.$$p = block.$to_proc(), $d).apply($e, [method_sym].concat(Opal.to_a(args)))).$tap, $b.$$p = (TMP_3 = function(result){var self = TMP_3.$$s || this; if (self.on_change == null) self.on_change = nil; if (self.value == null) self.value = nil; if (result == null) result = nil; return self.on_change.$call(self.value)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $b).call($c); }, TMP_2.$$arity = -2); Opal.defn(self, '$respond_to?', TMP_4 = function(method, $a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } if ((($b = ["call", "to_proc"]['$include?'](method)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return true } else { return ($b = self.value)['$respond_to?'].apply($b, [method].concat(Opal.to_a(args))) }; }, TMP_4.$$arity = -2); Opal.defn(self, '$call', TMP_5 = function $$call(new_value) { var self = this; self.on_change.$call(new_value); return self.value = new_value; }, TMP_5.$$arity = 1); return (Opal.defn(self, '$to_proc', TMP_7 = function $$to_proc() { var $a, $b, TMP_6, self = this; return ($a = ($b = self).$lambda, $a.$$p = (TMP_6 = function(arg){var self = TMP_6.$$s || this; if (self.value == null) self.value = nil; if (self.on_change == null) self.on_change = nil; if (arg == null) { arg = self.value; } return self.on_change.$call(arg)}, TMP_6.$$s = self, TMP_6.$$arity = -1, TMP_6), $a).call($b); }, TMP_7.$$arity = 0), nil) && 'to_proc'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/validator"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_accessor', '$attr_reader', '$private', '$new', '$build', '$to_proc', '$instance_eval', '$[]=', '$define_rule', '$allow_undefined_props=', '$reject', '$[]', '$rules', '$errors=', '$allow_undefined_props?', '$validate_undefined', '$coerce_native_hash_values', '$defined_props', '$validate_required', '$each', '$validate_types', '$validate_allowed', '$errors', '$inject', '$select', '$include?', '$keys', '$!', '$define_param', '$props_wrapper', '$is_a?', '$type_check', '$>', '$length', '$validate_value_array', '$nil?', '$respond_to?', '$_react_param_conversion', '$<<', '$-', '$each_with_index', '$Native']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Validator(){}; var self = $Validator = $klass($base, $super, 'Validator', $Validator); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_10, TMP_13, TMP_15, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_24, TMP_26, TMP_28, TMP_30; def.allow_undefined_props = def.rules = def.errors = nil; self.$attr_accessor("errors"); self.$attr_reader("props_wrapper"); self.$private("errors", "props_wrapper"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(props_wrapper) { var self = this; if (props_wrapper == null) { props_wrapper = $scope.get('Class').$new((($scope.get('Component')).$$scope.get('PropsWrapper'))); } return self.props_wrapper = props_wrapper; }, TMP_1.$$arity = -1); Opal.defs(self, '$build', TMP_2 = function $$build() { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; return ($a = ($b = self.$new()).$build, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_2.$$arity = 0); Opal.defn(self, '$build', TMP_3 = function $$build() { var $a, $b, self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; ($a = ($b = self).$instance_eval, $a.$$p = block.$to_proc(), $a).call($b); return self; }, TMP_3.$$arity = 0); Opal.defn(self, '$requires', TMP_4 = function $$requires(name, options) { var self = this; if (options == null) { options = $hash2([], {}); } options['$[]=']("required", true); return self.$define_rule(name, options); }, TMP_4.$$arity = -2); Opal.defn(self, '$optional', TMP_5 = function $$optional(name, options) { var self = this; if (options == null) { options = $hash2([], {}); } options['$[]=']("required", false); return self.$define_rule(name, options); }, TMP_5.$$arity = -2); Opal.defn(self, '$allow_undefined_props=', TMP_6 = function(allow) { var self = this; return self.allow_undefined_props = allow; }, TMP_6.$$arity = 1); Opal.defn(self, '$undefined_props', TMP_8 = function $$undefined_props(props) { var $a, $b, TMP_7, self = this; (($a = [true]), $b = self, $b['$allow_undefined_props='].apply($b, $a), $a[$a.length-1]); return ($a = ($b = props).$reject, $a.$$p = (TMP_7 = function(name, value){var self = TMP_7.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return self.$rules()['$[]'](name)}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7), $a).call($b); }, TMP_8.$$arity = 1); Opal.defn(self, '$validate', TMP_10 = function $$validate(props) { var $a, $b, TMP_9, self = this; (($a = [[]]), $b = self, $b['$errors='].apply($b, $a), $a[$a.length-1]); if ((($a = self['$allow_undefined_props?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$validate_undefined(props) }; props = self.$coerce_native_hash_values(self.$defined_props(props)); self.$validate_required(props); ($a = ($b = props).$each, $a.$$p = (TMP_9 = function(name, value){var self = TMP_9.$$s || this; if (name == null) name = nil;if (value == null) value = nil; self.$validate_types(name, value); return self.$validate_allowed(name, value);}, TMP_9.$$s = self, TMP_9.$$arity = 2, TMP_9), $a).call($b); return self.$errors(); }, TMP_10.$$arity = 1); Opal.defn(self, '$default_props', TMP_13 = function $$default_props() { var $a, $b, TMP_11, $c, $d, TMP_12, self = this; return ($a = ($b = ($c = ($d = self.$rules()).$select, $c.$$p = (TMP_12 = function(key, value){var self = TMP_12.$$s || this; if (key == null) key = nil;if (value == null) value = nil; return value.$keys()['$include?']("default")}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $c).call($d)).$inject, $a.$$p = (TMP_11 = function(memo, $c){var self = TMP_11.$$s || this, $c_args, k, v; if ($c == null) { $c = nil; } $c = Opal.to_ary($c); $c_args = Opal.slice.call($c, 0, $c.length); k = $c_args.splice(0,1)[0]; if (k == null) { k = nil; } v = $c_args.splice(0,1)[0]; if (v == null) { v = nil; }if (memo == null) memo = nil; memo['$[]='](k, v['$[]']("default")); return memo;}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11.$$has_top_level_mlhs_arg = true, TMP_11), $a).call($b, $hash2([], {})); }, TMP_13.$$arity = 0); self.$private(); Opal.defn(self, '$defined_props', TMP_15 = function $$defined_props(props) { var $a, $b, TMP_14, self = this; return ($a = ($b = props).$select, $a.$$p = (TMP_14 = function(name){var self = TMP_14.$$s || this; if (name == null) name = nil; return self.$rules().$keys()['$include?'](name)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_15.$$arity = 1); Opal.defn(self, '$allow_undefined_props?', TMP_16 = function() { var self = this; return self.allow_undefined_props['$!']()['$!'](); }, TMP_16.$$arity = 0); Opal.defn(self, '$rules', TMP_17 = function $$rules() { var $a, self = this; return ((($a = self.rules) !== false && $a !== nil && $a != null) ? $a : self.rules = $hash2(["children"], {"children": $hash2(["required"], {"required": false})})); }, TMP_17.$$arity = 0); Opal.defn(self, '$define_rule', TMP_18 = function $$define_rule(name, options) { var self = this; if (options == null) { options = $hash2([], {}); } self.$rules()['$[]='](name, self.$coerce_native_hash_values(options)); return self.$props_wrapper().$define_param(name, options['$[]']("type")); }, TMP_18.$$arity = -2); Opal.defn(self, '$errors', TMP_19 = function $$errors() { var $a, self = this; return ((($a = self.errors) !== false && $a !== nil && $a != null) ? $a : self.errors = []); }, TMP_19.$$arity = 0); Opal.defn(self, '$validate_types', TMP_20 = function $$validate_types(prop_name, value) { var $a, self = this, klass = nil, allow_nil = nil; if ((($a = klass = self.$rules()['$[]'](prop_name)['$[]']("type")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = klass['$is_a?']($scope.get('Array'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { allow_nil = self.$rules()['$[]'](prop_name)['$[]']("allow_nil")['$!']()['$!'](); return self.$type_check("`" + (prop_name) + "`", value, klass, allow_nil); } else if ((($a = $rb_gt(klass.$length(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$validate_value_array(prop_name, value) } else { allow_nil = self.$rules()['$[]'](prop_name)['$[]']("allow_nil")['$!']()['$!'](); return self.$type_check("`" + (prop_name) + "`", value, $scope.get('Array'), allow_nil); }; }, TMP_20.$$arity = 2); Opal.defn(self, '$type_check', TMP_21 = function $$type_check(prop_name, value, klass, allow_nil) { var $a, $b, self = this; if ((($a = (($b = allow_nil !== false && allow_nil !== nil && allow_nil != null) ? value['$nil?']() : allow_nil)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if ((($a = value['$is_a?'](klass)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if ((($a = ($b = klass['$respond_to?']("_react_param_conversion"), $b !== false && $b !== nil && $b != null ?klass.$_react_param_conversion(value, "validate_only") : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; return self.$errors()['$<<']("Provided prop " + (prop_name) + " could not be converted to " + (klass)); }, TMP_21.$$arity = 4); Opal.defn(self, '$validate_allowed', TMP_22 = function $$validate_allowed(prop_name, value) { var $a, self = this, values = nil; if ((($a = values = self.$rules()['$[]'](prop_name)['$[]']("values")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = values['$include?'](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; return self.$errors()['$<<']("Value `" + (value) + "` for prop `" + (prop_name) + "` is not an allowed value"); }, TMP_22.$$arity = 2); Opal.defn(self, '$validate_required', TMP_24 = function $$validate_required(props) { var $a, $b, TMP_23, self = this; return ($a = ($b = ($rb_minus(self.$rules().$keys(), props.$keys()))).$each, $a.$$p = (TMP_23 = function(name){var self = TMP_23.$$s || this, $c; if (name == null) name = nil; if ((($c = self.$rules()['$[]'](name)['$[]']("required")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { return nil; }; return self.$errors()['$<<']("Required prop `" + (name) + "` was not specified");}, TMP_23.$$s = self, TMP_23.$$arity = 1, TMP_23), $a).call($b); }, TMP_24.$$arity = 1); Opal.defn(self, '$validate_undefined', TMP_26 = function $$validate_undefined(props) { var $a, $b, TMP_25, self = this; return ($a = ($b = ($rb_minus(props.$keys(), self.$rules().$keys()))).$each, $a.$$p = (TMP_25 = function(prop_name){var self = TMP_25.$$s || this; if (prop_name == null) prop_name = nil; return self.$errors()['$<<']("Provided prop `" + (prop_name) + "` not specified in spec")}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25), $a).call($b); }, TMP_26.$$arity = 1); Opal.defn(self, '$validate_value_array', TMP_28 = function $$validate_value_array(name, value) { var $a, $b, TMP_27, self = this, klass = nil, allow_nil = nil; try { klass = self.$rules()['$[]'](name)['$[]']("type"); allow_nil = self.$rules()['$[]'](name)['$[]']("allow_nil")['$!']()['$!'](); return ($a = ($b = value).$each_with_index, $a.$$p = (TMP_27 = function(item, index){var self = TMP_27.$$s || this; if (item == null) item = nil;if (index == null) index = nil; return self.$type_check("`" + (name) + "`[" + (index) + "]", self.$Native(item), klass['$[]'](0), allow_nil)}, TMP_27.$$s = self, TMP_27.$$arity = 2, TMP_27), $a).call($b); } catch ($err) { if (Opal.rescue($err, [$scope.get('NoMethodError')])) { try { return self.$errors()['$<<']("Provided prop `" + (name) + "` was not an Array") } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_28.$$arity = 2); return (Opal.defn(self, '$coerce_native_hash_values', TMP_30 = function $$coerce_native_hash_values(hash) { var $a, $b, TMP_29, self = this; return ($a = ($b = hash).$each, $a.$$p = (TMP_29 = function(key, value){var self = TMP_29.$$s || this; if (key == null) key = nil;if (value == null) value = nil; return hash['$[]='](key, self.$Native(value))}, TMP_29.$$s = self, TMP_29.$$arity = 2, TMP_29), $a).call($b); }, TMP_30.$$arity = 1), nil) && 'coerce_native_hash_values'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/ext/string"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; return (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$event_camelize', TMP_1 = function $$event_camelize() { var self = this; return self.replace(/(^|_)([^_]+)/g, function(match, pre, word, index) { var capitalize = true; return capitalize ? word.substr(0,1).toUpperCase()+word.substr(1) : word; }); }, TMP_1.$$arity = 0), nil) && 'event_camelize' })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/ext/hash"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$map']); return (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_2; return (Opal.defn(self, '$shallow_to_n', TMP_2 = function $$shallow_to_n() { var $a, $b, TMP_1, self = this, hash = nil; hash = {}; ($a = ($b = self).$map, $a.$$p = (TMP_1 = function(key, value){var self = TMP_1.$$s || this; if (key == null) key = nil;if (value == null) value = nil; return hash[key] = value;}, TMP_1.$$s = self, TMP_1.$$arity = 2, TMP_1), $a).call($b); return hash; }, TMP_2.$$arity = 0), nil) && 'shallow_to_n' })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/kernel/singleton_class"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$class_eval', '$to_proc', '$singleton_class']); return (function($base) { var $Kernel, self = $Kernel = $module($base, 'Kernel'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defn(self, '$class_eval', TMP_1 = function $$class_eval($a_rest) { var $b, $c, self = this, args, $iter = TMP_1.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_1.$$p = null; return ($b = ($c = self.$singleton_class()).$class_eval, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_1.$$arity = -1) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/module/remove_method"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$method_defined?', '$private_method_defined?', '$undef_method', '$remove_possible_method', '$define_method', '$to_proc']); return (function($base, $super) { function $Module(){}; var self = $Module = $klass($base, $super, 'Module', $Module); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; Opal.defn(self, '$remove_possible_method', TMP_1 = function $$remove_possible_method(method) { var $a, $b, self = this; if ((($a = ((($b = self['$method_defined?'](method)) !== false && $b !== nil && $b != null) ? $b : self['$private_method_defined?'](method))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$undef_method(method) } else { return nil }; }, TMP_1.$$arity = 1); return (Opal.defn(self, '$redefine_method', TMP_2 = function $$redefine_method(method) { var $a, $b, self = this, $iter = TMP_2.$$p, block = $iter || nil; TMP_2.$$p = null; self.$remove_possible_method(method); return ($a = ($b = self).$define_method, $a.$$p = block.$to_proc(), $a).call($b, method); }, TMP_2.$$arity = 1), nil) && 'redefine_method'; })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/array/extract_options"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$instance_of?', '$is_a?', '$last', '$extractable_options?', '$pop']); (function($base, $super) { function $Hash(){}; var self = $Hash = $klass($base, $super, 'Hash', $Hash); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$extractable_options?', TMP_1 = function() { var self = this; return self['$instance_of?']($scope.get('Hash')); }, TMP_1.$$arity = 0), nil) && 'extractable_options?' })($scope.base, null); return (function($base, $super) { function $Array(){}; var self = $Array = $klass($base, $super, 'Array', $Array); var def = self.$$proto, $scope = self.$$scope, TMP_2; return (Opal.defn(self, '$extract_options!', TMP_2 = function() { var $a, $b, self = this; if ((($a = ($b = self.$last()['$is_a?']($scope.get('Hash')), $b !== false && $b !== nil && $b != null ?self.$last()['$extractable_options?']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$pop() } else { return $hash2([], {}) }; }, TMP_2.$$arity = 0), nil) && 'extract_options!' })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["active_support/core_ext/class/attribute"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$extract_options!', '$fetch', '$each', '$define_singleton_method', '$!', '$public_send', '$class_eval', '$remove_possible_method', '$define_method', '$singleton_class', '$singleton_class?', '$instance_variable_defined?', '$instance_variable_get', '$send', '$class', '$attr_writer', '$private', '$respond_to?', '$!=', '$first', '$ancestors']); self.$require("active_support/core_ext/kernel/singleton_class"); self.$require("active_support/core_ext/module/remove_method"); self.$require("active_support/core_ext/array/extract_options"); return (function($base, $super) { function $Class(){}; var self = $Class = $klass($base, $super, 'Class', $Class); var def = self.$$proto, $scope = self.$$scope, TMP_11, $a, TMP_12; Opal.defn(self, '$class_attribute', TMP_11 = function $$class_attribute($a_rest) { var $b, $c, TMP_1, self = this, attrs, options = nil, instance_reader = nil, instance_writer = nil, instance_predicate = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } attrs = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { attrs[$arg_idx - 0] = arguments[$arg_idx]; } options = attrs['$extract_options!'](); instance_reader = ($b = options.$fetch("instance_accessor", true), $b !== false && $b !== nil && $b != null ?options.$fetch("instance_reader", true) : $b); instance_writer = ($b = options.$fetch("instance_accessor", true), $b !== false && $b !== nil && $b != null ?options.$fetch("instance_writer", true) : $b); instance_predicate = options.$fetch("instance_predicate", true); return ($b = ($c = attrs).$each, $b.$$p = (TMP_1 = function(name){var self = TMP_1.$$s || this, $a, $d, TMP_2, $e, TMP_3, $f, TMP_4, $g, TMP_9, $h, TMP_10, ivar = nil; if (name == null) name = nil; ($a = ($d = self).$define_singleton_method, $a.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this; return nil}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $a).call($d, name); if (instance_predicate !== false && instance_predicate !== nil && instance_predicate != null) { ($a = ($e = self).$define_singleton_method, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return self.$public_send(name)['$!']()['$!']()}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($e, "" + (name) + "?")}; ivar = "@" + (name); ($a = ($f = self).$define_singleton_method, $a.$$p = (TMP_4 = function(val){var self = TMP_4.$$s || this, $g, $h, TMP_5, $i, TMP_7; if (val == null) val = nil; ($g = ($h = self.$singleton_class()).$class_eval, $g.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, $i, $j, TMP_6; self.$remove_possible_method(name); return ($i = ($j = self).$define_method, $i.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return val}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $i).call($j, name);}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $g).call($h); if ((($g = self['$singleton_class?']()) !== nil && $g != null && (!$g.$$is_boolean || $g == true))) { ($g = ($i = self).$class_eval, $g.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this, $j, $k, TMP_8; self.$remove_possible_method(name); return ($j = ($k = self).$define_method, $j.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, $l; if ((($l = self['$instance_variable_defined?'](ivar)) !== nil && $l != null && (!$l.$$is_boolean || $l == true))) { return self.$instance_variable_get(ivar) } else { return self.$singleton_class().$send(name) }}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $j).call($k, name);}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $g).call($i)}; return val;}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($f, "" + (name) + "="); if (instance_reader !== false && instance_reader !== nil && instance_reader != null) { self.$remove_possible_method(name); ($a = ($g = self).$define_method, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this, $h; if ((($h = self['$instance_variable_defined?'](ivar)) !== nil && $h != null && (!$h.$$is_boolean || $h == true))) { return self.$instance_variable_get(ivar) } else { return self.$class().$public_send(name) }}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $a).call($g, name); if (instance_predicate !== false && instance_predicate !== nil && instance_predicate != null) { ($a = ($h = self).$define_method, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; return self.$public_send(name)['$!']()['$!']()}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $a).call($h, "" + (name) + "?")};}; if (instance_writer !== false && instance_writer !== nil && instance_writer != null) { return self.$attr_writer(name) } else { return nil };}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $b).call($c); }, TMP_11.$$arity = -1); self.$private(); if ((($a = self['$respond_to?']("singleton_class?")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return (Opal.defn(self, '$singleton_class?', TMP_12 = function() { var $a, self = this; return ((($a = true) !== false && $a !== nil && $a != null) ? $a : self.$ancestors().$first()['$!='](self)); }, TMP_12.$$arity = 0), nil) && 'singleton_class?' }; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/callbacks"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$require', '$extend', '$each', '$is_a?', '$instance_exec', '$to_proc', '$send', '$callbacks_for', '$class', '$class_attribute', '$define_singleton_method', '$concat', '$push', '$+', '$respond_to?', '$superclass']); self.$require("active_support/core_ext/class/attribute"); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Callbacks, self = $Callbacks = $module($base, 'Callbacks'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_3; Opal.defs(self, '$included', TMP_1 = function $$included(base) { var self = this; return base.$extend($scope.get('ClassMethods')); }, TMP_1.$$arity = 1); Opal.defn(self, '$run_callback', TMP_3 = function $$run_callback(name, $a_rest) { var $b, $c, TMP_2, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } return ($b = ($c = self.$class().$callbacks_for(name)).$each, $b.$$p = (TMP_2 = function(callback){var self = TMP_2.$$s || this, $a, $d; if (callback == null) callback = nil; if ((($a = callback['$is_a?']($scope.get('Proc'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($d = self).$instance_exec, $a.$$p = callback.$to_proc(), $a).apply($d, Opal.to_a(args)) } else { return ($a = self).$send.apply($a, [callback].concat(Opal.to_a(args))) }}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).call($c); }, TMP_3.$$arity = -2); (function($base) { var $ClassMethods, self = $ClassMethods = $module($base, 'ClassMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_5, TMP_6; Opal.defn(self, '$define_callback', TMP_5 = function $$define_callback(callback_name) { var $a, $b, TMP_4, self = this, $iter = TMP_5.$$p, $yield = $iter || nil, attribute_name = nil; TMP_5.$$p = null; attribute_name = "_" + (callback_name) + "_callbacks"; self.$class_attribute(attribute_name); self.$send("" + (attribute_name) + "=", []); return ($a = ($b = self).$define_singleton_method, $a.$$p = (TMP_4 = function($c_rest){var self = TMP_4.$$s || this, block, args, callbacks = nil; block = TMP_4.$$p || nil, TMP_4.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } callbacks = self.$send(attribute_name); callbacks.$concat(args); if ((block !== nil)) { callbacks.$push(block)}; return self.$send("" + (attribute_name) + "=", callbacks);}, TMP_4.$$s = self, TMP_4.$$arity = -1, TMP_4), $a).call($b, callback_name); }, TMP_5.$$arity = 1); Opal.defn(self, '$callbacks_for', TMP_6 = function $$callbacks_for(callback_name) { var $a, self = this, attribute_name = nil; attribute_name = "_" + (callback_name) + "_callbacks"; return $rb_plus((function() {if ((($a = self.$superclass()['$respond_to?']("callbacks_for")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$superclass().$callbacks_for(callback_name) } else { return [] }; return nil; })(), self.$send(attribute_name)); }, TMP_6.$$arity = 1); })($scope.base); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/rendering_context"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_accessor', '$!', '$remove_nodes_from_args', '$build', '$waiting_on_resources', '$waiting_on_resources=', '$run_child_block', '$to_proc', '$nil?', '$dup', '$tap', '$detect', '$respond_to?', '$is_a?', '$last', '$create_element', '$span', '$to_s', '$<<', '$delete', '$include?', '$[]=', '$index', '$[]', '$each', '$as_node', '$try', '$empty?', '$!=', '$raise_render_error', '$==', '$count', '$improper_render', '$>', '$class', '$raise', '$define_method', '$unshift', '$send', '$render']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $RenderingContext(){}; var self = $RenderingContext = $klass($base, $super, 'RenderingContext', $RenderingContext); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_8, TMP_9, TMP_10, TMP_11, TMP_13, TMP_14, TMP_15, TMP_16; self.$attr_accessor("waiting_on_resources"); Opal.defn(self, '$render', TMP_1 = function $$render(name, $a_rest) { var $b, $c, TMP_2, $d, $e, self = this, args, $iter = TMP_1.$$p, block = $iter || nil, was_outer_most = nil, element = nil; if (self.not_outer_most == null) self.not_outer_most = nil; if (self.buffer == null) self.buffer = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_1.$$p = null; try { was_outer_most = self.not_outer_most['$!'](); self.not_outer_most = true; self.$remove_nodes_from_args(args); if ((($b = self.buffer) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { ((($b = self.buffer) !== false && $b !== nil && $b != null) ? $b : self.buffer = []) }; if (block !== false && block !== nil && block != null) { element = ($b = ($c = self).$build, $b.$$p = (TMP_2 = function(){var self = TMP_2.$$s || this, $a, $d, $e, TMP_3, $f, $g, TMP_5, TMP_6, $h, TMP_7, saved_waiting_on_resources = nil, buffer = nil; if (self.buffer == null) self.buffer = nil; saved_waiting_on_resources = self.$waiting_on_resources(); (($a = [nil]), $d = self, $d['$waiting_on_resources='].apply($d, $a), $a[$a.length-1]); ($a = ($d = self).$run_child_block, $a.$$p = block.$to_proc(), $a).call($d, name['$nil?']()); if (name !== false && name !== nil && name != null) { buffer = self.buffer.$dup(); return ($a = ($e = ($f = ($g = $scope.get('React')).$create_element, $f.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return buffer}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $f).apply($g, [name].concat(Opal.to_a(args)))).$tap, $a.$$p = (TMP_3 = function(element){var self = TMP_3.$$s || this, $f, $g, $h, $i, $j, TMP_4; if (element == null) element = nil; (($f = [((($h = saved_waiting_on_resources) !== false && $h !== nil && $h != null) ? $h : ($i = ($j = buffer).$detect, $i.$$p = (TMP_4 = function(e){var self = TMP_4.$$s || this, $k; if (e == null) e = nil; if ((($k = e['$respond_to?']("waiting_on_resources")) !== nil && $k != null && (!$k.$$is_boolean || $k == true))) { return e.$waiting_on_resources() } else { return nil }}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $i).call($j)['$!']()['$!']())]), $g = element, $g['$waiting_on_resources='].apply($g, $f), $f[$f.length-1]); return ($f = element, ((($g = $f.$waiting_on_resources()) !== false && $g !== nil && $g != null) ? $g : $f['$waiting_on_resources='](($h = buffer.$last()['$is_a?']($scope.get('String')), $h !== false && $h !== nil && $h != null ?self.$waiting_on_resources() : $h))));}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($e); } else if ((($a = self.buffer.$last()['$is_a?']((($scope.get('React')).$$scope.get('Element')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($f = self.buffer.$last()).$tap, $a.$$p = (TMP_6 = function(element){var self = TMP_6.$$s || this, $h, $i; if (element == null) element = nil; return ($h = element, ((($i = $h.$waiting_on_resources()) !== false && $i !== nil && $i != null) ? $i : $h['$waiting_on_resources='](saved_waiting_on_resources)))}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($f) } else { return ($a = ($h = self.buffer.$last().$to_s().$span()).$tap, $a.$$p = (TMP_7 = function(element){var self = TMP_7.$$s || this, $i, $j; if (element == null) element = nil; return (($i = [saved_waiting_on_resources]), $j = element, $j['$waiting_on_resources='].apply($j, $i), $i[$i.length-1])}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $a).call($h) };}, TMP_2.$$s = self, TMP_2.$$arity = 0, TMP_2), $b).call($c) } else if ((($b = name['$is_a?']((($scope.get('React')).$$scope.get('Element')))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { element = name } else { element = ($b = $scope.get('React')).$create_element.apply($b, [name].concat(Opal.to_a(args))); (($d = [self.$waiting_on_resources()]), $e = element, $e['$waiting_on_resources='].apply($e, $d), $d[$d.length-1]); }; self.buffer['$<<'](element); (($d = [nil]), $e = self, $e['$waiting_on_resources='].apply($e, $d), $d[$d.length-1]); return element; } finally { if (was_outer_most !== false && was_outer_most !== nil && was_outer_most != null) { self.not_outer_most = self.buffer = nil} }; }, TMP_1.$$arity = -2); Opal.defn(self, '$build', TMP_8 = function $$build() { var self = this, $iter = TMP_8.$$p, $yield = $iter || nil, current = nil, return_val = nil; if (self.buffer == null) self.buffer = nil; TMP_8.$$p = null; current = self.buffer; self.buffer = []; return_val = Opal.yield1($yield, self.buffer); self.buffer = current; return return_val; }, TMP_8.$$arity = 0); Opal.defn(self, '$as_node', TMP_9 = function $$as_node(element) { var self = this; if (self.buffer == null) self.buffer = nil; self.buffer.$delete(element); return element; }, TMP_9.$$arity = 1); Opal.alias(self, 'delete', 'as_node'); Opal.defn(self, '$rendered?', TMP_10 = function(element) { var self = this; if (self.buffer == null) self.buffer = nil; return self.buffer['$include?'](element); }, TMP_10.$$arity = 1); Opal.defn(self, '$replace', TMP_11 = function $$replace(e1, e2) { var self = this; if (self.buffer == null) self.buffer = nil; return self.buffer['$[]='](self.buffer.$index(e1), e2); }, TMP_11.$$arity = 2); Opal.defn(self, '$remove_nodes_from_args', TMP_13 = function $$remove_nodes_from_args(args) { var $a, $b, TMP_12, self = this; if ((($a = ($b = args['$[]'](0), $b !== false && $b !== nil && $b != null ?args['$[]'](0)['$is_a?']($scope.get('Hash')) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = args['$[]'](0)).$each, $a.$$p = (TMP_12 = function(key, value){var self = TMP_12.$$s || this, $c; if (key == null) key = nil;if (value == null) value = nil; try { if ((($c = value['$is_a?']($scope.get('Element'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return value.$as_node() } else { return nil } } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) { try { return nil } finally { Opal.pop_exception() } } else { throw $err; } }}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $a).call($b) } else { return nil }; }, TMP_13.$$arity = 1); Opal.defn(self, '$run_child_block', TMP_14 = function $$run_child_block(is_outer_scope) { var $a, $b, $c, self = this, $iter = TMP_14.$$p, $yield = $iter || nil, result = nil; if (self.buffer == null) self.buffer = nil; TMP_14.$$p = null; result = Opal.yieldX($yield, []); if ((($a = result.$try(((($b = "acts_as_string?") !== false && $b !== nil && $b != null) ? $b : result['$is_a?']($scope.get('String'))))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = result.$to_s().$span()}; if ((($a = ((($b = result['$is_a?']($scope.get('String'))) !== false && $b !== nil && $b != null) ? $b : (($c = result['$is_a?']((($scope.get('React')).$$scope.get('Element'))), $c !== false && $c !== nil && $c != null ?self.buffer['$empty?']() : $c)))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.buffer['$<<'](result)}; if ((($a = (($b = is_outer_scope !== false && is_outer_scope !== nil && is_outer_scope != null) ? self.buffer['$!=']([result]) : is_outer_scope)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise_render_error(result) } else { return nil }; }, TMP_14.$$arity = 1); Opal.defn(self, '$raise_render_error', TMP_15 = function $$raise_render_error(result) { var $a, self = this; if (self.buffer == null) self.buffer = nil; if (self.buffer.$count()['$=='](1)) { self.$improper_render("A different element was returned than was generated within the DSL.", "Possibly improper use of Element#delete.")}; if ((($a = $rb_gt(self.buffer.$count(), 1)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$improper_render("Instead " + (self.buffer.$count()) + " elements were generated.", "Do you want to wrap your elements in a div?")}; if ((($a = result.$try("reactrb_component?")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$improper_render("Instead the component " + (result) + " was returned.", "Did you mean " + (result) + "()?")}; return self.$improper_render("Instead the " + (result.$class()) + " " + (result) + " was returned.", "You may need to convert this to a string."); }, TMP_15.$$arity = 1); return (Opal.defn(self, '$improper_render', TMP_16 = function $$improper_render(message, solution) { var self = this; return self.$raise("a component's render method must generate and return exactly 1 element or a string.\n" + (" " + (message) + " " + (solution))); }, TMP_16.$$arity = 2), nil) && 'improper_render'; })(Opal.get_singleton_class(self)) })($scope.base, null); (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_17, TMP_20, TMP_23; ($a = ($b = ["span", "td", "th", "while_loading"]).$each, $a.$$p = (TMP_17 = function(tag){var self = TMP_17.$$s || this, $c, $d, TMP_18; if (tag == null) tag = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_18 = function($e_rest){var self = TMP_18.$$s || this, block, args, $f, $g, $h, TMP_19; block = TMP_18.$$p || nil, TMP_18.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } args.$unshift(tag); if ((($f = self['$is_a?']((($scope.get('React')).$$scope.get('Component')))) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { return ($f = ($g = self).$send, $f.$$p = block.$to_proc(), $f).apply($g, Opal.to_a(args))}; return ($f = ($h = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $f.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this; return self.$to_s()}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $f).apply($h, Opal.to_a(args));}, TMP_18.$$s = self, TMP_18.$$arity = -1, TMP_18), $c).call($d, tag)}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b); Opal.defn(self, '$para', TMP_20 = function $$para($a_rest) { var $b, $c, $d, TMP_21, self = this, args, $iter = TMP_20.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_20.$$p = null; args.$unshift("p"); if ((($b = self['$is_a?']((($scope.get('React')).$$scope.get('Component')))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = self).$send, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args))}; return ($b = ($d = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $b.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this; return self.$to_s()}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21), $b).apply($d, Opal.to_a(args)); }, TMP_20.$$arity = -1); return (Opal.defn(self, '$br', TMP_23 = function $$br() { var $a, $b, TMP_22, self = this; if ((($a = self['$is_a?']((($scope.get('React')).$$scope.get('Component')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$send("br")}; return ($a = ($b = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $a.$$p = (TMP_22 = function(){var self = TMP_22.$$s || this; (($scope.get('React')).$$scope.get('RenderingContext')).$render(self.$to_s()); return (($scope.get('React')).$$scope.get('RenderingContext')).$render("br");}, TMP_22.$$s = self, TMP_22.$$arity = 0, TMP_22), $a).call($b, "span"); }, TMP_23.$$arity = 0), nil) && 'br'; })(Opal.Object, null); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/class_methods"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$attr_accessor', '$>', '$count', '$define_state_methods', '$to_proc', '$class_state_wrapper', '$__state_wrapper', '$singleton_class', '$new', '$class_mutator_wrapper']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $ClassMethods, self = $ClassMethods = $module($base, 'ClassMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5; self.$attr_accessor("__shared_states", "__class_states", "__instance_states"); Opal.defn(self, '$state', TMP_1 = function $$state($a_rest) { var $b, $c, self = this, args, $iter = TMP_1.$$p, block = $iter || nil; if (self.state == null) self.state = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_1.$$p = null; if ((($b = $rb_gt(args.$count(), 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return ($b = ($c = self.$singleton_class().$__state_wrapper().$class_state_wrapper()).$define_state_methods, $b.$$p = block.$to_proc(), $b).apply($c, [self].concat(Opal.to_a(args))) } else { return ((($b = self.state) !== false && $b !== nil && $b != null) ? $b : self.state = self.$singleton_class().$__state_wrapper().$class_state_wrapper().$new(self)) }; }, TMP_1.$$arity = -1); Opal.defn(self, '$mutate', TMP_2 = function $$mutate() { var $a, self = this; if (self.mutate == null) self.mutate = nil; return ((($a = self.mutate) !== false && $a !== nil && $a != null) ? $a : self.mutate = self.$singleton_class().$__state_wrapper().$class_mutator_wrapper().$new(self)); }, TMP_2.$$arity = 0); Opal.defn(self, '$__shared_states', TMP_3 = function $$__shared_states() { var $a, self = this; if (self.__shared_states == null) self.__shared_states = nil; return ((($a = self.__shared_states) !== false && $a !== nil && $a != null) ? $a : self.__shared_states = []); }, TMP_3.$$arity = 0); Opal.defn(self, '$__class_states', TMP_4 = function $$__class_states() { var $a, self = this; if (self.__class_states == null) self.__class_states = nil; return ((($a = self.__class_states) !== false && $a !== nil && $a != null) ? $a : self.__class_states = []); }, TMP_4.$$arity = 0); Opal.defn(self, '$__instance_states', TMP_5 = function $$__instance_states() { var $a, self = this; if (self.__instance_states == null) self.__instance_states = nil; return ((($a = self.__instance_states) !== false && $a !== nil && $a != null) ? $a : self.__instance_states = []); }, TMP_5.$$arity = 0); })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/dispatch_receiver"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_accessor', '$format_callback', '$empty?', '$raise', '$each', '$on_dispatch', '$call', '$private', '$is_a?', '$last', '$pop', '$lambda', '$send', '$to_s']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DispatchReceiver, self = $DispatchReceiver = $module($base, 'DispatchReceiver'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_5; (function($base, $super) { function $InvalidOperationError(){}; var self = $InvalidOperationError = $klass($base, $super, 'InvalidOperationError', $InvalidOperationError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); self.$attr_accessor("params"); Opal.defn(self, '$receives', TMP_1 = function $$receives($a_rest) { var $b, $c, TMP_2, self = this, args, $iter = TMP_1.$$p, block = $iter || nil, callback = nil, message = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_1.$$p = null; callback = self.$format_callback(args); if ((($b = args['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { message = "At least one operation must be passed in to the 'receives' macro"; self.$raise($scope.get('InvalidOperationError'), message);}; return ($b = ($c = args).$each, $b.$$p = (TMP_2 = function(operation){var self = TMP_2.$$s || this, $a, $d, TMP_3; if (operation == null) operation = nil; return ($a = ($d = operation).$on_dispatch, $a.$$p = (TMP_3 = function(params){var self = TMP_3.$$s || this; if (params == null) params = nil; self.params = params; if (callback !== false && callback !== nil && callback != null) { callback.$call()}; if (block !== false && block !== nil && block != null) { return Opal.yield1(block, params); } else { return nil };}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($d)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).call($c); }, TMP_1.$$arity = -1); self.$private(); Opal.defn(self, '$format_callback', TMP_5 = function $$format_callback(args) { var $a, $b, TMP_4, self = this, method_name = nil; if ((($a = args.$last()['$is_a?']($scope.get('Symbol'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { method_name = args.$pop(); return ($a = ($b = self).$lambda, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return self.$send((method_name.$to_s()))}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b); } else if ((($a = args.$last()['$is_a?']($scope.get('Proc'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return args.$pop() } else { return nil }; }, TMP_5.$$arity = 1); })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/instance_methods"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$each', '$==', '$[]', '$initializer_value', '$__send__', '$mutate', '$to_s', '$instance_eval', '$to_proc', '$__instance_states', '$class', '$new', '$instance_state_wrapper', '$__state_wrapper', '$singleton_class', '$instance_mutator_wrapper', '$private', '$>', '$arity', '$call']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $InstanceMethods, self = $InstanceMethods = $module($base, 'InstanceMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5; Opal.defn(self, '$init_store', TMP_2 = function $$init_store() { var $a, $b, TMP_1, self = this; return ($a = ($b = self.$class().$__instance_states()).$each, $a.$$p = (TMP_1 = function(instance_state){var self = TMP_1.$$s || this, $c, $d, proc_value = nil, block_value = nil; if (instance_state == null) instance_state = nil; if (instance_state['$[]'](1)['$[]']("scope")['$==']("shared")) { return nil;}; proc_value = self.$initializer_value(instance_state['$[]'](1)['$[]']("initializer")); self.$mutate().$__send__((instance_state['$[]'](0).$to_s()), proc_value); if ((($c = instance_state['$[]'](1)['$[]']("block")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { return nil; }; block_value = ($c = ($d = self).$instance_eval, $c.$$p = instance_state['$[]'](1)['$[]']("block").$to_proc(), $c).call($d); return self.$mutate().$__send__((instance_state['$[]'](0).$to_s()), block_value);}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); }, TMP_2.$$arity = 0); Opal.defn(self, '$state', TMP_3 = function $$state() { var $a, self = this; if (self.state == null) self.state = nil; return ((($a = self.state) !== false && $a !== nil && $a != null) ? $a : self.state = self.$class().$singleton_class().$__state_wrapper().$instance_state_wrapper().$new(self)); }, TMP_3.$$arity = 0); Opal.defn(self, '$mutate', TMP_4 = function $$mutate() { var $a, self = this; if (self.mutate == null) self.mutate = nil; return ((($a = self.mutate) !== false && $a !== nil && $a != null) ? $a : self.mutate = self.$class().$singleton_class().$__state_wrapper().$instance_mutator_wrapper().$new(self)); }, TMP_4.$$arity = 0); self.$private(); Opal.defn(self, '$initializer_value', TMP_5 = function $$initializer_value(initializer) { var $a, self = this; if ((($a = $rb_gt(initializer.$arity(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return initializer.$call(self) } else { return initializer.$call() }; }, TMP_5.$$arity = 1); })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/mutator_wrapper"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$define_method', '$==', '$[]', '$__from__', '$state', '$get_state', '$to_s', '$>', '$count', '$set_state', '$new', '$initialize_values?', '$initialize_values', '$include?', '$initializer_proc', '$receives', '$__send__', '$mutate', '$call', '$private', '$arity', '$lambda', '$attr_accessor', '$allocate', '$__from__=', '$add_method', '$to_proc']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $MutatorWrapper(){}; var self = $MutatorWrapper = $klass($base, $super, 'MutatorWrapper', $MutatorWrapper); var def = self.$$proto, $scope = self.$$scope, TMP_11, TMP_12; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_3, TMP_4, TMP_7, TMP_10; Opal.defn(self, '$add_method', TMP_3 = function $$add_method(klass, method_name, opts) { var $a, $b, TMP_1, self = this; if (opts == null) { opts = $hash2([], {}); } ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function($c_rest){var self = TMP_1.$$s || this, args, $d, $e, TMP_2, from = nil, current_value = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } from = (function() {if (opts['$[]']("scope")['$==']("shared")) { return klass.$state().$__from__() } else { return self.$__from__() }; return nil; })(); current_value = (($scope.get('React')).$$scope.get('State')).$get_state(from, method_name.$to_s()); if ((($d = $rb_gt(args.$count(), 0)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { (($scope.get('React')).$$scope.get('State')).$set_state(from, method_name.$to_s(), args['$[]'](0)); return current_value; } else { (($scope.get('React')).$$scope.get('State')).$set_state(from, method_name.$to_s(), current_value); return ($d = ($e = (($scope.get('React')).$$scope.get('Observable'))).$new, $d.$$p = (TMP_2 = function(update){var self = TMP_2.$$s || this; if (update == null) update = nil; return (($scope.get('React')).$$scope.get('State')).$set_state(from, method_name.$to_s(), update)}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $d).call($e, current_value); };}, TMP_1.$$s = self, TMP_1.$$arity = -1, TMP_1), $a).call($b, (method_name.$to_s())); if ((($a = self['$initialize_values?'](opts)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$initialize_values(klass, method_name, opts) } else { return nil }; }, TMP_3.$$arity = -3); Opal.defn(self, '$initialize_values?', TMP_4 = function(opts) { var $a, $b, self = this; return ($a = ["class", "shared"]['$include?'](opts['$[]']("scope")), $a !== false && $a !== nil && $a != null ?(((($b = opts['$[]']("initializer")) !== false && $b !== nil && $b != null) ? $b : opts['$[]']("block"))) : $a); }, TMP_4.$$arity = 1); Opal.defn(self, '$initialize_values', TMP_7 = function $$initialize_values(klass, name, opts) { var $a, $b, TMP_5, $c, TMP_6, self = this, initializer = nil; if ((($a = opts['$[]']("initializer")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { initializer = self.$initializer_proc(opts['$[]']("initializer"), klass, name)}; if ((($a = (($b = initializer !== false && initializer !== nil && initializer != null) ? opts['$[]']("block") : initializer)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = klass).$receives, $a.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return klass.$mutate().$__send__((name.$to_s()), opts['$[]']("block").$call())}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $a).call($b, (((($scope.get('Hyperloop')).$$scope.get('Application'))).$$scope.get('Boot')), initializer) } else if (initializer !== false && initializer !== nil && initializer != null) { return klass.$receives((((($scope.get('Hyperloop')).$$scope.get('Application'))).$$scope.get('Boot')), initializer) } else if ((($a = opts['$[]']("block")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = klass).$receives, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return klass.$mutate().$__send__((name.$to_s()), opts['$[]']("block").$call())}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($c, (((($scope.get('Hyperloop')).$$scope.get('Application'))).$$scope.get('Boot'))) } else { return nil }; }, TMP_7.$$arity = 3); self.$private(); return (Opal.defn(self, '$initializer_proc', TMP_10 = function $$initializer_proc(initializer, klass, name) { var $a, $b, TMP_8, $c, TMP_9, self = this; if ((($a = $rb_gt(initializer.$arity(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$lambda, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this; return klass.$mutate().$__send__((name.$to_s()), initializer.$call(klass))}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $a).call($b) } else { return ($a = ($c = self).$lambda, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; return klass.$mutate().$__send__((name.$to_s()), initializer.$call())}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $a).call($c) }; }, TMP_10.$$arity = 3), nil) && 'initializer_proc'; })(Opal.get_singleton_class(self)); self.$attr_accessor("__from__"); Opal.defs(self, '$new', TMP_11 = function(from) { var $a, $b, self = this, instance = nil; instance = self.$allocate(); (($a = [from]), $b = instance, $b['$__from__='].apply($b, $a), $a[$a.length-1]); return instance; }, TMP_11.$$arity = 1); return (Opal.defn(self, '$method_missing', TMP_12 = function $$method_missing(name, $a_rest) { var $b, $c, self = this, args, $iter = TMP_12.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_12.$$p = null; ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(Opal.get_singleton_class(self))).$add_method(nil, name); return ($b = ($c = self).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, [name].concat(Opal.to_a(args))); }, TMP_12.$$arity = -2), nil) && 'method_missing'; })($scope.base, $scope.get('BaseStoreClass')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/state_wrapper/argument_validator"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$parse_arguments', '$to_proc', '$[]', '$[]=', '$default_scope', '$validate_initializer', '$==', '$private', '$raise', '$is_a?', '$first', '$include?', '$to_sym', '$keys', '$invalid_option', '$shift', '$dup_or_return_intial_value', '$class', '$lambda', '$send', '$to_s', '$dup']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StateWrapper(){}; var self = $StateWrapper = $klass($base, $super, 'StateWrapper', $StateWrapper); var def = self.$$proto, $scope = self.$$scope; return (function($base) { var $ArgumentValidator, self = $ArgumentValidator = $module($base, 'ArgumentValidator'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_8, TMP_10; (function($base, $super) { function $InvalidOptionError(){}; var self = $InvalidOptionError = $klass($base, $super, 'InvalidOptionError', $InvalidOptionError); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('StandardError')); Opal.defn(self, '$validate_args!', TMP_1 = function(klass, $a_rest) { var $b, $c, $d, $e, self = this, args, $iter = TMP_1.$$p, block = $iter || nil, name = nil, initial_value = nil, opts = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_1.$$p = null; $c = ($d = ($e = self).$parse_arguments, $d.$$p = block.$to_proc(), $d).apply($e, Opal.to_a(args)), $b = Opal.to_ary($c), name = ($b[0] == null ? nil : $b[0]), initial_value = ($b[1] == null ? nil : $b[1]), opts = ($b[2] == null ? nil : $b[2]), $c; ($b = "scope", $c = opts, ((($d = $c['$[]']($b)) !== false && $d !== nil && $d != null) ? $d : $c['$[]=']($b, self.$default_scope(klass)))); opts['$[]=']("initializer", self.$validate_initializer(initial_value, klass, opts)); if (block !== false && block !== nil && block != null) { opts['$[]=']("block", block)}; if ((($b = opts['$[]']("reader")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { opts['$[]=']("reader", (function() {if (opts['$[]']("reader")['$=='](true)) { return name } else { return opts['$[]']("reader") }; return nil; })())}; return [name, opts]; }, TMP_1.$$arity = -2); self.$private(); Opal.defn(self, '$invalid_option', TMP_2 = function $$invalid_option(message) { var self = this; return self.$raise($scope.get('InvalidOptionError'), message); }, TMP_2.$$arity = 1); Opal.defn(self, '$parse_arguments', TMP_3 = function $$parse_arguments($a_rest) { var $b, $c, self = this, args, message = nil, name = nil, initial_value = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = args.$first()['$is_a?']($scope.get('Hash'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = ["reader", "initializer", "scope"]['$include?'](args.$first().$keys().$first().$to_sym())) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { message = "The name of the state must be specified first as " + "either 'state :name' or 'state name: nil'"; self.$invalid_option(message);}; $c = args['$[]'](0).$shift(), $b = Opal.to_ary($c), name = ($b[0] == null ? nil : $b[0]), initial_value = ($b[1] == null ? nil : $b[1]), $c; } else { name = args.$shift() }; return [name, initial_value, ((($b = args['$[]'](0)) !== false && $b !== nil && $b != null) ? $b : $hash2([], {}))]; }, TMP_3.$$arity = -1); Opal.defn(self, '$validate_initializer', TMP_8 = function $$validate_initializer(initial_value, klass, opts) { var $a, $b, TMP_4, $c, TMP_5, $d, TMP_6, $e, TMP_7, self = this, method_name = nil; if (initial_value !== false && initial_value !== nil && initial_value != null) { return self.$dup_or_return_intial_value(initial_value) } else if ((($a = opts['$[]']("initializer")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = [$scope.get('Symbol'), $scope.get('String')]['$include?'](opts['$[]']("initializer").$class())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { method_name = opts['$[]']("initializer"); if ((($a = ["class", "shared"]['$include?'](opts['$[]']("scope"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self).$lambda, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return klass.$send((method_name.$to_s()))}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b) } else { return ($a = ($c = self).$lambda, $a.$$p = (TMP_5 = function(instance){var self = TMP_5.$$s || this; if (instance == null) instance = nil; return instance.$send((method_name.$to_s()))}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($c) }; } else if ((($a = opts['$[]']("initializer")['$is_a?']($scope.get('Proc'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return opts['$[]']("initializer") } else { self.$invalid_option("'state' option 'initialize' must either be a Symbol or a Proc"); return ($a = ($d = self).$lambda, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return nil}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($d); } } else { return ($a = ($e = self).$lambda, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return nil}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $a).call($e) }; }, TMP_8.$$arity = 3); Opal.defn(self, '$dup_or_return_intial_value', TMP_10 = function $$dup_or_return_intial_value(value) { var $a, $b, TMP_9, self = this; value = (function() { try { return value.$dup() } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return value } finally { Opal.pop_exception() } } else { throw $err; } }})(); return ($a = ($b = self).$lambda, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; return value}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $a).call($b); }, TMP_10.$$arity = 1); })($scope.base) })($scope.base, $scope.get('BaseStoreClass')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/state_wrapper"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $gvars = Opal.gvars; Opal.add_stubs(['$extend', '$attr_reader', '$==', '$add_class_instance_vars', '$new', '$empty?', '$validate_args!', '$to_proc', '$add_readers', '$add_error_methods', '$state', '$singleton_class', '$add_methods', '$remove_methods', '$<<', '$send', '$to_s', '$[]', '$include?', '$class_eval', '$define_method', '$__send__', '$define_singleton_method', '$each', '$add_method', '$instance_variable_get', '$__from__', '$get_state', '$respond_to?', '$wrappers', '$class_state_wrapper', '$__state_wrapper', '$attr_accessor', '$allocate', '$__from__=']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StateWrapper(){}; var self = $StateWrapper = $klass($base, $super, 'StateWrapper', $StateWrapper); var def = self.$$proto, $scope = self.$$scope, TMP_17, TMP_18; self.$extend($scope.get('ArgumentValidator')); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2, TMP_3, TMP_7, TMP_10, TMP_11, TMP_13, TMP_15, TMP_16; self.$attr_reader("instance_state_wrapper", "class_state_wrapper", "instance_mutator_wrapper", "class_mutator_wrapper", "wrappers"); Opal.defn(self, '$inherited', TMP_1 = function $$inherited(subclass) { var self = this; if (self['$==']($scope.get('StateWrapper'))) { return subclass.$add_class_instance_vars(subclass) } else { return nil }; }, TMP_1.$$arity = 1); Opal.defn(self, '$add_class_instance_vars', TMP_2 = function $$add_class_instance_vars(subclass) { var self = this; if (self.shared_state_wrapper == null) self.shared_state_wrapper = nil; if (self.shared_mutator_wrapper == null) self.shared_mutator_wrapper = nil; if (self.instance_state_wrapper == null) self.instance_state_wrapper = nil; if (self.instance_mutator_wrapper == null) self.instance_mutator_wrapper = nil; if (self.class_state_wrapper == null) self.class_state_wrapper = nil; if (self.class_mutator_wrapper == null) self.class_mutator_wrapper = nil; self.shared_state_wrapper = subclass; self.instance_state_wrapper = $scope.get('Class').$new(self.shared_state_wrapper); self.class_state_wrapper = $scope.get('Class').$new(self.shared_state_wrapper); self.shared_mutator_wrapper = $scope.get('Class').$new($scope.get('MutatorWrapper')); self.instance_mutator_wrapper = $scope.get('Class').$new(self.shared_mutator_wrapper); self.class_mutator_wrapper = $scope.get('Class').$new(self.shared_mutator_wrapper); return self.wrappers = [self.instance_state_wrapper, self.instance_mutator_wrapper, self.class_state_wrapper, self.class_mutator_wrapper]; }, TMP_2.$$arity = 1); Opal.defn(self, '$define_state_methods', TMP_3 = function $$define_state_methods(klass, $a_rest) { var $b, $c, $d, $e, self = this, args, $iter = TMP_3.$$p, block = $iter || nil, name = nil, opts = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_3.$$p = null; if ((($b = args['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self}; $c = ($d = ($e = self)['$validate_args!'], $d.$$p = block.$to_proc(), $d).apply($e, [klass].concat(Opal.to_a(args))), $b = Opal.to_ary($c), name = ($b[0] == null ? nil : $b[0]), opts = ($b[1] == null ? nil : $b[1]), $c; self.$add_readers(klass, name, opts); klass.$singleton_class().$state().$add_error_methods(name, opts); klass.$singleton_class().$state().$add_methods(klass, name, opts); klass.$singleton_class().$state().$remove_methods(name, opts); return klass.$send(("__" + opts['$[]']("scope").$to_s() + "_states"))['$<<']([name, opts]); }, TMP_3.$$arity = -2); Opal.defn(self, '$add_readers', TMP_7 = function $$add_readers(klass, name, opts) { var $a, $b, TMP_4, $c, TMP_6, self = this; if ((($a = opts['$[]']("reader")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; if ((($a = ["instance", "shared"]['$include?'](opts['$[]']("scope"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ($a = ($b = klass).$class_eval, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this, $c, $d, TMP_5; return ($c = ($d = self).$define_method, $c.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this; return self.$state().$__send__((name.$to_s()))}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $c).call($d, (opts['$[]']("reader").$to_s()))}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b)}; if ((($a = ["class", "shared"]['$include?'](opts['$[]']("scope"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = klass).$define_singleton_method, $a.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this; return self.$state().$__send__((name.$to_s()))}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $a).call($c, (opts['$[]']("reader").$to_s())) } else { return nil }; }, TMP_7.$$arity = 3); Opal.defn(self, '$add_error_methods', TMP_10 = function $$add_error_methods(name, opts) { var $a, $b, TMP_8, self = this; if (self.shared_state_wrapper == null) self.shared_state_wrapper = nil; if (self.shared_mutator_wrapper == null) self.shared_mutator_wrapper = nil; if (opts['$[]']("scope")['$==']("shared")) { return nil}; return ($a = ($b = [self.shared_state_wrapper, self.shared_mutator_wrapper]).$each, $a.$$p = (TMP_8 = function(klass){var self = TMP_8.$$s || this, $c, $d, TMP_9; if (klass == null) klass = nil; return ($c = ($d = klass).$define_singleton_method, $c.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; return "nope!"}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $c).call($d, (name.$to_s()))}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $a).call($b); }, TMP_10.$$arity = 2); Opal.defn(self, '$add_methods', TMP_11 = function $$add_methods(klass, name, opts) { var self = this; self.$instance_variable_get("@" + (opts['$[]']("scope")) + "_state_wrapper").$add_method(klass, name, opts); return self.$instance_variable_get("@" + (opts['$[]']("scope")) + "_mutator_wrapper").$add_method(klass, name, opts); }, TMP_11.$$arity = 3); Opal.defn(self, '$add_method', TMP_13 = function $$add_method(klass, method_name, opts) { var $a, $b, TMP_12, self = this; if (opts == null) { opts = $hash2([], {}); } return ($a = ($b = self).$define_method, $a.$$p = (TMP_12 = function(){var self = TMP_12.$$s || this, from = nil; if (self.__from__ == null) self.__from__ = nil; from = (function() {if (opts['$[]']("scope")['$==']("shared")) { return klass.$state().$__from__() } else { return self.__from__ }; return nil; })(); return (($scope.get('React')).$$scope.get('State')).$get_state(from, method_name.$to_s());}, TMP_12.$$s = self, TMP_12.$$arity = 0, TMP_12), $a).call($b, (method_name.$to_s())); }, TMP_13.$$arity = -3); Opal.defn(self, '$remove_methods', TMP_15 = function $$remove_methods(name, opts) { var $a, $b, TMP_14, self = this; if (opts['$[]']("scope")['$==']("shared")) { } else { return nil }; return ($a = ($b = self.$wrappers()).$each, $a.$$p = (TMP_14 = function(wrapper){var self = TMP_14.$$s || this, $c; if (wrapper == null) wrapper = nil; if ((($c = wrapper['$respond_to?']((name.$to_s()))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return wrapper.$send("remove_method", (name.$to_s())) } else { return nil }}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); }, TMP_15.$$arity = 2); return (Opal.defn(self, '$default_scope', TMP_16 = function $$default_scope(klass) { var self = this; if (self['$=='](klass.$singleton_class().$__state_wrapper().$class_state_wrapper())) { return "instance" } else { return "class" }; }, TMP_16.$$arity = 1), nil) && 'default_scope'; })(Opal.get_singleton_class(self)); self.$attr_accessor("__from__"); Opal.defs(self, '$new', TMP_17 = function(from) { var $a, $b, self = this, instance = nil; instance = self.$allocate(); (($a = [from]), $b = instance, $b['$__from__='].apply($b, $a), $a[$a.length-1]); return instance; }, TMP_17.$$arity = 1); return (Opal.defn(self, '$method_missing', TMP_18 = function $$method_missing(name, $a_rest) { var $b, $c, self = this, args, $iter = TMP_18.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_18.$$p = null; $gvars.method_missing = [name].concat(Opal.to_a(args)); ((function(self) { var $scope = self.$$scope, def = self.$$proto; return self })(Opal.get_singleton_class(self))).$add_method(nil, name); return ($b = ($c = self).$__send__, $b.$$p = block.$to_proc(), $b).apply($c, [name].concat(Opal.to_a(args))); }, TMP_18.$$arity = -2), nil) && 'method_missing'; })($scope.base, $scope.get('BaseStoreClass')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'VERSION', "0.2.1") })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop/store"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$init_store']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Store(){}; var self = $Store = $klass($base, $super, 'Store', $Store); var def = self.$$proto, $scope = self.$$scope, TMP_2; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1; return (Opal.defn(self, '$inherited', TMP_1 = function $$inherited(child) { var self = this; return child.$include($scope.get('Mixin')); }, TMP_1.$$arity = 1), nil) && 'inherited' })(Opal.get_singleton_class(self)); return (Opal.defn(self, '$initialize', TMP_2 = function $$initialize() { var self = this; return self.$init_store(); }, TMP_2.$$arity = 0), nil) && 'initialize'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop/application/boot"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$<<', '$receivers', '$attr_reader', '$new', '$each', '$call', '$puts']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope, $a; if ((($a = ($scope.Operation != null)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2; Opal.defn(self, '$on_dispatch', TMP_1 = function $$on_dispatch() { var self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; return self.$receivers()['$<<'](block); }, TMP_1.$$arity = 0); return (Opal.defn(self, '$receivers', TMP_2 = function $$receivers() { var $a, self = this; if (self.receivers == null) self.receivers = nil; return ((($a = self.receivers) !== false && $a !== nil && $a != null) ? $a : self.receivers = []); }, TMP_2.$$arity = 0), nil) && 'receivers'; })(Opal.get_singleton_class(self)) })($scope.base, null) }; (function($base, $super) { function $Application(){}; var self = $Application = $klass($base, $super, 'Application', $Application); var def = self.$$proto, $scope = self.$$scope, $a; if ((($a = ($scope.Boot != null)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return (function($base, $super) { function $Boot(){}; var self = $Boot = $klass($base, $super, 'Boot', $Boot); var def = self.$$proto, $scope = self.$$scope, TMP_5; (function($base, $super) { function $ReactDummyParams(){}; var self = $ReactDummyParams = $klass($base, $super, 'ReactDummyParams', $ReactDummyParams); var def = self.$$proto, $scope = self.$$scope, TMP_3; self.$attr_reader("context"); return (Opal.defn(self, '$initialize', TMP_3 = function $$initialize(context) { var self = this; return self.context = context; }, TMP_3.$$arity = 1), nil) && 'initialize'; })($scope.base, null); return (Opal.defs(self, '$run', TMP_5 = function $$run($kwargs) { var $a, $b, TMP_4, self = this, context, params = nil, e = nil; if ($kwargs == null || !$kwargs.$$is_hash) { if ($kwargs == null) { $kwargs = $hash2([], {}); } else { throw Opal.ArgumentError.$new('expected kwargs'); } } if ((context = $kwargs.$$smap['context']) == null) { context = nil } try { params = $scope.get('ReactDummyParams').$new(context); return ($a = ($b = self.$receivers()).$each, $a.$$p = (TMP_4 = function(receiver){var self = TMP_4.$$s || this; if (receiver == null) receiver = nil; return receiver.$call(params)}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$puts("called Boot.run and she broke " + (e)) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_5.$$arity = -1), nil) && 'run'; })($scope.base, $scope.get('Operation')) } })($scope.base, null); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyperloop/store/mixin"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$extend', '$define_singleton_method', '$new', '$singleton_class', '$define_state_methods', '$to_proc', '$__state_wrapper']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Store(){}; var self = $Store = $klass($base, $super, 'Store', $Store); var def = self.$$proto, $scope = self.$$scope; return (function($base) { var $Mixin, self = $Mixin = $module($base, 'Mixin'); var def = self.$$proto, $scope = self.$$scope; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_3; return (Opal.defn(self, '$included', TMP_3 = function $$included(base) { var $a, $b, TMP_1, $c, TMP_2, self = this; base.$include((($scope.get('HyperStore')).$$scope.get('InstanceMethods'))); base.$extend((($scope.get('HyperStore')).$$scope.get('ClassMethods'))); base.$extend((($scope.get('HyperStore')).$$scope.get('DispatchReceiver'))); ($a = ($b = base.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c; if (self.__state_wrapper == null) self.__state_wrapper = nil; return ((($c = self.__state_wrapper) !== false && $c !== nil && $c != null) ? $c : self.__state_wrapper = $scope.get('Class').$new((($scope.get('HyperStore')).$$scope.get('StateWrapper'))))}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b, "__state_wrapper"); return ($a = ($c = base.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_2 = function($d_rest){var self = TMP_2.$$s || this, block, args, $e, $f; block = TMP_2.$$p || nil, TMP_2.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($e = ($f = self.$__state_wrapper()).$define_state_methods, $e.$$p = block.$to_proc(), $e).apply($f, [base].concat(Opal.to_a(args)))}, TMP_2.$$s = self, TMP_2.$$arity = -1, TMP_2), $a).call($c, "state"); }, TMP_3.$$arity = 1), nil) && 'included' })(Opal.get_singleton_class(self)) })($scope.base) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/state"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$on_client?', '$attr_reader', '$!', '$empty?', '$[]', '$observers_by_name', '$respond_to?', '$each', '$include?', '$[]=', '$+', '$==', '$dup', '$merge!', '$states', '$new_observers', '$<<', '$new', '$after', '$set_state2', '$update_react_js_state', '$notify_observers', '$raise', '$delete', '$current_observers', '$to_f', '$now', '$class', '$name', '$to_s', '$object_id', '$-', '$max', '$define_method', '$instance_variable_get', '$instance_variable_set']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $State(){}; var self = $State = $klass($base, $super, 'State', $State); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'ALWAYS_UPDATE_STATE_AFTER_RENDER', $scope.get('Hyperloop')['$on_client?']()); self.rendering_level = 0; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_2, TMP_4, TMP_5, TMP_6, TMP_16, TMP_18, TMP_21, TMP_22, TMP_23, TMP_28, TMP_31, TMP_32, TMP_34, $a, $b, TMP_35; self.$attr_reader("current_observer"); Opal.defn(self, '$has_observers?', TMP_1 = function(object, name) { var self = this; return self.$observers_by_name()['$[]'](object)['$[]'](name)['$empty?']()['$!'](); }, TMP_1.$$arity = 2); Opal.defn(self, '$bulk_update', TMP_2 = function $$bulk_update() { var self = this, $iter = TMP_2.$$p, $yield = $iter || nil, saved_bulk_update_flag = nil; if (self.bulk_update_flag == null) self.bulk_update_flag = nil; TMP_2.$$p = null; try { saved_bulk_update_flag = self.bulk_update_flag; self.bulk_update_flag = true; return Opal.yieldX($yield, []);; } finally { self.bulk_update_flag = saved_bulk_update_flag }; }, TMP_2.$$arity = 0); Opal.defn(self, '$set_state2', TMP_4 = function $$set_state2(object, name, value, updates, exclusions) { var $a, $b, TMP_3, $c, self = this, object_needs_notification = nil; if (exclusions == null) { exclusions = nil; } object_needs_notification = object['$respond_to?']("update_react_js_state"); ($a = ($b = self.$observers_by_name()['$[]'](object)['$[]'](name).$dup()).$each, $a.$$p = (TMP_3 = function(observer){var self = TMP_3.$$s || this, $c, $d; if (observer == null) observer = nil; if ((($c = (($d = exclusions !== false && exclusions !== nil && exclusions != null) ? exclusions['$include?'](observer) : exclusions)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return nil;}; ($c = observer, $d = updates, $d['$[]=']($c, $rb_plus($d['$[]']($c), [object, name, value]))); if (object['$=='](observer)) { return object_needs_notification = false } else { return nil };}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b); if (object_needs_notification !== false && object_needs_notification !== nil && object_needs_notification != null) { return ($a = object, $c = updates, $c['$[]=']($a, $rb_plus($c['$[]']($a), [nil, name, value]))) } else { return nil }; }, TMP_4.$$arity = -5); Opal.defn(self, '$initialize_states', TMP_5 = function $$initialize_states(object, initial_values) { var $a, self = this; return self.$states()['$[]'](object)['$merge!'](((($a = initial_values) !== false && $a !== nil && $a != null) ? $a : $hash2([], {}))); }, TMP_5.$$arity = 2); Opal.defn(self, '$get_state', TMP_6 = function $$get_state(object, name, current_observer) { var $a, $b, self = this; if (self.delayed_updates == null) self.delayed_updates = nil; if (self.current_observer == null) self.current_observer = nil; if (current_observer == null) { current_observer = self.current_observer; } if ((($a = (($b = current_observer !== false && current_observer !== nil && current_observer != null) ? self.$new_observers()['$[]'](current_observer)['$[]'](object)['$include?'](name)['$!']() : current_observer)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$new_observers()['$[]'](current_observer)['$[]'](object)['$<<'](name)}; if ((($a = ($b = self.delayed_updates, $b !== false && $b !== nil && $b != null ?self.delayed_updates['$[]'](object)['$[]'](name) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.delayed_updates['$[]'](object)['$[]'](name)['$[]'](1)['$<<'](current_observer)}; return self.$states()['$[]'](object)['$[]'](name); }, TMP_6.$$arity = -3); Opal.defn(self, '$set_state', TMP_16 = function $$set_state(object, name, value, delay) { var $a, $b, $c, TMP_7, $d, TMP_8, TMP_14, $e, TMP_15, self = this, updates = nil; if (self.bulk_update_flag == null) self.bulk_update_flag = nil; if (self.delayed_updates == null) self.delayed_updates = nil; if (self.delayed_updater == null) self.delayed_updater = nil; if (self.rendering_level == null) self.rendering_level = nil; if (delay == null) { delay = $scope.get('ALWAYS_UPDATE_STATE_AFTER_RENDER'); } self.$states()['$[]'](object)['$[]='](name, value); if ((($a = ((($b = delay) !== false && $b !== nil && $b != null) ? $b : self.bulk_update_flag)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ((($a = self.delayed_updates) !== false && $a !== nil && $a != null) ? $a : self.delayed_updates = ($b = ($c = $scope.get('Hash')).$new, $b.$$p = (TMP_7 = function(h, k){var self = TMP_7.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, $hash2([], {}))}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7), $b).call($c)); self.delayed_updates['$[]'](object)['$[]='](name, [value, $scope.get('Set').$new()]); ((($a = self.delayed_updater) !== false && $a !== nil && $a != null) ? $a : self.delayed_updater = ($b = ($d = self).$after, $b.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, $e, $f, TMP_9, $g, TMP_10, $h, TMP_11, $i, TMP_13, delayed_updates = nil, updates = nil; if (self.delayed_updates == null) self.delayed_updates = nil; delayed_updates = self.delayed_updates; self.delayed_updates = ($e = ($f = $scope.get('Hash')).$new, $e.$$p = (TMP_9 = function(h, k){var self = TMP_9.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, $hash2([], {}))}, TMP_9.$$s = self, TMP_9.$$arity = 2, TMP_9), $e).call($f); self.delayed_updater = nil; updates = ($e = ($g = $scope.get('Hash')).$new, $e.$$p = (TMP_10 = function(hash, key){var self = TMP_10.$$s || this; if (hash == null) hash = nil;if (key == null) key = nil; return hash['$[]='](key, $scope.get('Array').$new())}, TMP_10.$$s = self, TMP_10.$$arity = 2, TMP_10), $e).call($g); ($e = ($h = delayed_updates).$each, $e.$$p = (TMP_11 = function(object, name_hash){var self = TMP_11.$$s || this, $i, $j, TMP_12; if (object == null) object = nil;if (name_hash == null) name_hash = nil; return ($i = ($j = name_hash).$each, $i.$$p = (TMP_12 = function(name, value_and_set){var self = TMP_12.$$s || this; if (name == null) name = nil;if (value_and_set == null) value_and_set = nil; return self.$set_state2(object, name, value_and_set['$[]'](0), updates, value_and_set['$[]'](1))}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $i).call($j)}, TMP_11.$$s = self, TMP_11.$$arity = 2, TMP_11), $e).call($h); return ($e = ($i = updates).$each, $e.$$p = (TMP_13 = function(observer, args){var self = TMP_13.$$s || this, $j; if (observer == null) observer = nil;if (args == null) args = nil; return ($j = observer).$update_react_js_state.apply($j, Opal.to_a(args))}, TMP_13.$$s = self, TMP_13.$$arity = 2, TMP_13), $e).call($i);}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $b).call($d, 0.001)); } else if (self.rendering_level['$=='](0)) { updates = ($a = ($b = $scope.get('Hash')).$new, $a.$$p = (TMP_14 = function(hash, key){var self = TMP_14.$$s || this; if (hash == null) hash = nil;if (key == null) key = nil; return hash['$[]='](key, $scope.get('Array').$new())}, TMP_14.$$s = self, TMP_14.$$arity = 2, TMP_14), $a).call($b); self.$set_state2(object, name, value, updates); ($a = ($e = updates).$each, $a.$$p = (TMP_15 = function(observer, args){var self = TMP_15.$$s || this, $f; if (observer == null) observer = nil;if (args == null) args = nil; return ($f = observer).$update_react_js_state.apply($f, Opal.to_a(args))}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $a).call($e);}; return value; }, TMP_16.$$arity = -4); Opal.defn(self, '$notify_observers', TMP_18 = function $$notify_observers(object, name, value) { var $a, $b, TMP_17, self = this, object_needs_notification = nil; object_needs_notification = object['$respond_to?']("update_react_js_state"); ($a = ($b = self.$observers_by_name()['$[]'](object)['$[]'](name).$dup()).$each, $a.$$p = (TMP_17 = function(observer){var self = TMP_17.$$s || this; if (observer == null) observer = nil; observer.$update_react_js_state(object, name, value); if (object['$=='](observer)) { return object_needs_notification = false } else { return nil };}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b); if (object_needs_notification !== false && object_needs_notification !== nil && object_needs_notification != null) { return object.$update_react_js_state(nil, name, value) } else { return nil }; }, TMP_18.$$arity = 3); Opal.defn(self, '$notify_observers_after_thread_completes', TMP_21 = function $$notify_observers_after_thread_completes(object, name, value) { var $a, $b, $c, TMP_19, self = this; if (self.delayed_updates == null) self.delayed_updates = nil; if (self.delayed_updater == null) self.delayed_updater = nil; (((($a = self.delayed_updates) !== false && $a !== nil && $a != null) ? $a : self.delayed_updates = []))['$<<']([object, name, value]); return ((($a = self.delayed_updater) !== false && $a !== nil && $a != null) ? $a : self.delayed_updater = ($b = ($c = self).$after, $b.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this, $d, $e, TMP_20, delayed_updates = nil; if (self.delayed_updates == null) self.delayed_updates = nil; delayed_updates = self.delayed_updates; self.delayed_updates = []; self.delayed_updater = nil; return ($d = ($e = delayed_updates).$each, $d.$$p = (TMP_20 = function(args){var self = TMP_20.$$s || this, $f; if (args == null) args = nil; return ($f = self).$notify_observers.apply($f, Opal.to_a(args))}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $d).call($e);}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $b).call($c, 0)); }, TMP_21.$$arity = 3); Opal.defn(self, '$will_be_observing?', TMP_22 = function(object, name, current_observer) { var $a, self = this; return (($a = current_observer !== false && current_observer !== nil && current_observer != null) ? self.$new_observers()['$[]'](current_observer)['$[]'](object)['$include?'](name) : current_observer); }, TMP_22.$$arity = 3); Opal.defn(self, '$is_observing?', TMP_23 = function(object, name, current_observer) { var $a, self = this; return (($a = current_observer !== false && current_observer !== nil && current_observer != null) ? self.$observers_by_name()['$[]'](object)['$[]'](name)['$include?'](current_observer) : current_observer); }, TMP_23.$$arity = 3); Opal.defn(self, '$update_states_to_observe', TMP_28 = function $$update_states_to_observe(current_observer) { var $a, $b, TMP_24, $c, TMP_26, self = this, observers = nil; if (self.current_observer == null) self.current_observer = nil; if (current_observer == null) { current_observer = self.current_observer; } if (current_observer !== false && current_observer !== nil && current_observer != null) { } else { self.$raise("update_states_to_observer called outside of watch block") }; ($a = ($b = self.$current_observers()['$[]'](current_observer)).$each, $a.$$p = (TMP_24 = function(object, names){var self = TMP_24.$$s || this, $c, $d, TMP_25; if (object == null) object = nil;if (names == null) names = nil; return ($c = ($d = names).$each, $c.$$p = (TMP_25 = function(name){var self = TMP_25.$$s || this; if (name == null) name = nil; return self.$observers_by_name()['$[]'](object)['$[]'](name).$delete(current_observer)}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25), $c).call($d)}, TMP_24.$$s = self, TMP_24.$$arity = 2, TMP_24), $a).call($b); observers = self.$current_observers()['$[]='](current_observer, self.$new_observers()['$[]'](current_observer)); self.$new_observers().$delete(current_observer); return ($a = ($c = observers).$each, $a.$$p = (TMP_26 = function(object, names){var self = TMP_26.$$s || this, $d, $e, TMP_27; if (object == null) object = nil;if (names == null) names = nil; return ($d = ($e = names).$each, $d.$$p = (TMP_27 = function(name){var self = TMP_27.$$s || this; if (name == null) name = nil; return self.$observers_by_name()['$[]'](object)['$[]'](name)['$<<'](current_observer)}, TMP_27.$$s = self, TMP_27.$$arity = 1, TMP_27), $d).call($e)}, TMP_26.$$s = self, TMP_26.$$arity = 2, TMP_26), $a).call($c); }, TMP_28.$$arity = -1); Opal.defn(self, '$remove', TMP_31 = function $$remove() { var $a, $b, TMP_29, self = this; if (self.current_observer == null) self.current_observer = nil; if ((($a = self.current_observer) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise("remove called outside of watch block") }; ($a = ($b = self.$current_observers()['$[]'](self.current_observer)).$each, $a.$$p = (TMP_29 = function(object, names){var self = TMP_29.$$s || this, $c, $d, TMP_30; if (object == null) object = nil;if (names == null) names = nil; return ($c = ($d = names).$each, $c.$$p = (TMP_30 = function(name){var self = TMP_30.$$s || this; if (self.current_observer == null) self.current_observer = nil; if (name == null) name = nil; return self.$observers_by_name()['$[]'](object)['$[]'](name).$delete(self.current_observer)}, TMP_30.$$s = self, TMP_30.$$arity = 1, TMP_30), $c).call($d)}, TMP_29.$$s = self, TMP_29.$$arity = 2, TMP_29), $a).call($b); return self.$current_observers().$delete(self.current_observer); }, TMP_31.$$arity = 0); Opal.defn(self, '$set_state_context_to', TMP_32 = function $$set_state_context_to(observer, rendering) { var $a, self = this, $iter = TMP_32.$$p, $yield = $iter || nil, start_time = nil, observer_name = nil, saved_current_observer = nil, return_value = nil; if (self.nesting_level == null) self.nesting_level = nil; if (self.current_observer == null) self.current_observer = nil; if (self.rendering_level == null) self.rendering_level = nil; if (rendering == null) { rendering = nil; } TMP_32.$$p = null; try { if ((($a = typeof Opal.global.reactive_ruby_timing !== 'undefined') !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.nesting_level = $rb_plus((((($a = self.nesting_level) !== false && $a !== nil && $a != null) ? $a : 0)), 1); start_time = $scope.get('Time').$now().$to_f(); observer_name = (function() { try {return ((function() {if ((($a = observer.$class()['$respond_to?']("name")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return observer.$class().$name() } else { return observer.$to_s() }; return nil; })()) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return "object:" + (observer.$object_id()) } else { throw $err; } }})();}; saved_current_observer = self.current_observer; self.current_observer = observer; if (rendering !== false && rendering !== nil && rendering != null) { self.rendering_level = $rb_plus(self.rendering_level, 1)}; return_value = Opal.yieldX($yield, []); return return_value; } finally { self.current_observer = saved_current_observer; if (rendering !== false && rendering !== nil && rendering != null) { self.rendering_level = $rb_minus(self.rendering_level, 1)}; if ((($a = typeof Opal.global.reactive_ruby_timing !== 'undefined') !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.nesting_level = [0, $rb_minus(self.nesting_level, 1)].$max()}; return_value; }; }, TMP_32.$$arity = -2); Opal.defn(self, '$states', TMP_34 = function $$states() { var $a, $b, $c, TMP_33, self = this; if (self.states == null) self.states = nil; return ((($a = self.states) !== false && $a !== nil && $a != null) ? $a : self.states = ($b = ($c = $scope.get('Hash')).$new, $b.$$p = (TMP_33 = function(h, k){var self = TMP_33.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, $hash2([], {}))}, TMP_33.$$s = self, TMP_33.$$arity = 2, TMP_33), $b).call($c)); }, TMP_34.$$arity = 0); return ($a = ($b = ["new_observers", "current_observers", "observers_by_name"]).$each, $a.$$p = (TMP_35 = function(method_name){var self = TMP_35.$$s || this, $c, $d, TMP_36; if (method_name == null) method_name = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_36 = function(){var self = TMP_36.$$s || this, $e, $f, $g, TMP_37; return ((($e = self.$instance_variable_get("@" + (method_name))) !== false && $e !== nil && $e != null) ? $e : self.$instance_variable_set("@" + (method_name), ($f = ($g = $scope.get('Hash')).$new, $f.$$p = (TMP_37 = function(h, k){var self = TMP_37.$$s || this, $h, $i, TMP_38; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, ($h = ($i = $scope.get('Hash')).$new, $h.$$p = (TMP_38 = function(h, k){var self = TMP_38.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, [])}, TMP_38.$$s = self, TMP_38.$$arity = 2, TMP_38), $h).call($i))}, TMP_37.$$s = self, TMP_37.$$arity = 2, TMP_37), $f).call($g)))}, TMP_36.$$s = self, TMP_36.$$arity = 0, TMP_36), $c).call($d, method_name)}, TMP_35.$$s = self, TMP_35.$$arity = 1, TMP_35), $a).call($b); })(Opal.get_singleton_class(self)); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-store"] = function(Opal) { var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$import', '$!=']); self.$require("set"); self.$require("hyperloop-config"); $scope.get('Hyperloop').$import("hyper-store"); (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $BaseStoreClass(){}; var self = $BaseStoreClass = $klass($base, $super, 'BaseStoreClass', $BaseStoreClass); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('BasicObject')) })($scope.base); self.$require("hyper-store/class_methods"); self.$require("hyper-store/dispatch_receiver"); self.$require("hyper-store/instance_methods"); self.$require("hyper-store/mutator_wrapper"); self.$require("hyper-store/state_wrapper/argument_validator"); self.$require("hyper-store/state_wrapper"); self.$require("hyper-store/version"); self.$require("hyperloop/store"); self.$require("hyperloop/application/boot"); self.$require("hyperloop/store/mixin"); self.$require("react/state"); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return nil }; }; /* Generated by Opal 0.10.3 */ Opal.modules["react/state_wrapper"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$instance_variable_get', '$__from__', '$=~', '$respond_to?', '$deprecation_warning', '$gsub', '$__send__', '$mutate', '$pre_component_method_missing']); return (function($base) { var $HyperStore, self = $HyperStore = $module($base, 'HyperStore'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $StateWrapper(){}; var self = $StateWrapper = $klass($base, $super, 'StateWrapper', $StateWrapper); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; Opal.defn(self, '$[]', TMP_1 = function(state) { var self = this; return self.$__from__().$instance_variable_get("@native").state[state] || nil; }, TMP_1.$$arity = 1); Opal.defn(self, '$[]=', TMP_2 = function(state, new_value) { var self = this; return self.$__from__().$instance_variable_get("@native").state[state] = new_value; }, TMP_2.$$arity = 2); Opal.alias(self, 'pre_component_method_missing', 'method_missing'); return (Opal.defn(self, '$method_missing', TMP_3 = function $$method_missing(method, $a_rest) { var $b, $c, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } if ((($b = ($c = method['$=~'](/\!$/), $c !== false && $c !== nil && $c != null ?self.$__from__()['$respond_to?']("deprecation_warning") : $c)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { self.$__from__().$deprecation_warning("The mutator 'state." + (method) + "' has been deprecated. Use 'mutate." + (method.$gsub(/\!$/, "")) + "' instead."); return ($b = self.$__from__().$mutate()).$__send__.apply($b, [method.$gsub(/\!$/, "")].concat(Opal.to_a(args))); } else { return ($c = self).$pre_component_method_missing.apply($c, [method].concat(Opal.to_a(args))) }; }, TMP_3.$$arity = -2), nil) && 'method_missing'; })($scope.base, $scope.get('BaseStoreClass')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/api"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$!', '$set_or_replace_state_or_prop', '$to_proc', '$private', '$raise', '$shallow_to_n', '$call']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $API, self = $API = $module($base, 'API'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; Opal.defn(self, '$dom_node', TMP_1 = function $$dom_node() { var $a, self = this; if ((($a = ((typeof ReactDOM === 'undefined' || typeof ReactDOM.findDOMNode === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ReactDOM.findDOMNode(self.native); } else if ((($a = ((typeof React.findDOMNode === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return React.findDOMNode(self.native); } else { return self.native.getDOMNode; }; }, TMP_1.$$arity = 0); Opal.defn(self, '$mounted?', TMP_2 = function() { var self = this; return self.native.isMounted(); }, TMP_2.$$arity = 0); Opal.defn(self, '$force_update!', TMP_3 = function() { var self = this; return self.native.forceUpdate(); }, TMP_3.$$arity = 0); Opal.defn(self, '$set_props', TMP_4 = function $$set_props(prop) { var $a, $b, self = this, $iter = TMP_4.$$p, block = $iter || nil; TMP_4.$$p = null; return ($a = ($b = self).$set_or_replace_state_or_prop, $a.$$p = block.$to_proc(), $a).call($b, prop, "setProps"); }, TMP_4.$$arity = 1); Opal.defn(self, '$set_props!', TMP_5 = function(prop) { var $a, $b, self = this, $iter = TMP_5.$$p, block = $iter || nil; TMP_5.$$p = null; return ($a = ($b = self).$set_or_replace_state_or_prop, $a.$$p = block.$to_proc(), $a).call($b, prop, "replaceProps"); }, TMP_5.$$arity = 1); Opal.defn(self, '$set_state', TMP_6 = function $$set_state(state) { var $a, $b, self = this, $iter = TMP_6.$$p, block = $iter || nil; TMP_6.$$p = null; return ($a = ($b = self).$set_or_replace_state_or_prop, $a.$$p = block.$to_proc(), $a).call($b, state, "setState"); }, TMP_6.$$arity = 1); Opal.defn(self, '$set_state!', TMP_7 = function(state) { var $a, $b, self = this, $iter = TMP_7.$$p, block = $iter || nil; TMP_7.$$p = null; return ($a = ($b = self).$set_or_replace_state_or_prop, $a.$$p = block.$to_proc(), $a).call($b, state, "replaceState"); }, TMP_7.$$arity = 1); self.$private(); Opal.defn(self, '$set_or_replace_state_or_prop', TMP_8 = function $$set_or_replace_state_or_prop(state_or_prop, method) { var $a, self = this, $iter = TMP_8.$$p, block = $iter || nil; if (self["native"] == null) self["native"] = nil; TMP_8.$$p = null; if ((($a = self["native"]) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise("No native ReactComponent associated") }; self["native"][method](state_or_prop.$shallow_to_n(), function(){ (function() {if (block !== false && block !== nil && block != null) { return block.$call() } else { return nil }; return nil; })() }); ; }, TMP_8.$$arity = 2); })($scope.base) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/class_methods"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $range = Opal.range, $hash2 = Opal.hash2, $hash = Opal.hash; Opal.add_stubs(['$deprecation_warning', '$==', '$[]', '$message', '$backtrace', '$>', '$length', '$!', '$append_backtrace', '$join', '$raise', '$<<', '$each', '$is_a?', '$type', '$define_method', '$render', '$instance_eval', '$to_proc', '$empty?', '$method_missing', '$haml_class_name', '$new', '$props_wrapper', '$validator', '$validate', '$+', '$name', '$count', '$default_props', '$build', '$first', '$delete', '$merge!', '$optional', '$requires', '$allow_undefined_props=', '$undefined_props', '$props', '$arity', '$last', '$pop', '$state', '$[]=', '$__send__', '$mutate', '$singleton_class', '$native_mixins', '$static_call_backs', '$split', '$Native', '$to_n', '$add_item_to_tree', '$create_native_react_class', '$reverse', '$import_native_component', '$eval_native_react_component', '$!=', '$class', '$inject']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $ClassMethods, self = $ClassMethods = $module($base, 'ClassMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_6, TMP_7, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17, TMP_20, TMP_21, TMP_24, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32, TMP_34, TMP_36; Opal.defn(self, '$deprecation_warning', TMP_1 = function $$deprecation_warning(message) { var self = this; return (($scope.get('React')).$$scope.get('Component')).$deprecation_warning(self, message); }, TMP_1.$$arity = 1); Opal.defn(self, '$reactrb_component?', TMP_2 = function() { var self = this; return true; }, TMP_2.$$arity = 0); Opal.defn(self, '$backtrace', TMP_3 = function $$backtrace($a_rest) { var $b, self = this, args; if (self.dont_catch_exceptions == null) self.dont_catch_exceptions = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } self.dont_catch_exceptions = (args['$[]'](0)['$==']("none")); return self.backtrace_off = ((($b = self.dont_catch_exceptions) !== false && $b !== nil && $b != null) ? $b : (args['$[]'](0)['$==']("off"))); }, TMP_3.$$arity = -1); Opal.defn(self, '$process_exception', TMP_4 = function $$process_exception(e, component, reraise) { var $a, $b, $c, self = this, message = nil; if (self.dont_catch_exceptions == null) self.dont_catch_exceptions = nil; if (self.backtrace_off == null) self.backtrace_off = nil; if (reraise == null) { reraise = self.dont_catch_exceptions; } if ((($a = self.dont_catch_exceptions) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { message = ["Exception raised while rendering " + (component) + ": " + (e.$message())]; if ((($a = ($b = ($c = e.$backtrace(), $c !== false && $c !== nil && $c != null ?$rb_gt(e.$backtrace().$length(), 1) : $c), $b !== false && $b !== nil && $b != null ?self.backtrace_off['$!']() : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$append_backtrace(message, e.$backtrace())}; console.error(message.$join("\n")); }; if (reraise !== false && reraise !== nil && reraise != null) { return self.$raise(e) } else { return nil }; }, TMP_4.$$arity = -3); Opal.defn(self, '$append_backtrace', TMP_6 = function $$append_backtrace(message_array, backtrace) { var $a, $b, TMP_5, self = this; message_array['$<<'](" " + (backtrace['$[]'](0))); return ($a = ($b = backtrace['$[]']($range(1, -1, false))).$each, $a.$$p = (TMP_5 = function(line){var self = TMP_5.$$s || this; if (line == null) line = nil; return message_array['$<<'](line)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($b); }, TMP_6.$$arity = 2); Opal.defn(self, '$render', TMP_7 = function $$render(container, params) { var $a, $b, TMP_8, $c, TMP_10, self = this, $iter = TMP_7.$$p, block = $iter || nil; if (container == null) { container = nil; } if (params == null) { params = $hash2([], {}); } TMP_7.$$p = null; if (container !== false && container !== nil && container != null) { if ((($a = container['$is_a?']((($scope.get('React')).$$scope.get('Element')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { container = container.$type()}; return ($a = ($b = self).$define_method, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, $c, $d, TMP_9; return ($c = ($d = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $c.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this, $e, $f; if (block !== false && block !== nil && block != null) { return ($e = ($f = self).$instance_eval, $e.$$p = block.$to_proc(), $e).call($f) } else { return nil }}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $c).call($d, container, params)}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $a).call($b, "render"); } else { return ($a = ($c = self).$define_method, $a.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this, $d, $e; return ($d = ($e = self).$instance_eval, $d.$$p = block.$to_proc(), $d).call($e)}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $a).call($c, "render") }; }, TMP_7.$$arity = -1); Opal.defn(self, '$method_missing', TMP_11 = function $$method_missing(name, $a_rest) { var $b, $c, $d, self = this, args, $iter = TMP_11.$$p, children = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_11.$$p = null; if ((($b = args['$empty?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { ($b = ($c = $scope.get('Object')).$method_missing, $b.$$p = children.$to_proc(), $b).apply($c, [name].concat(Opal.to_a(args))) }; return ($b = ($d = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $b.$$p = children.$to_proc(), $b).call($d, self, $hash2(["class"], {"class": (($scope.get('React')).$$scope.get('Element')).$haml_class_name(name)})); }, TMP_11.$$arity = -2); Opal.defn(self, '$validator', TMP_12 = function $$validator() { var $a, self = this; if (self.validator == null) self.validator = nil; return ((($a = self.validator) !== false && $a !== nil && $a != null) ? $a : self.validator = $scope.get('Validator').$new(self.$props_wrapper())); }, TMP_12.$$arity = 0); Opal.defn(self, '$prop_types', TMP_13 = function $$prop_types() { var $a, self = this; if ((($a = self.$validator()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $hash2(["_componentValidator"], {"_componentValidator": function(props, propName, componentName) { var errors = self.$validator().$validate($scope.get('Hash').$new(props)); var error = new Error($rb_plus("In component `" + (self.$name()) + "`\n", (errors).$join("\n"))); return (function() {if ((($a = $rb_gt((errors).$count(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return error; } else { return undefined; }; return nil; })(); } }) } else { return $hash2([], {}) }; }, TMP_13.$$arity = 0); Opal.defn(self, '$default_props', TMP_14 = function $$default_props() { var self = this; return self.$validator().$default_props(); }, TMP_14.$$arity = 0); Opal.defn(self, '$params', TMP_15 = function $$params() { var $a, $b, self = this, $iter = TMP_15.$$p, block = $iter || nil; TMP_15.$$p = null; return ($a = ($b = self.$validator()).$build, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_15.$$arity = 0); Opal.defn(self, '$props_wrapper', TMP_16 = function $$props_wrapper() { var $a, self = this; if (self.props_wrapper == null) self.props_wrapper = nil; return ((($a = self.props_wrapper) !== false && $a !== nil && $a != null) ? $a : self.props_wrapper = $scope.get('Class').$new($scope.get('PropsWrapper'))); }, TMP_16.$$arity = 0); Opal.defn(self, '$param', TMP_17 = function $$param($a_rest) { var $b, self = this, args, options = nil, name = nil, default$ = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = args['$[]'](0)['$is_a?']($scope.get('Hash'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { options = args['$[]'](0); name = options.$first()['$[]'](0); default$ = options.$first()['$[]'](1); options.$delete(name); options['$merge!']($hash2(["default"], {"default": default$})); } else { name = args['$[]'](0); options = ((($b = args['$[]'](1)) !== false && $b !== nil && $b != null) ? $b : $hash2([], {})); }; if ((($b = options['$[]']("default")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$validator().$optional(name, options) } else { return self.$validator().$requires(name, options) }; }, TMP_17.$$arity = -1); Opal.defn(self, '$collect_other_params_as', TMP_20 = function $$collect_other_params_as(name) { var $a, $b, TMP_18, $c, TMP_19, self = this, validator_in_lexical_scope = nil, validator_in_lexial_scope = nil; (($a = [true]), $b = self.$validator(), $b['$allow_undefined_props='].apply($b, $a), $a[$a.length-1]); validator_in_lexical_scope = self.$validator(); ($a = ($b = self.$props_wrapper()).$define_method, $a.$$p = (TMP_18 = function(){var self = TMP_18.$$s || this, $c; if (self._all_others == null) self._all_others = nil; return ((($c = self._all_others) !== false && $c !== nil && $c != null) ? $c : self._all_others = validator_in_lexical_scope.$undefined_props(self.$props()))}, TMP_18.$$s = self, TMP_18.$$arity = 0, TMP_18), $a).call($b, name); validator_in_lexial_scope = self.$validator(); return ($a = ($c = self.$props_wrapper()).$define_method, $a.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this, $d; if (self._all_others == null) self._all_others = nil; return ((($d = self._all_others) !== false && $d !== nil && $d != null) ? $d : self._all_others = validator_in_lexial_scope.$undefined_props(self.$props()))}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $a).call($c, name); }, TMP_20.$$arity = 1); Opal.defn(self, '$define_state', TMP_21 = function $$define_state($a_rest) { var $b, $c, TMP_22, $d, TMP_23, self = this, states, $iter = TMP_21.$$p, block = $iter || nil, default_initial_value = nil, states_hash = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } states = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { states[$arg_idx - 0] = arguments[$arg_idx]; } TMP_21.$$p = null; self.$deprecation_warning("'define_state' is deprecated. Use the 'state' macro to declare states."); default_initial_value = (function() {if ((($b = ((($c = block !== false && block !== nil && block != null) ? block.$arity()['$=='](0) : block))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return Opal.yieldX(block, []); } else { return nil }; return nil; })(); states_hash = (function() {if ((($b = (states.$last()['$is_a?']($scope.get('Hash')))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return states.$pop() } else { return $hash2([], {}) }; return nil; })(); ($b = ($c = states).$each, $b.$$p = (TMP_22 = function(name){var self = TMP_22.$$s || this; if (name == null) name = nil; return self.$state($hash(name, default_initial_value))}, TMP_22.$$s = self, TMP_22.$$arity = 1, TMP_22), $b).call($c); return ($b = ($d = states_hash).$each, $b.$$p = (TMP_23 = function(name, value){var self = TMP_23.$$s || this; if (name == null) name = nil;if (value == null) value = nil; return self.$state($hash(name, value))}, TMP_23.$$s = self, TMP_23.$$arity = 2, TMP_23), $b).call($d); }, TMP_21.$$arity = -1); Opal.defn(self, '$export_state', TMP_24 = function $$export_state($a_rest) { var $b, $c, TMP_25, $d, TMP_26, self = this, states, $iter = TMP_24.$$p, block = $iter || nil, default_initial_value = nil, states_hash = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } states = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { states[$arg_idx - 0] = arguments[$arg_idx]; } TMP_24.$$p = null; self.$deprecation_warning("'export_state' is deprecated. Use the 'state' macro to declare states."); default_initial_value = (function() {if ((($b = ((($c = block !== false && block !== nil && block != null) ? block.$arity()['$=='](0) : block))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return Opal.yieldX(block, []); } else { return nil }; return nil; })(); states_hash = (function() {if ((($b = (states.$last()['$is_a?']($scope.get('Hash')))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return states.$pop() } else { return $hash2([], {}) }; return nil; })(); ($b = ($c = states).$each, $b.$$p = (TMP_25 = function(name){var self = TMP_25.$$s || this; if (name == null) name = nil; return states_hash['$[]='](name, default_initial_value)}, TMP_25.$$s = self, TMP_25.$$arity = 1, TMP_25), $b).call($c); return ($b = ($d = states_hash).$each, $b.$$p = (TMP_26 = function(name, value){var self = TMP_26.$$s || this, $a, $e, TMP_27; if (name == null) name = nil;if (value == null) value = nil; self.$state($hash(name, value, "scope", "class", "reader", true)); return ($a = ($e = self.$singleton_class()).$define_method, $a.$$p = (TMP_27 = function($f_rest){var self = TMP_27.$$s || this, args, $g; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($g = self.$mutate()).$__send__.apply($g, [name].concat(Opal.to_a(args)))}, TMP_27.$$s = self, TMP_27.$$arity = -1, TMP_27), $a).call($e, "" + (name) + "!");}, TMP_26.$$s = self, TMP_26.$$arity = 2, TMP_26), $b).call($d); }, TMP_24.$$arity = -1); Opal.defn(self, '$native_mixin', TMP_28 = function $$native_mixin(item) { var self = this; return self.$native_mixins()['$<<'](item); }, TMP_28.$$arity = 1); Opal.defn(self, '$native_mixins', TMP_29 = function $$native_mixins() { var $a, self = this; if (self.native_mixins == null) self.native_mixins = nil; return ((($a = self.native_mixins) !== false && $a !== nil && $a != null) ? $a : self.native_mixins = []); }, TMP_29.$$arity = 0); Opal.defn(self, '$static_call_back', TMP_30 = function $$static_call_back(name) { var self = this, $iter = TMP_30.$$p, block = $iter || nil; TMP_30.$$p = null; return self.$static_call_backs()['$[]='](name, block); }, TMP_30.$$arity = 1); Opal.defn(self, '$static_call_backs', TMP_31 = function $$static_call_backs() { var $a, self = this; if (self.static_call_backs == null) self.static_call_backs = nil; return ((($a = self.static_call_backs) !== false && $a !== nil && $a != null) ? $a : self.static_call_backs = $hash2([], {})); }, TMP_31.$$arity = 0); Opal.defn(self, '$export_component', TMP_32 = function $$export_component(opts) { var $a, self = this, export_name = nil, first_name = nil; if (opts == null) { opts = $hash2([], {}); } export_name = (((($a = opts['$[]']("as")) !== false && $a !== nil && $a != null) ? $a : self.$name())).$split("::"); first_name = export_name.$first(); return self.$Native(Opal.global)['$[]='](first_name, self.$add_item_to_tree(self.$Native(Opal.global)['$[]'](first_name), $rb_plus([(($scope.get('React')).$$scope.get('API')).$create_native_react_class(self)], export_name['$[]']($range(1, -1, false)).$reverse())).$to_n()); }, TMP_32.$$arity = -1); Opal.defn(self, '$imports', TMP_34 = function $$imports(component_name) { var $a, $b, TMP_33, self = this, e = nil; try { try { (($scope.get('React')).$$scope.get('API')).$import_native_component(self, (($scope.get('React')).$$scope.get('API')).$eval_native_react_component(component_name)); return ($a = ($b = self).$define_method, $a.$$p = (TMP_33 = function(){var self = TMP_33.$$s || this; return nil}, TMP_33.$$s = self, TMP_33.$$arity = 0, TMP_33), $a).call($b, "render"); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$raise("" + (self) + " cannot import '" + (component_name) + "': " + (e.$message()) + ".") } finally { Opal.pop_exception() } } else { throw $err; } } } finally { self }; }, TMP_34.$$arity = 1); Opal.defn(self, '$add_item_to_tree', TMP_36 = function $$add_item_to_tree(current_tree, new_item) { var $a, $b, TMP_35, self = this; if ((($a = ((($b = self.$Native(current_tree).$class()['$!=']((($scope.get('Native')).$$scope.get('Object')))) !== false && $b !== nil && $b != null) ? $b : new_item.$length()['$=='](1))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = new_item).$inject, $a.$$p = (TMP_35 = function(a, e){var self = TMP_35.$$s || this; if (a == null) a = nil;if (e == null) e = nil; return $hash(e, a)}, TMP_35.$$s = self, TMP_35.$$arity = 2, TMP_35), $a).call($b) } else { self.$Native(current_tree)['$[]='](new_item.$last(), self.$add_item_to_tree(self.$Native(current_tree)['$[]'](new_item.$last()), new_item['$[]']($range(0, -2, false)))); return current_tree; }; }, TMP_36.$$arity = 2); })($scope.base) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/props_wrapper"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$attr_reader', '$==', '$define_method', '$value_for', '$>', '$count', '$call', '$[]', '$props', '$to_proc', '$fetch_from_cache', '$respond_to?', '$_react_param_conversion', '$is_a?', '$collect', '$private', '$cache', '$equal?', '$tap', '$[]=', '$new', '$component', '$instance_variable_get']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $PropsWrapper(){}; var self = $PropsWrapper = $klass($base, $super, 'PropsWrapper', $PropsWrapper); var def = self.$$proto, $scope = self.$$scope, TMP_7, TMP_8, TMP_9, TMP_11, TMP_13, TMP_14, TMP_15; def.cache = nil; self.$attr_reader("component"); Opal.defs(self, '$define_param', TMP_7 = function $$define_param(name, param_type) { var $a, $b, TMP_1, $c, TMP_2, $d, TMP_3, $e, TMP_4, self = this; if (param_type['$==']($scope.get('Observable'))) { ($a = ($b = self).$define_method, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; return self.$value_for(name)}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b, "" + (name)); return ($a = ($c = self).$define_method, $a.$$p = (TMP_2 = function($d_rest){var self = TMP_2.$$s || this, args, $e, current_value = nil; if (self.dont_update_state == null) self.dont_update_state = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } current_value = self.$value_for(name); if ((($e = $rb_gt(args.$count(), 0)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$props()['$[]'](name).$call(args['$[]'](0)); return current_value; } else { try {(function() {if ((($e = self.dont_update_state) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { return nil } else { return self.$props()['$[]'](name).$call(current_value) }; return nil; })() } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { nil } else { throw $err; } }; return self.$props()['$[]'](name); };}, TMP_2.$$s = self, TMP_2.$$arity = -1, TMP_2), $a).call($c, "" + (name) + "!"); } else if (param_type['$==']($scope.get('Proc'))) { return ($a = ($d = self).$define_method, $a.$$p = (TMP_3 = function($e_rest){var self = TMP_3.$$s || this, block, args, $f, $g; block = TMP_3.$$p || nil, TMP_3.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($f = self.$props()['$[]'](name)) !== nil && $f != null && (!$f.$$is_boolean || $f == true))) { return ($f = ($g = self.$props()['$[]'](name)).$call, $f.$$p = block.$to_proc(), $f).apply($g, Opal.to_a(args)) } else { return nil }}, TMP_3.$$s = self, TMP_3.$$arity = -1, TMP_3), $a).call($d, "" + (name)) } else { return ($a = ($e = self).$define_method, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this, $f, $g, TMP_5; return ($f = ($g = self).$fetch_from_cache, $f.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, $h, $i, TMP_6; if ((($h = param_type['$respond_to?']("_react_param_conversion")) !== nil && $h != null && (!$h.$$is_boolean || $h == true))) { return param_type.$_react_param_conversion(self.$props()['$[]'](name), nil) } else if ((($h = ($i = param_type['$is_a?']($scope.get('Array')), $i !== false && $i !== nil && $i != null ?param_type['$[]'](0)['$respond_to?']("_react_param_conversion") : $i)) !== nil && $h != null && (!$h.$$is_boolean || $h == true))) { return ($h = ($i = self.$props()['$[]'](name)).$collect, $h.$$p = (TMP_6 = function(param){var self = TMP_6.$$s || this; if (param == null) param = nil; return param_type['$[]'](0).$_react_param_conversion(param, nil)}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $h).call($i) } else { return self.$props()['$[]'](name) }}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $f).call($g, name)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($e, "" + (name)) }; }, TMP_7.$$arity = 2); Opal.defn(self, '$initialize', TMP_8 = function $$initialize(component) { var self = this; return self.component = component; }, TMP_8.$$arity = 1); Opal.defn(self, '$[]', TMP_9 = function(prop) { var self = this; return self.$props()['$[]'](prop); }, TMP_9.$$arity = 1); self.$private(); Opal.defn(self, '$fetch_from_cache', TMP_11 = function $$fetch_from_cache(name) { var $a, $b, TMP_10, self = this, $iter = TMP_11.$$p, $yield = $iter || nil, last = nil, value = nil; TMP_11.$$p = null; $b = self.$cache()['$[]'](name), $a = Opal.to_ary($b), last = ($a[0] == null ? nil : $a[0]), value = ($a[1] == null ? nil : $a[1]), $b; if ((($a = last['$equal?'](self.$props()['$[]'](name))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return value}; return ($a = ($b = Opal.yieldX($yield, [])).$tap, $a.$$p = (TMP_10 = function(value){var self = TMP_10.$$s || this; if (value == null) value = nil; return self.$cache()['$[]='](name, [self.$props()['$[]'](name), value])}, TMP_10.$$s = self, TMP_10.$$arity = 1, TMP_10), $a).call($b); }, TMP_11.$$arity = 1); Opal.defn(self, '$cache', TMP_13 = function $$cache() { var $a, $b, $c, TMP_12, self = this; return ((($a = self.cache) !== false && $a !== nil && $a != null) ? $a : self.cache = ($b = ($c = $scope.get('Hash')).$new, $b.$$p = (TMP_12 = function(h, k){var self = TMP_12.$$s || this; if (h == null) h = nil;if (k == null) k = nil; return h['$[]='](k, [])}, TMP_12.$$s = self, TMP_12.$$arity = 2, TMP_12), $b).call($c)); }, TMP_13.$$arity = 0); Opal.defn(self, '$props', TMP_14 = function $$props() { var self = this; return self.$component().$props(); }, TMP_14.$$arity = 0); return (Opal.defn(self, '$value_for', TMP_15 = function $$value_for(name) { var $a, self = this; if ((($a = self['$[]'](name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self['$[]'](name).$instance_variable_get("@value") } else { return nil }; }, TMP_15.$$arity = 1), nil) && 'value_for'; })($scope.base, null) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash = Opal.hash; Opal.add_stubs(['$require', '$include', '$class_eval', '$class_attribute', '$define_callback', '$extend', '$deprecation_warning', '$name', '$class', '$init_store', '$call', '$[]', '$params', '$event_camelize', '$to_s', '$on_opal_client?', '$load_context', '$set_state_context_to', '$run_callback', '$process_exception', '$update_states_to_observe', '$new', '$remove', '$attr_reader', '$==', '$set_state', '$to_f', '$now', '$method_defined?', '$raise', '$render', '$respond_to?', '$waiting_on_resources', '$initialize_states', '$define_state', '$to_proc', '$include?', '$<<', '$log']); self.$require("react/ext/string"); self.$require("react/ext/hash"); self.$require("active_support/core_ext/class/attribute"); self.$require("react/callbacks"); self.$require("react/rendering_context"); self.$require("hyper-store"); self.$require("react/state_wrapper"); self.$require("react/component/api"); self.$require("react/component/class_methods"); self.$require("react/component/props_wrapper"); self.$require("native"); (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Component(){}; var self = $Component = $klass($base, $super, 'Component', $Component); var def = self.$$proto, $scope = self.$$scope; return (function($base) { var $Mixin, self = $Mixin = $module($base, 'Mixin'); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_8, TMP_10, TMP_12, TMP_14, TMP_16, TMP_18, TMP_19, $a, TMP_20, TMP_23, TMP_24, TMP_25; Opal.defs(self, '$included', TMP_2 = function $$included(base) { var $a, $b, TMP_1, self = this; base.$include((($scope.get('Store')).$$scope.get('Mixin'))); base.$include((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('API'))); base.$include((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('Callbacks'))); base.$include((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('Tags'))); base.$include((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('DslInstanceMethods'))); base.$include((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('ShouldComponentUpdate'))); ($a = ($b = base).$class_eval, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this; self.$class_attribute("initial_state"); self.$define_callback("before_mount"); self.$define_callback("after_mount"); self.$define_callback("before_receive_props"); self.$define_callback("before_update"); self.$define_callback("after_update"); return self.$define_callback("before_unmount");}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b); return base.$extend((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('ClassMethods'))); }, TMP_2.$$arity = 1); Opal.defs(self, '$deprecation_warning', TMP_3 = function $$deprecation_warning(message) { var self = this; return (($scope.get('React')).$$scope.get('Component')).$deprecation_warning(self.$name(), message); }, TMP_3.$$arity = 1); Opal.defn(self, '$deprecation_warning', TMP_4 = function $$deprecation_warning(message) { var self = this; return (($scope.get('React')).$$scope.get('Component')).$deprecation_warning(self.$class().$name(), message); }, TMP_4.$$arity = 1); Opal.defn(self, '$initialize', TMP_5 = function $$initialize(native_element) { var self = this; self["native"] = native_element; return self.$init_store(); }, TMP_5.$$arity = 1); Opal.defn(self, '$emit', TMP_6 = function $$emit(event_name, $a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } return ($b = self.$params()['$[]']("_on" + (event_name.$to_s().$event_camelize()))).$call.apply($b, Opal.to_a(args)); }, TMP_6.$$arity = -2); Opal.defn(self, '$component_will_mount', TMP_8 = function $$component_will_mount() { var $a, $b, TMP_7, self = this, e = nil; try { if ((($a = (($scope.get('React')).$$scope.get('IsomorphicHelpers'))['$on_opal_client?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { (($scope.get('React')).$$scope.get('IsomorphicHelpers')).$load_context(true)}; return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return self.$run_callback("before_mount")}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $a).call($b, self); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_8.$$arity = 0); Opal.defn(self, '$component_did_mount', TMP_10 = function $$component_did_mount() { var $a, $b, TMP_9, self = this, e = nil; try { return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; self.$run_callback("after_mount"); return (($scope.get('React')).$$scope.get('State')).$update_states_to_observe();}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $a).call($b, self) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_10.$$arity = 0); Opal.defn(self, '$component_will_receive_props', TMP_12 = function $$component_will_receive_props(next_props) { var $a, $b, TMP_11, self = this, e = nil; try { return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this; return self.$run_callback("before_receive_props", $scope.get('Hash').$new(next_props))}, TMP_11.$$s = self, TMP_11.$$arity = 0, TMP_11), $a).call($b, self) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_12.$$arity = 1); Opal.defn(self, '$component_will_update', TMP_14 = function $$component_will_update(next_props, next_state) { var $a, $b, TMP_13, self = this, e = nil; try { return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_13 = function(){var self = TMP_13.$$s || this; return self.$run_callback("before_update", $scope.get('Hash').$new(next_props), $scope.get('Hash').$new(next_state))}, TMP_13.$$s = self, TMP_13.$$arity = 0, TMP_13), $a).call($b, self) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_14.$$arity = 2); Opal.defn(self, '$component_did_update', TMP_16 = function $$component_did_update(prev_props, prev_state) { var $a, $b, TMP_15, self = this, e = nil; try { return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_15 = function(){var self = TMP_15.$$s || this; self.$run_callback("after_update", $scope.get('Hash').$new(prev_props), $scope.get('Hash').$new(prev_state)); return (($scope.get('React')).$$scope.get('State')).$update_states_to_observe();}, TMP_15.$$s = self, TMP_15.$$arity = 0, TMP_15), $a).call($b, self) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_16.$$arity = 2); Opal.defn(self, '$component_will_unmount', TMP_18 = function $$component_will_unmount() { var $a, $b, TMP_17, self = this, e = nil; try { return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_17 = function(){var self = TMP_17.$$s || this; self.$run_callback("before_unmount"); return (($scope.get('React')).$$scope.get('State')).$remove();}, TMP_17.$$s = self, TMP_17.$$arity = 0, TMP_17), $a).call($b, self) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_18.$$arity = 0); self.$attr_reader("waiting_on_resources"); Opal.defn(self, '$update_react_js_state', TMP_19 = function $$update_react_js_state(object, name, value) { var self = this; if (object !== false && object !== nil && object != null) { if (object['$=='](self)) { } else { name = "" + (object.$class()) + "." + (name) }; return self.$set_state($hash("***_state_updated_at-***", $scope.get('Time').$now().$to_f(), name, value)); } else { return self.$set_state($hash(name, value)) }; }, TMP_19.$$arity = 3); if ((($a = self['$method_defined?']("render")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Opal.defn(self, '$render', TMP_20 = function $$render() { var self = this; return self.$raise("no render defined"); }, TMP_20.$$arity = 0) }; Opal.defn(self, '$_render_wrapper', TMP_23 = function $$_render_wrapper() { var $a, $b, TMP_21, self = this, e = nil; try { return ($a = ($b = (($scope.get('React')).$$scope.get('State'))).$set_state_context_to, $a.$$p = (TMP_21 = function(){var self = TMP_21.$$s || this, $c, $d, TMP_22, element = nil; element = ($c = ($d = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $c.$$p = (TMP_22 = function(){var self = TMP_22.$$s || this, $e; return ((($e = self.$render()) !== false && $e !== nil && $e != null) ? $e : "")}, TMP_22.$$s = self, TMP_22.$$arity = 0, TMP_22), $c).call($d, nil); if ((($c = element['$respond_to?']("waiting_on_resources")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.waiting_on_resources = element.$waiting_on_resources()}; return element;}, TMP_21.$$s = self, TMP_21.$$arity = 0, TMP_21), $a).call($b, self, true) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return self.$class().$process_exception(e, self) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_23.$$arity = 0); Opal.defn(self, '$watch', TMP_24 = function $$watch(value) { var self = this, $iter = TMP_24.$$p, on_change = $iter || nil; TMP_24.$$p = null; return $scope.get('Observable').$new(value, on_change); }, TMP_24.$$arity = 1); Opal.defn(self, '$define_state', TMP_25 = function $$define_state($a_rest) { var $b, $c, self = this, args, $iter = TMP_25.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_25.$$p = null; return (($scope.get('React')).$$scope.get('State')).$initialize_states(self, ($b = ($c = self.$class()).$define_state, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args))); }, TMP_25.$$arity = -1); })($scope.base) })($scope.base, null) })($scope.base); (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope, TMP_26, TMP_27; Opal.defs(self, '$included', TMP_26 = function $$included(base) { var self = this; self.$deprecation_warning(base, "The module name React::Component has been deprecated. Use Hyperloop::Component::Mixin instead."); return base.$include((((($scope.get('Hyperloop')).$$scope.get('Component'))).$$scope.get('Mixin'))); }, TMP_26.$$arity = 1); Opal.defs(self, '$deprecation_warning', TMP_27 = function $$deprecation_warning(name, message) { var $a, self = this; if (self.deprecation_messages == null) self.deprecation_messages = nil; ((($a = self.deprecation_messages) !== false && $a !== nil && $a != null) ? $a : self.deprecation_messages = []); message = "Warning: Deprecated feature used in " + (name) + ". " + (message); if ((($a = self.deprecation_messages['$include?'](message)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { self.deprecation_messages['$<<'](message); return (($scope.get('React')).$$scope.get('IsomorphicHelpers')).$log(message, "warning"); }; }, TMP_27.$$arity = 2); })($scope.base); (function($base) { var $ComponentNoNotice, self = $ComponentNoNotice = $module($base, 'ComponentNoNotice'); var def = self.$$proto, $scope = self.$$scope, TMP_28; Opal.defs(self, '$included', TMP_28 = function $$included(base) { var self = this; return base.$include((((($scope.get('Hyperloop')).$$scope.get('Component'))).$$scope.get('Mixin'))); }, TMP_28.$$arity = 1) })($scope.base); })($scope.base); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; nil })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/children"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$to_enum', '$length', '$>', '$new', '$call', '$<<', '$alias_method']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Children(){}; var self = $Children = $klass($base, $super, 'Children', $Children); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4; def.children = def.length = nil; self.$include($scope.get('Enumerable')); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(children) { var self = this; return self.children = children; }, TMP_1.$$arity = 1); Opal.defn(self, '$each', TMP_2 = function $$each() { var $a, $b, TMP_3, self = this, $iter = TMP_2.$$p, block = $iter || nil, collection = nil, element = nil; TMP_2.$$p = null; if ((block !== nil)) { } else { return ($a = ($b = self).$to_enum, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return self.$length()}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($b, "each") }; if ((($a = $rb_gt(self.$length(), 0)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return [] }; collection = []; React.Children.forEach(self.children, function(context){ element = (($scope.get('React')).$$scope.get('Element')).$new(context) block.$call(element) collection['$<<'](element) }) ; return collection; }, TMP_2.$$arity = 0); Opal.defn(self, '$length', TMP_4 = function $$length() { var $a, self = this; return ((($a = self.length) !== false && $a !== nil && $a != null) ? $a : self.length = React.Children.count(self.children)); }, TMP_4.$$arity = 0); return self.$alias_method("size", "length"); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/dsl_instance_methods"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$require', '$new', '$props_wrapper', '$class']); self.$require("react/children"); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $DslInstanceMethods, self = $DslInstanceMethods = $module($base, 'DslInstanceMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; Opal.defn(self, '$children', TMP_1 = function $$children() { var self = this; if (self["native"] == null) self["native"] = nil; return $scope.get('Children').$new(self["native"].props.children); }, TMP_1.$$arity = 0); Opal.defn(self, '$params', TMP_2 = function $$params() { var $a, self = this; if (self.params == null) self.params = nil; return ((($a = self.params) !== false && $a !== nil && $a != null) ? $a : self.params = self.$class().$props_wrapper().$new(self)); }, TMP_2.$$arity = 0); Opal.defn(self, '$props', TMP_3 = function $$props() { var self = this; if (self["native"] == null) self["native"] = nil; return $scope.get('Hash').$new(self["native"].props); }, TMP_3.$$arity = 0); Opal.defn(self, '$refs', TMP_4 = function $$refs() { var self = this; if (self["native"] == null) self["native"] = nil; return $scope.get('Hash').$new(self["native"].refs); }, TMP_4.$$arity = 0); })($scope.base) })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/component/should_component_update"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$set_state_context_to', '$new', '$respond_to?', '$!', '$call_needs_update', '$props_changed?', '$native_state_changed?', '$define_singleton_method', '$needs_update?', '$!=', '$sort', '$keys', '$props', '$detect']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $ShouldComponentUpdate, self = $ShouldComponentUpdate = $module($base, 'ShouldComponentUpdate'); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_5, TMP_6, TMP_8; Opal.defn(self, '$should_component_update?', TMP_2 = function(native_next_props, native_next_state) { var $a, $b, TMP_1, self = this; return ($a = ($b = $scope.get('State')).$set_state_context_to, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, $c, next_params = nil; next_params = $scope.get('Hash').$new(native_next_props); if ((($c = self['$respond_to?']("needs_update?")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$call_needs_update(next_params, native_next_state)['$!']()['$!']() } else { return (((($c = self['$props_changed?'](next_params)) !== false && $c !== nil && $c != null) ? $c : self['$native_state_changed?'](native_next_state)))['$!']()['$!']() };}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b, self, false); }, TMP_2.$$arity = 2); Opal.defn(self, '$call_needs_update', TMP_5 = function $$call_needs_update(next_params, native_next_state) { var $a, $b, TMP_3, $c, TMP_4, self = this, component = nil, next_state = nil; component = self; ($a = ($b = next_params).$define_singleton_method, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this; return component['$props_changed?'](self)}, TMP_3.$$s = self, TMP_3.$$arity = 0, TMP_3), $a).call($b, "changed?"); next_state = $scope.get('Hash').$new(native_next_state); ($a = ($c = next_state).$define_singleton_method, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return component['$native_state_changed?'](native_next_state)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($c, "changed?"); return self['$needs_update?'](next_params, next_state); }, TMP_5.$$arity = 2); Opal.defn(self, '$native_state_changed?', TMP_6 = function(next_state) { var self = this; if (self["native"] == null) self["native"] = nil; var current_state = self["native"].state var normalized_next_state = !next_state || Object.keys(next_state).length === 0 || nil == next_state ? false : next_state var normalized_current_state = !current_state || Object.keys(current_state).length === 0 || nil == current_state ? false : current_state if (!normalized_current_state != !normalized_next_state) return(true) if (!normalized_current_state && !normalized_next_state) return(false) if (!normalized_current_state['***_state_updated_at-***'] || !normalized_next_state['***_state_updated_at-***']) return(true) return (normalized_current_state['***_state_updated_at-***'] != normalized_next_state['***_state_updated_at-***']) ; }, TMP_6.$$arity = 1); Opal.defn(self, '$props_changed?', TMP_8 = function(next_params) { var $a, $b, $c, TMP_7, self = this; return ((($a = (self.$props().$keys().$sort()['$!='](next_params.$keys().$sort()))) !== false && $a !== nil && $a != null) ? $a : ($b = ($c = next_params).$detect, $b.$$p = (TMP_7 = function(k, v){var self = TMP_7.$$s || this; if (self["native"] == null) self["native"] = nil; if (k == null) k = nil;if (v == null) v = nil; return v != self["native"].props[k];}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7), $b).call($c)); }, TMP_8.$$arity = 1); })($scope.base) })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/element"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $hash = Opal.hash; Opal.add_stubs(['$require', '$include', '$alias_native', '$attr_reader', '$attr_accessor', '$each', '$merge_event_prop!', '$to_proc', '$to_n', '$shallow_to_n', '$properties', '$empty?', '$render', '$convert_props', '$new', '$type', '$merge', '$block', '$delete', '$as_node', '$rendered?', '$method_missing', '$dup', '$replace', '$build', '$build_new_properties', '$gsub', '$private', '$haml_class_name', '$class', '$[]=', '$join', '$uniq', '$split', '$[]', '$merge!', '$=~', '$merge_component_event_prop!', '$include?', '$event_camelize', '$merge_built_in_event_prop!', '$instance_variable_get', '$merge_deprecated_component_event_prop!', '$Array', '$deprecation_warning']); self.$require("react/ext/string"); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Element(){}; var self = $Element = $klass($base, $super, 'Element', $Element); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_4, TMP_5, TMP_6, TMP_7, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15; def.type = def.properties = nil; self.$include($scope.get('Native')); self.$alias_native("element_type", "type"); self.$alias_native("props", "props"); self.$attr_reader("type"); self.$attr_reader("properties"); self.$attr_reader("block"); self.$attr_accessor("waiting_on_resources"); Opal.defn(self, '$initialize', TMP_1 = function $$initialize(native_element, type, properties, block) { var $a, $b, self = this; if (type == null) { type = nil; } if (properties == null) { properties = $hash2([], {}); } if (block == null) { block = nil; } self.type = type; self.properties = ((($a = ((function() {if ((($b = typeof properties === 'undefined') !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return nil } else { return properties }; return nil; })())) !== false && $a !== nil && $a != null) ? $a : $hash2([], {})); self.block = block; return self["native"] = native_element; }, TMP_1.$$arity = -2); Opal.defn(self, '$on', TMP_2 = function $$on($a_rest) { var $b, $c, TMP_3, self = this, event_names, $iter = TMP_2.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } event_names = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { event_names[$arg_idx - 0] = arguments[$arg_idx]; } TMP_2.$$p = null; ($b = ($c = event_names).$each, $b.$$p = (TMP_3 = function(event_name){var self = TMP_3.$$s || this, $a, $d; if (event_name == null) event_name = nil; return ($a = ($d = self)['$merge_event_prop!'], $a.$$p = block.$to_proc(), $a).call($d, event_name)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $b).call($c); self["native"] = React.cloneElement(self.$to_n(), self.$properties().$shallow_to_n()); return self; }, TMP_2.$$arity = -1); Opal.defn(self, '$render', TMP_4 = function $$render(props) { var $a, self = this, $iter = TMP_4.$$p, new_block = $iter || nil; if (props == null) { props = $hash2([], {}); } TMP_4.$$p = null; if ((($a = props['$empty?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('React')).$$scope.get('RenderingContext')).$render(self) } else { props = $scope.get('API').$convert_props(props); return (($scope.get('React')).$$scope.get('RenderingContext')).$render($scope.get('Element').$new(React.cloneElement(self.$to_n(), props.$shallow_to_n()), self.$type(), self.$properties().$merge(props), self.$block())); }; }, TMP_4.$$arity = -1); Opal.defn(self, '$delete', TMP_5 = function() { var self = this; return (($scope.get('React')).$$scope.get('RenderingContext')).$delete(self); }, TMP_5.$$arity = 0); Opal.defn(self, '$as_node', TMP_6 = function $$as_node() { var self = this; return (($scope.get('React')).$$scope.get('RenderingContext')).$as_node(self); }, TMP_6.$$arity = 0); Opal.defn(self, '$method_missing', TMP_7 = function $$method_missing(class_name, args) { var $a, $b, $c, TMP_8, self = this, $iter = TMP_7.$$p, new_block = $iter || nil; if (args == null) { args = $hash2([], {}); } TMP_7.$$p = null; if ((($a = self['$rendered?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return ($a = ($b = self.$dup().$render()).$method_missing, $a.$$p = new_block.$to_proc(), $a).call($b, class_name, args) }; return (($scope.get('React')).$$scope.get('RenderingContext')).$replace(self, ($a = ($c = $scope.get('RenderingContext')).$build, $a.$$p = (TMP_8 = function(){var self = TMP_8.$$s || this, $d, $e; return ($d = ($e = $scope.get('RenderingContext')).$render, $d.$$p = new_block.$to_proc(), $d).call($e, self.$type(), self.$build_new_properties(class_name, args))}, TMP_8.$$s = self, TMP_8.$$arity = 0, TMP_8), $a).call($c)); }, TMP_7.$$arity = -2); Opal.defn(self, '$rendered?', TMP_9 = function() { var self = this; return (($scope.get('React')).$$scope.get('RenderingContext'))['$rendered?'](self); }, TMP_9.$$arity = 0); Opal.defs(self, '$haml_class_name', TMP_10 = function $$haml_class_name(class_name) { var self = this; return class_name.$gsub(/__|_/, $hash2(["__", "_"], {"__": "_", "_": "-"})); }, TMP_10.$$arity = 1); self.$private(); Opal.defn(self, '$build_new_properties', TMP_11 = function $$build_new_properties(class_name, args) { var self = this, new_props = nil; class_name = self.$class().$haml_class_name(class_name); new_props = self.$properties().$dup(); new_props['$[]=']("className", (((((((((" ") + (class_name)) + " ") + (new_props['$[]']("className"))) + " ") + (args.$delete("class"))) + " ") + (args.$delete("className"))) + " ").$split(" ").$uniq().$join(" ")); return new_props['$merge!'](args); }, TMP_11.$$arity = 2); Opal.defn(self, '$merge_event_prop!', TMP_12 = function(event_name) { var $a, $b, $c, $d, $e, $f, self = this, $iter = TMP_12.$$p, block = $iter || nil, name = nil; TMP_12.$$p = null; if ((($a = event_name['$=~'](/^<(.+)>$/)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self)['$merge_component_event_prop!'], $a.$$p = block.$to_proc(), $a).call($b, event_name.$gsub(/^<(.+)>$/, "\\1")) } else if ((($a = (((($scope.get('React')).$$scope.get('Event'))).$$scope.get('BUILT_IN_EVENTS'))['$include?'](name = "on" + (event_name.$event_camelize()))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = self)['$merge_built_in_event_prop!'], $a.$$p = block.$to_proc(), $a).call($c, name) } else if ((($a = self.type.$instance_variable_get("@native_import")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($d = self)['$merge_component_event_prop!'], $a.$$p = block.$to_proc(), $a).call($d, name) } else { ($a = ($e = self)['$merge_deprecated_component_event_prop!'], $a.$$p = block.$to_proc(), $a).call($e, event_name); return ($a = ($f = self)['$merge_component_event_prop!'], $a.$$p = block.$to_proc(), $a).call($f, "on_" + (event_name)); }; }, TMP_12.$$arity = 1); Opal.defn(self, '$merge_built_in_event_prop!', TMP_13 = function(prop_name) { var self = this, $iter = TMP_13.$$p, $yield = $iter || nil; TMP_13.$$p = null; return self.properties['$merge!']($hash(prop_name, function(event){ return Opal.yield1($yield, (($scope.get('React')).$$scope.get('Event')).$new(event)) } )); }, TMP_13.$$arity = 1); Opal.defn(self, '$merge_component_event_prop!', TMP_14 = function(prop_name) { var self = this, $iter = TMP_14.$$p, $yield = $iter || nil; TMP_14.$$p = null; return self.properties['$merge!']($hash(prop_name, function(){ return Opal.yieldX($yield, Opal.to_a(self.$Array(arguments))) } )); }, TMP_14.$$arity = 1); return (Opal.defn(self, '$merge_deprecated_component_event_prop!', TMP_15 = function(event_name) { var self = this, $iter = TMP_15.$$p, $yield = $iter || nil, prop_name = nil, fn = nil; TMP_15.$$p = null; prop_name = "_on" + (event_name.$event_camelize()); fn = function(){(($scope.get('React')).$$scope.get('Component')).$deprecation_warning(self.$type(), "In future releases React::Element#on('" + (event_name) + "') will no longer respond " + ("to the '" + (prop_name) + "' emitter.\n") + ("Rename your emitter param to 'on_" + (event_name) + "' or use .on('<" + (prop_name) + ">')")) return Opal.yieldX($yield, Opal.to_a(self.$Array(arguments))) }; return self.properties['$merge!']($hash(prop_name, fn)); }, TMP_15.$$arity = 1), nil) && 'merge_deprecated_component_event_prop!'; })($scope.base, null) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/event"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$alias_native']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Event(){}; var self = $Event = $klass($base, $super, 'Event', $Event); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$include($scope.get('Native')); self.$alias_native("bubbles", "bubbles"); self.$alias_native("cancelable", "cancelable"); self.$alias_native("current_target", "currentTarget"); self.$alias_native("default_prevented", "defaultPrevented"); self.$alias_native("event_phase", "eventPhase"); self.$alias_native("is_trusted?", "isTrusted"); self.$alias_native("native_event", "nativeEvent"); self.$alias_native("target", "target"); self.$alias_native("timestamp", "timeStamp"); self.$alias_native("event_type", "type"); self.$alias_native("prevent_default", "preventDefault"); self.$alias_native("stop_propagation", "stopPropagation"); self.$alias_native("clipboard_data", "clipboardData"); self.$alias_native("alt_key", "altKey"); self.$alias_native("char_code", "charCode"); self.$alias_native("ctrl_key", "ctrlKey"); self.$alias_native("get_modifier_state", "getModifierState"); self.$alias_native("key", "key"); self.$alias_native("key_code", "keyCode"); self.$alias_native("locale", "locale"); self.$alias_native("location", "location"); self.$alias_native("meta_key", "metaKey"); self.$alias_native("repeat", "repeat"); self.$alias_native("shift_key", "shiftKey"); self.$alias_native("which", "which"); self.$alias_native("related_target", "relatedTarget"); self.$alias_native("alt_key", "altKey"); self.$alias_native("button", "button"); self.$alias_native("buttons", "buttons"); self.$alias_native("client_x", "clientX"); self.$alias_native("client_y", "clientY"); self.$alias_native("ctrl_key", "ctrlKey"); self.$alias_native("get_modifier_state", "getModifierState"); self.$alias_native("meta_key", "metaKey"); self.$alias_native("page_x", "pageX"); self.$alias_native("page_y", "pageY"); self.$alias_native("related_target", "relatedTarget"); self.$alias_native("screen_x", "screen_x"); self.$alias_native("screen_y", "screen_y"); self.$alias_native("shift_key", "shift_key"); self.$alias_native("alt_key", "altKey"); self.$alias_native("changed_touches", "changedTouches"); self.$alias_native("ctrl_key", "ctrlKey"); self.$alias_native("get_modifier_state", "getModifierState"); self.$alias_native("meta_key", "metaKey"); self.$alias_native("shift_key", "shiftKey"); self.$alias_native("target_touches", "targetTouches"); self.$alias_native("touches", "touches"); self.$alias_native("detail", "detail"); self.$alias_native("view", "view"); self.$alias_native("delta_mode", "deltaMode"); self.$alias_native("delta_x", "deltaX"); self.$alias_native("delta_y", "deltaY"); self.$alias_native("delta_z", "deltaZ"); Opal.cdecl($scope, 'BUILT_IN_EVENTS', ["onCopy", "onCut", "onPaste", "onKeyDown", "onKeyPress", "onKeyUp", "onFocus", "onBlur", "onChange", "onInput", "onSubmit", "onClick", "onDoubleClick", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onScroll"]); return (Opal.defn(self, '$initialize', TMP_1 = function $$initialize(native_element) { var self = this; return self["native"] = native_element; }, TMP_1.$$arity = 1), nil) && 'initialize'; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/native_library"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $range = Opal.range; Opal.add_stubs(['$each', '$lookup_native_name', '$create_component_wrapper', '$create_library_wrapper', '$raise', '$name', '$scope_native_name', '$+', '$downcase', '$[]', '$import_const_from_native', '$const_defined?', '$get_const', '$render', '$to_proc', '$private', '$native_react_component?', '$const_set', '$new', '$class_eval', '$include', '$imports']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $NativeLibrary(){}; var self = $NativeLibrary = $klass($base, $super, 'NativeLibrary', $NativeLibrary); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_10, TMP_11; Opal.defn(self, '$imports', TMP_1 = function $$imports(native_name) { var self = this; self.native_prefix = "" + (native_name) + "."; return self; }, TMP_1.$$arity = 1); Opal.defn(self, '$rename', TMP_3 = function $$rename(rename_list) { var $a, $b, TMP_2, self = this; return ($a = ($b = rename_list).$each, $a.$$p = (TMP_2 = function(js_name, ruby_name){var self = TMP_2.$$s || this, $c, native_name = nil; if (js_name == null) js_name = nil;if (ruby_name == null) ruby_name = nil; native_name = self.$lookup_native_name(js_name); if ((($c = self.$lookup_native_name(js_name)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return ((($c = self.$create_component_wrapper(self, native_name, ruby_name)) !== false && $c !== nil && $c != null) ? $c : self.$create_library_wrapper(self, native_name, ruby_name)) } else { return self.$raise("class " + (self.$name()) + " < React::NativeLibrary could not import " + (js_name) + ". " + ("Native value " + (self.$scope_native_name(js_name)) + " is undefined.")) };}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $a).call($b); }, TMP_3.$$arity = 1); Opal.defn(self, '$import_const_from_native', TMP_4 = function $$import_const_from_native(klass, const_name, create_library) { var $a, $b, $c, self = this, native_name = nil; native_name = ((($a = self.$lookup_native_name(const_name)) !== false && $a !== nil && $a != null) ? $a : self.$lookup_native_name($rb_plus(const_name['$[]'](0).$downcase(), const_name['$[]']($range(1, -1, false))))); return (($a = native_name !== false && native_name !== nil && native_name != null) ? (((($b = self.$create_component_wrapper(klass, native_name, const_name)) !== false && $b !== nil && $b != null) ? $b : ((($c = create_library !== false && create_library !== nil && create_library != null) ? self.$create_library_wrapper(klass, native_name, const_name) : create_library)))) : native_name); }, TMP_4.$$arity = 3); Opal.defn(self, '$const_missing', TMP_5 = function $$const_missing(const_name) { var $a, $b, $c, self = this, $iter = TMP_5.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_5.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return ((($a = self.$import_const_from_native(self, const_name, true)) !== false && $a !== nil && $a != null) ? $a : ($b = ($c = self, Opal.find_super_dispatcher(self, 'const_missing', TMP_5, false)), $b.$$p = $iter, $b).apply($c, $zuper)); }, TMP_5.$$arity = 1); Opal.defn(self, '$method_missing', TMP_6 = function $$method_missing(method, $a_rest) { var $b, $c, self = this, args, $iter = TMP_6.$$p, block = $iter || nil, component_class = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_6.$$p = null; if ((($b = self['$const_defined?'](method)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { component_class = self.$get_const(method)}; ((($b = component_class) !== false && $b !== nil && $b != null) ? $b : component_class = self.$import_const_from_native(self, method, false)); if (component_class !== false && component_class !== nil && component_class != null) { } else { self.$raise("could not import a react component named: " + (self.$scope_native_name(method))) }; return ($b = ($c = (($scope.get('React')).$$scope.get('RenderingContext'))).$render, $b.$$p = block.$to_proc(), $b).apply($c, [component_class].concat(Opal.to_a(args))); }, TMP_6.$$arity = -2); self.$private(); Opal.defn(self, '$lookup_native_name', TMP_7 = function $$lookup_native_name(js_name) { var self = this, native_name = nil; try { native_name = self.$scope_native_name(js_name); return eval(native_name) !== undefined && native_name; } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) { try { return nil } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_7.$$arity = 1); Opal.defn(self, '$scope_native_name', TMP_8 = function $$scope_native_name(js_name) { var self = this; if (self.native_prefix == null) self.native_prefix = nil; return "" + (self.native_prefix) + (js_name); }, TMP_8.$$arity = 1); Opal.defn(self, '$create_component_wrapper', TMP_10 = function $$create_component_wrapper(klass, native_name, ruby_name) { var $a, $b, TMP_9, self = this, new_klass = nil; if ((($a = (($scope.get('React')).$$scope.get('API'))['$native_react_component?'](native_name)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { new_klass = klass.$const_set(ruby_name, $scope.get('Class').$new()); ($a = ($b = new_klass).$class_eval, $a.$$p = (TMP_9 = function(){var self = TMP_9.$$s || this; self.$include((($scope.get('React')).$$scope.get('Component'))); return self.$imports(native_name);}, TMP_9.$$s = self, TMP_9.$$arity = 0, TMP_9), $a).call($b); return new_klass; } else { return nil }; }, TMP_10.$$arity = 3); return (Opal.defn(self, '$create_library_wrapper', TMP_11 = function $$create_library_wrapper(klass, native_name, ruby_name) { var self = this; return klass.$const_set(ruby_name, $scope.get('Class').$new((($scope.get('React')).$$scope.get('NativeLibrary'))).$imports(native_name)); }, TMP_11.$$arity = 3), nil) && 'create_library_wrapper'; })(Opal.get_singleton_class(self)) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/api"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $range = Opal.range; Opal.add_stubs(['$require', '$instance_variable_set', '$[]=', '$raise', '$eval_native_react_component', '$!', '$method_defined?', '$[]', '$name', '$respond_to?', '$to_n', '$prop_types', '$default_props', '$native_mixins', '$static_call_backs', '$component_will_mount', '$component_did_mount', '$component_will_receive_props', '$new', '$should_component_update?', '$component_will_update', '$component_did_update', '$component_will_unmount', '$send', '$<<', '$kind_of?', '$create_native_react_class', '$include?', '$is_a?', '$convert_props', '$shallow_to_n', '$each', '$flatten', '$map', '$==', '$lower_camelize', '$const_defined?', '$tr', '$html_attr?', '$private', '$split', '$first', '$concat', '$+', '$upcase', '$join']); self.$require("react/native_library"); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $API(){}; var self = $API = $klass($base, $super, 'API', $API); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_7, TMP_10, TMP_12; (Opal.cvars['@@component_classes'] = $hash2([], {})); Opal.defs(self, '$import_native_component', TMP_1 = function $$import_native_component(opal_class, native_class) { var $a, self = this; opal_class.$instance_variable_set("@native_import", true); return (($a = Opal.cvars['@@component_classes']) == null ? nil : $a)['$[]='](opal_class, native_class); }, TMP_1.$$arity = 2); Opal.defs(self, '$eval_native_react_component', TMP_2 = function $$eval_native_react_component(name) { var $a, $b, $c, self = this, component = nil, is_component_class = nil, is_functional_component = nil, is_not_using_react_v13 = nil; component = eval(name); if ((($a = component === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise("" + (name) + " is not defined")}; is_component_class = ($a = component.prototype !== undefined, $a !== false && $a !== nil && $a != null ?(((($b = !!component.prototype.isReactComponent) !== false && $b !== nil && $b != null) ? $b : !!component.prototype.render)) : $a); is_functional_component = typeof component === "function"; is_not_using_react_v13 = !Opal.global.React.version.match(/0\.13/); if ((($a = ((($b = is_component_class) !== false && $b !== nil && $b != null) ? $b : ((($c = is_not_using_react_v13 !== false && is_not_using_react_v13 !== nil && is_not_using_react_v13 != null) ? is_functional_component : is_not_using_react_v13)))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise("does not appear to be a native react component") }; return component; }, TMP_2.$$arity = 1); Opal.defs(self, '$native_react_component?', TMP_3 = function(name) { var self = this; if (name == null) { name = nil; } try { if (name !== false && name !== nil && name != null) { } else { return false }; return self.$eval_native_react_component(name); } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return nil } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_3.$$arity = -1); Opal.defs(self, '$create_native_react_class', TMP_4 = function $$create_native_react_class(type) { var $a, $b, $c, $d, self = this, render_fn = nil; if ((($a = (type['$method_defined?']("render"))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise("Provided class should define `render` method")}; render_fn = (function() {if ((($a = (type['$method_defined?']("_render_wrapper"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "_render_wrapper" } else { return "render" }; return nil; })(); return ($a = type, $b = (($c = Opal.cvars['@@component_classes']) == null ? nil : $c), ((($c = $b['$[]']($a)) !== false && $c !== nil && $c != null) ? $c : $b['$[]=']($a, React.createClass({ displayName: type.$name(), propTypes: (function() {if ((($d = type['$respond_to?']("prop_types")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return type.$prop_types().$to_n() } else { return {}; }; return nil; })(), getDefaultProps: function(){ return (function() {if ((($d = type['$respond_to?']("default_props")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return type.$default_props().$to_n() } else { return {}; }; return nil; })(); }, mixins: (function() {if ((($d = type['$respond_to?']("native_mixins")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return type.$native_mixins() } else { return []; }; return nil; })(), statics: (function() {if ((($d = type['$respond_to?']("static_call_backs")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return type.$static_call_backs().$to_n() } else { return {}; }; return nil; })(), componentWillMount: function() { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("component_will_mount")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance).$component_will_mount() } else { return nil }; return nil; })(); }, componentDidMount: function() { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("component_did_mount")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance).$component_did_mount() } else { return nil }; return nil; })(); }, componentWillReceiveProps: function(next_props) { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("component_will_receive_props")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance).$component_will_receive_props($scope.get('Hash').$new(next_props)) } else { return nil }; return nil; })(); }, shouldComponentUpdate: function(next_props, next_state) { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("should_component_update?")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance)['$should_component_update?']($scope.get('Hash').$new(next_props), $scope.get('Hash').$new(next_state)) } else { return nil }; return nil; })(); }, componentWillUpdate: function(next_props, next_state) { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("component_will_update")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance).$component_will_update($scope.get('Hash').$new(next_props), $scope.get('Hash').$new(next_state)) } else { return nil }; return nil; })(); }, componentDidUpdate: function(prev_props, prev_state) { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("component_did_update")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance).$component_did_update($scope.get('Hash').$new(prev_props), $scope.get('Hash').$new(prev_state)) } else { return nil }; return nil; })(); }, componentWillUnmount: function() { var instance = this._getOpalInstance.apply(this); return (function() {if ((($d = type['$method_defined?']("component_will_unmount")) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return (instance).$component_will_unmount() } else { return nil }; return nil; })(); }, _getOpalInstance: function() { if (this.__opalInstance == undefined) { var instance = type.$new(this); } else { var instance = this.__opalInstance; } this.__opalInstance = instance; return instance; }, render: function() { var instance = this._getOpalInstance.apply(this); return (instance).$send(render_fn).$to_n(); } }) ))); }, TMP_4.$$arity = 1); Opal.defs(self, '$create_element', TMP_5 = function $$create_element(type, properties) { var $a, $b, TMP_6, self = this, $iter = TMP_5.$$p, block = $iter || nil, params = nil; if (properties == null) { properties = $hash2([], {}); } TMP_5.$$p = null; params = []; if ((($a = (($b = Opal.cvars['@@component_classes']) == null ? nil : $b)['$[]'](type)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { params['$<<']((($a = Opal.cvars['@@component_classes']) == null ? nil : $a)['$[]'](type)) } else if ((($a = type['$kind_of?']($scope.get('Class'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { params['$<<'](self.$create_native_react_class(type)) } else if ((($a = (((((($scope.get('React')).$$scope.get('Component'))).$$scope.get('Tags'))).$$scope.get('HTML_TAGS'))['$include?'](type)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { params['$<<'](type) } else if ((($a = type['$is_a?']($scope.get('String'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('React')).$$scope.get('Element')).$new(type) } else { self.$raise("" + (type) + " not implemented") }; properties = self.$convert_props(properties); params['$<<'](properties.$shallow_to_n()); if ((block !== nil)) { ($a = ($b = [Opal.yieldX(block, [])].$flatten()).$each, $a.$$p = (TMP_6 = function(ele){var self = TMP_6.$$s || this; if (ele == null) ele = nil; return params['$<<'](ele.$to_n())}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b)}; return (($scope.get('React')).$$scope.get('Element')).$new(React.createElement.apply(null, params), type, properties, block); }, TMP_5.$$arity = -2); Opal.defs(self, '$clear_component_class_cache', TMP_7 = function $$clear_component_class_cache() { var self = this; return (Opal.cvars['@@component_classes'] = $hash2([], {})); }, TMP_7.$$arity = 0); Opal.defs(self, '$convert_props', TMP_10 = function $$convert_props(properties) { var $a, $b, TMP_8, self = this, props = nil; if ((($a = properties['$is_a?']($scope.get('Hash'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise("Component parameters must be a hash. Instead you sent " + (properties)) }; props = $hash2([], {}); ($a = ($b = properties).$map, $a.$$p = (TMP_8 = function(key, value){var self = TMP_8.$$s || this, $c, $d, TMP_9; if (key == null) key = nil;if (value == null) value = nil; if ((($c = (($d = key['$==']("class_name")) ? value['$is_a?']($scope.get('Hash')) : key['$==']("class_name"))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return props['$[]='](self.$lower_camelize(key), React.addons.classSet(value.$to_n())) } else if (key['$==']("class")) { return props['$[]=']("className", value) } else if ((($c = ["style", "dangerously_set_inner_HTML"]['$include?'](key)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return props['$[]='](self.$lower_camelize(key), value.$to_n()) } else if ((($c = (($d = key['$==']("ref")) ? value['$is_a?']($scope.get('Proc')) : key['$==']("ref"))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { if ((($c = $scope.get('React')['$const_defined?']("RefsCallbackExtension")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { console.error( "Warning: Using deprecated behavior of ref callback,", "require \"react/ref_callback\" to get the correct behavior." ); }; return props['$[]='](key, value); } else if ((($c = ($d = (($scope.get('React')).$$scope.get('HASH_ATTRIBUTES'))['$include?'](key), $d !== false && $d !== nil && $d != null ?value['$is_a?']($scope.get('Hash')) : $d)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return ($c = ($d = value).$each, $c.$$p = (TMP_9 = function(k, v){var self = TMP_9.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return props['$[]=']("" + (key) + "-" + (k.$tr("_", "-")), v.$to_n())}, TMP_9.$$s = self, TMP_9.$$arity = 2, TMP_9), $c).call($d) } else { return props['$[]=']((function() {if ((($c = $scope.get('React')['$html_attr?'](self.$lower_camelize(key))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$lower_camelize(key) } else { return key }; return nil; })(), value) }}, TMP_8.$$s = self, TMP_8.$$arity = 2, TMP_8), $a).call($b); return props; }, TMP_10.$$arity = 1); self.$private(); return (Opal.defs(self, '$lower_camelize', TMP_12 = function $$lower_camelize(snake_cased_word) { var $a, $b, TMP_11, self = this, words = nil, result = nil; words = snake_cased_word.$split("_"); result = [words.$first()]; result.$concat(($a = ($b = words['$[]']($range(1, -1, false))).$map, $a.$$p = (TMP_11 = function(word){var self = TMP_11.$$s || this; if (word == null) word = nil; return $rb_plus(word['$[]'](0).$upcase(), word['$[]']($range(1, -1, false)))}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b)); return result.$join(""); }, TMP_12.$$arity = 1), nil) && 'lower_camelize'; })($scope.base, null) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["react/object"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$_reactrb_tag_original_const_missing', '$html_tag_class_for', '$raise']); return (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_1; Opal.alias(self, '_reactrb_tag_original_const_missing', 'const_missing'); return (Opal.defn(self, '$const_missing', TMP_1 = function $$const_missing(const_name) { var $a, self = this, e = nil; try { return self.$_reactrb_tag_original_const_missing(const_name) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) {e = $err; try { return ((($a = (((($scope.get('React')).$$scope.get('Component'))).$$scope.get('Tags')).$html_tag_class_for(const_name)) !== false && $a !== nil && $a != null) ? $a : self.$raise(e)) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_1.$$arity = 1), nil) && 'const_missing'; })(Opal.get_singleton_class(self)) })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/ext/opal-jquery/element"] = function(Opal) { var $a, $b, TMP_1, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $hash2 = Opal.hash2; Opal.add_stubs(['$const_defined?', '$instance_eval', '$dom_node', '$find', '$define_method', '$to_n', '$new', '$class_eval', '$render', '$to_proc', '$create_element']); if ((($a = $scope.get('Object')['$const_defined?']("Element")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = $scope.get('Element')).$instance_eval, $a.$$p = (TMP_1 = function(){var self = TMP_1.$$s || this, TMP_2, TMP_3, $c, $d, TMP_4; Opal.defs(self, '$find', TMP_2 = function $$find(selector) { var $a, self = this; if ((($a = selector.$dom_node !== undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { selector = (function() { try { return selector.$dom_node() } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { try { return selector } finally { Opal.pop_exception() } } else { throw $err; } }})()}; return $(selector); }, TMP_2.$$arity = 1); Opal.defs(self, '$[]', TMP_3 = function(selector) { var self = this; return self.$find(selector); }, TMP_3.$$arity = 1); return ($c = ($d = self).$define_method, $c.$$p = (TMP_4 = function(container, params){var self = TMP_4.$$s || this, block, $e, $f, TMP_5, klass = nil; block = TMP_4.$$p || nil, TMP_4.$$p = null; if (container == null) { container = nil; } if (params == null) { params = $hash2([], {}); } if ((($e = self.$to_n()._reactrb_component_class === undefined) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { self.$to_n()._reactrb_component_class = $scope.get('Class').$new((($scope.get('Hyperloop')).$$scope.get('Component')));}; klass = self.$to_n()._reactrb_component_class; ($e = ($f = klass).$class_eval, $e.$$p = (TMP_5 = function(){var self = TMP_5.$$s || this, $g, $h; return ($g = ($h = self).$render, $g.$$p = block.$to_proc(), $g).call($h, container, params)}, TMP_5.$$s = self, TMP_5.$$arity = 0, TMP_5), $e).call($f); return $scope.get('React').$render($scope.get('React').$create_element(self.$to_n()._reactrb_component_class), self);}, TMP_4.$$s = self, TMP_4.$$arity = -1, TMP_4), $c).call($d, "render");}, TMP_1.$$s = self, TMP_1.$$arity = 0, TMP_1), $a).call($b) } else { return nil } }; /* Generated by Opal 0.10.3 */ Opal.modules["react/config/client"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2; Opal.add_stubs(['$extend', '$[]=', '$config', '$default_config']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Config, self = $Config = $module($base, 'Config'); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3; self.$extend(self); Opal.defn(self, '$environment=', TMP_1 = function(value) { var self = this; return self.$config()['$[]=']("environment", value); }, TMP_1.$$arity = 1); Opal.defn(self, '$config', TMP_2 = function $$config() { var $a, self = this; if (self.config == null) self.config = nil; return ((($a = self.config) !== false && $a !== nil && $a != null) ? $a : self.config = self.$default_config()); }, TMP_2.$$arity = 0); Opal.defn(self, '$default_config', TMP_3 = function $$default_config() { var self = this; return $hash2(["environment"], {"environment": "express"}); }, TMP_3.$$arity = 0); })($scope.base) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["react/config"] = function(Opal) { var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice; Opal.add_stubs(['$!=', '$require']); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return self.$require("react/config/client") } }; /* Generated by Opal 0.10.3 */ Opal.modules["reactive-ruby/isomorphic_helpers"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $range = Opal.range, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$require', '$extend', '$!=', '$!', '$unique_id', '$on_opal_server?', '$log', '$new', '$is_a?', '$==', '$[]', '$config', '$+', '$class', '$on_opal_client?', '$join', '$collect', '$call', '$prerender_footer_blocks', '$attr_reader', '$run', '$each', '$before_first_mount_blocks', '$eval', '$length', '$load!', '$<<', '$first', '$send_to_server', '$to_json', '$parse', '$controller', '$context', '$register_before_first_mount_block', '$to_proc', '$register_prerender_footer_block', '$send', '$result']); self.$require("react/config"); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $IsomorphicHelpers, self = $IsomorphicHelpers = $module($base, 'IsomorphicHelpers'); var def = self.$$proto, $scope = self.$$scope, TMP_1, $a, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_10; Opal.defs(self, '$included', TMP_1 = function $$included(base) { var self = this; return base.$extend($scope.get('ClassMethods')); }, TMP_1.$$arity = 1); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Opal.defs(self, '$load_context', TMP_2 = function $$load_context(unique_id, name) { var $a, $b, $c, self = this, message = nil; if (self.context == null) self.context = nil; if (unique_id == null) { unique_id = nil; } if (name == null) { name = nil; } if ((($a = ((($b = ((($c = unique_id['$!']()) !== false && $c !== nil && $c != null) ? $c : self.context['$!']())) !== false && $b !== nil && $b != null) ? $b : self.context.$unique_id()['$!='](unique_id))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = self['$on_opal_server?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { try {console.history = [] } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { nil } else { throw $err; } }; message = "************************ React Prerendering Context Initialized " + (name) + " ***********************"; } else { message = "************************ React Browser Context Initialized ****************************" }; self.$log(message); self.context = $scope.get('Context').$new(unique_id);}; return self.context; }, TMP_2.$$arity = -1) }; Opal.defs(self, '$log', TMP_3 = function $$log(message, message_type) { var $a, $b, $c, self = this, is_production = nil, style = nil; if (message_type == null) { message_type = "info"; } if ((($a = message['$is_a?']($scope.get('Array'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { message = [message] }; is_production = (($scope.get('React')).$$scope.get('Config')).$config()['$[]']("environment")['$==']("production"); if ((($a = ($b = (((($c = message_type['$==']("info")) !== false && $c !== nil && $c != null) ? $c : message_type['$==']("warning"))), $b !== false && $b !== nil && $b != null ?is_production : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if (message_type['$==']("info")) { if ((($a = self['$on_opal_server?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { style = "background: #00FFFF; color: red" } else { style = "background: #222; color: #bada55" }; message = $rb_plus([$rb_plus("%c", message['$[]'](0)), style], message['$[]']($range(1, -1, false))); return console.log.apply(console, message); } else if (message_type['$==']("warning")) { return console.warn.apply(console, message); } else { return console.error.apply(console, message); }; }, TMP_3.$$arity = -2); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { Opal.defs(self, '$on_opal_server?', TMP_4 = function() { var self = this; return typeof Opal.global.document === 'undefined'; }, TMP_4.$$arity = 0); Opal.defs(self, '$on_opal_client?', TMP_5 = function() { var self = this; return self['$on_opal_server?']()['$!'](); }, TMP_5.$$arity = 0); }; Opal.defn(self, '$log', TMP_6 = function $$log($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $scope.get('IsomorphicHelpers')).$log.apply($b, Opal.to_a(args)); }, TMP_6.$$arity = -1); Opal.defn(self, '$on_opal_server?', TMP_7 = function() { var self = this; return self.$class()['$on_opal_server?'](); }, TMP_7.$$arity = 0); Opal.defn(self, '$on_opal_client?', TMP_8 = function() { var self = this; return self.$class()['$on_opal_client?'](); }, TMP_8.$$arity = 0); Opal.defs(self, '$prerender_footers', TMP_10 = function $$prerender_footers(controller) { var $a, $b, TMP_9, self = this, footer = nil; if (controller == null) { controller = nil; } footer = ($a = ($b = $scope.get('Context').$prerender_footer_blocks()).$collect, $a.$$p = (TMP_9 = function(block){var self = TMP_9.$$s || this; if (block == null) block = nil; return block.$call(controller)}, TMP_9.$$s = self, TMP_9.$$arity = 1, TMP_9), $a).call($b).$join("\n"); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {}; return footer; }, TMP_10.$$arity = -1); (function($base, $super) { function $Context(){}; var self = $Context = $klass($base, $super, 'Context', $Context); var def = self.$$proto, $scope = self.$$scope, TMP_11, TMP_12, TMP_14, TMP_15, TMP_17, TMP_18, TMP_19; def.ctx = nil; self.$attr_reader("controller"); self.$attr_reader("unique_id"); Opal.defs(self, '$before_first_mount_blocks', TMP_11 = function $$before_first_mount_blocks() { var $a, self = this; if (self.before_first_mount_blocks == null) self.before_first_mount_blocks = nil; return ((($a = self.before_first_mount_blocks) !== false && $a !== nil && $a != null) ? $a : self.before_first_mount_blocks = []); }, TMP_11.$$arity = 0); Opal.defs(self, '$prerender_footer_blocks', TMP_12 = function $$prerender_footer_blocks() { var $a, self = this; if (self.prerender_footer_blocks == null) self.prerender_footer_blocks = nil; return ((($a = self.prerender_footer_blocks) !== false && $a !== nil && $a != null) ? $a : self.prerender_footer_blocks = []); }, TMP_12.$$arity = 0); Opal.defn(self, '$initialize', TMP_14 = function $$initialize(unique_id, ctx, controller, name) { var $a, $b, TMP_13, self = this; if (ctx == null) { ctx = nil; } if (controller == null) { controller = nil; } if (name == null) { name = nil; } self.unique_id = unique_id; if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {}; (((($scope.get('Hyperloop')).$$scope.get('Application'))).$$scope.get('Boot')).$run($hash2(["context"], {"context": self})); return ($a = ($b = self.$class().$before_first_mount_blocks()).$each, $a.$$p = (TMP_13 = function(block){var self = TMP_13.$$s || this; if (block == null) block = nil; return block.$call(self)}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $a).call($b); }, TMP_14.$$arity = -2); Opal.defn(self, '$eval', TMP_15 = function(js) { var $a, self = this; if ((($a = self.ctx) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.ctx.$eval(js) } else { return nil }; }, TMP_15.$$arity = 1); Opal.defn(self, '$send_to_opal', TMP_17 = function $$send_to_opal(method, $a_rest) { var $b, $c, TMP_16, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } if ((($b = self.ctx) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { return nil }; if (args.$length()['$=='](0)) { args = [1]}; ((Opal.get('ReactiveRuby')).$$scope.get('ComponentLoader')).$new(self.ctx)['$load!'](); return self.ctx.$eval("Opal.React.$const_get('IsomorphicHelpers').$" + (method) + "(" + (($b = ($c = args).$collect, $b.$$p = (TMP_16 = function(arg){var self = TMP_16.$$s || this; if (arg == null) arg = nil; return "'" + (arg) + "'"}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $b).call($c).$join(", ")) + ")"); }, TMP_17.$$arity = -2); Opal.defs(self, '$register_before_first_mount_block', TMP_18 = function $$register_before_first_mount_block() { var self = this, $iter = TMP_18.$$p, block = $iter || nil; TMP_18.$$p = null; return self.$before_first_mount_blocks()['$<<'](block); }, TMP_18.$$arity = 0); return (Opal.defs(self, '$register_prerender_footer_block', TMP_19 = function $$register_prerender_footer_block() { var self = this, $iter = TMP_19.$$p, block = $iter || nil; TMP_19.$$p = null; return self.$prerender_footer_blocks()['$<<'](block); }, TMP_19.$$arity = 0), nil) && 'register_prerender_footer_block'; })($scope.base, null); (function($base, $super) { function $IsomorphicProcCall(){}; var self = $IsomorphicProcCall = $klass($base, $super, 'IsomorphicProcCall', $IsomorphicProcCall); var def = self.$$proto, $scope = self.$$scope, TMP_20, TMP_21, TMP_22, TMP_23, TMP_24; def.result = def.name = nil; Opal.defn(self, '$result', TMP_20 = function $$result() { var $a, self = this; if ((($a = self.result) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.result.$first() } else { return nil }; }, TMP_20.$$arity = 0); Opal.defn(self, '$initialize', TMP_21 = function $$initialize(name, block, $a_rest) { var $b, $c, $d, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 2; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 2; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 2] = arguments[$arg_idx]; } self.name = name; ($b = block).$call.apply($b, [self].concat(Opal.to_a(args))); if ((($c = $scope.get('IsomorphicHelpers')['$on_opal_server?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return ((($c = self.result) !== false && $c !== nil && $c != null) ? $c : self.result = ($d = self).$send_to_server.apply($d, Opal.to_a(args))) } else { return nil }; }, TMP_21.$$arity = -3); Opal.defn(self, '$when_on_client', TMP_22 = function $$when_on_client() { var $a, self = this, $iter = TMP_22.$$p, block = $iter || nil; TMP_22.$$p = null; if ((($a = $scope.get('IsomorphicHelpers')['$on_opal_client?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.result = [block.$call()] } else { return nil }; }, TMP_22.$$arity = 0); Opal.defn(self, '$send_to_server', TMP_23 = function $$send_to_server($a_rest) { var $b, self = this, args, args_as_json = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = $scope.get('IsomorphicHelpers')['$on_opal_server?']()) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { args_as_json = args.$to_json(); return self.result = [$scope.get('JSON').$parse(Opal.global.ServerSideIsomorphicMethods[self.name](args_as_json))]; } else { return nil }; }, TMP_23.$$arity = -1); return (Opal.defn(self, '$when_on_server', TMP_24 = function $$when_on_server() { var $a, $b, self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; if ((($a = ((($b = $scope.get('IsomorphicHelpers')['$on_opal_client?']()) !== false && $b !== nil && $b != null) ? $b : $scope.get('IsomorphicHelpers')['$on_opal_server?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return self.result = [block.$call().$to_json()] }; }, TMP_24.$$arity = 0), nil) && 'when_on_server'; })($scope.base, null); (function($base) { var $ClassMethods, self = $ClassMethods = $module($base, 'ClassMethods'); var def = self.$$proto, $scope = self.$$scope, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, $a, TMP_31; Opal.defn(self, '$on_opal_server?', TMP_25 = function() { var self = this; return $scope.get('IsomorphicHelpers')['$on_opal_server?'](); }, TMP_25.$$arity = 0); Opal.defn(self, '$on_opal_client?', TMP_26 = function() { var self = this; return $scope.get('IsomorphicHelpers')['$on_opal_client?'](); }, TMP_26.$$arity = 0); Opal.defn(self, '$log', TMP_27 = function $$log($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = $scope.get('IsomorphicHelpers')).$log.apply($b, Opal.to_a(args)); }, TMP_27.$$arity = -1); Opal.defn(self, '$controller', TMP_28 = function $$controller() { var self = this; return $scope.get('IsomorphicHelpers').$context().$controller(); }, TMP_28.$$arity = 0); Opal.defn(self, '$before_first_mount', TMP_29 = function $$before_first_mount() { var $a, $b, self = this, $iter = TMP_29.$$p, block = $iter || nil; TMP_29.$$p = null; return ($a = ($b = (((($scope.get('React')).$$scope.get('IsomorphicHelpers'))).$$scope.get('Context'))).$register_before_first_mount_block, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_29.$$arity = 0); Opal.defn(self, '$prerender_footer', TMP_30 = function $$prerender_footer() { var $a, $b, self = this, $iter = TMP_30.$$p, block = $iter || nil; TMP_30.$$p = null; return ($a = ($b = (((($scope.get('React')).$$scope.get('IsomorphicHelpers'))).$$scope.get('Context'))).$register_prerender_footer_block, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_30.$$arity = 0); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$require("json"); Opal.defn(self, '$isomorphic_method', TMP_31 = function $$isomorphic_method(name) { var $a, $b, TMP_32, self = this, $iter = TMP_31.$$p, block = $iter || nil; TMP_31.$$p = null; return ($a = ($b = self.$class()).$send, $a.$$p = (TMP_32 = function($c_rest){var self = TMP_32.$$s || this, args, $d; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($d = (((($scope.get('React')).$$scope.get('IsomorphicHelpers'))).$$scope.get('IsomorphicProcCall'))).$new.apply($d, [name, block].concat(Opal.to_a(args))).$result()}, TMP_32.$$s = self, TMP_32.$$arity = -1, TMP_32), $a).call($b, "define_method", name); }, TMP_31.$$arity = 1); }; })($scope.base); })($scope.base) })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["rails-helpers/top_level_rails_component"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$include', '$export_component', '$param', '$backtrace', '$start_with?', '$component_name', '$params', '$<<', '$gsub', '$inject', '$const_get', '$split', '$method_defined?', '$present', '$render_params', '$each', '$==', '$+', '$name', '$controller', '$search_path', '$class', '$raise', '$join', '$search_path=', '$!', '$include?', '$add_to_react_search_path']); (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $TopLevelRailsComponent(){}; var self = $TopLevelRailsComponent = $klass($base, $super, 'TopLevelRailsComponent', $TopLevelRailsComponent); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_7; self.$include((((($scope.get('Hyperloop')).$$scope.get('Component'))).$$scope.get('Mixin'))); Opal.defs(self, '$search_path', TMP_1 = function $$search_path() { var $a, self = this; if (self.search_path == null) self.search_path = nil; return ((($a = self.search_path) !== false && $a !== nil && $a != null) ? $a : self.search_path = [$scope.get('Module')]); }, TMP_1.$$arity = 0); self.$export_component(); self.$param("component_name"); self.$param("controller"); self.$param("render_params"); self.$backtrace("off"); return (Opal.defn(self, '$render', TMP_7 = function $$render() {try { var $a, $b, TMP_2, $c, TMP_3, $d, TMP_5, self = this, paths_searched = nil, component = nil; paths_searched = []; if ((($a = self.$params().$component_name()['$start_with?']("::")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { paths_searched['$<<'](self.$params().$component_name().$gsub(/^\:\:/, "")); component = (function() { try {return ($a = ($b = self.$params().$component_name().$gsub(/^\:\:/, "").$split("::")).$inject, $a.$$p = (TMP_2 = function(scope, next_const){var self = TMP_2.$$s || this; if (scope == null) scope = nil;if (next_const == null) next_const = nil; return scope.$const_get(next_const, false)}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $a).call($b, $scope.get('Module')) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return nil } else { throw $err; } }})(); if ((($a = (($c = component !== false && component !== nil && component != null) ? component['$method_defined?']("render") : component)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$present(component, self.$params().$render_params())}; } else { ($a = ($c = self.$class().$search_path()).$each, $a.$$p = (TMP_3 = function(path){var self = TMP_3.$$s || this, $d, $e, TMP_4, $f; if (path == null) path = nil; paths_searched['$<<']("" + ((function() {if (path['$==']($scope.get('Module'))) { return nil } else { return $rb_plus(path.$name(), "::") }; return nil; })()) + (self.$params().$controller()) + "::" + (self.$params().$component_name())); component = (function() { try {return ($d = ($e = (((("") + (self.$params().$controller())) + "::") + (self.$params().$component_name())).$split("::")).$inject, $d.$$p = (TMP_4 = function(scope, next_const){var self = TMP_4.$$s || this; if (scope == null) scope = nil;if (next_const == null) next_const = nil; return scope.$const_get(next_const, false)}, TMP_4.$$s = self, TMP_4.$$arity = 2, TMP_4), $d).call($e, path) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return nil } else { throw $err; } }})(); if ((($d = (($f = component !== false && component !== nil && component != null) ? component['$method_defined?']("render") : component)) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { Opal.ret(self.$present(component, self.$params().$render_params())) } else { return nil };}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($c); ($a = ($d = self.$class().$search_path()).$each, $a.$$p = (TMP_5 = function(path){var self = TMP_5.$$s || this, $e, $f, TMP_6, $g; if (path == null) path = nil; paths_searched['$<<']("" + ((function() {if (path['$==']($scope.get('Module'))) { return nil } else { return $rb_plus(path.$name(), "::") }; return nil; })()) + (self.$params().$component_name())); component = (function() { try {return ($e = ($f = (("") + (self.$params().$component_name())).$split("::")).$inject, $e.$$p = (TMP_6 = function(scope, next_const){var self = TMP_6.$$s || this; if (scope == null) scope = nil;if (next_const == null) next_const = nil; return scope.$const_get(next_const, false)}, TMP_6.$$s = self, TMP_6.$$arity = 2, TMP_6), $e).call($f, path) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return nil } else { throw $err; } }})(); if ((($e = (($g = component !== false && component !== nil && component != null) ? component['$method_defined?']("render") : component)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { Opal.ret(self.$present(component, self.$params().$render_params())) } else { return nil };}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $a).call($d); }; return self.$raise("Could not find component class '" + (self.$params().$component_name()) + "' for params.controller '" + (self.$params().$controller()) + "' in any component directory. Tried [" + (paths_searched.$join(", ")) + "]"); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_7.$$arity = 0), nil) && 'render'; })($scope.base, null) })($scope.base); (function($base, $super) { function $Module(){}; var self = $Module = $klass($base, $super, 'Module', $Module); var def = self.$$proto, $scope = self.$$scope, TMP_8; return (Opal.defn(self, '$add_to_react_search_path', TMP_8 = function $$add_to_react_search_path(replace_search_path) { var $a, $b, self = this; if (replace_search_path == null) { replace_search_path = nil; } if (replace_search_path !== false && replace_search_path !== nil && replace_search_path != null) { return (($a = [[self]]), $b = (($scope.get('React')).$$scope.get('TopLevelRailsComponent')), $b['$search_path='].apply($b, $a), $a[$a.length-1]) } else if ((($a = (($scope.get('React')).$$scope.get('TopLevelRailsComponent')).$search_path()['$include?'](self)['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (($scope.get('React')).$$scope.get('TopLevelRailsComponent')).$search_path()['$<<'](self) } else { return nil }; }, TMP_8.$$arity = -1), nil) && 'add_to_react_search_path' })($scope.base, null); return (function($base) { var $Components, self = $Components = $module($base, 'Components'); var def = self.$$proto, $scope = self.$$scope; self.$add_to_react_search_path() })($scope.base); }; /* Generated by Opal 0.10.3 */ Opal.modules["reactive-ruby/version"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; Opal.cdecl($scope, 'VERSION', "0.12.3") })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-react"] = function(Opal) { var $a, self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $hash2 = Opal.hash2, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$import', '$==', '$raise', '$join', '$include', '$deprecation_warning']); self.$require("hyperloop-config"); $scope.get('Hyperloop').$import("hyper-store"); $scope.get('Hyperloop').$import("react/react-source-browser"); $scope.get('Hyperloop').$import("react/react-source-server", $hash2(["server_only"], {"server_only": true})); $scope.get('Hyperloop').$import("opal-jquery", $hash2(["client_only"], {"client_only": true})); $scope.get('Hyperloop').$import("browser/delay", $hash2(["client_only"], {"client_only": true})); $scope.get('Hyperloop').$import("react_ujs", $hash2(["client_only"], {"client_only": true})); $scope.get('Hyperloop').$import("hyper-react"); if ($scope.get('RUBY_ENGINE')['$==']("opal")) { (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Component(){}; var self = $Component = $klass($base, $super, 'Component', $Component); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, null) })($scope.base); if ((($a = Opal.global.React === undefined || Opal.global.React.version === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise(["No React.js Available", "", "A global `React` must be defined before requiring 'hyper-react'", "", "To USE THE BUILT-IN SOURCE: ", " add 'require \"react/react-source-browser\"' immediately before the 'require \"hyper-react\" directive.", "IF USING WEBPACK:", " add 'react' to your webpack manifest."].$join("\n"))}; self.$require("react/hash"); self.$require("react/top_level"); self.$require("react/observable"); self.$require("react/validator"); self.$require("react/component"); self.$require("react/component/dsl_instance_methods"); self.$require("react/component/should_component_update"); self.$require("react/component/tags"); self.$require("react/component/base"); self.$require("react/element"); self.$require("react/event"); self.$require("react/api"); self.$require("react/rendering_context"); self.$require("react/state"); self.$require("react/object"); self.$require("react/ext/opal-jquery/element"); self.$require("reactive-ruby/isomorphic_helpers"); self.$require("rails-helpers/top_level_rails_component"); self.$require("reactive-ruby/version"); (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Component(){}; var self = $Component = $klass($base, $super, 'Component', $Component); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defs(self, '$inherited', TMP_1 = function $$inherited(child) { var self = this; return child.$include($scope.get('Mixin')); }, TMP_1.$$arity = 1), nil) && 'inherited' })($scope.base, null) })($scope.base); if ((($a = (function(){ try { return (((((($scope.get('Hyperloop')).$$scope.get('Component'))).$$scope.get('VERSION'))) != null ? 'constant' : nil); } catch (err) { if (err.$$class === Opal.NameError) { return nil; } else { throw(err); }}; })()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil } else { return (($scope.get('React')).$$scope.get('Component')).$deprecation_warning("components.rb", "Requiring 'hyper-react' is deprecated. Use gem 'hyper-component', and require 'hyper-component' instead.") };}; }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-component"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$require', '$import', '$==']); self.$require("hyperloop/component/version"); self.$require("hyperloop-config"); $scope.get('Hyperloop').$import("hyper-component"); if ($scope.get('RUBY_ENGINE')['$==']("opal")) { (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Component(){}; var self = $Component = $klass($base, $super, 'Component', $Component); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, null) })($scope.base); return self.$require("hyper-react");}; }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/call_by_class_name"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$private', '$lookup_const', '$<', '$!', '$method_defined?', '$raise', '$=~', '$reverse', '$inject', '$+', '$const_get', '$last', '$split', '$to_s', '$name', '$detect', '$is_a?', '$_hyper_operation_original_method_missing', '$to_proc', '$send', '$class']); (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, null) })($scope.base); (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Component, self = $Component = $module($base, 'Component'); var def = self.$$proto, $scope = self.$$scope; (function($base) { var $Tags, self = $Tags = $module($base, 'Tags'); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$private(); Opal.defn(self, '$find_component', TMP_1 = function $$find_component(name) { var $a, $b, self = this, component = nil; component = self.$lookup_const(name); if ((($a = (($b = component !== false && component !== nil && component != null) ? $rb_lt(component, (($scope.get('Hyperloop')).$$scope.get('Operation'))) : component)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; if ((($a = (($b = component !== false && component !== nil && component != null) ? component['$method_defined?']("render")['$!']() : component)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise("" + (name) + " does not appear to be a react component.")}; return component; }, TMP_1.$$arity = 1); })($scope.base) })($scope.base) })($scope.base); return (function($base, $super) { function $Object(){}; var self = $Object = $klass($base, $super, 'Object', $Object); var def = self.$$proto, $scope = self.$$scope, TMP_5; (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_2; Opal.alias(self, '_hyper_operation_original_method_missing', 'method_missing'); return (Opal.defn(self, '$method_missing', TMP_2 = function $$method_missing(name, $a_rest) { var $b, $c, TMP_3, $d, TMP_4, $e, self = this, args, $iter = TMP_2.$$p, block = $iter || nil, scopes = nil, scope = nil, const$ = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_2.$$p = null; if ((($b = name['$=~'](/^[A-Z]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { scopes = ($b = ($c = self.$name().$to_s().$split("::")).$inject, $b.$$p = (TMP_3 = function(nesting, next_const){var self = TMP_3.$$s || this; if (nesting == null) nesting = nil;if (next_const == null) next_const = nil; return $rb_plus(nesting, [nesting.$last().$const_get(next_const)])}, TMP_3.$$s = self, TMP_3.$$arity = 2, TMP_3), $b).call($c, [$scope.get('Module')]).$reverse(); scope = ($b = ($d = scopes).$detect, $b.$$p = (TMP_4 = function(s){var self = TMP_4.$$s || this; if (s == null) s = nil; try {return s.$const_get(name) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return nil } else { throw $err; } }}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $b).call($d); if (scope !== false && scope !== nil && scope != null) { const$ = scope.$const_get(name)};}; if ((($b = ($e = const$['$is_a?']($scope.get('Class')), $e !== false && $e !== nil && $e != null ?$rb_lt(const$, (($scope.get('Hyperloop')).$$scope.get('Operation'))) : $e)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { ($b = ($e = self).$_hyper_operation_original_method_missing, $b.$$p = block.$to_proc(), $b).apply($e, [name].concat(Opal.to_a(args))) }; return ($b = const$).$send.apply($b, ["run"].concat(Opal.to_a(args))); }, TMP_2.$$arity = -2), nil) && 'method_missing'; })(Opal.get_singleton_class(self)); Opal.alias(self, '_hyper_operation_original_method_missing', 'method_missing'); return (Opal.defn(self, '$method_missing', TMP_5 = function $$method_missing(name, $a_rest) { var $b, $c, TMP_6, $d, TMP_7, $e, self = this, args, $iter = TMP_5.$$p, block = $iter || nil, first = nil, scopes = nil, scope = nil, const$ = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } TMP_5.$$p = null; if ((($b = name['$=~'](/^[A-Z]/)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { first = (function() {if ((($b = ((($c = self['$is_a?']($scope.get('Module'))) !== false && $c !== nil && $c != null) ? $c : self['$is_a?']($scope.get('Class')))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { return self.$name() } else { return self.$class().$name() }; return nil; })(); scopes = ($b = ($c = first.$to_s().$split("::")).$inject, $b.$$p = (TMP_6 = function(nesting, next_const){var self = TMP_6.$$s || this; if (nesting == null) nesting = nil;if (next_const == null) next_const = nil; return $rb_plus(nesting, [nesting.$last().$const_get(next_const)])}, TMP_6.$$s = self, TMP_6.$$arity = 2, TMP_6), $b).call($c, [$scope.get('Module')]).$reverse(); scope = ($b = ($d = scopes).$detect, $b.$$p = (TMP_7 = function(s){var self = TMP_7.$$s || this; if (s == null) s = nil; try {return s.$const_get(name) } catch ($err) { if (Opal.rescue($err, [$scope.get('StandardError')])) { return nil } else { throw $err; } }}, TMP_7.$$s = self, TMP_7.$$arity = 1, TMP_7), $b).call($d); if (scope !== false && scope !== nil && scope != null) { const$ = scope.$const_get(name)};}; if ((($b = ($e = const$['$is_a?']($scope.get('Class')), $e !== false && $e !== nil && $e != null ?$rb_lt(const$, (($scope.get('Hyperloop')).$$scope.get('Operation'))) : $e)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { ($b = ($e = self).$_hyper_operation_original_method_missing, $b.$$p = block.$to_proc(), $b).apply($e, [name].concat(Opal.to_a(args))) }; return ($b = const$).$send.apply($b, ["run"].concat(Opal.to_a(args))); }, TMP_5.$$arity = -2), nil) && 'method_missing'; })($scope.base, null); }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/transport/client_drivers"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$[]', '$opts', '$==', '$each', '$is_a?', '$connect_to', '$name', '$id', '$class', '$raise', '$new', '$+', '$to_s', '$<<', '$open_channels', '$add_connection', '$gsub', '$lambda', '$get_queued_data', '$then', '$action_cable_consumer', '$json', '$sync_dispatch', '$parse', '$post', '$polling_path', '$get', '$include', '$dispatch_from_server', '$constantize', '$!=', '$attr_reader', '$on_opal_client?', '$[]=', '$connect', '$every']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4; (function($base, $super) { function $Application(){}; var self = $Application = $klass($base, $super, 'Application', $Application); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defs(self, '$acting_user_id', TMP_1 = function $$acting_user_id() { var self = this; return $scope.get('ClientDrivers').$opts()['$[]']("acting_user_id"); }, TMP_1.$$arity = 0), nil) && 'acting_user_id' })($scope.base, null); if ($scope.get('RUBY_ENGINE')['$==']("opal")) { Opal.defs(self, '$connect', TMP_3 = function $$connect($a_rest) { var $b, $c, TMP_2, self = this, channels; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } channels = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { channels[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = channels).$each, $b.$$p = (TMP_2 = function(channel){var self = TMP_2.$$s || this, $a, $d; if (channel == null) channel = nil; if ((($a = channel['$is_a?']($scope.get('Class'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $scope.get('IncomingBroadcast').$connect_to(channel.$name()) } else if ((($a = ((($d = channel['$is_a?']($scope.get('String'))) !== false && $d !== nil && $d != null) ? $d : channel['$is_a?']($scope.get('Array')))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = $scope.get('IncomingBroadcast')).$connect_to.apply($a, Opal.to_a(channel)) } else if ((($d = channel.$id()) !== nil && $d != null && (!$d.$$is_boolean || $d == true))) { return $scope.get('IncomingBroadcast').$connect_to(channel.$class().$name(), channel.$id()) } else { return self.$raise("cannot connect to model before it has been saved") }}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $b).call($c); }, TMP_3.$$arity = -1); Opal.defs(self, '$action_cable_consumer', TMP_4 = function $$action_cable_consumer() { var self = this; return $scope.get('ClientDrivers').$opts()['$[]']("action_cable_consumer"); }, TMP_4.$$arity = 0); (function($base, $super) { function $IncomingBroadcast(){}; var self = $IncomingBroadcast = $klass($base, $super, 'IncomingBroadcast', $IncomingBroadcast); var def = self.$$proto, $scope = self.$$scope, TMP_5, TMP_6, TMP_9; Opal.defs(self, '$open_channels', TMP_5 = function $$open_channels() { var $a, self = this; if (self.open_channels == null) self.open_channels = nil; return ((($a = self.open_channels) !== false && $a !== nil && $a != null) ? $a : self.open_channels = $scope.get('Set').$new()); }, TMP_5.$$arity = 0); Opal.defs(self, '$add_connection', TMP_6 = function $$add_connection(channel_name, id) { var self = this, channel_string = nil; if (id == null) { id = nil; } channel_string = "" + (channel_name) + ((function() {if (id !== false && id !== nil && id != null) { return $rb_plus("-", id.$to_s()) } else { return nil }; return nil; })()); self.$open_channels()['$<<'](channel_string); return channel_string; }, TMP_6.$$arity = -2); return (Opal.defs(self, '$connect_to', TMP_9 = function $$connect_to(channel_name, id) { var $a, $b, TMP_7, $c, TMP_8, self = this, channel_string = nil, channel = nil; if (id == null) { id = nil; } channel_string = self.$add_connection(channel_name, id); if ($scope.get('ClientDrivers').$opts()['$[]']("transport")['$==']("pusher")) { channel = "" + ($scope.get('ClientDrivers').$opts()['$[]']("channel")) + "-" + (channel_string); var channel = $scope.get('ClientDrivers').$opts()['$[]']("pusher_api").subscribe(channel.$gsub("::", "==")); channel.bind('dispatch', $scope.get('ClientDrivers').$opts()['$[]']("dispatch")) channel.bind('pusher:subscription_succeeded', ($a = ($b = self).$lambda, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this; return $scope.get('ClientDrivers').$get_queued_data("connect-to-transport", channel_string)}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $a).call($b)) ; } else if ($scope.get('ClientDrivers').$opts()['$[]']("transport")['$==']("action_cable")) { channel = "" + ($scope.get('ClientDrivers').$opts()['$[]']("channel")) + "-" + (channel_string); return ($a = ($c = $scope.get('HTTP').$post($scope.get('ClientDrivers').$polling_path("action-cable-auth", channel))).$then, $a.$$p = (TMP_8 = function(response){var self = TMP_8.$$s || this; if (response == null) response = nil; $scope.get('Hyperloop').$action_cable_consumer().subscriptions.create( { channel: "Hyperloop::ActionCableChannel", client_id: $scope.get('ClientDrivers').$opts()['$[]']("id"), hyperloop_channel: channel_string, authorization: response.$json()['$[]']("authorization"), salt: response.$json()['$[]']("salt") }, { connected: function() { $scope.get('ClientDrivers').$get_queued_data("connect-to-transport", channel_string) }, received: function(data) { $scope.get('ClientDrivers').$sync_dispatch($scope.get('JSON').$parse(JSON.stringify(data))['$[]']("data")) } } ) ;}, TMP_8.$$s = self, TMP_8.$$arity = 1, TMP_8), $a).call($c); } else { return $scope.get('HTTP').$get($scope.get('ClientDrivers').$polling_path("subscribe", channel_string)) }; }, TMP_9.$$arity = -2), nil) && 'connect_to'; })($scope.base, null);}; (function($base, $super) { function $ClientDrivers(){}; var self = $ClientDrivers = $klass($base, $super, 'ClientDrivers', $ClientDrivers); var def = self.$$proto, $scope = self.$$scope, TMP_10, $a, TMP_13, TMP_17, TMP_18; self.$include((($scope.get('React')).$$scope.get('IsomorphicHelpers'))); Opal.defs(self, '$sync_dispatch', TMP_10 = function $$sync_dispatch(data) { var self = this; return data['$[]']("operation").$constantize().$dispatch_from_server(data['$[]']("params")); }, TMP_10.$$arity = 1); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {}; (function(self) { var $scope = self.$$scope, def = self.$$proto; return self.$attr_reader("opts") })(Opal.get_singleton_class(self)); Opal.defs(self, '$get_queued_data', TMP_13 = function $$get_queued_data(operation, channel, opts) { var $a, $b, TMP_11, self = this; if (channel == null) { channel = nil; } if (opts == null) { opts = $hash2([], {}); } return ($a = ($b = $scope.get('HTTP').$get(self.$polling_path(operation, channel), opts)).$then, $a.$$p = (TMP_11 = function(response){var self = TMP_11.$$s || this, $c, $d, TMP_12; if (response == null) response = nil; return ($c = ($d = response.$json()).$each, $c.$$p = (TMP_12 = function(data){var self = TMP_12.$$s || this; if (data == null) data = nil; return self.$sync_dispatch(data['$[]'](1))}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $c).call($d)}, TMP_11.$$s = self, TMP_11.$$arity = 1, TMP_11), $a).call($b); }, TMP_13.$$arity = -2); Opal.defs(self, '$initialize_client_drivers_on_boot', TMP_17 = function $$initialize_client_drivers_on_boot() { var $a, $b, TMP_14, $c, $d, $e, TMP_15, $f, TMP_16, self = this, h = nil, pusher_api = nil; if ($scope.get('RUBY_ENGINE')['$==']("opal")) { self.opts = $scope.get('Hash').$new(window.HyperloopOpts)}; if ((($a = self['$on_opal_client?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if (self.$opts()['$[]']("transport")['$==']("pusher")) { self.$opts()['$[]=']("dispatch", ($a = ($b = self).$lambda, $a.$$p = (TMP_14 = function(data){var self = TMP_14.$$s || this; if (data == null) data = nil; return self.$sync_dispatch($scope.get('JSON').$parse(JSON.stringify(data)))}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b)); if ((($a = ($c = self.$opts()['$[]']("client_logging"), $c !== false && $c !== nil && $c != null ?window.console && window.console.log : $c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { Pusher.log = function(message) {window.console.log(message);}}; if ((($a = self.$opts()['$[]']("pusher_fake_js")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$opts()['$[]=']("pusher_api", eval(self.$opts()['$[]']("pusher_fake_js"))) } else { h = nil; pusher_api = nil; h = { encrypted: self.$opts()['$[]']("encrypted"), authEndpoint: window.HyperloopEnginePath+'/hyperloop-pusher-auth', auth: {headers: {'X-CSRF-Token': self.$opts()['$[]']("form_authenticity_token")}} }; pusher_api = new Pusher(self.$opts()['$[]']("key"), h) ; self.$opts()['$[]=']("pusher_api", pusher_api); }; return ($a = $scope.get('Hyperloop')).$connect.apply($a, Opal.to_a(self.$opts()['$[]']("auto_connect"))); } else if (self.$opts()['$[]']("transport")['$==']("action_cable")) { self.$opts()['$[]=']("action_cable_consumer", ActionCable.createConsumer.apply(ActionCable, [].concat(Opal.to_a(self.$opts()['$[]']("action_cable_consumer_url"))))); return ($c = $scope.get('Hyperloop')).$connect.apply($c, Opal.to_a(self.$opts()['$[]']("auto_connect"))); } else if (self.$opts()['$[]']("transport")['$==']("simple_poller")) { ($d = ($e = self.$opts()['$[]']("auto_connect")).$each, $d.$$p = (TMP_15 = function(channel){var self = TMP_15.$$s || this, $f; if (channel == null) channel = nil; return ($f = $scope.get('IncomingBroadcast')).$add_connection.apply($f, Opal.to_a(channel))}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $d).call($e); return ($d = ($f = self).$every, $d.$$p = (TMP_16 = function(){var self = TMP_16.$$s || this; return self.$get_queued_data("read", nil, $hash2(["headers"], {"headers": $hash2(["X-HYPERLOOP-SILENT-REQUEST"], {"X-HYPERLOOP-SILENT-REQUEST": true})}))}, TMP_16.$$s = self, TMP_16.$$arity = 0, TMP_16), $d).call($f, self.$opts()['$[]']("seconds_between_poll")); } else { return nil } } else { return nil }; }, TMP_17.$$arity = 0); return (Opal.defs(self, '$polling_path', TMP_18 = function $$polling_path(to, id) { var self = this, s = nil; if (id == null) { id = nil; } s = "" + (window.HyperloopEnginePath) + "/hyperloop-" + (to) + "/" + (self.$opts()['$[]']("id")); if (id !== false && id !== nil && id != null) { s = "" + (s) + "/" + (id)}; return s; }, TMP_18.$$arity = -2), nil) && 'polling_path'; })($scope.base, null); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/exception"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $AccessViolation(){}; var self = $AccessViolation = $klass($base, $super, 'AccessViolation', $AccessViolation); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$message', TMP_1 = function $$message() { var $a, $b, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_1.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return "Hyperloop::Operation::AccessViolation: " + (($a = ($b = self, Opal.find_super_dispatcher(self, 'message', TMP_1, false)), $a.$$p = $iter, $a).apply($b, $zuper)); }, TMP_1.$$arity = 0), nil) && 'message' })($scope.base, $scope.get('StandardError')); (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $ValidationException(){}; var self = $ValidationException = $klass($base, $super, 'ValidationException', $ValidationException); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, (($scope.get('Mutations')).$$scope.get('ValidationException'))) })($scope.base, null); })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/promise"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } function $rb_le(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs); } function $rb_minus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs - rhs : lhs['$-'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$resolve', '$new', '$reject', '$attr_reader', '$===', '$value', '$has_key?', '$keys', '$!', '$==', '$realized?', '$<<', '$>>', '$exception?', '$[]', '$resolved?', '$rejected?', '$error', '$include?', '$action', '$raise', '$^', '$call', '$resolve!', '$exception!', '$any?', '$each', '$reject!', '$there_can_be_only_one!', '$then', '$to_proc', '$fail', '$always', '$trace', '$class', '$object_id', '$+', '$inspect', '$act?', '$nil?', '$prev', '$push', '$concat', '$it', '$proc', '$reverse', '$pop', '$<=', '$length', '$shift', '$-', '$wait', '$map', '$reduce', '$try', '$tap', '$all?', '$find']); return (function($base, $super) { function $Promise(){}; var self = $Promise = $klass($base, $super, 'Promise', $Promise); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_18, TMP_19, TMP_21, TMP_22, TMP_23, TMP_24, TMP_25, TMP_26, TMP_27, TMP_28, TMP_29, TMP_30, TMP_31, TMP_32; def.value = def.action = def.exception = def.realized = def.next = def.delayed = def.error = def.prev = nil; Opal.defs(self, '$value', TMP_1 = function $$value(value) { var self = this; return self.$new().$resolve(value); }, TMP_1.$$arity = 1); Opal.defs(self, '$error', TMP_2 = function $$error(value) { var self = this; return self.$new().$reject(value); }, TMP_2.$$arity = 1); Opal.defs(self, '$when', TMP_3 = function $$when($a_rest) { var self = this, promises; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } promises = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { promises[$arg_idx - 0] = arguments[$arg_idx]; } return $scope.get('When').$new(promises); }, TMP_3.$$arity = -1); self.$attr_reader("error", "prev", "next"); Opal.defn(self, '$initialize', TMP_4 = function $$initialize(action) { var self = this; if (action == null) { action = $hash2([], {}); } self.action = action; self.realized = false; self.exception = false; self.value = nil; self.error = nil; self.delayed = false; self.prev = nil; return self.next = []; }, TMP_4.$$arity = -1); Opal.defn(self, '$value', TMP_5 = function $$value() { var $a, self = this; if ((($a = $scope.get('Promise')['$==='](self.value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.value.$value() } else { return self.value }; }, TMP_5.$$arity = 0); Opal.defn(self, '$act?', TMP_6 = function() { var $a, self = this; return ((($a = self.action['$has_key?']("success")) !== false && $a !== nil && $a != null) ? $a : self.action['$has_key?']("always")); }, TMP_6.$$arity = 0); Opal.defn(self, '$action', TMP_7 = function $$action() { var self = this; return self.action.$keys(); }, TMP_7.$$arity = 0); Opal.defn(self, '$exception?', TMP_8 = function() { var self = this; return self.exception; }, TMP_8.$$arity = 0); Opal.defn(self, '$realized?', TMP_9 = function() { var self = this; return self.realized['$!']()['$!'](); }, TMP_9.$$arity = 0); Opal.defn(self, '$resolved?', TMP_10 = function() { var self = this; return self.realized['$==']("resolve"); }, TMP_10.$$arity = 0); Opal.defn(self, '$rejected?', TMP_11 = function() { var self = this; return self.realized['$==']("reject"); }, TMP_11.$$arity = 0); Opal.defn(self, '$pending?', TMP_12 = function() { var self = this; return self['$realized?']()['$!'](); }, TMP_12.$$arity = 0); Opal.defn(self, '$^', TMP_13 = function(promise) { var self = this; promise['$<<'](self); self['$>>'](promise); return promise; }, TMP_13.$$arity = 1); Opal.defn(self, '$<<', TMP_14 = function(promise) { var self = this; self.prev = promise; return self; }, TMP_14.$$arity = 1); Opal.defn(self, '$>>', TMP_15 = function(promise) { var $a, $b, $c, self = this; self.next['$<<'](promise); if ((($a = self['$exception?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$reject(self.delayed['$[]'](0)) } else if ((($a = self['$resolved?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$resolve((function() {if ((($a = self.delayed) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.delayed['$[]'](0) } else { return self.$value() }; return nil; })()) } else if ((($a = self['$rejected?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = ((($b = self.action['$has_key?']("failure")['$!']()) !== false && $b !== nil && $b != null) ? $b : $scope.get('Promise')['$==='](((function() {if ((($c = self.delayed) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.delayed['$[]'](0) } else { return self.error }; return nil; })())))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$reject((function() {if ((($a = self.delayed) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.delayed['$[]'](0) } else { return self.$error() }; return nil; })()) } else if ((($a = promise.$action()['$include?']("always")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise.$reject((function() {if ((($a = self.delayed) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.delayed['$[]'](0) } else { return self.$error() }; return nil; })())}}; return self; }, TMP_15.$$arity = 1); Opal.defn(self, '$resolve', TMP_16 = function $$resolve(value) { var $a, $b, self = this, block = nil, e = nil; if (value == null) { value = nil; } if ((($a = self['$realized?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "the promise has already been realized")}; if ((($a = $scope.get('Promise')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (value['$<<'](self.prev))['$^'](self)}; try { if ((($a = block = ((($b = self.action['$[]']("success")) !== false && $b !== nil && $b != null) ? $b : self.action['$[]']("always"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = block.$call(value)}; self['$resolve!'](value); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { self['$exception!'](e) } finally { Opal.pop_exception() } } else { throw $err; } }; return self; }, TMP_16.$$arity = -1); Opal.defn(self, '$resolve!', TMP_18 = function(value) { var $a, $b, TMP_17, self = this; self.realized = "resolve"; self.value = value; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.next).$each, $a.$$p = (TMP_17 = function(p){var self = TMP_17.$$s || this; if (p == null) p = nil; return p.$resolve(value)}, TMP_17.$$s = self, TMP_17.$$arity = 1, TMP_17), $a).call($b) } else { return self.delayed = [value] }; }, TMP_18.$$arity = 1); Opal.defn(self, '$reject', TMP_19 = function $$reject(value) { var $a, $b, self = this, block = nil, e = nil; if (value == null) { value = nil; } if ((($a = self['$realized?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise($scope.get('ArgumentError'), "the promise has already been realized")}; if ((($a = $scope.get('Promise')['$==='](value)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return (value['$<<'](self.prev))['$^'](self)}; try { if ((($a = block = ((($b = self.action['$[]']("failure")) !== false && $b !== nil && $b != null) ? $b : self.action['$[]']("always"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { value = block.$call(value)}; if ((($a = self.action['$has_key?']("always")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self['$resolve!'](value) } else { self['$reject!'](value) }; } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { self['$exception!'](e) } finally { Opal.pop_exception() } } else { throw $err; } }; return self; }, TMP_19.$$arity = -1); Opal.defn(self, '$reject!', TMP_21 = function(value) { var $a, $b, TMP_20, self = this; self.realized = "reject"; self.error = value; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = self.next).$each, $a.$$p = (TMP_20 = function(p){var self = TMP_20.$$s || this; if (p == null) p = nil; return p.$reject(value)}, TMP_20.$$s = self, TMP_20.$$arity = 1, TMP_20), $a).call($b) } else { return self.delayed = [value] }; }, TMP_21.$$arity = 1); Opal.defn(self, '$exception!', TMP_22 = function(error) { var self = this; self.exception = true; return self['$reject!'](error); }, TMP_22.$$arity = 1); Opal.defn(self, '$then', TMP_23 = function $$then() { var self = this, $iter = TMP_23.$$p, block = $iter || nil; TMP_23.$$p = null; return self['$^']($scope.get('Promise').$new($hash2(["success"], {"success": block}))); }, TMP_23.$$arity = 0); Opal.defn(self, '$then!', TMP_24 = function() { var $a, $b, self = this, $iter = TMP_24.$$p, block = $iter || nil; TMP_24.$$p = null; self['$there_can_be_only_one!'](); return ($a = ($b = self).$then, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_24.$$arity = 0); Opal.alias(self, 'do', 'then'); Opal.alias(self, 'do!', 'then!'); Opal.defn(self, '$fail', TMP_25 = function $$fail() { var self = this, $iter = TMP_25.$$p, block = $iter || nil; TMP_25.$$p = null; return self['$^']($scope.get('Promise').$new($hash2(["failure"], {"failure": block}))); }, TMP_25.$$arity = 0); Opal.defn(self, '$fail!', TMP_26 = function() { var $a, $b, self = this, $iter = TMP_26.$$p, block = $iter || nil; TMP_26.$$p = null; self['$there_can_be_only_one!'](); return ($a = ($b = self).$fail, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_26.$$arity = 0); Opal.alias(self, 'rescue', 'fail'); Opal.alias(self, 'catch', 'fail'); Opal.alias(self, 'rescue!', 'fail!'); Opal.alias(self, 'catch!', 'fail!'); Opal.defn(self, '$always', TMP_27 = function $$always() { var self = this, $iter = TMP_27.$$p, block = $iter || nil; TMP_27.$$p = null; return self['$^']($scope.get('Promise').$new($hash2(["always"], {"always": block}))); }, TMP_27.$$arity = 0); Opal.defn(self, '$always!', TMP_28 = function() { var $a, $b, self = this, $iter = TMP_28.$$p, block = $iter || nil; TMP_28.$$p = null; self['$there_can_be_only_one!'](); return ($a = ($b = self).$always, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_28.$$arity = 0); Opal.alias(self, 'finally', 'always'); Opal.alias(self, 'ensure', 'always'); Opal.alias(self, 'finally!', 'always!'); Opal.alias(self, 'ensure!', 'always!'); Opal.defn(self, '$trace', TMP_29 = function $$trace(depth) { var self = this, $iter = TMP_29.$$p, block = $iter || nil; if (depth == null) { depth = nil; } TMP_29.$$p = null; return self['$^']($scope.get('Trace').$new(depth, block)); }, TMP_29.$$arity = -1); Opal.defn(self, '$trace!', TMP_30 = function($a_rest) { var $b, $c, self = this, args, $iter = TMP_30.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_30.$$p = null; self['$there_can_be_only_one!'](); return ($b = ($c = self).$trace, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_30.$$arity = -1); Opal.defn(self, '$there_can_be_only_one!', TMP_31 = function() { var $a, self = this; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$raise($scope.get('ArgumentError'), "a promise has already been chained") } else { return nil }; }, TMP_31.$$arity = 0); Opal.defn(self, '$inspect', TMP_32 = function $$inspect() { var $a, self = this, result = nil; result = "#<" + (self.$class()) + "(" + (self.$object_id()) + ")"; if ((($a = self.next['$any?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, " >> " + (self.next.$inspect()))}; if ((($a = self['$realized?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { result = $rb_plus(result, ": " + ((((($a = self.value) !== false && $a !== nil && $a != null) ? $a : self.error)).$inspect()) + ">") } else { result = $rb_plus(result, ">") }; return result; }, TMP_32.$$arity = 0); (function($base, $super) { function $Trace(){}; var self = $Trace = $klass($base, $super, 'Trace', $Trace); var def = self.$$proto, $scope = self.$$scope, TMP_33, TMP_34; Opal.defs(self, '$it', TMP_33 = function $$it(promise) { var $a, $b, self = this, current = nil, prev = nil; current = []; if ((($a = ((($b = promise['$act?']()) !== false && $b !== nil && $b != null) ? $b : promise.$prev()['$nil?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { current.$push(promise.$value())}; if ((($a = prev = promise.$prev()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return current.$concat(self.$it(prev)) } else { return current }; }, TMP_33.$$arity = 1); return (Opal.defn(self, '$initialize', TMP_34 = function $$initialize(depth, block) { var $a, $b, $c, $d, TMP_35, self = this, $iter = TMP_34.$$p, $yield = $iter || nil; TMP_34.$$p = null; self.depth = depth; return ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_34, false)), $a.$$p = null, $a).call($b, $hash2(["success"], {"success": ($c = ($d = self).$proc, $c.$$p = (TMP_35 = function(){var self = TMP_35.$$s || this, $e, $f, trace = nil; trace = $scope.get('Trace').$it(self).$reverse(); trace.$pop(); if ((($e = (($f = depth !== false && depth !== nil && depth != null) ? $rb_le(depth, trace.$length()) : depth)) !== nil && $e != null && (!$e.$$is_boolean || $e == true))) { trace.$shift($rb_minus(trace.$length(), depth))}; return ($e = block).$call.apply($e, Opal.to_a(trace));}, TMP_35.$$s = self, TMP_35.$$arity = 0, TMP_35), $c).call($d)})); }, TMP_34.$$arity = 2), nil) && 'initialize'; })($scope.base, self); return (function($base, $super) { function $When(){}; var self = $When = $klass($base, $super, 'When', $When); var def = self.$$proto, $scope = self.$$scope, TMP_36, TMP_38, TMP_40, TMP_42, TMP_45, TMP_47, TMP_48; def.wait = nil; Opal.defn(self, '$initialize', TMP_36 = function $$initialize(promises) { var $a, $b, $c, TMP_37, self = this, $iter = TMP_36.$$p, $yield = $iter || nil; if (promises == null) { promises = []; } TMP_36.$$p = null; ($a = ($b = self, Opal.find_super_dispatcher(self, 'initialize', TMP_36, false)), $a.$$p = null, $a).call($b); self.wait = []; return ($a = ($c = promises).$each, $a.$$p = (TMP_37 = function(promise){var self = TMP_37.$$s || this; if (promise == null) promise = nil; return self.$wait(promise)}, TMP_37.$$s = self, TMP_37.$$arity = 1, TMP_37), $a).call($c); }, TMP_36.$$arity = -1); Opal.defn(self, '$each', TMP_38 = function $$each() { var $a, $b, TMP_39, self = this, $iter = TMP_38.$$p, block = $iter || nil; TMP_38.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block given") }; return ($a = ($b = self).$then, $a.$$p = (TMP_39 = function(values){var self = TMP_39.$$s || this, $c, $d; if (values == null) values = nil; return ($c = ($d = values).$each, $c.$$p = block.$to_proc(), $c).call($d)}, TMP_39.$$s = self, TMP_39.$$arity = 1, TMP_39), $a).call($b); }, TMP_38.$$arity = 0); Opal.defn(self, '$collect', TMP_40 = function $$collect() { var $a, $b, TMP_41, self = this, $iter = TMP_40.$$p, block = $iter || nil; TMP_40.$$p = null; if (block !== false && block !== nil && block != null) { } else { self.$raise($scope.get('ArgumentError'), "no block given") }; return ($a = ($b = self).$then, $a.$$p = (TMP_41 = function(values){var self = TMP_41.$$s || this, $c, $d; if (values == null) values = nil; return $scope.get('When').$new(($c = ($d = values).$map, $c.$$p = block.$to_proc(), $c).call($d))}, TMP_41.$$s = self, TMP_41.$$arity = 1, TMP_41), $a).call($b); }, TMP_40.$$arity = 0); Opal.defn(self, '$inject', TMP_42 = function $$inject($a_rest) { var $b, $c, TMP_43, self = this, args, $iter = TMP_42.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_42.$$p = null; return ($b = ($c = self).$then, $b.$$p = (TMP_43 = function(values){var self = TMP_43.$$s || this, $a, $d; if (values == null) values = nil; return ($a = ($d = values).$reduce, $a.$$p = block.$to_proc(), $a).apply($d, Opal.to_a(args))}, TMP_43.$$s = self, TMP_43.$$arity = 1, TMP_43), $b).call($c); }, TMP_42.$$arity = -1); Opal.alias(self, 'map', 'collect'); Opal.alias(self, 'reduce', 'inject'); Opal.defn(self, '$wait', TMP_45 = function $$wait(promise) { var $a, $b, TMP_44, self = this; if ((($a = $scope.get('Promise')['$==='](promise)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { promise = $scope.get('Promise').$value(promise) }; if ((($a = promise['$act?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { promise = promise.$then()}; self.wait['$<<'](promise); ($a = ($b = promise).$always, $a.$$p = (TMP_44 = function(){var self = TMP_44.$$s || this, $c; if (self.next == null) self.next = nil; if ((($c = self.next['$any?']()) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return self.$try() } else { return nil }}, TMP_44.$$s = self, TMP_44.$$arity = 0, TMP_44), $a).call($b); return self; }, TMP_45.$$arity = 1); Opal.alias(self, 'and', 'wait'); Opal.defn(self, '$>>', TMP_47 = function($a_rest) { var $b, $c, TMP_46, $d, $e, self = this, $iter = TMP_47.$$p, $yield = $iter || nil, $zuper = nil, $zuper_index = nil, $zuper_length = nil; TMP_47.$$p = null; $zuper = []; for($zuper_index = 0; $zuper_index < arguments.length; $zuper_index++) { $zuper[$zuper_index] = arguments[$zuper_index]; } return ($b = ($c = ($d = ($e = self, Opal.find_super_dispatcher(self, '>>', TMP_47, false)), $d.$$p = $iter, $d).apply($e, $zuper)).$tap, $b.$$p = (TMP_46 = function(){var self = TMP_46.$$s || this; return self.$try()}, TMP_46.$$s = self, TMP_46.$$arity = 0, TMP_46), $b).call($c); }, TMP_47.$$arity = -1); return (Opal.defn(self, '$try', TMP_48 = function() { var $a, $b, $c, $d, self = this, promise = nil; if ((($a = ($b = ($c = self.wait)['$all?'], $b.$$p = "realized?".$to_proc(), $b).call($c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { if ((($a = promise = ($b = ($d = self.wait).$find, $b.$$p = "rejected?".$to_proc(), $b).call($d)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$reject(promise.$error()) } else { return self.$resolve(($a = ($b = self.wait).$map, $a.$$p = "value".$to_proc(), $a).call($b)) } } else { return nil }; }, TMP_48.$$arity = 0), nil) && 'try'; })($scope.base, self); })($scope.base, null) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/railway"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/api"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $hash = Opal.hash; Opal.add_stubs(['$is_a?', '$raise', '$new', '$tap', '$split', '$to_s', '$pop', '$inject', '$to_sym', '$[]', '$[]=', '$!', '$nil?', '$abort!', '$succeed!', '$_Railway', '$class', '$_run', '$instance_eval', '$process_params', '$process_validations', '$run', '$dispatch', '$result', '$then', '$to_proc', '$fail', '$add_param', '$each', '$add_validation', '$add_error', '$add_step', '$add_failed', '$add_async', '$add_receiver', '$singleton_class', '$define_singleton_method', '$superclass', '$==', '$instance_variable_get', '$instance_variable_set', '$dup']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8; def.errors = def.params = nil; Opal.defn(self, '$add_error', TMP_3 = function $$add_error(key, kind, message) { var $a, $b, TMP_1, self = this; if (message == null) { message = nil; } if ((($a = kind['$is_a?']($scope.get('Symbol'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { self.$raise($scope.get('ArgumentError').$new("Invalid kind")) }; ((($a = self.errors) !== false && $a !== nil && $a != null) ? $a : self.errors = (($scope.get('Mutations')).$$scope.get('ErrorHash')).$new()); return ($a = ($b = self.errors).$tap, $a.$$p = (TMP_1 = function(errs){var self = TMP_1.$$s || this, $c, $d, TMP_2, path = nil, last = nil, inner = nil; if (errs == null) errs = nil; path = key.$to_s().$split("."); last = path.$pop(); inner = ($c = ($d = path).$inject, $c.$$p = (TMP_2 = function(cur_errors, part){var self = TMP_2.$$s || this, $e, $f, $g; if (cur_errors == null) cur_errors = nil;if (part == null) part = nil; return ($e = part.$to_sym(), $f = cur_errors, ((($g = $f['$[]']($e)) !== false && $g !== nil && $g != null) ? $g : $f['$[]=']($e, (($scope.get('Mutations')).$$scope.get('ErrorHash')).$new())))}, TMP_2.$$s = self, TMP_2.$$arity = 2, TMP_2), $c).call($d, errs); return inner['$[]='](last, (($scope.get('Mutations')).$$scope.get('ErrorAtom')).$new(key, kind, $hash2(["message"], {"message": message})));}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $a).call($b); }, TMP_3.$$arity = -3); Opal.defn(self, '$has_errors?', TMP_4 = function() { var self = this; return self.errors['$nil?']()['$!'](); }, TMP_4.$$arity = 0); Opal.defn(self, '$params', TMP_5 = function $$params() { var self = this; return self.params; }, TMP_5.$$arity = 0); Opal.defn(self, '$abort!', TMP_6 = function(arg) { var self = this; if (arg == null) { arg = nil; } return $scope.get('Railway')['$abort!'](arg); }, TMP_6.$$arity = -1); Opal.defn(self, '$succeed!', TMP_7 = function(arg) { var self = this; if (arg == null) { arg = nil; } return $scope.get('Railway')['$succeed!'](arg); }, TMP_7.$$arity = -1); Opal.defn(self, '$initialize', TMP_8 = function $$initialize() { var self = this; return self._railway = self.$class().$_Railway().$new(self); }, TMP_8.$$arity = 0); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_9, TMP_11, TMP_12, TMP_13, TMP_14, TMP_16, TMP_17, TMP_18, TMP_19, TMP_20, TMP_21, TMP_22, TMP_23, TMP_35; Opal.defn(self, '$run', TMP_9 = function $$run($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = self).$_run.apply($b, Opal.to_a(args)); }, TMP_9.$$arity = -1); Opal.defn(self, '$_run', TMP_11 = function $$_run($a_rest) { var $b, $c, TMP_10, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = self.$new()).$instance_eval, $b.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this; if (self._railway == null) self._railway = nil; self._railway.$process_params(args); self._railway.$process_validations(); self._railway.$run(); self._railway.$dispatch(); return self._railway.$result();}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $b).call($c); }, TMP_11.$$arity = -1); Opal.defn(self, '$then', TMP_12 = function $$then($a_rest) { var $b, $c, $d, self = this, args, $iter = TMP_12.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_12.$$p = null; return ($b = ($c = ($d = self).$run.apply($d, Opal.to_a(args))).$then, $b.$$p = block.$to_proc(), $b).call($c); }, TMP_12.$$arity = -1); Opal.defn(self, '$fail', TMP_13 = function $$fail($a_rest) { var $b, $c, $d, self = this, args, $iter = TMP_13.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_13.$$p = null; return ($b = ($c = ($d = self).$run.apply($d, Opal.to_a(args))).$fail, $b.$$p = block.$to_proc(), $b).call($c); }, TMP_13.$$arity = -1); Opal.defn(self, '$param', TMP_14 = function $$param($a_rest) { var $b, $c, self = this, args, $iter = TMP_14.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_14.$$p = null; return ($b = ($c = self.$_Railway()).$add_param, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_14.$$arity = -1); Opal.defn(self, '$outbound', TMP_16 = function $$outbound($a_rest) { var $b, $c, TMP_15, self = this, keys; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } keys = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { keys[$arg_idx - 0] = arguments[$arg_idx]; } return ($b = ($c = keys).$each, $b.$$p = (TMP_15 = function(key){var self = TMP_15.$$s || this; if (key == null) key = nil; return self.$_Railway().$add_param($hash(key, nil, "type", "outbound"))}, TMP_15.$$s = self, TMP_15.$$arity = 1, TMP_15), $b).call($c); }, TMP_16.$$arity = -1); Opal.defn(self, '$validate', TMP_17 = function $$validate($a_rest) { var $b, $c, self = this, args, $iter = TMP_17.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_17.$$p = null; return ($b = ($c = self.$_Railway()).$add_validation, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_17.$$arity = -1); Opal.defn(self, '$add_error', TMP_18 = function $$add_error(param, symbol, message, $a_rest) { var $b, $c, self = this, args, $iter = TMP_18.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 3; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 3; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 3] = arguments[$arg_idx]; } TMP_18.$$p = null; return ($b = ($c = self.$_Railway()).$add_error, $b.$$p = block.$to_proc(), $b).apply($c, [param, symbol, message].concat(Opal.to_a(args))); }, TMP_18.$$arity = -4); Opal.defn(self, '$step', TMP_19 = function $$step($a_rest) { var $b, $c, self = this, args, $iter = TMP_19.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_19.$$p = null; return ($b = ($c = self.$_Railway()).$add_step, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_19.$$arity = -1); Opal.defn(self, '$failed', TMP_20 = function $$failed($a_rest) { var $b, $c, self = this, args, $iter = TMP_20.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_20.$$p = null; return ($b = ($c = self.$_Railway()).$add_failed, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_20.$$arity = -1); Opal.defn(self, '$async', TMP_21 = function $$async($a_rest) { var $b, $c, self = this, args, $iter = TMP_21.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_21.$$p = null; return ($b = ($c = self.$_Railway()).$add_async, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_21.$$arity = -1); Opal.defn(self, '$on_dispatch', TMP_22 = function $$on_dispatch() { var $a, $b, self = this, $iter = TMP_22.$$p, block = $iter || nil; TMP_22.$$p = null; return ($a = ($b = self.$_Railway()).$add_receiver, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_22.$$arity = 0); Opal.defn(self, '$_Railway', TMP_23 = function $$_Railway() { var self = this; return self.$singleton_class().$_Railway(); }, TMP_23.$$arity = 0); return (Opal.defn(self, '$inherited', TMP_35 = function $$inherited(child) { var $a, $b, TMP_24, $c, TMP_25, $d, TMP_27, $e, TMP_28, $f, TMP_29, $g, TMP_30, $h, TMP_31, $i, TMP_32, self = this; ($a = ($b = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_24 = function($c_rest){var self = TMP_24.$$s || this, block, args, $d, $e; block = TMP_24.$$p || nil, TMP_24.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($d = ($e = self.$_Railway()).$add_param, $d.$$p = block.$to_proc(), $d).apply($e, Opal.to_a(args))}, TMP_24.$$s = self, TMP_24.$$arity = -1, TMP_24), $a).call($b, "param"); ($a = ($c = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_25 = function($d_rest){var self = TMP_25.$$s || this, keys, $e, $f, TMP_26; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } keys = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { keys[$arg_idx - 0] = arguments[$arg_idx]; } return ($e = ($f = keys).$each, $e.$$p = (TMP_26 = function(key){var self = TMP_26.$$s || this; if (key == null) key = nil; return self.$_Railway().$add_param($hash(key, nil, "type", "outbound"))}, TMP_26.$$s = self, TMP_26.$$arity = 1, TMP_26), $e).call($f)}, TMP_25.$$s = self, TMP_25.$$arity = -1, TMP_25), $a).call($c, "outbound"); ($a = ($d = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_27 = function($e_rest){var self = TMP_27.$$s || this, block, args, $f, $g; block = TMP_27.$$p || nil, TMP_27.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($f = ($g = self.$_Railway()).$add_validation, $f.$$p = block.$to_proc(), $f).apply($g, Opal.to_a(args))}, TMP_27.$$s = self, TMP_27.$$arity = -1, TMP_27), $a).call($d, "validate"); ($a = ($e = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_28 = function(param, symbol, message, $f_rest){var self = TMP_28.$$s || this, block, args, $g, $h; block = TMP_28.$$p || nil, TMP_28.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 3; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 3; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 3] = arguments[$arg_idx]; }if (param == null) param = nil;if (symbol == null) symbol = nil;if (message == null) message = nil; return ($g = ($h = self.$_Railway()).$add_error, $g.$$p = block.$to_proc(), $g).apply($h, [param, symbol, message].concat(Opal.to_a(args)))}, TMP_28.$$s = self, TMP_28.$$arity = -4, TMP_28), $a).call($e, "add_error"); ($a = ($f = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_29 = function($g_rest){var self = TMP_29.$$s || this, block, args, $h, $i; block = TMP_29.$$p || nil, TMP_29.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($h = ($i = self.$_Railway()).$add_step, $h.$$p = block.$to_proc(), $h).apply($i, [$hash2(["scope"], {"scope": "class"})].concat(Opal.to_a(args)))}, TMP_29.$$s = self, TMP_29.$$arity = -1, TMP_29), $a).call($f, "step"); ($a = ($g = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_30 = function($h_rest){var self = TMP_30.$$s || this, block, args, $i, $j; block = TMP_30.$$p || nil, TMP_30.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($i = ($j = self.$_Railway()).$add_failed, $i.$$p = block.$to_proc(), $i).apply($j, [$hash2(["scope"], {"scope": "class"})].concat(Opal.to_a(args)))}, TMP_30.$$s = self, TMP_30.$$arity = -1, TMP_30), $a).call($g, "failed"); ($a = ($h = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_31 = function($i_rest){var self = TMP_31.$$s || this, block, args, $j, $k; block = TMP_31.$$p || nil, TMP_31.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return ($j = ($k = self.$_Railway()).$add_async, $j.$$p = block.$to_proc(), $j).apply($k, [$hash2(["scope"], {"scope": "class"})].concat(Opal.to_a(args)))}, TMP_31.$$s = self, TMP_31.$$arity = -1, TMP_31), $a).call($h, "async"); return ($a = ($i = child.$singleton_class()).$define_singleton_method, $a.$$p = (TMP_32 = function(){var self = TMP_32.$$s || this, $j, $k, $l, TMP_33, my_super = nil; if (self._railway == null) self._railway = nil; return ((($j = self._railway) !== false && $j !== nil && $j != null) ? $j : self._railway = (function() {my_super = ((($k = self.$superclass()) !== false && $k !== nil && $k != null) ? $k : (self.$$singleton_of).$superclass().$singleton_class()); if (my_super['$==']($scope.get('Operation').$singleton_class())) { return $scope.get('Class').$new($scope.get('Railway')) } else { return ($k = ($l = $scope.get('Class').$new(my_super.$_Railway())).$tap, $k.$$p = (TMP_33 = function(wrapper){var self = TMP_33.$$s || this, $m, $n, TMP_34; if (wrapper == null) wrapper = nil; return ($m = ($n = ["@validations", "@tracks", "@receivers"]).$each, $m.$$p = (TMP_34 = function(var$){var self = TMP_34.$$s || this, $o, value = nil; if (var$ == null) var$ = nil; value = my_super.$_Railway().$instance_variable_get(var$); return wrapper.$instance_variable_set(var$, (($o = value !== false && value !== nil && value != null) ? value.$dup() : value));}, TMP_34.$$s = self, TMP_34.$$arity = 1, TMP_34), $m).call($n)}, TMP_33.$$s = self, TMP_33.$$arity = 1, TMP_33), $k).call($l) };})())}, TMP_32.$$s = self, TMP_32.$$arity = 0, TMP_32), $a).call($i, "_Railway"); }, TMP_35.$$arity = 1), nil) && 'inherited'; })(Opal.get_singleton_class(self)); return (function($base, $super) { function $Railway(){}; var self = $Railway = $klass($base, $super, 'Railway', $Railway); var def = self.$$proto, $scope = self.$$scope, TMP_36; return (Opal.defn(self, '$initialize', TMP_36 = function $$initialize(operation) { var self = this; return self.operation = operation; }, TMP_36.$$arity = 1), nil) && 'initialize' })($scope.base, null); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/railway/dispatcher"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$receivers', '$class', '$<<', '$then', '$each', '$call', '$dispatch_params', '$params_wrapper', '$params', '$result']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Railway(){}; var self = $Railway = $klass($base, $super, 'Railway', $Railway); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_6; Opal.defn(self, '$receivers', TMP_1 = function $$receivers() { var self = this; return self.$class().$receivers(); }, TMP_1.$$arity = 0); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_2, TMP_3; Opal.defn(self, '$receivers', TMP_2 = function $$receivers() { var $a, self = this; if (self.receivers == null) self.receivers = nil; return ((($a = self.receivers) !== false && $a !== nil && $a != null) ? $a : self.receivers = []); }, TMP_2.$$arity = 0); return (Opal.defn(self, '$add_receiver', TMP_3 = function $$add_receiver() { var self = this, $iter = TMP_3.$$p, block = $iter || nil; TMP_3.$$p = null; return self.$receivers()['$<<'](block); }, TMP_3.$$arity = 0), nil) && 'add_receiver'; })(Opal.get_singleton_class(self)); return (Opal.defn(self, '$dispatch', TMP_6 = function $$dispatch() { var $a, $b, TMP_4, self = this; return ($a = ($b = self.$result()).$then, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this, $c, $d, TMP_5; return ($c = ($d = self.$receivers()).$each, $c.$$p = (TMP_5 = function(receiver){var self = TMP_5.$$s || this; if (self.operation == null) self.operation = nil; if (receiver == null) receiver = nil; return receiver.$call(self.$class().$params_wrapper().$dispatch_params(self.operation.$params()), self.operation)}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $c).call($d)}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b); }, TMP_6.$$arity = 0), nil) && 'dispatch'; })($scope.base, null) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/railway/params_wrapper"] = function(Opal) { function $rb_gt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs > rhs : lhs['$>'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$with_indifferent_access', '$to_s', '$to_h', '$inject', '$respond_to?', '$raise', '$new', '$merge!', '$combine_arg_array', '$filter', '$hash_filter', '$instance_eval', '$translate_args', '$to_proc', '$key?', '$optional', '$send', '$required', '$define_method', '$[]', '$method_missing', '$[]=', '$dup', '$each', '$lock', '$get_name_and_opts', '$delete', '$is_a?', '$>', '$count', '$first', '$==', '$proc', '$duck', '$underscore', '$last', '$process_params', '$params_wrapper', '$class', '$add_param', '$superclass', '$tap', '$instance_variable_set']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ParamsWrapper(){}; var self = $ParamsWrapper = $klass($base, $super, 'ParamsWrapper', $ParamsWrapper); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_4; def.inputs = nil; Opal.defn(self, '$initialize', TMP_1 = function $$initialize(inputs) { var self = this; return self.inputs = inputs; }, TMP_1.$$arity = 1); Opal.defn(self, '$lock', TMP_2 = function $$lock() { var self = this; self.locked = true; return self; }, TMP_2.$$arity = 0); Opal.defn(self, '$to_h', TMP_3 = function $$to_h() { var self = this; return self.inputs.$with_indifferent_access(); }, TMP_3.$$arity = 0); Opal.defn(self, '$to_s', TMP_4 = function $$to_s() { var self = this; return self.$to_h().$to_s(); }, TMP_4.$$arity = 0); return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_6, TMP_8, TMP_9, TMP_16, TMP_17, TMP_18, TMP_21; Opal.defn(self, '$combine_arg_array', TMP_6 = function $$combine_arg_array(args) { var $a, $b, TMP_5, self = this, hash = nil; return hash = ($a = ($b = args).$inject, $a.$$p = (TMP_5 = function(h, arg){var self = TMP_5.$$s || this, $c; if (h == null) h = nil;if (arg == null) arg = nil; if ((($c = arg['$respond_to?']("to_h")) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { self.$raise($scope.get('ArgumentError').$new("All arguments must be hashes")) }; return h['$merge!'](arg.$to_h());}, TMP_5.$$s = self, TMP_5.$$arity = 2, TMP_5), $a).call($b, $hash2([], {}).$with_indifferent_access()); }, TMP_6.$$arity = 1); Opal.defn(self, '$process_params', TMP_8 = function $$process_params(operation, args) { var $a, $b, TMP_7, self = this, raw_inputs = nil, inputs = nil, errors = nil, params_wrapper = nil; raw_inputs = self.$combine_arg_array(args); $b = self.$hash_filter().$filter(raw_inputs), $a = Opal.to_ary($b), inputs = ($a[0] == null ? nil : $a[0]), errors = ($a[1] == null ? nil : $a[1]), $b; params_wrapper = self.$new(inputs); return ($a = ($b = operation).$instance_eval, $a.$$p = (TMP_7 = function(){var self = TMP_7.$$s || this, $c, $d; return $d = [raw_inputs, params_wrapper, errors], $c = Opal.to_ary($d), self.raw_inputs = ($c[0] == null ? nil : $c[0]), self.params = ($c[1] == null ? nil : $c[1]), self.errors = ($c[2] == null ? nil : $c[2]), $d}, TMP_7.$$s = self, TMP_7.$$arity = 0, TMP_7), $a).call($b); }, TMP_8.$$arity = 2); Opal.defn(self, '$add_param', TMP_9 = function $$add_param($a_rest) { var $b, $c, $d, $e, TMP_10, TMP_11, $f, TMP_12, $g, TMP_13, self = this, args, $iter = TMP_9.$$p, block = $iter || nil, type_method = nil, name = nil, opts = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_9.$$p = null; $c = ($d = ($e = self).$translate_args, $d.$$p = block.$to_proc(), $d).apply($e, Opal.to_a(args)), $b = Opal.to_ary($c), type_method = ($b[0] == null ? nil : $b[0]), name = ($b[1] == null ? nil : $b[1]), opts = ($b[2] == null ? nil : $b[2]), block = ($b[3] == null ? nil : $b[3]), $c; if ((($b = opts['$key?']("default")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { ($b = ($c = self.$hash_filter()).$optional, $b.$$p = (TMP_10 = function(){var self = TMP_10.$$s || this, $a, $f; return ($a = ($f = self).$send, $a.$$p = block.$to_proc(), $a).call($f, type_method, name, opts)}, TMP_10.$$s = self, TMP_10.$$arity = 0, TMP_10), $b).call($c) } else { ($b = ($d = self.$hash_filter()).$required, $b.$$p = (TMP_11 = function(){var self = TMP_11.$$s || this, $a, $f; return ($a = ($f = self).$send, $a.$$p = block.$to_proc(), $a).call($f, type_method, name, opts)}, TMP_11.$$s = self, TMP_11.$$arity = 0, TMP_11), $b).call($d) }; ($b = ($f = self).$define_method, $b.$$p = (TMP_12 = function(){var self = TMP_12.$$s || this; if (self.inputs == null) self.inputs = nil; return self.inputs['$[]'](name)}, TMP_12.$$s = self, TMP_12.$$arity = 0, TMP_12), $b).call($f, name); return ($b = ($g = self).$define_method, $b.$$p = (TMP_13 = function(x){var self = TMP_13.$$s || this, $a; if (self.locked == null) self.locked = nil; if (self.inputs == null) self.inputs = nil; if (x == null) x = nil; if ((($a = self.locked) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$method_missing(("" + name.$to_s() + "="), x)}; return self.inputs['$[]='](name, x);}, TMP_13.$$s = self, TMP_13.$$arity = 1, TMP_13), $b).call($g, ("" + name.$to_s() + "=")); }, TMP_9.$$arity = -1); Opal.defn(self, '$dispatch_params', TMP_16 = function $$dispatch_params(params, hashes) { var $a, $b, TMP_14, self = this; if (hashes == null) { hashes = $hash2([], {}); } params = params.$dup(); ($a = ($b = hashes).$each, $a.$$p = (TMP_14 = function(hash){var self = TMP_14.$$s || this, $c, $d, TMP_15; if (hash == null) hash = nil; return ($c = ($d = hash).$each, $c.$$p = (TMP_15 = function(k, v){var self = TMP_15.$$s || this; if (k == null) k = nil;if (v == null) v = nil; return params.$send(("" + k.$to_s() + "="), v)}, TMP_15.$$s = self, TMP_15.$$arity = 2, TMP_15), $c).call($d)}, TMP_14.$$s = self, TMP_14.$$arity = 1, TMP_14), $a).call($b); return params.$lock(); }, TMP_16.$$arity = -2); Opal.defn(self, '$hash_filter', TMP_17 = function $$hash_filter() { var $a, self = this; if (self.hash_filter == null) self.hash_filter = nil; return ((($a = self.hash_filter) !== false && $a !== nil && $a != null) ? $a : self.hash_filter = (($scope.get('Mutations')).$$scope.get('HashFilter')).$new()); }, TMP_17.$$arity = 0); Opal.defn(self, '$translate_args', TMP_18 = function $$translate_args($a_rest) { var $b, $c, $d, $e, TMP_19, $f, TMP_20, self = this, args, $iter = TMP_18.$$p, block = $iter || nil, name = nil, opts = nil, type_method = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_18.$$p = null; $c = ($d = self).$get_name_and_opts.apply($d, Opal.to_a(args)), $b = Opal.to_ary($c), name = ($b[0] == null ? nil : $b[0]), opts = ($b[1] == null ? nil : $b[1]), $c; if ((($b = opts['$key?']("type")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { type_method = opts.$delete("type"); if ((($b = type_method['$is_a?']($scope.get('Array'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { if ((($b = $rb_gt(type_method.$count(), 0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { opts['$[]=']("class", type_method.$first())}; type_method = $scope.get('Array'); } else if ((($b = ((($c = type_method['$is_a?']($scope.get('Hash'))) !== false && $c !== nil && $c != null) ? $c : type_method['$==']($scope.get('Hash')))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { type_method = $scope.get('Hash'); ((($b = block) !== false && $b !== nil && $b != null) ? $b : block = ($c = ($e = self).$proc, $c.$$p = (TMP_19 = function(){var self = TMP_19.$$s || this; return self.$duck("*")}, TMP_19.$$s = self, TMP_19.$$arity = 0, TMP_19), $c).call($e));}; type_method = type_method.$to_s().$underscore(); } else { type_method = "duck" }; return [type_method, name, opts, ((($b = block) !== false && $b !== nil && $b != null) ? $b : ($c = ($f = self).$proc, $c.$$p = (TMP_20 = function(){var self = TMP_20.$$s || this; return nil}, TMP_20.$$s = self, TMP_20.$$arity = 0, TMP_20), $c).call($f))]; }, TMP_18.$$arity = -1); return (Opal.defn(self, '$get_name_and_opts', TMP_21 = function $$get_name_and_opts($a_rest) { var $b, self = this, args, opts = nil, name = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } if ((($b = args['$[]'](0)['$is_a?']($scope.get('Hash'))) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { opts = args['$[]'](0); name = opts.$first().$first(); opts['$[]=']("default", opts.$first().$last()); opts.$delete(name); } else { name = args['$[]'](0); opts = ((($b = args['$[]'](1)) !== false && $b !== nil && $b != null) ? $b : $hash2([], {})); }; return [name, opts]; }, TMP_21.$$arity = -1), nil) && 'get_name_and_opts'; })(Opal.get_singleton_class(self)); })($scope.base, null); return (function($base, $super) { function $Railway(){}; var self = $Railway = $klass($base, $super, 'Railway', $Railway); var def = self.$$proto, $scope = self.$$scope, TMP_22, TMP_23, TMP_25; def.operation = nil; Opal.defn(self, '$process_params', TMP_22 = function $$process_params(args) { var self = this; return self.$class().$params_wrapper().$process_params(self.operation, args); }, TMP_22.$$arity = 1); Opal.defs(self, '$add_param', TMP_23 = function $$add_param($a_rest) { var $b, $c, self = this, args, $iter = TMP_23.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_23.$$p = null; return ($b = ($c = self.$params_wrapper()).$add_param, $b.$$p = block.$to_proc(), $b).apply($c, Opal.to_a(args)); }, TMP_23.$$arity = -1); return (Opal.defs(self, '$params_wrapper', TMP_25 = function $$params_wrapper() { var $a, $b, $c, TMP_24, self = this; if (self.params_wrapper == null) self.params_wrapper = nil; return ((($a = self.params_wrapper) !== false && $a !== nil && $a != null) ? $a : self.params_wrapper = (function() {if ($scope.get('Railway')['$=='](self.$superclass())) { return $scope.get('Class').$new($scope.get('ParamsWrapper')) } else { return ($b = ($c = $scope.get('Class').$new(self.$superclass().$params_wrapper())).$tap, $b.$$p = (TMP_24 = function(wrapper){var self = TMP_24.$$s || this, $d, hash_filter = nil; if (wrapper == null) wrapper = nil; hash_filter = self.$superclass().$params_wrapper().$hash_filter(); return wrapper.$instance_variable_set("@hash_filter", (($d = hash_filter !== false && hash_filter !== nil && hash_filter != null) ? hash_filter.$dup() : hash_filter));}, TMP_24.$$s = self, TMP_24.$$arity = 1, TMP_24), $b).call($c) }; return nil; })()); }, TMP_25.$$arity = 0), nil) && 'params_wrapper'; })($scope.base, null); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/railway/run"] = function(Opal) { function $rb_lt(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs < rhs : lhs['$<'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$attr_reader', '$tracks', '$class', '$merge', '$zero?', '$count', '$is_a?', '$[]', '$==', '$<', '$proc', '$run', '$params', '$instance_method', '$each', '$define_method', '$<<', '$to_opts', '$to_s', '$raise', '$new', '$then', '$apply', '$fail', '$!=', '$method', '$arity', '$instance_exec', '$to_proc', '$rejected?', '$error', '$resolved?', '$value', '$state', '$result', '$has_errors?', '$instance_variable_get', '$call', '$bind', '$resolve', '$reject']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Exit(){}; var self = $Exit = $klass($base, $super, 'Exit', $Exit); var def = self.$$proto, $scope = self.$$scope, TMP_1; self.$attr_reader("state"); self.$attr_reader("result"); return (Opal.defn(self, '$initialize', TMP_1 = function $$initialize(state, result) { var self = this; self.state = state; return self.result = result; }, TMP_1.$$arity = 2), nil) && 'initialize'; })($scope.base, $scope.get('StandardError')); return (function($base, $super) { function $Railway(){}; var self = $Railway = $klass($base, $super, 'Railway', $Railway); var def = self.$$proto, $scope = self.$$scope, TMP_2, TMP_11, TMP_13, TMP_14, TMP_15, TMP_17, TMP_18; def.last_result = def.state = def.operation = nil; Opal.defn(self, '$tracks', TMP_2 = function $$tracks() { var self = this; return self.$class().$tracks(); }, TMP_2.$$arity = 0); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_3, TMP_5, $a, $b, TMP_6, TMP_8, TMP_9; Opal.defn(self, '$tracks', TMP_3 = function $$tracks() { var $a, self = this; if (self.tracks == null) self.tracks = nil; return ((($a = self.tracks) !== false && $a !== nil && $a != null) ? $a : self.tracks = []); }, TMP_3.$$arity = 0); Opal.defn(self, '$to_opts', TMP_5 = function $$to_opts(tie, args, block) { var $a, $b, TMP_4, self = this, scope = nil; return (function() {if ((($a = args.$count()['$zero?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $hash2(["run"], {"run": block}) } else if ((($a = args['$[]'](0)['$is_a?']($scope.get('Hash'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $hash2(["scope", "run"], {"scope": (function() {if ((($a = args['$[]'](0)['$[]']("class")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return "class" } else { return args['$[]'](0)['$[]']("scope") }; return nil; })(), "run": ((($a = ((($b = args['$[]'](0)['$[]']("class")) !== false && $b !== nil && $b != null) ? $b : args['$[]'](0)['$[]']("run"))) !== false && $a !== nil && $a != null) ? $a : block)}) } else if ((($a = (($b = args['$[]'](0)['$==']("class")) ? block : args['$[]'](0)['$==']("class"))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $hash2(["run", "scope"], {"run": block, "scope": "class"}) } else if ((($a = ($b = args['$[]'](0)['$is_a?']($scope.get('Class')), $b !== false && $b !== nil && $b != null ?$rb_lt(args['$[]'](0), $scope.get('Operation')) : $b)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return $hash2(["run"], {"run": ($a = ($b = self).$proc, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this; return args['$[]'](0).$run(self.$params())}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b)}) } else { if ((($a = args['$[]'](1)['$is_a?']($scope.get('Hash'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { scope = args['$[]'](1)['$[]']("scope")}; return $hash2(["run", "scope"], {"run": args['$[]'](0), "scope": scope}); }; return nil; })().$merge($hash2(["tie"], {"tie": self.$instance_method(tie)})); }, TMP_5.$$arity = 3); ($a = ($b = ["step", "failed", "async"]).$each, $a.$$p = (TMP_6 = function(tie){var self = TMP_6.$$s || this, $c, $d, TMP_7; if (tie == null) tie = nil; return ($c = ($d = self).$define_method, $c.$$p = (TMP_7 = function($e_rest){var self = TMP_7.$$s || this, block, args; block = TMP_7.$$p || nil, TMP_7.$$p = null; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } return self.$tracks()['$<<'](self.$to_opts(tie, args, block))}, TMP_7.$$s = self, TMP_7.$$arity = -1, TMP_7), $c).call($d, ("add_" + tie.$to_s()))}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $a).call($b); Opal.defn(self, '$abort!', TMP_8 = function(arg) { var self = this; return self.$raise($scope.get('Exit').$new("failed", arg)); }, TMP_8.$$arity = 1); return (Opal.defn(self, '$succeed!', TMP_9 = function(arg) { var self = this; return self.$raise($scope.get('Exit').$new("success", arg)); }, TMP_9.$$arity = 1), nil) && 'succeed!'; })(Opal.get_singleton_class(self)); Opal.defn(self, '$step', TMP_11 = function $$step(opts) { var $a, $b, TMP_10, self = this; if ((($a = self.last_result['$is_a?']($scope.get('Promise'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.last_result = ($a = ($b = self.last_result).$then, $a.$$p = (TMP_10 = function($c_rest){var self = TMP_10.$$s || this, result; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } result = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { result[$arg_idx - 0] = arguments[$arg_idx]; } self.last_result = result; return self.$apply(opts, "in_promise");}, TMP_10.$$s = self, TMP_10.$$arity = -1, TMP_10), $a).call($b) } else if (self.state['$==']("success")) { return self.$apply(opts) } else { return nil }; }, TMP_11.$$arity = 1); Opal.defn(self, '$failed', TMP_13 = function $$failed(opts) { var $a, $b, TMP_12, self = this; if ((($a = self.last_result['$is_a?']($scope.get('Promise'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.last_result = ($a = ($b = self.last_result).$fail, $a.$$p = (TMP_12 = function(e){var self = TMP_12.$$s || this, $c; if (self.last_result == null) self.last_result = nil; if (e == null) e = nil; self.last_result = e; self.$apply(opts, "in_promise"); if ((($c = self.last_result['$is_a?']($scope.get('Exception'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { self.$raise(self.last_result)}; return self.$raise(e);}, TMP_12.$$s = self, TMP_12.$$arity = 1, TMP_12), $a).call($b) } else if (self.state['$==']("failed")) { return self.$apply(opts) } else { return nil }; }, TMP_13.$$arity = 1); Opal.defn(self, '$async', TMP_14 = function $$async(opts) { var $a, self = this; if ((($a = self.state['$!=']("failed")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$apply(opts) } else { return nil }; }, TMP_14.$$arity = 1); Opal.defn(self, '$apply', TMP_15 = function $$apply(opts, in_promise) { var $a, $b, $c, $d, $e, self = this, args = nil, instance = nil, block = nil, e = nil; if (in_promise == null) { in_promise = nil; } try { if (opts['$[]']("scope")['$==']("class")) { args = [self.operation].concat(Opal.to_a(self.last_result)); instance = self.operation.$class(); } else { args = self.last_result; instance = self.operation; }; block = opts['$[]']("run"); if ((($a = block['$is_a?']($scope.get('Symbol'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { block = instance.$method(block)}; self.last_result = (function() {if ((($a = block.$arity()['$zero?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = instance).$instance_exec, $a.$$p = block.$to_proc(), $a).call($b) } else if ((($a = ($c = args['$is_a?']($scope.get('Array')), $c !== false && $c !== nil && $c != null ?block.$arity()['$=='](args.$count()) : $c)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($c = instance).$instance_exec, $a.$$p = block.$to_proc(), $a).apply($c, Opal.to_a(args)) } else { return ($a = ($d = instance).$instance_exec, $a.$$p = block.$to_proc(), $a).call($d, args) }; return nil; })(); if ((($a = self.last_result['$is_a?']($scope.get('Promise'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { } else { return self.last_result }; if ((($a = self.last_result['$rejected?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.$raise(self.last_result.$error())}; if ((($a = self.last_result['$resolved?']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { self.last_result = self.last_result.$value()}; return self.last_result; } catch ($err) { if (Opal.rescue($err, [$scope.get('Exit')])) {e = $err; try { self.state = e.$state(); self.last_result = (function() {if ((($a = (((($e = e.$state()['$!=']("failed")) !== false && $e !== nil && $e != null) ? $e : e.$result()['$is_a?']($scope.get('Exception'))))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return e.$result() } else { return e }; return nil; })(); return self.$raise(e); } finally { Opal.pop_exception() } } else if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { self.state = "failed"; self.last_result = e; if (in_promise !== false && in_promise !== nil && in_promise != null) { self.$raise(e)}; } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_15.$$arity = -2); Opal.defn(self, '$run', TMP_17 = function $$run() { var $a, $b, TMP_16, self = this; try { if ((($a = ((($b = self.operation['$has_errors?']()) !== false && $b !== nil && $b != null) ? $b : self.state)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { ((($a = self.last_result) !== false && $a !== nil && $a != null) ? $a : self.last_result = $scope.get('ValidationException').$new(self.operation.$instance_variable_get("@errors"))); if ((($a = self.state) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return nil}; self.state = "failed"; } else { self.state = "success" }; return ($a = ($b = self.$tracks()).$each, $a.$$p = (TMP_16 = function(opts){var self = TMP_16.$$s || this; if (opts == null) opts = nil; return opts['$[]']("tie").$bind(self).$call(opts)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exit')])) { try { return nil } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_17.$$arity = 0); return (Opal.defn(self, '$result', TMP_18 = function $$result() { var $a, self = this; if ((($a = self.last_result['$is_a?']($scope.get('Promise'))) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.last_result}; return self.last_result = (function() {if (self.state['$==']("success")) { return $scope.get('Promise').$new().$resolve(self.last_result) } else { return $scope.get('Promise').$new().$reject(self.last_result) }; return nil; })(); }, TMP_18.$$arity = 0), nil) && 'result'; })($scope.base, null); })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/railway/validations"] = function(Opal) { function $rb_plus(lhs, rhs) { return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs + rhs : lhs['$+'](rhs); } var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$validations', '$class', '$add_error', '$+', '$to_s', '$[]', '$<<', '$add_validation', '$instance_eval', '$to_proc', '$==', '$state', '$raise', '$new', '$result', '$each_with_index', '$is_a?', '$method', '$instance_exec', '$add_validation_error', '$===']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Operation(){}; var self = $Operation = $klass($base, $super, 'Operation', $Operation); var def = self.$$proto, $scope = self.$$scope; return (function($base, $super) { function $Railway(){}; var self = $Railway = $klass($base, $super, 'Railway', $Railway); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_8; def.operation = nil; Opal.defn(self, '$validations', TMP_1 = function $$validations() { var self = this; return self.$class().$validations(); }, TMP_1.$$arity = 0); Opal.defn(self, '$add_validation_error', TMP_2 = function $$add_validation_error(i, e) { var self = this; return self.operation.$add_error("param validation " + ($rb_plus(i, 1)), "validation_error", e.$to_s()); }, TMP_2.$$arity = 2); (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_3, TMP_4, TMP_5; Opal.defn(self, '$validations', TMP_3 = function $$validations() { var $a, self = this; if (self.validations == null) self.validations = nil; return ((($a = self.validations) !== false && $a !== nil && $a != null) ? $a : self.validations = []); }, TMP_3.$$arity = 0); Opal.defn(self, '$add_validation', TMP_4 = function $$add_validation($a_rest) { var $b, self = this, args, $iter = TMP_4.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_4.$$p = null; if ((($b = args['$[]'](0)) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { block = args['$[]'](0)}; return self.$validations()['$<<'](block); }, TMP_4.$$arity = -1); return (Opal.defn(self, '$add_error', TMP_5 = function $$add_error(param, symbol, message, $a_rest) { var $b, $c, TMP_6, self = this, args, $iter = TMP_5.$$p, block = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 3; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 3; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 3] = arguments[$arg_idx]; } TMP_5.$$p = null; return ($b = ($c = self).$add_validation, $b.$$p = (TMP_6 = function(){var self = TMP_6.$$s || this, $a, $d, $e, e = nil; try { if ((($a = ($d = ($e = self).$instance_eval, $d.$$p = block.$to_proc(), $d).call($e)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return self.$add_error(param, symbol, message) } else { return nil } } catch ($err) { if (Opal.rescue($err, [$scope.get('Exit')])) {e = $err; try { if (e.$state()['$==']("failed")) { } else { self.$raise(e) }; self.$add_error(param, symbol, message); return self.$raise($scope.get('Exit').$new("abort_from_add_error", e.$result())); } finally { Opal.pop_exception() } } else { throw $err; } }}, TMP_6.$$s = self, TMP_6.$$arity = 0, TMP_6), $b).call($c); }, TMP_5.$$arity = -4), nil) && 'add_error'; })(Opal.get_singleton_class(self)); return (Opal.defn(self, '$process_validations', TMP_8 = function $$process_validations() {try { var $a, $b, TMP_7, self = this; return ($a = ($b = self.$validations()).$each_with_index, $a.$$p = (TMP_7 = function(validator, i){var self = TMP_7.$$s || this, $c, $d, $e, e = nil, $case = nil; if (self.operation == null) self.operation = nil; if (validator == null) validator = nil;if (i == null) i = nil; try { if ((($c = validator['$is_a?']($scope.get('Symbol'))) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { validator = self.operation.$method(validator)}; if ((($c = ($d = ($e = self.operation).$instance_exec, $d.$$p = validator.$to_proc(), $d).call($e)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { return nil;}; return self.$add_validation_error(i, "param validation " + ($rb_plus(i, 1)) + " failed"); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exit')])) {e = $err; try { $case = e.$state();if ("success"['$===']($case)) {self.$add_validation_error(i, "illegal use of succeed! in validation")}else if ("failed"['$===']($case)) {self.$add_validation_error(i, "param validation " + ($rb_plus(i, 1)) + " aborted")}; self.state = "failed"; Opal.ret(nil); } finally { Opal.pop_exception() } } else if (Opal.rescue($err, [$scope.get('AccessViolation')])) {e = $err; try { self.$add_validation_error(i, e); self.state = "failed"; self.last_result = e; Opal.ret(nil); } finally { Opal.pop_exception() } } else if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { self.$add_validation_error(i, e) } finally { Opal.pop_exception() } } else { throw $err; } }}, TMP_7.$$s = self, TMP_7.$$arity = 2, TMP_7), $a).call($b); } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_8.$$arity = 0), nil) && 'process_validations'; })($scope.base, null) })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/server_op"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2; Opal.add_stubs(['$==', '$combine_arg_array', '$params_wrapper', '$_Railway', '$serialize_params', '$fail', '$new', '$[]', '$json', '$then', '$deserialize_response', '$post', '$to_json', '$name', '$opts', '$class_eval', '$method_defined?', '$raise', '$serialize_response', '$run', '$constantize', '$URI', '$host', '$port', '$path', '$scheme', '$use_ssl=', '$verify_mode=', '$body=', '$resolve', '$request', '$reject', '$!=', '$lock', '$deserialize_dispatch', '$each', '$call', '$receivers']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $ServerOp(){}; var self = $ServerOp = $klass($base, $super, 'ServerOp', $ServerOp); var def = self.$$proto, $scope = self.$$scope; return (function(self) { var $scope = self.$$scope, def = self.$$proto, TMP_3, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, $a, TMP_17; if ($scope.get('RUBY_ENGINE')['$==']("opal")) { Opal.defn(self, '$run', TMP_3 = function $$run($a_rest) { var $b, $c, TMP_1, $d, $e, TMP_2, self = this, args, hash = nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } hash = self.$_Railway().$params_wrapper().$combine_arg_array(args); hash = self.$serialize_params(hash); return ($b = ($c = ($d = ($e = $scope.get('HTTP').$post("" + (window.HyperloopEnginePath) + "/execute_remote", $hash2(["payload", "headers"], {"payload": $hash2(["json"], {"json": $hash2(["operation", "params"], {"operation": self.$name(), "params": hash}).$to_json()}), "headers": $hash2(["X-CSRF-Token"], {"X-CSRF-Token": (($scope.get('Hyperloop')).$$scope.get('ClientDrivers')).$opts()['$[]']("form_authenticity_token")})}))).$then, $d.$$p = (TMP_2 = function(response){var self = TMP_2.$$s || this; if (response == null) response = nil; return self.$deserialize_response(response.$json()['$[]']("response"))}, TMP_2.$$s = self, TMP_2.$$arity = 1, TMP_2), $d).call($e)).$fail, $b.$$p = (TMP_1 = function(response){var self = TMP_1.$$s || this; if (response == null) response = nil; return $scope.get('Exception').$new(response.$json()['$[]']("error"))}, TMP_1.$$s = self, TMP_1.$$arity = 1, TMP_1), $b).call($c); }, TMP_3.$$arity = -1)}; Opal.defn(self, '$run_from_client', TMP_7 = function $$run_from_client(security_param, operation, params) {try { var $a, $b, TMP_4, self = this, e = nil; try { return ($a = ($b = operation.$constantize()).$class_eval, $a.$$p = (TMP_4 = function(){var self = TMP_4.$$s || this, $c, $d, TMP_5, $e, $f, TMP_6; if ((($c = self.$_Railway().$params_wrapper()['$method_defined?'](security_param)) !== nil && $c != null && (!$c.$$is_boolean || $c == true))) { } else { self.$raise($scope.get('AccessViolation')) }; return ($c = ($d = ($e = ($f = self.$run(params)).$then, $e.$$p = (TMP_6 = function(r){var self = TMP_6.$$s || this; if (r == null) r = nil; Opal.ret($hash2(["json"], {"json": $hash2(["response"], {"response": self.$serialize_response(r)})}))}, TMP_6.$$s = self, TMP_6.$$arity = 1, TMP_6), $e).call($f)).$fail, $c.$$p = (TMP_5 = function(e){var self = TMP_5.$$s || this; if (e == null) e = nil; Opal.ret($hash2(["json", "status"], {"json": $hash2(["error"], {"error": e}), "status": 500}))}, TMP_5.$$s = self, TMP_5.$$arity = 1, TMP_5), $c).call($d);}, TMP_4.$$s = self, TMP_4.$$arity = 0, TMP_4), $a).call($b) } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return $hash2(["json", "status"], {"json": $hash2(["error"], {"error": e}), "status": 500}) } finally { Opal.pop_exception() } } else { throw $err; } }; } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; } }, TMP_7.$$arity = 3); Opal.defn(self, '$remote', TMP_8 = function $$remote(path, $a_rest) { var $b, $c, self = this, args, promise = nil, uri = nil, http = nil, request = nil, e = nil; var $args_len = arguments.length, $rest_len = $args_len - 1; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 1; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 1] = arguments[$arg_idx]; } try { promise = $scope.get('Promise').$new(); uri = self.$URI("" + (path) + "execute_remote_api"); http = (($scope.get('Net')).$$scope.get('HTTP')).$new(uri.$host(), uri.$port()); request = (((($scope.get('Net')).$$scope.get('HTTP'))).$$scope.get('Post')).$new(uri.$path(), $hash2(["Content-Type"], {"Content-Type": "application/json"})); if (uri.$scheme()['$==']("https")) { (($b = [true]), $c = http, $c['$use_ssl='].apply($c, $b), $b[$b.length-1]); (($b = [(((($scope.get('OpenSSL')).$$scope.get('SSL'))).$$scope.get('VERIFY_NONE'))]), $c = http, $c['$verify_mode='].apply($c, $b), $b[$b.length-1]);}; (($b = [$hash2(["operation", "params"], {"operation": self.$name(), "params": (((($scope.get('Hyperloop')).$$scope.get('Operation'))).$$scope.get('ParamsWrapper')).$combine_arg_array(args)}).$to_json()]), $c = request, $c['$body='].apply($c, $b), $b[$b.length-1]); return promise.$resolve(http.$request(request)); } catch ($err) { if (Opal.rescue($err, [$scope.get('Exception')])) {e = $err; try { return promise.$reject(e) } finally { Opal.pop_exception() } } else { throw $err; } }; }, TMP_8.$$arity = -2); Opal.defn(self, '$serialize_params', TMP_9 = function $$serialize_params(hash) { var self = this; return hash; }, TMP_9.$$arity = 1); Opal.defn(self, '$deserialize_params', TMP_10 = function $$deserialize_params(hash) { var self = this; return hash; }, TMP_10.$$arity = 1); Opal.defn(self, '$serialize_response', TMP_11 = function $$serialize_response(hash) { var self = this; return hash; }, TMP_11.$$arity = 1); Opal.defn(self, '$deserialize_response', TMP_12 = function $$deserialize_response(hash) { var self = this; return hash; }, TMP_12.$$arity = 1); Opal.defn(self, '$serialize_dispatch', TMP_13 = function $$serialize_dispatch(hash) { var self = this; return hash; }, TMP_13.$$arity = 1); Opal.defn(self, '$deserialize_dispatch', TMP_14 = function $$deserialize_dispatch(hash) { var self = this; return hash; }, TMP_14.$$arity = 1); Opal.defn(self, '$dispatch_to', TMP_15 = function $$dispatch_to($a_rest) { var $b, self = this, args, $iter = TMP_15.$$p, regulation = $iter || nil; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } TMP_15.$$p = null; if ((($b = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $b != null && (!$b.$$is_boolean || $b == true))) { } else { return nil }; }, TMP_15.$$arity = -1); if ((($a = $scope.get('RUBY_ENGINE')['$!=']("opal")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {}; return (Opal.defn(self, '$dispatch_from_server', TMP_17 = function $$dispatch_from_server(params_hash) { var $a, $b, TMP_16, self = this, params = nil; params = self.$_Railway().$params_wrapper().$new(self.$deserialize_dispatch(params_hash)).$lock(); return ($a = ($b = self.$_Railway().$receivers()).$each, $a.$$p = (TMP_16 = function(receiver){var self = TMP_16.$$s || this; if (receiver == null) receiver = nil; return receiver.$call(params)}, TMP_16.$$s = self, TMP_16.$$arity = 1, TMP_16), $a).call($b); }, TMP_17.$$arity = 1), nil) && 'dispatch_from_server'; })(Opal.get_singleton_class(self)) })($scope.base, $scope.get('Operation')) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation/boot"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass; Opal.add_stubs(['$inherited', '$add_receiver', '$to_proc', '$_Railway', '$initialize_client_drivers_on_boot', '$_run', '$respond_to?', '$each', '$on_dispatch', '$receivers']); return (function($base) { var $Hyperloop, self = $Hyperloop = $module($base, 'Hyperloop'); var def = self.$$proto, $scope = self.$$scope; (function($base, $super) { function $Application(){}; var self = $Application = $klass($base, $super, 'Application', $Application); var def = self.$$proto, $scope = self.$$scope, $a, $b, TMP_3; if ((($a = ($scope.Boot != null)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { $scope.get('Operation').$inherited($scope.get('Boot'))}; (function($base, $super) { function $Boot(){}; var self = $Boot = $klass($base, $super, 'Boot', $Boot); var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2; Opal.defs(self, '$on_dispatch', TMP_1 = function $$on_dispatch() { var $a, $b, self = this, $iter = TMP_1.$$p, block = $iter || nil; TMP_1.$$p = null; return ($a = ($b = self.$_Railway()).$add_receiver, $a.$$p = block.$to_proc(), $a).call($b); }, TMP_1.$$arity = 0); return (Opal.defs(self, '$run', TMP_2 = function $$run($a_rest) { var $b, self = this, args; var $args_len = arguments.length, $rest_len = $args_len - 0; if ($rest_len < 0) { $rest_len = 0; } args = new Array($rest_len); for (var $arg_idx = 0; $arg_idx < $args_len; $arg_idx++) { args[$arg_idx - 0] = arguments[$arg_idx]; } $scope.get('ClientDrivers').$initialize_client_drivers_on_boot(); return ($b = self).$_run.apply($b, Opal.to_a(args)); }, TMP_2.$$arity = -1), nil) && 'run'; })($scope.base, $scope.get('Operation')); if ((($a = $scope.get('Boot')['$respond_to?']("receivers")) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return ($a = ($b = $scope.get('Boot').$receivers()).$each, $a.$$p = (TMP_3 = function(r){var self = TMP_3.$$s || this, $c, $d; if (r == null) r = nil; return ($c = ($d = $scope.get('Boot')).$on_dispatch, $c.$$p = r.$to_proc(), $c).call($d)}, TMP_3.$$s = self, TMP_3.$$arity = 1, TMP_3), $a).call($b) } else { return nil }; })($scope.base, null) })($scope.base) }; /* Generated by Opal 0.10.3 */ Opal.modules["hyper-operation"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass; Opal.add_stubs(['$require', '$import', '$==']); self.$require("hyper-operation/version"); self.$require("hyperloop-config"); $scope.get('Hyperloop').$import("hyper-operation"); if ($scope.get('RUBY_ENGINE')['$==']("opal")) { self.$require("active_support/core_ext/string"); self.$require("mutations"); self.$require("hyper-operation/filters/outbound_filter"); self.$require("hyper-component"); self.$require("hyper-operation/call_by_class_name"); self.$require("hyper-operation/transport/client_drivers"); (function($base, $super) { function $HashWithIndifferentAccess(){}; var self = $HashWithIndifferentAccess = $klass($base, $super, 'HashWithIndifferentAccess', $HashWithIndifferentAccess); var def = self.$$proto, $scope = self.$$scope; return nil; })($scope.base, $scope.get('Hash')); (function($base, $super) { function $String(){}; var self = $String = $klass($base, $super, 'String', $String); var def = self.$$proto, $scope = self.$$scope, TMP_1; return (Opal.defn(self, '$titleize', TMP_1 = function $$titleize() { var self = this; return self; }, TMP_1.$$arity = 0), nil) && 'titleize' })($scope.base, null); self.$require("hyper-operation/exception"); self.$require("hyper-operation/promise"); self.$require("hyper-operation/railway"); self.$require("hyper-operation/api"); self.$require("hyper-operation/railway/dispatcher"); self.$require("hyper-operation/railway/params_wrapper"); self.$require("hyper-operation/railway/run"); self.$require("hyper-operation/railway/validations"); self.$require("hyper-operation/server_op"); return self.$require("hyper-operation/boot");}; }; /* Generated by Opal 0.10.3 */ Opal.modules["react/top_level_render"] = function(Opal) { var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module; Opal.add_stubs(['$!', '$to_n', '$raise']); return (function($base) { var $React, self = $React = $module($base, 'React'); var def = self.$$proto, $scope = self.$$scope, TMP_1; Opal.defs(self, '$render', TMP_1 = function $$render(element, container) { var $a, self = this, $iter = TMP_1.$$p, $yield = $iter || nil, cb = nil, native$ = nil; TMP_1.$$p = null; container = container.$$class ? container[0] : container; cb = function(){ setTimeout(function(){ (function() {if (($yield !== nil)) { return Opal.yieldX($yield, []); } else { return nil }; return nil; })() }, 0) } ; if ((($a = ((typeof ReactDOM === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { native$ = ReactDOM.render(element.$to_n(), container, cb) } else if ((($a = ((typeof React.renderToString === 'undefined'))['$!']()) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { native$ = React.render(element.$to_n(), container, cb) } else { self.$raise("render is not defined. In React >= v15 you must import it with ReactDOM") }; if ((($a = native$._getOpalInstance !== undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return native$._getOpalInstance(); } else if ((($a = React.findDOMNode !== undefined && native$.nodeType === undefined) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) { return React.findDOMNode(native$); } else { return native$ }; }, TMP_1.$$arity = 2) })($scope.base) }; /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { var React = __webpack_require__(1); var ReactDOM = __webpack_require__(35); React.addons = __webpack_require__(175); window.React = React; window.ReactDOM = ReactDOM; /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(2); /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule React */ 'use strict'; var _assign = __webpack_require__(4); var ReactChildren = __webpack_require__(5); var ReactComponent = __webpack_require__(17); var ReactPureComponent = __webpack_require__(20); var ReactClass = __webpack_require__(21); var ReactDOMFactories = __webpack_require__(26); var ReactElement = __webpack_require__(9); var ReactPropTypes = __webpack_require__(32); var ReactVersion = __webpack_require__(33); var onlyChild = __webpack_require__(34); var warning = __webpack_require__(11); var createElement = ReactElement.createElement; var createFactory = ReactElement.createFactory; var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { var ReactElementValidator = __webpack_require__(28); createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; cloneElement = ReactElementValidator.cloneElement; } var __spread = _assign; if (process.env.NODE_ENV !== 'production') { var warned = false; __spread = function () { process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0; warned = true; return _assign.apply(null, arguments); }; } var React = { // Modern Children: { map: ReactChildren.map, forEach: ReactChildren.forEach, count: ReactChildren.count, toArray: ReactChildren.toArray, only: onlyChild }, Component: ReactComponent, PureComponent: ReactPureComponent, createElement: createElement, cloneElement: cloneElement, isValidElement: ReactElement.isValidElement, // Classic PropTypes: ReactPropTypes, createClass: ReactClass.createClass, createFactory: createFactory, createMixin: function (mixin) { // Currently a noop. Will be used to validate and trace mixins. return mixin; }, // This looks DOM specific but these are actually isomorphic helpers // since they are just generating DOM strings. DOM: ReactDOMFactories, version: ReactVersion, // Deprecated hook for JSX spread, don't use this for anything. __spread: __spread }; module.exports = React; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 3 */ /***/ function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; (function () { try { cachedSetTimeout = setTimeout; } catch (e) { cachedSetTimeout = function () { throw new Error('setTimeout is not defined'); } } try { cachedClearTimeout = clearTimeout; } catch (e) { cachedClearTimeout = function () { throw new Error('clearTimeout is not defined'); } } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }, /* 4 */ /***/ function(module, exports) { 'use strict'; /* eslint-disable no-unused-vars */ var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (e) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (Object.getOwnPropertySymbols) { symbols = Object.getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactChildren */ 'use strict'; var PooledClass = __webpack_require__(6); var ReactElement = __webpack_require__(9); var emptyFunction = __webpack_require__(12); var traverseAllChildren = __webpack_require__(14); var twoArgumentPooler = PooledClass.twoArgumentPooler; var fourArgumentPooler = PooledClass.fourArgumentPooler; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); } /** * PooledClass representing the bookkeeping associated with performing a child * traversal. Allows avoiding binding callbacks. * * @constructor ForEachBookKeeping * @param {!function} forEachFunction Function to perform traversal with. * @param {?*} forEachContext Context to perform context with. */ function ForEachBookKeeping(forEachFunction, forEachContext) { this.func = forEachFunction; this.context = forEachContext; this.count = 0; } ForEachBookKeeping.prototype.destructor = function () { this.func = null; this.context = null; this.count = 0; }; PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); function forEachSingleChild(bookKeeping, child, name) { var func = bookKeeping.func; var context = bookKeeping.context; func.call(context, child, bookKeeping.count++); } /** * Iterates through children that are typically specified as `props.children`. * * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); ForEachBookKeeping.release(traverseContext); } /** * PooledClass representing the bookkeeping associated with performing a child * mapping. Allows avoiding binding callbacks. * * @constructor MapBookKeeping * @param {!*} mapResult Object containing the ordered map of results. * @param {!function} mapFunction Function to perform mapping with. * @param {?*} mapContext Context to perform mapping with. */ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { this.result = mapResult; this.keyPrefix = keyPrefix; this.func = mapFunction; this.context = mapContext; this.count = 0; } MapBookKeeping.prototype.destructor = function () { this.result = null; this.keyPrefix = null; this.func = null; this.context = null; this.count = 0; }; PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); function mapSingleChildIntoContext(bookKeeping, child, childKey) { var result = bookKeeping.result; var keyPrefix = bookKeeping.keyPrefix; var func = bookKeeping.func; var context = bookKeeping.context; var mappedChild = func.call(context, child, bookKeeping.count++); if (Array.isArray(mappedChild)) { mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); } else if (mappedChild != null) { if (ReactElement.isValidElement(mappedChild)) { mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); } result.push(mappedChild); } } function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { var escapedPrefix = ''; if (prefix != null) { escapedPrefix = escapeUserProvidedKey(prefix) + '/'; } var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); MapBookKeeping.release(traverseContext); } /** * Maps children that are typically specified as `props.children`. * * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map * * The provided mapFunction(child, key, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} func The map function. * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; mapIntoWithKeyPrefixInternal(children, result, null, func, context); return result; } function forEachSingleChildDummy(traverseContext, child, name) { return null; } /** * Count the number of children that are typically specified as * `props.children`. * * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children, context) { return traverseAllChildren(children, forEachSingleChildDummy, null); } /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray */ function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); return result; } var ReactChildren = { forEach: forEachChildren, map: mapChildren, mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, count: countChildren, toArray: toArray }; module.exports = ReactChildren; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule PooledClass */ 'use strict'; var _prodInvariant = __webpack_require__(7); var invariant = __webpack_require__(8); /** * Static poolers. Several custom versions for each potential number of * arguments. A completely generic pooler is easy to implement, but would * require accessing the `arguments` object. In each of these, `this` refers to * the Class itself, not an instance. If any others are needed, simply add them * here, or in their own files. */ var oneArgumentPooler = function (copyFieldsFrom) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, copyFieldsFrom); return instance; } else { return new Klass(copyFieldsFrom); } }; var twoArgumentPooler = function (a1, a2) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2); return instance; } else { return new Klass(a1, a2); } }; var threeArgumentPooler = function (a1, a2, a3) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3); return instance; } else { return new Klass(a1, a2, a3); } }; var fourArgumentPooler = function (a1, a2, a3, a4) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3, a4); return instance; } else { return new Klass(a1, a2, a3, a4); } }; var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); Klass.call(instance, a1, a2, a3, a4, a5); return instance; } else { return new Klass(a1, a2, a3, a4, a5); } }; var standardReleaser = function (instance) { var Klass = this; !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; instance.destructor(); if (Klass.instancePool.length < Klass.poolSize) { Klass.instancePool.push(instance); } }; var DEFAULT_POOL_SIZE = 10; var DEFAULT_POOLER = oneArgumentPooler; /** * Augments `CopyConstructor` to be a poolable class, augmenting only the class * itself (statically) not adding any prototypical fields. Any CopyConstructor * you give this may have a `poolSize` property, and will look for a * prototypical `destructor` on instances. * * @param {Function} CopyConstructor Constructor that can be used to reset. * @param {Function} pooler Customizable pooler. */ var addPoolingTo = function (CopyConstructor, pooler) { var NewKlass = CopyConstructor; NewKlass.instancePool = []; NewKlass.getPooled = pooler || DEFAULT_POOLER; if (!NewKlass.poolSize) { NewKlass.poolSize = DEFAULT_POOL_SIZE; } NewKlass.release = standardReleaser; return NewKlass; }; var PooledClass = { addPoolingTo: addPoolingTo, oneArgumentPooler: oneArgumentPooler, twoArgumentPooler: twoArgumentPooler, threeArgumentPooler: threeArgumentPooler, fourArgumentPooler: fourArgumentPooler, fiveArgumentPooler: fiveArgumentPooler }; module.exports = PooledClass; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 7 */ /***/ function(module, exports) { /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule reactProdInvariant * */ 'use strict'; /** * WARNING: DO NOT manually require this module. * This is a replacement for `invariant(...)` used by the error code system * and will _only_ be required by the corresponding babel pass. * It always throws. */ function reactProdInvariant(code) { var argCount = arguments.length - 1; var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; for (var argIdx = 0; argIdx < argCount; argIdx++) { message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); } message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; var error = new Error(message); error.name = 'Invariant Violation'; error.framesToPop = 1; // we don't care about reactProdInvariant's own frame throw error; } module.exports = reactProdInvariant; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ function invariant(condition, format, a, b, c, d, e, f) { if (process.env.NODE_ENV !== 'production') { if (format === undefined) { throw new Error('invariant requires an error message argument'); } } if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } module.exports = invariant; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactElement */ 'use strict'; var _assign = __webpack_require__(4); var ReactCurrentOwner = __webpack_require__(10); var warning = __webpack_require__(11); var canDefineProperty = __webpack_require__(13); var hasOwnProperty = Object.prototype.hasOwnProperty; // The Symbol used to tag the ReactElement type. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown, specialPropRefWarningShown; function hasValidRef(config) { if (process.env.NODE_ENV !== 'production') { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== undefined; } function hasValidKey(config) { if (process.env.NODE_ENV !== 'production') { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== undefined; } /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, no instanceof check * will work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} key * @param {string|object} ref * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @param {*} owner * @param {*} props * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allow us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; if (process.env.NODE_ENV !== 'production') { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. if (canDefineProperty) { Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); Object.defineProperty(element, '_shadowChildren', { configurable: false, enumerable: false, writable: false, value: shadowChildren }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); } else { element._store.validated = false; element._self = self; element._shadowChildren = shadowChildren; element._source = source; } if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; /** * Create and return a new ReactElement of the given type. * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement */ ReactElement.createElement = function (type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning( /* eslint-disable no-proto */ config.__proto__ == null || config.__proto__ === Object.prototype, /* eslint-enable no-proto */ 'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0; } if (hasValidRef(config)) { ref = config.ref; } if (hasValidKey(config)) { key = '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } if (process.env.NODE_ENV !== 'production') { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; // Create dummy `key` and `ref` property to `props` to warn users against its use var warnAboutAccessingKey = function () { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; } return undefined; }; warnAboutAccessingKey.isReactWarning = true; var warnAboutAccessingRef = function () { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; } return undefined; }; warnAboutAccessingRef.isReactWarning = true; if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { if (!props.hasOwnProperty('key')) { Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, configurable: true }); } if (!props.hasOwnProperty('ref')) { Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, configurable: true }); } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); }; /** * Return a function that produces ReactElements of a given type. * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory */ ReactElement.createFactory = function (type) { var factory = ReactElement.createElement.bind(null, type); // Expose the type on the factory and the prototype so that it can be // easily accessed on elements. E.g. `.type === Foo`. // This should not be named `constructor` since this may not be the function // that created the element, and it may not even be a constructor. // Legacy hook TODO: Warn if this is accessed factory.type = type; return factory; }; ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; }; /** * Clone and return a new ReactElement using element as the starting point. * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement */ ReactElement.cloneElement = function (element, config, children) { var propName; // Original props are copied var props = _assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning( /* eslint-disable no-proto */ config.__proto__ == null || config.__proto__ === Object.prototype, /* eslint-enable no-proto */ 'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0; } if (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { key = '' + config.key; } // Remaining properties override existing props var defaultProps; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); }; /** * Verifies the object is a ReactElement. * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement * @param {?object} object * @return {boolean} True if `object` is a valid component. * @final */ ReactElement.isValidElement = function (object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE; module.exports = ReactElement; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 10 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactCurrentOwner */ 'use strict'; /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; module.exports = ReactCurrentOwner; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var emptyFunction = __webpack_require__(12); /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = emptyFunction; if (process.env.NODE_ENV !== 'production') { warning = function warning(condition, format) { for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } if (format === undefined) { throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); } if (format.indexOf('Failed Composite propType: ') === 0) { return; // Ignore CompositeComponent proptype check. } if (!condition) { var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} } }; } module.exports = warning; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 12 */ /***/ function(module, exports) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule canDefineProperty */ 'use strict'; var canDefineProperty = false; if (process.env.NODE_ENV !== 'production') { try { Object.defineProperty({}, 'x', { get: function () {} }); canDefineProperty = true; } catch (x) { // IE will fail on defineProperty } } module.exports = canDefineProperty; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule traverseAllChildren */ 'use strict'; var _prodInvariant = __webpack_require__(7); var ReactCurrentOwner = __webpack_require__(10); var ReactElement = __webpack_require__(9); var getIteratorFn = __webpack_require__(15); var invariant = __webpack_require__(8); var KeyEscapeUtils = __webpack_require__(16); var warning = __webpack_require__(11); var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ var didWarnAboutMaps = false; /** * Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ function getComponentKey(component, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (component && typeof component === 'object' && component.key != null) { // Explicit key return KeyEscapeUtils.escape(component.key); } // Implicit key determined by the index in the set return index.toString(36); } /** * @param {?*} children Children tree container. * @param {!string} nameSoFar Name of the key path so far. * @param {!function} callback Callback to invoke with each child found. * @param {?*} traverseContext Used to pass information throughout the traversal * process. * @return {!number} The number of children in this subtree. */ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; if (type === 'undefined' || type === 'boolean') { // All of the above are perceived as null. children = null; } if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) { callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); return 1; } var child; var nextName; var subtreeCount = 0; // Count of children found in the current subtree. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getComponentKey(child, i); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else { var iteratorFn = getIteratorFn(children); if (iteratorFn) { var iterator = iteratorFn.call(children); var step; if (iteratorFn !== children.entries) { var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getComponentKey(child, ii++); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else { if (process.env.NODE_ENV !== 'production') { var mapsAsChildrenAddendum = ''; if (ReactCurrentOwner.current) { var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); if (mapsAsChildrenOwnerName) { mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; } } process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; didWarnAboutMaps = true; } // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { child = entry[1]; nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } } } else if (type === 'object') { var addendum = ''; if (process.env.NODE_ENV !== 'production') { addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; if (children._isReactElement) { addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; } if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); if (name) { addendum += ' Check the render method of `' + name + '`.'; } } } var childrenString = String(children); true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; } } return subtreeCount; } /** * Traverses children that are typically specified as `props.children`, but * might also be specified through attributes: * * - `traverseAllChildren(this.props.children, ...)` * - `traverseAllChildren(this.props.leftPanelChildren, ...)` * * The `traverseContext` is an optional argument that is passed through the * entire traversal. It can be used to store accumulations or anything else that * the callback might find relevant. * * @param {?*} children Children tree object. * @param {!function} callback To invoke upon traversing each child. * @param {?*} traverseContext Context for traversal. * @return {!number} The number of children in this subtree. */ function traverseAllChildren(children, callback, traverseContext) { if (children == null) { return 0; } return traverseAllChildrenImpl(children, '', callback, traverseContext); } module.exports = traverseAllChildren; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 15 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getIteratorFn * */ 'use strict'; /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } module.exports = getIteratorFn; /***/ }, /* 16 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule KeyEscapeUtils * */ 'use strict'; /** * Escape and wrap key so it is safe to use as a reactid * * @param {string} key to be escaped. * @return {string} the escaped key. */ function escape(key) { var escapeRegex = /[=:]/g; var escaperLookup = { '=': '=0', ':': '=2' }; var escapedString = ('' + key).replace(escapeRegex, function (match) { return escaperLookup[match]; }); return '$' + escapedString; } /** * Unescape and unwrap key for human-readable display * * @param {string} key to unescape. * @return {string} the unescaped key. */ function unescape(key) { var unescapeRegex = /(=0|=2)/g; var unescaperLookup = { '=0': '=', '=2': ':' }; var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); return ('' + keySubstring).replace(unescapeRegex, function (match) { return unescaperLookup[match]; }); } var KeyEscapeUtils = { escape: escape, unescape: unescape }; module.exports = KeyEscapeUtils; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponent */ 'use strict'; var _prodInvariant = __webpack_require__(7); var ReactNoopUpdateQueue = __webpack_require__(18); var canDefineProperty = __webpack_require__(13); var emptyObject = __webpack_require__(19); var invariant = __webpack_require__(8); var warning = __webpack_require__(11); /** * Base class helpers for the updating state of a component. */ function ReactComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } ReactComponent.prototype.isReactComponent = {}; /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * When a function is provided to setState, it will be called at some point in * the future (not synchronously). It will be called with the up to date * component arguments (state, props, context). These values can be different * from this.* because your function may be called after receiveProps but before * shouldComponentUpdate, and this new state, props, and context will not yet be * assigned to this. * * @param {object|function} partialState Next partial state or function to * produce next partial state to be merged with current state. * @param {?function} callback Called after state is updated. * @final * @protected */ ReactComponent.prototype.setState = function (partialState, callback) { !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; this.updater.enqueueSetState(this, partialState); if (callback) { this.updater.enqueueCallback(this, callback, 'setState'); } }; /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ ReactComponent.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this); if (callback) { this.updater.enqueueCallback(this, callback, 'forceUpdate'); } }; /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ if (process.env.NODE_ENV !== 'production') { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; var defineDeprecationWarning = function (methodName, info) { if (canDefineProperty) { Object.defineProperty(ReactComponent.prototype, methodName, { get: function () { process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0; return undefined; } }); } }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } module.exports = ReactComponent; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactNoopUpdateQueue */ 'use strict'; var warning = __webpack_require__(11); function warnNoop(publicInstance, callerName) { if (process.env.NODE_ENV !== 'production') { var constructor = publicInstance.constructor; process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; } } /** * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function (publicInstance) { return false; }, /** * Enqueue a callback that will be executed after all the pending updates * have processed. * * @param {ReactClass} publicInstance The instance to use as `this` context. * @param {?function} callback Called after state is updated. * @internal */ enqueueCallback: function (publicInstance, callback) {}, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @internal */ enqueueForceUpdate: function (publicInstance) { warnNoop(publicInstance, 'forceUpdate'); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @internal */ enqueueReplaceState: function (publicInstance, completeState) { warnNoop(publicInstance, 'replaceState'); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @internal */ enqueueSetState: function (publicInstance, partialState) { warnNoop(publicInstance, 'setState'); } }; module.exports = ReactNoopUpdateQueue; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var emptyObject = {}; if (process.env.NODE_ENV !== 'production') { Object.freeze(emptyObject); } module.exports = emptyObject; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPureComponent */ 'use strict'; var _assign = __webpack_require__(4); var ReactComponent = __webpack_require__(17); var ReactNoopUpdateQueue = __webpack_require__(18); var emptyObject = __webpack_require__(19); /** * Base class helpers for the updating state of a component. */ function ReactPureComponent(props, context, updater) { // Duplicated from ReactComponent. this.props = props; this.context = context; this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } function ComponentDummy() {} ComponentDummy.prototype = ReactComponent.prototype; ReactPureComponent.prototype = new ComponentDummy(); ReactPureComponent.prototype.constructor = ReactPureComponent; // Avoid an extra prototype jump for these methods. _assign(ReactPureComponent.prototype, ReactComponent.prototype); ReactPureComponent.prototype.isPureReactComponent = true; module.exports = ReactPureComponent; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactClass */ 'use strict'; var _prodInvariant = __webpack_require__(7), _assign = __webpack_require__(4); var ReactComponent = __webpack_require__(17); var ReactElement = __webpack_require__(9); var ReactPropTypeLocations = __webpack_require__(22); var ReactPropTypeLocationNames = __webpack_require__(24); var ReactNoopUpdateQueue = __webpack_require__(18); var emptyObject = __webpack_require__(19); var invariant = __webpack_require__(8); var keyMirror = __webpack_require__(23); var keyOf = __webpack_require__(25); var warning = __webpack_require__(11); var MIXINS_KEY = keyOf({ mixins: null }); /** * Policies that describe methods in `ReactClassInterface`. */ var SpecPolicy = keyMirror({ /** * These methods may be defined only once by the class specification or mixin. */ DEFINE_ONCE: null, /** * These methods may be defined by both the class specification and mixins. * Subsequent definitions will be chained. These methods must return void. */ DEFINE_MANY: null, /** * These methods are overriding the base class. */ OVERRIDE_BASE: null, /** * These methods are similar to DEFINE_MANY, except we assume they return * objects. We try to merge the keys of the return values of all the mixed in * functions. If there is a key conflict we throw. */ DEFINE_MANY_MERGED: null }); var injectedMixins = []; /** * Composite components are higher-level components that compose other composite * or host components. * * To create a new type of `ReactClass`, pass a specification of * your new class to `React.createClass`. The only requirement of your class * specification is that you implement a `render` method. * * var MyComponent = React.createClass({ * render: function() { * return
Hello World
; * } * }); * * The class specification supports a specific protocol of methods that have * special meaning (e.g. `render`). See `ReactClassInterface` for * more the comprehensive protocol. Any other properties and methods in the * class specification will be available on the prototype. * * @interface ReactClassInterface * @internal */ var ReactClassInterface = { /** * An array of Mixin objects to include when defining your component. * * @type {array} * @optional */ mixins: SpecPolicy.DEFINE_MANY, /** * An object containing properties and methods that should be defined on * the component's constructor instead of its prototype (static methods). * * @type {object} * @optional */ statics: SpecPolicy.DEFINE_MANY, /** * Definition of prop types for this component. * * @type {object} * @optional */ propTypes: SpecPolicy.DEFINE_MANY, /** * Definition of context types for this component. * * @type {object} * @optional */ contextTypes: SpecPolicy.DEFINE_MANY, /** * Definition of context types this component sets for its children. * * @type {object} * @optional */ childContextTypes: SpecPolicy.DEFINE_MANY, // ==== Definition methods ==== /** * Invoked when the component is mounted. Values in the mapping will be set on * `this.props` if that prop is not specified (i.e. using an `in` check). * * This method is invoked before `getInitialState` and therefore cannot rely * on `this.state` or use `this.setState`. * * @return {object} * @optional */ getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, /** * Invoked once before the component is mounted. The return value will be used * as the initial value of `this.state`. * * getInitialState: function() { * return { * isOn: false, * fooBaz: new BazFoo() * } * } * * @return {object} * @optional */ getInitialState: SpecPolicy.DEFINE_MANY_MERGED, /** * @return {object} * @optional */ getChildContext: SpecPolicy.DEFINE_MANY_MERGED, /** * Uses props from `this.props` and state from `this.state` to render the * structure of the component. * * No guarantees are made about when or how often this method is invoked, so * it must not have side effects. * * render: function() { * var name = this.props.name; * return
Hello, {name}!
; * } * * @return {ReactComponent} * @nosideeffects * @required */ render: SpecPolicy.DEFINE_ONCE, // ==== Delegate methods ==== /** * Invoked when the component is initially created and about to be mounted. * This may have side effects, but any external subscriptions or data created * by this method must be cleaned up in `componentWillUnmount`. * * @optional */ componentWillMount: SpecPolicy.DEFINE_MANY, /** * Invoked when the component has been mounted and has a DOM representation. * However, there is no guarantee that the DOM node is in the document. * * Use this as an opportunity to operate on the DOM when the component has * been mounted (initialized and rendered) for the first time. * * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidMount: SpecPolicy.DEFINE_MANY, /** * Invoked before the component receives new props. * * Use this as an opportunity to react to a prop transition by updating the * state using `this.setState`. Current props are accessed via `this.props`. * * componentWillReceiveProps: function(nextProps, nextContext) { * this.setState({ * likesIncreasing: nextProps.likeCount > this.props.likeCount * }); * } * * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop * transition may cause a state change, but the opposite is not true. If you * need it, you are probably looking for `componentWillUpdate`. * * @param {object} nextProps * @optional */ componentWillReceiveProps: SpecPolicy.DEFINE_MANY, /** * Invoked while deciding if the component should be updated as a result of * receiving new props, state and/or context. * * Use this as an opportunity to `return false` when you're certain that the * transition to the new props/state/context will not require a component * update. * * shouldComponentUpdate: function(nextProps, nextState, nextContext) { * return !equal(nextProps, this.props) || * !equal(nextState, this.state) || * !equal(nextContext, this.context); * } * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @return {boolean} True if the component should update. * @optional */ shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, /** * Invoked when the component is about to update due to a transition from * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` * and `nextContext`. * * Use this as an opportunity to perform preparation before an update occurs. * * NOTE: You **cannot** use `this.setState()` in this method. * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @param {ReactReconcileTransaction} transaction * @optional */ componentWillUpdate: SpecPolicy.DEFINE_MANY, /** * Invoked when the component's DOM representation has been updated. * * Use this as an opportunity to operate on the DOM when the component has * been updated. * * @param {object} prevProps * @param {?object} prevState * @param {?object} prevContext * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidUpdate: SpecPolicy.DEFINE_MANY, /** * Invoked when the component is about to be removed from its parent and have * its DOM representation destroyed. * * Use this as an opportunity to deallocate any external resources. * * NOTE: There is no `componentDidUnmount` since your component will have been * destroyed by that point. * * @optional */ componentWillUnmount: SpecPolicy.DEFINE_MANY, // ==== Advanced methods ==== /** * Updates the component's currently mounted DOM representation. * * By default, this implements React's rendering and reconciliation algorithm. * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction * @internal * @overridable */ updateComponent: SpecPolicy.OVERRIDE_BASE }; /** * Mapping from class specification keys to special processing functions. * * Although these are declared like instance properties in the specification * when defining classes using `React.createClass`, they are actually static * and are accessible on the constructor instead of the prototype. Despite * being static, they must be defined outside of the "statics" key under * which all other static methods are defined. */ var RESERVED_SPEC_KEYS = { displayName: function (Constructor, displayName) { Constructor.displayName = displayName; }, mixins: function (Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, childContextTypes: function (Constructor, childContextTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext); } Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); }, contextTypes: function (Constructor, contextTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context); } Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); }, /** * Special case getDefaultProps which should move into statics but requires * automatic merging. */ getDefaultProps: function (Constructor, getDefaultProps) { if (Constructor.getDefaultProps) { Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); } else { Constructor.getDefaultProps = getDefaultProps; } }, propTypes: function (Constructor, propTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop); } Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); }, statics: function (Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); }, autobind: function () {} }; // noop function validateTypeDef(Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { // use a warning instead of an invariant so components // don't show up in prod but only in __DEV__ process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; } } } function validateMethodOverride(isAlreadyDefined, name) { var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; // Disallow overriding of base class methods unless explicitly allowed. if (ReactClassMixin.hasOwnProperty(name)) { !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0; } // Disallow defining methods more than once unless explicitly allowed. if (isAlreadyDefined) { !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0; } } /** * Mixin helper which handles policy validation and reserved * specification keys when building React classes. */ function mixSpecIntoComponent(Constructor, spec) { if (!spec) { if (process.env.NODE_ENV !== 'production') { var typeofSpec = typeof spec; var isMixinValid = typeofSpec === 'object' && spec !== null; process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0; } return; } !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0; !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0; var proto = Constructor.prototype; var autoBindPairs = proto.__reactAutoBindPairs; // By handling mixins before any other properties, we ensure the same // chaining order is applied to methods with DEFINE_MANY policy, whether // mixins are listed before or after these methods in the spec. if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { // We have already handled mixins in a special case above. continue; } var property = spec[name]; var isAlreadyDefined = proto.hasOwnProperty(name); validateMethodOverride(isAlreadyDefined, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactClass methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; if (shouldAutoBind) { autoBindPairs.push(name, property); proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0; // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === SpecPolicy.DEFINE_MANY) { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if (process.env.NODE_ENV !== 'production') { // Add verbose displayName to the function, which helps when looking // at profiling tools. if (typeof property === 'function' && spec.displayName) { proto[name].displayName = spec.displayName + '_' + name; } } } } } } } function mixStaticSpecIntoComponent(Constructor, statics) { if (!statics) { return; } for (var name in statics) { var property = statics[name]; if (!statics.hasOwnProperty(name)) { continue; } var isReserved = name in RESERVED_SPEC_KEYS; !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0; var isInherited = name in Constructor; !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0; Constructor[name] = property; } } /** * Merge two objects, but throw if both contain the same key. * * @param {object} one The first object, which is mutated. * @param {object} two The second object * @return {object} one after it has been mutated to contain everything in two. */ function mergeIntoWithNoDuplicateKeys(one, two) { !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0; for (var key in two) { if (two.hasOwnProperty(key)) { !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0; one[key] = two[key]; } } return one; } /** * Creates a function that invokes two functions and merges their return values. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createMergedResultFunction(one, two) { return function mergedResult() { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c, a); mergeIntoWithNoDuplicateKeys(c, b); return c; }; } /** * Creates a function that invokes two functions and ignores their return vales. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; } /** * Binds a method to the component. * * @param {object} component Component whose method is going to be bound. * @param {function} method Method to be bound. * @return {function} The bound method. */ function bindAutoBindMethod(component, method) { var boundMethod = method.bind(component); if (process.env.NODE_ENV !== 'production') { boundMethod.__reactBoundContext = component; boundMethod.__reactBoundMethod = method; boundMethod.__reactBoundArguments = null; var componentName = component.constructor.displayName; var _bind = boundMethod.bind; boundMethod.bind = function (newThis) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } // User is trying to bind() an autobound method; we effectively will // ignore the value of "this" that the user is trying to use, so // let's warn. if (newThis !== component && newThis !== null) { process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; } else if (!args.length) { process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; return boundMethod; } var reboundMethod = _bind.apply(boundMethod, arguments); reboundMethod.__reactBoundContext = component; reboundMethod.__reactBoundMethod = method; reboundMethod.__reactBoundArguments = args; return reboundMethod; }; } return boundMethod; } /** * Binds all auto-bound methods in a component. * * @param {object} component Component whose method is going to be bound. */ function bindAutoBindMethods(component) { var pairs = component.__reactAutoBindPairs; for (var i = 0; i < pairs.length; i += 2) { var autoBindKey = pairs[i]; var method = pairs[i + 1]; component[autoBindKey] = bindAutoBindMethod(component, method); } } /** * Add more to the ReactClass base class. These are all legacy features and * therefore not already part of the modern ReactComponent. */ var ReactClassMixin = { /** * TODO: This will be deprecated because state should always keep a consistent * type signature and the only use case for this, is to avoid that. */ replaceState: function (newState, callback) { this.updater.enqueueReplaceState(this, newState); if (callback) { this.updater.enqueueCallback(this, callback, 'replaceState'); } }, /** * Checks whether or not this composite component is mounted. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function () { return this.updater.isMounted(this); } }; var ReactClassComponent = function () {}; _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); /** * Module for creating composite components. * * @class ReactClass */ var ReactClass = { /** * Creates a composite component class given a class specification. * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass * * @param {object} spec Class specification (which must define `render`). * @return {function} Component constructor function. * @public */ createClass: function (spec) { var Constructor = function (props, context, updater) { // This constructor gets overridden by mocks. The argument is used // by mocks to assert on what gets mounted. if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; } // Wire up auto-binding if (this.__reactAutoBindPairs.length) { bindAutoBindMethods(this); } this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; this.state = null; // ReactClasses doesn't have constructors. Instead, they use the // getInitialState and componentWillMount methods for initialization. var initialState = this.getInitialState ? this.getInitialState() : null; if (process.env.NODE_ENV !== 'production') { // We allow auto-mocks to proceed as if they're returning null. if (initialState === undefined && this.getInitialState._isMockFunction) { // This is probably bad practice. Consider warning here and // deprecating this convenience. initialState = null; } } !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0; this.state = initialState; }; Constructor.prototype = new ReactClassComponent(); Constructor.prototype.constructor = Constructor; Constructor.prototype.__reactAutoBindPairs = []; injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); mixSpecIntoComponent(Constructor, spec); // Initialize the defaultProps property after all mixins have been merged. if (Constructor.getDefaultProps) { Constructor.defaultProps = Constructor.getDefaultProps(); } if (process.env.NODE_ENV !== 'production') { // This is a tag to indicate that the use of these method names is ok, // since it's used with createClass. If it's not, then it's likely a // mistake so we'll warn you to use the static property, property // initializer or constructor respectively. if (Constructor.getDefaultProps) { Constructor.getDefaultProps.isReactClassApproved = {}; } if (Constructor.prototype.getInitialState) { Constructor.prototype.getInitialState.isReactClassApproved = {}; } } !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; } // Reduce time spent doing lookups by setting these on the prototype. for (var methodName in ReactClassInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; } } return Constructor; }, injection: { injectMixin: function (mixin) { injectedMixins.push(mixin); } } }; module.exports = ReactClass; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypeLocations */ 'use strict'; var keyMirror = __webpack_require__(23); var ReactPropTypeLocations = keyMirror({ prop: null, context: null, childContext: null }); module.exports = ReactPropTypeLocations; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks static-only */ 'use strict'; var invariant = __webpack_require__(8); /** * Constructs an enumeration with keys equal to their value. * * For example: * * var COLORS = keyMirror({blue: null, red: null}); * var myColor = COLORS.blue; * var isColorValid = !!COLORS[myColor]; * * The last line could not be performed if the values of the generated enum were * not equal to their keys. * * Input: {key1: val1, key2: val2} * Output: {key1: key1, key2: key2} * * @param {object} obj * @return {object} */ var keyMirror = function keyMirror(obj) { var ret = {}; var key; !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0; for (key in obj) { if (!obj.hasOwnProperty(key)) { continue; } ret[key] = key; } return ret; }; module.exports = keyMirror; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypeLocationNames */ 'use strict'; var ReactPropTypeLocationNames = {}; if (process.env.NODE_ENV !== 'production') { ReactPropTypeLocationNames = { prop: 'prop', context: 'context', childContext: 'child context' }; } module.exports = ReactPropTypeLocationNames; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 25 */ /***/ function(module, exports) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ /** * Allows extraction of a minified key. Let's the build system minify keys * without losing the ability to dynamically use key strings as values * themselves. Pass in an object with a single key/val pair and it will return * you the string key of that single record. Suppose you want to grab the * value for a key 'className' inside of an object. Key/val minification may * have aliased that key to be 'xa12'. keyOf({className: null}) will return * 'xa12' in that case. Resolve keys you want to use once at startup time, then * reuse those resolutions. */ var keyOf = function keyOf(oneKeyObj) { var key; for (key in oneKeyObj) { if (!oneKeyObj.hasOwnProperty(key)) { continue; } return key; } return null; }; module.exports = keyOf; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMFactories */ 'use strict'; var ReactElement = __webpack_require__(9); var mapObject = __webpack_require__(27); /** * Create a factory that creates HTML tag elements. * * @param {string} tag Tag name (e.g. `div`). * @private */ function createDOMFactory(tag) { if (process.env.NODE_ENV !== 'production') { var ReactElementValidator = __webpack_require__(28); return ReactElementValidator.createFactory(tag); } return ReactElement.createFactory(tag); } /** * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. * This is also accessible via `React.DOM`. * * @public */ var ReactDOMFactories = mapObject({ a: 'a', abbr: 'abbr', address: 'address', area: 'area', article: 'article', aside: 'aside', audio: 'audio', b: 'b', base: 'base', bdi: 'bdi', bdo: 'bdo', big: 'big', blockquote: 'blockquote', body: 'body', br: 'br', button: 'button', canvas: 'canvas', caption: 'caption', cite: 'cite', code: 'code', col: 'col', colgroup: 'colgroup', data: 'data', datalist: 'datalist', dd: 'dd', del: 'del', details: 'details', dfn: 'dfn', dialog: 'dialog', div: 'div', dl: 'dl', dt: 'dt', em: 'em', embed: 'embed', fieldset: 'fieldset', figcaption: 'figcaption', figure: 'figure', footer: 'footer', form: 'form', h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', head: 'head', header: 'header', hgroup: 'hgroup', hr: 'hr', html: 'html', i: 'i', iframe: 'iframe', img: 'img', input: 'input', ins: 'ins', kbd: 'kbd', keygen: 'keygen', label: 'label', legend: 'legend', li: 'li', link: 'link', main: 'main', map: 'map', mark: 'mark', menu: 'menu', menuitem: 'menuitem', meta: 'meta', meter: 'meter', nav: 'nav', noscript: 'noscript', object: 'object', ol: 'ol', optgroup: 'optgroup', option: 'option', output: 'output', p: 'p', param: 'param', picture: 'picture', pre: 'pre', progress: 'progress', q: 'q', rp: 'rp', rt: 'rt', ruby: 'ruby', s: 's', samp: 'samp', script: 'script', section: 'section', select: 'select', small: 'small', source: 'source', span: 'span', strong: 'strong', style: 'style', sub: 'sub', summary: 'summary', sup: 'sup', table: 'table', tbody: 'tbody', td: 'td', textarea: 'textarea', tfoot: 'tfoot', th: 'th', thead: 'thead', time: 'time', title: 'title', tr: 'tr', track: 'track', u: 'u', ul: 'ul', 'var': 'var', video: 'video', wbr: 'wbr', // SVG circle: 'circle', clipPath: 'clipPath', defs: 'defs', ellipse: 'ellipse', g: 'g', image: 'image', line: 'line', linearGradient: 'linearGradient', mask: 'mask', path: 'path', pattern: 'pattern', polygon: 'polygon', polyline: 'polyline', radialGradient: 'radialGradient', rect: 'rect', stop: 'stop', svg: 'svg', text: 'text', tspan: 'tspan' }, createDOMFactory); module.exports = ReactDOMFactories; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 27 */ /***/ function(module, exports) { /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Executes the provided `callback` once for each enumerable own property in the * object and constructs a new object from the results. The `callback` is * invoked with three arguments: * * - the property value * - the property name * - the object being traversed * * Properties that are added after the call to `mapObject` will not be visited * by `callback`. If the values of existing properties are changed, the value * passed to `callback` will be the value at the time `mapObject` visits them. * Properties that are deleted before being visited are not visited. * * @grep function objectMap() * @grep function objMap() * * @param {?object} object * @param {function} callback * @param {*} context * @return {?object} */ function mapObject(object, callback, context) { if (!object) { return null; } var result = {}; for (var name in object) { if (hasOwnProperty.call(object, name)) { result[name] = callback.call(context, object[name], name, object); } } return result; } module.exports = mapObject; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactElementValidator */ /** * ReactElementValidator provides a wrapper around a element factory * which validates the props passed to the element. This is intended to be * used only in DEV and could be replaced by a static type checker for languages * that support it. */ 'use strict'; var ReactCurrentOwner = __webpack_require__(10); var ReactComponentTreeDevtool = __webpack_require__(29); var ReactElement = __webpack_require__(9); var ReactPropTypeLocations = __webpack_require__(22); var checkReactTypeSpec = __webpack_require__(30); var canDefineProperty = __webpack_require__(13); var getIteratorFn = __webpack_require__(15); var warning = __webpack_require__(11); function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); if (name) { return ' Check the render method of `' + name + '`.'; } } return ''; } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { info = ' Check the top-level render call using <' + parentName + '>.'; } } return info; } /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. Error statuses are cached so a warning * will only be shown once. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (memoizer[currentComponentErrorInfo]) { return; } memoizer[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. var childOwner = ''; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; } process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeDevtool.getCurrentStackAddendum(element)) : void 0; } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (ReactElement.isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (ReactElement.isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); // Entry iterators provide implicit keys. if (iteratorFn) { if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (ReactElement.isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { var componentClass = element.type; if (typeof componentClass !== 'function') { return; } var name = componentClass.displayName || componentClass.name; if (componentClass.propTypes) { checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null); } if (typeof componentClass.getDefaultProps === 'function') { process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; } } var ReactElementValidator = { createElement: function (type, props, children) { var validType = typeof type === 'string' || typeof type === 'function'; // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; var element = ReactElement.createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } validatePropTypes(element); return element; }, createFactory: function (type) { var validatedFactory = ReactElementValidator.createElement.bind(null, type); // Legacy hook TODO: Warn if this is accessed validatedFactory.type = type; if (process.env.NODE_ENV !== 'production') { if (canDefineProperty) { Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0; Object.defineProperty(this, 'type', { value: type }); return type; } }); } } return validatedFactory; }, cloneElement: function (element, props, children) { var newElement = ReactElement.cloneElement.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } }; module.exports = ReactElementValidator; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponentTreeDevtool */ 'use strict'; var _prodInvariant = __webpack_require__(7); var ReactCurrentOwner = __webpack_require__(10); var invariant = __webpack_require__(8); var warning = __webpack_require__(11); var tree = {}; var unmountedIDs = {}; var rootIDs = {}; function updateTree(id, update) { if (!tree[id]) { tree[id] = { element: null, parentID: null, ownerID: null, text: null, childIDs: [], displayName: 'Unknown', isMounted: false, updateCount: 0 }; } update(tree[id]); } function purgeDeep(id) { var item = tree[id]; if (item) { var childIDs = item.childIDs; delete tree[id]; childIDs.forEach(purgeDeep); } } function describeComponentFrame(name, source, ownerName) { return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); } function describeID(id) { var name = ReactComponentTreeDevtool.getDisplayName(id); var element = ReactComponentTreeDevtool.getElement(id); var ownerID = ReactComponentTreeDevtool.getOwnerID(id); var ownerName; if (ownerID) { ownerName = ReactComponentTreeDevtool.getDisplayName(ownerID); } process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeDevtool: Missing React element for debugID %s when ' + 'building stack', id) : void 0; return describeComponentFrame(name, element && element._source, ownerName); } var ReactComponentTreeDevtool = { onSetDisplayName: function (id, displayName) { updateTree(id, function (item) { return item.displayName = displayName; }); }, onSetChildren: function (id, nextChildIDs) { updateTree(id, function (item) { item.childIDs = nextChildIDs; nextChildIDs.forEach(function (nextChildID) { var nextChild = tree[nextChildID]; !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected devtool events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('68') : void 0; !(nextChild.displayName != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('69') : void 0; !(nextChild.childIDs != null || nextChild.text != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('70') : void 0; !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; if (nextChild.parentID == null) { nextChild.parentID = id; // TODO: This shouldn't be necessary but mounting a new root during in // componentWillMount currently causes not-yet-mounted components to // be purged from our tree data so their parent ID is missing. } !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetParent() and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('72', nextChildID, nextChild.parentID, id) : void 0; }); }); }, onSetOwner: function (id, ownerID) { updateTree(id, function (item) { return item.ownerID = ownerID; }); }, onSetParent: function (id, parentID) { updateTree(id, function (item) { return item.parentID = parentID; }); }, onSetText: function (id, text) { updateTree(id, function (item) { return item.text = text; }); }, onBeforeMountComponent: function (id, element) { updateTree(id, function (item) { return item.element = element; }); }, onBeforeUpdateComponent: function (id, element) { updateTree(id, function (item) { return item.element = element; }); }, onMountComponent: function (id) { updateTree(id, function (item) { return item.isMounted = true; }); }, onMountRootComponent: function (id) { rootIDs[id] = true; }, onUpdateComponent: function (id) { updateTree(id, function (item) { return item.updateCount++; }); }, onUnmountComponent: function (id) { updateTree(id, function (item) { return item.isMounted = false; }); unmountedIDs[id] = true; delete rootIDs[id]; }, purgeUnmountedComponents: function () { if (ReactComponentTreeDevtool._preventPurging) { // Should only be used for testing. return; } for (var id in unmountedIDs) { purgeDeep(id); } unmountedIDs = {}; }, isMounted: function (id) { var item = tree[id]; return item ? item.isMounted : false; }, getCurrentStackAddendum: function (topElement) { var info = ''; if (topElement) { var type = topElement.type; var name = typeof type === 'function' ? type.displayName || type.name : type; var owner = topElement._owner; info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName()); } var currentOwner = ReactCurrentOwner.current; var id = currentOwner && currentOwner._debugID; info += ReactComponentTreeDevtool.getStackAddendumByID(id); return info; }, getStackAddendumByID: function (id) { var info = ''; while (id) { info += describeID(id); id = ReactComponentTreeDevtool.getParentID(id); } return info; }, getChildIDs: function (id) { var item = tree[id]; return item ? item.childIDs : []; }, getDisplayName: function (id) { var item = tree[id]; return item ? item.displayName : 'Unknown'; }, getElement: function (id) { var item = tree[id]; return item ? item.element : null; }, getOwnerID: function (id) { var item = tree[id]; return item ? item.ownerID : null; }, getParentID: function (id) { var item = tree[id]; return item ? item.parentID : null; }, getSource: function (id) { var item = tree[id]; var element = item ? item.element : null; var source = element != null ? element._source : null; return source; }, getText: function (id) { var item = tree[id]; return item ? item.text : null; }, getUpdateCount: function (id) { var item = tree[id]; return item ? item.updateCount : 0; }, getRootIDs: function () { return Object.keys(rootIDs); }, getRegisteredIDs: function () { return Object.keys(tree); } }; module.exports = ReactComponentTreeDevtool; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule checkReactTypeSpec */ 'use strict'; var _prodInvariant = __webpack_require__(7); var ReactPropTypeLocationNames = __webpack_require__(24); var ReactPropTypesSecret = __webpack_require__(31); var invariant = __webpack_require__(8); var warning = __webpack_require__(11); var ReactComponentTreeDevtool; if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { // Temporary hack. // Inline requires don't work well with Jest: // https://github.com/facebook/react/issues/7240 // Remove the inline requires when we don't need them anymore: // https://github.com/facebook/react/pull/7178 ReactComponentTreeDevtool = __webpack_require__(29); } var loggedTypeFailures = {}; /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?object} element The React element that is being type-checked * @param {?number} debugID The React component instance that is being type-checked * @private */ function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { for (var typeSpecName in typeSpecs) { if (typeSpecs.hasOwnProperty(typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var componentStackInfo = ''; if (process.env.NODE_ENV !== 'production') { if (!ReactComponentTreeDevtool) { ReactComponentTreeDevtool = __webpack_require__(29); } if (debugID !== null) { componentStackInfo = ReactComponentTreeDevtool.getStackAddendumByID(debugID); } else if (element !== null) { componentStackInfo = ReactComponentTreeDevtool.getCurrentStackAddendum(element); } } process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; } } } } module.exports = checkReactTypeSpec; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 31 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypesSecret */ 'use strict'; var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypes */ 'use strict'; var ReactElement = __webpack_require__(9); var ReactPropTypeLocationNames = __webpack_require__(24); var ReactPropTypesSecret = __webpack_require__(31); var emptyFunction = __webpack_require__(12); var getIteratorFn = __webpack_require__(15); var warning = __webpack_require__(11); /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<>'; var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== 'production') { var manualPropTypeCallCache = {}; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (process.env.NODE_ENV !== 'production') { if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { var cacheKey = componentName + ':' + propName; if (!manualPropTypeCallCache[cacheKey]) { process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be ' + 'seeing this warning due to a third-party PropTypes library. ' + 'See https://fb.me/react-warning-dont-call-proptypes for details.', propFullName, componentName) : void 0; manualPropTypeCallCache[cacheKey] = true; } } } if (props[propName] == null) { var locationName = ReactPropTypeLocationNames[location]; if (isRequired) { return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { var locationName = ReactPropTypeLocationNames[location]; // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunction.thatReturns(null)); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var locationName = ReactPropTypeLocationNames[location]; var propType = getPropType(propValue); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactElement.isValidElement(propValue)) { var locationName = ReactPropTypeLocationNames[location]; var propType = getPropType(propValue); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var locationName = ReactPropTypeLocationNames[location]; var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; return emptyFunction.thatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var locationName = ReactPropTypeLocationNames[location]; var valuesString = JSON.stringify(expectedValues); return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (propValue.hasOwnProperty(key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; return emptyFunction.thatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { return null; } } var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { var locationName = ReactPropTypeLocationNames[location]; return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || ReactElement.isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } module.exports = ReactPropTypes; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 33 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactVersion */ 'use strict'; module.exports = '15.3.0'; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule onlyChild */ 'use strict'; var _prodInvariant = __webpack_require__(7); var ReactElement = __webpack_require__(9); var invariant = __webpack_require__(8); /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only * * The current implementation of this function assumes that a single child gets * passed without a wrapper, but the purpose of this helper function is to * abstract away the particular structure of children. * * @param {?object} children Child collection structure. * @return {ReactElement} The first and only `ReactElement` contained in the * structure. */ function onlyChild(children) { !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : _prodInvariant('23') : void 0; return children; } module.exports = onlyChild; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(36); /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOM */ /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/ 'use strict'; var ReactDOMComponentTree = __webpack_require__(37); var ReactDefaultInjection = __webpack_require__(40); var ReactMount = __webpack_require__(167); var ReactReconciler = __webpack_require__(60); var ReactUpdates = __webpack_require__(57); var ReactVersion = __webpack_require__(33); var findDOMNode = __webpack_require__(172); var getHostComponentFromComposite = __webpack_require__(173); var renderSubtreeIntoContainer = __webpack_require__(174); var warning = __webpack_require__(11); ReactDefaultInjection.inject(); var ReactDOM = { findDOMNode: findDOMNode, render: ReactMount.render, unmountComponentAtNode: ReactMount.unmountComponentAtNode, version: ReactVersion, /* eslint-disable camelcase */ unstable_batchedUpdates: ReactUpdates.batchedUpdates, unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer }; // Inject the runtime into a devtools global hook regardless of browser. // Allows for debugging when the hook is injected on the page. /* eslint-enable camelcase */ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ ComponentTree: { getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode, getNodeFromInstance: function (inst) { // inst is an internal instance (but could be a composite) if (inst._renderedComponent) { inst = getHostComponentFromComposite(inst); } if (inst) { return ReactDOMComponentTree.getNodeFromInstance(inst); } else { return null; } } }, Mount: ReactMount, Reconciler: ReactReconciler }); } if (process.env.NODE_ENV !== 'production') { var ExecutionEnvironment = __webpack_require__(50); if (ExecutionEnvironment.canUseDOM && window.top === window.self) { // First check if devtools is not installed if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { // If we're in Chrome or Firefox, provide a download link if not installed. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { // Firefox does not have the issue with devtools loaded over file:// var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1; console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools'); } } var testFunc = function testFn() {}; process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0; // If we're in IE8, check to see if we are in compatibility mode and provide // information on preventing compatibility mode var ieCompatibilityMode = document.documentMode && document.documentMode < 8; process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '') : void 0; var expectedFeatures = [ // shims Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim]; for (var i = 0; i < expectedFeatures.length; i++) { if (!expectedFeatures[i]) { process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0; break; } } } } module.exports = ReactDOM; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMComponentTree */ 'use strict'; var _prodInvariant = __webpack_require__(7); var DOMProperty = __webpack_require__(38); var ReactDOMComponentFlags = __webpack_require__(39); var invariant = __webpack_require__(8); var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; var Flags = ReactDOMComponentFlags; var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); /** * Drill down (through composites and empty components) until we get a host or * host text component. * * This is pretty polymorphic but unavoidable with the current structure we have * for `_renderedChildren`. */ function getRenderedHostOrTextFromComponent(component) { var rendered; while (rendered = component._renderedComponent) { component = rendered; } return component; } /** * Populate `_hostNode` on the rendered host/text component with the given * DOM node. The passed `inst` can be a composite. */ function precacheNode(inst, node) { var hostInst = getRenderedHostOrTextFromComponent(inst); hostInst._hostNode = node; node[internalInstanceKey] = hostInst; } function uncacheNode(inst) { var node = inst._hostNode; if (node) { delete node[internalInstanceKey]; inst._hostNode = null; } } /** * Populate `_hostNode` on each child of `inst`, assuming that the children * match up with the DOM (element) children of `node`. * * We cache entire levels at once to avoid an n^2 problem where we access the * children of a node sequentially and have to walk from the start to our target * node every time. * * Since we update `_renderedChildren` and the actual DOM at (slightly) * different times, we could race here and see a newer `_renderedChildren` than * the DOM nodes we see. To avoid this, ReactMultiChild calls * `prepareToManageChildren` before we change `_renderedChildren`, at which * time the container's child nodes are always cached (until it unmounts). */ function precacheChildNodes(inst, node) { if (inst._flags & Flags.hasCachedChildNodes) { return; } var children = inst._renderedChildren; var childNode = node.firstChild; outer: for (var name in children) { if (!children.hasOwnProperty(name)) { continue; } var childInst = children[name]; var childID = getRenderedHostOrTextFromComponent(childInst)._domID; if (childID == null) { // We're currently unmounting this child in ReactMultiChild; skip it. continue; } // We assume the child nodes are in the same order as the child instances. for (; childNode !== null; childNode = childNode.nextSibling) { if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') { precacheNode(childInst, childNode); continue outer; } } // We reached the end of the DOM children without finding an ID match. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0; } inst._flags |= Flags.hasCachedChildNodes; } /** * Given a DOM node, return the closest ReactDOMComponent or * ReactDOMTextComponent instance ancestor. */ function getClosestInstanceFromNode(node) { if (node[internalInstanceKey]) { return node[internalInstanceKey]; } // Walk up the tree until we find an ancestor whose instance we have cached. var parents = []; while (!node[internalInstanceKey]) { parents.push(node); if (node.parentNode) { node = node.parentNode; } else { // Top of the tree. This node must not be part of a React tree (or is // unmounted, potentially). return null; } } var closest; var inst; for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) { closest = inst; if (parents.length) { precacheChildNodes(inst, node); } } return closest; } /** * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent * instance, or null if the node was not rendered by this React. */ function getInstanceFromNode(node) { var inst = getClosestInstanceFromNode(node); if (inst != null && inst._hostNode === node) { return inst; } else { return null; } } /** * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding * DOM node. */ function getNodeFromInstance(inst) { // Without this first invariant, passing a non-DOM-component triggers the next // invariant for a missing parent, which is super confusing. !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0; if (inst._hostNode) { return inst._hostNode; } // Walk up the tree until we find an ancestor whose DOM node we have cached. var parents = []; while (!inst._hostNode) { parents.push(inst); !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0; inst = inst._hostParent; } // Now parents contains each ancestor that does *not* have a cached native // node, and `inst` is the deepest ancestor that does. for (; parents.length; inst = parents.pop()) { precacheChildNodes(inst, inst._hostNode); } return inst._hostNode; } var ReactDOMComponentTree = { getClosestInstanceFromNode: getClosestInstanceFromNode, getInstanceFromNode: getInstanceFromNode, getNodeFromInstance: getNodeFromInstance, precacheChildNodes: precacheChildNodes, precacheNode: precacheNode, uncacheNode: uncacheNode }; module.exports = ReactDOMComponentTree; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMProperty */ 'use strict'; var _prodInvariant = __webpack_require__(7); var invariant = __webpack_require__(8); function checkMask(value, bitmask) { return (value & bitmask) === bitmask; } var DOMPropertyInjection = { /** * Mapping from normalized, camelcased property names to a configuration that * specifies how the associated DOM property should be accessed or rendered. */ MUST_USE_PROPERTY: 0x1, HAS_BOOLEAN_VALUE: 0x4, HAS_NUMERIC_VALUE: 0x8, HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8, HAS_OVERLOADED_BOOLEAN_VALUE: 0x20, /** * Inject some specialized knowledge about the DOM. This takes a config object * with the following properties: * * isCustomAttribute: function that given an attribute name will return true * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* * attributes where it's impossible to enumerate all of the possible * attribute names, * * Properties: object mapping DOM property name to one of the * DOMPropertyInjection constants or null. If your attribute isn't in here, * it won't get written to the DOM. * * DOMAttributeNames: object mapping React attribute name to the DOM * attribute name. Attribute names not specified use the **lowercase** * normalized name. * * DOMAttributeNamespaces: object mapping React attribute name to the DOM * attribute namespace URL. (Attribute names not specified use no namespace.) * * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. * Property names not specified use the normalized name. * * DOMMutationMethods: Properties that require special mutation methods. If * `value` is undefined, the mutation method should unset the property. * * @param {object} domPropertyConfig the config as described above. */ injectDOMPropertyConfig: function (domPropertyConfig) { var Injection = DOMPropertyInjection; var Properties = domPropertyConfig.Properties || {}; var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {}; var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; if (domPropertyConfig.isCustomAttribute) { DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute); } for (var propName in Properties) { !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0; var lowerCased = propName.toLowerCase(); var propConfig = Properties[propName]; var propertyInfo = { attributeName: lowerCased, attributeNamespace: null, propertyName: propName, mutationMethod: null, mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY), hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE), hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE), hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE), hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE) }; !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0; if (process.env.NODE_ENV !== 'production') { DOMProperty.getPossibleStandardName[lowerCased] = propName; } if (DOMAttributeNames.hasOwnProperty(propName)) { var attributeName = DOMAttributeNames[propName]; propertyInfo.attributeName = attributeName; if (process.env.NODE_ENV !== 'production') { DOMProperty.getPossibleStandardName[attributeName] = propName; } } if (DOMAttributeNamespaces.hasOwnProperty(propName)) { propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName]; } if (DOMPropertyNames.hasOwnProperty(propName)) { propertyInfo.propertyName = DOMPropertyNames[propName]; } if (DOMMutationMethods.hasOwnProperty(propName)) { propertyInfo.mutationMethod = DOMMutationMethods[propName]; } DOMProperty.properties[propName] = propertyInfo; } } }; /* eslint-disable max-len */ var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD'; /* eslint-enable max-len */ /** * DOMProperty exports lookup objects that can be used like functions: * * > DOMProperty.isValid['id'] * true * > DOMProperty.isValid['foobar'] * undefined * * Although this may be confusing, it performs better in general. * * @see http://jsperf.com/key-exists * @see http://jsperf.com/key-missing */ var DOMProperty = { ID_ATTRIBUTE_NAME: 'data-reactid', ROOT_ATTRIBUTE_NAME: 'data-reactroot', ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR, ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040', /** * Map from property "standard name" to an object with info about how to set * the property in the DOM. Each object contains: * * attributeName: * Used when rendering markup or with `*Attribute()`. * attributeNamespace * propertyName: * Used on DOM node instances. (This includes properties that mutate due to * external factors.) * mutationMethod: * If non-null, used instead of the property or `setAttribute()` after * initial render. * mustUseProperty: * Whether the property must be accessed and mutated as an object property. * hasBooleanValue: * Whether the property should be removed when set to a falsey value. * hasNumericValue: * Whether the property must be numeric or parse as a numeric and should be * removed when set to a falsey value. * hasPositiveNumericValue: * Whether the property must be positive numeric or parse as a positive * numeric and should be removed when set to a falsey value. * hasOverloadedBooleanValue: * Whether the property can be used as a flag as well as with a value. * Removed when strictly equal to false; present without a value when * strictly equal to true; present with a value otherwise. */ properties: {}, /** * Mapping from lowercase property names to the properly cased version, used * to warn in the case of missing properties. Available only in __DEV__. * @type {Object} */ getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null, /** * All of the isCustomAttribute() functions that have been injected. */ _isCustomAttributeFunctions: [], /** * Checks whether a property name is a custom attribute. * @method */ isCustomAttribute: function (attributeName) { for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; if (isCustomAttributeFn(attributeName)) { return true; } } return false; }, injection: DOMPropertyInjection }; module.exports = DOMProperty; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 39 */ /***/ function(module, exports) { /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMComponentFlags */ 'use strict'; var ReactDOMComponentFlags = { hasCachedChildNodes: 1 << 0 }; module.exports = ReactDOMComponentFlags; /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDefaultInjection */ 'use strict'; var BeforeInputEventPlugin = __webpack_require__(41); var ChangeEventPlugin = __webpack_require__(56); var DefaultEventPluginOrder = __webpack_require__(74); var EnterLeaveEventPlugin = __webpack_require__(75); var HTMLDOMPropertyConfig = __webpack_require__(80); var ReactComponentBrowserEnvironment = __webpack_require__(81); var ReactDOMComponent = __webpack_require__(95); var ReactDOMComponentTree = __webpack_require__(37); var ReactDOMEmptyComponent = __webpack_require__(138); var ReactDOMTreeTraversal = __webpack_require__(139); var ReactDOMTextComponent = __webpack_require__(140); var ReactDefaultBatchingStrategy = __webpack_require__(141); var ReactEventListener = __webpack_require__(142); var ReactInjection = __webpack_require__(145); var ReactReconcileTransaction = __webpack_require__(146); var SVGDOMPropertyConfig = __webpack_require__(154); var SelectEventPlugin = __webpack_require__(155); var SimpleEventPlugin = __webpack_require__(156); var alreadyInjected = false; function inject() { if (alreadyInjected) { // TODO: This is currently true because these injections are shared between // the client and the server package. They should be built independently // and not share any injection state. Then this problem will be solved. return; } alreadyInjected = true; ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener); /** * Inject modules for resolving DOM hierarchy and plugin ordering. */ ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder); ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree); ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal); /** * Some important event plugins included by default (without having to require * them). */ ReactInjection.EventPluginHub.injectEventPluginsByName({ SimpleEventPlugin: SimpleEventPlugin, EnterLeaveEventPlugin: EnterLeaveEventPlugin, ChangeEventPlugin: ChangeEventPlugin, SelectEventPlugin: SelectEventPlugin, BeforeInputEventPlugin: BeforeInputEventPlugin }); ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent); ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent); ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) { return new ReactDOMEmptyComponent(instantiate); }); ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction); ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy); ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); } module.exports = { inject: inject }; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule BeforeInputEventPlugin */ 'use strict'; var EventConstants = __webpack_require__(42); var EventPropagators = __webpack_require__(43); var ExecutionEnvironment = __webpack_require__(50); var FallbackCompositionState = __webpack_require__(51); var SyntheticCompositionEvent = __webpack_require__(53); var SyntheticInputEvent = __webpack_require__(55); var keyOf = __webpack_require__(25); var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window; var documentMode = null; if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) { documentMode = document.documentMode; } // Webkit offers a very useful `textInput` event that can be used to // directly represent `beforeInput`. The IE `textinput` event is not as // useful, so we don't use it. var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto(); // In IE9+, we have access to composition events, but the data supplied // by the native compositionend event may be incorrect. Japanese ideographic // spaces, for instance (\u3000) are not recorded correctly. var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); /** * Opera <= 12 includes TextEvent in window, but does not fire * text input events. Rely on keypress instead. */ function isPresto() { var opera = window.opera; return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; } var SPACEBAR_CODE = 32; var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); var topLevelTypes = EventConstants.topLevelTypes; // Events and their corresponding property names. var eventTypes = { beforeInput: { phasedRegistrationNames: { bubbled: keyOf({ onBeforeInput: null }), captured: keyOf({ onBeforeInputCapture: null }) }, dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste] }, compositionEnd: { phasedRegistrationNames: { bubbled: keyOf({ onCompositionEnd: null }), captured: keyOf({ onCompositionEndCapture: null }) }, dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] }, compositionStart: { phasedRegistrationNames: { bubbled: keyOf({ onCompositionStart: null }), captured: keyOf({ onCompositionStartCapture: null }) }, dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] }, compositionUpdate: { phasedRegistrationNames: { bubbled: keyOf({ onCompositionUpdate: null }), captured: keyOf({ onCompositionUpdateCapture: null }) }, dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] } }; // Track whether we've ever handled a keypress on the space key. var hasSpaceKeypress = false; /** * Return whether a native keypress event is assumed to be a command. * This is required because Firefox fires `keypress` events for key commands * (cut, copy, select-all, etc.) even though no character is inserted. */ function isKeypressCommand(nativeEvent) { return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey && nativeEvent.altKey); } /** * Translate native top level events into event types. * * @param {string} topLevelType * @return {object} */ function getCompositionEventType(topLevelType) { switch (topLevelType) { case topLevelTypes.topCompositionStart: return eventTypes.compositionStart; case topLevelTypes.topCompositionEnd: return eventTypes.compositionEnd; case topLevelTypes.topCompositionUpdate: return eventTypes.compositionUpdate; } } /** * Does our fallback best-guess model think this event signifies that * composition has begun? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean} */ function isFallbackCompositionStart(topLevelType, nativeEvent) { return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE; } /** * Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean} */ function isFallbackCompositionEnd(topLevelType, nativeEvent) { switch (topLevelType) { case topLevelTypes.topKeyUp: // Command keys insert or clear IME input. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; case topLevelTypes.topKeyDown: // Expect IME keyCode on each keydown. If we get any other // code we must have exited earlier. return nativeEvent.keyCode !== START_KEYCODE; case topLevelTypes.topKeyPress: case topLevelTypes.topMouseDown: case topLevelTypes.topBlur: // Events are not possible without cancelling IME. return true; default: return false; } } /** * Google Input Tools provides composition data via a CustomEvent, * with the `data` property populated in the `detail` object. If this * is available on the event object, use it. If not, this is a plain * composition event and we have nothing special to extract. * * @param {object} nativeEvent * @return {?string} */ function getDataFromCustomEvent(nativeEvent) { var detail = nativeEvent.detail; if (typeof detail === 'object' && 'data' in detail) { return detail.data; } return null; } // Track the current IME composition fallback object, if any. var currentComposition = null; /** * @return {?object} A SyntheticCompositionEvent. */ function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { var eventType; var fallbackData; if (canUseCompositionEvent) { eventType = getCompositionEventType(topLevelType); } else if (!currentComposition) { if (isFallbackCompositionStart(topLevelType, nativeEvent)) { eventType = eventTypes.compositionStart; } } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { eventType = eventTypes.compositionEnd; } if (!eventType) { return null; } if (useFallbackCompositionData) { // The current composition is stored statically and must not be // overwritten while composition continues. if (!currentComposition && eventType === eventTypes.compositionStart) { currentComposition = FallbackCompositionState.getPooled(nativeEventTarget); } else if (eventType === eventTypes.compositionEnd) { if (currentComposition) { fallbackData = currentComposition.getData(); } } } var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget); if (fallbackData) { // Inject data generated from fallback path into the synthetic event. // This matches the property of native CompositionEventInterface. event.data = fallbackData; } else { var customData = getDataFromCustomEvent(nativeEvent); if (customData !== null) { event.data = customData; } } EventPropagators.accumulateTwoPhaseDispatches(event); return event; } /** * @param {string} topLevelType Record from `EventConstants`. * @param {object} nativeEvent Native browser event. * @return {?string} The string corresponding to this `beforeInput` event. */ function getNativeBeforeInputChars(topLevelType, nativeEvent) { switch (topLevelType) { case topLevelTypes.topCompositionEnd: return getDataFromCustomEvent(nativeEvent); case topLevelTypes.topKeyPress: /** * If native `textInput` events are available, our goal is to make * use of them. However, there is a special case: the spacebar key. * In Webkit, preventing default on a spacebar `textInput` event * cancels character insertion, but it *also* causes the browser * to fall back to its default spacebar behavior of scrolling the * page. * * Tracking at: * https://code.google.com/p/chromium/issues/detail?id=355103 * * To avoid this issue, use the keypress event as if no `textInput` * event is available. */ var which = nativeEvent.which; if (which !== SPACEBAR_CODE) { return null; } hasSpaceKeypress = true; return SPACEBAR_CHAR; case topLevelTypes.topTextInput: // Record the characters to be added to the DOM. var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled // it at the keypress level and bail immediately. Android Chrome // doesn't give us keycodes, so we need to blacklist it. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { return null; } return chars; default: // For other native event types, do nothing. return null; } } /** * For browsers that do not provide the `textInput` event, extract the * appropriate string to use for SyntheticInputEvent. * * @param {string} topLevelType Record from `EventConstants`. * @param {object} nativeEvent Native browser event. * @return {?string} The fallback string for this `beforeInput` event. */ function getFallbackBeforeInputChars(topLevelType, nativeEvent) { // If we are currently composing (IME) and using a fallback to do so, // try to extract the composed characters from the fallback object. if (currentComposition) { if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) { var chars = currentComposition.getData(); FallbackCompositionState.release(currentComposition); currentComposition = null; return chars; } return null; } switch (topLevelType) { case topLevelTypes.topPaste: // If a paste event occurs after a keypress, throw out the input // chars. Paste events should not lead to BeforeInput events. return null; case topLevelTypes.topKeyPress: /** * As of v27, Firefox may fire keypress events even when no character * will be inserted. A few possibilities: * * - `which` is `0`. Arrow keys, Esc key, etc. * * - `which` is the pressed key code, but no char is available. * Ex: 'AltGr + d` in Polish. There is no modified character for * this key combination and no character is inserted into the * document, but FF fires the keypress for char code `100` anyway. * No `input` event will occur. * * - `which` is the pressed key code, but a command combination is * being used. Ex: `Cmd+C`. No character is inserted, and no * `input` event will occur. */ if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { return String.fromCharCode(nativeEvent.which); } return null; case topLevelTypes.topCompositionEnd: return useFallbackCompositionData ? null : nativeEvent.data; default: return null; } } /** * Extract a SyntheticInputEvent for `beforeInput`, based on either native * `textInput` or fallback behavior. * * @return {?object} A SyntheticInputEvent. */ function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { var chars; if (canUseTextInputEvent) { chars = getNativeBeforeInputChars(topLevelType, nativeEvent); } else { chars = getFallbackBeforeInputChars(topLevelType, nativeEvent); } // If no characters are being inserted, no BeforeInput event should // be fired. if (!chars) { return null; } var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget); event.data = chars; EventPropagators.accumulateTwoPhaseDispatches(event); return event; } /** * Create an `onBeforeInput` event to match * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. * * This event plugin is based on the native `textInput` event * available in Chrome, Safari, Opera, and IE. This event fires after * `onKeyPress` and `onCompositionEnd`, but before `onInput`. * * `beforeInput` is spec'd but not implemented in any browsers, and * the `input` event does not provide any useful information about what has * actually been added, contrary to the spec. Thus, `textInput` is the best * available event to identify the characters that have actually been inserted * into the target node. * * This plugin is also responsible for emitting `composition` events, thus * allowing us to share composition fallback code for both `beforeInput` and * `composition` event types. */ var BeforeInputEventPlugin = { eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)]; } }; module.exports = BeforeInputEventPlugin; /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventConstants */ 'use strict'; var keyMirror = __webpack_require__(23); var PropagationPhases = keyMirror({ bubbled: null, captured: null }); /** * Types of raw signals from the browser caught at the top level. */ var topLevelTypes = keyMirror({ topAbort: null, topAnimationEnd: null, topAnimationIteration: null, topAnimationStart: null, topBlur: null, topCanPlay: null, topCanPlayThrough: null, topChange: null, topClick: null, topCompositionEnd: null, topCompositionStart: null, topCompositionUpdate: null, topContextMenu: null, topCopy: null, topCut: null, topDoubleClick: null, topDrag: null, topDragEnd: null, topDragEnter: null, topDragExit: null, topDragLeave: null, topDragOver: null, topDragStart: null, topDrop: null, topDurationChange: null, topEmptied: null, topEncrypted: null, topEnded: null, topError: null, topFocus: null, topInput: null, topInvalid: null, topKeyDown: null, topKeyPress: null, topKeyUp: null, topLoad: null, topLoadedData: null, topLoadedMetadata: null, topLoadStart: null, topMouseDown: null, topMouseMove: null, topMouseOut: null, topMouseOver: null, topMouseUp: null, topPaste: null, topPause: null, topPlay: null, topPlaying: null, topProgress: null, topRateChange: null, topReset: null, topScroll: null, topSeeked: null, topSeeking: null, topSelectionChange: null, topStalled: null, topSubmit: null, topSuspend: null, topTextInput: null, topTimeUpdate: null, topTouchCancel: null, topTouchEnd: null, topTouchMove: null, topTouchStart: null, topTransitionEnd: null, topVolumeChange: null, topWaiting: null, topWheel: null }); var EventConstants = { topLevelTypes: topLevelTypes, PropagationPhases: PropagationPhases }; module.exports = EventConstants; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPropagators */ 'use strict'; var EventConstants = __webpack_require__(42); var EventPluginHub = __webpack_require__(44); var EventPluginUtils = __webpack_require__(46); var accumulateInto = __webpack_require__(48); var forEachAccumulated = __webpack_require__(49); var warning = __webpack_require__(11); var PropagationPhases = EventConstants.PropagationPhases; var getListener = EventPluginHub.getListener; /** * Some event types have a notion of different registration names for different * "phases" of propagation. This finds listeners by a given phase. */ function listenerAtPhase(inst, event, propagationPhase) { var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; return getListener(inst, registrationName); } /** * Tags a `SyntheticEvent` with dispatched listeners. Creating this function * here, allows us to not have to bind or create functions for each event. * Mutating the event's members allows us to not have to create a wrapping * "dispatch" object that pairs the event with the listener. */ function accumulateDirectionalDispatches(inst, upwards, event) { if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0; } var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured; var listener = listenerAtPhase(inst, event, phase); if (listener) { event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); } } /** * Collect dispatches (must be entirely collected before dispatching - see unit * tests). Lazily allocate the array to conserve memory. We must loop through * each event and perform the traversal for each one. We cannot perform a * single traversal for the entire collection of events because each event may * have a different target. */ function accumulateTwoPhaseDispatchesSingle(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); } } /** * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. */ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { if (event && event.dispatchConfig.phasedRegistrationNames) { var targetInst = event._targetInst; var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null; EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); } } /** * Accumulates without regard to direction, does not look for phased * registration names. Same as `accumulateDirectDispatchesSingle` but without * requiring that the `dispatchMarker` be the same as the dispatched ID. */ function accumulateDispatches(inst, ignoredDirection, event) { if (event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName; var listener = getListener(inst, registrationName); if (listener) { event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); } } } /** * Accumulates dispatches on an `SyntheticEvent`, but only for the * `dispatchMarker`. * @param {SyntheticEvent} event */ function accumulateDirectDispatchesSingle(event) { if (event && event.dispatchConfig.registrationName) { accumulateDispatches(event._targetInst, null, event); } } function accumulateTwoPhaseDispatches(events) { forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); } function accumulateTwoPhaseDispatchesSkipTarget(events) { forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); } function accumulateEnterLeaveDispatches(leave, enter, from, to) { EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); } function accumulateDirectDispatches(events) { forEachAccumulated(events, accumulateDirectDispatchesSingle); } /** * A small set of propagation patterns, each of which will accept a small amount * of information, and generate a set of "dispatch ready event objects" - which * are sets of events that have already been annotated with a set of dispatched * listener functions/ids. The API is designed this way to discourage these * propagation strategies from actually executing the dispatches, since we * always want to collect the entire set of dispatches before executing event a * single one. * * @constructor EventPropagators */ var EventPropagators = { accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, accumulateDirectDispatches: accumulateDirectDispatches, accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches }; module.exports = EventPropagators; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPluginHub */ 'use strict'; var _prodInvariant = __webpack_require__(7); var EventPluginRegistry = __webpack_require__(45); var EventPluginUtils = __webpack_require__(46); var ReactErrorUtils = __webpack_require__(47); var accumulateInto = __webpack_require__(48); var forEachAccumulated = __webpack_require__(49); var invariant = __webpack_require__(8); /** * Internal store for event listeners */ var listenerBank = {}; /** * Internal queue of events that have accumulated their dispatches and are * waiting to have their dispatches executed. */ var eventQueue = null; /** * Dispatches an event and releases it back into the pool, unless persistent. * * @param {?object} event Synthetic event to be dispatched. * @param {boolean} simulated If the event is simulated (changes exn behavior) * @private */ var executeDispatchesAndRelease = function (event, simulated) { if (event) { EventPluginUtils.executeDispatchesInOrder(event, simulated); if (!event.isPersistent()) { event.constructor.release(event); } } }; var executeDispatchesAndReleaseSimulated = function (e) { return executeDispatchesAndRelease(e, true); }; var executeDispatchesAndReleaseTopLevel = function (e) { return executeDispatchesAndRelease(e, false); }; var getDictionaryKey = function (inst) { return '.' + inst._rootNodeID; }; /** * This is a unified interface for event plugins to be installed and configured. * * Event plugins can implement the following properties: * * `extractEvents` {function(string, DOMEventTarget, string, object): *} * Required. When a top-level event is fired, this method is expected to * extract synthetic events that will in turn be queued and dispatched. * * `eventTypes` {object} * Optional, plugins that fire events must publish a mapping of registration * names that are used to register listeners. Values of this mapping must * be objects that contain `registrationName` or `phasedRegistrationNames`. * * `executeDispatch` {function(object, function, string)} * Optional, allows plugins to override how an event gets dispatched. By * default, the listener is simply invoked. * * Each plugin that is injected into `EventsPluginHub` is immediately operable. * * @public */ var EventPluginHub = { /** * Methods for injecting dependencies. */ injection: { /** * @param {array} InjectedEventPluginOrder * @public */ injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, /** * @param {object} injectedNamesToPlugins Map from names to plugin modules. */ injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName }, /** * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent. * * @param {object} inst The instance, which is the source of events. * @param {string} registrationName Name of listener (e.g. `onClick`). * @param {function} listener The callback to store. */ putListener: function (inst, registrationName, listener) { !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0; var key = getDictionaryKey(inst); var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); bankForRegistrationName[key] = listener; var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; if (PluginModule && PluginModule.didPutListener) { PluginModule.didPutListener(inst, registrationName, listener); } }, /** * @param {object} inst The instance, which is the source of events. * @param {string} registrationName Name of listener (e.g. `onClick`). * @return {?function} The stored callback. */ getListener: function (inst, registrationName) { var bankForRegistrationName = listenerBank[registrationName]; var key = getDictionaryKey(inst); return bankForRegistrationName && bankForRegistrationName[key]; }, /** * Deletes a listener from the registration bank. * * @param {object} inst The instance, which is the source of events. * @param {string} registrationName Name of listener (e.g. `onClick`). */ deleteListener: function (inst, registrationName) { var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; if (PluginModule && PluginModule.willDeleteListener) { PluginModule.willDeleteListener(inst, registrationName); } var bankForRegistrationName = listenerBank[registrationName]; // TODO: This should never be null -- when is it? if (bankForRegistrationName) { var key = getDictionaryKey(inst); delete bankForRegistrationName[key]; } }, /** * Deletes all listeners for the DOM element with the supplied ID. * * @param {object} inst The instance, which is the source of events. */ deleteAllListeners: function (inst) { var key = getDictionaryKey(inst); for (var registrationName in listenerBank) { if (!listenerBank.hasOwnProperty(registrationName)) { continue; } if (!listenerBank[registrationName][key]) { continue; } var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; if (PluginModule && PluginModule.willDeleteListener) { PluginModule.willDeleteListener(inst, registrationName); } delete listenerBank[registrationName][key]; } }, /** * Allows registered plugins an opportunity to extract events from top-level * native browser events. * * @return {*} An accumulation of synthetic events. * @internal */ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { var events; var plugins = EventPluginRegistry.plugins; for (var i = 0; i < plugins.length; i++) { // Not every plugin in the ordering may be loaded at runtime. var possiblePlugin = plugins[i]; if (possiblePlugin) { var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); if (extractedEvents) { events = accumulateInto(events, extractedEvents); } } } return events; }, /** * Enqueues a synthetic event that should be dispatched when * `processEventQueue` is invoked. * * @param {*} events An accumulation of synthetic events. * @internal */ enqueueEvents: function (events) { if (events) { eventQueue = accumulateInto(eventQueue, events); } }, /** * Dispatches all synthetic events on the event queue. * * @internal */ processEventQueue: function (simulated) { // Set `eventQueue` to null before processing it so that we can tell if more // events get enqueued while processing. var processingEventQueue = eventQueue; eventQueue = null; if (simulated) { forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); } else { forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); } !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0; // This would be a good time to rethrow if any of the event handlers threw. ReactErrorUtils.rethrowCaughtError(); }, /** * These are needed for tests only. Do not use! */ __purge: function () { listenerBank = {}; }, __getListenerBank: function () { return listenerBank; } }; module.exports = EventPluginHub; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPluginRegistry */ 'use strict'; var _prodInvariant = __webpack_require__(7); var invariant = __webpack_require__(8); /** * Injectable ordering of event plugins. */ var EventPluginOrder = null; /** * Injectable mapping from names to event plugin modules. */ var namesToPlugins = {}; /** * Recomputes the plugin list using the injected plugins and plugin ordering. * * @private */ function recomputePluginOrdering() { if (!EventPluginOrder) { // Wait until an `EventPluginOrder` is injected. return; } for (var pluginName in namesToPlugins) { var PluginModule = namesToPlugins[pluginName]; var pluginIndex = EventPluginOrder.indexOf(pluginName); !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0; if (EventPluginRegistry.plugins[pluginIndex]) { continue; } !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0; EventPluginRegistry.plugins[pluginIndex] = PluginModule; var publishedEvents = PluginModule.eventTypes; for (var eventName in publishedEvents) { !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0; } } } /** * Publishes an event so that it can be dispatched by the supplied plugin. * * @param {object} dispatchConfig Dispatch configuration for the event. * @param {object} PluginModule Plugin publishing the event. * @return {boolean} True if the event was successfully published. * @private */ function publishEventForPlugin(dispatchConfig, PluginModule, eventName) { !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0; EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; if (phasedRegistrationNames) { for (var phaseName in phasedRegistrationNames) { if (phasedRegistrationNames.hasOwnProperty(phaseName)) { var phasedRegistrationName = phasedRegistrationNames[phaseName]; publishRegistrationName(phasedRegistrationName, PluginModule, eventName); } } return true; } else if (dispatchConfig.registrationName) { publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName); return true; } return false; } /** * Publishes a registration name that is used to identify dispatched events and * can be used with `EventPluginHub.putListener` to register listeners. * * @param {string} registrationName Registration name to add. * @param {object} PluginModule Plugin publishing the event. * @private */ function publishRegistrationName(registrationName, PluginModule, eventName) { !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0; EventPluginRegistry.registrationNameModules[registrationName] = PluginModule; EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies; if (process.env.NODE_ENV !== 'production') { var lowerCasedName = registrationName.toLowerCase(); EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName; if (registrationName === 'onDoubleClick') { EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName; } } } /** * Registers plugins so that they can extract and dispatch events. * * @see {EventPluginHub} */ var EventPluginRegistry = { /** * Ordered list of injected plugins. */ plugins: [], /** * Mapping from event name to dispatch config */ eventNameDispatchConfigs: {}, /** * Mapping from registration name to plugin module */ registrationNameModules: {}, /** * Mapping from registration name to event name */ registrationNameDependencies: {}, /** * Mapping from lowercase registration names to the properly cased version, * used to warn in the case of missing event handlers. Available * only in __DEV__. * @type {Object} */ possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null, /** * Injects an ordering of plugins (by plugin name). This allows the ordering * to be decoupled from injection of the actual plugins so that ordering is * always deterministic regardless of packaging, on-the-fly injection, etc. * * @param {array} InjectedEventPluginOrder * @internal * @see {EventPluginHub.injection.injectEventPluginOrder} */ injectEventPluginOrder: function (InjectedEventPluginOrder) { !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0; // Clone the ordering so it cannot be dynamically mutated. EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder); recomputePluginOrdering(); }, /** * Injects plugins to be used by `EventPluginHub`. The plugin names must be * in the ordering injected by `injectEventPluginOrder`. * * Plugins can be injected as part of page initialization or on-the-fly. * * @param {object} injectedNamesToPlugins Map from names to plugin modules. * @internal * @see {EventPluginHub.injection.injectEventPluginsByName} */ injectEventPluginsByName: function (injectedNamesToPlugins) { var isOrderingDirty = false; for (var pluginName in injectedNamesToPlugins) { if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { continue; } var PluginModule = injectedNamesToPlugins[pluginName]; if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) { !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0; namesToPlugins[pluginName] = PluginModule; isOrderingDirty = true; } } if (isOrderingDirty) { recomputePluginOrdering(); } }, /** * Looks up the plugin for the supplied event. * * @param {object} event A synthetic event. * @return {?object} The plugin that created the supplied event. * @internal */ getPluginModuleForEvent: function (event) { var dispatchConfig = event.dispatchConfig; if (dispatchConfig.registrationName) { return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; } for (var phase in dispatchConfig.phasedRegistrationNames) { if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) { continue; } var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]]; if (PluginModule) { return PluginModule; } } return null; }, /** * Exposed for unit testing. * @private */ _resetEventPlugins: function () { EventPluginOrder = null; for (var pluginName in namesToPlugins) { if (namesToPlugins.hasOwnProperty(pluginName)) { delete namesToPlugins[pluginName]; } } EventPluginRegistry.plugins.length = 0; var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs; for (var eventName in eventNameDispatchConfigs) { if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { delete eventNameDispatchConfigs[eventName]; } } var registrationNameModules = EventPluginRegistry.registrationNameModules; for (var registrationName in registrationNameModules) { if (registrationNameModules.hasOwnProperty(registrationName)) { delete registrationNameModules[registrationName]; } } if (process.env.NODE_ENV !== 'production') { var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames; for (var lowerCasedName in possibleRegistrationNames) { if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) { delete possibleRegistrationNames[lowerCasedName]; } } } } }; module.exports = EventPluginRegistry; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPluginUtils */ 'use strict'; var _prodInvariant = __webpack_require__(7); var EventConstants = __webpack_require__(42); var ReactErrorUtils = __webpack_require__(47); var invariant = __webpack_require__(8); var warning = __webpack_require__(11); /** * Injected dependencies: */ /** * - `ComponentTree`: [required] Module that can convert between React instances * and actual node references. */ var ComponentTree; var TreeTraversal; var injection = { injectComponentTree: function (Injected) { ComponentTree = Injected; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; } }, injectTreeTraversal: function (Injected) { TreeTraversal = Injected; if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0; } } }; var topLevelTypes = EventConstants.topLevelTypes; function isEndish(topLevelType) { return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel; } function isMoveish(topLevelType) { return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove; } function isStartish(topLevelType) { return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart; } var validateEventDispatches; if (process.env.NODE_ENV !== 'production') { validateEventDispatches = function (event) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; var listenersIsArr = Array.isArray(dispatchListeners); var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; var instancesIsArr = Array.isArray(dispatchInstances); var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0; }; } /** * Dispatch the event to the listener. * @param {SyntheticEvent} event SyntheticEvent to handle * @param {boolean} simulated If the event is simulated (changes exn behavior) * @param {function} listener Application-level callback * @param {*} inst Internal component instance */ function executeDispatch(event, simulated, listener, inst) { var type = event.type || 'unknown-event'; event.currentTarget = EventPluginUtils.getNodeFromInstance(inst); if (simulated) { ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event); } else { ReactErrorUtils.invokeGuardedCallback(type, listener, event); } event.currentTarget = null; } /** * Standard/simple iteration through an event's collected dispatches. */ function executeDispatchesInOrder(event, simulated) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; if (process.env.NODE_ENV !== 'production') { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; } // Listeners and Instances are two parallel arrays that are always in sync. executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); } } else if (dispatchListeners) { executeDispatch(event, simulated, dispatchListeners, dispatchInstances); } event._dispatchListeners = null; event._dispatchInstances = null; } /** * Standard/simple iteration through an event's collected dispatches, but stops * at the first dispatch execution returning true, and returns that id. * * @return {?string} id of the first dispatch execution who's listener returns * true, or null if no listener returned true. */ function executeDispatchesInOrderStopAtTrueImpl(event) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; if (process.env.NODE_ENV !== 'production') { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; } // Listeners and Instances are two parallel arrays that are always in sync. if (dispatchListeners[i](event, dispatchInstances[i])) { return dispatchInstances[i]; } } } else if (dispatchListeners) { if (dispatchListeners(event, dispatchInstances)) { return dispatchInstances; } } return null; } /** * @see executeDispatchesInOrderStopAtTrueImpl */ function executeDispatchesInOrderStopAtTrue(event) { var ret = executeDispatchesInOrderStopAtTrueImpl(event); event._dispatchInstances = null; event._dispatchListeners = null; return ret; } /** * Execution of a "direct" dispatch - there must be at most one dispatch * accumulated on the event or it is considered an error. It doesn't really make * sense for an event with multiple dispatches (bubbled) to keep track of the * return values at each dispatch execution, but it does tend to make sense when * dealing with "direct" dispatches. * * @return {*} The return value of executing the single dispatch. */ function executeDirectDispatch(event) { if (process.env.NODE_ENV !== 'production') { validateEventDispatches(event); } var dispatchListener = event._dispatchListeners; var dispatchInstance = event._dispatchInstances; !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0; event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; var res = dispatchListener ? dispatchListener(event) : null; event.currentTarget = null; event._dispatchListeners = null; event._dispatchInstances = null; return res; } /** * @param {SyntheticEvent} event * @return {boolean} True iff number of dispatches accumulated is greater than 0. */ function hasDispatches(event) { return !!event._dispatchListeners; } /** * General utilities that are useful in creating custom Event Plugins. */ var EventPluginUtils = { isEndish: isEndish, isMoveish: isMoveish, isStartish: isStartish, executeDirectDispatch: executeDirectDispatch, executeDispatchesInOrder: executeDispatchesInOrder, executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, hasDispatches: hasDispatches, getInstanceFromNode: function (node) { return ComponentTree.getInstanceFromNode(node); }, getNodeFromInstance: function (node) { return ComponentTree.getNodeFromInstance(node); }, isAncestor: function (a, b) { return TreeTraversal.isAncestor(a, b); }, getLowestCommonAncestor: function (a, b) { return TreeTraversal.getLowestCommonAncestor(a, b); }, getParentInstance: function (inst) { return TreeTraversal.getParentInstance(inst); }, traverseTwoPhase: function (target, fn, arg) { return TreeTraversal.traverseTwoPhase(target, fn, arg); }, traverseEnterLeave: function (from, to, fn, argFrom, argTo) { return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); }, injection: injection }; module.exports = EventPluginUtils; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactErrorUtils */ 'use strict'; var caughtError = null; /** * Call a function while guarding against errors that happens within it. * * @param {?String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} a First argument * @param {*} b Second argument */ function invokeGuardedCallback(name, func, a, b) { try { return func(a, b); } catch (x) { if (caughtError === null) { caughtError = x; } return undefined; } } var ReactErrorUtils = { invokeGuardedCallback: invokeGuardedCallback, /** * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event * handler are sure to be rethrown by rethrowCaughtError. */ invokeGuardedCallbackWithCatch: invokeGuardedCallback, /** * During execution of guarded functions we will capture the first error which * we will rethrow to be handled by the top level error handler. */ rethrowCaughtError: function () { if (caughtError) { var error = caughtError; caughtError = null; throw error; } } }; if (process.env.NODE_ENV !== 'production') { /** * To help development we can get better devtools integration by simulating a * real browser event. */ if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { var fakeNode = document.createElement('react'); ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) { var boundFunc = func.bind(null, a, b); var evtType = 'react-' + name; fakeNode.addEventListener(evtType, boundFunc, false); var evt = document.createEvent('Event'); evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); fakeNode.removeEventListener(evtType, boundFunc, false); }; } } module.exports = ReactErrorUtils; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule accumulateInto * */ 'use strict'; var _prodInvariant = __webpack_require__(7); var invariant = __webpack_require__(8); /** * Accumulates items that must not be null or undefined into the first one. This * is used to conserve memory by avoiding array allocations, and thus sacrifices * API cleanness. Since `current` can be null before being passed in and not * null after this function, make sure to assign it back to `current`: * * `a = accumulateInto(a, b);` * * This API should be sparingly used. Try `accumulate` for something cleaner. * * @return {*|array<*>} An accumulation of items. */ function accumulateInto(current, next) { !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0; if (current == null) { return next; } // Both are not empty. Warning: Never call x.concat(y) when you are not // certain that x is an Array (x could be a string with concat method). if (Array.isArray(current)) { if (Array.isArray(next)) { current.push.apply(current, next); return current; } current.push(next); return current; } if (Array.isArray(next)) { // A bit too dangerous to mutate `next`. return [current].concat(next); } return [current, next]; } module.exports = accumulateInto; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 49 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule forEachAccumulated * */ 'use strict'; /** * @param {array} arr an "accumulation" of items which is either an Array or * a single item. Useful when paired with the `accumulate` module. This is a * simple utility that allows us to reason about a collection of items, but * handling the case when there is exactly one item (and we do not need to * allocate an array). */ function forEachAccumulated(arr, cb, scope) { if (Array.isArray(arr)) { arr.forEach(cb, scope); } else if (arr) { cb.call(scope, arr); } } module.exports = forEachAccumulated; /***/ }, /* 50 */ /***/ function(module, exports) { /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule FallbackCompositionState */ 'use strict'; var _assign = __webpack_require__(4); var PooledClass = __webpack_require__(6); var getTextContentAccessor = __webpack_require__(52); /** * This helper class stores information about text content of a target node, * allowing comparison of content before and after a given event. * * Identify the node where selection currently begins, then observe * both its text content and its current position in the DOM. Since the * browser may natively replace the target node during composition, we can * use its position to find its replacement. * * @param {DOMEventTarget} root */ function FallbackCompositionState(root) { this._root = root; this._startText = this.getText(); this._fallbackText = null; } _assign(FallbackCompositionState.prototype, { destructor: function () { this._root = null; this._startText = null; this._fallbackText = null; }, /** * Get current text of input. * * @return {string} */ getText: function () { if ('value' in this._root) { return this._root.value; } return this._root[getTextContentAccessor()]; }, /** * Determine the differing substring between the initially stored * text content and the current content. * * @return {string} */ getData: function () { if (this._fallbackText) { return this._fallbackText; } var start; var startValue = this._startText; var startLength = startValue.length; var end; var endValue = this.getText(); var endLength = endValue.length; for (start = 0; start < startLength; start++) { if (startValue[start] !== endValue[start]) { break; } } var minEnd = startLength - start; for (end = 1; end <= minEnd; end++) { if (startValue[startLength - end] !== endValue[endLength - end]) { break; } } var sliceTail = end > 1 ? 1 - end : undefined; this._fallbackText = endValue.slice(start, sliceTail); return this._fallbackText; } }); PooledClass.addPoolingTo(FallbackCompositionState); module.exports = FallbackCompositionState; /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getTextContentAccessor */ 'use strict'; var ExecutionEnvironment = __webpack_require__(50); var contentKey = null; /** * Gets the key used to access text content on a DOM node. * * @return {?string} Key used to access text content. * @internal */ function getTextContentAccessor() { if (!contentKey && ExecutionEnvironment.canUseDOM) { // Prefer textContent to innerText because many browsers support both but // SVG elements don't support innerText even when
does. contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; } return contentKey; } module.exports = getTextContentAccessor; /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticCompositionEvent */ 'use strict'; var SyntheticEvent = __webpack_require__(54); /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents */ var CompositionEventInterface = { data: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); } SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); module.exports = SyntheticCompositionEvent; /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticEvent */ 'use strict'; var _assign = __webpack_require__(4); var PooledClass = __webpack_require__(6); var emptyFunction = __webpack_require__(12); var warning = __webpack_require__(11); var didWarnForAddedNewProperty = false; var isProxySupported = typeof Proxy === 'function'; var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances']; /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var EventInterface = { type: null, target: null, // currentTarget is set when dispatching; no use in copying it here currentTarget: emptyFunction.thatReturnsNull, eventPhase: null, bubbles: null, cancelable: null, timeStamp: function (event) { return event.timeStamp || Date.now(); }, defaultPrevented: null, isTrusted: null }; /** * Synthetic events are dispatched by event plugins, typically in response to a * top-level event delegation handler. * * These systems should generally use pooling to reduce the frequency of garbage * collection. The system should check `isPersistent` to determine whether the * event should be released into the pool after being dispatched. Users that * need a persisted event should invoke `persist`. * * Synthetic events (and subclasses) implement the DOM Level 3 Events API by * normalizing browser quirks. Subclasses do not necessarily have to implement a * DOM interface; custom application-specific events can also subclass this. * * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {*} targetInst Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @param {DOMEventTarget} nativeEventTarget Target node. */ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { if (process.env.NODE_ENV !== 'production') { // these have a getter/setter for warnings delete this.nativeEvent; delete this.preventDefault; delete this.stopPropagation; } this.dispatchConfig = dispatchConfig; this._targetInst = targetInst; this.nativeEvent = nativeEvent; var Interface = this.constructor.Interface; for (var propName in Interface) { if (!Interface.hasOwnProperty(propName)) { continue; } if (process.env.NODE_ENV !== 'production') { delete this[propName]; // this has a getter/setter for warnings } var normalize = Interface[propName]; if (normalize) { this[propName] = normalize(nativeEvent); } else { if (propName === 'target') { this.target = nativeEventTarget; } else { this[propName] = nativeEvent[propName]; } } } var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; if (defaultPrevented) { this.isDefaultPrevented = emptyFunction.thatReturnsTrue; } else { this.isDefaultPrevented = emptyFunction.thatReturnsFalse; } this.isPropagationStopped = emptyFunction.thatReturnsFalse; return this; } _assign(SyntheticEvent.prototype, { preventDefault: function () { this.defaultPrevented = true; var event = this.nativeEvent; if (!event) { return; } if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } this.isDefaultPrevented = emptyFunction.thatReturnsTrue; }, stopPropagation: function () { var event = this.nativeEvent; if (!event) { return; } if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } this.isPropagationStopped = emptyFunction.thatReturnsTrue; }, /** * We release all dispatched `SyntheticEvent`s after each event loop, adding * them back into the pool. This allows a way to hold onto a reference that * won't be added back into the pool. */ persist: function () { this.isPersistent = emptyFunction.thatReturnsTrue; }, /** * Checks if this event should be released back into the pool. * * @return {boolean} True if this should not be released, false otherwise. */ isPersistent: emptyFunction.thatReturnsFalse, /** * `PooledClass` looks for `destructor` on each instance it releases. */ destructor: function () { var Interface = this.constructor.Interface; for (var propName in Interface) { if (process.env.NODE_ENV !== 'production') { Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); } else { this[propName] = null; } } for (var i = 0; i < shouldBeReleasedProperties.length; i++) { this[shouldBeReleasedProperties[i]] = null; } if (process.env.NODE_ENV !== 'production') { Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction)); Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); } } }); SyntheticEvent.Interface = EventInterface; if (process.env.NODE_ENV !== 'production') { if (isProxySupported) { /*eslint-disable no-func-assign */ SyntheticEvent = new Proxy(SyntheticEvent, { construct: function (target, args) { return this.apply(target, Object.create(target.prototype), args); }, apply: function (constructor, that, args) { return new Proxy(constructor.apply(that, args), { set: function (target, prop, value) { if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) { process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0; didWarnForAddedNewProperty = true; } target[prop] = value; return true; } }); } }); /*eslint-enable no-func-assign */ } } /** * Helper to reduce boilerplate when creating subclasses. * * @param {function} Class * @param {?object} Interface */ SyntheticEvent.augmentClass = function (Class, Interface) { var Super = this; var E = function () {}; E.prototype = Super.prototype; var prototype = new E(); _assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; Class.Interface = _assign({}, Super.Interface, Interface); Class.augmentClass = Super.augmentClass; PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); }; PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler); module.exports = SyntheticEvent; /** * Helper to nullify syntheticEvent instance properties when destructing * * @param {object} SyntheticEvent * @param {String} propName * @return {object} defineProperty object */ function getPooledWarningPropertyDefinition(propName, getVal) { var isFunction = typeof getVal === 'function'; return { configurable: true, set: set, get: get }; function set(val) { var action = isFunction ? 'setting the method' : 'setting the property'; warn(action, 'This is effectively a no-op'); return val; } function get() { var action = isFunction ? 'accessing the method' : 'accessing the property'; var result = isFunction ? 'This is a no-op function' : 'This is set to null'; warn(action, result); return getVal; } function warn(action, result) { var warningCondition = false; process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; } } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticInputEvent */ 'use strict'; var SyntheticEvent = __webpack_require__(54); /** * @interface Event * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 * /#events-inputevents */ var InputEventInterface = { data: null }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); } SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); module.exports = SyntheticInputEvent; /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ChangeEventPlugin */ 'use strict'; var EventConstants = __webpack_require__(42); var EventPluginHub = __webpack_require__(44); var EventPropagators = __webpack_require__(43); var ExecutionEnvironment = __webpack_require__(50); var ReactDOMComponentTree = __webpack_require__(37); var ReactUpdates = __webpack_require__(57); var SyntheticEvent = __webpack_require__(54); var getEventTarget = __webpack_require__(71); var isEventSupported = __webpack_require__(72); var isTextInputElement = __webpack_require__(73); var keyOf = __webpack_require__(25); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { change: { phasedRegistrationNames: { bubbled: keyOf({ onChange: null }), captured: keyOf({ onChangeCapture: null }) }, dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange] } }; /** * For IE shims */ var activeElement = null; var activeElementInst = null; var activeElementValue = null; var activeElementValueProp = null; /** * SECTION: handle `change` event */ function shouldUseChangeEvent(elem) { var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; } var doesChangeEventBubble = false; if (ExecutionEnvironment.canUseDOM) { // See `handleChange` comment below doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8); } function manualDispatchChangeEvent(nativeEvent) { var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); EventPropagators.accumulateTwoPhaseDispatches(event); // If change and propertychange bubbled, we'd just bind to it like all the // other events and have it go through ReactBrowserEventEmitter. Since it // doesn't, we manually listen for the events and so we have to enqueue and // process the abstract event manually. // // Batching is necessary here in order to ensure that all event handlers run // before the next rerender (including event handlers attached to ancestor // elements instead of directly on the input). Without this, controlled // components don't work properly in conjunction with event bubbling because // the component is rerendered and the value reverted before all the event // handlers can run. See https://github.com/facebook/react/issues/708. ReactUpdates.batchedUpdates(runEventInBatch, event); } function runEventInBatch(event) { EventPluginHub.enqueueEvents(event); EventPluginHub.processEventQueue(false); } function startWatchingForChangeEventIE8(target, targetInst) { activeElement = target; activeElementInst = targetInst; activeElement.attachEvent('onchange', manualDispatchChangeEvent); } function stopWatchingForChangeEventIE8() { if (!activeElement) { return; } activeElement.detachEvent('onchange', manualDispatchChangeEvent); activeElement = null; activeElementInst = null; } function getTargetInstForChangeEvent(topLevelType, targetInst) { if (topLevelType === topLevelTypes.topChange) { return targetInst; } } function handleEventsForChangeEventIE8(topLevelType, target, targetInst) { if (topLevelType === topLevelTypes.topFocus) { // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForChangeEventIE8(); startWatchingForChangeEventIE8(target, targetInst); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForChangeEventIE8(); } } /** * SECTION: handle `input` event */ var isInputEventSupported = false; if (ExecutionEnvironment.canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events. // IE10+ fire input events to often, such when a placeholder // changes or when an input with a placeholder is focused. isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11); } /** * (For IE <=11) Replacement getter/setter for the `value` property that gets * set on the active element. */ var newValueProp = { get: function () { return activeElementValueProp.get.call(this); }, set: function (val) { // Cast to a string so we can do equality checks. activeElementValue = '' + val; activeElementValueProp.set.call(this, val); } }; /** * (For IE <=11) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetInst) { activeElement = target; activeElementInst = targetInst; activeElementValue = target.value; activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value'); // Not guarded in a canDefineProperty check: IE8 supports defineProperty only // on DOM elements Object.defineProperty(activeElement, 'value', newValueProp); if (activeElement.attachEvent) { activeElement.attachEvent('onpropertychange', handlePropertyChange); } else { activeElement.addEventListener('propertychange', handlePropertyChange, false); } } /** * (For IE <=11) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } // delete restores the original property definition delete activeElement.value; if (activeElement.detachEvent) { activeElement.detachEvent('onpropertychange', handlePropertyChange); } else { activeElement.removeEventListener('propertychange', handlePropertyChange, false); } activeElement = null; activeElementInst = null; activeElementValue = null; activeElementValueProp = null; } /** * (For IE <=11) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } var value = nativeEvent.srcElement.value; if (value === activeElementValue) { return; } activeElementValue = value; manualDispatchChangeEvent(nativeEvent); } /** * If a `change` event should be fired, returns the target's ID. */ function getTargetInstForInputEvent(topLevelType, targetInst) { if (topLevelType === topLevelTypes.topInput) { // In modern browsers (i.e., not IE8 or IE9), the input event is exactly // what we want so fall through here and trigger an abstract event return targetInst; } } function handleEventsForInputEventIE(topLevelType, target, targetInst) { if (topLevelType === topLevelTypes.topFocus) { // In IE8, we can capture almost all .value changes by adding a // propertychange handler and looking for events with propertyName // equal to 'value' // In IE9-11, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // In either case, we don't want to call the event handler if the value // is changed from JS so we redefine a setter for `.value` that updates // our activeElementValue variable, allowing us to ignore those changes // // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(target, targetInst); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetInstForInputEventIE(topLevelType, targetInst) { if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. Catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. if (activeElement && activeElement.value !== activeElementValue) { activeElementValue = activeElement.value; return activeElementInst; } } } /** * SECTION: handle `click` event */ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); } function getTargetInstForClickEvent(topLevelType, targetInst) { if (topLevelType === topLevelTypes.topClick) { return targetInst; } } /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to * change the element's value without seeing a flicker. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - select */ var ChangeEventPlugin = { eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window; var getTargetInstFunc, handleEventFunc; if (shouldUseChangeEvent(targetNode)) { if (doesChangeEventBubble) { getTargetInstFunc = getTargetInstForChangeEvent; } else { handleEventFunc = handleEventsForChangeEventIE8; } } else if (isTextInputElement(targetNode)) { if (isInputEventSupported) { getTargetInstFunc = getTargetInstForInputEvent; } else { getTargetInstFunc = getTargetInstForInputEventIE; handleEventFunc = handleEventsForInputEventIE; } } else if (shouldUseClickEvent(targetNode)) { getTargetInstFunc = getTargetInstForClickEvent; } if (getTargetInstFunc) { var inst = getTargetInstFunc(topLevelType, targetInst); if (inst) { var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget); event.type = 'change'; EventPropagators.accumulateTwoPhaseDispatches(event); return event; } } if (handleEventFunc) { handleEventFunc(topLevelType, targetNode, targetInst); } } }; module.exports = ChangeEventPlugin; /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactUpdates */ 'use strict'; var _prodInvariant = __webpack_require__(7), _assign = __webpack_require__(4); var CallbackQueue = __webpack_require__(58); var PooledClass = __webpack_require__(6); var ReactFeatureFlags = __webpack_require__(59); var ReactReconciler = __webpack_require__(60); var Transaction = __webpack_require__(70); var invariant = __webpack_require__(8); var dirtyComponents = []; var updateBatchNumber = 0; var asapCallbackQueue = CallbackQueue.getPooled(); var asapEnqueued = false; var batchingStrategy = null; function ensureInjected() { !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0; } var NESTED_UPDATES = { initialize: function () { this.dirtyComponentsLength = dirtyComponents.length; }, close: function () { if (this.dirtyComponentsLength !== dirtyComponents.length) { // Additional updates were enqueued by componentDidUpdate handlers or // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run // these new updates so that if A's componentDidUpdate calls setState on // B, B will update before the callback A's updater provided when calling // setState. dirtyComponents.splice(0, this.dirtyComponentsLength); flushBatchedUpdates(); } else { dirtyComponents.length = 0; } } }; var UPDATE_QUEUEING = { initialize: function () { this.callbackQueue.reset(); }, close: function () { this.callbackQueue.notifyAll(); } }; var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; function ReactUpdatesFlushTransaction() { this.reinitializeTransaction(); this.dirtyComponentsLength = null; this.callbackQueue = CallbackQueue.getPooled(); this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* useCreateElement */true); } _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, { getTransactionWrappers: function () { return TRANSACTION_WRAPPERS; }, destructor: function () { this.dirtyComponentsLength = null; CallbackQueue.release(this.callbackQueue); this.callbackQueue = null; ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); this.reconcileTransaction = null; }, perform: function (method, scope, a) { // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` // with this transaction's wrappers around it. return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); } }); PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); function batchedUpdates(callback, a, b, c, d, e) { ensureInjected(); batchingStrategy.batchedUpdates(callback, a, b, c, d, e); } /** * Array comparator for ReactComponents by mount ordering. * * @param {ReactComponent} c1 first component you're comparing * @param {ReactComponent} c2 second component you're comparing * @return {number} Return value usable by Array.prototype.sort(). */ function mountOrderComparator(c1, c2) { return c1._mountOrder - c2._mountOrder; } function runBatchedUpdates(transaction) { var len = transaction.dirtyComponentsLength; !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0; // Since reconciling a component higher in the owner hierarchy usually (not // always -- see shouldComponentUpdate()) will reconcile children, reconcile // them before their children by sorting the array. dirtyComponents.sort(mountOrderComparator); // Any updates enqueued while reconciling must be performed after this entire // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and // C, B could update twice in a single batch if C's render enqueues an update // to B (since B would have already updated, we should skip it, and the only // way we can know to do so is by checking the batch counter). updateBatchNumber++; for (var i = 0; i < len; i++) { // If a component is unmounted before pending changes apply, it will still // be here, but we assume that it has cleared its _pendingCallbacks and // that performUpdateIfNecessary is a noop. var component = dirtyComponents[i]; // If performUpdateIfNecessary happens to enqueue any new updates, we // shouldn't execute the callbacks until the next render happens, so // stash the callbacks first var callbacks = component._pendingCallbacks; component._pendingCallbacks = null; var markerName; if (ReactFeatureFlags.logTopLevelRenders) { var namedComponent = component; // Duck type TopLevelWrapper. This is probably always true. if (component._currentElement.props === component._renderedComponent._currentElement) { namedComponent = component._renderedComponent; } markerName = 'React update: ' + namedComponent.getName(); console.time(markerName); } ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); if (markerName) { console.timeEnd(markerName); } if (callbacks) { for (var j = 0; j < callbacks.length; j++) { transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance()); } } } } var flushBatchedUpdates = function () { // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents // array and perform any updates enqueued by mount-ready handlers (i.e., // componentDidUpdate) but we need to check here too in order to catch // updates enqueued by setState callbacks and asap calls. while (dirtyComponents.length || asapEnqueued) { if (dirtyComponents.length) { var transaction = ReactUpdatesFlushTransaction.getPooled(); transaction.perform(runBatchedUpdates, null, transaction); ReactUpdatesFlushTransaction.release(transaction); } if (asapEnqueued) { asapEnqueued = false; var queue = asapCallbackQueue; asapCallbackQueue = CallbackQueue.getPooled(); queue.notifyAll(); CallbackQueue.release(queue); } } }; /** * Mark a component as needing a rerender, adding an optional callback to a * list of functions which will be executed once the rerender occurs. */ function enqueueUpdate(component) { ensureInjected(); // Various parts of our code (such as ReactCompositeComponent's // _renderValidatedComponent) assume that calls to render aren't nested; // verify that that's the case. (This is called by each top-level update // function, like setState, forceUpdate, etc.; creation and // destruction of top-level components is guarded in ReactMount.) if (!batchingStrategy.isBatchingUpdates) { batchingStrategy.batchedUpdates(enqueueUpdate, component); return; } dirtyComponents.push(component); if (component._updateBatchNumber == null) { component._updateBatchNumber = updateBatchNumber + 1; } } /** * Enqueue a callback to be run at the end of the current batching cycle. Throws * if no updates are currently being performed. */ function asap(callback, context) { !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0; asapCallbackQueue.enqueue(callback, context); asapEnqueued = true; } var ReactUpdatesInjection = { injectReconcileTransaction: function (ReconcileTransaction) { !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0; ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; }, injectBatchingStrategy: function (_batchingStrategy) { !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0; !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0; !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0; batchingStrategy = _batchingStrategy; } }; var ReactUpdates = { /** * React references `ReactReconcileTransaction` using this property in order * to allow dependency injection. * * @internal */ ReactReconcileTransaction: null, batchedUpdates: batchedUpdates, enqueueUpdate: enqueueUpdate, flushBatchedUpdates: flushBatchedUpdates, injection: ReactUpdatesInjection, asap: asap }; module.exports = ReactUpdates; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule CallbackQueue */ 'use strict'; var _prodInvariant = __webpack_require__(7), _assign = __webpack_require__(4); var PooledClass = __webpack_require__(6); var invariant = __webpack_require__(8); /** * A specialized pseudo-event module to help keep track of components waiting to * be notified when their DOM representations are available for use. * * This implements `PooledClass`, so you should never need to instantiate this. * Instead, use `CallbackQueue.getPooled()`. * * @class ReactMountReady * @implements PooledClass * @internal */ function CallbackQueue() { this._callbacks = null; this._contexts = null; } _assign(CallbackQueue.prototype, { /** * Enqueues a callback to be invoked when `notifyAll` is invoked. * * @param {function} callback Invoked when `notifyAll` is invoked. * @param {?object} context Context to call `callback` with. * @internal */ enqueue: function (callback, context) { this._callbacks = this._callbacks || []; this._contexts = this._contexts || []; this._callbacks.push(callback); this._contexts.push(context); }, /** * Invokes all enqueued callbacks and clears the queue. This is invoked after * the DOM representation of a component has been created or updated. * * @internal */ notifyAll: function () { var callbacks = this._callbacks; var contexts = this._contexts; if (callbacks) { !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0; this._callbacks = null; this._contexts = null; for (var i = 0; i < callbacks.length; i++) { callbacks[i].call(contexts[i]); } callbacks.length = 0; contexts.length = 0; } }, checkpoint: function () { return this._callbacks ? this._callbacks.length : 0; }, rollback: function (len) { if (this._callbacks) { this._callbacks.length = len; this._contexts.length = len; } }, /** * Resets the internal queue. * * @internal */ reset: function () { this._callbacks = null; this._contexts = null; }, /** * `PooledClass` looks for this. */ destructor: function () { this.reset(); } }); PooledClass.addPoolingTo(CallbackQueue); module.exports = CallbackQueue; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 59 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactFeatureFlags * */ 'use strict'; var ReactFeatureFlags = { // When true, call console.time() before and .timeEnd() after each top-level // render (both initial renders and updates). Useful when looking at prod-mode // timeline profiles in Chrome, for example. logTopLevelRenders: false }; module.exports = ReactFeatureFlags; /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactReconciler */ 'use strict'; var ReactRef = __webpack_require__(61); var ReactInstrumentation = __webpack_require__(63); var warning = __webpack_require__(11); /** * Helper to call ReactRef.attachRefs with this composite component, split out * to avoid allocations in the transaction mount-ready queue. */ function attachRefs() { ReactRef.attachRefs(this, this._currentElement); } var ReactReconciler = { /** * Initializes the component, renders markup, and registers event listeners. * * @param {ReactComponent} internalInstance * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction * @param {?object} the containing host component instance * @param {?object} info about the host container * @return {?string} Rendered markup to be inserted into the DOM. * @final * @internal */ mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context) { if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement); ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent'); } } var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context); if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent'); ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID); } } return markup; }, /** * Returns a value that can be passed to * ReactComponentEnvironment.replaceNodeWithMarkup. */ getHostNode: function (internalInstance) { return internalInstance.getHostNode(); }, /** * Releases any resources allocated by `mountComponent`. * * @final * @internal */ unmountComponent: function (internalInstance, safely) { if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent'); } } ReactRef.detachRefs(internalInstance, internalInstance._currentElement); internalInstance.unmountComponent(safely); if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent'); ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); } } }, /** * Update a component using a new element. * * @param {ReactComponent} internalInstance * @param {ReactElement} nextElement * @param {ReactReconcileTransaction} transaction * @param {object} context * @internal */ receiveComponent: function (internalInstance, nextElement, transaction, context) { var prevElement = internalInstance._currentElement; if (nextElement === prevElement && context === internalInstance._context) { // Since elements are immutable after the owner is rendered, // we can do a cheap identity compare here to determine if this is a // superfluous reconcile. It's possible for state to be mutable but such // change should trigger an update of the owner which would recreate // the element. We explicitly check for the existence of an owner since // it's possible for an element created outside a composite to be // deeply mutated and reused. // TODO: Bailing out early is just a perf optimization right? // TODO: Removing the return statement should affect correctness? return; } if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent'); } } var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement); if (refsChanged) { ReactRef.detachRefs(internalInstance, prevElement); } internalInstance.receiveComponent(nextElement, transaction, context); if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) { transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent'); ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } } }, /** * Flush any dirty changes in a component. * * @param {ReactComponent} internalInstance * @param {ReactReconcileTransaction} transaction * @internal */ performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) { if (internalInstance._updateBatchNumber !== updateBatchNumber) { // The component's enqueued batch number should always be the current // batch or the following one. process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0; return; } if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary'); ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement); } } internalInstance.performUpdateIfNecessary(transaction); if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary'); ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } } } }; module.exports = ReactReconciler; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactRef */ 'use strict'; var ReactOwner = __webpack_require__(62); var ReactRef = {}; function attachRef(ref, component, owner) { if (typeof ref === 'function') { ref(component.getPublicInstance()); } else { // Legacy ref ReactOwner.addComponentAsRefTo(component, ref, owner); } } function detachRef(ref, component, owner) { if (typeof ref === 'function') { ref(null); } else { // Legacy ref ReactOwner.removeComponentAsRefFrom(component, ref, owner); } } ReactRef.attachRefs = function (instance, element) { if (element === null || element === false) { return; } var ref = element.ref; if (ref != null) { attachRef(ref, instance, element._owner); } }; ReactRef.shouldUpdateRefs = function (prevElement, nextElement) { // If either the owner or a `ref` has changed, make sure the newest owner // has stored a reference to `this`, and the previous owner (if different) // has forgotten the reference to `this`. We use the element instead // of the public this.props because the post processing cannot determine // a ref. The ref conceptually lives on the element. // TODO: Should this even be possible? The owner cannot change because // it's forbidden by shouldUpdateReactComponent. The ref can change // if you swap the keys of but not the refs. Reconsider where this check // is made. It probably belongs where the key checking and // instantiateReactComponent is done. var prevEmpty = prevElement === null || prevElement === false; var nextEmpty = nextElement === null || nextElement === false; return( // This has a few false positives w/r/t empty components. prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref || // If owner changes but we have an unchanged function ref, don't update refs typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner ); }; ReactRef.detachRefs = function (instance, element) { if (element === null || element === false) { return; } var ref = element.ref; if (ref != null) { detachRef(ref, instance, element._owner); } }; module.exports = ReactRef; /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactOwner */ 'use strict'; var _prodInvariant = __webpack_require__(7); var invariant = __webpack_require__(8); /** * ReactOwners are capable of storing references to owned components. * * All components are capable of //being// referenced by owner components, but * only ReactOwner components are capable of //referencing// owned components. * The named reference is known as a "ref". * * Refs are available when mounted and updated during reconciliation. * * var MyComponent = React.createClass({ * render: function() { * return ( *
* *
* ); * }, * handleClick: function() { * this.refs.custom.handleClick(); * }, * componentDidMount: function() { * this.refs.custom.initialize(); * } * }); * * Refs should rarely be used. When refs are used, they should only be done to * control data that is not handled by React's data flow. * * @class ReactOwner */ var ReactOwner = { /** * @param {?object} object * @return {boolean} True if `object` is a valid owner. * @final */ isValidOwner: function (object) { return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); }, /** * Adds a component by ref to an owner component. * * @param {ReactComponent} component Component to reference. * @param {string} ref Name by which to refer to the component. * @param {ReactOwner} owner Component on which to record the ref. * @final * @internal */ addComponentAsRefTo: function (component, ref, owner) { !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0; owner.attachRef(ref, component); }, /** * Removes a component by ref from an owner component. * * @param {ReactComponent} component Component to dereference. * @param {string} ref Name of the ref to remove. * @param {ReactOwner} owner Component on which the ref is recorded. * @final * @internal */ removeComponentAsRefFrom: function (component, ref, owner) { !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0; var ownerPublicInstance = owner.getPublicInstance(); // Check that `component`'s owner is still alive and that `component` is still the current ref // because we do not want to detach the ref if another component stole it. if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) { owner.detachRef(ref); } } }; module.exports = ReactOwner; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInstrumentation */ 'use strict'; var debugTool = null; if (process.env.NODE_ENV !== 'production') { var ReactDebugTool = __webpack_require__(64); debugTool = ReactDebugTool; } module.exports = { debugTool: debugTool }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDebugTool */ 'use strict'; var ReactInvalidSetStateWarningDevTool = __webpack_require__(65); var ReactHostOperationHistoryDevtool = __webpack_require__(66); var ReactComponentTreeDevtool = __webpack_require__(29); var ReactChildrenMutationWarningDevtool = __webpack_require__(67); var ExecutionEnvironment = __webpack_require__(50); var performanceNow = __webpack_require__(68); var warning = __webpack_require__(11); var eventHandlers = []; var handlerDoesThrowForEvent = {}; function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) { eventHandlers.forEach(function (handler) { try { if (handler[handlerFunctionName]) { handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5); } } catch (e) { process.env.NODE_ENV !== 'production' ? warning(handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e + '\n' + e.stack) : void 0; handlerDoesThrowForEvent[handlerFunctionName] = true; } }); } var isProfiling = false; var flushHistory = []; var lifeCycleTimerStack = []; var currentFlushNesting = 0; var currentFlushMeasurements = null; var currentFlushStartTime = null; var currentTimerDebugID = null; var currentTimerStartTime = null; var currentTimerNestedFlushDuration = null; var currentTimerType = null; var lifeCycleTimerHasWarned = false; function clearHistory() { ReactComponentTreeDevtool.purgeUnmountedComponents(); ReactHostOperationHistoryDevtool.clearHistory(); } function getTreeSnapshot(registeredIDs) { return registeredIDs.reduce(function (tree, id) { var ownerID = ReactComponentTreeDevtool.getOwnerID(id); var parentID = ReactComponentTreeDevtool.getParentID(id); tree[id] = { displayName: ReactComponentTreeDevtool.getDisplayName(id), text: ReactComponentTreeDevtool.getText(id), updateCount: ReactComponentTreeDevtool.getUpdateCount(id), childIDs: ReactComponentTreeDevtool.getChildIDs(id), // Text nodes don't have owners but this is close enough. ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID), parentID: parentID }; return tree; }, {}); } function resetMeasurements() { var previousStartTime = currentFlushStartTime; var previousMeasurements = currentFlushMeasurements || []; var previousOperations = ReactHostOperationHistoryDevtool.getHistory(); if (currentFlushNesting === 0) { currentFlushStartTime = null; currentFlushMeasurements = null; clearHistory(); return; } if (previousMeasurements.length || previousOperations.length) { var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs(); flushHistory.push({ duration: performanceNow() - previousStartTime, measurements: previousMeasurements || [], operations: previousOperations || [], treeSnapshot: getTreeSnapshot(registeredIDs) }); } clearHistory(); currentFlushStartTime = performanceNow(); currentFlushMeasurements = []; } function checkDebugID(debugID) { process.env.NODE_ENV !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0; } function beginLifeCycleTimer(debugID, timerType) { if (currentFlushNesting === 0) { return; } if (currentTimerType && !lifeCycleTimerHasWarned) { process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; lifeCycleTimerHasWarned = true; } currentTimerStartTime = performanceNow(); currentTimerNestedFlushDuration = 0; currentTimerDebugID = debugID; currentTimerType = timerType; } function endLifeCycleTimer(debugID, timerType) { if (currentFlushNesting === 0) { return; } if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) { process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; lifeCycleTimerHasWarned = true; } if (isProfiling) { currentFlushMeasurements.push({ timerType: timerType, instanceID: debugID, duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration }); } currentTimerStartTime = null; currentTimerNestedFlushDuration = null; currentTimerDebugID = null; currentTimerType = null; } function pauseCurrentLifeCycleTimer() { var currentTimer = { startTime: currentTimerStartTime, nestedFlushStartTime: performanceNow(), debugID: currentTimerDebugID, timerType: currentTimerType }; lifeCycleTimerStack.push(currentTimer); currentTimerStartTime = null; currentTimerNestedFlushDuration = null; currentTimerDebugID = null; currentTimerType = null; } function resumeCurrentLifeCycleTimer() { var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(); var startTime = _lifeCycleTimerStack$.startTime; var nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime; var debugID = _lifeCycleTimerStack$.debugID; var timerType = _lifeCycleTimerStack$.timerType; var nestedFlushDuration = performanceNow() - nestedFlushStartTime; currentTimerStartTime = startTime; currentTimerNestedFlushDuration += nestedFlushDuration; currentTimerDebugID = debugID; currentTimerType = timerType; } var ReactDebugTool = { addDevtool: function (devtool) { eventHandlers.push(devtool); }, removeDevtool: function (devtool) { for (var i = 0; i < eventHandlers.length; i++) { if (eventHandlers[i] === devtool) { eventHandlers.splice(i, 1); i--; } } }, isProfiling: function () { return isProfiling; }, beginProfiling: function () { if (isProfiling) { return; } isProfiling = true; flushHistory.length = 0; resetMeasurements(); ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool); }, endProfiling: function () { if (!isProfiling) { return; } isProfiling = false; resetMeasurements(); ReactDebugTool.removeDevtool(ReactHostOperationHistoryDevtool); }, getFlushHistory: function () { return flushHistory; }, onBeginFlush: function () { currentFlushNesting++; resetMeasurements(); pauseCurrentLifeCycleTimer(); emitEvent('onBeginFlush'); }, onEndFlush: function () { resetMeasurements(); currentFlushNesting--; resumeCurrentLifeCycleTimer(); emitEvent('onEndFlush'); }, onBeginLifeCycleTimer: function (debugID, timerType) { checkDebugID(debugID); emitEvent('onBeginLifeCycleTimer', debugID, timerType); beginLifeCycleTimer(debugID, timerType); }, onEndLifeCycleTimer: function (debugID, timerType) { checkDebugID(debugID); endLifeCycleTimer(debugID, timerType); emitEvent('onEndLifeCycleTimer', debugID, timerType); }, onBeginReconcilerTimer: function (debugID, timerType) { checkDebugID(debugID); emitEvent('onBeginReconcilerTimer', debugID, timerType); }, onEndReconcilerTimer: function (debugID, timerType) { checkDebugID(debugID); emitEvent('onEndReconcilerTimer', debugID, timerType); }, onError: function (debugID) { if (currentTimerDebugID != null) { endLifeCycleTimer(currentTimerDebugID, currentTimerType); } emitEvent('onError', debugID); }, onBeginProcessingChildContext: function () { emitEvent('onBeginProcessingChildContext'); }, onEndProcessingChildContext: function () { emitEvent('onEndProcessingChildContext'); }, onHostOperation: function (debugID, type, payload) { checkDebugID(debugID); emitEvent('onHostOperation', debugID, type, payload); }, onComponentHasMounted: function (debugID) { checkDebugID(debugID); emitEvent('onComponentHasMounted', debugID); }, onComponentHasUpdated: function (debugID) { checkDebugID(debugID); emitEvent('onComponentHasUpdated', debugID); }, onSetState: function () { emitEvent('onSetState'); }, onSetDisplayName: function (debugID, displayName) { checkDebugID(debugID); emitEvent('onSetDisplayName', debugID, displayName); }, onSetChildren: function (debugID, childDebugIDs) { checkDebugID(debugID); childDebugIDs.forEach(checkDebugID); emitEvent('onSetChildren', debugID, childDebugIDs); }, onSetOwner: function (debugID, ownerDebugID) { checkDebugID(debugID); emitEvent('onSetOwner', debugID, ownerDebugID); }, onSetParent: function (debugID, parentDebugID) { checkDebugID(debugID); emitEvent('onSetParent', debugID, parentDebugID); }, onSetText: function (debugID, text) { checkDebugID(debugID); emitEvent('onSetText', debugID, text); }, onMountRootComponent: function (debugID) { checkDebugID(debugID); emitEvent('onMountRootComponent', debugID); }, onBeforeMountComponent: function (debugID, element) { checkDebugID(debugID); emitEvent('onBeforeMountComponent', debugID, element); }, onMountComponent: function (debugID) { checkDebugID(debugID); emitEvent('onMountComponent', debugID); }, onBeforeUpdateComponent: function (debugID, element) { checkDebugID(debugID); emitEvent('onBeforeUpdateComponent', debugID, element); }, onUpdateComponent: function (debugID) { checkDebugID(debugID); emitEvent('onUpdateComponent', debugID); }, onUnmountComponent: function (debugID) { checkDebugID(debugID); emitEvent('onUnmountComponent', debugID); }, onTestEvent: function () { emitEvent('onTestEvent'); } }; ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool); ReactDebugTool.addDevtool(ReactComponentTreeDevtool); ReactDebugTool.addDevtool(ReactChildrenMutationWarningDevtool); var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; if (/[?&]react_perf\b/.test(url)) { ReactDebugTool.beginProfiling(); } module.exports = ReactDebugTool; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInvalidSetStateWarningDevTool */ 'use strict'; var warning = __webpack_require__(11); if (process.env.NODE_ENV !== 'production') { var processingChildContext = false; var warnInvalidSetState = function () { process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0; }; } var ReactInvalidSetStateWarningDevTool = { onBeginProcessingChildContext: function () { processingChildContext = true; }, onEndProcessingChildContext: function () { processingChildContext = false; }, onSetState: function () { warnInvalidSetState(); } }; module.exports = ReactInvalidSetStateWarningDevTool; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 66 */ /***/ function(module, exports) { /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactHostOperationHistoryDevtool */ 'use strict'; var history = []; var ReactHostOperationHistoryDevtool = { onHostOperation: function (debugID, type, payload) { history.push({ instanceID: debugID, type: type, payload: payload }); }, clearHistory: function () { if (ReactHostOperationHistoryDevtool._preventClearing) { // Should only be used for tests. return; } history = []; }, getHistory: function () { return history; } }; module.exports = ReactHostOperationHistoryDevtool; /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactChildrenMutationWarningDevtool */ 'use strict'; var ReactComponentTreeDevtool = __webpack_require__(29); var warning = __webpack_require__(11); var elements = {}; function handleElement(debugID, element) { if (element == null) { return; } if (element._shadowChildren === undefined) { return; } if (element._shadowChildren === element.props.children) { return; } var isMutated = false; if (Array.isArray(element._shadowChildren)) { if (element._shadowChildren.length === element.props.children.length) { for (var i = 0; i < element._shadowChildren.length; i++) { if (element._shadowChildren[i] !== element.props.children[i]) { isMutated = true; } } } else { isMutated = true; } } process.env.NODE_ENV !== 'production' ? warning(Array.isArray(element._shadowChildren) && !isMutated, 'Component\'s children should not be mutated.%s', ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0; } var ReactDOMUnknownPropertyDevtool = { onBeforeMountComponent: function (debugID, element) { elements[debugID] = element; }, onBeforeUpdateComponent: function (debugID, element) { elements[debugID] = element; }, onComponentHasMounted: function (debugID) { handleElement(debugID, elements[debugID]); delete elements[debugID]; }, onComponentHasUpdated: function (debugID) { handleElement(debugID, elements[debugID]); delete elements[debugID]; } }; module.exports = ReactDOMUnknownPropertyDevtool; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ var performance = __webpack_require__(69); var performanceNow; /** * Detect if we can use `window.performance.now()` and gracefully fallback to * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now * because of Facebook's testing infrastructure. */ if (performance.now) { performanceNow = function performanceNow() { return performance.now(); }; } else { performanceNow = function performanceNow() { return Date.now(); }; } module.exports = performanceNow; /***/ }, /* 69 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ 'use strict'; var ExecutionEnvironment = __webpack_require__(50); var performance; if (ExecutionEnvironment.canUseDOM) { performance = window.performance || window.msPerformance || window.webkitPerformance; } module.exports = performance || {}; /***/ }, /* 70 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Transaction */ 'use strict'; var _prodInvariant = __webpack_require__(7); var invariant = __webpack_require__(8); /** * `Transaction` creates a black box that is able to wrap any method such that * certain invariants are maintained before and after the method is invoked * (Even if an exception is thrown while invoking the wrapped method). Whoever * instantiates a transaction can provide enforcers of the invariants at * creation time. The `Transaction` class itself will supply one additional * automatic invariant for you - the invariant that any transaction instance * should not be run while it is already being run. You would typically create a * single instance of a `Transaction` for reuse multiple times, that potentially * is used to wrap several different methods. Wrappers are extremely simple - * they only require implementing two methods. * *
	 *                       wrappers (injected at creation time)
	 *                                      +        +
	 *                                      |        |
	 *                    +-----------------|--------|--------------+
	 *                    |                 v        |              |
	 *                    |      +---------------+   |              |
	 *                    |   +--|    wrapper1   |---|----+         |
	 *                    |   |  +---------------+   v    |         |
	 *                    |   |          +-------------+  |         |
	 *                    |   |     +----|   wrapper2  |--------+   |
	 *                    |   |     |    +-------------+  |     |   |
	 *                    |   |     |                     |     |   |
	 *                    |   v     v                     v     v   | wrapper
	 *                    | +---+ +---+   +---------+   +---+ +---+ | invariants
	 * perform(anyMethod) | |   | |   |   |         |   |   | |   | | maintained
	 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
	 *                    | |   | |   |   |         |   |   | |   | |
	 *                    | |   | |   |   |         |   |   | |   | |
	 *                    | |   | |   |   |         |   |   | |   | |
	 *                    | +---+ +---+   +---------+   +---+ +---+ |
	 *                    |  initialize                    close    |
	 *                    +-----------------------------------------+
	 * 
* * Use cases: * - Preserving the input selection ranges before/after reconciliation. * Restoring selection even in the event of an unexpected error. * - Deactivating events while rearranging the DOM, preventing blurs/focuses, * while guaranteeing that afterwards, the event system is reactivated. * - Flushing a queue of collected DOM mutations to the main UI thread after a * reconciliation takes place in a worker thread. * - Invoking any collected `componentDidUpdate` callbacks after rendering new * content. * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue * to preserve the `scrollTop` (an automatic scroll aware DOM). * - (Future use case): Layout calculations before and after DOM updates. * * Transactional plugin API: * - A module that has an `initialize` method that returns any precomputation. * - and a `close` method that accepts the precomputation. `close` is invoked * when the wrapped process is completed, or has failed. * * @param {Array} transactionWrapper Wrapper modules * that implement `initialize` and `close`. * @return {Transaction} Single transaction for reuse in thread. * * @class Transaction */ var Mixin = { /** * Sets up this instance so that it is prepared for collecting metrics. Does * so such that this setup method may be used on an instance that is already * initialized, in a way that does not consume additional memory upon reuse. * That can be useful if you decide to make your subclass of this mixin a * "PooledClass". */ reinitializeTransaction: function () { this.transactionWrappers = this.getTransactionWrappers(); if (this.wrapperInitData) { this.wrapperInitData.length = 0; } else { this.wrapperInitData = []; } this._isInTransaction = false; }, _isInTransaction: false, /** * @abstract * @return {Array} Array of transaction wrappers. */ getTransactionWrappers: null, isInTransaction: function () { return !!this._isInTransaction; }, /** * Executes the function within a safety window. Use this for the top level * methods that result in large amounts of computation/mutations that would * need to be safety checked. The optional arguments helps prevent the need * to bind in many cases. * * @param {function} method Member of scope to call. * @param {Object} scope Scope to invoke from. * @param {Object?=} a Argument to pass to the method. * @param {Object?=} b Argument to pass to the method. * @param {Object?=} c Argument to pass to the method. * @param {Object?=} d Argument to pass to the method. * @param {Object?=} e Argument to pass to the method. * @param {Object?=} f Argument to pass to the method. * * @return {*} Return value from `method`. */ perform: function (method, scope, a, b, c, d, e, f) { !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0; var errorThrown; var ret; try { this._isInTransaction = true; // Catching errors makes debugging more difficult, so we start with // errorThrown set to true before setting it to false after calling // close -- if it's still set to true in the finally block, it means // one of these calls threw. errorThrown = true; this.initializeAll(0); ret = method.call(scope, a, b, c, d, e, f); errorThrown = false; } finally { try { if (errorThrown) { // If `method` throws, prefer to show that stack trace over any thrown // by invoking `closeAll`. try { this.closeAll(0); } catch (err) {} } else { // Since `method` didn't throw, we don't want to silence the exception // here. this.closeAll(0); } } finally { this._isInTransaction = false; } } return ret; }, initializeAll: function (startIndex) { var transactionWrappers = this.transactionWrappers; for (var i = startIndex; i < transactionWrappers.length; i++) { var wrapper = transactionWrappers[i]; try { // Catching errors makes debugging more difficult, so we start with the // OBSERVED_ERROR state before overwriting it with the real return value // of initialize -- if it's still set to OBSERVED_ERROR in the finally // block, it means wrapper.initialize threw. this.wrapperInitData[i] = Transaction.OBSERVED_ERROR; this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; } finally { if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) { // The initializer for wrapper i threw an error; initialize the // remaining wrappers but silence any exceptions from them to ensure // that the first error is the one to bubble up. try { this.initializeAll(i + 1); } catch (err) {} } } } }, /** * Invokes each of `this.transactionWrappers.close[i]` functions, passing into * them the respective return values of `this.transactionWrappers.init[i]` * (`close`rs that correspond to initializers that failed will not be * invoked). */ closeAll: function (startIndex) { !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0; var transactionWrappers = this.transactionWrappers; for (var i = startIndex; i < transactionWrappers.length; i++) { var wrapper = transactionWrappers[i]; var initData = this.wrapperInitData[i]; var errorThrown; try { // Catching errors makes debugging more difficult, so we start with // errorThrown set to true before setting it to false after calling // close -- if it's still set to true in the finally block, it means // wrapper.close threw. errorThrown = true; if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) { wrapper.close.call(this, initData); } errorThrown = false; } finally { if (errorThrown) { // The closer for wrapper i threw an error; close the remaining // wrappers but silence any exceptions from them to ensure that the // first error is the one to bubble up. try { this.closeAll(i + 1); } catch (e) {} } } } this.wrapperInitData.length = 0; } }; var Transaction = { Mixin: Mixin, /** * Token to look for to determine if an error occurred. */ OBSERVED_ERROR: {} }; module.exports = Transaction; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 71 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getEventTarget */ 'use strict'; /** * Gets the target node from a native browser event by accounting for * inconsistencies in browser DOM APIs. * * @param {object} nativeEvent Native browser event. * @return {DOMEventTarget} Target node. */ function getEventTarget(nativeEvent) { var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG element events #4963 if (target.correspondingUseElement) { target = target.correspondingUseElement; } // Safari may fire events on text nodes (Node.TEXT_NODE is 3). // @see http://www.quirksmode.org/js/events_properties.html return target.nodeType === 3 ? target.parentNode : target; } module.exports = getEventTarget; /***/ }, /* 72 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isEventSupported */ 'use strict'; var ExecutionEnvironment = __webpack_require__(50); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { useHasFeature = document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature document.implementation.hasFeature('', '') !== true; } /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ function isEventSupported(eventNameSuffix, capture) { if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { return false; } var eventName = 'on' + eventNameSuffix; var isSupported = eventName in document; if (!isSupported) { var element = document.createElement('div'); element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] === 'function'; } if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { // This is the only way to test support for the `wheel` event in IE9+. isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); } return isSupported; } module.exports = isEventSupported; /***/ }, /* 73 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isTextInputElement * */ 'use strict'; /** * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary */ var supportedInputTypes = { 'color': true, 'date': true, 'datetime': true, 'datetime-local': true, 'email': true, 'month': true, 'number': true, 'password': true, 'range': true, 'search': true, 'tel': true, 'text': true, 'time': true, 'url': true, 'week': true }; function isTextInputElement(elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); if (nodeName === 'input') { return !!supportedInputTypes[elem.type]; } if (nodeName === 'textarea') { return true; } return false; } module.exports = isTextInputElement; /***/ }, /* 74 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DefaultEventPluginOrder */ 'use strict'; var keyOf = __webpack_require__(25); /** * Module that is injectable into `EventPluginHub`, that specifies a * deterministic ordering of `EventPlugin`s. A convenient way to reason about * plugins, without having to package every one of them. This is better than * having plugins be ordered in the same order that they are injected because * that ordering would be influenced by the packaging order. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that * preventing default on events is convenient in `SimpleEventPlugin` handlers. */ var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })]; module.exports = DefaultEventPluginOrder; /***/ }, /* 75 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EnterLeaveEventPlugin */ 'use strict'; var EventConstants = __webpack_require__(42); var EventPropagators = __webpack_require__(43); var ReactDOMComponentTree = __webpack_require__(37); var SyntheticMouseEvent = __webpack_require__(76); var keyOf = __webpack_require__(25); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { mouseEnter: { registrationName: keyOf({ onMouseEnter: null }), dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver] }, mouseLeave: { registrationName: keyOf({ onMouseLeave: null }), dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver] } }; var EnterLeaveEventPlugin = { eventTypes: eventTypes, /** * For almost every interaction we care about, there will be both a top-level * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that * we do not extract duplicate events. However, moving the mouse into the * browser from outside will not fire a `mouseout` event. In this case, we use * the `mouseover` top-level event. */ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { return null; } if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) { // Must not be a mouse in or mouse out - ignoring. return null; } var win; if (nativeEventTarget.window === nativeEventTarget) { // `nativeEventTarget` is probably a window object. win = nativeEventTarget; } else { // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. var doc = nativeEventTarget.ownerDocument; if (doc) { win = doc.defaultView || doc.parentWindow; } else { win = window; } } var from; var to; if (topLevelType === topLevelTypes.topMouseOut) { from = targetInst; var related = nativeEvent.relatedTarget || nativeEvent.toElement; to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null; } else { // Moving to a node from outside the window. from = null; to = targetInst; } if (from === to) { // Nothing pertains to our managed components. return null; } var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from); var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to); var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget); leave.type = 'mouseleave'; leave.target = fromNode; leave.relatedTarget = toNode; var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget); enter.type = 'mouseenter'; enter.target = toNode; enter.relatedTarget = fromNode; EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to); return [leave, enter]; } }; module.exports = EnterLeaveEventPlugin; /***/ }, /* 76 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticMouseEvent */ 'use strict'; var SyntheticUIEvent = __webpack_require__(77); var ViewportMetrics = __webpack_require__(78); var getEventModifierState = __webpack_require__(79); /** * @interface MouseEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var MouseEventInterface = { screenX: null, screenY: null, clientX: null, clientY: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, getModifierState: getEventModifierState, button: function (event) { // Webkit, Firefox, IE9+ // which: 1 2 3 // button: 0 1 2 (standard) var button = event.button; if ('which' in event) { return button; } // IE<9 // which: undefined // button: 0 0 0 // button: 1 4 2 (onmouseup) return button === 2 ? 2 : button === 4 ? 1 : 0; }, buttons: null, relatedTarget: function (event) { return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); }, // "Proprietary" Interface. pageX: function (event) { return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; }, pageY: function (event) { return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; } }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticUIEvent} */ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); } SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; /***/ }, /* 77 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticUIEvent */ 'use strict'; var SyntheticEvent = __webpack_require__(54); var getEventTarget = __webpack_require__(71); /** * @interface UIEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var UIEventInterface = { view: function (event) { if (event.view) { return event.view; } var target = getEventTarget(event); if (target.window === target) { // target is a window object return target; } var doc = target.ownerDocument; // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. if (doc) { return doc.defaultView || doc.parentWindow; } else { return window; } }, detail: function (event) { return event.detail || 0; } }; /** * @param {object} dispatchConfig Configuration used to dispatch this event. * @param {string} dispatchMarker Marker identifying the event target. * @param {object} nativeEvent Native browser event. * @extends {SyntheticEvent} */ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); } SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; /***/ }, /* 78 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ViewportMetrics */ 'use strict'; var ViewportMetrics = { currentScrollLeft: 0, currentScrollTop: 0, refreshScrollValues: function (scrollPosition) { ViewportMetrics.currentScrollLeft = scrollPosition.x; ViewportMetrics.currentScrollTop = scrollPosition.y; } }; module.exports = ViewportMetrics; /***/ }, /* 79 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getEventModifierState */ 'use strict'; /** * Translation from modifier key to the associated property in the event. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers */ var modifierKeyToProp = { 'Alt': 'altKey', 'Control': 'ctrlKey', 'Meta': 'metaKey', 'Shift': 'shiftKey' }; // IE8 does not implement getModifierState so we simply map it to the only // modifier keys exposed by the event itself, does not support Lock-keys. // Currently, all major browsers except Chrome seems to support Lock-keys. function modifierStateGetter(keyArg) { var syntheticEvent = this; var nativeEvent = syntheticEvent.nativeEvent; if (nativeEvent.getModifierState) { return nativeEvent.getModifierState(keyArg); } var keyProp = modifierKeyToProp[keyArg]; return keyProp ? !!nativeEvent[keyProp] : false; } function getEventModifierState(nativeEvent) { return modifierStateGetter; } module.exports = getEventModifierState; /***/ }, /* 80 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule HTMLDOMPropertyConfig */ 'use strict'; var DOMProperty = __webpack_require__(38); var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE; var HTMLDOMPropertyConfig = { isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')), Properties: { /** * Standard Properties */ accept: 0, acceptCharset: 0, accessKey: 0, action: 0, allowFullScreen: HAS_BOOLEAN_VALUE, allowTransparency: 0, alt: 0, async: HAS_BOOLEAN_VALUE, autoComplete: 0, // autoFocus is polyfilled/normalized by AutoFocusUtils // autoFocus: HAS_BOOLEAN_VALUE, autoPlay: HAS_BOOLEAN_VALUE, capture: HAS_BOOLEAN_VALUE, cellPadding: 0, cellSpacing: 0, charSet: 0, challenge: 0, checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, cite: 0, classID: 0, className: 0, cols: HAS_POSITIVE_NUMERIC_VALUE, colSpan: 0, content: 0, contentEditable: 0, contextMenu: 0, controls: HAS_BOOLEAN_VALUE, coords: 0, crossOrigin: 0, data: 0, // For `` acts as `src`. dateTime: 0, 'default': HAS_BOOLEAN_VALUE, defer: HAS_BOOLEAN_VALUE, dir: 0, disabled: HAS_BOOLEAN_VALUE, download: HAS_OVERLOADED_BOOLEAN_VALUE, draggable: 0, encType: 0, form: 0, formAction: 0, formEncType: 0, formMethod: 0, formNoValidate: HAS_BOOLEAN_VALUE, formTarget: 0, frameBorder: 0, headers: 0, height: 0, hidden: HAS_BOOLEAN_VALUE, high: 0, href: 0, hrefLang: 0, htmlFor: 0, httpEquiv: 0, icon: 0, id: 0, inputMode: 0, integrity: 0, is: 0, keyParams: 0, keyType: 0, kind: 0, label: 0, lang: 0, list: 0, loop: HAS_BOOLEAN_VALUE, low: 0, manifest: 0, marginHeight: 0, marginWidth: 0, max: 0, maxLength: 0, media: 0, mediaGroup: 0, method: 0, min: 0, minLength: 0, // Caution; `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, name: 0, nonce: 0, noValidate: HAS_BOOLEAN_VALUE, open: HAS_BOOLEAN_VALUE, optimum: 0, pattern: 0, placeholder: 0, poster: 0, preload: 0, profile: 0, radioGroup: 0, readOnly: HAS_BOOLEAN_VALUE, referrerPolicy: 0, rel: 0, required: HAS_BOOLEAN_VALUE, reversed: HAS_BOOLEAN_VALUE, role: 0, rows: HAS_POSITIVE_NUMERIC_VALUE, rowSpan: HAS_NUMERIC_VALUE, sandbox: 0, scope: 0, scoped: HAS_BOOLEAN_VALUE, scrolling: 0, seamless: HAS_BOOLEAN_VALUE, selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, shape: 0, size: HAS_POSITIVE_NUMERIC_VALUE, sizes: 0, span: HAS_POSITIVE_NUMERIC_VALUE, spellCheck: 0, src: 0, srcDoc: 0, srcLang: 0, srcSet: 0, start: HAS_NUMERIC_VALUE, step: 0, style: 0, summary: 0, tabIndex: 0, target: 0, title: 0, // Setting .type throws on non- tags type: 0, useMap: 0, value: 0, width: 0, wmode: 0, wrap: 0, /** * RDFa Properties */ about: 0, datatype: 0, inlist: 0, prefix: 0, // property is also supported for OpenGraph in meta tags. property: 0, resource: 0, 'typeof': 0, vocab: 0, /** * Non-standard Properties */ // autoCapitalize and autoCorrect are supported in Mobile Safari for // keyboard hints. autoCapitalize: 0, autoCorrect: 0, // autoSave allows WebKit/Blink to persist values of input fields on page reloads autoSave: 0, // color is for Safari mask-icon link color: 0, // itemProp, itemScope, itemType are for // Microdata support. See http://schema.org/docs/gs.html itemProp: 0, itemScope: HAS_BOOLEAN_VALUE, itemType: 0, // itemID and itemRef are for Microdata support as well but // only specified in the WHATWG spec document. See // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api itemID: 0, itemRef: 0, // results show looking glass icon and recent searches on input // search fields in WebKit/Blink results: 0, // IE-only attribute that specifies security restrictions on an iframe // as an alternative to the sandbox attribute on IE<10 security: 0, // IE-only attribute that controls focus behavior unselectable: 0 }, DOMAttributeNames: { acceptCharset: 'accept-charset', className: 'class', htmlFor: 'for', httpEquiv: 'http-equiv' }, DOMPropertyNames: {} }; module.exports = HTMLDOMPropertyConfig; /***/ }, /* 81 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponentBrowserEnvironment */ 'use strict'; var DOMChildrenOperations = __webpack_require__(82); var ReactDOMIDOperations = __webpack_require__(94); /** * Abstracts away all functionality of the reconciler that requires knowledge of * the browser context. TODO: These callers should be refactored to avoid the * need for this injection. */ var ReactComponentBrowserEnvironment = { processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup, /** * If a particular environment requires that some resources be cleaned up, * specify this in the injected Mixin. In the DOM, we would likely want to * purge any cached node ID lookups. * * @private */ unmountIDFromEnvironment: function (rootNodeID) {} }; module.exports = ReactComponentBrowserEnvironment; /***/ }, /* 82 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMChildrenOperations */ 'use strict'; var DOMLazyTree = __webpack_require__(83); var Danger = __webpack_require__(89); var ReactMultiChildUpdateTypes = __webpack_require__(93); var ReactDOMComponentTree = __webpack_require__(37); var ReactInstrumentation = __webpack_require__(63); var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); var setInnerHTML = __webpack_require__(85); var setTextContent = __webpack_require__(87); function getNodeAfter(parentNode, node) { // Special case for text components, which return [open, close] comments // from getHostNode. if (Array.isArray(node)) { node = node[1]; } return node ? node.nextSibling : parentNode.firstChild; } /** * Inserts `childNode` as a child of `parentNode` at the `index`. * * @param {DOMElement} parentNode Parent node in which to insert. * @param {DOMElement} childNode Child node to insert. * @param {number} index Index at which to insert the child. * @internal */ var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) { // We rely exclusively on `insertBefore(node, null)` instead of also using // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so // we are careful to use `null`.) parentNode.insertBefore(childNode, referenceNode); }); function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); } function moveChild(parentNode, childNode, referenceNode) { if (Array.isArray(childNode)) { moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode); } else { insertChildAt(parentNode, childNode, referenceNode); } } function removeChild(parentNode, childNode) { if (Array.isArray(childNode)) { var closingComment = childNode[1]; childNode = childNode[0]; removeDelimitedText(parentNode, childNode, closingComment); parentNode.removeChild(closingComment); } parentNode.removeChild(childNode); } function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) { var node = openingComment; while (true) { var nextNode = node.nextSibling; insertChildAt(parentNode, node, referenceNode); if (node === closingComment) { break; } node = nextNode; } } function removeDelimitedText(parentNode, startNode, closingComment) { while (true) { var node = startNode.nextSibling; if (node === closingComment) { // The closing comment is removed by ReactMultiChild. break; } else { parentNode.removeChild(node); } } } function replaceDelimitedText(openingComment, closingComment, stringText) { var parentNode = openingComment.parentNode; var nodeAfterComment = openingComment.nextSibling; if (nodeAfterComment === closingComment) { // There are no text nodes between the opening and closing comments; insert // a new one if stringText isn't empty. if (stringText) { insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment); } } else { if (stringText) { // Set the text content of the first node after the opening comment, and // remove all following nodes up until the closing comment. setTextContent(nodeAfterComment, stringText); removeDelimitedText(parentNode, nodeAfterComment, closingComment); } else { removeDelimitedText(parentNode, openingComment, closingComment); } } if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText); } } var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup; if (process.env.NODE_ENV !== 'production') { dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); if (prevInstance._debugID !== 0) { ReactInstrumentation.debugTool.onHostOperation(prevInstance._debugID, 'replace with', markup.toString()); } else { var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); if (nextInstance._debugID !== 0) { ReactInstrumentation.debugTool.onHostOperation(nextInstance._debugID, 'mount', markup.toString()); } } }; } /** * Operations for updating with DOM children. */ var DOMChildrenOperations = { dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, replaceDelimitedText: replaceDelimitedText, /** * Updates a component's children by processing a series of updates. The * update configurations are each expected to have a `parentNode` property. * * @param {array} updates List of update configurations. * @internal */ processUpdates: function (parentNode, updates) { if (process.env.NODE_ENV !== 'production') { var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID; } for (var k = 0; k < updates.length; k++) { var update = updates[k]; switch (update.type) { case ReactMultiChildUpdateTypes.INSERT_MARKUP: insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() }); } break; case ReactMultiChildUpdateTypes.MOVE_EXISTING: moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex }); } break; case ReactMultiChildUpdateTypes.SET_MARKUP: setInnerHTML(parentNode, update.content); if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace children', update.content.toString()); } break; case ReactMultiChildUpdateTypes.TEXT_CONTENT: setTextContent(parentNode, update.content); if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace text', update.content.toString()); } break; case ReactMultiChildUpdateTypes.REMOVE_NODE: removeChild(parentNode, update.fromNode); if (process.env.NODE_ENV !== 'production') { ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex }); } break; } } } }; module.exports = DOMChildrenOperations; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 83 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMLazyTree */ 'use strict'; var DOMNamespaces = __webpack_require__(84); var setInnerHTML = __webpack_require__(85); var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); var setTextContent = __webpack_require__(87); var ELEMENT_NODE_TYPE = 1; var DOCUMENT_FRAGMENT_NODE_TYPE = 11; /** * In IE (8-11) and Edge, appending nodes with no children is dramatically * faster than appending a full subtree, so we essentially queue up the * .appendChild calls here and apply them so each node is added to its parent * before any children are added. * * In other browsers, doing so is slower or neutral compared to the other order * (in Firefox, twice as slow) so we only do this inversion in IE. * * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode. */ var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent); function insertTreeChildren(tree) { if (!enableLazy) { return; } var node = tree.node; var children = tree.children; if (children.length) { for (var i = 0; i < children.length; i++) { insertTreeBefore(node, children[i], null); } } else if (tree.html != null) { setInnerHTML(node, tree.html); } else if (tree.text != null) { setTextContent(node, tree.text); } } var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) { // DocumentFragments aren't actually part of the DOM after insertion so // appending children won't update the DOM. We need to ensure the fragment // is properly populated first, breaking out of our lazy approach for just // this level. Also, some plugins (like Flash Player) will read // nodes immediately upon insertion into the DOM, so // must also be populated prior to insertion into the DOM. if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) { insertTreeChildren(tree); parentNode.insertBefore(tree.node, referenceNode); } else { parentNode.insertBefore(tree.node, referenceNode); insertTreeChildren(tree); } }); function replaceChildWithTree(oldNode, newTree) { oldNode.parentNode.replaceChild(newTree.node, oldNode); insertTreeChildren(newTree); } function queueChild(parentTree, childTree) { if (enableLazy) { parentTree.children.push(childTree); } else { parentTree.node.appendChild(childTree.node); } } function queueHTML(tree, html) { if (enableLazy) { tree.html = html; } else { setInnerHTML(tree.node, html); } } function queueText(tree, text) { if (enableLazy) { tree.text = text; } else { setTextContent(tree.node, text); } } function toString() { return this.node.nodeName; } function DOMLazyTree(node) { return { node: node, children: [], html: null, text: null, toString: toString }; } DOMLazyTree.insertTreeBefore = insertTreeBefore; DOMLazyTree.replaceChildWithTree = replaceChildWithTree; DOMLazyTree.queueChild = queueChild; DOMLazyTree.queueHTML = queueHTML; DOMLazyTree.queueText = queueText; module.exports = DOMLazyTree; /***/ }, /* 84 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMNamespaces */ 'use strict'; var DOMNamespaces = { html: 'http://www.w3.org/1999/xhtml', mathml: 'http://www.w3.org/1998/Math/MathML', svg: 'http://www.w3.org/2000/svg' }; module.exports = DOMNamespaces; /***/ }, /* 85 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule setInnerHTML */ 'use strict'; var ExecutionEnvironment = __webpack_require__(50); var DOMNamespaces = __webpack_require__(84); var WHITESPACE_TEST = /^[ \r\n\t\f]/; var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); // SVG temp container for IE lacking innerHTML var reusableSVGContainer; /** * Set the innerHTML property of a node, ensuring that whitespace is preserved * even in IE8. * * @param {DOMElement} node * @param {string} html * @internal */ var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { // IE does not have innerHTML for SVG nodes, so instead we inject the // new markup in a temp node and then move the child nodes across into // the target node if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) { reusableSVGContainer = reusableSVGContainer || document.createElement('div'); reusableSVGContainer.innerHTML = '' + html + ''; var newNodes = reusableSVGContainer.firstChild.childNodes; for (var i = 0; i < newNodes.length; i++) { node.appendChild(newNodes[i]); } } else { node.innerHTML = html; } }); if (ExecutionEnvironment.canUseDOM) { // IE8: When updating a just created node with innerHTML only leading // whitespace is removed. When updating an existing node with innerHTML // whitespace in root TextNodes is also collapsed. // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html // Feature detection; only IE8 is known to behave improperly like this. var testElement = document.createElement('div'); testElement.innerHTML = ' '; if (testElement.innerHTML === '') { setInnerHTML = function (node, html) { // Magic theory: IE8 supposedly differentiates between added and updated // nodes when processing innerHTML, innerHTML on updated nodes suffers // from worse whitespace behavior. Re-adding a node like this triggers // the initial and more favorable whitespace behavior. // TODO: What to do on a detached node? if (node.parentNode) { node.parentNode.replaceChild(node, node); } // We also implement a workaround for non-visible tags disappearing into // thin air on IE8, this only happens if there is no visible text // in-front of the non-visible tags. Piggyback on the whitespace fix // and simply check if any non-visible tags appear in the source. if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) { // Recover leading whitespace by temporarily prepending any character. // \uFEFF has the potential advantage of being zero-width/invisible. // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode // in hopes that this is preserved even if "\uFEFF" is transformed to // the actual Unicode character (by Babel, for example). // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 node.innerHTML = String.fromCharCode(0xFEFF) + html; // deleteData leaves an empty `TextNode` which offsets the index of all // children. Definitely want to avoid this. var textNode = node.firstChild; if (textNode.data.length === 1) { node.removeChild(textNode); } else { textNode.deleteData(0, 1); } } else { node.innerHTML = html; } }; } testElement = null; } module.exports = setInnerHTML; /***/ }, /* 86 */ /***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule createMicrosoftUnsafeLocalFunction */ /* globals MSApp */ 'use strict'; /** * Create a function which has 'unsafe' privileges (required by windows8 apps) */ var createMicrosoftUnsafeLocalFunction = function (func) { if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { return function (arg0, arg1, arg2, arg3) { MSApp.execUnsafeLocalFunction(function () { return func(arg0, arg1, arg2, arg3); }); }; } else { return func; } }; module.exports = createMicrosoftUnsafeLocalFunction; /***/ }, /* 87 */ /***/ function(module, exports, __webpack_require__) { /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule setTextContent */ 'use strict'; var ExecutionEnvironment = __webpack_require__(50); var escapeTextContentForBrowser = __webpack_require__(88); var setInnerHTML = __webpack_require__(85); /** * Set the textContent property of a node, ensuring that whitespace is preserved * even in IE8. innerText is a poor substitute for textContent and, among many * issues, inserts
instead of the literal newline chars. innerHTML behaves * as it should. * * @param {DOMElement} node * @param {string} text * @internal */ var setTextContent = function (node, text) { if (text) { var firstChild = node.firstChild; if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) { firstChild.nodeValue = text; return; } } node.textContent = text; }; if (ExecutionEnvironment.canUseDOM) { if (!('textContent' in document.documentElement)) { setTextContent = function (node, text) { setInnerHTML(node, escapeTextContentForBrowser(text)); }; } } module.exports = setTextContent; /***/ }, /* 88 */ /***/ function(module, exports) { /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * Based on the escape-html library, which is used under the MIT License below: * * Copyright (c) 2012-2013 TJ Holowaychuk * Copyright (c) 2015 Andreas Lubbe * Copyright (c) 2015 Tiancheng "Timothy" Gu * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * @providesModule escapeTextContentForBrowser */ 'use strict'; // code copied and modified from escape-html /** * Module variables. * @private */ var matchHtmlRegExp = /["'&<>]/; /** * Escape special characters in the given string of html. * * @param {string} string The string to escape for inserting into HTML * @return {string} * @public */ function escapeHtml(string) { var str = '' + string; var match = matchHtmlRegExp.exec(str); if (!match) { return str; } var escape; var html = ''; var index = 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: // " escape = '"'; break; case 38: // & escape = '&'; break; case 39: // ' escape = '''; // modified from escape-html; used to be ''' break; case 60: // < escape = '<'; break; case 62: // > escape = '>'; break; default: continue; } if (lastIndex !== index) { html += str.substring(lastIndex, index); } lastIndex = index + 1; html += escape; } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; } // end code copied and modified from escape-html /** * Escapes text to prevent scripting attacks. * * @param {*} text Text value to escape. * @return {string} An escaped string. */ function escapeTextContentForBrowser(text) { if (typeof text === 'boolean' || typeof text === 'number') { // this shortcircuit helps perf for types that we know will never have // special characters, especially given that this function is used often // for numeric dom ids. return '' + text; } return escapeHtml(text); } module.exports = escapeTextContentForBrowser; /***/ }, /* 89 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Danger */ 'use strict'; var _prodInvariant = __webpack_require__(7); var DOMLazyTree = __webpack_require__(83); var ExecutionEnvironment = __webpack_require__(50); var createNodesFromMarkup = __webpack_require__(90); var emptyFunction = __webpack_require__(12); var invariant = __webpack_require__(8); var Danger = { /** * Replaces a node with a string of markup at its current position within its * parent. The markup must render into a single root node. * * @param {DOMElement} oldChild Child node to replace. * @param {string} markup Markup to render in place of the child node. * @internal */ dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) { !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0; !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0; !(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0; if (typeof markup === 'string') { var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; oldChild.parentNode.replaceChild(newChild, oldChild); } else { DOMLazyTree.replaceChildWithTree(oldChild, markup); } } }; module.exports = Danger; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 90 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks */ /*eslint-disable fb-www/unsafe-html*/ var ExecutionEnvironment = __webpack_require__(50); var createArrayFromMixed = __webpack_require__(91); var getMarkupWrap = __webpack_require__(92); var invariant = __webpack_require__(8); /** * Dummy container used to render all markup. */ var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; /** * Pattern used by `getNodeName`. */ var nodeNamePattern = /^\s*<(\w+)/; /** * Extracts the `nodeName` of the first element in a string of markup. * * @param {string} markup String of markup. * @return {?string} Node name of the supplied markup. */ function getNodeName(markup) { var nodeNameMatch = markup.match(nodeNamePattern); return nodeNameMatch && nodeNameMatch[1].toLowerCase(); } /** * Creates an array containing the nodes rendered from the supplied markup. The * optionally supplied `handleScript` function will be invoked once for each *