text: /*
  YUI 3.16.0 (build 76f0e08)
  Copyright 2014 Yahoo! Inc. All rights reserved.
  Licensed under the BSD License.
  http://yuilibrary.com/license/
  */
  
  if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
  if (!__coverage__['build/model-sync-rest/model-sync-rest.js']) {
     __coverage__['build/model-sync-rest/model-sync-rest.js'] = {"path":"build/model-sync-rest/model-sync-rest.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0,0],"19":[0,0],"20":[0,0,0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":46}}},"2":{"name":"RESTSync","line":48,"loc":{"start":{"line":48,"column":0},"end":{"line":48,"column":20}}},"3":{"name":"(anonymous_3)","line":296,"loc":{"start":{"line":296,"column":17},"end":{"line":296,"column":35}}},"4":{"name":"(anonymous_4)","line":332,"loc":{"start":{"line":332,"column":12},"end":{"line":332,"column":39}}},"5":{"name":"(anonymous_5)","line":386,"loc":{"start":{"line":386,"column":21},"end":{"line":386,"column":41}}},"6":{"name":"(anonymous_6)","line":411,"loc":{"start":{"line":411,"column":15},"end":{"line":411,"column":33}}},"7":{"name":"(anonymous_7)","line":448,"loc":{"start":{"line":448,"column":10},"end":{"line":448,"column":47}}},"8":{"name":"(anonymous_8)","line":517,"loc":{"start":{"line":517,"column":14},"end":{"line":517,"column":29}}},"9":{"name":"(anonymous_9)","line":551,"loc":{"start":{"line":551,"column":12},"end":{"line":551,"column":32}}},"10":{"name":"(anonymous_10)","line":581,"loc":{"start":{"line":581,"column":24},"end":{"line":581,"column":42}}},"11":{"name":"(anonymous_11)","line":622,"loc":{"start":{"line":622,"column":20},"end":{"line":622,"column":41}}},"12":{"name":"(anonymous_12)","line":631,"loc":{"start":{"line":631,"column":28},"end":{"line":631,"column":44}}},"13":{"name":"(anonymous_13)","line":658,"loc":{"start":{"line":658,"column":18},"end":{"line":658,"column":43}}},"14":{"name":"(anonymous_14)","line":676,"loc":{"start":{"line":676,"column":22},"end":{"line":676,"column":52}}},"15":{"name":"(anonymous_15)","line":703,"loc":{"start":{"line":703,"column":22},"end":{"line":703,"column":52}}},"16":{"name":"(anonymous_16)","line":725,"loc":{"start":{"line":725,"column":20},"end":{"line":725,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":733,"column":67}},"2":{"start":{"line":12,"column":0},"end":{"line":12,"column":18}},"3":{"start":{"line":48,"column":0},"end":{"line":48,"column":22}},"4":{"start":{"line":76,"column":0},"end":{"line":76,"column":41}},"5":{"start":{"line":92,"column":0},"end":{"line":92,"column":30}},"6":{"start":{"line":116,"column":0},"end":{"line":119,"column":2}},"7":{"start":{"line":136,"column":0},"end":{"line":141,"column":2}},"8":{"start":{"line":155,"column":0},"end":{"line":155,"column":30}},"9":{"start":{"line":168,"column":0},"end":{"line":168,"column":42}},"10":{"start":{"line":170,"column":0},"end":{"line":726,"column":2}},"11":{"start":{"line":297,"column":8},"end":{"line":297,"column":32}},"12":{"start":{"line":300,"column":8},"end":{"line":302,"column":9}},"13":{"start":{"line":301,"column":12},"end":{"line":301,"column":42}},"14":{"start":{"line":305,"column":8},"end":{"line":307,"column":9}},"15":{"start":{"line":306,"column":12},"end":{"line":306,"column":40}},"16":{"start":{"line":333,"column":8},"end":{"line":334,"column":28}},"17":{"start":{"line":339,"column":8},"end":{"line":345,"column":9}},"18":{"start":{"line":340,"column":12},"end":{"line":342,"column":13}},"19":{"start":{"line":341,"column":16},"end":{"line":341,"column":49}},"20":{"start":{"line":344,"column":12},"end":{"line":344,"column":79}},"21":{"start":{"line":352,"column":8},"end":{"line":354,"column":9}},"22":{"start":{"line":353,"column":12},"end":{"line":353,"column":24}},"23":{"start":{"line":359,"column":8},"end":{"line":361,"column":9}},"24":{"start":{"line":360,"column":12},"end":{"line":360,"column":60}},"25":{"start":{"line":365,"column":8},"end":{"line":365,"column":75}},"26":{"start":{"line":387,"column":8},"end":{"line":387,"column":37}},"27":{"start":{"line":412,"column":8},"end":{"line":412,"column":38}},"28":{"start":{"line":449,"column":8},"end":{"line":449,"column":34}},"29":{"start":{"line":451,"column":8},"end":{"line":456,"column":19}},"30":{"start":{"line":459,"column":8},"end":{"line":464,"column":9}},"31":{"start":{"line":460,"column":12},"end":{"line":460,"column":44}},"32":{"start":{"line":463,"column":12},"end":{"line":463,"column":43}},"33":{"start":{"line":467,"column":8},"end":{"line":475,"column":9}},"34":{"start":{"line":471,"column":12},"end":{"line":471,"column":55}},"35":{"start":{"line":474,"column":12},"end":{"line":474,"column":28}},"36":{"start":{"line":479,"column":8},"end":{"line":483,"column":9}},"37":{"start":{"line":482,"column":12},"end":{"line":482,"column":48}},"38":{"start":{"line":485,"column":8},"end":{"line":493,"column":11}},"39":{"start":{"line":518,"column":8},"end":{"line":518,"column":29}},"40":{"start":{"line":520,"column":8},"end":{"line":522,"column":9}},"41":{"start":{"line":521,"column":12},"end":{"line":521,"column":22}},"42":{"start":{"line":524,"column":8},"end":{"line":526,"column":9}},"43":{"start":{"line":525,"column":12},"end":{"line":525,"column":35}},"44":{"start":{"line":530,"column":8},"end":{"line":532,"column":33}},"45":{"start":{"line":555,"column":8},"end":{"line":557,"column":9}},"46":{"start":{"line":556,"column":12},"end":{"line":556,"column":54}},"47":{"start":{"line":559,"column":8},"end":{"line":559,"column":36}},"48":{"start":{"line":582,"column":8},"end":{"line":601,"column":11}},"49":{"start":{"line":623,"column":8},"end":{"line":625,"column":9}},"50":{"start":{"line":624,"column":12},"end":{"line":624,"column":22}},"51":{"start":{"line":627,"column":8},"end":{"line":627,"column":24}},"52":{"start":{"line":631,"column":8},"end":{"line":636,"column":11}},"53":{"start":{"line":632,"column":12},"end":{"line":635,"column":13}},"54":{"start":{"line":634,"column":16},"end":{"line":634,"column":50}},"55":{"start":{"line":638,"column":8},"end":{"line":638,"column":37}},"56":{"start":{"line":677,"column":8},"end":{"line":677,"column":40}},"57":{"start":{"line":679,"column":8},"end":{"line":684,"column":9}},"58":{"start":{"line":680,"column":12},"end":{"line":683,"column":20}},"59":{"start":{"line":704,"column":8},"end":{"line":704,"column":40}},"60":{"start":{"line":706,"column":8},"end":{"line":708,"column":9}},"61":{"start":{"line":707,"column":12},"end":{"line":707,"column":32}},"62":{"start":{"line":730,"column":0},"end":{"line":730,"column":41}}},"branchMap":{"1":{"line":297,"type":"binary-expr","locations":[{"start":{"line":297,"column":8},"end":{"line":297,"column":14}},{"start":{"line":297,"column":19},"end":{"line":297,"column":30}}]},"2":{"line":300,"type":"if","locations":[{"start":{"line":300,"column":8},"end":{"line":300,"column":8}},{"start":{"line":300,"column":8},"end":{"line":300,"column":8}}]},"3":{"line":301,"type":"binary-expr","locations":[{"start":{"line":301,"column":24},"end":{"line":301,"column":35}},{"start":{"line":301,"column":39},"end":{"line":301,"column":41}}]},"4":{"line":305,"type":"if","locations":[{"start":{"line":305,"column":8},"end":{"line":305,"column":8}},{"start":{"line":305,"column":8},"end":{"line":305,"column":8}}]},"5":{"line":306,"type":"binary-expr","locations":[{"start":{"line":306,"column":23},"end":{"line":306,"column":33}},{"start":{"line":306,"column":37},"end":{"line":306,"column":39}}]},"6":{"line":339,"type":"if","locations":[{"start":{"line":339,"column":8},"end":{"line":339,"column":8}},{"start":{"line":339,"column":8},"end":{"line":339,"column":8}}]},"7":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":12},"end":{"line":340,"column":12}},{"start":{"line":340,"column":12},"end":{"line":340,"column":12}}]},"8":{"line":352,"type":"if","locations":[{"start":{"line":352,"column":8},"end":{"line":352,"column":8}},{"start":{"line":352,"column":8},"end":{"line":352,"column":8}}]},"9":{"line":352,"type":"binary-expr","locations":[{"start":{"line":352,"column":12},"end":{"line":352,"column":16}},{"start":{"line":352,"column":21},"end":{"line":352,"column":40}},{"start":{"line":352,"column":44},"end":{"line":352,"column":56}}]},"10":{"line":359,"type":"if","locations":[{"start":{"line":359,"column":8},"end":{"line":359,"column":8}},{"start":{"line":359,"column":8},"end":{"line":359,"column":8}}]},"11":{"line":360,"type":"binary-expr","locations":[{"start":{"line":360,"column":33},"end":{"line":360,"column":52}},{"start":{"line":360,"column":56},"end":{"line":360,"column":58}}]},"12":{"line":449,"type":"binary-expr","locations":[{"start":{"line":449,"column":8},"end":{"line":449,"column":15}},{"start":{"line":449,"column":20},"end":{"line":449,"column":32}}]},"13":{"line":454,"type":"binary-expr","locations":[{"start":{"line":454,"column":24},"end":{"line":454,"column":39}},{"start":{"line":454,"column":43},"end":{"line":454,"column":64}}]},"14":{"line":455,"type":"binary-expr","locations":[{"start":{"line":455,"column":24},"end":{"line":455,"column":41}},{"start":{"line":455,"column":45},"end":{"line":455,"column":64}}]},"15":{"line":459,"type":"if","locations":[{"start":{"line":459,"column":8},"end":{"line":459,"column":8}},{"start":{"line":459,"column":8},"end":{"line":459,"column":8}}]},"16":{"line":459,"type":"binary-expr","locations":[{"start":{"line":459,"column":12},"end":{"line":459,"column":29}},{"start":{"line":459,"column":33},"end":{"line":459,"column":49}}]},"17":{"line":467,"type":"if","locations":[{"start":{"line":467,"column":8},"end":{"line":467,"column":8}},{"start":{"line":467,"column":8},"end":{"line":467,"column":8}}]},"18":{"line":467,"type":"binary-expr","locations":[{"start":{"line":467,"column":12},"end":{"line":467,"column":33}},{"start":{"line":468,"column":17},"end":{"line":468,"column":33}},{"start":{"line":468,"column":37},"end":{"line":468,"column":56}}]},"19":{"line":479,"type":"if","locations":[{"start":{"line":479,"column":8},"end":{"line":479,"column":8}},{"start":{"line":479,"column":8},"end":{"line":479,"column":8}}]},"20":{"line":479,"type":"binary-expr","locations":[{"start":{"line":479,"column":12},"end":{"line":479,"column":21}},{"start":{"line":480,"column":17},"end":{"line":480,"column":34}},{"start":{"line":480,"column":38},"end":{"line":480,"column":54}},{"start":{"line":480,"column":58},"end":{"line":480,"column":77}}]},"21":{"line":520,"type":"if","locations":[{"start":{"line":520,"column":8},"end":{"line":520,"column":8}},{"start":{"line":520,"column":8},"end":{"line":520,"column":8}}]},"22":{"line":520,"type":"binary-expr","locations":[{"start":{"line":520,"column":14},"end":{"line":520,"column":18}},{"start":{"line":520,"column":22},"end":{"line":520,"column":25}}]},"23":{"line":524,"type":"if","locations":[{"start":{"line":524,"column":8},"end":{"line":524,"column":8}},{"start":{"line":524,"column":8},"end":{"line":524,"column":8}}]},"24":{"line":530,"type":"cond-expr","locations":[{"start":{"line":531,"column":16},"end":{"line":531,"column":32}},{"start":{"line":532,"column":16},"end":{"line":532,"column":32}}]},"25":{"line":530,"type":"binary-expr","locations":[{"start":{"line":530,"column":15},"end":{"line":530,"column":19}},{"start":{"line":530,"column":23},"end":{"line":530,"column":59}}]},"26":{"line":555,"type":"if","locations":[{"start":{"line":555,"column":8},"end":{"line":555,"column":8}},{"start":{"line":555,"column":8},"end":{"line":555,"column":8}}]},"27":{"line":623,"type":"if","locations":[{"start":{"line":623,"column":8},"end":{"line":623,"column":8}},{"start":{"line":623,"column":8},"end":{"line":623,"column":8}}]},"28":{"line":632,"type":"if","locations":[{"start":{"line":632,"column":12},"end":{"line":632,"column":12}},{"start":{"line":632,"column":12},"end":{"line":632,"column":12}}]},"29":{"line":632,"type":"binary-expr","locations":[{"start":{"line":632,"column":16},"end":{"line":632,"column":32}},{"start":{"line":632,"column":36},"end":{"line":632,"column":52}}]},"30":{"line":679,"type":"if","locations":[{"start":{"line":679,"column":8},"end":{"line":679,"column":8}},{"start":{"line":679,"column":8},"end":{"line":679,"column":8}}]},"31":{"line":706,"type":"if","locations":[{"start":{"line":706,"column":8},"end":{"line":706,"column":8}},{"start":{"line":706,"column":8},"end":{"line":706,"column":8}}]}},"code":["(function () { YUI.add('model-sync-rest', function (Y, NAME) {","","/**","An extension which provides a RESTful XHR sync implementation that can be mixed","into a Model or ModelList subclass.","","@module app","@submodule model-sync-rest","@since 3.6.0","**/","","var Lang = Y.Lang;","","/**","An extension which provides a RESTful XHR sync implementation that can be mixed","into a Model or ModelList subclass.","","This makes it trivial for your Model or ModelList subclasses communicate and","transmit their data via RESTful XHRs. In most cases you'll only need to provide","a value for `root` when sub-classing `Y.Model`.","","    Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {","        root: '/users'","    });","","    Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {","        // By convention `Y.User`'s `root` will be used for the lists' URL.","        model: Y.User","    });","","    var users = new Y.Users();","","    // GET users list from: \"/users\"","    users.load(function () {","        var firstUser = users.item(0);","","        firstUser.get('id'); // => \"1\"","","        // PUT updated user data at: \"/users/1\"","        firstUser.set('name', 'Eric').save();","    });","","@class ModelSync.REST","@extensionfor Model","@extensionfor ModelList","@since 3.6.0","**/","function RESTSync() {}","","/**","A request authenticity token to validate HTTP requests made by this extension","with the server when the request results in changing persistent state. This","allows you to protect your server from Cross-Site Request Forgery attacks.","","A CSRF token provided by the server can be embedded in the HTML document and","assigned to `YUI.Env.CSRF_TOKEN` like this:","","    <script>","        YUI.Env.CSRF_TOKEN = {{session.authenticityToken}};","    </script>","","The above should come after YUI seed file so that `YUI.Env` will be defined.","","**Note:** This can be overridden on a per-request basis. See `sync()` method.","","When a value for the CSRF token is provided, either statically or via `options`","passed to the `save()` and `destroy()` methods, the applicable HTTP requests","will have a `X-CSRF-Token` header added with the token value.","","@property CSRF_TOKEN","@type String","@default YUI.Env.CSRF_TOKEN","@static","@since 3.6.0","**/","RESTSync.CSRF_TOKEN = YUI.Env.CSRF_TOKEN;","","/**","Static flag to use the HTTP POST method instead of PUT or DELETE.","","If the server-side HTTP framework isn't RESTful, setting this flag to `true`","will cause all PUT and DELETE requests to instead use the POST HTTP method, and","add a `X-HTTP-Method-Override` HTTP header with the value of the method type","which was overridden.","","@property EMULATE_HTTP","@type Boolean","@default false","@static","@since 3.6.0","**/","RESTSync.EMULATE_HTTP = false;","","/**","Default headers used with all XHRs.","","By default the `Accept` and `Content-Type` headers are set to","\"application/json\", this signals to the HTTP server to process the request","bodies as JSON and send JSON responses. If you're sending and receiving content","other than JSON, you can override these headers and the `parse()` and","`serialize()` methods.","","**Note:** These headers will be merged with any request-specific headers, and","the request-specific headers will take precedence.","","@property HTTP_HEADERS","@type Object","@default","    {","        \"Accept\"      : \"application/json\",","        \"Content-Type\": \"application/json\"","    }","@static","@since 3.6.0","**/","RESTSync.HTTP_HEADERS = {","    'Accept'      : 'application/json',","    'Content-Type': 'application/json'","};","","/**","Static mapping of RESTful HTTP methods corresponding to CRUD actions.","","@property HTTP_METHODS","@type Object","@default","    {","        \"create\": \"POST\",","        \"read\"  : \"GET\",","        \"update\": \"PUT\",","        \"delete\": \"DELETE\"","    }","@static","@since 3.6.0","**/","RESTSync.HTTP_METHODS = {","    'create': 'POST',","    'read'  : 'GET',","    'update': 'PUT',","    'delete': 'DELETE'","};","","/**","The number of milliseconds before the XHRs will timeout/abort. This defaults to","30 seconds.","","**Note:** This can be overridden on a per-request basis. See `sync()` method.","","@property HTTP_TIMEOUT","@type Number","@default 30000","@static","@since 3.6.0","**/","RESTSync.HTTP_TIMEOUT = 30000;","","/**","Properties that shouldn't be turned into ad-hoc attributes when passed to a","Model or ModelList constructor.","","@property _NON_ATTRS_CFG","@type Array","@default [\"root\", \"url\"]","@static","@protected","@since 3.6.0","**/","RESTSync._NON_ATTRS_CFG = ['root', 'url'];","","RESTSync.prototype = {","","    // -- Public Properties ----------------------------------------------------","","    /**","    A string which represents the root or collection part of the URL which","    relates to a Model or ModelList. Usually this value should be same for all","    instances of a specific Model/ModelList subclass.","","    When sub-classing `Y.Model`, usually you'll only need to override this","    property, which lets the URLs for the XHRs be generated by convention. If","    the `root` string ends with a trailing-slash, XHR URLs will also end with a","    \"/\", and if the `root` does not end with a slash, neither will the XHR URLs.","","    @example","        Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {","            root: '/users'","        });","","        var currentUser, newUser;","","        // GET the user data from: \"/users/123\"","        currentUser = new Y.User({id: '123'}).load();","","        // POST the new user data to: \"/users\"","        newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();","","    When sub-classing `Y.ModelList`, usually you'll want to ignore configuring","    the `root` and simply rely on the build-in convention of the list's","    generated URLs defaulting to the `root` specified by the list's `model`.","","    @property root","    @type String","    @default \"\"","    @since 3.6.0","    **/","    root: '',","","    /**","    A string which specifies the URL to use when making XHRs, if not value is","    provided, the URLs used to make XHRs will be generated by convention.","","    While a `url` can be provided for each Model/ModelList instance, usually","    you'll want to either rely on the default convention or provide a tokenized","    string on the prototype which can be used for all instances.","","    When sub-classing `Y.Model`, you will probably be able to rely on the","    default convention of generating URLs in conjunction with the `root`","    property and whether the model is new or not (i.e. has an `id`). If the","    `root` property ends with a trailing-slash, the generated URL for the","    specific model will also end with a trailing-slash.","","    @example","        Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {","            root: '/users/'","        });","","        var currentUser, newUser;","","        // GET the user data from: \"/users/123/\"","        currentUser = new Y.User({id: '123'}).load();","","        // POST the new user data to: \"/users/\"","        newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();","","    If a `url` is specified, it will be processed by `Y.Lang.sub()`, which is","    useful when the URLs for a Model/ModelList subclass match a specific pattern","    and can use simple replacement tokens; e.g.:","","    @example","        Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {","            root: '/users',","            url : '/users/{username}'","        });","","    **Note:** String subsitituion of the `url` only use string an number values","    provided by this object's attribute and/or the `options` passed to the","    `getURL()` method. Do not expect something fancy to happen with Object,","    Array, or Boolean values, they will simply be ignored.","","    If your URLs have plural roots or collection URLs, while the specific item","    resources are under a singular name, e.g. \"/users\" (plural) and \"/user/123\"","    (singular), you'll probably want to configure the `root` and `url`","    properties like this:","","    @example","        Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {","            root: '/users',","            url : '/user/{id}'","        });","","        var currentUser, newUser;","","        // GET the user data from: \"/user/123\"","        currentUser = new Y.User({id: '123'}).load();","","        // POST the new user data to: \"/users\"","        newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();","","    When sub-classing `Y.ModelList`, usually you'll be able to rely on the","    associated `model` to supply its `root` to be used as the model list's URL.","    If this needs to be customized, you can provide a simple string for the","    `url` property.","","    @example","        Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {","            // Leverages `Y.User`'s `root`, which is \"/users\".","            model: Y.User","        });","","        // Or specified explicitly...","","        Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {","            model: Y.User,","            url  : '/users'","        });","","    @property url","    @type String","    @default \"\"","    @since 3.6.0","    **/","    url: '',","","    // -- Lifecycle Methods ----------------------------------------------------","","    initializer: function (config) {","        config || (config = {});","","        // Overrides `root` at the instance level.","        if ('root' in config) {","            this.root = config.root || '';","        }","","        // Overrides `url` at the instance level.","        if ('url' in config) {","            this.url = config.url || '';","        }","    },","","    // -- Public Methods -------------------------------------------------------","","    /**","    Returns the URL for this model or model list for the given `action` and","    `options`, if specified.","","    This method correctly handles the variations of `root` and `url` values and","    is called by the `sync()` method to get the URLs used to make the XHRs.","","    You can override this method if you need to provide a specific","    implementation for how the URLs of your Model and ModelList subclasses need","    to be generated.","","    @method getURL","    @param {String} [action] Optional `sync()` action for which to generate the","        URL.","    @param {Object} [options] Optional options which may be used to help","        generate the URL.","    @return {String} this model's or model list's URL for the the given","        `action` and `options`.","    @since 3.6.0","    **/","    getURL: function (action, options) {","        var root = this.root,","            url  = this.url;","","        // If this is a model list, use its `url` and substitute placeholders,","        // but default to the `root` of its `model`. By convention a model's","        // `root` is the location to a collection resource.","        if (this._isYUIModelList) {","            if (!url) {","                return this.model.prototype.root;","            }","","            return this._substituteURL(url, Y.merge(this.getAttrs(), options));","        }","","        // Assume `this` is a model.","","        // When a model is new, i.e. has no `id`, the `root` should be used. By","        // convention a model's `root` is the location to a collection resource.","        // The model's `url` will be used as a fallback if `root` isn't defined.","        if (root && (action === 'create' || this.isNew())) {","            return root;","        }","","        // When a model's `url` is not provided, we'll generate a URL to use by","        // convention. This will combine the model's `id` with its configured","        // `root` and add a trailing-slash if the root ends with \"/\".","        if (!url) {","            return this._joinURL(this.getAsURL('id') || '');","        }","","        // Substitute placeholders in the `url` with URL-encoded values from the","        // model's attribute values or the specified `options`.","        return this._substituteURL(url, Y.merge(this.getAttrs(), options));","    },","","    /**","    Called to parse the response object returned from `Y.io()`. This method","    receives the full response object and is expected to \"prep\" a response which","    is suitable to pass to the `parse()` method.","","    By default the response body is returned (`responseText`), because it","    usually represents the entire entity of this model on the server.","","    If you need to parse data out of the response's headers you should do so by","    overriding this method. If you'd like the entire response object from the","    XHR to be passed to your `parse()` method, you can simply assign this","    property to `false`.","","    @method parseIOResponse","    @param {Object} response Response object from `Y.io()`.","    @return {Any} The modified response to pass along to the `parse()` method.","    @since 3.7.0","    **/","    parseIOResponse: function (response) {","        return response.responseText;","    },","","    /**","    Serializes `this` model to be used as the HTTP request entity body.","","    By default this model will be serialized to a JSON string via its `toJSON()`","    method.","","    You can override this method when the HTTP server expects a different","    representation of this model's data that is different from the default JSON","    serialization. If you're sending and receive content other than JSON, be","    sure change the `Accept` and `Content-Type` `HTTP_HEADERS` as well.","","    **Note:** A model's `toJSON()` method can also be overridden. If you only","    need to modify which attributes are serialized to JSON, that's a better","    place to start.","","    @method serialize","    @param {String} [action] Optional `sync()` action for which to generate the","        the serialized representation of this model.","    @return {String} serialized HTTP request entity body.","    @since 3.6.0","    **/","    serialize: function (action) {","        return Y.JSON.stringify(this);","    },","","    /**","    Communicates with a RESTful HTTP server by sending and receiving data via","    XHRs. This method is called internally by load(), save(), and destroy().","","    The URL used for each XHR will be retrieved by calling the `getURL()` method","    and passing it the specified `action` and `options`.","","    This method relies heavily on standard RESTful HTTP conventions","","    @method sync","    @param {String} action Sync action to perform. May be one of the following:","","      * `create`: Store a newly-created model for the first time.","      * `delete`: Delete an existing model.","      * `read`  : Load an existing model.","      * `update`: Update an existing model.","","    @param {Object} [options] Sync options:","      @param {String} [options.csrfToken] The authenticity token used by the","        server to verify the validity of this request and protected against CSRF","        attacks. This overrides the default value provided by the static","        `CSRF_TOKEN` property.","      @param {Object} [options.headers] The HTTP headers to mix with the default","        headers specified by the static `HTTP_HEADERS` property.","      @param {Number} [options.timeout] The number of milliseconds before the","        request will timeout and be aborted. This overrides the default provided","        by the static `HTTP_TIMEOUT` property.","    @param {Function} [callback] Called when the sync operation finishes.","      @param {Error|null} callback.err If an error occurred, this parameter will","        contain the error. If the sync operation succeeded, _err_ will be","        falsy.","      @param {Any} [callback.response] The server's response.","    **/","    sync: function (action, options, callback) {","        options || (options = {});","","        var url       = this.getURL(action, options),","            method    = RESTSync.HTTP_METHODS[action],","            headers   = Y.merge(RESTSync.HTTP_HEADERS, options.headers),","            timeout   = options.timeout || RESTSync.HTTP_TIMEOUT,","            csrfToken = options.csrfToken || RESTSync.CSRF_TOKEN,","            entity;","","        // Prepare the content if we are sending data to the server.","        if (method === 'POST' || method === 'PUT') {","            entity = this.serialize(action);","        } else {","            // Remove header, no content is being sent.","            delete headers['Content-Type'];","        }","","        // Setup HTTP emulation for older servers if we need it.","        if (RESTSync.EMULATE_HTTP &&","                (method === 'PUT' || method === 'DELETE')) {","","            // Pass along original method type in the headers.","            headers['X-HTTP-Method-Override'] = method;","","            // Fall-back to using POST method type.","            method = 'POST';","        }","","        // Add CSRF token to HTTP request headers if one is specified and the","        // request will cause side effects on the server.","        if (csrfToken &&","                (method === 'POST' || method === 'PUT' || method === 'DELETE')) {","","            headers['X-CSRF-Token'] = csrfToken;","        }","","        this._sendSyncIORequest({","            action  : action,","            callback: callback,","            entity  : entity,","            headers : headers,","            method  : method,","            timeout : timeout,","            url     : url","        });","    },","","    // -- Protected Methods ----------------------------------------------------","","    /**","    Joins the `root` URL to the specified `url`, normalizing leading/trailing","    \"/\" characters.","","    @example","        model.root = '/foo'","        model._joinURL('bar');  // => '/foo/bar'","        model._joinURL('/bar'); // => '/foo/bar'","","        model.root = '/foo/'","        model._joinURL('bar');  // => '/foo/bar/'","        model._joinURL('/bar'); // => '/foo/bar/'","","    @method _joinURL","    @param {String} url URL to append to the `root` URL.","    @return {String} Joined URL.","    @protected","    @since 3.6.0","    **/","    _joinURL: function (url) {","        var root = this.root;","","        if (!(root || url)) {","            return '';","        }","","        if (url.charAt(0) === '/') {","            url = url.substring(1);","        }","","        // Combines the `root` with the `url` and adds a trailing-slash if the","        // `root` has a trailing-slash.","        return root && root.charAt(root.length - 1) === '/' ?","                root + url + '/' :","                root + '/' + url;","    },","","","    /**","    Calls both public, overrideable methods: `parseIOResponse()`, then `parse()`","    and returns the result.","","    This will call into `parseIOResponse()`, if it's defined as a method,","    passing it the full response object from the XHR and using its return value","    to pass along to the `parse()`. This enables developers to easily parse data","    out of the response headers which should be used by the `parse()` method.","","    @method _parse","    @param {Object} response Response object from `Y.io()`.","    @return {Object|Object[]} Attribute hash or Array of model attribute hashes.","    @protected","    @since 3.7.0","    **/","    _parse: function (response) {","        // When `parseIOResponse` is defined as a method, it will be invoked and","        // the result will become the new response object that the `parse()`","        // will be invoked with.","        if (typeof this.parseIOResponse === 'function') {","            response = this.parseIOResponse(response);","        }","","        return this.parse(response);","    },","","    /**","    Performs the XHR and returns the resulting `Y.io()` request object.","","    This method is called by `sync()`.","","    @method _sendSyncIORequest","    @param {Object} config An object with the following properties:","      @param {String} config.action The `sync()` action being performed.","      @param {Function} [config.callback] Called when the sync operation","        finishes.","      @param {String} [config.entity] The HTTP request entity body.","      @param {Object} config.headers The HTTP request headers.","      @param {String} config.method The HTTP request method.","      @param {Number} [config.timeout] Time until the HTTP request is aborted.","      @param {String} config.url The URL of the HTTP resource.","    @return {Object} The resulting `Y.io()` request object.","    @protected","    @since 3.6.0","    **/","    _sendSyncIORequest: function (config) {","        return Y.io(config.url, {","            'arguments': {","                action  : config.action,","                callback: config.callback,","                url     : config.url","            },","","            context: this,","            data   : config.entity,","            headers: config.headers,","            method : config.method,","            timeout: config.timeout,","","            on: {","                start  : this._onSyncIOStart,","                failure: this._onSyncIOFailure,","                success: this._onSyncIOSuccess,","                end    : this._onSyncIOEnd","            }","        });","    },","","    /**","    Utility which takes a tokenized `url` string and substitutes its","    placeholders using a specified `data` object.","","    This method will property URL-encode any values before substituting them.","    Also, only expect it to work with String and Number values.","","    @example","        var url = this._substituteURL('/users/{name}', {id: 'Eric F'});","        // => \"/users/Eric%20F\"","","    @method _substituteURL","    @param {String} url Tokenized URL string to substitute placeholder values.","    @param {Object} data Set of data to fill in the `url`'s placeholders.","    @return {String} Substituted URL.","    @protected","    @since 3.6.0","    **/","    _substituteURL: function (url, data) {","        if (!url) {","            return '';","        }","","        var values = {};","","        // Creates a hash of the string and number values only to be used to","        // replace any placeholders in a tokenized `url`.","        Y.Object.each(data, function (v, k) {","            if (Lang.isString(v) || Lang.isNumber(v)) {","                // URL-encode any string or number values.","                values[k] = encodeURIComponent(v);","            }","        });","","        return Lang.sub(url, values);","    },","","    // -- Event Handlers -------------------------------------------------------","","    /**","    Called when the `Y.io` request has finished, after \"success\" or \"failure\"","    has been determined.","","    This is a no-op by default, but provides a hook for overriding.","","    @method _onSyncIOEnd","    @param {String} txId The `Y.io` transaction id.","    @param {Object} details Extra details carried through from `sync()`:","      @param {String} details.action The sync action performed.","      @param {Function} [details.callback] The function to call after syncing.","      @param {String} details.url The URL of the requested resource.","    @protected","    @since 3.6.0","    **/","    _onSyncIOEnd: function (txId, details) {},","","    /**","    Called when the `Y.io` request has finished unsuccessfully.","","    By default this calls the `details.callback` function passing it the HTTP","    status code and message as an error object along with the response body.","","    @method _onSyncIOFailure","    @param {String} txId The `Y.io` transaction id.","    @param {Object} res The `Y.io` response object.","    @param {Object} details Extra details carried through from `sync()`:","      @param {String} details.action The sync action performed.","      @param {Function} [details.callback] The function to call after syncing.","      @param {String} details.url The URL of the requested resource.","    @protected","    @since 3.6.0","    **/","    _onSyncIOFailure: function (txId, res, details) {","        var callback = details.callback;","","        if (callback) {","            callback({","                code: res.status,","                msg : res.statusText","            }, res);","        }","    },","","    /**","    Called when the `Y.io` request has finished successfully.","","    By default this calls the `details.callback` function passing it the","    response body.","","    @method _onSyncIOSuccess","    @param {String} txId The `Y.io` transaction id.","    @param {Object} res The `Y.io` response object.","    @param {Object} details Extra details carried through from `sync()`:","      @param {String} details.action The sync action performed.","      @param {Function} [details.callback] The function to call after syncing.","      @param {String} details.url The URL of the requested resource.","    @protected","    @since 3.6.0","    **/","    _onSyncIOSuccess: function (txId, res, details) {","        var callback = details.callback;","","        if (callback) {","            callback(null, res);","        }","    },","","    /**","    Called when the `Y.io` request is made.","","    This is a no-op by default, but provides a hook for overriding.","","    @method _onSyncIOStart","    @param {String} txId The `Y.io` transaction id.","    @param {Object} details Extra details carried through from `sync()`:","      @param {String} details.action The sync action performed.","      @param {Function} [details.callback] The function to call after syncing.","      @param {String} details.url The URL of the requested resource.","    @protected","    @since 3.6.0","    **/","    _onSyncIOStart: function (txId, details) {}","};","","// -- Namespace ----------------------------------------------------------------","","Y.namespace('ModelSync').REST = RESTSync;","","","}, '3.16.0', {\"requires\": [\"model\", \"io-base\", \"json-stringify\"]});","","}());"]};
  }
  var __cov_h7KfwFva39ZCITOYDnMWHA = __coverage__['build/model-sync-rest/model-sync-rest.js'];
  __cov_h7KfwFva39ZCITOYDnMWHA.s['1']++;YUI.add('model-sync-rest',function(Y,NAME){__cov_h7KfwFva39ZCITOYDnMWHA.f['1']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['2']++;var Lang=Y.Lang;__cov_h7KfwFva39ZCITOYDnMWHA.s['3']++;function RESTSync(){__cov_h7KfwFva39ZCITOYDnMWHA.f['2']++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['4']++;RESTSync.CSRF_TOKEN=YUI.Env.CSRF_TOKEN;__cov_h7KfwFva39ZCITOYDnMWHA.s['5']++;RESTSync.EMULATE_HTTP=false;__cov_h7KfwFva39ZCITOYDnMWHA.s['6']++;RESTSync.HTTP_HEADERS={'Accept':'application/json','Content-Type':'application/json'};__cov_h7KfwFva39ZCITOYDnMWHA.s['7']++;RESTSync.HTTP_METHODS={'create':'POST','read':'GET','update':'PUT','delete':'DELETE'};__cov_h7KfwFva39ZCITOYDnMWHA.s['8']++;RESTSync.HTTP_TIMEOUT=30000;__cov_h7KfwFva39ZCITOYDnMWHA.s['9']++;RESTSync._NON_ATTRS_CFG=['root','url'];__cov_h7KfwFva39ZCITOYDnMWHA.s['10']++;RESTSync.prototype={root:'',url:'',initializer:function(config){__cov_h7KfwFva39ZCITOYDnMWHA.f['3']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['11']++;(__cov_h7KfwFva39ZCITOYDnMWHA.b['1'][0]++,config)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['1'][1]++,config={});__cov_h7KfwFva39ZCITOYDnMWHA.s['12']++;if('root'in config){__cov_h7KfwFva39ZCITOYDnMWHA.b['2'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['13']++;this.root=(__cov_h7KfwFva39ZCITOYDnMWHA.b['3'][0]++,config.root)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['3'][1]++,'');}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['2'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['14']++;if('url'in config){__cov_h7KfwFva39ZCITOYDnMWHA.b['4'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['15']++;this.url=(__cov_h7KfwFva39ZCITOYDnMWHA.b['5'][0]++,config.url)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['5'][1]++,'');}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['4'][1]++;}},getURL:function(action,options){__cov_h7KfwFva39ZCITOYDnMWHA.f['4']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['16']++;var root=this.root,url=this.url;__cov_h7KfwFva39ZCITOYDnMWHA.s['17']++;if(this._isYUIModelList){__cov_h7KfwFva39ZCITOYDnMWHA.b['6'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['18']++;if(!url){__cov_h7KfwFva39ZCITOYDnMWHA.b['7'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['19']++;return this.model.prototype.root;}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['7'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['20']++;return this._substituteURL(url,Y.merge(this.getAttrs(),options));}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['6'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['21']++;if((__cov_h7KfwFva39ZCITOYDnMWHA.b['9'][0]++,root)&&((__cov_h7KfwFva39ZCITOYDnMWHA.b['9'][1]++,action==='create')||(__cov_h7KfwFva39ZCITOYDnMWHA.b['9'][2]++,this.isNew()))){__cov_h7KfwFva39ZCITOYDnMWHA.b['8'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['22']++;return root;}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['8'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['23']++;if(!url){__cov_h7KfwFva39ZCITOYDnMWHA.b['10'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['24']++;return this._joinURL((__cov_h7KfwFva39ZCITOYDnMWHA.b['11'][0]++,this.getAsURL('id'))||(__cov_h7KfwFva39ZCITOYDnMWHA.b['11'][1]++,''));}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['10'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['25']++;return this._substituteURL(url,Y.merge(this.getAttrs(),options));},parseIOResponse:function(response){__cov_h7KfwFva39ZCITOYDnMWHA.f['5']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['26']++;return response.responseText;},serialize:function(action){__cov_h7KfwFva39ZCITOYDnMWHA.f['6']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['27']++;return Y.JSON.stringify(this);},sync:function(action,options,callback){__cov_h7KfwFva39ZCITOYDnMWHA.f['7']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['28']++;(__cov_h7KfwFva39ZCITOYDnMWHA.b['12'][0]++,options)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['12'][1]++,options={});__cov_h7KfwFva39ZCITOYDnMWHA.s['29']++;var url=this.getURL(action,options),method=RESTSync.HTTP_METHODS[action],headers=Y.merge(RESTSync.HTTP_HEADERS,options.headers),timeout=(__cov_h7KfwFva39ZCITOYDnMWHA.b['13'][0]++,options.timeout)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['13'][1]++,RESTSync.HTTP_TIMEOUT),csrfToken=(__cov_h7KfwFva39ZCITOYDnMWHA.b['14'][0]++,options.csrfToken)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['14'][1]++,RESTSync.CSRF_TOKEN),entity;__cov_h7KfwFva39ZCITOYDnMWHA.s['30']++;if((__cov_h7KfwFva39ZCITOYDnMWHA.b['16'][0]++,method==='POST')||(__cov_h7KfwFva39ZCITOYDnMWHA.b['16'][1]++,method==='PUT')){__cov_h7KfwFva39ZCITOYDnMWHA.b['15'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['31']++;entity=this.serialize(action);}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['15'][1]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['32']++;delete headers['Content-Type'];}__cov_h7KfwFva39ZCITOYDnMWHA.s['33']++;if((__cov_h7KfwFva39ZCITOYDnMWHA.b['18'][0]++,RESTSync.EMULATE_HTTP)&&((__cov_h7KfwFva39ZCITOYDnMWHA.b['18'][1]++,method==='PUT')||(__cov_h7KfwFva39ZCITOYDnMWHA.b['18'][2]++,method==='DELETE'))){__cov_h7KfwFva39ZCITOYDnMWHA.b['17'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['34']++;headers['X-HTTP-Method-Override']=method;__cov_h7KfwFva39ZCITOYDnMWHA.s['35']++;method='POST';}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['17'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['36']++;if((__cov_h7KfwFva39ZCITOYDnMWHA.b['20'][0]++,csrfToken)&&((__cov_h7KfwFva39ZCITOYDnMWHA.b['20'][1]++,method==='POST')||(__cov_h7KfwFva39ZCITOYDnMWHA.b['20'][2]++,method==='PUT')||(__cov_h7KfwFva39ZCITOYDnMWHA.b['20'][3]++,method==='DELETE'))){__cov_h7KfwFva39ZCITOYDnMWHA.b['19'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['37']++;headers['X-CSRF-Token']=csrfToken;}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['19'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['38']++;this._sendSyncIORequest({action:action,callback:callback,entity:entity,headers:headers,method:method,timeout:timeout,url:url});},_joinURL:function(url){__cov_h7KfwFva39ZCITOYDnMWHA.f['8']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['39']++;var root=this.root;__cov_h7KfwFva39ZCITOYDnMWHA.s['40']++;if(!((__cov_h7KfwFva39ZCITOYDnMWHA.b['22'][0]++,root)||(__cov_h7KfwFva39ZCITOYDnMWHA.b['22'][1]++,url))){__cov_h7KfwFva39ZCITOYDnMWHA.b['21'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['41']++;return'';}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['21'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['42']++;if(url.charAt(0)==='/'){__cov_h7KfwFva39ZCITOYDnMWHA.b['23'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['43']++;url=url.substring(1);}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['23'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['44']++;return(__cov_h7KfwFva39ZCITOYDnMWHA.b['25'][0]++,root)&&(__cov_h7KfwFva39ZCITOYDnMWHA.b['25'][1]++,root.charAt(root.length-1)==='/')?(__cov_h7KfwFva39ZCITOYDnMWHA.b['24'][0]++,root+url+'/'):(__cov_h7KfwFva39ZCITOYDnMWHA.b['24'][1]++,root+'/'+url);},_parse:function(response){__cov_h7KfwFva39ZCITOYDnMWHA.f['9']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['45']++;if(typeof this.parseIOResponse==='function'){__cov_h7KfwFva39ZCITOYDnMWHA.b['26'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['46']++;response=this.parseIOResponse(response);}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['26'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['47']++;return this.parse(response);},_sendSyncIORequest:function(config){__cov_h7KfwFva39ZCITOYDnMWHA.f['10']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['48']++;return Y.io(config.url,{'arguments':{action:config.action,callback:config.callback,url:config.url},context:this,data:config.entity,headers:config.headers,method:config.method,timeout:config.timeout,on:{start:this._onSyncIOStart,failure:this._onSyncIOFailure,success:this._onSyncIOSuccess,end:this._onSyncIOEnd}});},_substituteURL:function(url,data){__cov_h7KfwFva39ZCITOYDnMWHA.f['11']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['49']++;if(!url){__cov_h7KfwFva39ZCITOYDnMWHA.b['27'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['50']++;return'';}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['27'][1]++;}__cov_h7KfwFva39ZCITOYDnMWHA.s['51']++;var values={};__cov_h7KfwFva39ZCITOYDnMWHA.s['52']++;Y.Object.each(data,function(v,k){__cov_h7KfwFva39ZCITOYDnMWHA.f['12']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['53']++;if((__cov_h7KfwFva39ZCITOYDnMWHA.b['29'][0]++,Lang.isString(v))||(__cov_h7KfwFva39ZCITOYDnMWHA.b['29'][1]++,Lang.isNumber(v))){__cov_h7KfwFva39ZCITOYDnMWHA.b['28'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['54']++;values[k]=encodeURIComponent(v);}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['28'][1]++;}});__cov_h7KfwFva39ZCITOYDnMWHA.s['55']++;return Lang.sub(url,values);},_onSyncIOEnd:function(txId,details){__cov_h7KfwFva39ZCITOYDnMWHA.f['13']++;},_onSyncIOFailure:function(txId,res,details){__cov_h7KfwFva39ZCITOYDnMWHA.f['14']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['56']++;var callback=details.callback;__cov_h7KfwFva39ZCITOYDnMWHA.s['57']++;if(callback){__cov_h7KfwFva39ZCITOYDnMWHA.b['30'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['58']++;callback({code:res.status,msg:res.statusText},res);}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['30'][1]++;}},_onSyncIOSuccess:function(txId,res,details){__cov_h7KfwFva39ZCITOYDnMWHA.f['15']++;__cov_h7KfwFva39ZCITOYDnMWHA.s['59']++;var callback=details.callback;__cov_h7KfwFva39ZCITOYDnMWHA.s['60']++;if(callback){__cov_h7KfwFva39ZCITOYDnMWHA.b['31'][0]++;__cov_h7KfwFva39ZCITOYDnMWHA.s['61']++;callback(null,res);}else{__cov_h7KfwFva39ZCITOYDnMWHA.b['31'][1]++;}},_onSyncIOStart:function(txId,details){__cov_h7KfwFva39ZCITOYDnMWHA.f['16']++;}};__cov_h7KfwFva39ZCITOYDnMWHA.s['62']++;Y.namespace('ModelSync').REST=RESTSync;},'3.16.0',{'requires':['model','io-base','json-stringify']});
  