diff --git a/node_modules/handlebars/.npmignore b/node_modules/handlebars/.npmignore index f10592c..366b454 100644 --- a/node_modules/handlebars/.npmignore +++ b/node_modules/handlebars/.npmignore @@ -1,7 +1,7 @@ .DS_Store .gitignore .rvmrc -.eslintrc +.jshintrc .travis.yml .rspec Gemfile @@ -10,11 +10,9 @@ Rakefile Gruntfile.js *.gemspec *.nuspec -*.log bench/* configurations/* components/* -coverage/* dist/cdnjs/* dist/components/* spec/* diff --git a/node_modules/handlebars/CONTRIBUTING.md b/node_modules/handlebars/CONTRIBUTING.md index b84fdb0..c6db72a 100644 --- a/node_modules/handlebars/CONTRIBUTING.md +++ b/node_modules/handlebars/CONTRIBUTING.md @@ -28,8 +28,6 @@ To build Handlebars.js you'll need a few things installed. * Node.js * [Grunt](http://gruntjs.com/getting-started) -Before building, you need to make sure that the Git submodule `spec/mustache` is included (i.e. the directory `spec/mustache` should not be empty). To include it, if using Git version 1.6.5 or newer, use `git clone --recursive` rather than `git clone`. Or, if you already cloned without `--recursive`, use `git submodule update --init`. - Project dependencies may be installed via `npm install`. To build Handlebars.js from scratch, you'll want to run `grunt` @@ -77,4 +75,4 @@ After this point the handlebars site needs to be updated to point to the new ver [generator-release]: https://github.com/walmartlabs/generator-release [pull-request]: https://github.com/wycats/handlebars.js/pull/new/master [issue]: https://github.com/wycats/handlebars.js/issues/new -[jsfiddle]: http://jsfiddle.net/9D88g/26/ +[jsfiddle]: http://jsfiddle.net/9D88g/25/ diff --git a/node_modules/handlebars/FAQ.md b/node_modules/handlebars/FAQ.md index 108e839..0bd0997 100644 --- a/node_modules/handlebars/FAQ.md +++ b/node_modules/handlebars/FAQ.md @@ -57,4 +57,4 @@ The other option is to load the `handlebars.runtime.js` UMD build, which might not require path configuration and exposes the library as both the module root and the `default` field for compatibility. - If not using ES6 transpilers or accessing submodules in the build the former option should be sufficient for most use cases. + If not using ES6 transpilers or accessing submodules in the build the former option should be sufficent for most use cases. diff --git a/node_modules/handlebars/README.markdown b/node_modules/handlebars/README.markdown index d6aa6bd..7755286 100644 --- a/node_modules/handlebars/README.markdown +++ b/node_modules/handlebars/README.markdown @@ -16,8 +16,6 @@ Installing ---------- Installing Handlebars is easy. Simply download the package [from the official site](http://handlebarsjs.com/) or the [bower repository][bower-repo] and add it to your web pages (you should usually use the most recent version). -For web browsers, a free CDN is available at [jsDelivr](http://www.jsdelivr.com/#!handlebarsjs). Advanced usage, such as [version aliasing & concocting](https://github.com/jsdelivr/jsdelivr#usage), is available. - Alternatively, if you prefer having the latest version of handlebars from the 'master' branch, passing builds of the 'master' branch are automatically published to S3. You may download the latest passing master build by grabbing @@ -110,7 +108,7 @@ templates easier and also changes a tiny detail of how partials work. ### Paths Handlebars.js supports an extended expression syntax that we call paths. -Paths are made up of typical expressions and `.` characters. Expressions +Paths are made up of typical expressions and . characters. Expressions allow you to not only display data from the current context, but to display data from contexts that are descendants and ancestors of the current context. @@ -134,7 +132,7 @@ into the person object you could still display the company's name with an expression like `{{../company.name}}`, so: ``` -{{#with person}}{{name}} - {{../company.name}}{{/with}} +{{#with person}}{{name}} - {{../company.name}}{{/person}} ``` would render: @@ -197,7 +195,7 @@ template(data); ``` Whenever the block helper is called it is given one or more parameters, -any arguments that are passed into the helper in the call, and an `options` +any arguments that are passed in the helper in the call and an `options` object containing the `fn` function which executes the block's child. The block's current context may be accessed through `this`. @@ -236,35 +234,6 @@ template(data); // ``` -Partials can also accept parameters - -```js -var source = "
{{> roster rosterProperties people=listOfPeople}}
"; - -Handlebars.registerPartial('roster', '

{{rosterName}}

{{#people}}{{id}}: {{name}}{{/people}}') -var template = Handlebars.compile(source); - -var data = { - "listOfPeople": [ - { "name": "Alan", "id": 1 }, - { "name": "Yehuda", "id": 2 } - ], - "rosterProperties": { - "rosterName": "Cool People" - } -}; - -template(data); - -// Should render: -//
-//

Cool People

-// 1: Alan -// 2: Yehuda -//
- -``` - ### Comments You can add comments to your templates with the following syntax: @@ -395,7 +364,6 @@ Handlebars in the Wild and [@doowb](https://github.com/doowb), is a static site generator that uses Handlebars.js as its template engine. * [CoSchedule](http://coschedule.com) An editorial calendar for WordPress that uses Handlebars.js -* [dashbars](https://github.com/pismute/dashbars) A modern helper library for Handlebars.js. * [Ember.js](http://www.emberjs.com) makes Handlebars.js the primary way to structure your views, also with automatic data binding support. * [Ghost](https://ghost.org/) Just a blogging platform. @@ -403,7 +371,6 @@ Handlebars in the Wild from Les Hill (@leshill). * [handlebars-helpers](https://github.com/assemble/handlebars-helpers) is an extensive library with 100+ handlebars helpers. -* [handlebars-layouts](https://github.com/shannonmoeller/handlebars-layouts) is a set of helpers which implement extendible and embeddable layout blocks as seen in other popular templating languages. * [hbs](http://github.com/donpark/hbs): An Express.js view engine adapter for Handlebars.js, from Don Park. * [koa-hbs](https://github.com/jwilm/koa-hbs): [koa](https://github.com/koajs/koa) generator based diff --git a/node_modules/handlebars/bin/handlebars b/node_modules/handlebars/bin/handlebars index 4ed98b3..4ea3296 100755 --- a/node_modules/handlebars/bin/handlebars +++ b/node_modules/handlebars/bin/handlebars @@ -1,16 +1,12 @@ #!/usr/bin/env node var optimist = require('optimist') - .usage('Precompile handlebar templates.\nUsage: $0 [template|directory]...', { + .usage('Precompile handlebar templates.\nUsage: $0 template...', { 'f': { 'type': 'string', 'description': 'Output File', 'alias': 'output' }, - 'map': { - 'type': 'string', - 'description': 'Source Map File' - }, 'a': { 'type': 'boolean', 'description': 'Exports amd style (require.js)', @@ -84,11 +80,6 @@ var optimist = require('optimist') 'type': 'boolean', 'description': 'Prints the current compiler version', 'alias': 'version' - }, - - 'help': { - 'type': 'boolean', - 'description': 'Outputs this message' } }) @@ -98,14 +89,7 @@ var optimist = require('optimist') } }); - var argv = optimist.argv; argv.templates = argv._; delete argv._; - -if (argv.help || (!argv.templates.length && !argv.version)) { - optimist.showHelp(); - return; -} - -return require('../dist/cjs/precompiler').cli(argv); +return require('../lib/precompiler').cli(argv); diff --git a/node_modules/handlebars/coverage/coverage.json b/node_modules/handlebars/coverage/coverage.json new file mode 100644 index 0000000..2f3d171 --- /dev/null +++ b/node_modules/handlebars/coverage/coverage.json @@ -0,0 +1 @@ +{"/Users/kpdecker/dev/kpdecker/handlebars.js/lib/index.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/lib/index.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":2,"10":2,"11":2,"12":1,"13":1},"b":{"1":[1,0],"2":[1,1]},"f":{"1":2},"fnMap":{"1":{"name":"(anonymous_1)","line":19,"loc":{"start":{"line":19,"column":18},"end":{"line":19,"column":45}}}},"statementMap":{"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":62}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":83}},"3":{"start":{"line":10,"column":0},"end":{"line":10,"column":65}},"4":{"start":{"line":11,"column":0},"end":{"line":11,"column":47}},"5":{"start":{"line":12,"column":0},"end":{"line":12,"column":33}},"6":{"start":{"line":14,"column":0},"end":{"line":14,"column":28}},"7":{"start":{"line":18,"column":0},"end":{"line":26,"column":1}},"8":{"start":{"line":19,"column":2},"end":{"line":23,"column":4}},"9":{"start":{"line":20,"column":4},"end":{"line":20,"column":27}},"10":{"start":{"line":21,"column":4},"end":{"line":21,"column":59}},"11":{"start":{"line":22,"column":4},"end":{"line":22,"column":56}},"12":{"start":{"line":24,"column":2},"end":{"line":24,"column":48}},"13":{"start":{"line":25,"column":2},"end":{"line":25,"column":41}}},"branchMap":{"1":{"line":18,"type":"if","locations":[{"start":{"line":18,"column":0},"end":{"line":18,"column":0}},{"start":{"line":18,"column":0},"end":{"line":18,"column":0},"skip":true}]},"2":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":4},"end":{"line":18,"column":34}},{"start":{"line":18,"column":38},"end":{"line":18,"column":56}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":504,"12":504,"13":82,"14":504,"15":409,"16":504,"17":504,"18":504,"19":504,"20":504,"21":504,"22":1,"23":1,"24":1,"25":1},"b":{},"f":{"1":504,"2":82,"3":409},"fnMap":{"1":{"name":"(anonymous_1)","line":15,"loc":{"start":{"line":15,"column":13},"end":{"line":15,"column":24}}},"2":{"name":"(anonymous_2)","line":18,"loc":{"start":{"line":18,"column":15},"end":{"line":18,"column":40}}},"3":{"name":"(anonymous_3)","line":21,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":44}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":60}},"2":{"start":{"line":6,"column":0},"end":{"line":6,"column":58}},"3":{"start":{"line":7,"column":0},"end":{"line":7,"column":58}},"4":{"start":{"line":8,"column":0},"end":{"line":8,"column":56}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":66}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":64}},"7":{"start":{"line":11,"column":0},"end":{"line":11,"column":70}},"8":{"start":{"line":12,"column":0},"end":{"line":12,"column":89}},"9":{"start":{"line":14,"column":0},"end":{"line":14,"column":32}},"10":{"start":{"line":15,"column":0},"end":{"line":32,"column":2}},"11":{"start":{"line":16,"column":2},"end":{"line":16,"column":21}},"12":{"start":{"line":18,"column":2},"end":{"line":20,"column":4}},"13":{"start":{"line":19,"column":4},"end":{"line":19,"column":39}},"14":{"start":{"line":21,"column":2},"end":{"line":23,"column":4}},"15":{"start":{"line":22,"column":4},"end":{"line":22,"column":42}},"16":{"start":{"line":25,"column":2},"end":{"line":25,"column":15}},"17":{"start":{"line":26,"column":2},"end":{"line":26,"column":25}},"18":{"start":{"line":27,"column":2},"end":{"line":27,"column":45}},"19":{"start":{"line":28,"column":2},"end":{"line":28,"column":21}},"20":{"start":{"line":29,"column":2},"end":{"line":29,"column":19}},"21":{"start":{"line":31,"column":2},"end":{"line":31,"column":12}},"22":{"start":{"line":34,"column":0},"end":{"line":34,"column":22}},"23":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}},"24":{"start":{"line":37,"column":0},"end":{"line":37,"column":35}},"25":{"start":{"line":39,"column":0},"end":{"line":39,"column":32}}},"branchMap":{}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars.runtime.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars.runtime.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":505,"8":505,"9":505,"10":505,"11":505,"12":505,"13":505,"14":505,"15":474,"16":505,"17":1,"18":1,"19":1,"20":1},"b":{},"f":{"1":505,"2":474},"fnMap":{"1":{"name":"(anonymous_1)","line":13,"loc":{"start":{"line":13,"column":13},"end":{"line":13,"column":24}}},"2":{"name":"(anonymous_2)","line":23,"loc":{"start":{"line":23,"column":16},"end":{"line":23,"column":31}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":40}},"2":{"start":{"line":7,"column":0},"end":{"line":7,"column":64}},"3":{"start":{"line":8,"column":0},"end":{"line":8,"column":61}},"4":{"start":{"line":9,"column":0},"end":{"line":9,"column":42}},"5":{"start":{"line":10,"column":0},"end":{"line":10,"column":46}},"6":{"start":{"line":13,"column":0},"end":{"line":28,"column":2}},"7":{"start":{"line":14,"column":2},"end":{"line":14,"column":44}},"8":{"start":{"line":16,"column":2},"end":{"line":16,"column":25}},"9":{"start":{"line":17,"column":2},"end":{"line":17,"column":29}},"10":{"start":{"line":18,"column":2},"end":{"line":18,"column":27}},"11":{"start":{"line":19,"column":2},"end":{"line":19,"column":19}},"12":{"start":{"line":20,"column":2},"end":{"line":20,"column":47}},"13":{"start":{"line":22,"column":2},"end":{"line":22,"column":18}},"14":{"start":{"line":23,"column":2},"end":{"line":25,"column":4}},"15":{"start":{"line":24,"column":4},"end":{"line":24,"column":38}},"16":{"start":{"line":27,"column":2},"end":{"line":27,"column":12}},"17":{"start":{"line":30,"column":0},"end":{"line":30,"column":26}},"18":{"start":{"line":31,"column":0},"end":{"line":31,"column":27}},"19":{"start":{"line":33,"column":0},"end":{"line":33,"column":35}},"20":{"start":{"line":35,"column":0},"end":{"line":35,"column":32}}},"branchMap":{}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/base.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/base.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":505,"12":505,"13":505,"14":1,"15":1,"16":4059,"17":2,"18":1,"19":1,"20":4057,"21":1,"22":2,"23":1,"24":1,"25":1,"26":1,"27":505,"28":24,"29":23,"30":1,"31":505,"32":145,"33":145,"34":26,"35":119,"36":40,"37":79,"38":57,"39":49,"40":1,"41":49,"42":8,"43":22,"44":3,"45":3,"46":3,"47":22,"48":505,"49":83,"50":1,"51":82,"52":82,"53":82,"54":82,"55":5,"56":82,"57":1,"58":82,"59":76,"60":82,"61":81,"62":75,"63":173,"64":160,"65":160,"66":160,"67":160,"68":5,"69":173,"70":6,"71":13,"72":12,"73":10,"74":10,"75":10,"76":10,"77":3,"78":12,"79":12,"80":82,"81":4,"82":82,"83":505,"84":83,"85":4,"86":83,"87":44,"88":39,"89":505,"90":2,"91":505,"92":9,"93":1,"94":9,"95":9,"96":8,"97":3,"98":3,"99":3,"100":8,"101":1,"102":505,"103":5,"104":5,"105":505,"106":4,"107":1,"108":3,"109":2,"110":2,"111":1,"112":1,"113":1,"114":1,"115":1,"116":109,"117":109,"118":109,"119":1},"b":{"1":[505,505],"2":[505,505],"3":[2,4057],"4":[1,1],"5":[1,1],"6":[23,1],"7":[26,119],"8":[40,79],"9":[119,93],"10":[57,22],"11":[49,8],"12":[1,48],"13":[3,19],"14":[22,22],"15":[1,82],"16":[5,77],"17":[82,76],"18":[1,81],"19":[76,6],"20":[81,1],"21":[82,81],"22":[75,6],"23":[160,13],"24":[5,155],"25":[12,1],"26":[10,2],"27":[3,7],"28":[4,78],"29":[4,79],"30":[44,39],"31":[83,82,40],"32":[1,8],"33":[8,1],"34":[3,5],"35":[8,8],"36":[3,2],"37":[5,5],"38":[4,2],"39":[2,1],"40":[1,1],"41":[2,2]},"f":{"1":505,"2":4059,"3":1,"4":2,"5":1,"6":505,"7":24,"8":145,"9":83,"10":83,"11":2,"12":9,"13":5,"14":4,"15":3,"16":109},"fnMap":{"1":{"name":"HandlebarsEnvironment","line":22,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":50}}},"2":{"name":"(anonymous_2)","line":35,"loc":{"start":{"line":35,"column":18},"end":{"line":35,"column":37}}},"3":{"name":"(anonymous_3)","line":43,"loc":{"start":{"line":43,"column":20},"end":{"line":43,"column":35}}},"4":{"name":"(anonymous_4)","line":47,"loc":{"start":{"line":47,"column":19},"end":{"line":47,"column":43}}},"5":{"name":"(anonymous_5)","line":54,"loc":{"start":{"line":54,"column":21},"end":{"line":54,"column":36}}},"6":{"name":"registerDefaultHelpers","line":59,"loc":{"start":{"line":59,"column":0},"end":{"line":59,"column":42}}},"7":{"name":"(anonymous_7)","line":60,"loc":{"start":{"line":60,"column":43},"end":{"line":60,"column":75}}},"8":{"name":"(anonymous_8)","line":70,"loc":{"start":{"line":70,"column":48},"end":{"line":70,"column":75}}},"9":{"name":"(anonymous_9)","line":99,"loc":{"start":{"line":99,"column":34},"end":{"line":99,"column":61}}},"10":{"name":"(anonymous_10)","line":158,"loc":{"start":{"line":158,"column":32},"end":{"line":158,"column":63}}},"11":{"name":"(anonymous_11)","line":171,"loc":{"start":{"line":171,"column":36},"end":{"line":171,"column":67}}},"12":{"name":"(anonymous_12)","line":175,"loc":{"start":{"line":175,"column":34},"end":{"line":175,"column":61}}},"13":{"name":"(anonymous_13)","line":193,"loc":{"start":{"line":193,"column":33},"end":{"line":193,"column":60}}},"14":{"name":"(anonymous_14)","line":198,"loc":{"start":{"line":198,"column":36},"end":{"line":198,"column":57}}},"15":{"name":"(anonymous_15)","line":214,"loc":{"start":{"line":214,"column":7},"end":{"line":214,"column":32}}},"16":{"name":"(anonymous_16)","line":226,"loc":{"start":{"line":226,"column":18},"end":{"line":226,"column":35}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":22}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":26}},"5":{"start":{"line":6,"column":26},"end":{"line":6,"column":52}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":46}},"7":{"start":{"line":8,"column":0},"end":{"line":15,"column":2}},"8":{"start":{"line":16,"column":0},"end":{"line":16,"column":44}},"9":{"start":{"line":17,"column":0},"end":{"line":20,"column":35}},"10":{"start":{"line":22,"column":0},"end":{"line":27,"column":1}},"11":{"start":{"line":23,"column":2},"end":{"line":23,"column":31}},"12":{"start":{"line":24,"column":2},"end":{"line":24,"column":33}},"13":{"start":{"line":26,"column":2},"end":{"line":26,"column":31}},"14":{"start":{"line":29,"column":0},"end":{"line":29,"column":54}},"15":{"start":{"line":29,"column":54},"end":{"line":57,"column":2}},"16":{"start":{"line":36,"column":4},"end":{"line":41,"column":5}},"17":{"start":{"line":37,"column":6},"end":{"line":37,"column":81}},"18":{"start":{"line":37,"column":16},"end":{"line":37,"column":79}},"19":{"start":{"line":38,"column":6},"end":{"line":38,"column":39}},"20":{"start":{"line":40,"column":6},"end":{"line":40,"column":30}},"21":{"start":{"line":44,"column":4},"end":{"line":44,"column":30}},"22":{"start":{"line":48,"column":4},"end":{"line":52,"column":5}},"23":{"start":{"line":49,"column":6},"end":{"line":49,"column":41}},"24":{"start":{"line":51,"column":6},"end":{"line":51,"column":36}},"25":{"start":{"line":55,"column":4},"end":{"line":55,"column":31}},"26":{"start":{"line":59,"column":0},"end":{"line":201,"column":1}},"27":{"start":{"line":60,"column":2},"end":{"line":68,"column":5}},"28":{"start":{"line":61,"column":4},"end":{"line":67,"column":5}},"29":{"start":{"line":63,"column":6},"end":{"line":63,"column":23}},"30":{"start":{"line":66,"column":6},"end":{"line":66,"column":90}},"31":{"start":{"line":70,"column":2},"end":{"line":97,"column":5}},"32":{"start":{"line":71,"column":4},"end":{"line":72,"column":24}},"33":{"start":{"line":74,"column":4},"end":{"line":96,"column":5}},"34":{"start":{"line":75,"column":6},"end":{"line":75,"column":22}},"35":{"start":{"line":76,"column":11},"end":{"line":96,"column":5}},"36":{"start":{"line":77,"column":6},"end":{"line":77,"column":27}},"37":{"start":{"line":78,"column":11},"end":{"line":96,"column":5}},"38":{"start":{"line":79,"column":6},"end":{"line":87,"column":7}},"39":{"start":{"line":80,"column":8},"end":{"line":82,"column":9}},"40":{"start":{"line":81,"column":10},"end":{"line":81,"column":39}},"41":{"start":{"line":84,"column":8},"end":{"line":84,"column":55}},"42":{"start":{"line":86,"column":8},"end":{"line":86,"column":29}},"43":{"start":{"line":89,"column":6},"end":{"line":93,"column":7}},"44":{"start":{"line":90,"column":8},"end":{"line":90,"column":45}},"45":{"start":{"line":91,"column":8},"end":{"line":91,"column":91}},"46":{"start":{"line":92,"column":8},"end":{"line":92,"column":31}},"47":{"start":{"line":95,"column":6},"end":{"line":95,"column":34}},"48":{"start":{"line":99,"column":2},"end":{"line":156,"column":5}},"49":{"start":{"line":100,"column":4},"end":{"line":102,"column":5}},"50":{"start":{"line":101,"column":6},"end":{"line":101,"column":57}},"51":{"start":{"line":104,"column":4},"end":{"line":104,"column":51}},"52":{"start":{"line":105,"column":4},"end":{"line":105,"column":30}},"53":{"start":{"line":107,"column":4},"end":{"line":107,"column":20}},"54":{"start":{"line":108,"column":4},"end":{"line":110,"column":5}},"55":{"start":{"line":109,"column":6},"end":{"line":109,"column":92}},"56":{"start":{"line":112,"column":4},"end":{"line":112,"column":62}},"57":{"start":{"line":112,"column":31},"end":{"line":112,"column":60}},"58":{"start":{"line":114,"column":4},"end":{"line":116,"column":5}},"59":{"start":{"line":115,"column":6},"end":{"line":115,"column":39}},"60":{"start":{"line":118,"column":4},"end":{"line":149,"column":5}},"61":{"start":{"line":119,"column":6},"end":{"line":148,"column":7}},"62":{"start":{"line":120,"column":8},"end":{"line":131,"column":9}},"63":{"start":{"line":121,"column":10},"end":{"line":129,"column":11}},"64":{"start":{"line":122,"column":12},"end":{"line":122,"column":27}},"65":{"start":{"line":123,"column":12},"end":{"line":123,"column":35}},"66":{"start":{"line":124,"column":12},"end":{"line":124,"column":52}},"67":{"start":{"line":126,"column":12},"end":{"line":128,"column":13}},"68":{"start":{"line":127,"column":14},"end":{"line":127,"column":49}},"69":{"start":{"line":130,"column":10},"end":{"line":130,"column":53}},"70":{"start":{"line":133,"column":8},"end":{"line":147,"column":9}},"71":{"start":{"line":134,"column":10},"end":{"line":146,"column":11}},"72":{"start":{"line":135,"column":12},"end":{"line":143,"column":13}},"73":{"start":{"line":136,"column":14},"end":{"line":136,"column":29}},"74":{"start":{"line":137,"column":14},"end":{"line":137,"column":29}},"75":{"start":{"line":138,"column":14},"end":{"line":138,"column":37}},"76":{"start":{"line":140,"column":14},"end":{"line":142,"column":15}},"77":{"start":{"line":141,"column":16},"end":{"line":141,"column":53}},"78":{"start":{"line":144,"column":12},"end":{"line":144,"column":55}},"79":{"start":{"line":145,"column":12},"end":{"line":145,"column":16}},"80":{"start":{"line":151,"column":4},"end":{"line":153,"column":5}},"81":{"start":{"line":152,"column":6},"end":{"line":152,"column":26}},"82":{"start":{"line":155,"column":4},"end":{"line":155,"column":15}},"83":{"start":{"line":158,"column":2},"end":{"line":169,"column":5}},"84":{"start":{"line":159,"column":4},"end":{"line":159,"column":74}},"85":{"start":{"line":159,"column":35},"end":{"line":159,"column":72}},"86":{"start":{"line":164,"column":4},"end":{"line":168,"column":5}},"87":{"start":{"line":165,"column":6},"end":{"line":165,"column":35}},"88":{"start":{"line":167,"column":6},"end":{"line":167,"column":30}},"89":{"start":{"line":171,"column":2},"end":{"line":173,"column":5}},"90":{"start":{"line":172,"column":4},"end":{"line":172,"column":122}},"91":{"start":{"line":175,"column":2},"end":{"line":191,"column":5}},"92":{"start":{"line":176,"column":4},"end":{"line":176,"column":62}},"93":{"start":{"line":176,"column":31},"end":{"line":176,"column":60}},"94":{"start":{"line":178,"column":4},"end":{"line":178,"column":24}},"95":{"start":{"line":180,"column":4},"end":{"line":190,"column":5}},"96":{"start":{"line":181,"column":6},"end":{"line":185,"column":7}},"97":{"start":{"line":182,"column":8},"end":{"line":182,"column":45}},"98":{"start":{"line":183,"column":8},"end":{"line":183,"column":93}},"99":{"start":{"line":184,"column":8},"end":{"line":184,"column":30}},"100":{"start":{"line":187,"column":6},"end":{"line":187,"column":34}},"101":{"start":{"line":189,"column":6},"end":{"line":189,"column":35}},"102":{"start":{"line":193,"column":2},"end":{"line":196,"column":5}},"103":{"start":{"line":194,"column":4},"end":{"line":194,"column":98}},"104":{"start":{"line":195,"column":4},"end":{"line":195,"column":33}},"105":{"start":{"line":198,"column":2},"end":{"line":200,"column":5}},"106":{"start":{"line":199,"column":4},"end":{"line":199,"column":29}},"107":{"start":{"line":203,"column":0},"end":{"line":222,"column":2}},"108":{"start":{"line":215,"column":4},"end":{"line":220,"column":5}},"109":{"start":{"line":216,"column":6},"end":{"line":216,"column":43}},"110":{"start":{"line":217,"column":6},"end":{"line":219,"column":7}},"111":{"start":{"line":218,"column":8},"end":{"line":218,"column":47}},"112":{"start":{"line":223,"column":0},"end":{"line":223,"column":24}},"113":{"start":{"line":224,"column":0},"end":{"line":224,"column":21}},"114":{"start":{"line":225,"column":0},"end":{"line":225,"column":18}},"115":{"start":{"line":226,"column":0},"end":{"line":230,"column":2}},"116":{"start":{"line":227,"column":2},"end":{"line":227,"column":39}},"117":{"start":{"line":228,"column":2},"end":{"line":228,"column":25}},"118":{"start":{"line":229,"column":2},"end":{"line":229,"column":15}},"119":{"start":{"line":231,"column":0},"end":{"line":231,"column":34}}},"branchMap":{"1":{"line":23,"type":"binary-expr","locations":[{"start":{"line":23,"column":17},"end":{"line":23,"column":24}},{"start":{"line":23,"column":28},"end":{"line":23,"column":30}}]},"2":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":18},"end":{"line":24,"column":26}},{"start":{"line":24,"column":30},"end":{"line":24,"column":32}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]},"4":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":6},"end":{"line":37,"column":6}},{"start":{"line":37,"column":6},"end":{"line":37,"column":6}}]},"5":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"6":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":4},"end":{"line":61,"column":4}},{"start":{"line":61,"column":4},"end":{"line":61,"column":4}}]},"7":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":74,"column":4}},{"start":{"line":74,"column":4},"end":{"line":74,"column":4}}]},"8":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":11},"end":{"line":76,"column":11}},{"start":{"line":76,"column":11},"end":{"line":76,"column":11}}]},"9":{"line":76,"type":"binary-expr","locations":[{"start":{"line":76,"column":14},"end":{"line":76,"column":31}},{"start":{"line":76,"column":35},"end":{"line":76,"column":50}}]},"10":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":11},"end":{"line":78,"column":11}},{"start":{"line":78,"column":11},"end":{"line":78,"column":11}}]},"11":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":6},"end":{"line":79,"column":6}},{"start":{"line":79,"column":6},"end":{"line":79,"column":6}}]},"12":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":8},"end":{"line":80,"column":8}},{"start":{"line":80,"column":8},"end":{"line":80,"column":8}}]},"13":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":6},"end":{"line":89,"column":6}},{"start":{"line":89,"column":6},"end":{"line":89,"column":6}}]},"14":{"line":89,"type":"binary-expr","locations":[{"start":{"line":89,"column":10},"end":{"line":89,"column":22}},{"start":{"line":89,"column":26},"end":{"line":89,"column":37}}]},"15":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":4},"end":{"line":100,"column":4}},{"start":{"line":100,"column":4},"end":{"line":100,"column":4}}]},"16":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":4},"end":{"line":108,"column":4}},{"start":{"line":108,"column":4},"end":{"line":108,"column":4}}]},"17":{"line":108,"type":"binary-expr","locations":[{"start":{"line":108,"column":8},"end":{"line":108,"column":20}},{"start":{"line":108,"column":24},"end":{"line":108,"column":35}}]},"18":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":4},"end":{"line":112,"column":4}},{"start":{"line":112,"column":4},"end":{"line":112,"column":4}}]},"19":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":4},"end":{"line":114,"column":4}},{"start":{"line":114,"column":4},"end":{"line":114,"column":4}}]},"20":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":4},"end":{"line":118,"column":4}},{"start":{"line":118,"column":4},"end":{"line":118,"column":4}}]},"21":{"line":118,"type":"binary-expr","locations":[{"start":{"line":118,"column":7},"end":{"line":118,"column":14}},{"start":{"line":118,"column":18},"end":{"line":118,"column":45}}]},"22":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":6},"end":{"line":119,"column":6}},{"start":{"line":119,"column":6},"end":{"line":119,"column":6}}]},"23":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":10},"end":{"line":121,"column":10}},{"start":{"line":121,"column":10},"end":{"line":121,"column":10}}]},"24":{"line":126,"type":"if","locations":[{"start":{"line":126,"column":12},"end":{"line":126,"column":12}},{"start":{"line":126,"column":12},"end":{"line":126,"column":12}}]},"25":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":10},"end":{"line":134,"column":10}},{"start":{"line":134,"column":10},"end":{"line":134,"column":10}}]},"26":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":12},"end":{"line":135,"column":12}},{"start":{"line":135,"column":12},"end":{"line":135,"column":12}}]},"27":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":14},"end":{"line":140,"column":14}},{"start":{"line":140,"column":14},"end":{"line":140,"column":14}}]},"28":{"line":151,"type":"if","locations":[{"start":{"line":151,"column":4},"end":{"line":151,"column":4}},{"start":{"line":151,"column":4},"end":{"line":151,"column":4}}]},"29":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":4},"end":{"line":159,"column":4}},{"start":{"line":159,"column":4},"end":{"line":159,"column":4}}]},"30":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":4},"end":{"line":164,"column":4}},{"start":{"line":164,"column":4},"end":{"line":164,"column":4}}]},"31":{"line":164,"type":"binary-expr","locations":[{"start":{"line":164,"column":9},"end":{"line":164,"column":34}},{"start":{"line":164,"column":38},"end":{"line":164,"column":50}},{"start":{"line":164,"column":55},"end":{"line":164,"column":81}}]},"32":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":4},"end":{"line":176,"column":4}},{"start":{"line":176,"column":4},"end":{"line":176,"column":4}}]},"33":{"line":180,"type":"if","locations":[{"start":{"line":180,"column":4},"end":{"line":180,"column":4}},{"start":{"line":180,"column":4},"end":{"line":180,"column":4}}]},"34":{"line":181,"type":"if","locations":[{"start":{"line":181,"column":6},"end":{"line":181,"column":6}},{"start":{"line":181,"column":6},"end":{"line":181,"column":6}}]},"35":{"line":181,"type":"binary-expr","locations":[{"start":{"line":181,"column":10},"end":{"line":181,"column":22}},{"start":{"line":181,"column":26},"end":{"line":181,"column":37}}]},"36":{"line":194,"type":"cond-expr","locations":[{"start":{"line":194,"column":61},"end":{"line":194,"column":93}},{"start":{"line":194,"column":96},"end":{"line":194,"column":97}}]},"37":{"line":194,"type":"binary-expr","locations":[{"start":{"line":194,"column":16},"end":{"line":194,"column":28}},{"start":{"line":194,"column":32},"end":{"line":194,"column":58}}]},"38":{"line":199,"type":"binary-expr","locations":[{"start":{"line":199,"column":11},"end":{"line":199,"column":14}},{"start":{"line":199,"column":18},"end":{"line":199,"column":28}}]},"39":{"line":215,"type":"if","locations":[{"start":{"line":215,"column":4},"end":{"line":215,"column":4}},{"start":{"line":215,"column":4},"end":{"line":215,"column":4}}]},"40":{"line":217,"type":"if","locations":[{"start":{"line":217,"column":6},"end":{"line":217,"column":6}},{"start":{"line":217,"column":6},"end":{"line":217,"column":6}}]},"41":{"line":217,"type":"binary-expr","locations":[{"start":{"line":217,"column":10},"end":{"line":217,"column":40}},{"start":{"line":217,"column":44},"end":{"line":217,"column":59}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/utils.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/utils.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":27,"7":1,"8":933,"9":1249,"10":6468,"11":6467,"12":933,"13":1,"14":1,"15":1,"16":1,"17":175,"18":1,"19":0,"20":0,"21":1,"22":1,"23":1,"24":0,"25":1,"26":1,"27":534,"28":11,"29":523,"30":29,"31":494,"32":19,"33":475,"34":475,"35":466,"36":9,"37":1,"38":1,"39":58,"40":5,"41":53,"42":2,"43":51,"44":1,"45":1,"46":11,"47":1},"b":{"1":[6467,1],"2":[0,1],"3":[0,0],"4":[1,0],"5":[0,0],"6":[0,0],"7":[11,523],"8":[29,494],"9":[19,475],"10":[466,9],"11":[5,53],"12":[58,7],"13":[2,51],"14":[53,4],"15":[3,8]},"f":{"1":27,"2":933,"3":175,"4":0,"5":0,"6":534,"7":58,"8":11},"fnMap":{"1":{"name":"escapeChar","line":17,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":25}}},"2":{"name":"extend","line":21,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":39}}},"3":{"name":"(anonymous_3)","line":37,"loc":{"start":{"line":37,"column":17},"end":{"line":37,"column":33}}},"4":{"name":"(anonymous_4)","line":43,"loc":{"start":{"line":43,"column":15},"end":{"line":43,"column":31}},"skip":true},"5":{"name":"(anonymous_5)","line":50,"loc":{"start":{"line":50,"column":31},"end":{"line":50,"column":47}},"skip":true},"6":{"name":"escapeExpression","line":55,"loc":{"start":{"line":55,"column":0},"end":{"line":55,"column":34}}},"7":{"name":"isEmpty","line":74,"loc":{"start":{"line":74,"column":44},"end":{"line":74,"column":68}}},"8":{"name":"appendContextPath","line":84,"loc":{"start":{"line":84,"column":26},"end":{"line":84,"column":70}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":53}},"2":{"start":{"line":5,"column":0},"end":{"line":12,"column":2}},"3":{"start":{"line":14,"column":0},"end":{"line":14,"column":27}},"4":{"start":{"line":15,"column":0},"end":{"line":15,"column":26}},"5":{"start":{"line":17,"column":0},"end":{"line":19,"column":1}},"6":{"start":{"line":18,"column":2},"end":{"line":18,"column":21}},"7":{"start":{"line":21,"column":0},"end":{"line":31,"column":1}},"8":{"start":{"line":22,"column":2},"end":{"line":28,"column":3}},"9":{"start":{"line":23,"column":4},"end":{"line":27,"column":5}},"10":{"start":{"line":24,"column":6},"end":{"line":26,"column":7}},"11":{"start":{"line":25,"column":8},"end":{"line":25,"column":37}},"12":{"start":{"line":30,"column":2},"end":{"line":30,"column":13}},"13":{"start":{"line":33,"column":0},"end":{"line":33,"column":24}},"14":{"start":{"line":33,"column":24},"end":{"line":33,"column":65}},"15":{"start":{"line":34,"column":0},"end":{"line":34,"column":28}},"16":{"start":{"line":37,"column":0},"end":{"line":39,"column":2}},"17":{"start":{"line":38,"column":2},"end":{"line":38,"column":37}},"18":{"start":{"line":42,"column":0},"end":{"line":46,"column":1},"skip":true},"19":{"start":{"line":43,"column":2},"end":{"line":45,"column":4},"skip":true},"20":{"start":{"line":44,"column":4},"end":{"line":44,"column":87},"skip":true},"21":{"start":{"line":47,"column":0},"end":{"line":47,"column":15}},"22":{"start":{"line":48,"column":0},"end":{"line":48,"column":32}},"23":{"start":{"line":50,"column":0},"end":{"line":52,"column":2},"skip":true},"24":{"start":{"line":51,"column":2},"end":{"line":51,"column":98},"skip":true},"25":{"start":{"line":53,"column":0},"end":{"line":53,"column":26}},"26":{"start":{"line":55,"column":0},"end":{"line":72,"column":1}},"27":{"start":{"line":57,"column":2},"end":{"line":63,"column":3}},"28":{"start":{"line":58,"column":4},"end":{"line":58,"column":29}},"29":{"start":{"line":59,"column":9},"end":{"line":63,"column":3}},"30":{"start":{"line":60,"column":4},"end":{"line":60,"column":14}},"31":{"start":{"line":61,"column":9},"end":{"line":63,"column":3}},"32":{"start":{"line":62,"column":4},"end":{"line":62,"column":23}},"33":{"start":{"line":68,"column":2},"end":{"line":68,"column":23}},"34":{"start":{"line":70,"column":2},"end":{"line":70,"column":47}},"35":{"start":{"line":70,"column":31},"end":{"line":70,"column":45}},"36":{"start":{"line":71,"column":2},"end":{"line":71,"column":46}},"37":{"start":{"line":74,"column":0},"end":{"line":74,"column":44}},"38":{"start":{"line":74,"column":44},"end":{"line":82,"column":1}},"39":{"start":{"line":75,"column":2},"end":{"line":81,"column":3}},"40":{"start":{"line":76,"column":4},"end":{"line":76,"column":16}},"41":{"start":{"line":77,"column":9},"end":{"line":81,"column":3}},"42":{"start":{"line":78,"column":4},"end":{"line":78,"column":16}},"43":{"start":{"line":80,"column":4},"end":{"line":80,"column":17}},"44":{"start":{"line":84,"column":0},"end":{"line":84,"column":26}},"45":{"start":{"line":84,"column":26},"end":{"line":86,"column":1}},"46":{"start":{"line":85,"column":2},"end":{"line":85,"column":53}},"47":{"start":{"line":88,"column":0},"end":{"line":88,"column":46}}},"branchMap":{"1":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":6},"end":{"line":24,"column":6}},{"start":{"line":24,"column":6},"end":{"line":24,"column":6}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":0},"end":{"line":42,"column":0},"skip":true},{"start":{"line":42,"column":0},"end":{"line":42,"column":0},"skip":true}]},"3":{"line":44,"type":"binary-expr","locations":[{"start":{"line":44,"column":11},"end":{"line":44,"column":38},"skip":true},{"start":{"line":44,"column":42},"end":{"line":44,"column":86},"skip":true}]},"4":{"line":50,"type":"binary-expr","locations":[{"start":{"line":50,"column":14},"end":{"line":50,"column":27},"skip":true},{"start":{"line":50,"column":31},"end":{"line":52,"column":1},"skip":true}]},"5":{"line":51,"type":"cond-expr","locations":[{"start":{"line":51,"column":48},"end":{"line":51,"column":89},"skip":true},{"start":{"line":51,"column":92},"end":{"line":51,"column":97},"skip":true}]},"6":{"line":51,"type":"binary-expr","locations":[{"start":{"line":51,"column":10},"end":{"line":51,"column":15},"skip":true},{"start":{"line":51,"column":19},"end":{"line":51,"column":44},"skip":true}]},"7":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":2},"end":{"line":57,"column":2}},{"start":{"line":57,"column":2},"end":{"line":57,"column":2}}]},"8":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":9},"end":{"line":59,"column":9}},{"start":{"line":59,"column":9},"end":{"line":59,"column":9}}]},"9":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":9},"end":{"line":61,"column":9}},{"start":{"line":61,"column":9},"end":{"line":61,"column":9}}]},"10":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":2},"end":{"line":70,"column":2}},{"start":{"line":70,"column":2},"end":{"line":70,"column":2}}]},"11":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":2},"end":{"line":75,"column":2}},{"start":{"line":75,"column":2},"end":{"line":75,"column":2}}]},"12":{"line":75,"type":"binary-expr","locations":[{"start":{"line":75,"column":6},"end":{"line":75,"column":12}},{"start":{"line":75,"column":16},"end":{"line":75,"column":27}}]},"13":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":9},"end":{"line":77,"column":9}},{"start":{"line":77,"column":9},"end":{"line":77,"column":9}}]},"14":{"line":77,"type":"binary-expr","locations":[{"start":{"line":77,"column":13},"end":{"line":77,"column":27}},{"start":{"line":77,"column":31},"end":{"line":77,"column":49}}]},"15":{"line":85,"type":"cond-expr","locations":[{"start":{"line":85,"column":24},"end":{"line":85,"column":41}},{"start":{"line":85,"column":44},"end":{"line":85,"column":46}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/safe-string.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/safe-string.js","s":{"1":1,"2":12,"3":1,"4":12,"5":1},"b":{},"f":{"1":12,"2":12},"fnMap":{"1":{"name":"SafeString","line":3,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":28}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":32},"end":{"line":7,"column":43}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":5,"column":1}},"2":{"start":{"line":4,"column":2},"end":{"line":4,"column":23}},"3":{"start":{"line":7,"column":0},"end":{"line":9,"column":2}},"4":{"start":{"line":8,"column":2},"end":{"line":8,"column":26}},"5":{"start":{"line":11,"column":0},"end":{"line":11,"column":32}}},"branchMap":{}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/exception.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/exception.js","s":{"1":1,"2":1,"3":48,"4":48,"5":16,"6":16,"7":48,"8":48,"9":336,"10":48,"11":16,"12":16,"13":1,"14":1},"b":{"1":[16,32],"2":[48,16],"3":[16,32]},"f":{"1":48},"fnMap":{"1":{"name":"Exception","line":5,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":34}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":3,"column":97}},"2":{"start":{"line":5,"column":0},"end":{"line":24,"column":1}},"3":{"start":{"line":6,"column":2},"end":{"line":6,"column":11}},"4":{"start":{"line":7,"column":2},"end":{"line":11,"column":3}},"5":{"start":{"line":8,"column":4},"end":{"line":8,"column":26}},"6":{"start":{"line":10,"column":4},"end":{"line":10,"column":53}},"7":{"start":{"line":13,"column":2},"end":{"line":13,"column":60}},"8":{"start":{"line":16,"column":2},"end":{"line":18,"column":3}},"9":{"start":{"line":17,"column":4},"end":{"line":17,"column":49}},"10":{"start":{"line":20,"column":2},"end":{"line":23,"column":3}},"11":{"start":{"line":21,"column":4},"end":{"line":21,"column":27}},"12":{"start":{"line":22,"column":4},"end":{"line":22,"column":35}},"13":{"start":{"line":26,"column":0},"end":{"line":26,"column":34}},"14":{"start":{"line":28,"column":0},"end":{"line":28,"column":31}}},"branchMap":{"1":{"line":7,"type":"if","locations":[{"start":{"line":7,"column":2},"end":{"line":7,"column":2}},{"start":{"line":7,"column":2},"end":{"line":7,"column":2}}]},"2":{"line":7,"type":"binary-expr","locations":[{"start":{"line":7,"column":6},"end":{"line":7,"column":10}},{"start":{"line":7,"column":14},"end":{"line":7,"column":28}}]},"3":{"line":20,"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":20,"column":2}},{"start":{"line":20,"column":2},"end":{"line":20,"column":2}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/runtime.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/runtime.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":470,"8":470,"9":3,"10":2,"11":2,"12":1,"13":1,"14":1,"15":474,"16":0,"17":474,"18":3,"19":471,"20":468,"21":55,"22":2,"23":55,"24":53,"25":39,"26":39,"27":39,"28":53,"29":52,"30":8,"31":8,"32":18,"33":6,"34":12,"35":8,"36":52,"37":1,"38":468,"39":175,"40":175,"41":261,"42":170,"43":138,"44":345,"45":345,"46":345,"47":340,"48":5,"49":4,"50":345,"51":4,"52":6,"53":4,"54":512,"55":512,"56":313,"57":512,"58":468,"59":480,"60":480,"61":480,"62":480,"63":462,"64":480,"65":480,"66":141,"67":480,"68":468,"69":468,"70":482,"71":471,"72":471,"73":41,"74":11,"75":11,"76":468,"77":4,"78":1,"79":3,"80":468,"81":1,"82":1,"83":347,"84":365,"85":365,"86":347,"87":347,"88":347,"89":1,"90":1,"91":55,"92":55,"93":2,"94":53,"95":13,"96":1,"97":1,"98":62,"99":1,"100":1,"101":462,"102":424,"103":424,"104":462},"b":{"1":[470,469,1],"2":[3,467],"3":[2,1],"4":[0,474],"5":[3,471],"6":[474,472],"7":[2,53],"8":[39,14],"9":[53,40],"10":[52,1],"11":[8,44],"12":[6,12],"13":[18,6],"14":[170,91],"15":[261,261],"16":[3,135],"17":[340,5],"18":[345,6],"19":[4,1],"20":[10,10],"21":[512,197],"22":[313,199],"23":[512,315,315],"24":[480,174],"25":[462,18],"26":[480,469],"27":[141,339],"28":[15,126],"29":[471,11],"30":[41,430],"31":[1,3],"32":[4,2],"33":[365,147],"34":[365,162],"35":[365,152],"36":[122,225],"37":[2,53],"38":[13,40],"39":[424,38],"40":[462,59],"41":[21,403]},"f":{"1":470,"2":474,"3":55,"4":175,"5":138,"6":345,"7":345,"8":4,"9":512,"10":480,"11":482,"12":4,"13":347,"14":365,"15":55,"16":62,"17":462},"fnMap":{"1":{"name":"checkRevision","line":8,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":37}}},"2":{"name":"template","line":28,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":37}}},"3":{"name":"(anonymous_3)","line":41,"loc":{"start":{"line":41,"column":29},"end":{"line":41,"column":109}}},"4":{"name":"(anonymous_4)","line":73,"loc":{"start":{"line":73,"column":12},"end":{"line":73,"column":35}}},"5":{"name":"(anonymous_5)","line":81,"loc":{"start":{"line":81,"column":12},"end":{"line":81,"column":39}}},"6":{"name":"(anonymous_6)","line":88,"loc":{"start":{"line":88,"column":8},"end":{"line":88,"column":20}}},"7":{"name":"(anonymous_7)","line":93,"loc":{"start":{"line":93,"column":13},"end":{"line":93,"column":39}}},"8":{"name":"(anonymous_8)","line":104,"loc":{"start":{"line":104,"column":10},"end":{"line":104,"column":32}}},"9":{"name":"(anonymous_9)","line":110,"loc":{"start":{"line":110,"column":11},"end":{"line":110,"column":35}}},"10":{"name":"(anonymous_10)","line":124,"loc":{"start":{"line":124,"column":12},"end":{"line":124,"column":39}}},"11":{"name":"(anonymous_11)","line":141,"loc":{"start":{"line":141,"column":15},"end":{"line":141,"column":33}}},"12":{"name":"(anonymous_12)","line":154,"loc":{"start":{"line":154,"column":15},"end":{"line":154,"column":41}}},"13":{"name":"program","line":164,"loc":{"start":{"line":164,"column":28},"end":{"line":164,"column":77}}},"14":{"name":"(anonymous_14)","line":165,"loc":{"start":{"line":165,"column":13},"end":{"line":165,"column":40}}},"15":{"name":"invokePartial","line":175,"loc":{"start":{"line":175,"column":26},"end":{"line":175,"column":106}}},"16":{"name":"noop","line":185,"loc":{"start":{"line":185,"column":38},"end":{"line":185,"column":54}}},"17":{"name":"initData","line":187,"loc":{"start":{"line":187,"column":20},"end":{"line":187,"column":53}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":50}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":60}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":58}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":48}},"6":{"start":{"line":8,"column":0},"end":{"line":24,"column":1}},"7":{"start":{"line":9,"column":2},"end":{"line":10,"column":42}},"8":{"start":{"line":12,"column":2},"end":{"line":23,"column":3}},"9":{"start":{"line":13,"column":4},"end":{"line":22,"column":5}},"10":{"start":{"line":14,"column":6},"end":{"line":15,"column":64}},"11":{"start":{"line":16,"column":6},"end":{"line":17,"column":157}},"12":{"start":{"line":20,"column":6},"end":{"line":21,"column":84}},"13":{"start":{"line":26,"column":0},"end":{"line":26,"column":38}},"14":{"start":{"line":28,"column":0},"end":{"line":162,"column":1}},"15":{"start":{"line":30,"column":2},"end":{"line":32,"column":3},"skip":true},"16":{"start":{"line":31,"column":4},"end":{"line":31,"column":61},"skip":true},"17":{"start":{"line":33,"column":2},"end":{"line":35,"column":3}},"18":{"start":{"line":34,"column":4},"end":{"line":34,"column":75}},"19":{"start":{"line":39,"column":2},"end":{"line":39,"column":46}},"20":{"start":{"line":41,"column":2},"end":{"line":69,"column":4}},"21":{"start":{"line":42,"column":4},"end":{"line":44,"column":5}},"22":{"start":{"line":43,"column":6},"end":{"line":43,"column":48}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":106}},"24":{"start":{"line":48,"column":4},"end":{"line":52,"column":5}},"25":{"start":{"line":49,"column":6},"end":{"line":49,"column":89}},"26":{"start":{"line":50,"column":6},"end":{"line":50,"column":108}},"27":{"start":{"line":51,"column":6},"end":{"line":51,"column":48}},"28":{"start":{"line":53,"column":4},"end":{"line":68,"column":5}},"29":{"start":{"line":54,"column":6},"end":{"line":64,"column":7}},"30":{"start":{"line":55,"column":8},"end":{"line":55,"column":39}},"31":{"start":{"line":56,"column":8},"end":{"line":62,"column":9}},"32":{"start":{"line":57,"column":10},"end":{"line":59,"column":11}},"33":{"start":{"line":58,"column":12},"end":{"line":58,"column":18}},"34":{"start":{"line":61,"column":10},"end":{"line":61,"column":39}},"35":{"start":{"line":63,"column":8},"end":{"line":63,"column":34}},"36":{"start":{"line":65,"column":6},"end":{"line":65,"column":20}},"37":{"start":{"line":67,"column":6},"end":{"line":67,"column":110}},"38":{"start":{"line":72,"column":2},"end":{"line":122,"column":4}},"39":{"start":{"line":74,"column":6},"end":{"line":74,"column":30}},"40":{"start":{"line":75,"column":6},"end":{"line":79,"column":7}},"41":{"start":{"line":76,"column":8},"end":{"line":78,"column":9}},"42":{"start":{"line":77,"column":10},"end":{"line":77,"column":33}},"43":{"start":{"line":82,"column":6},"end":{"line":82,"column":77}},"44":{"start":{"line":89,"column":6},"end":{"line":89,"column":29}},"45":{"start":{"line":94,"column":6},"end":{"line":95,"column":26}},"46":{"start":{"line":96,"column":6},"end":{"line":100,"column":7}},"47":{"start":{"line":97,"column":8},"end":{"line":97,"column":60}},"48":{"start":{"line":98,"column":13},"end":{"line":100,"column":7}},"49":{"start":{"line":99,"column":8},"end":{"line":99,"column":65}},"50":{"start":{"line":101,"column":6},"end":{"line":101,"column":28}},"51":{"start":{"line":105,"column":6},"end":{"line":107,"column":7}},"52":{"start":{"line":106,"column":8},"end":{"line":106,"column":28}},"53":{"start":{"line":108,"column":6},"end":{"line":108,"column":18}},"54":{"start":{"line":111,"column":6},"end":{"line":111,"column":32}},"55":{"start":{"line":113,"column":6},"end":{"line":115,"column":7}},"56":{"start":{"line":114,"column":8},"end":{"line":114,"column":46}},"57":{"start":{"line":117,"column":6},"end":{"line":117,"column":17}},"58":{"start":{"line":124,"column":2},"end":{"line":138,"column":4}},"59":{"start":{"line":125,"column":4},"end":{"line":125,"column":28}},"60":{"start":{"line":126,"column":4},"end":{"line":126,"column":28}},"61":{"start":{"line":128,"column":4},"end":{"line":128,"column":24}},"62":{"start":{"line":129,"column":4},"end":{"line":131,"column":5}},"63":{"start":{"line":130,"column":6},"end":{"line":130,"column":37}},"64":{"start":{"line":132,"column":4},"end":{"line":132,"column":15}},"65":{"start":{"line":133,"column":4},"end":{"line":135,"column":5}},"66":{"start":{"line":134,"column":6},"end":{"line":134,"column":77}},"67":{"start":{"line":137,"column":4},"end":{"line":137,"column":107}},"68":{"start":{"line":139,"column":2},"end":{"line":139,"column":19}},"69":{"start":{"line":141,"column":2},"end":{"line":152,"column":4}},"70":{"start":{"line":142,"column":4},"end":{"line":151,"column":5}},"71":{"start":{"line":143,"column":6},"end":{"line":143,"column":72}},"72":{"start":{"line":145,"column":6},"end":{"line":147,"column":7}},"73":{"start":{"line":146,"column":8},"end":{"line":146,"column":77}},"74":{"start":{"line":149,"column":6},"end":{"line":149,"column":42}},"75":{"start":{"line":150,"column":6},"end":{"line":150,"column":44}},"76":{"start":{"line":154,"column":2},"end":{"line":160,"column":4}},"77":{"start":{"line":155,"column":4},"end":{"line":157,"column":5}},"78":{"start":{"line":156,"column":6},"end":{"line":156,"column":53}},"79":{"start":{"line":159,"column":4},"end":{"line":159,"column":64}},"80":{"start":{"line":161,"column":2},"end":{"line":161,"column":13}},"81":{"start":{"line":164,"column":0},"end":{"line":164,"column":28}},"82":{"start":{"line":164,"column":28},"end":{"line":173,"column":1}},"83":{"start":{"line":165,"column":2},"end":{"line":169,"column":4}},"84":{"start":{"line":166,"column":4},"end":{"line":166,"column":28}},"85":{"start":{"line":168,"column":4},"end":{"line":168,"column":136}},"86":{"start":{"line":170,"column":2},"end":{"line":170,"column":19}},"87":{"start":{"line":171,"column":2},"end":{"line":171,"column":42}},"88":{"start":{"line":172,"column":2},"end":{"line":172,"column":14}},"89":{"start":{"line":175,"column":0},"end":{"line":175,"column":26}},"90":{"start":{"line":175,"column":26},"end":{"line":183,"column":1}},"91":{"start":{"line":176,"column":2},"end":{"line":176,"column":100}},"92":{"start":{"line":178,"column":2},"end":{"line":182,"column":3}},"93":{"start":{"line":179,"column":4},"end":{"line":179,"column":71}},"94":{"start":{"line":180,"column":9},"end":{"line":182,"column":3}},"95":{"start":{"line":181,"column":4},"end":{"line":181,"column":37}},"96":{"start":{"line":185,"column":0},"end":{"line":185,"column":38}},"97":{"start":{"line":185,"column":38},"end":{"line":185,"column":68}},"98":{"start":{"line":185,"column":56},"end":{"line":185,"column":66}},"99":{"start":{"line":187,"column":0},"end":{"line":187,"column":20}},"100":{"start":{"line":187,"column":20},"end":{"line":193,"column":1}},"101":{"start":{"line":188,"column":2},"end":{"line":191,"column":3}},"102":{"start":{"line":189,"column":4},"end":{"line":189,"column":41}},"103":{"start":{"line":190,"column":4},"end":{"line":190,"column":24}},"104":{"start":{"line":192,"column":2},"end":{"line":192,"column":14}}},"branchMap":{"1":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":25},"end":{"line":9,"column":37}},{"start":{"line":9,"column":41},"end":{"line":9,"column":56}},{"start":{"line":9,"column":60},"end":{"line":9,"column":61}}]},"2":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":2},"end":{"line":12,"column":2}},{"start":{"line":12,"column":2},"end":{"line":12,"column":2}}]},"3":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":4},"end":{"line":13,"column":4}},{"start":{"line":13,"column":4},"end":{"line":13,"column":4}}]},"4":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":30,"column":2},"skip":true},{"start":{"line":30,"column":2},"end":{"line":30,"column":2},"skip":true}]},"5":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":2},"end":{"line":33,"column":2}},{"start":{"line":33,"column":2},"end":{"line":33,"column":2}}]},"6":{"line":33,"type":"binary-expr","locations":[{"start":{"line":33,"column":6},"end":{"line":33,"column":19}},{"start":{"line":33,"column":23},"end":{"line":33,"column":41}}]},"7":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]},"8":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"9":{"line":48,"type":"binary-expr","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":22}},{"start":{"line":48,"column":26},"end":{"line":48,"column":37}}]},"10":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":4},"end":{"line":53,"column":4}},{"start":{"line":53,"column":4},"end":{"line":53,"column":4}}]},"11":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":6},"end":{"line":54,"column":6}},{"start":{"line":54,"column":6},"end":{"line":54,"column":6}}]},"12":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":10},"end":{"line":57,"column":10}},{"start":{"line":57,"column":10},"end":{"line":57,"column":10}}]},"13":{"line":57,"type":"binary-expr","locations":[{"start":{"line":57,"column":14},"end":{"line":57,"column":23}},{"start":{"line":57,"column":27},"end":{"line":57,"column":38}}]},"14":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"15":{"line":76,"type":"binary-expr","locations":[{"start":{"line":76,"column":12},"end":{"line":76,"column":21}},{"start":{"line":76,"column":25},"end":{"line":76,"column":48}}]},"16":{"line":82,"type":"cond-expr","locations":[{"start":{"line":82,"column":45},"end":{"line":82,"column":66}},{"start":{"line":82,"column":69},"end":{"line":82,"column":76}}]},"17":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":6},"end":{"line":96,"column":6}},{"start":{"line":96,"column":6},"end":{"line":96,"column":6}}]},"18":{"line":96,"type":"binary-expr","locations":[{"start":{"line":96,"column":10},"end":{"line":96,"column":14}},{"start":{"line":96,"column":18},"end":{"line":96,"column":24}}]},"19":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":13},"end":{"line":98,"column":13}},{"start":{"line":98,"column":13},"end":{"line":98,"column":13}}]},"20":{"line":105,"type":"binary-expr","locations":[{"start":{"line":105,"column":13},"end":{"line":105,"column":17}},{"start":{"line":105,"column":21},"end":{"line":105,"column":28}}]},"21":{"line":111,"type":"binary-expr","locations":[{"start":{"line":111,"column":16},"end":{"line":111,"column":21}},{"start":{"line":111,"column":25},"end":{"line":111,"column":31}}]},"22":{"line":113,"type":"if","locations":[{"start":{"line":113,"column":6},"end":{"line":113,"column":6}},{"start":{"line":113,"column":6},"end":{"line":113,"column":6}}]},"23":{"line":113,"type":"binary-expr","locations":[{"start":{"line":113,"column":10},"end":{"line":113,"column":15}},{"start":{"line":113,"column":19},"end":{"line":113,"column":25}},{"start":{"line":113,"column":30},"end":{"line":113,"column":46}}]},"24":{"line":125,"type":"binary-expr","locations":[{"start":{"line":125,"column":14},"end":{"line":125,"column":21}},{"start":{"line":125,"column":25},"end":{"line":125,"column":27}}]},"25":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":4},"end":{"line":129,"column":4}},{"start":{"line":129,"column":4},"end":{"line":129,"column":4}}]},"26":{"line":129,"type":"binary-expr","locations":[{"start":{"line":129,"column":8},"end":{"line":129,"column":24}},{"start":{"line":129,"column":28},"end":{"line":129,"column":48}}]},"27":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":4},"end":{"line":133,"column":4}},{"start":{"line":133,"column":4},"end":{"line":133,"column":4}}]},"28":{"line":134,"type":"cond-expr","locations":[{"start":{"line":134,"column":32},"end":{"line":134,"column":64}},{"start":{"line":134,"column":67},"end":{"line":134,"column":76}}]},"29":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":4},"end":{"line":142,"column":4}},{"start":{"line":142,"column":4},"end":{"line":142,"column":4}}]},"30":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":6},"end":{"line":145,"column":6}},{"start":{"line":145,"column":6},"end":{"line":145,"column":6}}]},"31":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":4},"end":{"line":155,"column":4}},{"start":{"line":155,"column":4},"end":{"line":155,"column":4}}]},"32":{"line":155,"type":"binary-expr","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":30}},{"start":{"line":155,"column":34},"end":{"line":155,"column":41}}]},"33":{"line":166,"type":"binary-expr","locations":[{"start":{"line":166,"column":14},"end":{"line":166,"column":21}},{"start":{"line":166,"column":25},"end":{"line":166,"column":27}}]},"34":{"line":168,"type":"binary-expr","locations":[{"start":{"line":168,"column":78},"end":{"line":168,"column":90}},{"start":{"line":168,"column":94},"end":{"line":168,"column":98}}]},"35":{"line":168,"type":"binary-expr","locations":[{"start":{"line":168,"column":100},"end":{"line":168,"column":106}},{"start":{"line":168,"column":110},"end":{"line":168,"column":134}}]},"36":{"line":171,"type":"cond-expr","locations":[{"start":{"line":171,"column":24},"end":{"line":171,"column":37}},{"start":{"line":171,"column":40},"end":{"line":171,"column":41}}]},"37":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":2},"end":{"line":178,"column":2}},{"start":{"line":178,"column":2},"end":{"line":178,"column":2}}]},"38":{"line":180,"type":"if","locations":[{"start":{"line":180,"column":9},"end":{"line":180,"column":9}},{"start":{"line":180,"column":9},"end":{"line":180,"column":9}}]},"39":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":2},"end":{"line":188,"column":2}},{"start":{"line":188,"column":2},"end":{"line":188,"column":2}}]},"40":{"line":188,"type":"binary-expr","locations":[{"start":{"line":188,"column":6},"end":{"line":188,"column":11}},{"start":{"line":188,"column":15},"end":{"line":188,"column":32}}]},"41":{"line":189,"type":"cond-expr","locations":[{"start":{"line":189,"column":18},"end":{"line":189,"column":35}},{"start":{"line":189,"column":38},"end":{"line":189,"column":40}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/ast.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/ast.js","s":{"1":1,"2":1,"3":10460,"4":10460,"5":10460,"6":10460,"7":10460,"8":1,"9":1700,"10":1700,"11":1700,"12":1700,"13":1588,"14":1588,"15":1588,"16":1588,"17":1584,"18":1584,"19":4,"20":1588,"21":1569,"22":19,"23":1588,"24":1588,"25":1588,"26":1588,"27":1588,"28":1644,"29":1644,"30":1644,"31":1644,"32":1644,"33":1644,"34":1644,"35":96,"36":96,"37":96,"38":96,"39":96,"40":96,"41":96,"42":602,"43":602,"44":602,"45":602,"46":602,"47":602,"48":602,"49":80,"50":5,"51":5,"52":1,"53":4,"54":4,"55":4,"56":4,"57":1617,"58":1617,"59":1617,"60":75,"61":75,"62":75,"63":2756,"64":2756,"65":2756,"66":2756,"67":3091,"68":3091,"69":3091,"70":163,"71":11,"72":152,"73":67,"74":67,"75":85,"76":2928,"77":2745,"78":2745,"79":2745,"80":2745,"81":2745,"82":2745,"83":2745,"84":96,"85":96,"86":96,"87":75,"88":75,"89":75,"90":75,"91":75,"92":58,"93":58,"94":58,"95":56,"96":56,"97":56,"98":56,"99":55,"100":55,"101":55,"102":55,"103":37,"104":37,"105":37,"106":37,"107":1},"b":{"1":[10460,47],"2":[1584,4],"3":[1588,1587],"4":[1584,1554],"5":[1584,1544],"6":[1569,19],"7":[1644,1225],"8":[1644,1159],"9":[80,522],"10":[602,143],"11":[1,4],"12":[3091,2758],"13":[163,2928],"14":[3091,3019,2960],"15":[11,152],"16":[67,85],"17":[2745,2478,2416]},"f":{"1":10460,"2":1700,"3":1588,"4":1644,"5":96,"6":602,"7":5,"8":1617,"9":75,"10":2756,"11":96,"12":75,"13":58,"14":56,"15":55,"16":37},"fnMap":{"1":{"name":"LocationInfo","line":4,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}}},"2":{"name":"(anonymous_2)","line":13,"loc":{"start":{"line":13,"column":15},"end":{"line":13,"column":52}}},"3":{"name":"(anonymous_3)","line":20,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":64}}},"4":{"name":"(anonymous_4)","line":49,"loc":{"start":{"line":49,"column":13},"end":{"line":49,"column":48}}},"5":{"name":"(anonymous_5)","line":72,"loc":{"start":{"line":72,"column":15},"end":{"line":72,"column":68}}},"6":{"name":"(anonymous_6)","line":83,"loc":{"start":{"line":83,"column":13},"end":{"line":83,"column":66}}},"7":{"name":"(anonymous_7)","line":97,"loc":{"start":{"line":97,"column":16},"end":{"line":97,"column":60}}},"8":{"name":"(anonymous_8)","line":111,"loc":{"start":{"line":111,"column":15},"end":{"line":111,"column":41}}},"9":{"name":"(anonymous_9)","line":117,"loc":{"start":{"line":117,"column":12},"end":{"line":117,"column":37}}},"10":{"name":"(anonymous_10)","line":123,"loc":{"start":{"line":123,"column":10},"end":{"line":123,"column":35}}},"11":{"name":"(anonymous_11)","line":163,"loc":{"start":{"line":163,"column":19},"end":{"line":163,"column":43}}},"12":{"name":"(anonymous_12)","line":169,"loc":{"start":{"line":169,"column":12},"end":{"line":169,"column":34}}},"13":{"name":"(anonymous_13)","line":177,"loc":{"start":{"line":177,"column":14},"end":{"line":177,"column":40}}},"14":{"name":"(anonymous_14)","line":185,"loc":{"start":{"line":185,"column":14},"end":{"line":185,"column":40}}},"15":{"name":"(anonymous_15)","line":193,"loc":{"start":{"line":193,"column":15},"end":{"line":193,"column":39}}},"16":{"name":"(anonymous_16)","line":200,"loc":{"start":{"line":200,"column":15},"end":{"line":200,"column":42}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":51}},"2":{"start":{"line":4,"column":0},"end":{"line":10,"column":1}},"3":{"start":{"line":5,"column":2},"end":{"line":5,"column":26}},"4":{"start":{"line":6,"column":2},"end":{"line":6,"column":40}},"5":{"start":{"line":7,"column":2},"end":{"line":7,"column":42}},"6":{"start":{"line":8,"column":2},"end":{"line":8,"column":41}},"7":{"start":{"line":9,"column":2},"end":{"line":9,"column":39}},"8":{"start":{"line":12,"column":0},"end":{"line":209,"column":2}},"9":{"start":{"line":14,"column":4},"end":{"line":14,"column":37}},"10":{"start":{"line":15,"column":4},"end":{"line":15,"column":26}},"11":{"start":{"line":16,"column":4},"end":{"line":16,"column":33}},"12":{"start":{"line":17,"column":4},"end":{"line":17,"column":23}},"13":{"start":{"line":21,"column":4},"end":{"line":21,"column":37}},"14":{"start":{"line":22,"column":4},"end":{"line":22,"column":27}},"15":{"start":{"line":23,"column":4},"end":{"line":23,"column":23}},"16":{"start":{"line":26,"column":4},"end":{"line":32,"column":5}},"17":{"start":{"line":28,"column":6},"end":{"line":28,"column":56}},"18":{"start":{"line":29,"column":6},"end":{"line":29,"column":62}},"19":{"start":{"line":31,"column":6},"end":{"line":31,"column":28}},"20":{"start":{"line":34,"column":4},"end":{"line":39,"column":5}},"21":{"start":{"line":35,"column":6},"end":{"line":35,"column":29}},"22":{"start":{"line":38,"column":6},"end":{"line":38,"column":54}},"23":{"start":{"line":42,"column":4},"end":{"line":42,"column":28}},"24":{"start":{"line":43,"column":4},"end":{"line":43,"column":36}},"25":{"start":{"line":44,"column":4},"end":{"line":44,"column":32}},"26":{"start":{"line":45,"column":4},"end":{"line":45,"column":52}},"27":{"start":{"line":46,"column":4},"end":{"line":46,"column":40}},"28":{"start":{"line":50,"column":4},"end":{"line":50,"column":37}},"29":{"start":{"line":52,"column":4},"end":{"line":52,"column":24}},"30":{"start":{"line":53,"column":4},"end":{"line":53,"column":21}},"31":{"start":{"line":55,"column":4},"end":{"line":55,"column":36}},"32":{"start":{"line":56,"column":4},"end":{"line":56,"column":50}},"33":{"start":{"line":61,"column":4},"end":{"line":61,"column":46}},"34":{"start":{"line":65,"column":4},"end":{"line":65,"column":55}},"35":{"start":{"line":73,"column":4},"end":{"line":73,"column":37}},"36":{"start":{"line":74,"column":4},"end":{"line":74,"column":34}},"37":{"start":{"line":75,"column":4},"end":{"line":75,"column":36}},"38":{"start":{"line":76,"column":4},"end":{"line":76,"column":32}},"39":{"start":{"line":77,"column":4},"end":{"line":77,"column":21}},"40":{"start":{"line":78,"column":4},"end":{"line":78,"column":23}},"41":{"start":{"line":80,"column":4},"end":{"line":80,"column":39}},"42":{"start":{"line":84,"column":4},"end":{"line":84,"column":37}},"43":{"start":{"line":86,"column":4},"end":{"line":86,"column":24}},"44":{"start":{"line":87,"column":4},"end":{"line":87,"column":29}},"45":{"start":{"line":88,"column":4},"end":{"line":88,"column":28}},"46":{"start":{"line":89,"column":4},"end":{"line":89,"column":28}},"47":{"start":{"line":90,"column":4},"end":{"line":90,"column":23}},"48":{"start":{"line":92,"column":4},"end":{"line":94,"column":5}},"49":{"start":{"line":93,"column":6},"end":{"line":93,"column":28}},"50":{"start":{"line":98,"column":4},"end":{"line":98,"column":37}},"51":{"start":{"line":100,"column":4},"end":{"line":102,"column":5}},"52":{"start":{"line":101,"column":6},"end":{"line":101,"column":88}},"53":{"start":{"line":104,"column":4},"end":{"line":104,"column":52}},"54":{"start":{"line":106,"column":4},"end":{"line":106,"column":24}},"55":{"start":{"line":107,"column":4},"end":{"line":107,"column":29}},"56":{"start":{"line":108,"column":4},"end":{"line":108,"column":63}},"57":{"start":{"line":112,"column":4},"end":{"line":112,"column":37}},"58":{"start":{"line":113,"column":4},"end":{"line":113,"column":26}},"59":{"start":{"line":114,"column":4},"end":{"line":114,"column":41}},"60":{"start":{"line":118,"column":4},"end":{"line":118,"column":37}},"61":{"start":{"line":119,"column":4},"end":{"line":119,"column":23}},"62":{"start":{"line":120,"column":4},"end":{"line":120,"column":23}},"63":{"start":{"line":124,"column":4},"end":{"line":124,"column":37}},"64":{"start":{"line":125,"column":4},"end":{"line":125,"column":21}},"65":{"start":{"line":127,"column":4},"end":{"line":130,"column":25}},"66":{"start":{"line":132,"column":4},"end":{"line":148,"column":5}},"67":{"start":{"line":133,"column":6},"end":{"line":133,"column":31}},"68":{"start":{"line":134,"column":6},"end":{"line":134,"column":52}},"69":{"start":{"line":136,"column":6},"end":{"line":147,"column":7}},"70":{"start":{"line":137,"column":8},"end":{"line":144,"column":9}},"71":{"start":{"line":138,"column":10},"end":{"line":138,"column":65}},"72":{"start":{"line":139,"column":15},"end":{"line":144,"column":9}},"73":{"start":{"line":140,"column":10},"end":{"line":140,"column":18}},"74":{"start":{"line":141,"column":10},"end":{"line":141,"column":31}},"75":{"start":{"line":143,"column":10},"end":{"line":143,"column":31}},"76":{"start":{"line":146,"column":8},"end":{"line":146,"column":23}},"77":{"start":{"line":150,"column":4},"end":{"line":150,"column":29}},"78":{"start":{"line":151,"column":4},"end":{"line":151,"column":24}},"79":{"start":{"line":152,"column":4},"end":{"line":152,"column":34}},"80":{"start":{"line":153,"column":4},"end":{"line":153,"column":26}},"81":{"start":{"line":154,"column":4},"end":{"line":154,"column":46}},"82":{"start":{"line":158,"column":4},"end":{"line":158,"column":72}},"83":{"start":{"line":160,"column":4},"end":{"line":160,"column":39}},"84":{"start":{"line":164,"column":4},"end":{"line":164,"column":37}},"85":{"start":{"line":165,"column":4},"end":{"line":165,"column":31}},"86":{"start":{"line":166,"column":4},"end":{"line":166,"column":30}},"87":{"start":{"line":170,"column":4},"end":{"line":170,"column":37}},"88":{"start":{"line":171,"column":4},"end":{"line":171,"column":23}},"89":{"start":{"line":172,"column":4},"end":{"line":172,"column":17}},"90":{"start":{"line":173,"column":4},"end":{"line":173,"column":46}},"91":{"start":{"line":174,"column":4},"end":{"line":174,"column":43}},"92":{"start":{"line":178,"column":4},"end":{"line":178,"column":37}},"93":{"start":{"line":179,"column":4},"end":{"line":179,"column":25}},"94":{"start":{"line":180,"column":4},"end":{"line":182,"column":36}},"95":{"start":{"line":186,"column":4},"end":{"line":186,"column":37}},"96":{"start":{"line":187,"column":4},"end":{"line":187,"column":25}},"97":{"start":{"line":188,"column":4},"end":{"line":189,"column":27}},"98":{"start":{"line":190,"column":4},"end":{"line":190,"column":42}},"99":{"start":{"line":194,"column":4},"end":{"line":194,"column":37}},"100":{"start":{"line":195,"column":4},"end":{"line":195,"column":26}},"101":{"start":{"line":196,"column":4},"end":{"line":196,"column":21}},"102":{"start":{"line":197,"column":4},"end":{"line":197,"column":43}},"103":{"start":{"line":201,"column":4},"end":{"line":201,"column":37}},"104":{"start":{"line":202,"column":4},"end":{"line":202,"column":26}},"105":{"start":{"line":203,"column":4},"end":{"line":203,"column":27}},"106":{"start":{"line":205,"column":4},"end":{"line":207,"column":6}},"107":{"start":{"line":214,"column":0},"end":{"line":214,"column":25}}},"branchMap":{"1":{"line":5,"type":"binary-expr","locations":[{"start":{"line":5,"column":12},"end":{"line":5,"column":19}},{"start":{"line":5,"column":23},"end":{"line":5,"column":25}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"3":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":8},"end":{"line":26,"column":20}},{"start":{"line":26,"column":24},"end":{"line":26,"column":35}}]},"4":{"line":28,"type":"binary-expr","locations":[{"start":{"line":28,"column":23},"end":{"line":28,"column":37}},{"start":{"line":28,"column":41},"end":{"line":28,"column":55}}]},"5":{"line":29,"type":"binary-expr","locations":[{"start":{"line":29,"column":21},"end":{"line":29,"column":39}},{"start":{"line":29,"column":43},"end":{"line":29,"column":61}}]},"6":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"7":{"line":61,"type":"binary-expr","locations":[{"start":{"line":61,"column":23},"end":{"line":61,"column":36}},{"start":{"line":61,"column":40},"end":{"line":61,"column":44}}]},"8":{"line":65,"type":"binary-expr","locations":[{"start":{"line":65,"column":26},"end":{"line":65,"column":39}},{"start":{"line":65,"column":43},"end":{"line":65,"column":54}}]},"9":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":4},"end":{"line":92,"column":4}},{"start":{"line":92,"column":4},"end":{"line":92,"column":4}}]},"10":{"line":92,"type":"binary-expr","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":15}},{"start":{"line":92,"column":19},"end":{"line":92,"column":27}}]},"11":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":4},"end":{"line":100,"column":4}},{"start":{"line":100,"column":4},"end":{"line":100,"column":4}}]},"12":{"line":134,"type":"binary-expr","locations":[{"start":{"line":134,"column":19},"end":{"line":134,"column":37}},{"start":{"line":134,"column":41},"end":{"line":134,"column":43}}]},"13":{"line":136,"type":"if","locations":[{"start":{"line":136,"column":6},"end":{"line":136,"column":6}},{"start":{"line":136,"column":6},"end":{"line":136,"column":6}}]},"14":{"line":136,"type":"binary-expr","locations":[{"start":{"line":136,"column":10},"end":{"line":136,"column":23}},{"start":{"line":136,"column":27},"end":{"line":136,"column":39}},{"start":{"line":136,"column":43},"end":{"line":136,"column":58}}]},"15":{"line":137,"type":"if","locations":[{"start":{"line":137,"column":8},"end":{"line":137,"column":8}},{"start":{"line":137,"column":8},"end":{"line":137,"column":8}}]},"16":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":15},"end":{"line":139,"column":15}},{"start":{"line":139,"column":15},"end":{"line":139,"column":15}}]},"17":{"line":158,"type":"binary-expr","locations":[{"start":{"line":158,"column":20},"end":{"line":158,"column":38}},{"start":{"line":158,"column":42},"end":{"line":158,"column":56}},{"start":{"line":158,"column":60},"end":{"line":158,"column":71}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/base.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/base.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1052,"10":3,"11":1049,"12":1049,"13":1},"b":{"1":[3,1049]},"f":{"1":1052},"fnMap":{"1":{"name":"parse","line":12,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":22}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":44}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":38}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":35}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":40}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":24}},"6":{"start":{"line":9,"column":0},"end":{"line":9,"column":12}},"7":{"start":{"line":10,"column":0},"end":{"line":10,"column":25}},"8":{"start":{"line":12,"column":0},"end":{"line":19,"column":1}},"9":{"start":{"line":14,"column":2},"end":{"line":14,"column":62}},"10":{"start":{"line":14,"column":47},"end":{"line":14,"column":60}},"11":{"start":{"line":16,"column":2},"end":{"line":16,"column":17}},"12":{"start":{"line":18,"column":2},"end":{"line":18,"column":29}},"13":{"start":{"line":21,"column":0},"end":{"line":21,"column":22}}},"branchMap":{"1":{"line":14,"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":14,"column":2}},{"start":{"line":14,"column":2},"end":{"line":14,"column":2}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/parser.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/parser.js","s":{"1":1,"2":1,"3":26939,"4":26939,"5":1026,"6":1026,"7":0,"8":1692,"9":1692,"10":952,"11":952,"12":601,"13":601,"14":4,"15":4,"16":95,"17":95,"18":1609,"19":1609,"20":36,"21":36,"22":5,"23":4,"24":5,"25":5,"26":523,"27":521,"28":80,"29":80,"30":531,"31":531,"32":80,"33":80,"34":62,"35":62,"36":603,"37":603,"38":914,"39":914,"40":38,"41":38,"42":6,"43":6,"44":89,"45":89,"46":1584,"47":1584,"48":40,"49":40,"50":390,"51":390,"52":55,"53":55,"54":53,"55":53,"56":54,"57":54,"58":34,"59":34,"60":52,"61":52,"62":52,"63":74,"64":74,"65":119,"66":119,"67":91,"68":91,"69":2,"70":2,"71":2,"72":2,"73":74,"74":74,"75":2752,"76":2744,"77":341,"78":341,"79":341,"80":2752,"81":2752,"82":1722,"83":1722,"84":3297,"85":3297,"86":1586,"87":1586,"88":513,"89":513,"90":74,"91":74,"92":45,"93":45,"94":12,"95":1049,"96":1049,"97":1049,"98":1049,"99":1049,"100":1049,"101":0,"102":1049,"103":1049,"104":1049,"105":1049,"106":0,"107":1,"108":0,"109":0,"110":0,"111":1,"112":11342,"113":11342,"114":11342,"115":7,"116":11342,"117":1049,"118":1049,"119":38270,"120":38270,"121":1159,"122":37111,"123":11342,"124":37111,"125":38270,"126":12,"127":12,"128":12,"129":12,"130":82,"131":82,"132":12,"133":12,"134":0,"135":12,"136":38258,"137":0,"138":38258,"139":11319,"140":11319,"141":11319,"142":11319,"143":11319,"144":11319,"145":11319,"146":11319,"147":11319,"148":11319,"149":11319,"150":0,"151":0,"152":0,"153":11319,"154":26939,"155":26939,"156":26939,"157":26939,"158":0,"159":26939,"160":26928,"161":1026,"162":25902,"163":20448,"164":20448,"165":20448,"166":25902,"167":25902,"168":25902,"169":25902,"170":25902,"171":25902,"172":0,"173":0,"174":1,"175":1,"176":0,"177":0,"178":0,"179":1116,"180":1116,"181":1116,"182":1116,"183":1116,"184":1116,"185":1116,"186":0,"187":1116,"188":1116,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":12,"223":12,"224":12,"225":12,"226":12,"227":12,"228":12,"229":12,"230":12,"231":13951,"232":0,"233":13951,"234":1094,"235":13951,"236":13951,"237":13951,"238":13951,"239":13951,"240":13951,"241":221226,"242":221226,"243":13951,"244":13951,"245":13951,"246":13951,"247":13951,"248":13951,"249":13951,"250":370,"251":13951,"252":13951,"253":13951,"254":13951,"255":13951,"256":13951,"257":0,"258":13951,"259":13951,"260":13951,"261":13951,"262":13951,"263":0,"264":13951,"265":11800,"266":2151,"267":0,"268":0,"269":0,"270":13951,"271":13951,"272":11800,"273":2151,"274":2483,"275":2474,"276":13951,"277":0,"278":0,"279":1,"280":1,"281":1,"282":141,"283":13951,"284":13951,"285":2476,"286":10,"287":10,"288":2466,"289":10,"290":10,"291":2456,"292":2476,"293":1201,"294":1275,"295":426,"296":0,"297":10,"298":10,"299":0,"300":5,"301":5,"302":5,"303":0,"304":5,"305":0,"306":2,"307":2,"308":2,"309":0,"310":62,"311":0,"312":62,"313":0,"314":5,"315":0,"316":5,"317":5,"318":5,"319":0,"320":100,"321":0,"322":532,"323":0,"324":604,"325":0,"326":44,"327":44,"328":0,"329":22,"330":22,"331":0,"332":81,"333":0,"334":1,"335":0,"336":42,"337":0,"338":23,"339":0,"340":2,"341":2,"342":2,"343":37,"344":37,"345":37,"346":0,"347":973,"348":0,"349":131,"350":0,"351":73,"352":0,"353":59,"354":0,"355":355,"356":0,"357":874,"358":42,"359":42,"360":0,"361":2305,"362":2305,"363":0,"364":61,"365":61,"366":0,"367":6,"368":6,"369":0,"370":79,"371":0,"372":42,"373":0,"374":18,"375":0,"376":61,"377":0,"378":3208,"379":0,"380":15,"381":15,"382":0,"383":9,"384":0,"385":1094,"386":0,"387":1,"388":1,"389":1,"390":1,"391":1,"392":1,"393":1,"394":1,"395":1,"396":1},"b":{"1":[1026,1692,952,601,4,95,1609,36,5,5,523,80,531,80,62,603,914,38,6,89,1584,40,390,55,53,54,34,52,74,119,91,2,2,74,2752,341,2752,1722,3297,1586,513,74,45],"2":[0,1049],"3":[1049,1049],"4":[0,1049],"5":[11342,0],"6":[7,11335],"7":[7,7],"8":[1159,37111],"9":[11342,25769],"10":[37111,26818],"11":[37111,37111],"12":[12,38258],"13":[38270,38258,38258],"14":[12,0],"15":[82,0],"16":[82,82],"17":[12,0],"18":[12,7],"19":[0,0],"20":[0,0],"21":[12,7],"22":[0,38258],"23":[38258,0],"24":[11319,26939,0],"25":[11319,0],"26":[0,11319],"27":[26939,5454],"28":[26939,5454],"29":[0,26939],"30":[0,0],"31":[1026,25902],"32":[20448,5454],"33":[0,0],"34":[0,1116],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,12],"42":[12,0],"43":[0,12],"44":[0,13951],"45":[1094,12857],"46":[13951,0],"47":[13951,207275],"48":[221226,13951,0],"49":[13951,0],"50":[13951,0],"51":[370,13581],"52":[370,13581],"53":[0,13951],"54":[0,13951],"55":[13951,1094],"56":[11800,2151],"57":[0,0],"58":[11800,2151],"59":[2476,426,10,5,5,2,62,62,5,5,100,532,604,44,22,81,1,42,23,2,37,973,131,73,59,355,874,42,2305,61,6,79,42,18,61,3208,15,9,1094],"60":[10,2466],"61":[10,2456],"62":[1201,1275]},"f":{"1":1,"2":0,"3":26939,"4":12,"5":1049,"6":0,"7":11342,"8":1,"9":0,"10":1116,"11":0,"12":0,"13":0,"14":0,"15":12,"16":12,"17":12,"18":13951,"19":13951,"20":2483,"21":2474,"22":13951,"23":0,"24":0,"25":13951,"26":141,"27":1},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":28}},"skip":true},"2":{"name":"trace","line":6,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":38}},"skip":true},"3":{"name":"anonymous","line":11,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":75}},"skip":true},"4":{"name":"parseError","line":105,"loc":{"start":{"line":105,"column":12},"end":{"line":105,"column":43}},"skip":true},"5":{"name":"parse","line":108,"loc":{"start":{"line":108,"column":7},"end":{"line":108,"column":29}},"skip":true},"6":{"name":"popStack","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":121,"column":25}},"skip":true},"7":{"name":"lex","line":126,"loc":{"start":{"line":126,"column":4},"end":{"line":126,"column":19}},"skip":true},"8":{"name":"(anonymous_8)","line":213,"loc":{"start":{"line":213,"column":13},"end":{"line":213,"column":23}},"skip":true},"9":{"name":"parseError","line":215,"loc":{"start":{"line":215,"column":11},"end":{"line":215,"column":42}},"skip":true},"10":{"name":"(anonymous_10)","line":222,"loc":{"start":{"line":222,"column":9},"end":{"line":222,"column":26}},"skip":true},"11":{"name":"(anonymous_11)","line":233,"loc":{"start":{"line":233,"column":6},"end":{"line":233,"column":18}},"skip":true},"12":{"name":"(anonymous_12)","line":252,"loc":{"start":{"line":252,"column":6},"end":{"line":252,"column":20}},"skip":true},"13":{"name":"(anonymous_13)","line":280,"loc":{"start":{"line":280,"column":5},"end":{"line":280,"column":17}},"skip":true},"14":{"name":"(anonymous_14)","line":284,"loc":{"start":{"line":284,"column":5},"end":{"line":284,"column":18}},"skip":true},"15":{"name":"(anonymous_15)","line":287,"loc":{"start":{"line":287,"column":10},"end":{"line":287,"column":22}},"skip":true},"16":{"name":"(anonymous_16)","line":291,"loc":{"start":{"line":291,"column":14},"end":{"line":291,"column":26}},"skip":true},"17":{"name":"(anonymous_17)","line":298,"loc":{"start":{"line":298,"column":13},"end":{"line":298,"column":25}},"skip":true},"18":{"name":"(anonymous_18)","line":303,"loc":{"start":{"line":303,"column":5},"end":{"line":303,"column":17}},"skip":true},"19":{"name":"lex","line":357,"loc":{"start":{"line":357,"column":4},"end":{"line":357,"column":19}},"skip":true},"20":{"name":"begin","line":365,"loc":{"start":{"line":365,"column":6},"end":{"line":365,"column":32}},"skip":true},"21":{"name":"popState","line":368,"loc":{"start":{"line":368,"column":9},"end":{"line":368,"column":29}},"skip":true},"22":{"name":"_currentRules","line":371,"loc":{"start":{"line":371,"column":14},"end":{"line":371,"column":39}},"skip":true},"23":{"name":"(anonymous_23)","line":374,"loc":{"start":{"line":374,"column":9},"end":{"line":374,"column":21}},"skip":true},"24":{"name":"begin","line":377,"loc":{"start":{"line":377,"column":10},"end":{"line":377,"column":36}},"skip":true},"25":{"name":"anonymous","line":381,"loc":{"start":{"line":381,"column":22},"end":{"line":381,"column":84}},"skip":true},"26":{"name":"strip","line":384,"loc":{"start":{"line":384,"column":0},"end":{"line":384,"column":27}},"skip":true},"27":{"name":"Parser","line":497,"loc":{"start":{"line":497,"column":0},"end":{"line":497,"column":19}},"skip":true}},"statementMap":{"1":{"start":{"line":5,"column":0},"end":{"line":499,"column":5},"skip":true},"2":{"start":{"line":6,"column":0},"end":{"line":211,"column":2},"skip":true},"3":{"start":{"line":13,"column":0},"end":{"line":13,"column":23},"skip":true},"4":{"start":{"line":14,"column":0},"end":{"line":101,"column":1},"skip":true},"5":{"start":{"line":15,"column":8},"end":{"line":15,"column":53},"skip":true},"6":{"start":{"line":15,"column":54},"end":{"line":15,"column":70},"skip":true},"7":{"start":{"line":16,"column":0},"end":{"line":16,"column":6},"skip":true},"8":{"start":{"line":17,"column":7},"end":{"line":17,"column":75},"skip":true},"9":{"start":{"line":18,"column":0},"end":{"line":18,"column":6},"skip":true},"10":{"start":{"line":19,"column":7},"end":{"line":19,"column":23},"skip":true},"11":{"start":{"line":20,"column":0},"end":{"line":20,"column":6},"skip":true},"12":{"start":{"line":21,"column":7},"end":{"line":21,"column":23},"skip":true},"13":{"start":{"line":22,"column":0},"end":{"line":22,"column":6},"skip":true},"14":{"start":{"line":23,"column":7},"end":{"line":23,"column":23},"skip":true},"15":{"start":{"line":24,"column":0},"end":{"line":24,"column":6},"skip":true},"16":{"start":{"line":25,"column":7},"end":{"line":25,"column":23},"skip":true},"17":{"start":{"line":26,"column":0},"end":{"line":26,"column":6},"skip":true},"18":{"start":{"line":27,"column":7},"end":{"line":27,"column":52},"skip":true},"19":{"start":{"line":28,"column":0},"end":{"line":28,"column":6},"skip":true},"20":{"start":{"line":29,"column":7},"end":{"line":29,"column":52},"skip":true},"21":{"start":{"line":30,"column":0},"end":{"line":30,"column":6},"skip":true},"22":{"start":{"line":31,"column":7},"end":{"line":31,"column":73},"skip":true},"23":{"start":{"line":32,"column":0},"end":{"line":32,"column":6},"skip":true},"24":{"start":{"line":33,"column":8},"end":{"line":33,"column":70},"skip":true},"25":{"start":{"line":34,"column":0},"end":{"line":34,"column":6},"skip":true},"26":{"start":{"line":35,"column":8},"end":{"line":35,"column":87},"skip":true},"27":{"start":{"line":36,"column":0},"end":{"line":36,"column":6},"skip":true},"28":{"start":{"line":37,"column":8},"end":{"line":37,"column":86},"skip":true},"29":{"start":{"line":38,"column":0},"end":{"line":38,"column":6},"skip":true},"30":{"start":{"line":39,"column":8},"end":{"line":39,"column":105},"skip":true},"31":{"start":{"line":40,"column":0},"end":{"line":40,"column":6},"skip":true},"32":{"start":{"line":41,"column":8},"end":{"line":41,"column":105},"skip":true},"33":{"start":{"line":42,"column":0},"end":{"line":42,"column":6},"skip":true},"34":{"start":{"line":43,"column":8},"end":{"line":43,"column":79},"skip":true},"35":{"start":{"line":44,"column":0},"end":{"line":44,"column":6},"skip":true},"36":{"start":{"line":45,"column":8},"end":{"line":45,"column":74},"skip":true},"37":{"start":{"line":46,"column":0},"end":{"line":46,"column":6},"skip":true},"38":{"start":{"line":47,"column":8},"end":{"line":47,"column":105},"skip":true},"39":{"start":{"line":48,"column":0},"end":{"line":48,"column":6},"skip":true},"40":{"start":{"line":49,"column":8},"end":{"line":49,"column":105},"skip":true},"41":{"start":{"line":50,"column":0},"end":{"line":50,"column":6},"skip":true},"42":{"start":{"line":51,"column":8},"end":{"line":51,"column":108},"skip":true},"43":{"start":{"line":52,"column":0},"end":{"line":52,"column":6},"skip":true},"44":{"start":{"line":53,"column":8},"end":{"line":53,"column":109},"skip":true},"45":{"start":{"line":54,"column":0},"end":{"line":54,"column":6},"skip":true},"46":{"start":{"line":55,"column":8},"end":{"line":55,"column":80},"skip":true},"47":{"start":{"line":56,"column":0},"end":{"line":56,"column":6},"skip":true},"48":{"start":{"line":57,"column":8},"end":{"line":57,"column":59},"skip":true},"49":{"start":{"line":58,"column":0},"end":{"line":58,"column":6},"skip":true},"50":{"start":{"line":59,"column":8},"end":{"line":59,"column":24},"skip":true},"51":{"start":{"line":60,"column":0},"end":{"line":60,"column":6},"skip":true},"52":{"start":{"line":61,"column":8},"end":{"line":61,"column":52},"skip":true},"53":{"start":{"line":62,"column":0},"end":{"line":62,"column":6},"skip":true},"54":{"start":{"line":63,"column":8},"end":{"line":63,"column":52},"skip":true},"55":{"start":{"line":64,"column":0},"end":{"line":64,"column":6},"skip":true},"56":{"start":{"line":65,"column":8},"end":{"line":65,"column":53},"skip":true},"57":{"start":{"line":66,"column":0},"end":{"line":66,"column":6},"skip":true},"58":{"start":{"line":67,"column":8},"end":{"line":67,"column":24},"skip":true},"59":{"start":{"line":68,"column":0},"end":{"line":68,"column":6},"skip":true},"60":{"start":{"line":69,"column":8},"end":{"line":69,"column":33},"skip":true},"61":{"start":{"line":69,"column":34},"end":{"line":69,"column":52},"skip":true},"62":{"start":{"line":70,"column":0},"end":{"line":70,"column":6},"skip":true},"63":{"start":{"line":71,"column":8},"end":{"line":71,"column":50},"skip":true},"64":{"start":{"line":72,"column":0},"end":{"line":72,"column":6},"skip":true},"65":{"start":{"line":73,"column":8},"end":{"line":73,"column":36},"skip":true},"66":{"start":{"line":74,"column":0},"end":{"line":74,"column":6},"skip":true},"67":{"start":{"line":75,"column":8},"end":{"line":75,"column":57},"skip":true},"68":{"start":{"line":76,"column":0},"end":{"line":76,"column":6},"skip":true},"69":{"start":{"line":77,"column":8},"end":{"line":77,"column":85},"skip":true},"70":{"start":{"line":78,"column":0},"end":{"line":78,"column":6},"skip":true},"71":{"start":{"line":79,"column":8},"end":{"line":79,"column":76},"skip":true},"72":{"start":{"line":80,"column":0},"end":{"line":80,"column":6},"skip":true},"73":{"start":{"line":81,"column":8},"end":{"line":81,"column":50},"skip":true},"74":{"start":{"line":82,"column":0},"end":{"line":82,"column":6},"skip":true},"75":{"start":{"line":83,"column":8},"end":{"line":83,"column":48},"skip":true},"76":{"start":{"line":84,"column":0},"end":{"line":84,"column":6},"skip":true},"77":{"start":{"line":85,"column":9},"end":{"line":85,"column":60},"skip":true},"78":{"start":{"line":85,"column":61},"end":{"line":85,"column":79},"skip":true},"79":{"start":{"line":86,"column":0},"end":{"line":86,"column":6},"skip":true},"80":{"start":{"line":87,"column":8},"end":{"line":87,"column":34},"skip":true},"81":{"start":{"line":88,"column":0},"end":{"line":88,"column":6},"skip":true},"82":{"start":{"line":89,"column":8},"end":{"line":89,"column":20},"skip":true},"83":{"start":{"line":90,"column":0},"end":{"line":90,"column":6},"skip":true},"84":{"start":{"line":91,"column":8},"end":{"line":91,"column":30},"skip":true},"85":{"start":{"line":92,"column":0},"end":{"line":92,"column":6},"skip":true},"86":{"start":{"line":93,"column":8},"end":{"line":93,"column":20},"skip":true},"87":{"start":{"line":94,"column":0},"end":{"line":94,"column":6},"skip":true},"88":{"start":{"line":95,"column":8},"end":{"line":95,"column":30},"skip":true},"89":{"start":{"line":96,"column":0},"end":{"line":96,"column":6},"skip":true},"90":{"start":{"line":97,"column":8},"end":{"line":97,"column":26},"skip":true},"91":{"start":{"line":98,"column":0},"end":{"line":98,"column":6},"skip":true},"92":{"start":{"line":99,"column":8},"end":{"line":99,"column":30},"skip":true},"93":{"start":{"line":100,"column":0},"end":{"line":100,"column":6},"skip":true},"94":{"start":{"line":106,"column":4},"end":{"line":106,"column":25},"skip":true},"95":{"start":{"line":109,"column":4},"end":{"line":109,"column":159},"skip":true},"96":{"start":{"line":110,"column":4},"end":{"line":110,"column":31},"skip":true},"97":{"start":{"line":111,"column":4},"end":{"line":111,"column":28},"skip":true},"98":{"start":{"line":112,"column":4},"end":{"line":112,"column":31},"skip":true},"99":{"start":{"line":113,"column":4},"end":{"line":113,"column":26},"skip":true},"100":{"start":{"line":114,"column":4},"end":{"line":115,"column":31},"skip":true},"101":{"start":{"line":115,"column":8},"end":{"line":115,"column":31},"skip":true},"102":{"start":{"line":116,"column":4},"end":{"line":116,"column":34},"skip":true},"103":{"start":{"line":117,"column":4},"end":{"line":117,"column":23},"skip":true},"104":{"start":{"line":118,"column":4},"end":{"line":118,"column":65},"skip":true},"105":{"start":{"line":119,"column":4},"end":{"line":120,"column":45},"skip":true},"106":{"start":{"line":120,"column":8},"end":{"line":120,"column":45},"skip":true},"107":{"start":{"line":121,"column":4},"end":{"line":125,"column":5},"skip":true},"108":{"start":{"line":122,"column":8},"end":{"line":122,"column":44},"skip":true},"109":{"start":{"line":123,"column":8},"end":{"line":123,"column":42},"skip":true},"110":{"start":{"line":124,"column":8},"end":{"line":124,"column":42},"skip":true},"111":{"start":{"line":126,"column":4},"end":{"line":133,"column":5},"skip":true},"112":{"start":{"line":127,"column":8},"end":{"line":127,"column":18},"skip":true},"113":{"start":{"line":128,"column":8},"end":{"line":128,"column":38},"skip":true},"114":{"start":{"line":129,"column":8},"end":{"line":131,"column":9},"skip":true},"115":{"start":{"line":130,"column":12},"end":{"line":130,"column":50},"skip":true},"116":{"start":{"line":132,"column":8},"end":{"line":132,"column":21},"skip":true},"117":{"start":{"line":134,"column":4},"end":{"line":134,"column":92},"skip":true},"118":{"start":{"line":135,"column":4},"end":{"line":208,"column":5},"skip":true},"119":{"start":{"line":136,"column":8},"end":{"line":136,"column":40},"skip":true},"120":{"start":{"line":137,"column":8},"end":{"line":144,"column":9},"skip":true},"121":{"start":{"line":138,"column":12},"end":{"line":138,"column":48},"skip":true},"122":{"start":{"line":140,"column":12},"end":{"line":142,"column":13},"skip":true},"123":{"start":{"line":141,"column":16},"end":{"line":141,"column":31},"skip":true},"124":{"start":{"line":143,"column":12},"end":{"line":143,"column":58},"skip":true},"125":{"start":{"line":145,"column":8},"end":{"line":160,"column":9},"skip":true},"126":{"start":{"line":146,"column":12},"end":{"line":146,"column":28},"skip":true},"127":{"start":{"line":147,"column":12},"end":{"line":159,"column":13},"skip":true},"128":{"start":{"line":148,"column":16},"end":{"line":148,"column":30},"skip":true},"129":{"start":{"line":149,"column":16},"end":{"line":152,"column":21},"skip":true},"130":{"start":{"line":150,"column":20},"end":{"line":152,"column":21},"skip":true},"131":{"start":{"line":151,"column":24},"end":{"line":151,"column":70},"skip":true},"132":{"start":{"line":153,"column":16},"end":{"line":157,"column":17},"skip":true},"133":{"start":{"line":154,"column":20},"end":{"line":154,"column":200},"skip":true},"134":{"start":{"line":156,"column":20},"end":{"line":156,"column":166},"skip":true},"135":{"start":{"line":158,"column":16},"end":{"line":158,"column":167},"skip":true},"136":{"start":{"line":161,"column":8},"end":{"line":163,"column":9},"skip":true},"137":{"start":{"line":162,"column":12},"end":{"line":162,"column":112},"skip":true},"138":{"start":{"line":164,"column":8},"end":{"line":207,"column":9},"skip":true},"139":{"start":{"line":166,"column":12},"end":{"line":166,"column":31},"skip":true},"140":{"start":{"line":167,"column":12},"end":{"line":167,"column":43},"skip":true},"141":{"start":{"line":168,"column":12},"end":{"line":168,"column":43},"skip":true},"142":{"start":{"line":169,"column":12},"end":{"line":169,"column":34},"skip":true},"143":{"start":{"line":170,"column":12},"end":{"line":170,"column":26},"skip":true},"144":{"start":{"line":171,"column":12},"end":{"line":181,"column":13},"skip":true},"145":{"start":{"line":172,"column":16},"end":{"line":172,"column":43},"skip":true},"146":{"start":{"line":173,"column":16},"end":{"line":173,"column":43},"skip":true},"147":{"start":{"line":174,"column":16},"end":{"line":174,"column":47},"skip":true},"148":{"start":{"line":175,"column":16},"end":{"line":175,"column":42},"skip":true},"149":{"start":{"line":176,"column":16},"end":{"line":177,"column":33},"skip":true},"150":{"start":{"line":177,"column":20},"end":{"line":177,"column":33},"skip":true},"151":{"start":{"line":179,"column":16},"end":{"line":179,"column":40},"skip":true},"152":{"start":{"line":180,"column":16},"end":{"line":180,"column":38},"skip":true},"153":{"start":{"line":182,"column":12},"end":{"line":182,"column":18},"skip":true},"154":{"start":{"line":184,"column":12},"end":{"line":184,"column":50},"skip":true},"155":{"start":{"line":185,"column":12},"end":{"line":185,"column":50},"skip":true},"156":{"start":{"line":186,"column":12},"end":{"line":186,"column":246},"skip":true},"157":{"start":{"line":187,"column":12},"end":{"line":189,"column":13},"skip":true},"158":{"start":{"line":188,"column":16},"end":{"line":188,"column":115},"skip":true},"159":{"start":{"line":190,"column":12},"end":{"line":190,"column":109},"skip":true},"160":{"start":{"line":191,"column":12},"end":{"line":193,"column":13},"skip":true},"161":{"start":{"line":192,"column":16},"end":{"line":192,"column":25},"skip":true},"162":{"start":{"line":194,"column":12},"end":{"line":198,"column":13},"skip":true},"163":{"start":{"line":195,"column":16},"end":{"line":195,"column":53},"skip":true},"164":{"start":{"line":196,"column":16},"end":{"line":196,"column":51},"skip":true},"165":{"start":{"line":197,"column":16},"end":{"line":197,"column":51},"skip":true},"166":{"start":{"line":199,"column":12},"end":{"line":199,"column":56},"skip":true},"167":{"start":{"line":200,"column":12},"end":{"line":200,"column":33},"skip":true},"168":{"start":{"line":201,"column":12},"end":{"line":201,"column":34},"skip":true},"169":{"start":{"line":202,"column":12},"end":{"line":202,"column":79},"skip":true},"170":{"start":{"line":203,"column":12},"end":{"line":203,"column":33},"skip":true},"171":{"start":{"line":204,"column":12},"end":{"line":204,"column":18},"skip":true},"172":{"start":{"line":206,"column":12},"end":{"line":206,"column":24},"skip":true},"173":{"start":{"line":209,"column":4},"end":{"line":209,"column":16},"skip":true},"174":{"start":{"line":213,"column":0},"end":{"line":496,"column":0},"skip":true},"175":{"start":{"line":214,"column":0},"end":{"line":379,"column":8},"skip":true},"176":{"start":{"line":216,"column":8},"end":{"line":220,"column":9},"skip":true},"177":{"start":{"line":217,"column":12},"end":{"line":217,"column":49},"skip":true},"178":{"start":{"line":219,"column":12},"end":{"line":219,"column":33},"skip":true},"179":{"start":{"line":223,"column":8},"end":{"line":223,"column":28},"skip":true},"180":{"start":{"line":224,"column":8},"end":{"line":224,"column":52},"skip":true},"181":{"start":{"line":225,"column":8},"end":{"line":225,"column":40},"skip":true},"182":{"start":{"line":226,"column":8},"end":{"line":226,"column":53},"skip":true},"183":{"start":{"line":227,"column":8},"end":{"line":227,"column":42},"skip":true},"184":{"start":{"line":228,"column":8},"end":{"line":228,"column":78},"skip":true},"185":{"start":{"line":229,"column":8},"end":{"line":229,"column":59},"skip":true},"186":{"start":{"line":229,"column":33},"end":{"line":229,"column":59},"skip":true},"187":{"start":{"line":230,"column":8},"end":{"line":230,"column":24},"skip":true},"188":{"start":{"line":231,"column":8},"end":{"line":231,"column":20},"skip":true},"189":{"start":{"line":234,"column":8},"end":{"line":234,"column":32},"skip":true},"190":{"start":{"line":235,"column":8},"end":{"line":235,"column":26},"skip":true},"191":{"start":{"line":236,"column":8},"end":{"line":236,"column":22},"skip":true},"192":{"start":{"line":237,"column":8},"end":{"line":237,"column":22},"skip":true},"193":{"start":{"line":238,"column":8},"end":{"line":238,"column":25},"skip":true},"194":{"start":{"line":239,"column":8},"end":{"line":239,"column":27},"skip":true},"195":{"start":{"line":240,"column":8},"end":{"line":240,"column":48},"skip":true},"196":{"start":{"line":241,"column":8},"end":{"line":246,"column":9},"skip":true},"197":{"start":{"line":242,"column":12},"end":{"line":242,"column":28},"skip":true},"198":{"start":{"line":243,"column":12},"end":{"line":243,"column":36},"skip":true},"199":{"start":{"line":245,"column":12},"end":{"line":245,"column":38},"skip":true},"200":{"start":{"line":247,"column":8},"end":{"line":247,"column":56},"skip":true},"201":{"start":{"line":247,"column":33},"end":{"line":247,"column":56},"skip":true},"202":{"start":{"line":249,"column":8},"end":{"line":249,"column":43},"skip":true},"203":{"start":{"line":250,"column":8},"end":{"line":250,"column":18},"skip":true},"204":{"start":{"line":253,"column":8},"end":{"line":253,"column":28},"skip":true},"205":{"start":{"line":254,"column":8},"end":{"line":254,"column":46},"skip":true},"206":{"start":{"line":256,"column":8},"end":{"line":256,"column":39},"skip":true},"207":{"start":{"line":257,"column":8},"end":{"line":257,"column":70},"skip":true},"208":{"start":{"line":259,"column":8},"end":{"line":259,"column":27},"skip":true},"209":{"start":{"line":260,"column":8},"end":{"line":260,"column":57},"skip":true},"210":{"start":{"line":261,"column":8},"end":{"line":261,"column":63},"skip":true},"211":{"start":{"line":262,"column":8},"end":{"line":262,"column":69},"skip":true},"212":{"start":{"line":264,"column":8},"end":{"line":264,"column":60},"skip":true},"213":{"start":{"line":264,"column":28},"end":{"line":264,"column":60},"skip":true},"214":{"start":{"line":265,"column":8},"end":{"line":265,"column":34},"skip":true},"215":{"start":{"line":267,"column":8},"end":{"line":273,"column":12},"skip":true},"216":{"start":{"line":275,"column":8},"end":{"line":277,"column":9},"skip":true},"217":{"start":{"line":276,"column":12},"end":{"line":276,"column":65},"skip":true},"218":{"start":{"line":278,"column":8},"end":{"line":278,"column":20},"skip":true},"219":{"start":{"line":281,"column":8},"end":{"line":281,"column":26},"skip":true},"220":{"start":{"line":282,"column":8},"end":{"line":282,"column":20},"skip":true},"221":{"start":{"line":285,"column":8},"end":{"line":285,"column":40},"skip":true},"222":{"start":{"line":288,"column":8},"end":{"line":288,"column":83},"skip":true},"223":{"start":{"line":289,"column":8},"end":{"line":289,"column":83},"skip":true},"224":{"start":{"line":292,"column":8},"end":{"line":292,"column":30},"skip":true},"225":{"start":{"line":293,"column":8},"end":{"line":295,"column":9},"skip":true},"226":{"start":{"line":294,"column":12},"end":{"line":294,"column":58},"skip":true},"227":{"start":{"line":296,"column":8},"end":{"line":296,"column":84},"skip":true},"228":{"start":{"line":299,"column":8},"end":{"line":299,"column":35},"skip":true},"229":{"start":{"line":300,"column":8},"end":{"line":300,"column":52},"skip":true},"230":{"start":{"line":301,"column":8},"end":{"line":301,"column":57},"skip":true},"231":{"start":{"line":304,"column":8},"end":{"line":306,"column":9},"skip":true},"232":{"start":{"line":305,"column":12},"end":{"line":305,"column":28},"skip":true},"233":{"start":{"line":307,"column":8},"end":{"line":307,"column":43},"skip":true},"234":{"start":{"line":307,"column":26},"end":{"line":307,"column":43},"skip":true},"235":{"start":{"line":309,"column":8},"end":{"line":314,"column":18},"skip":true},"236":{"start":{"line":315,"column":8},"end":{"line":318,"column":9},"skip":true},"237":{"start":{"line":316,"column":12},"end":{"line":316,"column":29},"skip":true},"238":{"start":{"line":317,"column":12},"end":{"line":317,"column":28},"skip":true},"239":{"start":{"line":319,"column":8},"end":{"line":319,"column":41},"skip":true},"240":{"start":{"line":320,"column":8},"end":{"line":327,"column":9},"skip":true},"241":{"start":{"line":321,"column":12},"end":{"line":321,"column":64},"skip":true},"242":{"start":{"line":322,"column":12},"end":{"line":326,"column":13},"skip":true},"243":{"start":{"line":323,"column":16},"end":{"line":323,"column":34},"skip":true},"244":{"start":{"line":324,"column":16},"end":{"line":324,"column":26},"skip":true},"245":{"start":{"line":325,"column":16},"end":{"line":325,"column":46},"skip":true},"246":{"start":{"line":325,"column":40},"end":{"line":325,"column":46},"skip":true},"247":{"start":{"line":328,"column":8},"end":{"line":349,"column":9},"skip":true},"248":{"start":{"line":329,"column":12},"end":{"line":329,"column":54},"skip":true},"249":{"start":{"line":330,"column":12},"end":{"line":330,"column":53},"skip":true},"250":{"start":{"line":330,"column":23},"end":{"line":330,"column":53},"skip":true},"251":{"start":{"line":331,"column":12},"end":{"line":334,"column":170},"skip":true},"252":{"start":{"line":335,"column":12},"end":{"line":335,"column":36},"skip":true},"253":{"start":{"line":336,"column":12},"end":{"line":336,"column":35},"skip":true},"254":{"start":{"line":337,"column":12},"end":{"line":337,"column":33},"skip":true},"255":{"start":{"line":338,"column":12},"end":{"line":338,"column":45},"skip":true},"256":{"start":{"line":339,"column":12},"end":{"line":341,"column":13},"skip":true},"257":{"start":{"line":340,"column":16},"end":{"line":340,"column":78},"skip":true},"258":{"start":{"line":342,"column":12},"end":{"line":342,"column":31},"skip":true},"259":{"start":{"line":343,"column":12},"end":{"line":343,"column":61},"skip":true},"260":{"start":{"line":344,"column":12},"end":{"line":344,"column":37},"skip":true},"261":{"start":{"line":345,"column":12},"end":{"line":345,"column":129},"skip":true},"262":{"start":{"line":346,"column":12},"end":{"line":346,"column":60},"skip":true},"263":{"start":{"line":346,"column":42},"end":{"line":346,"column":60},"skip":true},"264":{"start":{"line":347,"column":12},"end":{"line":348,"column":24},"skip":true},"265":{"start":{"line":347,"column":23},"end":{"line":347,"column":36},"skip":true},"266":{"start":{"line":348,"column":17},"end":{"line":348,"column":24},"skip":true},"267":{"start":{"line":350,"column":8},"end":{"line":355,"column":9},"skip":true},"268":{"start":{"line":351,"column":12},"end":{"line":351,"column":28},"skip":true},"269":{"start":{"line":353,"column":12},"end":{"line":354,"column":66},"skip":true},"270":{"start":{"line":358,"column":8},"end":{"line":358,"column":28},"skip":true},"271":{"start":{"line":359,"column":8},"end":{"line":363,"column":9},"skip":true},"272":{"start":{"line":360,"column":12},"end":{"line":360,"column":21},"skip":true},"273":{"start":{"line":362,"column":12},"end":{"line":362,"column":30},"skip":true},"274":{"start":{"line":366,"column":8},"end":{"line":366,"column":44},"skip":true},"275":{"start":{"line":369,"column":8},"end":{"line":369,"column":41},"skip":true},"276":{"start":{"line":372,"column":8},"end":{"line":372,"column":88},"skip":true},"277":{"start":{"line":375,"column":8},"end":{"line":375,"column":65},"skip":true},"278":{"start":{"line":378,"column":8},"end":{"line":378,"column":30},"skip":true},"279":{"start":{"line":380,"column":0},"end":{"line":380,"column":19},"skip":true},"280":{"start":{"line":381,"column":0},"end":{"line":492,"column":2},"skip":true},"281":{"start":{"line":384,"column":0},"end":{"line":386,"column":1},"skip":true},"282":{"start":{"line":385,"column":2},"end":{"line":385,"column":63},"skip":true},"283":{"start":{"line":389,"column":0},"end":{"line":390,"column":0},"skip":true},"284":{"start":{"line":390,"column":0},"end":{"line":491,"column":1},"skip":true},"285":{"start":{"line":392,"column":35},"end":{"line":400,"column":36},"skip":true},"286":{"start":{"line":393,"column":37},"end":{"line":393,"column":48},"skip":true},"287":{"start":{"line":394,"column":37},"end":{"line":394,"column":54},"skip":true},"288":{"start":{"line":395,"column":42},"end":{"line":400,"column":36},"skip":true},"289":{"start":{"line":396,"column":37},"end":{"line":396,"column":48},"skip":true},"290":{"start":{"line":397,"column":37},"end":{"line":397,"column":55},"skip":true},"291":{"start":{"line":399,"column":37},"end":{"line":399,"column":54},"skip":true},"292":{"start":{"line":401,"column":35},"end":{"line":401,"column":60},"skip":true},"293":{"start":{"line":401,"column":50},"end":{"line":401,"column":60},"skip":true},"294":{"start":{"line":403,"column":0},"end":{"line":403,"column":6},"skip":true},"295":{"start":{"line":404,"column":7},"end":{"line":404,"column":17},"skip":true},"296":{"start":{"line":405,"column":0},"end":{"line":405,"column":6},"skip":true},"297":{"start":{"line":407,"column":35},"end":{"line":407,"column":51},"skip":true},"298":{"start":{"line":408,"column":35},"end":{"line":408,"column":45},"skip":true},"299":{"start":{"line":410,"column":0},"end":{"line":410,"column":6},"skip":true},"300":{"start":{"line":412,"column":34},"end":{"line":412,"column":82},"skip":true},"301":{"start":{"line":413,"column":34},"end":{"line":413,"column":50},"skip":true},"302":{"start":{"line":414,"column":34},"end":{"line":414,"column":44},"skip":true},"303":{"start":{"line":416,"column":0},"end":{"line":416,"column":6},"skip":true},"304":{"start":{"line":417,"column":8},"end":{"line":417,"column":18},"skip":true},"305":{"start":{"line":418,"column":0},"end":{"line":418,"column":6},"skip":true},"306":{"start":{"line":419,"column":7},"end":{"line":419,"column":18},"skip":true},"307":{"start":{"line":419,"column":19},"end":{"line":419,"column":35},"skip":true},"308":{"start":{"line":419,"column":36},"end":{"line":419,"column":46},"skip":true},"309":{"start":{"line":420,"column":0},"end":{"line":420,"column":6},"skip":true},"310":{"start":{"line":421,"column":7},"end":{"line":421,"column":17},"skip":true},"311":{"start":{"line":422,"column":0},"end":{"line":422,"column":6},"skip":true},"312":{"start":{"line":423,"column":7},"end":{"line":423,"column":17},"skip":true},"313":{"start":{"line":424,"column":0},"end":{"line":424,"column":6},"skip":true},"314":{"start":{"line":425,"column":8},"end":{"line":425,"column":18},"skip":true},"315":{"start":{"line":426,"column":0},"end":{"line":426,"column":6},"skip":true},"316":{"start":{"line":428,"column":34},"end":{"line":428,"column":50},"skip":true},"317":{"start":{"line":429,"column":34},"end":{"line":429,"column":52},"skip":true},"318":{"start":{"line":430,"column":34},"end":{"line":430,"column":44},"skip":true},"319":{"start":{"line":432,"column":0},"end":{"line":432,"column":6},"skip":true},"320":{"start":{"line":433,"column":8},"end":{"line":433,"column":18},"skip":true},"321":{"start":{"line":434,"column":0},"end":{"line":434,"column":6},"skip":true},"322":{"start":{"line":435,"column":8},"end":{"line":435,"column":18},"skip":true},"323":{"start":{"line":436,"column":0},"end":{"line":436,"column":6},"skip":true},"324":{"start":{"line":437,"column":8},"end":{"line":437,"column":18},"skip":true},"325":{"start":{"line":438,"column":0},"end":{"line":438,"column":6},"skip":true},"326":{"start":{"line":439,"column":8},"end":{"line":439,"column":24},"skip":true},"327":{"start":{"line":439,"column":25},"end":{"line":439,"column":35},"skip":true},"328":{"start":{"line":440,"column":0},"end":{"line":440,"column":6},"skip":true},"329":{"start":{"line":441,"column":8},"end":{"line":441,"column":24},"skip":true},"330":{"start":{"line":441,"column":25},"end":{"line":441,"column":35},"skip":true},"331":{"start":{"line":442,"column":0},"end":{"line":442,"column":6},"skip":true},"332":{"start":{"line":443,"column":8},"end":{"line":443,"column":18},"skip":true},"333":{"start":{"line":444,"column":0},"end":{"line":444,"column":6},"skip":true},"334":{"start":{"line":445,"column":8},"end":{"line":445,"column":18},"skip":true},"335":{"start":{"line":446,"column":0},"end":{"line":446,"column":6},"skip":true},"336":{"start":{"line":447,"column":8},"end":{"line":447,"column":18},"skip":true},"337":{"start":{"line":448,"column":0},"end":{"line":448,"column":6},"skip":true},"338":{"start":{"line":449,"column":8},"end":{"line":449,"column":18},"skip":true},"339":{"start":{"line":450,"column":0},"end":{"line":450,"column":6},"skip":true},"340":{"start":{"line":451,"column":8},"end":{"line":451,"column":24},"skip":true},"341":{"start":{"line":451,"column":25},"end":{"line":451,"column":43},"skip":true},"342":{"start":{"line":452,"column":0},"end":{"line":452,"column":6},"skip":true},"343":{"start":{"line":453,"column":8},"end":{"line":453,"column":19},"skip":true},"344":{"start":{"line":453,"column":20},"end":{"line":453,"column":36},"skip":true},"345":{"start":{"line":453,"column":37},"end":{"line":453,"column":47},"skip":true},"346":{"start":{"line":454,"column":0},"end":{"line":454,"column":6},"skip":true},"347":{"start":{"line":455,"column":8},"end":{"line":455,"column":18},"skip":true},"348":{"start":{"line":456,"column":0},"end":{"line":456,"column":6},"skip":true},"349":{"start":{"line":457,"column":8},"end":{"line":457,"column":18},"skip":true},"350":{"start":{"line":458,"column":0},"end":{"line":458,"column":6},"skip":true},"351":{"start":{"line":459,"column":8},"end":{"line":459,"column":18},"skip":true},"352":{"start":{"line":460,"column":0},"end":{"line":460,"column":6},"skip":true},"353":{"start":{"line":461,"column":8},"end":{"line":461,"column":18},"skip":true},"354":{"start":{"line":462,"column":0},"end":{"line":462,"column":6},"skip":true},"355":{"start":{"line":463,"column":8},"end":{"line":463,"column":18},"skip":true},"356":{"start":{"line":464,"column":0},"end":{"line":464,"column":6},"skip":true},"357":{"start":{"line":466,"column":0},"end":{"line":466,"column":6},"skip":true},"358":{"start":{"line":467,"column":8},"end":{"line":467,"column":24},"skip":true},"359":{"start":{"line":467,"column":25},"end":{"line":467,"column":35},"skip":true},"360":{"start":{"line":468,"column":0},"end":{"line":468,"column":6},"skip":true},"361":{"start":{"line":469,"column":8},"end":{"line":469,"column":24},"skip":true},"362":{"start":{"line":469,"column":25},"end":{"line":469,"column":35},"skip":true},"363":{"start":{"line":470,"column":0},"end":{"line":470,"column":6},"skip":true},"364":{"start":{"line":471,"column":8},"end":{"line":471,"column":52},"skip":true},"365":{"start":{"line":471,"column":53},"end":{"line":471,"column":63},"skip":true},"366":{"start":{"line":472,"column":0},"end":{"line":472,"column":6},"skip":true},"367":{"start":{"line":473,"column":8},"end":{"line":473,"column":52},"skip":true},"368":{"start":{"line":473,"column":53},"end":{"line":473,"column":63},"skip":true},"369":{"start":{"line":474,"column":0},"end":{"line":474,"column":6},"skip":true},"370":{"start":{"line":475,"column":8},"end":{"line":475,"column":18},"skip":true},"371":{"start":{"line":476,"column":0},"end":{"line":476,"column":6},"skip":true},"372":{"start":{"line":477,"column":8},"end":{"line":477,"column":18},"skip":true},"373":{"start":{"line":478,"column":0},"end":{"line":478,"column":6},"skip":true},"374":{"start":{"line":479,"column":8},"end":{"line":479,"column":18},"skip":true},"375":{"start":{"line":480,"column":0},"end":{"line":480,"column":6},"skip":true},"376":{"start":{"line":481,"column":8},"end":{"line":481,"column":18},"skip":true},"377":{"start":{"line":482,"column":0},"end":{"line":482,"column":6},"skip":true},"378":{"start":{"line":483,"column":8},"end":{"line":483,"column":18},"skip":true},"379":{"start":{"line":484,"column":0},"end":{"line":484,"column":6},"skip":true},"380":{"start":{"line":485,"column":8},"end":{"line":485,"column":32},"skip":true},"381":{"start":{"line":485,"column":33},"end":{"line":485,"column":43},"skip":true},"382":{"start":{"line":486,"column":0},"end":{"line":486,"column":6},"skip":true},"383":{"start":{"line":487,"column":8},"end":{"line":487,"column":25},"skip":true},"384":{"start":{"line":488,"column":0},"end":{"line":488,"column":6},"skip":true},"385":{"start":{"line":489,"column":8},"end":{"line":489,"column":17},"skip":true},"386":{"start":{"line":490,"column":0},"end":{"line":490,"column":6},"skip":true},"387":{"start":{"line":493,"column":0},"end":{"line":493,"column":879},"skip":true},"388":{"start":{"line":494,"column":0},"end":{"line":494,"column":313},"skip":true},"389":{"start":{"line":495,"column":0},"end":{"line":495,"column":13},"skip":true},"390":{"start":{"line":496,"column":0},"end":{"line":496,"column":21},"skip":true},"391":{"start":{"line":497,"column":0},"end":{"line":497,"column":36},"skip":true},"392":{"start":{"line":497,"column":21},"end":{"line":497,"column":34},"skip":true},"393":{"start":{"line":497,"column":36},"end":{"line":497,"column":62},"skip":true},"394":{"start":{"line":497,"column":62},"end":{"line":497,"column":85},"skip":true},"395":{"start":{"line":498,"column":0},"end":{"line":498,"column":18},"skip":true},"396":{"start":{"line":499,"column":5},"end":{"line":499,"column":37}}},"branchMap":{"1":{"line":14,"type":"switch","locations":[{"start":{"line":15,"column":0},"end":{"line":16,"column":6},"skip":true},{"start":{"line":17,"column":0},"end":{"line":18,"column":6},"skip":true},{"start":{"line":19,"column":0},"end":{"line":20,"column":6},"skip":true},{"start":{"line":21,"column":0},"end":{"line":22,"column":6},"skip":true},{"start":{"line":23,"column":0},"end":{"line":24,"column":6},"skip":true},{"start":{"line":25,"column":0},"end":{"line":26,"column":6},"skip":true},{"start":{"line":27,"column":0},"end":{"line":28,"column":6},"skip":true},{"start":{"line":29,"column":0},"end":{"line":30,"column":6},"skip":true},{"start":{"line":31,"column":0},"end":{"line":32,"column":6},"skip":true},{"start":{"line":33,"column":0},"end":{"line":34,"column":6},"skip":true},{"start":{"line":35,"column":0},"end":{"line":36,"column":6},"skip":true},{"start":{"line":37,"column":0},"end":{"line":38,"column":6},"skip":true},{"start":{"line":39,"column":0},"end":{"line":40,"column":6},"skip":true},{"start":{"line":41,"column":0},"end":{"line":42,"column":6},"skip":true},{"start":{"line":43,"column":0},"end":{"line":44,"column":6},"skip":true},{"start":{"line":45,"column":0},"end":{"line":46,"column":6},"skip":true},{"start":{"line":47,"column":0},"end":{"line":48,"column":6},"skip":true},{"start":{"line":49,"column":0},"end":{"line":50,"column":6},"skip":true},{"start":{"line":51,"column":0},"end":{"line":52,"column":6},"skip":true},{"start":{"line":53,"column":0},"end":{"line":54,"column":6},"skip":true},{"start":{"line":55,"column":0},"end":{"line":56,"column":6},"skip":true},{"start":{"line":57,"column":0},"end":{"line":58,"column":6},"skip":true},{"start":{"line":59,"column":0},"end":{"line":60,"column":6},"skip":true},{"start":{"line":61,"column":0},"end":{"line":62,"column":6},"skip":true},{"start":{"line":63,"column":0},"end":{"line":64,"column":6},"skip":true},{"start":{"line":65,"column":0},"end":{"line":66,"column":6},"skip":true},{"start":{"line":67,"column":0},"end":{"line":68,"column":6},"skip":true},{"start":{"line":69,"column":0},"end":{"line":70,"column":6},"skip":true},{"start":{"line":71,"column":0},"end":{"line":72,"column":6},"skip":true},{"start":{"line":73,"column":0},"end":{"line":74,"column":6},"skip":true},{"start":{"line":75,"column":0},"end":{"line":76,"column":6},"skip":true},{"start":{"line":77,"column":0},"end":{"line":78,"column":6},"skip":true},{"start":{"line":79,"column":0},"end":{"line":80,"column":6},"skip":true},{"start":{"line":81,"column":0},"end":{"line":82,"column":6},"skip":true},{"start":{"line":83,"column":0},"end":{"line":84,"column":6},"skip":true},{"start":{"line":85,"column":0},"end":{"line":86,"column":6},"skip":true},{"start":{"line":87,"column":0},"end":{"line":88,"column":6},"skip":true},{"start":{"line":89,"column":0},"end":{"line":90,"column":6},"skip":true},{"start":{"line":91,"column":0},"end":{"line":92,"column":6},"skip":true},{"start":{"line":93,"column":0},"end":{"line":94,"column":6},"skip":true},{"start":{"line":95,"column":0},"end":{"line":96,"column":6},"skip":true},{"start":{"line":97,"column":0},"end":{"line":98,"column":6},"skip":true},{"start":{"line":99,"column":0},"end":{"line":100,"column":6},"skip":true}]},"2":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":4},"end":{"line":114,"column":4},"skip":true},{"start":{"line":114,"column":4},"end":{"line":114,"column":4},"skip":true}]},"3":{"line":118,"type":"binary-expr","locations":[{"start":{"line":118,"column":17},"end":{"line":118,"column":35},"skip":true},{"start":{"line":118,"column":39},"end":{"line":118,"column":64},"skip":true}]},"4":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":4},"end":{"line":119,"column":4},"skip":true},{"start":{"line":119,"column":4},"end":{"line":119,"column":4},"skip":true}]},"5":{"line":128,"type":"binary-expr","locations":[{"start":{"line":128,"column":16},"end":{"line":128,"column":32},"skip":true},{"start":{"line":128,"column":36},"end":{"line":128,"column":37},"skip":true}]},"6":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":8},"end":{"line":129,"column":8},"skip":true},{"start":{"line":129,"column":8},"end":{"line":129,"column":8},"skip":true}]},"7":{"line":130,"type":"binary-expr","locations":[{"start":{"line":130,"column":20},"end":{"line":130,"column":40},"skip":true},{"start":{"line":130,"column":44},"end":{"line":130,"column":49},"skip":true}]},"8":{"line":137,"type":"if","locations":[{"start":{"line":137,"column":8},"end":{"line":137,"column":8},"skip":true},{"start":{"line":137,"column":8},"end":{"line":137,"column":8},"skip":true}]},"9":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":12},"end":{"line":140,"column":12},"skip":true},{"start":{"line":140,"column":12},"end":{"line":140,"column":12},"skip":true}]},"10":{"line":140,"type":"binary-expr","locations":[{"start":{"line":140,"column":16},"end":{"line":140,"column":31},"skip":true},{"start":{"line":140,"column":35},"end":{"line":140,"column":63},"skip":true}]},"11":{"line":143,"type":"binary-expr","locations":[{"start":{"line":143,"column":21},"end":{"line":143,"column":33},"skip":true},{"start":{"line":143,"column":37},"end":{"line":143,"column":57},"skip":true}]},"12":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8},"skip":true},{"start":{"line":145,"column":8},"end":{"line":145,"column":8},"skip":true}]},"13":{"line":145,"type":"binary-expr","locations":[{"start":{"line":145,"column":12},"end":{"line":145,"column":41},"skip":true},{"start":{"line":145,"column":45},"end":{"line":145,"column":59},"skip":true},{"start":{"line":145,"column":63},"end":{"line":145,"column":73},"skip":true}]},"14":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":12},"end":{"line":147,"column":12},"skip":true},{"start":{"line":147,"column":12},"end":{"line":147,"column":12},"skip":true}]},"15":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":20},"end":{"line":150,"column":20},"skip":true},{"start":{"line":150,"column":20},"end":{"line":150,"column":20},"skip":true}]},"16":{"line":150,"type":"binary-expr","locations":[{"start":{"line":150,"column":24},"end":{"line":150,"column":42},"skip":true},{"start":{"line":150,"column":46},"end":{"line":150,"column":51},"skip":true}]},"17":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":16},"end":{"line":153,"column":16},"skip":true},{"start":{"line":153,"column":16},"end":{"line":153,"column":16},"skip":true}]},"18":{"line":154,"type":"binary-expr","locations":[{"start":{"line":154,"column":159},"end":{"line":154,"column":182},"skip":true},{"start":{"line":154,"column":186},"end":{"line":154,"column":192},"skip":true}]},"19":{"line":156,"type":"cond-expr","locations":[{"start":{"line":156,"column":102},"end":{"line":156,"column":116},"skip":true},{"start":{"line":156,"column":117},"end":{"line":156,"column":164},"skip":true}]},"20":{"line":156,"type":"binary-expr","locations":[{"start":{"line":156,"column":124},"end":{"line":156,"column":147},"skip":true},{"start":{"line":156,"column":151},"end":{"line":156,"column":157},"skip":true}]},"21":{"line":158,"type":"binary-expr","locations":[{"start":{"line":158,"column":72},"end":{"line":158,"column":95},"skip":true},{"start":{"line":158,"column":99},"end":{"line":158,"column":105},"skip":true}]},"22":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8},"skip":true},{"start":{"line":161,"column":8},"end":{"line":161,"column":8},"skip":true}]},"23":{"line":161,"type":"binary-expr","locations":[{"start":{"line":161,"column":12},"end":{"line":161,"column":38},"skip":true},{"start":{"line":161,"column":42},"end":{"line":161,"column":59},"skip":true}]},"24":{"line":164,"type":"switch","locations":[{"start":{"line":165,"column":8},"end":{"line":182,"column":18},"skip":true},{"start":{"line":183,"column":8},"end":{"line":204,"column":18},"skip":true},{"start":{"line":205,"column":8},"end":{"line":206,"column":24},"skip":true}]},"25":{"line":171,"type":"if","locations":[{"start":{"line":171,"column":12},"end":{"line":171,"column":12},"skip":true},{"start":{"line":171,"column":12},"end":{"line":171,"column":12},"skip":true}]},"26":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":16},"end":{"line":176,"column":16},"skip":true},{"start":{"line":176,"column":16},"end":{"line":176,"column":16},"skip":true}]},"27":{"line":186,"type":"binary-expr","locations":[{"start":{"line":186,"column":60},"end":{"line":186,"column":63},"skip":true},{"start":{"line":186,"column":67},"end":{"line":186,"column":68},"skip":true}]},"28":{"line":186,"type":"binary-expr","locations":[{"start":{"line":186,"column":169},"end":{"line":186,"column":172},"skip":true},{"start":{"line":186,"column":176},"end":{"line":186,"column":177},"skip":true}]},"29":{"line":187,"type":"if","locations":[{"start":{"line":187,"column":12},"end":{"line":187,"column":12},"skip":true},{"start":{"line":187,"column":12},"end":{"line":187,"column":12},"skip":true}]},"30":{"line":188,"type":"binary-expr","locations":[{"start":{"line":188,"column":58},"end":{"line":188,"column":61},"skip":true},{"start":{"line":188,"column":65},"end":{"line":188,"column":66},"skip":true}]},"31":{"line":191,"type":"if","locations":[{"start":{"line":191,"column":12},"end":{"line":191,"column":12},"skip":true},{"start":{"line":191,"column":12},"end":{"line":191,"column":12},"skip":true}]},"32":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":12},"end":{"line":194,"column":12},"skip":true},{"start":{"line":194,"column":12},"end":{"line":194,"column":12},"skip":true}]},"33":{"line":216,"type":"if","locations":[{"start":{"line":216,"column":8},"end":{"line":216,"column":8},"skip":true},{"start":{"line":216,"column":8},"end":{"line":216,"column":8},"skip":true}]},"34":{"line":229,"type":"if","locations":[{"start":{"line":229,"column":8},"end":{"line":229,"column":8},"skip":true},{"start":{"line":229,"column":8},"end":{"line":229,"column":8},"skip":true}]},"35":{"line":241,"type":"if","locations":[{"start":{"line":241,"column":8},"end":{"line":241,"column":8},"skip":true},{"start":{"line":241,"column":8},"end":{"line":241,"column":8},"skip":true}]},"36":{"line":247,"type":"if","locations":[{"start":{"line":247,"column":8},"end":{"line":247,"column":8},"skip":true},{"start":{"line":247,"column":8},"end":{"line":247,"column":8},"skip":true}]},"37":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8},"skip":true},{"start":{"line":264,"column":8},"end":{"line":264,"column":8},"skip":true}]},"38":{"line":270,"type":"cond-expr","locations":[{"start":{"line":271,"column":14},"end":{"line":271,"column":147},"skip":true},{"start":{"line":272,"column":14},"end":{"line":272,"column":44},"skip":true}]},"39":{"line":271,"type":"cond-expr","locations":[{"start":{"line":271,"column":50},"end":{"line":271,"column":74},"skip":true},{"start":{"line":271,"column":77},"end":{"line":271,"column":78},"skip":true}]},"40":{"line":275,"type":"if","locations":[{"start":{"line":275,"column":8},"end":{"line":275,"column":8},"skip":true},{"start":{"line":275,"column":8},"end":{"line":275,"column":8},"skip":true}]},"41":{"line":289,"type":"cond-expr","locations":[{"start":{"line":289,"column":35},"end":{"line":289,"column":40},"skip":true},{"start":{"line":289,"column":41},"end":{"line":289,"column":43},"skip":true}]},"42":{"line":293,"type":"if","locations":[{"start":{"line":293,"column":8},"end":{"line":293,"column":8},"skip":true},{"start":{"line":293,"column":8},"end":{"line":293,"column":8},"skip":true}]},"43":{"line":296,"type":"cond-expr","locations":[{"start":{"line":296,"column":54},"end":{"line":296,"column":59},"skip":true},{"start":{"line":296,"column":60},"end":{"line":296,"column":62},"skip":true}]},"44":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":8},"end":{"line":304,"column":8},"skip":true},{"start":{"line":304,"column":8},"end":{"line":304,"column":8},"skip":true}]},"45":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8},"skip":true},{"start":{"line":307,"column":8},"end":{"line":307,"column":8},"skip":true}]},"46":{"line":315,"type":"if","locations":[{"start":{"line":315,"column":8},"end":{"line":315,"column":8},"skip":true},{"start":{"line":315,"column":8},"end":{"line":315,"column":8},"skip":true}]},"47":{"line":322,"type":"if","locations":[{"start":{"line":322,"column":12},"end":{"line":322,"column":12},"skip":true},{"start":{"line":322,"column":12},"end":{"line":322,"column":12},"skip":true}]},"48":{"line":322,"type":"binary-expr","locations":[{"start":{"line":322,"column":16},"end":{"line":322,"column":25},"skip":true},{"start":{"line":322,"column":30},"end":{"line":322,"column":36},"skip":true},{"start":{"line":322,"column":40},"end":{"line":322,"column":77},"skip":true}]},"49":{"line":325,"type":"if","locations":[{"start":{"line":325,"column":16},"end":{"line":325,"column":16},"skip":true},{"start":{"line":325,"column":16},"end":{"line":325,"column":16},"skip":true}]},"50":{"line":328,"type":"if","locations":[{"start":{"line":328,"column":8},"end":{"line":328,"column":8},"skip":true},{"start":{"line":328,"column":8},"end":{"line":328,"column":8},"skip":true}]},"51":{"line":330,"type":"if","locations":[{"start":{"line":330,"column":12},"end":{"line":330,"column":12},"skip":true},{"start":{"line":330,"column":12},"end":{"line":330,"column":12},"skip":true}]},"52":{"line":334,"type":"cond-expr","locations":[{"start":{"line":334,"column":48},"end":{"line":334,"column":124},"skip":true},{"start":{"line":334,"column":127},"end":{"line":334,"column":168},"skip":true}]},"53":{"line":339,"type":"if","locations":[{"start":{"line":339,"column":12},"end":{"line":339,"column":12},"skip":true},{"start":{"line":339,"column":12},"end":{"line":339,"column":12},"skip":true}]},"54":{"line":346,"type":"if","locations":[{"start":{"line":346,"column":12},"end":{"line":346,"column":12},"skip":true},{"start":{"line":346,"column":12},"end":{"line":346,"column":12},"skip":true}]},"55":{"line":346,"type":"binary-expr","locations":[{"start":{"line":346,"column":16},"end":{"line":346,"column":25},"skip":true},{"start":{"line":346,"column":29},"end":{"line":346,"column":40},"skip":true}]},"56":{"line":347,"type":"if","locations":[{"start":{"line":347,"column":12},"end":{"line":347,"column":12},"skip":true},{"start":{"line":347,"column":12},"end":{"line":347,"column":12},"skip":true}]},"57":{"line":350,"type":"if","locations":[{"start":{"line":350,"column":8},"end":{"line":350,"column":8},"skip":true},{"start":{"line":350,"column":8},"end":{"line":350,"column":8},"skip":true}]},"58":{"line":359,"type":"if","locations":[{"start":{"line":359,"column":8},"end":{"line":359,"column":8},"skip":true},{"start":{"line":359,"column":8},"end":{"line":359,"column":8},"skip":true}]},"59":{"line":390,"type":"switch","locations":[{"start":{"line":391,"column":0},"end":{"line":403,"column":6},"skip":true},{"start":{"line":404,"column":0},"end":{"line":405,"column":6},"skip":true},{"start":{"line":406,"column":0},"end":{"line":410,"column":6},"skip":true},{"start":{"line":411,"column":0},"end":{"line":416,"column":6},"skip":true},{"start":{"line":417,"column":0},"end":{"line":418,"column":6},"skip":true},{"start":{"line":419,"column":0},"end":{"line":420,"column":6},"skip":true},{"start":{"line":421,"column":0},"end":{"line":422,"column":6},"skip":true},{"start":{"line":423,"column":0},"end":{"line":424,"column":6},"skip":true},{"start":{"line":425,"column":0},"end":{"line":426,"column":6},"skip":true},{"start":{"line":427,"column":0},"end":{"line":432,"column":6},"skip":true},{"start":{"line":433,"column":0},"end":{"line":434,"column":6},"skip":true},{"start":{"line":435,"column":0},"end":{"line":436,"column":6},"skip":true},{"start":{"line":437,"column":0},"end":{"line":438,"column":6},"skip":true},{"start":{"line":439,"column":0},"end":{"line":440,"column":6},"skip":true},{"start":{"line":441,"column":0},"end":{"line":442,"column":6},"skip":true},{"start":{"line":443,"column":0},"end":{"line":444,"column":6},"skip":true},{"start":{"line":445,"column":0},"end":{"line":446,"column":6},"skip":true},{"start":{"line":447,"column":0},"end":{"line":448,"column":6},"skip":true},{"start":{"line":449,"column":0},"end":{"line":450,"column":6},"skip":true},{"start":{"line":451,"column":0},"end":{"line":452,"column":6},"skip":true},{"start":{"line":453,"column":0},"end":{"line":454,"column":6},"skip":true},{"start":{"line":455,"column":0},"end":{"line":456,"column":6},"skip":true},{"start":{"line":457,"column":0},"end":{"line":458,"column":6},"skip":true},{"start":{"line":459,"column":0},"end":{"line":460,"column":6},"skip":true},{"start":{"line":461,"column":0},"end":{"line":462,"column":6},"skip":true},{"start":{"line":463,"column":0},"end":{"line":464,"column":6},"skip":true},{"start":{"line":465,"column":0},"end":{"line":466,"column":6},"skip":true},{"start":{"line":467,"column":0},"end":{"line":468,"column":6},"skip":true},{"start":{"line":469,"column":0},"end":{"line":470,"column":6},"skip":true},{"start":{"line":471,"column":0},"end":{"line":472,"column":6},"skip":true},{"start":{"line":473,"column":0},"end":{"line":474,"column":6},"skip":true},{"start":{"line":475,"column":0},"end":{"line":476,"column":6},"skip":true},{"start":{"line":477,"column":0},"end":{"line":478,"column":6},"skip":true},{"start":{"line":479,"column":0},"end":{"line":480,"column":6},"skip":true},{"start":{"line":481,"column":0},"end":{"line":482,"column":6},"skip":true},{"start":{"line":483,"column":0},"end":{"line":484,"column":6},"skip":true},{"start":{"line":485,"column":0},"end":{"line":486,"column":6},"skip":true},{"start":{"line":487,"column":0},"end":{"line":488,"column":6},"skip":true},{"start":{"line":489,"column":0},"end":{"line":490,"column":6},"skip":true}]},"60":{"line":392,"type":"if","locations":[{"start":{"line":392,"column":35},"end":{"line":392,"column":35},"skip":true},{"start":{"line":392,"column":35},"end":{"line":392,"column":35},"skip":true}]},"61":{"line":395,"type":"if","locations":[{"start":{"line":395,"column":42},"end":{"line":395,"column":42},"skip":true},{"start":{"line":395,"column":42},"end":{"line":395,"column":42},"skip":true}]},"62":{"line":401,"type":"if","locations":[{"start":{"line":401,"column":35},"end":{"line":401,"column":35},"skip":true},{"start":{"line":401,"column":35},"end":{"line":401,"column":35},"skip":true}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/helpers.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/helpers.js","s":{"1":1,"2":1,"3":2323,"4":1,"5":1,"6":603,"7":2,"8":601,"9":601,"10":601,"11":34,"12":601,"13":62,"14":62,"15":22,"16":62,"17":22,"18":62,"19":18,"20":62,"21":17,"22":17,"23":539,"24":14,"25":601,"26":80,"27":521,"28":1,"29":1,"30":2718,"31":5434,"32":5434,"33":2583,"34":2851,"35":2851,"36":72,"37":2851,"38":64,"39":2851,"40":63,"41":63,"42":20,"43":11,"44":2851,"45":109,"46":109,"47":2851,"48":115,"49":115,"50":2718,"51":1,"52":1,"53":3514,"54":663,"55":3514,"56":3514,"57":1480,"58":2034,"59":1712,"60":1,"61":3469,"62":618,"63":3469,"64":3469,"65":1401,"66":2068,"67":1729,"68":1,"69":432,"70":432,"71":150,"72":282,"73":282,"74":282,"75":1,"76":422,"77":422,"78":90,"79":332,"80":332,"81":332,"82":332},"b":{"1":[2,601],"2":[601,62],"3":[601,539],"4":[34,567],"5":[62,539],"6":[22,40],"7":[22,40],"8":[18,44],"9":[17,45],"10":[62,17],"11":[14,525],"12":[80,521],"13":[2583,2851],"14":[2851,143],"15":[2851,143],"16":[2851,236,73],"17":[72,2779],"18":[64,2787],"19":[63,2788],"20":[20,43],"21":[11,9],"22":[11,0],"23":[109,2742],"24":[109,28],"25":[115,2736],"26":[115,59],"27":[663,2851],"28":[1480,2034],"29":[1712,322],"30":[1353,359],"31":[1712,1125],"32":[618,2851],"33":[1401,2068],"34":[1729,339],"35":[1344,385],"36":[1729,1170],"37":[182,250],"38":[150,282],"39":[432,395,395,267],"40":[128,154],"41":[186,236],"42":[90,332],"43":[422,386,386,268],"44":[118,214]},"f":{"1":2323,"2":603,"3":2718,"4":3514,"5":3469,"6":432,"7":422},"fnMap":{"1":{"name":"stripFlags","line":4,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":33}}},"2":{"name":"prepareBlock","line":12,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":86}}},"3":{"name":"prepareProgram","line":68,"loc":{"start":{"line":68,"column":0},"end":{"line":68,"column":44}}},"4":{"name":"isPrevWhitespace","line":118,"loc":{"start":{"line":118,"column":40},"end":{"line":118,"column":89}}},"5":{"name":"isNextWhitespace","line":135,"loc":{"start":{"line":135,"column":0},"end":{"line":135,"column":49}}},"6":{"name":"omitRight","line":158,"loc":{"start":{"line":158,"column":0},"end":{"line":158,"column":44}}},"7":{"name":"omitLeft","line":176,"loc":{"start":{"line":176,"column":0},"end":{"line":176,"column":43}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":51}},"2":{"start":{"line":4,"column":0},"end":{"line":9,"column":1}},"3":{"start":{"line":5,"column":2},"end":{"line":8,"column":4}},"4":{"start":{"line":11,"column":0},"end":{"line":11,"column":32}},"5":{"start":{"line":12,"column":0},"end":{"line":65,"column":1}},"6":{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},"7":{"start":{"line":15,"column":4},"end":{"line":15,"column":105}},"8":{"start":{"line":18,"column":2},"end":{"line":18,"column":63}},"9":{"start":{"line":20,"column":2},"end":{"line":28,"column":4}},"10":{"start":{"line":30,"column":2},"end":{"line":32,"column":3}},"11":{"start":{"line":31,"column":4},"end":{"line":31,"column":46}},"12":{"start":{"line":34,"column":2},"end":{"line":58,"column":3}},"13":{"start":{"line":35,"column":4},"end":{"line":35,"column":47}},"14":{"start":{"line":37,"column":4},"end":{"line":39,"column":5}},"15":{"start":{"line":38,"column":6},"end":{"line":38,"column":47}},"16":{"start":{"line":40,"column":4},"end":{"line":42,"column":5}},"17":{"start":{"line":41,"column":6},"end":{"line":41,"column":48}},"18":{"start":{"line":43,"column":4},"end":{"line":45,"column":5}},"19":{"start":{"line":44,"column":6},"end":{"line":44,"column":47}},"20":{"start":{"line":48,"column":4},"end":{"line":53,"column":5}},"21":{"start":{"line":51,"column":6},"end":{"line":51,"column":35}},"22":{"start":{"line":52,"column":6},"end":{"line":52,"column":36}},"23":{"start":{"line":55,"column":4},"end":{"line":57,"column":5}},"24":{"start":{"line":56,"column":6},"end":{"line":56,"column":47}},"25":{"start":{"line":60,"column":2},"end":{"line":64,"column":3}},"26":{"start":{"line":61,"column":4},"end":{"line":61,"column":74}},"27":{"start":{"line":63,"column":4},"end":{"line":63,"column":74}},"28":{"start":{"line":67,"column":0},"end":{"line":67,"column":36}},"29":{"start":{"line":68,"column":0},"end":{"line":116,"column":1}},"30":{"start":{"line":69,"column":2},"end":{"line":113,"column":3}},"31":{"start":{"line":70,"column":4},"end":{"line":71,"column":30}},"32":{"start":{"line":73,"column":4},"end":{"line":75,"column":5}},"33":{"start":{"line":74,"column":6},"end":{"line":74,"column":15}},"34":{"start":{"line":77,"column":4},"end":{"line":82,"column":92}},"35":{"start":{"line":84,"column":4},"end":{"line":86,"column":5}},"36":{"start":{"line":85,"column":6},"end":{"line":85,"column":37}},"37":{"start":{"line":87,"column":4},"end":{"line":89,"column":5}},"38":{"start":{"line":88,"column":6},"end":{"line":88,"column":36}},"39":{"start":{"line":91,"column":4},"end":{"line":100,"column":5}},"40":{"start":{"line":92,"column":6},"end":{"line":92,"column":31}},"41":{"start":{"line":94,"column":6},"end":{"line":99,"column":7}},"42":{"start":{"line":96,"column":8},"end":{"line":98,"column":9}},"43":{"start":{"line":97,"column":10},"end":{"line":97,"column":89}},"44":{"start":{"line":101,"column":4},"end":{"line":106,"column":5}},"45":{"start":{"line":102,"column":6},"end":{"line":102,"column":65}},"46":{"start":{"line":105,"column":6},"end":{"line":105,"column":30}},"47":{"start":{"line":107,"column":4},"end":{"line":112,"column":5}},"48":{"start":{"line":109,"column":6},"end":{"line":109,"column":31}},"49":{"start":{"line":111,"column":6},"end":{"line":111,"column":64}},"50":{"start":{"line":115,"column":2},"end":{"line":115,"column":20}},"51":{"start":{"line":118,"column":0},"end":{"line":118,"column":40}},"52":{"start":{"line":118,"column":40},"end":{"line":134,"column":1}},"53":{"start":{"line":119,"column":2},"end":{"line":121,"column":3}},"54":{"start":{"line":120,"column":4},"end":{"line":120,"column":26}},"55":{"start":{"line":125,"column":2},"end":{"line":126,"column":32}},"56":{"start":{"line":127,"column":2},"end":{"line":129,"column":3}},"57":{"start":{"line":128,"column":4},"end":{"line":128,"column":18}},"58":{"start":{"line":131,"column":2},"end":{"line":133,"column":3}},"59":{"start":{"line":132,"column":4},"end":{"line":132,"column":90}},"60":{"start":{"line":135,"column":0},"end":{"line":149,"column":1}},"61":{"start":{"line":136,"column":2},"end":{"line":138,"column":3}},"62":{"start":{"line":137,"column":4},"end":{"line":137,"column":11}},"63":{"start":{"line":140,"column":2},"end":{"line":141,"column":32}},"64":{"start":{"line":142,"column":2},"end":{"line":144,"column":3}},"65":{"start":{"line":143,"column":4},"end":{"line":143,"column":18}},"66":{"start":{"line":146,"column":2},"end":{"line":148,"column":3}},"67":{"start":{"line":147,"column":4},"end":{"line":147,"column":90}},"68":{"start":{"line":158,"column":0},"end":{"line":167,"column":1}},"69":{"start":{"line":159,"column":2},"end":{"line":159,"column":50}},"70":{"start":{"line":160,"column":2},"end":{"line":162,"column":3}},"71":{"start":{"line":161,"column":4},"end":{"line":161,"column":11}},"72":{"start":{"line":164,"column":2},"end":{"line":164,"column":32}},"73":{"start":{"line":165,"column":2},"end":{"line":165,"column":87}},"74":{"start":{"line":166,"column":2},"end":{"line":166,"column":54}},"75":{"start":{"line":176,"column":0},"end":{"line":187,"column":1}},"76":{"start":{"line":177,"column":2},"end":{"line":177,"column":70}},"77":{"start":{"line":178,"column":2},"end":{"line":180,"column":3}},"78":{"start":{"line":179,"column":4},"end":{"line":179,"column":11}},"79":{"start":{"line":183,"column":2},"end":{"line":183,"column":32}},"80":{"start":{"line":184,"column":2},"end":{"line":184,"column":81}},"81":{"start":{"line":185,"column":2},"end":{"line":185,"column":53}},"82":{"start":{"line":186,"column":2},"end":{"line":186,"column":30}}},"branchMap":{"1":{"line":14,"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":14,"column":2}},{"start":{"line":14,"column":2},"end":{"line":14,"column":2}}]},"2":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":16},"end":{"line":18,"column":33}},{"start":{"line":18,"column":37},"end":{"line":18,"column":62}}]},"3":{"line":27,"type":"binary-expr","locations":[{"start":{"line":27,"column":39},"end":{"line":27,"column":46}},{"start":{"line":27,"column":50},"end":{"line":27,"column":57}}]},"4":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":2},"end":{"line":30,"column":2}},{"start":{"line":30,"column":2},"end":{"line":30,"column":2}}]},"5":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":34,"column":2}},{"start":{"line":34,"column":2},"end":{"line":34,"column":2}}]},"6":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":4},"end":{"line":37,"column":4}},{"start":{"line":37,"column":4},"end":{"line":37,"column":4}}]},"7":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"8":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":43,"column":4}},{"start":{"line":43,"column":4},"end":{"line":43,"column":4}}]},"9":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"10":{"line":48,"type":"binary-expr","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":44}},{"start":{"line":49,"column":11},"end":{"line":49,"column":47}}]},"11":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":4},"end":{"line":55,"column":4}},{"start":{"line":55,"column":4},"end":{"line":55,"column":4}}]},"12":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":2},"end":{"line":60,"column":2}},{"start":{"line":60,"column":2},"end":{"line":60,"column":2}}]},"13":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":4},"end":{"line":73,"column":4}},{"start":{"line":73,"column":4},"end":{"line":73,"column":4}}]},"14":{"line":80,"type":"binary-expr","locations":[{"start":{"line":80,"column":25},"end":{"line":80,"column":45}},{"start":{"line":80,"column":49},"end":{"line":80,"column":66}}]},"15":{"line":81,"type":"binary-expr","locations":[{"start":{"line":81,"column":26},"end":{"line":81,"column":47}},{"start":{"line":81,"column":51},"end":{"line":81,"column":68}}]},"16":{"line":82,"type":"binary-expr","locations":[{"start":{"line":82,"column":27},"end":{"line":82,"column":49}},{"start":{"line":82,"column":53},"end":{"line":82,"column":70}},{"start":{"line":82,"column":74},"end":{"line":82,"column":91}}]},"17":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":4},"end":{"line":84,"column":4}},{"start":{"line":84,"column":4},"end":{"line":84,"column":4}}]},"18":{"line":87,"type":"if","locations":[{"start":{"line":87,"column":4},"end":{"line":87,"column":4}},{"start":{"line":87,"column":4},"end":{"line":87,"column":4}}]},"19":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":4},"end":{"line":91,"column":4}},{"start":{"line":91,"column":4},"end":{"line":91,"column":4}}]},"20":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":6},"end":{"line":94,"column":6}},{"start":{"line":94,"column":6},"end":{"line":94,"column":6}}]},"21":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":8},"end":{"line":96,"column":8}},{"start":{"line":96,"column":8},"end":{"line":96,"column":8}}]},"22":{"line":97,"type":"cond-expr","locations":[{"start":{"line":97,"column":74},"end":{"line":97,"column":83}},{"start":{"line":97,"column":86},"end":{"line":97,"column":88}}]},"23":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":4},"end":{"line":101,"column":4}},{"start":{"line":101,"column":4},"end":{"line":101,"column":4}}]},"24":{"line":102,"type":"binary-expr","locations":[{"start":{"line":102,"column":17},"end":{"line":102,"column":32}},{"start":{"line":102,"column":36},"end":{"line":102,"column":51}}]},"25":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":4},"end":{"line":107,"column":4}},{"start":{"line":107,"column":4},"end":{"line":107,"column":4}}]},"26":{"line":111,"type":"binary-expr","locations":[{"start":{"line":111,"column":16},"end":{"line":111,"column":31}},{"start":{"line":111,"column":35},"end":{"line":111,"column":50}}]},"27":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":2},"end":{"line":119,"column":2}},{"start":{"line":119,"column":2},"end":{"line":119,"column":2}}]},"28":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":2},"end":{"line":127,"column":2}},{"start":{"line":127,"column":2},"end":{"line":127,"column":2}}]},"29":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":2},"end":{"line":131,"column":2}},{"start":{"line":131,"column":2},"end":{"line":131,"column":2}}]},"30":{"line":132,"type":"cond-expr","locations":[{"start":{"line":132,"column":34},"end":{"line":132,"column":46}},{"start":{"line":132,"column":51},"end":{"line":132,"column":67}}]},"31":{"line":132,"type":"binary-expr","locations":[{"start":{"line":132,"column":12},"end":{"line":132,"column":19}},{"start":{"line":132,"column":23},"end":{"line":132,"column":30}}]},"32":{"line":136,"type":"if","locations":[{"start":{"line":136,"column":2},"end":{"line":136,"column":2}},{"start":{"line":136,"column":2},"end":{"line":136,"column":2}}]},"33":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":2},"end":{"line":142,"column":2}},{"start":{"line":142,"column":2},"end":{"line":142,"column":2}}]},"34":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":2},"end":{"line":146,"column":2}},{"start":{"line":146,"column":2},"end":{"line":146,"column":2}}]},"35":{"line":147,"type":"cond-expr","locations":[{"start":{"line":147,"column":34},"end":{"line":147,"column":46}},{"start":{"line":147,"column":51},"end":{"line":147,"column":67}}]},"36":{"line":147,"type":"binary-expr","locations":[{"start":{"line":147,"column":12},"end":{"line":147,"column":19}},{"start":{"line":147,"column":23},"end":{"line":147,"column":30}}]},"37":{"line":159,"type":"cond-expr","locations":[{"start":{"line":159,"column":39},"end":{"line":159,"column":40}},{"start":{"line":159,"column":43},"end":{"line":159,"column":48}}]},"38":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":2},"end":{"line":160,"column":2}},{"start":{"line":160,"column":2},"end":{"line":160,"column":2}}]},"39":{"line":160,"type":"binary-expr","locations":[{"start":{"line":160,"column":6},"end":{"line":160,"column":14}},{"start":{"line":160,"column":18},"end":{"line":160,"column":44}},{"start":{"line":160,"column":49},"end":{"line":160,"column":58}},{"start":{"line":160,"column":62},"end":{"line":160,"column":83}}]},"40":{"line":165,"type":"cond-expr","locations":[{"start":{"line":165,"column":54},"end":{"line":165,"column":60}},{"start":{"line":165,"column":65},"end":{"line":165,"column":80}}]},"41":{"line":177,"type":"cond-expr","locations":[{"start":{"line":177,"column":39},"end":{"line":177,"column":60}},{"start":{"line":177,"column":63},"end":{"line":177,"column":68}}]},"42":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":2},"end":{"line":178,"column":2}},{"start":{"line":178,"column":2},"end":{"line":178,"column":2}}]},"43":{"line":178,"type":"binary-expr","locations":[{"start":{"line":178,"column":6},"end":{"line":178,"column":14}},{"start":{"line":178,"column":18},"end":{"line":178,"column":44}},{"start":{"line":178,"column":49},"end":{"line":178,"column":58}},{"start":{"line":178,"column":62},"end":{"line":178,"column":82}}]},"44":{"line":184,"type":"cond-expr","locations":[{"start":{"line":184,"column":54},"end":{"line":184,"column":60}},{"start":{"line":184,"column":65},"end":{"line":184,"column":74}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/compiler.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/compiler.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":129,"8":129,"9":45,"10":84,"11":279,"12":279,"13":68,"14":16,"15":16,"16":4,"17":3,"18":13,"19":1595,"20":1595,"21":1595,"22":1595,"23":1595,"24":1595,"25":1595,"26":1595,"27":1595,"28":646,"29":5054,"30":1595,"31":5302,"32":1595,"33":1595,"34":3165,"35":1593,"36":1593,"37":2,"38":1593,"39":631,"40":631,"41":631,"42":631,"43":631,"44":52,"45":52,"46":50,"47":2,"48":631,"49":583,"50":583,"51":505,"52":583,"53":126,"54":583,"55":583,"56":583,"57":232,"58":351,"59":32,"60":32,"61":32,"62":32,"63":32,"64":319,"65":319,"66":319,"67":319,"68":319,"69":583,"70":60,"71":60,"72":60,"73":96,"74":60,"75":96,"76":60,"77":86,"78":86,"79":86,"80":2,"81":84,"82":86,"83":4,"84":82,"85":82,"86":86,"87":86,"88":1553,"89":1419,"90":913,"91":911,"92":851,"93":60,"94":894,"95":894,"96":894,"97":894,"98":894,"99":894,"100":186,"101":186,"102":38,"103":148,"104":108,"105":40,"106":40,"107":40,"108":186,"109":468,"110":468,"111":210,"112":258,"113":2,"114":256,"115":256,"116":256,"117":965,"118":965,"119":154,"120":811,"121":236,"122":575,"123":1588,"124":1588,"125":1588,"126":1588,"127":16,"128":1572,"129":68,"130":68,"131":42,"132":50,"133":40,"134":14161,"135":1636,"136":1580,"137":56,"138":54,"139":54,"140":1548,"141":1548,"142":1548,"143":1548,"144":912,"145":912,"146":10,"147":902,"148":8,"149":1548,"150":468,"151":1080,"152":894,"153":186,"154":468,"155":502,"156":598,"157":62,"158":6,"159":62,"160":62,"161":62,"162":4,"163":536,"164":54,"165":536,"166":468,"167":468,"168":468,"169":468,"170":468,"171":58,"172":410,"173":468,"174":1,"175":801,"176":2,"177":799,"178":799,"179":767,"180":799,"181":180,"182":799,"183":785,"184":783,"185":1,"186":1,"187":155,"188":2,"189":153,"190":153,"191":71,"192":153,"193":48,"194":153,"195":1,"196":153,"197":153,"198":153,"199":153,"200":153,"201":174,"202":150,"203":174,"204":153,"205":2,"206":1,"207":2,"208":153,"209":4,"210":2,"211":4,"212":153,"213":1,"214":1,"215":621,"216":241,"217":380,"218":312,"219":342,"220":81,"221":231},"b":{"1":[45,84],"2":[68,211],"3":[279,279],"4":[3,1],"5":[646,949],"6":[631,631],"7":[50,2],"8":[505,78],"9":[126,457],"10":[232,351],"11":[32,319],"12":[2,84],"13":[4,82],"14":[86,76],"15":[1419,134],"16":[851,60],"17":[911,851],"18":[894,635],"19":[38,148],"20":[108,40],"21":[210,258],"22":[2,256],"23":[154,811],"24":[236,575],"25":[16,1572],"26":[1580,56],"27":[54,2],"28":[912,636],"29":[1548,1370],"30":[10,902],"31":[8,894],"32":[468,1080],"33":[894,186],"34":[62,536],"35":[6,56],"36":[62,56],"37":[4,58],"38":[54,482],"39":[54,12],"40":[58,410],"41":[2,799],"42":[801,800,2],"43":[799,387],"44":[767,32],"45":[180,619],"46":[2,153],"47":[155,154,2],"48":[153,7],"49":[71,82],"50":[48,105],"51":[150,24],"52":[1,1],"53":[2,2],"54":[241,380],"55":[312,68],"56":[380,312,312],"57":[81,261]},"f":{"1":1595,"2":129,"3":1595,"4":5302,"5":1595,"6":2,"7":631,"8":583,"9":60,"10":86,"11":1553,"12":913,"13":894,"14":186,"15":468,"16":965,"17":1588,"18":68,"19":42,"20":50,"21":40,"22":30,"23":14161,"24":1636,"25":1548,"26":468,"27":598,"28":468,"29":801,"30":155,"31":153,"32":174,"33":2,"34":4,"35":621},"fnMap":{"1":{"name":"Compiler","line":7,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":20}}},"2":{"name":"(anonymous_2)","line":17,"loc":{"start":{"line":17,"column":10},"end":{"line":17,"column":26}}},"3":{"name":"(anonymous_3)","line":45,"loc":{"start":{"line":45,"column":11},"end":{"line":45,"column":38}}},"4":{"name":"(anonymous_4)","line":74,"loc":{"start":{"line":74,"column":10},"end":{"line":74,"column":25}}},"5":{"name":"(anonymous_5)","line":78,"loc":{"start":{"line":78,"column":11},"end":{"line":78,"column":29}}},"6":{"name":"(anonymous_6)","line":86,"loc":{"start":{"line":86,"column":45},"end":{"line":86,"column":60}}},"7":{"name":"(anonymous_7)","line":93,"loc":{"start":{"line":93,"column":18},"end":{"line":93,"column":36}}},"8":{"name":"(anonymous_8)","line":111,"loc":{"start":{"line":111,"column":9},"end":{"line":111,"column":25}}},"9":{"name":"(anonymous_9)","line":152,"loc":{"start":{"line":152,"column":8},"end":{"line":152,"column":23}}},"10":{"name":"(anonymous_10)","line":166,"loc":{"start":{"line":166,"column":11},"end":{"line":166,"column":29}}},"11":{"name":"(anonymous_11)","line":187,"loc":{"start":{"line":187,"column":11},"end":{"line":187,"column":29}}},"12":{"name":"(anonymous_12)","line":193,"loc":{"start":{"line":193,"column":12},"end":{"line":193,"column":31}}},"13":{"name":"(anonymous_13)","line":203,"loc":{"start":{"line":203,"column":18},"end":{"line":203,"column":52}}},"14":{"name":"(anonymous_14)","line":218,"loc":{"start":{"line":218,"column":15},"end":{"line":218,"column":31}}},"15":{"name":"(anonymous_15)","line":235,"loc":{"start":{"line":235,"column":15},"end":{"line":235,"column":49}}},"16":{"name":"(anonymous_16)","line":252,"loc":{"start":{"line":252,"column":9},"end":{"line":252,"column":25}}},"17":{"name":"(anonymous_17)","line":264,"loc":{"start":{"line":264,"column":6},"end":{"line":264,"column":19}}},"18":{"name":"(anonymous_18)","line":277,"loc":{"start":{"line":277,"column":8},"end":{"line":277,"column":23}}},"19":{"name":"(anonymous_19)","line":282,"loc":{"start":{"line":282,"column":10},"end":{"line":282,"column":27}}},"20":{"name":"(anonymous_20)","line":286,"loc":{"start":{"line":286,"column":10},"end":{"line":286,"column":27}}},"21":{"name":"(anonymous_21)","line":290,"loc":{"start":{"line":290,"column":11},"end":{"line":290,"column":26}}},"22":{"name":"(anonymous_22)","line":294,"loc":{"start":{"line":294,"column":11},"end":{"line":294,"column":22}}},"23":{"name":"(anonymous_23)","line":297,"loc":{"start":{"line":297,"column":10},"end":{"line":297,"column":25}}},"24":{"name":"(anonymous_24)","line":301,"loc":{"start":{"line":301,"column":12},"end":{"line":301,"column":28}}},"25":{"name":"(anonymous_25)","line":310,"loc":{"start":{"line":310,"column":17},"end":{"line":310,"column":33}}},"26":{"name":"(anonymous_26)","line":332,"loc":{"start":{"line":332,"column":14},"end":{"line":332,"column":31}}},"27":{"name":"(anonymous_27)","line":338,"loc":{"start":{"line":338,"column":13},"end":{"line":338,"column":27}}},"28":{"name":"(anonymous_28)","line":359,"loc":{"start":{"line":359,"column":27},"end":{"line":359,"column":61}}},"29":{"name":"precompile","line":376,"loc":{"start":{"line":376,"column":0},"end":{"line":376,"column":41}}},"30":{"name":"compile","line":394,"loc":{"start":{"line":394,"column":32},"end":{"line":394,"column":70}}},"31":{"name":"compileInput","line":410,"loc":{"start":{"line":410,"column":2},"end":{"line":410,"column":26}}},"32":{"name":"(anonymous_32)","line":418,"loc":{"start":{"line":418,"column":12},"end":{"line":418,"column":39}}},"33":{"name":"(anonymous_33)","line":424,"loc":{"start":{"line":424,"column":15},"end":{"line":424,"column":33}}},"34":{"name":"(anonymous_34)","line":430,"loc":{"start":{"line":430,"column":15},"end":{"line":430,"column":41}}},"35":{"name":"argEquals","line":439,"loc":{"start":{"line":439,"column":26},"end":{"line":439,"column":51}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":51}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":42}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":21}},"4":{"start":{"line":7,"column":0},"end":{"line":7,"column":22}},"5":{"start":{"line":9,"column":0},"end":{"line":9,"column":28}},"6":{"start":{"line":14,"column":0},"end":{"line":374,"column":2}},"7":{"start":{"line":18,"column":4},"end":{"line":18,"column":34}},"8":{"start":{"line":19,"column":4},"end":{"line":21,"column":5}},"9":{"start":{"line":20,"column":6},"end":{"line":20,"column":19}},"10":{"start":{"line":23,"column":4},"end":{"line":29,"column":5}},"11":{"start":{"line":24,"column":6},"end":{"line":25,"column":41}},"12":{"start":{"line":26,"column":6},"end":{"line":28,"column":7}},"13":{"start":{"line":27,"column":8},"end":{"line":27,"column":21}},"14":{"start":{"line":33,"column":4},"end":{"line":33,"column":31}},"15":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}},"16":{"start":{"line":35,"column":6},"end":{"line":37,"column":7}},"17":{"start":{"line":36,"column":8},"end":{"line":36,"column":21}},"18":{"start":{"line":40,"column":4},"end":{"line":40,"column":16}},"19":{"start":{"line":46,"column":4},"end":{"line":46,"column":22}},"20":{"start":{"line":47,"column":4},"end":{"line":47,"column":23}},"21":{"start":{"line":48,"column":4},"end":{"line":48,"column":29}},"22":{"start":{"line":49,"column":4},"end":{"line":49,"column":27}},"23":{"start":{"line":50,"column":4},"end":{"line":50,"column":45}},"24":{"start":{"line":51,"column":4},"end":{"line":51,"column":37}},"25":{"start":{"line":54,"column":4},"end":{"line":54,"column":49}},"26":{"start":{"line":55,"column":4},"end":{"line":64,"column":6}},"27":{"start":{"line":65,"column":4},"end":{"line":69,"column":5}},"28":{"start":{"line":66,"column":6},"end":{"line":68,"column":7}},"29":{"start":{"line":67,"column":8},"end":{"line":67,"column":61}},"30":{"start":{"line":71,"column":4},"end":{"line":71,"column":32}},"31":{"start":{"line":75,"column":4},"end":{"line":75,"column":33}},"32":{"start":{"line":79,"column":4},"end":{"line":79,"column":40}},"33":{"start":{"line":81,"column":4},"end":{"line":83,"column":5}},"34":{"start":{"line":82,"column":6},"end":{"line":82,"column":33}},"35":{"start":{"line":84,"column":4},"end":{"line":84,"column":28}},"36":{"start":{"line":86,"column":4},"end":{"line":88,"column":7}},"37":{"start":{"line":87,"column":6},"end":{"line":87,"column":19}},"38":{"start":{"line":90,"column":4},"end":{"line":90,"column":16}},"39":{"start":{"line":94,"column":4},"end":{"line":94,"column":68}},"40":{"start":{"line":95,"column":4},"end":{"line":95,"column":34}},"41":{"start":{"line":97,"column":4},"end":{"line":97,"column":59}},"42":{"start":{"line":99,"column":4},"end":{"line":99,"column":33}},"43":{"start":{"line":101,"column":4},"end":{"line":106,"column":5}},"44":{"start":{"line":102,"column":6},"end":{"line":102,"column":36}},"45":{"start":{"line":104,"column":6},"end":{"line":105,"column":40}},"46":{"start":{"line":104,"column":22},"end":{"line":104,"column":31}},"47":{"start":{"line":105,"column":13},"end":{"line":105,"column":38}},"48":{"start":{"line":108,"column":4},"end":{"line":108,"column":16}},"49":{"start":{"line":112,"column":4},"end":{"line":114,"column":32}},"50":{"start":{"line":116,"column":4},"end":{"line":118,"column":5}},"51":{"start":{"line":117,"column":6},"end":{"line":117,"column":45}},"52":{"start":{"line":120,"column":4},"end":{"line":122,"column":5}},"53":{"start":{"line":121,"column":6},"end":{"line":121,"column":45}},"54":{"start":{"line":124,"column":4},"end":{"line":124,"column":31}},"55":{"start":{"line":125,"column":4},"end":{"line":125,"column":41}},"56":{"start":{"line":127,"column":4},"end":{"line":147,"column":5}},"57":{"start":{"line":128,"column":6},"end":{"line":128,"column":48}},"58":{"start":{"line":129,"column":11},"end":{"line":147,"column":5}},"59":{"start":{"line":130,"column":6},"end":{"line":130,"column":30}},"60":{"start":{"line":134,"column":6},"end":{"line":134,"column":42}},"61":{"start":{"line":135,"column":6},"end":{"line":135,"column":42}},"62":{"start":{"line":136,"column":6},"end":{"line":136,"column":31}},"63":{"start":{"line":137,"column":6},"end":{"line":137,"column":51}},"64":{"start":{"line":139,"column":6},"end":{"line":139,"column":51}},"65":{"start":{"line":143,"column":6},"end":{"line":143,"column":42}},"66":{"start":{"line":144,"column":6},"end":{"line":144,"column":42}},"67":{"start":{"line":145,"column":6},"end":{"line":145,"column":31}},"68":{"start":{"line":146,"column":6},"end":{"line":146,"column":41}},"69":{"start":{"line":149,"column":4},"end":{"line":149,"column":26}},"70":{"start":{"line":153,"column":4},"end":{"line":153,"column":33}},"71":{"start":{"line":155,"column":4},"end":{"line":155,"column":28}},"72":{"start":{"line":157,"column":4},"end":{"line":159,"column":5}},"73":{"start":{"line":158,"column":6},"end":{"line":158,"column":34}},"74":{"start":{"line":160,"column":4},"end":{"line":162,"column":5}},"75":{"start":{"line":161,"column":6},"end":{"line":161,"column":47}},"76":{"start":{"line":163,"column":4},"end":{"line":163,"column":27}},"77":{"start":{"line":167,"column":4},"end":{"line":167,"column":42}},"78":{"start":{"line":168,"column":4},"end":{"line":168,"column":27}},"79":{"start":{"line":170,"column":4},"end":{"line":174,"column":5}},"80":{"start":{"line":171,"column":6},"end":{"line":171,"column":32}},"81":{"start":{"line":173,"column":6},"end":{"line":173,"column":39}},"82":{"start":{"line":176,"column":4},"end":{"line":181,"column":5}},"83":{"start":{"line":177,"column":6},"end":{"line":177,"column":35}},"84":{"start":{"line":179,"column":6},"end":{"line":179,"column":35}},"85":{"start":{"line":180,"column":6},"end":{"line":180,"column":33}},"86":{"start":{"line":183,"column":4},"end":{"line":183,"column":73}},"87":{"start":{"line":184,"column":4},"end":{"line":184,"column":26}},"88":{"start":{"line":188,"column":4},"end":{"line":190,"column":5}},"89":{"start":{"line":189,"column":6},"end":{"line":189,"column":51}},"90":{"start":{"line":194,"column":4},"end":{"line":194,"column":31}},"91":{"start":{"line":196,"column":4},"end":{"line":200,"column":5}},"92":{"start":{"line":197,"column":6},"end":{"line":197,"column":35}},"93":{"start":{"line":199,"column":6},"end":{"line":199,"column":28}},"94":{"start":{"line":204,"column":4},"end":{"line":206,"column":53}},"95":{"start":{"line":208,"column":4},"end":{"line":208,"column":40}},"96":{"start":{"line":210,"column":4},"end":{"line":210,"column":40}},"97":{"start":{"line":211,"column":4},"end":{"line":211,"column":40}},"98":{"start":{"line":213,"column":4},"end":{"line":213,"column":16}},"99":{"start":{"line":215,"column":4},"end":{"line":215,"column":50}},"100":{"start":{"line":219,"column":4},"end":{"line":219,"column":22}},"101":{"start":{"line":221,"column":4},"end":{"line":230,"column":5}},"102":{"start":{"line":222,"column":6},"end":{"line":222,"column":20}},"103":{"start":{"line":223,"column":11},"end":{"line":230,"column":5}},"104":{"start":{"line":224,"column":6},"end":{"line":224,"column":18}},"105":{"start":{"line":227,"column":6},"end":{"line":227,"column":30}},"106":{"start":{"line":228,"column":6},"end":{"line":228,"column":42}},"107":{"start":{"line":229,"column":6},"end":{"line":229,"column":33}},"108":{"start":{"line":232,"column":4},"end":{"line":232,"column":41}},"109":{"start":{"line":236,"column":4},"end":{"line":238,"column":27}},"110":{"start":{"line":240,"column":4},"end":{"line":249,"column":5}},"111":{"start":{"line":241,"column":6},"end":{"line":241,"column":60}},"112":{"start":{"line":242,"column":11},"end":{"line":249,"column":5}},"113":{"start":{"line":243,"column":6},"end":{"line":243,"column":104}},"114":{"start":{"line":245,"column":6},"end":{"line":245,"column":22}},"115":{"start":{"line":247,"column":6},"end":{"line":247,"column":18}},"116":{"start":{"line":248,"column":6},"end":{"line":248,"column":75}},"117":{"start":{"line":253,"column":4},"end":{"line":253,"column":41}},"118":{"start":{"line":255,"column":4},"end":{"line":261,"column":5}},"119":{"start":{"line":256,"column":6},"end":{"line":256,"column":30}},"120":{"start":{"line":257,"column":11},"end":{"line":261,"column":5}},"121":{"start":{"line":258,"column":6},"end":{"line":258,"column":30}},"122":{"start":{"line":260,"column":6},"end":{"line":260,"column":33}},"123":{"start":{"line":265,"column":4},"end":{"line":265,"column":28}},"124":{"start":{"line":266,"column":4},"end":{"line":266,"column":40}},"125":{"start":{"line":268,"column":4},"end":{"line":268,"column":27}},"126":{"start":{"line":269,"column":4},"end":{"line":274,"column":5}},"127":{"start":{"line":271,"column":6},"end":{"line":271,"column":33}},"128":{"start":{"line":273,"column":6},"end":{"line":273,"column":70}},"129":{"start":{"line":278,"column":4},"end":{"line":278,"column":29}},"130":{"start":{"line":279,"column":4},"end":{"line":279,"column":60}},"131":{"start":{"line":283,"column":4},"end":{"line":283,"column":45}},"132":{"start":{"line":287,"column":4},"end":{"line":287,"column":46}},"133":{"start":{"line":291,"column":4},"end":{"line":291,"column":42}},"134":{"start":{"line":298,"column":4},"end":{"line":298,"column":72}},"135":{"start":{"line":302,"column":4},"end":{"line":302,"column":31}},"136":{"start":{"line":302,"column":22},"end":{"line":302,"column":29}},"137":{"start":{"line":304,"column":4},"end":{"line":307,"column":5}},"138":{"start":{"line":305,"column":6},"end":{"line":305,"column":32}},"139":{"start":{"line":306,"column":6},"end":{"line":306,"column":35}},"140":{"start":{"line":311,"column":4},"end":{"line":311,"column":36}},"141":{"start":{"line":312,"column":4},"end":{"line":312,"column":42}},"142":{"start":{"line":313,"column":4},"end":{"line":313,"column":34}},"143":{"start":{"line":317,"column":4},"end":{"line":325,"column":5}},"144":{"start":{"line":318,"column":6},"end":{"line":318,"column":35}},"145":{"start":{"line":320,"column":6},"end":{"line":324,"column":7}},"146":{"start":{"line":321,"column":8},"end":{"line":321,"column":24}},"147":{"start":{"line":322,"column":13},"end":{"line":324,"column":7}},"148":{"start":{"line":323,"column":8},"end":{"line":323,"column":27}},"149":{"start":{"line":327,"column":4},"end":{"line":329,"column":29}},"150":{"start":{"line":327,"column":20},"end":{"line":327,"column":36}},"151":{"start":{"line":328,"column":9},"end":{"line":329,"column":29}},"152":{"start":{"line":328,"column":27},"end":{"line":328,"column":46}},"153":{"start":{"line":329,"column":11},"end":{"line":329,"column":27}},"154":{"start":{"line":333,"column":4},"end":{"line":335,"column":5}},"155":{"start":{"line":334,"column":6},"end":{"line":334,"column":32}},"156":{"start":{"line":339,"column":4},"end":{"line":356,"column":5}},"157":{"start":{"line":340,"column":6},"end":{"line":342,"column":7}},"158":{"start":{"line":341,"column":8},"end":{"line":341,"column":33}},"159":{"start":{"line":343,"column":6},"end":{"line":343,"column":48}},"160":{"start":{"line":344,"column":6},"end":{"line":344,"column":68}},"161":{"start":{"line":346,"column":6},"end":{"line":350,"column":7}},"162":{"start":{"line":349,"column":8},"end":{"line":349,"column":24}},"163":{"start":{"line":352,"column":6},"end":{"line":354,"column":7}},"164":{"start":{"line":353,"column":8},"end":{"line":353,"column":75}},"165":{"start":{"line":355,"column":6},"end":{"line":355,"column":23}},"166":{"start":{"line":360,"column":4},"end":{"line":360,"column":30}},"167":{"start":{"line":361,"column":4},"end":{"line":361,"column":28}},"168":{"start":{"line":363,"column":4},"end":{"line":363,"column":40}},"169":{"start":{"line":364,"column":4},"end":{"line":364,"column":40}},"170":{"start":{"line":366,"column":4},"end":{"line":370,"column":5}},"171":{"start":{"line":367,"column":6},"end":{"line":367,"column":28}},"172":{"start":{"line":369,"column":6},"end":{"line":369,"column":31}},"173":{"start":{"line":372,"column":4},"end":{"line":372,"column":18}},"174":{"start":{"line":376,"column":0},"end":{"line":392,"column":1}},"175":{"start":{"line":377,"column":2},"end":{"line":379,"column":3}},"176":{"start":{"line":378,"column":4},"end":{"line":378,"column":114}},"177":{"start":{"line":381,"column":2},"end":{"line":381,"column":26}},"178":{"start":{"line":382,"column":2},"end":{"line":384,"column":3}},"179":{"start":{"line":383,"column":4},"end":{"line":383,"column":24}},"180":{"start":{"line":385,"column":2},"end":{"line":387,"column":3}},"181":{"start":{"line":386,"column":4},"end":{"line":386,"column":29}},"182":{"start":{"line":389,"column":2},"end":{"line":389,"column":29}},"183":{"start":{"line":390,"column":2},"end":{"line":390,"column":61}},"184":{"start":{"line":391,"column":2},"end":{"line":391,"column":68}},"185":{"start":{"line":394,"column":0},"end":{"line":394,"column":32}},"186":{"start":{"line":394,"column":32},"end":{"line":437,"column":1}},"187":{"start":{"line":395,"column":2},"end":{"line":397,"column":3}},"188":{"start":{"line":396,"column":4},"end":{"line":396,"column":111}},"189":{"start":{"line":399,"column":2},"end":{"line":399,"column":26}},"190":{"start":{"line":401,"column":2},"end":{"line":403,"column":3}},"191":{"start":{"line":402,"column":4},"end":{"line":402,"column":24}},"192":{"start":{"line":404,"column":2},"end":{"line":406,"column":3}},"193":{"start":{"line":405,"column":4},"end":{"line":405,"column":29}},"194":{"start":{"line":408,"column":2},"end":{"line":408,"column":15}},"195":{"start":{"line":410,"column":2},"end":{"line":415,"column":3}},"196":{"start":{"line":411,"column":4},"end":{"line":411,"column":31}},"197":{"start":{"line":412,"column":4},"end":{"line":412,"column":63}},"198":{"start":{"line":413,"column":4},"end":{"line":413,"column":99}},"199":{"start":{"line":414,"column":4},"end":{"line":414,"column":38}},"200":{"start":{"line":418,"column":2},"end":{"line":423,"column":4}},"201":{"start":{"line":419,"column":4},"end":{"line":421,"column":5}},"202":{"start":{"line":420,"column":6},"end":{"line":420,"column":32}},"203":{"start":{"line":422,"column":4},"end":{"line":422,"column":49}},"204":{"start":{"line":424,"column":2},"end":{"line":429,"column":4}},"205":{"start":{"line":425,"column":4},"end":{"line":427,"column":5}},"206":{"start":{"line":426,"column":6},"end":{"line":426,"column":32}},"207":{"start":{"line":428,"column":4},"end":{"line":428,"column":36}},"208":{"start":{"line":430,"column":2},"end":{"line":435,"column":4}},"209":{"start":{"line":431,"column":4},"end":{"line":433,"column":5}},"210":{"start":{"line":432,"column":6},"end":{"line":432,"column":32}},"211":{"start":{"line":434,"column":4},"end":{"line":434,"column":44}},"212":{"start":{"line":436,"column":2},"end":{"line":436,"column":13}},"213":{"start":{"line":439,"column":0},"end":{"line":439,"column":26}},"214":{"start":{"line":439,"column":26},"end":{"line":452,"column":1}},"215":{"start":{"line":440,"column":2},"end":{"line":442,"column":3}},"216":{"start":{"line":441,"column":4},"end":{"line":441,"column":16}},"217":{"start":{"line":444,"column":2},"end":{"line":451,"column":3}},"218":{"start":{"line":445,"column":4},"end":{"line":449,"column":5}},"219":{"start":{"line":446,"column":6},"end":{"line":448,"column":7}},"220":{"start":{"line":447,"column":8},"end":{"line":447,"column":21}},"221":{"start":{"line":450,"column":4},"end":{"line":450,"column":16}}},"branchMap":{"1":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":4},"end":{"line":19,"column":4}},{"start":{"line":19,"column":4},"end":{"line":19,"column":4}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":6},"end":{"line":26,"column":6}},{"start":{"line":26,"column":6},"end":{"line":26,"column":6}}]},"3":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":10},"end":{"line":26,"column":46}},{"start":{"line":26,"column":50},"end":{"line":26,"column":91}}]},"4":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":6},"end":{"line":35,"column":6}},{"start":{"line":35,"column":6},"end":{"line":35,"column":6}}]},"5":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":4},"end":{"line":65,"column":4}},{"start":{"line":65,"column":4},"end":{"line":65,"column":4}}]},"6":{"line":97,"type":"binary-expr","locations":[{"start":{"line":97,"column":22},"end":{"line":97,"column":37}},{"start":{"line":97,"column":41},"end":{"line":97,"column":58}}]},"7":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":6},"end":{"line":104,"column":6}},{"start":{"line":104,"column":6},"end":{"line":104,"column":6}}]},"8":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":4},"end":{"line":116,"column":4}},{"start":{"line":116,"column":4},"end":{"line":116,"column":4}}]},"9":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":4},"end":{"line":120,"column":4}},{"start":{"line":120,"column":4},"end":{"line":120,"column":4}}]},"10":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":4},"end":{"line":127,"column":4}},{"start":{"line":127,"column":4},"end":{"line":127,"column":4}}]},"11":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":11},"end":{"line":129,"column":11}},{"start":{"line":129,"column":11},"end":{"line":129,"column":11}}]},"12":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":4},"end":{"line":170,"column":4}},{"start":{"line":170,"column":4},"end":{"line":170,"column":4}}]},"13":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":4},"end":{"line":176,"column":4}},{"start":{"line":176,"column":4},"end":{"line":176,"column":4}}]},"14":{"line":183,"type":"binary-expr","locations":[{"start":{"line":183,"column":51},"end":{"line":183,"column":65}},{"start":{"line":183,"column":69},"end":{"line":183,"column":71}}]},"15":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":4},"end":{"line":188,"column":4}},{"start":{"line":188,"column":4},"end":{"line":188,"column":4}}]},"16":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":4},"end":{"line":196,"column":4}},{"start":{"line":196,"column":4},"end":{"line":196,"column":4}}]},"17":{"line":196,"type":"binary-expr","locations":[{"start":{"line":196,"column":7},"end":{"line":196,"column":23}},{"start":{"line":196,"column":27},"end":{"line":196,"column":49}}]},"18":{"line":206,"type":"binary-expr","locations":[{"start":{"line":206,"column":18},"end":{"line":206,"column":33}},{"start":{"line":206,"column":37},"end":{"line":206,"column":52}}]},"19":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":4},"end":{"line":221,"column":4}},{"start":{"line":221,"column":4},"end":{"line":221,"column":4}}]},"20":{"line":223,"type":"if","locations":[{"start":{"line":223,"column":11},"end":{"line":223,"column":11}},{"start":{"line":223,"column":11},"end":{"line":223,"column":11}}]},"21":{"line":240,"type":"if","locations":[{"start":{"line":240,"column":4},"end":{"line":240,"column":4}},{"start":{"line":240,"column":4},"end":{"line":240,"column":4}}]},"22":{"line":242,"type":"if","locations":[{"start":{"line":242,"column":11},"end":{"line":242,"column":11}},{"start":{"line":242,"column":11},"end":{"line":242,"column":11}}]},"23":{"line":255,"type":"if","locations":[{"start":{"line":255,"column":4},"end":{"line":255,"column":4}},{"start":{"line":255,"column":4},"end":{"line":255,"column":4}}]},"24":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":11},"end":{"line":257,"column":11}},{"start":{"line":257,"column":11},"end":{"line":257,"column":11}}]},"25":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":4},"end":{"line":269,"column":4}},{"start":{"line":269,"column":4},"end":{"line":269,"column":4}}]},"26":{"line":302,"type":"if","locations":[{"start":{"line":302,"column":4},"end":{"line":302,"column":4}},{"start":{"line":302,"column":4},"end":{"line":302,"column":4}}]},"27":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":4},"end":{"line":304,"column":4}},{"start":{"line":304,"column":4},"end":{"line":304,"column":4}}]},"28":{"line":317,"type":"if","locations":[{"start":{"line":317,"column":4},"end":{"line":317,"column":4}},{"start":{"line":317,"column":4},"end":{"line":317,"column":4}}]},"29":{"line":317,"type":"binary-expr","locations":[{"start":{"line":317,"column":8},"end":{"line":317,"column":18}},{"start":{"line":317,"column":22},"end":{"line":317,"column":31}}]},"30":{"line":320,"type":"if","locations":[{"start":{"line":320,"column":6},"end":{"line":320,"column":6}},{"start":{"line":320,"column":6},"end":{"line":320,"column":6}}]},"31":{"line":322,"type":"if","locations":[{"start":{"line":322,"column":13},"end":{"line":322,"column":13}},{"start":{"line":322,"column":13},"end":{"line":322,"column":13}}]},"32":{"line":327,"type":"if","locations":[{"start":{"line":327,"column":4},"end":{"line":327,"column":4}},{"start":{"line":327,"column":4},"end":{"line":327,"column":4}}]},"33":{"line":328,"type":"if","locations":[{"start":{"line":328,"column":9},"end":{"line":328,"column":9}},{"start":{"line":328,"column":9},"end":{"line":328,"column":9}}]},"34":{"line":339,"type":"if","locations":[{"start":{"line":339,"column":4},"end":{"line":339,"column":4}},{"start":{"line":339,"column":4},"end":{"line":339,"column":4}}]},"35":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":6},"end":{"line":340,"column":6}},{"start":{"line":340,"column":6},"end":{"line":340,"column":6}}]},"36":{"line":343,"type":"binary-expr","locations":[{"start":{"line":343,"column":32},"end":{"line":343,"column":41}},{"start":{"line":343,"column":45},"end":{"line":343,"column":46}}]},"37":{"line":346,"type":"if","locations":[{"start":{"line":346,"column":6},"end":{"line":346,"column":6}},{"start":{"line":346,"column":6},"end":{"line":346,"column":6}}]},"38":{"line":352,"type":"if","locations":[{"start":{"line":352,"column":6},"end":{"line":352,"column":6}},{"start":{"line":352,"column":6},"end":{"line":352,"column":6}}]},"39":{"line":353,"type":"binary-expr","locations":[{"start":{"line":353,"column":40},"end":{"line":353,"column":50}},{"start":{"line":353,"column":54},"end":{"line":353,"column":73}}]},"40":{"line":366,"type":"if","locations":[{"start":{"line":366,"column":4},"end":{"line":366,"column":4}},{"start":{"line":366,"column":4},"end":{"line":366,"column":4}}]},"41":{"line":377,"type":"if","locations":[{"start":{"line":377,"column":2},"end":{"line":377,"column":2}},{"start":{"line":377,"column":2},"end":{"line":377,"column":2}}]},"42":{"line":377,"type":"binary-expr","locations":[{"start":{"line":377,"column":6},"end":{"line":377,"column":19}},{"start":{"line":377,"column":24},"end":{"line":377,"column":49}},{"start":{"line":377,"column":53},"end":{"line":377,"column":94}}]},"43":{"line":381,"type":"binary-expr","locations":[{"start":{"line":381,"column":12},"end":{"line":381,"column":19}},{"start":{"line":381,"column":23},"end":{"line":381,"column":25}}]},"44":{"line":382,"type":"if","locations":[{"start":{"line":382,"column":2},"end":{"line":382,"column":2}},{"start":{"line":382,"column":2},"end":{"line":382,"column":2}}]},"45":{"line":385,"type":"if","locations":[{"start":{"line":385,"column":2},"end":{"line":385,"column":2}},{"start":{"line":385,"column":2},"end":{"line":385,"column":2}}]},"46":{"line":395,"type":"if","locations":[{"start":{"line":395,"column":2},"end":{"line":395,"column":2}},{"start":{"line":395,"column":2},"end":{"line":395,"column":2}}]},"47":{"line":395,"type":"binary-expr","locations":[{"start":{"line":395,"column":6},"end":{"line":395,"column":19}},{"start":{"line":395,"column":24},"end":{"line":395,"column":49}},{"start":{"line":395,"column":53},"end":{"line":395,"column":94}}]},"48":{"line":399,"type":"binary-expr","locations":[{"start":{"line":399,"column":12},"end":{"line":399,"column":19}},{"start":{"line":399,"column":23},"end":{"line":399,"column":25}}]},"49":{"line":401,"type":"if","locations":[{"start":{"line":401,"column":2},"end":{"line":401,"column":2}},{"start":{"line":401,"column":2},"end":{"line":401,"column":2}}]},"50":{"line":404,"type":"if","locations":[{"start":{"line":404,"column":2},"end":{"line":404,"column":2}},{"start":{"line":404,"column":2},"end":{"line":404,"column":2}}]},"51":{"line":419,"type":"if","locations":[{"start":{"line":419,"column":4},"end":{"line":419,"column":4}},{"start":{"line":419,"column":4},"end":{"line":419,"column":4}}]},"52":{"line":425,"type":"if","locations":[{"start":{"line":425,"column":4},"end":{"line":425,"column":4}},{"start":{"line":425,"column":4},"end":{"line":425,"column":4}}]},"53":{"line":431,"type":"if","locations":[{"start":{"line":431,"column":4},"end":{"line":431,"column":4}},{"start":{"line":431,"column":4},"end":{"line":431,"column":4}}]},"54":{"line":440,"type":"if","locations":[{"start":{"line":440,"column":2},"end":{"line":440,"column":2}},{"start":{"line":440,"column":2},"end":{"line":440,"column":2}}]},"55":{"line":444,"type":"if","locations":[{"start":{"line":444,"column":2},"end":{"line":444,"column":2}},{"start":{"line":444,"column":2},"end":{"line":444,"column":2}}]},"56":{"line":444,"type":"binary-expr","locations":[{"start":{"line":444,"column":6},"end":{"line":444,"column":16}},{"start":{"line":444,"column":20},"end":{"line":444,"column":30}},{"start":{"line":444,"column":34},"end":{"line":444,"column":55}}]},"57":{"line":446,"type":"if","locations":[{"start":{"line":446,"column":6},"end":{"line":446,"column":6}},{"start":{"line":446,"column":6},"end":{"line":446,"column":6}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/javascript-compiler.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/javascript-compiler.js","s":{"1":1,"2":1,"3":1,"4":1,"5":6739,"6":1,"7":1,"8":3716,"9":3428,"10":288,"11":332,"12":332,"13":935,"14":935,"15":3199,"16":1085,"17":2114,"18":458,"19":147,"20":1555,"21":1555,"22":1555,"23":1555,"24":1555,"25":1555,"26":1555,"27":1555,"28":1555,"29":1555,"30":1555,"31":1555,"32":1555,"33":1555,"34":1555,"35":1555,"36":1555,"37":1555,"38":1555,"39":1555,"40":13864,"41":13864,"42":1555,"43":1555,"44":0,"45":1555,"46":1555,"47":936,"48":936,"49":936,"50":1154,"51":619,"52":936,"53":82,"54":936,"55":922,"56":936,"57":278,"58":936,"59":228,"60":936,"61":783,"62":783,"63":936,"64":619,"65":1555,"66":1555,"67":1555,"68":1555,"69":1555,"70":1023,"71":1555,"72":2891,"73":2889,"74":1555,"75":1555,"76":472,"77":1555,"78":1555,"79":184,"80":184,"81":1371,"82":1555,"83":1555,"84":4235,"85":4235,"86":1656,"87":796,"88":860,"89":2579,"90":292,"91":264,"92":264,"93":28,"94":292,"95":2579,"96":2579,"97":1140,"98":1555,"99":1143,"100":324,"101":412,"102":412,"103":269,"104":143,"105":1555,"106":1207,"107":1555,"108":32,"109":32,"110":32,"111":32,"112":32,"113":32,"114":313,"115":313,"116":313,"117":313,"118":313,"119":313,"120":313,"121":1409,"122":26,"123":1409,"124":723,"125":723,"126":723,"127":723,"128":265,"129":828,"130":828,"131":2610,"132":1401,"133":1533,"134":1533,"135":332,"136":1201,"137":1533,"138":1345,"139":1345,"140":1345,"141":1095,"142":250,"143":68,"144":64,"145":4,"146":68,"147":68,"148":80,"149":80,"150":182,"151":182,"152":62,"153":62,"154":62,"155":58,"156":50,"157":8,"158":1626,"159":1626,"160":56,"161":1626,"162":30,"163":30,"164":52,"165":2,"166":52,"167":52,"168":52,"169":52,"170":4,"171":52,"172":10,"173":10,"174":52,"175":198,"176":10559,"177":10559,"178":78,"179":3352,"180":952,"181":2400,"182":244,"183":244,"184":244,"185":244,"186":244,"187":210,"188":210,"189":877,"190":877,"191":877,"192":877,"193":877,"194":877,"195":877,"196":877,"197":86,"198":86,"199":82,"200":4,"201":2,"202":86,"203":26,"204":86,"205":88,"206":88,"207":6,"208":88,"209":18,"210":18,"211":88,"212":88,"213":18,"214":88,"215":18,"216":88,"217":6,"218":88,"219":54,"220":46,"221":8,"222":2,"223":6,"224":1555,"225":1555,"226":625,"227":625,"228":625,"229":625,"230":619,"231":619,"232":619,"233":619,"234":619,"235":619,"236":619,"237":6,"238":6,"239":625,"240":222,"241":222,"242":6,"243":952,"244":952,"245":952,"246":376,"247":952,"248":1503,"249":966,"250":966,"251":6739,"252":4407,"253":1383,"254":1383,"255":4407,"256":2852,"257":723,"258":723,"259":723,"260":723,"261":723,"262":1425,"263":1425,"264":0,"265":1425,"266":1425,"267":1269,"268":1269,"269":156,"270":156,"271":156,"272":156,"273":1425,"274":1425,"275":156,"276":1425,"277":156,"278":1425,"279":879,"280":879,"281":751,"282":879,"283":879,"284":1759,"285":1759,"286":723,"287":723,"288":723,"289":723,"290":0,"291":723,"292":13878,"293":10559,"294":10559,"295":5470,"296":5089,"297":723,"298":0,"299":723,"300":5089,"301":469,"302":469,"303":0,"304":469,"305":3259,"306":54,"307":3205,"308":13802,"309":2459,"310":2459,"311":10401,"312":10397,"313":2459,"314":1331,"315":1331,"316":1331,"317":1676,"318":1676,"319":1676,"320":1676,"321":60,"322":1676,"323":40,"324":40,"325":1676,"326":1676,"327":1676,"328":890,"329":138,"330":890,"331":690,"332":890,"333":890,"334":1676,"335":1676,"336":486,"337":486,"338":486,"339":48,"340":486,"341":44,"342":44,"343":1676,"344":60,"345":1676,"346":40,"347":40,"348":1676,"349":1640,"350":1676,"351":1676,"352":1676,"353":626,"354":626,"355":626,"356":1050,"357":1050,"358":1,"359":1,"360":1,"361":58,"362":1,"363":3716,"364":1},"b":{"1":[3428,288],"2":[1085,2114],"3":[1555,936],"4":[1555,1369,1319],"5":[0,1555],"6":[1555,1555,1555],"7":[936,619],"8":[619,535],"9":[82,854],"10":[922,14],"11":[278,658],"12":[228,708],"13":[783,153],"14":[1023,532],"15":[2889,2],"16":[472,1083],"17":[184,1371],"18":[1656,2579],"19":[796,860],"20":[292,2287],"21":[264,28],"22":[1140,1439],"23":[1143,412],"24":[324,819],"25":[1143,844],"26":[324,25],"27":[264,148],"28":[269,143],"29":[1207,348],"30":[264,943],"31":[26,1383],"32":[265,458],"33":[332,1201],"34":[1533,1515,332],"35":[1095,250],"36":[64,4],"37":[58,4],"38":[50,8],"39":[56,1570],"40":[30,1596],"41":[2,50],"42":[4,48],"43":[10,42],"44":[952,2400],"45":[232,12],"46":[313,564],"47":[82,4],"48":[2,2],"49":[26,60],"50":[6,82],"51":[18,70],"52":[18,70],"53":[18,70],"54":[6,82],"55":[46,8],"56":[54,12],"57":[2,6],"58":[619,6],"59":[619,611],"60":[6,216],"61":[222,112],"62":[376,576],"63":[966,537],"64":[1383,3024],"65":[2852,1555],"66":[0,1425],"67":[1269,156],"68":[0,156],"69":[156,1269],"70":[156,1269],"71":[751,128],"72":[723,1036],"73":[0,723],"74":[9836,723],"75":[5470,5089],"76":[10559,9134],"77":[723,4366],"78":[0,723],"79":[156,313],"80":[0,469],"81":[54,3205],"82":[3259,826],"83":[10397,4],"84":[60,1616],"85":[40,1636],"86":[890,786],"87":[1676,924],"88":[138,752],"89":[690,200],"90":[48,438],"91":[44,442],"92":[60,1616],"93":[40,1636],"94":[1640,36],"95":[626,1050],"96":[3716,3480]},"f":{"1":6739,"2":1561,"3":3716,"4":332,"5":935,"6":3199,"7":458,"8":147,"9":1555,"10":1555,"11":1555,"12":1555,"13":32,"14":313,"15":1409,"16":723,"17":828,"18":2610,"19":1401,"20":1533,"21":1345,"22":68,"23":80,"24":182,"25":62,"26":1626,"27":52,"28":52,"29":198,"30":10559,"31":78,"32":3352,"33":244,"34":210,"35":877,"36":86,"37":88,"38":54,"39":1555,"40":625,"41":952,"42":1503,"43":6739,"44":4407,"45":723,"46":1425,"47":879,"48":879,"49":1759,"50":13878,"51":10559,"52":469,"53":3259,"54":13802,"55":2459,"56":1331,"57":1676,"58":1676,"59":3716},"fnMap":{"1":{"name":"Literal","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":24}}},"2":{"name":"JavaScriptCompiler","line":10,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":30}}},"3":{"name":"(anonymous_3)","line":15,"loc":{"start":{"line":15,"column":14},"end":{"line":15,"column":49}}},"4":{"name":"(anonymous_4)","line":22,"loc":{"start":{"line":22,"column":17},"end":{"line":22,"column":32}}},"5":{"name":"(anonymous_5)","line":28,"loc":{"start":{"line":28,"column":16},"end":{"line":28,"column":27}}},"6":{"name":"(anonymous_6)","line":34,"loc":{"start":{"line":34,"column":18},"end":{"line":34,"column":35}}},"7":{"name":"(anonymous_7)","line":41,"loc":{"start":{"line":41,"column":18},"end":{"line":41,"column":29}}},"8":{"name":"(anonymous_8)","line":46,"loc":{"start":{"line":46,"column":20},"end":{"line":46,"column":31}}},"9":{"name":"(anonymous_9)","line":53,"loc":{"start":{"line":53,"column":11},"end":{"line":53,"column":61}}},"10":{"name":"(anonymous_10)","line":137,"loc":{"start":{"line":137,"column":12},"end":{"line":137,"column":23}}},"11":{"name":"(anonymous_11)","line":144,"loc":{"start":{"line":144,"column":25},"end":{"line":144,"column":44}}},"12":{"name":"(anonymous_12)","line":176,"loc":{"start":{"line":176,"column":15},"end":{"line":176,"column":41}}},"13":{"name":"(anonymous_13)","line":237,"loc":{"start":{"line":237,"column":14},"end":{"line":237,"column":29}}},"14":{"name":"(anonymous_14)","line":255,"loc":{"start":{"line":255,"column":23},"end":{"line":255,"column":34}}},"15":{"name":"(anonymous_15)","line":276,"loc":{"start":{"line":276,"column":17},"end":{"line":276,"column":35}}},"16":{"name":"(anonymous_16)","line":293,"loc":{"start":{"line":293,"column":10},"end":{"line":293,"column":21}}},"17":{"name":"(anonymous_17)","line":310,"loc":{"start":{"line":310,"column":17},"end":{"line":310,"column":28}}},"18":{"name":"(anonymous_18)","line":323,"loc":{"start":{"line":323,"column":14},"end":{"line":323,"column":30}}},"19":{"name":"(anonymous_19)","line":333,"loc":{"start":{"line":333,"column":15},"end":{"line":333,"column":26}}},"20":{"name":"(anonymous_20)","line":344,"loc":{"start":{"line":344,"column":19},"end":{"line":344,"column":50}}},"21":{"name":"(anonymous_21)","line":358,"loc":{"start":{"line":358,"column":24},"end":{"line":358,"column":42}}},"22":{"name":"(anonymous_22)","line":378,"loc":{"start":{"line":378,"column":14},"end":{"line":378,"column":37}}},"23":{"name":"(anonymous_23)","line":388,"loc":{"start":{"line":388,"column":24},"end":{"line":388,"column":42}}},"24":{"name":"(anonymous_24)","line":401,"loc":{"start":{"line":401,"column":25},"end":{"line":401,"column":36}}},"25":{"name":"(anonymous_25)","line":415,"loc":{"start":{"line":415,"column":19},"end":{"line":415,"column":42}}},"26":{"name":"(anonymous_26)","line":430,"loc":{"start":{"line":430,"column":13},"end":{"line":430,"column":24}}},"27":{"name":"(anonymous_27)","line":441,"loc":{"start":{"line":441,"column":12},"end":{"line":441,"column":23}}},"28":{"name":"(anonymous_28)","line":447,"loc":{"start":{"line":447,"column":11},"end":{"line":447,"column":22}}},"29":{"name":"(anonymous_29)","line":468,"loc":{"start":{"line":468,"column":14},"end":{"line":468,"column":31}}},"30":{"name":"(anonymous_30)","line":478,"loc":{"start":{"line":478,"column":8},"end":{"line":478,"column":23}}},"31":{"name":"(anonymous_31)","line":491,"loc":{"start":{"line":491,"column":15},"end":{"line":491,"column":31}}},"32":{"name":"(anonymous_32)","line":503,"loc":{"start":{"line":503,"column":15},"end":{"line":503,"column":30}}},"33":{"name":"(anonymous_33)","line":520,"loc":{"start":{"line":520,"column":16},"end":{"line":520,"column":52}}},"34":{"name":"(anonymous_34)","line":537,"loc":{"start":{"line":537,"column":21},"end":{"line":537,"column":47}}},"35":{"name":"(anonymous_35)","line":554,"loc":{"start":{"line":554,"column":19},"end":{"line":554,"column":46}}},"36":{"name":"(anonymous_36)","line":579,"loc":{"start":{"line":579,"column":17},"end":{"line":579,"column":40}}},"37":{"name":"(anonymous_37)","line":600,"loc":{"start":{"line":600,"column":16},"end":{"line":600,"column":30}}},"38":{"name":"(anonymous_38)","line":627,"loc":{"start":{"line":627,"column":10},"end":{"line":627,"column":31}}},"39":{"name":"(anonymous_39)","line":641,"loc":{"start":{"line":641,"column":19},"end":{"line":641,"column":50}}},"40":{"name":"(anonymous_40)","line":665,"loc":{"start":{"line":665,"column":24},"end":{"line":665,"column":40}}},"41":{"name":"(anonymous_41)","line":674,"loc":{"start":{"line":674,"column":21},"end":{"line":674,"column":36}}},"42":{"name":"(anonymous_42)","line":689,"loc":{"start":{"line":689,"column":15},"end":{"line":689,"column":30}}},"43":{"name":"(anonymous_43)","line":696,"loc":{"start":{"line":696,"column":20},"end":{"line":696,"column":35}}},"44":{"name":"(anonymous_44)","line":700,"loc":{"start":{"line":700,"column":14},"end":{"line":700,"column":31}}},"45":{"name":"(anonymous_45)","line":711,"loc":{"start":{"line":711,"column":13},"end":{"line":711,"column":28}}},"46":{"name":"(anonymous_46)","line":720,"loc":{"start":{"line":720,"column":16},"end":{"line":720,"column":35}}},"47":{"name":"(anonymous_47)","line":759,"loc":{"start":{"line":759,"column":13},"end":{"line":759,"column":24}}},"48":{"name":"(anonymous_48)","line":764,"loc":{"start":{"line":764,"column":16},"end":{"line":764,"column":27}}},"49":{"name":"(anonymous_49)","line":767,"loc":{"start":{"line":767,"column":15},"end":{"line":767,"column":26}}},"50":{"name":"(anonymous_50)","line":781,"loc":{"start":{"line":781,"column":12},"end":{"line":781,"column":23}}},"51":{"name":"(anonymous_51)","line":785,"loc":{"start":{"line":785,"column":12},"end":{"line":785,"column":30}}},"52":{"name":"(anonymous_52)","line":803,"loc":{"start":{"line":803,"column":12},"end":{"line":803,"column":23}}},"53":{"name":"(anonymous_53)","line":814,"loc":{"start":{"line":814,"column":15},"end":{"line":814,"column":33}}},"54":{"name":"(anonymous_54)","line":822,"loc":{"start":{"line":822,"column":16},"end":{"line":822,"column":30}}},"55":{"name":"(anonymous_55)","line":832,"loc":{"start":{"line":832,"column":17},"end":{"line":832,"column":31}}},"56":{"name":"(anonymous_56)","line":844,"loc":{"start":{"line":844,"column":15},"end":{"line":844,"column":54}}},"57":{"name":"(anonymous_57)","line":857,"loc":{"start":{"line":857,"column":16},"end":{"line":857,"column":52}}},"58":{"name":"(anonymous_58)","line":922,"loc":{"start":{"line":922,"column":15},"end":{"line":922,"column":68}}},"59":{"name":"(anonymous_59)","line":960,"loc":{"start":{"line":960,"column":51},"end":{"line":960,"column":66}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":61}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":59}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":51}},"4":{"start":{"line":6,"column":0},"end":{"line":8,"column":1}},"5":{"start":{"line":7,"column":2},"end":{"line":7,"column":21}},"6":{"start":{"line":10,"column":0},"end":{"line":10,"column":32}},"7":{"start":{"line":12,"column":0},"end":{"line":934,"column":2}},"8":{"start":{"line":16,"column":4},"end":{"line":20,"column":5}},"9":{"start":{"line":17,"column":6},"end":{"line":17,"column":33}},"10":{"start":{"line":19,"column":6},"end":{"line":19,"column":41}},"11":{"start":{"line":23,"column":4},"end":{"line":23,"column":40}},"12":{"start":{"line":25,"column":4},"end":{"line":25,"column":44}},"13":{"start":{"line":29,"column":4},"end":{"line":30,"column":46}},"14":{"start":{"line":31,"column":4},"end":{"line":31,"column":32}},"15":{"start":{"line":35,"column":4},"end":{"line":43,"column":5}},"16":{"start":{"line":36,"column":6},"end":{"line":36,"column":38}},"17":{"start":{"line":38,"column":6},"end":{"line":42,"column":8}},"18":{"start":{"line":41,"column":31},"end":{"line":41,"column":66}},"19":{"start":{"line":47,"column":4},"end":{"line":47,"column":33}},"20":{"start":{"line":54,"column":4},"end":{"line":54,"column":35}},"21":{"start":{"line":55,"column":4},"end":{"line":55,"column":27}},"22":{"start":{"line":56,"column":4},"end":{"line":56,"column":50}},"23":{"start":{"line":57,"column":4},"end":{"line":57,"column":42}},"24":{"start":{"line":58,"column":4},"end":{"line":58,"column":32}},"25":{"start":{"line":60,"column":4},"end":{"line":60,"column":38}},"26":{"start":{"line":61,"column":4},"end":{"line":61,"column":29}},"27":{"start":{"line":62,"column":4},"end":{"line":65,"column":6}},"28":{"start":{"line":67,"column":4},"end":{"line":67,"column":20}},"29":{"start":{"line":69,"column":4},"end":{"line":69,"column":23}},"30":{"start":{"line":70,"column":4},"end":{"line":70,"column":24}},"31":{"start":{"line":71,"column":4},"end":{"line":71,"column":22}},"32":{"start":{"line":72,"column":4},"end":{"line":72,"column":34}},"33":{"start":{"line":73,"column":4},"end":{"line":73,"column":21}},"34":{"start":{"line":74,"column":4},"end":{"line":74,"column":27}},"35":{"start":{"line":75,"column":4},"end":{"line":75,"column":26}},"36":{"start":{"line":77,"column":4},"end":{"line":77,"column":47}},"37":{"start":{"line":79,"column":4},"end":{"line":79,"column":93}},"38":{"start":{"line":81,"column":4},"end":{"line":84,"column":10}},"39":{"start":{"line":86,"column":4},"end":{"line":90,"column":5}},"40":{"start":{"line":87,"column":6},"end":{"line":87,"column":26}},"41":{"start":{"line":89,"column":6},"end":{"line":89,"column":51}},"42":{"start":{"line":93,"column":4},"end":{"line":93,"column":24}},"43":{"start":{"line":96,"column":4},"end":{"line":98,"column":5},"skip":true},"44":{"start":{"line":97,"column":6},"end":{"line":97,"column":74},"skip":true},"45":{"start":{"line":100,"column":4},"end":{"line":100,"column":50}},"46":{"start":{"line":101,"column":4},"end":{"line":134,"column":5}},"47":{"start":{"line":102,"column":6},"end":{"line":105,"column":8}},"48":{"start":{"line":106,"column":6},"end":{"line":106,"column":43}},"49":{"start":{"line":107,"column":6},"end":{"line":111,"column":7}},"50":{"start":{"line":108,"column":8},"end":{"line":110,"column":9}},"51":{"start":{"line":109,"column":10},"end":{"line":109,"column":31}},"52":{"start":{"line":113,"column":6},"end":{"line":115,"column":7}},"53":{"start":{"line":114,"column":8},"end":{"line":114,"column":30}},"54":{"start":{"line":116,"column":6},"end":{"line":118,"column":7}},"55":{"start":{"line":117,"column":8},"end":{"line":117,"column":27}},"56":{"start":{"line":119,"column":6},"end":{"line":121,"column":7}},"57":{"start":{"line":120,"column":8},"end":{"line":120,"column":29}},"58":{"start":{"line":122,"column":6},"end":{"line":124,"column":7}},"59":{"start":{"line":123,"column":8},"end":{"line":123,"column":26}},"60":{"start":{"line":126,"column":6},"end":{"line":129,"column":7}},"61":{"start":{"line":127,"column":8},"end":{"line":127,"column":52}},"62":{"start":{"line":128,"column":8},"end":{"line":128,"column":38}},"63":{"start":{"line":131,"column":6},"end":{"line":131,"column":17}},"64":{"start":{"line":133,"column":6},"end":{"line":133,"column":16}},"65":{"start":{"line":140,"column":4},"end":{"line":140,"column":25}},"66":{"start":{"line":141,"column":4},"end":{"line":141,"column":21}},"67":{"start":{"line":145,"column":4},"end":{"line":145,"column":29}},"68":{"start":{"line":147,"column":4},"end":{"line":147,"column":60}},"69":{"start":{"line":148,"column":4},"end":{"line":150,"column":5}},"70":{"start":{"line":149,"column":6},"end":{"line":149,"column":50}},"71":{"start":{"line":153,"column":4},"end":{"line":157,"column":5}},"72":{"start":{"line":154,"column":6},"end":{"line":156,"column":7}},"73":{"start":{"line":155,"column":8},"end":{"line":155,"column":68}},"74":{"start":{"line":159,"column":4},"end":{"line":159,"column":59}},"75":{"start":{"line":161,"column":4},"end":{"line":163,"column":5}},"76":{"start":{"line":162,"column":6},"end":{"line":162,"column":28}},"77":{"start":{"line":166,"column":4},"end":{"line":166,"column":51}},"78":{"start":{"line":168,"column":4},"end":{"line":174,"column":5}},"79":{"start":{"line":169,"column":6},"end":{"line":169,"column":26}},"80":{"start":{"line":171,"column":6},"end":{"line":171,"column":42}},"81":{"start":{"line":173,"column":6},"end":{"line":173,"column":71}},"82":{"start":{"line":177,"column":4},"end":{"line":180,"column":20}},"83":{"start":{"line":182,"column":4},"end":{"line":206,"column":5}},"84":{"start":{"line":183,"column":6},"end":{"line":183,"column":32}},"85":{"start":{"line":184,"column":6},"end":{"line":205,"column":7}},"86":{"start":{"line":185,"column":8},"end":{"line":189,"column":9}},"87":{"start":{"line":186,"column":10},"end":{"line":186,"column":54}},"88":{"start":{"line":188,"column":10},"end":{"line":188,"column":32}},"89":{"start":{"line":191,"column":8},"end":{"line":199,"column":9}},"90":{"start":{"line":192,"column":10},"end":{"line":197,"column":11}},"91":{"start":{"line":193,"column":12},"end":{"line":193,"column":31}},"92":{"start":{"line":194,"column":12},"end":{"line":194,"column":38}},"93":{"start":{"line":196,"column":12},"end":{"line":196,"column":54}},"94":{"start":{"line":198,"column":10},"end":{"line":198,"column":29}},"95":{"start":{"line":200,"column":8},"end":{"line":200,"column":32}},"96":{"start":{"line":202,"column":8},"end":{"line":204,"column":9}},"97":{"start":{"line":203,"column":10},"end":{"line":203,"column":29}},"98":{"start":{"line":208,"column":4},"end":{"line":219,"column":5}},"99":{"start":{"line":209,"column":6},"end":{"line":211,"column":7}},"100":{"start":{"line":210,"column":8},"end":{"line":210,"column":55}},"101":{"start":{"line":213,"column":6},"end":{"line":213,"column":86}},"102":{"start":{"line":214,"column":6},"end":{"line":218,"column":7}},"103":{"start":{"line":215,"column":8},"end":{"line":215,"column":54}},"104":{"start":{"line":217,"column":8},"end":{"line":217,"column":37}},"105":{"start":{"line":221,"column":4},"end":{"line":223,"column":5}},"106":{"start":{"line":222,"column":6},"end":{"line":222,"column":93}},"107":{"start":{"line":225,"column":4},"end":{"line":225,"column":18}},"108":{"start":{"line":238,"column":4},"end":{"line":238,"column":67}},"109":{"start":{"line":240,"column":4},"end":{"line":240,"column":39}},"110":{"start":{"line":241,"column":4},"end":{"line":241,"column":38}},"111":{"start":{"line":243,"column":4},"end":{"line":243,"column":36}},"112":{"start":{"line":244,"column":4},"end":{"line":244,"column":35}},"113":{"start":{"line":246,"column":4},"end":{"line":246,"column":68}},"114":{"start":{"line":256,"column":4},"end":{"line":256,"column":67}},"115":{"start":{"line":259,"column":4},"end":{"line":259,"column":39}},"116":{"start":{"line":260,"column":4},"end":{"line":260,"column":42}},"117":{"start":{"line":262,"column":4},"end":{"line":262,"column":23}},"118":{"start":{"line":264,"column":4},"end":{"line":264,"column":34}},"119":{"start":{"line":265,"column":4},"end":{"line":265,"column":33}},"120":{"start":{"line":267,"column":4},"end":{"line":267,"column":127}},"121":{"start":{"line":277,"column":4},"end":{"line":279,"column":5}},"122":{"start":{"line":278,"column":6},"end":{"line":278,"column":46}},"123":{"start":{"line":281,"column":4},"end":{"line":281,"column":34}},"124":{"start":{"line":296,"column":4},"end":{"line":296,"column":23}},"125":{"start":{"line":297,"column":4},"end":{"line":297,"column":32}},"126":{"start":{"line":298,"column":4},"end":{"line":298,"column":89}},"127":{"start":{"line":299,"column":4},"end":{"line":301,"column":5}},"128":{"start":{"line":300,"column":6},"end":{"line":300,"column":68}},"129":{"start":{"line":311,"column":4},"end":{"line":311,"column":60}},"130":{"start":{"line":313,"column":4},"end":{"line":313,"column":86}},"131":{"start":{"line":324,"column":4},"end":{"line":324,"column":29}},"132":{"start":{"line":334,"column":4},"end":{"line":334,"column":62}},"133":{"start":{"line":346,"column":4},"end":{"line":347,"column":27}},"134":{"start":{"line":349,"column":4},"end":{"line":355,"column":5}},"135":{"start":{"line":352,"column":6},"end":{"line":352,"column":48}},"136":{"start":{"line":354,"column":6},"end":{"line":354,"column":25}},"137":{"start":{"line":357,"column":4},"end":{"line":369,"column":5}},"138":{"start":{"line":358,"column":6},"end":{"line":368,"column":9}},"139":{"start":{"line":359,"column":8},"end":{"line":359,"column":67}},"140":{"start":{"line":362,"column":8},"end":{"line":367,"column":9}},"141":{"start":{"line":363,"column":10},"end":{"line":363,"column":58}},"142":{"start":{"line":366,"column":10},"end":{"line":366,"column":33}},"143":{"start":{"line":380,"column":4},"end":{"line":384,"column":5}},"144":{"start":{"line":381,"column":6},"end":{"line":381,"column":36}},"145":{"start":{"line":383,"column":6},"end":{"line":383,"column":62}},"146":{"start":{"line":386,"column":4},"end":{"line":386,"column":27}},"147":{"start":{"line":387,"column":4},"end":{"line":391,"column":5}},"148":{"start":{"line":388,"column":6},"end":{"line":390,"column":9}},"149":{"start":{"line":389,"column":8},"end":{"line":389,"column":67}},"150":{"start":{"line":402,"column":4},"end":{"line":402,"column":40}},"151":{"start":{"line":404,"column":4},"end":{"line":404,"column":78}},"152":{"start":{"line":416,"column":4},"end":{"line":416,"column":23}},"153":{"start":{"line":417,"column":4},"end":{"line":417,"column":26}},"154":{"start":{"line":421,"column":4},"end":{"line":427,"column":5}},"155":{"start":{"line":422,"column":6},"end":{"line":426,"column":7}},"156":{"start":{"line":423,"column":8},"end":{"line":423,"column":32}},"157":{"start":{"line":425,"column":8},"end":{"line":425,"column":38}},"158":{"start":{"line":431,"column":4},"end":{"line":431,"column":32}},"159":{"start":{"line":433,"column":4},"end":{"line":435,"column":5}},"160":{"start":{"line":434,"column":6},"end":{"line":434,"column":22}},"161":{"start":{"line":436,"column":4},"end":{"line":439,"column":5}},"162":{"start":{"line":437,"column":6},"end":{"line":437,"column":22}},"163":{"start":{"line":438,"column":6},"end":{"line":438,"column":22}},"164":{"start":{"line":442,"column":4},"end":{"line":444,"column":5}},"165":{"start":{"line":443,"column":6},"end":{"line":443,"column":34}},"166":{"start":{"line":445,"column":4},"end":{"line":445,"column":63}},"167":{"start":{"line":448,"column":4},"end":{"line":448,"column":25}},"168":{"start":{"line":449,"column":4},"end":{"line":449,"column":34}},"169":{"start":{"line":451,"column":4},"end":{"line":453,"column":5}},"170":{"start":{"line":452,"column":6},"end":{"line":452,"column":48}},"171":{"start":{"line":454,"column":4},"end":{"line":457,"column":5}},"172":{"start":{"line":455,"column":6},"end":{"line":455,"column":53}},"173":{"start":{"line":456,"column":6},"end":{"line":456,"column":50}},"174":{"start":{"line":459,"column":4},"end":{"line":459,"column":65}},"175":{"start":{"line":469,"column":4},"end":{"line":469,"column":53}},"176":{"start":{"line":479,"column":4},"end":{"line":479,"column":32}},"177":{"start":{"line":480,"column":4},"end":{"line":480,"column":16}},"178":{"start":{"line":492,"column":4},"end":{"line":492,"column":33}},"179":{"start":{"line":504,"column":4},"end":{"line":508,"column":5}},"180":{"start":{"line":505,"column":6},"end":{"line":505,"column":58}},"181":{"start":{"line":507,"column":6},"end":{"line":507,"column":34}},"182":{"start":{"line":521,"column":4},"end":{"line":521,"column":57}},"183":{"start":{"line":523,"column":4},"end":{"line":523,"column":36}},"184":{"start":{"line":524,"column":4},"end":{"line":524,"column":51}},"185":{"start":{"line":526,"column":4},"end":{"line":526,"column":90}},"186":{"start":{"line":527,"column":4},"end":{"line":527,"column":68}},"187":{"start":{"line":538,"column":4},"end":{"line":538,"column":51}},"188":{"start":{"line":539,"column":4},"end":{"line":539,"column":64}},"189":{"start":{"line":555,"column":4},"end":{"line":555,"column":45}},"190":{"start":{"line":556,"column":4},"end":{"line":556,"column":57}},"191":{"start":{"line":557,"column":4},"end":{"line":557,"column":31}},"192":{"start":{"line":559,"column":4},"end":{"line":559,"column":36}},"193":{"start":{"line":561,"column":4},"end":{"line":561,"column":21}},"194":{"start":{"line":562,"column":4},"end":{"line":562,"column":55}},"195":{"start":{"line":564,"column":4},"end":{"line":564,"column":82}},"196":{"start":{"line":566,"column":4},"end":{"line":569,"column":95}},"197":{"start":{"line":580,"column":4},"end":{"line":580,"column":159}},"198":{"start":{"line":582,"column":4},"end":{"line":586,"column":5}},"199":{"start":{"line":583,"column":6},"end":{"line":583,"column":26}},"200":{"start":{"line":584,"column":11},"end":{"line":586,"column":5}},"201":{"start":{"line":585,"column":6},"end":{"line":585,"column":31}},"202":{"start":{"line":587,"column":4},"end":{"line":589,"column":5}},"203":{"start":{"line":588,"column":6},"end":{"line":588,"column":28}},"204":{"start":{"line":591,"column":4},"end":{"line":591,"column":63}},"205":{"start":{"line":601,"column":4},"end":{"line":604,"column":11}},"206":{"start":{"line":606,"column":4},"end":{"line":608,"column":5}},"207":{"start":{"line":607,"column":6},"end":{"line":607,"column":27}},"208":{"start":{"line":609,"column":4},"end":{"line":612,"column":5}},"209":{"start":{"line":610,"column":6},"end":{"line":610,"column":29}},"210":{"start":{"line":611,"column":6},"end":{"line":611,"column":32}},"211":{"start":{"line":614,"column":4},"end":{"line":614,"column":25}},"212":{"start":{"line":615,"column":4},"end":{"line":617,"column":5}},"213":{"start":{"line":616,"column":6},"end":{"line":616,"column":54}},"214":{"start":{"line":618,"column":4},"end":{"line":620,"column":5}},"215":{"start":{"line":619,"column":6},"end":{"line":619,"column":48}},"216":{"start":{"line":621,"column":4},"end":{"line":623,"column":5}},"217":{"start":{"line":622,"column":6},"end":{"line":622,"column":44}},"218":{"start":{"line":624,"column":4},"end":{"line":624,"column":55}},"219":{"start":{"line":628,"column":4},"end":{"line":634,"column":5}},"220":{"start":{"line":629,"column":6},"end":{"line":629,"column":28}},"221":{"start":{"line":630,"column":11},"end":{"line":634,"column":5}},"222":{"start":{"line":631,"column":6},"end":{"line":631,"column":36}},"223":{"start":{"line":633,"column":6},"end":{"line":633,"column":36}},"224":{"start":{"line":642,"column":4},"end":{"line":642,"column":57}},"225":{"start":{"line":644,"column":4},"end":{"line":663,"column":5}},"226":{"start":{"line":645,"column":6},"end":{"line":645,"column":26}},"227":{"start":{"line":646,"column":6},"end":{"line":646,"column":37}},"228":{"start":{"line":648,"column":6},"end":{"line":648,"column":51}},"229":{"start":{"line":650,"column":6},"end":{"line":662,"column":7}},"230":{"start":{"line":651,"column":8},"end":{"line":651,"column":39}},"231":{"start":{"line":652,"column":8},"end":{"line":652,"column":45}},"232":{"start":{"line":653,"column":8},"end":{"line":653,"column":28}},"233":{"start":{"line":654,"column":8},"end":{"line":654,"column":39}},"234":{"start":{"line":655,"column":8},"end":{"line":655,"column":104}},"235":{"start":{"line":656,"column":8},"end":{"line":656,"column":49}},"236":{"start":{"line":658,"column":8},"end":{"line":658,"column":62}},"237":{"start":{"line":660,"column":8},"end":{"line":660,"column":28}},"238":{"start":{"line":661,"column":8},"end":{"line":661,"column":39}},"239":{"start":{"line":666,"column":4},"end":{"line":671,"column":5}},"240":{"start":{"line":667,"column":6},"end":{"line":667,"column":53}},"241":{"start":{"line":668,"column":6},"end":{"line":670,"column":7}},"242":{"start":{"line":669,"column":8},"end":{"line":669,"column":17}},"243":{"start":{"line":675,"column":4},"end":{"line":678,"column":14}},"244":{"start":{"line":680,"column":4},"end":{"line":680,"column":46}},"245":{"start":{"line":682,"column":4},"end":{"line":684,"column":5}},"246":{"start":{"line":683,"column":6},"end":{"line":683,"column":35}},"247":{"start":{"line":686,"column":4},"end":{"line":686,"column":60}},"248":{"start":{"line":690,"column":4},"end":{"line":693,"column":5}},"249":{"start":{"line":691,"column":6},"end":{"line":691,"column":34}},"250":{"start":{"line":692,"column":6},"end":{"line":692,"column":37}},"251":{"start":{"line":697,"column":4},"end":{"line":697,"column":40}},"252":{"start":{"line":701,"column":4},"end":{"line":704,"column":5}},"253":{"start":{"line":702,"column":6},"end":{"line":702,"column":84}},"254":{"start":{"line":703,"column":6},"end":{"line":703,"column":38}},"255":{"start":{"line":706,"column":4},"end":{"line":708,"column":5}},"256":{"start":{"line":707,"column":6},"end":{"line":707,"column":31}},"257":{"start":{"line":712,"column":4},"end":{"line":712,"column":23}},"258":{"start":{"line":714,"column":4},"end":{"line":714,"column":33}},"259":{"start":{"line":715,"column":4},"end":{"line":715,"column":48}},"260":{"start":{"line":716,"column":4},"end":{"line":716,"column":34}},"261":{"start":{"line":717,"column":4},"end":{"line":717,"column":17}},"262":{"start":{"line":721,"column":4},"end":{"line":725,"column":20}},"263":{"start":{"line":728,"column":4},"end":{"line":730,"column":5},"skip":true},"264":{"start":{"line":729,"column":6},"end":{"line":729,"column":56},"skip":true},"265":{"start":{"line":733,"column":4},"end":{"line":733,"column":34}},"266":{"start":{"line":735,"column":4},"end":{"line":746,"column":5}},"267":{"start":{"line":737,"column":6},"end":{"line":737,"column":33}},"268":{"start":{"line":738,"column":6},"end":{"line":738,"column":25}},"269":{"start":{"line":741,"column":6},"end":{"line":741,"column":37}},"270":{"start":{"line":742,"column":6},"end":{"line":742,"column":72}},"271":{"start":{"line":744,"column":6},"end":{"line":744,"column":57}},"272":{"start":{"line":745,"column":6},"end":{"line":745,"column":30}},"273":{"start":{"line":748,"column":4},"end":{"line":748,"column":42}},"274":{"start":{"line":750,"column":4},"end":{"line":752,"column":5}},"275":{"start":{"line":751,"column":6},"end":{"line":751,"column":22}},"276":{"start":{"line":753,"column":4},"end":{"line":755,"column":5}},"277":{"start":{"line":754,"column":6},"end":{"line":754,"column":23}},"278":{"start":{"line":756,"column":4},"end":{"line":756,"column":41}},"279":{"start":{"line":760,"column":4},"end":{"line":760,"column":21}},"280":{"start":{"line":761,"column":4},"end":{"line":761,"column":97}},"281":{"start":{"line":761,"column":49},"end":{"line":761,"column":95}},"282":{"start":{"line":762,"column":4},"end":{"line":762,"column":31}},"283":{"start":{"line":765,"column":4},"end":{"line":765,"column":36}},"284":{"start":{"line":768,"column":4},"end":{"line":768,"column":39}},"285":{"start":{"line":769,"column":4},"end":{"line":779,"column":5}},"286":{"start":{"line":770,"column":6},"end":{"line":770,"column":28}},"287":{"start":{"line":771,"column":6},"end":{"line":778,"column":7}},"288":{"start":{"line":772,"column":8},"end":{"line":772,"column":35}},"289":{"start":{"line":773,"column":8},"end":{"line":777,"column":9}},"290":{"start":{"line":774,"column":10},"end":{"line":774,"column":40}},"291":{"start":{"line":776,"column":10},"end":{"line":776,"column":32}},"292":{"start":{"line":782,"column":4},"end":{"line":782,"column":35}},"293":{"start":{"line":786,"column":4},"end":{"line":787,"column":69}},"294":{"start":{"line":789,"column":4},"end":{"line":800,"column":5}},"295":{"start":{"line":790,"column":6},"end":{"line":790,"column":24}},"296":{"start":{"line":792,"column":6},"end":{"line":798,"column":7}},"297":{"start":{"line":794,"column":8},"end":{"line":796,"column":9},"skip":true},"298":{"start":{"line":795,"column":10},"end":{"line":795,"column":51},"skip":true},"299":{"start":{"line":797,"column":8},"end":{"line":797,"column":25}},"300":{"start":{"line":799,"column":6},"end":{"line":799,"column":18}},"301":{"start":{"line":804,"column":4},"end":{"line":805,"column":39}},"302":{"start":{"line":807,"column":4},"end":{"line":811,"column":5}},"303":{"start":{"line":808,"column":6},"end":{"line":808,"column":24}},"304":{"start":{"line":810,"column":6},"end":{"line":810,"column":18}},"305":{"start":{"line":815,"column":4},"end":{"line":819,"column":5}},"306":{"start":{"line":816,"column":6},"end":{"line":816,"column":39}},"307":{"start":{"line":818,"column":6},"end":{"line":818,"column":31}},"308":{"start":{"line":823,"column":4},"end":{"line":829,"column":43}},"309":{"start":{"line":833,"column":4},"end":{"line":833,"column":19}},"310":{"start":{"line":835,"column":4},"end":{"line":839,"column":5}},"311":{"start":{"line":836,"column":6},"end":{"line":838,"column":7}},"312":{"start":{"line":837,"column":8},"end":{"line":837,"column":60}},"313":{"start":{"line":841,"column":4},"end":{"line":841,"column":39}},"314":{"start":{"line":845,"column":4},"end":{"line":846,"column":76}},"315":{"start":{"line":847,"column":4},"end":{"line":847,"column":65}},"316":{"start":{"line":849,"column":4},"end":{"line":854,"column":6}},"317":{"start":{"line":858,"column":4},"end":{"line":858,"column":83}},"318":{"start":{"line":860,"column":4},"end":{"line":860,"column":45}},"319":{"start":{"line":861,"column":4},"end":{"line":861,"column":35}},"320":{"start":{"line":863,"column":4},"end":{"line":865,"column":5}},"321":{"start":{"line":864,"column":6},"end":{"line":864,"column":40}},"322":{"start":{"line":866,"column":4},"end":{"line":869,"column":5}},"323":{"start":{"line":867,"column":6},"end":{"line":867,"column":42}},"324":{"start":{"line":868,"column":6},"end":{"line":868,"column":45}},"325":{"start":{"line":871,"column":4},"end":{"line":871,"column":30}},"326":{"start":{"line":872,"column":4},"end":{"line":872,"column":30}},"327":{"start":{"line":876,"column":4},"end":{"line":887,"column":5}},"328":{"start":{"line":877,"column":6},"end":{"line":879,"column":7}},"329":{"start":{"line":878,"column":8},"end":{"line":878,"column":30}},"330":{"start":{"line":881,"column":6},"end":{"line":883,"column":7}},"331":{"start":{"line":882,"column":8},"end":{"line":882,"column":30}},"332":{"start":{"line":885,"column":6},"end":{"line":885,"column":27}},"333":{"start":{"line":886,"column":6},"end":{"line":886,"column":32}},"334":{"start":{"line":891,"column":4},"end":{"line":891,"column":22}},"335":{"start":{"line":892,"column":4},"end":{"line":903,"column":5}},"336":{"start":{"line":893,"column":6},"end":{"line":893,"column":30}},"337":{"start":{"line":894,"column":6},"end":{"line":894,"column":24}},"338":{"start":{"line":896,"column":6},"end":{"line":898,"column":7}},"339":{"start":{"line":897,"column":8},"end":{"line":897,"column":33}},"340":{"start":{"line":899,"column":6},"end":{"line":902,"column":7}},"341":{"start":{"line":900,"column":8},"end":{"line":900,"column":35}},"342":{"start":{"line":901,"column":8},"end":{"line":901,"column":38}},"343":{"start":{"line":905,"column":4},"end":{"line":907,"column":5}},"344":{"start":{"line":906,"column":6},"end":{"line":906,"column":46}},"345":{"start":{"line":908,"column":4},"end":{"line":911,"column":5}},"346":{"start":{"line":909,"column":6},"end":{"line":909,"column":50}},"347":{"start":{"line":910,"column":6},"end":{"line":910,"column":56}},"348":{"start":{"line":913,"column":4},"end":{"line":915,"column":5}},"349":{"start":{"line":914,"column":6},"end":{"line":914,"column":28}},"350":{"start":{"line":917,"column":4},"end":{"line":917,"column":19}},"351":{"start":{"line":923,"column":4},"end":{"line":923,"column":87}},"352":{"start":{"line":925,"column":4},"end":{"line":932,"column":5}},"353":{"start":{"line":926,"column":6},"end":{"line":926,"column":34}},"354":{"start":{"line":927,"column":6},"end":{"line":927,"column":29}},"355":{"start":{"line":928,"column":6},"end":{"line":928,"column":34}},"356":{"start":{"line":930,"column":6},"end":{"line":930,"column":27}},"357":{"start":{"line":931,"column":6},"end":{"line":931,"column":16}},"358":{"start":{"line":936,"column":0},"end":{"line":952,"column":13}},"359":{"start":{"line":954,"column":0},"end":{"line":954,"column":59}},"360":{"start":{"line":956,"column":0},"end":{"line":958,"column":1}},"361":{"start":{"line":957,"column":2},"end":{"line":957,"column":41}},"362":{"start":{"line":960,"column":0},"end":{"line":962,"column":2}},"363":{"start":{"line":961,"column":2},"end":{"line":961,"column":93}},"364":{"start":{"line":964,"column":0},"end":{"line":964,"column":40}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":4},"end":{"line":35,"column":4}},{"start":{"line":35,"column":4},"end":{"line":35,"column":4}}]},"3":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":19},"end":{"line":62,"column":26}},{"start":{"line":62,"column":30},"end":{"line":65,"column":5}}]},"4":{"line":79,"type":"binary-expr","locations":[{"start":{"line":79,"column":21},"end":{"line":79,"column":35}},{"start":{"line":79,"column":39},"end":{"line":79,"column":69}},{"start":{"line":79,"column":73},"end":{"line":79,"column":92}}]},"5":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":4},"end":{"line":96,"column":4},"skip":true},{"start":{"line":96,"column":4},"end":{"line":96,"column":4},"skip":true}]},"6":{"line":96,"type":"binary-expr","locations":[{"start":{"line":96,"column":8},"end":{"line":96,"column":22},"skip":true},{"start":{"line":96,"column":26},"end":{"line":96,"column":49},"skip":true},{"start":{"line":96,"column":53},"end":{"line":96,"column":77},"skip":true}]},"7":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":4},"end":{"line":101,"column":4}},{"start":{"line":101,"column":4},"end":{"line":101,"column":4}}]},"8":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":8},"end":{"line":108,"column":8}},{"start":{"line":108,"column":8},"end":{"line":108,"column":8}}]},"9":{"line":113,"type":"if","locations":[{"start":{"line":113,"column":6},"end":{"line":113,"column":6}},{"start":{"line":113,"column":6},"end":{"line":113,"column":6}}]},"10":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":6},"end":{"line":116,"column":6}},{"start":{"line":116,"column":6},"end":{"line":116,"column":6}}]},"11":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":6},"end":{"line":119,"column":6}},{"start":{"line":119,"column":6},"end":{"line":119,"column":6}}]},"12":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":6},"end":{"line":122,"column":6}},{"start":{"line":122,"column":6},"end":{"line":122,"column":6}}]},"13":{"line":126,"type":"if","locations":[{"start":{"line":126,"column":6},"end":{"line":126,"column":6}},{"start":{"line":126,"column":6},"end":{"line":126,"column":6}}]},"14":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":4},"end":{"line":148,"column":4}},{"start":{"line":148,"column":4},"end":{"line":148,"column":4}}]},"15":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":6},"end":{"line":154,"column":6}},{"start":{"line":154,"column":6},"end":{"line":154,"column":6}}]},"16":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":4},"end":{"line":161,"column":4}},{"start":{"line":161,"column":4},"end":{"line":161,"column":4}}]},"17":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":4},"end":{"line":168,"column":4}},{"start":{"line":168,"column":4},"end":{"line":168,"column":4}}]},"18":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":6},"end":{"line":184,"column":6}},{"start":{"line":184,"column":6},"end":{"line":184,"column":6}}]},"19":{"line":185,"type":"if","locations":[{"start":{"line":185,"column":8},"end":{"line":185,"column":8}},{"start":{"line":185,"column":8},"end":{"line":185,"column":8}}]},"20":{"line":191,"type":"if","locations":[{"start":{"line":191,"column":8},"end":{"line":191,"column":8}},{"start":{"line":191,"column":8},"end":{"line":191,"column":8}}]},"21":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":10},"end":{"line":192,"column":10}},{"start":{"line":192,"column":10},"end":{"line":192,"column":10}}]},"22":{"line":202,"type":"if","locations":[{"start":{"line":202,"column":8},"end":{"line":202,"column":8}},{"start":{"line":202,"column":8},"end":{"line":202,"column":8}}]},"23":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":4},"end":{"line":208,"column":4}},{"start":{"line":208,"column":4},"end":{"line":208,"column":4}}]},"24":{"line":209,"type":"if","locations":[{"start":{"line":209,"column":6},"end":{"line":209,"column":6}},{"start":{"line":209,"column":6},"end":{"line":209,"column":6}}]},"25":{"line":209,"type":"binary-expr","locations":[{"start":{"line":209,"column":10},"end":{"line":209,"column":16}},{"start":{"line":209,"column":20},"end":{"line":209,"column":27}}]},"26":{"line":210,"type":"binary-expr","locations":[{"start":{"line":210,"column":31},"end":{"line":210,"column":37}},{"start":{"line":210,"column":41},"end":{"line":210,"column":45}}]},"27":{"line":213,"type":"cond-expr","locations":[{"start":{"line":213,"column":56},"end":{"line":213,"column":58}},{"start":{"line":213,"column":61},"end":{"line":213,"column":84}}]},"28":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":6},"end":{"line":214,"column":6}},{"start":{"line":214,"column":6},"end":{"line":214,"column":6}}]},"29":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":4},"end":{"line":221,"column":4}},{"start":{"line":221,"column":4},"end":{"line":221,"column":4}}]},"30":{"line":222,"type":"cond-expr","locations":[{"start":{"line":222,"column":70},"end":{"line":222,"column":72}},{"start":{"line":222,"column":75},"end":{"line":222,"column":82}}]},"31":{"line":277,"type":"if","locations":[{"start":{"line":277,"column":4},"end":{"line":277,"column":4}},{"start":{"line":277,"column":4},"end":{"line":277,"column":4}}]},"32":{"line":299,"type":"if","locations":[{"start":{"line":299,"column":4},"end":{"line":299,"column":4}},{"start":{"line":299,"column":4},"end":{"line":299,"column":4}}]},"33":{"line":349,"type":"if","locations":[{"start":{"line":349,"column":4},"end":{"line":349,"column":4}},{"start":{"line":349,"column":4},"end":{"line":349,"column":4}}]},"34":{"line":349,"type":"binary-expr","locations":[{"start":{"line":349,"column":8},"end":{"line":349,"column":15}},{"start":{"line":349,"column":19},"end":{"line":349,"column":38}},{"start":{"line":349,"column":42},"end":{"line":349,"column":59}}]},"35":{"line":362,"type":"if","locations":[{"start":{"line":362,"column":8},"end":{"line":362,"column":8}},{"start":{"line":362,"column":8},"end":{"line":362,"column":8}}]},"36":{"line":380,"type":"if","locations":[{"start":{"line":380,"column":4},"end":{"line":380,"column":4}},{"start":{"line":380,"column":4},"end":{"line":380,"column":4}}]},"37":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":4},"end":{"line":421,"column":4}},{"start":{"line":421,"column":4},"end":{"line":421,"column":4}}]},"38":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":6},"end":{"line":422,"column":6}},{"start":{"line":422,"column":6},"end":{"line":422,"column":6}}]},"39":{"line":433,"type":"if","locations":[{"start":{"line":433,"column":4},"end":{"line":433,"column":4}},{"start":{"line":433,"column":4},"end":{"line":433,"column":4}}]},"40":{"line":436,"type":"if","locations":[{"start":{"line":436,"column":4},"end":{"line":436,"column":4}},{"start":{"line":436,"column":4},"end":{"line":436,"column":4}}]},"41":{"line":442,"type":"if","locations":[{"start":{"line":442,"column":4},"end":{"line":442,"column":4}},{"start":{"line":442,"column":4},"end":{"line":442,"column":4}}]},"42":{"line":451,"type":"if","locations":[{"start":{"line":451,"column":4},"end":{"line":451,"column":4}},{"start":{"line":451,"column":4},"end":{"line":451,"column":4}}]},"43":{"line":454,"type":"if","locations":[{"start":{"line":454,"column":4},"end":{"line":454,"column":4}},{"start":{"line":454,"column":4},"end":{"line":454,"column":4}}]},"44":{"line":504,"type":"if","locations":[{"start":{"line":504,"column":4},"end":{"line":504,"column":4}},{"start":{"line":504,"column":4},"end":{"line":504,"column":4}}]},"45":{"line":526,"type":"cond-expr","locations":[{"start":{"line":526,"column":29},"end":{"line":526,"column":49}},{"start":{"line":526,"column":52},"end":{"line":526,"column":54}}]},"46":{"line":568,"type":"cond-expr","locations":[{"start":{"line":568,"column":31},"end":{"line":568,"column":56}},{"start":{"line":568,"column":59},"end":{"line":568,"column":61}}]},"47":{"line":582,"type":"if","locations":[{"start":{"line":582,"column":4},"end":{"line":582,"column":4}},{"start":{"line":582,"column":4},"end":{"line":582,"column":4}}]},"48":{"line":584,"type":"if","locations":[{"start":{"line":584,"column":11},"end":{"line":584,"column":11}},{"start":{"line":584,"column":11},"end":{"line":584,"column":11}}]},"49":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":4},"end":{"line":587,"column":4}},{"start":{"line":587,"column":4},"end":{"line":587,"column":4}}]},"50":{"line":606,"type":"if","locations":[{"start":{"line":606,"column":4},"end":{"line":606,"column":4}},{"start":{"line":606,"column":4},"end":{"line":606,"column":4}}]},"51":{"line":609,"type":"if","locations":[{"start":{"line":609,"column":4},"end":{"line":609,"column":4}},{"start":{"line":609,"column":4},"end":{"line":609,"column":4}}]},"52":{"line":615,"type":"if","locations":[{"start":{"line":615,"column":4},"end":{"line":615,"column":4}},{"start":{"line":615,"column":4},"end":{"line":615,"column":4}}]},"53":{"line":618,"type":"if","locations":[{"start":{"line":618,"column":4},"end":{"line":618,"column":4}},{"start":{"line":618,"column":4},"end":{"line":618,"column":4}}]},"54":{"line":621,"type":"if","locations":[{"start":{"line":621,"column":4},"end":{"line":621,"column":4}},{"start":{"line":621,"column":4},"end":{"line":621,"column":4}}]},"55":{"line":628,"type":"if","locations":[{"start":{"line":628,"column":4},"end":{"line":628,"column":4}},{"start":{"line":628,"column":4},"end":{"line":628,"column":4}}]},"56":{"line":628,"type":"binary-expr","locations":[{"start":{"line":628,"column":8},"end":{"line":628,"column":21}},{"start":{"line":628,"column":25},"end":{"line":628,"column":40}}]},"57":{"line":630,"type":"if","locations":[{"start":{"line":630,"column":11},"end":{"line":630,"column":11}},{"start":{"line":630,"column":11},"end":{"line":630,"column":11}}]},"58":{"line":650,"type":"if","locations":[{"start":{"line":650,"column":6},"end":{"line":650,"column":6}},{"start":{"line":650,"column":6},"end":{"line":650,"column":6}}]},"59":{"line":658,"type":"binary-expr","locations":[{"start":{"line":658,"column":25},"end":{"line":658,"column":39}},{"start":{"line":658,"column":43},"end":{"line":658,"column":61}}]},"60":{"line":668,"type":"if","locations":[{"start":{"line":668,"column":6},"end":{"line":668,"column":6}},{"start":{"line":668,"column":6},"end":{"line":668,"column":6}}]},"61":{"line":668,"type":"binary-expr","locations":[{"start":{"line":668,"column":10},"end":{"line":668,"column":21}},{"start":{"line":668,"column":25},"end":{"line":668,"column":50}}]},"62":{"line":682,"type":"if","locations":[{"start":{"line":682,"column":4},"end":{"line":682,"column":4}},{"start":{"line":682,"column":4},"end":{"line":682,"column":4}}]},"63":{"line":690,"type":"if","locations":[{"start":{"line":690,"column":4},"end":{"line":690,"column":4}},{"start":{"line":690,"column":4},"end":{"line":690,"column":4}}]},"64":{"line":701,"type":"if","locations":[{"start":{"line":701,"column":4},"end":{"line":701,"column":4}},{"start":{"line":701,"column":4},"end":{"line":701,"column":4}}]},"65":{"line":706,"type":"if","locations":[{"start":{"line":706,"column":4},"end":{"line":706,"column":4}},{"start":{"line":706,"column":4},"end":{"line":706,"column":4}}]},"66":{"line":728,"type":"if","locations":[{"start":{"line":728,"column":4},"end":{"line":728,"column":4},"skip":true},{"start":{"line":728,"column":4},"end":{"line":728,"column":4},"skip":true}]},"67":{"line":735,"type":"if","locations":[{"start":{"line":735,"column":4},"end":{"line":735,"column":4}},{"start":{"line":735,"column":4},"end":{"line":735,"column":4}}]},"68":{"line":742,"type":"cond-expr","locations":[{"start":{"line":742,"column":33},"end":{"line":742,"column":52}},{"start":{"line":742,"column":55},"end":{"line":742,"column":71}}]},"69":{"line":750,"type":"if","locations":[{"start":{"line":750,"column":4},"end":{"line":750,"column":4}},{"start":{"line":750,"column":4},"end":{"line":750,"column":4}}]},"70":{"line":753,"type":"if","locations":[{"start":{"line":753,"column":4},"end":{"line":753,"column":4}},{"start":{"line":753,"column":4},"end":{"line":753,"column":4}}]},"71":{"line":761,"type":"if","locations":[{"start":{"line":761,"column":4},"end":{"line":761,"column":4}},{"start":{"line":761,"column":4},"end":{"line":761,"column":4}}]},"72":{"line":769,"type":"if","locations":[{"start":{"line":769,"column":4},"end":{"line":769,"column":4}},{"start":{"line":769,"column":4},"end":{"line":769,"column":4}}]},"73":{"line":773,"type":"if","locations":[{"start":{"line":773,"column":8},"end":{"line":773,"column":8}},{"start":{"line":773,"column":8},"end":{"line":773,"column":8}}]},"74":{"line":787,"type":"cond-expr","locations":[{"start":{"line":787,"column":25},"end":{"line":787,"column":41}},{"start":{"line":787,"column":44},"end":{"line":787,"column":61}}]},"75":{"line":789,"type":"if","locations":[{"start":{"line":789,"column":4},"end":{"line":789,"column":4}},{"start":{"line":789,"column":4},"end":{"line":789,"column":4}}]},"76":{"line":789,"type":"binary-expr","locations":[{"start":{"line":789,"column":8},"end":{"line":789,"column":16}},{"start":{"line":789,"column":21},"end":{"line":789,"column":44}}]},"77":{"line":792,"type":"if","locations":[{"start":{"line":792,"column":6},"end":{"line":792,"column":6}},{"start":{"line":792,"column":6},"end":{"line":792,"column":6}}]},"78":{"line":794,"type":"if","locations":[{"start":{"line":794,"column":8},"end":{"line":794,"column":8},"skip":true},{"start":{"line":794,"column":8},"end":{"line":794,"column":8},"skip":true}]},"79":{"line":804,"type":"cond-expr","locations":[{"start":{"line":804,"column":35},"end":{"line":804,"column":51}},{"start":{"line":804,"column":54},"end":{"line":804,"column":71}}]},"80":{"line":807,"type":"if","locations":[{"start":{"line":807,"column":4},"end":{"line":807,"column":4}},{"start":{"line":807,"column":4},"end":{"line":807,"column":4}}]},"81":{"line":815,"type":"if","locations":[{"start":{"line":815,"column":4},"end":{"line":815,"column":4}},{"start":{"line":815,"column":4},"end":{"line":815,"column":4}}]},"82":{"line":815,"type":"binary-expr","locations":[{"start":{"line":815,"column":8},"end":{"line":815,"column":22}},{"start":{"line":815,"column":26},"end":{"line":815,"column":33}}]},"83":{"line":836,"type":"if","locations":[{"start":{"line":836,"column":6},"end":{"line":836,"column":6}},{"start":{"line":836,"column":6},"end":{"line":836,"column":6}}]},"84":{"line":863,"type":"if","locations":[{"start":{"line":863,"column":4},"end":{"line":863,"column":4}},{"start":{"line":863,"column":4},"end":{"line":863,"column":4}}]},"85":{"line":866,"type":"if","locations":[{"start":{"line":866,"column":4},"end":{"line":866,"column":4}},{"start":{"line":866,"column":4},"end":{"line":866,"column":4}}]},"86":{"line":876,"type":"if","locations":[{"start":{"line":876,"column":4},"end":{"line":876,"column":4}},{"start":{"line":876,"column":4},"end":{"line":876,"column":4}}]},"87":{"line":876,"type":"binary-expr","locations":[{"start":{"line":876,"column":8},"end":{"line":876,"column":15}},{"start":{"line":876,"column":19},"end":{"line":876,"column":26}}]},"88":{"line":877,"type":"if","locations":[{"start":{"line":877,"column":6},"end":{"line":877,"column":6}},{"start":{"line":877,"column":6},"end":{"line":877,"column":6}}]},"89":{"line":881,"type":"if","locations":[{"start":{"line":881,"column":6},"end":{"line":881,"column":6}},{"start":{"line":881,"column":6},"end":{"line":881,"column":6}}]},"90":{"line":896,"type":"if","locations":[{"start":{"line":896,"column":6},"end":{"line":896,"column":6}},{"start":{"line":896,"column":6},"end":{"line":896,"column":6}}]},"91":{"line":899,"type":"if","locations":[{"start":{"line":899,"column":6},"end":{"line":899,"column":6}},{"start":{"line":899,"column":6},"end":{"line":899,"column":6}}]},"92":{"line":905,"type":"if","locations":[{"start":{"line":905,"column":4},"end":{"line":905,"column":4}},{"start":{"line":905,"column":4},"end":{"line":905,"column":4}}]},"93":{"line":908,"type":"if","locations":[{"start":{"line":908,"column":4},"end":{"line":908,"column":4}},{"start":{"line":908,"column":4},"end":{"line":908,"column":4}}]},"94":{"line":913,"type":"if","locations":[{"start":{"line":913,"column":4},"end":{"line":913,"column":4}},{"start":{"line":913,"column":4},"end":{"line":913,"column":4}}]},"95":{"line":925,"type":"if","locations":[{"start":{"line":925,"column":4},"end":{"line":925,"column":4}},{"start":{"line":925,"column":4},"end":{"line":925,"column":4}}]},"96":{"line":961,"type":"binary-expr","locations":[{"start":{"line":961,"column":9},"end":{"line":961,"column":49}},{"start":{"line":961,"column":53},"end":{"line":961,"column":92}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/visitor.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/visitor.js","s":{"1":1,"2":1,"3":276,"4":1},"b":{},"f":{"1":1,"2":276},"fnMap":{"1":{"name":"Visitor","line":2,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}},"2":{"name":"(anonymous_2)","line":7,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":27}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}},"2":{"start":{"line":4,"column":0},"end":{"line":10,"column":2}},"3":{"start":{"line":8,"column":4},"end":{"line":8,"column":37}},"4":{"start":{"line":12,"column":0},"end":{"line":12,"column":29}}},"branchMap":{}},"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/printer.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/printer.js","s":{"1":1,"2":1,"3":48,"4":1,"5":1,"6":48,"7":1,"8":1,"9":1,"10":89,"11":89,"12":50,"13":89,"14":89,"15":1,"16":67,"17":67,"18":59,"19":67,"20":67,"21":1,"22":11,"23":11,"24":11,"25":11,"26":11,"27":9,"28":9,"29":9,"30":9,"31":11,"32":10,"33":8,"34":10,"35":10,"36":10,"37":10,"38":10,"39":8,"40":11,"41":11,"42":1,"43":40,"44":40,"45":11,"46":40,"47":40,"48":40,"49":1,"50":40,"51":1,"52":5,"53":5,"54":2,"55":5,"56":2,"57":5,"58":1,"59":14,"60":14,"61":14,"62":23,"63":23,"64":23,"65":14,"66":1,"67":7,"68":1,"69":3,"70":1,"71":6,"72":1,"73":60,"74":60,"75":1,"76":59,"77":1,"78":5,"79":1,"80":4,"81":1,"82":12,"83":1,"84":2},"b":{"1":[9,2],"2":[10,1],"3":[8,2],"4":[8,2],"5":[12,28],"6":[2,3],"7":[2,3],"8":[1,59]},"f":{"1":48,"2":48,"3":89,"4":67,"5":11,"6":40,"7":40,"8":5,"9":14,"10":7,"11":3,"12":6,"13":60,"14":5,"15":4,"16":12,"17":2},"fnMap":{"1":{"name":"print","line":4,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":20}}},"2":{"name":"PrintVisitor","line":8,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":46}}},"3":{"name":"(anonymous_3)","line":14,"loc":{"start":{"line":14,"column":29},"end":{"line":14,"column":46}}},"4":{"name":"(anonymous_4)","line":25,"loc":{"start":{"line":25,"column":33},"end":{"line":25,"column":51}}},"5":{"name":"(anonymous_5)","line":39,"loc":{"start":{"line":39,"column":31},"end":{"line":39,"column":47}}},"6":{"name":"(anonymous_6)","line":64,"loc":{"start":{"line":64,"column":31},"end":{"line":64,"column":47}}},"7":{"name":"(anonymous_7)","line":78,"loc":{"start":{"line":78,"column":34},"end":{"line":78,"column":53}}},"8":{"name":"(anonymous_8)","line":82,"loc":{"start":{"line":82,"column":33},"end":{"line":82,"column":51}}},"9":{"name":"(anonymous_9)","line":93,"loc":{"start":{"line":93,"column":30},"end":{"line":93,"column":45}}},"10":{"name":"(anonymous_10)","line":106,"loc":{"start":{"line":106,"column":32},"end":{"line":106,"column":49}}},"11":{"name":"(anonymous_11)","line":110,"loc":{"start":{"line":110,"column":32},"end":{"line":110,"column":49}}},"12":{"name":"(anonymous_12)","line":114,"loc":{"start":{"line":114,"column":33},"end":{"line":114,"column":48}}},"13":{"name":"(anonymous_13)","line":118,"loc":{"start":{"line":118,"column":28},"end":{"line":118,"column":41}}},"14":{"name":"(anonymous_14)","line":127,"loc":{"start":{"line":127,"column":38},"end":{"line":127,"column":60}}},"15":{"name":"(anonymous_15)","line":131,"loc":{"start":{"line":131,"column":30},"end":{"line":131,"column":45}}},"16":{"name":"(anonymous_16)","line":135,"loc":{"start":{"line":135,"column":33},"end":{"line":135,"column":51}}},"17":{"name":"(anonymous_17)","line":139,"loc":{"start":{"line":139,"column":33},"end":{"line":139,"column":51}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}},"2":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}},"3":{"start":{"line":5,"column":2},"end":{"line":5,"column":40}},"4":{"start":{"line":8,"column":0},"end":{"line":8,"column":22}},"5":{"start":{"line":8,"column":22},"end":{"line":10,"column":1}},"6":{"start":{"line":9,"column":2},"end":{"line":9,"column":19}},"7":{"start":{"line":12,"column":0},"end":{"line":12,"column":36}},"8":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}},"9":{"start":{"line":14,"column":0},"end":{"line":23,"column":2}},"10":{"start":{"line":15,"column":2},"end":{"line":15,"column":15}},"11":{"start":{"line":17,"column":2},"end":{"line":19,"column":3}},"12":{"start":{"line":18,"column":4},"end":{"line":18,"column":21}},"13":{"start":{"line":21,"column":2},"end":{"line":21,"column":28}},"14":{"start":{"line":22,"column":2},"end":{"line":22,"column":13}},"15":{"start":{"line":25,"column":0},"end":{"line":37,"column":2}},"16":{"start":{"line":26,"column":2},"end":{"line":28,"column":11}},"17":{"start":{"line":30,"column":2},"end":{"line":32,"column":3}},"18":{"start":{"line":31,"column":4},"end":{"line":31,"column":43}},"19":{"start":{"line":34,"column":2},"end":{"line":34,"column":17}},"20":{"start":{"line":36,"column":2},"end":{"line":36,"column":13}},"21":{"start":{"line":39,"column":0},"end":{"line":62,"column":2}},"22":{"start":{"line":40,"column":2},"end":{"line":40,"column":15}},"23":{"start":{"line":42,"column":2},"end":{"line":42,"column":33}},"24":{"start":{"line":43,"column":2},"end":{"line":43,"column":17}},"25":{"start":{"line":44,"column":2},"end":{"line":44,"column":42}},"26":{"start":{"line":45,"column":2},"end":{"line":50,"column":3}},"27":{"start":{"line":46,"column":4},"end":{"line":46,"column":37}},"28":{"start":{"line":47,"column":4},"end":{"line":47,"column":19}},"29":{"start":{"line":48,"column":4},"end":{"line":48,"column":43}},"30":{"start":{"line":49,"column":4},"end":{"line":49,"column":19}},"31":{"start":{"line":51,"column":2},"end":{"line":58,"column":3}},"32":{"start":{"line":52,"column":4},"end":{"line":52,"column":42}},"33":{"start":{"line":52,"column":25},"end":{"line":52,"column":40}},"34":{"start":{"line":53,"column":4},"end":{"line":53,"column":34}},"35":{"start":{"line":54,"column":4},"end":{"line":54,"column":19}},"36":{"start":{"line":55,"column":4},"end":{"line":55,"column":43}},"37":{"start":{"line":56,"column":4},"end":{"line":56,"column":19}},"38":{"start":{"line":57,"column":4},"end":{"line":57,"column":42}},"39":{"start":{"line":57,"column":25},"end":{"line":57,"column":40}},"40":{"start":{"line":59,"column":2},"end":{"line":59,"column":17}},"41":{"start":{"line":61,"column":2},"end":{"line":61,"column":13}},"42":{"start":{"line":64,"column":0},"end":{"line":76,"column":2}},"43":{"start":{"line":65,"column":2},"end":{"line":65,"column":53}},"44":{"start":{"line":67,"column":2},"end":{"line":69,"column":3}},"45":{"start":{"line":68,"column":4},"end":{"line":68,"column":46}},"46":{"start":{"line":71,"column":2},"end":{"line":71,"column":47}},"47":{"start":{"line":73,"column":2},"end":{"line":73,"column":57}},"48":{"start":{"line":75,"column":2},"end":{"line":75,"column":53}},"49":{"start":{"line":78,"column":0},"end":{"line":80,"column":2}},"50":{"start":{"line":79,"column":2},"end":{"line":79,"column":63}},"51":{"start":{"line":82,"column":0},"end":{"line":91,"column":2}},"52":{"start":{"line":83,"column":2},"end":{"line":83,"column":49}},"53":{"start":{"line":84,"column":2},"end":{"line":86,"column":3}},"54":{"start":{"line":85,"column":4},"end":{"line":85,"column":50}},"55":{"start":{"line":87,"column":2},"end":{"line":89,"column":3}},"56":{"start":{"line":88,"column":4},"end":{"line":88,"column":47}},"57":{"start":{"line":90,"column":2},"end":{"line":90,"column":44}},"58":{"start":{"line":93,"column":0},"end":{"line":104,"column":2}},"59":{"start":{"line":94,"column":2},"end":{"line":94,"column":25}},"60":{"start":{"line":95,"column":2},"end":{"line":95,"column":36}},"61":{"start":{"line":97,"column":2},"end":{"line":101,"column":3}},"62":{"start":{"line":98,"column":4},"end":{"line":98,"column":23}},"63":{"start":{"line":99,"column":4},"end":{"line":99,"column":37}},"64":{"start":{"line":100,"column":4},"end":{"line":100,"column":43}},"65":{"start":{"line":103,"column":2},"end":{"line":103,"column":48}},"66":{"start":{"line":106,"column":0},"end":{"line":108,"column":2}},"67":{"start":{"line":107,"column":2},"end":{"line":107,"column":35}},"68":{"start":{"line":110,"column":0},"end":{"line":112,"column":2}},"69":{"start":{"line":111,"column":2},"end":{"line":111,"column":41}},"70":{"start":{"line":114,"column":0},"end":{"line":116,"column":2}},"71":{"start":{"line":115,"column":2},"end":{"line":115,"column":38}},"72":{"start":{"line":118,"column":0},"end":{"line":125,"column":2}},"73":{"start":{"line":119,"column":2},"end":{"line":119,"column":32}},"74":{"start":{"line":120,"column":2},"end":{"line":124,"column":3}},"75":{"start":{"line":121,"column":4},"end":{"line":121,"column":26}},"76":{"start":{"line":123,"column":4},"end":{"line":123,"column":24}},"77":{"start":{"line":127,"column":0},"end":{"line":129,"column":2}},"78":{"start":{"line":128,"column":4},"end":{"line":128,"column":41}},"79":{"start":{"line":131,"column":0},"end":{"line":133,"column":2}},"80":{"start":{"line":132,"column":2},"end":{"line":132,"column":36}},"81":{"start":{"line":135,"column":0},"end":{"line":137,"column":2}},"82":{"start":{"line":136,"column":2},"end":{"line":136,"column":57}},"83":{"start":{"line":139,"column":0},"end":{"line":141,"column":2}},"84":{"start":{"line":140,"column":2},"end":{"line":140,"column":54}}},"branchMap":{"1":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":2},"end":{"line":45,"column":2}},{"start":{"line":45,"column":2},"end":{"line":45,"column":2}}]},"2":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":2},"end":{"line":51,"column":2}},{"start":{"line":51,"column":2},"end":{"line":51,"column":2}}]},"3":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":4},"end":{"line":52,"column":4}},{"start":{"line":52,"column":4},"end":{"line":52,"column":4}}]},"4":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":4},"end":{"line":57,"column":4}},{"start":{"line":57,"column":4},"end":{"line":57,"column":4}}]},"5":{"line":73,"type":"cond-expr","locations":[{"start":{"line":73,"column":22},"end":{"line":73,"column":51}},{"start":{"line":73,"column":54},"end":{"line":73,"column":56}}]},"6":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":2},"end":{"line":84,"column":2}},{"start":{"line":84,"column":2},"end":{"line":84,"column":2}}]},"7":{"line":87,"type":"if","locations":[{"start":{"line":87,"column":2},"end":{"line":87,"column":2}},{"start":{"line":87,"column":2},"end":{"line":87,"column":2}}]},"8":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":2},"end":{"line":120,"column":2}},{"start":{"line":120,"column":2},"end":{"line":120,"column":2}}]}}},"/Users/kpdecker/dev/kpdecker/handlebars.js/lib/precompiler.js":{"path":"/Users/kpdecker/dev/kpdecker/handlebars.js/lib/precompiler.js","s":{"1":1,"2":1,"3":54,"4":3,"5":3,"6":51,"7":51,"8":3,"9":48,"10":51,"11":51,"12":3,"13":45,"14":3,"15":42,"16":6,"17":36,"18":36,"19":3,"20":36,"21":3,"22":3,"23":36,"24":3,"25":36,"26":36,"27":36,"28":27,"29":12,"30":15,"31":3,"32":12,"33":27,"34":27,"35":27,"36":27,"37":27,"38":1,"39":57,"40":57,"41":15,"42":45,"43":45,"44":21,"45":42,"46":42,"47":0,"48":42,"49":42,"50":3,"51":42,"52":21,"53":21,"54":21,"55":42,"56":42,"57":9,"58":33,"59":9,"60":3,"61":9,"62":24,"63":3,"64":24,"65":36,"66":36,"67":36,"68":27,"69":12,"70":6,"71":3,"72":3,"73":12,"74":15,"75":12,"76":36,"77":36,"78":3,"79":36,"80":0,"81":36},"b":{"1":[3,51],"2":[3,48],"3":[3,42],"4":[45,18],"5":[6,36],"6":[42,15,12],"7":[3,33],"8":[36,3],"9":[3,33],"10":[27,9],"11":[12,15],"12":[3,12],"13":[15,42],"14":[21,24],"15":[45,24],"16":[21,21],"17":[0,42],"18":[42,0],"19":[3,39],"20":[21,21],"21":[21,0],"22":[9,33],"23":[9,24],"24":[3,6],"25":[9,9,9],"26":[3,21],"27":[24,9,9],"28":[27,9],"29":[12,15],"30":[6,6],"31":[12,12,12],"32":[3,3],"33":[12,3],"34":[3,33],"35":[0,36]},"f":{"1":54,"2":51,"3":3,"4":57,"5":45,"6":36},"fnMap":{"1":{"name":"(anonymous_1)","line":7,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":36}}},"2":{"name":"(anonymous_2)","line":18,"loc":{"start":{"line":18,"column":25},"end":{"line":18,"column":44}}},"3":{"name":"(anonymous_3)","line":45,"loc":{"start":{"line":45,"column":70},"end":{"line":45,"column":84}}},"4":{"name":"processTemplate","line":63,"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":43}}},"5":{"name":"(anonymous_5)","line":67,"loc":{"start":{"line":67,"column":35},"end":{"line":67,"column":50}}},"6":{"name":"(anonymous_6)","line":114,"loc":{"start":{"line":114,"column":25},"end":{"line":114,"column":44}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":5,"column":34}},"2":{"start":{"line":7,"column":0},"end":{"line":144,"column":2}},"3":{"start":{"line":8,"column":2},"end":{"line":11,"column":3}},"4":{"start":{"line":9,"column":4},"end":{"line":9,"column":36}},"5":{"start":{"line":10,"column":4},"end":{"line":10,"column":11}},"6":{"start":{"line":13,"column":2},"end":{"line":13,"column":21}},"7":{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},"8":{"start":{"line":15,"column":4},"end":{"line":15,"column":86}},"9":{"start":{"line":18,"column":2},"end":{"line":24,"column":5}},"10":{"start":{"line":19,"column":4},"end":{"line":23,"column":5}},"11":{"start":{"line":20,"column":6},"end":{"line":20,"column":28}},"12":{"start":{"line":22,"column":6},"end":{"line":22,"column":88}},"13":{"start":{"line":26,"column":2},"end":{"line":28,"column":3}},"14":{"start":{"line":27,"column":4},"end":{"line":27,"column":70}},"15":{"start":{"line":29,"column":2},"end":{"line":31,"column":3}},"16":{"start":{"line":30,"column":4},"end":{"line":30,"column":89}},"17":{"start":{"line":34,"column":2},"end":{"line":34,"column":17}},"18":{"start":{"line":35,"column":2},"end":{"line":37,"column":3}},"19":{"start":{"line":36,"column":4},"end":{"line":36,"column":30}},"20":{"start":{"line":38,"column":2},"end":{"line":42,"column":3}},"21":{"start":{"line":39,"column":4},"end":{"line":41,"column":5}},"22":{"start":{"line":40,"column":6},"end":{"line":40,"column":34}},"23":{"start":{"line":45,"column":2},"end":{"line":45,"column":108}},"24":{"start":{"line":45,"column":86},"end":{"line":45,"column":104}},"25":{"start":{"line":46,"column":2},"end":{"line":46,"column":50}},"26":{"start":{"line":48,"column":2},"end":{"line":48,"column":18}},"27":{"start":{"line":49,"column":2},"end":{"line":62,"column":3}},"28":{"start":{"line":50,"column":4},"end":{"line":56,"column":5}},"29":{"start":{"line":51,"column":6},"end":{"line":51,"column":142}},"30":{"start":{"line":52,"column":11},"end":{"line":56,"column":5}},"31":{"start":{"line":53,"column":6},"end":{"line":53,"column":72}},"32":{"start":{"line":55,"column":6},"end":{"line":55,"column":37}},"33":{"start":{"line":57,"column":4},"end":{"line":57,"column":70}},"34":{"start":{"line":58,"column":4},"end":{"line":58,"column":32}},"35":{"start":{"line":59,"column":4},"end":{"line":59,"column":23}},"36":{"start":{"line":60,"column":4},"end":{"line":60,"column":32}},"37":{"start":{"line":61,"column":4},"end":{"line":61,"column":29}},"38":{"start":{"line":63,"column":2},"end":{"line":112,"column":3}},"39":{"start":{"line":64,"column":4},"end":{"line":65,"column":33}},"40":{"start":{"line":66,"column":4},"end":{"line":111,"column":5}},"41":{"start":{"line":67,"column":6},"end":{"line":73,"column":9}},"42":{"start":{"line":68,"column":8},"end":{"line":68,"column":41}},"43":{"start":{"line":70,"column":8},"end":{"line":72,"column":9}},"44":{"start":{"line":71,"column":10},"end":{"line":71,"column":50}},"45":{"start":{"line":75,"column":6},"end":{"line":75,"column":47}},"46":{"start":{"line":77,"column":6},"end":{"line":79,"column":7}},"47":{"start":{"line":78,"column":8},"end":{"line":78,"column":33}},"48":{"start":{"line":81,"column":6},"end":{"line":84,"column":8}},"49":{"start":{"line":86,"column":6},"end":{"line":88,"column":7}},"50":{"start":{"line":87,"column":8},"end":{"line":87,"column":28}},"51":{"start":{"line":91,"column":6},"end":{"line":95,"column":7}},"52":{"start":{"line":92,"column":8},"end":{"line":92,"column":38}},"53":{"start":{"line":93,"column":13},"end":{"line":95,"column":7}},"54":{"start":{"line":94,"column":8},"end":{"line":94,"column":53}},"55":{"start":{"line":96,"column":6},"end":{"line":96,"column":49}},"56":{"start":{"line":98,"column":6},"end":{"line":110,"column":7}},"57":{"start":{"line":99,"column":8},"end":{"line":99,"column":65}},"58":{"start":{"line":100,"column":13},"end":{"line":110,"column":7}},"59":{"start":{"line":101,"column":8},"end":{"line":103,"column":9}},"60":{"start":{"line":102,"column":10},"end":{"line":102,"column":33}},"61":{"start":{"line":104,"column":8},"end":{"line":104,"column":125}},"62":{"start":{"line":106,"column":8},"end":{"line":108,"column":9}},"63":{"start":{"line":107,"column":10},"end":{"line":107,"column":33}},"64":{"start":{"line":109,"column":8},"end":{"line":109,"column":115}},"65":{"start":{"line":114,"column":2},"end":{"line":116,"column":5}},"66":{"start":{"line":115,"column":4},"end":{"line":115,"column":41}},"67":{"start":{"line":119,"column":2},"end":{"line":132,"column":3}},"68":{"start":{"line":120,"column":4},"end":{"line":131,"column":5}},"69":{"start":{"line":121,"column":6},"end":{"line":127,"column":7}},"70":{"start":{"line":122,"column":8},"end":{"line":126,"column":9}},"71":{"start":{"line":123,"column":10},"end":{"line":123,"column":55}},"72":{"start":{"line":125,"column":10},"end":{"line":125,"column":45}},"73":{"start":{"line":128,"column":6},"end":{"line":128,"column":25}},"74":{"start":{"line":129,"column":11},"end":{"line":131,"column":5}},"75":{"start":{"line":130,"column":6},"end":{"line":130,"column":27}},"76":{"start":{"line":133,"column":2},"end":{"line":133,"column":27}},"77":{"start":{"line":135,"column":2},"end":{"line":137,"column":3}},"78":{"start":{"line":136,"column":4},"end":{"line":136,"column":60}},"79":{"start":{"line":139,"column":2},"end":{"line":143,"column":3}},"80":{"start":{"line":140,"column":4},"end":{"line":140,"column":50}},"81":{"start":{"line":142,"column":4},"end":{"line":142,"column":24}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":2},"end":{"line":8,"column":2}},{"start":{"line":8,"column":2},"end":{"line":8,"column":2}}]},"2":{"line":14,"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":14,"column":2}},{"start":{"line":14,"column":2},"end":{"line":14,"column":2}}]},"3":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":2},"end":{"line":26,"column":2}},{"start":{"line":26,"column":2},"end":{"line":26,"column":2}}]},"4":{"line":26,"type":"binary-expr","locations":[{"start":{"line":26,"column":6},"end":{"line":26,"column":17}},{"start":{"line":26,"column":21},"end":{"line":26,"column":29}}]},"5":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":2},"end":{"line":29,"column":2}},{"start":{"line":29,"column":2},"end":{"line":29,"column":2}}]},"6":{"line":29,"type":"binary-expr","locations":[{"start":{"line":29,"column":6},"end":{"line":29,"column":17}},{"start":{"line":29,"column":22},"end":{"line":29,"column":49}},{"start":{"line":29,"column":53},"end":{"line":29,"column":97}}]},"7":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":2},"end":{"line":35,"column":2}},{"start":{"line":35,"column":2},"end":{"line":35,"column":2}}]},"8":{"line":35,"type":"binary-expr","locations":[{"start":{"line":35,"column":6},"end":{"line":35,"column":16}},{"start":{"line":35,"column":20},"end":{"line":35,"column":46}}]},"9":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":38,"column":2}},{"start":{"line":38,"column":2},"end":{"line":38,"column":2}}]},"10":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":2},"end":{"line":49,"column":2}},{"start":{"line":49,"column":2},"end":{"line":49,"column":2}}]},"11":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":4},"end":{"line":50,"column":4}},{"start":{"line":50,"column":4},"end":{"line":50,"column":4}}]},"12":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":11},"end":{"line":52,"column":11}},{"start":{"line":52,"column":11},"end":{"line":52,"column":11}}]},"13":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":4}},{"start":{"line":66,"column":4},"end":{"line":66,"column":4}}]},"14":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]},"15":{"line":70,"type":"binary-expr","locations":[{"start":{"line":70,"column":12},"end":{"line":70,"column":32}},{"start":{"line":70,"column":36},"end":{"line":70,"column":67}}]},"16":{"line":71,"type":"binary-expr","locations":[{"start":{"line":71,"column":32},"end":{"line":71,"column":36}},{"start":{"line":71,"column":40},"end":{"line":71,"column":48}}]},"17":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":6},"end":{"line":77,"column":6}},{"start":{"line":77,"column":6},"end":{"line":77,"column":6}}]},"18":{"line":77,"type":"binary-expr","locations":[{"start":{"line":77,"column":10},"end":{"line":77,"column":18}},{"start":{"line":77,"column":22},"end":{"line":77,"column":50}}]},"19":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":6},"end":{"line":86,"column":6}},{"start":{"line":86,"column":6},"end":{"line":86,"column":6}}]},"20":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":6},"end":{"line":91,"column":6}},{"start":{"line":91,"column":6},"end":{"line":91,"column":6}}]},"21":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":13},"end":{"line":93,"column":13}},{"start":{"line":93,"column":13},"end":{"line":93,"column":13}}]},"22":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":6},"end":{"line":98,"column":6}},{"start":{"line":98,"column":6},"end":{"line":98,"column":6}}]},"23":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":13},"end":{"line":100,"column":13}},{"start":{"line":100,"column":13},"end":{"line":100,"column":13}}]},"24":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":8},"end":{"line":101,"column":8}},{"start":{"line":101,"column":8},"end":{"line":101,"column":8}}]},"25":{"line":101,"type":"binary-expr","locations":[{"start":{"line":101,"column":11},"end":{"line":101,"column":19}},{"start":{"line":101,"column":24},"end":{"line":101,"column":50}},{"start":{"line":101,"column":54},"end":{"line":101,"column":99}}]},"26":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":8}},{"start":{"line":106,"column":8},"end":{"line":106,"column":8}}]},"27":{"line":106,"type":"binary-expr","locations":[{"start":{"line":106,"column":11},"end":{"line":106,"column":19}},{"start":{"line":106,"column":24},"end":{"line":106,"column":50}},{"start":{"line":106,"column":54},"end":{"line":106,"column":99}}]},"28":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":2},"end":{"line":119,"column":2}},{"start":{"line":119,"column":2},"end":{"line":119,"column":2}}]},"29":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":4},"end":{"line":120,"column":4}},{"start":{"line":120,"column":4},"end":{"line":120,"column":4}}]},"30":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":6},"end":{"line":121,"column":6}},{"start":{"line":121,"column":6},"end":{"line":121,"column":6}}]},"31":{"line":121,"type":"binary-expr","locations":[{"start":{"line":121,"column":9},"end":{"line":121,"column":34}},{"start":{"line":121,"column":39},"end":{"line":121,"column":65}},{"start":{"line":121,"column":69},"end":{"line":121,"column":113}}]},"32":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":122,"column":8}},{"start":{"line":122,"column":8},"end":{"line":122,"column":8}}]},"33":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":11},"end":{"line":129,"column":11}},{"start":{"line":129,"column":11},"end":{"line":129,"column":11}}]},"34":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":2},"end":{"line":135,"column":2}},{"start":{"line":135,"column":2},"end":{"line":135,"column":2}}]},"35":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":2},"end":{"line":139,"column":2}},{"start":{"line":139,"column":2},"end":{"line":139,"column":2}}]}}}} \ No newline at end of file diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.js.html new file mode 100644 index 0000000..f94ea48 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.js.html @@ -0,0 +1,436 @@ + + + + Code coverage report for dist/cjs/handlebars.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars.js

+

+ + Statements: 100% (25 / 25)      + + + Branches: 100% (0 / 0)      + + + Functions: 100% (3 / 3)      + + + Lines: 100% (25 / 25)      + + Ignored: none      +

+
All files » dist/cjs/ » handlebars.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39  +  +1 +  +  +1 +1 +1 +1 +1 +1 +1 +  +1 +1 +504 +  +504 +82 +  +504 +409 +  +  +504 +504 +504 +504 +504 +  +504 +  +  +1 +1 +  +1 +  +1
"use strict";
+/*globals Handlebars: true */
+var Handlebars = require("./handlebars.runtime")["default"];
+ 
+// Compiler imports
+var AST = require("./handlebars/compiler/ast")["default"];
+var Parser = require("./handlebars/compiler/base").parser;
+var parse = require("./handlebars/compiler/base").parse;
+var Compiler = require("./handlebars/compiler/compiler").Compiler;
+var compile = require("./handlebars/compiler/compiler").compile;
+var precompile = require("./handlebars/compiler/compiler").precompile;
+var JavaScriptCompiler = require("./handlebars/compiler/javascript-compiler")["default"];
+ 
+var _create = Handlebars.create;
+var create = function() {
+  var hb = _create();
+ 
+  hb.compile = function(input, options) {
+    return compile(input, options, hb);
+  };
+  hb.precompile = function (input, options) {
+    return precompile(input, options, hb);
+  };
+ 
+  hb.AST = AST;
+  hb.Compiler = Compiler;
+  hb.JavaScriptCompiler = JavaScriptCompiler;
+  hb.Parser = Parser;
+  hb.parse = parse;
+ 
+  return hb;
+};
+ 
+Handlebars = create();
+Handlebars.create = create;
+ 
+Handlebars['default'] = Handlebars;
+ 
+exports["default"] = Handlebars;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.runtime.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.runtime.js.html new file mode 100644 index 0000000..1a1ec28 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars.runtime.js.html @@ -0,0 +1,424 @@ + + + + Code coverage report for dist/cjs/handlebars.runtime.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars.runtime.js

+

+ + Statements: 100% (20 / 20)      + + + Branches: 100% (0 / 0)      + + + Functions: 100% (2 / 2)      + + + Lines: 100% (20 / 20)      + + Ignored: none      +

+
All files » dist/cjs/ » handlebars.runtime.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35  +  +1 +  +  +  +1 +1 +1 +1 +  +  +1 +505 +  +505 +505 +505 +505 +505 +  +505 +505 +474 +  +  +505 +  +  +1 +1 +  +1 +  +1
"use strict";
+/*globals Handlebars: true */
+var base = require("./handlebars/base");
+ 
+// Each of these augment the Handlebars object. No need to setup here.
+// (This is done to easily share code between commonjs and browse envs)
+var SafeString = require("./handlebars/safe-string")["default"];
+var Exception = require("./handlebars/exception")["default"];
+var Utils = require("./handlebars/utils");
+var runtime = require("./handlebars/runtime");
+ 
+// For compatibility and usage outside of module systems, make the Handlebars object a namespace
+var create = function() {
+  var hb = new base.HandlebarsEnvironment();
+ 
+  Utils.extend(hb, base);
+  hb.SafeString = SafeString;
+  hb.Exception = Exception;
+  hb.Utils = Utils;
+  hb.escapeExpression = Utils.escapeExpression;
+ 
+  hb.VM = runtime;
+  hb.template = function(spec) {
+    return runtime.template(spec, hb);
+  };
+ 
+  return hb;
+};
+ 
+var Handlebars = create();
+Handlebars.create = create;
+ 
+Handlebars['default'] = Handlebars;
+ 
+exports["default"] = Handlebars;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/base.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/base.js.html new file mode 100644 index 0000000..bac3f2b --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/base.js.html @@ -0,0 +1,1012 @@ + + + + Code coverage report for dist/cjs/handlebars/base.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/base.js

+

+ + Statements: 100% (119 / 119)      + + + Branches: 100% (83 / 83)      + + + Functions: 100% (16 / 16)      + + + Lines: 100% (113 / 113)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/ » base.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231  +1 +1 +  +1 +1 +1 +1 +  +  +  +  +  +  +  +1 +1 +  +  +  +  +1 +505 +505 +  +505 +  +  +1 +  +  +  +  +  +  +4059 +2 +1 +  +4057 +  +  +  +1 +  +  +  +2 +1 +  +1 +  +  +  +1 +  +  +  +1 +505 +24 +  +23 +  +  +1 +  +  +  +505 +145 +  +  +145 +26 +119 +40 +79 +57 +49 +1 +  +  +49 +  +8 +  +  +22 +3 +3 +3 +  +  +22 +  +  +  +505 +83 +1 +  +  +82 +82 +  +82 +82 +5 +  +  +82 +  +82 +76 +  +  +82 +81 +75 +173 +160 +160 +160 +  +160 +5 +  +  +173 +  +  +6 +13 +12 +10 +10 +10 +  +10 +3 +  +  +12 +12 +  +  +  +  +  +82 +4 +  +  +82 +  +  +505 +83 +  +  +  +  +83 +44 +  +39 +  +  +  +505 +2 +  +  +505 +9 +  +9 +  +9 +8 +3 +3 +3 +  +  +8 +  +1 +  +  +  +505 +5 +5 +  +  +505 +4 +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +3 +2 +2 +1 +  +  +  +  +1 +1 +1 +1 +109 +109 +109 +  +1
"use strict";
+var Utils = require("./utils");
+var Exception = require("./exception")["default"];
+ 
+var VERSION = "2.0.0";
+exports.VERSION = VERSION;var COMPILER_REVISION = 6;
+exports.COMPILER_REVISION = COMPILER_REVISION;
+var REVISION_CHANGES = {
+  1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
+  2: '== 1.0.0-rc.3',
+  3: '== 1.0.0-rc.4',
+  4: '== 1.x.x',
+  5: '== 2.0.0-alpha.x',
+  6: '>= 2.0.0-beta.1'
+};
+exports.REVISION_CHANGES = REVISION_CHANGES;
+var isArray = Utils.isArray,
+    isFunction = Utils.isFunction,
+    toString = Utils.toString,
+    objectType = '[object Object]';
+ 
+function HandlebarsEnvironment(helpers, partials) {
+  this.helpers = helpers || {};
+  this.partials = partials || {};
+ 
+  registerDefaultHelpers(this);
+}
+ 
+exports.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
+  constructor: HandlebarsEnvironment,
+ 
+  logger: logger,
+  log: log,
+ 
+  registerHelper: function(name, fn) {
+    if (toString.call(name) === objectType) {
+      if (fn) { throw new Exception('Arg not supported with multiple helpers'); }
+      Utils.extend(this.helpers, name);
+    } else {
+      this.helpers[name] = fn;
+    }
+  },
+  unregisterHelper: function(name) {
+    delete this.helpers[name];
+  },
+ 
+  registerPartial: function(name, partial) {
+    if (toString.call(name) === objectType) {
+      Utils.extend(this.partials,  name);
+    } else {
+      this.partials[name] = partial;
+    }
+  },
+  unregisterPartial: function(name) {
+    delete this.partials[name];
+  }
+};
+ 
+function registerDefaultHelpers(instance) {
+  instance.registerHelper('helperMissing', function(/* [args, ]options */) {
+    if(arguments.length === 1) {
+      // A missing field in a {{foo}} constuct.
+      return undefined;
+    } else {
+      // Someone is actually trying to call something, blow up.
+      throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'");
+    }
+  });
+ 
+  instance.registerHelper('blockHelperMissing', function(context, options) {
+    var inverse = options.inverse,
+        fn = options.fn;
+ 
+    if(context === true) {
+      return fn(this);
+    } else if(context === false || context == null) {
+      return inverse(this);
+    } else if (isArray(context)) {
+      if(context.length > 0) {
+        if (options.ids) {
+          options.ids = [options.name];
+        }
+ 
+        return instance.helpers.each(context, options);
+      } else {
+        return inverse(this);
+      }
+    } else {
+      if (options.data && options.ids) {
+        var data = createFrame(options.data);
+        data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
+        options = {data: data};
+      }
+ 
+      return fn(context, options);
+    }
+  });
+ 
+  instance.registerHelper('each', function(context, options) {
+    if (!options) {
+      throw new Exception('Must pass iterator to #each');
+    }
+ 
+    var fn = options.fn, inverse = options.inverse;
+    var i = 0, ret = "", data;
+ 
+    var contextPath;
+    if (options.data && options.ids) {
+      contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
+    }
+ 
+    if (isFunction(context)) { context = context.call(this); }
+ 
+    if (options.data) {
+      data = createFrame(options.data);
+    }
+ 
+    if(context && typeof context === 'object') {
+      if (isArray(context)) {
+        for(var j = context.length; i<j; i++) {
+          if (data) {
+            data.index = i;
+            data.first = (i === 0);
+            data.last  = (i === (context.length-1));
+ 
+            if (contextPath) {
+              data.contextPath = contextPath + i;
+            }
+          }
+          ret = ret + fn(context[i], { data: data });
+        }
+      } else {
+        for(var key in context) {
+          if(context.hasOwnProperty(key)) {
+            if(data) {
+              data.key = key;
+              data.index = i;
+              data.first = (i === 0);
+ 
+              if (contextPath) {
+                data.contextPath = contextPath + key;
+              }
+            }
+            ret = ret + fn(context[key], {data: data});
+            i++;
+          }
+        }
+      }
+    }
+ 
+    if(i === 0){
+      ret = inverse(this);
+    }
+ 
+    return ret;
+  });
+ 
+  instance.registerHelper('if', function(conditional, options) {
+    if (isFunction(conditional)) { conditional = conditional.call(this); }
+ 
+    // Default behavior is to render the positive path if the value is truthy and not empty.
+    // The `includeZero` option may be set to treat the condtional as purely not empty based on the
+    // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
+    if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
+      return options.inverse(this);
+    } else {
+      return options.fn(this);
+    }
+  });
+ 
+  instance.registerHelper('unless', function(conditional, options) {
+    return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
+  });
+ 
+  instance.registerHelper('with', function(context, options) {
+    if (isFunction(context)) { context = context.call(this); }
+ 
+    var fn = options.fn;
+ 
+    if (!Utils.isEmpty(context)) {
+      if (options.data && options.ids) {
+        var data = createFrame(options.data);
+        data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
+        options = {data:data};
+      }
+ 
+      return fn(context, options);
+    } else {
+      return options.inverse(this);
+    }
+  });
+ 
+  instance.registerHelper('log', function(message, options) {
+    var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
+    instance.log(level, message);
+  });
+ 
+  instance.registerHelper('lookup', function(obj, field) {
+    return obj && obj[field];
+  });
+}
+ 
+var logger = {
+  methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
+ 
+  // State enum
+  DEBUG: 0,
+  INFO: 1,
+  WARN: 2,
+  ERROR: 3,
+  level: 3,
+ 
+  // can be overridden in the host environment
+  log: function(level, message) {
+    if (logger.level <= level) {
+      var method = logger.methodMap[level];
+      if (typeof console !== 'undefined' && console[method]) {
+        console[method].call(console, message);
+      }
+    }
+  }
+};
+exports.logger = logger;
+var log = logger.log;
+exports.log = log;
+var createFrame = function(object) {
+  var frame = Utils.extend({}, object);
+  frame._parent = object;
+  return frame;
+};
+exports.createFrame = createFrame;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/ast.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/ast.js.html new file mode 100644 index 0000000..f978155 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/ast.js.html @@ -0,0 +1,961 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/ast.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/ast.js

+

+ + Statements: 100% (107 / 107)      + + + Branches: 100% (36 / 36)      + + + Functions: 100% (16 / 16)      + + + Lines: 100% (107 / 107)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/compiler/ » ast.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214  +1 +  +1 +10460 +10460 +10460 +10460 +10460 +  +  +1 +  +1700 +1700 +1700 +1700 +  +  +  +1588 +1588 +1588 +  +  +1588 +  +1584 +1584 +  +4 +  +  +1588 +1569 +  +  +19 +  +  +  +1588 +1588 +1588 +1588 +1588 +  +  +  +1644 +  +1644 +1644 +  +1644 +1644 +  +  +  +  +1644 +  +  +  +1644 +  +  +  +  +  +  +  +96 +96 +96 +96 +96 +96 +  +96 +  +  +  +602 +  +602 +602 +602 +602 +602 +  +602 +80 +  +  +  +  +5 +  +5 +1 +  +  +4 +  +4 +4 +4 +  +  +  +1617 +1617 +1617 +  +  +  +75 +75 +75 +  +  +  +2756 +2756 +  +2756 +  +  +  +  +2756 +3091 +3091 +  +3091 +163 +11 +152 +67 +67 +  +85 +  +  +2928 +  +  +  +2745 +2745 +2745 +2745 +2745 +  +  +  +2745 +  +2745 +  +  +  +96 +96 +96 +  +  +  +75 +75 +75 +75 +75 +  +  +  +58 +58 +58 +  +  +  +  +  +56 +56 +56 +  +56 +  +  +  +55 +55 +55 +55 +  +  +  +37 +37 +37 +  +37 +  +  +  +  +  +  +  +  +1
"use strict";
+var Exception = require("../exception")["default"];
+ 
+function LocationInfo(locInfo) {
+  locInfo = locInfo || {};
+  this.firstLine   = locInfo.first_line;
+  this.firstColumn = locInfo.first_column;
+  this.lastColumn  = locInfo.last_column;
+  this.lastLine    = locInfo.last_line;
+}
+ 
+var AST = {
+  ProgramNode: function(statements, strip, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "program";
+    this.statements = statements;
+    this.strip = strip;
+  },
+ 
+  MustacheNode: function(rawParams, hash, open, strip, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "mustache";
+    this.strip = strip;
+ 
+    // Open may be a string parsed from the parser or a passed boolean flag
+    if (open != null && open.charAt) {
+      // Must use charAt to support IE pre-10
+      var escapeFlag = open.charAt(3) || open.charAt(2);
+      this.escaped = escapeFlag !== '{' && escapeFlag !== '&';
+    } else {
+      this.escaped = !!open;
+    }
+ 
+    if (rawParams instanceof AST.SexprNode) {
+      this.sexpr = rawParams;
+    } else {
+      // Support old AST API
+      this.sexpr = new AST.SexprNode(rawParams, hash);
+    }
+ 
+    // Support old AST API that stored this info in MustacheNode
+    this.id = this.sexpr.id;
+    this.params = this.sexpr.params;
+    this.hash = this.sexpr.hash;
+    this.eligibleHelper = this.sexpr.eligibleHelper;
+    this.isHelper = this.sexpr.isHelper;
+  },
+ 
+  SexprNode: function(rawParams, hash, locInfo) {
+    LocationInfo.call(this, locInfo);
+ 
+    this.type = "sexpr";
+    this.hash = hash;
+ 
+    var id = this.id = rawParams[0];
+    var params = this.params = rawParams.slice(1);
+ 
+    // a mustache is definitely a helper if:
+    // * it is an eligible helper, and
+    // * it has at least one parameter or hash segment
+    this.isHelper = !!(params.length || hash);
+ 
+    // a mustache is an eligible helper if:
+    // * its id is simple (a single part, not `this` or `..`)
+    this.eligibleHelper = this.isHelper || id.isSimple;
+ 
+    // if a mustache is an eligible helper but not a definite
+    // helper, it is ambiguous, and will be resolved in a later
+    // pass or at runtime.
+  },
+ 
+  PartialNode: function(partialName, context, hash, strip, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type         = "partial";
+    this.partialName  = partialName;
+    this.context      = context;
+    this.hash = hash;
+    this.strip = strip;
+ 
+    this.strip.inlineStandalone = true;
+  },
+ 
+  BlockNode: function(mustache, program, inverse, strip, locInfo) {
+    LocationInfo.call(this, locInfo);
+ 
+    this.type = 'block';
+    this.mustache = mustache;
+    this.program  = program;
+    this.inverse  = inverse;
+    this.strip = strip;
+ 
+    if (inverse && !program) {
+      this.isInverse = true;
+    }
+  },
+ 
+  RawBlockNode: function(mustache, content, close, locInfo) {
+    LocationInfo.call(this, locInfo);
+ 
+    if (mustache.sexpr.id.original !== close) {
+      throw new Exception(mustache.sexpr.id.original + " doesn't match " + close, this);
+    }
+ 
+    content = new AST.ContentNode(content, locInfo);
+ 
+    this.type = 'block';
+    this.mustache = mustache;
+    this.program = new AST.ProgramNode([content], {}, locInfo);
+  },
+ 
+  ContentNode: function(string, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "content";
+    this.original = this.string = string;
+  },
+ 
+  HashNode: function(pairs, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "hash";
+    this.pairs = pairs;
+  },
+ 
+  IdNode: function(parts, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "ID";
+ 
+    var original = "",
+        dig = [],
+        depth = 0,
+        depthString = '';
+ 
+    for(var i=0,l=parts.length; i<l; i++) {
+      var part = parts[i].part;
+      original += (parts[i].separator || '') + part;
+ 
+      if (part === ".." || part === "." || part === "this") {
+        if (dig.length > 0) {
+          throw new Exception("Invalid path: " + original, this);
+        } else if (part === "..") {
+          depth++;
+          depthString += '../';
+        } else {
+          this.isScoped = true;
+        }
+      } else {
+        dig.push(part);
+      }
+    }
+ 
+    this.original = original;
+    this.parts    = dig;
+    this.string   = dig.join('.');
+    this.depth    = depth;
+    this.idName   = depthString + this.string;
+ 
+    // an ID is simple if it only has one part, and that part is not
+    // `..` or `this`.
+    this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
+ 
+    this.stringModeValue = this.string;
+  },
+ 
+  PartialNameNode: function(name, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "PARTIAL_NAME";
+    this.name = name.original;
+  },
+ 
+  DataNode: function(id, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "DATA";
+    this.id = id;
+    this.stringModeValue = id.stringModeValue;
+    this.idName = '@' + id.stringModeValue;
+  },
+ 
+  StringNode: function(string, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "STRING";
+    this.original =
+      this.string =
+      this.stringModeValue = string;
+  },
+ 
+  NumberNode: function(number, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "NUMBER";
+    this.original =
+      this.number = number;
+    this.stringModeValue = Number(number);
+  },
+ 
+  BooleanNode: function(bool, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "BOOLEAN";
+    this.bool = bool;
+    this.stringModeValue = bool === "true";
+  },
+ 
+  CommentNode: function(comment, locInfo) {
+    LocationInfo.call(this, locInfo);
+    this.type = "comment";
+    this.comment = comment;
+ 
+    this.strip = {
+      inlineStandalone: true
+    };
+  }
+};
+ 
+ 
+// Must be exported as an object rather than the root of the module as the jison lexer
+// most modify the object to operate properly.
+exports["default"] = AST;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/base.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/base.js.html new file mode 100644 index 0000000..0f553bf --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/base.js.html @@ -0,0 +1,382 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/base.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/base.js

+

+ + Statements: 100% (13 / 13)      + + + Branches: 100% (2 / 2)      + + + Functions: 100% (1 / 1)      + + + Lines: 100% (12 / 12)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/compiler/ » base.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +1 +1 +1 +1 +  +1 +  +1 +1 +  +1 +  +1052 +  +1049 +  +1049 +  +  +1
"use strict";
+var parser = require("./parser")["default"];
+var AST = require("./ast")["default"];
+var Helpers = require("./helpers");
+var extend = require("../utils").extend;
+ 
+exports.parser = parser;
+ 
+var yy = {};
+extend(yy, Helpers, AST);
+ 
+function parse(input) {
+  // Just return if an already-compile AST was passed in.
+  if (input.constructor === AST.ProgramNode) { return input; }
+ 
+  parser.yy = yy;
+ 
+  return parser.parse(input);
+}
+ 
+exports.parse = parse;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/compiler.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/compiler.js.html new file mode 100644 index 0000000..2c8a871 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/compiler.js.html @@ -0,0 +1,1675 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/compiler.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/compiler.js

+

+ + Statements: 100% (221 / 221)      + + + Branches: 100% (117 / 117)      + + + Functions: 100% (35 / 35)      + + + Lines: 100% (215 / 215)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/compiler/ » compiler.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452  +1 +1 +  +1 +  +1 +  +1 +  +  +  +  +1 +  +  +  +129 +129 +45 +  +  +84 +279 +  +279 +68 +  +  +  +  +  +16 +16 +4 +3 +  +  +  +13 +  +  +  +  +  +1595 +1595 +1595 +1595 +1595 +1595 +  +  +1595 +1595 +  +  +  +  +  +  +  +  +  +1595 +646 +5054 +  +  +  +1595 +  +  +  +5302 +  +  +  +1595 +  +1595 +3165 +  +1593 +  +1593 +2 +  +  +1593 +  +  +  +631 +631 +  +631 +  +631 +  +631 +52 +  +52 +2 +  +  +631 +  +  +  +583 +  +  +  +583 +505 +  +  +583 +126 +  +  +583 +583 +  +583 +232 +351 +32 +  +  +  +32 +32 +32 +32 +  +319 +  +  +  +319 +319 +319 +319 +  +  +583 +  +  +  +60 +  +60 +  +60 +96 +  +60 +96 +  +60 +  +  +  +86 +86 +  +86 +2 +  +84 +  +  +86 +4 +  +82 +82 +  +  +86 +86 +  +  +  +1553 +1419 +  +  +  +  +913 +  +911 +851 +  +60 +  +  +  +  +894 +  +  +  +894 +  +894 +894 +  +894 +  +894 +  +  +  +186 +  +186 +38 +148 +108 +  +  +40 +40 +40 +  +  +186 +  +  +  +468 +  +  +  +468 +210 +258 +2 +  +256 +  +256 +256 +  +  +  +  +965 +  +965 +154 +811 +236 +  +575 +  +  +  +  +1588 +1588 +  +1588 +1588 +  +16 +  +1572 +  +  +  +  +68 +68 +  +  +  +42 +  +  +  +50 +  +  +  +40 +  +  +  +  +  +  +14161 +  +  +  +1636 +  +56 +54 +54 +  +  +  +  +1548 +1548 +1548 +  +  +  +1548 +912 +  +912 +10 +902 +8 +  +  +  +1548 +1080 +186 +  +  +  +468 +502 +  +  +  +  +598 +62 +6 +  +62 +62 +  +62 +  +  +4 +  +  +536 +54 +  +536 +  +  +  +  +468 +468 +  +468 +468 +  +468 +58 +  +410 +  +  +468 +  +  +  +1 +801 +2 +  +  +799 +799 +767 +  +799 +180 +  +  +799 +785 +783 +  +  +1 +155 +2 +  +  +153 +  +153 +71 +  +153 +48 +  +  +153 +  +1 +153 +153 +153 +153 +  +  +  +153 +174 +150 +  +174 +  +153 +2 +1 +  +2 +  +153 +4 +2 +  +4 +  +153 +  +  +1 +621 +241 +  +  +380 +312 +342 +81 +  +  +231 +  + 
"use strict";
+var Exception = require("../exception")["default"];
+var isArray = require("../utils").isArray;
+ 
+var slice = [].slice;
+ 
+function Compiler() {}
+ 
+exports.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a
+// function in a context. This is necessary for mustache compatibility, which
+// requires that context functions in blocks are evaluated by blockHelperMissing,
+// and then proceed as if the resulting value was provided to blockHelperMissing.
+ 
+Compiler.prototype = {
+  compiler: Compiler,
+ 
+  equals: function(other) {
+    var len = this.opcodes.length;
+    if (other.opcodes.length !== len) {
+      return false;
+    }
+ 
+    for (var i = 0; i < len; i++) {
+      var opcode = this.opcodes[i],
+          otherOpcode = other.opcodes[i];
+      if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
+        return false;
+      }
+    }
+ 
+    // We know that length is the same between the two arrays because they are directly tied
+    // to the opcode behavior above.
+    len = this.children.length;
+    for (i = 0; i < len; i++) {
+      if (!this.children[i].equals(other.children[i])) {
+        return false;
+      }
+    }
+ 
+    return true;
+  },
+ 
+  guid: 0,
+ 
+  compile: function(program, options) {
+    this.opcodes = [];
+    this.children = [];
+    this.depths = {list: []};
+    this.options = options;
+    this.stringParams = options.stringParams;
+    this.trackIds = options.trackIds;
+ 
+    // These changes will propagate to the other compiler components
+    var knownHelpers = this.options.knownHelpers;
+    this.options.knownHelpers = {
+      'helperMissing': true,
+      'blockHelperMissing': true,
+      'each': true,
+      'if': true,
+      'unless': true,
+      'with': true,
+      'log': true,
+      'lookup': true
+    };
+    if (knownHelpers) {
+      for (var name in knownHelpers) {
+        this.options.knownHelpers[name] = knownHelpers[name];
+      }
+    }
+ 
+    return this.accept(program);
+  },
+ 
+  accept: function(node) {
+    return this[node.type](node);
+  },
+ 
+  program: function(program) {
+    var statements = program.statements;
+ 
+    for(var i=0, l=statements.length; i<l; i++) {
+      this.accept(statements[i]);
+    }
+    this.isSimple = l === 1;
+ 
+    this.depths.list = this.depths.list.sort(function(a, b) {
+      return a - b;
+    });
+ 
+    return this;
+  },
+ 
+  compileProgram: function(program) {
+    var result = new this.compiler().compile(program, this.options);
+    var guid = this.guid++, depth;
+ 
+    this.usePartial = this.usePartial || result.usePartial;
+ 
+    this.children[guid] = result;
+ 
+    for(var i=0, l=result.depths.list.length; i<l; i++) {
+      depth = result.depths.list[i];
+ 
+      if(depth < 2) { continue; }
+      else { this.addDepth(depth - 1); }
+    }
+ 
+    return guid;
+  },
+ 
+  block: function(block) {
+    var mustache = block.mustache,
+        program = block.program,
+        inverse = block.inverse;
+ 
+    if (program) {
+      program = this.compileProgram(program);
+    }
+ 
+    if (inverse) {
+      inverse = this.compileProgram(inverse);
+    }
+ 
+    var sexpr = mustache.sexpr;
+    var type = this.classifySexpr(sexpr);
+ 
+    if (type === "helper") {
+      this.helperSexpr(sexpr, program, inverse);
+    } else if (type === "simple") {
+      this.simpleSexpr(sexpr);
+ 
+      // now that the simple mustache is resolved, we need to
+      // evaluate it by executing `blockHelperMissing`
+      this.opcode('pushProgram', program);
+      this.opcode('pushProgram', inverse);
+      this.opcode('emptyHash');
+      this.opcode('blockValue', sexpr.id.original);
+    } else {
+      this.ambiguousSexpr(sexpr, program, inverse);
+ 
+      // now that the simple mustache is resolved, we need to
+      // evaluate it by executing `blockHelperMissing`
+      this.opcode('pushProgram', program);
+      this.opcode('pushProgram', inverse);
+      this.opcode('emptyHash');
+      this.opcode('ambiguousBlockValue');
+    }
+ 
+    this.opcode('append');
+  },
+ 
+  hash: function(hash) {
+    var pairs = hash.pairs, i, l;
+ 
+    this.opcode('pushHash');
+ 
+    for(i=0, l=pairs.length; i<l; i++) {
+      this.pushParam(pairs[i][1]);
+    }
+    while(i--) {
+      this.opcode('assignToHash', pairs[i][0]);
+    }
+    this.opcode('popHash');
+  },
+ 
+  partial: function(partial) {
+    var partialName = partial.partialName;
+    this.usePartial = true;
+ 
+    if (partial.hash) {
+      this.accept(partial.hash);
+    } else {
+      this.opcode('push', 'undefined');
+    }
+ 
+    if (partial.context) {
+      this.accept(partial.context);
+    } else {
+      this.opcode('getContext', 0);
+      this.opcode('pushContext');
+    }
+ 
+    this.opcode('invokePartial', partialName.name, partial.indent || '');
+    this.opcode('append');
+  },
+ 
+  content: function(content) {
+    if (content.string) {
+      this.opcode('appendContent', content.string);
+    }
+  },
+ 
+  mustache: function(mustache) {
+    this.sexpr(mustache.sexpr);
+ 
+    if(mustache.escaped && !this.options.noEscape) {
+      this.opcode('appendEscaped');
+    } else {
+      this.opcode('append');
+    }
+  },
+ 
+  ambiguousSexpr: function(sexpr, program, inverse) {
+    var id = sexpr.id,
+        name = id.parts[0],
+        isBlock = program != null || inverse != null;
+ 
+    this.opcode('getContext', id.depth);
+ 
+    this.opcode('pushProgram', program);
+    this.opcode('pushProgram', inverse);
+ 
+    this.ID(id);
+ 
+    this.opcode('invokeAmbiguous', name, isBlock);
+  },
+ 
+  simpleSexpr: function(sexpr) {
+    var id = sexpr.id;
+ 
+    if (id.type === 'DATA') {
+      this.DATA(id);
+    } else if (id.parts.length) {
+      this.ID(id);
+    } else {
+      // Simplified ID for `this`
+      this.addDepth(id.depth);
+      this.opcode('getContext', id.depth);
+      this.opcode('pushContext');
+    }
+ 
+    this.opcode('resolvePossibleLambda');
+  },
+ 
+  helperSexpr: function(sexpr, program, inverse) {
+    var params = this.setupFullMustacheParams(sexpr, program, inverse),
+        id = sexpr.id,
+        name = id.parts[0];
+ 
+    if (this.options.knownHelpers[name]) {
+      this.opcode('invokeKnownHelper', params.length, name);
+    } else if (this.options.knownHelpersOnly) {
+      throw new Exception("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
+    } else {
+      id.falsy = true;
+ 
+      this.ID(id);
+      this.opcode('invokeHelper', params.length, id.original, id.isSimple);
+    }
+  },
+ 
+  sexpr: function(sexpr) {
+    var type = this.classifySexpr(sexpr);
+ 
+    if (type === "simple") {
+      this.simpleSexpr(sexpr);
+    } else if (type === "helper") {
+      this.helperSexpr(sexpr);
+    } else {
+      this.ambiguousSexpr(sexpr);
+    }
+  },
+ 
+  ID: function(id) {
+    this.addDepth(id.depth);
+    this.opcode('getContext', id.depth);
+ 
+    var name = id.parts[0];
+    if (!name) {
+      // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
+      this.opcode('pushContext');
+    } else {
+      this.opcode('lookupOnContext', id.parts, id.falsy, id.isScoped);
+    }
+  },
+ 
+  DATA: function(data) {
+    this.options.data = true;
+    this.opcode('lookupData', data.id.depth, data.id.parts);
+  },
+ 
+  STRING: function(string) {
+    this.opcode('pushString', string.string);
+  },
+ 
+  NUMBER: function(number) {
+    this.opcode('pushLiteral', number.number);
+  },
+ 
+  BOOLEAN: function(bool) {
+    this.opcode('pushLiteral', bool.bool);
+  },
+ 
+  comment: function() {},
+ 
+  // HELPERS
+  opcode: function(name) {
+    this.opcodes.push({ opcode: name, args: slice.call(arguments, 1) });
+  },
+ 
+  addDepth: function(depth) {
+    if(depth === 0) { return; }
+ 
+    if(!this.depths[depth]) {
+      this.depths[depth] = true;
+      this.depths.list.push(depth);
+    }
+  },
+ 
+  classifySexpr: function(sexpr) {
+    var isHelper   = sexpr.isHelper;
+    var isEligible = sexpr.eligibleHelper;
+    var options    = this.options;
+ 
+    // if ambiguous, we can possibly resolve the ambiguity now
+    // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
+    if (isEligible && !isHelper) {
+      var name = sexpr.id.parts[0];
+ 
+      if (options.knownHelpers[name]) {
+        isHelper = true;
+      } else if (options.knownHelpersOnly) {
+        isEligible = false;
+      }
+    }
+ 
+    if (isHelper) { return "helper"; }
+    else if (isEligible) { return "ambiguous"; }
+    else { return "simple"; }
+  },
+ 
+  pushParams: function(params) {
+    for(var i=0, l=params.length; i<l; i++) {
+      this.pushParam(params[i]);
+    }
+  },
+ 
+  pushParam: function(val) {
+    if (this.stringParams) {
+      if(val.depth) {
+        this.addDepth(val.depth);
+      }
+      this.opcode('getContext', val.depth || 0);
+      this.opcode('pushStringParam', val.stringModeValue, val.type);
+ 
+      if (val.type === 'sexpr') {
+        // Subexpressions get evaluated and passed in
+        // in string params mode.
+        this.sexpr(val);
+      }
+    } else {
+      if (this.trackIds) {
+        this.opcode('pushId', val.type, val.idName || val.stringModeValue);
+      }
+      this.accept(val);
+    }
+  },
+ 
+  setupFullMustacheParams: function(sexpr, program, inverse) {
+    var params = sexpr.params;
+    this.pushParams(params);
+ 
+    this.opcode('pushProgram', program);
+    this.opcode('pushProgram', inverse);
+ 
+    if (sexpr.hash) {
+      this.hash(sexpr.hash);
+    } else {
+      this.opcode('emptyHash');
+    }
+ 
+    return params;
+  }
+};
+ 
+function precompile(input, options, env) {
+  if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
+    throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
+  }
+ 
+  options = options || {};
+  if (!('data' in options)) {
+    options.data = true;
+  }
+  if (options.compat) {
+    options.useDepths = true;
+  }
+ 
+  var ast = env.parse(input);
+  var environment = new env.Compiler().compile(ast, options);
+  return new env.JavaScriptCompiler().compile(environment, options);
+}
+ 
+exports.precompile = precompile;function compile(input, options, env) {
+  if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
+    throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
+  }
+ 
+  options = options || {};
+ 
+  if (!('data' in options)) {
+    options.data = true;
+  }
+  if (options.compat) {
+    options.useDepths = true;
+  }
+ 
+  var compiled;
+ 
+  function compileInput() {
+    var ast = env.parse(input);
+    var environment = new env.Compiler().compile(ast, options);
+    var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
+    return env.template(templateSpec);
+  }
+ 
+  // Template is only compiled on first use and cached after that point.
+  var ret = function(context, options) {
+    if (!compiled) {
+      compiled = compileInput();
+    }
+    return compiled.call(this, context, options);
+  };
+  ret._setup = function(options) {
+    if (!compiled) {
+      compiled = compileInput();
+    }
+    return compiled._setup(options);
+  };
+  ret._child = function(i, data, depths) {
+    if (!compiled) {
+      compiled = compileInput();
+    }
+    return compiled._child(i, data, depths);
+  };
+  return ret;
+}
+ 
+exports.compile = compile;function argEquals(a, b) {
+  if (a === b) {
+    return true;
+  }
+ 
+  if (isArray(a) && isArray(b) && a.length === b.length) {
+    for (var i = 0; i < a.length; i++) {
+      if (!argEquals(a[i], b[i])) {
+        return false;
+      }
+    }
+    return true;
+  }
+}
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/helpers.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/helpers.js.html new file mode 100644 index 0000000..39db2a5 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/helpers.js.html @@ -0,0 +1,880 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/helpers.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/helpers.js

+

+ + Statements: 100% (82 / 82)      + + + Branches: 98.92% (92 / 93)      + + + Functions: 100% (7 / 7)      + + + Lines: 100% (81 / 81)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/compiler/ » helpers.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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  +1 +  +1 +2323 +  +  +  +  +  +1 +1 +  +603 +2 +  +  +601 +  +601 +  +  +  +  +  +  +  +  +  +601 +34 +  +  +601 +62 +  +62 +22 +  +62 +22 +  +62 +18 +  +  +  +62 +  +  +17 +17 +  +  +539 +14 +  +  +  +601 +80 +  +521 +  +  +  +1 +1 +2718 +5434 +  +  +5434 +2583 +  +  +2851 +  +  +  +  +  +  +2851 +72 +  +2851 +64 +  +  +2851 +63 +  +63 +  +20 +11 +  +  +  +2851 +109 +  +  +109 +  +2851 +  +115 +  +115 +  +  +  +2718 +  +  +1 +3514 +663 +  +  +  +  +3514 +  +3514 +1480 +  +  +2034 +1712 +  +  +1 +3469 +618 +  +  +3469 +  +3469 +1401 +  +  +2068 +1729 +  +  +  +  +  +  +  +  +  +  +1 +432 +432 +150 +  +  +282 +282 +282 +  +  +  +  +  +  +  +  +  +1 +422 +422 +90 +  +  +  +332 +332 +332 +332 + 
"use strict";
+var Exception = require("../exception")["default"];
+ 
+function stripFlags(open, close) {
+  return {
+    left: open.charAt(2) === '~',
+    right: close.charAt(close.length-3) === '~'
+  };
+}
+ 
+exports.stripFlags = stripFlags;
+function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) {
+  /*jshint -W040 */
+  if (mustache.sexpr.id.original !== close.path.original) {
+    throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache);
+  }
+ 
+  var inverse = inverseAndProgram && inverseAndProgram.program;
+ 
+  var strip = {
+    left: mustache.strip.left,
+    right: close.strip.right,
+ 
+    // Determine the standalone candiacy. Basically flag our content as being possibly standalone
+    // so our parent can determine if we actually are standalone
+    openStandalone: isNextWhitespace(program.statements),
+    closeStandalone: isPrevWhitespace((inverse || program).statements)
+  };
+ 
+  if (mustache.strip.right) {
+    omitRight(program.statements, null, true);
+  }
+ 
+  if (inverse) {
+    var inverseStrip = inverseAndProgram.strip;
+ 
+    if (inverseStrip.left) {
+      omitLeft(program.statements, null, true);
+    }
+    if (inverseStrip.right) {
+      omitRight(inverse.statements, null, true);
+    }
+    if (close.strip.left) {
+      omitLeft(inverse.statements, null, true);
+    }
+ 
+    // Find standalone else statments
+    if (isPrevWhitespace(program.statements)
+        && isNextWhitespace(inverse.statements)) {
+ 
+      omitLeft(program.statements);
+      omitRight(inverse.statements);
+    }
+  } else {
+    if (close.strip.left) {
+      omitLeft(program.statements, null, true);
+    }
+  }
+ 
+  if (inverted) {
+    return new this.BlockNode(mustache, inverse, program, strip, locInfo);
+  } else {
+    return new this.BlockNode(mustache, program, inverse, strip, locInfo);
+  }
+}
+ 
+exports.prepareBlock = prepareBlock;
+function prepareProgram(statements, isRoot) {
+  for (var i = 0, l = statements.length; i < l; i++) {
+    var current = statements[i],
+        strip = current.strip;
+ 
+    if (!strip) {
+      continue;
+    }
+ 
+    var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'),
+        _isNextWhitespace = isNextWhitespace(statements, i, isRoot),
+ 
+        openStandalone = strip.openStandalone && _isPrevWhitespace,
+        closeStandalone = strip.closeStandalone && _isNextWhitespace,
+        inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
+ 
+    if (strip.right) {
+      omitRight(statements, i, true);
+    }
+    if (strip.left) {
+      omitLeft(statements, i, true);
+    }
+ 
+    if (inlineStandalone) {
+      omitRight(statements, i);
+ 
+      if (omitLeft(statements, i)) {
+        // If we are on a standalone node, save the indent info for partials
+        if (current.type === 'partial') {
+          current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : '';
+        }
+      }
+    }
+    if (openStandalone) {
+      omitRight((current.program || current.inverse).statements);
+ 
+      // Strip out the previous content node if it's whitespace only
+      omitLeft(statements, i);
+    }
+    if (closeStandalone) {
+      // Always strip the next node
+      omitRight(statements, i);
+ 
+      omitLeft((current.inverse || current.program).statements);
+    }
+  }
+ 
+  return statements;
+}
+ 
+exports.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) {
+  if (i === undefined) {
+    i = statements.length;
+  }
+ 
+  // Nodes that end with newlines are considered whitespace (but are special
+  // cased for strip operations)
+  var prev = statements[i-1],
+      sibling = statements[i-2];
+  if (!prev) {
+    return isRoot;
+  }
+ 
+  if (prev.type === 'content') {
+    return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original);
+  }
+}
+function isNextWhitespace(statements, i, isRoot) {
+  if (i === undefined) {
+    i = -1;
+  }
+ 
+  var next = statements[i+1],
+      sibling = statements[i+2];
+  if (!next) {
+    return isRoot;
+  }
+ 
+  if (next.type === 'content') {
+    return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original);
+  }
+}
+ 
+// Marks the node to the right of the position as omitted.
+// I.e. {{foo}}' ' will mark the ' ' node as omitted.
+//
+// If i is undefined, then the first child will be marked as such.
+//
+// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
+// content is met.
+function omitRight(statements, i, multiple) {
+  var current = statements[i == null ? 0 : i + 1];
+  if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) {
+    return;
+  }
+ 
+  var original = current.string;
+  current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), '');
+  current.rightStripped = current.string !== original;
+}
+ 
+// Marks the node to the left of the position as omitted.
+// I.e. ' '{{foo}} will mark the ' ' node as omitted.
+//
+// If i is undefined then the last child will be marked as such.
+//
+// If mulitple is truthy then all whitespace will be stripped out until non-whitespace
+// content is met.
+function omitLeft(statements, i, multiple) {
+  var current = statements[i == null ? statements.length - 1 : i - 1];
+  if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) {
+    return;
+  }
+ 
+  // We omit the last node if it's whitespace only and not preceeded by a non-content node.
+  var original = current.string;
+  current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), '');
+  current.leftStripped = current.string !== original;
+  return current.leftStripped;
+}
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/index.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/index.html new file mode 100644 index 0000000..72eacf9 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/index.html @@ -0,0 +1,441 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/ + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/

+

+ + Statements: 99.84% (1269 / 1271)      + + + Branches: 99.4% (660 / 664)      + + + Functions: 100% (164 / 164)      + + + Lines: 99.84% (1229 / 1231)      + + Ignored: 98 statements, 9 functions, 48 branches      +

+
All files » dist/cjs/handlebars/compiler/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ast.js100%(107 / 107)100%(36 / 36)100%(16 / 16)100%(107 / 107)
base.js100%(13 / 13)100%(2 / 2)100%(1 / 1)100%(12 / 12)
compiler.js100%(221 / 221)100%(117 / 117)100%(35 / 35)100%(215 / 215)
helpers.js100%(82 / 82)98.92%(92 / 93)100%(7 / 7)100%(81 / 81)
javascript-compiler.js99.45%(362 / 364)98.46%(192 / 195)100%(59 / 59)99.45%(361 / 363)
parser.js100%(396 / 396)100%(205 / 205)100%(27 / 27)100%(369 / 369)
printer.js100%(84 / 84)100%(16 / 16)100%(17 / 17)100%(80 / 80)
visitor.js100%(4 / 4)100%(0 / 0)100%(2 / 2)100%(4 / 4)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/javascript-compiler.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/javascript-compiler.js.html new file mode 100644 index 0000000..17a4ec2 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/javascript-compiler.js.html @@ -0,0 +1,3211 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/javascript-compiler.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/javascript-compiler.js

+

+ + Statements: 99.45% (362 / 364)      + + + Branches: 98.46% (192 / 195)      + + + Functions: 100% (59 / 59)      + + + Lines: 99.45% (361 / 363)      + + Ignored: 3 statements, 3 branches      +

+
All files » dist/cjs/handlebars/compiler/ » javascript-compiler.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +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 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964  +1 +1 +1 +  +1 +6739 +  +  +1 +  +1 +  +  +  +3716 +3428 +  +288 +  +  +  +332 +  +332 +  +  +  +935 +  +935 +  +  +  +3199 +1085 +  +2114 +  +  +458 +  +  +  +  +  +147 +  +  +  +  +  +  +1555 +1555 +1555 +1555 +1555 +  +1555 +1555 +1555 +  +  +  +  +1555 +  +1555 +1555 +1555 +1555 +1555 +1555 +1555 +  +1555 +  +1555 +  +1555 +  +  +  +  +1555 +13864 +  +13864 +  +  +  +1555 +  +  +1555 +1 +  +  +1555 +1555 +936 +  +  +  +936 +936 +1154 +619 +  +  +  +936 +82 +  +936 +922 +  +936 +278 +  +936 +228 +  +  +936 +783 +783 +  +  +936 +  +619 +  +  +  +  +  +  +1555 +1555 +  +  +  +1555 +  +1555 +1555 +1023 +  +  +  +1555 +2891 +2889 +  +  +  +1555 +  +1555 +472 +  +  +  +1555 +  +1555 +184 +  +184 +  +1371 +  +  +  +1555 +  +  +  +  +1555 +4235 +4235 +1656 +796 +  +860 +  +  +2579 +292 +264 +264 +  +28 +  +292 +  +2579 +  +2579 +1140 +  +  +  +  +1555 +1143 +324 +  +  +412 +412 +269 +  +143 +  +  +  +1555 +1207 +  +  +1555 +  +  +  +  +  +  +  +  +  +  +  +  +32 +  +32 +32 +  +32 +32 +  +32 +  +  +  +  +  +  +  +  +  +313 +  +  +313 +313 +  +313 +  +313 +313 +  +313 +  +  +  +  +  +  +  +  +  +1409 +26 +  +  +1409 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +723 +723 +723 +723 +265 +  +  +  +  +  +  +  +  +  +  +828 +  +828 +  +  +  +  +  +  +  +  +  +  +2610 +  +  +  +  +  +  +  +  +  +1401 +  +  +  +  +  +  +  +  +  +  +  +1533 +  +  +1533 +  +  +332 +  +1201 +  +  +1533 +1345 +1345 +  +  +1345 +1095 +  +  +250 +  +  +  +  +  +  +  +  +  +  +  +  +  +68 +64 +  +4 +  +  +68 +68 +80 +80 +  +  +  +  +  +  +  +  +  +  +  +  +182 +  +182 +  +  +  +  +  +  +  +  +  +  +  +62 +62 +  +  +  +62 +58 +50 +  +8 +  +  +  +  +  +1626 +  +1626 +56 +  +1626 +30 +30 +  +  +  +52 +2 +  +52 +  +  +52 +52 +  +52 +4 +  +52 +10 +10 +  +  +52 +  +  +  +  +  +  +  +  +  +198 +  +  +  +  +  +  +  +  +  +10559 +10559 +  +  +  +  +  +  +  +  +  +  +  +78 +  +  +  +  +  +  +  +  +  +  +  +3352 +952 +  +2400 +  +  +  +  +  +  +  +  +  +  +  +  +  +244 +  +244 +244 +  +244 +244 +  +  +  +  +  +  +  +  +  +  +210 +210 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +877 +877 +877 +  +877 +  +877 +877 +  +877 +  +877 +  +  +  +  +  +  +  +  +  +  +  +  +  +86 +  +86 +82 +4 +2 +  +86 +26 +  +  +86 +  +  +  +  +  +  +  +  +  +88 +  +  +  +  +88 +6 +  +88 +18 +18 +  +  +88 +88 +18 +  +88 +18 +  +88 +6 +  +88 +  +  +  +54 +46 +8 +2 +  +6 +  +  +  +  +  +  +  +  +1555 +  +1555 +625 +625 +  +625 +  +625 +619 +619 +619 +619 +619 +619 +  +619 +  +6 +6 +  +  +  +  +625 +222 +222 +6 +  +  +  +  +  +952 +  +  +  +  +952 +  +952 +376 +  +  +952 +  +  +  +1503 +966 +966 +  +  +  +  +6739 +  +  +  +4407 +1383 +1383 +  +  +4407 +2852 +  +  +  +  +723 +  +723 +723 +723 +723 +  +  +  +1425 +  +  +  +  +  +  +1425 +1 +  +  +  +1425 +  +1425 +  +1269 +1269 +  +  +156 +156 +  +156 +156 +  +  +1425 +  +1425 +156 +  +1425 +156 +  +1425 +  +  +  +879 +879 +879 +  +  +879 +  +  +1759 +1759 +723 +723 +723 +723 +  +  +723 +  +  +  +  +  +13878 +  +  +  +10559 +  +  +10559 +5470 +  +5089 +  +723 +1 +  +723 +  +5089 +  +  +  +  +469 +  +  +469 +  +  +469 +  +  +  +  +3259 +54 +  +3205 +  +  +  +  +13802 +  +  +  +  +  +  +  +  +  +2459 +  +2459 +10401 +10397 +  +  +  +2459 +  +  +  +1331 +  +1331 +  +1331 +  +  +  +  +  +  +  +  +1676 +  +1676 +1676 +  +1676 +60 +  +1676 +40 +40 +  +  +1676 +1676 +  +  +  +1676 +890 +138 +  +  +890 +690 +  +  +890 +890 +  +  +  +  +1676 +1676 +486 +486 +  +486 +48 +  +486 +44 +44 +  +  +  +1676 +60 +  +1676 +40 +40 +  +  +1676 +1640 +  +  +1676 +  +  +  +  +  +1676 +  +1676 +626 +626 +626 +  +1050 +1050 +  +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1 +  +1 +58 +  +  +1 +3716 +  +  +1
"use strict";
+var COMPILER_REVISION = require("../base").COMPILER_REVISION;
+var REVISION_CHANGES = require("../base").REVISION_CHANGES;
+var Exception = require("../exception")["default"];
+ 
+function Literal(value) {
+  this.value = value;
+}
+ 
+function JavaScriptCompiler() {}
+ 
+JavaScriptCompiler.prototype = {
+  // PUBLIC API: You can override these methods in a subclass to provide
+  // alternative compiled forms for name lookup and buffering semantics
+  nameLookup: function(parent, name /* , type*/) {
+    if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
+      return parent + "." + name;
+    } else {
+      return parent + "['" + name + "']";
+    }
+  },
+  depthedLookup: function(name) {
+    this.aliases.lookup = 'this.lookup';
+ 
+    return 'lookup(depths, "' + name + '")';
+  },
+ 
+  compilerInfo: function() {
+    var revision = COMPILER_REVISION,
+        versions = REVISION_CHANGES[revision];
+    return [revision, versions];
+  },
+ 
+  appendToBuffer: function(string) {
+    if (this.environment.isSimple) {
+      return "return " + string + ";";
+    } else {
+      return {
+        appendToBuffer: true,
+        content: string,
+        toString: function() { return "buffer += " + string + ";"; }
+      };
+    }
+  },
+ 
+  initializeBuffer: function() {
+    return this.quotedString("");
+  },
+ 
+  namespace: "Handlebars",
+  // END PUBLIC API
+ 
+  compile: function(environment, options, context, asObject) {
+    this.environment = environment;
+    this.options = options;
+    this.stringParams = this.options.stringParams;
+    this.trackIds = this.options.trackIds;
+    this.precompile = !asObject;
+ 
+    this.name = this.environment.name;
+    this.isChild = !!context;
+    this.context = context || {
+      programs: [],
+      environments: []
+    };
+ 
+    this.preamble();
+ 
+    this.stackSlot = 0;
+    this.stackVars = [];
+    this.aliases = {};
+    this.registers = { list: [] };
+    this.hashes = [];
+    this.compileStack = [];
+    this.inlineStack = [];
+ 
+    this.compileChildren(environment, options);
+ 
+    this.useDepths = this.useDepths || environment.depths.list.length || this.options.compat;
+ 
+    var opcodes = environment.opcodes,
+        opcode,
+        i,
+        l;
+ 
+    for (i = 0, l = opcodes.length; i < l; i++) {
+      opcode = opcodes[i];
+ 
+      this[opcode.opcode].apply(this, opcode.args);
+    }
+ 
+    // Flush any trailing content that might be pending.
+    this.pushSource('');
+ 
+    /* istanbul ignore next */
+    Iif (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
+      throw new Exception('Compile completed with content left on stack');
+    }
+ 
+    var fn = this.createFunctionContext(asObject);
+    if (!this.isChild) {
+      var ret = {
+        compiler: this.compilerInfo(),
+        main: fn
+      };
+      var programs = this.context.programs;
+      for (i = 0, l = programs.length; i < l; i++) {
+        if (programs[i]) {
+          ret[i] = programs[i];
+        }
+      }
+ 
+      if (this.environment.usePartial) {
+        ret.usePartial = true;
+      }
+      if (this.options.data) {
+        ret.useData = true;
+      }
+      if (this.useDepths) {
+        ret.useDepths = true;
+      }
+      if (this.options.compat) {
+        ret.compat = true;
+      }
+ 
+      if (!asObject) {
+        ret.compiler = JSON.stringify(ret.compiler);
+        ret = this.objectLiteral(ret);
+      }
+ 
+      return ret;
+    } else {
+      return fn;
+    }
+  },
+ 
+  preamble: function() {
+    // track the last context pushed into place to allow skipping the
+    // getContext opcode when it would be a noop
+    this.lastContext = 0;
+    this.source = [];
+  },
+ 
+  createFunctionContext: function(asObject) {
+    var varDeclarations = '';
+ 
+    var locals = this.stackVars.concat(this.registers.list);
+    if(locals.length > 0) {
+      varDeclarations += ", " + locals.join(", ");
+    }
+ 
+    // Generate minimizer alias mappings
+    for (var alias in this.aliases) {
+      if (this.aliases.hasOwnProperty(alias)) {
+        varDeclarations += ', ' + alias + '=' + this.aliases[alias];
+      }
+    }
+ 
+    var params = ["depth0", "helpers", "partials", "data"];
+ 
+    if (this.useDepths) {
+      params.push('depths');
+    }
+ 
+    // Perform a second pass over the output to merge content when possible
+    var source = this.mergeSource(varDeclarations);
+ 
+    if (asObject) {
+      params.push(source);
+ 
+      return Function.apply(this, params);
+    } else {
+      return 'function(' + params.join(',') + ') {\n  ' + source + '}';
+    }
+  },
+  mergeSource: function(varDeclarations) {
+    var source = '',
+        buffer,
+        appendOnly = !this.forceBuffer,
+        appendFirst;
+ 
+    for (var i = 0, len = this.source.length; i < len; i++) {
+      var line = this.source[i];
+      if (line.appendToBuffer) {
+        if (buffer) {
+          buffer = buffer + '\n    + ' + line.content;
+        } else {
+          buffer = line.content;
+        }
+      } else {
+        if (buffer) {
+          if (!source) {
+            appendFirst = true;
+            source = buffer + ';\n  ';
+          } else {
+            source += 'buffer += ' + buffer + ';\n  ';
+          }
+          buffer = undefined;
+        }
+        source += line + '\n  ';
+ 
+        if (!this.environment.isSimple) {
+          appendOnly = false;
+        }
+      }
+    }
+ 
+    if (appendOnly) {
+      if (buffer || !source) {
+        source += 'return ' + (buffer || '""') + ';\n';
+      }
+    } else {
+      varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer());
+      if (buffer) {
+        source += 'return buffer + ' + buffer + ';\n';
+      } else {
+        source += 'return buffer;\n';
+      }
+    }
+ 
+    if (varDeclarations) {
+      source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n  ') + source;
+    }
+ 
+    return source;
+  },
+ 
+  // [blockValue]
+  //
+  // On stack, before: hash, inverse, program, value
+  // On stack, after: return value of blockHelperMissing
+  //
+  // The purpose of this opcode is to take a block of the form
+  // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
+  // replace it on the stack with the result of properly
+  // invoking blockHelperMissing.
+  blockValue: function(name) {
+    this.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+ 
+    var params = [this.contextName(0)];
+    this.setupParams(name, 0, params);
+ 
+    var blockName = this.popStack();
+    params.splice(1, 0, blockName);
+ 
+    this.push('blockHelperMissing.call(' + params.join(', ') + ')');
+  },
+ 
+  // [ambiguousBlockValue]
+  //
+  // On stack, before: hash, inverse, program, value
+  // Compiler value, before: lastHelper=value of last found helper, if any
+  // On stack, after, if no lastHelper: same as [blockValue]
+  // On stack, after, if lastHelper: value
+  ambiguousBlockValue: function() {
+    this.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+ 
+    // We're being a bit cheeky and reusing the options value from the prior exec
+    var params = [this.contextName(0)];
+    this.setupParams('', 0, params, true);
+ 
+    this.flushInline();
+ 
+    var current = this.topStack();
+    params.splice(1, 0, current);
+ 
+    this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
+  },
+ 
+  // [appendContent]
+  //
+  // On stack, before: ...
+  // On stack, after: ...
+  //
+  // Appends the string value of `content` to the current buffer
+  appendContent: function(content) {
+    if (this.pendingContent) {
+      content = this.pendingContent + content;
+    }
+ 
+    this.pendingContent = content;
+  },
+ 
+  // [append]
+  //
+  // On stack, before: value, ...
+  // On stack, after: ...
+  //
+  // Coerces `value` to a String and appends it to the current buffer.
+  //
+  // If `value` is truthy, or 0, it is coerced into a string and appended
+  // Otherwise, the empty string is appended
+  append: function() {
+    // Force anything that is inlined onto the stack so we don't have duplication
+    // when we examine local
+    this.flushInline();
+    var local = this.popStack();
+    this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }');
+    if (this.environment.isSimple) {
+      this.pushSource("else { " + this.appendToBuffer("''") + " }");
+    }
+  },
+ 
+  // [appendEscaped]
+  //
+  // On stack, before: value, ...
+  // On stack, after: ...
+  //
+  // Escape `value` and append it to the buffer
+  appendEscaped: function() {
+    this.aliases.escapeExpression = 'this.escapeExpression';
+ 
+    this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"));
+  },
+ 
+  // [getContext]
+  //
+  // On stack, before: ...
+  // On stack, after: ...
+  // Compiler value, after: lastContext=depth
+  //
+  // Set the value of the `lastContext` compiler value to the depth
+  getContext: function(depth) {
+    this.lastContext = depth;
+  },
+ 
+  // [pushContext]
+  //
+  // On stack, before: ...
+  // On stack, after: currentContext, ...
+  //
+  // Pushes the value of the current context onto the stack.
+  pushContext: function() {
+    this.pushStackLiteral(this.contextName(this.lastContext));
+  },
+ 
+  // [lookupOnContext]
+  //
+  // On stack, before: ...
+  // On stack, after: currentContext[name], ...
+  //
+  // Looks up the value of `name` on the current context and pushes
+  // it onto the stack.
+  lookupOnContext: function(parts, falsy, scoped) {
+    /*jshint -W083 */
+    var i = 0,
+        len = parts.length;
+ 
+    if (!scoped && this.options.compat && !this.lastContext) {
+      // The depthed query is expected to handle the undefined logic for the root level that
+      // is implemented below, so we evaluate that directly in compat mode
+      this.push(this.depthedLookup(parts[i++]));
+    } else {
+      this.pushContext();
+    }
+ 
+    for (; i < len; i++) {
+      this.replaceStack(function(current) {
+        var lookup = this.nameLookup(current, parts[i], 'context');
+        // We want to ensure that zero and false are handled properly if the context (falsy flag)
+        // needs to have the special handling for these values.
+        if (!falsy) {
+          return ' != null ? ' + lookup + ' : ' + current;
+        } else {
+          // Otherwise we can use generic falsy handling
+          return ' && ' + lookup;
+        }
+      });
+    }
+  },
+ 
+  // [lookupData]
+  //
+  // On stack, before: ...
+  // On stack, after: data, ...
+  //
+  // Push the data lookup operator
+  lookupData: function(depth, parts) {
+    /*jshint -W083 */
+    if (!depth) {
+      this.pushStackLiteral('data');
+    } else {
+      this.pushStackLiteral('this.data(data, ' + depth + ')');
+    }
+ 
+    var len = parts.length;
+    for (var i = 0; i < len; i++) {
+      this.replaceStack(function(current) {
+        return ' && ' + this.nameLookup(current, parts[i], 'data');
+      });
+    }
+  },
+ 
+  // [resolvePossibleLambda]
+  //
+  // On stack, before: value, ...
+  // On stack, after: resolved value, ...
+  //
+  // If the `value` is a lambda, replace it on the stack by
+  // the return value of the lambda
+  resolvePossibleLambda: function() {
+    this.aliases.lambda = 'this.lambda';
+ 
+    this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')');
+  },
+ 
+  // [pushStringParam]
+  //
+  // On stack, before: ...
+  // On stack, after: string, currentContext, ...
+  //
+  // This opcode is designed for use in string mode, which
+  // provides the string value of a parameter along with its
+  // depth rather than resolving it immediately.
+  pushStringParam: function(string, type) {
+    this.pushContext();
+    this.pushString(type);
+ 
+    // If it's a subexpression, the string result
+    // will be pushed after this opcode.
+    if (type !== 'sexpr') {
+      if (typeof string === 'string') {
+        this.pushString(string);
+      } else {
+        this.pushStackLiteral(string);
+      }
+    }
+  },
+ 
+  emptyHash: function() {
+    this.pushStackLiteral('{}');
+ 
+    if (this.trackIds) {
+      this.push('{}'); // hashIds
+    }
+    if (this.stringParams) {
+      this.push('{}'); // hashContexts
+      this.push('{}'); // hashTypes
+    }
+  },
+  pushHash: function() {
+    if (this.hash) {
+      this.hashes.push(this.hash);
+    }
+    this.hash = {values: [], types: [], contexts: [], ids: []};
+  },
+  popHash: function() {
+    var hash = this.hash;
+    this.hash = this.hashes.pop();
+ 
+    if (this.trackIds) {
+      this.push('{' + hash.ids.join(',') + '}');
+    }
+    if (this.stringParams) {
+      this.push('{' + hash.contexts.join(',') + '}');
+      this.push('{' + hash.types.join(',') + '}');
+    }
+ 
+    this.push('{\n    ' + hash.values.join(',\n    ') + '\n  }');
+  },
+ 
+  // [pushString]
+  //
+  // On stack, before: ...
+  // On stack, after: quotedString(string), ...
+  //
+  // Push a quoted version of `string` onto the stack
+  pushString: function(string) {
+    this.pushStackLiteral(this.quotedString(string));
+  },
+ 
+  // [push]
+  //
+  // On stack, before: ...
+  // On stack, after: expr, ...
+  //
+  // Push an expression onto the stack
+  push: function(expr) {
+    this.inlineStack.push(expr);
+    return expr;
+  },
+ 
+  // [pushLiteral]
+  //
+  // On stack, before: ...
+  // On stack, after: value, ...
+  //
+  // Pushes a value onto the stack. This operation prevents
+  // the compiler from creating a temporary variable to hold
+  // it.
+  pushLiteral: function(value) {
+    this.pushStackLiteral(value);
+  },
+ 
+  // [pushProgram]
+  //
+  // On stack, before: ...
+  // On stack, after: program(guid), ...
+  //
+  // Push a program expression onto the stack. This takes
+  // a compile-time guid and converts it into a runtime-accessible
+  // expression.
+  pushProgram: function(guid) {
+    if (guid != null) {
+      this.pushStackLiteral(this.programExpression(guid));
+    } else {
+      this.pushStackLiteral(null);
+    }
+  },
+ 
+  // [invokeHelper]
+  //
+  // On stack, before: hash, inverse, program, params..., ...
+  // On stack, after: result of helper invocation
+  //
+  // Pops off the helper's parameters, invokes the helper,
+  // and pushes the helper's return value onto the stack.
+  //
+  // If the helper is not found, `helperMissing` is called.
+  invokeHelper: function(paramSize, name, isSimple) {
+    this.aliases.helperMissing = 'helpers.helperMissing';
+ 
+    var nonHelper = this.popStack();
+    var helper = this.setupHelper(paramSize, name);
+ 
+    var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing';
+    this.push('((' + lookup + ').call(' + helper.callParams + '))');
+  },
+ 
+  // [invokeKnownHelper]
+  //
+  // On stack, before: hash, inverse, program, params..., ...
+  // On stack, after: result of helper invocation
+  //
+  // This operation is used when the helper is known to exist,
+  // so a `helperMissing` fallback is not required.
+  invokeKnownHelper: function(paramSize, name) {
+    var helper = this.setupHelper(paramSize, name);
+    this.push(helper.name + ".call(" + helper.callParams + ")");
+  },
+ 
+  // [invokeAmbiguous]
+  //
+  // On stack, before: hash, inverse, program, params..., ...
+  // On stack, after: result of disambiguation
+  //
+  // This operation is used when an expression like `{{foo}}`
+  // is provided, but we don't know at compile-time whether it
+  // is a helper or a path.
+  //
+  // This operation emits more code than the other options,
+  // and can be avoided by passing the `knownHelpers` and
+  // `knownHelpersOnly` flags at compile-time.
+  invokeAmbiguous: function(name, helperCall) {
+    this.aliases.functionType = '"function"';
+    this.aliases.helperMissing = 'helpers.helperMissing';
+    this.useRegister('helper');
+ 
+    var nonHelper = this.popStack();
+ 
+    this.emptyHash();
+    var helper = this.setupHelper(0, name, helperCall);
+ 
+    var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
+ 
+    this.push(
+      '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing'
+        + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),'
+      + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))');
+  },
+ 
+  // [invokePartial]
+  //
+  // On stack, before: context, ...
+  // On stack after: result of partial invocation
+  //
+  // This operation pops off a context, invokes a partial with that context,
+  // and pushes the result of the invocation back.
+  invokePartial: function(name, indent) {
+    var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"];
+ 
+    if (this.options.data) {
+      params.push("data");
+    } else if (this.options.compat) {
+      params.push('undefined');
+    }
+    if (this.options.compat) {
+      params.push('depths');
+    }
+ 
+    this.push("this.invokePartial(" + params.join(", ") + ")");
+  },
+ 
+  // [assignToHash]
+  //
+  // On stack, before: value, ..., hash, ...
+  // On stack, after: ..., hash, ...
+  //
+  // Pops a value off the stack and assigns it to the current hash
+  assignToHash: function(key) {
+    var value = this.popStack(),
+        context,
+        type,
+        id;
+ 
+    if (this.trackIds) {
+      id = this.popStack();
+    }
+    if (this.stringParams) {
+      type = this.popStack();
+      context = this.popStack();
+    }
+ 
+    var hash = this.hash;
+    if (context) {
+      hash.contexts.push("'" + key + "': " + context);
+    }
+    if (type) {
+      hash.types.push("'" + key + "': " + type);
+    }
+    if (id) {
+      hash.ids.push("'" + key + "': " + id);
+    }
+    hash.values.push("'" + key + "': (" + value + ")");
+  },
+ 
+  pushId: function(type, name) {
+    if (type === 'ID' || type === 'DATA') {
+      this.pushString(name);
+    } else if (type === 'sexpr') {
+      this.pushStackLiteral('true');
+    } else {
+      this.pushStackLiteral('null');
+    }
+  },
+ 
+  // HELPERS
+ 
+  compiler: JavaScriptCompiler,
+ 
+  compileChildren: function(environment, options) {
+    var children = environment.children, child, compiler;
+ 
+    for(var i=0, l=children.length; i<l; i++) {
+      child = children[i];
+      compiler = new this.compiler();
+ 
+      var index = this.matchExistingProgram(child);
+ 
+      if (index == null) {
+        this.context.programs.push('');     // Placeholder to prevent name conflicts for nested children
+        index = this.context.programs.length;
+        child.index = index;
+        child.name = 'program' + index;
+        this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
+        this.context.environments[index] = child;
+ 
+        this.useDepths = this.useDepths || compiler.useDepths;
+      } else {
+        child.index = index;
+        child.name = 'program' + index;
+      }
+    }
+  },
+  matchExistingProgram: function(child) {
+    for (var i = 0, len = this.context.environments.length; i < len; i++) {
+      var environment = this.context.environments[i];
+      if (environment && environment.equals(child)) {
+        return i;
+      }
+    }
+  },
+ 
+  programExpression: function(guid) {
+    var child = this.environment.children[guid],
+        depths = child.depths.list,
+        useDepths = this.useDepths,
+        depth;
+ 
+    var programParams = [child.index, 'data'];
+ 
+    if (useDepths) {
+      programParams.push('depths');
+    }
+ 
+    return 'this.program(' + programParams.join(', ') + ')';
+  },
+ 
+  useRegister: function(name) {
+    if(!this.registers[name]) {
+      this.registers[name] = true;
+      this.registers.list.push(name);
+    }
+  },
+ 
+  pushStackLiteral: function(item) {
+    return this.push(new Literal(item));
+  },
+ 
+  pushSource: function(source) {
+    if (this.pendingContent) {
+      this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent)));
+      this.pendingContent = undefined;
+    }
+ 
+    if (source) {
+      this.source.push(source);
+    }
+  },
+ 
+  pushStack: function(item) {
+    this.flushInline();
+ 
+    var stack = this.incrStack();
+    this.pushSource(stack + " = " + item + ";");
+    this.compileStack.push(stack);
+    return stack;
+  },
+ 
+  replaceStack: function(callback) {
+    var prefix = '',
+        inline = this.isInline(),
+        stack,
+        createdStack,
+        usedLiteral;
+ 
+    /* istanbul ignore next */
+    Iif (!this.isInline()) {
+      throw new Exception('replaceStack on non-inline');
+    }
+ 
+    // We want to merge the inline statement into the replacement statement via ','
+    var top = this.popStack(true);
+ 
+    if (top instanceof Literal) {
+      // Literals do not need to be inlined
+      prefix = stack = top.value;
+      usedLiteral = true;
+    } else {
+      // Get or create the current stack name for use by the inline
+      createdStack = !this.stackSlot;
+      var name = !createdStack ? this.topStackName() : this.incrStack();
+ 
+      prefix = '(' + this.push(name) + ' = ' + top + ')';
+      stack = this.topStack();
+    }
+ 
+    var item = callback.call(this, stack);
+ 
+    if (!usedLiteral) {
+      this.popStack();
+    }
+    if (createdStack) {
+      this.stackSlot--;
+    }
+    this.push('(' + prefix + item + ')');
+  },
+ 
+  incrStack: function() {
+    this.stackSlot++;
+    if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
+    return this.topStackName();
+  },
+  topStackName: function() {
+    return "stack" + this.stackSlot;
+  },
+  flushInline: function() {
+    var inlineStack = this.inlineStack;
+    if (inlineStack.length) {
+      this.inlineStack = [];
+      for (var i = 0, len = inlineStack.length; i < len; i++) {
+        var entry = inlineStack[i];
+        Iif (entry instanceof Literal) {
+          this.compileStack.push(entry);
+        } else {
+          this.pushStack(entry);
+        }
+      }
+    }
+  },
+  isInline: function() {
+    return this.inlineStack.length;
+  },
+ 
+  popStack: function(wrapped) {
+    var inline = this.isInline(),
+        item = (inline ? this.inlineStack : this.compileStack).pop();
+ 
+    if (!wrapped && (item instanceof Literal)) {
+      return item.value;
+    } else {
+      if (!inline) {
+        /* istanbul ignore next */
+        Iif (!this.stackSlot) {
+          throw new Exception('Invalid stack pop');
+        }
+        this.stackSlot--;
+      }
+      return item;
+    }
+  },
+ 
+  topStack: function() {
+    var stack = (this.isInline() ? this.inlineStack : this.compileStack),
+        item = stack[stack.length - 1];
+ 
+    Iif (item instanceof Literal) {
+      return item.value;
+    } else {
+      return item;
+    }
+  },
+ 
+  contextName: function(context) {
+    if (this.useDepths && context) {
+      return 'depths[' + context + ']';
+    } else {
+      return 'depth' + context;
+    }
+  },
+ 
+  quotedString: function(str) {
+    return '"' + str
+      .replace(/\\/g, '\\\\')
+      .replace(/"/g, '\\"')
+      .replace(/\n/g, '\\n')
+      .replace(/\r/g, '\\r')
+      .replace(/\u2028/g, '\\u2028')   // Per Ecma-262 7.3 + 7.8.4
+      .replace(/\u2029/g, '\\u2029') + '"';
+  },
+ 
+  objectLiteral: function(obj) {
+    var pairs = [];
+ 
+    for (var key in obj) {
+      if (obj.hasOwnProperty(key)) {
+        pairs.push(this.quotedString(key) + ':' + obj[key]);
+      }
+    }
+ 
+    return '{' + pairs.join(',') + '}';
+  },
+ 
+  setupHelper: function(paramSize, name, blockHelper) {
+    var params = [],
+        paramsInit = this.setupParams(name, paramSize, params, blockHelper);
+    var foundHelper = this.nameLookup('helpers', name, 'helper');
+ 
+    return {
+      params: params,
+      paramsInit: paramsInit,
+      name: foundHelper,
+      callParams: [this.contextName(0)].concat(params).join(", ")
+    };
+  },
+ 
+  setupOptions: function(helper, paramSize, params) {
+    var options = {}, contexts = [], types = [], ids = [], param, inverse, program;
+ 
+    options.name = this.quotedString(helper);
+    options.hash = this.popStack();
+ 
+    if (this.trackIds) {
+      options.hashIds = this.popStack();
+    }
+    if (this.stringParams) {
+      options.hashTypes = this.popStack();
+      options.hashContexts = this.popStack();
+    }
+ 
+    inverse = this.popStack();
+    program = this.popStack();
+ 
+    // Avoid setting fn and inverse if neither are set. This allows
+    // helpers to do a check for `if (options.fn)`
+    if (program || inverse) {
+      if (!program) {
+        program = 'this.noop';
+      }
+ 
+      if (!inverse) {
+        inverse = 'this.noop';
+      }
+ 
+      options.fn = program;
+      options.inverse = inverse;
+    }
+ 
+    // The parameters go on to the stack in order (making sure that they are evaluated in order)
+    // so we need to pop them off the stack in reverse order
+    var i = paramSize;
+    while (i--) {
+      param = this.popStack();
+      params[i] = param;
+ 
+      if (this.trackIds) {
+        ids[i] = this.popStack();
+      }
+      if (this.stringParams) {
+        types[i] = this.popStack();
+        contexts[i] = this.popStack();
+      }
+    }
+ 
+    if (this.trackIds) {
+      options.ids = "[" + ids.join(",") + "]";
+    }
+    if (this.stringParams) {
+      options.types = "[" + types.join(",") + "]";
+      options.contexts = "[" + contexts.join(",") + "]";
+    }
+ 
+    if (this.options.data) {
+      options.data = "data";
+    }
+ 
+    return options;
+  },
+ 
+  // the params and contexts arguments are passed in arrays
+  // to fill in
+  setupParams: function(helperName, paramSize, params, useRegister) {
+    var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params));
+ 
+    if (useRegister) {
+      this.useRegister('options');
+      params.push('options');
+      return 'options=' + options;
+    } else {
+      params.push(options);
+      return '';
+    }
+  }
+};
+ 
+var reservedWords = (
+  "break else new var" +
+  " case finally return void" +
+  " catch for switch while" +
+  " continue function this with" +
+  " default if throw" +
+  " delete in try" +
+  " do instanceof typeof" +
+  " abstract enum int short" +
+  " boolean export interface static" +
+  " byte extends long super" +
+  " char final native synchronized" +
+  " class float package throws" +
+  " const goto private transient" +
+  " debugger implements protected volatile" +
+  " double import public let yield"
+).split(" ");
+ 
+var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
+ 
+for(var i=0, l=reservedWords.length; i<l; i++) {
+  compilerWords[reservedWords[i]] = true;
+}
+ 
+JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
+  return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
+};
+ 
+exports["default"] = JavaScriptCompiler;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/parser.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/parser.js.html new file mode 100644 index 0000000..a1471b9 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/parser.js.html @@ -0,0 +1,1819 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/parser.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/parser.js

+

+ + Statements: 100% (396 / 396)      + + + Branches: 100% (205 / 205)      + + + Functions: 100% (27 / 27)      + + + Lines: 100% (369 / 369)      + + Ignored: 95 statements, 9 functions, 45 branches      +

+
All files » dist/cjs/handlebars/compiler/ » parser.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +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 +498 +499 +500  +  +  +  +1 +1 +  +  +  +  +  +  +26939 +26939 +1026 +1 +1692 +1692 +952 +952 +601 +601 +4 +4 +95 +95 +1609 +1609 +36 +36 +5 +4 +5 +5 +523 +521 +80 +80 +531 +531 +80 +80 +62 +62 +603 +603 +914 +914 +38 +38 +6 +6 +89 +89 +1584 +1584 +40 +40 +390 +390 +55 +55 +53 +53 +54 +54 +34 +34 +52 +52 +74 +74 +119 +119 +91 +91 +2 +2 +2 +2 +74 +74 +2752 +2744 +341 +341 +2752 +2752 +1722 +1722 +3297 +3297 +1586 +1586 +513 +513 +74 +74 +45 +45 +  +  +  +  +  +12 +  +  +1049 +1049 +1049 +1049 +1049 +1049 +1 +1049 +1049 +1049 +1049 +1 +1 +1 +1 +1 +  +1 +11342 +11342 +11342 +7 +  +11342 +  +1049 +1049 +38270 +38270 +1159 +  +37111 +11342 +  +37111 +  +38270 +12 +12 +12 +12 +82 +82 +  +12 +12 +  +1 +  +12 +  +  +38258 +1 +  +38258 +  +11319 +11319 +11319 +11319 +11319 +11319 +11319 +11319 +11319 +11319 +11319 +1 +  +1 +1 +  +11319 +  +26939 +26939 +26939 +26939 +1 +  +26939 +26928 +1026 +  +25902 +20448 +20448 +20448 +  +25902 +25902 +25902 +25902 +25902 +25902 +  +1 +  +  +1 +  +  +  +1 +1 +  +1 +1 +  +1 +  +  +  +1116 +1116 +1116 +1116 +1116 +1116 +1116 +1116 +1116 +  +  +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +  +1 +  +1 +  +1 +1 +  +  +1 +1 +  +1 +1 +  +1 +1 +1 +1 +  +1 +1 +  +1 +  +  +  +  +  +  +  +1 +1 +  +1 +  +  +1 +1 +  +  +1 +  +  +12 +12 +  +  +12 +12 +12 +  +12 +  +  +12 +12 +12 +  +  +13951 +1 +  +13951 +  +13951 +  +  +  +  +  +13951 +13951 +13951 +  +13951 +13951 +221226 +221226 +13951 +13951 +13951 +  +  +13951 +13951 +13951 +13951 +  +  +  +13951 +13951 +13951 +13951 +13951 +1 +  +13951 +13951 +13951 +13951 +13951 +13951 +2151 +  +1 +1 +  +1 +  +  +  +  +13951 +13951 +11800 +  +2151 +  +  +  +2483 +  +  +2474 +  +  +13951 +  +  +1 +  +  +1 +  +1 +1 +  +  +1 +141 +  +  +  +13951 +13951 +  +2476 +10 +10 +2466 +10 +10 +  +2456 +  +2476 +  +1275 +426 +1 +  +10 +10 +  +1 +  +5 +5 +5 +  +1 +5 +1 +2 +1 +62 +1 +62 +1 +5 +1 +  +5 +5 +5 +  +1 +100 +1 +532 +1 +604 +1 +44 +1 +22 +1 +81 +1 +1 +1 +42 +1 +23 +1 +2 +2 +37 +1 +973 +1 +131 +1 +73 +1 +59 +1 +355 +1 +  +874 +42 +1 +2305 +1 +61 +1 +6 +1 +79 +1 +42 +1 +18 +1 +61 +1 +3208 +1 +15 +1 +9 +1 +1094 +1 +  +  +1 +1 +1 +1 +1 +1 +1 + 
"use strict";
+/* jshint ignore:start */
+/* istanbul ignore next */
+/* Jison generated parser */
+var handlebars = (function(){
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"root":3,"program":4,"EOF":5,"program_repetition0":6,"statement":7,"mustache":8,"block":9,"rawBlock":10,"partial":11,"CONTENT":12,"COMMENT":13,"openRawBlock":14,"END_RAW_BLOCK":15,"OPEN_RAW_BLOCK":16,"sexpr":17,"CLOSE_RAW_BLOCK":18,"openBlock":19,"block_option0":20,"closeBlock":21,"openInverse":22,"block_option1":23,"OPEN_BLOCK":24,"CLOSE":25,"OPEN_INVERSE":26,"inverseAndProgram":27,"INVERSE":28,"OPEN_ENDBLOCK":29,"path":30,"OPEN":31,"OPEN_UNESCAPED":32,"CLOSE_UNESCAPED":33,"OPEN_PARTIAL":34,"partialName":35,"param":36,"partial_option0":37,"partial_option1":38,"sexpr_repetition0":39,"sexpr_option0":40,"dataName":41,"STRING":42,"NUMBER":43,"BOOLEAN":44,"OPEN_SEXPR":45,"CLOSE_SEXPR":46,"hash":47,"hash_repetition_plus0":48,"hashSegment":49,"ID":50,"EQUALS":51,"DATA":52,"pathSegments":53,"SEP":54,"$accept":0,"$end":1},
+terminals_: {2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},
+productions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],
+performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+ 
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1: yy.prepareProgram($$[$0-1].statements, true); return $$[$0-1]; 
+break;
+case 2:this.$ = new yy.ProgramNode(yy.prepareProgram($$[$0]), {}, this._$);
+break;
+case 3:this.$ = $$[$0];
+break;
+case 4:this.$ = $$[$0];
+break;
+case 5:this.$ = $$[$0];
+break;
+case 6:this.$ = $$[$0];
+break;
+case 7:this.$ = new yy.ContentNode($$[$0], this._$);
+break;
+case 8:this.$ = new yy.CommentNode($$[$0], this._$);
+break;
+case 9:this.$ = new yy.RawBlockNode($$[$0-2], $$[$0-1], $$[$0], this._$);
+break;
+case 10:this.$ = new yy.MustacheNode($$[$0-1], null, '', '', this._$);
+break;
+case 11:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], false, this._$);
+break;
+case 12:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], true, this._$);
+break;
+case 13:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
+break;
+case 14:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
+break;
+case 15:this.$ = { strip: yy.stripFlags($$[$0-1], $$[$0-1]), program: $$[$0] };
+break;
+case 16:this.$ = {path: $$[$0-1], strip: yy.stripFlags($$[$0-2], $$[$0])};
+break;
+case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
+break;
+case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$);
+break;
+case 19:this.$ = new yy.PartialNode($$[$0-3], $$[$0-2], $$[$0-1], yy.stripFlags($$[$0-4], $$[$0]), this._$);
+break;
+case 20:this.$ = new yy.PartialNode($$[$0-2], undefined, $$[$0-1], yy.stripFlags($$[$0-3], $$[$0]), this._$);
+break;
+case 21:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$);
+break;
+case 22:this.$ = new yy.SexprNode([$$[$0]], null, this._$);
+break;
+case 23:this.$ = $$[$0];
+break;
+case 24:this.$ = new yy.StringNode($$[$0], this._$);
+break;
+case 25:this.$ = new yy.NumberNode($$[$0], this._$);
+break;
+case 26:this.$ = new yy.BooleanNode($$[$0], this._$);
+break;
+case 27:this.$ = $$[$0];
+break;
+case 28:$$[$0-1].isHelper = true; this.$ = $$[$0-1];
+break;
+case 29:this.$ = new yy.HashNode($$[$0], this._$);
+break;
+case 30:this.$ = [$$[$0-2], $$[$0]];
+break;
+case 31:this.$ = new yy.PartialNameNode($$[$0], this._$);
+break;
+case 32:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$);
+break;
+case 33:this.$ = new yy.PartialNameNode(new yy.NumberNode($$[$0], this._$));
+break;
+case 34:this.$ = new yy.DataNode($$[$0], this._$);
+break;
+case 35:this.$ = new yy.IdNode($$[$0], this._$);
+break;
+case 36: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2]; 
+break;
+case 37:this.$ = [{part: $$[$0]}];
+break;
+case 38:this.$ = [];
+break;
+case 39:$$[$0-1].push($$[$0]);
+break;
+case 48:this.$ = [];
+break;
+case 49:$$[$0-1].push($$[$0]);
+break;
+case 52:this.$ = [$$[$0]];
+break;
+case 53:$$[$0-1].push($$[$0]);
+break;
+}
+},
+table: [{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],
+defaultActions: {4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},
+parseError: function parseError(str, hash) {
+    throw new Error(str);
+},
+parse: function parse(input) {
+    var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
+    this.lexer.setInput(input);
+    this.lexer.yy = this.yy;
+    this.yy.lexer = this.lexer;
+    this.yy.parser = this;
+    Iif (typeof this.lexer.yylloc == "undefined")
+        this.lexer.yylloc = {};
+    var yyloc = this.lexer.yylloc;
+    lstack.push(yyloc);
+    var ranges = this.lexer.options && this.lexer.options.ranges;
+    Iif (typeof this.yy.parseError === "function")
+        this.parseError = this.yy.parseError;
+    function popStack(n) {
+        stack.length = stack.length - 2 * n;
+        vstack.length = vstack.length - n;
+        lstack.length = lstack.length - n;
+    }
+    function lex() {
+        var token;
+        token = self.lexer.lex() || 1;
+        if (typeof token !== "number") {
+            token = self.symbols_[token] || token;
+        }
+        return token;
+    }
+    var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
+    while (true) {
+        state = stack[stack.length - 1];
+        if (this.defaultActions[state]) {
+            action = this.defaultActions[state];
+        } else {
+            if (symbol === null || typeof symbol == "undefined") {
+                symbol = lex();
+            }
+            action = table[state] && table[state][symbol];
+        }
+        if (typeof action === "undefined" || !action.length || !action[0]) {
+            var errStr = "";
+            Eif (!recovering) {
+                expected = [];
+                for (p in table[state])
+                    Eif (this.terminals_[p] && p > 2) {
+                        expected.push("'" + this.terminals_[p] + "'");
+                    }
+                Eif (this.lexer.showPosition) {
+                    errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+                } else {
+                    errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
+                }
+                this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+            }
+        }
+        Iif (action[0] instanceof Array && action.length > 1) {
+            throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+        }
+        switch (action[0]) {
+        case 1:
+            stack.push(symbol);
+            vstack.push(this.lexer.yytext);
+            lstack.push(this.lexer.yylloc);
+            stack.push(action[1]);
+            symbol = null;
+            Eif (!preErrorSymbol) {
+                yyleng = this.lexer.yyleng;
+                yytext = this.lexer.yytext;
+                yylineno = this.lexer.yylineno;
+                yyloc = this.lexer.yylloc;
+                Iif (recovering > 0)
+                    recovering--;
+            } else {
+                symbol = preErrorSymbol;
+                preErrorSymbol = null;
+            }
+            break;
+        case 2:
+            len = this.productions_[action[1]][1];
+            yyval.$ = vstack[vstack.length - len];
+            yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
+            Iif (ranges) {
+                yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
+            }
+            r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+            if (typeof r !== "undefined") {
+                return r;
+            }
+            if (len) {
+                stack = stack.slice(0, -1 * len * 2);
+                vstack = vstack.slice(0, -1 * len);
+                lstack = lstack.slice(0, -1 * len);
+            }
+            stack.push(this.productions_[action[1]][0]);
+            vstack.push(yyval.$);
+            lstack.push(yyval._$);
+            newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+            stack.push(newState);
+            break;
+        case 3:
+            return true;
+        }
+    }
+    return true;
+}
+};
+/* Jison generated lexer */
+var lexer = (function(){
+var lexer = ({EOF:1,
+parseError:function parseError(str, hash) {
+        if (this.yy.parser) {
+            this.yy.parser.parseError(str, hash);
+        } else {
+            throw new Error(str);
+        }
+    },
+setInput:function (input) {
+        this._input = input;
+        this._more = this._less = this.done = false;
+        this.yylineno = this.yyleng = 0;
+        this.yytext = this.matched = this.match = '';
+        this.conditionStack = ['INITIAL'];
+        this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
+        Iif (this.options.ranges) this.yylloc.range = [0,0];
+        this.offset = 0;
+        return this;
+    },
+input:function () {
+        var ch = this._input[0];
+        this.yytext += ch;
+        this.yyleng++;
+        this.offset++;
+        this.match += ch;
+        this.matched += ch;
+        var lines = ch.match(/(?:\r\n?|\n).*/g);
+        if (lines) {
+            this.yylineno++;
+            this.yylloc.last_line++;
+        } else {
+            this.yylloc.last_column++;
+        }
+        if (this.options.ranges) this.yylloc.range[1]++;
+ 
+        this._input = this._input.slice(1);
+        return ch;
+    },
+unput:function (ch) {
+        var len = ch.length;
+        var lines = ch.split(/(?:\r\n?|\n)/g);
+ 
+        this._input = ch + this._input;
+        this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
+        //this.yyleng -= len;
+        this.offset -= len;
+        var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+        this.match = this.match.substr(0, this.match.length-1);
+        this.matched = this.matched.substr(0, this.matched.length-1);
+ 
+        if (lines.length-1) this.yylineno -= lines.length-1;
+        var r = this.yylloc.range;
+ 
+        this.yylloc = {first_line: this.yylloc.first_line,
+          last_line: this.yylineno+1,
+          first_column: this.yylloc.first_column,
+          last_column: lines ?
+              (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
+              this.yylloc.first_column - len
+          };
+ 
+        if (this.options.ranges) {
+            this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+        }
+        return this;
+    },
+more:function () {
+        this._more = true;
+        return this;
+    },
+less:function (n) {
+        this.unput(this.match.slice(n));
+    },
+pastInput:function () {
+        var past = this.matched.substr(0, this.matched.length - this.match.length);
+        return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
+    },
+upcomingInput:function () {
+        var next = this.match;
+        Eif (next.length < 20) {
+            next += this._input.substr(0, 20-next.length);
+        }
+        return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
+    },
+showPosition:function () {
+        var pre = this.pastInput();
+        var c = new Array(pre.length + 1).join("-");
+        return pre + this.upcomingInput() + "\n" + c+"^";
+    },
+next:function () {
+        Iif (this.done) {
+            return this.EOF;
+        }
+        if (!this._input) this.done = true;
+ 
+        var token,
+            match,
+            tempMatch,
+            index,
+            col,
+            lines;
+        Eif (!this._more) {
+            this.yytext = '';
+            this.match = '';
+        }
+        var rules = this._currentRules();
+        for (var i=0;i < rules.length; i++) {
+            tempMatch = this._input.match(this.rules[rules[i]]);
+            if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+                match = tempMatch;
+                index = i;
+                Eif (!this.options.flex) break;
+            }
+        }
+        Eif (match) {
+            lines = match[0].match(/(?:\r\n?|\n).*/g);
+            if (lines) this.yylineno += lines.length;
+            this.yylloc = {first_line: this.yylloc.last_line,
+                           last_line: this.yylineno+1,
+                           first_column: this.yylloc.last_column,
+                           last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
+            this.yytext += match[0];
+            this.match += match[0];
+            this.matches = match;
+            this.yyleng = this.yytext.length;
+            Iif (this.options.ranges) {
+                this.yylloc.range = [this.offset, this.offset += this.yyleng];
+            }
+            this._more = false;
+            this._input = this._input.slice(match[0].length);
+            this.matched += match[0];
+            token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
+            Iif (this.done && this._input) this.done = false;
+            if (token) return token;
+            else return;
+        }
+        if (this._input === "") {
+            return this.EOF;
+        } else {
+            return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
+                    {text: "", token: null, line: this.yylineno});
+        }
+    },
+lex:function lex() {
+        var r = this.next();
+        if (typeof r !== 'undefined') {
+            return r;
+        } else {
+            return this.lex();
+        }
+    },
+begin:function begin(condition) {
+        this.conditionStack.push(condition);
+    },
+popState:function popState() {
+        return this.conditionStack.pop();
+    },
+_currentRules:function _currentRules() {
+        return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
+    },
+topState:function () {
+        return this.conditionStack[this.conditionStack.length-2];
+    },
+pushState:function begin(condition) {
+        this.begin(condition);
+    }});
+lexer.options = {};
+lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
+ 
+ 
+function strip(start, end) {
+  return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
+}
+ 
+ 
+var YYSTATE=YY_START
+switch($avoiding_name_collisions) {
+case 0:
+                                   if(yy_.yytext.slice(-2) === "\\\\") {
+                                     strip(0,1);
+                                     this.begin("mu");
+                                   } else if(yy_.yytext.slice(-1) === "\\") {
+                                     strip(0,1);
+                                     this.begin("emu");
+                                   } else {
+                                     this.begin("mu");
+                                   }
+                                   if(yy_.yytext) return 12;
+                                 
+break;
+case 1:return 12;
+break;
+case 2:
+                                   this.popState();
+                                   return 12;
+                                 
+break;
+case 3:
+                                  yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9);
+                                  this.popState();
+                                  return 15;
+                                 
+break;
+case 4: return 12; 
+break;
+case 5:strip(0,4); this.popState(); return 13;
+break;
+case 6:return 45;
+break;
+case 7:return 46;
+break;
+case 8: return 16; 
+break;
+case 9:
+                                  this.popState();
+                                  this.begin('raw');
+                                  return 18;
+                                 
+break;
+case 10:return 34;
+break;
+case 11:return 24;
+break;
+case 12:return 29;
+break;
+case 13:this.popState(); return 28;
+break;
+case 14:this.popState(); return 28;
+break;
+case 15:return 26;
+break;
+case 16:return 26;
+break;
+case 17:return 32;
+break;
+case 18:return 31;
+break;
+case 19:this.popState(); this.begin('com');
+break;
+case 20:strip(3,5); this.popState(); return 13;
+break;
+case 21:return 31;
+break;
+case 22:return 51;
+break;
+case 23:return 50;
+break;
+case 24:return 50;
+break;
+case 25:return 54;
+break;
+case 26:// ignore whitespace
+break;
+case 27:this.popState(); return 33;
+break;
+case 28:this.popState(); return 25;
+break;
+case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42;
+break;
+case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42;
+break;
+case 31:return 52;
+break;
+case 32:return 44;
+break;
+case 33:return 44;
+break;
+case 34:return 43;
+break;
+case 35:return 50;
+break;
+case 36:yy_.yytext = strip(1,2); return 50;
+break;
+case 37:return 'INVALID';
+break;
+case 38:return 5;
+break;
+}
+};
+lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
+lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}};
+return lexer;})()
+parser.lexer = lexer;
+function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
+return new Parser;
+})();exports["default"] = handlebars;
+/* jshint ignore:end */
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/printer.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/printer.js.html new file mode 100644 index 0000000..38851b8 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/printer.js.html @@ -0,0 +1,742 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/printer.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/printer.js

+

+ + Statements: 100% (84 / 84)      + + + Branches: 100% (16 / 16)      + + + Functions: 100% (17 / 17)      + + + Lines: 100% (80 / 80)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/compiler/ » printer.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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  +1 +  +1 +48 +  +  +1 +48 +  +  +1 +  +1 +89 +  +89 +50 +  +  +89 +89 +  +  +1 +67 +  +  +  +67 +59 +  +  +67 +  +67 +  +  +1 +11 +  +11 +11 +11 +11 +9 +9 +9 +9 +  +11 +10 +10 +10 +10 +10 +10 +  +11 +  +11 +  +  +1 +40 +  +40 +11 +  +  +40 +  +40 +  +40 +  +  +1 +40 +  +  +1 +5 +5 +2 +  +5 +2 +  +5 +  +  +1 +14 +14 +  +14 +23 +23 +23 +  +  +14 +  +  +1 +7 +  +  +1 +3 +  +  +1 +6 +  +  +1 +60 +60 +1 +  +59 +  +  +  +1 +5 +  +  +1 +4 +  +  +1 +12 +  +  +1 +2 + 
"use strict";
+var Visitor = require("./visitor")["default"];
+ 
+function print(ast) {
+  return new PrintVisitor().accept(ast);
+}
+ 
+exports.print = print;function PrintVisitor() {
+  this.padding = 0;
+}
+ 
+exports.PrintVisitor = PrintVisitor;PrintVisitor.prototype = new Visitor();
+ 
+PrintVisitor.prototype.pad = function(string) {
+  var out = "";
+ 
+  for(var i=0,l=this.padding; i<l; i++) {
+    out = out + "  ";
+  }
+ 
+  out = out + string + "\n";
+  return out;
+};
+ 
+PrintVisitor.prototype.program = function(program) {
+  var out = "",
+      statements = program.statements,
+      i, l;
+ 
+  for(i=0, l=statements.length; i<l; i++) {
+    out = out + this.accept(statements[i]);
+  }
+ 
+  this.padding--;
+ 
+  return out;
+};
+ 
+PrintVisitor.prototype.block = function(block) {
+  var out = "";
+ 
+  out = out + this.pad("BLOCK:");
+  this.padding++;
+  out = out + this.accept(block.mustache);
+  if (block.program) {
+    out = out + this.pad("PROGRAM:");
+    this.padding++;
+    out = out + this.accept(block.program);
+    this.padding--;
+  }
+  if (block.inverse) {
+    if (block.program) { this.padding++; }
+    out = out + this.pad("{{^}}");
+    this.padding++;
+    out = out + this.accept(block.inverse);
+    this.padding--;
+    if (block.program) { this.padding--; }
+  }
+  this.padding--;
+ 
+  return out;
+};
+ 
+PrintVisitor.prototype.sexpr = function(sexpr) {
+  var params = sexpr.params, paramStrings = [], hash;
+ 
+  for(var i=0, l=params.length; i<l; i++) {
+    paramStrings.push(this.accept(params[i]));
+  }
+ 
+  params = "[" + paramStrings.join(", ") + "]";
+ 
+  hash = sexpr.hash ? " " + this.accept(sexpr.hash) : "";
+ 
+  return this.accept(sexpr.id) + " " + params + hash;
+};
+ 
+PrintVisitor.prototype.mustache = function(mustache) {
+  return this.pad("{{ " + this.accept(mustache.sexpr) + " }}");
+};
+ 
+PrintVisitor.prototype.partial = function(partial) {
+  var content = this.accept(partial.partialName);
+  if(partial.context) {
+    content += " " + this.accept(partial.context);
+  }
+  if (partial.hash) {
+    content += " " + this.accept(partial.hash);
+  }
+  return this.pad("{{> " + content + " }}");
+};
+ 
+PrintVisitor.prototype.hash = function(hash) {
+  var pairs = hash.pairs;
+  var joinedPairs = [], left, right;
+ 
+  for(var i=0, l=pairs.length; i<l; i++) {
+    left = pairs[i][0];
+    right = this.accept(pairs[i][1]);
+    joinedPairs.push( left + "=" + right );
+  }
+ 
+  return "HASH{" + joinedPairs.join(", ") + "}";
+};
+ 
+PrintVisitor.prototype.STRING = function(string) {
+  return '"' + string.string + '"';
+};
+ 
+PrintVisitor.prototype.NUMBER = function(number) {
+  return "NUMBER{" + number.number + "}";
+};
+ 
+PrintVisitor.prototype.BOOLEAN = function(bool) {
+  return "BOOLEAN{" + bool.bool + "}";
+};
+ 
+PrintVisitor.prototype.ID = function(id) {
+  var path = id.parts.join("/");
+  if(id.parts.length > 1) {
+    return "PATH:" + path;
+  } else {
+    return "ID:" + path;
+  }
+};
+ 
+PrintVisitor.prototype.PARTIAL_NAME = function(partialName) {
+    return "PARTIAL:" + partialName.name;
+};
+ 
+PrintVisitor.prototype.DATA = function(data) {
+  return "@" + this.accept(data.id);
+};
+ 
+PrintVisitor.prototype.content = function(content) {
+  return this.pad("CONTENT[ '" + content.string + "' ]");
+};
+ 
+PrintVisitor.prototype.comment = function(comment) {
+  return this.pad("{{! '" + comment.comment + "' }}");
+};
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/visitor.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/visitor.js.html new file mode 100644 index 0000000..a5ae849 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/visitor.js.html @@ -0,0 +1,355 @@ + + + + Code coverage report for dist/cjs/handlebars/compiler/visitor.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/compiler/visitor.js

+

+ + Statements: 100% (4 / 4)      + + + Branches: 100% (0 / 0)      + + + Functions: 100% (2 / 2)      + + + Lines: 100% (4 / 4)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/compiler/ » visitor.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12  +1 +  +1 +  +  +  +276 +  +  +  +1
"use strict";
+function Visitor() {}
+ 
+Visitor.prototype = {
+  constructor: Visitor,
+ 
+  accept: function(object) {
+    return this[object.type](object);
+  }
+};
+ 
+exports["default"] = Visitor;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/exception.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/exception.js.html new file mode 100644 index 0000000..fdd2de2 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/exception.js.html @@ -0,0 +1,403 @@ + + + + Code coverage report for dist/cjs/handlebars/exception.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/exception.js

+

+ + Statements: 100% (14 / 14)      + + + Branches: 100% (6 / 6)      + + + Functions: 100% (1 / 1)      + + + Lines: 100% (14 / 14)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/ » exception.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +1 +  +1 +48 +48 +16 +  +16 +  +  +48 +  +  +48 +336 +  +  +48 +16 +16 +  +  +  +1 +  +1
"use strict";
+ 
+var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
+ 
+function Exception(message, node) {
+  var line;
+  if (node && node.firstLine) {
+    line = node.firstLine;
+ 
+    message += ' - ' + line + ':' + node.firstColumn;
+  }
+ 
+  var tmp = Error.prototype.constructor.call(this, message);
+ 
+  // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
+  for (var idx = 0; idx < errorProps.length; idx++) {
+    this[errorProps[idx]] = tmp[errorProps[idx]];
+  }
+ 
+  if (line) {
+    this.lineNumber = line;
+    this.column = node.firstColumn;
+  }
+}
+ 
+Exception.prototype = new Error();
+ 
+exports["default"] = Exception;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/index.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/index.html new file mode 100644 index 0000000..13e6eff --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/index.html @@ -0,0 +1,402 @@ + + + + Code coverage report for dist/cjs/handlebars/ + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/

+

+ + Statements: 100% (289 / 289)      + + + Branches: 100% (203 / 203)      + + + Functions: 100% (44 / 44)      + + + Lines: 100% (274 / 274)      + + Ignored: 4 statements, 2 functions, 9 branches      +

+
All files » dist/cjs/handlebars/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
base.js100%(119 / 119)100%(83 / 83)100%(16 / 16)100%(113 / 113)
exception.js100%(14 / 14)100%(6 / 6)100%(1 / 1)100%(14 / 14)
runtime.js100%(104 / 104)100%(84 / 84)100%(17 / 17)100%(99 / 99)
safe-string.js100%(5 / 5)100%(0 / 0)100%(2 / 2)100%(5 / 5)
utils.js100%(47 / 47)100%(30 / 30)100%(8 / 8)100%(43 / 43)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/runtime.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/runtime.js.html new file mode 100644 index 0000000..03c0e0d --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/runtime.js.html @@ -0,0 +1,898 @@ + + + + Code coverage report for dist/cjs/handlebars/runtime.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/runtime.js

+

+ + Statements: 100% (104 / 104)      + + + Branches: 100% (84 / 84)      + + + Functions: 100% (17 / 17)      + + + Lines: 100% (99 / 99)      + + Ignored: 1 statement, 1 branch      +

+
All files » dist/cjs/handlebars/ » runtime.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193  +1 +1 +1 +1 +1 +  +1 +470 +  +  +470 +3 +2 +  +2 +  +  +  +1 +  +  +  +  +  +1 +  +1 +  +474 +1 +  +474 +3 +  +  +  +  +471 +  +468 +55 +2 +  +  +55 +  +53 +39 +39 +39 +  +53 +52 +8 +8 +18 +6 +  +  +12 +  +8 +  +52 +  +1 +  +  +  +  +468 +  +175 +175 +261 +170 +  +  +  +  +138 +  +  +  +  +  +  +345 +  +  +  +  +345 +  +345 +340 +5 +4 +  +345 +  +  +  +4 +6 +  +4 +  +  +512 +  +512 +313 +  +  +512 +  +  +  +  +  +  +468 +480 +480 +  +480 +480 +462 +  +480 +480 +141 +  +  +480 +  +468 +  +468 +482 +471 +  +471 +41 +  +  +11 +11 +  +  +  +468 +4 +1 +  +  +3 +  +468 +  +  +1 +347 +365 +  +365 +  +347 +347 +347 +  +  +1 +55 +  +55 +2 +53 +13 +  +  +  +62 +  +1 +462 +424 +424 +  +462 + 
"use strict";
+var Utils = require("./utils");
+var Exception = require("./exception")["default"];
+var COMPILER_REVISION = require("./base").COMPILER_REVISION;
+var REVISION_CHANGES = require("./base").REVISION_CHANGES;
+var createFrame = require("./base").createFrame;
+ 
+function checkRevision(compilerInfo) {
+  var compilerRevision = compilerInfo && compilerInfo[0] || 1,
+      currentRevision = COMPILER_REVISION;
+ 
+  if (compilerRevision !== currentRevision) {
+    if (compilerRevision < currentRevision) {
+      var runtimeVersions = REVISION_CHANGES[currentRevision],
+          compilerVersions = REVISION_CHANGES[compilerRevision];
+      throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
+            "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
+    } else {
+      // Use the embedded version info since the runtime doesn't know about this revision yet
+      throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
+            "Please update your runtime to a newer version ("+compilerInfo[1]+").");
+    }
+  }
+}
+ 
+exports.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
+ 
+function template(templateSpec, env) {
+  /* istanbul ignore next */
+  Iif (!env) {
+    throw new Exception("No environment passed to template");
+  }
+  if (!templateSpec || !templateSpec.main) {
+    throw new Exception('Unknown template object: ' + typeof templateSpec);
+  }
+ 
+  // Note: Using env.VM references rather than local var references throughout this section to allow
+  // for external users to override these as psuedo-supported APIs.
+  env.VM.checkRevision(templateSpec.compiler);
+ 
+  var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
+    if (hash) {
+      context = Utils.extend({}, context, hash);
+    }
+ 
+    var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);
+ 
+    if (result == null && env.compile) {
+      var options = { helpers: helpers, partials: partials, data: data, depths: depths };
+      partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);
+      result = partials[name](context, options);
+    }
+    if (result != null) {
+      if (indent) {
+        var lines = result.split('\n');
+        for (var i = 0, l = lines.length; i < l; i++) {
+          if (!lines[i] && i + 1 === l) {
+            break;
+          }
+ 
+          lines[i] = indent + lines[i];
+        }
+        result = lines.join('\n');
+      }
+      return result;
+    } else {
+      throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
+    }
+  };
+ 
+  // Just add water
+  var container = {
+    lookup: function(depths, name) {
+      var len = depths.length;
+      for (var i = 0; i < len; i++) {
+        if (depths[i] && depths[i][name] != null) {
+          return depths[i][name];
+        }
+      }
+    },
+    lambda: function(current, context) {
+      return typeof current === 'function' ? current.call(context) : current;
+    },
+ 
+    escapeExpression: Utils.escapeExpression,
+    invokePartial: invokePartialWrapper,
+ 
+    fn: function(i) {
+      return templateSpec[i];
+    },
+ 
+    programs: [],
+    program: function(i, data, depths) {
+      var programWrapper = this.programs[i],
+          fn = this.fn(i);
+      if (data || depths) {
+        programWrapper = program(this, i, fn, data, depths);
+      } else if (!programWrapper) {
+        programWrapper = this.programs[i] = program(this, i, fn);
+      }
+      return programWrapper;
+    },
+ 
+    data: function(data, depth) {
+      while (data && depth--) {
+        data = data._parent;
+      }
+      return data;
+    },
+    merge: function(param, common) {
+      var ret = param || common;
+ 
+      if (param && common && (param !== common)) {
+        ret = Utils.extend({}, common, param);
+      }
+ 
+      return ret;
+    },
+ 
+    noop: env.VM.noop,
+    compilerInfo: templateSpec.compiler
+  };
+ 
+  var ret = function(context, options) {
+    options = options || {};
+    var data = options.data;
+ 
+    ret._setup(options);
+    if (!options.partial && templateSpec.useData) {
+      data = initData(context, data);
+    }
+    var depths;
+    if (templateSpec.useDepths) {
+      depths = options.depths ? [context].concat(options.depths) : [context];
+    }
+ 
+    return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);
+  };
+  ret.isTop = true;
+ 
+  ret._setup = function(options) {
+    if (!options.partial) {
+      container.helpers = container.merge(options.helpers, env.helpers);
+ 
+      if (templateSpec.usePartial) {
+        container.partials = container.merge(options.partials, env.partials);
+      }
+    } else {
+      container.helpers = options.helpers;
+      container.partials = options.partials;
+    }
+  };
+ 
+  ret._child = function(i, data, depths) {
+    if (templateSpec.useDepths && !depths) {
+      throw new Exception('must pass parent depths');
+    }
+ 
+    return program(container, i, templateSpec[i], data, depths);
+  };
+  return ret;
+}
+ 
+exports.template = template;function program(container, i, fn, data, depths) {
+  var prog = function(context, options) {
+    options = options || {};
+ 
+    return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths));
+  };
+  prog.program = i;
+  prog.depth = depths ? depths.length : 0;
+  return prog;
+}
+ 
+exports.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) {
+  var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths };
+ 
+  if(partial === undefined) {
+    throw new Exception("The partial " + name + " could not be found");
+  } else if(partial instanceof Function) {
+    return partial(context, options);
+  }
+}
+ 
+exports.invokePartial = invokePartial;function noop() { return ""; }
+ 
+exports.noop = noop;function initData(context, data) {
+  if (!data || !('root' in data)) {
+    data = data ? createFrame(data) : {};
+    data.root = context;
+  }
+  return data;
+}
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/safe-string.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/safe-string.js.html new file mode 100644 index 0000000..5d39a7f --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/safe-string.js.html @@ -0,0 +1,352 @@ + + + + Code coverage report for dist/cjs/handlebars/safe-string.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/safe-string.js

+

+ + Statements: 100% (5 / 5)      + + + Branches: 100% (0 / 0)      + + + Functions: 100% (2 / 2)      + + + Lines: 100% (5 / 5)      + + Ignored: none      +

+
All files » dist/cjs/handlebars/ » safe-string.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11  +  +1 +12 +  +  +1 +12 +  +  +1
"use strict";
+// Build out our basic SafeString type
+function SafeString(string) {
+  this.string = string;
+}
+ 
+SafeString.prototype.toString = function() {
+  return "" + this.string;
+};
+ 
+exports["default"] = SafeString;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/utils.js.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/utils.js.html new file mode 100644 index 0000000..0cdb36f --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/utils.js.html @@ -0,0 +1,583 @@ + + + + Code coverage report for dist/cjs/handlebars/utils.js + + + + + + + +
+

Code coverage report for dist/cjs/handlebars/utils.js

+

+ + Statements: 100% (47 / 47)      + + + Branches: 100% (30 / 30)      + + + Functions: 100% (8 / 8)      + + + Lines: 100% (43 / 43)      + + Ignored: 3 statements, 2 functions, 8 branches      +

+
All files » dist/cjs/handlebars/ » utils.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88  +  +1 +  +1 +  +  +  +  +  +  +  +  +1 +1 +  +1 +27 +  +  +1 +933 +1249 +6468 +6467 +  +  +  +  +933 +  +  +1 +1 +  +  +1 +175 +  +  +  +1 +1 +1 +  +  +1 +1 +  +1 +1 +  +1 +  +1 +  +534 +11 +523 +29 +494 +19 +  +  +  +  +  +475 +  +475 +9 +  +  +1 +58 +5 +53 +2 +  +51 +  +  +  +1 +11 +  +  +1
"use strict";
+/*jshint -W004 */
+var SafeString = require("./safe-string")["default"];
+ 
+var escape = {
+  "&": "&amp;",
+  "<": "&lt;",
+  ">": "&gt;",
+  '"': "&quot;",
+  "'": "&#x27;",
+  "`": "&#x60;"
+};
+ 
+var badChars = /[&<>"'`]/g;
+var possible = /[&<>"'`]/;
+ 
+function escapeChar(chr) {
+  return escape[chr];
+}
+ 
+function extend(obj /* , ...source */) {
+  for (var i = 1; i < arguments.length; i++) {
+    for (var key in arguments[i]) {
+      if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
+        obj[key] = arguments[i][key];
+      }
+    }
+  }
+ 
+  return obj;
+}
+ 
+exports.extend = extend;var toString = Object.prototype.toString;
+exports.toString = toString;
+// Sourced from lodash
+// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
+var isFunction = function(value) {
+  return typeof value === 'function';
+};
+// fallback for older versions of Chrome and Safari
+/* istanbul ignore next */
+Iif (isFunction(/x/)) {
+  isFunction = function(value) {
+    return typeof value === 'function' && toString.call(value) === '[object Function]';
+  };
+}
+var isFunction;
+exports.isFunction = isFunction;
+/* istanbul ignore next */
+var isArray = Array.isArray || function(value) {
+  return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
+};
+exports.isArray = isArray;
+ 
+function escapeExpression(string) {
+  // don't escape SafeStrings, since they're already safe
+  if (string instanceof SafeString) {
+    return string.toString();
+  } else if (string == null) {
+    return "";
+  } else if (!string) {
+    return string + '';
+  }
+ 
+  // Force a string conversion as this will be done by the append regardless and
+  // the regex test will do this transparently behind the scenes, causing issues if
+  // an object's to string has escaped characters in it.
+  string = "" + string;
+ 
+  if(!possible.test(string)) { return string; }
+  return string.replace(badChars, escapeChar);
+}
+ 
+exports.escapeExpression = escapeExpression;function isEmpty(value) {
+  if (!value && value !== 0) {
+    return true;
+  } else if (isArray(value) && value.length === 0) {
+    return true;
+  } else {
+    return false;
+  }
+}
+ 
+exports.isEmpty = isEmpty;function appendContextPath(contextPath, id) {
+  return (contextPath ? contextPath + '.' : '') + id;
+}
+ 
+exports.appendContextPath = appendContextPath;
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/dist/cjs/index.html b/node_modules/handlebars/coverage/lcov-report/dist/cjs/index.html new file mode 100644 index 0000000..9cbd3a7 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/dist/cjs/index.html @@ -0,0 +1,363 @@ + + + + Code coverage report for dist/cjs/ + + + + + + + +
+

Code coverage report for dist/cjs/

+

+ + Statements: 100% (45 / 45)      + + + Branches: 100% (0 / 0)      + + + Functions: 100% (5 / 5)      + + + Lines: 100% (45 / 45)      + + Ignored: none      +

+
All files » dist/cjs/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
handlebars.js100%(25 / 25)100%(0 / 0)100%(3 / 3)100%(25 / 25)
handlebars.runtime.js100%(20 / 20)100%(0 / 0)100%(2 / 2)100%(20 / 20)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/index.html b/node_modules/handlebars/coverage/lcov-report/index.html new file mode 100644 index 0000000..ce9927a --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/index.html @@ -0,0 +1,389 @@ + + + + Code coverage report for All files + + + + + + + +
+

Code coverage report for All files

+

+ + Statements: 99.76% (1695 / 1699)      + + + Branches: 99.15% (937 / 945)      + + + Functions: 100% (220 / 220)      + + + Lines: 99.76% (1639 / 1643)      + + Ignored: 102 statements, 11 functions, 58 branches      +

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
dist/cjs/100%(45 / 45)100%(0 / 0)100%(5 / 5)100%(45 / 45)
dist/cjs/handlebars/100%(289 / 289)100%(203 / 203)100%(44 / 44)100%(274 / 274)
dist/cjs/handlebars/compiler/99.84%(1269 / 1271)99.4%(660 / 664)100%(164 / 164)99.84%(1229 / 1231)
lib/97.87%(92 / 94)94.87%(74 / 78)100%(7 / 7)97.85%(91 / 93)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/lib/index.html b/node_modules/handlebars/coverage/lcov-report/lib/index.html new file mode 100644 index 0000000..7b68223 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/lib/index.html @@ -0,0 +1,363 @@ + + + + Code coverage report for lib/ + + + + + + + +
+

Code coverage report for lib/

+

+ + Statements: 97.87% (92 / 94)      + + + Branches: 94.87% (74 / 78)      + + + Functions: 100% (7 / 7)      + + + Lines: 97.85% (91 / 93)      + + Ignored: 1 branch      +

+
All files » lib/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.js100%(13 / 13)100%(4 / 4)100%(1 / 1)100%(13 / 13)
precompiler.js97.53%(79 / 81)94.59%(70 / 74)100%(6 / 6)97.5%(78 / 80)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/lib/index.js.html b/node_modules/handlebars/coverage/lcov-report/lib/index.js.html new file mode 100644 index 0000000..f935b2d --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/lib/index.js.html @@ -0,0 +1,400 @@ + + + + Code coverage report for lib/index.js + + + + + + + +
+

Code coverage report for lib/index.js

+

+ + Statements: 100% (13 / 13)      + + + Branches: 100% (4 / 4)      + + + Functions: 100% (1 / 1)      + + + Lines: 100% (13 / 13)      + + Ignored: 1 branch      +

+
All files » lib/ » index.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +1 +  +1 +  +1 +1 +1 +  +1 +  +  +  +1 +1 +2 +2 +2 +  +1 +1 +  + 
// USAGE:
+// var handlebars = require('handlebars');
+ 
+// var local = handlebars.create();
+ 
+var handlebars = require('../dist/cjs/handlebars')["default"];
+ 
+handlebars.Visitor = require('../dist/cjs/handlebars/compiler/visitor')["default"];
+ 
+var printer = require('../dist/cjs/handlebars/compiler/printer');
+handlebars.PrintVisitor = printer.PrintVisitor;
+handlebars.print = printer.print;
+ 
+module.exports = handlebars;
+ 
+// Publish a Node.js require() handler for .handlebars and .hbs files
+/* istanbul ignore else */
+Eif (typeof require !== 'undefined' && require.extensions) {
+  var extension = function(module, filename) {
+    var fs = require("fs");
+    var templateString = fs.readFileSync(filename, "utf8");
+    module.exports = handlebars.compile(templateString);
+  };
+  require.extensions[".handlebars"] = extension;
+  require.extensions[".hbs"] = extension;
+}
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/lib/precompiler.js.html b/node_modules/handlebars/coverage/lcov-report/lib/precompiler.js.html new file mode 100644 index 0000000..80b0aeb --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/lib/precompiler.js.html @@ -0,0 +1,754 @@ + + + + Code coverage report for lib/precompiler.js + + + + + + + +
+

Code coverage report for lib/precompiler.js

+

+ + Statements: 97.53% (79 / 81)      + + + Branches: 94.59% (70 / 74)      + + + Functions: 100% (6 / 6)      + + + Lines: 97.5% (78 / 80)      + + Ignored: none      +

+
All files » lib/ » precompiler.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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  +1 +  +  +  +  +1 +54 +3 +3 +  +  +51 +51 +3 +  +  +48 +51 +51 +  +3 +  +  +  +45 +3 +  +42 +6 +  +  +  +36 +36 +3 +  +36 +3 +3 +  +  +  +  +36 +36 +  +36 +36 +27 +12 +15 +3 +  +12 +  +27 +27 +27 +27 +27 +  +1 +57 +  +57 +15 +45 +  +45 +21 +  +  +  +42 +  +42 +  +  +  +42 +  +  +  +  +42 +3 +  +  +  +42 +21 +21 +21 +  +42 +  +42 +9 +33 +9 +3 +  +9 +  +24 +3 +  +24 +  +  +  +  +36 +36 +  +  +  +36 +27 +12 +6 +3 +  +3 +  +  +12 +15 +12 +  +  +36 +  +36 +3 +  +  +36 +  +  +36 +  +  + 
 
+var fs = require('fs'),
+    Handlebars = require('./index'),
+    basename = require('path').basename,
+    uglify = require('uglify-js');
+ 
+module.exports.cli = function(opts) {
+  if (opts.version) {
+    console.log(Handlebars.VERSION);
+    return;
+  }
+ 
+  var template = [0];
+  if (!opts.templates.length) {
+    throw new Handlebars.Exception('Must define at least one template or directory.');
+  }
+ 
+  opts.templates.forEach(function(template) {
+    try {
+      fs.statSync(template);
+    } catch (err) {
+      throw new Handlebars.Exception('Unable to open template file "' + template + '"');
+    }
+  });
+ 
+  if (opts.simple && opts.min) {
+    throw new Handlebars.Exception('Unable to minimze simple output');
+  }
+  if (opts.simple && (opts.templates.length !== 1 || fs.statSync(opts.templates[0]).isDirectory())) {
+    throw new Handlebars.Exception('Unable to output multiple templates in simple mode');
+  }
+ 
+  // Convert the known list into a hash
+  var known = {};
+  if (opts.known && !Array.isArray(opts.known)) {
+    opts.known = [opts.known];
+  }
+  if (opts.known) {
+    for (var i = 0, len = opts.known.length; i < len; i++) {
+      known[opts.known[i]] = true;
+    }
+  }
+ 
+  // Build file extension pattern
+  var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function(arg) { return '\\' + arg; });
+  extension = new RegExp('\\.' + extension + '$');
+ 
+  var output = [];
+  if (!opts.simple) {
+    if (opts.amd) {
+      output.push('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n  Handlebars = Handlebars["default"];');
+    } else if (opts.commonjs) {
+      output.push('var Handlebars = require("' + opts.commonjs + '");');
+    } else {
+      output.push('(function() {\n');
+    }
+    output.push('  var template = Handlebars.template, templates = ');
+    output.push(opts.namespace);
+    output.push(' = ');
+    output.push(opts.namespace);
+    output.push(' || {};\n');
+  }
+  function processTemplate(template, root) {
+    var path = template,
+        stat = fs.statSync(path);
+    if (stat.isDirectory()) {
+      fs.readdirSync(template).map(function(file) {
+        var path = template + '/' + file;
+ 
+        if (extension.test(path) || fs.statSync(path).isDirectory()) {
+          processTemplate(path, root || template);
+        }
+      });
+    } else {
+      var data = fs.readFileSync(path, 'utf8');
+ 
+      Iif (opts.bom && data.indexOf('\uFEFF') === 0) {
+        data = data.substring(1);
+      }
+ 
+      var options = {
+        knownHelpers: known,
+        knownHelpersOnly: opts.o
+      };
+ 
+      if (opts.data) {
+        options.data = true;
+      }
+ 
+      // Clean the template name
+      if (!root) {
+        template = basename(template);
+      } else Eif (template.indexOf(root) === 0) {
+        template = template.substring(root.length+1);
+      }
+      template = template.replace(extension, '');
+ 
+      if (opts.simple) {
+        output.push(Handlebars.precompile(data, options) + '\n');
+      } else if (opts.partial) {
+        if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) {
+          output.push('return ');
+        }
+        output.push('Handlebars.partials[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n');
+      } else {
+        if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) {
+          output.push('return ');
+        }
+        output.push('templates[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n');
+      }
+    }
+  }
+ 
+  opts.templates.forEach(function(template) {
+    processTemplate(template, opts.root);
+  });
+ 
+  // Output the content
+  if (!opts.simple) {
+    if (opts.amd) {
+      if(opts.templates.length > 1 || (opts.templates.length == 1 && fs.statSync(opts.templates[0]).isDirectory())) {
+        if(opts.partial){
+          output.push('return Handlebars.partials;\n');
+        } else {
+          output.push('return templates;\n');
+        }
+      }
+      output.push('});');
+    } else if (!opts.commonjs) {
+      output.push('})();');
+    }
+  }
+  output = output.join('');
+ 
+  if (opts.min) {
+    output = uglify.minify(output, {fromString: true}).code;
+  }
+ 
+  Iif (opts.output) {
+    fs.writeFileSync(opts.output, output, 'utf8');
+  } else {
+    console.log(output);
+  }
+};
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/prettify.css b/node_modules/handlebars/coverage/lcov-report/prettify.css new file mode 100644 index 0000000..b317a7c --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/node_modules/handlebars/coverage/lcov-report/prettify.js b/node_modules/handlebars/coverage/lcov-report/prettify.js new file mode 100644 index 0000000..ef51e03 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/node_modules/handlebars/coverage/lcov-report/spec/ast.js.html b/node_modules/handlebars/coverage/lcov-report/spec/ast.js.html new file mode 100644 index 0000000..1d933d3 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/ast.js.html @@ -0,0 +1,1594 @@ + + + + Code coverage report for spec/ast.js + + + + + + + +
+

Code coverage report for spec/ast.js

+

+ + Statements: 28.99% (69 / 238)      + + + Branches: 100% (2 / 2)      + + + Functions: 30.88% (21 / 68)      + + + Lines: 28.99% (69 / 238)      + + Ignored: none      +

+
All files » spec/ » ast.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425  +3 +3 +1 +  +  +2 +  +  +  +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +2 +1 +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +2 +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +2 +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +  +2 +  +2 +  +  +  +  +2 +  +2 +2 +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +2 +  +1 +  +  +  +  +  +  +2 +  +2 +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +  +  +  +2 +2 +2 +  +  +  +  +  +2 +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +2 +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +2 +  +  +  +2 +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  + 
/*global Handlebars, handlebarsEnv, shouldThrow */
+describe('ast', function() {
+  if (!Handlebars.AST) {
+    return;
+  }
+ 
+  var LOCATION_INFO = {
+    last_line: 0,
+    first_line: 0,
+    first_column: 0,
+    last_column: 0
+  };
+ 
+  function testLocationInfoStorage(node){
+    var properties = [ 'firstLine', 'lastLine', 'firstColumn', 'lastColumn' ],
+        property,
+        propertiesLen = properties.length,
+        i;
+ 
+    for (i = 0; i < propertiesLen; i++){
+      property = properties[0];
+      equals(node[property], 0);
+    }
+  }
+ 
+  describe('MustacheNode', function() {
+    function testEscape(open, expected) {
+      var mustache = new handlebarsEnv.AST.MustacheNode([{}], {}, open, false);
+      equals(mustache.escaped, expected);
+    }
+ 
+    it('should store args', function() {
+      var id = {isSimple: true},
+          hash = {},
+          mustache = new handlebarsEnv.AST.MustacheNode([id, 'param1'], hash, '', false, LOCATION_INFO);
+      equals(mustache.type, 'mustache');
+      equals(mustache.hash, hash);
+      equals(mustache.escaped, true);
+      equals(mustache.id, id);
+      equals(mustache.params.length, 1);
+      equals(mustache.params[0], 'param1');
+      equals(!!mustache.isHelper, true);
+      testLocationInfoStorage(mustache);
+    });
+    it('should accept token for escape', function() {
+      testEscape('{{', true);
+      testEscape('{{~', true);
+      testEscape('{{#', true);
+      testEscape('{{~#', true);
+      testEscape('{{/', true);
+      testEscape('{{~/', true);
+      testEscape('{{^', true);
+      testEscape('{{~^', true);
+      testEscape('{', true);
+      testEscape('{', true);
+ 
+      testEscape('{{&', false);
+      testEscape('{{~&', false);
+      testEscape('{{{', false);
+      testEscape('{{~{', false);
+    });
+    it('should accept boolean for escape', function() {
+      testEscape(true, true);
+      testEscape({}, true);
+ 
+      testEscape(false, false);
+      testEscape(undefined, false);
+    });
+  });
+  describe('BlockNode', function() {
+    it('should throw on mustache mismatch (old sexpr-less version)', function() {
+      shouldThrow(function() {
+        var mustacheNode = new handlebarsEnv.AST.MustacheNode([{ original: 'foo'}], null, '{{', {});
+        new handlebarsEnv.AST.BlockNode(mustacheNode, {}, {}, {path: {original: 'bar'}});
+      }, Handlebars.Exception, "foo doesn't match bar");
+    });
+    it('should throw on mustache mismatch', function() {
+      shouldThrow(function() {
+        var sexprNode = new handlebarsEnv.AST.SexprNode([{ original: 'foo'}], null);
+        var mustacheNode = new handlebarsEnv.AST.MustacheNode(sexprNode, null, '{{', {});
+        new handlebarsEnv.AST.BlockNode(mustacheNode, {}, {}, {path: {original: 'bar'}}, {first_line: 2, first_column: 2});
+      }, Handlebars.Exception, "foo doesn't match bar - 2:2");
+    });
+ 
+    it('stores location info', function(){
+      var sexprNode = new handlebarsEnv.AST.SexprNode([{ original: 'foo'}], null);
+      var mustacheNode = new handlebarsEnv.AST.MustacheNode(sexprNode, null, '{{', {});
+      var block = new handlebarsEnv.AST.BlockNode(mustacheNode,
+                                                  {statements: [], strip: {}}, {statements: [], strip: {}},
+                                                  {
+                                                    strip: {},
+                                                    path: {original: 'foo'}
+                                                  },
+                                                  LOCATION_INFO);
+      testLocationInfoStorage(block);
+    });
+  });
+  describe('IdNode', function() {
+    it('should throw on invalid path', function() {
+      shouldThrow(function() {
+        new handlebarsEnv.AST.IdNode([
+          {part: 'foo'},
+          {part: '..'},
+          {part: 'bar'}
+        ], {first_line: 1, first_column: 1});
+      }, Handlebars.Exception, "Invalid path: foo.. - 1:1");
+      shouldThrow(function() {
+        new handlebarsEnv.AST.IdNode([
+          {part: 'foo'},
+          {part: '.'},
+          {part: 'bar'}
+        ], {first_line: 1, first_column: 1});
+      }, Handlebars.Exception, "Invalid path: foo. - 1:1");
+      shouldThrow(function() {
+        new handlebarsEnv.AST.IdNode([
+          {part: 'foo'},
+          {part: 'this'},
+          {part: 'bar'}
+        ], {first_line: 1, first_column: 1});
+      }, Handlebars.Exception, "Invalid path: foothis - 1:1");
+    });
+ 
+    it('stores location info', function(){
+      var idNode = new handlebarsEnv.AST.IdNode([], LOCATION_INFO);
+      testLocationInfoStorage(idNode);
+    });
+  });
+ 
+  describe("HashNode", function(){
+ 
+    it('stores location info', function(){
+      var hash = new handlebarsEnv.AST.HashNode([], LOCATION_INFO);
+      testLocationInfoStorage(hash);
+    });
+  });
+ 
+  describe("ContentNode", function(){
+ 
+    it('stores location info', function(){
+      var content = new handlebarsEnv.AST.ContentNode("HI", LOCATION_INFO);
+      testLocationInfoStorage(content);
+    });
+  });
+ 
+  describe("CommentNode", function(){
+ 
+    it('stores location info', function(){
+      var comment = new handlebarsEnv.AST.CommentNode("HI", LOCATION_INFO);
+      testLocationInfoStorage(comment);
+    });
+  });
+ 
+  describe("NumberNode", function(){
+ 
+    it('stores location info', function(){
+      var integer = new handlebarsEnv.AST.NumberNode("6", LOCATION_INFO);
+      testLocationInfoStorage(integer);
+    });
+  });
+ 
+  describe("StringNode", function(){
+ 
+    it('stores location info', function(){
+      var string = new handlebarsEnv.AST.StringNode("6", LOCATION_INFO);
+      testLocationInfoStorage(string);
+    });
+  });
+ 
+  describe("BooleanNode", function(){
+ 
+    it('stores location info', function(){
+      var bool = new handlebarsEnv.AST.BooleanNode("true", LOCATION_INFO);
+      testLocationInfoStorage(bool);
+    });
+  });
+ 
+  describe("DataNode", function(){
+ 
+    it('stores location info', function(){
+      var data = new handlebarsEnv.AST.DataNode("YES", LOCATION_INFO);
+      testLocationInfoStorage(data);
+    });
+  });
+ 
+  describe("PartialNameNode", function(){
+ 
+    it('stores location info', function(){
+      var pnn = new handlebarsEnv.AST.PartialNameNode({original: "YES"}, LOCATION_INFO);
+      testLocationInfoStorage(pnn);
+    });
+  });
+ 
+  describe("PartialNode", function(){
+ 
+    it('stores location info', function(){
+      var pn = new handlebarsEnv.AST.PartialNode("so_partial", {}, {}, {}, LOCATION_INFO);
+      testLocationInfoStorage(pn);
+    });
+  });
+  describe("ProgramNode", function(){
+ 
+    describe("storing location info", function(){
+      it("stores when `inverse` argument isn't passed", function(){
+        var pn = new handlebarsEnv.AST.ProgramNode(false, [], LOCATION_INFO);
+        testLocationInfoStorage(pn);
+      });
+ 
+      it("stores when `inverse` or `stripInverse` arguments passed", function(){
+        var pn = new handlebarsEnv.AST.ProgramNode(false, [], {strip: {}}, undefined, LOCATION_INFO);
+        testLocationInfoStorage(pn);
+ 
+        var clone = {
+          strip: {},
+          firstLine: 0,
+          lastLine: 0,
+          firstColumn: 0,
+          lastColumn: 0
+        };
+        pn = new handlebarsEnv.AST.ProgramNode(false, [], {strip: {}}, [ clone ], LOCATION_INFO);
+        testLocationInfoStorage(pn);
+ 
+        // Assert that the newly created ProgramNode has the same location
+        // information as the inverse
+        testLocationInfoStorage(pn.inverse);
+      });
+    });
+  });
+ 
+  describe("Line Numbers", function(){
+    var ast, statements;
+ 
+    function testColumns(node, firstLine, lastLine, firstColumn, lastColumn){
+      equals(node.firstLine, firstLine);
+      equals(node.lastLine, lastLine);
+      equals(node.firstColumn, firstColumn);
+      equals(node.lastColumn, lastColumn);
+    }
+ 
+    ast = Handlebars.parse("line 1 {{line1Token}}\n line 2 {{line2token}}\n line 3 {{#blockHelperOnLine3}}\nline 4{{line4token}}\n" +
+                           "line5{{else}}\n{{line6Token}}\n{{/blockHelperOnLine3}}");
+    statements = ast.statements;
+ 
+    it('gets ContentNode line numbers', function(){
+      var contentNode = statements[0];
+      testColumns(contentNode, 1, 1, 0, 7);
+    });
+ 
+    it('gets MustacheNode line numbers', function(){
+      var mustacheNode = statements[1];
+      testColumns(mustacheNode, 1, 1, 7, 21);
+    });
+ 
+    it('gets line numbers correct when newlines appear', function(){
+      testColumns(statements[2], 1, 2, 21, 0);
+      testColumns(statements[3], 2, 2, 0, 8);
+    });
+ 
+    it('gets MustacheNode line numbers correct across newlines', function(){
+      var secondMustacheNode = statements[4];
+      testColumns(secondMustacheNode, 2, 2, 8, 22);
+     });
+ 
+     it('gets the block helper information correct', function(){
+       var blockHelperNode = statements[7];
+       testColumns(blockHelperNode, 3, 7, 8, 23);
+     });
+ 
+     it('correctly records the line numbers of an inverse of a block helper', function(){
+       var blockHelperNode = statements[7],
+           inverse = blockHelperNode.inverse;
+ 
+       testColumns(inverse, 5, 6, 13, 0);
+     });
+  });
+ 
+  describe('standalone flags', function(){
+    describe('mustache', function() {
+      it('does not mark mustaches as standalone', function() {
+        var ast = Handlebars.parse('  {{comment}} ');
+        equals(ast.statements[0].omit, undefined);
+        equals(ast.statements[2].omit, undefined);
+      });
+    });
+    describe('blocks', function() {
+      it('marks block mustaches as standalone', function() {
+        var ast = Handlebars.parse(' {{# comment}} \nfoo\n {{else}} \n  bar \n  {{/comment}} '),
+            block = ast.statements[1];
+ 
+        equals(ast.statements[0].omit, true);
+ 
+        equals(block.program.statements[0].omit, true);
+        equals(block.program.statements[1].string, 'foo\n');
+        equals(block.program.statements[2].omit, true);
+ 
+        equals(block.inverse.statements[0].omit, true);
+        equals(block.inverse.statements[1].string, '  bar \n');
+        equals(block.inverse.statements[2].omit, true);
+ 
+        equals(ast.statements[2].omit, true);
+      });
+      it('marks initial block mustaches as standalone', function() {
+        var ast = Handlebars.parse('{{# comment}} \nfoo\n {{/comment}}'),
+            block = ast.statements[0];
+ 
+        equals(block.program.statements[0].omit, true);
+        equals(block.program.statements[1].string, 'foo\n');
+        equals(block.program.statements[2].omit, true);
+      });
+      it('marks mustaches with children as standalone', function() {
+        var ast = Handlebars.parse('{{# comment}} \n{{foo}}\n {{/comment}}'),
+            block = ast.statements[0];
+ 
+        equals(block.program.statements[0].omit, true);
+        equals(block.program.statements[1].id.original, 'foo');
+        equals(block.program.statements[2].omit, undefined);
+        equals(block.program.statements[3].omit, true);
+      });
+      it('marks nested block mustaches as standalone', function() {
+        var ast = Handlebars.parse('{{#foo}} \n{{# comment}} \nfoo\n {{else}} \n  bar \n  {{/comment}} \n{{/foo}}'),
+            statements = ast.statements[0].program.statements,
+            block = statements[1];
+ 
+        equals(statements[0].omit, true);
+ 
+        equals(block.program.statements[0].omit, true);
+        equals(block.program.statements[1].string, 'foo\n');
+        equals(block.program.statements[2].omit, true);
+ 
+        equals(block.inverse.statements[0].omit, true);
+        equals(block.inverse.statements[1].string, '  bar \n');
+        equals(block.inverse.statements[2].omit, true);
+ 
+        equals(statements[0].omit, true);
+      });
+      it('does not mark nested block mustaches as standalone', function() {
+        var ast = Handlebars.parse('{{#foo}} {{# comment}} \nfoo\n {{else}} \n  bar \n  {{/comment}} {{/foo}}'),
+            statements = ast.statements[0].program.statements,
+            block = statements[1];
+ 
+        equals(statements[0].omit, undefined);
+ 
+        equals(block.program.statements[0].omit, undefined);
+        equals(block.program.statements[1].string, 'foo\n');
+        equals(block.program.statements[2].omit, true);
+ 
+        equals(block.inverse.statements[0].omit, true);
+        equals(block.inverse.statements[1].string, '  bar \n');
+        equals(block.inverse.statements[2].omit, undefined);
+ 
+        equals(statements[0].omit, undefined);
+      });
+      it('does not mark nested initial block mustaches as standalone', function() {
+        var ast = Handlebars.parse('{{#foo}}{{# comment}} \nfoo\n {{else}} \n  bar \n  {{/comment}}{{/foo}}'),
+            statements = ast.statements[0].program.statements,
+            block = statements[0];
+ 
+        equals(block.program.statements[0].omit, undefined);
+        equals(block.program.statements[1].string, 'foo\n');
+        equals(block.program.statements[2].omit, true);
+ 
+        equals(block.inverse.statements[0].omit, true);
+        equals(block.inverse.statements[1].string, '  bar \n');
+        equals(block.inverse.statements[2].omit, undefined);
+ 
+        equals(statements[0].omit, undefined);
+      });
+ 
+      it('marks column 0 block mustaches as standalone', function() {
+        var ast = Handlebars.parse('test\n{{# comment}} \nfoo\n {{else}} \n  bar \n  {{/comment}} '),
+            block = ast.statements[1];
+ 
+        equals(ast.statements[0].omit, undefined);
+ 
+        equals(block.program.statements[0].omit, true);
+        equals(block.program.statements[1].string, 'foo\n');
+        equals(block.program.statements[2].omit, true);
+ 
+        equals(block.inverse.statements[0].omit, true);
+        equals(block.inverse.statements[1].string, '  bar \n');
+        equals(block.inverse.statements[2].omit, true);
+ 
+        equals(ast.statements[2].omit, true);
+      });
+    });
+    describe('partials', function() {
+      it('marks partial as standalone', function() {
+        var ast = Handlebars.parse('{{> partial }} ');
+        equals(ast.statements[1].omit, true);
+      });
+      it('marks indented partial as standalone', function() {
+        var ast = Handlebars.parse('  {{> partial }} ');
+        equals(ast.statements[0].omit, true);
+        equals(ast.statements[1].indent, '  ');
+        equals(ast.statements[2].omit, true);
+      });
+      it('marks those around content as not standalone', function() {
+        var ast = Handlebars.parse('a{{> partial }}');
+        equals(ast.statements[0].omit, undefined);
+ 
+        ast = Handlebars.parse('{{> partial }}a');
+        equals(ast.statements[1].omit, undefined);
+      });
+    });
+    describe('comments', function() {
+      it('marks comment as standalone', function() {
+        var ast = Handlebars.parse('{{! comment }} ');
+        equals(ast.statements[1].omit, true);
+      });
+      it('marks indented comment as standalone', function() {
+        var ast = Handlebars.parse('  {{! comment }} ');
+        equals(ast.statements[0].omit, true);
+        equals(ast.statements[2].omit, true);
+      });
+      it('marks those around content as not standalone', function() {
+        var ast = Handlebars.parse('a{{! comment }}');
+        equals(ast.statements[0].omit, undefined);
+ 
+        ast = Handlebars.parse('{{! comment }}a');
+        equals(ast.statements[1].omit, undefined);
+      });
+    });
+  });
+});
+ 
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/basic.js.html b/node_modules/handlebars/coverage/lcov-report/spec/basic.js.html new file mode 100644 index 0000000..5c90a38 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/basic.js.html @@ -0,0 +1,973 @@ + + + + Code coverage report for spec/basic.js + + + + + + + +
+

Code coverage report for spec/basic.js

+

+ + Statements: 29.31% (34 / 116)      + + + Branches: 100% (0 / 0)      + + + Functions: 2.13% (1 / 47)      + + + Lines: 30.09% (34 / 113)      + + Ignored: none      +

+
All files » spec/ » basic.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218  +3 +  +3 +  +  +  +3 +3 +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  + 
/*global CompilerContext, Handlebars, beforeEach, shouldCompileTo */
+global.handlebarsEnv = null;
+ 
+beforeEach(function() {
+  global.handlebarsEnv = Handlebars.create();
+});
+ 
+describe("basic context", function() {
+  it("most basic", function() {
+    shouldCompileTo("{{foo}}", { foo: "foo" }, "foo");
+  });
+ 
+  it("escaping", function() {
+    shouldCompileTo("\\{{foo}}", { foo: "food" }, "{{foo}}");
+    shouldCompileTo("content \\{{foo}}", { foo: "food" }, "content {{foo}}");
+    shouldCompileTo("\\\\{{foo}}", { foo: "food" }, "\\food");
+    shouldCompileTo("content \\\\{{foo}}", { foo: "food" }, "content \\food");
+    shouldCompileTo("\\\\ {{foo}}", { foo: "food" }, "\\\\ food");
+  });
+ 
+  it("compiling with a basic context", function() {
+    shouldCompileTo("Goodbye\n{{cruel}}\n{{world}}!", {cruel: "cruel", world: "world"}, "Goodbye\ncruel\nworld!",
+                    "It works if all the required keys are provided");
+  });
+ 
+  it("compiling with an undefined context", function() {
+    shouldCompileTo("Goodbye\n{{cruel}}\n{{world.bar}}!", undefined, "Goodbye\n\n!");
+ 
+    shouldCompileTo("{{#unless foo}}Goodbye{{../test}}{{test2}}{{/unless}}", undefined, "Goodbye");
+  });
+ 
+  it("comments", function() {
+    shouldCompileTo("{{! Goodbye}}Goodbye\n{{cruel}}\n{{world}}!",
+      {cruel: "cruel", world: "world"}, "Goodbye\ncruel\nworld!",
+      "comments are ignored");
+  });
+ 
+  it("boolean", function() {
+    var string   = "{{#goodbye}}GOODBYE {{/goodbye}}cruel {{world}}!";
+    shouldCompileTo(string, {goodbye: true, world: "world"}, "GOODBYE cruel world!",
+                    "booleans show the contents when true");
+ 
+    shouldCompileTo(string, {goodbye: false, world: "world"}, "cruel world!",
+                    "booleans do not show the contents when false");
+  });
+ 
+  it("zeros", function() {
+    shouldCompileTo("num1: {{num1}}, num2: {{num2}}", {num1: 42, num2: 0},
+        "num1: 42, num2: 0");
+    shouldCompileTo("num: {{.}}", 0, "num: 0");
+    shouldCompileTo("num: {{num1/num2}}", {num1: {num2: 0}}, "num: 0");
+  });
+ 
+  it("newlines", function() {
+      shouldCompileTo("Alan's\nTest", {}, "Alan's\nTest");
+      shouldCompileTo("Alan's\rTest", {}, "Alan's\rTest");
+  });
+ 
+  it("escaping text", function() {
+    shouldCompileTo("Awesome's", {}, "Awesome's", "text is escaped so that it doesn't get caught on single quotes");
+    shouldCompileTo("Awesome\\", {}, "Awesome\\", "text is escaped so that the closing quote can't be ignored");
+    shouldCompileTo("Awesome\\\\ foo", {}, "Awesome\\\\ foo", "text is escaped so that it doesn't mess up backslashes");
+    shouldCompileTo("Awesome {{foo}}", {foo: '\\'}, "Awesome \\", "text is escaped so that it doesn't mess up backslashes");
+    shouldCompileTo(' " " ', {}, ' " " ', "double quotes never produce invalid javascript");
+  });
+ 
+  it("escaping expressions", function() {
+   shouldCompileTo("{{{awesome}}}", {awesome: "&\"\\<>"}, '&\"\\<>',
+          "expressions with 3 handlebars aren't escaped");
+ 
+   shouldCompileTo("{{&awesome}}", {awesome: "&\"\\<>"}, '&\"\\<>',
+          "expressions with {{& handlebars aren't escaped");
+ 
+   shouldCompileTo("{{awesome}}", {awesome: "&\"'`\\<>"}, '&amp;&quot;&#x27;&#x60;\\&lt;&gt;',
+          "by default expressions should be escaped");
+ 
+   shouldCompileTo("{{awesome}}", {awesome: "Escaped, <b> looks like: &lt;b&gt;"}, 'Escaped, &lt;b&gt; looks like: &amp;lt;b&amp;gt;',
+          "escaping should properly handle amperstands");
+  });
+ 
+  it("functions returning safestrings shouldn't be escaped", function() {
+    var hash = {awesome: function() { return new Handlebars.SafeString("&\"\\<>"); }};
+    shouldCompileTo("{{awesome}}", hash, '&\"\\<>',
+        "functions returning safestrings aren't escaped");
+  });
+ 
+  it("functions", function() {
+    shouldCompileTo("{{awesome}}", {awesome: function() { return "Awesome"; }}, "Awesome",
+                    "functions are called and render their output");
+    shouldCompileTo("{{awesome}}", {awesome: function() { return this.more; }, more:  "More awesome"}, "More awesome",
+                    "functions are bound to the context");
+  });
+ 
+  it("functions with context argument", function() {
+    shouldCompileTo("{{awesome frank}}",
+        {awesome: function(context) { return context; },
+          frank: "Frank"},
+        "Frank", "functions are called with context arguments");
+  });
+  it("pathed functions with context argument", function() {
+    shouldCompileTo("{{bar.awesome frank}}",
+        {bar: {awesome: function(context) { return context; }},
+          frank: "Frank"},
+        "Frank", "functions are called with context arguments");
+  });
+  it("depthed functions with context argument", function() {
+    shouldCompileTo("{{#with frank}}{{../awesome .}}{{/with}}",
+        {awesome: function(context) { return context; },
+          frank: "Frank"},
+        "Frank", "functions are called with context arguments");
+  });
+ 
+  it("block functions with context argument", function() {
+    shouldCompileTo("{{#awesome 1}}inner {{.}}{{/awesome}}",
+        {awesome: function(context, options) { return options.fn(context); }},
+        "inner 1", "block functions are called with context and options");
+  });
+ 
+  it("depthed block functions with context argument", function() {
+    shouldCompileTo("{{#with value}}{{#../awesome 1}}inner {{.}}{{/../awesome}}{{/with}}",
+        {value: true, awesome: function(context, options) { return options.fn(context); }},
+        "inner 1", "block functions are called with context and options");
+  });
+ 
+  it("block functions without context argument", function() {
+    shouldCompileTo("{{#awesome}}inner{{/awesome}}",
+        {awesome: function(options) { return options.fn(this); }},
+        "inner", "block functions are called with options");
+  });
+  it("pathed block functions without context argument", function() {
+    shouldCompileTo("{{#foo.awesome}}inner{{/foo.awesome}}",
+        {foo: {awesome: function(options) { return this; }}},
+        "inner", "block functions are called with options");
+  });
+  it("depthed block functions without context argument", function() {
+    shouldCompileTo("{{#with value}}{{#../awesome}}inner{{/../awesome}}{{/with}}",
+        {value: true, awesome: function(options) { return this; }},
+        "inner", "block functions are called with options");
+  });
+ 
+ 
+  it("paths with hyphens", function() {
+    shouldCompileTo("{{foo-bar}}", {"foo-bar": "baz"}, "baz", "Paths can contain hyphens (-)");
+    shouldCompileTo("{{foo.foo-bar}}", {foo: {"foo-bar": "baz"}}, "baz", "Paths can contain hyphens (-)");
+    shouldCompileTo("{{foo/foo-bar}}", {foo: {"foo-bar": "baz"}}, "baz", "Paths can contain hyphens (-)");
+  });
+ 
+  it("nested paths", function() {
+    shouldCompileTo("Goodbye {{alan/expression}} world!", {alan: {expression: "beautiful"}},
+                    "Goodbye beautiful world!", "Nested paths access nested objects");
+  });
+ 
+  it("nested paths with empty string value", function() {
+    shouldCompileTo("Goodbye {{alan/expression}} world!", {alan: {expression: ""}},
+                    "Goodbye  world!", "Nested paths access nested objects with empty string");
+  });
+ 
+  it("literal paths", function() {
+    shouldCompileTo("Goodbye {{[@alan]/expression}} world!", {"@alan": {expression: "beautiful"}},
+        "Goodbye beautiful world!", "Literal paths can be used");
+    shouldCompileTo("Goodbye {{[foo bar]/expression}} world!", {"foo bar": {expression: "beautiful"}},
+        "Goodbye beautiful world!", "Literal paths can be used");
+  });
+ 
+  it('literal references', function() {
+    shouldCompileTo("Goodbye {{[foo bar]}} world!", {"foo bar": "beautiful"},
+        "Goodbye beautiful world!", "Literal paths can be used");
+  });
+ 
+  it("that current context path ({{.}}) doesn't hit helpers", function() {
+    shouldCompileTo("test: {{.}}", [null, {helper: "awesome"}], "test: ");
+  });
+ 
+  it("complex but empty paths", function() {
+    shouldCompileTo("{{person/name}}", {person: {name: null}}, "");
+    shouldCompileTo("{{person/name}}", {person: {}}, "");
+  });
+ 
+  it("this keyword in paths", function() {
+    var string = "{{#goodbyes}}{{this}}{{/goodbyes}}";
+    var hash = {goodbyes: ["goodbye", "Goodbye", "GOODBYE"]};
+    shouldCompileTo(string, hash, "goodbyeGoodbyeGOODBYE",
+      "This keyword in paths evaluates to current context");
+ 
+    string = "{{#hellos}}{{this/text}}{{/hellos}}";
+    hash = {hellos: [{text: "hello"}, {text: "Hello"}, {text: "HELLO"}]};
+    shouldCompileTo(string, hash, "helloHelloHELLO", "This keyword evaluates in more complex paths");
+  });
+ 
+  it("this keyword nested inside path", function() {
+    var string = "{{#hellos}}{{text/this/foo}}{{/hellos}}";
+    shouldThrow(function() {
+      CompilerContext.compile(string);
+    }, Error);
+  });
+ 
+  it("this keyword in helpers", function() {
+    var helpers = {foo: function(value) {
+        return 'bar ' + value;
+    }};
+    var string = "{{#goodbyes}}{{foo this}}{{/goodbyes}}";
+    var hash = {goodbyes: ["goodbye", "Goodbye", "GOODBYE"]};
+    shouldCompileTo(string, [hash, helpers], "bar goodbyebar Goodbyebar GOODBYE",
+      "This keyword in paths evaluates to current context");
+ 
+    string = "{{#hellos}}{{foo this/text}}{{/hellos}}";
+    hash = {hellos: [{text: "hello"}, {text: "Hello"}, {text: "HELLO"}]};
+    shouldCompileTo(string, [hash, helpers], "bar hellobar Hellobar HELLO", "This keyword evaluates in more complex paths");
+  });
+ 
+  it("this keyword nested inside helpers param", function() {
+    var string = "{{#hellos}}{{foo text/this/foo}}{{/hellos}}";
+    shouldThrow(function() {
+      CompilerContext.compile(string);
+    }, Error);
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/blocks.js.html b/node_modules/handlebars/coverage/lcov-report/spec/blocks.js.html new file mode 100644 index 0000000..fe8e9ab --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/blocks.js.html @@ -0,0 +1,676 @@ + + + + Code coverage report for spec/blocks.js + + + + + + + +
+

Code coverage report for spec/blocks.js

+

+ + Statements: 29.69% (19 / 64)      + + + Branches: 100% (0 / 0)      + + + Functions: 20% (4 / 20)      + + + Lines: 29.69% (19 / 64)      + + Ignored: none      +

+
All files » spec/ » blocks.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +3 +3 +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +  +  + 
/*global CompilerContext, shouldCompileTo, shouldThrow */
+describe('blocks', function() {
+  it("array", function() {
+    var string   = "{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!";
+    var hash     = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+    shouldCompileTo(string, hash, "goodbye! Goodbye! GOODBYE! cruel world!",
+                    "Arrays iterate over the contents when not empty");
+ 
+    shouldCompileTo(string, {goodbyes: [], world: "world"}, "cruel world!",
+                    "Arrays ignore the contents when empty");
+ 
+  });
+ 
+  it("array with @index", function() {
+    var string = "{{#goodbyes}}{{@index}}. {{text}}! {{/goodbyes}}cruel {{world}}!";
+    var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+    var template = CompilerContext.compile(string);
+    var result = template(hash);
+ 
+    equal(result, "0. goodbye! 1. Goodbye! 2. GOODBYE! cruel world!", "The @index variable is used");
+  });
+  
+  it("empty block", function() {
+    var string   = "{{#goodbyes}}{{/goodbyes}}cruel {{world}}!";
+    var hash     = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+    shouldCompileTo(string, hash, "cruel world!",
+                    "Arrays iterate over the contents when not empty");
+ 
+    shouldCompileTo(string, {goodbyes: [], world: "world"}, "cruel world!",
+                    "Arrays ignore the contents when empty");
+  });
+ 
+  it("block with complex lookup", function() {
+    var string = "{{#goodbyes}}{{text}} cruel {{../name}}! {{/goodbyes}}";
+    var hash     = {name: "Alan", goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}]};
+ 
+    shouldCompileTo(string, hash, "goodbye cruel Alan! Goodbye cruel Alan! GOODBYE cruel Alan! ",
+                    "Templates can access variables in contexts up the stack with relative path syntax");
+  });
+ 
+  it("block with complex lookup using nested context", function() {
+    var string = "{{#goodbyes}}{{text}} cruel {{foo/../name}}! {{/goodbyes}}";
+ 
+    shouldThrow(function() {
+      CompilerContext.compile(string);
+    }, Error);
+  });
+ 
+  it("block with deep nested complex lookup", function() {
+    var string = "{{#outer}}Goodbye {{#inner}}cruel {{../../omg}}{{/inner}}{{/outer}}";
+    var hash = {omg: "OMG!", outer: [{ inner: [{ text: "goodbye" }] }] };
+ 
+    shouldCompileTo(string, hash, "Goodbye cruel OMG!");
+  });
+ 
+  describe('inverted sections', function() {
+    it("inverted sections with unset value", function() {
+      var string = "{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}";
+      var hash = {};
+      shouldCompileTo(string, hash, "Right On!", "Inverted section rendered when value isn't set.");
+    });
+ 
+    it("inverted section with false value", function() {
+      var string = "{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}";
+      var hash = {goodbyes: false};
+      shouldCompileTo(string, hash, "Right On!", "Inverted section rendered when value is false.");
+    });
+ 
+    it("inverted section with empty set", function() {
+      var string = "{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}";
+      var hash = {goodbyes: []};
+      shouldCompileTo(string, hash, "Right On!", "Inverted section rendered when value is empty set.");
+    });
+ 
+    it("block inverted sections", function() {
+      shouldCompileTo("{{#people}}{{name}}{{^}}{{none}}{{/people}}", {none: "No people"},
+        "No people");
+    });
+ 
+    it("block inverted sections with empty arrays", function() {
+      shouldCompileTo("{{#people}}{{name}}{{^}}{{none}}{{/people}}", {none: "No people", people: []},
+        "No people");
+    });
+  });
+ 
+  describe('standalone sections', function() {
+    it('block standalone else sections', function() {
+      shouldCompileTo('{{#people}}\n{{name}}\n{{^}}\n{{none}}\n{{/people}}\n', {none: 'No people'},
+        'No people\n');
+      shouldCompileTo('{{#none}}\n{{.}}\n{{^}}\n{{none}}\n{{/none}}\n', {none: 'No people'},
+        'No people\n');
+      shouldCompileTo('\n{{#people}}\n{{name}}\n{{^}}\n{{none}}\n{{/people}}\n', {none: 'No people'},
+        'No people\n');
+    });
+  });
+ 
+  describe('compat mode', function() {
+    it("block with deep recursive lookup lookup", function() {
+      var string = "{{#outer}}Goodbye {{#inner}}cruel {{omg}}{{/inner}}{{/outer}}";
+      var hash = {omg: "OMG!", outer: [{ inner: [{ text: "goodbye" }] }] };
+ 
+      shouldCompileTo(string, [hash, undefined, undefined, true], "Goodbye cruel OMG!");
+    });
+    it("block with deep recursive pathed lookup", function() {
+      var string = "{{#outer}}Goodbye {{#inner}}cruel {{omg.yes}}{{/inner}}{{/outer}}";
+      var hash = {omg: {yes: "OMG!"}, outer: [{ inner: [{ yes: 'no', text: "goodbye" }] }] };
+ 
+      shouldCompileTo(string, [hash, undefined, undefined, true], "Goodbye cruel OMG!");
+    });
+    it("block with missed recursive lookup", function() {
+      var string = "{{#outer}}Goodbye {{#inner}}cruel {{omg.yes}}{{/inner}}{{/outer}}";
+      var hash = {omg: {no: "OMG!"}, outer: [{ inner: [{ yes: 'no', text: "goodbye" }] }] };
+ 
+      shouldCompileTo(string, [hash, undefined, undefined, true], "Goodbye cruel ");
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/builtins.js.html b/node_modules/handlebars/coverage/lcov-report/spec/builtins.js.html new file mode 100644 index 0000000..73de04c --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/builtins.js.html @@ -0,0 +1,1018 @@ + + + + Code coverage report for spec/builtins.js + + + + + + + +
+

Code coverage report for spec/builtins.js

+

+ + Statements: 20% (27 / 135)      + + + Branches: 0% (0 / 4)      + + + Functions: 13.89% (5 / 36)      + + + Lines: 20.93% (27 / 129)      + + Ignored: none      +

+
All files » spec/ » builtins.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233  +3 +3 +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +3 +  +  +  +3 +  +  +  +  +  +3 +3 +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  + 
/*global CompilerContext, shouldCompileTo, shouldThrow, compileWithPartials, handlebarsEnv */
+describe('builtin helpers', function() {
+  describe('#if', function() {
+    it("if", function() {
+      var string   = "{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!";
+      shouldCompileTo(string, {goodbye: true, world: "world"}, "GOODBYE cruel world!",
+                      "if with boolean argument shows the contents when true");
+      shouldCompileTo(string, {goodbye: "dummy", world: "world"}, "GOODBYE cruel world!",
+                      "if with string argument shows the contents");
+      shouldCompileTo(string, {goodbye: false, world: "world"}, "cruel world!",
+                      "if with boolean argument does not show the contents when false");
+      shouldCompileTo(string, {world: "world"}, "cruel world!",
+                      "if with undefined does not show the contents");
+      shouldCompileTo(string, {goodbye: ['foo'], world: "world"}, "GOODBYE cruel world!",
+                      "if with non-empty array shows the contents");
+      shouldCompileTo(string, {goodbye: [], world: "world"}, "cruel world!",
+                      "if with empty array does not show the contents");
+      shouldCompileTo(string, {goodbye: 0, world: "world"}, "cruel world!",
+                      "if with zero does not show the contents");
+      shouldCompileTo("{{#if goodbye includeZero=true}}GOODBYE {{/if}}cruel {{world}}!",
+                      {goodbye: 0, world: "world"}, "GOODBYE cruel world!",
+                      "if with zero does not show the contents");
+    });
+ 
+    it("if with function argument", function() {
+      var string   = "{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!";
+      shouldCompileTo(string, {goodbye: function() {return true;}, world: "world"}, "GOODBYE cruel world!",
+                      "if with function shows the contents when function returns true");
+      shouldCompileTo(string, {goodbye: function() {return this.world;}, world: "world"}, "GOODBYE cruel world!",
+                      "if with function shows the contents when function returns string");
+      shouldCompileTo(string, {goodbye: function() {return false;}, world: "world"}, "cruel world!",
+                      "if with function does not show the contents when returns false");
+      shouldCompileTo(string, {goodbye: function() {return this.foo;}, world: "world"}, "cruel world!",
+                      "if with function does not show the contents when returns undefined");
+    });
+  });
+ 
+  describe('#with', function() {
+    it("with", function() {
+      var string = "{{#with person}}{{first}} {{last}}{{/with}}";
+      shouldCompileTo(string, {person: {first: "Alan", last: "Johnson"}}, "Alan Johnson");
+    });
+    it("with with function argument", function() {
+      var string = "{{#with person}}{{first}} {{last}}{{/with}}";
+      shouldCompileTo(string, {person: function() { return {first: "Alan", last: "Johnson"};}}, "Alan Johnson");
+    });
+    it("with with else", function() {
+      var string = "{{#with person}}Person is present{{else}}Person is not present{{/with}}";
+      shouldCompileTo(string, {}, "Person is not present");
+    });
+  });
+ 
+  describe('#each', function() {
+    beforeEach(function() {
+      handlebarsEnv.registerHelper('detectDataInsideEach', function(options) {
+        return options.data && options.data.exclaim;
+      });
+    });
+ 
+    it("each", function() {
+      var string   = "{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!";
+      var hash     = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+      shouldCompileTo(string, hash, "goodbye! Goodbye! GOODBYE! cruel world!",
+                      "each with array argument iterates over the contents when not empty");
+      shouldCompileTo(string, {goodbyes: [], world: "world"}, "cruel world!",
+                      "each with array argument ignores the contents when empty");
+    });
+ 
+    it("each with an object and @key", function() {
+      var string   = "{{#each goodbyes}}{{@key}}. {{text}}! {{/each}}cruel {{world}}!";
+      var hash     = {goodbyes: {"<b>#1</b>": {text: "goodbye"}, 2: {text: "GOODBYE"}}, world: "world"};
+ 
+      // Object property iteration order is undefined according to ECMA spec,
+      // so we need to check both possible orders
+      // @see http://stackoverflow.com/questions/280713/elements-order-in-a-for-in-loop
+      var actual = compileWithPartials(string, hash);
+      var expected1 = "&lt;b&gt;#1&lt;/b&gt;. goodbye! 2. GOODBYE! cruel world!";
+      var expected2 = "2. GOODBYE! &lt;b&gt;#1&lt;/b&gt;. goodbye! cruel world!";
+ 
+      equals(actual === expected1 || actual === expected2, true, "each with object argument iterates over the contents when not empty");
+      shouldCompileTo(string, {goodbyes: [], world: "world"}, "cruel world!",
+                      "each with object argument ignores the contents when empty");
+    });
+ 
+    it("each with @index", function() {
+      var string = "{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "0. goodbye! 1. Goodbye! 2. GOODBYE! cruel world!", "The @index variable is used");
+    });
+ 
+    it("each with nested @index", function() {
+      var string = "{{#each goodbyes}}{{@index}}. {{text}}! {{#each ../goodbyes}}{{@index}} {{/each}}After {{@index}} {{/each}}{{@index}}cruel {{world}}!";
+      var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "0. goodbye! 0 1 2 After 0 1. Goodbye! 0 1 2 After 1 2. GOODBYE! 0 1 2 After 2 cruel world!", "The @index variable is used");
+    });
+ 
+    it("each object with @index", function() {
+      var string = "{{#each goodbyes}}{{@index}}. {{text}}! {{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: {'a': {text: "goodbye"}, b: {text: "Goodbye"}, c: {text: "GOODBYE"}}, world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "0. goodbye! 1. Goodbye! 2. GOODBYE! cruel world!", "The @index variable is used");
+    });
+ 
+ 
+    it("each with @first", function() {
+      var string = "{{#each goodbyes}}{{#if @first}}{{text}}! {{/if}}{{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "goodbye! cruel world!", "The @first variable is used");
+    });
+ 
+    it("each with nested @first", function() {
+      var string = "{{#each goodbyes}}({{#if @first}}{{text}}! {{/if}}{{#each ../goodbyes}}{{#if @first}}{{text}}!{{/if}}{{/each}}{{#if @first}} {{text}}!{{/if}}) {{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "(goodbye! goodbye! goodbye!) (goodbye!) (goodbye!) cruel world!", "The @first variable is used");
+    });
+ 
+    it("each object with @first", function() {
+      var string = "{{#each goodbyes}}{{#if @first}}{{text}}! {{/if}}{{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: {'foo': {text: "goodbye"}, bar: {text: "Goodbye"}}, world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "goodbye! cruel world!", "The @first variable is used");
+    });
+ 
+    it("each with @last", function() {
+      var string = "{{#each goodbyes}}{{#if @last}}{{text}}! {{/if}}{{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "GOODBYE! cruel world!", "The @last variable is used");
+    });
+ 
+    it("each with nested @last", function() {
+      var string = "{{#each goodbyes}}({{#if @last}}{{text}}! {{/if}}{{#each ../goodbyes}}{{#if @last}}{{text}}!{{/if}}{{/each}}{{#if @last}} {{text}}!{{/if}}) {{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, "(GOODBYE!) (GOODBYE!) (GOODBYE! GOODBYE! GOODBYE!) cruel world!", "The @last variable is used");
+    });
+ 
+    it("each with function argument", function() {
+      var string = "{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!";
+      var hash   = {goodbyes: function () { return [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}];}, world: "world"};
+      shouldCompileTo(string, hash, "goodbye! Goodbye! GOODBYE! cruel world!",
+                "each with array function argument iterates over the contents when not empty");
+      shouldCompileTo(string, {goodbyes: [], world: "world"}, "cruel world!",
+                "each with array function argument ignores the contents when empty");
+    });
+ 
+    it("data passed to helpers", function() {
+      var string = "{{#each letters}}{{this}}{{detectDataInsideEach}}{{/each}}";
+      var hash = {letters: ['a', 'b', 'c']};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash, {
+        data: {
+          exclaim: '!'
+        }
+      });
+      equal(result, 'a!b!c!', 'should output data');
+    });
+ 
+    it("each on implicit context", function() {
+      shouldThrow(function() {
+        var template = CompilerContext.compile("{{#each}}{{text}}! {{/each}}cruel world!");
+        template({});
+      }, handlebarsEnv.Exception, 'Must pass iterator to #each');
+    });
+  });
+ 
+  it("#log", function() {
+    var string = "{{log blah}}";
+    var hash   = { blah: "whee" };
+ 
+    var levelArg, logArg;
+    handlebarsEnv.log = function(level, arg){
+      levelArg = level;
+      logArg = arg;
+    };
+ 
+    shouldCompileTo(string, hash, "", "log should not display");
+    equals(1, levelArg, "should call log with 1");
+    equals("whee", logArg, "should call log with 'whee'");
+  });
+ 
+ 
+  describe('#lookup', function() {
+    it('should lookup arbitrary content', function() {
+      var string = '{{#each goodbyes}}{{lookup ../data .}}{{/each}}',
+          hash   = {goodbyes: [0, 1], data: ['foo', 'bar']};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, 'foobar');
+    });
+    it('should not fail on undefined value', function() {
+      var string = '{{#each goodbyes}}{{lookup ../bar .}}{{/each}}',
+          hash   = {goodbyes: [0, 1], data: ['foo', 'bar']};
+ 
+      var template = CompilerContext.compile(string);
+      var result = template(hash);
+ 
+      equal(result, '');
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/data.js.html b/node_modules/handlebars/coverage/lcov-report/spec/data.js.html new file mode 100644 index 0000000..1db88da --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/data.js.html @@ -0,0 +1,1093 @@ + + + + Code coverage report for spec/data.js + + + + + + + +
+

Code coverage report for spec/data.js

+

+ + Statements: 17.6% (22 / 125)      + + + Branches: 0% (0 / 12)      + + + Functions: 6.98% (3 / 43)      + + + Lines: 17.6% (22 / 125)      + + Ignored: none      +

+
All files » spec/ » data.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258  +3 +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/*global CompilerContext, Handlebars, handlebarsEnv, shouldThrow */
+describe('data', function() {
+  it("passing in data to a compiled function that expects data - works with helpers", function() {
+    var template = CompilerContext.compile("{{hello}}", {data: true});
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.data.adjective + " "  + this.noun;
+      }
+    };
+ 
+    var result = template({noun: "cat"}, {helpers: helpers, data: {adjective: "happy"}});
+    equals("happy cat", result, "Data output by helper");
+  });
+ 
+  it("data can be looked up via @foo", function() {
+    var template = CompilerContext.compile("{{@hello}}");
+    var result = template({}, { data: { hello: "hello" } });
+    equals("hello", result, "@foo retrieves template data");
+  });
+ 
+  it("deep @foo triggers automatic top-level data", function() {
+    var template = CompilerContext.compile('{{#let world="world"}}{{#if foo}}{{#if foo}}Hello {{@world}}{{/if}}{{/if}}{{/let}}');
+ 
+    var helpers = Handlebars.createFrame(handlebarsEnv.helpers);
+ 
+    helpers.let = function(options) {
+      var frame = Handlebars.createFrame(options.data);
+ 
+      for (var prop in options.hash) {
+        frame[prop] = options.hash[prop];
+      }
+      return options.fn(this, { data: frame });
+    };
+ 
+    var result = template({ foo: true }, { helpers: helpers });
+    equals("Hello world", result, "Automatic data was triggered");
+  });
+ 
+  it("parameter data can be looked up via @foo", function() {
+    var template = CompilerContext.compile("{{hello @world}}");
+    var helpers = {
+      hello: function(noun) {
+        return "Hello " + noun;
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers, data: { world: "world" } });
+    equals("Hello world", result, "@foo as a parameter retrieves template data");
+  });
+ 
+  it("hash values can be looked up via @foo", function() {
+    var template = CompilerContext.compile("{{hello noun=@world}}");
+    var helpers = {
+      hello: function(options) {
+        return "Hello " + options.hash.noun;
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers, data: { world: "world" } });
+    equals("Hello world", result, "@foo as a parameter retrieves template data");
+  });
+ 
+  it("nested parameter data can be looked up via @foo.bar", function() {
+    var template = CompilerContext.compile("{{hello @world.bar}}");
+    var helpers = {
+      hello: function(noun) {
+        return "Hello " + noun;
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers, data: { world: {bar: "world" } } });
+    equals("Hello world", result, "@foo as a parameter retrieves template data");
+  });
+ 
+  it("nested parameter data does not fail with @world.bar", function() {
+    var template = CompilerContext.compile("{{hello @world.bar}}");
+    var helpers = {
+      hello: function(noun) {
+        return "Hello " + noun;
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers, data: { foo: {bar: "world" } } });
+    equals("Hello undefined", result, "@foo as a parameter retrieves template data");
+  });
+ 
+  it("parameter data throws when using complex scope references", function() {
+    var string = "{{#goodbyes}}{{text}} cruel {{@foo/../name}}! {{/goodbyes}}";
+ 
+    shouldThrow(function() {
+      CompilerContext.compile(string);
+    }, Error);
+  });
+ 
+  it("data is inherited downstream", function() {
+    var template = CompilerContext.compile("{{#let foo=1 bar=2}}{{#let foo=bar.baz}}{{@bar}}{{@foo}}{{/let}}{{@foo}}{{/let}}", { data: true });
+    var helpers = {
+      let: function(options) {
+        var frame = Handlebars.createFrame(options.data);
+        for (var prop in options.hash) {
+          frame[prop] = options.hash[prop];
+        }
+        return options.fn(this, {data: frame});
+      }
+    };
+ 
+    var result = template({ bar: { baz: "hello world" } }, { helpers: helpers, data: {} });
+    equals("2hello world1", result, "data variables are inherited downstream");
+  });
+ 
+  it("passing in data to a compiled function that expects data - works with helpers in partials", function() {
+    var template = CompilerContext.compile("{{>my_partial}}", {data: true});
+ 
+    var partials = {
+      my_partial: CompilerContext.compile("{{hello}}", {data: true})
+    };
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.data.adjective + " "  + this.noun;
+      }
+    };
+ 
+    var result = template({noun: "cat"}, {helpers: helpers, partials: partials, data: {adjective: "happy"}});
+    equals("happy cat", result, "Data output by helper inside partial");
+  });
+ 
+  it("passing in data to a compiled function that expects data - works with helpers and parameters", function() {
+    var template = CompilerContext.compile("{{hello world}}", {data: true});
+ 
+    var helpers = {
+      hello: function(noun, options) {
+        return options.data.adjective + " "  + noun + (this.exclaim ? "!" : "");
+      }
+    };
+ 
+    var result = template({exclaim: true, world: "world"}, {helpers: helpers, data: {adjective: "happy"}});
+    equals("happy world!", result, "Data output by helper");
+  });
+ 
+  it("passing in data to a compiled function that expects data - works with block helpers", function() {
+    var template = CompilerContext.compile("{{#hello}}{{world}}{{/hello}}", {data: true});
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.fn(this);
+      },
+      world: function(options) {
+        return options.data.adjective + " world" + (this.exclaim ? "!" : "");
+      }
+    };
+ 
+    var result = template({exclaim: true}, {helpers: helpers, data: {adjective: "happy"}});
+    equals("happy world!", result, "Data output by helper");
+  });
+ 
+  it("passing in data to a compiled function that expects data - works with block helpers that use ..", function() {
+    var template = CompilerContext.compile("{{#hello}}{{world ../zomg}}{{/hello}}", {data: true});
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.fn({exclaim: "?"});
+      },
+      world: function(thing, options) {
+        return options.data.adjective + " " + thing + (this.exclaim || "");
+      }
+    };
+ 
+    var result = template({exclaim: true, zomg: "world"}, {helpers: helpers, data: {adjective: "happy"}});
+    equals("happy world?", result, "Data output by helper");
+  });
+ 
+  it("passing in data to a compiled function that expects data - data is passed to with block helpers where children use ..", function() {
+    var template = CompilerContext.compile("{{#hello}}{{world ../zomg}}{{/hello}}", {data: true});
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.data.accessData + " " + options.fn({exclaim: "?"});
+      },
+      world: function(thing, options) {
+        return options.data.adjective + " " + thing + (this.exclaim || "");
+      }
+    };
+ 
+    var result = template({exclaim: true, zomg: "world"}, {helpers: helpers, data: {adjective: "happy", accessData: "#win"}});
+    equals("#win happy world?", result, "Data output by helper");
+  });
+ 
+  it("you can override inherited data when invoking a helper", function() {
+    var template = CompilerContext.compile("{{#hello}}{{world zomg}}{{/hello}}", {data: true});
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.fn({exclaim: "?", zomg: "world"}, { data: {adjective: "sad"} });
+      },
+      world: function(thing, options) {
+        return options.data.adjective + " " + thing + (this.exclaim || "");
+      }
+    };
+ 
+    var result = template({exclaim: true, zomg: "planet"}, {helpers: helpers, data: {adjective: "happy"}});
+    equals("sad world?", result, "Overriden data output by helper");
+  });
+ 
+ 
+  it("you can override inherited data when invoking a helper with depth", function() {
+    var template = CompilerContext.compile("{{#hello}}{{world ../zomg}}{{/hello}}", {data: true});
+ 
+    var helpers = {
+      hello: function(options) {
+        return options.fn({exclaim: "?"}, { data: {adjective: "sad"} });
+      },
+      world: function(thing, options) {
+        return options.data.adjective + " " + thing + (this.exclaim || "");
+      }
+    };
+ 
+    var result = template({exclaim: true, zomg: "world"}, {helpers: helpers, data: {adjective: "happy"}});
+    equals("sad world?", result, "Overriden data output by helper");
+  });
+ 
+  describe('@root', function() {
+    it('the root context can be looked up via @root', function() {
+      var template = CompilerContext.compile('{{@root.foo}}');
+      var result = template({foo: 'hello'}, { data: {} });
+      equals('hello', result);
+ 
+      result = template({foo: 'hello'}, {});
+      equals('hello', result);
+    });
+    it('passed root values take priority', function() {
+      var template = CompilerContext.compile('{{@root.foo}}');
+      var result = template({}, { data: {root: {foo: 'hello'} } });
+      equals('hello', result);
+    });
+  });
+ 
+  describe('nesting', function() {
+    it('the root context can be looked up via @root', function() {
+      var template = CompilerContext.compile('{{#helper}}{{#helper}}{{@./depth}} {{@../depth}} {{@../../depth}}{{/helper}}{{/helper}}');
+      var result = template({foo: 'hello'}, {
+        helpers: {
+          helper: function(options) {
+            var frame = Handlebars.createFrame(options.data);
+            frame.depth = options.data.depth + 1;
+            return options.fn(this, {data: frame});
+          }
+        },
+        data: {
+          depth: 0
+        }
+      });
+      equals('2 1 0', result);
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/env/browser.js.html b/node_modules/handlebars/coverage/lcov-report/spec/env/browser.js.html new file mode 100644 index 0000000..d7ac516 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/env/browser.js.html @@ -0,0 +1,406 @@ + + + + Code coverage report for spec/env/browser.js + + + + + + + +
+

Code coverage report for spec/env/browser.js

+

+ + Statements: 46.15% (6 / 13)      + + + Branches: 100% (0 / 0)      + + + Functions: 0% (0 / 3)      + + + Lines: 46.15% (6 / 13)      + + Ignored: none      +

+
All files » spec/env/ » browser.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29  +1 +  +1 +  +  +  +1 +1 +  +1 +  +  +  +  +  +  +  +  +  +1 +  +  +  +  +  +  +  + 
/*global handlebarsEnv */
+require('./common');
+ 
+var _ = require('underscore'),
+    fs = require('fs'),
+    vm = require('vm');
+ 
+global.Handlebars = undefined;
+vm.runInThisContext(fs.readFileSync(__dirname + '/../../dist/handlebars.js'), 'dist/handlebars.js');
+ 
+global.CompilerContext = {
+  compile: function(template, options) {
+    var templateSpec = handlebarsEnv.precompile(template, options);
+    return handlebarsEnv.template(safeEval(templateSpec));
+  },
+  compileWithPartial: function(template, options) {
+    return handlebarsEnv.compile(template, options);
+  }
+};
+ 
+function safeEval(templateSpec) {
+  try {
+    return eval('(' + templateSpec + ')');
+  } catch (err) {
+    console.error(templateSpec);
+    throw err;
+  }
+}
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/env/common.js.html b/node_modules/handlebars/coverage/lcov-report/spec/env/common.js.html new file mode 100644 index 0000000..ee61b8d --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/env/common.js.html @@ -0,0 +1,481 @@ + + + + Code coverage report for spec/env/common.js + + + + + + + +
+

Code coverage report for spec/env/common.js

+

+ + Statements: 16.67% (5 / 30)      + + + Branches: 0% (0 / 22)      + + + Functions: 0% (0 / 5)      + + + Lines: 16.67% (5 / 30)      + + Ignored: none      +

+
All files » spec/env/ » common.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +1 +  +  +  +1 +  +  +  +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1 +  +  +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/*global CompilerContext, compileWithPartials, shouldCompileToWithPartials */
+global.shouldCompileTo = function(string, hashOrArray, expected, message) {
+  shouldCompileToWithPartials(string, hashOrArray, false, expected, message);
+};
+ 
+global.shouldCompileToWithPartials = function(string, hashOrArray, partials, expected, message) {
+  var result = compileWithPartials(string, hashOrArray, partials);
+  if (result !== expected) {
+    throw new Error("'" + result + "' should === '" + expected + "': " + message);
+  }
+};
+ 
+global.compileWithPartials = function(string, hashOrArray, partials) {
+  var template,
+      ary,
+      options;
+  if(Object.prototype.toString.call(hashOrArray) === "[object Array]") {
+    ary = [];
+    ary.push(hashOrArray[0]);
+    ary.push({ helpers: hashOrArray[1], partials: hashOrArray[2] });
+    options = {compat: hashOrArray[3]};
+  } else {
+    ary = [hashOrArray];
+  }
+ 
+  template = CompilerContext[partials ? 'compileWithPartial' : 'compile'](string, options);
+  return template.apply(this, ary);
+};
+ 
+ 
+global.equals = global.equal = function(a, b, msg) {
+  if (a !== b) {
+    throw new Error("'" + a + "' should === '" + b + "'" + (msg ? ": " + msg : ''));
+  }
+};
+ 
+global.shouldThrow = function(callback, type, msg) {
+  var failed;
+  try {
+    callback();
+    failed = true;
+  } catch (err) {
+    if (type && !(err instanceof type)) {
+      throw new Error('Type failure');
+    }
+    if (msg && !(msg.test ? msg.test(err.message) : msg === err.message)) {
+      throw new Error('Message failure');
+    }
+  }
+  if (failed) {
+    throw new Error('It failed to throw');
+  }
+};
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/env/index.html b/node_modules/handlebars/coverage/lcov-report/spec/env/index.html new file mode 100644 index 0000000..8bac850 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/env/index.html @@ -0,0 +1,402 @@ + + + + Code coverage report for spec/env/ + + + + + + + +
+

Code coverage report for spec/env/

+

+ + Statements: 46.67% (49 / 105)      + + + Branches: 4.17% (1 / 24)      + + + Functions: 33.33% (8 / 24)      + + + Lines: 46.67% (49 / 105)      + + Ignored: none      +

+
All files » spec/env/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
browser.js46.15%(6 / 13)100%(0 / 0)0%(0 / 3)46.15%(6 / 13)
common.js16.67%(5 / 30)0%(0 / 22)0%(0 / 5)16.67%(5 / 30)
node.js36.36%(4 / 11)100%(0 / 0)0%(0 / 3)36.36%(4 / 11)
runner.js100%(25 / 25)50%(1 / 2)100%(8 / 8)100%(25 / 25)
runtime.js34.62%(9 / 26)100%(0 / 0)0%(0 / 5)34.62%(9 / 26)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/env/node.js.html b/node_modules/handlebars/coverage/lcov-report/spec/env/node.js.html new file mode 100644 index 0000000..88f1293 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/env/node.js.html @@ -0,0 +1,391 @@ + + + + Code coverage report for spec/env/node.js + + + + + + + +
+

Code coverage report for spec/env/node.js

+

+ + Statements: 36.36% (4 / 11)      + + + Branches: 100% (0 / 0)      + + + Functions: 0% (0 / 3)      + + + Lines: 36.36% (4 / 11)      + + Ignored: none      +

+
All files » spec/env/ » node.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24  +1 +  +1 +  +1 +  +  +  +  +  +  +  +  +  +1 +  +  +  +  +  +  +  + 
/*global handlebarsEnv */
+require('./common');
+ 
+global.Handlebars = require('../../lib');
+ 
+global.CompilerContext = {
+  compile: function(template, options) {
+    var templateSpec = handlebarsEnv.precompile(template, options);
+    return handlebarsEnv.template(safeEval(templateSpec));
+  },
+  compileWithPartial: function(template, options) {
+    return handlebarsEnv.compile(template, options);
+  }
+};
+ 
+function safeEval(templateSpec) {
+  try {
+    return eval('(' + templateSpec + ')');
+  } catch (err) {
+    console.error(templateSpec);
+    throw err;
+  }
+}
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/env/runner.js.html b/node_modules/handlebars/coverage/lcov-report/spec/env/runner.js.html new file mode 100644 index 0000000..9ca41e8 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/env/runner.js.html @@ -0,0 +1,457 @@ + + + + Code coverage report for spec/env/runner.js + + + + + + + +
+

Code coverage report for spec/env/runner.js

+

+ + Statements: 100% (25 / 25)      + + + Branches: 50% (1 / 2)      + + + Functions: 100% (8 / 8)      + + + Lines: 100% (25 / 25)      + + Ignored: none      +

+
All files » spec/env/ » runner.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +461 +  +  +  +1 +  +  +  +1 +  +1 +26 +20 +  +1 +  +1 +1 +1 +1 +  +  +  +  +  +1 +3 +3 +3 +3 +3 +3 +  +  +3 +60 +  +  +3 +3 +3 +3 +3 +  +  + 
var fs = require('fs'),
+    Mocha = require('mocha'),
+    path = require('path');
+ 
+var errors = 0,
+    testDir = path.dirname(__dirname),
+    grep = process.argv[2];
+ 
+var files = [ testDir + "/basic.js" ];
+ 
+var files = fs.readdirSync(testDir)
+      .filter(function(name) { return (/.*\.js$/).test(name); })
+      .map(function(name) { return testDir + '/' + name; });
+ 
+console.log(files);
+ 
+run('./node', function() {
+  run('./browser', function() {
+    run('./runtime', function() {
+      process.exit(errors);
+    });
+  });
+});
+ 
+ 
+function run(env, callback) {
+  var mocha = new Mocha();
+  mocha.ui('bdd');
+  mocha.reporter('spec');
+  mocha.files = files.slice();
+  Eif (grep) {
+    mocha.grep(grep);
+  }
+ 
+  files.forEach(function(name) {
+    delete require.cache[name];
+  });
+ 
+  console.log('Running env: ' + env);
+  require(env);
+  mocha.run(function(errorCount) {
+    errors += errorCount;
+    callback();
+  });
+}
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/env/runtime.js.html b/node_modules/handlebars/coverage/lcov-report/spec/env/runtime.js.html new file mode 100644 index 0000000..ca6578d --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/env/runtime.js.html @@ -0,0 +1,466 @@ + + + + Code coverage report for spec/env/runtime.js + + + + + + + +
+

Code coverage report for spec/env/runtime.js

+

+ + Statements: 34.62% (9 / 26)      + + + Branches: 100% (0 / 0)      + + + Functions: 0% (0 / 5)      + + + Lines: 34.62% (9 / 26)      + + Ignored: none      +

+
All files » spec/env/ » runtime.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +1 +  +1 +  +  +  +1 +1 +  +1 +1 +1 +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1 +  +  +  +  +  +  +  + 
/*global handlebarsEnv */
+require('./common');
+ 
+var _ = require('underscore'),
+    fs = require('fs'),
+    vm = require('vm');
+ 
+global.Handlebars = undefined;
+vm.runInThisContext(fs.readFileSync(__dirname + '/../../dist/handlebars.runtime.js'), 'dist/handlebars.runtime.js');
+ 
+var parse = require('../../dist/cjs/handlebars/compiler/base').parse;
+var compiler = require('../../dist/cjs/handlebars/compiler/compiler');
+var JavaScriptCompiler = require('../../dist/cjs/handlebars/compiler/javascript-compiler')['default'];
+ 
+global.CompilerContext = {
+  compile: function(template, options) {
+    // Hack the compiler on to the environment for these specific tests
+    handlebarsEnv.precompile = function(template, options) {
+      return compiler.precompile(template, options, handlebarsEnv);
+    };
+    handlebarsEnv.parse = parse;
+    handlebarsEnv.Compiler = compiler.Compiler;
+    handlebarsEnv.JavaScriptCompiler = JavaScriptCompiler;
+ 
+    var templateSpec = handlebarsEnv.precompile(template, options);
+    return handlebarsEnv.template(safeEval(templateSpec));
+  },
+  compileWithPartial: function(template, options) {
+    // Hack the compiler on to the environment for these specific tests
+    handlebarsEnv.compile = function(template, options) {
+      return compiler.compile(template, options, handlebarsEnv);
+    };
+    handlebarsEnv.parse = parse;
+    handlebarsEnv.Compiler = compiler.Compiler;
+    handlebarsEnv.JavaScriptCompiler = JavaScriptCompiler;
+ 
+    return handlebarsEnv.compile(template, options);
+  }
+};
+ 
+function safeEval(templateSpec) {
+  try {
+    return eval('(' + templateSpec + ')');
+  } catch (err) {
+    console.error(templateSpec);
+    throw err;
+  }
+}
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/helpers.js.html b/node_modules/handlebars/coverage/lcov-report/spec/helpers.js.html new file mode 100644 index 0000000..20c55f1 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/helpers.js.html @@ -0,0 +1,2182 @@ + + + + Code coverage report for spec/helpers.js + + + + + + + +
+

Code coverage report for spec/helpers.js

+

+ + Statements: 19.23% (70 / 364)      + + + Branches: 0% (0 / 26)      + + + Functions: 7.81% (10 / 128)      + + + Lines: 20.71% (70 / 338)      + + Ignored: none      +

+
All files » spec/ » helpers.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +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 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621  +3 +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +3 +3 +  +  +  +  +3 +  +  +  +  +  +  +3 +3 +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +3 +  +  +3 +  +  +3 +  +  +3 +  +  +3 +  +  +  +  +  +3 +  +  +  +3 +  +  +  +  +3 +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/*global CompilerContext, Handlebars, shouldCompileTo, shouldCompileToWithPartials, shouldThrow, handlebarsEnv */
+describe('helpers', function() {
+  it("helper with complex lookup$", function() {
+    var string = "{{#goodbyes}}{{{link ../prefix}}}{{/goodbyes}}";
+    var hash = {prefix: "/root", goodbyes: [{text: "Goodbye", url: "goodbye"}]};
+    var helpers = {link: function(prefix) {
+      return "<a href='" + prefix + "/" + this.url + "'>" + this.text + "</a>";
+    }};
+    shouldCompileTo(string, [hash, helpers], "<a href='/root/goodbye'>Goodbye</a>");
+  });
+ 
+  it("helper for raw block gets raw content", function() {
+    var string   = "{{{{raw}}}} {{test}} {{{{/raw}}}}";
+    var hash = { test: "hello" };
+    var helpers = { raw: function(options) {
+        return options.fn();
+    } };
+    shouldCompileTo(string, [hash, helpers], " {{test}} ",
+                    "raw block helper gets raw content");
+  });
+  
+  it("helper for raw block gets parameters", function() {
+    var string   = "{{{{raw 1 2 3}}}} {{test}} {{{{/raw}}}}";
+    var hash = { test: "hello" };
+    var helpers = { raw: function(a, b, c, options) {
+        return options.fn() + a + b + c;
+    } };
+    shouldCompileTo(string, [hash, helpers], " {{test}} 123",
+                    "raw block helper gets raw content");
+  });
+  
+  it("helper block with complex lookup expression", function() {
+    var string = "{{#goodbyes}}{{../name}}{{/goodbyes}}";
+    var hash = {name: "Alan"};
+    var helpers = {goodbyes: function(options) {
+      var out = "";
+      var byes = ["Goodbye", "goodbye", "GOODBYE"];
+      for (var i = 0,j = byes.length; i < j; i++) {
+        out += byes[i] + " " + options.fn(this) + "! ";
+      }
+      return out;
+    }};
+    shouldCompileTo(string, [hash, helpers], "Goodbye Alan! goodbye Alan! GOODBYE Alan! ");
+  });
+ 
+  it("helper with complex lookup and nested template", function() {
+    var string = "{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}";
+    var hash = {prefix: '/root', goodbyes: [{text: "Goodbye", url: "goodbye"}]};
+    var helpers = {link: function (prefix, options) {
+        return "<a href='" + prefix + "/" + this.url + "'>" + options.fn(this) + "</a>";
+    }};
+    shouldCompileToWithPartials(string, [hash, helpers], false, "<a href='/root/goodbye'>Goodbye</a>");
+  });
+ 
+  it("helper with complex lookup and nested template in VM+Compiler", function() {
+    var string = "{{#goodbyes}}{{#link ../prefix}}{{text}}{{/link}}{{/goodbyes}}";
+    var hash = {prefix: '/root', goodbyes: [{text: "Goodbye", url: "goodbye"}]};
+    var helpers = {link: function (prefix, options) {
+        return "<a href='" + prefix + "/" + this.url + "'>" + options.fn(this) + "</a>";
+    }};
+    shouldCompileToWithPartials(string, [hash, helpers], true, "<a href='/root/goodbye'>Goodbye</a>");
+  });
+ 
+  it("block helper", function() {
+    var string   = "{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!";
+    var template = CompilerContext.compile(string);
+ 
+    var result = template({world: "world"}, { helpers: {goodbyes: function(options) { return options.fn({text: "GOODBYE"}); }}});
+    equal(result, "GOODBYE! cruel world!", "Block helper executed");
+  });
+ 
+  it("block helper staying in the same context", function() {
+    var string   = "{{#form}}<p>{{name}}</p>{{/form}}";
+    var template = CompilerContext.compile(string);
+ 
+    var result = template({name: "Yehuda"}, {helpers: {form: function(options) { return "<form>" + options.fn(this) + "</form>"; } }});
+    equal(result, "<form><p>Yehuda</p></form>", "Block helper executed with current context");
+  });
+ 
+  it("block helper should have context in this", function() {
+    var source = "<ul>{{#people}}<li>{{#link}}{{name}}{{/link}}</li>{{/people}}</ul>";
+    var link = function(options) {
+      return '<a href="/people/' + this.id + '">' + options.fn(this) + '</a>';
+    };
+    var data = { "people": [
+      { "name": "Alan", "id": 1 },
+      { "name": "Yehuda", "id": 2 }
+    ]};
+ 
+    shouldCompileTo(source, [data, {link: link}], "<ul><li><a href=\"/people/1\">Alan</a></li><li><a href=\"/people/2\">Yehuda</a></li></ul>");
+  });
+ 
+  it("block helper for undefined value", function() {
+    shouldCompileTo("{{#empty}}shouldn't render{{/empty}}", {}, "");
+  });
+ 
+  it("block helper passing a new context", function() {
+    var string   = "{{#form yehuda}}<p>{{name}}</p>{{/form}}";
+    var template = CompilerContext.compile(string);
+ 
+    var result = template({yehuda: {name: "Yehuda"}}, { helpers: {form: function(context, options) { return "<form>" + options.fn(context) + "</form>"; }}});
+    equal(result, "<form><p>Yehuda</p></form>", "Context variable resolved");
+  });
+ 
+  it("block helper passing a complex path context", function() {
+    var string   = "{{#form yehuda/cat}}<p>{{name}}</p>{{/form}}";
+    var template = CompilerContext.compile(string);
+ 
+    var result = template({yehuda: {name: "Yehuda", cat: {name: "Harold"}}}, { helpers: {form: function(context, options) { return "<form>" + options.fn(context) + "</form>"; }}});
+    equal(result, "<form><p>Harold</p></form>", "Complex path variable resolved");
+  });
+ 
+  it("nested block helpers", function() {
+    var string   = "{{#form yehuda}}<p>{{name}}</p>{{#link}}Hello{{/link}}{{/form}}";
+    var template = CompilerContext.compile(string);
+ 
+    var result = template({
+      yehuda: {name: "Yehuda" }
+    }, {
+      helpers: {
+        link: function(options) { return "<a href='" + this.name + "'>" + options.fn(this) + "</a>"; },
+        form: function(context, options) { return "<form>" + options.fn(context) + "</form>"; }
+      }
+    });
+    equal(result, "<form><p>Yehuda</p><a href='Yehuda'>Hello</a></form>", "Both blocks executed");
+  });
+ 
+  it("block helper inverted sections", function() {
+    var string = "{{#list people}}{{name}}{{^}}<em>Nobody's here</em>{{/list}}";
+    var list = function(context, options) {
+      if (context.length > 0) {
+        var out = "<ul>";
+        for(var i = 0,j=context.length; i < j; i++) {
+          out += "<li>";
+          out += options.fn(context[i]);
+          out += "</li>";
+        }
+        out += "</ul>";
+        return out;
+      } else {
+        return "<p>" + options.inverse(this) + "</p>";
+      }
+    };
+ 
+    var hash = {people: [{name: "Alan"}, {name: "Yehuda"}]};
+    var empty = {people: []};
+    var rootMessage = {
+      people: [],
+      message: "Nobody's here"
+    };
+ 
+    var messageString = "{{#list people}}Hello{{^}}{{message}}{{/list}}";
+ 
+    // the meaning here may be kind of hard to catch, but list.not is always called,
+    // so we should see the output of both
+    shouldCompileTo(string, [hash, { list: list }], "<ul><li>Alan</li><li>Yehuda</li></ul>", "an inverse wrapper is passed in as a new context");
+    shouldCompileTo(string, [empty, { list: list }], "<p><em>Nobody's here</em></p>", "an inverse wrapper can be optionally called");
+    shouldCompileTo(messageString, [rootMessage, { list: list }], "<p>Nobody&#x27;s here</p>", "the context of an inverse is the parent of the block");
+  });
+ 
+  it('pathed lambas with parameters', function() {
+    var hash = {
+      helper: function() {
+        return 'winning';
+      }
+    };
+    hash.hash = hash;
+    var helpers = {
+      './helper': function() {
+        return 'fail';
+      }
+    };
+    shouldCompileTo('{{./helper 1}}', [hash, helpers], 'winning');
+    shouldCompileTo('{{hash/helper 1}}', [hash, helpers], 'winning');
+  });
+ 
+  describe("helpers hash", function() {
+    it("providing a helpers hash", function() {
+      shouldCompileTo("Goodbye {{cruel}} {{world}}!", [{cruel: "cruel"}, {world: function() { return "world"; }}], "Goodbye cruel world!",
+                      "helpers hash is available");
+ 
+      shouldCompileTo("Goodbye {{#iter}}{{cruel}} {{world}}{{/iter}}!", [{iter: [{cruel: "cruel"}]}, {world: function() { return "world"; }}],
+                      "Goodbye cruel world!", "helpers hash is available inside other blocks");
+    });
+ 
+    it("in cases of conflict, helpers win", function() {
+      shouldCompileTo("{{{lookup}}}", [{lookup: 'Explicit'}, {lookup: function() { return 'helpers'; }}], "helpers",
+                      "helpers hash has precedence escaped expansion");
+      shouldCompileTo("{{lookup}}", [{lookup: 'Explicit'}, {lookup: function() { return 'helpers'; }}], "helpers",
+                      "helpers hash has precedence simple expansion");
+    });
+ 
+    it("the helpers hash is available is nested contexts", function() {
+      shouldCompileTo("{{#outer}}{{#inner}}{{helper}}{{/inner}}{{/outer}}",
+                    [{'outer': {'inner': {'unused':[]}}},  {'helper': function() { return 'helper'; }}], "helper",
+                    "helpers hash is available in nested contexts.");
+    });
+ 
+    it("the helper hash should augment the global hash", function() {
+      handlebarsEnv.registerHelper('test_helper', function() { return 'found it!'; });
+ 
+      shouldCompileTo(
+        "{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}", [
+          {cruel: "cruel"},
+          {world: function() { return "world!"; }}
+        ],
+        "found it! Goodbye cruel world!!");
+    });
+  });
+ 
+  it("Multiple global helper registration", function() {
+    var helpers = handlebarsEnv.helpers;
+    handlebarsEnv.helpers = {};
+ 
+    handlebarsEnv.registerHelper({
+      'if': helpers['if'],
+      world: function() { return "world!"; },
+      test_helper: function() { return 'found it!'; }
+    });
+ 
+    shouldCompileTo(
+      "{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}",
+      [{cruel: "cruel"}],
+      "found it! Goodbye cruel world!!");
+  });
+ 
+  it("decimal number literals work", function() {
+    var string   = 'Message: {{hello -1.2 1.2}}';
+    var hash     = {};
+    var helpers  = {hello: function(times, times2) {
+      if(typeof times !== 'number') { times = "NaN"; }
+      if(typeof times2 !== 'number') { times2 = "NaN"; }
+      return "Hello " + times + " " + times2 + " times";
+    }};
+    shouldCompileTo(string, [hash, helpers], "Message: Hello -1.2 1.2 times", "template with a negative integer literal");
+  });
+ 
+  it("negative number literals work", function() {
+    var string   = 'Message: {{hello -12}}';
+    var hash     = {};
+    var helpers  = {hello: function(times) {
+      if(typeof times !== 'number') { times = "NaN"; }
+      return "Hello " + times + " times";
+    }};
+    shouldCompileTo(string, [hash, helpers], "Message: Hello -12 times", "template with a negative integer literal");
+  });
+ 
+  describe("String literal parameters", function() {
+    it("simple literals work", function() {
+      var string   = 'Message: {{hello "world" 12 true false}}';
+      var hash     = {};
+      var helpers  = {hello: function(param, times, bool1, bool2) {
+        if(typeof times !== 'number') { times = "NaN"; }
+        if(typeof bool1 !== 'boolean') { bool1 = "NaB"; }
+        if(typeof bool2 !== 'boolean') { bool2 = "NaB"; }
+        return "Hello " + param + " " + times + " times: " + bool1 + " " + bool2;
+      }};
+      shouldCompileTo(string, [hash, helpers], "Message: Hello world 12 times: true false", "template with a simple String literal");
+    });
+ 
+    it("using a quote in the middle of a parameter raises an error", function() {
+      var string   = 'Message: {{hello wo"rld"}}';
+      shouldThrow(function() {
+        CompilerContext.compile(string);
+      }, Error);
+    });
+ 
+    it("escaping a String is possible", function(){
+      var string   = 'Message: {{{hello "\\"world\\""}}}';
+      var hash     = {};
+      var helpers = {hello: function(param) { return "Hello " + param; }};
+      shouldCompileTo(string, [hash, helpers], "Message: Hello \"world\"", "template with an escaped String literal");
+    });
+ 
+    it("it works with ' marks", function() {
+      var string   = 'Message: {{{hello "Alan\'s world"}}}';
+      var hash     = {};
+      var helpers = {hello: function(param) { return "Hello " + param; }};
+      shouldCompileTo(string, [hash, helpers], "Message: Hello Alan's world", "template with a ' mark");
+    });
+  });
+ 
+  it("negative number literals work", function() {
+    var string   = 'Message: {{hello -12}}';
+    var hash     = {};
+    var helpers  = {hello: function(times) {
+      if(typeof times !== 'number') { times = "NaN"; }
+      return "Hello " + times + " times";
+    }};
+    shouldCompileTo(string, [hash, helpers], "Message: Hello -12 times", "template with a negative integer literal");
+  });
+ 
+  describe("multiple parameters", function() {
+    it("simple multi-params work", function() {
+      var string   = 'Message: {{goodbye cruel world}}';
+      var hash     = {cruel: "cruel", world: "world"};
+      var helpers = {goodbye: function(cruel, world) { return "Goodbye " + cruel + " " + world; }};
+      shouldCompileTo(string, [hash, helpers], "Message: Goodbye cruel world", "regular helpers with multiple params");
+    });
+ 
+    it("block multi-params work", function() {
+      var string   = 'Message: {{#goodbye cruel world}}{{greeting}} {{adj}} {{noun}}{{/goodbye}}';
+      var hash     = {cruel: "cruel", world: "world"};
+      var helpers = {goodbye: function(cruel, world, options) {
+        return options.fn({greeting: "Goodbye", adj: cruel, noun: world});
+      }};
+      shouldCompileTo(string, [hash, helpers], "Message: Goodbye cruel world", "block helpers with multiple params");
+    });
+  });
+ 
+  describe('hash', function() {
+    it("helpers can take an optional hash", function() {
+      var template = CompilerContext.compile('{{goodbye cruel="CRUEL" world="WORLD" times=12}}');
+ 
+      var helpers = {
+        goodbye: function(options) {
+          return "GOODBYE " + options.hash.cruel + " " + options.hash.world + " " + options.hash.times + " TIMES";
+        }
+      };
+ 
+      var context = {};
+ 
+      var result = template(context, {helpers: helpers});
+      equals(result, "GOODBYE CRUEL WORLD 12 TIMES", "Helper output hash");
+    });
+ 
+    it("helpers can take an optional hash with booleans", function() {
+      var helpers = {
+        goodbye: function(options) {
+          if (options.hash.print === true) {
+            return "GOODBYE " + options.hash.cruel + " " + options.hash.world;
+          } else if (options.hash.print === false) {
+            return "NOT PRINTING";
+          } else {
+            return "THIS SHOULD NOT HAPPEN";
+          }
+        }
+      };
+ 
+      var context = {};
+ 
+      var template = CompilerContext.compile('{{goodbye cruel="CRUEL" world="WORLD" print=true}}');
+      var result = template(context, {helpers: helpers});
+      equals(result, "GOODBYE CRUEL WORLD", "Helper output hash");
+ 
+      template = CompilerContext.compile('{{goodbye cruel="CRUEL" world="WORLD" print=false}}');
+      result = template(context, {helpers: helpers});
+      equals(result, "NOT PRINTING", "Boolean helper parameter honored");
+    });
+ 
+    it("block helpers can take an optional hash", function() {
+      var template = CompilerContext.compile('{{#goodbye cruel="CRUEL" times=12}}world{{/goodbye}}');
+ 
+      var helpers = {
+        goodbye: function(options) {
+          return "GOODBYE " + options.hash.cruel + " " + options.fn(this) + " " + options.hash.times + " TIMES";
+        }
+      };
+ 
+      var result = template({}, {helpers: helpers});
+      equals(result, "GOODBYE CRUEL world 12 TIMES", "Hash parameters output");
+    });
+ 
+    it("block helpers can take an optional hash with single quoted stings", function() {
+      var template = CompilerContext.compile("{{#goodbye cruel='CRUEL' times=12}}world{{/goodbye}}");
+ 
+      var helpers = {
+        goodbye: function(options) {
+          return "GOODBYE " + options.hash.cruel + " " + options.fn(this) + " " + options.hash.times + " TIMES";
+        }
+      };
+ 
+      var result = template({}, {helpers: helpers});
+      equals(result, "GOODBYE CRUEL world 12 TIMES", "Hash parameters output");
+    });
+ 
+    it("block helpers can take an optional hash with booleans", function() {
+      var helpers = {
+        goodbye: function(options) {
+          if (options.hash.print === true) {
+            return "GOODBYE " + options.hash.cruel + " " + options.fn(this);
+          } else if (options.hash.print === false) {
+            return "NOT PRINTING";
+          } else {
+            return "THIS SHOULD NOT HAPPEN";
+          }
+        }
+      };
+ 
+      var template = CompilerContext.compile('{{#goodbye cruel="CRUEL" print=true}}world{{/goodbye}}');
+      var result = template({}, {helpers: helpers});
+      equals(result, "GOODBYE CRUEL world", "Boolean hash parameter honored");
+ 
+      template = CompilerContext.compile('{{#goodbye cruel="CRUEL" print=false}}world{{/goodbye}}');
+      result = template({}, {helpers: helpers});
+      equals(result, "NOT PRINTING", "Boolean hash parameter honored");
+    });
+  });
+ 
+  describe("helperMissing", function() {
+    it("if a context is not found, helperMissing is used", function() {
+      shouldThrow(function() {
+          var template = CompilerContext.compile("{{hello}} {{link_to world}}");
+          template({});
+      }, undefined, /Missing helper: 'link_to'/);
+    });
+ 
+    it("if a context is not found, custom helperMissing is used", function() {
+      var string = "{{hello}} {{link_to world}}";
+      var context = { hello: "Hello", world: "world" };
+ 
+      var helpers = {
+        helperMissing: function(mesg, options) {
+          if(options.name === "link_to") {
+            return new Handlebars.SafeString("<a>" + mesg + "</a>");
+          }
+        }
+      };
+ 
+      shouldCompileTo(string, [context, helpers], "Hello <a>world</a>");
+    });
+  });
+ 
+  describe("knownHelpers", function() {
+    it("Known helper should render helper", function() {
+      var template = CompilerContext.compile("{{hello}}", {knownHelpers: {"hello" : true}});
+ 
+      var result = template({}, {helpers: {hello: function() { return "foo"; }}});
+      equal(result, "foo", "'foo' should === '" + result);
+    });
+ 
+    it("Unknown helper in knownHelpers only mode should be passed as undefined", function() {
+      var template = CompilerContext.compile("{{typeof hello}}", {knownHelpers: {'typeof': true}, knownHelpersOnly: true});
+ 
+      var result = template({}, {helpers: {'typeof': function(arg) { return typeof arg; }, hello: function() { return "foo"; }}});
+      equal(result, "undefined", "'undefined' should === '" + result);
+    });
+    it("Builtin helpers available in knownHelpers only mode", function() {
+      var template = CompilerContext.compile("{{#unless foo}}bar{{/unless}}", {knownHelpersOnly: true});
+ 
+      var result = template({});
+      equal(result, "bar", "'bar' should === '" + result);
+    });
+    it("Field lookup works in knownHelpers only mode", function() {
+      var template = CompilerContext.compile("{{foo}}", {knownHelpersOnly: true});
+ 
+      var result = template({foo: 'bar'});
+      equal(result, "bar", "'bar' should === '" + result);
+    });
+    it("Conditional blocks work in knownHelpers only mode", function() {
+      var template = CompilerContext.compile("{{#foo}}bar{{/foo}}", {knownHelpersOnly: true});
+ 
+      var result = template({foo: 'baz'});
+      equal(result, "bar", "'bar' should === '" + result);
+    });
+    it("Invert blocks work in knownHelpers only mode", function() {
+      var template = CompilerContext.compile("{{^foo}}bar{{/foo}}", {knownHelpersOnly: true});
+ 
+      var result = template({foo: false});
+      equal(result, "bar", "'bar' should === '" + result);
+    });
+    it("Functions are bound to the context in knownHelpers only mode", function() {
+      var template = CompilerContext.compile("{{foo}}", {knownHelpersOnly: true});
+      var result = template({foo: function() { return this.bar; }, bar: 'bar'});
+      equal(result, "bar", "'bar' should === '" + result);
+    });
+    it("Unknown helper call in knownHelpers only mode should throw", function() {
+      shouldThrow(function() {
+        CompilerContext.compile("{{typeof hello}}", {knownHelpersOnly: true});
+      }, Error);
+    });
+  });
+ 
+  describe("blockHelperMissing", function() {
+    it("lambdas are resolved by blockHelperMissing, not handlebars proper", function() {
+      var string = "{{#truthy}}yep{{/truthy}}";
+      var data = { truthy: function() { return true; } };
+      shouldCompileTo(string, data, "yep");
+    });
+    it("lambdas resolved by blockHelperMissing are bound to the context", function() {
+      var string = "{{#truthy}}yep{{/truthy}}";
+      var boundData = { truthy: function() { return this.truthiness(); }, truthiness: function() { return false; } };
+      shouldCompileTo(string, boundData, "");
+    });
+  });
+ 
+  describe('name field', function() {
+    var context = {};
+    var helpers = {
+      blockHelperMissing: function() {
+        return 'missing: ' + arguments[arguments.length-1].name;
+      },
+      helperMissing: function() {
+        return 'helper missing: ' + arguments[arguments.length-1].name;
+      },
+      helper: function() {
+        return 'ran: ' + arguments[arguments.length-1].name;
+      }
+    };
+ 
+    it('should include in ambiguous mustache calls', function() {
+      shouldCompileTo('{{helper}}', [context, helpers], 'ran: helper');
+    });
+    it('should include in helper mustache calls', function() {
+      shouldCompileTo('{{helper 1}}', [context, helpers], 'ran: helper');
+    });
+    it('should include in ambiguous block calls', function() {
+      shouldCompileTo('{{#helper}}{{/helper}}', [context, helpers], 'ran: helper');
+    });
+    it('should include in simple block calls', function() {
+      shouldCompileTo('{{#./helper}}{{/./helper}}', [context, helpers], 'missing: ./helper');
+    });
+    it('should include in helper block calls', function() {
+      shouldCompileTo('{{#helper 1}}{{/helper}}', [context, helpers], 'ran: helper');
+    });
+    it('should include in known helper calls', function() {
+      var template = CompilerContext.compile("{{helper}}", {knownHelpers: {'helper': true}, knownHelpersOnly: true});
+ 
+      equal(template({}, {helpers: helpers}), 'ran: helper');
+    });
+ 
+    it('should include full id', function() {
+      shouldCompileTo('{{#foo.helper}}{{/foo.helper}}', [{foo: {}}, helpers], 'missing: foo.helper');
+    });
+ 
+    it('should include full id if a hash is passed', function() {
+      shouldCompileTo('{{#foo.helper bar=baz}}{{/foo.helper}}', [{foo: {}}, helpers], 'helper missing: foo.helper');
+    });
+  });
+ 
+  describe('name conflicts', function() {
+    it("helpers take precedence over same-named context properties", function() {
+      var template = CompilerContext.compile("{{goodbye}} {{cruel world}}");
+ 
+      var helpers = {
+        goodbye: function() {
+          return this.goodbye.toUpperCase();
+        },
+ 
+        cruel: function(world) {
+          return "cruel " + world.toUpperCase();
+        }
+      };
+ 
+      var context = {
+        goodbye: "goodbye",
+        world: "world"
+      };
+ 
+      var result = template(context, {helpers: helpers});
+      equals(result, "GOODBYE cruel WORLD", "Helper executed");
+    });
+ 
+    it("helpers take precedence over same-named context properties$", function() {
+      var template = CompilerContext.compile("{{#goodbye}} {{cruel world}}{{/goodbye}}");
+ 
+      var helpers = {
+        goodbye: function(options) {
+          return this.goodbye.toUpperCase() + options.fn(this);
+        },
+ 
+        cruel: function(world) {
+          return "cruel " + world.toUpperCase();
+        }
+      };
+ 
+      var context = {
+        goodbye: "goodbye",
+        world: "world"
+      };
+ 
+      var result = template(context, {helpers: helpers});
+      equals(result, "GOODBYE cruel WORLD", "Helper executed");
+    });
+ 
+    it("Scoped names take precedence over helpers", function() {
+      var template = CompilerContext.compile("{{this.goodbye}} {{cruel world}} {{cruel this.goodbye}}");
+ 
+      var helpers = {
+        goodbye: function() {
+          return this.goodbye.toUpperCase();
+        },
+ 
+        cruel: function(world) {
+          return "cruel " + world.toUpperCase();
+        }
+      };
+ 
+      var context = {
+        goodbye: "goodbye",
+        world: "world"
+      };
+ 
+      var result = template(context, {helpers: helpers});
+      equals(result, "goodbye cruel WORLD cruel GOODBYE", "Helper not executed");
+    });
+ 
+    it("Scoped names take precedence over block helpers", function() {
+      var template = CompilerContext.compile("{{#goodbye}} {{cruel world}}{{/goodbye}} {{this.goodbye}}");
+ 
+      var helpers = {
+        goodbye: function(options) {
+          return this.goodbye.toUpperCase() + options.fn(this);
+        },
+ 
+        cruel: function(world) {
+          return "cruel " + world.toUpperCase();
+        }
+      };
+ 
+      var context = {
+        goodbye: "goodbye",
+        world: "world"
+      };
+ 
+      var result = template(context, {helpers: helpers});
+      equals(result, "GOODBYE cruel WORLD goodbye", "Helper executed");
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/index.html b/node_modules/handlebars/coverage/lcov-report/spec/index.html new file mode 100644 index 0000000..50ab2c2 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/index.html @@ -0,0 +1,597 @@ + + + + Code coverage report for spec/ + + + + + + + +
+

Code coverage report for spec/

+

+ + Statements: 24.27% (497 / 2048)      + + + Branches: 28.41% (25 / 88)      + + + Functions: 11.96% (77 / 644)      + + + Lines: 24.69% (497 / 2013)      + + Ignored: none      +

+
All files » spec/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ast.js28.99%(69 / 238)100%(2 / 2)30.88%(21 / 68)28.99%(69 / 238)
basic.js29.31%(34 / 116)100%(0 / 0)2.13%(1 / 47)30.09%(34 / 113)
blocks.js29.69%(19 / 64)100%(0 / 0)20%(4 / 20)29.69%(19 / 64)
builtins.js20%(27 / 135)0%(0 / 4)13.89%(5 / 36)20.93%(27 / 129)
data.js17.6%(22 / 125)0%(0 / 12)6.98%(3 / 43)17.6%(22 / 125)
helpers.js19.23%(70 / 364)0%(0 / 26)7.81%(10 / 128)20.71%(70 / 338)
javascript-compiler.js41.3%(19 / 46)50%(2 / 4)21.05%(4 / 19)41.3%(19 / 46)
parser.js37.5%(39 / 104)100%(2 / 2)4.44%(2 / 45)37.5%(39 / 104)
partials.js21.74%(25 / 115)100%(0 / 0)10.71%(3 / 28)21.74%(25 / 115)
precompiler.js42.86%(9 / 21)50%(1 / 2)11.11%(1 / 9)42.86%(9 / 21)
regressions.js27.94%(19 / 68)100%(2 / 2)4%(1 / 25)27.94%(19 / 68)
require.js28.57%(4 / 14)75%(3 / 4)33.33%(1 / 3)28.57%(4 / 14)
runtime.js100%(3 / 3)100%(0 / 0)100%(2 / 2)100%(3 / 3)
spec.js76.19%(16 / 21)73.33%(11 / 15)83.33%(5 / 6)76.19%(16 / 21)
string-params.js11.9%(10 / 84)100%(0 / 0)4.35%(1 / 23)11.9%(10 / 84)
subexpressions.js13.33%(14 / 105)0%(0 / 4)2.56%(1 / 39)13.33%(14 / 105)
tokenizer.js20.91%(55 / 263)22.22%(2 / 9)1.89%(1 / 53)20.91%(55 / 263)
track-ids.js27.38%(23 / 84)100%(0 / 0)16.67%(5 / 30)27.38%(23 / 84)
utils.js32.43%(12 / 37)0%(0 / 2)33.33%(4 / 12)32.43%(12 / 37)
whitespace-control.js19.51%(8 / 41)100%(0 / 0)25%(2 / 8)19.51%(8 / 41)
+
+
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/javascript-compiler.js.html b/node_modules/handlebars/coverage/lcov-report/spec/javascript-compiler.js.html new file mode 100644 index 0000000..b6164b3 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/javascript-compiler.js.html @@ -0,0 +1,535 @@ + + + + Code coverage report for spec/javascript-compiler.js + + + + + + + +
+

Code coverage report for spec/javascript-compiler.js

+

+ + Statements: 41.3% (19 / 46)      + + + Branches: 50% (2 / 4)      + + + Functions: 21.05% (4 / 19)      + + + Lines: 41.3% (19 / 46)      + + Ignored: none      +

+
All files » spec/ » javascript-compiler.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72  +3 +3 +1 +  +  +2 +2 +2 +  +  +2 +  +  +  +2 +  +  +  +  +  +  +2 +2 +2 +  +  +  +2 +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +2 +2 +2 +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +  + 
/*global Handlebars, beforeEach, handlebarsEnv, shouldCompileTo */
+describe('javascript-compiler api', function() {
+  if (!Handlebars.JavaScriptCompiler) {
+    return;
+  }
+ 
+  describe('#nameLookup', function() {
+    var $superName;
+    beforeEach(function() {
+      $superName = handlebarsEnv.JavaScriptCompiler.prototype.nameLookup;
+    });
+    afterEach(function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.nameLookup = $superName;
+    });
+ 
+    it('should allow override', function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.nameLookup = function(parent, name) {
+        return parent + '.bar_' + name;
+      };
+      shouldCompileTo("{{foo}}", { bar_foo: "food" }, "food");
+    });
+  });
+  describe('#compilerInfo', function() {
+    var $superCheck, $superInfo;
+    beforeEach(function() {
+      $superCheck = handlebarsEnv.VM.checkRevision;
+      $superInfo = handlebarsEnv.JavaScriptCompiler.prototype.compilerInfo;
+    });
+    afterEach(function() {
+      handlebarsEnv.VM.checkRevision = $superCheck;
+      handlebarsEnv.JavaScriptCompiler.prototype.compilerInfo = $superInfo;
+    });
+    it('should allow compilerInfo override', function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.compilerInfo = function() {
+        return 'crazy';
+      };
+      handlebarsEnv.VM.checkRevision = function(compilerInfo) {
+        if (compilerInfo !== 'crazy') {
+          throw new Error('It didn\'t work');
+        }
+      };
+      shouldCompileTo("{{foo}} ", { foo: "food" }, "food ");
+    });
+  });
+  describe('buffer', function() {
+    var $superAppend, $superCreate;
+    beforeEach(function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.forceBuffer = true;
+      $superAppend = handlebarsEnv.JavaScriptCompiler.prototype.appendToBuffer;
+      $superCreate = handlebarsEnv.JavaScriptCompiler.prototype.initializeBuffer;
+    });
+    afterEach(function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.forceBuffer = false;
+      handlebarsEnv.JavaScriptCompiler.prototype.appendToBuffer = $superAppend;
+      handlebarsEnv.JavaScriptCompiler.prototype.initializeBuffer = $superCreate;
+    });
+ 
+    it('should allow init buffer override', function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.initializeBuffer = function() {
+        return this.quotedString('foo_');
+      };
+      shouldCompileTo("{{foo}} ", { foo: "food" }, "foo_food ");
+    });
+    it('should allow append buffer override', function() {
+      handlebarsEnv.JavaScriptCompiler.prototype.appendToBuffer = function(string) {
+        return $superAppend.call(this, string + ' + "_foo"');
+      };
+      shouldCompileTo("{{foo}}", { foo: "food" }, "food_foo");
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/parser.js.html b/node_modules/handlebars/coverage/lcov-report/spec/parser.js.html new file mode 100644 index 0000000..7b2d6b5 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/parser.js.html @@ -0,0 +1,892 @@ + + + + Code coverage report for spec/parser.js + + + + + + + +
+

Code coverage report for spec/parser.js

+

+ + Statements: 37.5% (39 / 104)      + + + Branches: 100% (2 / 2)      + + + Functions: 4.44% (2 / 45)      + + + Lines: 37.5% (39 / 104)      + + Ignored: none      +

+
All files » spec/ » parser.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191  +3 +3 +2 +  +  +1 +  +  +  +  +1 +  +  +  +  +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +  +1 +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1 +  +  +  +  +  +  +  +  +1 +  +  +  +  +  +1 +1 +  +  +  +  + 
/*global Handlebars */
+describe('parser', function() {
+  if (!Handlebars.print) {
+    return;
+  }
+ 
+  function ast_for(template) {
+    var ast = Handlebars.parse(template);
+    return Handlebars.print(ast);
+  }
+ 
+  it('parses simple mustaches', function() {
+    equals(ast_for('{{foo}}'), "{{ ID:foo [] }}\n");
+    equals(ast_for('{{foo?}}'), "{{ ID:foo? [] }}\n");
+    equals(ast_for('{{foo_}}'), "{{ ID:foo_ [] }}\n");
+    equals(ast_for('{{foo-}}'), "{{ ID:foo- [] }}\n");
+    equals(ast_for('{{foo:}}'), "{{ ID:foo: [] }}\n");
+  });
+ 
+  it('parses simple mustaches with data', function() {
+    equals(ast_for("{{@foo}}"), "{{ @ID:foo [] }}\n");
+  });
+ 
+  it('parses simple mustaches with data paths', function() {
+    equals(ast_for("{{@../foo}}"), "{{ @ID:foo [] }}\n");
+  });
+ 
+  it('parses mustaches with paths', function() {
+    equals(ast_for("{{foo/bar}}"), "{{ PATH:foo/bar [] }}\n");
+  });
+ 
+  it('parses mustaches with this/foo', function() {
+    equals(ast_for("{{this/foo}}"), "{{ ID:foo [] }}\n");
+  });
+ 
+  it('parses mustaches with - in a path', function() {
+    equals(ast_for("{{foo-bar}}"), "{{ ID:foo-bar [] }}\n");
+  });
+ 
+  it('parses mustaches with parameters', function() {
+    equals(ast_for("{{foo bar}}"), "{{ ID:foo [ID:bar] }}\n");
+  });
+ 
+  it('parses mustaches with string parameters', function() {
+    equals(ast_for("{{foo bar \"baz\" }}"), '{{ ID:foo [ID:bar, "baz"] }}\n');
+  });
+ 
+  it('parses mustaches with NUMBER parameters', function() {
+    equals(ast_for("{{foo 1}}"), "{{ ID:foo [NUMBER{1}] }}\n");
+  });
+ 
+  it('parses mustaches with BOOLEAN parameters', function() {
+    equals(ast_for("{{foo true}}"), "{{ ID:foo [BOOLEAN{true}] }}\n");
+    equals(ast_for("{{foo false}}"), "{{ ID:foo [BOOLEAN{false}] }}\n");
+  });
+ 
+  it('parses mutaches with DATA parameters', function() {
+    equals(ast_for("{{foo @bar}}"), "{{ ID:foo [@ID:bar] }}\n");
+  });
+ 
+  it('parses mustaches with hash arguments', function() {
+    equals(ast_for("{{foo bar=baz}}"), "{{ ID:foo [] HASH{bar=ID:baz} }}\n");
+    equals(ast_for("{{foo bar=1}}"), "{{ ID:foo [] HASH{bar=NUMBER{1}} }}\n");
+    equals(ast_for("{{foo bar=true}}"), "{{ ID:foo [] HASH{bar=BOOLEAN{true}} }}\n");
+    equals(ast_for("{{foo bar=false}}"), "{{ ID:foo [] HASH{bar=BOOLEAN{false}} }}\n");
+    equals(ast_for("{{foo bar=@baz}}"), "{{ ID:foo [] HASH{bar=@ID:baz} }}\n");
+ 
+    equals(ast_for("{{foo bar=baz bat=bam}}"), "{{ ID:foo [] HASH{bar=ID:baz, bat=ID:bam} }}\n");
+    equals(ast_for("{{foo bar=baz bat=\"bam\"}}"), '{{ ID:foo [] HASH{bar=ID:baz, bat="bam"} }}\n');
+ 
+    equals(ast_for("{{foo bat='bam'}}"), '{{ ID:foo [] HASH{bat="bam"} }}\n');
+ 
+    equals(ast_for("{{foo omg bar=baz bat=\"bam\"}}"), '{{ ID:foo [ID:omg] HASH{bar=ID:baz, bat="bam"} }}\n');
+    equals(ast_for("{{foo omg bar=baz bat=\"bam\" baz=1}}"), '{{ ID:foo [ID:omg] HASH{bar=ID:baz, bat="bam", baz=NUMBER{1}} }}\n');
+    equals(ast_for("{{foo omg bar=baz bat=\"bam\" baz=true}}"), '{{ ID:foo [ID:omg] HASH{bar=ID:baz, bat="bam", baz=BOOLEAN{true}} }}\n');
+    equals(ast_for("{{foo omg bar=baz bat=\"bam\" baz=false}}"), '{{ ID:foo [ID:omg] HASH{bar=ID:baz, bat="bam", baz=BOOLEAN{false}} }}\n');
+  });
+ 
+  it('parses contents followed by a mustache', function() {
+    equals(ast_for("foo bar {{baz}}"), "CONTENT[ \'foo bar \' ]\n{{ ID:baz [] }}\n");
+  });
+ 
+  it('parses a partial', function() {
+    equals(ast_for("{{> foo }}"), "{{> PARTIAL:foo }}\n");
+  });
+ 
+  it('parses a partial with context', function() {
+    equals(ast_for("{{> foo bar}}"), "{{> PARTIAL:foo ID:bar }}\n");
+  });
+ 
+  it('parses a partial with hash', function() {
+    equals(ast_for("{{> foo bar=bat}}"), "{{> PARTIAL:foo HASH{bar=ID:bat} }}\n");
+  });
+ 
+  it('parses a partial with context and hash', function() {
+    equals(ast_for("{{> foo bar bat=baz}}"), "{{> PARTIAL:foo ID:bar HASH{bat=ID:baz} }}\n");
+  });
+ 
+  it('parses a partial with a complex name', function() {
+    equals(ast_for("{{> shared/partial?.bar}}"), "{{> PARTIAL:shared/partial?.bar }}\n");
+  });
+ 
+  it('parses a comment', function() {
+    equals(ast_for("{{! this is a comment }}"), "{{! ' this is a comment ' }}\n");
+  });
+ 
+  it('parses a multi-line comment', function() {
+    equals(ast_for("{{!\nthis is a multi-line comment\n}}"), "{{! \'\nthis is a multi-line comment\n\' }}\n");
+  });
+ 
+  it('parses an inverse section', function() {
+    equals(ast_for("{{#foo}} bar {{^}} baz {{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n    CONTENT[ ' bar ' ]\n  {{^}}\n    CONTENT[ ' baz ' ]\n");
+  });
+ 
+  it('parses an inverse (else-style) section', function() {
+    equals(ast_for("{{#foo}} bar {{else}} baz {{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n    CONTENT[ ' bar ' ]\n  {{^}}\n    CONTENT[ ' baz ' ]\n");
+  });
+ 
+  it('parses empty blocks', function() {
+    equals(ast_for("{{#foo}}{{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n");
+  });
+ 
+  it('parses empty blocks with empty inverse section', function() {
+    equals(ast_for("{{#foo}}{{^}}{{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n");
+  });
+ 
+  it('parses empty blocks with empty inverse (else-style) section', function() {
+    equals(ast_for("{{#foo}}{{else}}{{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n");
+  });
+ 
+  it('parses non-empty blocks with empty inverse section', function() {
+    equals(ast_for("{{#foo}} bar {{^}}{{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n    CONTENT[ ' bar ' ]\n  {{^}}\n");
+  });
+ 
+  it('parses non-empty blocks with empty inverse (else-style) section', function() {
+    equals(ast_for("{{#foo}} bar {{else}}{{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n    CONTENT[ ' bar ' ]\n  {{^}}\n");
+  });
+ 
+  it('parses empty blocks with non-empty inverse section', function() {
+    equals(ast_for("{{#foo}}{{^}} bar {{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n  {{^}}\n    CONTENT[ ' bar ' ]\n");
+  });
+ 
+  it('parses empty blocks with non-empty inverse (else-style) section', function() {
+    equals(ast_for("{{#foo}}{{else}} bar {{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  PROGRAM:\n  {{^}}\n    CONTENT[ ' bar ' ]\n");
+  });
+ 
+  it('parses a standalone inverse section', function() {
+    equals(ast_for("{{^foo}}bar{{/foo}}"), "BLOCK:\n  {{ ID:foo [] }}\n  {{^}}\n    CONTENT[ 'bar' ]\n");
+  });
+ 
+  it("raises if there's a Parse error", function() {
+    shouldThrow(function() {
+      ast_for("foo{{^}}bar");
+    }, Error, /Parse error on line 1/);
+    shouldThrow(function() {
+      ast_for("{{foo}");
+    }, Error, /Parse error on line 1/);
+    shouldThrow(function() {
+      ast_for("{{foo &}}");
+    }, Error, /Parse error on line 1/);
+    shouldThrow(function() {
+      ast_for("{{#goodbyes}}{{/hellos}}");
+    }, Error, /goodbyes doesn't match hellos/);
+ 
+    shouldThrow(function() {
+      ast_for("{{{{goodbyes}}}} {{{{/hellos}}}}");
+    }, Error, /goodbyes doesn't match hellos/);
+  });
+ 
+  it('knows how to report the correct line number in errors', function() {
+    shouldThrow(function() {
+      ast_for("hello\nmy\n{{foo}");
+    }, Error, /Parse error on line 3/);
+    shouldThrow(function() {
+      ast_for("hello\n\nmy\n\n{{foo}");
+    }, Error, /Parse error on line 5/);
+  });
+ 
+  it('knows how to report the correct line number in errors when the first character is a newline', function() {
+    shouldThrow(function() {
+      ast_for("\n\nhello\n\nmy\n\n{{foo}");
+    }, Error, /Parse error on line 7/);
+  });
+ 
+  describe('externally compiled AST', function() {
+    it('can pass through an already-compiled AST', function() {
+      equals(ast_for(new Handlebars.AST.ProgramNode(false, [ new Handlebars.AST.ContentNode("Hello")])), "CONTENT[ \'Hello\' ]\n");
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/partials.js.html b/node_modules/handlebars/coverage/lcov-report/spec/partials.js.html new file mode 100644 index 0000000..3467042 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/partials.js.html @@ -0,0 +1,841 @@ + + + + Code coverage report for spec/partials.js + + + + + + + +
+

Code coverage report for spec/partials.js

+

+ + Statements: 21.74% (25 / 115)      + + + Branches: 100% (0 / 0)      + + + Functions: 10.71% (3 / 28)      + + + Lines: 21.74% (25 / 115)      + + Ignored: none      +

+
All files » spec/ » partials.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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  +3 +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +3 +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +3 +  +  +  +  +  +  +  + 
/*global CompilerContext, Handlebars, handlebarsEnv, shouldCompileTo, shouldCompileToWithPartials, shouldThrow */
+describe('partials', function() {
+  it("basic partials", function() {
+    var string = "Dudes: {{#dudes}}{{> dude}}{{/dudes}}";
+    var partial = "{{name}} ({{url}}) ";
+    var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+    shouldCompileToWithPartials(string, [hash, {}, {dude: partial}], true, "Dudes: Yehuda (http://yehuda) Alan (http://alan) ",
+                    "Basic partials output based on current context.");
+  });
+ 
+  it("partials with context", function() {
+    var string = "Dudes: {{>dude dudes}}";
+    var partial = "{{#this}}{{name}} ({{url}}) {{/this}}";
+    var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+    shouldCompileToWithPartials(string, [hash, {}, {dude: partial}], true, "Dudes: Yehuda (http://yehuda) Alan (http://alan) ",
+                    "Partials can be passed a context");
+  });
+ 
+  it("partials with undefined context", function() {
+    var string = "Dudes: {{>dude dudes}}";
+    var partial = "{{foo}} Empty";
+    var hash = {};
+    shouldCompileToWithPartials(string, [hash, {}, {dude: partial}], true, "Dudes:  Empty");
+  });
+ 
+  it("partials with parameters", function() {
+    var string = "Dudes: {{#dudes}}{{> dude others=..}}{{/dudes}}";
+    var partial = "{{others.foo}}{{name}} ({{url}}) ";
+    var hash = {foo: 'bar', dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+    shouldCompileToWithPartials(string, [hash, {}, {dude: partial}], true, "Dudes: barYehuda (http://yehuda) barAlan (http://alan) ",
+                    "Basic partials output based on current context.");
+  });
+ 
+  it("partial in a partial", function() {
+    var string = "Dudes: {{#dudes}}{{>dude}}{{/dudes}}";
+    var dude = "{{name}} {{> url}} ";
+    var url = "<a href='{{url}}'>{{url}}</a>";
+    var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+    shouldCompileToWithPartials(string, [hash, {}, {dude: dude, url: url}], true, "Dudes: Yehuda <a href='http://yehuda'>http://yehuda</a> Alan <a href='http://alan'>http://alan</a> ", "Partials are rendered inside of other partials");
+  });
+ 
+  it("rendering undefined partial throws an exception", function() {
+    shouldThrow(function() {
+        var template = CompilerContext.compile("{{> whatever}}");
+        template();
+    }, Handlebars.Exception, 'The partial whatever could not be found');
+  });
+ 
+  it("rendering template partial in vm mode throws an exception", function() {
+    shouldThrow(function() {
+      var template = CompilerContext.compile("{{> whatever}}");
+      template();
+    }, Handlebars.Exception, 'The partial whatever could not be found');
+  });
+ 
+  it("rendering function partial in vm mode", function() {
+    var string = "Dudes: {{#dudes}}{{> dude}}{{/dudes}}";
+    var partial = function(context) {
+      return context.name + ' (' + context.url + ') ';
+    };
+    var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+    shouldCompileTo(string, [hash, {}, {dude: partial}], "Dudes: Yehuda (http://yehuda) Alan (http://alan) ",
+                    "Function partials output based in VM.");
+  });
+ 
+  it("GH-14: a partial preceding a selector", function() {
+     var string = "Dudes: {{>dude}} {{another_dude}}";
+     var dude = "{{name}}";
+     var hash = {name:"Jeepers", another_dude:"Creepers"};
+     shouldCompileToWithPartials(string, [hash, {}, {dude:dude}], true, "Dudes: Jeepers Creepers", "Regular selectors can follow a partial");
+  });
+ 
+  it("Partials with slash paths", function() {
+    var string = "Dudes: {{> shared/dude}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {'shared/dude':dude}], true, "Dudes: Jeepers", "Partials can use literal paths");
+  });
+ 
+  it("Partials with slash and point paths", function() {
+    var string = "Dudes: {{> shared/dude.thing}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {'shared/dude.thing':dude}], true, "Dudes: Jeepers", "Partials can use literal with points in paths");
+  });
+ 
+  it("Global Partials", function() {
+    handlebarsEnv.registerPartial('global_test', '{{another_dude}}');
+ 
+    var string = "Dudes: {{> shared/dude}} {{> global_test}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {'shared/dude':dude}], true, "Dudes: Jeepers Creepers", "Partials can use globals or passed");
+  });
+ 
+  it("Multiple partial registration", function() {
+    handlebarsEnv.registerPartial({
+      'shared/dude': '{{name}}',
+      global_test: '{{another_dude}}'
+    });
+ 
+    var string = "Dudes: {{> shared/dude}} {{> global_test}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash], true, "Dudes: Jeepers Creepers", "Partials can use globals or passed");
+  });
+ 
+  it("Partials with integer path", function() {
+    var string = "Dudes: {{> 404}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {404:dude}], true, "Dudes: Jeepers", "Partials can use literal paths");
+  });
+ 
+  it("Partials with complex path", function() {
+    var string = "Dudes: {{> 404/asdf?.bar}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {'404/asdf?.bar':dude}], true, "Dudes: Jeepers", "Partials can use literal paths");
+  });
+ 
+  it("Partials with escaped", function() {
+    var string = "Dudes: {{> [+404/asdf?.bar]}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {'+404/asdf?.bar':dude}], true, "Dudes: Jeepers", "Partials can use literal paths");
+  });
+ 
+  it("Partials with string", function() {
+    var string = "Dudes: {{> \"+404/asdf?.bar\"}}";
+    var dude = "{{name}}";
+    var hash = {name:"Jeepers", another_dude:"Creepers"};
+    shouldCompileToWithPartials(string, [hash, {}, {'+404/asdf?.bar':dude}], true, "Dudes: Jeepers", "Partials can use literal paths");
+  });
+ 
+  it('should handle empty partial', function() {
+    var string = "Dudes: {{#dudes}}{{> dude}}{{/dudes}}";
+    var partial = "";
+    var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+    shouldCompileToWithPartials(string, [hash, {}, {dude: partial}], true, "Dudes: ");  });
+ 
+  describe('standalone partials', function() {
+    it("indented partials", function() {
+      var string = "Dudes:\n{{#dudes}}\n  {{>dude}}\n{{/dudes}}";
+      var dude = "{{name}}\n";
+      var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+      shouldCompileToWithPartials(string, [hash, {}, {dude: dude}], true,
+            "Dudes:\n  Yehuda\n  Alan\n");
+    });
+    it("nested indented partials", function() {
+      var string = "Dudes:\n{{#dudes}}\n  {{>dude}}\n{{/dudes}}";
+      var dude = "{{name}}\n {{> url}}";
+      var url = "{{url}}!\n";
+      var hash = {dudes: [{name: "Yehuda", url: "http://yehuda"}, {name: "Alan", url: "http://alan"}]};
+      shouldCompileToWithPartials(string, [hash, {}, {dude: dude, url: url}], true,
+            "Dudes:\n  Yehuda\n   http://yehuda!\n  Alan\n   http://alan!\n");
+    });
+  });
+ 
+  describe('compat mode', function() {
+    it('basic partials', function() {
+      var string = 'Dudes: {{#dudes}}{{> dude}}{{/dudes}}';
+      var partial = '{{name}} ({{url}}) {{root}} ';
+      var hash = {root: 'yes', dudes: [{name: 'Yehuda', url: 'http://yehuda'}, {name: 'Alan', url: 'http://alan'}]};
+      shouldCompileToWithPartials(string, [hash, {}, {dude: partial}, true], true, 'Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes ');
+    });
+    it('partials inherit compat', function() {
+      var string = 'Dudes: {{> dude}}';
+      var partial = '{{#dudes}}{{name}} ({{url}}) {{root}} {{/dudes}}';
+      var hash = {root: 'yes', dudes: [{name: 'Yehuda', url: 'http://yehuda'}, {name: 'Alan', url: 'http://alan'}]};
+      shouldCompileToWithPartials(string, [hash, {}, {dude: partial}, true], true, 'Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes ');
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/precompiler.js.html b/node_modules/handlebars/coverage/lcov-report/spec/precompiler.js.html new file mode 100644 index 0000000..e8e9623 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/precompiler.js.html @@ -0,0 +1,442 @@ + + + + Code coverage report for spec/precompiler.js + + + + + + + +
+

Code coverage report for spec/precompiler.js

+

+ + Statements: 42.86% (9 / 21)      + + + Branches: 50% (1 / 2)      + + + Functions: 11.11% (1 / 9)      + + + Lines: 42.86% (9 / 21)      + + Ignored: none      +

+
All files » spec/ » precompiler.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41  +  +3 +  +3 +  +  +  +3 +  +  +3 +  +  +3 +  +  +  +  +  +  +3 +  +  +  +3 +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  + 
/*global shouldThrow */
+ 
+describe('precompiler', function() {
+  // NOP Under non-node environments
+  Iif (typeof process === 'undefined') {
+    return;
+  }
+ 
+  var Handlebars = require('../lib'),
+      Precompiler = require('../lib/precompiler');
+ 
+  var log,
+      logFunction;
+ 
+  beforeEach(function() {
+    logFunction = console.log;
+    log = '';
+    console.log = function() {
+      log += Array.prototype.join.call(arguments, '');
+    };
+  });
+  afterEach(function() {
+    console.log = logFunction;
+  });
+ 
+  it('should output version', function() {
+    Precompiler.cli({templates: [], version: true});
+    equals(log, Handlebars.VERSION);
+  });
+  it('should throw if lacking templates', function() {
+    shouldThrow(function() {
+      Precompiler.cli({templates: []});
+    }, Handlebars.Exception, 'Must define at least one template or directory.');
+  });
+  it('should throw on missing template', function() {
+    shouldThrow(function() {
+      Precompiler.cli({templates: ['foo']});
+    }, Handlebars.Exception, 'Unable to open template file "foo"');
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/regressions.js.html b/node_modules/handlebars/coverage/lcov-report/spec/regressions.js.html new file mode 100644 index 0000000..c09402c --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/regressions.js.html @@ -0,0 +1,790 @@ + + + + Code coverage report for spec/regressions.js + + + + + + + +
+

Code coverage report for spec/regressions.js

+

+ + Statements: 27.94% (19 / 68)      + + + Branches: 100% (2 / 2)      + + + Functions: 4% (1 / 25)      + + + Lines: 27.94% (19 / 68)      + + Ignored: none      +

+
All files » spec/ » regressions.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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  +3 +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +3 +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +3 +  +  +  +3 +2 +  +  +  +2 +  +  +  +  + 
/*global CompilerContext, Handlebars, shouldCompileTo, shouldThrow */
+describe('Regressions', function() {
+  it("GH-94: Cannot read property of undefined", function() {
+    var data = {"books":[{"title":"The origin of species","author":{"name":"Charles Darwin"}},{"title":"Lazarillo de Tormes"}]};
+    var string = "{{#books}}{{title}}{{author.name}}{{/books}}";
+    shouldCompileTo(string, data, "The origin of speciesCharles DarwinLazarillo de Tormes",
+                    "Renders without an undefined property error");
+  });
+ 
+  it("GH-150: Inverted sections print when they shouldn't", function() {
+    var string = "{{^set}}not set{{/set}} :: {{#set}}set{{/set}}";
+ 
+    shouldCompileTo(string, {}, "not set :: ", "inverted sections run when property isn't present in context");
+    shouldCompileTo(string, {set: undefined}, "not set :: ", "inverted sections run when property is undefined");
+    shouldCompileTo(string, {set: false}, "not set :: ", "inverted sections run when property is false");
+    shouldCompileTo(string, {set: true}, " :: set", "inverted sections don't run when property is true");
+  });
+ 
+  it("GH-158: Using array index twice, breaks the template", function() {
+    var string = "{{arr.[0]}}, {{arr.[1]}}";
+    var data = { "arr": [1,2] };
+ 
+    shouldCompileTo(string, data, "1, 2", "it works as expected");
+  });
+ 
+  it("bug reported by @fat where lambdas weren't being properly resolved", function() {
+    var string = '<strong>This is a slightly more complicated {{thing}}.</strong>.\n'
+        + '{{! Just ignore this business. }}\n'
+        + 'Check this out:\n'
+        + '{{#hasThings}}\n'
+        + '<ul>\n'
+        + '{{#things}}\n'
+        + '<li class={{className}}>{{word}}</li>\n'
+        + '{{/things}}</ul>.\n'
+        + '{{/hasThings}}\n'
+        + '{{^hasThings}}\n'
+        + '\n'
+        + '<small>Nothing to check out...</small>\n'
+        + '{{/hasThings}}';
+    var data = {
+      thing: function() {
+        return "blah";
+      },
+      things: [
+        {className: "one", word: "@fat"},
+        {className: "two", word: "@dhg"},
+        {className: "three", word:"@sayrer"}
+      ],
+      hasThings: function() {
+        return true;
+      }
+    };
+ 
+    var output = '<strong>This is a slightly more complicated blah.</strong>.\n'
+        + 'Check this out:\n'
+        + '<ul>\n'
+        + '<li class=one>@fat</li>\n'
+        + '<li class=two>@dhg</li>\n'
+        + '<li class=three>@sayrer</li>\n'
+        + '</ul>.\n';
+    shouldCompileTo(string, data, output);
+  });
+ 
+  it('GH-408: Multiple loops fail', function() {
+    var context = [
+      { name: "John Doe", location: { city: "Chicago" } },
+      { name: "Jane Doe", location: { city: "New York"} }
+    ];
+ 
+    var template = CompilerContext.compile('{{#.}}{{name}}{{/.}}{{#.}}{{name}}{{/.}}{{#.}}{{name}}{{/.}}');
+ 
+    var result = template(context);
+    equals(result, "John DoeJane DoeJohn DoeJane DoeJohn DoeJane Doe", 'It should output multiple times');
+  });
+ 
+  it('GS-428: Nested if else rendering', function() {
+    var succeedingTemplate = '{{#inverse}} {{#blk}} Unexpected {{/blk}} {{else}}  {{#blk}} Expected {{/blk}} {{/inverse}}';
+    var failingTemplate = '{{#inverse}} {{#blk}} Unexpected {{/blk}} {{else}} {{#blk}} Expected {{/blk}} {{/inverse}}';
+ 
+    var helpers = {
+      blk: function(block) { return block.fn(''); },
+      inverse: function(block) { return block.inverse(''); }
+    };
+ 
+    shouldCompileTo(succeedingTemplate, [{}, helpers], '   Expected  ');
+    shouldCompileTo(failingTemplate, [{}, helpers], '  Expected  ');
+  });
+ 
+  it('GH-458: Scoped this identifier', function() {
+    shouldCompileTo('{{./foo}}', {foo: 'bar'}, 'bar');
+  });
+ 
+  it('GH-375: Unicode line terminators', function() {
+    shouldCompileTo('\u2028', {}, '\u2028');
+  });
+ 
+  it('GH-534: Object prototype aliases', function() {
+    Object.prototype[0xD834] = true;
+ 
+    shouldCompileTo('{{foo}}', { foo: 'bar' }, 'bar');
+ 
+    delete Object.prototype[0xD834];
+  });
+ 
+  it('GH-437: Matching escaping', function() {
+    shouldThrow(function() {
+      CompilerContext.compile('{{{a}}');
+    }, Error);
+    shouldThrow(function() {
+      CompilerContext.compile('{{a}}}');
+    }, Error);
+  });
+ 
+  it("GH-676: Using array in escaping mustache fails", function() {
+    var string = "{{arr}}";
+    var data = { "arr": [1,2] };
+ 
+    shouldCompileTo(string, data, data.arr.toString(), "it works as expected");
+  });
+ 
+  it("Mustache man page", function() {
+    var string = "Hello {{name}}. You have just won ${{value}}!{{#in_ca}} Well, ${{taxed_value}}, after taxes.{{/in_ca}}";
+    var data = {
+      "name": "Chris",
+      "value": 10000,
+      "taxed_value": 10000 - (10000 * 0.4),
+      "in_ca": true
+    };
+ 
+    shouldCompileTo(string, data, "Hello Chris. You have just won $10000! Well, $6000, after taxes.", "the hello world mustache example works");
+  });
+ 
+  it("Passing falsy values to Handlebars.compile throws an error", function() {
+    shouldThrow(function() {
+      CompilerContext.compile(null);
+    }, Error, 'You must pass a string or Handlebars AST to Handlebars.precompile. You passed null');
+  });
+ 
+  it('GH-731: zero context rendering', function() {
+    shouldCompileTo('{{#foo}} This is {{bar}} ~ {{/foo}}', {foo: 0, bar: 'OK'}, ' This is  ~ ');
+  });
+ 
+  it('GH-820: zero pathed rendering', function() {
+    shouldCompileTo('{{foo.bar}}', {foo: 0}, '');
+  });
+ 
+  if (Handlebars.AST) {
+    it("can pass through an already-compiled AST via compile/precompile", function() {
+      equal(Handlebars.compile(new Handlebars.AST.ProgramNode(true, [ new Handlebars.AST.ContentNode("Hello")]))(), 'Hello');
+    });
+ 
+    it("can pass through an empty string", function() {
+      equal(Handlebars.compile('')(), '');
+    });
+  }
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/require.js.html b/node_modules/handlebars/coverage/lcov-report/spec/require.js.html new file mode 100644 index 0000000..9cec92b --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/require.js.html @@ -0,0 +1,391 @@ + + + + Code coverage report for spec/require.js + + + + + + + +
+

Code coverage report for spec/require.js

+

+ + Statements: 28.57% (4 / 14)      + + + Branches: 75% (3 / 4)      + + + Functions: 33.33% (1 / 3)      + + + Lines: 28.57% (4 / 14)      + + Ignored: none      +

+
All files » spec/ » require.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +243 +3 +3 +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  + 
Eif (typeof(require) !== 'undefined' && require.extensions[".handlebars"]) {
+  describe('Require', function() {
+    it('Load .handlebars files with require()', function() {
+      var template = require("./artifacts/example_1");
+      equal(template, require("./artifacts/example_1.handlebars"));
+ 
+      var expected = 'foo\n';
+      var result = template({foo: "foo"});
+ 
+      equal(result, expected);
+    });
+ 
+    it('Load .hbs files with require()', function() {
+      var template = require("./artifacts/example_2");
+      equal(template, require("./artifacts/example_2.hbs"));
+ 
+      var expected = 'Hello, World!\n';
+      var result = template({name: "World"});
+ 
+      equal(result, expected);
+    });
+  });
+}
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/runtime.js.html b/node_modules/handlebars/coverage/lcov-report/spec/runtime.js.html new file mode 100644 index 0000000..e71c168 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/runtime.js.html @@ -0,0 +1,337 @@ + + + + Code coverage report for spec/runtime.js + + + + + + + +
+

Code coverage report for spec/runtime.js

+

+ + Statements: 100% (3 / 3)      + + + Branches: 100% (0 / 0)      + + + Functions: 100% (2 / 2)      + + + Lines: 100% (3 / 3)      + + Ignored: none      +

+
All files » spec/ » runtime.js
+
+
+

+
+
1 +2 +3 +4 +5 +63 +3 +3 +  +  + 
describe('runtime', function() {
+  describe('#template', function() {
+    it('should throw on invalid data');
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/spec.js.html b/node_modules/handlebars/coverage/lcov-report/spec/spec.js.html new file mode 100644 index 0000000..eeaee4d --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/spec.js.html @@ -0,0 +1,469 @@ + + + + Code coverage report for spec/spec.js + + + + + + + +
+

Code coverage report for spec/spec.js

+

+ + Statements: 76.19% (16 / 21)      + + + Branches: 73.33% (11 / 15)      + + + Functions: 83.33% (5 / 6)      + + + Lines: 76.19% (16 / 21)      + + Ignored: none      +

+
All files » spec/ » spec.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +503 +  +3 +  +  +  +3 +  +  +  +3 +3 +42 +  +  +3 +21 +21 +  +  +366 +  +  +  +  +  +  +  +  +30 +78 +78 +  +  +288 +288 +  +  +  +288 +  +  +  +  +  +  +  +  +  + 
describe('spec', function() {
+  // NOP Under non-node environments
+  Iif (typeof process === 'undefined') {
+    return;
+  }
+ 
+  var _ = require('underscore'),
+      Handlebars = require('../lib'),
+      fs = require('fs');
+ 
+  var specDir =__dirname + '/mustache/specs/';
+  var specs = _.filter(fs.readdirSync(specDir), function(name) {
+    return /.*\.json$/.test(name);
+  });
+ 
+  _.each(specs, function(name) {
+    var spec = require(specDir + name);
+    _.each(spec.tests, function(test) {
+      // Our lambda implementation knowingly deviates from the optional Mustace lambda spec
+      // We also do not support alternative delimeters
+      if (name === '~lambdas.json'
+ 
+          // We also choose to throw if paritals are not found
+          || (name === 'partials.json' && test.name === 'Failed Lookup')
+ 
+          // We nest the entire response from partials, not just the literals
+          || (name === 'partials.json' && test.name === 'Standalone Indentation')
+ 
+          || /\{\{\=/.test(test.template)
+          || _.any(test.partials, function(partial) { return /\{\{\=/.test(partial); })) {
+        it.skip(name + ' - ' + test.name);
+        return;
+      }
+ 
+      var data = _.clone(test.data);
+      Iif (data.lambda) {
+        // Blergh
+        data.lambda = eval('(' + data.lambda.js + ')');
+      }
+      it(name + ' - ' + test.name, function() {
+        if (test.partials) {
+          shouldCompileToWithPartials(test.template, [data, {}, test.partials, true], true, test.expected, test.desc + ' "' + test.template + '"');
+        } else {
+          shouldCompileTo(test.template, [data, {}, {}, true], test.expected, test.desc + ' "' + test.template + '"');
+        }
+      });
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/string-params.js.html b/node_modules/handlebars/coverage/lcov-report/spec/string-params.js.html new file mode 100644 index 0000000..0eb0e99 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/string-params.js.html @@ -0,0 +1,850 @@ + + + + Code coverage report for spec/string-params.js + + + + + + + +
+

Code coverage report for spec/string-params.js

+

+ + Statements: 11.9% (10 / 84)      + + + Branches: 100% (0 / 0)      + + + Functions: 4.35% (1 / 23)      + + + Lines: 11.9% (10 / 84)      + + Ignored: none      +

+
All files » spec/ » string-params.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +1773 +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
describe('string params mode', function() {
+  it("arguments to helpers can be retrieved from options hash in string form", function() {
+    var template = CompilerContext.compile('{{wycats is.a slave.driver}}', {stringParams: true});
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun) {
+        return "HELP ME MY BOSS " + passiveVoice + ' ' + noun;
+      }
+    };
+ 
+    var result = template({}, {helpers: helpers});
+ 
+    equals(result, "HELP ME MY BOSS is.a slave.driver", "String parameters output");
+  });
+ 
+  it("when using block form, arguments to helpers can be retrieved from options hash in string form", function() {
+    var template = CompilerContext.compile('{{#wycats is.a slave.driver}}help :({{/wycats}}', {stringParams: true});
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun, options) {
+        return "HELP ME MY BOSS " + passiveVoice + ' ' +
+                noun + ': ' + options.fn(this);
+      }
+    };
+ 
+    var result = template({}, {helpers: helpers});
+ 
+    equals(result, "HELP ME MY BOSS is.a slave.driver: help :(", "String parameters output");
+  });
+ 
+  it("when inside a block in String mode, .. passes the appropriate context in the options hash", function() {
+    var template = CompilerContext.compile('{{#with dale}}{{tomdale ../need dad.joke}}{{/with}}', {stringParams: true});
+ 
+    var helpers = {
+      tomdale: function(desire, noun, options) {
+        return "STOP ME FROM READING HACKER NEWS I " +
+                options.contexts[0][desire] + " " + noun;
+      },
+ 
+      "with": function(context, options) {
+        return options.fn(options.contexts[0][context]);
+      }
+    };
+ 
+    var result = template({
+      dale: {},
+ 
+      need: 'need-a'
+    }, {helpers: helpers});
+ 
+    equals(result, "STOP ME FROM READING HACKER NEWS I need-a dad.joke", "Proper context variable output");
+  });
+ 
+  it("information about the types is passed along", function() {
+    var template = CompilerContext.compile('{{tomdale "need" dad.joke true false}}', { stringParams: true });
+ 
+    var helpers = {
+      tomdale: function(desire, noun, trueBool, falseBool, options) {
+        equal(options.types[0], 'STRING', "the string type is passed");
+        equal(options.types[1], 'ID', "the expression type is passed");
+        equal(options.types[2], 'BOOLEAN', "the expression type is passed");
+        equal(desire, "need", "the string form is passed for strings");
+        equal(noun, "dad.joke", "the string form is passed for expressions");
+        equal(trueBool, true, "raw booleans are passed through");
+        equal(falseBool, false, "raw booleans are passed through");
+        return "Helper called";
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers });
+    equal(result, "Helper called");
+  });
+ 
+  it("hash parameters get type information", function() {
+    var template = CompilerContext.compile('{{tomdale he.says desire="need" noun=dad.joke bool=true}}', { stringParams: true });
+ 
+    var helpers = {
+      tomdale: function(exclamation, options) {
+        equal(exclamation, "he.says");
+        equal(options.types[0], "ID");
+ 
+        equal(options.hashTypes.desire, "STRING");
+        equal(options.hashTypes.noun, "ID");
+        equal(options.hashTypes.bool, "BOOLEAN");
+        equal(options.hash.desire, "need");
+        equal(options.hash.noun, "dad.joke");
+        equal(options.hash.bool, true);
+        return "Helper called";
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers });
+    equal(result, "Helper called");
+  });
+ 
+  it("hash parameters get context information", function() {
+    var template = CompilerContext.compile('{{#with dale}}{{tomdale he.says desire="need" noun=../dad/joke bool=true}}{{/with}}', { stringParams: true });
+ 
+    var context = {dale: {}};
+ 
+    var helpers = {
+      tomdale: function(exclamation, options) {
+        equal(exclamation, "he.says");
+        equal(options.types[0], "ID");
+ 
+        equal(options.contexts.length, 1);
+        equal(options.hashContexts.noun, context);
+        equal(options.hash.desire, "need");
+        equal(options.hash.noun, "dad.joke");
+        equal(options.hash.bool, true);
+        return "Helper called";
+      },
+      "with": function(context, options) {
+        return options.fn(options.contexts[0][context]);
+      }
+    };
+ 
+    var result = template(context, { helpers: helpers });
+    equal(result, "Helper called");
+  });
+ 
+  it("when inside a block in String mode, .. passes the appropriate context in the options hash to a block helper", function() {
+    var template = CompilerContext.compile('{{#with dale}}{{#tomdale ../need dad.joke}}wot{{/tomdale}}{{/with}}', {stringParams: true});
+ 
+    var helpers = {
+      tomdale: function(desire, noun, options) {
+        return "STOP ME FROM READING HACKER NEWS I " +
+                options.contexts[0][desire] + " " + noun + " " +
+                options.fn(this);
+      },
+ 
+      "with": function(context, options) {
+        return options.fn(options.contexts[0][context]);
+      }
+    };
+ 
+    var result = template({
+      dale: {},
+ 
+      need: 'need-a'
+    }, {helpers: helpers});
+ 
+    equals(result, "STOP ME FROM READING HACKER NEWS I need-a dad.joke wot", "Proper context variable output");
+  });
+ 
+  it("with nested block ambiguous", function() {
+    var template = CompilerContext.compile('{{#with content}}{{#view}}{{firstName}} {{lastName}}{{/view}}{{/with}}', {stringParams: true});
+ 
+    var helpers  = {
+      'with': function(options) {
+        return "WITH";
+      },
+      view: function() {
+        return "VIEW";
+      }
+    };
+ 
+    var result = template({}, {helpers: helpers});
+    equals(result, "WITH");
+  });
+ 
+  it('should handle DATA', function() {
+    var template = CompilerContext.compile('{{foo @bar}}', { stringParams: true });
+ 
+    var helpers = {
+      foo: function(bar, options) {
+        equal(bar, 'bar');
+        equal(options.types[0], 'DATA');
+        return 'Foo!';
+      }
+    };
+ 
+    var result = template({}, { helpers: helpers });
+    equal(result, 'Foo!');
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/subexpressions.js.html b/node_modules/handlebars/coverage/lcov-report/spec/subexpressions.js.html new file mode 100644 index 0000000..fc7e305 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/subexpressions.js.html @@ -0,0 +1,970 @@ + + + + Code coverage report for spec/subexpressions.js + + + + + + + +
+

Code coverage report for spec/subexpressions.js

+

+ + Statements: 13.33% (14 / 105)      + + + Branches: 0% (0 / 4)      + + + Functions: 2.56% (1 / 39)      + + + Lines: 13.33% (14 / 105)      + + Ignored: none      +

+
All files » spec/ » subexpressions.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217  +3 +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/*global CompilerContext, shouldCompileTo */
+describe('subexpressions', function() {
+  it("arg-less helper", function() {
+    var string   = "{{foo (bar)}}!";
+    var context  = {};
+    var helpers  = {
+      foo: function(val) {
+        return val+val;
+      },
+      bar: function() {
+        return "LOL";
+      }
+    };
+    shouldCompileTo(string, [context, helpers], "LOLLOL!");
+  });
+ 
+  it("helper w args", function() {
+    var string   = '{{blog (equal a b)}}';
+ 
+    var context  = { bar: "LOL" };
+    var helpers  = {
+      blog: function(val) {
+        return "val is " + val;
+      },
+      equal: function(x, y) {
+        return x === y;
+      }
+    };
+    shouldCompileTo(string, [context, helpers], "val is true");
+  });
+ 
+  it("mixed paths and helpers", function() {
+    var string   = '{{blog baz.bat (equal a b) baz.bar}}';
+ 
+    var context  = { bar: "LOL", baz: {bat: 'foo!', bar: 'bar!'} };
+    var helpers  = {
+      blog: function(val, that, theOther) {
+        return "val is " + val + ', ' + that + ' and ' + theOther;
+      },
+      equal: function(x, y) {
+        return x === y;
+      }
+    };
+    shouldCompileTo(string, [context, helpers], "val is foo!, true and bar!");
+  });
+ 
+  it("supports much nesting", function() {
+    var string   = '{{blog (equal (equal true true) true)}}';
+ 
+    var context  = { bar: "LOL" };
+    var helpers  = {
+      blog: function(val) {
+        return "val is " + val;
+      },
+      equal: function(x, y) {
+        return x === y;
+      }
+    };
+    shouldCompileTo(string, [context, helpers], "val is true");
+  });
+ 
+  it('GH-800 : Complex subexpressions', function() {
+    var context  = {a: 'a', b:'b', c:{c:'c'}, d:'d', e: {e: 'e'}};
+    var helpers  = {
+      dash: function(a, b) {
+        return a + "-" + b;
+      },
+      concat: function(a, b) {
+        return a + b;
+      }
+    };
+ 
+    shouldCompileTo('{{dash "abc" (concat a b)}}', [context, helpers], 'abc-ab');
+    shouldCompileTo('{{dash d (concat a b)}}', [context, helpers], 'd-ab');
+    shouldCompileTo('{{dash c.c (concat a b)}}', [context, helpers], 'c-ab');
+    shouldCompileTo('{{dash (concat a b) c.c}}', [context, helpers], 'ab-c');
+    shouldCompileTo('{{dash (concat a e.e) c.c}}', [context, helpers], 'ae-c');
+  });
+ 
+  it("provides each nested helper invocation its own options hash", function() {
+    var string = '{{equal (equal true true) true}}';
+ 
+    var lastOptions = null;
+    var helpers  = {
+      equal: function(x, y, options) {
+        if (!options || options === lastOptions) {
+          throw new Error("options hash was reused");
+        }
+        lastOptions = options;
+        return x === y;
+      }
+    };
+    shouldCompileTo(string, [{}, helpers], "true");
+  });
+ 
+  it("with hashes", function() {
+    var string   = '{{blog (equal (equal true true) true fun="yes")}}';
+ 
+    var context  = { bar: "LOL" };
+    var helpers  = {
+      blog: function(val) {
+        return "val is " + val;
+      },
+      equal: function(x, y) {
+        return x === y;
+      }
+    };
+    shouldCompileTo(string, [context, helpers], "val is true");
+  });
+ 
+  it("as hashes", function() {
+    var string   = '{{blog fun=(equal (blog fun=1) "val is 1")}}';
+ 
+    var helpers  = {
+      blog: function(options) {
+        return "val is " + options.hash.fun;
+      },
+      equal: function(x, y) {
+        return x === y;
+      }
+    };
+    shouldCompileTo(string, [{}, helpers], "val is true");
+  });
+ 
+  it("multiple subexpressions in a hash", function() {
+    var string = '{{input aria-label=(t "Name") placeholder=(t "Example User")}}';
+ 
+    var helpers = {
+      input: function(options) {
+        var hash        = options.hash;
+        var ariaLabel   = Handlebars.Utils.escapeExpression(hash['aria-label']);
+        var placeholder = Handlebars.Utils.escapeExpression(hash.placeholder);
+        return new Handlebars.SafeString('<input aria-label="' + ariaLabel + '" placeholder="' + placeholder + '" />');
+      },
+      t: function(defaultString) {
+        return new Handlebars.SafeString(defaultString);
+      }
+    }
+    shouldCompileTo(string, [{}, helpers], '<input aria-label="Name" placeholder="Example User" />');
+  });
+ 
+  it("in string params mode,", function() {
+    var template = CompilerContext.compile('{{snog (blorg foo x=y) yeah a=b}}', {stringParams: true});
+ 
+    var helpers = {
+      snog: function(a, b, options) {
+        equals(a, 'foo');
+        equals(options.types.length, 2, "string params for outer helper processed correctly");
+        equals(options.types[0], 'sexpr', "string params for outer helper processed correctly");
+        equals(options.types[1], 'ID', "string params for outer helper processed correctly");
+        return a + b;
+      },
+ 
+      blorg: function(a, options) {
+        equals(options.types.length, 1, "string params for inner helper processed correctly");
+        equals(options.types[0], 'ID', "string params for inner helper processed correctly");
+        return a;
+      }
+    };
+ 
+    var result = template({
+      foo: {},
+      yeah: {}
+    }, {helpers: helpers});
+ 
+    equals(result, "fooyeah");
+  });
+ 
+  it("as hashes in string params mode", function() {
+ 
+    var template = CompilerContext.compile('{{blog fun=(bork)}}', {stringParams: true});
+ 
+    var helpers  = {
+      blog: function(options) {
+        equals(options.hashTypes.fun, 'sexpr');
+        return "val is " + options.hash.fun;
+      },
+      bork: function() {
+        return "BORK";
+      }
+    };
+ 
+    var result = template({}, {helpers: helpers});
+    equals(result, "val is BORK");
+  });
+ 
+  it("subexpression functions on the context", function() {
+    var string   = "{{foo (bar)}}!";
+    var context  = {
+      bar: function() {
+        return "LOL";
+      }
+    };
+    var helpers  = {
+      foo: function(val) {
+        return val+val;
+      }
+    };
+    shouldCompileTo(string, [context, helpers], "LOLLOL!");
+  });
+ 
+  it("subexpressions can't just be property lookups", function() {
+    var string   = "{{foo (bar)}}!";
+    var context  = {
+      bar: "LOL"
+    };
+    var helpers  = {
+      foo: function(val) {
+        return val+val;
+      }
+    };
+    shouldThrow(function() {
+      shouldCompileTo(string, [context, helpers], "LOLLOL!");
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/tokenizer.js.html b/node_modules/handlebars/coverage/lcov-report/spec/tokenizer.js.html new file mode 100644 index 0000000..377d160 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/tokenizer.js.html @@ -0,0 +1,1528 @@ + + + + Code coverage report for spec/tokenizer.js + + + + + + + +
+

Code coverage report for spec/tokenizer.js

+

+ + Statements: 20.91% (55 / 263)      + + + Branches: 22.22% (2 / 9)      + + + Functions: 1.89% (1 / 53)      + + + Lines: 20.91% (55 / 263)      + + Ignored: none      +

+
All files » spec/ » tokenizer.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +4031 +  +  +  +  +1 +  +  +  +  +3 +3 +1 +  +  +1 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +2 +  +  +  +2 +  +  +  +  +  +  +  +  +  +  +  +  +2 +  +  +  +  +  +  +  +  +2 +  +  +  +  + 
function shouldMatchTokens(result, tokens) {
+  for (var index = 0; index < result.length; index++) {
+    equals(result[index].name, tokens[index]);
+  }
+}
+function shouldBeToken(result, name, text) {
+  equals(result.name, name);
+  equals(result.text, text);
+}
+ 
+describe('Tokenizer', function() {
+  if (!Handlebars.Parser) {
+    return;
+  }
+ 
+  function tokenize(template) {
+    var parser = Handlebars.Parser,
+        lexer = parser.lexer;
+ 
+    lexer.setInput(template);
+    var out = [],
+        token;
+ 
+    while (token = lexer.lex()) {
+      var result = parser.terminals_[token] || token;
+      if (!result || result === 'EOF' || result === 'INVALID') {
+        break;
+      }
+      out.push({name: result, text: lexer.yytext});
+    }
+ 
+    return out;
+  }
+ 
+  it('tokenizes a simple mustache as "OPEN ID CLOSE"', function() {
+    var result = tokenize("{{foo}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+  });
+ 
+  it('supports unescaping with &', function() {
+    var result = tokenize("{{&bar}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[0], "OPEN", "{{&");
+    shouldBeToken(result[1], "ID", "bar");
+  });
+ 
+  it('supports unescaping with {{{', function() {
+    var result = tokenize("{{{bar}}}");
+    shouldMatchTokens(result, ['OPEN_UNESCAPED', 'ID', 'CLOSE_UNESCAPED']);
+ 
+    shouldBeToken(result[1], "ID", "bar");
+  });
+ 
+  it('supports escaping delimiters', function() {
+    var result = tokenize("{{foo}} \\{{bar}} {{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[3], "CONTENT", " ");
+    shouldBeToken(result[4], "CONTENT", "{{bar}} ");
+  });
+ 
+  it('supports escaping multiple delimiters', function() {
+    var result = tokenize("{{foo}} \\{{bar}} \\{{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'CONTENT']);
+ 
+    shouldBeToken(result[3], "CONTENT", " ");
+    shouldBeToken(result[4], "CONTENT", "{{bar}} ");
+    shouldBeToken(result[5], "CONTENT", "{{baz}}");
+  });
+ 
+  it('supports escaping a triple stash', function() {
+    var result = tokenize("{{foo}} \\{{{bar}}} {{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[4], "CONTENT", "{{{bar}}} ");
+  });
+ 
+  it('supports escaping escape character', function() {
+    var result = tokenize("{{foo}} \\\\{{bar}} {{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[3], "CONTENT", " \\");
+    shouldBeToken(result[5], "ID", "bar");
+  });
+ 
+  it('supports escaping multiple escape characters', function() {
+    var result = tokenize("{{foo}} \\\\{{bar}} \\\\{{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[3], "CONTENT", " \\");
+    shouldBeToken(result[5], "ID", "bar");
+    shouldBeToken(result[7], "CONTENT", " \\");
+    shouldBeToken(result[9], "ID", "baz");
+  });
+ 
+  it('supports escaped mustaches after escaped escape characters', function() {
+    var result = tokenize("{{foo}} \\\\{{bar}} \\{{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'CONTENT']);
+ 
+    shouldBeToken(result[3], "CONTENT", " \\");
+    shouldBeToken(result[4], "OPEN", "{{");
+    shouldBeToken(result[5], "ID", "bar");
+    shouldBeToken(result[7], "CONTENT", " ");
+    shouldBeToken(result[8], "CONTENT", "{{baz}}");
+  });
+ 
+  it('supports escaped escape characters after escaped mustaches', function() {
+    var result = tokenize("{{foo}} \\{{bar}} \\\\{{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'CONTENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[4], "CONTENT", "{{bar}} ");
+    shouldBeToken(result[5], "CONTENT", "\\");
+    shouldBeToken(result[6], "OPEN", "{{");
+    shouldBeToken(result[7], "ID", "baz");
+  });
+ 
+  it('supports escaped escape character on a triple stash', function() {
+    var result = tokenize("{{foo}} \\\\{{{bar}}} {{baz}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE', 'CONTENT', 'OPEN_UNESCAPED', 'ID', 'CLOSE_UNESCAPED', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+ 
+    shouldBeToken(result[3], "CONTENT", " \\");
+    shouldBeToken(result[5], "ID", "bar");
+  });
+ 
+  it('tokenizes a simple path', function() {
+    var result = tokenize("{{foo/bar}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);
+  });
+ 
+  it('allows dot notation', function() {
+    var result = tokenize("{{foo.bar}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);
+ 
+    shouldMatchTokens(tokenize("{{foo.bar.baz}}"), ['OPEN', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);
+  });
+ 
+  it('allows path literals with []', function() {
+    var result = tokenize("{{foo.[bar]}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);
+  });
+ 
+  it('allows multiple path literals on a line with []', function() {
+    var result = tokenize("{{foo.[bar]}}{{foo.[baz]}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE', 'OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes {{.}} as OPEN ID CLOSE', function() {
+    var result = tokenize("{{.}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes a path as "OPEN (ID SEP)* ID CLOSE"', function() {
+    var result = tokenize("{{../foo/bar}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "..");
+  });
+ 
+  it('tokenizes a path with .. as a parent path', function() {
+    var result = tokenize("{{../foo.bar}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "..");
+  });
+ 
+  it('tokenizes a path with this/foo as OPEN ID SEP ID CLOSE', function() {
+    var result = tokenize("{{this/foo}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'SEP', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "this");
+    shouldBeToken(result[3], "ID", "foo");
+  });
+ 
+  it('tokenizes a simple mustache with spaces as "OPEN ID CLOSE"', function() {
+    var result = tokenize("{{  foo  }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+  });
+ 
+  it('tokenizes a simple mustache with line breaks as "OPEN ID ID CLOSE"', function() {
+    var result = tokenize("{{  foo  \n   bar }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+  });
+ 
+  it('tokenizes raw content as "CONTENT"', function() {
+    var result = tokenize("foo {{ bar }} baz");
+    shouldMatchTokens(result, ['CONTENT', 'OPEN', 'ID', 'CLOSE', 'CONTENT']);
+    shouldBeToken(result[0], "CONTENT", "foo ");
+    shouldBeToken(result[4], "CONTENT", " baz");
+  });
+ 
+  it('tokenizes a partial as "OPEN_PARTIAL ID CLOSE"', function() {
+    var result = tokenize("{{> foo}}");
+    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes a partial with context as "OPEN_PARTIAL ID ID CLOSE"', function() {
+    var result = tokenize("{{> foo bar }}");
+    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes a partial without spaces as "OPEN_PARTIAL ID CLOSE"', function() {
+    var result = tokenize("{{>foo}}");
+    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes a partial space at the }); as "OPEN_PARTIAL ID CLOSE"', function() {
+    var result = tokenize("{{>foo  }}");
+    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes a partial space at the }); as "OPEN_PARTIAL ID CLOSE"', function() {
+    var result = tokenize("{{>foo/bar.baz  }}");
+    shouldMatchTokens(result, ['OPEN_PARTIAL', 'ID', 'SEP', 'ID', 'SEP', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes a comment as "COMMENT"', function() {
+    var result = tokenize("foo {{! this is a comment }} bar {{ baz }}");
+    shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "COMMENT", " this is a comment ");
+  });
+ 
+  it('tokenizes a block comment as "COMMENT"', function() {
+    var result = tokenize("foo {{!-- this is a {{comment}} --}} bar {{ baz }}");
+    shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "COMMENT", " this is a {{comment}} ");
+  });
+ 
+  it('tokenizes a block comment with whitespace as "COMMENT"', function() {
+    var result = tokenize("foo {{!-- this is a\n{{comment}}\n--}} bar {{ baz }}");
+    shouldMatchTokens(result, ['CONTENT', 'COMMENT', 'CONTENT', 'OPEN', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "COMMENT", " this is a\n{{comment}}\n");
+  });
+ 
+  it('tokenizes open and closing blocks as OPEN_BLOCK, ID, CLOSE ..., OPEN_ENDBLOCK ID CLOSE', function() {
+    var result = tokenize("{{#foo}}content{{/foo}}");
+    shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'CLOSE', 'CONTENT', 'OPEN_ENDBLOCK', 'ID', 'CLOSE']);
+  });
+ 
+  it('tokenizes inverse sections as "OPEN_INVERSE CLOSE"', function() {
+    shouldMatchTokens(tokenize("{{^}}"), ['OPEN_INVERSE', 'CLOSE']);
+    shouldMatchTokens(tokenize("{{else}}"), ['OPEN_INVERSE', 'CLOSE']);
+    shouldMatchTokens(tokenize("{{ else }}"), ['OPEN_INVERSE', 'CLOSE']);
+  });
+ 
+  it('tokenizes inverse sections with ID as "OPEN_INVERSE ID CLOSE"', function() {
+    var result = tokenize("{{^foo}}");
+    shouldMatchTokens(result, ['OPEN_INVERSE', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+  });
+ 
+  it('tokenizes inverse sections with ID and spaces as "OPEN_INVERSE ID CLOSE"', function() {
+    var result = tokenize("{{^ foo  }}");
+    shouldMatchTokens(result, ['OPEN_INVERSE', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+  });
+ 
+  it('tokenizes mustaches with params as "OPEN ID ID ID CLOSE"', function() {
+    var result = tokenize("{{ foo bar baz }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+    shouldBeToken(result[2], "ID", "bar");
+    shouldBeToken(result[3], "ID", "baz");
+  });
+ 
+  it('tokenizes mustaches with String params as "OPEN ID ID STRING CLOSE"', function() {
+    var result = tokenize("{{ foo bar \"baz\" }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'STRING', 'CLOSE']);
+    shouldBeToken(result[3], "STRING", "baz");
+  });
+ 
+  it('tokenizes mustaches with String params using single quotes as "OPEN ID ID STRING CLOSE"', function() {
+    var result = tokenize("{{ foo bar \'baz\' }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'STRING', 'CLOSE']);
+    shouldBeToken(result[3], "STRING", "baz");
+  });
+ 
+  it('tokenizes String params with spaces inside as "STRING"', function() {
+    var result = tokenize("{{ foo bar \"baz bat\" }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'STRING', 'CLOSE']);
+    shouldBeToken(result[3], "STRING", "baz bat");
+  });
+ 
+  it('tokenizes String params with escapes quotes as STRING', function() {
+    var result = tokenize('{{ foo "bar\\"baz" }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'STRING', 'CLOSE']);
+    shouldBeToken(result[2], "STRING", 'bar"baz');
+  });
+ 
+  it('tokenizes String params using single quotes with escapes quotes as STRING', function() {
+    var result = tokenize("{{ foo 'bar\\'baz' }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'STRING', 'CLOSE']);
+    shouldBeToken(result[2], "STRING", "bar'baz");
+  });
+ 
+  it('tokenizes numbers', function() {
+    var result = tokenize('{{ foo 1 }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);
+    shouldBeToken(result[2], "NUMBER", "1");
+ 
+    result = tokenize('{{ foo 1.1 }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);
+    shouldBeToken(result[2], "NUMBER", "1.1");
+ 
+    result = tokenize('{{ foo -1 }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);
+    shouldBeToken(result[2], "NUMBER", "-1");
+ 
+    result = tokenize('{{ foo -1.1 }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'NUMBER', 'CLOSE']);
+    shouldBeToken(result[2], "NUMBER", "-1.1");
+  });
+ 
+  it('tokenizes booleans', function() {
+    var result = tokenize('{{ foo true }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'BOOLEAN', 'CLOSE']);
+    shouldBeToken(result[2], "BOOLEAN", "true");
+ 
+    result = tokenize('{{ foo false }}');
+    shouldMatchTokens(result, ['OPEN', 'ID', 'BOOLEAN', 'CLOSE']);
+    shouldBeToken(result[2], "BOOLEAN", "false");
+  });
+ 
+  it('tokenizes hash arguments', function() {
+    var result = tokenize("{{ foo bar=baz }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'EQUALS', 'ID', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar baz=bat }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'ID', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar baz=1 }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'NUMBER', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar baz=true }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'BOOLEAN', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar baz=false }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'BOOLEAN', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar\n  baz=bat }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'ID', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar baz=\"bat\" }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'STRING', 'CLOSE']);
+ 
+    result = tokenize("{{ foo bar baz=\"bat\" bam=wot }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'STRING', 'ID', 'EQUALS', 'ID', 'CLOSE']);
+ 
+    result = tokenize("{{foo omg bar=baz bat=\"bam\"}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'ID', 'EQUALS', 'ID', 'ID', 'EQUALS', 'STRING', 'CLOSE']);
+    shouldBeToken(result[2], "ID", "omg");
+  });
+ 
+  it('tokenizes special @ identifiers', function() {
+    var result = tokenize("{{ @foo }}");
+    shouldMatchTokens(result, ['OPEN', 'DATA', 'ID', 'CLOSE']);
+    shouldBeToken(result[2], "ID", "foo");
+ 
+    result = tokenize("{{ foo @bar }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'DATA', 'ID', 'CLOSE']);
+    shouldBeToken(result[3], "ID", "bar");
+ 
+    result = tokenize("{{ foo bar=@baz }}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'ID', 'EQUALS', 'DATA', 'ID', 'CLOSE']);
+    shouldBeToken(result[5], "ID", "baz");
+  });
+ 
+  it('does not time out in a mustache with a single } followed by EOF', function() {
+    shouldMatchTokens(tokenize("{{foo}"), ['OPEN', 'ID']);
+  });
+ 
+  it('does not time out in a mustache when invalid ID characters are used', function() {
+    shouldMatchTokens(tokenize("{{foo & }}"), ['OPEN', 'ID']);
+  });
+ 
+  it('tokenizes subexpressions', function() {
+    var result = tokenize("{{foo (bar)}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'CLOSE_SEXPR', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+    shouldBeToken(result[3], "ID", "bar");
+ 
+    result = tokenize("{{foo (a-x b-y)}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'ID', 'CLOSE_SEXPR', 'CLOSE']);
+    shouldBeToken(result[1], "ID", "foo");
+    shouldBeToken(result[3], "ID", "a-x");
+    shouldBeToken(result[4], "ID", "b-y");
+  });
+ 
+  it('tokenizes nested subexpressions', function() {
+    var result = tokenize("{{foo (bar (lol rofl)) (baz)}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'OPEN_SEXPR', 'ID', 'ID', 'CLOSE_SEXPR', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'CLOSE_SEXPR', 'CLOSE']);
+    shouldBeToken(result[3],  "ID", "bar");
+    shouldBeToken(result[5],  "ID", "lol");
+    shouldBeToken(result[6],  "ID", "rofl");
+    shouldBeToken(result[10], "ID", "baz");
+  });
+ 
+  it('tokenizes nested subexpressions: literals', function() {
+    var result = tokenize("{{foo (bar (lol true) false) (baz 1) (blah 'b') (blorg \"c\")}}");
+    shouldMatchTokens(result, ['OPEN', 'ID', 'OPEN_SEXPR', 'ID', 'OPEN_SEXPR', 'ID', 'BOOLEAN', 'CLOSE_SEXPR', 'BOOLEAN', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'NUMBER', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'STRING', 'CLOSE_SEXPR', 'OPEN_SEXPR', 'ID', 'STRING', 'CLOSE_SEXPR', 'CLOSE']);
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/track-ids.js.html b/node_modules/handlebars/coverage/lcov-report/spec/track-ids.js.html new file mode 100644 index 0000000..e026a5e --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/track-ids.js.html @@ -0,0 +1,811 @@ + + + + Code coverage report for spec/track-ids.js + + + + + + + +
+

Code coverage report for spec/track-ids.js

+

+ + Statements: 27.38% (23 / 84)      + + + Branches: 100% (0 / 0)      + + + Functions: 16.67% (5 / 30)      + + + Lines: 27.38% (23 / 84)      + + Ignored: none      +

+
All files » spec/ » track-ids.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +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  +3 +3 +3 +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +3 +3 +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +3 +3 +  +  +  +  +3 +  +  +  +  +  +3 +3 +  +  +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +  + 
/*global CompilerContext */
+describe('track ids', function() {
+  var context;
+  beforeEach(function() {
+    context = {is: {a: 'foo'}, slave: {driver: 'bar'}};
+  });
+ 
+  it('should not include anything without the flag', function() {
+    var template = CompilerContext.compile('{{wycats is.a slave.driver}}');
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun, options) {
+        equal(options.ids, undefined);
+        equal(options.hashIds, undefined);
+ 
+        return 'success';
+      }
+    };
+ 
+    equals(template({}, {helpers: helpers}), 'success');
+  });
+  it('should include argument ids', function() {
+    var template = CompilerContext.compile('{{wycats is.a slave.driver}}', {trackIds: true});
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun, options) {
+        equal(options.ids[0], 'is.a');
+        equal(options.ids[1], 'slave.driver');
+ 
+        return "HELP ME MY BOSS " + options.ids[0] + ':' + passiveVoice + ' ' + options.ids[1] + ':' + noun;
+      }
+    };
+ 
+    equals(template(context, {helpers: helpers}), 'HELP ME MY BOSS is.a:foo slave.driver:bar');
+  });
+  it('should include hash ids', function() {
+    var template = CompilerContext.compile('{{wycats bat=is.a baz=slave.driver}}', {trackIds: true});
+ 
+    var helpers = {
+      wycats: function(options) {
+        equal(options.hashIds.bat, 'is.a');
+        equal(options.hashIds.baz, 'slave.driver');
+ 
+        return "HELP ME MY BOSS " + options.hashIds.bat + ':' + options.hash.bat + ' ' + options.hashIds.baz + ':' + options.hash.baz;
+      }
+    };
+ 
+    equals(template(context, {helpers: helpers}), 'HELP ME MY BOSS is.a:foo slave.driver:bar');
+  });
+  it('should note ../ and ./ references', function() {
+    var template = CompilerContext.compile('{{wycats ./is.a ../slave.driver}}', {trackIds: true});
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun, options) {
+        equal(options.ids[0], 'is.a');
+        equal(options.ids[1], '../slave.driver');
+ 
+        return "HELP ME MY BOSS " + options.ids[0] + ':' + passiveVoice + ' ' + options.ids[1] + ':' + noun;
+      }
+    };
+ 
+    equals(template(context, {helpers: helpers}), 'HELP ME MY BOSS is.a:foo ../slave.driver:undefined');
+  });
+  it('should note @data references', function() {
+    var template = CompilerContext.compile('{{wycats @is.a @slave.driver}}', {trackIds: true});
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun, options) {
+        equal(options.ids[0], '@is.a');
+        equal(options.ids[1], '@slave.driver');
+ 
+        return "HELP ME MY BOSS " + options.ids[0] + ':' + passiveVoice + ' ' + options.ids[1] + ':' + noun;
+      }
+    };
+ 
+    equals(template({}, {helpers: helpers, data:context}), 'HELP ME MY BOSS @is.a:foo @slave.driver:bar');
+  });
+ 
+  it('should return null for constants', function() {
+    var template = CompilerContext.compile('{{wycats 1 "foo" key=false}}', {trackIds: true});
+ 
+    var helpers = {
+      wycats: function(passiveVoice, noun, options) {
+        equal(options.ids[0], null);
+        equal(options.ids[1], null);
+        equal(options.hashIds.key, null);
+ 
+        return "HELP ME MY BOSS " + passiveVoice + ' ' + noun + ' ' + options.hash.key;
+      }
+    };
+ 
+    equals(template(context, {helpers: helpers}), 'HELP ME MY BOSS 1 foo false');
+  });
+  it('should return true for subexpressions', function() {
+    var template = CompilerContext.compile('{{wycats (sub)}}', {trackIds: true});
+ 
+    var helpers = {
+      sub: function() { return 1; },
+      wycats: function(passiveVoice, options) {
+        equal(options.ids[0], true);
+ 
+        return "HELP ME MY BOSS " + passiveVoice;
+      }
+    };
+ 
+    equals(template(context, {helpers: helpers}), 'HELP ME MY BOSS 1');
+  });
+ 
+  describe('builtin helpers', function() {
+    var helpers = {
+      wycats: function(name, options) {
+        return name + ':' + options.data.contextPath + '\n';
+      }
+    };
+ 
+    describe('#each', function() {
+      it('should track contextPath for arrays', function() {
+        var template = CompilerContext.compile('{{#each array}}{{wycats name}}{{/each}}', {trackIds: true});
+ 
+        equals(template({array: [{name: 'foo'}, {name: 'bar'}]}, {helpers: helpers}), 'foo:array.0\nbar:array.1\n');
+      });
+      it('should track contextPath for keys', function() {
+        var template = CompilerContext.compile('{{#each object}}{{wycats name}}{{/each}}', {trackIds: true});
+ 
+        equals(template({object: {foo: {name: 'foo'}, bar: {name: 'bar'}}}, {helpers: helpers}), 'foo:object.foo\nbar:object.bar\n');
+      });
+      it('should handle nesting', function() {
+        var template = CompilerContext.compile('{{#each .}}{{#each .}}{{wycats name}}{{/each}}{{/each}}', {trackIds: true});
+ 
+        equals(template({array: [{name: 'foo'}, {name: 'bar'}]}, {helpers: helpers}), 'foo:.array..0\nbar:.array..1\n');
+      });
+    });
+    describe('#with', function() {
+      it('should track contextPath', function() {
+        var template = CompilerContext.compile('{{#with field}}{{wycats name}}{{/with}}', {trackIds: true});
+ 
+        equals(template({field: {name: 'foo'}}, {helpers: helpers}), 'foo:field\n');
+      });
+      it('should handle nesting', function() {
+        var template = CompilerContext.compile('{{#with bat}}{{#with field}}{{wycats name}}{{/with}}{{/with}}', {trackIds: true});
+ 
+        equals(template({bat: {field: {name: 'foo'}}}, {helpers: helpers}), 'foo:bat.field\n');
+      });
+    });
+    describe('#blockHelperMissing', function() {
+      it('should track contextPath for arrays', function() {
+        var template = CompilerContext.compile('{{#field}}{{wycats name}}{{/field}}', {trackIds: true});
+ 
+        equals(template({field: [{name: 'foo'}]}, {helpers: helpers}), 'foo:field.0\n');
+      });
+      it('should track contextPath for keys', function() {
+        var template = CompilerContext.compile('{{#field}}{{wycats name}}{{/field}}', {trackIds: true});
+ 
+        equals(template({field: {name: 'foo'}}, {helpers: helpers}), 'foo:field\n');
+      });
+      it('should handle nesting', function() {
+        var template = CompilerContext.compile('{{#bat}}{{#field}}{{wycats name}}{{/field}}{{/bat}}', {trackIds: true});
+ 
+        equals(template({bat: {field: {name: 'foo'}}}, {helpers: helpers}), 'foo:bat.field\n');
+      });
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/utils.js.html b/node_modules/handlebars/coverage/lcov-report/spec/utils.js.html new file mode 100644 index 0000000..013bde1 --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/utils.js.html @@ -0,0 +1,499 @@ + + + + Code coverage report for spec/utils.js + + + + + + + +
+

Code coverage report for spec/utils.js

+

+ + Statements: 32.43% (12 / 37)      + + + Branches: 0% (0 / 2)      + + + Functions: 33.33% (4 / 12)      + + + Lines: 32.43% (12 / 37)      + + Ignored: none      +

+
All files » spec/ » utils.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60  +  +3 +3 +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +3 +3 +  +  +3 +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  + 
/*global Handlebars, shouldCompileTo */
+ 
+describe('utils', function() {
+  describe('#SafeString', function() {
+    it("constructing a safestring from a string and checking its type", function() {
+      var safe = new Handlebars.SafeString("testing 1, 2, 3");
+      if (!(safe instanceof Handlebars.SafeString)) {
+        throw new Error('Must be instance of SafeString');
+      }
+      equals(safe == 'testing 1, 2, 3', true, 'SafeString is equivalent to its underlying string');
+    });
+ 
+    it("it should not escape SafeString properties", function() {
+      var name = new Handlebars.SafeString("<em>Sean O&#x27;Malley</em>");
+ 
+      shouldCompileTo('{{name}}', [{ name: name }], "<em>Sean O&#x27;Malley</em>");
+    });
+  });
+ 
+  describe('#escapeExpression', function() {
+    it('shouhld escape html', function() {
+      equals(Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo&lt;&amp;&quot;&#x27;&gt;');
+    });
+    it('should not escape SafeString', function() {
+      var string = new Handlebars.SafeString('foo<&"\'>');
+      equals(Handlebars.Utils.escapeExpression(string), 'foo<&"\'>');
+ 
+    });
+    it('should handle falsy', function() {
+      equals(Handlebars.Utils.escapeExpression(''), '');
+      equals(Handlebars.Utils.escapeExpression(undefined), '');
+      equals(Handlebars.Utils.escapeExpression(null), '');
+      equals(Handlebars.Utils.escapeExpression(false), '');
+ 
+      equals(Handlebars.Utils.escapeExpression(0), '0');
+    });
+    it('should handle empty objects', function() {
+      equals(Handlebars.Utils.escapeExpression({}), {}.toString());
+      equals(Handlebars.Utils.escapeExpression([]), [].toString());
+    });
+  });
+ 
+  describe('#isEmpty', function() {
+    it('should not be empty', function() {
+      equals(Handlebars.Utils.isEmpty(undefined), true);
+      equals(Handlebars.Utils.isEmpty(null), true);
+      equals(Handlebars.Utils.isEmpty(false), true);
+      equals(Handlebars.Utils.isEmpty(''), true);
+      equals(Handlebars.Utils.isEmpty([]), true);
+    });
+ 
+    it('should be empty', function() {
+      equals(Handlebars.Utils.isEmpty(0), false);
+      equals(Handlebars.Utils.isEmpty([1]), false);
+      equals(Handlebars.Utils.isEmpty('foo'), false);
+      equals(Handlebars.Utils.isEmpty({bar: 1}), false);
+    });
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov-report/spec/whitespace-control.js.html b/node_modules/handlebars/coverage/lcov-report/spec/whitespace-control.js.html new file mode 100644 index 0000000..2d3df6c --- /dev/null +++ b/node_modules/handlebars/coverage/lcov-report/spec/whitespace-control.js.html @@ -0,0 +1,508 @@ + + + + Code coverage report for spec/whitespace-control.js + + + + + + + +
+

Code coverage report for spec/whitespace-control.js

+

+ + Statements: 19.51% (8 / 41)      + + + Branches: 100% (0 / 0)      + + + Functions: 25% (2 / 8)      + + + Lines: 19.51% (8 / 41)      + + Ignored: none      +

+
All files » spec/ » whitespace-control.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +633 +3 +  +  +  +  +  +  +  +  +  +  +3 +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +3 +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3 +  +  +  +  +  +3 +  +  +  +  +  + 
describe('whitespace control', function() {
+  it('should strip whitespace around mustache calls', function() {
+    var hash = {foo: 'bar<'};
+ 
+    shouldCompileTo(' {{~foo~}} ', hash, 'bar&lt;');
+    shouldCompileTo(' {{~foo}} ', hash, 'bar&lt; ');
+    shouldCompileTo(' {{foo~}} ', hash, ' bar&lt;');
+ 
+    shouldCompileTo(' {{~&foo~}} ', hash, 'bar<');
+    shouldCompileTo(' {{~{foo}~}} ', hash, 'bar<');
+  });
+ 
+  describe('blocks', function() {
+    it('should strip whitespace around simple block calls', function() {
+      var hash = {foo: 'bar<'};
+ 
+      shouldCompileTo(' {{~#if foo~}} bar {{~/if~}} ', hash, 'bar');
+      shouldCompileTo(' {{#if foo~}} bar {{/if~}} ', hash, ' bar ');
+      shouldCompileTo(' {{~#if foo}} bar {{~/if}} ', hash, ' bar ');
+      shouldCompileTo(' {{#if foo}} bar {{/if}} ', hash, '  bar  ');
+    });
+    it('should strip whitespace around inverse block calls', function() {
+      var hash = {};
+ 
+      shouldCompileTo(' {{~^if foo~}} bar {{~/if~}} ', hash, 'bar');
+      shouldCompileTo(' {{^if foo~}} bar {{/if~}} ', hash, ' bar ');
+      shouldCompileTo(' {{~^if foo}} bar {{~/if}} ', hash, ' bar ');
+      shouldCompileTo(' {{^if foo}} bar {{/if}} ', hash, '  bar  ');
+    });
+    it('should strip whitespace around complex block calls', function() {
+      var hash = {foo: 'bar<'};
+ 
+      shouldCompileTo('{{#if foo~}} bar {{~^~}} baz {{~/if}}', hash, 'bar');
+      shouldCompileTo('{{#if foo~}} bar {{^~}} baz {{/if}}', hash, 'bar ');
+      shouldCompileTo('{{#if foo}} bar {{~^~}} baz {{~/if}}', hash, ' bar');
+      shouldCompileTo('{{#if foo}} bar {{^~}} baz {{/if}}', hash, ' bar ');
+ 
+      shouldCompileTo('{{#if foo~}} bar {{~else~}} baz {{~/if}}', hash, 'bar');
+ 
+      hash = {};
+ 
+      shouldCompileTo('{{#if foo~}} bar {{~^~}} baz {{~/if}}', hash, 'baz');
+      shouldCompileTo('{{#if foo}} bar {{~^~}} baz {{/if}}', hash, 'baz ');
+      shouldCompileTo('{{#if foo~}} bar {{~^}} baz {{~/if}}', hash, ' baz');
+      shouldCompileTo('{{#if foo~}} bar {{~^}} baz {{/if}}', hash, ' baz ');
+ 
+      shouldCompileTo('{{#if foo~}} bar {{~else~}} baz {{~/if}}', hash, 'baz');
+    });
+  });
+ 
+  it('should strip whitespace around partials', function() {
+    shouldCompileToWithPartials('foo {{~> dude~}} ', [{}, {}, {dude: 'bar'}], true, 'foobar');
+    shouldCompileToWithPartials('foo {{> dude~}} ', [{}, {}, {dude: 'bar'}], true, 'foo bar');
+    shouldCompileToWithPartials('foo {{> dude}} ', [{}, {}, {dude: 'bar'}], true, 'foo bar ');
+  });
+ 
+  it('should only strip whitespace once', function() {
+    var hash = {foo: 'bar'};
+ 
+    shouldCompileTo(' {{~foo~}} {{foo}} {{foo}} ', hash, 'barbar bar ');
+  });
+});
+ 
+ +
+ + + + + + + + diff --git a/node_modules/handlebars/coverage/lcov.info b/node_modules/handlebars/coverage/lcov.info new file mode 100644 index 0000000..b26981d --- /dev/null +++ b/node_modules/handlebars/coverage/lcov.info @@ -0,0 +1,3181 @@ +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/lib/index.js +FN:19,(anonymous_1) +FNF:1 +FNH:1 +FNDA:2,(anonymous_1) +DA:6,1 +DA:8,1 +DA:10,1 +DA:11,1 +DA:12,1 +DA:14,1 +DA:18,1 +DA:19,1 +DA:20,2 +DA:21,2 +DA:22,2 +DA:24,1 +DA:25,1 +LF:13 +LH:13 +BRDA:18,1,0,1 +BRDA:18,1,1,0 +BRDA:18,2,0,1 +BRDA:18,2,1,1 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars.js +FN:15,(anonymous_1) +FN:18,(anonymous_2) +FN:21,(anonymous_3) +FNF:3 +FNH:3 +FNDA:504,(anonymous_1) +FNDA:82,(anonymous_2) +FNDA:409,(anonymous_3) +DA:3,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:10,1 +DA:11,1 +DA:12,1 +DA:14,1 +DA:15,1 +DA:16,504 +DA:18,504 +DA:19,82 +DA:21,504 +DA:22,409 +DA:25,504 +DA:26,504 +DA:27,504 +DA:28,504 +DA:29,504 +DA:31,504 +DA:34,1 +DA:35,1 +DA:37,1 +DA:39,1 +LF:25 +LH:25 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars.runtime.js +FN:13,(anonymous_1) +FN:23,(anonymous_2) +FNF:2 +FNH:2 +FNDA:505,(anonymous_1) +FNDA:474,(anonymous_2) +DA:3,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:10,1 +DA:13,1 +DA:14,505 +DA:16,505 +DA:17,505 +DA:18,505 +DA:19,505 +DA:20,505 +DA:22,505 +DA:23,505 +DA:24,474 +DA:27,505 +DA:30,1 +DA:31,1 +DA:33,1 +DA:35,1 +LF:20 +LH:20 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/base.js +FN:22,HandlebarsEnvironment +FN:35,(anonymous_2) +FN:43,(anonymous_3) +FN:47,(anonymous_4) +FN:54,(anonymous_5) +FN:59,registerDefaultHelpers +FN:60,(anonymous_7) +FN:70,(anonymous_8) +FN:99,(anonymous_9) +FN:158,(anonymous_10) +FN:171,(anonymous_11) +FN:175,(anonymous_12) +FN:193,(anonymous_13) +FN:198,(anonymous_14) +FN:214,(anonymous_15) +FN:226,(anonymous_16) +FNF:16 +FNH:16 +FNDA:505,HandlebarsEnvironment +FNDA:4059,(anonymous_2) +FNDA:1,(anonymous_3) +FNDA:2,(anonymous_4) +FNDA:1,(anonymous_5) +FNDA:505,registerDefaultHelpers +FNDA:24,(anonymous_7) +FNDA:145,(anonymous_8) +FNDA:83,(anonymous_9) +FNDA:83,(anonymous_10) +FNDA:2,(anonymous_11) +FNDA:9,(anonymous_12) +FNDA:5,(anonymous_13) +FNDA:4,(anonymous_14) +FNDA:3,(anonymous_15) +FNDA:109,(anonymous_16) +DA:2,1 +DA:3,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:16,1 +DA:17,1 +DA:22,1 +DA:23,505 +DA:24,505 +DA:26,505 +DA:29,1 +DA:36,4059 +DA:37,2 +DA:38,1 +DA:40,4057 +DA:44,1 +DA:48,2 +DA:49,1 +DA:51,1 +DA:55,1 +DA:59,1 +DA:60,505 +DA:61,24 +DA:63,23 +DA:66,1 +DA:70,505 +DA:71,145 +DA:74,145 +DA:75,26 +DA:76,119 +DA:77,40 +DA:78,79 +DA:79,57 +DA:80,49 +DA:81,1 +DA:84,49 +DA:86,8 +DA:89,22 +DA:90,3 +DA:91,3 +DA:92,3 +DA:95,22 +DA:99,505 +DA:100,83 +DA:101,1 +DA:104,82 +DA:105,82 +DA:107,82 +DA:108,82 +DA:109,5 +DA:112,82 +DA:114,82 +DA:115,76 +DA:118,82 +DA:119,81 +DA:120,75 +DA:121,173 +DA:122,160 +DA:123,160 +DA:124,160 +DA:126,160 +DA:127,5 +DA:130,173 +DA:133,6 +DA:134,13 +DA:135,12 +DA:136,10 +DA:137,10 +DA:138,10 +DA:140,10 +DA:141,3 +DA:144,12 +DA:145,12 +DA:151,82 +DA:152,4 +DA:155,82 +DA:158,505 +DA:159,83 +DA:164,83 +DA:165,44 +DA:167,39 +DA:171,505 +DA:172,2 +DA:175,505 +DA:176,9 +DA:178,9 +DA:180,9 +DA:181,8 +DA:182,3 +DA:183,3 +DA:184,3 +DA:187,8 +DA:189,1 +DA:193,505 +DA:194,5 +DA:195,5 +DA:198,505 +DA:199,4 +DA:203,1 +DA:215,3 +DA:216,2 +DA:217,2 +DA:218,1 +DA:223,1 +DA:224,1 +DA:225,1 +DA:226,1 +DA:227,109 +DA:228,109 +DA:229,109 +DA:231,1 +LF:113 +LH:113 +BRDA:23,1,0,505 +BRDA:23,1,1,505 +BRDA:24,2,0,505 +BRDA:24,2,1,505 +BRDA:36,3,0,2 +BRDA:36,3,1,4057 +BRDA:37,4,0,1 +BRDA:37,4,1,1 +BRDA:48,5,0,1 +BRDA:48,5,1,1 +BRDA:61,6,0,23 +BRDA:61,6,1,1 +BRDA:74,7,0,26 +BRDA:74,7,1,119 +BRDA:76,8,0,40 +BRDA:76,8,1,79 +BRDA:76,9,0,119 +BRDA:76,9,1,93 +BRDA:78,10,0,57 +BRDA:78,10,1,22 +BRDA:79,11,0,49 +BRDA:79,11,1,8 +BRDA:80,12,0,1 +BRDA:80,12,1,48 +BRDA:89,13,0,3 +BRDA:89,13,1,19 +BRDA:89,14,0,22 +BRDA:89,14,1,22 +BRDA:100,15,0,1 +BRDA:100,15,1,82 +BRDA:108,16,0,5 +BRDA:108,16,1,77 +BRDA:108,17,0,82 +BRDA:108,17,1,76 +BRDA:112,18,0,1 +BRDA:112,18,1,81 +BRDA:114,19,0,76 +BRDA:114,19,1,6 +BRDA:118,20,0,81 +BRDA:118,20,1,1 +BRDA:118,21,0,82 +BRDA:118,21,1,81 +BRDA:119,22,0,75 +BRDA:119,22,1,6 +BRDA:121,23,0,160 +BRDA:121,23,1,13 +BRDA:126,24,0,5 +BRDA:126,24,1,155 +BRDA:134,25,0,12 +BRDA:134,25,1,1 +BRDA:135,26,0,10 +BRDA:135,26,1,2 +BRDA:140,27,0,3 +BRDA:140,27,1,7 +BRDA:151,28,0,4 +BRDA:151,28,1,78 +BRDA:159,29,0,4 +BRDA:159,29,1,79 +BRDA:164,30,0,44 +BRDA:164,30,1,39 +BRDA:164,31,0,83 +BRDA:164,31,1,82 +BRDA:164,31,2,40 +BRDA:176,32,0,1 +BRDA:176,32,1,8 +BRDA:180,33,0,8 +BRDA:180,33,1,1 +BRDA:181,34,0,3 +BRDA:181,34,1,5 +BRDA:181,35,0,8 +BRDA:181,35,1,8 +BRDA:194,36,0,3 +BRDA:194,36,1,2 +BRDA:194,37,0,5 +BRDA:194,37,1,5 +BRDA:199,38,0,4 +BRDA:199,38,1,2 +BRDA:215,39,0,2 +BRDA:215,39,1,1 +BRDA:217,40,0,1 +BRDA:217,40,1,1 +BRDA:217,41,0,2 +BRDA:217,41,1,2 +BRF:83 +BRH:83 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/utils.js +FN:17,escapeChar +FN:21,extend +FN:37,(anonymous_3) +FN:43,(anonymous_4) +FN:50,(anonymous_5) +FN:55,escapeExpression +FN:74,isEmpty +FN:84,appendContextPath +FNF:8 +FNH:8 +FNDA:27,escapeChar +FNDA:933,extend +FNDA:175,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:534,escapeExpression +FNDA:58,isEmpty +FNDA:11,appendContextPath +DA:3,1 +DA:5,1 +DA:14,1 +DA:15,1 +DA:17,1 +DA:18,27 +DA:21,1 +DA:22,933 +DA:23,1249 +DA:24,6468 +DA:25,6467 +DA:30,933 +DA:33,1 +DA:34,1 +DA:37,1 +DA:38,175 +DA:42,1 +DA:43,1 +DA:44,1 +DA:47,1 +DA:48,1 +DA:50,1 +DA:51,1 +DA:53,1 +DA:55,1 +DA:57,534 +DA:58,11 +DA:59,523 +DA:60,29 +DA:61,494 +DA:62,19 +DA:68,475 +DA:70,475 +DA:71,9 +DA:74,1 +DA:75,58 +DA:76,5 +DA:77,53 +DA:78,2 +DA:80,51 +DA:84,1 +DA:85,11 +DA:88,1 +LF:43 +LH:43 +BRDA:24,1,0,6467 +BRDA:24,1,1,1 +BRDA:42,2,0,0 +BRDA:42,2,1,1 +BRDA:44,3,0,0 +BRDA:44,3,1,0 +BRDA:50,4,0,1 +BRDA:50,4,1,0 +BRDA:51,5,0,0 +BRDA:51,5,1,0 +BRDA:51,6,0,0 +BRDA:51,6,1,0 +BRDA:57,7,0,11 +BRDA:57,7,1,523 +BRDA:59,8,0,29 +BRDA:59,8,1,494 +BRDA:61,9,0,19 +BRDA:61,9,1,475 +BRDA:70,10,0,466 +BRDA:70,10,1,9 +BRDA:75,11,0,5 +BRDA:75,11,1,53 +BRDA:75,12,0,58 +BRDA:75,12,1,7 +BRDA:77,13,0,2 +BRDA:77,13,1,51 +BRDA:77,14,0,53 +BRDA:77,14,1,4 +BRDA:85,15,0,3 +BRDA:85,15,1,8 +BRF:30 +BRH:30 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/safe-string.js +FN:3,SafeString +FN:7,(anonymous_2) +FNF:2 +FNH:2 +FNDA:12,SafeString +FNDA:12,(anonymous_2) +DA:3,1 +DA:4,12 +DA:7,1 +DA:8,12 +DA:11,1 +LF:5 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/exception.js +FN:5,Exception +FNF:1 +FNH:1 +FNDA:48,Exception +DA:3,1 +DA:5,1 +DA:6,48 +DA:7,48 +DA:8,16 +DA:10,16 +DA:13,48 +DA:16,48 +DA:17,336 +DA:20,48 +DA:21,16 +DA:22,16 +DA:26,1 +DA:28,1 +LF:14 +LH:14 +BRDA:7,1,0,16 +BRDA:7,1,1,32 +BRDA:7,2,0,48 +BRDA:7,2,1,16 +BRDA:20,3,0,16 +BRDA:20,3,1,32 +BRF:6 +BRH:6 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/runtime.js +FN:8,checkRevision +FN:28,template +FN:41,(anonymous_3) +FN:73,(anonymous_4) +FN:81,(anonymous_5) +FN:88,(anonymous_6) +FN:93,(anonymous_7) +FN:104,(anonymous_8) +FN:110,(anonymous_9) +FN:124,(anonymous_10) +FN:141,(anonymous_11) +FN:154,(anonymous_12) +FN:164,program +FN:165,(anonymous_14) +FN:175,invokePartial +FN:185,noop +FN:187,initData +FNF:17 +FNH:17 +FNDA:470,checkRevision +FNDA:474,template +FNDA:55,(anonymous_3) +FNDA:175,(anonymous_4) +FNDA:138,(anonymous_5) +FNDA:345,(anonymous_6) +FNDA:345,(anonymous_7) +FNDA:4,(anonymous_8) +FNDA:512,(anonymous_9) +FNDA:480,(anonymous_10) +FNDA:482,(anonymous_11) +FNDA:4,(anonymous_12) +FNDA:347,program +FNDA:365,(anonymous_14) +FNDA:55,invokePartial +FNDA:62,noop +FNDA:462,initData +DA:2,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:6,1 +DA:8,1 +DA:9,470 +DA:12,470 +DA:13,3 +DA:14,2 +DA:16,2 +DA:20,1 +DA:26,1 +DA:28,1 +DA:30,474 +DA:31,1 +DA:33,474 +DA:34,3 +DA:39,471 +DA:41,468 +DA:42,55 +DA:43,2 +DA:46,55 +DA:48,53 +DA:49,39 +DA:50,39 +DA:51,39 +DA:53,53 +DA:54,52 +DA:55,8 +DA:56,8 +DA:57,18 +DA:58,6 +DA:61,12 +DA:63,8 +DA:65,52 +DA:67,1 +DA:72,468 +DA:74,175 +DA:75,175 +DA:76,261 +DA:77,170 +DA:82,138 +DA:89,345 +DA:94,345 +DA:96,345 +DA:97,340 +DA:98,5 +DA:99,4 +DA:101,345 +DA:105,4 +DA:106,6 +DA:108,4 +DA:111,512 +DA:113,512 +DA:114,313 +DA:117,512 +DA:124,468 +DA:125,480 +DA:126,480 +DA:128,480 +DA:129,480 +DA:130,462 +DA:132,480 +DA:133,480 +DA:134,141 +DA:137,480 +DA:139,468 +DA:141,468 +DA:142,482 +DA:143,471 +DA:145,471 +DA:146,41 +DA:149,11 +DA:150,11 +DA:154,468 +DA:155,4 +DA:156,1 +DA:159,3 +DA:161,468 +DA:164,1 +DA:165,347 +DA:166,365 +DA:168,365 +DA:170,347 +DA:171,347 +DA:172,347 +DA:175,1 +DA:176,55 +DA:178,55 +DA:179,2 +DA:180,53 +DA:181,13 +DA:185,62 +DA:187,1 +DA:188,462 +DA:189,424 +DA:190,424 +DA:192,462 +LF:99 +LH:99 +BRDA:9,1,0,470 +BRDA:9,1,1,469 +BRDA:9,1,2,1 +BRDA:12,2,0,3 +BRDA:12,2,1,467 +BRDA:13,3,0,2 +BRDA:13,3,1,1 +BRDA:30,4,0,0 +BRDA:30,4,1,474 +BRDA:33,5,0,3 +BRDA:33,5,1,471 +BRDA:33,6,0,474 +BRDA:33,6,1,472 +BRDA:42,7,0,2 +BRDA:42,7,1,53 +BRDA:48,8,0,39 +BRDA:48,8,1,14 +BRDA:48,9,0,53 +BRDA:48,9,1,40 +BRDA:53,10,0,52 +BRDA:53,10,1,1 +BRDA:54,11,0,8 +BRDA:54,11,1,44 +BRDA:57,12,0,6 +BRDA:57,12,1,12 +BRDA:57,13,0,18 +BRDA:57,13,1,6 +BRDA:76,14,0,170 +BRDA:76,14,1,91 +BRDA:76,15,0,261 +BRDA:76,15,1,261 +BRDA:82,16,0,3 +BRDA:82,16,1,135 +BRDA:96,17,0,340 +BRDA:96,17,1,5 +BRDA:96,18,0,345 +BRDA:96,18,1,6 +BRDA:98,19,0,4 +BRDA:98,19,1,1 +BRDA:105,20,0,10 +BRDA:105,20,1,10 +BRDA:111,21,0,512 +BRDA:111,21,1,197 +BRDA:113,22,0,313 +BRDA:113,22,1,199 +BRDA:113,23,0,512 +BRDA:113,23,1,315 +BRDA:113,23,2,315 +BRDA:125,24,0,480 +BRDA:125,24,1,174 +BRDA:129,25,0,462 +BRDA:129,25,1,18 +BRDA:129,26,0,480 +BRDA:129,26,1,469 +BRDA:133,27,0,141 +BRDA:133,27,1,339 +BRDA:134,28,0,15 +BRDA:134,28,1,126 +BRDA:142,29,0,471 +BRDA:142,29,1,11 +BRDA:145,30,0,41 +BRDA:145,30,1,430 +BRDA:155,31,0,1 +BRDA:155,31,1,3 +BRDA:155,32,0,4 +BRDA:155,32,1,2 +BRDA:166,33,0,365 +BRDA:166,33,1,147 +BRDA:168,34,0,365 +BRDA:168,34,1,162 +BRDA:168,35,0,365 +BRDA:168,35,1,152 +BRDA:171,36,0,122 +BRDA:171,36,1,225 +BRDA:178,37,0,2 +BRDA:178,37,1,53 +BRDA:180,38,0,13 +BRDA:180,38,1,40 +BRDA:188,39,0,424 +BRDA:188,39,1,38 +BRDA:188,40,0,462 +BRDA:188,40,1,59 +BRDA:189,41,0,21 +BRDA:189,41,1,403 +BRF:84 +BRH:84 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/ast.js +FN:4,LocationInfo +FN:13,(anonymous_2) +FN:20,(anonymous_3) +FN:49,(anonymous_4) +FN:72,(anonymous_5) +FN:83,(anonymous_6) +FN:97,(anonymous_7) +FN:111,(anonymous_8) +FN:117,(anonymous_9) +FN:123,(anonymous_10) +FN:163,(anonymous_11) +FN:169,(anonymous_12) +FN:177,(anonymous_13) +FN:185,(anonymous_14) +FN:193,(anonymous_15) +FN:200,(anonymous_16) +FNF:16 +FNH:16 +FNDA:10460,LocationInfo +FNDA:1700,(anonymous_2) +FNDA:1588,(anonymous_3) +FNDA:1644,(anonymous_4) +FNDA:96,(anonymous_5) +FNDA:602,(anonymous_6) +FNDA:5,(anonymous_7) +FNDA:1617,(anonymous_8) +FNDA:75,(anonymous_9) +FNDA:2756,(anonymous_10) +FNDA:96,(anonymous_11) +FNDA:75,(anonymous_12) +FNDA:58,(anonymous_13) +FNDA:56,(anonymous_14) +FNDA:55,(anonymous_15) +FNDA:37,(anonymous_16) +DA:2,1 +DA:4,1 +DA:5,10460 +DA:6,10460 +DA:7,10460 +DA:8,10460 +DA:9,10460 +DA:12,1 +DA:14,1700 +DA:15,1700 +DA:16,1700 +DA:17,1700 +DA:21,1588 +DA:22,1588 +DA:23,1588 +DA:26,1588 +DA:28,1584 +DA:29,1584 +DA:31,4 +DA:34,1588 +DA:35,1569 +DA:38,19 +DA:42,1588 +DA:43,1588 +DA:44,1588 +DA:45,1588 +DA:46,1588 +DA:50,1644 +DA:52,1644 +DA:53,1644 +DA:55,1644 +DA:56,1644 +DA:61,1644 +DA:65,1644 +DA:73,96 +DA:74,96 +DA:75,96 +DA:76,96 +DA:77,96 +DA:78,96 +DA:80,96 +DA:84,602 +DA:86,602 +DA:87,602 +DA:88,602 +DA:89,602 +DA:90,602 +DA:92,602 +DA:93,80 +DA:98,5 +DA:100,5 +DA:101,1 +DA:104,4 +DA:106,4 +DA:107,4 +DA:108,4 +DA:112,1617 +DA:113,1617 +DA:114,1617 +DA:118,75 +DA:119,75 +DA:120,75 +DA:124,2756 +DA:125,2756 +DA:127,2756 +DA:132,2756 +DA:133,3091 +DA:134,3091 +DA:136,3091 +DA:137,163 +DA:138,11 +DA:139,152 +DA:140,67 +DA:141,67 +DA:143,85 +DA:146,2928 +DA:150,2745 +DA:151,2745 +DA:152,2745 +DA:153,2745 +DA:154,2745 +DA:158,2745 +DA:160,2745 +DA:164,96 +DA:165,96 +DA:166,96 +DA:170,75 +DA:171,75 +DA:172,75 +DA:173,75 +DA:174,75 +DA:178,58 +DA:179,58 +DA:180,58 +DA:186,56 +DA:187,56 +DA:188,56 +DA:190,56 +DA:194,55 +DA:195,55 +DA:196,55 +DA:197,55 +DA:201,37 +DA:202,37 +DA:203,37 +DA:205,37 +DA:214,1 +LF:107 +LH:107 +BRDA:5,1,0,10460 +BRDA:5,1,1,47 +BRDA:26,2,0,1584 +BRDA:26,2,1,4 +BRDA:26,3,0,1588 +BRDA:26,3,1,1587 +BRDA:28,4,0,1584 +BRDA:28,4,1,1554 +BRDA:29,5,0,1584 +BRDA:29,5,1,1544 +BRDA:34,6,0,1569 +BRDA:34,6,1,19 +BRDA:61,7,0,1644 +BRDA:61,7,1,1225 +BRDA:65,8,0,1644 +BRDA:65,8,1,1159 +BRDA:92,9,0,80 +BRDA:92,9,1,522 +BRDA:92,10,0,602 +BRDA:92,10,1,143 +BRDA:100,11,0,1 +BRDA:100,11,1,4 +BRDA:134,12,0,3091 +BRDA:134,12,1,2758 +BRDA:136,13,0,163 +BRDA:136,13,1,2928 +BRDA:136,14,0,3091 +BRDA:136,14,1,3019 +BRDA:136,14,2,2960 +BRDA:137,15,0,11 +BRDA:137,15,1,152 +BRDA:139,16,0,67 +BRDA:139,16,1,85 +BRDA:158,17,0,2745 +BRDA:158,17,1,2478 +BRDA:158,17,2,2416 +BRF:36 +BRH:36 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/base.js +FN:12,parse +FNF:1 +FNH:1 +FNDA:1052,parse +DA:2,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:7,1 +DA:9,1 +DA:10,1 +DA:12,1 +DA:14,1052 +DA:16,1049 +DA:18,1049 +DA:21,1 +LF:12 +LH:12 +BRDA:14,1,0,3 +BRDA:14,1,1,1049 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/parser.js +FN:5,(anonymous_1) +FN:6,trace +FN:11,anonymous +FN:105,parseError +FN:108,parse +FN:121,popStack +FN:126,lex +FN:213,(anonymous_8) +FN:215,parseError +FN:222,(anonymous_10) +FN:233,(anonymous_11) +FN:252,(anonymous_12) +FN:280,(anonymous_13) +FN:284,(anonymous_14) +FN:287,(anonymous_15) +FN:291,(anonymous_16) +FN:298,(anonymous_17) +FN:303,(anonymous_18) +FN:357,lex +FN:365,begin +FN:368,popState +FN:371,_currentRules +FN:374,(anonymous_23) +FN:377,begin +FN:381,anonymous +FN:384,strip +FN:497,Parser +FNF:27 +FNH:27 +FNDA:1,(anonymous_1) +FNDA:0,trace +FNDA:26939,anonymous +FNDA:12,parseError +FNDA:1049,parse +FNDA:0,popStack +FNDA:11342,lex +FNDA:1,(anonymous_8) +FNDA:0,parseError +FNDA:1116,(anonymous_10) +FNDA:0,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) +FNDA:0,(anonymous_14) +FNDA:12,(anonymous_15) +FNDA:12,(anonymous_16) +FNDA:12,(anonymous_17) +FNDA:13951,(anonymous_18) +FNDA:13951,lex +FNDA:2483,begin +FNDA:2474,popState +FNDA:13951,_currentRules +FNDA:0,(anonymous_23) +FNDA:0,begin +FNDA:13951,anonymous +FNDA:141,strip +FNDA:1,Parser +DA:5,1 +DA:6,1 +DA:13,26939 +DA:14,26939 +DA:15,1026 +DA:16,1 +DA:17,1692 +DA:18,1692 +DA:19,952 +DA:20,952 +DA:21,601 +DA:22,601 +DA:23,4 +DA:24,4 +DA:25,95 +DA:26,95 +DA:27,1609 +DA:28,1609 +DA:29,36 +DA:30,36 +DA:31,5 +DA:32,4 +DA:33,5 +DA:34,5 +DA:35,523 +DA:36,521 +DA:37,80 +DA:38,80 +DA:39,531 +DA:40,531 +DA:41,80 +DA:42,80 +DA:43,62 +DA:44,62 +DA:45,603 +DA:46,603 +DA:47,914 +DA:48,914 +DA:49,38 +DA:50,38 +DA:51,6 +DA:52,6 +DA:53,89 +DA:54,89 +DA:55,1584 +DA:56,1584 +DA:57,40 +DA:58,40 +DA:59,390 +DA:60,390 +DA:61,55 +DA:62,55 +DA:63,53 +DA:64,53 +DA:65,54 +DA:66,54 +DA:67,34 +DA:68,34 +DA:69,52 +DA:70,52 +DA:71,74 +DA:72,74 +DA:73,119 +DA:74,119 +DA:75,91 +DA:76,91 +DA:77,2 +DA:78,2 +DA:79,2 +DA:80,2 +DA:81,74 +DA:82,74 +DA:83,2752 +DA:84,2744 +DA:85,341 +DA:86,341 +DA:87,2752 +DA:88,2752 +DA:89,1722 +DA:90,1722 +DA:91,3297 +DA:92,3297 +DA:93,1586 +DA:94,1586 +DA:95,513 +DA:96,513 +DA:97,74 +DA:98,74 +DA:99,45 +DA:100,45 +DA:106,12 +DA:109,1049 +DA:110,1049 +DA:111,1049 +DA:112,1049 +DA:113,1049 +DA:114,1049 +DA:115,1 +DA:116,1049 +DA:117,1049 +DA:118,1049 +DA:119,1049 +DA:120,1 +DA:121,1 +DA:122,1 +DA:123,1 +DA:124,1 +DA:126,1 +DA:127,11342 +DA:128,11342 +DA:129,11342 +DA:130,7 +DA:132,11342 +DA:134,1049 +DA:135,1049 +DA:136,38270 +DA:137,38270 +DA:138,1159 +DA:140,37111 +DA:141,11342 +DA:143,37111 +DA:145,38270 +DA:146,12 +DA:147,12 +DA:148,12 +DA:149,12 +DA:150,82 +DA:151,82 +DA:153,12 +DA:154,12 +DA:156,1 +DA:158,12 +DA:161,38258 +DA:162,1 +DA:164,38258 +DA:166,11319 +DA:167,11319 +DA:168,11319 +DA:169,11319 +DA:170,11319 +DA:171,11319 +DA:172,11319 +DA:173,11319 +DA:174,11319 +DA:175,11319 +DA:176,11319 +DA:177,1 +DA:179,1 +DA:180,1 +DA:182,11319 +DA:184,26939 +DA:185,26939 +DA:186,26939 +DA:187,26939 +DA:188,1 +DA:190,26939 +DA:191,26928 +DA:192,1026 +DA:194,25902 +DA:195,20448 +DA:196,20448 +DA:197,20448 +DA:199,25902 +DA:200,25902 +DA:201,25902 +DA:202,25902 +DA:203,25902 +DA:204,25902 +DA:206,1 +DA:209,1 +DA:213,1 +DA:214,1 +DA:216,1 +DA:217,1 +DA:219,1 +DA:223,1116 +DA:224,1116 +DA:225,1116 +DA:226,1116 +DA:227,1116 +DA:228,1116 +DA:229,1116 +DA:230,1116 +DA:231,1116 +DA:234,1 +DA:235,1 +DA:236,1 +DA:237,1 +DA:238,1 +DA:239,1 +DA:240,1 +DA:241,1 +DA:242,1 +DA:243,1 +DA:245,1 +DA:247,1 +DA:249,1 +DA:250,1 +DA:253,1 +DA:254,1 +DA:256,1 +DA:257,1 +DA:259,1 +DA:260,1 +DA:261,1 +DA:262,1 +DA:264,1 +DA:265,1 +DA:267,1 +DA:275,1 +DA:276,1 +DA:278,1 +DA:281,1 +DA:282,1 +DA:285,1 +DA:288,12 +DA:289,12 +DA:292,12 +DA:293,12 +DA:294,12 +DA:296,12 +DA:299,12 +DA:300,12 +DA:301,12 +DA:304,13951 +DA:305,1 +DA:307,13951 +DA:309,13951 +DA:315,13951 +DA:316,13951 +DA:317,13951 +DA:319,13951 +DA:320,13951 +DA:321,221226 +DA:322,221226 +DA:323,13951 +DA:324,13951 +DA:325,13951 +DA:328,13951 +DA:329,13951 +DA:330,13951 +DA:331,13951 +DA:335,13951 +DA:336,13951 +DA:337,13951 +DA:338,13951 +DA:339,13951 +DA:340,1 +DA:342,13951 +DA:343,13951 +DA:344,13951 +DA:345,13951 +DA:346,13951 +DA:347,13951 +DA:348,2151 +DA:350,1 +DA:351,1 +DA:353,1 +DA:358,13951 +DA:359,13951 +DA:360,11800 +DA:362,2151 +DA:366,2483 +DA:369,2474 +DA:372,13951 +DA:375,1 +DA:378,1 +DA:380,1 +DA:381,1 +DA:384,1 +DA:385,141 +DA:389,13951 +DA:390,13951 +DA:392,2476 +DA:393,10 +DA:394,10 +DA:395,2466 +DA:396,10 +DA:397,10 +DA:399,2456 +DA:401,2476 +DA:403,1275 +DA:404,426 +DA:405,1 +DA:407,10 +DA:408,10 +DA:410,1 +DA:412,5 +DA:413,5 +DA:414,5 +DA:416,1 +DA:417,5 +DA:418,1 +DA:419,2 +DA:420,1 +DA:421,62 +DA:422,1 +DA:423,62 +DA:424,1 +DA:425,5 +DA:426,1 +DA:428,5 +DA:429,5 +DA:430,5 +DA:432,1 +DA:433,100 +DA:434,1 +DA:435,532 +DA:436,1 +DA:437,604 +DA:438,1 +DA:439,44 +DA:440,1 +DA:441,22 +DA:442,1 +DA:443,81 +DA:444,1 +DA:445,1 +DA:446,1 +DA:447,42 +DA:448,1 +DA:449,23 +DA:450,1 +DA:451,2 +DA:452,2 +DA:453,37 +DA:454,1 +DA:455,973 +DA:456,1 +DA:457,131 +DA:458,1 +DA:459,73 +DA:460,1 +DA:461,59 +DA:462,1 +DA:463,355 +DA:464,1 +DA:466,874 +DA:467,42 +DA:468,1 +DA:469,2305 +DA:470,1 +DA:471,61 +DA:472,1 +DA:473,6 +DA:474,1 +DA:475,79 +DA:476,1 +DA:477,42 +DA:478,1 +DA:479,18 +DA:480,1 +DA:481,61 +DA:482,1 +DA:483,3208 +DA:484,1 +DA:485,15 +DA:486,1 +DA:487,9 +DA:488,1 +DA:489,1094 +DA:490,1 +DA:493,1 +DA:494,1 +DA:495,1 +DA:496,1 +DA:497,1 +DA:498,1 +DA:499,1 +LF:369 +LH:369 +BRDA:14,1,0,1026 +BRDA:14,1,1,1692 +BRDA:14,1,2,952 +BRDA:14,1,3,601 +BRDA:14,1,4,4 +BRDA:14,1,5,95 +BRDA:14,1,6,1609 +BRDA:14,1,7,36 +BRDA:14,1,8,5 +BRDA:14,1,9,5 +BRDA:14,1,10,523 +BRDA:14,1,11,80 +BRDA:14,1,12,531 +BRDA:14,1,13,80 +BRDA:14,1,14,62 +BRDA:14,1,15,603 +BRDA:14,1,16,914 +BRDA:14,1,17,38 +BRDA:14,1,18,6 +BRDA:14,1,19,89 +BRDA:14,1,20,1584 +BRDA:14,1,21,40 +BRDA:14,1,22,390 +BRDA:14,1,23,55 +BRDA:14,1,24,53 +BRDA:14,1,25,54 +BRDA:14,1,26,34 +BRDA:14,1,27,52 +BRDA:14,1,28,74 +BRDA:14,1,29,119 +BRDA:14,1,30,91 +BRDA:14,1,31,2 +BRDA:14,1,32,2 +BRDA:14,1,33,74 +BRDA:14,1,34,2752 +BRDA:14,1,35,341 +BRDA:14,1,36,2752 +BRDA:14,1,37,1722 +BRDA:14,1,38,3297 +BRDA:14,1,39,1586 +BRDA:14,1,40,513 +BRDA:14,1,41,74 +BRDA:14,1,42,45 +BRDA:114,2,0,0 +BRDA:114,2,1,1049 +BRDA:118,3,0,1049 +BRDA:118,3,1,1049 +BRDA:119,4,0,0 +BRDA:119,4,1,1049 +BRDA:128,5,0,11342 +BRDA:128,5,1,0 +BRDA:129,6,0,7 +BRDA:129,6,1,11335 +BRDA:130,7,0,7 +BRDA:130,7,1,7 +BRDA:137,8,0,1159 +BRDA:137,8,1,37111 +BRDA:140,9,0,11342 +BRDA:140,9,1,25769 +BRDA:140,10,0,37111 +BRDA:140,10,1,26818 +BRDA:143,11,0,37111 +BRDA:143,11,1,37111 +BRDA:145,12,0,12 +BRDA:145,12,1,38258 +BRDA:145,13,0,38270 +BRDA:145,13,1,38258 +BRDA:145,13,2,38258 +BRDA:147,14,0,12 +BRDA:147,14,1,0 +BRDA:150,15,0,82 +BRDA:150,15,1,0 +BRDA:150,16,0,82 +BRDA:150,16,1,82 +BRDA:153,17,0,12 +BRDA:153,17,1,0 +BRDA:154,18,0,12 +BRDA:154,18,1,7 +BRDA:156,19,0,0 +BRDA:156,19,1,0 +BRDA:156,20,0,0 +BRDA:156,20,1,0 +BRDA:158,21,0,12 +BRDA:158,21,1,7 +BRDA:161,22,0,0 +BRDA:161,22,1,38258 +BRDA:161,23,0,38258 +BRDA:161,23,1,0 +BRDA:164,24,0,11319 +BRDA:164,24,1,26939 +BRDA:164,24,2,0 +BRDA:171,25,0,11319 +BRDA:171,25,1,0 +BRDA:176,26,0,0 +BRDA:176,26,1,11319 +BRDA:186,27,0,26939 +BRDA:186,27,1,5454 +BRDA:186,28,0,26939 +BRDA:186,28,1,5454 +BRDA:187,29,0,0 +BRDA:187,29,1,26939 +BRDA:188,30,0,0 +BRDA:188,30,1,0 +BRDA:191,31,0,1026 +BRDA:191,31,1,25902 +BRDA:194,32,0,20448 +BRDA:194,32,1,5454 +BRDA:216,33,0,0 +BRDA:216,33,1,0 +BRDA:229,34,0,0 +BRDA:229,34,1,1116 +BRDA:241,35,0,0 +BRDA:241,35,1,0 +BRDA:247,36,0,0 +BRDA:247,36,1,0 +BRDA:264,37,0,0 +BRDA:264,37,1,0 +BRDA:270,38,0,0 +BRDA:270,38,1,0 +BRDA:271,39,0,0 +BRDA:271,39,1,0 +BRDA:275,40,0,0 +BRDA:275,40,1,0 +BRDA:289,41,0,0 +BRDA:289,41,1,12 +BRDA:293,42,0,12 +BRDA:293,42,1,0 +BRDA:296,43,0,0 +BRDA:296,43,1,12 +BRDA:304,44,0,0 +BRDA:304,44,1,13951 +BRDA:307,45,0,1094 +BRDA:307,45,1,12857 +BRDA:315,46,0,13951 +BRDA:315,46,1,0 +BRDA:322,47,0,13951 +BRDA:322,47,1,207275 +BRDA:322,48,0,221226 +BRDA:322,48,1,13951 +BRDA:322,48,2,0 +BRDA:325,49,0,13951 +BRDA:325,49,1,0 +BRDA:328,50,0,13951 +BRDA:328,50,1,0 +BRDA:330,51,0,370 +BRDA:330,51,1,13581 +BRDA:334,52,0,370 +BRDA:334,52,1,13581 +BRDA:339,53,0,0 +BRDA:339,53,1,13951 +BRDA:346,54,0,0 +BRDA:346,54,1,13951 +BRDA:346,55,0,13951 +BRDA:346,55,1,1094 +BRDA:347,56,0,11800 +BRDA:347,56,1,2151 +BRDA:350,57,0,0 +BRDA:350,57,1,0 +BRDA:359,58,0,11800 +BRDA:359,58,1,2151 +BRDA:390,59,0,2476 +BRDA:390,59,1,426 +BRDA:390,59,2,10 +BRDA:390,59,3,5 +BRDA:390,59,4,5 +BRDA:390,59,5,2 +BRDA:390,59,6,62 +BRDA:390,59,7,62 +BRDA:390,59,8,5 +BRDA:390,59,9,5 +BRDA:390,59,10,100 +BRDA:390,59,11,532 +BRDA:390,59,12,604 +BRDA:390,59,13,44 +BRDA:390,59,14,22 +BRDA:390,59,15,81 +BRDA:390,59,16,1 +BRDA:390,59,17,42 +BRDA:390,59,18,23 +BRDA:390,59,19,2 +BRDA:390,59,20,37 +BRDA:390,59,21,973 +BRDA:390,59,22,131 +BRDA:390,59,23,73 +BRDA:390,59,24,59 +BRDA:390,59,25,355 +BRDA:390,59,26,874 +BRDA:390,59,27,42 +BRDA:390,59,28,2305 +BRDA:390,59,29,61 +BRDA:390,59,30,6 +BRDA:390,59,31,79 +BRDA:390,59,32,42 +BRDA:390,59,33,18 +BRDA:390,59,34,61 +BRDA:390,59,35,3208 +BRDA:390,59,36,15 +BRDA:390,59,37,9 +BRDA:390,59,38,1094 +BRDA:392,60,0,10 +BRDA:392,60,1,2466 +BRDA:395,61,0,10 +BRDA:395,61,1,2456 +BRDA:401,62,0,1201 +BRDA:401,62,1,1275 +BRF:205 +BRH:205 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/helpers.js +FN:4,stripFlags +FN:12,prepareBlock +FN:68,prepareProgram +FN:118,isPrevWhitespace +FN:135,isNextWhitespace +FN:158,omitRight +FN:176,omitLeft +FNF:7 +FNH:7 +FNDA:2323,stripFlags +FNDA:603,prepareBlock +FNDA:2718,prepareProgram +FNDA:3514,isPrevWhitespace +FNDA:3469,isNextWhitespace +FNDA:432,omitRight +FNDA:422,omitLeft +DA:2,1 +DA:4,1 +DA:5,2323 +DA:11,1 +DA:12,1 +DA:14,603 +DA:15,2 +DA:18,601 +DA:20,601 +DA:30,601 +DA:31,34 +DA:34,601 +DA:35,62 +DA:37,62 +DA:38,22 +DA:40,62 +DA:41,22 +DA:43,62 +DA:44,18 +DA:48,62 +DA:51,17 +DA:52,17 +DA:55,539 +DA:56,14 +DA:60,601 +DA:61,80 +DA:63,521 +DA:67,1 +DA:68,1 +DA:69,2718 +DA:70,5434 +DA:73,5434 +DA:74,2583 +DA:77,2851 +DA:84,2851 +DA:85,72 +DA:87,2851 +DA:88,64 +DA:91,2851 +DA:92,63 +DA:94,63 +DA:96,20 +DA:97,11 +DA:101,2851 +DA:102,109 +DA:105,109 +DA:107,2851 +DA:109,115 +DA:111,115 +DA:115,2718 +DA:118,1 +DA:119,3514 +DA:120,663 +DA:125,3514 +DA:127,3514 +DA:128,1480 +DA:131,2034 +DA:132,1712 +DA:135,1 +DA:136,3469 +DA:137,618 +DA:140,3469 +DA:142,3469 +DA:143,1401 +DA:146,2068 +DA:147,1729 +DA:158,1 +DA:159,432 +DA:160,432 +DA:161,150 +DA:164,282 +DA:165,282 +DA:166,282 +DA:176,1 +DA:177,422 +DA:178,422 +DA:179,90 +DA:183,332 +DA:184,332 +DA:185,332 +DA:186,332 +LF:81 +LH:81 +BRDA:14,1,0,2 +BRDA:14,1,1,601 +BRDA:18,2,0,601 +BRDA:18,2,1,62 +BRDA:27,3,0,601 +BRDA:27,3,1,539 +BRDA:30,4,0,34 +BRDA:30,4,1,567 +BRDA:34,5,0,62 +BRDA:34,5,1,539 +BRDA:37,6,0,22 +BRDA:37,6,1,40 +BRDA:40,7,0,22 +BRDA:40,7,1,40 +BRDA:43,8,0,18 +BRDA:43,8,1,44 +BRDA:48,9,0,17 +BRDA:48,9,1,45 +BRDA:48,10,0,62 +BRDA:48,10,1,17 +BRDA:55,11,0,14 +BRDA:55,11,1,525 +BRDA:60,12,0,80 +BRDA:60,12,1,521 +BRDA:73,13,0,2583 +BRDA:73,13,1,2851 +BRDA:80,14,0,2851 +BRDA:80,14,1,143 +BRDA:81,15,0,2851 +BRDA:81,15,1,143 +BRDA:82,16,0,2851 +BRDA:82,16,1,236 +BRDA:82,16,2,73 +BRDA:84,17,0,72 +BRDA:84,17,1,2779 +BRDA:87,18,0,64 +BRDA:87,18,1,2787 +BRDA:91,19,0,63 +BRDA:91,19,1,2788 +BRDA:94,20,0,20 +BRDA:94,20,1,43 +BRDA:96,21,0,11 +BRDA:96,21,1,9 +BRDA:97,22,0,11 +BRDA:97,22,1,0 +BRDA:101,23,0,109 +BRDA:101,23,1,2742 +BRDA:102,24,0,109 +BRDA:102,24,1,28 +BRDA:107,25,0,115 +BRDA:107,25,1,2736 +BRDA:111,26,0,115 +BRDA:111,26,1,59 +BRDA:119,27,0,663 +BRDA:119,27,1,2851 +BRDA:127,28,0,1480 +BRDA:127,28,1,2034 +BRDA:131,29,0,1712 +BRDA:131,29,1,322 +BRDA:132,30,0,1353 +BRDA:132,30,1,359 +BRDA:132,31,0,1712 +BRDA:132,31,1,1125 +BRDA:136,32,0,618 +BRDA:136,32,1,2851 +BRDA:142,33,0,1401 +BRDA:142,33,1,2068 +BRDA:146,34,0,1729 +BRDA:146,34,1,339 +BRDA:147,35,0,1344 +BRDA:147,35,1,385 +BRDA:147,36,0,1729 +BRDA:147,36,1,1170 +BRDA:159,37,0,182 +BRDA:159,37,1,250 +BRDA:160,38,0,150 +BRDA:160,38,1,282 +BRDA:160,39,0,432 +BRDA:160,39,1,395 +BRDA:160,39,2,395 +BRDA:160,39,3,267 +BRDA:165,40,0,128 +BRDA:165,40,1,154 +BRDA:177,41,0,186 +BRDA:177,41,1,236 +BRDA:178,42,0,90 +BRDA:178,42,1,332 +BRDA:178,43,0,422 +BRDA:178,43,1,386 +BRDA:178,43,2,386 +BRDA:178,43,3,268 +BRDA:184,44,0,118 +BRDA:184,44,1,214 +BRF:93 +BRH:92 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/compiler.js +FN:7,Compiler +FN:17,(anonymous_2) +FN:45,(anonymous_3) +FN:74,(anonymous_4) +FN:78,(anonymous_5) +FN:86,(anonymous_6) +FN:93,(anonymous_7) +FN:111,(anonymous_8) +FN:152,(anonymous_9) +FN:166,(anonymous_10) +FN:187,(anonymous_11) +FN:193,(anonymous_12) +FN:203,(anonymous_13) +FN:218,(anonymous_14) +FN:235,(anonymous_15) +FN:252,(anonymous_16) +FN:264,(anonymous_17) +FN:277,(anonymous_18) +FN:282,(anonymous_19) +FN:286,(anonymous_20) +FN:290,(anonymous_21) +FN:294,(anonymous_22) +FN:297,(anonymous_23) +FN:301,(anonymous_24) +FN:310,(anonymous_25) +FN:332,(anonymous_26) +FN:338,(anonymous_27) +FN:359,(anonymous_28) +FN:376,precompile +FN:394,compile +FN:410,compileInput +FN:418,(anonymous_32) +FN:424,(anonymous_33) +FN:430,(anonymous_34) +FN:439,argEquals +FNF:35 +FNH:35 +FNDA:1595,Compiler +FNDA:129,(anonymous_2) +FNDA:1595,(anonymous_3) +FNDA:5302,(anonymous_4) +FNDA:1595,(anonymous_5) +FNDA:2,(anonymous_6) +FNDA:631,(anonymous_7) +FNDA:583,(anonymous_8) +FNDA:60,(anonymous_9) +FNDA:86,(anonymous_10) +FNDA:1553,(anonymous_11) +FNDA:913,(anonymous_12) +FNDA:894,(anonymous_13) +FNDA:186,(anonymous_14) +FNDA:468,(anonymous_15) +FNDA:965,(anonymous_16) +FNDA:1588,(anonymous_17) +FNDA:68,(anonymous_18) +FNDA:42,(anonymous_19) +FNDA:50,(anonymous_20) +FNDA:40,(anonymous_21) +FNDA:30,(anonymous_22) +FNDA:14161,(anonymous_23) +FNDA:1636,(anonymous_24) +FNDA:1548,(anonymous_25) +FNDA:468,(anonymous_26) +FNDA:598,(anonymous_27) +FNDA:468,(anonymous_28) +FNDA:801,precompile +FNDA:155,compile +FNDA:153,compileInput +FNDA:174,(anonymous_32) +FNDA:2,(anonymous_33) +FNDA:4,(anonymous_34) +FNDA:621,argEquals +DA:2,1 +DA:3,1 +DA:5,1 +DA:7,1 +DA:9,1 +DA:14,1 +DA:18,129 +DA:19,129 +DA:20,45 +DA:23,84 +DA:24,279 +DA:26,279 +DA:27,68 +DA:33,16 +DA:34,16 +DA:35,4 +DA:36,3 +DA:40,13 +DA:46,1595 +DA:47,1595 +DA:48,1595 +DA:49,1595 +DA:50,1595 +DA:51,1595 +DA:54,1595 +DA:55,1595 +DA:65,1595 +DA:66,646 +DA:67,5054 +DA:71,1595 +DA:75,5302 +DA:79,1595 +DA:81,1595 +DA:82,3165 +DA:84,1593 +DA:86,1593 +DA:87,2 +DA:90,1593 +DA:94,631 +DA:95,631 +DA:97,631 +DA:99,631 +DA:101,631 +DA:102,52 +DA:104,52 +DA:105,2 +DA:108,631 +DA:112,583 +DA:116,583 +DA:117,505 +DA:120,583 +DA:121,126 +DA:124,583 +DA:125,583 +DA:127,583 +DA:128,232 +DA:129,351 +DA:130,32 +DA:134,32 +DA:135,32 +DA:136,32 +DA:137,32 +DA:139,319 +DA:143,319 +DA:144,319 +DA:145,319 +DA:146,319 +DA:149,583 +DA:153,60 +DA:155,60 +DA:157,60 +DA:158,96 +DA:160,60 +DA:161,96 +DA:163,60 +DA:167,86 +DA:168,86 +DA:170,86 +DA:171,2 +DA:173,84 +DA:176,86 +DA:177,4 +DA:179,82 +DA:180,82 +DA:183,86 +DA:184,86 +DA:188,1553 +DA:189,1419 +DA:194,913 +DA:196,911 +DA:197,851 +DA:199,60 +DA:204,894 +DA:208,894 +DA:210,894 +DA:211,894 +DA:213,894 +DA:215,894 +DA:219,186 +DA:221,186 +DA:222,38 +DA:223,148 +DA:224,108 +DA:227,40 +DA:228,40 +DA:229,40 +DA:232,186 +DA:236,468 +DA:240,468 +DA:241,210 +DA:242,258 +DA:243,2 +DA:245,256 +DA:247,256 +DA:248,256 +DA:253,965 +DA:255,965 +DA:256,154 +DA:257,811 +DA:258,236 +DA:260,575 +DA:265,1588 +DA:266,1588 +DA:268,1588 +DA:269,1588 +DA:271,16 +DA:273,1572 +DA:278,68 +DA:279,68 +DA:283,42 +DA:287,50 +DA:291,40 +DA:298,14161 +DA:302,1636 +DA:304,56 +DA:305,54 +DA:306,54 +DA:311,1548 +DA:312,1548 +DA:313,1548 +DA:317,1548 +DA:318,912 +DA:320,912 +DA:321,10 +DA:322,902 +DA:323,8 +DA:327,1548 +DA:328,1080 +DA:329,186 +DA:333,468 +DA:334,502 +DA:339,598 +DA:340,62 +DA:341,6 +DA:343,62 +DA:344,62 +DA:346,62 +DA:349,4 +DA:352,536 +DA:353,54 +DA:355,536 +DA:360,468 +DA:361,468 +DA:363,468 +DA:364,468 +DA:366,468 +DA:367,58 +DA:369,410 +DA:372,468 +DA:376,1 +DA:377,801 +DA:378,2 +DA:381,799 +DA:382,799 +DA:383,767 +DA:385,799 +DA:386,180 +DA:389,799 +DA:390,785 +DA:391,783 +DA:394,1 +DA:395,155 +DA:396,2 +DA:399,153 +DA:401,153 +DA:402,71 +DA:404,153 +DA:405,48 +DA:408,153 +DA:410,1 +DA:411,153 +DA:412,153 +DA:413,153 +DA:414,153 +DA:418,153 +DA:419,174 +DA:420,150 +DA:422,174 +DA:424,153 +DA:425,2 +DA:426,1 +DA:428,2 +DA:430,153 +DA:431,4 +DA:432,2 +DA:434,4 +DA:436,153 +DA:439,1 +DA:440,621 +DA:441,241 +DA:444,380 +DA:445,312 +DA:446,342 +DA:447,81 +DA:450,231 +LF:215 +LH:215 +BRDA:19,1,0,45 +BRDA:19,1,1,84 +BRDA:26,2,0,68 +BRDA:26,2,1,211 +BRDA:26,3,0,279 +BRDA:26,3,1,279 +BRDA:35,4,0,3 +BRDA:35,4,1,1 +BRDA:65,5,0,646 +BRDA:65,5,1,949 +BRDA:97,6,0,631 +BRDA:97,6,1,631 +BRDA:104,7,0,50 +BRDA:104,7,1,2 +BRDA:116,8,0,505 +BRDA:116,8,1,78 +BRDA:120,9,0,126 +BRDA:120,9,1,457 +BRDA:127,10,0,232 +BRDA:127,10,1,351 +BRDA:129,11,0,32 +BRDA:129,11,1,319 +BRDA:170,12,0,2 +BRDA:170,12,1,84 +BRDA:176,13,0,4 +BRDA:176,13,1,82 +BRDA:183,14,0,86 +BRDA:183,14,1,76 +BRDA:188,15,0,1419 +BRDA:188,15,1,134 +BRDA:196,16,0,851 +BRDA:196,16,1,60 +BRDA:196,17,0,911 +BRDA:196,17,1,851 +BRDA:206,18,0,894 +BRDA:206,18,1,635 +BRDA:221,19,0,38 +BRDA:221,19,1,148 +BRDA:223,20,0,108 +BRDA:223,20,1,40 +BRDA:240,21,0,210 +BRDA:240,21,1,258 +BRDA:242,22,0,2 +BRDA:242,22,1,256 +BRDA:255,23,0,154 +BRDA:255,23,1,811 +BRDA:257,24,0,236 +BRDA:257,24,1,575 +BRDA:269,25,0,16 +BRDA:269,25,1,1572 +BRDA:302,26,0,1580 +BRDA:302,26,1,56 +BRDA:304,27,0,54 +BRDA:304,27,1,2 +BRDA:317,28,0,912 +BRDA:317,28,1,636 +BRDA:317,29,0,1548 +BRDA:317,29,1,1370 +BRDA:320,30,0,10 +BRDA:320,30,1,902 +BRDA:322,31,0,8 +BRDA:322,31,1,894 +BRDA:327,32,0,468 +BRDA:327,32,1,1080 +BRDA:328,33,0,894 +BRDA:328,33,1,186 +BRDA:339,34,0,62 +BRDA:339,34,1,536 +BRDA:340,35,0,6 +BRDA:340,35,1,56 +BRDA:343,36,0,62 +BRDA:343,36,1,56 +BRDA:346,37,0,4 +BRDA:346,37,1,58 +BRDA:352,38,0,54 +BRDA:352,38,1,482 +BRDA:353,39,0,54 +BRDA:353,39,1,12 +BRDA:366,40,0,58 +BRDA:366,40,1,410 +BRDA:377,41,0,2 +BRDA:377,41,1,799 +BRDA:377,42,0,801 +BRDA:377,42,1,800 +BRDA:377,42,2,2 +BRDA:381,43,0,799 +BRDA:381,43,1,387 +BRDA:382,44,0,767 +BRDA:382,44,1,32 +BRDA:385,45,0,180 +BRDA:385,45,1,619 +BRDA:395,46,0,2 +BRDA:395,46,1,153 +BRDA:395,47,0,155 +BRDA:395,47,1,154 +BRDA:395,47,2,2 +BRDA:399,48,0,153 +BRDA:399,48,1,7 +BRDA:401,49,0,71 +BRDA:401,49,1,82 +BRDA:404,50,0,48 +BRDA:404,50,1,105 +BRDA:419,51,0,150 +BRDA:419,51,1,24 +BRDA:425,52,0,1 +BRDA:425,52,1,1 +BRDA:431,53,0,2 +BRDA:431,53,1,2 +BRDA:440,54,0,241 +BRDA:440,54,1,380 +BRDA:444,55,0,312 +BRDA:444,55,1,68 +BRDA:444,56,0,380 +BRDA:444,56,1,312 +BRDA:444,56,2,312 +BRDA:446,57,0,81 +BRDA:446,57,1,261 +BRF:117 +BRH:117 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/javascript-compiler.js +FN:6,Literal +FN:10,JavaScriptCompiler +FN:15,(anonymous_3) +FN:22,(anonymous_4) +FN:28,(anonymous_5) +FN:34,(anonymous_6) +FN:41,(anonymous_7) +FN:46,(anonymous_8) +FN:53,(anonymous_9) +FN:137,(anonymous_10) +FN:144,(anonymous_11) +FN:176,(anonymous_12) +FN:237,(anonymous_13) +FN:255,(anonymous_14) +FN:276,(anonymous_15) +FN:293,(anonymous_16) +FN:310,(anonymous_17) +FN:323,(anonymous_18) +FN:333,(anonymous_19) +FN:344,(anonymous_20) +FN:358,(anonymous_21) +FN:378,(anonymous_22) +FN:388,(anonymous_23) +FN:401,(anonymous_24) +FN:415,(anonymous_25) +FN:430,(anonymous_26) +FN:441,(anonymous_27) +FN:447,(anonymous_28) +FN:468,(anonymous_29) +FN:478,(anonymous_30) +FN:491,(anonymous_31) +FN:503,(anonymous_32) +FN:520,(anonymous_33) +FN:537,(anonymous_34) +FN:554,(anonymous_35) +FN:579,(anonymous_36) +FN:600,(anonymous_37) +FN:627,(anonymous_38) +FN:641,(anonymous_39) +FN:665,(anonymous_40) +FN:674,(anonymous_41) +FN:689,(anonymous_42) +FN:696,(anonymous_43) +FN:700,(anonymous_44) +FN:711,(anonymous_45) +FN:720,(anonymous_46) +FN:759,(anonymous_47) +FN:764,(anonymous_48) +FN:767,(anonymous_49) +FN:781,(anonymous_50) +FN:785,(anonymous_51) +FN:803,(anonymous_52) +FN:814,(anonymous_53) +FN:822,(anonymous_54) +FN:832,(anonymous_55) +FN:844,(anonymous_56) +FN:857,(anonymous_57) +FN:922,(anonymous_58) +FN:960,(anonymous_59) +FNF:59 +FNH:59 +FNDA:6739,Literal +FNDA:1561,JavaScriptCompiler +FNDA:3716,(anonymous_3) +FNDA:332,(anonymous_4) +FNDA:935,(anonymous_5) +FNDA:3199,(anonymous_6) +FNDA:458,(anonymous_7) +FNDA:147,(anonymous_8) +FNDA:1555,(anonymous_9) +FNDA:1555,(anonymous_10) +FNDA:1555,(anonymous_11) +FNDA:1555,(anonymous_12) +FNDA:32,(anonymous_13) +FNDA:313,(anonymous_14) +FNDA:1409,(anonymous_15) +FNDA:723,(anonymous_16) +FNDA:828,(anonymous_17) +FNDA:2610,(anonymous_18) +FNDA:1401,(anonymous_19) +FNDA:1533,(anonymous_20) +FNDA:1345,(anonymous_21) +FNDA:68,(anonymous_22) +FNDA:80,(anonymous_23) +FNDA:182,(anonymous_24) +FNDA:62,(anonymous_25) +FNDA:1626,(anonymous_26) +FNDA:52,(anonymous_27) +FNDA:52,(anonymous_28) +FNDA:198,(anonymous_29) +FNDA:10559,(anonymous_30) +FNDA:78,(anonymous_31) +FNDA:3352,(anonymous_32) +FNDA:244,(anonymous_33) +FNDA:210,(anonymous_34) +FNDA:877,(anonymous_35) +FNDA:86,(anonymous_36) +FNDA:88,(anonymous_37) +FNDA:54,(anonymous_38) +FNDA:1555,(anonymous_39) +FNDA:625,(anonymous_40) +FNDA:952,(anonymous_41) +FNDA:1503,(anonymous_42) +FNDA:6739,(anonymous_43) +FNDA:4407,(anonymous_44) +FNDA:723,(anonymous_45) +FNDA:1425,(anonymous_46) +FNDA:879,(anonymous_47) +FNDA:879,(anonymous_48) +FNDA:1759,(anonymous_49) +FNDA:13878,(anonymous_50) +FNDA:10559,(anonymous_51) +FNDA:469,(anonymous_52) +FNDA:3259,(anonymous_53) +FNDA:13802,(anonymous_54) +FNDA:2459,(anonymous_55) +FNDA:1331,(anonymous_56) +FNDA:1676,(anonymous_57) +FNDA:1676,(anonymous_58) +FNDA:3716,(anonymous_59) +DA:2,1 +DA:3,1 +DA:4,1 +DA:6,1 +DA:7,6739 +DA:10,1 +DA:12,1 +DA:16,3716 +DA:17,3428 +DA:19,288 +DA:23,332 +DA:25,332 +DA:29,935 +DA:31,935 +DA:35,3199 +DA:36,1085 +DA:38,2114 +DA:41,458 +DA:47,147 +DA:54,1555 +DA:55,1555 +DA:56,1555 +DA:57,1555 +DA:58,1555 +DA:60,1555 +DA:61,1555 +DA:62,1555 +DA:67,1555 +DA:69,1555 +DA:70,1555 +DA:71,1555 +DA:72,1555 +DA:73,1555 +DA:74,1555 +DA:75,1555 +DA:77,1555 +DA:79,1555 +DA:81,1555 +DA:86,1555 +DA:87,13864 +DA:89,13864 +DA:93,1555 +DA:96,1555 +DA:97,1 +DA:100,1555 +DA:101,1555 +DA:102,936 +DA:106,936 +DA:107,936 +DA:108,1154 +DA:109,619 +DA:113,936 +DA:114,82 +DA:116,936 +DA:117,922 +DA:119,936 +DA:120,278 +DA:122,936 +DA:123,228 +DA:126,936 +DA:127,783 +DA:128,783 +DA:131,936 +DA:133,619 +DA:140,1555 +DA:141,1555 +DA:145,1555 +DA:147,1555 +DA:148,1555 +DA:149,1023 +DA:153,1555 +DA:154,2891 +DA:155,2889 +DA:159,1555 +DA:161,1555 +DA:162,472 +DA:166,1555 +DA:168,1555 +DA:169,184 +DA:171,184 +DA:173,1371 +DA:177,1555 +DA:182,1555 +DA:183,4235 +DA:184,4235 +DA:185,1656 +DA:186,796 +DA:188,860 +DA:191,2579 +DA:192,292 +DA:193,264 +DA:194,264 +DA:196,28 +DA:198,292 +DA:200,2579 +DA:202,2579 +DA:203,1140 +DA:208,1555 +DA:209,1143 +DA:210,324 +DA:213,412 +DA:214,412 +DA:215,269 +DA:217,143 +DA:221,1555 +DA:222,1207 +DA:225,1555 +DA:238,32 +DA:240,32 +DA:241,32 +DA:243,32 +DA:244,32 +DA:246,32 +DA:256,313 +DA:259,313 +DA:260,313 +DA:262,313 +DA:264,313 +DA:265,313 +DA:267,313 +DA:277,1409 +DA:278,26 +DA:281,1409 +DA:296,723 +DA:297,723 +DA:298,723 +DA:299,723 +DA:300,265 +DA:311,828 +DA:313,828 +DA:324,2610 +DA:334,1401 +DA:346,1533 +DA:349,1533 +DA:352,332 +DA:354,1201 +DA:357,1533 +DA:358,1345 +DA:359,1345 +DA:362,1345 +DA:363,1095 +DA:366,250 +DA:380,68 +DA:381,64 +DA:383,4 +DA:386,68 +DA:387,68 +DA:388,80 +DA:389,80 +DA:402,182 +DA:404,182 +DA:416,62 +DA:417,62 +DA:421,62 +DA:422,58 +DA:423,50 +DA:425,8 +DA:431,1626 +DA:433,1626 +DA:434,56 +DA:436,1626 +DA:437,30 +DA:438,30 +DA:442,52 +DA:443,2 +DA:445,52 +DA:448,52 +DA:449,52 +DA:451,52 +DA:452,4 +DA:454,52 +DA:455,10 +DA:456,10 +DA:459,52 +DA:469,198 +DA:479,10559 +DA:480,10559 +DA:492,78 +DA:504,3352 +DA:505,952 +DA:507,2400 +DA:521,244 +DA:523,244 +DA:524,244 +DA:526,244 +DA:527,244 +DA:538,210 +DA:539,210 +DA:555,877 +DA:556,877 +DA:557,877 +DA:559,877 +DA:561,877 +DA:562,877 +DA:564,877 +DA:566,877 +DA:580,86 +DA:582,86 +DA:583,82 +DA:584,4 +DA:585,2 +DA:587,86 +DA:588,26 +DA:591,86 +DA:601,88 +DA:606,88 +DA:607,6 +DA:609,88 +DA:610,18 +DA:611,18 +DA:614,88 +DA:615,88 +DA:616,18 +DA:618,88 +DA:619,18 +DA:621,88 +DA:622,6 +DA:624,88 +DA:628,54 +DA:629,46 +DA:630,8 +DA:631,2 +DA:633,6 +DA:642,1555 +DA:644,1555 +DA:645,625 +DA:646,625 +DA:648,625 +DA:650,625 +DA:651,619 +DA:652,619 +DA:653,619 +DA:654,619 +DA:655,619 +DA:656,619 +DA:658,619 +DA:660,6 +DA:661,6 +DA:666,625 +DA:667,222 +DA:668,222 +DA:669,6 +DA:675,952 +DA:680,952 +DA:682,952 +DA:683,376 +DA:686,952 +DA:690,1503 +DA:691,966 +DA:692,966 +DA:697,6739 +DA:701,4407 +DA:702,1383 +DA:703,1383 +DA:706,4407 +DA:707,2852 +DA:712,723 +DA:714,723 +DA:715,723 +DA:716,723 +DA:717,723 +DA:721,1425 +DA:728,1425 +DA:729,1 +DA:733,1425 +DA:735,1425 +DA:737,1269 +DA:738,1269 +DA:741,156 +DA:742,156 +DA:744,156 +DA:745,156 +DA:748,1425 +DA:750,1425 +DA:751,156 +DA:753,1425 +DA:754,156 +DA:756,1425 +DA:760,879 +DA:761,879 +DA:762,879 +DA:765,879 +DA:768,1759 +DA:769,1759 +DA:770,723 +DA:771,723 +DA:772,723 +DA:773,723 +DA:774,0 +DA:776,723 +DA:782,13878 +DA:786,10559 +DA:789,10559 +DA:790,5470 +DA:792,5089 +DA:794,723 +DA:795,1 +DA:797,723 +DA:799,5089 +DA:804,469 +DA:807,469 +DA:808,0 +DA:810,469 +DA:815,3259 +DA:816,54 +DA:818,3205 +DA:823,13802 +DA:833,2459 +DA:835,2459 +DA:836,10401 +DA:837,10397 +DA:841,2459 +DA:845,1331 +DA:847,1331 +DA:849,1331 +DA:858,1676 +DA:860,1676 +DA:861,1676 +DA:863,1676 +DA:864,60 +DA:866,1676 +DA:867,40 +DA:868,40 +DA:871,1676 +DA:872,1676 +DA:876,1676 +DA:877,890 +DA:878,138 +DA:881,890 +DA:882,690 +DA:885,890 +DA:886,890 +DA:891,1676 +DA:892,1676 +DA:893,486 +DA:894,486 +DA:896,486 +DA:897,48 +DA:899,486 +DA:900,44 +DA:901,44 +DA:905,1676 +DA:906,60 +DA:908,1676 +DA:909,40 +DA:910,40 +DA:913,1676 +DA:914,1640 +DA:917,1676 +DA:923,1676 +DA:925,1676 +DA:926,626 +DA:927,626 +DA:928,626 +DA:930,1050 +DA:931,1050 +DA:936,1 +DA:954,1 +DA:956,1 +DA:957,58 +DA:960,1 +DA:961,3716 +DA:964,1 +LF:363 +LH:361 +BRDA:16,1,0,3428 +BRDA:16,1,1,288 +BRDA:35,2,0,1085 +BRDA:35,2,1,2114 +BRDA:62,3,0,1555 +BRDA:62,3,1,936 +BRDA:79,4,0,1555 +BRDA:79,4,1,1369 +BRDA:79,4,2,1319 +BRDA:96,5,0,0 +BRDA:96,5,1,1555 +BRDA:96,6,0,1555 +BRDA:96,6,1,1555 +BRDA:96,6,2,1555 +BRDA:101,7,0,936 +BRDA:101,7,1,619 +BRDA:108,8,0,619 +BRDA:108,8,1,535 +BRDA:113,9,0,82 +BRDA:113,9,1,854 +BRDA:116,10,0,922 +BRDA:116,10,1,14 +BRDA:119,11,0,278 +BRDA:119,11,1,658 +BRDA:122,12,0,228 +BRDA:122,12,1,708 +BRDA:126,13,0,783 +BRDA:126,13,1,153 +BRDA:148,14,0,1023 +BRDA:148,14,1,532 +BRDA:154,15,0,2889 +BRDA:154,15,1,2 +BRDA:161,16,0,472 +BRDA:161,16,1,1083 +BRDA:168,17,0,184 +BRDA:168,17,1,1371 +BRDA:184,18,0,1656 +BRDA:184,18,1,2579 +BRDA:185,19,0,796 +BRDA:185,19,1,860 +BRDA:191,20,0,292 +BRDA:191,20,1,2287 +BRDA:192,21,0,264 +BRDA:192,21,1,28 +BRDA:202,22,0,1140 +BRDA:202,22,1,1439 +BRDA:208,23,0,1143 +BRDA:208,23,1,412 +BRDA:209,24,0,324 +BRDA:209,24,1,819 +BRDA:209,25,0,1143 +BRDA:209,25,1,844 +BRDA:210,26,0,324 +BRDA:210,26,1,25 +BRDA:213,27,0,264 +BRDA:213,27,1,148 +BRDA:214,28,0,269 +BRDA:214,28,1,143 +BRDA:221,29,0,1207 +BRDA:221,29,1,348 +BRDA:222,30,0,264 +BRDA:222,30,1,943 +BRDA:277,31,0,26 +BRDA:277,31,1,1383 +BRDA:299,32,0,265 +BRDA:299,32,1,458 +BRDA:349,33,0,332 +BRDA:349,33,1,1201 +BRDA:349,34,0,1533 +BRDA:349,34,1,1515 +BRDA:349,34,2,332 +BRDA:362,35,0,1095 +BRDA:362,35,1,250 +BRDA:380,36,0,64 +BRDA:380,36,1,4 +BRDA:421,37,0,58 +BRDA:421,37,1,4 +BRDA:422,38,0,50 +BRDA:422,38,1,8 +BRDA:433,39,0,56 +BRDA:433,39,1,1570 +BRDA:436,40,0,30 +BRDA:436,40,1,1596 +BRDA:442,41,0,2 +BRDA:442,41,1,50 +BRDA:451,42,0,4 +BRDA:451,42,1,48 +BRDA:454,43,0,10 +BRDA:454,43,1,42 +BRDA:504,44,0,952 +BRDA:504,44,1,2400 +BRDA:526,45,0,232 +BRDA:526,45,1,12 +BRDA:568,46,0,313 +BRDA:568,46,1,564 +BRDA:582,47,0,82 +BRDA:582,47,1,4 +BRDA:584,48,0,2 +BRDA:584,48,1,2 +BRDA:587,49,0,26 +BRDA:587,49,1,60 +BRDA:606,50,0,6 +BRDA:606,50,1,82 +BRDA:609,51,0,18 +BRDA:609,51,1,70 +BRDA:615,52,0,18 +BRDA:615,52,1,70 +BRDA:618,53,0,18 +BRDA:618,53,1,70 +BRDA:621,54,0,6 +BRDA:621,54,1,82 +BRDA:628,55,0,46 +BRDA:628,55,1,8 +BRDA:628,56,0,54 +BRDA:628,56,1,12 +BRDA:630,57,0,2 +BRDA:630,57,1,6 +BRDA:650,58,0,619 +BRDA:650,58,1,6 +BRDA:658,59,0,619 +BRDA:658,59,1,611 +BRDA:668,60,0,6 +BRDA:668,60,1,216 +BRDA:668,61,0,222 +BRDA:668,61,1,112 +BRDA:682,62,0,376 +BRDA:682,62,1,576 +BRDA:690,63,0,966 +BRDA:690,63,1,537 +BRDA:701,64,0,1383 +BRDA:701,64,1,3024 +BRDA:706,65,0,2852 +BRDA:706,65,1,1555 +BRDA:728,66,0,0 +BRDA:728,66,1,1425 +BRDA:735,67,0,1269 +BRDA:735,67,1,156 +BRDA:742,68,0,0 +BRDA:742,68,1,156 +BRDA:750,69,0,156 +BRDA:750,69,1,1269 +BRDA:753,70,0,156 +BRDA:753,70,1,1269 +BRDA:761,71,0,751 +BRDA:761,71,1,128 +BRDA:769,72,0,723 +BRDA:769,72,1,1036 +BRDA:773,73,0,0 +BRDA:773,73,1,723 +BRDA:787,74,0,9836 +BRDA:787,74,1,723 +BRDA:789,75,0,5470 +BRDA:789,75,1,5089 +BRDA:789,76,0,10559 +BRDA:789,76,1,9134 +BRDA:792,77,0,723 +BRDA:792,77,1,4366 +BRDA:794,78,0,0 +BRDA:794,78,1,723 +BRDA:804,79,0,156 +BRDA:804,79,1,313 +BRDA:807,80,0,0 +BRDA:807,80,1,469 +BRDA:815,81,0,54 +BRDA:815,81,1,3205 +BRDA:815,82,0,3259 +BRDA:815,82,1,826 +BRDA:836,83,0,10397 +BRDA:836,83,1,4 +BRDA:863,84,0,60 +BRDA:863,84,1,1616 +BRDA:866,85,0,40 +BRDA:866,85,1,1636 +BRDA:876,86,0,890 +BRDA:876,86,1,786 +BRDA:876,87,0,1676 +BRDA:876,87,1,924 +BRDA:877,88,0,138 +BRDA:877,88,1,752 +BRDA:881,89,0,690 +BRDA:881,89,1,200 +BRDA:896,90,0,48 +BRDA:896,90,1,438 +BRDA:899,91,0,44 +BRDA:899,91,1,442 +BRDA:905,92,0,60 +BRDA:905,92,1,1616 +BRDA:908,93,0,40 +BRDA:908,93,1,1636 +BRDA:913,94,0,1640 +BRDA:913,94,1,36 +BRDA:925,95,0,626 +BRDA:925,95,1,1050 +BRDA:961,96,0,3716 +BRDA:961,96,1,3480 +BRF:195 +BRH:192 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/visitor.js +FN:2,Visitor +FN:7,(anonymous_2) +FNF:2 +FNH:2 +FNDA:1,Visitor +FNDA:276,(anonymous_2) +DA:2,1 +DA:4,1 +DA:8,276 +DA:12,1 +LF:4 +LH:4 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/dist/cjs/handlebars/compiler/printer.js +FN:4,print +FN:8,PrintVisitor +FN:14,(anonymous_3) +FN:25,(anonymous_4) +FN:39,(anonymous_5) +FN:64,(anonymous_6) +FN:78,(anonymous_7) +FN:82,(anonymous_8) +FN:93,(anonymous_9) +FN:106,(anonymous_10) +FN:110,(anonymous_11) +FN:114,(anonymous_12) +FN:118,(anonymous_13) +FN:127,(anonymous_14) +FN:131,(anonymous_15) +FN:135,(anonymous_16) +FN:139,(anonymous_17) +FNF:17 +FNH:17 +FNDA:48,print +FNDA:48,PrintVisitor +FNDA:89,(anonymous_3) +FNDA:67,(anonymous_4) +FNDA:11,(anonymous_5) +FNDA:40,(anonymous_6) +FNDA:40,(anonymous_7) +FNDA:5,(anonymous_8) +FNDA:14,(anonymous_9) +FNDA:7,(anonymous_10) +FNDA:3,(anonymous_11) +FNDA:6,(anonymous_12) +FNDA:60,(anonymous_13) +FNDA:5,(anonymous_14) +FNDA:4,(anonymous_15) +FNDA:12,(anonymous_16) +FNDA:2,(anonymous_17) +DA:2,1 +DA:4,1 +DA:5,48 +DA:8,1 +DA:9,48 +DA:12,1 +DA:14,1 +DA:15,89 +DA:17,89 +DA:18,50 +DA:21,89 +DA:22,89 +DA:25,1 +DA:26,67 +DA:30,67 +DA:31,59 +DA:34,67 +DA:36,67 +DA:39,1 +DA:40,11 +DA:42,11 +DA:43,11 +DA:44,11 +DA:45,11 +DA:46,9 +DA:47,9 +DA:48,9 +DA:49,9 +DA:51,11 +DA:52,10 +DA:53,10 +DA:54,10 +DA:55,10 +DA:56,10 +DA:57,10 +DA:59,11 +DA:61,11 +DA:64,1 +DA:65,40 +DA:67,40 +DA:68,11 +DA:71,40 +DA:73,40 +DA:75,40 +DA:78,1 +DA:79,40 +DA:82,1 +DA:83,5 +DA:84,5 +DA:85,2 +DA:87,5 +DA:88,2 +DA:90,5 +DA:93,1 +DA:94,14 +DA:95,14 +DA:97,14 +DA:98,23 +DA:99,23 +DA:100,23 +DA:103,14 +DA:106,1 +DA:107,7 +DA:110,1 +DA:111,3 +DA:114,1 +DA:115,6 +DA:118,1 +DA:119,60 +DA:120,60 +DA:121,1 +DA:123,59 +DA:127,1 +DA:128,5 +DA:131,1 +DA:132,4 +DA:135,1 +DA:136,12 +DA:139,1 +DA:140,2 +LF:80 +LH:80 +BRDA:45,1,0,9 +BRDA:45,1,1,2 +BRDA:51,2,0,10 +BRDA:51,2,1,1 +BRDA:52,3,0,8 +BRDA:52,3,1,2 +BRDA:57,4,0,8 +BRDA:57,4,1,2 +BRDA:73,5,0,12 +BRDA:73,5,1,28 +BRDA:84,6,0,2 +BRDA:84,6,1,3 +BRDA:87,7,0,2 +BRDA:87,7,1,3 +BRDA:120,8,0,1 +BRDA:120,8,1,59 +BRF:16 +BRH:16 +end_of_record +TN: +SF:/Users/kpdecker/dev/kpdecker/handlebars.js/lib/precompiler.js +FN:7,(anonymous_1) +FN:18,(anonymous_2) +FN:45,(anonymous_3) +FN:63,processTemplate +FN:67,(anonymous_5) +FN:114,(anonymous_6) +FNF:6 +FNH:6 +FNDA:54,(anonymous_1) +FNDA:51,(anonymous_2) +FNDA:3,(anonymous_3) +FNDA:57,processTemplate +FNDA:45,(anonymous_5) +FNDA:36,(anonymous_6) +DA:2,1 +DA:7,1 +DA:8,54 +DA:9,3 +DA:10,3 +DA:13,51 +DA:14,51 +DA:15,3 +DA:18,48 +DA:19,51 +DA:20,51 +DA:22,3 +DA:26,45 +DA:27,3 +DA:29,42 +DA:30,6 +DA:34,36 +DA:35,36 +DA:36,3 +DA:38,36 +DA:39,3 +DA:40,3 +DA:45,36 +DA:46,36 +DA:48,36 +DA:49,36 +DA:50,27 +DA:51,12 +DA:52,15 +DA:53,3 +DA:55,12 +DA:57,27 +DA:58,27 +DA:59,27 +DA:60,27 +DA:61,27 +DA:63,1 +DA:64,57 +DA:66,57 +DA:67,15 +DA:68,45 +DA:70,45 +DA:71,21 +DA:75,42 +DA:77,42 +DA:78,0 +DA:81,42 +DA:86,42 +DA:87,3 +DA:91,42 +DA:92,21 +DA:93,21 +DA:94,21 +DA:96,42 +DA:98,42 +DA:99,9 +DA:100,33 +DA:101,9 +DA:102,3 +DA:104,9 +DA:106,24 +DA:107,3 +DA:109,24 +DA:114,36 +DA:115,36 +DA:119,36 +DA:120,27 +DA:121,12 +DA:122,6 +DA:123,3 +DA:125,3 +DA:128,12 +DA:129,15 +DA:130,12 +DA:133,36 +DA:135,36 +DA:136,3 +DA:139,36 +DA:140,0 +DA:142,36 +LF:80 +LH:78 +BRDA:8,1,0,3 +BRDA:8,1,1,51 +BRDA:14,2,0,3 +BRDA:14,2,1,48 +BRDA:26,3,0,3 +BRDA:26,3,1,42 +BRDA:26,4,0,45 +BRDA:26,4,1,18 +BRDA:29,5,0,6 +BRDA:29,5,1,36 +BRDA:29,6,0,42 +BRDA:29,6,1,15 +BRDA:29,6,2,12 +BRDA:35,7,0,3 +BRDA:35,7,1,33 +BRDA:35,8,0,36 +BRDA:35,8,1,3 +BRDA:38,9,0,3 +BRDA:38,9,1,33 +BRDA:49,10,0,27 +BRDA:49,10,1,9 +BRDA:50,11,0,12 +BRDA:50,11,1,15 +BRDA:52,12,0,3 +BRDA:52,12,1,12 +BRDA:66,13,0,15 +BRDA:66,13,1,42 +BRDA:70,14,0,21 +BRDA:70,14,1,24 +BRDA:70,15,0,45 +BRDA:70,15,1,24 +BRDA:71,16,0,21 +BRDA:71,16,1,21 +BRDA:77,17,0,0 +BRDA:77,17,1,42 +BRDA:77,18,0,42 +BRDA:77,18,1,0 +BRDA:86,19,0,3 +BRDA:86,19,1,39 +BRDA:91,20,0,21 +BRDA:91,20,1,21 +BRDA:93,21,0,21 +BRDA:93,21,1,0 +BRDA:98,22,0,9 +BRDA:98,22,1,33 +BRDA:100,23,0,9 +BRDA:100,23,1,24 +BRDA:101,24,0,3 +BRDA:101,24,1,6 +BRDA:101,25,0,9 +BRDA:101,25,1,9 +BRDA:101,25,2,9 +BRDA:106,26,0,3 +BRDA:106,26,1,21 +BRDA:106,27,0,24 +BRDA:106,27,1,9 +BRDA:106,27,2,9 +BRDA:119,28,0,27 +BRDA:119,28,1,9 +BRDA:120,29,0,12 +BRDA:120,29,1,15 +BRDA:121,30,0,6 +BRDA:121,30,1,6 +BRDA:121,31,0,12 +BRDA:121,31,1,12 +BRDA:121,31,2,12 +BRDA:122,32,0,3 +BRDA:122,32,1,3 +BRDA:129,33,0,12 +BRDA:129,33,1,3 +BRDA:135,34,0,3 +BRDA:135,34,1,33 +BRDA:139,35,0,0 +BRDA:139,35,1,36 +BRF:74 +BRH:70 +end_of_record diff --git a/node_modules/handlebars/dist/amd/handlebars.js b/node_modules/handlebars/dist/amd/handlebars.js index 3e2b5f9..779d757 100644 --- a/node_modules/handlebars/dist/amd/handlebars.js +++ b/node_modules/handlebars/dist/amd/handlebars.js @@ -1,48 +1,43 @@ -define(['exports', 'module', './handlebars.runtime', './handlebars/compiler/ast', './handlebars/compiler/base', './handlebars/compiler/compiler', './handlebars/compiler/javascript-compiler', './handlebars/compiler/visitor', './handlebars/no-conflict'], function (exports, module, _handlebarsRuntime, _handlebarsCompilerAst, _handlebarsCompilerBase, _handlebarsCompilerCompiler, _handlebarsCompilerJavascriptCompiler, _handlebarsCompilerVisitor, _handlebarsNoConflict) { - 'use strict'; +define( + ["./handlebars.runtime","./handlebars/compiler/ast","./handlebars/compiler/base","./handlebars/compiler/compiler","./handlebars/compiler/javascript-compiler","exports"], + function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) { + "use strict"; + /*globals Handlebars: true */ + var Handlebars = __dependency1__["default"]; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + // Compiler imports + var AST = __dependency2__["default"]; + var Parser = __dependency3__.parser; + var parse = __dependency3__.parse; + var Compiler = __dependency4__.Compiler; + var compile = __dependency4__.compile; + var precompile = __dependency4__.precompile; + var JavaScriptCompiler = __dependency5__["default"]; - var _runtime = _interopRequire(_handlebarsRuntime); + var _create = Handlebars.create; + var create = function() { + var hb = _create(); - // Compiler imports + hb.compile = function(input, options) { + return compile(input, options, hb); + }; + hb.precompile = function (input, options) { + return precompile(input, options, hb); + }; - var _AST = _interopRequire(_handlebarsCompilerAst); + hb.AST = AST; + hb.Compiler = Compiler; + hb.JavaScriptCompiler = JavaScriptCompiler; + hb.Parser = Parser; + hb.parse = parse; - var _JavaScriptCompiler = _interopRequire(_handlebarsCompilerJavascriptCompiler); - - var _Visitor = _interopRequire(_handlebarsCompilerVisitor); - - var _noConflict = _interopRequire(_handlebarsNoConflict); - - var _create = _runtime.create; - function create() { - var hb = _create(); - - hb.compile = function (input, options) { - return _handlebarsCompilerCompiler.compile(input, options, hb); - }; - hb.precompile = function (input, options) { - return _handlebarsCompilerCompiler.precompile(input, options, hb); + return hb; }; - hb.AST = _AST; - hb.Compiler = _handlebarsCompilerCompiler.Compiler; - hb.JavaScriptCompiler = _JavaScriptCompiler; - hb.Parser = _handlebarsCompilerBase.parser; - hb.parse = _handlebarsCompilerBase.parse; + Handlebars = create(); + Handlebars.create = create; - return hb; - } + Handlebars['default'] = Handlebars; - var inst = create(); - inst.create = create; - - _noConflict(inst); - - inst.Visitor = _Visitor; - - inst['default'] = inst; - - module.exports = inst; -}); \ No newline at end of file + __exports__["default"] = Handlebars; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars.runtime.js b/node_modules/handlebars/dist/amd/handlebars.runtime.js index 73218be..222a074 100644 --- a/node_modules/handlebars/dist/amd/handlebars.runtime.js +++ b/node_modules/handlebars/dist/amd/handlebars.runtime.js @@ -1,41 +1,39 @@ -define(['exports', 'module', './handlebars/base', './handlebars/safe-string', './handlebars/exception', './handlebars/utils', './handlebars/runtime', './handlebars/no-conflict'], function (exports, module, _handlebarsBase, _handlebarsSafeString, _handlebarsException, _handlebarsUtils, _handlebarsRuntime, _handlebarsNoConflict) { - 'use strict'; +define( + ["./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","exports"], + function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) { + "use strict"; + /*globals Handlebars: true */ + var base = __dependency1__; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + // Each of these augment the Handlebars object. No need to setup here. + // (This is done to easily share code between commonjs and browse envs) + var SafeString = __dependency2__["default"]; + var Exception = __dependency3__["default"]; + var Utils = __dependency4__; + var runtime = __dependency5__; - // Each of these augment the Handlebars object. No need to setup here. - // (This is done to easily share code between commonjs and browse envs) + // For compatibility and usage outside of module systems, make the Handlebars object a namespace + var create = function() { + var hb = new base.HandlebarsEnvironment(); - var _SafeString = _interopRequire(_handlebarsSafeString); + Utils.extend(hb, base); + hb.SafeString = SafeString; + hb.Exception = Exception; + hb.Utils = Utils; + hb.escapeExpression = Utils.escapeExpression; - var _Exception = _interopRequire(_handlebarsException); + hb.VM = runtime; + hb.template = function(spec) { + return runtime.template(spec, hb); + }; - var _noConflict = _interopRequire(_handlebarsNoConflict); - - // For compatibility and usage outside of module systems, make the Handlebars object a namespace - function create() { - var hb = new _handlebarsBase.HandlebarsEnvironment(); - - _handlebarsUtils.extend(hb, _handlebarsBase); - hb.SafeString = _SafeString; - hb.Exception = _Exception; - hb.Utils = _handlebarsUtils; - hb.escapeExpression = _handlebarsUtils.escapeExpression; - - hb.VM = _handlebarsRuntime; - hb.template = function (spec) { - return _handlebarsRuntime.template(spec, hb); + return hb; }; - return hb; - } + var Handlebars = create(); + Handlebars.create = create; - var inst = create(); - inst.create = create; + Handlebars['default'] = Handlebars; - _noConflict(inst); - - inst['default'] = inst; - - module.exports = inst; -}); \ No newline at end of file + __exports__["default"] = Handlebars; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/base.js b/node_modules/handlebars/dist/amd/handlebars/base.js index 4b7e4b3..403a895 100644 --- a/node_modules/handlebars/dist/amd/handlebars/base.js +++ b/node_modules/handlebars/dist/amd/handlebars/base.js @@ -1,268 +1,235 @@ -define(['exports', './utils', './exception'], function (exports, _utils, _exception) { - 'use strict'; +define( + ["./utils","./exception","exports"], + function(__dependency1__, __dependency2__, __exports__) { + "use strict"; + var Utils = __dependency1__; + var Exception = __dependency2__["default"]; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + var VERSION = "2.0.0"; + __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; + __exports__.COMPILER_REVISION = COMPILER_REVISION; + var REVISION_CHANGES = { + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it + 2: '== 1.0.0-rc.3', + 3: '== 1.0.0-rc.4', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' + }; + __exports__.REVISION_CHANGES = REVISION_CHANGES; + var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; - exports.__esModule = true; - exports.HandlebarsEnvironment = HandlebarsEnvironment; - exports.createFrame = createFrame; + function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; - var _Exception = _interopRequire(_exception); - - var VERSION = '3.0.1'; - exports.VERSION = VERSION; - var COMPILER_REVISION = 6; - - exports.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1' - }; - - exports.REVISION_CHANGES = REVISION_CHANGES; - var isArray = _utils.isArray, - isFunction = _utils.isFunction, - toString = _utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function registerHelper(name, fn) { - if (toString.call(name) === objectType) { - if (fn) { - throw new _Exception('Arg not supported with multiple helpers'); - } - _utils.extend(this.helpers, name); - } else { - this.helpers[name] = fn; - } - }, - unregisterHelper: function unregisterHelper(name) { - delete this.helpers[name]; - }, - - registerPartial: function registerPartial(name, partial) { - if (toString.call(name) === objectType) { - _utils.extend(this.partials, name); - } else { - if (typeof partial === 'undefined') { - throw new _Exception('Attempting to register a partial as undefined'); - } - this.partials[name] = partial; - } - }, - unregisterPartial: function unregisterPartial(name) { - delete this.partials[name]; + registerDefaultHelpers(this); } - }; - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function () { - if (arguments.length === 1) { - // A missing field in a {{foo}} constuct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new _Exception('Missing helper: "' + arguments[arguments.length - 1].name + '"'); - } - }); + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, - instance.registerHelper('blockHelperMissing', function (context, options) { - var inverse = options.inverse, - fn = options.fn; + logger: logger, + log: log, - if (context === true) { - return fn(this); - } else if (context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if (context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } - - return instance.helpers.each(context, options); + registerHelper: function(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } + Utils.extend(this.helpers, name); } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function(name) { + delete this.helpers[name]; + }, + + registerPartial: function(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + this.partials[name] = partial; + } + }, + unregisterPartial: function(name) { + delete this.partials[name]; + } + }; + + function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); + } + }); + + instance.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse, + fn = options.fn; + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; - } + } else if (isArray(context)) { + if(context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } - return fn(context, options); - } - }); - - instance.registerHelper('each', function (context, options) { - if (!options) { - throw new _Exception('Must pass iterator to #each'); - } - - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; - - if (options.data && options.ids) { - contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (isFunction(context)) { - context = context.call(this); - } - - if (options.data) { - data = createFrame(options.data); - } - - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { - if (isArray(context)) { - for (var j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); + return instance.helpers.each(context, options); + } else { + return inverse(this); } } else { - var priorKey = undefined; + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = {data: data}; + } - for (var key in context) { - if (context.hasOwnProperty(key)) { - // We're running the iterations one step out of sync so we can detect - // the last iteration without have to scan the object twice and create - // an itermediate keys array. - if (priorKey) { - execIteration(priorKey, i - 1); + return fn(context, options); + } + }); + + instance.registerHelper('each', function(context, options) { + if (!options) { + throw new Exception('Must pass iterator to #each'); + } + + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + var contextPath; + if (options.data && options.ids) { + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; + } + + if (isFunction(context)) { context = context.call(this); } + + if (options.data) { + data = createFrame(options.data); + } + + if(context && typeof context === 'object') { + if (isArray(context)) { + for(var j = context.length; i 0) { + throw new Exception("Invalid path: " + original, this); + } else if (part === "..") { + depth++; + depthString += '../'; + } else { + this.isScoped = true; + } + } else { + dig.push(part); + } + } + + this.original = original; + this.parts = dig; + this.string = dig.join('.'); + this.depth = depth; + this.idName = depthString + this.string; + + // an ID is simple if it only has one part, and that part is not + // `..` or `this`. + this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; + + this.stringModeValue = this.string; + }, + + PartialNameNode: function(name, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "PARTIAL_NAME"; + this.name = name.original; + }, + + DataNode: function(id, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "DATA"; + this.id = id; + this.stringModeValue = id.stringModeValue; + this.idName = '@' + id.stringModeValue; + }, + + StringNode: function(string, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "STRING"; + this.original = + this.string = + this.stringModeValue = string; + }, + + NumberNode: function(number, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "NUMBER"; + this.original = + this.number = number; + this.stringModeValue = Number(number); + }, + + BooleanNode: function(bool, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "BOOLEAN"; + this.bool = bool; + this.stringModeValue = bool === "true"; + }, + + CommentNode: function(comment, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "comment"; + this.comment = comment; + + this.strip = { + inlineStandalone: true + }; + } + }; + + + // Must be exported as an object rather than the root of the module as the jison lexer + // most modify the object to operate properly. + __exports__["default"] = AST; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/base.js b/node_modules/handlebars/dist/amd/handlebars/compiler/base.js index 35473b1..bc9158c 100644 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/base.js +++ b/node_modules/handlebars/dist/amd/handlebars/compiler/base.js @@ -1,36 +1,25 @@ -define(['exports', './parser', './ast', './whitespace-control', './helpers', '../utils'], function (exports, _parser, _ast, _whitespaceControl, _helpers, _utils) { - 'use strict'; +define( + ["./parser","./ast","./helpers","../utils","exports"], + function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) { + "use strict"; + var parser = __dependency1__["default"]; + var AST = __dependency2__["default"]; + var Helpers = __dependency3__; + var extend = __dependency4__.extend; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + __exports__.parser = parser; - exports.__esModule = true; - exports.parse = parse; + var yy = {}; + extend(yy, Helpers, AST); - var _parser2 = _interopRequire(_parser); + function parse(input) { + // Just return if an already-compile AST was passed in. + if (input.constructor === AST.ProgramNode) { return input; } - var _AST = _interopRequire(_ast); + parser.yy = yy; - var _WhitespaceControl = _interopRequire(_whitespaceControl); - - exports.parser = _parser2; - - var yy = {}; - _utils.extend(yy, _helpers, _AST); - - function parse(input, options) { - // Just return if an already-compiled AST was passed in. - if (input.type === 'Program') { - return input; + return parser.parse(input); } - _parser2.yy = yy; - - // Altering the shared object here, but this is ok as parser is a sync operation - yy.locInfo = function (locInfo) { - return new yy.SourceLocation(options && options.srcName, locInfo); - }; - - var strip = new _WhitespaceControl(); - return strip.accept(_parser2.parse(input)); - } -}); \ No newline at end of file + __exports__.parse = parse; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/code-gen.js b/node_modules/handlebars/dist/amd/handlebars/compiler/code-gen.js deleted file mode 100644 index 4baf088..0000000 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/code-gen.js +++ /dev/null @@ -1,161 +0,0 @@ -define(['exports', 'module', '../utils'], function (exports, module, _utils) { - 'use strict'; - - var SourceNode = undefined; - - try { - /* istanbul ignore next */ - if (typeof define !== 'function' || !define.amd) { - // We don't support this in AMD environments. For these environments, we asusme that - // they are running on the browser and thus have no need for the source-map library. - var SourceMap = require('source-map'); - SourceNode = SourceMap.SourceNode; - } - } catch (err) {} - - /* istanbul ignore if: tested but not covered in istanbul due to dist build */ - if (!SourceNode) { - SourceNode = function (line, column, srcFile, chunks) { - this.src = ''; - if (chunks) { - this.add(chunks); - } - }; - /* istanbul ignore next */ - SourceNode.prototype = { - add: function add(chunks) { - if (_utils.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src += chunks; - }, - prepend: function prepend(chunks) { - if (_utils.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src = chunks + this.src; - }, - toStringWithSourceMap: function toStringWithSourceMap() { - return { code: this.toString() }; - }, - toString: function toString() { - return this.src; - } - }; - } - - function castChunk(chunk, codeGen, loc) { - if (_utils.isArray(chunk)) { - var ret = []; - - for (var i = 0, len = chunk.length; i < len; i++) { - ret.push(codeGen.wrap(chunk[i], loc)); - } - return ret; - } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { - // Handle primitives that the SourceNode will throw up on - return chunk + ''; - } - return chunk; - } - - function CodeGen(srcFile) { - this.srcFile = srcFile; - this.source = []; - } - - CodeGen.prototype = { - prepend: function prepend(source, loc) { - this.source.unshift(this.wrap(source, loc)); - }, - push: function push(source, loc) { - this.source.push(this.wrap(source, loc)); - }, - - merge: function merge() { - var source = this.empty(); - this.each(function (line) { - source.add([' ', line, '\n']); - }); - return source; - }, - - each: function each(iter) { - for (var i = 0, len = this.source.length; i < len; i++) { - iter(this.source[i]); - } - }, - - empty: function empty() { - var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile); - }, - wrap: function wrap(chunk) { - var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; - - if (chunk instanceof SourceNode) { - return chunk; - } - - chunk = castChunk(chunk, this, loc); - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); - }, - - functionCall: function functionCall(fn, type, params) { - params = this.generateList(params); - return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); - }, - - quotedString: function quotedString(str) { - return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 - .replace(/\u2029/g, '\\u2029') + '"'; - }, - - objectLiteral: function objectLiteral(obj) { - var pairs = []; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - var value = castChunk(obj[key], this); - if (value !== 'undefined') { - pairs.push([this.quotedString(key), ':', value]); - } - } - } - - var ret = this.generateList(pairs); - ret.prepend('{'); - ret.add('}'); - return ret; - }, - - generateList: function generateList(entries, loc) { - var ret = this.empty(loc); - - for (var i = 0, len = entries.length; i < len; i++) { - if (i) { - ret.add(','); - } - - ret.add(castChunk(entries[i], this, loc)); - } - - return ret; - }, - - generateArray: function generateArray(entries, loc) { - var ret = this.generateList(entries, loc); - ret.prepend('['); - ret.add(']'); - - return ret; - } - }; - - module.exports = CodeGen; -}); -/*global define */ - -/* NOP */ \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js b/node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js index 152e528..74c7b01 100644 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js +++ b/node_modules/handlebars/dist/amd/handlebars/compiler/compiler.js @@ -1,523 +1,456 @@ -define(['exports', '../exception', '../utils', './ast'], function (exports, _exception, _utils, _ast) { - 'use strict'; +define( + ["../exception","../utils","exports"], + function(__dependency1__, __dependency2__, __exports__) { + "use strict"; + var Exception = __dependency1__["default"]; + var isArray = __dependency2__.isArray; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + var slice = [].slice; - exports.__esModule = true; - exports.Compiler = Compiler; - exports.precompile = precompile; - exports.compile = compile; + function Compiler() {} - var _Exception = _interopRequire(_exception); + __exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a + // function in a context. This is necessary for mustache compatibility, which + // requires that context functions in blocks are evaluated by blockHelperMissing, + // and then proceed as if the resulting value was provided to blockHelperMissing. - var _AST = _interopRequire(_ast); + Compiler.prototype = { + compiler: Compiler, - var slice = [].slice; - - function Compiler() {} - - // the foundHelper register will disambiguate helper lookup from finding a - // function in a context. This is necessary for mustache compatibility, which - // requires that context functions in blocks are evaluated by blockHelperMissing, - // and then proceed as if the resulting value was provided to blockHelperMissing. - - Compiler.prototype = { - compiler: Compiler, - - equals: function equals(other) { - var len = this.opcodes.length; - if (other.opcodes.length !== len) { - return false; - } - - for (var i = 0; i < len; i++) { - var opcode = this.opcodes[i], - otherOpcode = other.opcodes[i]; - if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { + equals: function(other) { + var len = this.opcodes.length; + if (other.opcodes.length !== len) { return false; } - } - // We know that length is the same between the two arrays because they are directly tied - // to the opcode behavior above. - len = this.children.length; - for (var i = 0; i < len; i++) { - if (!this.children[i].equals(other.children[i])) { - return false; - } - } - - return true; - }, - - guid: 0, - - compile: function compile(program, options) { - this.sourceNode = []; - this.opcodes = []; - this.children = []; - this.options = options; - this.stringParams = options.stringParams; - this.trackIds = options.trackIds; - - options.blockParams = options.blockParams || []; - - // These changes will propagate to the other compiler components - var knownHelpers = options.knownHelpers; - options.knownHelpers = { - helperMissing: true, - blockHelperMissing: true, - each: true, - 'if': true, - unless: true, - 'with': true, - log: true, - lookup: true - }; - if (knownHelpers) { - for (var _name in knownHelpers) { - if (_name in knownHelpers) { - options.knownHelpers[_name] = knownHelpers[_name]; + for (var i = 0; i < len; i++) { + var opcode = this.opcodes[i], + otherOpcode = other.opcodes[i]; + if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { + return false; } } - } - return this.accept(program); - }, + // We know that length is the same between the two arrays because they are directly tied + // to the opcode behavior above. + len = this.children.length; + for (i = 0; i < len; i++) { + if (!this.children[i].equals(other.children[i])) { + return false; + } + } - compileProgram: function compileProgram(program) { - var childCompiler = new this.compiler(), - // eslint-disable-line new-cap - result = childCompiler.compile(program, this.options), - guid = this.guid++; + return true; + }, - this.usePartial = this.usePartial || result.usePartial; + guid: 0, - this.children[guid] = result; - this.useDepths = this.useDepths || result.useDepths; + compile: function(program, options) { + this.opcodes = []; + this.children = []; + this.depths = {list: []}; + this.options = options; + this.stringParams = options.stringParams; + this.trackIds = options.trackIds; - return guid; - }, + // These changes will propagate to the other compiler components + var knownHelpers = this.options.knownHelpers; + this.options.knownHelpers = { + 'helperMissing': true, + 'blockHelperMissing': true, + 'each': true, + 'if': true, + 'unless': true, + 'with': true, + 'log': true, + 'lookup': true + }; + if (knownHelpers) { + for (var name in knownHelpers) { + this.options.knownHelpers[name] = knownHelpers[name]; + } + } - accept: function accept(node) { - this.sourceNode.unshift(node); - var ret = this[node.type](node); - this.sourceNode.shift(); - return ret; - }, + return this.accept(program); + }, - Program: function Program(program) { - this.options.blockParams.unshift(program.blockParams); + accept: function(node) { + return this[node.type](node); + }, - var body = program.body, - bodyLength = body.length; - for (var i = 0; i < bodyLength; i++) { - this.accept(body[i]); - } + program: function(program) { + var statements = program.statements; - this.options.blockParams.shift(); + for(var i=0, l=statements.length; i 1) { - throw new _Exception('Unsupported number of partial arguments: ' + params.length, partial); - } else if (!params.length) { - params.push({ type: 'PathExpression', parts: [], depth: 0 }); - } + var sexpr = mustache.sexpr; + var type = this.classifySexpr(sexpr); - var partialName = partial.name.original, - isDynamic = partial.name.type === 'SubExpression'; - if (isDynamic) { - this.accept(partial.name); - } + if (type === "helper") { + this.helperSexpr(sexpr, program, inverse); + } else if (type === "simple") { + this.simpleSexpr(sexpr); - this.setupFullMustacheParams(partial, undefined, undefined, true); + // now that the simple mustache is resolved, we need to + // evaluate it by executing `blockHelperMissing` + this.opcode('pushProgram', program); + this.opcode('pushProgram', inverse); + this.opcode('emptyHash'); + this.opcode('blockValue', sexpr.id.original); + } else { + this.ambiguousSexpr(sexpr, program, inverse); - var indent = partial.indent || ''; - if (this.options.preventIndent && indent) { - this.opcode('appendContent', indent); - indent = ''; - } + // now that the simple mustache is resolved, we need to + // evaluate it by executing `blockHelperMissing` + this.opcode('pushProgram', program); + this.opcode('pushProgram', inverse); + this.opcode('emptyHash'); + this.opcode('ambiguousBlockValue'); + } - this.opcode('invokePartial', isDynamic, partialName, indent); - this.opcode('append'); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.SubExpression(mustache); // eslint-disable-line new-cap - - if (mustache.escaped && !this.options.noEscape) { - this.opcode('appendEscaped'); - } else { this.opcode('append'); - } - }, + }, - ContentStatement: function ContentStatement(content) { - if (content.value) { - this.opcode('appendContent', content.value); - } - }, + hash: function(hash) { + var pairs = hash.pairs, i, l; - CommentStatement: function CommentStatement() {}, + this.opcode('pushHash'); - SubExpression: function SubExpression(sexpr) { - transformLiteralToPath(sexpr); - var type = this.classifySexpr(sexpr); + for(i=0, l=pairs.length; i= 0) { - return [depth, param]; - } + return true; } } - }; - - function precompile(input, options, env) { - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); - } - - options = options || {}; - if (!('data' in options)) { - options.data = true; - } - if (options.compat) { - options.useDepths = true; - } - - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options); - return new env.JavaScriptCompiler().compile(environment, options); - } - - function compile(input, _x, env) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); - } - - if (!('data' in options)) { - options.data = true; - } - if (options.compat) { - options.useDepths = true; - } - - var compiled = undefined; - - function compileInput() { - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options), - templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); - return env.template(templateSpec); - } - - // Template is only compiled on first use and cached after that point. - function ret(context, execOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled.call(this, context, execOptions); - } - ret._setup = function (setupOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._setup(setupOptions); - }; - ret._child = function (i, data, blockParams, depths) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._child(i, data, blockParams, depths); - }; - return ret; - } - - function argEquals(a, b) { - if (a === b) { - return true; - } - - if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { - for (var i = 0; i < a.length; i++) { - if (!argEquals(a[i], b[i])) { - return false; - } - } - return true; - } - } - - function transformLiteralToPath(sexpr) { - if (!sexpr.path.parts) { - var literal = sexpr.path; - // Casting to string here to make false and 0 literal values play nicely with the rest - // of the system. - sexpr.path = new _AST.PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); - } - } -}); \ No newline at end of file + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/helpers.js b/node_modules/handlebars/dist/amd/handlebars/compiler/helpers.js index 97efc9e..8251c9f 100644 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/helpers.js +++ b/node_modules/handlebars/dist/amd/handlebars/compiler/helpers.js @@ -1,131 +1,191 @@ -define(['exports', '../exception'], function (exports, _exception) { - 'use strict'; +define( + ["../exception","exports"], + function(__dependency1__, __exports__) { + "use strict"; + var Exception = __dependency1__["default"]; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.SourceLocation = SourceLocation; - exports.id = id; - exports.stripFlags = stripFlags; - exports.stripComment = stripComment; - exports.preparePath = preparePath; - exports.prepareMustache = prepareMustache; - exports.prepareRawBlock = prepareRawBlock; - exports.prepareBlock = prepareBlock; - - var _Exception = _interopRequire(_exception); - - function SourceLocation(source, locInfo) { - this.source = source; - this.start = { - line: locInfo.first_line, - column: locInfo.first_column - }; - this.end = { - line: locInfo.last_line, - column: locInfo.last_column - }; - } - - function id(token) { - if (/^\[.*\]$/.test(token)) { - return token.substr(1, token.length - 2); - } else { - return token; + function stripFlags(open, close) { + return { + left: open.charAt(2) === '~', + right: close.charAt(close.length-3) === '~' + }; } - } - function stripFlags(open, close) { - return { - open: open.charAt(2) === '~', - close: close.charAt(close.length - 3) === '~' - }; - } + __exports__.stripFlags = stripFlags; + function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { + /*jshint -W040 */ + if (mustache.sexpr.id.original !== close.path.original) { + throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache); + } - function stripComment(comment) { - return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, ''); - } + var inverse = inverseAndProgram && inverseAndProgram.program; - function preparePath(data, parts, locInfo) { - locInfo = this.locInfo(locInfo); + var strip = { + left: mustache.strip.left, + right: close.strip.right, - var original = data ? '@' : '', - dig = [], - depth = 0, - depthString = ''; + // Determine the standalone candiacy. Basically flag our content as being possibly standalone + // so our parent can determine if we actually are standalone + openStandalone: isNextWhitespace(program.statements), + closeStandalone: isPrevWhitespace((inverse || program).statements) + }; - for (var i = 0, l = parts.length; i < l; i++) { - var part = parts[i].part, + if (mustache.strip.right) { + omitRight(program.statements, null, true); + } - // If we have [] syntax then we do not treat path references as operators, - // i.e. foo.[this] resolves to approximately context.foo['this'] - isLiteral = parts[i].original !== part; - original += (parts[i].separator || '') + part; + if (inverse) { + var inverseStrip = inverseAndProgram.strip; - if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { - if (dig.length > 0) { - throw new _Exception('Invalid path: ' + original, { loc: locInfo }); - } else if (part === '..') { - depth++; - depthString += '../'; + if (inverseStrip.left) { + omitLeft(program.statements, null, true); + } + if (inverseStrip.right) { + omitRight(inverse.statements, null, true); + } + if (close.strip.left) { + omitLeft(inverse.statements, null, true); + } + + // Find standalone else statments + if (isPrevWhitespace(program.statements) + && isNextWhitespace(inverse.statements)) { + + omitLeft(program.statements); + omitRight(inverse.statements); } } else { - dig.push(part); + if (close.strip.left) { + omitLeft(program.statements, null, true); + } + } + + if (inverted) { + return new this.BlockNode(mustache, inverse, program, strip, locInfo); + } else { + return new this.BlockNode(mustache, program, inverse, strip, locInfo); } } - return new this.PathExpression(data, depth, dig, original, locInfo); - } + __exports__.prepareBlock = prepareBlock; + function prepareProgram(statements, isRoot) { + for (var i = 0, l = statements.length; i < l; i++) { + var current = statements[i], + strip = current.strip; - function prepareMustache(path, params, hash, open, strip, locInfo) { - // Must use charAt to support IE pre-10 - var escapeFlag = open.charAt(3) || open.charAt(2), - escaped = escapeFlag !== '{' && escapeFlag !== '&'; + if (!strip) { + continue; + } - return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo)); - } + var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'), + _isNextWhitespace = isNextWhitespace(statements, i, isRoot), - function prepareRawBlock(openRawBlock, content, close, locInfo) { - if (openRawBlock.path.original !== close) { - var errorNode = { loc: openRawBlock.path.loc }; + openStandalone = strip.openStandalone && _isPrevWhitespace, + closeStandalone = strip.closeStandalone && _isNextWhitespace, + inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; - throw new _Exception(openRawBlock.path.original + ' doesn\'t match ' + close, errorNode); - } + if (strip.right) { + omitRight(statements, i, true); + } + if (strip.left) { + omitLeft(statements, i, true); + } - locInfo = this.locInfo(locInfo); - var program = new this.Program([content], null, {}, locInfo); + if (inlineStandalone) { + omitRight(statements, i); - return new this.BlockStatement(openRawBlock.path, openRawBlock.params, openRawBlock.hash, program, undefined, {}, {}, {}, locInfo); - } + if (omitLeft(statements, i)) { + // If we are on a standalone node, save the indent info for partials + if (current.type === 'partial') { + current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : ''; + } + } + } + if (openStandalone) { + omitRight((current.program || current.inverse).statements); - function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { - // When we are chaining inverse calls, we will not have a close path - if (close && close.path && openBlock.path.original !== close.path.original) { - var errorNode = { loc: openBlock.path.loc }; + // Strip out the previous content node if it's whitespace only + omitLeft(statements, i); + } + if (closeStandalone) { + // Always strip the next node + omitRight(statements, i); - throw new _Exception(openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); - } - - program.blockParams = openBlock.blockParams; - - var inverse = undefined, - inverseStrip = undefined; - - if (inverseAndProgram) { - if (inverseAndProgram.chain) { - inverseAndProgram.program.body[0].closeStrip = close.strip; + omitLeft((current.inverse || current.program).statements); + } } - inverseStrip = inverseAndProgram.strip; - inverse = inverseAndProgram.program; + return statements; } - if (inverted) { - inverted = inverse; - inverse = program; - program = inverted; + __exports__.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = statements.length; + } + + // Nodes that end with newlines are considered whitespace (but are special + // cased for strip operations) + var prev = statements[i-1], + sibling = statements[i-2]; + if (!prev) { + return isRoot; + } + + if (prev.type === 'content') { + return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); + } + } + function isNextWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = -1; + } + + var next = statements[i+1], + sibling = statements[i+2]; + if (!next) { + return isRoot; + } + + if (next.type === 'content') { + return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); + } } - return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); - } -}); \ No newline at end of file + // Marks the node to the right of the position as omitted. + // I.e. {{foo}}' ' will mark the ' ' node as omitted. + // + // If i is undefined, then the first child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitRight(statements, i, multiple) { + var current = statements[i == null ? 0 : i + 1]; + if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) { + return; + } + + var original = current.string; + current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); + current.rightStripped = current.string !== original; + } + + // Marks the node to the left of the position as omitted. + // I.e. ' '{{foo}} will mark the ' ' node as omitted. + // + // If i is undefined then the last child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitLeft(statements, i, multiple) { + var current = statements[i == null ? statements.length - 1 : i - 1]; + if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) { + return; + } + + // We omit the last node if it's whitespace only and not preceeded by a non-content node. + var original = current.string; + current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); + current.leftStripped = current.string !== original; + return current.leftStripped; + } + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js b/node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js index befdf50..35cf820 100644 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js +++ b/node_modules/handlebars/dist/amd/handlebars/compiler/javascript-compiler.js @@ -1,1053 +1,968 @@ -define(['exports', 'module', '../base', '../exception', '../utils', './code-gen'], function (exports, module, _base, _exception, _utils, _codeGen) { - 'use strict'; +define( + ["../base","../exception","exports"], + function(__dependency1__, __dependency2__, __exports__) { + "use strict"; + var COMPILER_REVISION = __dependency1__.COMPILER_REVISION; + var REVISION_CHANGES = __dependency1__.REVISION_CHANGES; + var Exception = __dependency2__["default"]; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + function Literal(value) { + this.value = value; + } - var _Exception = _interopRequire(_exception); + function JavaScriptCompiler() {} - var _CodeGen = _interopRequire(_codeGen); - - function Literal(value) { - this.value = value; - } - - function JavaScriptCompiler() {} - - JavaScriptCompiler.prototype = { - // PUBLIC API: You can override these methods in a subclass to provide - // alternative compiled forms for name lookup and buffering semantics - nameLookup: function nameLookup(parent, name /* , type*/) { - if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { - return [parent, '.', name]; - } else { - return [parent, '[\'', name, '\']']; - } - }, - depthedLookup: function depthedLookup(name) { - return [this.aliasable('this.lookup'), '(depths, "', name, '")']; - }, - - compilerInfo: function compilerInfo() { - var revision = _base.COMPILER_REVISION, - versions = _base.REVISION_CHANGES[revision]; - return [revision, versions]; - }, - - appendToBuffer: function appendToBuffer(source, location, explicit) { - // Force a source as this simplifies the merge logic. - if (!_utils.isArray(source)) { - source = [source]; - } - source = this.source.wrap(source, location); - - if (this.environment.isSimple) { - return ['return ', source, ';']; - } else if (explicit) { - // This is a case where the buffer operation occurs as a child of another - // construct, generally braces. We have to explicitly output these buffer - // operations to ensure that the emitted code goes in the correct location. - return ['buffer += ', source, ';']; - } else { - source.appendToBuffer = true; - return source; - } - }, - - initializeBuffer: function initializeBuffer() { - return this.quotedString(''); - }, - // END PUBLIC API - - compile: function compile(environment, options, context, asObject) { - this.environment = environment; - this.options = options; - this.stringParams = this.options.stringParams; - this.trackIds = this.options.trackIds; - this.precompile = !asObject; - - this.name = this.environment.name; - this.isChild = !!context; - this.context = context || { - programs: [], - environments: [] - }; - - this.preamble(); - - this.stackSlot = 0; - this.stackVars = []; - this.aliases = {}; - this.registers = { list: [] }; - this.hashes = []; - this.compileStack = []; - this.inlineStack = []; - this.blockParams = []; - - this.compileChildren(environment, options); - - this.useDepths = this.useDepths || environment.useDepths || this.options.compat; - this.useBlockParams = this.useBlockParams || environment.useBlockParams; - - var opcodes = environment.opcodes, - opcode = undefined, - firstLoc = undefined, - i = undefined, - l = undefined; - - for (i = 0, l = opcodes.length; i < l; i++) { - opcode = opcodes[i]; - - this.source.currentLocation = opcode.loc; - firstLoc = firstLoc || opcode.loc; - this[opcode.opcode].apply(this, opcode.args); - } - - // Flush any trailing content that might be pending. - this.source.currentLocation = firstLoc; - this.pushSource(''); - - /* istanbul ignore next */ - if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { - throw new _Exception('Compile completed with content left on stack'); - } - - var fn = this.createFunctionContext(asObject); - if (!this.isChild) { - var ret = { - compiler: this.compilerInfo(), - main: fn - }; - var programs = this.context.programs; - for (i = 0, l = programs.length; i < l; i++) { - if (programs[i]) { - ret[i] = programs[i]; - } - } - - if (this.environment.usePartial) { - ret.usePartial = true; - } - if (this.options.data) { - ret.useData = true; - } - if (this.useDepths) { - ret.useDepths = true; - } - if (this.useBlockParams) { - ret.useBlockParams = true; - } - if (this.options.compat) { - ret.compat = true; - } - - if (!asObject) { - ret.compiler = JSON.stringify(ret.compiler); - - this.source.currentLocation = { start: { line: 1, column: 0 } }; - ret = this.objectLiteral(ret); - - if (options.srcName) { - ret = ret.toStringWithSourceMap({ file: options.destName }); - ret.map = ret.map && ret.map.toString(); - } else { - ret = ret.toString(); - } + JavaScriptCompiler.prototype = { + // PUBLIC API: You can override these methods in a subclass to provide + // alternative compiled forms for name lookup and buffering semantics + nameLookup: function(parent, name /* , type*/) { + if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { + return parent + "." + name; } else { - ret.compilerOptions = this.options; + return parent + "['" + name + "']"; } + }, + depthedLookup: function(name) { + this.aliases.lookup = 'this.lookup'; - return ret; - } else { - return fn; - } - }, + return 'lookup(depths, "' + name + '")'; + }, - preamble: function preamble() { - // track the last context pushed into place to allow skipping the - // getContext opcode when it would be a noop - this.lastContext = 0; - this.source = new _CodeGen(this.options.srcName); - }, + compilerInfo: function() { + var revision = COMPILER_REVISION, + versions = REVISION_CHANGES[revision]; + return [revision, versions]; + }, - createFunctionContext: function createFunctionContext(asObject) { - var varDeclarations = ''; - - var locals = this.stackVars.concat(this.registers.list); - if (locals.length > 0) { - varDeclarations += ', ' + locals.join(', '); - } - - // Generate minimizer alias mappings - // - // When using true SourceNodes, this will update all references to the given alias - // as the source nodes are reused in situ. For the non-source node compilation mode, - // aliases will not be used, but this case is already being run on the client and - // we aren't concern about minimizing the template size. - var aliasCount = 0; - for (var alias in this.aliases) { - // eslint-disable-line guard-for-in - var node = this.aliases[alias]; - - if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { - varDeclarations += ', alias' + ++aliasCount + '=' + alias; - node.children[0] = 'alias' + aliasCount; - } - } - - var params = ['depth0', 'helpers', 'partials', 'data']; - - if (this.useBlockParams || this.useDepths) { - params.push('blockParams'); - } - if (this.useDepths) { - params.push('depths'); - } - - // Perform a second pass over the output to merge content when possible - var source = this.mergeSource(varDeclarations); - - if (asObject) { - params.push(source); - - return Function.apply(this, params); - } else { - return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); - } - }, - mergeSource: function mergeSource(varDeclarations) { - var isSimple = this.environment.isSimple, - appendOnly = !this.forceBuffer, - appendFirst = undefined, - sourceSeen = undefined, - bufferStart = undefined, - bufferEnd = undefined; - this.source.each(function (line) { - if (line.appendToBuffer) { - if (bufferStart) { - line.prepend(' + '); - } else { - bufferStart = line; - } - bufferEnd = line; - } else { - if (bufferStart) { - if (!sourceSeen) { - appendFirst = true; - } else { - bufferStart.prepend('buffer += '); - } - bufferEnd.add(';'); - bufferStart = bufferEnd = undefined; - } - - sourceSeen = true; - if (!isSimple) { - appendOnly = false; - } - } - }); - - if (appendOnly) { - if (bufferStart) { - bufferStart.prepend('return '); - bufferEnd.add(';'); - } else if (!sourceSeen) { - this.source.push('return "";'); - } - } else { - varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); - - if (bufferStart) { - bufferStart.prepend('return buffer + '); - bufferEnd.add(';'); - } else { - this.source.push('return buffer;'); - } - } - - if (varDeclarations) { - this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); - } - - return this.source.merge(); - }, - - // [blockValue] - // - // On stack, before: hash, inverse, program, value - // On stack, after: return value of blockHelperMissing - // - // The purpose of this opcode is to take a block of the form - // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and - // replace it on the stack with the result of properly - // invoking blockHelperMissing. - blockValue: function blockValue(name) { - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs(name, 0, params); - - var blockName = this.popStack(); - params.splice(1, 0, blockName); - - this.push(this.source.functionCall(blockHelperMissing, 'call', params)); - }, - - // [ambiguousBlockValue] - // - // On stack, before: hash, inverse, program, value - // Compiler value, before: lastHelper=value of last found helper, if any - // On stack, after, if no lastHelper: same as [blockValue] - // On stack, after, if lastHelper: value - ambiguousBlockValue: function ambiguousBlockValue() { - // We're being a bit cheeky and reusing the options value from the prior exec - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs('', 0, params, true); - - this.flushInline(); - - var current = this.topStack(); - params.splice(1, 0, current); - - this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); - }, - - // [appendContent] - // - // On stack, before: ... - // On stack, after: ... - // - // Appends the string value of `content` to the current buffer - appendContent: function appendContent(content) { - if (this.pendingContent) { - content = this.pendingContent + content; - } else { - this.pendingLocation = this.source.currentLocation; - } - - this.pendingContent = content; - }, - - // [append] - // - // On stack, before: value, ... - // On stack, after: ... - // - // Coerces `value` to a String and appends it to the current buffer. - // - // If `value` is truthy, or 0, it is coerced into a string and appended - // Otherwise, the empty string is appended - append: function append() { - if (this.isInline()) { - this.replaceStack(function (current) { - return [' != null ? ', current, ' : ""']; - }); - - this.pushSource(this.appendToBuffer(this.popStack())); - } else { - var local = this.popStack(); - this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); + appendToBuffer: function(string) { if (this.environment.isSimple) { - this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']); + return "return " + string + ";"; + } else { + return { + appendToBuffer: true, + content: string, + toString: function() { return "buffer += " + string + ";"; } + }; } - } - }, + }, - // [appendEscaped] - // - // On stack, before: value, ... - // On stack, after: ... - // - // Escape `value` and append it to the buffer - appendEscaped: function appendEscaped() { - this.pushSource(this.appendToBuffer([this.aliasable('this.escapeExpression'), '(', this.popStack(), ')'])); - }, + initializeBuffer: function() { + return this.quotedString(""); + }, - // [getContext] - // - // On stack, before: ... - // On stack, after: ... - // Compiler value, after: lastContext=depth - // - // Set the value of the `lastContext` compiler value to the depth - getContext: function getContext(depth) { - this.lastContext = depth; - }, + namespace: "Handlebars", + // END PUBLIC API - // [pushContext] - // - // On stack, before: ... - // On stack, after: currentContext, ... - // - // Pushes the value of the current context onto the stack. - pushContext: function pushContext() { - this.pushStackLiteral(this.contextName(this.lastContext)); - }, + compile: function(environment, options, context, asObject) { + this.environment = environment; + this.options = options; + this.stringParams = this.options.stringParams; + this.trackIds = this.options.trackIds; + this.precompile = !asObject; - // [lookupOnContext] - // - // On stack, before: ... - // On stack, after: currentContext[name], ... - // - // Looks up the value of `name` on the current context and pushes - // it onto the stack. - lookupOnContext: function lookupOnContext(parts, falsy, scoped) { - var i = 0; + this.name = this.environment.name; + this.isChild = !!context; + this.context = context || { + programs: [], + environments: [] + }; - if (!scoped && this.options.compat && !this.lastContext) { - // The depthed query is expected to handle the undefined logic for the root level that - // is implemented below, so we evaluate that directly in compat mode - this.push(this.depthedLookup(parts[i++])); - } else { - this.pushContext(); - } + this.preamble(); - this.resolvePath('context', parts, i, falsy); - }, + this.stackSlot = 0; + this.stackVars = []; + this.aliases = {}; + this.registers = { list: [] }; + this.hashes = []; + this.compileStack = []; + this.inlineStack = []; - // [lookupBlockParam] - // - // On stack, before: ... - // On stack, after: blockParam[name], ... - // - // Looks up the value of `parts` on the given block param and pushes - // it onto the stack. - lookupBlockParam: function lookupBlockParam(blockParamId, parts) { - this.useBlockParams = true; + this.compileChildren(environment, options); - this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); - this.resolvePath('context', parts, 1); - }, + this.useDepths = this.useDepths || environment.depths.list.length || this.options.compat; - // [lookupData] - // - // On stack, before: ... - // On stack, after: data, ... - // - // Push the data lookup operator - lookupData: function lookupData(depth, parts) { - if (!depth) { - this.pushStackLiteral('data'); - } else { - this.pushStackLiteral('this.data(data, ' + depth + ')'); - } + var opcodes = environment.opcodes, + opcode, + i, + l; - this.resolvePath('data', parts, 0, true); - }, + for (i = 0, l = opcodes.length; i < l; i++) { + opcode = opcodes[i]; - resolvePath: function resolvePath(type, parts, i, falsy) { - var _this = this; + this[opcode.opcode].apply(this, opcode.args); + } - if (this.options.strict || this.options.assumeObjects) { - this.push(strictLookup(this.options.strict, this, parts, type)); - return; - } + // Flush any trailing content that might be pending. + this.pushSource(''); - var len = parts.length; - for (; i < len; i++) { - /*eslint-disable no-loop-func */ - this.replaceStack(function (current) { - var lookup = _this.nameLookup(current, parts[i], type); - // We want to ensure that zero and false are handled properly if the context (falsy flag) - // needs to have the special handling for these values. - if (!falsy) { - return [' != null ? ', lookup, ' : ', current]; + /* istanbul ignore next */ + if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { + throw new Exception('Compile completed with content left on stack'); + } + + var fn = this.createFunctionContext(asObject); + if (!this.isChild) { + var ret = { + compiler: this.compilerInfo(), + main: fn + }; + var programs = this.context.programs; + for (i = 0, l = programs.length; i < l; i++) { + if (programs[i]) { + ret[i] = programs[i]; + } + } + + if (this.environment.usePartial) { + ret.usePartial = true; + } + if (this.options.data) { + ret.useData = true; + } + if (this.useDepths) { + ret.useDepths = true; + } + if (this.options.compat) { + ret.compat = true; + } + + if (!asObject) { + ret.compiler = JSON.stringify(ret.compiler); + ret = this.objectLiteral(ret); + } + + return ret; + } else { + return fn; + } + }, + + preamble: function() { + // track the last context pushed into place to allow skipping the + // getContext opcode when it would be a noop + this.lastContext = 0; + this.source = []; + }, + + createFunctionContext: function(asObject) { + var varDeclarations = ''; + + var locals = this.stackVars.concat(this.registers.list); + if(locals.length > 0) { + varDeclarations += ", " + locals.join(", "); + } + + // Generate minimizer alias mappings + for (var alias in this.aliases) { + if (this.aliases.hasOwnProperty(alias)) { + varDeclarations += ', ' + alias + '=' + this.aliases[alias]; + } + } + + var params = ["depth0", "helpers", "partials", "data"]; + + if (this.useDepths) { + params.push('depths'); + } + + // Perform a second pass over the output to merge content when possible + var source = this.mergeSource(varDeclarations); + + if (asObject) { + params.push(source); + + return Function.apply(this, params); + } else { + return 'function(' + params.join(',') + ') {\n ' + source + '}'; + } + }, + mergeSource: function(varDeclarations) { + var source = '', + buffer, + appendOnly = !this.forceBuffer, + appendFirst; + + for (var i = 0, len = this.source.length; i < len; i++) { + var line = this.source[i]; + if (line.appendToBuffer) { + if (buffer) { + buffer = buffer + '\n + ' + line.content; + } else { + buffer = line.content; + } } else { - // Otherwise we can use generic falsy handling - return [' && ', lookup]; + if (buffer) { + if (!source) { + appendFirst = true; + source = buffer + ';\n '; + } else { + source += 'buffer += ' + buffer + ';\n '; + } + buffer = undefined; + } + source += line + '\n '; + + if (!this.environment.isSimple) { + appendOnly = false; + } } - }); - /*eslint-enable no-loop-func */ - } - }, - - // [resolvePossibleLambda] - // - // On stack, before: value, ... - // On stack, after: resolved value, ... - // - // If the `value` is a lambda, replace it on the stack by - // the return value of the lambda - resolvePossibleLambda: function resolvePossibleLambda() { - this.push([this.aliasable('this.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); - }, - - // [pushStringParam] - // - // On stack, before: ... - // On stack, after: string, currentContext, ... - // - // This opcode is designed for use in string mode, which - // provides the string value of a parameter along with its - // depth rather than resolving it immediately. - pushStringParam: function pushStringParam(string, type) { - this.pushContext(); - this.pushString(type); - - // If it's a subexpression, the string result - // will be pushed after this opcode. - if (type !== 'SubExpression') { - if (typeof string === 'string') { - this.pushString(string); - } else { - this.pushStackLiteral(string); } - } - }, - emptyHash: function emptyHash(omitEmpty) { - if (this.trackIds) { - this.push('{}'); // hashIds - } - if (this.stringParams) { - this.push('{}'); // hashContexts - this.push('{}'); // hashTypes - } - this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); - }, - pushHash: function pushHash() { - if (this.hash) { - this.hashes.push(this.hash); - } - this.hash = { values: [], types: [], contexts: [], ids: [] }; - }, - popHash: function popHash() { - var hash = this.hash; - this.hash = this.hashes.pop(); - - if (this.trackIds) { - this.push(this.objectLiteral(hash.ids)); - } - if (this.stringParams) { - this.push(this.objectLiteral(hash.contexts)); - this.push(this.objectLiteral(hash.types)); - } - - this.push(this.objectLiteral(hash.values)); - }, - - // [pushString] - // - // On stack, before: ... - // On stack, after: quotedString(string), ... - // - // Push a quoted version of `string` onto the stack - pushString: function pushString(string) { - this.pushStackLiteral(this.quotedString(string)); - }, - - // [pushLiteral] - // - // On stack, before: ... - // On stack, after: value, ... - // - // Pushes a value onto the stack. This operation prevents - // the compiler from creating a temporary variable to hold - // it. - pushLiteral: function pushLiteral(value) { - this.pushStackLiteral(value); - }, - - // [pushProgram] - // - // On stack, before: ... - // On stack, after: program(guid), ... - // - // Push a program expression onto the stack. This takes - // a compile-time guid and converts it into a runtime-accessible - // expression. - pushProgram: function pushProgram(guid) { - if (guid != null) { - this.pushStackLiteral(this.programExpression(guid)); - } else { - this.pushStackLiteral(null); - } - }, - - // [invokeHelper] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of helper invocation - // - // Pops off the helper's parameters, invokes the helper, - // and pushes the helper's return value onto the stack. - // - // If the helper is not found, `helperMissing` is called. - invokeHelper: function invokeHelper(paramSize, name, isSimple) { - var nonHelper = this.popStack(), - helper = this.setupHelper(paramSize, name), - simple = isSimple ? [helper.name, ' || '] : ''; - - var lookup = ['('].concat(simple, nonHelper); - if (!this.options.strict) { - lookup.push(' || ', this.aliasable('helpers.helperMissing')); - } - lookup.push(')'); - - this.push(this.source.functionCall(lookup, 'call', helper.callParams)); - }, - - // [invokeKnownHelper] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of helper invocation - // - // This operation is used when the helper is known to exist, - // so a `helperMissing` fallback is not required. - invokeKnownHelper: function invokeKnownHelper(paramSize, name) { - var helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); - }, - - // [invokeAmbiguous] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of disambiguation - // - // This operation is used when an expression like `{{foo}}` - // is provided, but we don't know at compile-time whether it - // is a helper or a path. - // - // This operation emits more code than the other options, - // and can be avoided by passing the `knownHelpers` and - // `knownHelpersOnly` flags at compile-time. - invokeAmbiguous: function invokeAmbiguous(name, helperCall) { - this.useRegister('helper'); - - var nonHelper = this.popStack(); - - this.emptyHash(); - var helper = this.setupHelper(0, name, helperCall); - - var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); - - var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; - if (!this.options.strict) { - lookup[0] = '(helper = '; - lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing')); - } - - this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); - }, - - // [invokePartial] - // - // On stack, before: context, ... - // On stack after: result of partial invocation - // - // This operation pops off a context, invokes a partial with that context, - // and pushes the result of the invocation back. - invokePartial: function invokePartial(isDynamic, name, indent) { - var params = [], - options = this.setupParams(name, 1, params, false); - - if (isDynamic) { - name = this.popStack(); - delete options.name; - } - - if (indent) { - options.indent = JSON.stringify(indent); - } - options.helpers = 'helpers'; - options.partials = 'partials'; - - if (!isDynamic) { - params.unshift(this.nameLookup('partials', name, 'partial')); - } else { - params.unshift(name); - } - - if (this.options.compat) { - options.depths = 'depths'; - } - options = this.objectLiteral(options); - params.push(options); - - this.push(this.source.functionCall('this.invokePartial', '', params)); - }, - - // [assignToHash] - // - // On stack, before: value, ..., hash, ... - // On stack, after: ..., hash, ... - // - // Pops a value off the stack and assigns it to the current hash - assignToHash: function assignToHash(key) { - var value = this.popStack(), - context = undefined, - type = undefined, - id = undefined; - - if (this.trackIds) { - id = this.popStack(); - } - if (this.stringParams) { - type = this.popStack(); - context = this.popStack(); - } - - var hash = this.hash; - if (context) { - hash.contexts[key] = context; - } - if (type) { - hash.types[key] = type; - } - if (id) { - hash.ids[key] = id; - } - hash.values[key] = value; - }, - - pushId: function pushId(type, name, child) { - if (type === 'BlockParam') { - this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); - } else if (type === 'PathExpression') { - this.pushString(name); - } else if (type === 'SubExpression') { - this.pushStackLiteral('true'); - } else { - this.pushStackLiteral('null'); - } - }, - - // HELPERS - - compiler: JavaScriptCompiler, - - compileChildren: function compileChildren(environment, options) { - var children = environment.children, - child = undefined, - compiler = undefined; - - for (var i = 0, l = children.length; i < l; i++) { - child = children[i]; - compiler = new this.compiler(); // eslint-disable-line new-cap - - var index = this.matchExistingProgram(child); - - if (index == null) { - this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children - index = this.context.programs.length; - child.index = index; - child.name = 'program' + index; - this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); - this.context.environments[index] = child; - - this.useDepths = this.useDepths || compiler.useDepths; - this.useBlockParams = this.useBlockParams || compiler.useBlockParams; - } else { - child.index = index; - child.name = 'program' + index; - - this.useDepths = this.useDepths || child.useDepths; - this.useBlockParams = this.useBlockParams || child.useBlockParams; - } - } - }, - matchExistingProgram: function matchExistingProgram(child) { - for (var i = 0, len = this.context.environments.length; i < len; i++) { - var environment = this.context.environments[i]; - if (environment && environment.equals(child)) { - return i; - } - } - }, - - programExpression: function programExpression(guid) { - var child = this.environment.children[guid], - programParams = [child.index, 'data', child.blockParams]; - - if (this.useBlockParams || this.useDepths) { - programParams.push('blockParams'); - } - if (this.useDepths) { - programParams.push('depths'); - } - - return 'this.program(' + programParams.join(', ') + ')'; - }, - - useRegister: function useRegister(name) { - if (!this.registers[name]) { - this.registers[name] = true; - this.registers.list.push(name); - } - }, - - push: function push(expr) { - if (!(expr instanceof Literal)) { - expr = this.source.wrap(expr); - } - - this.inlineStack.push(expr); - return expr; - }, - - pushStackLiteral: function pushStackLiteral(item) { - this.push(new Literal(item)); - }, - - pushSource: function pushSource(source) { - if (this.pendingContent) { - this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); - this.pendingContent = undefined; - } - - if (source) { - this.source.push(source); - } - }, - - replaceStack: function replaceStack(callback) { - var prefix = ['('], - stack = undefined, - createdStack = undefined, - usedLiteral = undefined; - - /* istanbul ignore next */ - if (!this.isInline()) { - throw new _Exception('replaceStack on non-inline'); - } - - // We want to merge the inline statement into the replacement statement via ',' - var top = this.popStack(true); - - if (top instanceof Literal) { - // Literals do not need to be inlined - stack = [top.value]; - prefix = ['(', stack]; - usedLiteral = true; - } else { - // Get or create the current stack name for use by the inline - createdStack = true; - var _name = this.incrStack(); - - prefix = ['((', this.push(_name), ' = ', top, ')']; - stack = this.topStack(); - } - - var item = callback.call(this, stack); - - if (!usedLiteral) { - this.popStack(); - } - if (createdStack) { - this.stackSlot--; - } - this.push(prefix.concat(item, ')')); - }, - - incrStack: function incrStack() { - this.stackSlot++; - if (this.stackSlot > this.stackVars.length) { - this.stackVars.push('stack' + this.stackSlot); - } - return this.topStackName(); - }, - topStackName: function topStackName() { - return 'stack' + this.stackSlot; - }, - flushInline: function flushInline() { - var inlineStack = this.inlineStack; - this.inlineStack = []; - for (var i = 0, len = inlineStack.length; i < len; i++) { - var entry = inlineStack[i]; - /* istanbul ignore if */ - if (entry instanceof Literal) { - this.compileStack.push(entry); - } else { - var stack = this.incrStack(); - this.pushSource([stack, ' = ', entry, ';']); - this.compileStack.push(stack); - } - } - }, - isInline: function isInline() { - return this.inlineStack.length; - }, - - popStack: function popStack(wrapped) { - var inline = this.isInline(), - item = (inline ? this.inlineStack : this.compileStack).pop(); - - if (!wrapped && item instanceof Literal) { - return item.value; - } else { - if (!inline) { - /* istanbul ignore next */ - if (!this.stackSlot) { - throw new _Exception('Invalid stack pop'); + if (appendOnly) { + if (buffer || !source) { + source += 'return ' + (buffer || '""') + ';\n'; + } + } else { + varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer()); + if (buffer) { + source += 'return buffer + ' + buffer + ';\n'; + } else { + source += 'return buffer;\n'; } - this.stackSlot--; } - return item; - } - }, - topStack: function topStack() { - var stack = this.isInline() ? this.inlineStack : this.compileStack, - item = stack[stack.length - 1]; + if (varDeclarations) { + source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source; + } - /* istanbul ignore if */ - if (item instanceof Literal) { - return item.value; - } else { - return item; - } - }, + return source; + }, - contextName: function contextName(context) { - if (this.useDepths && context) { - return 'depths[' + context + ']'; - } else { - return 'depth' + context; - } - }, + // [blockValue] + // + // On stack, before: hash, inverse, program, value + // On stack, after: return value of blockHelperMissing + // + // The purpose of this opcode is to take a block of the form + // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and + // replace it on the stack with the result of properly + // invoking blockHelperMissing. + blockValue: function(name) { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; - quotedString: function quotedString(str) { - return this.source.quotedString(str); - }, + var params = [this.contextName(0)]; + this.setupParams(name, 0, params); - objectLiteral: function objectLiteral(obj) { - return this.source.objectLiteral(obj); - }, + var blockName = this.popStack(); + params.splice(1, 0, blockName); - aliasable: function aliasable(name) { - var ret = this.aliases[name]; - if (ret) { - ret.referenceCount++; - return ret; - } + this.push('blockHelperMissing.call(' + params.join(', ') + ')'); + }, - ret = this.aliases[name] = this.source.wrap(name); - ret.aliasable = true; - ret.referenceCount = 1; + // [ambiguousBlockValue] + // + // On stack, before: hash, inverse, program, value + // Compiler value, before: lastHelper=value of last found helper, if any + // On stack, after, if no lastHelper: same as [blockValue] + // On stack, after, if lastHelper: value + ambiguousBlockValue: function() { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; - return ret; - }, + // We're being a bit cheeky and reusing the options value from the prior exec + var params = [this.contextName(0)]; + this.setupParams('', 0, params, true); - setupHelper: function setupHelper(paramSize, name, blockHelper) { - var params = [], - paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); - var foundHelper = this.nameLookup('helpers', name, 'helper'); + this.flushInline(); - return { - params: params, - paramsInit: paramsInit, - name: foundHelper, - callParams: [this.contextName(0)].concat(params) - }; - }, + var current = this.topStack(); + params.splice(1, 0, current); - setupParams: function setupParams(helper, paramSize, params) { - var options = {}, - contexts = [], - types = [], - ids = [], - param = undefined; + this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }"); + }, - options.name = this.quotedString(helper); - options.hash = this.popStack(); + // [appendContent] + // + // On stack, before: ... + // On stack, after: ... + // + // Appends the string value of `content` to the current buffer + appendContent: function(content) { + if (this.pendingContent) { + content = this.pendingContent + content; + } - if (this.trackIds) { - options.hashIds = this.popStack(); - } - if (this.stringParams) { - options.hashTypes = this.popStack(); - options.hashContexts = this.popStack(); - } + this.pendingContent = content; + }, - var inverse = this.popStack(), - program = this.popStack(); + // [append] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Coerces `value` to a String and appends it to the current buffer. + // + // If `value` is truthy, or 0, it is coerced into a string and appended + // Otherwise, the empty string is appended + append: function() { + // Force anything that is inlined onto the stack so we don't have duplication + // when we examine local + this.flushInline(); + var local = this.popStack(); + this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }'); + if (this.environment.isSimple) { + this.pushSource("else { " + this.appendToBuffer("''") + " }"); + } + }, - // Avoid setting fn and inverse if neither are set. This allows - // helpers to do a check for `if (options.fn)` - if (program || inverse) { - options.fn = program || 'this.noop'; - options.inverse = inverse || 'this.noop'; - } + // [appendEscaped] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Escape `value` and append it to the buffer + appendEscaped: function() { + this.aliases.escapeExpression = 'this.escapeExpression'; - // The parameters go on to the stack in order (making sure that they are evaluated in order) - // so we need to pop them off the stack in reverse order - var i = paramSize; - while (i--) { - param = this.popStack(); - params[i] = param; + this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")); + }, + + // [getContext] + // + // On stack, before: ... + // On stack, after: ... + // Compiler value, after: lastContext=depth + // + // Set the value of the `lastContext` compiler value to the depth + getContext: function(depth) { + this.lastContext = depth; + }, + + // [pushContext] + // + // On stack, before: ... + // On stack, after: currentContext, ... + // + // Pushes the value of the current context onto the stack. + pushContext: function() { + this.pushStackLiteral(this.contextName(this.lastContext)); + }, + + // [lookupOnContext] + // + // On stack, before: ... + // On stack, after: currentContext[name], ... + // + // Looks up the value of `name` on the current context and pushes + // it onto the stack. + lookupOnContext: function(parts, falsy, scoped) { + /*jshint -W083 */ + var i = 0, + len = parts.length; + + if (!scoped && this.options.compat && !this.lastContext) { + // The depthed query is expected to handle the undefined logic for the root level that + // is implemented below, so we evaluate that directly in compat mode + this.push(this.depthedLookup(parts[i++])); + } else { + this.pushContext(); + } + + for (; i < len; i++) { + this.replaceStack(function(current) { + var lookup = this.nameLookup(current, parts[i], 'context'); + // We want to ensure that zero and false are handled properly if the context (falsy flag) + // needs to have the special handling for these values. + if (!falsy) { + return ' != null ? ' + lookup + ' : ' + current; + } else { + // Otherwise we can use generic falsy handling + return ' && ' + lookup; + } + }); + } + }, + + // [lookupData] + // + // On stack, before: ... + // On stack, after: data, ... + // + // Push the data lookup operator + lookupData: function(depth, parts) { + /*jshint -W083 */ + if (!depth) { + this.pushStackLiteral('data'); + } else { + this.pushStackLiteral('this.data(data, ' + depth + ')'); + } + + var len = parts.length; + for (var i = 0; i < len; i++) { + this.replaceStack(function(current) { + return ' && ' + this.nameLookup(current, parts[i], 'data'); + }); + } + }, + + // [resolvePossibleLambda] + // + // On stack, before: value, ... + // On stack, after: resolved value, ... + // + // If the `value` is a lambda, replace it on the stack by + // the return value of the lambda + resolvePossibleLambda: function() { + this.aliases.lambda = 'this.lambda'; + + this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')'); + }, + + // [pushStringParam] + // + // On stack, before: ... + // On stack, after: string, currentContext, ... + // + // This opcode is designed for use in string mode, which + // provides the string value of a parameter along with its + // depth rather than resolving it immediately. + pushStringParam: function(string, type) { + this.pushContext(); + this.pushString(type); + + // If it's a subexpression, the string result + // will be pushed after this opcode. + if (type !== 'sexpr') { + if (typeof string === 'string') { + this.pushString(string); + } else { + this.pushStackLiteral(string); + } + } + }, + + emptyHash: function() { + this.pushStackLiteral('{}'); if (this.trackIds) { - ids[i] = this.popStack(); + this.push('{}'); // hashIds } if (this.stringParams) { - types[i] = this.popStack(); - contexts[i] = this.popStack(); + this.push('{}'); // hashContexts + this.push('{}'); // hashTypes + } + }, + pushHash: function() { + if (this.hash) { + this.hashes.push(this.hash); + } + this.hash = {values: [], types: [], contexts: [], ids: []}; + }, + popHash: function() { + var hash = this.hash; + this.hash = this.hashes.pop(); + + if (this.trackIds) { + this.push('{' + hash.ids.join(',') + '}'); + } + if (this.stringParams) { + this.push('{' + hash.contexts.join(',') + '}'); + this.push('{' + hash.types.join(',') + '}'); + } + + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); + }, + + // [pushString] + // + // On stack, before: ... + // On stack, after: quotedString(string), ... + // + // Push a quoted version of `string` onto the stack + pushString: function(string) { + this.pushStackLiteral(this.quotedString(string)); + }, + + // [push] + // + // On stack, before: ... + // On stack, after: expr, ... + // + // Push an expression onto the stack + push: function(expr) { + this.inlineStack.push(expr); + return expr; + }, + + // [pushLiteral] + // + // On stack, before: ... + // On stack, after: value, ... + // + // Pushes a value onto the stack. This operation prevents + // the compiler from creating a temporary variable to hold + // it. + pushLiteral: function(value) { + this.pushStackLiteral(value); + }, + + // [pushProgram] + // + // On stack, before: ... + // On stack, after: program(guid), ... + // + // Push a program expression onto the stack. This takes + // a compile-time guid and converts it into a runtime-accessible + // expression. + pushProgram: function(guid) { + if (guid != null) { + this.pushStackLiteral(this.programExpression(guid)); + } else { + this.pushStackLiteral(null); + } + }, + + // [invokeHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // Pops off the helper's parameters, invokes the helper, + // and pushes the helper's return value onto the stack. + // + // If the helper is not found, `helperMissing` is called. + invokeHelper: function(paramSize, name, isSimple) { + this.aliases.helperMissing = 'helpers.helperMissing'; + + var nonHelper = this.popStack(); + var helper = this.setupHelper(paramSize, name); + + var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing'; + this.push('((' + lookup + ').call(' + helper.callParams + '))'); + }, + + // [invokeKnownHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // This operation is used when the helper is known to exist, + // so a `helperMissing` fallback is not required. + invokeKnownHelper: function(paramSize, name) { + var helper = this.setupHelper(paramSize, name); + this.push(helper.name + ".call(" + helper.callParams + ")"); + }, + + // [invokeAmbiguous] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of disambiguation + // + // This operation is used when an expression like `{{foo}}` + // is provided, but we don't know at compile-time whether it + // is a helper or a path. + // + // This operation emits more code than the other options, + // and can be avoided by passing the `knownHelpers` and + // `knownHelpersOnly` flags at compile-time. + invokeAmbiguous: function(name, helperCall) { + this.aliases.functionType = '"function"'; + this.aliases.helperMissing = 'helpers.helperMissing'; + this.useRegister('helper'); + + var nonHelper = this.popStack(); + + this.emptyHash(); + var helper = this.setupHelper(0, name, helperCall); + + var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); + + this.push( + '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing' + + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),' + + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))'); + }, + + // [invokePartial] + // + // On stack, before: context, ... + // On stack after: result of partial invocation + // + // This operation pops off a context, invokes a partial with that context, + // and pushes the result of the invocation back. + invokePartial: function(name, indent) { + var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"]; + + if (this.options.data) { + params.push("data"); + } else if (this.options.compat) { + params.push('undefined'); + } + if (this.options.compat) { + params.push('depths'); + } + + this.push("this.invokePartial(" + params.join(", ") + ")"); + }, + + // [assignToHash] + // + // On stack, before: value, ..., hash, ... + // On stack, after: ..., hash, ... + // + // Pops a value off the stack and assigns it to the current hash + assignToHash: function(key) { + var value = this.popStack(), + context, + type, + id; + + if (this.trackIds) { + id = this.popStack(); + } + if (this.stringParams) { + type = this.popStack(); + context = this.popStack(); + } + + var hash = this.hash; + if (context) { + hash.contexts.push("'" + key + "': " + context); + } + if (type) { + hash.types.push("'" + key + "': " + type); + } + if (id) { + hash.ids.push("'" + key + "': " + id); + } + hash.values.push("'" + key + "': (" + value + ")"); + }, + + pushId: function(type, name) { + if (type === 'ID' || type === 'DATA') { + this.pushString(name); + } else if (type === 'sexpr') { + this.pushStackLiteral('true'); + } else { + this.pushStackLiteral('null'); + } + }, + + // HELPERS + + compiler: JavaScriptCompiler, + + compileChildren: function(environment, options) { + var children = environment.children, child, compiler; + + for(var i=0, l=children.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } + return this.topStackName(); + }, + topStackName: function() { + return "stack" + this.stackSlot; + }, + flushInline: function() { + var inlineStack = this.inlineStack; + if (inlineStack.length) { + this.inlineStack = []; + for (var i = 0, len = inlineStack.length; i < len; i++) { + var entry = inlineStack[i]; + if (entry instanceof Literal) { + this.compileStack.push(entry); + } else { + this.pushStack(entry); + } + } + } + }, + isInline: function() { + return this.inlineStack.length; + }, + + popStack: function(wrapped) { + var inline = this.isInline(), + item = (inline ? this.inlineStack : this.compileStack).pop(); + + if (!wrapped && (item instanceof Literal)) { + return item.value; + } else { + if (!inline) { + /* istanbul ignore next */ + if (!this.stackSlot) { + throw new Exception('Invalid stack pop'); + } + this.stackSlot--; + } + return item; + } + }, + + topStack: function() { + var stack = (this.isInline() ? this.inlineStack : this.compileStack), + item = stack[stack.length - 1]; + + if (item instanceof Literal) { + return item.value; + } else { + return item; + } + }, + + contextName: function(context) { + if (this.useDepths && context) { + return 'depths[' + context + ']'; + } else { + return 'depth' + context; + } + }, + + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 + .replace(/\u2029/g, '\\u2029') + '"'; + }, + + objectLiteral: function(obj) { + var pairs = []; + + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + pairs.push(this.quotedString(key) + ':' + obj[key]); + } + } + + return '{' + pairs.join(',') + '}'; + }, + + setupHelper: function(paramSize, name, blockHelper) { + var params = [], + paramsInit = this.setupParams(name, paramSize, params, blockHelper); + var foundHelper = this.nameLookup('helpers', name, 'helper'); + + return { + params: params, + paramsInit: paramsInit, + name: foundHelper, + callParams: [this.contextName(0)].concat(params).join(", ") + }; + }, + + setupOptions: function(helper, paramSize, params) { + var options = {}, contexts = [], types = [], ids = [], param, inverse, program; + + options.name = this.quotedString(helper); + options.hash = this.popStack(); + + if (this.trackIds) { + options.hashIds = this.popStack(); + } + if (this.stringParams) { + options.hashTypes = this.popStack(); + options.hashContexts = this.popStack(); + } + + inverse = this.popStack(); + program = this.popStack(); + + // Avoid setting fn and inverse if neither are set. This allows + // helpers to do a check for `if (options.fn)` + if (program || inverse) { + if (!program) { + program = 'this.noop'; + } + + if (!inverse) { + inverse = 'this.noop'; + } + + options.fn = program; + options.inverse = inverse; + } + + // The parameters go on to the stack in order (making sure that they are evaluated in order) + // so we need to pop them off the stack in reverse order + var i = paramSize; + while (i--) { + param = this.popStack(); + params[i] = param; + + if (this.trackIds) { + ids[i] = this.popStack(); + } + if (this.stringParams) { + types[i] = this.popStack(); + contexts[i] = this.popStack(); + } + } + + if (this.trackIds) { + options.ids = "[" + ids.join(",") + "]"; + } + if (this.stringParams) { + options.types = "[" + types.join(",") + "]"; + options.contexts = "[" + contexts.join(",") + "]"; + } + + if (this.options.data) { + options.data = "data"; + } + + return options; + }, + + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(helperName, paramSize, params, useRegister) { + var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params)); + + if (useRegister) { + this.useRegister('options'); + params.push('options'); + return 'options=' + options; + } else { + params.push(options); + return ''; } } + }; - if (this.trackIds) { - options.ids = this.source.generateArray(ids); - } - if (this.stringParams) { - options.types = this.source.generateArray(types); - options.contexts = this.source.generateArray(contexts); - } - - if (this.options.data) { - options.data = 'data'; - } - if (this.useBlockParams) { - options.blockParams = 'blockParams'; - } - return options; - }, - - setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { - var options = this.setupParams(helper, paramSize, params, true); - options = this.objectLiteral(options); - if (useRegister) { - this.useRegister('options'); - params.push('options'); - return ['options=', options]; - } else { - params.push(options); - return ''; - } - } - }; - - (function () { - var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); + var reservedWords = ( + "break else new var" + + " case finally return void" + + " catch for switch while" + + " continue function this with" + + " default if throw" + + " delete in try" + + " do instanceof typeof" + + " abstract enum int short" + + " boolean export interface static" + + " byte extends long super" + + " char final native synchronized" + + " class float package throws" + + " const goto private transient" + + " debugger implements protected volatile" + + " double import public let yield" + ).split(" "); var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - for (var i = 0, l = reservedWords.length; i < l; i++) { + for(var i=0, l=reservedWords.length; i 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - if (!recovering) { - expected = []; - for (p in table[state]) if (this.terminals_[p] && p > 2) { - expected.push("'" + this.terminals_[p] + "'"); - } - if (this.lexer.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); - } - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) recovering--; - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; - if (ranges) { - yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: return true; } - }; - /* Jison generated lexer */ - var lexer = (function () { - var lexer = { EOF: 1, - parseError: function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - setInput: function setInput(input) { - this._input = input; - this._more = this._less = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; - if (this.options.ranges) this.yylloc.range = [0, 0]; - this.offset = 0; - return this; - }, - input: function input() { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) this.yylloc.range[1]++; + } + return true; + } + }; + /* Jison generated lexer */ + var lexer = (function(){ + var lexer = ({EOF:1, + parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, + input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; - this._input = this._input.slice(1); - return ch; - }, - unput: function unput(ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = this._input.slice(1); + return ch; + }, + unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); - if (lines.length - 1) this.yylineno -= lines.length - 1; - var r = this.yylloc.range; + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; - this.yylloc = { first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - return this; - }, - more: function more() { - this._more = true; - return this; - }, - less: function less(n) { - this.unput(this.match.slice(n)); - }, - pastInput: function pastInput() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - upcomingInput: function upcomingInput() { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20 - next.length); - } - return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - showPosition: function showPosition() { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - next: function next() { - if (this.done) { - return this.EOF; - } - if (!this._input) this.done = true; + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, + more:function () { + this._more = true; + return this; + }, + less:function (n) { + this.unput(this.match.slice(n)); + }, + pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, + showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, + next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; - var token, match, tempMatch, index, col, lines; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (!this.options.flex) break; - } - } - if (match) { - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) this.yylineno += lines.length; - this.yylloc = { first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) this.done = false; - if (token) { - return token; - } else { - return; - } - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); - } - }, - lex: function lex() { - var r = this.next(); - if (typeof r !== "undefined") { - return r; - } else { - return this.lex(); - } - }, - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - popState: function popState() { - return this.conditionStack.pop(); - }, - _currentRules: function _currentRules() { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - }, - topState: function topState() { - return this.conditionStack[this.conditionStack.length - 2]; - }, - pushState: function begin(condition) { - this.begin(condition); - } }; - lexer.options = {}; - lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - - function strip(start, end) { - return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end); + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; } - - var YYSTATE = YY_START; - switch ($avoiding_name_collisions) { - case 0: - if (yy_.yytext.slice(-2) === "\\\\") { - strip(0, 1); - this.begin("mu"); - } else if (yy_.yytext.slice(-1) === "\\") { - strip(0, 1); - this.begin("emu"); - } else { - this.begin("mu"); - } - if (yy_.yytext) { - return 14; - }break; - case 1: - return 14; - break; - case 2: - this.popState(); - return 14; - - break; - case 3: - yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9); - this.popState(); - return 16; - - break; - case 4: - return 14; - break; - case 5: - this.popState(); - return 13; - - break; - case 6: - return 59; - break; - case 7: - return 62; - break; - case 8: - return 17; - break; - case 9: - this.popState(); - this.begin("raw"); - return 21; - - break; - case 10: - return 53; - break; - case 11: - return 27; - break; - case 12: - return 45; - break; - case 13: - this.popState();return 42; - break; - case 14: - this.popState();return 42; - break; - case 15: - return 32; - break; - case 16: - return 37; - break; - case 17: - return 49; - break; - case 18: - return 46; - break; - case 19: - this.unput(yy_.yytext); - this.popState(); - this.begin("com"); - - break; - case 20: - this.popState(); - return 13; - - break; - case 21: - return 46; - break; - case 22: - return 67; - break; - case 23: - return 66; - break; - case 24: - return 66; - break; - case 25: - return 81; - break; - case 26: - // ignore whitespace - break; - case 27: - this.popState();return 52; - break; - case 28: - this.popState();return 31; - break; - case 29: - yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74; - break; - case 30: - yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 74; - break; - case 31: - return 79; - break; - case 32: - return 76; - break; - case 33: - return 76; - break; - case 34: - return 77; - break; - case 35: - return 78; - break; - case 36: - return 75; - break; - case 37: - return 69; - break; - case 38: - return 71; - break; - case 39: - return 66; - break; - case 40: - return 66; - break; - case 41: - return "INVALID"; - break; - case 42: - return 5; - break; + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; } - }; - lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/]; - lexer.conditions = { mu: { rules: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } }; - return lexer; - })(); - parser.lexer = lexer; - function Parser() { - this.yy = {}; - }Parser.prototype = parser;parser.Parser = Parser; - return new Parser(); - })();module.exports = handlebars; -}); \ No newline at end of file + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, + lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, + begin:function begin(condition) { + this.conditionStack.push(condition); + }, + popState:function popState() { + return this.conditionStack.pop(); + }, + _currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, + topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, + pushState:function begin(condition) { + this.begin(condition); + }}); + lexer.options = {}; + lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + + + function strip(start, end) { + return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end); + } + + + var YYSTATE=YY_START + switch($avoiding_name_collisions) { + case 0: + if(yy_.yytext.slice(-2) === "\\\\") { + strip(0,1); + this.begin("mu"); + } else if(yy_.yytext.slice(-1) === "\\") { + strip(0,1); + this.begin("emu"); + } else { + this.begin("mu"); + } + if(yy_.yytext) return 12; + + break; + case 1:return 12; + break; + case 2: + this.popState(); + return 12; + + break; + case 3: + yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9); + this.popState(); + return 15; + + break; + case 4: return 12; + break; + case 5:strip(0,4); this.popState(); return 13; + break; + case 6:return 45; + break; + case 7:return 46; + break; + case 8: return 16; + break; + case 9: + this.popState(); + this.begin('raw'); + return 18; + + break; + case 10:return 34; + break; + case 11:return 24; + break; + case 12:return 29; + break; + case 13:this.popState(); return 28; + break; + case 14:this.popState(); return 28; + break; + case 15:return 26; + break; + case 16:return 26; + break; + case 17:return 32; + break; + case 18:return 31; + break; + case 19:this.popState(); this.begin('com'); + break; + case 20:strip(3,5); this.popState(); return 13; + break; + case 21:return 31; + break; + case 22:return 51; + break; + case 23:return 50; + break; + case 24:return 50; + break; + case 25:return 54; + break; + case 26:// ignore whitespace + break; + case 27:this.popState(); return 33; + break; + case 28:this.popState(); return 25; + break; + case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42; + break; + case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42; + break; + case 31:return 52; + break; + case 32:return 44; + break; + case 33:return 44; + break; + case 34:return 43; + break; + case 35:return 50; + break; + case 36:yy_.yytext = strip(1,2); return 50; + break; + case 37:return 'INVALID'; + break; + case 38:return 5; + break; + } + }; + lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; + lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}}; + return lexer;})() + parser.lexer = lexer; + function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; + return new Parser; + })();__exports__["default"] = handlebars; + /* jshint ignore:end */ + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/printer.js b/node_modules/handlebars/dist/amd/handlebars/compiler/printer.js index 6b4c230..e2663b7 100644 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/printer.js +++ b/node_modules/handlebars/dist/amd/handlebars/compiler/printer.js @@ -1,165 +1,145 @@ -define(['exports', './visitor'], function (exports, _visitor) { - 'use strict'; +define( + ["./visitor","exports"], + function(__dependency1__, __exports__) { + "use strict"; + var Visitor = __dependency1__["default"]; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.print = print; - exports.PrintVisitor = PrintVisitor; - /*eslint-disable new-cap */ - - var _Visitor = _interopRequire(_visitor); - - function print(ast) { - return new PrintVisitor().accept(ast); - } - - function PrintVisitor() { - this.padding = 0; - } - - PrintVisitor.prototype = new _Visitor(); - - PrintVisitor.prototype.pad = function (string) { - var out = ''; - - for (var i = 0, l = this.padding; i < l; i++) { - out = out + ' '; + function print(ast) { + return new PrintVisitor().accept(ast); } - out = out + string + '\n'; - return out; - }; + __exports__.print = print;function PrintVisitor() { + this.padding = 0; + } - PrintVisitor.prototype.Program = function (program) { - var out = '', - body = program.body, - i = undefined, - l = undefined; + __exports__.PrintVisitor = PrintVisitor;PrintVisitor.prototype = new Visitor(); - if (program.blockParams) { - var blockParams = 'BLOCK PARAMS: ['; - for (i = 0, l = program.blockParams.length; i < l; i++) { - blockParams += ' ' + program.blockParams[i]; + PrintVisitor.prototype.pad = function(string) { + var out = ""; + + for(var i=0,l=this.padding; i ' + content + ' }}'); - }; + PrintVisitor.prototype.sexpr = function(sexpr) { + var params = sexpr.params, paramStrings = [], hash; - PrintVisitor.prototype.ContentStatement = function (content) { - return this.pad('CONTENT[ \'' + content.value + '\' ]'); - }; + for(var i=0, l=params.length; i " + content + " }}"); + }; - return this.accept(sexpr.path) + ' ' + params + hash; - }; + PrintVisitor.prototype.hash = function(hash) { + var pairs = hash.pairs; + var joinedPairs = [], left, right; - PrintVisitor.prototype.PathExpression = function (id) { - var path = id.parts.join('/'); - return (id.data ? '@' : '') + 'PATH:' + path; - }; + for(var i=0, l=pairs.length; i 1) { + return "PATH:" + path; + } else { + return "ID:" + path; + } + }; - PrintVisitor.prototype.Hash = function (hash) { - var pairs = hash.pairs, - joinedPairs = []; + PrintVisitor.prototype.PARTIAL_NAME = function(partialName) { + return "PARTIAL:" + partialName.name; + }; - for (var i = 0, l = pairs.length; i < l; i++) { - joinedPairs.push(this.accept(pairs[i])); - } + PrintVisitor.prototype.DATA = function(data) { + return "@" + this.accept(data.id); + }; - return 'HASH{' + joinedPairs.join(', ') + '}'; - }; - PrintVisitor.prototype.HashPair = function (pair) { - return pair.key + '=' + this.accept(pair.value); - }; - /*eslint-enable new-cap */ -}); \ No newline at end of file + PrintVisitor.prototype.content = function(content) { + return this.pad("CONTENT[ '" + content.string + "' ]"); + }; + + PrintVisitor.prototype.comment = function(comment) { + return this.pad("{{! '" + comment.comment + "' }}"); + }; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js b/node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js index c86bd51..325ba0e 100644 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js +++ b/node_modules/handlebars/dist/amd/handlebars/compiler/visitor.js @@ -1,127 +1,16 @@ -define(['exports', 'module', '../exception', './ast'], function (exports, module, _exception, _ast) { - 'use strict'; +define( + ["exports"], + function(__exports__) { + "use strict"; + function Visitor() {} - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + Visitor.prototype = { + constructor: Visitor, - var _Exception = _interopRequire(_exception); - - var _AST = _interopRequire(_ast); - - function Visitor() { - this.parents = []; - } - - Visitor.prototype = { - constructor: Visitor, - mutating: false, - - // Visits a given value. If mutating, will replace the value if necessary. - acceptKey: function acceptKey(node, name) { - var value = this.accept(node[name]); - if (this.mutating) { - // Hacky sanity check: - if (value && (!value.type || !_AST[value.type])) { - throw new _Exception('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); - } - node[name] = value; + accept: function(object) { + return this[object.type](object); } - }, + }; - // Performs an accept operation with added sanity check to ensure - // required keys are not removed. - acceptRequired: function acceptRequired(node, name) { - this.acceptKey(node, name); - - if (!node[name]) { - throw new _Exception(node.type + ' requires ' + name); - } - }, - - // Traverses a given array. If mutating, empty respnses will be removed - // for child elements. - acceptArray: function acceptArray(array) { - for (var i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - - if (!array[i]) { - array.splice(i, 1); - i--; - l--; - } - } - }, - - accept: function accept(object) { - if (!object) { - return; - } - - if (this.current) { - this.parents.unshift(this.current); - } - this.current = object; - - var ret = this[object.type](object); - - this.current = this.parents.shift(); - - if (!this.mutating || ret) { - return ret; - } else if (ret !== false) { - return object; - } - }, - - Program: function Program(program) { - this.acceptArray(program.body); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.acceptRequired(mustache, 'path'); - this.acceptArray(mustache.params); - this.acceptKey(mustache, 'hash'); - }, - - BlockStatement: function BlockStatement(block) { - this.acceptRequired(block, 'path'); - this.acceptArray(block.params); - this.acceptKey(block, 'hash'); - - this.acceptKey(block, 'program'); - this.acceptKey(block, 'inverse'); - }, - - PartialStatement: function PartialStatement(partial) { - this.acceptRequired(partial, 'name'); - this.acceptArray(partial.params); - this.acceptKey(partial, 'hash'); - }, - - ContentStatement: function ContentStatement() {}, - CommentStatement: function CommentStatement() {}, - - SubExpression: function SubExpression(sexpr) { - this.acceptRequired(sexpr, 'path'); - this.acceptArray(sexpr.params); - this.acceptKey(sexpr, 'hash'); - }, - - PathExpression: function PathExpression() {}, - - StringLiteral: function StringLiteral() {}, - NumberLiteral: function NumberLiteral() {}, - BooleanLiteral: function BooleanLiteral() {}, - UndefinedLiteral: function UndefinedLiteral() {}, - NullLiteral: function NullLiteral() {}, - - Hash: function Hash(hash) { - this.acceptArray(hash.pairs); - }, - HashPair: function HashPair(pair) { - this.acceptRequired(pair, 'value'); - } - }; - - module.exports = Visitor; -}); -/* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */ \ No newline at end of file + __exports__["default"] = Visitor; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/compiler/whitespace-control.js b/node_modules/handlebars/dist/amd/handlebars/compiler/whitespace-control.js deleted file mode 100644 index 9f1d30f..0000000 --- a/node_modules/handlebars/dist/amd/handlebars/compiler/whitespace-control.js +++ /dev/null @@ -1,209 +0,0 @@ -define(['exports', 'module', './visitor'], function (exports, module, _visitor) { - 'use strict'; - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - var _Visitor = _interopRequire(_visitor); - - function WhitespaceControl() {} - WhitespaceControl.prototype = new _Visitor(); - - WhitespaceControl.prototype.Program = function (program) { - var isRoot = !this.isRootSeen; - this.isRootSeen = true; - - var body = program.body; - for (var i = 0, l = body.length; i < l; i++) { - var current = body[i], - strip = this.accept(current); - - if (!strip) { - continue; - } - - var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), - _isNextWhitespace = isNextWhitespace(body, i, isRoot), - openStandalone = strip.openStandalone && _isPrevWhitespace, - closeStandalone = strip.closeStandalone && _isNextWhitespace, - inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; - - if (strip.close) { - omitRight(body, i, true); - } - if (strip.open) { - omitLeft(body, i, true); - } - - if (inlineStandalone) { - omitRight(body, i); - - if (omitLeft(body, i)) { - // If we are on a standalone node, save the indent info for partials - if (current.type === 'PartialStatement') { - // Pull out the whitespace from the final line - current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; - } - } - } - if (openStandalone) { - omitRight((current.program || current.inverse).body); - - // Strip out the previous content node if it's whitespace only - omitLeft(body, i); - } - if (closeStandalone) { - // Always strip the next node - omitRight(body, i); - - omitLeft((current.inverse || current.program).body); - } - } - - return program; - }; - WhitespaceControl.prototype.BlockStatement = function (block) { - this.accept(block.program); - this.accept(block.inverse); - - // Find the inverse program that is involed with whitespace stripping. - var program = block.program || block.inverse, - inverse = block.program && block.inverse, - firstInverse = inverse, - lastInverse = inverse; - - if (inverse && inverse.chained) { - firstInverse = inverse.body[0].program; - - // Walk the inverse chain to find the last inverse that is actually in the chain. - while (lastInverse.chained) { - lastInverse = lastInverse.body[lastInverse.body.length - 1].program; - } - } - - var strip = { - open: block.openStrip.open, - close: block.closeStrip.close, - - // Determine the standalone candiacy. Basically flag our content as being possibly standalone - // so our parent can determine if we actually are standalone - openStandalone: isNextWhitespace(program.body), - closeStandalone: isPrevWhitespace((firstInverse || program).body) - }; - - if (block.openStrip.close) { - omitRight(program.body, null, true); - } - - if (inverse) { - var inverseStrip = block.inverseStrip; - - if (inverseStrip.open) { - omitLeft(program.body, null, true); - } - - if (inverseStrip.close) { - omitRight(firstInverse.body, null, true); - } - if (block.closeStrip.open) { - omitLeft(lastInverse.body, null, true); - } - - // Find standalone else statments - if (isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { - omitLeft(program.body); - omitRight(firstInverse.body); - } - } else if (block.closeStrip.open) { - omitLeft(program.body, null, true); - } - - return strip; - }; - - WhitespaceControl.prototype.MustacheStatement = function (mustache) { - return mustache.strip; - }; - - WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { - /* istanbul ignore next */ - var strip = node.strip || {}; - return { - inlineStandalone: true, - open: strip.open, - close: strip.close - }; - }; - - function isPrevWhitespace(body, i, isRoot) { - if (i === undefined) { - i = body.length; - } - - // Nodes that end with newlines are considered whitespace (but are special - // cased for strip operations) - var prev = body[i - 1], - sibling = body[i - 2]; - if (!prev) { - return isRoot; - } - - if (prev.type === 'ContentStatement') { - return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); - } - } - function isNextWhitespace(body, i, isRoot) { - if (i === undefined) { - i = -1; - } - - var next = body[i + 1], - sibling = body[i + 2]; - if (!next) { - return isRoot; - } - - if (next.type === 'ContentStatement') { - return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); - } - } - - // Marks the node to the right of the position as omitted. - // I.e. {{foo}}' ' will mark the ' ' node as omitted. - // - // If i is undefined, then the first child will be marked as such. - // - // If mulitple is truthy then all whitespace will be stripped out until non-whitespace - // content is met. - function omitRight(body, i, multiple) { - var current = body[i == null ? 0 : i + 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { - return; - } - - var original = current.value; - current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); - current.rightStripped = current.value !== original; - } - - // Marks the node to the left of the position as omitted. - // I.e. ' '{{foo}} will mark the ' ' node as omitted. - // - // If i is undefined then the last child will be marked as such. - // - // If mulitple is truthy then all whitespace will be stripped out until non-whitespace - // content is met. - function omitLeft(body, i, multiple) { - var current = body[i == null ? body.length - 1 : i - 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { - return; - } - - // We omit the last node if it's whitespace only and not preceeded by a non-content node. - var original = current.value; - current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); - current.leftStripped = current.value !== original; - return current.leftStripped; - } - - module.exports = WhitespaceControl; -}); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/exception.js b/node_modules/handlebars/dist/amd/handlebars/exception.js index a1ccecf..df0b042 100644 --- a/node_modules/handlebars/dist/amd/handlebars/exception.js +++ b/node_modules/handlebars/dist/amd/handlebars/exception.js @@ -1,37 +1,32 @@ -define(['exports', 'module'], function (exports, module) { - 'use strict'; +define( + ["exports"], + function(__exports__) { + "use strict"; - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; + function Exception(message, node) { + var line; + if (node && node.firstLine) { + line = node.firstLine; - message += ' - ' + line + ':' + column; + message += ' - ' + line + ':' + node.firstColumn; + } + + var tmp = Error.prototype.constructor.call(this, message); + + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; + } + + if (line) { + this.lineNumber = line; + this.column = node.firstColumn; + } } - var tmp = Error.prototype.constructor.call(this, message); + Exception.prototype = new Error(); - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { - this.lineNumber = line; - this.column = column; - } - } - - Exception.prototype = new Error(); - - module.exports = Exception; -}); \ No newline at end of file + __exports__["default"] = Exception; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/no-conflict.js b/node_modules/handlebars/dist/amd/handlebars/no-conflict.js deleted file mode 100644 index c7dda86..0000000 --- a/node_modules/handlebars/dist/amd/handlebars/no-conflict.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['exports', 'module'], function (exports, module) { - /*global window */ - 'use strict'; - - module.exports = function (Handlebars) { - /* istanbul ignore next */ - var root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function () { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - }; - }; -}); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/runtime.js b/node_modules/handlebars/dist/amd/handlebars/runtime.js index e1186e4..7c30127 100644 --- a/node_modules/handlebars/dist/amd/handlebars/runtime.js +++ b/node_modules/handlebars/dist/amd/handlebars/runtime.js @@ -1,226 +1,197 @@ -define(['exports', './utils', './exception', './base'], function (exports, _utils, _exception, _base) { - 'use strict'; +define( + ["./utils","./exception","./base","exports"], + function(__dependency1__, __dependency2__, __dependency3__, __exports__) { + "use strict"; + var Utils = __dependency1__; + var Exception = __dependency2__["default"]; + var COMPILER_REVISION = __dependency3__.COMPILER_REVISION; + var REVISION_CHANGES = __dependency3__.REVISION_CHANGES; + var createFrame = __dependency3__.createFrame; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + function checkRevision(compilerInfo) { + var compilerRevision = compilerInfo && compilerInfo[0] || 1, + currentRevision = COMPILER_REVISION; - exports.__esModule = true; - exports.checkRevision = checkRevision; - - // TODO: Remove this line and break up compilePartial - - exports.template = template; - exports.wrapProgram = wrapProgram; - exports.resolvePartial = resolvePartial; - exports.invokePartial = invokePartial; - exports.noop = noop; - - var _Exception = _interopRequire(_exception); - - function checkRevision(compilerInfo) { - var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = _base.COMPILER_REVISION; - - if (compilerRevision !== currentRevision) { - if (compilerRevision < currentRevision) { - var runtimeVersions = _base.REVISION_CHANGES[currentRevision], - compilerVersions = _base.REVISION_CHANGES[compilerRevision]; - throw new _Exception('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); - } else { - // Use the embedded version info since the runtime doesn't know about this revision yet - throw new _Exception('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); + if (compilerRevision !== currentRevision) { + if (compilerRevision < currentRevision) { + var runtimeVersions = REVISION_CHANGES[currentRevision], + compilerVersions = REVISION_CHANGES[compilerRevision]; + throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+ + "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+")."); + } else { + // Use the embedded version info since the runtime doesn't know about this revision yet + throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+ + "Please update your runtime to a newer version ("+compilerInfo[1]+")."); + } } } - } - function template(templateSpec, env) { - /* istanbul ignore next */ - if (!env) { - throw new _Exception('No environment passed to template'); - } - if (!templateSpec || !templateSpec.main) { - throw new _Exception('Unknown template object: ' + typeof templateSpec); - } + __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial - // Note: Using env.VM references rather than local var references throughout this section to allow - // for external users to override these as psuedo-supported APIs. - env.VM.checkRevision(templateSpec.compiler); - - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = _utils.extend({}, context, options.hash); + function template(templateSpec, env) { + /* istanbul ignore next */ + if (!env) { + throw new Exception("No environment passed to template"); + } + if (!templateSpec || !templateSpec.main) { + throw new Exception('Unknown template object: ' + typeof templateSpec); } - partial = env.VM.resolvePartial.call(this, partial, context, options); - var result = env.VM.invokePartial.call(this, partial, context, options); + // Note: Using env.VM references rather than local var references throughout this section to allow + // for external users to override these as psuedo-supported APIs. + env.VM.checkRevision(templateSpec.compiler); - if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); - } - if (result != null) { - if (options.indent) { - var lines = result.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - if (!lines[i] && i + 1 === l) { - break; + var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) { + if (hash) { + context = Utils.extend({}, context, hash); + } + + var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths); + + if (result == null && env.compile) { + var options = { helpers: helpers, partials: partials, data: data, depths: depths }; + partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env); + result = partials[name](context, options); + } + if (result != null) { + if (indent) { + var lines = result.split('\n'); + for (var i = 0, l = lines.length; i < l; i++) { + if (!lines[i] && i + 1 === l) { + break; + } + + lines[i] = indent + lines[i]; } - - lines[i] = options.indent + lines[i]; + result = lines.join('\n'); } - result = lines.join('\n'); + return result; + } else { + throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); } - return result; - } else { - throw new _Exception('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); - } - } + }; - // Just add water - var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _Exception('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, - lookup: function lookup(depths, name) { - var len = depths.length; - for (var i = 0; i < len; i++) { - if (depths[i] && depths[i][name] != null) { - return depths[i][name]; + // Just add water + var container = { + lookup: function(depths, name) { + var len = depths.length; + for (var i = 0; i < len; i++) { + if (depths[i] && depths[i][name] != null) { + return depths[i][name]; + } } + }, + lambda: function(current, context) { + return typeof current === 'function' ? current.call(context) : current; + }, + + escapeExpression: Utils.escapeExpression, + invokePartial: invokePartialWrapper, + + fn: function(i) { + return templateSpec[i]; + }, + + programs: [], + program: function(i, data, depths) { + var programWrapper = this.programs[i], + fn = this.fn(i); + if (data || depths) { + programWrapper = program(this, i, fn, data, depths); + } else if (!programWrapper) { + programWrapper = this.programs[i] = program(this, i, fn); + } + return programWrapper; + }, + + data: function(data, depth) { + while (data && depth--) { + data = data._parent; + } + return data; + }, + merge: function(param, common) { + var ret = param || common; + + if (param && common && (param !== common)) { + ret = Utils.extend({}, common, param); + } + + return ret; + }, + + noop: env.VM.noop, + compilerInfo: templateSpec.compiler + }; + + var ret = function(context, options) { + options = options || {}; + var data = options.data; + + ret._setup(options); + if (!options.partial && templateSpec.useData) { + data = initData(context, data); } - }, - lambda: function lambda(current, context) { - return typeof current === 'function' ? current.call(context) : current; - }, - - escapeExpression: _utils.escapeExpression, - invokePartial: invokePartialWrapper, - - fn: function fn(i) { - return templateSpec[i]; - }, - - programs: [], - program: function program(i, data, declaredBlockParams, blockParams, depths) { - var programWrapper = this.programs[i], - fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); - } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); - } - return programWrapper; - }, - - data: function data(value, depth) { - while (value && depth--) { - value = value._parent; - } - return value; - }, - merge: function merge(param, common) { - var obj = param || common; - - if (param && common && param !== common) { - obj = _utils.extend({}, common, param); + var depths; + if (templateSpec.useDepths) { + depths = options.depths ? [context].concat(options.depths) : [context]; } - return obj; - }, + return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths); + }; + ret.isTop = true; - noop: env.VM.noop, - compilerInfo: templateSpec.compiler - }; + ret._setup = function(options) { + if (!options.partial) { + container.helpers = container.merge(options.helpers, env.helpers); - function ret(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - var data = options.data; - - ret._setup(options); - if (!options.partial && templateSpec.useData) { - data = initData(context, data); - } - var depths = undefined, - blockParams = templateSpec.useBlockParams ? [] : undefined; - if (templateSpec.useDepths) { - depths = options.depths ? [context].concat(options.depths) : [context]; - } - - return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); - } - ret.isTop = true; - - ret._setup = function (options) { - if (!options.partial) { - container.helpers = container.merge(options.helpers, env.helpers); - - if (templateSpec.usePartial) { - container.partials = container.merge(options.partials, env.partials); + if (templateSpec.usePartial) { + container.partials = container.merge(options.partials, env.partials); + } + } else { + container.helpers = options.helpers; + container.partials = options.partials; } - } else { - container.helpers = options.helpers; - container.partials = options.partials; + }; + + ret._child = function(i, data, depths) { + if (templateSpec.useDepths && !depths) { + throw new Exception('must pass parent depths'); + } + + return program(container, i, templateSpec[i], data, depths); + }; + return ret; + } + + __exports__.template = template;function program(container, i, fn, data, depths) { + var prog = function(context, options) { + options = options || {}; + + return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths)); + }; + prog.program = i; + prog.depth = depths ? depths.length : 0; + return prog; + } + + __exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) { + var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths }; + + if(partial === undefined) { + throw new Exception("The partial " + name + " could not be found"); + } else if(partial instanceof Function) { + return partial(context, options); } - }; + } - ret._child = function (i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new _Exception('must pass block params'); + __exports__.invokePartial = invokePartial;function noop() { return ""; } + + __exports__.noop = noop;function initData(context, data) { + if (!data || !('root' in data)) { + data = data ? createFrame(data) : {}; + data.root = context; } - if (templateSpec.useDepths && !depths) { - throw new _Exception('must pass parent depths'); - } - - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); - }; - return ret; - } - - function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); + return data; } - prog.program = i; - prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; - return prog; - } - - function resolvePartial(partial, context, options) { - if (!partial) { - partial = options.partials[options.name]; - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; - } - - function invokePartial(partial, context, options) { - options.partial = true; - - if (partial === undefined) { - throw new _Exception('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { - return partial(context, options); - } - } - - function noop() { - return ''; - } - - function initData(context, data) { - if (!data || !('root' in data)) { - data = data ? _base.createFrame(data) : {}; - data.root = context; - } - return data; - } -}); \ No newline at end of file + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/safe-string.js b/node_modules/handlebars/dist/amd/handlebars/safe-string.js index f2b3d53..5a2ad31 100644 --- a/node_modules/handlebars/dist/amd/handlebars/safe-string.js +++ b/node_modules/handlebars/dist/amd/handlebars/safe-string.js @@ -1,14 +1,15 @@ -define(['exports', 'module'], function (exports, module) { - // Build out our basic SafeString type - 'use strict'; +define( + ["exports"], + function(__exports__) { + "use strict"; + // Build out our basic SafeString type + function SafeString(string) { + this.string = string; + } - function SafeString(string) { - this.string = string; - } + SafeString.prototype.toString = function() { + return "" + this.string; + }; - SafeString.prototype.toString = SafeString.prototype.toHTML = function () { - return '' + this.string; - }; - - module.exports = SafeString; -}); \ No newline at end of file + __exports__["default"] = SafeString; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/handlebars/utils.js b/node_modules/handlebars/dist/amd/handlebars/utils.js index e2d6fff..e6372d3 100644 --- a/node_modules/handlebars/dist/amd/handlebars/utils.js +++ b/node_modules/handlebars/dist/amd/handlebars/utils.js @@ -1,84 +1,66 @@ -define(['exports'], function (exports) { - 'use strict'; +define( + ["./safe-string","exports"], + function(__dependency1__, __exports__) { + "use strict"; + /*jshint -W004 */ + var SafeString = __dependency1__["default"]; - exports.__esModule = true; - exports.extend = extend; + var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; - // Older IE versions do not directly support indexOf so we must implement our own, sadly. - exports.indexOf = indexOf; - exports.escapeExpression = escapeExpression; - exports.isEmpty = isEmpty; - exports.blockParams = blockParams; - exports.appendContextPath = appendContextPath; - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' - }; + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; - var badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; + function escapeChar(chr) { + return escape[chr]; + } - function escapeChar(chr) { - return escape[chr]; - } - - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; + function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } } } + + return obj; } - return obj; - } - - var toString = Object.prototype.toString; - - exports.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - /*eslint-disable func-style, no-var */ - var isFunction = function isFunction(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; + __exports__.extend = extend;var toString = Object.prototype.toString; + __exports__.toString = toString; + // Sourced from lodash + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt + var isFunction = function(value) { + return typeof value === 'function'; }; - } - var isFunction; - exports.isFunction = isFunction; - /*eslint-enable func-style, no-var */ - - /* istanbul ignore next */ - var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; - };exports.isArray = isArray; - - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } + // fallback for older versions of Chrome and Safari + /* istanbul ignore next */ + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; } - return -1; - } + var isFunction; + __exports__.isFunction = isFunction; + /* istanbul ignore next */ + var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; + }; + __exports__.isArray = isArray; - function escapeExpression(string) { - if (typeof string !== 'string') { + function escapeExpression(string) { // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); + if (string instanceof SafeString) { + return string.toString(); } else if (string == null) { - return ''; + return ""; } else if (!string) { return string + ''; } @@ -86,31 +68,25 @@ define(['exports'], function (exports) { // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. - string = '' + string; + string = "" + string; + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); } - if (!possible.test(string)) { - return string; + __exports__.escapeExpression = escapeExpression;function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; + } else { + return false; + } } - return string.replace(badChars, escapeChar); - } - function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; + __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; } - } - function blockParams(params, ids) { - params.path = ids; - return params; - } - - function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } -}); \ No newline at end of file + __exports__.appendContextPath = appendContextPath; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/amd/precompiler.js b/node_modules/handlebars/dist/amd/precompiler.js index dc5aac8..14630db 100644 --- a/node_modules/handlebars/dist/amd/precompiler.js +++ b/node_modules/handlebars/dist/amd/precompiler.js @@ -1,184 +1,149 @@ -define(['exports', 'fs', './handlebars', 'path', 'source-map', 'uglify-js'], function (exports, _fs, _handlebars, _path, _sourceMap, _uglifyJs) { - 'use strict'; +define( + [], + function() { + "use strict"; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + var fs = require('fs'), + Handlebars = require('./index'), + basename = require('path').basename, + uglify = require('uglify-js'); - /*eslint-disable no-console */ - - var _fs2 = _interopRequire(_fs); - - var _uglify = _interopRequire(_uglifyJs); - - module.exports.cli = function (opts) { - if (opts.version) { - console.log(_handlebars.VERSION); - return; - } - - if (!opts.templates.length) { - throw new _handlebars.Exception('Must define at least one template or directory.'); - } - - opts.templates.forEach(function (template) { - try { - _fs2.statSync(template); - } catch (err) { - throw new _handlebars.Exception('Unable to open template file "' + template + '"'); + module.exports.cli = function(opts) { + if (opts.version) { + console.log(Handlebars.VERSION); + return; } - }); - if (opts.simple && opts.min) { - throw new _handlebars.Exception('Unable to minimize simple output'); - } - if (opts.simple && (opts.templates.length !== 1 || _fs2.statSync(opts.templates[0]).isDirectory())) { - throw new _handlebars.Exception('Unable to output multiple templates in simple mode'); - } - - // Convert the known list into a hash - var known = {}; - if (opts.known && !Array.isArray(opts.known)) { - opts.known = [opts.known]; - } - if (opts.known) { - for (var i = 0, len = opts.known.length; i < len; i++) { - known[opts.known[i]] = true; + var template = [0]; + if (!opts.templates.length) { + throw new Handlebars.Exception('Must define at least one template or directory.'); } - } - // Build file extension pattern - var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function (arg) { - return '\\' + arg; - }); - extension = new RegExp('\\.' + extension + '$'); - - var output = new _sourceMap.SourceNode(); - if (!opts.simple) { - if (opts.amd) { - output.add('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n Handlebars = Handlebars["default"];'); - } else if (opts.commonjs) { - output.add('var Handlebars = require("' + opts.commonjs + '");'); - } else { - output.add('(function() {\n'); - } - output.add(' var template = Handlebars.template, templates = '); - if (opts.namespace) { - output.add(opts.namespace); - output.add(' = '); - output.add(opts.namespace); - output.add(' || '); - } - output.add('{};\n'); - } - function processTemplate(template, root) { - var path = template, - stat = _fs2.statSync(path); - if (stat.isDirectory()) { - _fs2.readdirSync(template).map(function (file) { - var childPath = template + '/' + file; - - if (extension.test(childPath) || _fs2.statSync(childPath).isDirectory()) { - processTemplate(childPath, root || template); - } - }); - } else { - var data = _fs2.readFileSync(path, 'utf8'); - - if (opts.bom && data.indexOf('') === 0) { - data = data.substring(1); + opts.templates.forEach(function(template) { + try { + fs.statSync(template); + } catch (err) { + throw new Handlebars.Exception('Unable to open template file "' + template + '"'); } - - var options = { - knownHelpers: known, - knownHelpersOnly: opts.o - }; - - if (opts.map) { - options.srcName = path; - } - if (opts.data) { - options.data = true; - } - - // Clean the template name - if (!root) { - template = _path.basename(template); - } else if (template.indexOf(root) === 0) { - template = template.substring(root.length + 1); - } - template = template.replace(extension, ''); - - var precompiled = _handlebars.precompile(data, options); - - // If we are generating a source map, we have to reconstruct the SourceNode object - if (opts.map) { - var consumer = new _sourceMap.SourceMapConsumer(precompiled.map); - precompiled = _sourceMap.SourceNode.fromStringWithSourceMap(precompiled.code, consumer); - } - - if (opts.simple) { - output.add([precompiled, '\n']); - } else if (opts.partial) { - if (opts.amd && (opts.templates.length == 1 && !_fs2.statSync(opts.templates[0]).isDirectory())) { - output.add('return '); - } - output.add(['Handlebars.partials[\'', template, '\'] = template(', precompiled, ');\n']); - } else { - if (opts.amd && (opts.templates.length == 1 && !_fs2.statSync(opts.templates[0]).isDirectory())) { - output.add('return '); - } - output.add(['templates[\'', template, '\'] = template(', precompiled, ');\n']); - } - } - } - - opts.templates.forEach(function (template) { - processTemplate(template, opts.root); - }); - - // Output the content - if (!opts.simple) { - if (opts.amd) { - if (opts.templates.length > 1 || opts.templates.length == 1 && _fs2.statSync(opts.templates[0]).isDirectory()) { - if (opts.partial) { - output.add('return Handlebars.partials;\n'); - } else { - output.add('return templates;\n'); - } - } - output.add('});'); - } else if (!opts.commonjs) { - output.add('})();'); - } - } - - if (opts.map) { - output.add('\n//# sourceMappingURL=' + opts.map + '\n'); - } - - output = output.toStringWithSourceMap(); - output.map = output.map + ''; - - if (opts.min) { - output = _uglify.minify(output.code, { - fromString: true, - - outSourceMap: opts.map, - inSourceMap: JSON.parse(output.map) }); - if (opts.map) { - output.code += '\n//# sourceMappingURL=' + opts.map + '\n'; + + if (opts.simple && opts.min) { + throw new Handlebars.Exception('Unable to minimze simple output'); + } + if (opts.simple && (opts.templates.length !== 1 || fs.statSync(opts.templates[0]).isDirectory())) { + throw new Handlebars.Exception('Unable to output multiple templates in simple mode'); } - } - if (opts.map) { - _fs2.writeFileSync(opts.map, output.map, 'utf8'); - } - output = output.code; + // Convert the known list into a hash + var known = {}; + if (opts.known && !Array.isArray(opts.known)) { + opts.known = [opts.known]; + } + if (opts.known) { + for (var i = 0, len = opts.known.length; i < len; i++) { + known[opts.known[i]] = true; + } + } - if (opts.output) { - _fs2.writeFileSync(opts.output, output, 'utf8'); - } else { - console.log(output); - } - }; -}); \ No newline at end of file + // Build file extension pattern + var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function(arg) { return '\\' + arg; }); + extension = new RegExp('\\.' + extension + '$'); + + var output = []; + if (!opts.simple) { + if (opts.amd) { + output.push('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n Handlebars = Handlebars["default"];'); + } else if (opts.commonjs) { + output.push('var Handlebars = require("' + opts.commonjs + '");'); + } else { + output.push('(function() {\n'); + } + output.push(' var template = Handlebars.template, templates = '); + output.push(opts.namespace); + output.push(' = '); + output.push(opts.namespace); + output.push(' || {};\n'); + } + function processTemplate(template, root) { + var path = template, + stat = fs.statSync(path); + if (stat.isDirectory()) { + fs.readdirSync(template).map(function(file) { + var path = template + '/' + file; + + if (extension.test(path) || fs.statSync(path).isDirectory()) { + processTemplate(path, root || template); + } + }); + } else { + var data = fs.readFileSync(path, 'utf8'); + + if (opts.bom && data.indexOf('\uFEFF') === 0) { + data = data.substring(1); + } + + var options = { + knownHelpers: known, + knownHelpersOnly: opts.o + }; + + if (opts.data) { + options.data = true; + } + + // Clean the template name + if (!root) { + template = basename(template); + } else if (template.indexOf(root) === 0) { + template = template.substring(root.length+1); + } + template = template.replace(extension, ''); + + if (opts.simple) { + output.push(Handlebars.precompile(data, options) + '\n'); + } else if (opts.partial) { + if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { + output.push('return '); + } + output.push('Handlebars.partials[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n'); + } else { + if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { + output.push('return '); + } + output.push('templates[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n'); + } + } + } + + opts.templates.forEach(function(template) { + processTemplate(template, opts.root); + }); + + // Output the content + if (!opts.simple) { + if (opts.amd) { + if(opts.templates.length > 1 || (opts.templates.length == 1 && fs.statSync(opts.templates[0]).isDirectory())) { + if(opts.partial){ + output.push('return Handlebars.partials;\n'); + } else { + output.push('return templates;\n'); + } + } + output.push('});'); + } else if (!opts.commonjs) { + output.push('})();'); + } + } + output = output.join(''); + + if (opts.min) { + output = uglify.minify(output, {fromString: true}).code; + } + + if (opts.output) { + fs.writeFileSync(opts.output, output, 'utf8'); + } else { + console.log(output); + } + }; + }); \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars.js b/node_modules/handlebars/dist/cjs/handlebars.js index f294436..31a0386 100644 --- a/node_modules/handlebars/dist/cjs/handlebars.js +++ b/node_modules/handlebars/dist/cjs/handlebars.js @@ -1,63 +1,39 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; - -var _runtime = require('./handlebars.runtime'); - -var _runtime2 = _interopRequireWildcard(_runtime); +"use strict"; +/*globals Handlebars: true */ +var Handlebars = require("./handlebars.runtime")["default"]; // Compiler imports +var AST = require("./handlebars/compiler/ast")["default"]; +var Parser = require("./handlebars/compiler/base").parser; +var parse = require("./handlebars/compiler/base").parse; +var Compiler = require("./handlebars/compiler/compiler").Compiler; +var compile = require("./handlebars/compiler/compiler").compile; +var precompile = require("./handlebars/compiler/compiler").precompile; +var JavaScriptCompiler = require("./handlebars/compiler/javascript-compiler")["default"]; -var _AST = require('./handlebars/compiler/ast'); - -var _AST2 = _interopRequireWildcard(_AST); - -var _Parser$parse = require('./handlebars/compiler/base'); - -var _Compiler$compile$precompile = require('./handlebars/compiler/compiler'); - -var _JavaScriptCompiler = require('./handlebars/compiler/javascript-compiler'); - -var _JavaScriptCompiler2 = _interopRequireWildcard(_JavaScriptCompiler); - -var _Visitor = require('./handlebars/compiler/visitor'); - -var _Visitor2 = _interopRequireWildcard(_Visitor); - -var _noConflict = require('./handlebars/no-conflict'); - -var _noConflict2 = _interopRequireWildcard(_noConflict); - -var _create = _runtime2['default'].create; -function create() { +var _create = Handlebars.create; +var create = function() { var hb = _create(); - hb.compile = function (input, options) { - return _Compiler$compile$precompile.compile(input, options, hb); + hb.compile = function(input, options) { + return compile(input, options, hb); }; hb.precompile = function (input, options) { - return _Compiler$compile$precompile.precompile(input, options, hb); + return precompile(input, options, hb); }; - hb.AST = _AST2['default']; - hb.Compiler = _Compiler$compile$precompile.Compiler; - hb.JavaScriptCompiler = _JavaScriptCompiler2['default']; - hb.Parser = _Parser$parse.parser; - hb.parse = _Parser$parse.parse; + hb.AST = AST; + hb.Compiler = Compiler; + hb.JavaScriptCompiler = JavaScriptCompiler; + hb.Parser = Parser; + hb.parse = parse; return hb; -} +}; -var inst = create(); -inst.create = create; +Handlebars = create(); +Handlebars.create = create; -_noConflict2['default'](inst); +Handlebars['default'] = Handlebars; -inst.Visitor = _Visitor2['default']; - -inst['default'] = inst; - -exports['default'] = inst; -module.exports = exports['default']; \ No newline at end of file +exports["default"] = Handlebars; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars.runtime.js b/node_modules/handlebars/dist/cjs/handlebars.runtime.js index e52f2fd..d19e60c 100644 --- a/node_modules/handlebars/dist/cjs/handlebars.runtime.js +++ b/node_modules/handlebars/dist/cjs/handlebars.runtime.js @@ -1,60 +1,35 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; - -var _import = require('./handlebars/base'); - -var base = _interopRequireWildcard(_import); +"use strict"; +/*globals Handlebars: true */ +var base = require("./handlebars/base"); // Each of these augment the Handlebars object. No need to setup here. // (This is done to easily share code between commonjs and browse envs) - -var _SafeString = require('./handlebars/safe-string'); - -var _SafeString2 = _interopRequireWildcard(_SafeString); - -var _Exception = require('./handlebars/exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -var _import2 = require('./handlebars/utils'); - -var Utils = _interopRequireWildcard(_import2); - -var _import3 = require('./handlebars/runtime'); - -var runtime = _interopRequireWildcard(_import3); - -var _noConflict = require('./handlebars/no-conflict'); - -var _noConflict2 = _interopRequireWildcard(_noConflict); +var SafeString = require("./handlebars/safe-string")["default"]; +var Exception = require("./handlebars/exception")["default"]; +var Utils = require("./handlebars/utils"); +var runtime = require("./handlebars/runtime"); // For compatibility and usage outside of module systems, make the Handlebars object a namespace -function create() { +var create = function() { var hb = new base.HandlebarsEnvironment(); Utils.extend(hb, base); - hb.SafeString = _SafeString2['default']; - hb.Exception = _Exception2['default']; + hb.SafeString = SafeString; + hb.Exception = Exception; hb.Utils = Utils; hb.escapeExpression = Utils.escapeExpression; hb.VM = runtime; - hb.template = function (spec) { + hb.template = function(spec) { return runtime.template(spec, hb); }; return hb; -} +}; -var inst = create(); -inst.create = create; +var Handlebars = create(); +Handlebars.create = create; -_noConflict2['default'](inst); +Handlebars['default'] = Handlebars; -inst['default'] = inst; - -exports['default'] = inst; -module.exports = exports['default']; \ No newline at end of file +exports["default"] = Handlebars; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/base.js b/node_modules/handlebars/dist/cjs/handlebars/base.js index c7c6a69..253a667 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/base.js +++ b/node_modules/handlebars/dist/cjs/handlebars/base.js @@ -1,23 +1,9 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; -exports.HandlebarsEnvironment = HandlebarsEnvironment; -exports.createFrame = createFrame; - -var _import = require('./utils'); - -var Utils = _interopRequireWildcard(_import); - -var _Exception = require('./exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -var VERSION = '3.0.1'; -exports.VERSION = VERSION; -var COMPILER_REVISION = 6; +"use strict"; +var Utils = require("./utils"); +var Exception = require("./exception")["default"]; +var VERSION = "2.0.0"; +exports.VERSION = VERSION;var COMPILER_REVISION = 6; exports.COMPILER_REVISION = COMPILER_REVISION; var REVISION_CHANGES = { 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it @@ -27,7 +13,6 @@ var REVISION_CHANGES = { 5: '== 2.0.0-alpha.x', 6: '>= 2.0.0-beta.1' }; - exports.REVISION_CHANGES = REVISION_CHANGES; var isArray = Utils.isArray, isFunction = Utils.isFunction, @@ -41,62 +26,57 @@ function HandlebarsEnvironment(helpers, partials) { registerDefaultHelpers(this); } -HandlebarsEnvironment.prototype = { +exports.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { constructor: HandlebarsEnvironment, logger: logger, log: log, - registerHelper: function registerHelper(name, fn) { + registerHelper: function(name, fn) { if (toString.call(name) === objectType) { - if (fn) { - throw new _Exception2['default']('Arg not supported with multiple helpers'); - } + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } Utils.extend(this.helpers, name); } else { this.helpers[name] = fn; } }, - unregisterHelper: function unregisterHelper(name) { + unregisterHelper: function(name) { delete this.helpers[name]; }, - registerPartial: function registerPartial(name, partial) { + registerPartial: function(name, partial) { if (toString.call(name) === objectType) { - Utils.extend(this.partials, name); + Utils.extend(this.partials, name); } else { - if (typeof partial === 'undefined') { - throw new _Exception2['default']('Attempting to register a partial as undefined'); - } this.partials[name] = partial; } }, - unregisterPartial: function unregisterPartial(name) { + unregisterPartial: function(name) { delete this.partials[name]; } }; function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function () { - if (arguments.length === 1) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { // A missing field in a {{foo}} constuct. return undefined; } else { // Someone is actually trying to call something, blow up. - throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); } }); - instance.registerHelper('blockHelperMissing', function (context, options) { + instance.registerHelper('blockHelperMissing', function(context, options) { var inverse = options.inverse, fn = options.fn; - if (context === true) { + if(context === true) { return fn(this); - } else if (context === false || context == null) { + } else if(context === false || context == null) { return inverse(this); } else if (isArray(context)) { - if (context.length > 0) { + if(context.length > 0) { if (options.ids) { options.ids = [options.name]; } @@ -109,111 +89,91 @@ function registerDefaultHelpers(instance) { if (options.data && options.ids) { var data = createFrame(options.data); data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; + options = {data: data}; } return fn(context, options); } }); - instance.registerHelper('each', function (context, options) { + instance.registerHelper('each', function(context, options) { if (!options) { - throw new _Exception2['default']('Must pass iterator to #each'); + throw new Exception('Must pass iterator to #each'); } - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + var contextPath; if (options.data && options.ids) { contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; } - if (isFunction(context)) { - context = context.call(this); - } + if (isFunction(context)) { context = context.call(this); } if (options.data) { data = createFrame(options.data); } - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: Utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { + if(context && typeof context === 'object') { if (isArray(context)) { - for (var j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); + for(var j = context.length; i 0) { + throw new Exception("Invalid path: " + original, this); + } else if (part === "..") { + depth++; + depthString += '../'; + } else { + this.isScoped = true; + } + } else { + dig.push(part); + } + } + + this.original = original; + this.parts = dig; + this.string = dig.join('.'); + this.depth = depth; + this.idName = depthString + this.string; // an ID is simple if it only has one part, and that part is not // `..` or `this`. - simpleId: function simpleId(path) { - return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; - } + this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; + + this.stringModeValue = this.string; + }, + + PartialNameNode: function(name, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "PARTIAL_NAME"; + this.name = name.original; + }, + + DataNode: function(id, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "DATA"; + this.id = id; + this.stringModeValue = id.stringModeValue; + this.idName = '@' + id.stringModeValue; + }, + + StringNode: function(string, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "STRING"; + this.original = + this.string = + this.stringModeValue = string; + }, + + NumberNode: function(number, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "NUMBER"; + this.original = + this.number = number; + this.stringModeValue = Number(number); + }, + + BooleanNode: function(bool, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "BOOLEAN"; + this.bool = bool; + this.stringModeValue = bool === "true"; + }, + + CommentNode: function(comment, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "comment"; + this.comment = comment; + + this.strip = { + inlineStandalone: true + }; } }; + // Must be exported as an object rather than the root of the module as the jison lexer -// must modify the object to operate properly. -exports['default'] = AST; -module.exports = exports['default']; \ No newline at end of file +// most modify the object to operate properly. +exports["default"] = AST; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js index d4bafe0..8197e07 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js +++ b/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js @@ -1,46 +1,21 @@ -'use strict'; +"use strict"; +var parser = require("./parser")["default"]; +var AST = require("./ast")["default"]; +var Helpers = require("./helpers"); +var extend = require("../utils").extend; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; -exports.parse = parse; - -var _parser = require('./parser'); - -var _parser2 = _interopRequireWildcard(_parser); - -var _AST = require('./ast'); - -var _AST2 = _interopRequireWildcard(_AST); - -var _WhitespaceControl = require('./whitespace-control'); - -var _WhitespaceControl2 = _interopRequireWildcard(_WhitespaceControl); - -var _import = require('./helpers'); - -var Helpers = _interopRequireWildcard(_import); - -var _extend = require('../utils'); - -exports.parser = _parser2['default']; +exports.parser = parser; var yy = {}; -_extend.extend(yy, Helpers, _AST2['default']); +extend(yy, Helpers, AST); -function parse(input, options) { - // Just return if an already-compiled AST was passed in. - if (input.type === 'Program') { - return input; - } +function parse(input) { + // Just return if an already-compile AST was passed in. + if (input.constructor === AST.ProgramNode) { return input; } - _parser2['default'].yy = yy; + parser.yy = yy; - // Altering the shared object here, but this is ok as parser is a sync operation - yy.locInfo = function (locInfo) { - return new yy.SourceLocation(options && options.srcName, locInfo); - }; + return parser.parse(input); +} - var strip = new _WhitespaceControl2['default'](); - return strip.accept(_parser2['default'].parse(input)); -} \ No newline at end of file +exports.parse = parse; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js deleted file mode 100644 index 8c48c8b..0000000 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js +++ /dev/null @@ -1,164 +0,0 @@ -'use strict'; - -exports.__esModule = true; -/*global define */ - -var _isArray = require('../utils'); - -var SourceNode = undefined; - -try { - /* istanbul ignore next */ - if (typeof define !== 'function' || !define.amd) { - // We don't support this in AMD environments. For these environments, we asusme that - // they are running on the browser and thus have no need for the source-map library. - var SourceMap = require('source-map'); - SourceNode = SourceMap.SourceNode; - } -} catch (err) {} - -/* istanbul ignore if: tested but not covered in istanbul due to dist build */ -if (!SourceNode) { - SourceNode = function (line, column, srcFile, chunks) { - this.src = ''; - if (chunks) { - this.add(chunks); - } - }; - /* istanbul ignore next */ - SourceNode.prototype = { - add: function add(chunks) { - if (_isArray.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src += chunks; - }, - prepend: function prepend(chunks) { - if (_isArray.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src = chunks + this.src; - }, - toStringWithSourceMap: function toStringWithSourceMap() { - return { code: this.toString() }; - }, - toString: function toString() { - return this.src; - } - }; -} - -function castChunk(chunk, codeGen, loc) { - if (_isArray.isArray(chunk)) { - var ret = []; - - for (var i = 0, len = chunk.length; i < len; i++) { - ret.push(codeGen.wrap(chunk[i], loc)); - } - return ret; - } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { - // Handle primitives that the SourceNode will throw up on - return chunk + ''; - } - return chunk; -} - -function CodeGen(srcFile) { - this.srcFile = srcFile; - this.source = []; -} - -CodeGen.prototype = { - prepend: function prepend(source, loc) { - this.source.unshift(this.wrap(source, loc)); - }, - push: function push(source, loc) { - this.source.push(this.wrap(source, loc)); - }, - - merge: function merge() { - var source = this.empty(); - this.each(function (line) { - source.add([' ', line, '\n']); - }); - return source; - }, - - each: function each(iter) { - for (var i = 0, len = this.source.length; i < len; i++) { - iter(this.source[i]); - } - }, - - empty: function empty() { - var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile); - }, - wrap: function wrap(chunk) { - var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; - - if (chunk instanceof SourceNode) { - return chunk; - } - - chunk = castChunk(chunk, this, loc); - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); - }, - - functionCall: function functionCall(fn, type, params) { - params = this.generateList(params); - return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); - }, - - quotedString: function quotedString(str) { - return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 - .replace(/\u2029/g, '\\u2029') + '"'; - }, - - objectLiteral: function objectLiteral(obj) { - var pairs = []; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - var value = castChunk(obj[key], this); - if (value !== 'undefined') { - pairs.push([this.quotedString(key), ':', value]); - } - } - } - - var ret = this.generateList(pairs); - ret.prepend('{'); - ret.add('}'); - return ret; - }, - - generateList: function generateList(entries, loc) { - var ret = this.empty(loc); - - for (var i = 0, len = entries.length; i < len; i++) { - if (i) { - ret.add(','); - } - - ret.add(castChunk(entries[i], this, loc)); - } - - return ret; - }, - - generateArray: function generateArray(entries, loc) { - var ret = this.generateList(entries, loc); - ret.prepend('['); - ret.add(']'); - - return ret; - } -}; - -exports['default'] = CodeGen; -module.exports = exports['default']; - -/* NOP */ \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js index 4840fa5..99978ac 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js +++ b/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js @@ -1,27 +1,12 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; -exports.Compiler = Compiler; -exports.precompile = precompile; -exports.compile = compile; - -var _Exception = require('../exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -var _isArray$indexOf = require('../utils'); - -var _AST = require('./ast'); - -var _AST2 = _interopRequireWildcard(_AST); +"use strict"; +var Exception = require("../exception")["default"]; +var isArray = require("../utils").isArray; var slice = [].slice; function Compiler() {} -// the foundHelper register will disambiguate helper lookup from finding a +exports.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a // function in a context. This is necessary for mustache compatibility, which // requires that context functions in blocks are evaluated by blockHelperMissing, // and then proceed as if the resulting value was provided to blockHelperMissing. @@ -29,7 +14,7 @@ function Compiler() {} Compiler.prototype = { compiler: Compiler, - equals: function equals(other) { + equals: function(other) { var len = this.opcodes.length; if (other.opcodes.length !== len) { return false; @@ -46,7 +31,7 @@ Compiler.prototype = { // We know that length is the same between the two arrays because they are directly tied // to the opcode behavior above. len = this.children.length; - for (var i = 0; i < len; i++) { + for (i = 0; i < len; i++) { if (!this.children[i].equals(other.children[i])) { return false; } @@ -57,101 +42,101 @@ Compiler.prototype = { guid: 0, - compile: function compile(program, options) { - this.sourceNode = []; + compile: function(program, options) { this.opcodes = []; this.children = []; + this.depths = {list: []}; this.options = options; this.stringParams = options.stringParams; this.trackIds = options.trackIds; - options.blockParams = options.blockParams || []; - // These changes will propagate to the other compiler components - var knownHelpers = options.knownHelpers; - options.knownHelpers = { - helperMissing: true, - blockHelperMissing: true, - each: true, + var knownHelpers = this.options.knownHelpers; + this.options.knownHelpers = { + 'helperMissing': true, + 'blockHelperMissing': true, + 'each': true, 'if': true, - unless: true, + 'unless': true, 'with': true, - log: true, - lookup: true + 'log': true, + 'lookup': true }; if (knownHelpers) { - for (var _name in knownHelpers) { - if (_name in knownHelpers) { - options.knownHelpers[_name] = knownHelpers[_name]; - } + for (var name in knownHelpers) { + this.options.knownHelpers[name] = knownHelpers[name]; } } return this.accept(program); }, - compileProgram: function compileProgram(program) { - var childCompiler = new this.compiler(), - // eslint-disable-line new-cap - result = childCompiler.compile(program, this.options), - guid = this.guid++; - - this.usePartial = this.usePartial || result.usePartial; - - this.children[guid] = result; - this.useDepths = this.useDepths || result.useDepths; - - return guid; + accept: function(node) { + return this[node.type](node); }, - accept: function accept(node) { - this.sourceNode.unshift(node); - var ret = this[node.type](node); - this.sourceNode.shift(); - return ret; - }, + program: function(program) { + var statements = program.statements; - Program: function Program(program) { - this.options.blockParams.unshift(program.blockParams); - - var body = program.body, - bodyLength = body.length; - for (var i = 0; i < bodyLength; i++) { - this.accept(body[i]); + for(var i=0, l=statements.length; i 1) { - throw new _Exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); - } else if (!params.length) { - params.push({ type: 'PathExpression', parts: [], depth: 0 }); + if (partial.hash) { + this.accept(partial.hash); + } else { + this.opcode('push', 'undefined'); } - var partialName = partial.name.original, - isDynamic = partial.name.type === 'SubExpression'; - if (isDynamic) { - this.accept(partial.name); + if (partial.context) { + this.accept(partial.context); + } else { + this.opcode('getContext', 0); + this.opcode('pushContext'); } - this.setupFullMustacheParams(partial, undefined, undefined, true); - - var indent = partial.indent || ''; - if (this.options.preventIndent && indent) { - this.opcode('appendContent', indent); - indent = ''; - } - - this.opcode('invokePartial', isDynamic, partialName, indent); + this.opcode('invokePartial', partialName.name, partial.indent || ''); this.opcode('append'); }, - MustacheStatement: function MustacheStatement(mustache) { - this.SubExpression(mustache); // eslint-disable-line new-cap + content: function(content) { + if (content.string) { + this.opcode('appendContent', content.string); + } + }, - if (mustache.escaped && !this.options.noEscape) { + mustache: function(mustache) { + this.sexpr(mustache.sexpr); + + if(mustache.escaped && !this.options.noEscape) { this.opcode('appendEscaped'); } else { this.opcode('append'); } }, - ContentStatement: function ContentStatement(content) { - if (content.value) { - this.opcode('appendContent', content.value); + ambiguousSexpr: function(sexpr, program, inverse) { + var id = sexpr.id, + name = id.parts[0], + isBlock = program != null || inverse != null; + + this.opcode('getContext', id.depth); + + this.opcode('pushProgram', program); + this.opcode('pushProgram', inverse); + + this.ID(id); + + this.opcode('invokeAmbiguous', name, isBlock); + }, + + simpleSexpr: function(sexpr) { + var id = sexpr.id; + + if (id.type === 'DATA') { + this.DATA(id); + } else if (id.parts.length) { + this.ID(id); + } else { + // Simplified ID for `this` + this.addDepth(id.depth); + this.opcode('getContext', id.depth); + this.opcode('pushContext'); + } + + this.opcode('resolvePossibleLambda'); + }, + + helperSexpr: function(sexpr, program, inverse) { + var params = this.setupFullMustacheParams(sexpr, program, inverse), + id = sexpr.id, + name = id.parts[0]; + + if (this.options.knownHelpers[name]) { + this.opcode('invokeKnownHelper', params.length, name); + } else if (this.options.knownHelpersOnly) { + throw new Exception("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr); + } else { + id.falsy = true; + + this.ID(id); + this.opcode('invokeHelper', params.length, id.original, id.isSimple); } }, - CommentStatement: function CommentStatement() {}, - - SubExpression: function SubExpression(sexpr) { - transformLiteralToPath(sexpr); + sexpr: function(sexpr) { var type = this.classifySexpr(sexpr); - if (type === 'simple') { + if (type === "simple") { this.simpleSexpr(sexpr); - } else if (type === 'helper') { + } else if (type === "helper") { this.helperSexpr(sexpr); } else { this.ambiguousSexpr(sexpr); } }, - ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { - var path = sexpr.path, - name = path.parts[0], - isBlock = program != null || inverse != null; - this.opcode('getContext', path.depth); + ID: function(id) { + this.addDepth(id.depth); + this.opcode('getContext', id.depth); - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - - this.accept(path); - - this.opcode('invokeAmbiguous', name, isBlock); - }, - - simpleSexpr: function simpleSexpr(sexpr) { - this.accept(sexpr.path); - this.opcode('resolvePossibleLambda'); - }, - - helperSexpr: function helperSexpr(sexpr, program, inverse) { - var params = this.setupFullMustacheParams(sexpr, program, inverse), - path = sexpr.path, - name = path.parts[0]; - - if (this.options.knownHelpers[name]) { - this.opcode('invokeKnownHelper', params.length, name); - } else if (this.options.knownHelpersOnly) { - throw new _Exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); - } else { - path.falsy = true; - - this.accept(path); - this.opcode('invokeHelper', params.length, path.original, _AST2['default'].helpers.simpleId(path)); - } - }, - - PathExpression: function PathExpression(path) { - this.addDepth(path.depth); - this.opcode('getContext', path.depth); - - var name = path.parts[0], - scoped = _AST2['default'].helpers.scopedId(path), - blockParamId = !path.depth && !scoped && this.blockParamIndex(name); - - if (blockParamId) { - this.opcode('lookupBlockParam', blockParamId, path.parts); - } else if (!name) { + var name = id.parts[0]; + if (!name) { // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` this.opcode('pushContext'); - } else if (path.data) { - this.options.data = true; - this.opcode('lookupData', path.depth, path.parts); } else { - this.opcode('lookupOnContext', path.parts, path.falsy, scoped); + this.opcode('lookupOnContext', id.parts, id.falsy, id.isScoped); } }, - StringLiteral: function StringLiteral(string) { - this.opcode('pushString', string.value); + DATA: function(data) { + this.options.data = true; + this.opcode('lookupData', data.id.depth, data.id.parts); }, - NumberLiteral: function NumberLiteral(number) { - this.opcode('pushLiteral', number.value); + STRING: function(string) { + this.opcode('pushString', string.string); }, - BooleanLiteral: function BooleanLiteral(bool) { - this.opcode('pushLiteral', bool.value); + NUMBER: function(number) { + this.opcode('pushLiteral', number.number); }, - UndefinedLiteral: function UndefinedLiteral() { - this.opcode('pushLiteral', 'undefined'); + BOOLEAN: function(bool) { + this.opcode('pushLiteral', bool.bool); }, - NullLiteral: function NullLiteral() { - this.opcode('pushLiteral', 'null'); - }, - - Hash: function Hash(hash) { - var pairs = hash.pairs, - i = 0, - l = pairs.length; - - this.opcode('pushHash'); - - for (; i < l; i++) { - this.pushParam(pairs[i].value); - } - while (i--) { - this.opcode('assignToHash', pairs[i].key); - } - this.opcode('popHash'); - }, + comment: function() {}, // HELPERS - opcode: function opcode(name) { - this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); + opcode: function(name) { + this.opcodes.push({ opcode: name, args: slice.call(arguments, 1) }); }, - addDepth: function addDepth(depth) { - if (!depth) { - return; + addDepth: function(depth) { + if(depth === 0) { return; } + + if(!this.depths[depth]) { + this.depths[depth] = true; + this.depths.list.push(depth); } - - this.useDepths = true; }, - classifySexpr: function classifySexpr(sexpr) { - var isSimple = _AST2['default'].helpers.simpleId(sexpr.path); - - var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); - - // a mustache is an eligible helper if: - // * its id is simple (a single part, not `this` or `..`) - var isHelper = !isBlockParam && _AST2['default'].helpers.helperExpression(sexpr); - - // if a mustache is an eligible helper but not a definite - // helper, it is ambiguous, and will be resolved in a later - // pass or at runtime. - var isEligible = !isBlockParam && (isHelper || isSimple); + classifySexpr: function(sexpr) { + var isHelper = sexpr.isHelper; + var isEligible = sexpr.eligibleHelper; + var options = this.options; // if ambiguous, we can possibly resolve the ambiguity now // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. if (isEligible && !isHelper) { - var _name2 = sexpr.path.parts[0], - options = this.options; + var name = sexpr.id.parts[0]; - if (options.knownHelpers[_name2]) { + if (options.knownHelpers[name]) { isHelper = true; } else if (options.knownHelpersOnly) { isEligible = false; } } - if (isHelper) { - return 'helper'; - } else if (isEligible) { - return 'ambiguous'; - } else { - return 'simple'; - } + if (isHelper) { return "helper"; } + else if (isEligible) { return "ambiguous"; } + else { return "simple"; } }, - pushParams: function pushParams(params) { - for (var i = 0, l = params.length; i < l; i++) { + pushParams: function(params) { + for(var i=0, l=params.length; i= 0) { - return [depth, param]; - } - } } }; function precompile(input, options, env) { - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); + if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) { + throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input); } options = options || {}; @@ -452,18 +386,18 @@ function precompile(input, options, env) { options.useDepths = true; } - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options); + var ast = env.parse(input); + var environment = new env.Compiler().compile(ast, options); return new env.JavaScriptCompiler().compile(environment, options); } -function compile(input, _x, env) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); +exports.precompile = precompile;function compile(input, options, env) { + if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) { + throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input); } + options = options || {}; + if (!('data' in options)) { options.data = true; } @@ -471,43 +405,43 @@ function compile(input, _x, env) { options.useDepths = true; } - var compiled = undefined; + var compiled; function compileInput() { - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options), - templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); + var ast = env.parse(input); + var environment = new env.Compiler().compile(ast, options); + var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); return env.template(templateSpec); } // Template is only compiled on first use and cached after that point. - function ret(context, execOptions) { + var ret = function(context, options) { if (!compiled) { compiled = compileInput(); } - return compiled.call(this, context, execOptions); - } - ret._setup = function (setupOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._setup(setupOptions); + return compiled.call(this, context, options); }; - ret._child = function (i, data, blockParams, depths) { + ret._setup = function(options) { if (!compiled) { compiled = compileInput(); } - return compiled._child(i, data, blockParams, depths); + return compiled._setup(options); + }; + ret._child = function(i, data, depths) { + if (!compiled) { + compiled = compileInput(); + } + return compiled._child(i, data, depths); }; return ret; } -function argEquals(a, b) { +exports.compile = compile;function argEquals(a, b) { if (a === b) { return true; } - if (_isArray$indexOf.isArray(a) && _isArray$indexOf.isArray(b) && a.length === b.length) { + if (isArray(a) && isArray(b) && a.length === b.length) { for (var i = 0; i < a.length; i++) { if (!argEquals(a[i], b[i])) { return false; @@ -515,13 +449,4 @@ function argEquals(a, b) { } return true; } -} - -function transformLiteralToPath(sexpr) { - if (!sexpr.path.parts) { - var literal = sexpr.path; - // Casting to string here to make false and 0 literal values play nicely with the rest - // of the system. - sexpr.path = new _AST2['default'].PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); - } } \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js index dac4f0c..3e543da 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js +++ b/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js @@ -1,131 +1,187 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; -exports.SourceLocation = SourceLocation; -exports.id = id; -exports.stripFlags = stripFlags; -exports.stripComment = stripComment; -exports.preparePath = preparePath; -exports.prepareMustache = prepareMustache; -exports.prepareRawBlock = prepareRawBlock; -exports.prepareBlock = prepareBlock; - -var _Exception = require('../exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -function SourceLocation(source, locInfo) { - this.source = source; - this.start = { - line: locInfo.first_line, - column: locInfo.first_column - }; - this.end = { - line: locInfo.last_line, - column: locInfo.last_column - }; -} - -function id(token) { - if (/^\[.*\]$/.test(token)) { - return token.substr(1, token.length - 2); - } else { - return token; - } -} +"use strict"; +var Exception = require("../exception")["default"]; function stripFlags(open, close) { return { - open: open.charAt(2) === '~', - close: close.charAt(close.length - 3) === '~' + left: open.charAt(2) === '~', + right: close.charAt(close.length-3) === '~' }; } -function stripComment(comment) { - return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, ''); -} +exports.stripFlags = stripFlags; +function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { + /*jshint -W040 */ + if (mustache.sexpr.id.original !== close.path.original) { + throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache); + } -function preparePath(data, parts, locInfo) { - locInfo = this.locInfo(locInfo); + var inverse = inverseAndProgram && inverseAndProgram.program; - var original = data ? '@' : '', - dig = [], - depth = 0, - depthString = ''; + var strip = { + left: mustache.strip.left, + right: close.strip.right, - for (var i = 0, l = parts.length; i < l; i++) { - var part = parts[i].part, + // Determine the standalone candiacy. Basically flag our content as being possibly standalone + // so our parent can determine if we actually are standalone + openStandalone: isNextWhitespace(program.statements), + closeStandalone: isPrevWhitespace((inverse || program).statements) + }; - // If we have [] syntax then we do not treat path references as operators, - // i.e. foo.[this] resolves to approximately context.foo['this'] - isLiteral = parts[i].original !== part; - original += (parts[i].separator || '') + part; + if (mustache.strip.right) { + omitRight(program.statements, null, true); + } - if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { - if (dig.length > 0) { - throw new _Exception2['default']('Invalid path: ' + original, { loc: locInfo }); - } else if (part === '..') { - depth++; - depthString += '../'; - } - } else { - dig.push(part); + if (inverse) { + var inverseStrip = inverseAndProgram.strip; + + if (inverseStrip.left) { + omitLeft(program.statements, null, true); } - } - - return new this.PathExpression(data, depth, dig, original, locInfo); -} - -function prepareMustache(path, params, hash, open, strip, locInfo) { - // Must use charAt to support IE pre-10 - var escapeFlag = open.charAt(3) || open.charAt(2), - escaped = escapeFlag !== '{' && escapeFlag !== '&'; - - return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo)); -} - -function prepareRawBlock(openRawBlock, content, close, locInfo) { - if (openRawBlock.path.original !== close) { - var errorNode = { loc: openRawBlock.path.loc }; - - throw new _Exception2['default'](openRawBlock.path.original + ' doesn\'t match ' + close, errorNode); - } - - locInfo = this.locInfo(locInfo); - var program = new this.Program([content], null, {}, locInfo); - - return new this.BlockStatement(openRawBlock.path, openRawBlock.params, openRawBlock.hash, program, undefined, {}, {}, {}, locInfo); -} - -function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { - // When we are chaining inverse calls, we will not have a close path - if (close && close.path && openBlock.path.original !== close.path.original) { - var errorNode = { loc: openBlock.path.loc }; - - throw new _Exception2['default'](openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); - } - - program.blockParams = openBlock.blockParams; - - var inverse = undefined, - inverseStrip = undefined; - - if (inverseAndProgram) { - if (inverseAndProgram.chain) { - inverseAndProgram.program.body[0].closeStrip = close.strip; + if (inverseStrip.right) { + omitRight(inverse.statements, null, true); + } + if (close.strip.left) { + omitLeft(inverse.statements, null, true); } - inverseStrip = inverseAndProgram.strip; - inverse = inverseAndProgram.program; + // Find standalone else statments + if (isPrevWhitespace(program.statements) + && isNextWhitespace(inverse.statements)) { + + omitLeft(program.statements); + omitRight(inverse.statements); + } + } else { + if (close.strip.left) { + omitLeft(program.statements, null, true); + } } if (inverted) { - inverted = inverse; - inverse = program; - program = inverted; + return new this.BlockNode(mustache, inverse, program, strip, locInfo); + } else { + return new this.BlockNode(mustache, program, inverse, strip, locInfo); + } +} + +exports.prepareBlock = prepareBlock; +function prepareProgram(statements, isRoot) { + for (var i = 0, l = statements.length; i < l; i++) { + var current = statements[i], + strip = current.strip; + + if (!strip) { + continue; + } + + var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'), + _isNextWhitespace = isNextWhitespace(statements, i, isRoot), + + openStandalone = strip.openStandalone && _isPrevWhitespace, + closeStandalone = strip.closeStandalone && _isNextWhitespace, + inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; + + if (strip.right) { + omitRight(statements, i, true); + } + if (strip.left) { + omitLeft(statements, i, true); + } + + if (inlineStandalone) { + omitRight(statements, i); + + if (omitLeft(statements, i)) { + // If we are on a standalone node, save the indent info for partials + if (current.type === 'partial') { + current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : ''; + } + } + } + if (openStandalone) { + omitRight((current.program || current.inverse).statements); + + // Strip out the previous content node if it's whitespace only + omitLeft(statements, i); + } + if (closeStandalone) { + // Always strip the next node + omitRight(statements, i); + + omitLeft((current.inverse || current.program).statements); + } } - return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); + return statements; +} + +exports.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = statements.length; + } + + // Nodes that end with newlines are considered whitespace (but are special + // cased for strip operations) + var prev = statements[i-1], + sibling = statements[i-2]; + if (!prev) { + return isRoot; + } + + if (prev.type === 'content') { + return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); + } +} +function isNextWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = -1; + } + + var next = statements[i+1], + sibling = statements[i+2]; + if (!next) { + return isRoot; + } + + if (next.type === 'content') { + return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); + } +} + +// Marks the node to the right of the position as omitted. +// I.e. {{foo}}' ' will mark the ' ' node as omitted. +// +// If i is undefined, then the first child will be marked as such. +// +// If mulitple is truthy then all whitespace will be stripped out until non-whitespace +// content is met. +function omitRight(statements, i, multiple) { + var current = statements[i == null ? 0 : i + 1]; + if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) { + return; + } + + var original = current.string; + current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); + current.rightStripped = current.string !== original; +} + +// Marks the node to the left of the position as omitted. +// I.e. ' '{{foo}} will mark the ' ' node as omitted. +// +// If i is undefined then the last child will be marked as such. +// +// If mulitple is truthy then all whitespace will be stripped out until non-whitespace +// content is met. +function omitLeft(statements, i, multiple) { + var current = statements[i == null ? statements.length - 1 : i - 1]; + if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) { + return; + } + + // We omit the last node if it's whitespace only and not preceeded by a non-content node. + var original = current.string; + current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); + current.leftStripped = current.string !== original; + return current.leftStripped; } \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js index c77f270..2b13a21 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js +++ b/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js @@ -1,20 +1,7 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; - -var _COMPILER_REVISION$REVISION_CHANGES = require('../base'); - -var _Exception = require('../exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -var _isArray = require('../utils'); - -var _CodeGen = require('./code-gen'); - -var _CodeGen2 = _interopRequireWildcard(_CodeGen); +"use strict"; +var COMPILER_REVISION = require("../base").COMPILER_REVISION; +var REVISION_CHANGES = require("../base").REVISION_CHANGES; +var Exception = require("../exception")["default"]; function Literal(value) { this.value = value; @@ -25,49 +12,45 @@ function JavaScriptCompiler() {} JavaScriptCompiler.prototype = { // PUBLIC API: You can override these methods in a subclass to provide // alternative compiled forms for name lookup and buffering semantics - nameLookup: function nameLookup(parent, name /* , type*/) { + nameLookup: function(parent, name /* , type*/) { if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { - return [parent, '.', name]; + return parent + "." + name; } else { - return [parent, '[\'', name, '\']']; + return parent + "['" + name + "']"; } }, - depthedLookup: function depthedLookup(name) { - return [this.aliasable('this.lookup'), '(depths, "', name, '")']; + depthedLookup: function(name) { + this.aliases.lookup = 'this.lookup'; + + return 'lookup(depths, "' + name + '")'; }, - compilerInfo: function compilerInfo() { - var revision = _COMPILER_REVISION$REVISION_CHANGES.COMPILER_REVISION, - versions = _COMPILER_REVISION$REVISION_CHANGES.REVISION_CHANGES[revision]; + compilerInfo: function() { + var revision = COMPILER_REVISION, + versions = REVISION_CHANGES[revision]; return [revision, versions]; }, - appendToBuffer: function appendToBuffer(source, location, explicit) { - // Force a source as this simplifies the merge logic. - if (!_isArray.isArray(source)) { - source = [source]; - } - source = this.source.wrap(source, location); - + appendToBuffer: function(string) { if (this.environment.isSimple) { - return ['return ', source, ';']; - } else if (explicit) { - // This is a case where the buffer operation occurs as a child of another - // construct, generally braces. We have to explicitly output these buffer - // operations to ensure that the emitted code goes in the correct location. - return ['buffer += ', source, ';']; + return "return " + string + ";"; } else { - source.appendToBuffer = true; - return source; + return { + appendToBuffer: true, + content: string, + toString: function() { return "buffer += " + string + ";"; } + }; } }, - initializeBuffer: function initializeBuffer() { - return this.quotedString(''); + initializeBuffer: function() { + return this.quotedString(""); }, + + namespace: "Handlebars", // END PUBLIC API - compile: function compile(environment, options, context, asObject) { + compile: function(environment, options, context, asObject) { this.environment = environment; this.options = options; this.stringParams = this.options.stringParams; @@ -90,34 +73,28 @@ JavaScriptCompiler.prototype = { this.hashes = []; this.compileStack = []; this.inlineStack = []; - this.blockParams = []; this.compileChildren(environment, options); - this.useDepths = this.useDepths || environment.useDepths || this.options.compat; - this.useBlockParams = this.useBlockParams || environment.useBlockParams; + this.useDepths = this.useDepths || environment.depths.list.length || this.options.compat; var opcodes = environment.opcodes, - opcode = undefined, - firstLoc = undefined, - i = undefined, - l = undefined; + opcode, + i, + l; for (i = 0, l = opcodes.length; i < l; i++) { opcode = opcodes[i]; - this.source.currentLocation = opcode.loc; - firstLoc = firstLoc || opcode.loc; this[opcode.opcode].apply(this, opcode.args); } // Flush any trailing content that might be pending. - this.source.currentLocation = firstLoc; this.pushSource(''); /* istanbul ignore next */ if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { - throw new _Exception2['default']('Compile completed with content left on stack'); + throw new Exception('Compile completed with content left on stack'); } var fn = this.createFunctionContext(asObject); @@ -142,27 +119,13 @@ JavaScriptCompiler.prototype = { if (this.useDepths) { ret.useDepths = true; } - if (this.useBlockParams) { - ret.useBlockParams = true; - } if (this.options.compat) { ret.compat = true; } if (!asObject) { ret.compiler = JSON.stringify(ret.compiler); - - this.source.currentLocation = { start: { line: 1, column: 0 } }; ret = this.objectLiteral(ret); - - if (options.srcName) { - ret = ret.toStringWithSourceMap({ file: options.destName }); - ret.map = ret.map && ret.map.toString(); - } else { - ret = ret.toString(); - } - } else { - ret.compilerOptions = this.options; } return ret; @@ -171,43 +134,30 @@ JavaScriptCompiler.prototype = { } }, - preamble: function preamble() { + preamble: function() { // track the last context pushed into place to allow skipping the // getContext opcode when it would be a noop this.lastContext = 0; - this.source = new _CodeGen2['default'](this.options.srcName); + this.source = []; }, - createFunctionContext: function createFunctionContext(asObject) { + createFunctionContext: function(asObject) { var varDeclarations = ''; var locals = this.stackVars.concat(this.registers.list); - if (locals.length > 0) { - varDeclarations += ', ' + locals.join(', '); + if(locals.length > 0) { + varDeclarations += ", " + locals.join(", "); } // Generate minimizer alias mappings - // - // When using true SourceNodes, this will update all references to the given alias - // as the source nodes are reused in situ. For the non-source node compilation mode, - // aliases will not be used, but this case is already being run on the client and - // we aren't concern about minimizing the template size. - var aliasCount = 0; for (var alias in this.aliases) { - // eslint-disable-line guard-for-in - var node = this.aliases[alias]; - - if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { - varDeclarations += ', alias' + ++aliasCount + '=' + alias; - node.children[0] = 'alias' + aliasCount; + if (this.aliases.hasOwnProperty(alias)) { + varDeclarations += ', ' + alias + '=' + this.aliases[alias]; } } - var params = ['depth0', 'helpers', 'partials', 'data']; + var params = ["depth0", "helpers", "partials", "data"]; - if (this.useBlockParams || this.useDepths) { - params.push('blockParams'); - } if (this.useDepths) { params.push('depths'); } @@ -220,65 +170,59 @@ JavaScriptCompiler.prototype = { return Function.apply(this, params); } else { - return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); + return 'function(' + params.join(',') + ') {\n ' + source + '}'; } }, - mergeSource: function mergeSource(varDeclarations) { - var isSimple = this.environment.isSimple, + mergeSource: function(varDeclarations) { + var source = '', + buffer, appendOnly = !this.forceBuffer, - appendFirst = undefined, - sourceSeen = undefined, - bufferStart = undefined, - bufferEnd = undefined; - this.source.each(function (line) { - if (line.appendToBuffer) { - if (bufferStart) { - line.prepend(' + '); - } else { - bufferStart = line; - } - bufferEnd = line; - } else { - if (bufferStart) { - if (!sourceSeen) { - appendFirst = true; - } else { - bufferStart.prepend('buffer += '); - } - bufferEnd.add(';'); - bufferStart = bufferEnd = undefined; - } + appendFirst; - sourceSeen = true; - if (!isSimple) { + for (var i = 0, len = this.source.length; i < len; i++) { + var line = this.source[i]; + if (line.appendToBuffer) { + if (buffer) { + buffer = buffer + '\n + ' + line.content; + } else { + buffer = line.content; + } + } else { + if (buffer) { + if (!source) { + appendFirst = true; + source = buffer + ';\n '; + } else { + source += 'buffer += ' + buffer + ';\n '; + } + buffer = undefined; + } + source += line + '\n '; + + if (!this.environment.isSimple) { appendOnly = false; } } - }); + } if (appendOnly) { - if (bufferStart) { - bufferStart.prepend('return '); - bufferEnd.add(';'); - } else if (!sourceSeen) { - this.source.push('return "";'); + if (buffer || !source) { + source += 'return ' + (buffer || '""') + ';\n'; } } else { - varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); - - if (bufferStart) { - bufferStart.prepend('return buffer + '); - bufferEnd.add(';'); + varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer()); + if (buffer) { + source += 'return buffer + ' + buffer + ';\n'; } else { - this.source.push('return buffer;'); + source += 'return buffer;\n'; } } if (varDeclarations) { - this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); + source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source; } - return this.source.merge(); + return source; }, // [blockValue] @@ -290,15 +234,16 @@ JavaScriptCompiler.prototype = { // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and // replace it on the stack with the result of properly // invoking blockHelperMissing. - blockValue: function blockValue(name) { - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs(name, 0, params); + blockValue: function(name) { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + + var params = [this.contextName(0)]; + this.setupParams(name, 0, params); var blockName = this.popStack(); params.splice(1, 0, blockName); - this.push(this.source.functionCall(blockHelperMissing, 'call', params)); + this.push('blockHelperMissing.call(' + params.join(', ') + ')'); }, // [ambiguousBlockValue] @@ -307,18 +252,19 @@ JavaScriptCompiler.prototype = { // Compiler value, before: lastHelper=value of last found helper, if any // On stack, after, if no lastHelper: same as [blockValue] // On stack, after, if lastHelper: value - ambiguousBlockValue: function ambiguousBlockValue() { + ambiguousBlockValue: function() { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + // We're being a bit cheeky and reusing the options value from the prior exec - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs('', 0, params, true); + var params = [this.contextName(0)]; + this.setupParams('', 0, params, true); this.flushInline(); var current = this.topStack(); params.splice(1, 0, current); - this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); + this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }"); }, // [appendContent] @@ -327,11 +273,9 @@ JavaScriptCompiler.prototype = { // On stack, after: ... // // Appends the string value of `content` to the current buffer - appendContent: function appendContent(content) { + appendContent: function(content) { if (this.pendingContent) { content = this.pendingContent + content; - } else { - this.pendingLocation = this.source.currentLocation; } this.pendingContent = content; @@ -346,19 +290,14 @@ JavaScriptCompiler.prototype = { // // If `value` is truthy, or 0, it is coerced into a string and appended // Otherwise, the empty string is appended - append: function append() { - if (this.isInline()) { - this.replaceStack(function (current) { - return [' != null ? ', current, ' : ""']; - }); - - this.pushSource(this.appendToBuffer(this.popStack())); - } else { - var local = this.popStack(); - this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); - if (this.environment.isSimple) { - this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']); - } + append: function() { + // Force anything that is inlined onto the stack so we don't have duplication + // when we examine local + this.flushInline(); + var local = this.popStack(); + this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }'); + if (this.environment.isSimple) { + this.pushSource("else { " + this.appendToBuffer("''") + " }"); } }, @@ -368,8 +307,10 @@ JavaScriptCompiler.prototype = { // On stack, after: ... // // Escape `value` and append it to the buffer - appendEscaped: function appendEscaped() { - this.pushSource(this.appendToBuffer([this.aliasable('this.escapeExpression'), '(', this.popStack(), ')'])); + appendEscaped: function() { + this.aliases.escapeExpression = 'this.escapeExpression'; + + this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")); }, // [getContext] @@ -379,7 +320,7 @@ JavaScriptCompiler.prototype = { // Compiler value, after: lastContext=depth // // Set the value of the `lastContext` compiler value to the depth - getContext: function getContext(depth) { + getContext: function(depth) { this.lastContext = depth; }, @@ -389,7 +330,7 @@ JavaScriptCompiler.prototype = { // On stack, after: currentContext, ... // // Pushes the value of the current context onto the stack. - pushContext: function pushContext() { + pushContext: function() { this.pushStackLiteral(this.contextName(this.lastContext)); }, @@ -400,8 +341,10 @@ JavaScriptCompiler.prototype = { // // Looks up the value of `name` on the current context and pushes // it onto the stack. - lookupOnContext: function lookupOnContext(parts, falsy, scoped) { - var i = 0; + lookupOnContext: function(parts, falsy, scoped) { + /*jshint -W083 */ + var i = 0, + len = parts.length; if (!scoped && this.options.compat && !this.lastContext) { // The depthed query is expected to handle the undefined logic for the root level that @@ -411,21 +354,19 @@ JavaScriptCompiler.prototype = { this.pushContext(); } - this.resolvePath('context', parts, i, falsy); - }, - - // [lookupBlockParam] - // - // On stack, before: ... - // On stack, after: blockParam[name], ... - // - // Looks up the value of `parts` on the given block param and pushes - // it onto the stack. - lookupBlockParam: function lookupBlockParam(blockParamId, parts) { - this.useBlockParams = true; - - this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); - this.resolvePath('context', parts, 1); + for (; i < len; i++) { + this.replaceStack(function(current) { + var lookup = this.nameLookup(current, parts[i], 'context'); + // We want to ensure that zero and false are handled properly if the context (falsy flag) + // needs to have the special handling for these values. + if (!falsy) { + return ' != null ? ' + lookup + ' : ' + current; + } else { + // Otherwise we can use generic falsy handling + return ' && ' + lookup; + } + }); + } }, // [lookupData] @@ -434,39 +375,19 @@ JavaScriptCompiler.prototype = { // On stack, after: data, ... // // Push the data lookup operator - lookupData: function lookupData(depth, parts) { + lookupData: function(depth, parts) { + /*jshint -W083 */ if (!depth) { this.pushStackLiteral('data'); } else { this.pushStackLiteral('this.data(data, ' + depth + ')'); } - this.resolvePath('data', parts, 0, true); - }, - - resolvePath: function resolvePath(type, parts, i, falsy) { - var _this = this; - - if (this.options.strict || this.options.assumeObjects) { - this.push(strictLookup(this.options.strict, this, parts, type)); - return; - } - var len = parts.length; - for (; i < len; i++) { - /*eslint-disable no-loop-func */ - this.replaceStack(function (current) { - var lookup = _this.nameLookup(current, parts[i], type); - // We want to ensure that zero and false are handled properly if the context (falsy flag) - // needs to have the special handling for these values. - if (!falsy) { - return [' != null ? ', lookup, ' : ', current]; - } else { - // Otherwise we can use generic falsy handling - return [' && ', lookup]; - } + for (var i = 0; i < len; i++) { + this.replaceStack(function(current) { + return ' && ' + this.nameLookup(current, parts[i], 'data'); }); - /*eslint-enable no-loop-func */ } }, @@ -477,8 +398,10 @@ JavaScriptCompiler.prototype = { // // If the `value` is a lambda, replace it on the stack by // the return value of the lambda - resolvePossibleLambda: function resolvePossibleLambda() { - this.push([this.aliasable('this.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); + resolvePossibleLambda: function() { + this.aliases.lambda = 'this.lambda'; + + this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')'); }, // [pushStringParam] @@ -489,13 +412,13 @@ JavaScriptCompiler.prototype = { // This opcode is designed for use in string mode, which // provides the string value of a parameter along with its // depth rather than resolving it immediately. - pushStringParam: function pushStringParam(string, type) { + pushStringParam: function(string, type) { this.pushContext(); this.pushString(type); // If it's a subexpression, the string result // will be pushed after this opcode. - if (type !== 'SubExpression') { + if (type !== 'sexpr') { if (typeof string === 'string') { this.pushString(string); } else { @@ -504,7 +427,9 @@ JavaScriptCompiler.prototype = { } }, - emptyHash: function emptyHash(omitEmpty) { + emptyHash: function() { + this.pushStackLiteral('{}'); + if (this.trackIds) { this.push('{}'); // hashIds } @@ -512,27 +437,26 @@ JavaScriptCompiler.prototype = { this.push('{}'); // hashContexts this.push('{}'); // hashTypes } - this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); }, - pushHash: function pushHash() { + pushHash: function() { if (this.hash) { this.hashes.push(this.hash); } - this.hash = { values: [], types: [], contexts: [], ids: [] }; + this.hash = {values: [], types: [], contexts: [], ids: []}; }, - popHash: function popHash() { + popHash: function() { var hash = this.hash; this.hash = this.hashes.pop(); if (this.trackIds) { - this.push(this.objectLiteral(hash.ids)); + this.push('{' + hash.ids.join(',') + '}'); } if (this.stringParams) { - this.push(this.objectLiteral(hash.contexts)); - this.push(this.objectLiteral(hash.types)); + this.push('{' + hash.contexts.join(',') + '}'); + this.push('{' + hash.types.join(',') + '}'); } - this.push(this.objectLiteral(hash.values)); + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); }, // [pushString] @@ -541,10 +465,21 @@ JavaScriptCompiler.prototype = { // On stack, after: quotedString(string), ... // // Push a quoted version of `string` onto the stack - pushString: function pushString(string) { + pushString: function(string) { this.pushStackLiteral(this.quotedString(string)); }, + // [push] + // + // On stack, before: ... + // On stack, after: expr, ... + // + // Push an expression onto the stack + push: function(expr) { + this.inlineStack.push(expr); + return expr; + }, + // [pushLiteral] // // On stack, before: ... @@ -553,7 +488,7 @@ JavaScriptCompiler.prototype = { // Pushes a value onto the stack. This operation prevents // the compiler from creating a temporary variable to hold // it. - pushLiteral: function pushLiteral(value) { + pushLiteral: function(value) { this.pushStackLiteral(value); }, @@ -565,7 +500,7 @@ JavaScriptCompiler.prototype = { // Push a program expression onto the stack. This takes // a compile-time guid and converts it into a runtime-accessible // expression. - pushProgram: function pushProgram(guid) { + pushProgram: function(guid) { if (guid != null) { this.pushStackLiteral(this.programExpression(guid)); } else { @@ -582,18 +517,14 @@ JavaScriptCompiler.prototype = { // and pushes the helper's return value onto the stack. // // If the helper is not found, `helperMissing` is called. - invokeHelper: function invokeHelper(paramSize, name, isSimple) { - var nonHelper = this.popStack(), - helper = this.setupHelper(paramSize, name), - simple = isSimple ? [helper.name, ' || '] : ''; + invokeHelper: function(paramSize, name, isSimple) { + this.aliases.helperMissing = 'helpers.helperMissing'; - var lookup = ['('].concat(simple, nonHelper); - if (!this.options.strict) { - lookup.push(' || ', this.aliasable('helpers.helperMissing')); - } - lookup.push(')'); + var nonHelper = this.popStack(); + var helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(lookup, 'call', helper.callParams)); + var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing'; + this.push('((' + lookup + ').call(' + helper.callParams + '))'); }, // [invokeKnownHelper] @@ -603,9 +534,9 @@ JavaScriptCompiler.prototype = { // // This operation is used when the helper is known to exist, // so a `helperMissing` fallback is not required. - invokeKnownHelper: function invokeKnownHelper(paramSize, name) { + invokeKnownHelper: function(paramSize, name) { var helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); + this.push(helper.name + ".call(" + helper.callParams + ")"); }, // [invokeAmbiguous] @@ -620,7 +551,9 @@ JavaScriptCompiler.prototype = { // This operation emits more code than the other options, // and can be avoided by passing the `knownHelpers` and // `knownHelpersOnly` flags at compile-time. - invokeAmbiguous: function invokeAmbiguous(name, helperCall) { + invokeAmbiguous: function(name, helperCall) { + this.aliases.functionType = '"function"'; + this.aliases.helperMissing = 'helpers.helperMissing'; this.useRegister('helper'); var nonHelper = this.popStack(); @@ -630,13 +563,10 @@ JavaScriptCompiler.prototype = { var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); - var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; - if (!this.options.strict) { - lookup[0] = '(helper = '; - lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing')); - } - - this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); + this.push( + '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing' + + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),' + + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))'); }, // [invokePartial] @@ -646,34 +576,19 @@ JavaScriptCompiler.prototype = { // // This operation pops off a context, invokes a partial with that context, // and pushes the result of the invocation back. - invokePartial: function invokePartial(isDynamic, name, indent) { - var params = [], - options = this.setupParams(name, 1, params, false); + invokePartial: function(name, indent) { + var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"]; - if (isDynamic) { - name = this.popStack(); - delete options.name; + if (this.options.data) { + params.push("data"); + } else if (this.options.compat) { + params.push('undefined'); } - - if (indent) { - options.indent = JSON.stringify(indent); - } - options.helpers = 'helpers'; - options.partials = 'partials'; - - if (!isDynamic) { - params.unshift(this.nameLookup('partials', name, 'partial')); - } else { - params.unshift(name); - } - if (this.options.compat) { - options.depths = 'depths'; + params.push('depths'); } - options = this.objectLiteral(options); - params.push(options); - this.push(this.source.functionCall('this.invokePartial', '', params)); + this.push("this.invokePartial(" + params.join(", ") + ")"); }, // [assignToHash] @@ -682,11 +597,11 @@ JavaScriptCompiler.prototype = { // On stack, after: ..., hash, ... // // Pops a value off the stack and assigns it to the current hash - assignToHash: function assignToHash(key) { + assignToHash: function(key) { var value = this.popStack(), - context = undefined, - type = undefined, - id = undefined; + context, + type, + id; if (this.trackIds) { id = this.popStack(); @@ -698,23 +613,21 @@ JavaScriptCompiler.prototype = { var hash = this.hash; if (context) { - hash.contexts[key] = context; + hash.contexts.push("'" + key + "': " + context); } if (type) { - hash.types[key] = type; + hash.types.push("'" + key + "': " + type); } if (id) { - hash.ids[key] = id; + hash.ids.push("'" + key + "': " + id); } - hash.values[key] = value; + hash.values.push("'" + key + "': (" + value + ")"); }, - pushId: function pushId(type, name, child) { - if (type === 'BlockParam') { - this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); - } else if (type === 'PathExpression') { + pushId: function(type, name) { + if (type === 'ID' || type === 'DATA') { this.pushString(name); - } else if (type === 'SubExpression') { + } else if (type === 'sexpr') { this.pushStackLiteral('true'); } else { this.pushStackLiteral('null'); @@ -725,19 +638,17 @@ JavaScriptCompiler.prototype = { compiler: JavaScriptCompiler, - compileChildren: function compileChildren(environment, options) { - var children = environment.children, - child = undefined, - compiler = undefined; + compileChildren: function(environment, options) { + var children = environment.children, child, compiler; - for (var i = 0, l = children.length; i < l; i++) { + for(var i=0, l=children.length; i this.stackVars.length) { - this.stackVars.push('stack' + this.stackSlot); - } + if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } return this.topStackName(); }, - topStackName: function topStackName() { - return 'stack' + this.stackSlot; + topStackName: function() { + return "stack" + this.stackSlot; }, - flushInline: function flushInline() { + flushInline: function() { var inlineStack = this.inlineStack; - this.inlineStack = []; - for (var i = 0, len = inlineStack.length; i < len; i++) { - var entry = inlineStack[i]; - /* istanbul ignore if */ - if (entry instanceof Literal) { - this.compileStack.push(entry); - } else { - var stack = this.incrStack(); - this.pushSource([stack, ' = ', entry, ';']); - this.compileStack.push(stack); + if (inlineStack.length) { + this.inlineStack = []; + for (var i = 0, len = inlineStack.length; i < len; i++) { + var entry = inlineStack[i]; + if (entry instanceof Literal) { + this.compileStack.push(entry); + } else { + this.pushStack(entry); + } } } }, - isInline: function isInline() { + isInline: function() { return this.inlineStack.length; }, - popStack: function popStack(wrapped) { + popStack: function(wrapped) { var inline = this.isInline(), item = (inline ? this.inlineStack : this.compileStack).pop(); - if (!wrapped && item instanceof Literal) { + if (!wrapped && (item instanceof Literal)) { return item.value; } else { if (!inline) { /* istanbul ignore next */ if (!this.stackSlot) { - throw new _Exception2['default']('Invalid stack pop'); + throw new Exception('Invalid stack pop'); } this.stackSlot--; } @@ -895,11 +800,10 @@ JavaScriptCompiler.prototype = { } }, - topStack: function topStack() { - var stack = this.isInline() ? this.inlineStack : this.compileStack, + topStack: function() { + var stack = (this.isInline() ? this.inlineStack : this.compileStack), item = stack[stack.length - 1]; - /* istanbul ignore if */ if (item instanceof Literal) { return item.value; } else { @@ -907,7 +811,7 @@ JavaScriptCompiler.prototype = { } }, - contextName: function contextName(context) { + contextName: function(context) { if (this.useDepths && context) { return 'depths[' + context + ']'; } else { @@ -915,47 +819,43 @@ JavaScriptCompiler.prototype = { } }, - quotedString: function quotedString(str) { - return this.source.quotedString(str); + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 + .replace(/\u2029/g, '\\u2029') + '"'; }, - objectLiteral: function objectLiteral(obj) { - return this.source.objectLiteral(obj); - }, + objectLiteral: function(obj) { + var pairs = []; - aliasable: function aliasable(name) { - var ret = this.aliases[name]; - if (ret) { - ret.referenceCount++; - return ret; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + pairs.push(this.quotedString(key) + ':' + obj[key]); + } } - ret = this.aliases[name] = this.source.wrap(name); - ret.aliasable = true; - ret.referenceCount = 1; - - return ret; + return '{' + pairs.join(',') + '}'; }, - setupHelper: function setupHelper(paramSize, name, blockHelper) { + setupHelper: function(paramSize, name, blockHelper) { var params = [], - paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); + paramsInit = this.setupParams(name, paramSize, params, blockHelper); var foundHelper = this.nameLookup('helpers', name, 'helper'); return { params: params, paramsInit: paramsInit, name: foundHelper, - callParams: [this.contextName(0)].concat(params) + callParams: [this.contextName(0)].concat(params).join(", ") }; }, - setupParams: function setupParams(helper, paramSize, params) { - var options = {}, - contexts = [], - types = [], - ids = [], - param = undefined; + setupOptions: function(helper, paramSize, params) { + var options = {}, contexts = [], types = [], ids = [], param, inverse, program; options.name = this.quotedString(helper); options.hash = this.popStack(); @@ -968,14 +868,22 @@ JavaScriptCompiler.prototype = { options.hashContexts = this.popStack(); } - var inverse = this.popStack(), - program = this.popStack(); + inverse = this.popStack(); + program = this.popStack(); // Avoid setting fn and inverse if neither are set. This allows // helpers to do a check for `if (options.fn)` if (program || inverse) { - options.fn = program || 'this.noop'; - options.inverse = inverse || 'this.noop'; + if (!program) { + program = 'this.noop'; + } + + if (!inverse) { + inverse = 'this.noop'; + } + + options.fn = program; + options.inverse = inverse; } // The parameters go on to the stack in order (making sure that they are evaluated in order) @@ -995,29 +903,29 @@ JavaScriptCompiler.prototype = { } if (this.trackIds) { - options.ids = this.source.generateArray(ids); + options.ids = "[" + ids.join(",") + "]"; } if (this.stringParams) { - options.types = this.source.generateArray(types); - options.contexts = this.source.generateArray(contexts); + options.types = "[" + types.join(",") + "]"; + options.contexts = "[" + contexts.join(",") + "]"; } if (this.options.data) { - options.data = 'data'; - } - if (this.useBlockParams) { - options.blockParams = 'blockParams'; + options.data = "data"; } + return options; }, - setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { - var options = this.setupParams(helper, paramSize, params, true); - options = this.objectLiteral(options); + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(helperName, paramSize, params, useRegister) { + var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params)); + if (useRegister) { this.useRegister('options'); params.push('options'); - return ['options=', options]; + return 'options=' + options; } else { params.push(options); return ''; @@ -1025,38 +933,32 @@ JavaScriptCompiler.prototype = { } }; -(function () { - var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); +var reservedWords = ( + "break else new var" + + " case finally return void" + + " catch for switch while" + + " continue function this with" + + " default if throw" + + " delete in try" + + " do instanceof typeof" + + " abstract enum int short" + + " boolean export interface static" + + " byte extends long super" + + " char final native synchronized" + + " class float package throws" + + " const goto private transient" + + " debugger implements protected volatile" + + " double import public let yield" +).split(" "); - var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; +var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - for (var i = 0, l = reservedWords.length; i < l; i++) { - compilerWords[reservedWords[i]] = true; - } -})(); +for(var i=0, l=reservedWords.length; i 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - if (!recovering) { - expected = []; - for (p in table[state]) if (this.terminals_[p] && p > 2) { - expected.push("'" + this.terminals_[p] + "'"); - } - if (this.lexer.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); - } - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) recovering--; - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; - if (ranges) { - yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: return true; } - }; - /* Jison generated lexer */ - var lexer = (function () { - var lexer = { EOF: 1, - parseError: function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - setInput: function setInput(input) { - this._input = input; - this._more = this._less = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; - if (this.options.ranges) this.yylloc.range = [0, 0]; - this.offset = 0; - return this; - }, - input: function input() { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) this.yylloc.range[1]++; + } + return true; +} +}; +/* Jison generated lexer */ +var lexer = (function(){ +var lexer = ({EOF:1, +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, +setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; - this._input = this._input.slice(1); - return ch; - }, - unput: function unput(ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); + this._input = this._input.slice(1); + return ch; + }, +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); - if (lines.length - 1) this.yylineno -= lines.length - 1; - var r = this.yylloc.range; + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; - this.yylloc = { first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - return this; - }, - more: function more() { - this._more = true; - return this; - }, - less: function less(n) { - this.unput(this.match.slice(n)); - }, - pastInput: function pastInput() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - upcomingInput: function upcomingInput() { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20 - next.length); - } - return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - showPosition: function showPosition() { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - next: function next() { - if (this.done) { - return this.EOF; - } - if (!this._input) this.done = true; + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, +more:function () { + this._more = true; + return this; + }, +less:function (n) { + this.unput(this.match.slice(n)); + }, +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; - var token, match, tempMatch, index, col, lines; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (!this.options.flex) break; - } - } - if (match) { - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) this.yylineno += lines.length; - this.yylloc = { first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) this.done = false; - if (token) { - return token; - } else { - return; - } - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); - } - }, - lex: function lex() { - var r = this.next(); - if (typeof r !== "undefined") { - return r; - } else { - return this.lex(); - } - }, - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - popState: function popState() { - return this.conditionStack.pop(); - }, - _currentRules: function _currentRules() { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - }, - topState: function topState() { - return this.conditionStack[this.conditionStack.length - 2]; - }, - pushState: function begin(condition) { - this.begin(condition); - } }; - lexer.options = {}; - lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - - function strip(start, end) { - return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end); + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; } - - var YYSTATE = YY_START; - switch ($avoiding_name_collisions) { - case 0: - if (yy_.yytext.slice(-2) === "\\\\") { - strip(0, 1); - this.begin("mu"); - } else if (yy_.yytext.slice(-1) === "\\") { - strip(0, 1); - this.begin("emu"); - } else { - this.begin("mu"); - } - if (yy_.yytext) { - return 14; - }break; - case 1: - return 14; - break; - case 2: - this.popState(); - return 14; - - break; - case 3: - yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9); - this.popState(); - return 16; - - break; - case 4: - return 14; - break; - case 5: - this.popState(); - return 13; - - break; - case 6: - return 59; - break; - case 7: - return 62; - break; - case 8: - return 17; - break; - case 9: - this.popState(); - this.begin("raw"); - return 21; - - break; - case 10: - return 53; - break; - case 11: - return 27; - break; - case 12: - return 45; - break; - case 13: - this.popState();return 42; - break; - case 14: - this.popState();return 42; - break; - case 15: - return 32; - break; - case 16: - return 37; - break; - case 17: - return 49; - break; - case 18: - return 46; - break; - case 19: - this.unput(yy_.yytext); - this.popState(); - this.begin("com"); - - break; - case 20: - this.popState(); - return 13; - - break; - case 21: - return 46; - break; - case 22: - return 67; - break; - case 23: - return 66; - break; - case 24: - return 66; - break; - case 25: - return 81; - break; - case 26: - // ignore whitespace - break; - case 27: - this.popState();return 52; - break; - case 28: - this.popState();return 31; - break; - case 29: - yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74; - break; - case 30: - yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 74; - break; - case 31: - return 79; - break; - case 32: - return 76; - break; - case 33: - return 76; - break; - case 34: - return 77; - break; - case 35: - return 78; - break; - case 36: - return 75; - break; - case 37: - return 69; - break; - case 38: - return 71; - break; - case 39: - return 66; - break; - case 40: - return 66; - break; - case 41: - return "INVALID"; - break; - case 42: - return 5; - break; + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; } - }; - lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/]; - lexer.conditions = { mu: { rules: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } }; - return lexer; - })(); - parser.lexer = lexer; - function Parser() { - this.yy = {}; - }Parser.prototype = parser;parser.Parser = Parser; - return new Parser(); + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, +lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, +begin:function begin(condition) { + this.conditionStack.push(condition); + }, +popState:function popState() { + return this.conditionStack.pop(); + }, +_currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, +topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, +pushState:function begin(condition) { + this.begin(condition); + }}); +lexer.options = {}; +lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + + +function strip(start, end) { + return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end); +} + + +var YYSTATE=YY_START +switch($avoiding_name_collisions) { +case 0: + if(yy_.yytext.slice(-2) === "\\\\") { + strip(0,1); + this.begin("mu"); + } else if(yy_.yytext.slice(-1) === "\\") { + strip(0,1); + this.begin("emu"); + } else { + this.begin("mu"); + } + if(yy_.yytext) return 12; + +break; +case 1:return 12; +break; +case 2: + this.popState(); + return 12; + +break; +case 3: + yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9); + this.popState(); + return 15; + +break; +case 4: return 12; +break; +case 5:strip(0,4); this.popState(); return 13; +break; +case 6:return 45; +break; +case 7:return 46; +break; +case 8: return 16; +break; +case 9: + this.popState(); + this.begin('raw'); + return 18; + +break; +case 10:return 34; +break; +case 11:return 24; +break; +case 12:return 29; +break; +case 13:this.popState(); return 28; +break; +case 14:this.popState(); return 28; +break; +case 15:return 26; +break; +case 16:return 26; +break; +case 17:return 32; +break; +case 18:return 31; +break; +case 19:this.popState(); this.begin('com'); +break; +case 20:strip(3,5); this.popState(); return 13; +break; +case 21:return 31; +break; +case 22:return 51; +break; +case 23:return 50; +break; +case 24:return 50; +break; +case 25:return 54; +break; +case 26:// ignore whitespace +break; +case 27:this.popState(); return 33; +break; +case 28:this.popState(); return 25; +break; +case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42; +break; +case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42; +break; +case 31:return 52; +break; +case 32:return 44; +break; +case 33:return 44; +break; +case 34:return 43; +break; +case 35:return 50; +break; +case 36:yy_.yytext = strip(1,2); return 50; +break; +case 37:return 'INVALID'; +break; +case 38:return 5; +break; +} +}; +lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; +lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}}; +return lexer;})() +parser.lexer = lexer; +function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; +return new Parser; })();exports["default"] = handlebars; -module.exports = exports["default"]; \ No newline at end of file +/* jshint ignore:end */ \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js index 8caebf6..db44c8d 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js +++ b/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js @@ -1,54 +1,34 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; -exports.print = print; -exports.PrintVisitor = PrintVisitor; -/*eslint-disable new-cap */ - -var _Visitor = require('./visitor'); - -var _Visitor2 = _interopRequireWildcard(_Visitor); +"use strict"; +var Visitor = require("./visitor")["default"]; function print(ast) { return new PrintVisitor().accept(ast); } -function PrintVisitor() { +exports.print = print;function PrintVisitor() { this.padding = 0; } -PrintVisitor.prototype = new _Visitor2['default'](); +exports.PrintVisitor = PrintVisitor;PrintVisitor.prototype = new Visitor(); -PrintVisitor.prototype.pad = function (string) { - var out = ''; +PrintVisitor.prototype.pad = function(string) { + var out = ""; - for (var i = 0, l = this.padding; i < l; i++) { - out = out + ' '; + for(var i=0,l=this.padding; i ' + content + ' }}'); -}; +PrintVisitor.prototype.sexpr = function(sexpr) { + var params = sexpr.params, paramStrings = [], hash; -PrintVisitor.prototype.ContentStatement = function (content) { - return this.pad('CONTENT[ \'' + content.value + '\' ]'); -}; - -PrintVisitor.prototype.CommentStatement = function (comment) { - return this.pad('{{! \'' + comment.value + '\' }}'); -}; - -PrintVisitor.prototype.SubExpression = function (sexpr) { - var params = sexpr.params, - paramStrings = [], - hash = undefined; - - for (var i = 0, l = params.length; i < l; i++) { + for(var i=0, l=params.length; i " + content + " }}"); }; -PrintVisitor.prototype.NumberLiteral = function (number) { - return 'NUMBER{' + number.value + '}'; -}; +PrintVisitor.prototype.hash = function(hash) { + var pairs = hash.pairs; + var joinedPairs = [], left, right; -PrintVisitor.prototype.BooleanLiteral = function (bool) { - return 'BOOLEAN{' + bool.value + '}'; -}; - -PrintVisitor.prototype.UndefinedLiteral = function () { - return 'UNDEFINED'; -}; - -PrintVisitor.prototype.NullLiteral = function () { - return 'NULL'; -}; - -PrintVisitor.prototype.Hash = function (hash) { - var pairs = hash.pairs, - joinedPairs = []; - - for (var i = 0, l = pairs.length; i < l; i++) { - joinedPairs.push(this.accept(pairs[i])); + for(var i=0, l=pairs.length; i 1) { + return "PATH:" + path; + } else { + return "ID:" + path; + } +}; + +PrintVisitor.prototype.PARTIAL_NAME = function(partialName) { + return "PARTIAL:" + partialName.name; +}; + +PrintVisitor.prototype.DATA = function(data) { + return "@" + this.accept(data.id); +}; + +PrintVisitor.prototype.content = function(content) { + return this.pad("CONTENT[ '" + content.string + "' ]"); +}; + +PrintVisitor.prototype.comment = function(comment) { + return this.pad("{{! '" + comment.comment + "' }}"); +}; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js index d5a909b..cb28dec 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js +++ b/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js @@ -1,132 +1,12 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; - -var _Exception = require('../exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -var _AST = require('./ast'); - -var _AST2 = _interopRequireWildcard(_AST); - -function Visitor() { - this.parents = []; -} +"use strict"; +function Visitor() {} Visitor.prototype = { constructor: Visitor, - mutating: false, - // Visits a given value. If mutating, will replace the value if necessary. - acceptKey: function acceptKey(node, name) { - var value = this.accept(node[name]); - if (this.mutating) { - // Hacky sanity check: - if (value && (!value.type || !_AST2['default'][value.type])) { - throw new _Exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); - } - node[name] = value; - } - }, - - // Performs an accept operation with added sanity check to ensure - // required keys are not removed. - acceptRequired: function acceptRequired(node, name) { - this.acceptKey(node, name); - - if (!node[name]) { - throw new _Exception2['default'](node.type + ' requires ' + name); - } - }, - - // Traverses a given array. If mutating, empty respnses will be removed - // for child elements. - acceptArray: function acceptArray(array) { - for (var i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - - if (!array[i]) { - array.splice(i, 1); - i--; - l--; - } - } - }, - - accept: function accept(object) { - if (!object) { - return; - } - - if (this.current) { - this.parents.unshift(this.current); - } - this.current = object; - - var ret = this[object.type](object); - - this.current = this.parents.shift(); - - if (!this.mutating || ret) { - return ret; - } else if (ret !== false) { - return object; - } - }, - - Program: function Program(program) { - this.acceptArray(program.body); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.acceptRequired(mustache, 'path'); - this.acceptArray(mustache.params); - this.acceptKey(mustache, 'hash'); - }, - - BlockStatement: function BlockStatement(block) { - this.acceptRequired(block, 'path'); - this.acceptArray(block.params); - this.acceptKey(block, 'hash'); - - this.acceptKey(block, 'program'); - this.acceptKey(block, 'inverse'); - }, - - PartialStatement: function PartialStatement(partial) { - this.acceptRequired(partial, 'name'); - this.acceptArray(partial.params); - this.acceptKey(partial, 'hash'); - }, - - ContentStatement: function ContentStatement() {}, - CommentStatement: function CommentStatement() {}, - - SubExpression: function SubExpression(sexpr) { - this.acceptRequired(sexpr, 'path'); - this.acceptArray(sexpr.params); - this.acceptKey(sexpr, 'hash'); - }, - - PathExpression: function PathExpression() {}, - - StringLiteral: function StringLiteral() {}, - NumberLiteral: function NumberLiteral() {}, - BooleanLiteral: function BooleanLiteral() {}, - UndefinedLiteral: function UndefinedLiteral() {}, - NullLiteral: function NullLiteral() {}, - - Hash: function Hash(hash) { - this.acceptArray(hash.pairs); - }, - HashPair: function HashPair(pair) { - this.acceptRequired(pair, 'value'); + accept: function(object) { + return this[object.type](object); } }; -exports['default'] = Visitor; -module.exports = exports['default']; -/* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */ \ No newline at end of file +exports["default"] = Visitor; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js b/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js deleted file mode 100644 index a8bc936..0000000 --- a/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js +++ /dev/null @@ -1,212 +0,0 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; - -var _Visitor = require('./visitor'); - -var _Visitor2 = _interopRequireWildcard(_Visitor); - -function WhitespaceControl() {} -WhitespaceControl.prototype = new _Visitor2['default'](); - -WhitespaceControl.prototype.Program = function (program) { - var isRoot = !this.isRootSeen; - this.isRootSeen = true; - - var body = program.body; - for (var i = 0, l = body.length; i < l; i++) { - var current = body[i], - strip = this.accept(current); - - if (!strip) { - continue; - } - - var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), - _isNextWhitespace = isNextWhitespace(body, i, isRoot), - openStandalone = strip.openStandalone && _isPrevWhitespace, - closeStandalone = strip.closeStandalone && _isNextWhitespace, - inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; - - if (strip.close) { - omitRight(body, i, true); - } - if (strip.open) { - omitLeft(body, i, true); - } - - if (inlineStandalone) { - omitRight(body, i); - - if (omitLeft(body, i)) { - // If we are on a standalone node, save the indent info for partials - if (current.type === 'PartialStatement') { - // Pull out the whitespace from the final line - current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; - } - } - } - if (openStandalone) { - omitRight((current.program || current.inverse).body); - - // Strip out the previous content node if it's whitespace only - omitLeft(body, i); - } - if (closeStandalone) { - // Always strip the next node - omitRight(body, i); - - omitLeft((current.inverse || current.program).body); - } - } - - return program; -}; -WhitespaceControl.prototype.BlockStatement = function (block) { - this.accept(block.program); - this.accept(block.inverse); - - // Find the inverse program that is involed with whitespace stripping. - var program = block.program || block.inverse, - inverse = block.program && block.inverse, - firstInverse = inverse, - lastInverse = inverse; - - if (inverse && inverse.chained) { - firstInverse = inverse.body[0].program; - - // Walk the inverse chain to find the last inverse that is actually in the chain. - while (lastInverse.chained) { - lastInverse = lastInverse.body[lastInverse.body.length - 1].program; - } - } - - var strip = { - open: block.openStrip.open, - close: block.closeStrip.close, - - // Determine the standalone candiacy. Basically flag our content as being possibly standalone - // so our parent can determine if we actually are standalone - openStandalone: isNextWhitespace(program.body), - closeStandalone: isPrevWhitespace((firstInverse || program).body) - }; - - if (block.openStrip.close) { - omitRight(program.body, null, true); - } - - if (inverse) { - var inverseStrip = block.inverseStrip; - - if (inverseStrip.open) { - omitLeft(program.body, null, true); - } - - if (inverseStrip.close) { - omitRight(firstInverse.body, null, true); - } - if (block.closeStrip.open) { - omitLeft(lastInverse.body, null, true); - } - - // Find standalone else statments - if (isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { - omitLeft(program.body); - omitRight(firstInverse.body); - } - } else if (block.closeStrip.open) { - omitLeft(program.body, null, true); - } - - return strip; -}; - -WhitespaceControl.prototype.MustacheStatement = function (mustache) { - return mustache.strip; -}; - -WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { - /* istanbul ignore next */ - var strip = node.strip || {}; - return { - inlineStandalone: true, - open: strip.open, - close: strip.close - }; -}; - -function isPrevWhitespace(body, i, isRoot) { - if (i === undefined) { - i = body.length; - } - - // Nodes that end with newlines are considered whitespace (but are special - // cased for strip operations) - var prev = body[i - 1], - sibling = body[i - 2]; - if (!prev) { - return isRoot; - } - - if (prev.type === 'ContentStatement') { - return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); - } -} -function isNextWhitespace(body, i, isRoot) { - if (i === undefined) { - i = -1; - } - - var next = body[i + 1], - sibling = body[i + 2]; - if (!next) { - return isRoot; - } - - if (next.type === 'ContentStatement') { - return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); - } -} - -// Marks the node to the right of the position as omitted. -// I.e. {{foo}}' ' will mark the ' ' node as omitted. -// -// If i is undefined, then the first child will be marked as such. -// -// If mulitple is truthy then all whitespace will be stripped out until non-whitespace -// content is met. -function omitRight(body, i, multiple) { - var current = body[i == null ? 0 : i + 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { - return; - } - - var original = current.value; - current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); - current.rightStripped = current.value !== original; -} - -// Marks the node to the left of the position as omitted. -// I.e. ' '{{foo}} will mark the ' ' node as omitted. -// -// If i is undefined then the last child will be marked as such. -// -// If mulitple is truthy then all whitespace will be stripped out until non-whitespace -// content is met. -function omitLeft(body, i, multiple) { - var current = body[i == null ? body.length - 1 : i - 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { - return; - } - - // We omit the last node if it's whitespace only and not preceeded by a non-content node. - var original = current.value; - current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); - current.leftStripped = current.value !== original; - return current.leftStripped; -} - -exports['default'] = WhitespaceControl; -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/exception.js b/node_modules/handlebars/dist/cjs/handlebars/exception.js index 9bf550a..a9ff3b6 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/exception.js +++ b/node_modules/handlebars/dist/cjs/handlebars/exception.js @@ -1,18 +1,13 @@ -'use strict'; - -exports.__esModule = true; +"use strict"; var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; + var line; + if (node && node.firstLine) { + line = node.firstLine; - message += ' - ' + line + ':' + column; + message += ' - ' + line + ':' + node.firstColumn; } var tmp = Error.prototype.constructor.call(this, message); @@ -22,17 +17,12 @@ function Exception(message, node) { this[errorProps[idx]] = tmp[errorProps[idx]]; } - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { + if (line) { this.lineNumber = line; - this.column = column; + this.column = node.firstColumn; } } Exception.prototype = new Error(); -exports['default'] = Exception; -module.exports = exports['default']; \ No newline at end of file +exports["default"] = Exception; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js b/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js deleted file mode 100644 index 149e421..0000000 --- a/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -exports.__esModule = true; -/*global window */ - -exports['default'] = function (Handlebars) { - /* istanbul ignore next */ - var root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function () { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - }; -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/runtime.js b/node_modules/handlebars/dist/cjs/handlebars/runtime.js index 188ac80..84ffc8f 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/runtime.js +++ b/node_modules/handlebars/dist/cjs/handlebars/runtime.js @@ -1,96 +1,76 @@ -'use strict'; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -exports.__esModule = true; -exports.checkRevision = checkRevision; - -// TODO: Remove this line and break up compilePartial - -exports.template = template; -exports.wrapProgram = wrapProgram; -exports.resolvePartial = resolvePartial; -exports.invokePartial = invokePartial; -exports.noop = noop; - -var _import = require('./utils'); - -var Utils = _interopRequireWildcard(_import); - -var _Exception = require('./exception'); - -var _Exception2 = _interopRequireWildcard(_Exception); - -var _COMPILER_REVISION$REVISION_CHANGES$createFrame = require('./base'); +"use strict"; +var Utils = require("./utils"); +var Exception = require("./exception")["default"]; +var COMPILER_REVISION = require("./base").COMPILER_REVISION; +var REVISION_CHANGES = require("./base").REVISION_CHANGES; +var createFrame = require("./base").createFrame; function checkRevision(compilerInfo) { var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION; + currentRevision = COMPILER_REVISION; if (compilerRevision !== currentRevision) { if (compilerRevision < currentRevision) { - var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision], - compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision]; - throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); + var runtimeVersions = REVISION_CHANGES[currentRevision], + compilerVersions = REVISION_CHANGES[compilerRevision]; + throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+ + "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+")."); } else { // Use the embedded version info since the runtime doesn't know about this revision yet - throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); + throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+ + "Please update your runtime to a newer version ("+compilerInfo[1]+")."); } } } +exports.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial + function template(templateSpec, env) { /* istanbul ignore next */ if (!env) { - throw new _Exception2['default']('No environment passed to template'); + throw new Exception("No environment passed to template"); } if (!templateSpec || !templateSpec.main) { - throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec); + throw new Exception('Unknown template object: ' + typeof templateSpec); } // Note: Using env.VM references rather than local var references throughout this section to allow // for external users to override these as psuedo-supported APIs. env.VM.checkRevision(templateSpec.compiler); - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = Utils.extend({}, context, options.hash); + var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) { + if (hash) { + context = Utils.extend({}, context, hash); } - partial = env.VM.resolvePartial.call(this, partial, context, options); - var result = env.VM.invokePartial.call(this, partial, context, options); + var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths); if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); + var options = { helpers: helpers, partials: partials, data: data, depths: depths }; + partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env); + result = partials[name](context, options); } if (result != null) { - if (options.indent) { + if (indent) { var lines = result.split('\n'); for (var i = 0, l = lines.length; i < l; i++) { if (!lines[i] && i + 1 === l) { break; } - lines[i] = options.indent + lines[i]; + lines[i] = indent + lines[i]; } result = lines.join('\n'); } return result; } else { - throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); + throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); } - } + }; // Just add water var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _Exception2['default']('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, - lookup: function lookup(depths, name) { + lookup: function(depths, name) { var len = depths.length; for (var i = 0; i < len; i++) { if (depths[i] && depths[i][name] != null) { @@ -98,69 +78,67 @@ function template(templateSpec, env) { } } }, - lambda: function lambda(current, context) { + lambda: function(current, context) { return typeof current === 'function' ? current.call(context) : current; }, escapeExpression: Utils.escapeExpression, invokePartial: invokePartialWrapper, - fn: function fn(i) { + fn: function(i) { return templateSpec[i]; }, programs: [], - program: function program(i, data, declaredBlockParams, blockParams, depths) { + program: function(i, data, depths) { var programWrapper = this.programs[i], fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); + if (data || depths) { + programWrapper = program(this, i, fn, data, depths); } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); + programWrapper = this.programs[i] = program(this, i, fn); } return programWrapper; }, - data: function data(value, depth) { - while (value && depth--) { - value = value._parent; + data: function(data, depth) { + while (data && depth--) { + data = data._parent; } - return value; + return data; }, - merge: function merge(param, common) { - var obj = param || common; + merge: function(param, common) { + var ret = param || common; - if (param && common && param !== common) { - obj = Utils.extend({}, common, param); + if (param && common && (param !== common)) { + ret = Utils.extend({}, common, param); } - return obj; + return ret; }, noop: env.VM.noop, compilerInfo: templateSpec.compiler }; - function ret(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - + var ret = function(context, options) { + options = options || {}; var data = options.data; ret._setup(options); if (!options.partial && templateSpec.useData) { data = initData(context, data); } - var depths = undefined, - blockParams = templateSpec.useBlockParams ? [] : undefined; + var depths; if (templateSpec.useDepths) { depths = options.depths ? [context].concat(options.depths) : [context]; } - return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); - } + return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths); + }; ret.isTop = true; - ret._setup = function (options) { + ret._setup = function(options) { if (!options.partial) { container.helpers = container.merge(options.helpers, env.helpers); @@ -173,59 +151,42 @@ function template(templateSpec, env) { } }; - ret._child = function (i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new _Exception2['default']('must pass block params'); - } + ret._child = function(i, data, depths) { if (templateSpec.useDepths && !depths) { - throw new _Exception2['default']('must pass parent depths'); + throw new Exception('must pass parent depths'); } - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); + return program(container, i, templateSpec[i], data, depths); }; return ret; } -function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; +exports.template = template;function program(container, i, fn, data, depths) { + var prog = function(context, options) { + options = options || {}; - return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); - } + return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths)); + }; prog.program = i; prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; return prog; } -function resolvePartial(partial, context, options) { - if (!partial) { - partial = options.partials[options.name]; - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; -} +exports.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) { + var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths }; -function invokePartial(partial, context, options) { - options.partial = true; - - if (partial === undefined) { - throw new _Exception2['default']('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { + if(partial === undefined) { + throw new Exception("The partial " + name + " could not be found"); + } else if(partial instanceof Function) { return partial(context, options); } } -function noop() { - return ''; -} +exports.invokePartial = invokePartial;function noop() { return ""; } -function initData(context, data) { +exports.noop = noop;function initData(context, data) { if (!data || !('root' in data)) { - data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {}; + data = data ? createFrame(data) : {}; data.root = context; } return data; diff --git a/node_modules/handlebars/dist/cjs/handlebars/safe-string.js b/node_modules/handlebars/dist/cjs/handlebars/safe-string.js index 62eb2d8..dffadbf 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/safe-string.js +++ b/node_modules/handlebars/dist/cjs/handlebars/safe-string.js @@ -1,14 +1,11 @@ -'use strict'; - -exports.__esModule = true; +"use strict"; // Build out our basic SafeString type function SafeString(string) { this.string = string; } -SafeString.prototype.toString = SafeString.prototype.toHTML = function () { - return '' + this.string; +SafeString.prototype.toString = function() { + return "" + this.string; }; -exports['default'] = SafeString; -module.exports = exports['default']; \ No newline at end of file +exports["default"] = SafeString; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/handlebars/utils.js b/node_modules/handlebars/dist/cjs/handlebars/utils.js index 6ff8f37..0ecce6e 100644 --- a/node_modules/handlebars/dist/cjs/handlebars/utils.js +++ b/node_modules/handlebars/dist/cjs/handlebars/utils.js @@ -1,25 +1,18 @@ -'use strict'; +"use strict"; +/*jshint -W004 */ +var SafeString = require("./safe-string")["default"]; -exports.__esModule = true; -exports.extend = extend; - -// Older IE versions do not directly support indexOf so we must implement our own, sadly. -exports.indexOf = indexOf; -exports.escapeExpression = escapeExpression; -exports.isEmpty = isEmpty; -exports.blockParams = blockParams; -exports.appendContextPath = appendContextPath; var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" }; -var badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; +var badChars = /[&<>"'`]/g; +var possible = /[&<>"'`]/; function escapeChar(chr) { return escape[chr]; @@ -37,64 +30,48 @@ function extend(obj /* , ...source */) { return obj; } -var toString = Object.prototype.toString; - +exports.extend = extend;var toString = Object.prototype.toString; exports.toString = toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt -/*eslint-disable func-style, no-var */ -var isFunction = function isFunction(value) { +var isFunction = function(value) { return typeof value === 'function'; }; // fallback for older versions of Chrome and Safari /* istanbul ignore next */ if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { + isFunction = function(value) { return typeof value === 'function' && toString.call(value) === '[object Function]'; }; } var isFunction; exports.isFunction = isFunction; -/*eslint-enable func-style, no-var */ - /* istanbul ignore next */ -var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; -};exports.isArray = isArray; - -function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - return -1; -} +var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; +}; +exports.isArray = isArray; function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; + // don't escape SafeStrings, since they're already safe + if (string instanceof SafeString) { + return string.toString(); + } else if (string == null) { + return ""; + } else if (!string) { + return string + ''; } - if (!possible.test(string)) { - return string; - } + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = "" + string; + + if(!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); } -function isEmpty(value) { +exports.escapeExpression = escapeExpression;function isEmpty(value) { if (!value && value !== 0) { return true; } else if (isArray(value) && value.length === 0) { @@ -104,11 +81,8 @@ function isEmpty(value) { } } -function blockParams(params, ids) { - params.path = ids; - return params; +exports.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; } -function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; -} \ No newline at end of file +exports.appendContextPath = appendContextPath; \ No newline at end of file diff --git a/node_modules/handlebars/dist/cjs/precompiler.js b/node_modules/handlebars/dist/cjs/precompiler.js index e9f9648..1f733ba 100644 --- a/node_modules/handlebars/dist/cjs/precompiler.js +++ b/node_modules/handlebars/dist/cjs/precompiler.js @@ -1,47 +1,33 @@ -'use strict'; +"use strict"; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; +var fs = require('fs'), + Handlebars = require('./index'), + basename = require('path').basename, + uglify = require('uglify-js'); -/*eslint-disable no-console */ - -var _fs = require('fs'); - -var _fs2 = _interopRequireWildcard(_fs); - -var _import = require('./handlebars'); - -var Handlebars = _interopRequireWildcard(_import); - -var _basename = require('path'); - -var _SourceMapConsumer$SourceNode = require('source-map'); - -var _uglify = require('uglify-js'); - -var _uglify2 = _interopRequireWildcard(_uglify); - -module.exports.cli = function (opts) { +module.exports.cli = function(opts) { if (opts.version) { console.log(Handlebars.VERSION); return; } + var template = [0]; if (!opts.templates.length) { throw new Handlebars.Exception('Must define at least one template or directory.'); } - opts.templates.forEach(function (template) { + opts.templates.forEach(function(template) { try { - _fs2['default'].statSync(template); + fs.statSync(template); } catch (err) { throw new Handlebars.Exception('Unable to open template file "' + template + '"'); } }); if (opts.simple && opts.min) { - throw new Handlebars.Exception('Unable to minimize simple output'); + throw new Handlebars.Exception('Unable to minimze simple output'); } - if (opts.simple && (opts.templates.length !== 1 || _fs2['default'].statSync(opts.templates[0]).isDirectory())) { + if (opts.simple && (opts.templates.length !== 1 || fs.statSync(opts.templates[0]).isDirectory())) { throw new Handlebars.Exception('Unable to output multiple templates in simple mode'); } @@ -57,44 +43,39 @@ module.exports.cli = function (opts) { } // Build file extension pattern - var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function (arg) { - return '\\' + arg; - }); + var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function(arg) { return '\\' + arg; }); extension = new RegExp('\\.' + extension + '$'); - var output = new _SourceMapConsumer$SourceNode.SourceNode(); + var output = []; if (!opts.simple) { if (opts.amd) { - output.add('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n Handlebars = Handlebars["default"];'); + output.push('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n Handlebars = Handlebars["default"];'); } else if (opts.commonjs) { - output.add('var Handlebars = require("' + opts.commonjs + '");'); + output.push('var Handlebars = require("' + opts.commonjs + '");'); } else { - output.add('(function() {\n'); + output.push('(function() {\n'); } - output.add(' var template = Handlebars.template, templates = '); - if (opts.namespace) { - output.add(opts.namespace); - output.add(' = '); - output.add(opts.namespace); - output.add(' || '); - } - output.add('{};\n'); + output.push(' var template = Handlebars.template, templates = '); + output.push(opts.namespace); + output.push(' = '); + output.push(opts.namespace); + output.push(' || {};\n'); } function processTemplate(template, root) { var path = template, - stat = _fs2['default'].statSync(path); + stat = fs.statSync(path); if (stat.isDirectory()) { - _fs2['default'].readdirSync(template).map(function (file) { - var childPath = template + '/' + file; + fs.readdirSync(template).map(function(file) { + var path = template + '/' + file; - if (extension.test(childPath) || _fs2['default'].statSync(childPath).isDirectory()) { - processTemplate(childPath, root || template); + if (extension.test(path) || fs.statSync(path).isDirectory()) { + processTemplate(path, root || template); } }); } else { - var data = _fs2['default'].readFileSync(path, 'utf8'); + var data = fs.readFileSync(path, 'utf8'); - if (opts.bom && data.indexOf('') === 0) { + if (opts.bom && data.indexOf('\uFEFF') === 0) { data = data.substring(1); } @@ -103,91 +84,61 @@ module.exports.cli = function (opts) { knownHelpersOnly: opts.o }; - if (opts.map) { - options.srcName = path; - } if (opts.data) { options.data = true; } // Clean the template name if (!root) { - template = _basename.basename(template); + template = basename(template); } else if (template.indexOf(root) === 0) { - template = template.substring(root.length + 1); + template = template.substring(root.length+1); } template = template.replace(extension, ''); - var precompiled = Handlebars.precompile(data, options); - - // If we are generating a source map, we have to reconstruct the SourceNode object - if (opts.map) { - var consumer = new _SourceMapConsumer$SourceNode.SourceMapConsumer(precompiled.map); - precompiled = _SourceMapConsumer$SourceNode.SourceNode.fromStringWithSourceMap(precompiled.code, consumer); - } - if (opts.simple) { - output.add([precompiled, '\n']); + output.push(Handlebars.precompile(data, options) + '\n'); } else if (opts.partial) { - if (opts.amd && (opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory())) { - output.add('return '); + if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { + output.push('return '); } - output.add(['Handlebars.partials[\'', template, '\'] = template(', precompiled, ');\n']); + output.push('Handlebars.partials[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n'); } else { - if (opts.amd && (opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory())) { - output.add('return '); + if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { + output.push('return '); } - output.add(['templates[\'', template, '\'] = template(', precompiled, ');\n']); + output.push('templates[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n'); } } } - opts.templates.forEach(function (template) { + opts.templates.forEach(function(template) { processTemplate(template, opts.root); }); // Output the content if (!opts.simple) { if (opts.amd) { - if (opts.templates.length > 1 || opts.templates.length == 1 && _fs2['default'].statSync(opts.templates[0]).isDirectory()) { - if (opts.partial) { - output.add('return Handlebars.partials;\n'); + if(opts.templates.length > 1 || (opts.templates.length == 1 && fs.statSync(opts.templates[0]).isDirectory())) { + if(opts.partial){ + output.push('return Handlebars.partials;\n'); } else { - output.add('return templates;\n'); + output.push('return templates;\n'); } } - output.add('});'); + output.push('});'); } else if (!opts.commonjs) { - output.add('})();'); + output.push('})();'); } } - - if (opts.map) { - output.add('\n//# sourceMappingURL=' + opts.map + '\n'); - } - - output = output.toStringWithSourceMap(); - output.map = output.map + ''; + output = output.join(''); if (opts.min) { - output = _uglify2['default'].minify(output.code, { - fromString: true, - - outSourceMap: opts.map, - inSourceMap: JSON.parse(output.map) - }); - if (opts.map) { - output.code += '\n//# sourceMappingURL=' + opts.map + '\n'; - } + output = uglify.minify(output, {fromString: true}).code; } - if (opts.map) { - _fs2['default'].writeFileSync(opts.map, output.map, 'utf8'); - } - output = output.code; - if (opts.output) { - _fs2['default'].writeFileSync(opts.output, output, 'utf8'); + fs.writeFileSync(opts.output, output, 'utf8'); } else { console.log(output); } diff --git a/node_modules/handlebars/dist/handlebars.amd.js b/node_modules/handlebars/dist/handlebars.amd.js index 07640c5..dddd408 100644 --- a/node_modules/handlebars/dist/handlebars.amd.js +++ b/node_modules/handlebars/dist/handlebars.amd.js @@ -1,6 +1,6 @@ /*! - handlebars v3.0.3 + handlebars v2.0.0 Copyright (C) 2011-2014 by Yehuda Katz @@ -24,87 +24,85 @@ THE SOFTWARE. @license */ -define('handlebars/utils',['exports'], function (exports) { - - exports.__esModule = true; - exports.extend = extend; +define( + 'handlebars/safe-string',["exports"], + function(__exports__) { + + // Build out our basic SafeString type + function SafeString(string) { + this.string = string; + } - // Older IE versions do not directly support indexOf so we must implement our own, sadly. - exports.indexOf = indexOf; - exports.escapeExpression = escapeExpression; - exports.isEmpty = isEmpty; - exports.blockParams = blockParams; - exports.appendContextPath = appendContextPath; - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' - }; + SafeString.prototype.toString = function() { + return "" + this.string; + }; - var badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; + __exports__["default"] = SafeString; + }); +define( + 'handlebars/utils',["./safe-string","exports"], + function(__dependency1__, __exports__) { + + /*jshint -W004 */ + var SafeString = __dependency1__["default"]; - function escapeChar(chr) { - return escape[chr]; - } + var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + function escapeChar(chr) { + return escape[chr]; + } + + function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } } } + + return obj; } - return obj; - } - - var toString = Object.prototype.toString; - - exports.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - /*eslint-disable func-style, no-var */ - var isFunction = function isFunction(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; + __exports__.extend = extend;var toString = Object.prototype.toString; + __exports__.toString = toString; + // Sourced from lodash + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt + var isFunction = function(value) { + return typeof value === 'function'; }; - } - var isFunction; - exports.isFunction = isFunction; - /*eslint-enable func-style, no-var */ - - /* istanbul ignore next */ - var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; - };exports.isArray = isArray; - - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } + // fallback for older versions of Chrome and Safari + /* istanbul ignore next */ + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; } - return -1; - } + var isFunction; + __exports__.isFunction = isFunction; + /* istanbul ignore next */ + var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; + }; + __exports__.isArray = isArray; - function escapeExpression(string) { - if (typeof string !== 'string') { + function escapeExpression(string) { // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); + if (string instanceof SafeString) { + return string.toString(); } else if (string == null) { - return ''; + return ""; } else if (!string) { return string + ''; } @@ -112,3751 +110,2933 @@ define('handlebars/utils',['exports'], function (exports) { // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. - string = '' + string; + string = "" + string; + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); } - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - function blockParams(params, ids) { - params.path = ids; - return params; - } - - function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } -}); -define('handlebars/exception',['exports', 'module'], function (exports, module) { - - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; - - message += ' - ' + line + ':' + column; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { - this.lineNumber = line; - this.column = column; - } - } - - Exception.prototype = new Error(); - - module.exports = Exception; -}); -define('handlebars/base',['exports', './utils', './exception'], function (exports, _utils, _exception) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.HandlebarsEnvironment = HandlebarsEnvironment; - exports.createFrame = createFrame; - - var _Exception = _interopRequire(_exception); - - var VERSION = '3.0.1'; - exports.VERSION = VERSION; - var COMPILER_REVISION = 6; - - exports.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1' - }; - - exports.REVISION_CHANGES = REVISION_CHANGES; - var isArray = _utils.isArray, - isFunction = _utils.isFunction, - toString = _utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function registerHelper(name, fn) { - if (toString.call(name) === objectType) { - if (fn) { - throw new _Exception('Arg not supported with multiple helpers'); - } - _utils.extend(this.helpers, name); + __exports__.escapeExpression = escapeExpression;function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; } else { - this.helpers[name] = fn; - } - }, - unregisterHelper: function unregisterHelper(name) { - delete this.helpers[name]; - }, - - registerPartial: function registerPartial(name, partial) { - if (toString.call(name) === objectType) { - _utils.extend(this.partials, name); - } else { - if (typeof partial === 'undefined') { - throw new _Exception('Attempting to register a partial as undefined'); - } - this.partials[name] = partial; - } - }, - unregisterPartial: function unregisterPartial(name) { - delete this.partials[name]; - } - }; - - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function () { - if (arguments.length === 1) { - // A missing field in a {{foo}} constuct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new _Exception('Missing helper: "' + arguments[arguments.length - 1].name + '"'); - } - }); - - instance.registerHelper('blockHelperMissing', function (context, options) { - var inverse = options.inverse, - fn = options.fn; - - if (context === true) { - return fn(this); - } else if (context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if (context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } - - return instance.helpers.each(context, options); - } else { - return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; - } - - return fn(context, options); - } - }); - - instance.registerHelper('each', function (context, options) { - if (!options) { - throw new _Exception('Must pass iterator to #each'); - } - - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; - - if (options.data && options.ids) { - contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (isFunction(context)) { - context = context.call(this); - } - - if (options.data) { - data = createFrame(options.data); - } - - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { - if (isArray(context)) { - for (var j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); - } - } else { - var priorKey = undefined; - - for (var key in context) { - if (context.hasOwnProperty(key)) { - // We're running the iterations one step out of sync so we can detect - // the last iteration without have to scan the object twice and create - // an itermediate keys array. - if (priorKey) { - execIteration(priorKey, i - 1); - } - priorKey = key; - i++; - } - } - if (priorKey) { - execIteration(priorKey, i - 1, true); - } - } - } - - if (i === 0) { - ret = inverse(this); - } - - return ret; - }); - - instance.registerHelper('if', function (conditional, options) { - if (isFunction(conditional)) { - conditional = conditional.call(this); - } - - // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the - // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. - if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); - - instance.registerHelper('unless', function (conditional, options) { - return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); - }); - - instance.registerHelper('with', function (context, options) { - if (isFunction(context)) { - context = context.call(this); - } - - var fn = options.fn; - - if (!_utils.isEmpty(context)) { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); - options = { data: data }; - } - - return fn(context, options); - } else { - return options.inverse(this); - } - }); - - instance.registerHelper('log', function (message, options) { - var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1; - instance.log(level, message); - }); - - instance.registerHelper('lookup', function (obj, field) { - return obj && obj[field]; - }); - } - - var logger = { - methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' }, - - // State enum - DEBUG: 0, - INFO: 1, - WARN: 2, - ERROR: 3, - level: 1, - - // Can be overridden in the host environment - log: function log(level, message) { - if (typeof console !== 'undefined' && logger.level <= level) { - var method = logger.methodMap[level]; - (console[method] || console.log).call(console, message); // eslint-disable-line no-console - } - } - }; - - exports.logger = logger; - var log = logger.log; - - exports.log = log; - - function createFrame(object) { - var frame = _utils.extend({}, object); - frame._parent = object; - return frame; - } -}); -/* [args, ]options */; -define('handlebars/safe-string',['exports', 'module'], function (exports, module) { - // Build out our basic SafeString type - - - function SafeString(string) { - this.string = string; - } - - SafeString.prototype.toString = SafeString.prototype.toHTML = function () { - return '' + this.string; - }; - - module.exports = SafeString; -}); -define('handlebars/runtime',['exports', './utils', './exception', './base'], function (exports, _utils, _exception, _base) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.checkRevision = checkRevision; - - // TODO: Remove this line and break up compilePartial - - exports.template = template; - exports.wrapProgram = wrapProgram; - exports.resolvePartial = resolvePartial; - exports.invokePartial = invokePartial; - exports.noop = noop; - - var _Exception = _interopRequire(_exception); - - function checkRevision(compilerInfo) { - var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = _base.COMPILER_REVISION; - - if (compilerRevision !== currentRevision) { - if (compilerRevision < currentRevision) { - var runtimeVersions = _base.REVISION_CHANGES[currentRevision], - compilerVersions = _base.REVISION_CHANGES[compilerRevision]; - throw new _Exception('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); - } else { - // Use the embedded version info since the runtime doesn't know about this revision yet - throw new _Exception('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); - } - } - } - - function template(templateSpec, env) { - /* istanbul ignore next */ - if (!env) { - throw new _Exception('No environment passed to template'); - } - if (!templateSpec || !templateSpec.main) { - throw new _Exception('Unknown template object: ' + typeof templateSpec); - } - - // Note: Using env.VM references rather than local var references throughout this section to allow - // for external users to override these as psuedo-supported APIs. - env.VM.checkRevision(templateSpec.compiler); - - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = _utils.extend({}, context, options.hash); - } - - partial = env.VM.resolvePartial.call(this, partial, context, options); - var result = env.VM.invokePartial.call(this, partial, context, options); - - if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); - } - if (result != null) { - if (options.indent) { - var lines = result.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - if (!lines[i] && i + 1 === l) { - break; - } - - lines[i] = options.indent + lines[i]; - } - result = lines.join('\n'); - } - return result; - } else { - throw new _Exception('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); - } - } - - // Just add water - var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _Exception('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, - lookup: function lookup(depths, name) { - var len = depths.length; - for (var i = 0; i < len; i++) { - if (depths[i] && depths[i][name] != null) { - return depths[i][name]; - } - } - }, - lambda: function lambda(current, context) { - return typeof current === 'function' ? current.call(context) : current; - }, - - escapeExpression: _utils.escapeExpression, - invokePartial: invokePartialWrapper, - - fn: function fn(i) { - return templateSpec[i]; - }, - - programs: [], - program: function program(i, data, declaredBlockParams, blockParams, depths) { - var programWrapper = this.programs[i], - fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); - } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); - } - return programWrapper; - }, - - data: function data(value, depth) { - while (value && depth--) { - value = value._parent; - } - return value; - }, - merge: function merge(param, common) { - var obj = param || common; - - if (param && common && param !== common) { - obj = _utils.extend({}, common, param); - } - - return obj; - }, - - noop: env.VM.noop, - compilerInfo: templateSpec.compiler - }; - - function ret(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - var data = options.data; - - ret._setup(options); - if (!options.partial && templateSpec.useData) { - data = initData(context, data); - } - var depths = undefined, - blockParams = templateSpec.useBlockParams ? [] : undefined; - if (templateSpec.useDepths) { - depths = options.depths ? [context].concat(options.depths) : [context]; - } - - return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); - } - ret.isTop = true; - - ret._setup = function (options) { - if (!options.partial) { - container.helpers = container.merge(options.helpers, env.helpers); - - if (templateSpec.usePartial) { - container.partials = container.merge(options.partials, env.partials); - } - } else { - container.helpers = options.helpers; - container.partials = options.partials; - } - }; - - ret._child = function (i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new _Exception('must pass block params'); - } - if (templateSpec.useDepths && !depths) { - throw new _Exception('must pass parent depths'); - } - - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); - }; - return ret; - } - - function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); - } - prog.program = i; - prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; - return prog; - } - - function resolvePartial(partial, context, options) { - if (!partial) { - partial = options.partials[options.name]; - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; - } - - function invokePartial(partial, context, options) { - options.partial = true; - - if (partial === undefined) { - throw new _Exception('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { - return partial(context, options); - } - } - - function noop() { - return ''; - } - - function initData(context, data) { - if (!data || !('root' in data)) { - data = data ? _base.createFrame(data) : {}; - data.root = context; - } - return data; - } -}); -define('handlebars/no-conflict',['exports', 'module'], function (exports, module) { - /*global window */ - - - module.exports = function (Handlebars) { - /* istanbul ignore next */ - var root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function () { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - }; - }; -}); -define('handlebars.runtime',['exports', 'module', './handlebars/base', './handlebars/safe-string', './handlebars/exception', './handlebars/utils', './handlebars/runtime', './handlebars/no-conflict'], function (exports, module, _handlebarsBase, _handlebarsSafeString, _handlebarsException, _handlebarsUtils, _handlebarsRuntime, _handlebarsNoConflict) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - // Each of these augment the Handlebars object. No need to setup here. - // (This is done to easily share code between commonjs and browse envs) - - var _SafeString = _interopRequire(_handlebarsSafeString); - - var _Exception = _interopRequire(_handlebarsException); - - var _noConflict = _interopRequire(_handlebarsNoConflict); - - // For compatibility and usage outside of module systems, make the Handlebars object a namespace - function create() { - var hb = new _handlebarsBase.HandlebarsEnvironment(); - - _handlebarsUtils.extend(hb, _handlebarsBase); - hb.SafeString = _SafeString; - hb.Exception = _Exception; - hb.Utils = _handlebarsUtils; - hb.escapeExpression = _handlebarsUtils.escapeExpression; - - hb.VM = _handlebarsRuntime; - hb.template = function (spec) { - return _handlebarsRuntime.template(spec, hb); - }; - - return hb; - } - - var inst = create(); - inst.create = create; - - _noConflict(inst); - - inst['default'] = inst; - - module.exports = inst; -}); -define('handlebars/compiler/ast',['exports', 'module'], function (exports, module) { - - - var AST = { - Program: function Program(statements, blockParams, strip, locInfo) { - this.loc = locInfo; - this.type = 'Program'; - this.body = statements; - - this.blockParams = blockParams; - this.strip = strip; - }, - - MustacheStatement: function MustacheStatement(path, params, hash, escaped, strip, locInfo) { - this.loc = locInfo; - this.type = 'MustacheStatement'; - - this.path = path; - this.params = params || []; - this.hash = hash; - this.escaped = escaped; - - this.strip = strip; - }, - - BlockStatement: function BlockStatement(path, params, hash, program, inverse, openStrip, inverseStrip, closeStrip, locInfo) { - this.loc = locInfo; - this.type = 'BlockStatement'; - - this.path = path; - this.params = params || []; - this.hash = hash; - this.program = program; - this.inverse = inverse; - - this.openStrip = openStrip; - this.inverseStrip = inverseStrip; - this.closeStrip = closeStrip; - }, - - PartialStatement: function PartialStatement(name, params, hash, strip, locInfo) { - this.loc = locInfo; - this.type = 'PartialStatement'; - - this.name = name; - this.params = params || []; - this.hash = hash; - - this.indent = ''; - this.strip = strip; - }, - - ContentStatement: function ContentStatement(string, locInfo) { - this.loc = locInfo; - this.type = 'ContentStatement'; - this.original = this.value = string; - }, - - CommentStatement: function CommentStatement(comment, strip, locInfo) { - this.loc = locInfo; - this.type = 'CommentStatement'; - this.value = comment; - - this.strip = strip; - }, - - SubExpression: function SubExpression(path, params, hash, locInfo) { - this.loc = locInfo; - - this.type = 'SubExpression'; - this.path = path; - this.params = params || []; - this.hash = hash; - }, - - PathExpression: function PathExpression(data, depth, parts, original, locInfo) { - this.loc = locInfo; - this.type = 'PathExpression'; - - this.data = data; - this.original = original; - this.parts = parts; - this.depth = depth; - }, - - StringLiteral: function StringLiteral(string, locInfo) { - this.loc = locInfo; - this.type = 'StringLiteral'; - this.original = this.value = string; - }, - - NumberLiteral: function NumberLiteral(number, locInfo) { - this.loc = locInfo; - this.type = 'NumberLiteral'; - this.original = this.value = Number(number); - }, - - BooleanLiteral: function BooleanLiteral(bool, locInfo) { - this.loc = locInfo; - this.type = 'BooleanLiteral'; - this.original = this.value = bool === 'true'; - }, - - UndefinedLiteral: function UndefinedLiteral(locInfo) { - this.loc = locInfo; - this.type = 'UndefinedLiteral'; - this.original = this.value = undefined; - }, - - NullLiteral: function NullLiteral(locInfo) { - this.loc = locInfo; - this.type = 'NullLiteral'; - this.original = this.value = null; - }, - - Hash: function Hash(pairs, locInfo) { - this.loc = locInfo; - this.type = 'Hash'; - this.pairs = pairs; - }, - HashPair: function HashPair(key, value, locInfo) { - this.loc = locInfo; - this.type = 'HashPair'; - this.key = key; - this.value = value; - }, - - // Public API used to evaluate derived attributes regarding AST nodes - helpers: { - // a mustache is definitely a helper if: - // * it is an eligible helper, and - // * it has at least one parameter or hash segment - helperExpression: function helperExpression(node) { - return !!(node.type === 'SubExpression' || node.params.length || node.hash); - }, - - scopedId: function scopedId(path) { - return /^\.|this\b/.test(path.original); - }, - - // an ID is simple if it only has one part, and that part is not - // `..` or `this`. - simpleId: function simpleId(path) { - return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; - } - } - }; - - // Must be exported as an object rather than the root of the module as the jison lexer - // must modify the object to operate properly. - module.exports = AST; -}); -define('handlebars/compiler/parser',["exports", "module"], function (exports, module) { - /* istanbul ignore next */ - /* Jison generated parser */ - - - var handlebars = (function () { - var parser = { trace: function trace() {}, - yy: {}, - symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, content: 12, COMMENT: 13, CONTENT: 14, openRawBlock: 15, END_RAW_BLOCK: 16, OPEN_RAW_BLOCK: 17, helperName: 18, openRawBlock_repetition0: 19, openRawBlock_option0: 20, CLOSE_RAW_BLOCK: 21, openBlock: 22, block_option0: 23, closeBlock: 24, openInverse: 25, block_option1: 26, OPEN_BLOCK: 27, openBlock_repetition0: 28, openBlock_option0: 29, openBlock_option1: 30, CLOSE: 31, OPEN_INVERSE: 32, openInverse_repetition0: 33, openInverse_option0: 34, openInverse_option1: 35, openInverseChain: 36, OPEN_INVERSE_CHAIN: 37, openInverseChain_repetition0: 38, openInverseChain_option0: 39, openInverseChain_option1: 40, inverseAndProgram: 41, INVERSE: 42, inverseChain: 43, inverseChain_option0: 44, OPEN_ENDBLOCK: 45, OPEN: 46, mustache_repetition0: 47, mustache_option0: 48, OPEN_UNESCAPED: 49, mustache_repetition1: 50, mustache_option1: 51, CLOSE_UNESCAPED: 52, OPEN_PARTIAL: 53, partialName: 54, partial_repetition0: 55, partial_option0: 56, param: 57, sexpr: 58, OPEN_SEXPR: 59, sexpr_repetition0: 60, sexpr_option0: 61, CLOSE_SEXPR: 62, hash: 63, hash_repetition_plus0: 64, hashSegment: 65, ID: 66, EQUALS: 67, blockParams: 68, OPEN_BLOCK_PARAMS: 69, blockParams_repetition_plus0: 70, CLOSE_BLOCK_PARAMS: 71, path: 72, dataName: 73, STRING: 74, NUMBER: 75, BOOLEAN: 76, UNDEFINED: 77, NULL: 78, DATA: 79, pathSegments: 80, SEP: 81, $accept: 0, $end: 1 }, - terminals_: { 2: "error", 5: "EOF", 13: "COMMENT", 14: "CONTENT", 16: "END_RAW_BLOCK", 17: "OPEN_RAW_BLOCK", 21: "CLOSE_RAW_BLOCK", 27: "OPEN_BLOCK", 31: "CLOSE", 32: "OPEN_INVERSE", 37: "OPEN_INVERSE_CHAIN", 42: "INVERSE", 45: "OPEN_ENDBLOCK", 46: "OPEN", 49: "OPEN_UNESCAPED", 52: "CLOSE_UNESCAPED", 53: "OPEN_PARTIAL", 59: "OPEN_SEXPR", 62: "CLOSE_SEXPR", 66: "ID", 67: "EQUALS", 69: "OPEN_BLOCK_PARAMS", 71: "CLOSE_BLOCK_PARAMS", 74: "STRING", 75: "NUMBER", 76: "BOOLEAN", 77: "UNDEFINED", 78: "NULL", 79: "DATA", 81: "SEP" }, - productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [12, 1], [10, 3], [15, 5], [9, 4], [9, 4], [22, 6], [25, 6], [36, 6], [41, 2], [43, 3], [43, 1], [24, 3], [8, 5], [8, 5], [11, 5], [57, 1], [57, 1], [58, 5], [63, 1], [65, 3], [68, 3], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [54, 1], [54, 1], [73, 2], [72, 1], [80, 3], [80, 1], [6, 0], [6, 2], [19, 0], [19, 2], [20, 0], [20, 1], [23, 0], [23, 1], [26, 0], [26, 1], [28, 0], [28, 2], [29, 0], [29, 1], [30, 0], [30, 1], [33, 0], [33, 2], [34, 0], [34, 1], [35, 0], [35, 1], [38, 0], [38, 2], [39, 0], [39, 1], [40, 0], [40, 1], [44, 0], [44, 1], [47, 0], [47, 2], [48, 0], [48, 1], [50, 0], [50, 2], [51, 0], [51, 1], [55, 0], [55, 2], [56, 0], [56, 1], [60, 0], [60, 2], [61, 0], [61, 1], [64, 1], [64, 2], [70, 1], [70, 2]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - break; - case 2: - this.$ = new yy.Program($$[$0], null, {}, yy.locInfo(this._$)); - break; - case 3: - this.$ = $$[$0]; - break; - case 4: - this.$ = $$[$0]; - break; - case 5: - this.$ = $$[$0]; - break; - case 6: - this.$ = $$[$0]; - break; - case 7: - this.$ = $$[$0]; - break; - case 8: - this.$ = new yy.CommentStatement(yy.stripComment($$[$0]), yy.stripFlags($$[$0], $$[$0]), yy.locInfo(this._$)); - break; - case 9: - this.$ = new yy.ContentStatement($$[$0], yy.locInfo(this._$)); - break; - case 10: - this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); - break; - case 11: - this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; - break; - case 12: - this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); - break; - case 13: - this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); - break; - case 14: - this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; - break; - case 15: - this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; - break; - case 16: - this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; - break; - case 17: - this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; - break; - case 18: - var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), - program = new yy.Program([inverse], null, {}, yy.locInfo(this._$)); - program.chained = true; - - this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; - - break; - case 19: - this.$ = $$[$0]; - break; - case 20: - this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; - break; - case 21: - this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); - break; - case 22: - this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); - break; - case 23: - this.$ = new yy.PartialStatement($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], yy.stripFlags($$[$0 - 4], $$[$0]), yy.locInfo(this._$)); - break; - case 24: - this.$ = $$[$0]; - break; - case 25: - this.$ = $$[$0]; - break; - case 26: - this.$ = new yy.SubExpression($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], yy.locInfo(this._$)); - break; - case 27: - this.$ = new yy.Hash($$[$0], yy.locInfo(this._$)); - break; - case 28: - this.$ = new yy.HashPair(yy.id($$[$0 - 2]), $$[$0], yy.locInfo(this._$)); - break; - case 29: - this.$ = yy.id($$[$0 - 1]); - break; - case 30: - this.$ = $$[$0]; - break; - case 31: - this.$ = $$[$0]; - break; - case 32: - this.$ = new yy.StringLiteral($$[$0], yy.locInfo(this._$)); - break; - case 33: - this.$ = new yy.NumberLiteral($$[$0], yy.locInfo(this._$)); - break; - case 34: - this.$ = new yy.BooleanLiteral($$[$0], yy.locInfo(this._$)); - break; - case 35: - this.$ = new yy.UndefinedLiteral(yy.locInfo(this._$)); - break; - case 36: - this.$ = new yy.NullLiteral(yy.locInfo(this._$)); - break; - case 37: - this.$ = $$[$0]; - break; - case 38: - this.$ = $$[$0]; - break; - case 39: - this.$ = yy.preparePath(true, $$[$0], this._$); - break; - case 40: - this.$ = yy.preparePath(false, $$[$0], this._$); - break; - case 41: - $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2]; - break; - case 42: - this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; - break; - case 43: - this.$ = []; - break; - case 44: - $$[$0 - 1].push($$[$0]); - break; - case 45: - this.$ = []; - break; - case 46: - $$[$0 - 1].push($$[$0]); - break; - case 53: - this.$ = []; - break; - case 54: - $$[$0 - 1].push($$[$0]); - break; - case 59: - this.$ = []; - break; - case 60: - $$[$0 - 1].push($$[$0]); - break; - case 65: - this.$ = []; - break; - case 66: - $$[$0 - 1].push($$[$0]); - break; - case 73: - this.$ = []; - break; - case 74: - $$[$0 - 1].push($$[$0]); - break; - case 77: - this.$ = []; - break; - case 78: - $$[$0 - 1].push($$[$0]); - break; - case 81: - this.$ = []; - break; - case 82: - $$[$0 - 1].push($$[$0]); - break; - case 85: - this.$ = []; - break; - case 86: - $$[$0 - 1].push($$[$0]); - break; - case 89: - this.$ = [$$[$0]]; - break; - case 90: - $$[$0 - 1].push($$[$0]); - break; - case 91: - this.$ = [$$[$0]]; - break; - case 92: - $$[$0 - 1].push($$[$0]); - break; - } - }, - table: [{ 3: 1, 4: 2, 5: [2, 43], 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: [1, 11], 14: [1, 18], 15: 16, 17: [1, 21], 22: 14, 25: 15, 27: [1, 19], 32: [1, 20], 37: [2, 2], 42: [2, 2], 45: [2, 2], 46: [1, 12], 49: [1, 13], 53: [1, 17] }, { 1: [2, 1] }, { 5: [2, 44], 13: [2, 44], 14: [2, 44], 17: [2, 44], 27: [2, 44], 32: [2, 44], 37: [2, 44], 42: [2, 44], 45: [2, 44], 46: [2, 44], 49: [2, 44], 53: [2, 44] }, { 5: [2, 3], 13: [2, 3], 14: [2, 3], 17: [2, 3], 27: [2, 3], 32: [2, 3], 37: [2, 3], 42: [2, 3], 45: [2, 3], 46: [2, 3], 49: [2, 3], 53: [2, 3] }, { 5: [2, 4], 13: [2, 4], 14: [2, 4], 17: [2, 4], 27: [2, 4], 32: [2, 4], 37: [2, 4], 42: [2, 4], 45: [2, 4], 46: [2, 4], 49: [2, 4], 53: [2, 4] }, { 5: [2, 5], 13: [2, 5], 14: [2, 5], 17: [2, 5], 27: [2, 5], 32: [2, 5], 37: [2, 5], 42: [2, 5], 45: [2, 5], 46: [2, 5], 49: [2, 5], 53: [2, 5] }, { 5: [2, 6], 13: [2, 6], 14: [2, 6], 17: [2, 6], 27: [2, 6], 32: [2, 6], 37: [2, 6], 42: [2, 6], 45: [2, 6], 46: [2, 6], 49: [2, 6], 53: [2, 6] }, { 5: [2, 7], 13: [2, 7], 14: [2, 7], 17: [2, 7], 27: [2, 7], 32: [2, 7], 37: [2, 7], 42: [2, 7], 45: [2, 7], 46: [2, 7], 49: [2, 7], 53: [2, 7] }, { 5: [2, 8], 13: [2, 8], 14: [2, 8], 17: [2, 8], 27: [2, 8], 32: [2, 8], 37: [2, 8], 42: [2, 8], 45: [2, 8], 46: [2, 8], 49: [2, 8], 53: [2, 8] }, { 18: 22, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 33, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 4: 34, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 37: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 4: 35, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 12: 36, 14: [1, 18] }, { 18: 38, 54: 37, 58: 39, 59: [1, 40], 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 9], 13: [2, 9], 14: [2, 9], 16: [2, 9], 17: [2, 9], 27: [2, 9], 32: [2, 9], 37: [2, 9], 42: [2, 9], 45: [2, 9], 46: [2, 9], 49: [2, 9], 53: [2, 9] }, { 18: 41, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 42, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 43, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 31: [2, 73], 47: 44, 59: [2, 73], 66: [2, 73], 74: [2, 73], 75: [2, 73], 76: [2, 73], 77: [2, 73], 78: [2, 73], 79: [2, 73] }, { 21: [2, 30], 31: [2, 30], 52: [2, 30], 59: [2, 30], 62: [2, 30], 66: [2, 30], 69: [2, 30], 74: [2, 30], 75: [2, 30], 76: [2, 30], 77: [2, 30], 78: [2, 30], 79: [2, 30] }, { 21: [2, 31], 31: [2, 31], 52: [2, 31], 59: [2, 31], 62: [2, 31], 66: [2, 31], 69: [2, 31], 74: [2, 31], 75: [2, 31], 76: [2, 31], 77: [2, 31], 78: [2, 31], 79: [2, 31] }, { 21: [2, 32], 31: [2, 32], 52: [2, 32], 59: [2, 32], 62: [2, 32], 66: [2, 32], 69: [2, 32], 74: [2, 32], 75: [2, 32], 76: [2, 32], 77: [2, 32], 78: [2, 32], 79: [2, 32] }, { 21: [2, 33], 31: [2, 33], 52: [2, 33], 59: [2, 33], 62: [2, 33], 66: [2, 33], 69: [2, 33], 74: [2, 33], 75: [2, 33], 76: [2, 33], 77: [2, 33], 78: [2, 33], 79: [2, 33] }, { 21: [2, 34], 31: [2, 34], 52: [2, 34], 59: [2, 34], 62: [2, 34], 66: [2, 34], 69: [2, 34], 74: [2, 34], 75: [2, 34], 76: [2, 34], 77: [2, 34], 78: [2, 34], 79: [2, 34] }, { 21: [2, 35], 31: [2, 35], 52: [2, 35], 59: [2, 35], 62: [2, 35], 66: [2, 35], 69: [2, 35], 74: [2, 35], 75: [2, 35], 76: [2, 35], 77: [2, 35], 78: [2, 35], 79: [2, 35] }, { 21: [2, 36], 31: [2, 36], 52: [2, 36], 59: [2, 36], 62: [2, 36], 66: [2, 36], 69: [2, 36], 74: [2, 36], 75: [2, 36], 76: [2, 36], 77: [2, 36], 78: [2, 36], 79: [2, 36] }, { 21: [2, 40], 31: [2, 40], 52: [2, 40], 59: [2, 40], 62: [2, 40], 66: [2, 40], 69: [2, 40], 74: [2, 40], 75: [2, 40], 76: [2, 40], 77: [2, 40], 78: [2, 40], 79: [2, 40], 81: [1, 45] }, { 66: [1, 32], 80: 46 }, { 21: [2, 42], 31: [2, 42], 52: [2, 42], 59: [2, 42], 62: [2, 42], 66: [2, 42], 69: [2, 42], 74: [2, 42], 75: [2, 42], 76: [2, 42], 77: [2, 42], 78: [2, 42], 79: [2, 42], 81: [2, 42] }, { 50: 47, 52: [2, 77], 59: [2, 77], 66: [2, 77], 74: [2, 77], 75: [2, 77], 76: [2, 77], 77: [2, 77], 78: [2, 77], 79: [2, 77] }, { 23: 48, 36: 50, 37: [1, 52], 41: 51, 42: [1, 53], 43: 49, 45: [2, 49] }, { 26: 54, 41: 55, 42: [1, 53], 45: [2, 51] }, { 16: [1, 56] }, { 31: [2, 81], 55: 57, 59: [2, 81], 66: [2, 81], 74: [2, 81], 75: [2, 81], 76: [2, 81], 77: [2, 81], 78: [2, 81], 79: [2, 81] }, { 31: [2, 37], 59: [2, 37], 66: [2, 37], 74: [2, 37], 75: [2, 37], 76: [2, 37], 77: [2, 37], 78: [2, 37], 79: [2, 37] }, { 31: [2, 38], 59: [2, 38], 66: [2, 38], 74: [2, 38], 75: [2, 38], 76: [2, 38], 77: [2, 38], 78: [2, 38], 79: [2, 38] }, { 18: 58, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 28: 59, 31: [2, 53], 59: [2, 53], 66: [2, 53], 69: [2, 53], 74: [2, 53], 75: [2, 53], 76: [2, 53], 77: [2, 53], 78: [2, 53], 79: [2, 53] }, { 31: [2, 59], 33: 60, 59: [2, 59], 66: [2, 59], 69: [2, 59], 74: [2, 59], 75: [2, 59], 76: [2, 59], 77: [2, 59], 78: [2, 59], 79: [2, 59] }, { 19: 61, 21: [2, 45], 59: [2, 45], 66: [2, 45], 74: [2, 45], 75: [2, 45], 76: [2, 45], 77: [2, 45], 78: [2, 45], 79: [2, 45] }, { 18: 65, 31: [2, 75], 48: 62, 57: 63, 58: 66, 59: [1, 40], 63: 64, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 66: [1, 70] }, { 21: [2, 39], 31: [2, 39], 52: [2, 39], 59: [2, 39], 62: [2, 39], 66: [2, 39], 69: [2, 39], 74: [2, 39], 75: [2, 39], 76: [2, 39], 77: [2, 39], 78: [2, 39], 79: [2, 39], 81: [1, 45] }, { 18: 65, 51: 71, 52: [2, 79], 57: 72, 58: 66, 59: [1, 40], 63: 73, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 24: 74, 45: [1, 75] }, { 45: [2, 50] }, { 4: 76, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 37: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 45: [2, 19] }, { 18: 77, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 4: 78, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 24: 79, 45: [1, 75] }, { 45: [2, 52] }, { 5: [2, 10], 13: [2, 10], 14: [2, 10], 17: [2, 10], 27: [2, 10], 32: [2, 10], 37: [2, 10], 42: [2, 10], 45: [2, 10], 46: [2, 10], 49: [2, 10], 53: [2, 10] }, { 18: 65, 31: [2, 83], 56: 80, 57: 81, 58: 66, 59: [1, 40], 63: 82, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 59: [2, 85], 60: 83, 62: [2, 85], 66: [2, 85], 74: [2, 85], 75: [2, 85], 76: [2, 85], 77: [2, 85], 78: [2, 85], 79: [2, 85] }, { 18: 65, 29: 84, 31: [2, 55], 57: 85, 58: 66, 59: [1, 40], 63: 86, 64: 67, 65: 68, 66: [1, 69], 69: [2, 55], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 65, 31: [2, 61], 34: 87, 57: 88, 58: 66, 59: [1, 40], 63: 89, 64: 67, 65: 68, 66: [1, 69], 69: [2, 61], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 65, 20: 90, 21: [2, 47], 57: 91, 58: 66, 59: [1, 40], 63: 92, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 31: [1, 93] }, { 31: [2, 74], 59: [2, 74], 66: [2, 74], 74: [2, 74], 75: [2, 74], 76: [2, 74], 77: [2, 74], 78: [2, 74], 79: [2, 74] }, { 31: [2, 76] }, { 21: [2, 24], 31: [2, 24], 52: [2, 24], 59: [2, 24], 62: [2, 24], 66: [2, 24], 69: [2, 24], 74: [2, 24], 75: [2, 24], 76: [2, 24], 77: [2, 24], 78: [2, 24], 79: [2, 24] }, { 21: [2, 25], 31: [2, 25], 52: [2, 25], 59: [2, 25], 62: [2, 25], 66: [2, 25], 69: [2, 25], 74: [2, 25], 75: [2, 25], 76: [2, 25], 77: [2, 25], 78: [2, 25], 79: [2, 25] }, { 21: [2, 27], 31: [2, 27], 52: [2, 27], 62: [2, 27], 65: 94, 66: [1, 95], 69: [2, 27] }, { 21: [2, 89], 31: [2, 89], 52: [2, 89], 62: [2, 89], 66: [2, 89], 69: [2, 89] }, { 21: [2, 42], 31: [2, 42], 52: [2, 42], 59: [2, 42], 62: [2, 42], 66: [2, 42], 67: [1, 96], 69: [2, 42], 74: [2, 42], 75: [2, 42], 76: [2, 42], 77: [2, 42], 78: [2, 42], 79: [2, 42], 81: [2, 42] }, { 21: [2, 41], 31: [2, 41], 52: [2, 41], 59: [2, 41], 62: [2, 41], 66: [2, 41], 69: [2, 41], 74: [2, 41], 75: [2, 41], 76: [2, 41], 77: [2, 41], 78: [2, 41], 79: [2, 41], 81: [2, 41] }, { 52: [1, 97] }, { 52: [2, 78], 59: [2, 78], 66: [2, 78], 74: [2, 78], 75: [2, 78], 76: [2, 78], 77: [2, 78], 78: [2, 78], 79: [2, 78] }, { 52: [2, 80] }, { 5: [2, 12], 13: [2, 12], 14: [2, 12], 17: [2, 12], 27: [2, 12], 32: [2, 12], 37: [2, 12], 42: [2, 12], 45: [2, 12], 46: [2, 12], 49: [2, 12], 53: [2, 12] }, { 18: 98, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 36: 50, 37: [1, 52], 41: 51, 42: [1, 53], 43: 100, 44: 99, 45: [2, 71] }, { 31: [2, 65], 38: 101, 59: [2, 65], 66: [2, 65], 69: [2, 65], 74: [2, 65], 75: [2, 65], 76: [2, 65], 77: [2, 65], 78: [2, 65], 79: [2, 65] }, { 45: [2, 17] }, { 5: [2, 13], 13: [2, 13], 14: [2, 13], 17: [2, 13], 27: [2, 13], 32: [2, 13], 37: [2, 13], 42: [2, 13], 45: [2, 13], 46: [2, 13], 49: [2, 13], 53: [2, 13] }, { 31: [1, 102] }, { 31: [2, 82], 59: [2, 82], 66: [2, 82], 74: [2, 82], 75: [2, 82], 76: [2, 82], 77: [2, 82], 78: [2, 82], 79: [2, 82] }, { 31: [2, 84] }, { 18: 65, 57: 104, 58: 66, 59: [1, 40], 61: 103, 62: [2, 87], 63: 105, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 30: 106, 31: [2, 57], 68: 107, 69: [1, 108] }, { 31: [2, 54], 59: [2, 54], 66: [2, 54], 69: [2, 54], 74: [2, 54], 75: [2, 54], 76: [2, 54], 77: [2, 54], 78: [2, 54], 79: [2, 54] }, { 31: [2, 56], 69: [2, 56] }, { 31: [2, 63], 35: 109, 68: 110, 69: [1, 108] }, { 31: [2, 60], 59: [2, 60], 66: [2, 60], 69: [2, 60], 74: [2, 60], 75: [2, 60], 76: [2, 60], 77: [2, 60], 78: [2, 60], 79: [2, 60] }, { 31: [2, 62], 69: [2, 62] }, { 21: [1, 111] }, { 21: [2, 46], 59: [2, 46], 66: [2, 46], 74: [2, 46], 75: [2, 46], 76: [2, 46], 77: [2, 46], 78: [2, 46], 79: [2, 46] }, { 21: [2, 48] }, { 5: [2, 21], 13: [2, 21], 14: [2, 21], 17: [2, 21], 27: [2, 21], 32: [2, 21], 37: [2, 21], 42: [2, 21], 45: [2, 21], 46: [2, 21], 49: [2, 21], 53: [2, 21] }, { 21: [2, 90], 31: [2, 90], 52: [2, 90], 62: [2, 90], 66: [2, 90], 69: [2, 90] }, { 67: [1, 96] }, { 18: 65, 57: 112, 58: 66, 59: [1, 40], 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 22], 13: [2, 22], 14: [2, 22], 17: [2, 22], 27: [2, 22], 32: [2, 22], 37: [2, 22], 42: [2, 22], 45: [2, 22], 46: [2, 22], 49: [2, 22], 53: [2, 22] }, { 31: [1, 113] }, { 45: [2, 18] }, { 45: [2, 72] }, { 18: 65, 31: [2, 67], 39: 114, 57: 115, 58: 66, 59: [1, 40], 63: 116, 64: 67, 65: 68, 66: [1, 69], 69: [2, 67], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 23], 13: [2, 23], 14: [2, 23], 17: [2, 23], 27: [2, 23], 32: [2, 23], 37: [2, 23], 42: [2, 23], 45: [2, 23], 46: [2, 23], 49: [2, 23], 53: [2, 23] }, { 62: [1, 117] }, { 59: [2, 86], 62: [2, 86], 66: [2, 86], 74: [2, 86], 75: [2, 86], 76: [2, 86], 77: [2, 86], 78: [2, 86], 79: [2, 86] }, { 62: [2, 88] }, { 31: [1, 118] }, { 31: [2, 58] }, { 66: [1, 120], 70: 119 }, { 31: [1, 121] }, { 31: [2, 64] }, { 14: [2, 11] }, { 21: [2, 28], 31: [2, 28], 52: [2, 28], 62: [2, 28], 66: [2, 28], 69: [2, 28] }, { 5: [2, 20], 13: [2, 20], 14: [2, 20], 17: [2, 20], 27: [2, 20], 32: [2, 20], 37: [2, 20], 42: [2, 20], 45: [2, 20], 46: [2, 20], 49: [2, 20], 53: [2, 20] }, { 31: [2, 69], 40: 122, 68: 123, 69: [1, 108] }, { 31: [2, 66], 59: [2, 66], 66: [2, 66], 69: [2, 66], 74: [2, 66], 75: [2, 66], 76: [2, 66], 77: [2, 66], 78: [2, 66], 79: [2, 66] }, { 31: [2, 68], 69: [2, 68] }, { 21: [2, 26], 31: [2, 26], 52: [2, 26], 59: [2, 26], 62: [2, 26], 66: [2, 26], 69: [2, 26], 74: [2, 26], 75: [2, 26], 76: [2, 26], 77: [2, 26], 78: [2, 26], 79: [2, 26] }, { 13: [2, 14], 14: [2, 14], 17: [2, 14], 27: [2, 14], 32: [2, 14], 37: [2, 14], 42: [2, 14], 45: [2, 14], 46: [2, 14], 49: [2, 14], 53: [2, 14] }, { 66: [1, 125], 71: [1, 124] }, { 66: [2, 91], 71: [2, 91] }, { 13: [2, 15], 14: [2, 15], 17: [2, 15], 27: [2, 15], 32: [2, 15], 42: [2, 15], 45: [2, 15], 46: [2, 15], 49: [2, 15], 53: [2, 15] }, { 31: [1, 126] }, { 31: [2, 70] }, { 31: [2, 29] }, { 66: [2, 92], 71: [2, 92] }, { 13: [2, 16], 14: [2, 16], 17: [2, 16], 27: [2, 16], 32: [2, 16], 37: [2, 16], 42: [2, 16], 45: [2, 16], 46: [2, 16], 49: [2, 16], 53: [2, 16] }], - defaultActions: { 4: [2, 1], 49: [2, 50], 51: [2, 19], 55: [2, 52], 64: [2, 76], 73: [2, 80], 78: [2, 17], 82: [2, 84], 92: [2, 48], 99: [2, 18], 100: [2, 72], 105: [2, 88], 107: [2, 58], 110: [2, 64], 111: [2, 11], 123: [2, 70], 124: [2, 29] }, - parseError: function parseError(str, hash) { - throw new Error(str); - }, - parse: function parse(input) { - var self = this, - stack = [0], - vstack = [null], - lstack = [], - table = this.table, - yytext = "", - yylineno = 0, - yyleng = 0, - recovering = 0, - TERROR = 2, - EOF = 1; - this.lexer.setInput(input); - this.lexer.yy = this.yy; - this.yy.lexer = this.lexer; - this.yy.parser = this; - if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; - var yyloc = this.lexer.yylloc; - lstack.push(yyloc); - var ranges = this.lexer.options && this.lexer.options.ranges; - if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = self.lexer.lex() || 1; - if (typeof token !== "number") { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, - preErrorSymbol, - state, - action, - a, - r, - yyval = {}, - p, - len, - newState, - expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - if (!recovering) { - expected = []; - for (p in table[state]) if (this.terminals_[p] && p > 2) { - expected.push("'" + this.terminals_[p] + "'"); - } - if (this.lexer.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); - } - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) recovering--; - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; - if (ranges) { - yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; - } - }; - /* Jison generated lexer */ - var lexer = (function () { - var lexer = { EOF: 1, - parseError: function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - setInput: function setInput(input) { - this._input = input; - this._more = this._less = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; - if (this.options.ranges) this.yylloc.range = [0, 0]; - this.offset = 0; - return this; - }, - input: function input() { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) this.yylloc.range[1]++; - - this._input = this._input.slice(1); - return ch; - }, - unput: function unput(ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) this.yylineno -= lines.length - 1; - var r = this.yylloc.range; - - this.yylloc = { first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - return this; - }, - more: function more() { - this._more = true; - return this; - }, - less: function less(n) { - this.unput(this.match.slice(n)); - }, - pastInput: function pastInput() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - upcomingInput: function upcomingInput() { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20 - next.length); - } - return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - showPosition: function showPosition() { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - next: function next() { - if (this.done) { - return this.EOF; - } - if (!this._input) this.done = true; - - var token, match, tempMatch, index, col, lines; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (!this.options.flex) break; - } - } - if (match) { - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) this.yylineno += lines.length; - this.yylloc = { first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) this.done = false; - if (token) { - return token; - } else { - return; - } - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); - } - }, - lex: function lex() { - var r = this.next(); - if (typeof r !== "undefined") { - return r; - } else { - return this.lex(); - } - }, - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - popState: function popState() { - return this.conditionStack.pop(); - }, - _currentRules: function _currentRules() { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - }, - topState: function topState() { - return this.conditionStack[this.conditionStack.length - 2]; - }, - pushState: function begin(condition) { - this.begin(condition); - } }; - lexer.options = {}; - lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - - function strip(start, end) { - return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end); - } - - var YYSTATE = YY_START; - switch ($avoiding_name_collisions) { - case 0: - if (yy_.yytext.slice(-2) === "\\\\") { - strip(0, 1); - this.begin("mu"); - } else if (yy_.yytext.slice(-1) === "\\") { - strip(0, 1); - this.begin("emu"); - } else { - this.begin("mu"); - } - if (yy_.yytext) { - return 14; - }break; - case 1: - return 14; - break; - case 2: - this.popState(); - return 14; - - break; - case 3: - yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9); - this.popState(); - return 16; - - break; - case 4: - return 14; - break; - case 5: - this.popState(); - return 13; - - break; - case 6: - return 59; - break; - case 7: - return 62; - break; - case 8: - return 17; - break; - case 9: - this.popState(); - this.begin("raw"); - return 21; - - break; - case 10: - return 53; - break; - case 11: - return 27; - break; - case 12: - return 45; - break; - case 13: - this.popState();return 42; - break; - case 14: - this.popState();return 42; - break; - case 15: - return 32; - break; - case 16: - return 37; - break; - case 17: - return 49; - break; - case 18: - return 46; - break; - case 19: - this.unput(yy_.yytext); - this.popState(); - this.begin("com"); - - break; - case 20: - this.popState(); - return 13; - - break; - case 21: - return 46; - break; - case 22: - return 67; - break; - case 23: - return 66; - break; - case 24: - return 66; - break; - case 25: - return 81; - break; - case 26: - // ignore whitespace - break; - case 27: - this.popState();return 52; - break; - case 28: - this.popState();return 31; - break; - case 29: - yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74; - break; - case 30: - yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 74; - break; - case 31: - return 79; - break; - case 32: - return 76; - break; - case 33: - return 76; - break; - case 34: - return 77; - break; - case 35: - return 78; - break; - case 36: - return 75; - break; - case 37: - return 69; - break; - case 38: - return 71; - break; - case 39: - return 66; - break; - case 40: - return 66; - break; - case 41: - return "INVALID"; - break; - case 42: - return 5; - break; - } - }; - lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/]; - lexer.conditions = { mu: { rules: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } }; - return lexer; - })(); - parser.lexer = lexer; - function Parser() { - this.yy = {}; - }Parser.prototype = parser;parser.Parser = Parser; - return new Parser(); - })();module.exports = handlebars; -}); -define('handlebars/compiler/visitor',['exports', 'module', '../exception', './ast'], function (exports, module, _exception, _ast) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - var _Exception = _interopRequire(_exception); - - var _AST = _interopRequire(_ast); - - function Visitor() { - this.parents = []; - } - - Visitor.prototype = { - constructor: Visitor, - mutating: false, - - // Visits a given value. If mutating, will replace the value if necessary. - acceptKey: function acceptKey(node, name) { - var value = this.accept(node[name]); - if (this.mutating) { - // Hacky sanity check: - if (value && (!value.type || !_AST[value.type])) { - throw new _Exception('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); - } - node[name] = value; - } - }, - - // Performs an accept operation with added sanity check to ensure - // required keys are not removed. - acceptRequired: function acceptRequired(node, name) { - this.acceptKey(node, name); - - if (!node[name]) { - throw new _Exception(node.type + ' requires ' + name); - } - }, - - // Traverses a given array. If mutating, empty respnses will be removed - // for child elements. - acceptArray: function acceptArray(array) { - for (var i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - - if (!array[i]) { - array.splice(i, 1); - i--; - l--; - } - } - }, - - accept: function accept(object) { - if (!object) { - return; - } - - if (this.current) { - this.parents.unshift(this.current); - } - this.current = object; - - var ret = this[object.type](object); - - this.current = this.parents.shift(); - - if (!this.mutating || ret) { - return ret; - } else if (ret !== false) { - return object; - } - }, - - Program: function Program(program) { - this.acceptArray(program.body); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.acceptRequired(mustache, 'path'); - this.acceptArray(mustache.params); - this.acceptKey(mustache, 'hash'); - }, - - BlockStatement: function BlockStatement(block) { - this.acceptRequired(block, 'path'); - this.acceptArray(block.params); - this.acceptKey(block, 'hash'); - - this.acceptKey(block, 'program'); - this.acceptKey(block, 'inverse'); - }, - - PartialStatement: function PartialStatement(partial) { - this.acceptRequired(partial, 'name'); - this.acceptArray(partial.params); - this.acceptKey(partial, 'hash'); - }, - - ContentStatement: function ContentStatement() {}, - CommentStatement: function CommentStatement() {}, - - SubExpression: function SubExpression(sexpr) { - this.acceptRequired(sexpr, 'path'); - this.acceptArray(sexpr.params); - this.acceptKey(sexpr, 'hash'); - }, - - PathExpression: function PathExpression() {}, - - StringLiteral: function StringLiteral() {}, - NumberLiteral: function NumberLiteral() {}, - BooleanLiteral: function BooleanLiteral() {}, - UndefinedLiteral: function UndefinedLiteral() {}, - NullLiteral: function NullLiteral() {}, - - Hash: function Hash(hash) { - this.acceptArray(hash.pairs); - }, - HashPair: function HashPair(pair) { - this.acceptRequired(pair, 'value'); - } - }; - - module.exports = Visitor; -}); -/* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */; -define('handlebars/compiler/whitespace-control',['exports', 'module', './visitor'], function (exports, module, _visitor) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - var _Visitor = _interopRequire(_visitor); - - function WhitespaceControl() {} - WhitespaceControl.prototype = new _Visitor(); - - WhitespaceControl.prototype.Program = function (program) { - var isRoot = !this.isRootSeen; - this.isRootSeen = true; - - var body = program.body; - for (var i = 0, l = body.length; i < l; i++) { - var current = body[i], - strip = this.accept(current); - - if (!strip) { - continue; - } - - var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), - _isNextWhitespace = isNextWhitespace(body, i, isRoot), - openStandalone = strip.openStandalone && _isPrevWhitespace, - closeStandalone = strip.closeStandalone && _isNextWhitespace, - inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; - - if (strip.close) { - omitRight(body, i, true); - } - if (strip.open) { - omitLeft(body, i, true); - } - - if (inlineStandalone) { - omitRight(body, i); - - if (omitLeft(body, i)) { - // If we are on a standalone node, save the indent info for partials - if (current.type === 'PartialStatement') { - // Pull out the whitespace from the final line - current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; - } - } - } - if (openStandalone) { - omitRight((current.program || current.inverse).body); - - // Strip out the previous content node if it's whitespace only - omitLeft(body, i); - } - if (closeStandalone) { - // Always strip the next node - omitRight(body, i); - - omitLeft((current.inverse || current.program).body); - } - } - - return program; - }; - WhitespaceControl.prototype.BlockStatement = function (block) { - this.accept(block.program); - this.accept(block.inverse); - - // Find the inverse program that is involed with whitespace stripping. - var program = block.program || block.inverse, - inverse = block.program && block.inverse, - firstInverse = inverse, - lastInverse = inverse; - - if (inverse && inverse.chained) { - firstInverse = inverse.body[0].program; - - // Walk the inverse chain to find the last inverse that is actually in the chain. - while (lastInverse.chained) { - lastInverse = lastInverse.body[lastInverse.body.length - 1].program; - } - } - - var strip = { - open: block.openStrip.open, - close: block.closeStrip.close, - - // Determine the standalone candiacy. Basically flag our content as being possibly standalone - // so our parent can determine if we actually are standalone - openStandalone: isNextWhitespace(program.body), - closeStandalone: isPrevWhitespace((firstInverse || program).body) - }; - - if (block.openStrip.close) { - omitRight(program.body, null, true); - } - - if (inverse) { - var inverseStrip = block.inverseStrip; - - if (inverseStrip.open) { - omitLeft(program.body, null, true); - } - - if (inverseStrip.close) { - omitRight(firstInverse.body, null, true); - } - if (block.closeStrip.open) { - omitLeft(lastInverse.body, null, true); - } - - // Find standalone else statments - if (isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { - omitLeft(program.body); - omitRight(firstInverse.body); - } - } else if (block.closeStrip.open) { - omitLeft(program.body, null, true); - } - - return strip; - }; - - WhitespaceControl.prototype.MustacheStatement = function (mustache) { - return mustache.strip; - }; - - WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { - /* istanbul ignore next */ - var strip = node.strip || {}; - return { - inlineStandalone: true, - open: strip.open, - close: strip.close - }; - }; - - function isPrevWhitespace(body, i, isRoot) { - if (i === undefined) { - i = body.length; - } - - // Nodes that end with newlines are considered whitespace (but are special - // cased for strip operations) - var prev = body[i - 1], - sibling = body[i - 2]; - if (!prev) { - return isRoot; - } - - if (prev.type === 'ContentStatement') { - return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); - } - } - function isNextWhitespace(body, i, isRoot) { - if (i === undefined) { - i = -1; - } - - var next = body[i + 1], - sibling = body[i + 2]; - if (!next) { - return isRoot; - } - - if (next.type === 'ContentStatement') { - return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); - } - } - - // Marks the node to the right of the position as omitted. - // I.e. {{foo}}' ' will mark the ' ' node as omitted. - // - // If i is undefined, then the first child will be marked as such. - // - // If mulitple is truthy then all whitespace will be stripped out until non-whitespace - // content is met. - function omitRight(body, i, multiple) { - var current = body[i == null ? 0 : i + 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { - return; - } - - var original = current.value; - current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); - current.rightStripped = current.value !== original; - } - - // Marks the node to the left of the position as omitted. - // I.e. ' '{{foo}} will mark the ' ' node as omitted. - // - // If i is undefined then the last child will be marked as such. - // - // If mulitple is truthy then all whitespace will be stripped out until non-whitespace - // content is met. - function omitLeft(body, i, multiple) { - var current = body[i == null ? body.length - 1 : i - 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { - return; - } - - // We omit the last node if it's whitespace only and not preceeded by a non-content node. - var original = current.value; - current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); - current.leftStripped = current.value !== original; - return current.leftStripped; - } - - module.exports = WhitespaceControl; -}); -define('handlebars/compiler/helpers',['exports', '../exception'], function (exports, _exception) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.SourceLocation = SourceLocation; - exports.id = id; - exports.stripFlags = stripFlags; - exports.stripComment = stripComment; - exports.preparePath = preparePath; - exports.prepareMustache = prepareMustache; - exports.prepareRawBlock = prepareRawBlock; - exports.prepareBlock = prepareBlock; - - var _Exception = _interopRequire(_exception); - - function SourceLocation(source, locInfo) { - this.source = source; - this.start = { - line: locInfo.first_line, - column: locInfo.first_column - }; - this.end = { - line: locInfo.last_line, - column: locInfo.last_column - }; - } - - function id(token) { - if (/^\[.*\]$/.test(token)) { - return token.substr(1, token.length - 2); - } else { - return token; - } - } - - function stripFlags(open, close) { - return { - open: open.charAt(2) === '~', - close: close.charAt(close.length - 3) === '~' - }; - } - - function stripComment(comment) { - return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, ''); - } - - function preparePath(data, parts, locInfo) { - locInfo = this.locInfo(locInfo); - - var original = data ? '@' : '', - dig = [], - depth = 0, - depthString = ''; - - for (var i = 0, l = parts.length; i < l; i++) { - var part = parts[i].part, - - // If we have [] syntax then we do not treat path references as operators, - // i.e. foo.[this] resolves to approximately context.foo['this'] - isLiteral = parts[i].original !== part; - original += (parts[i].separator || '') + part; - - if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { - if (dig.length > 0) { - throw new _Exception('Invalid path: ' + original, { loc: locInfo }); - } else if (part === '..') { - depth++; - depthString += '../'; - } - } else { - dig.push(part); - } - } - - return new this.PathExpression(data, depth, dig, original, locInfo); - } - - function prepareMustache(path, params, hash, open, strip, locInfo) { - // Must use charAt to support IE pre-10 - var escapeFlag = open.charAt(3) || open.charAt(2), - escaped = escapeFlag !== '{' && escapeFlag !== '&'; - - return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo)); - } - - function prepareRawBlock(openRawBlock, content, close, locInfo) { - if (openRawBlock.path.original !== close) { - var errorNode = { loc: openRawBlock.path.loc }; - - throw new _Exception(openRawBlock.path.original + ' doesn\'t match ' + close, errorNode); - } - - locInfo = this.locInfo(locInfo); - var program = new this.Program([content], null, {}, locInfo); - - return new this.BlockStatement(openRawBlock.path, openRawBlock.params, openRawBlock.hash, program, undefined, {}, {}, {}, locInfo); - } - - function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { - // When we are chaining inverse calls, we will not have a close path - if (close && close.path && openBlock.path.original !== close.path.original) { - var errorNode = { loc: openBlock.path.loc }; - - throw new _Exception(openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); - } - - program.blockParams = openBlock.blockParams; - - var inverse = undefined, - inverseStrip = undefined; - - if (inverseAndProgram) { - if (inverseAndProgram.chain) { - inverseAndProgram.program.body[0].closeStrip = close.strip; - } - - inverseStrip = inverseAndProgram.strip; - inverse = inverseAndProgram.program; - } - - if (inverted) { - inverted = inverse; - inverse = program; - program = inverted; - } - - return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); - } -}); -define('handlebars/compiler/base',['exports', './parser', './ast', './whitespace-control', './helpers', '../utils'], function (exports, _parser, _ast, _whitespaceControl, _helpers, _utils) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.parse = parse; - - var _parser2 = _interopRequire(_parser); - - var _AST = _interopRequire(_ast); - - var _WhitespaceControl = _interopRequire(_whitespaceControl); - - exports.parser = _parser2; - - var yy = {}; - _utils.extend(yy, _helpers, _AST); - - function parse(input, options) { - // Just return if an already-compiled AST was passed in. - if (input.type === 'Program') { - return input; - } - - _parser2.yy = yy; - - // Altering the shared object here, but this is ok as parser is a sync operation - yy.locInfo = function (locInfo) { - return new yy.SourceLocation(options && options.srcName, locInfo); - }; - - var strip = new _WhitespaceControl(); - return strip.accept(_parser2.parse(input)); - } -}); -define('handlebars/compiler/compiler',['exports', '../exception', '../utils', './ast'], function (exports, _exception, _utils, _ast) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.Compiler = Compiler; - exports.precompile = precompile; - exports.compile = compile; - - var _Exception = _interopRequire(_exception); - - var _AST = _interopRequire(_ast); - - var slice = [].slice; - - function Compiler() {} - - // the foundHelper register will disambiguate helper lookup from finding a - // function in a context. This is necessary for mustache compatibility, which - // requires that context functions in blocks are evaluated by blockHelperMissing, - // and then proceed as if the resulting value was provided to blockHelperMissing. - - Compiler.prototype = { - compiler: Compiler, - - equals: function equals(other) { - var len = this.opcodes.length; - if (other.opcodes.length !== len) { return false; } + } - for (var i = 0; i < len; i++) { - var opcode = this.opcodes[i], - otherOpcode = other.opcodes[i]; - if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { - return false; - } + __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; + } + + __exports__.appendContextPath = appendContextPath; + }); +define( + 'handlebars/exception',["exports"], + function(__exports__) { + + + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + + function Exception(message, node) { + var line; + if (node && node.firstLine) { + line = node.firstLine; + + message += ' - ' + line + ':' + node.firstColumn; } - // We know that length is the same between the two arrays because they are directly tied - // to the opcode behavior above. - len = this.children.length; - for (var i = 0; i < len; i++) { - if (!this.children[i].equals(other.children[i])) { - return false; - } + var tmp = Error.prototype.constructor.call(this, message); + + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; } - return true; - }, + if (line) { + this.lineNumber = line; + this.column = node.firstColumn; + } + } - guid: 0, + Exception.prototype = new Error(); - compile: function compile(program, options) { - this.sourceNode = []; - this.opcodes = []; - this.children = []; - this.options = options; - this.stringParams = options.stringParams; - this.trackIds = options.trackIds; + __exports__["default"] = Exception; + }); +define( + 'handlebars/base',["./utils","./exception","exports"], + function(__dependency1__, __dependency2__, __exports__) { + + var Utils = __dependency1__; + var Exception = __dependency2__["default"]; - options.blockParams = options.blockParams || []; + var VERSION = "2.0.0"; + __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; + __exports__.COMPILER_REVISION = COMPILER_REVISION; + var REVISION_CHANGES = { + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it + 2: '== 1.0.0-rc.3', + 3: '== 1.0.0-rc.4', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' + }; + __exports__.REVISION_CHANGES = REVISION_CHANGES; + var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; - // These changes will propagate to the other compiler components - var knownHelpers = options.knownHelpers; - options.knownHelpers = { - helperMissing: true, - blockHelperMissing: true, - each: true, - 'if': true, - unless: true, - 'with': true, - log: true, - lookup: true - }; - if (knownHelpers) { - for (var _name in knownHelpers) { - if (_name in knownHelpers) { - options.knownHelpers[_name] = knownHelpers[_name]; + function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; + + registerDefaultHelpers(this); + } + + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, + + logger: logger, + log: log, + + registerHelper: function(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } + Utils.extend(this.helpers, name); + } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function(name) { + delete this.helpers[name]; + }, + + registerPartial: function(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + this.partials[name] = partial; + } + }, + unregisterPartial: function(name) { + delete this.partials[name]; + } + }; + + function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); + } + }); + + instance.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse, + fn = options.fn; + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { + return inverse(this); + } else if (isArray(context)) { + if(context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } + + return instance.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = {data: data}; + } + + return fn(context, options); + } + }); + + instance.registerHelper('each', function(context, options) { + if (!options) { + throw new Exception('Must pass iterator to #each'); + } + + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + var contextPath; + if (options.data && options.ids) { + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; + } + + if (isFunction(context)) { context = context.call(this); } + + if (options.data) { + data = createFrame(options.data); + } + + if(context && typeof context === 'object') { + if (isArray(context)) { + for(var j = context.length; i 0) { + throw new Exception("Invalid path: " + original, this); + } else if (part === "..") { + depth++; + depthString += '../'; + } else { + this.isScoped = true; + } + } else { + dig.push(part); + } + } + + this.original = original; + this.parts = dig; + this.string = dig.join('.'); + this.depth = depth; + this.idName = depthString + this.string; + + // an ID is simple if it only has one part, and that part is not + // `..` or `this`. + this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; + + this.stringModeValue = this.string; + }, + + PartialNameNode: function(name, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "PARTIAL_NAME"; + this.name = name.original; + }, + + DataNode: function(id, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "DATA"; + this.id = id; + this.stringModeValue = id.stringModeValue; + this.idName = '@' + id.stringModeValue; + }, + + StringNode: function(string, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "STRING"; + this.original = + this.string = + this.stringModeValue = string; + }, + + NumberNode: function(number, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "NUMBER"; + this.original = + this.number = number; + this.stringModeValue = Number(number); + }, + + BooleanNode: function(bool, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "BOOLEAN"; + this.bool = bool; + this.stringModeValue = bool === "true"; + }, + + CommentNode: function(comment, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "comment"; + this.comment = comment; + + this.strip = { + inlineStandalone: true + }; + } + }; + + + // Must be exported as an object rather than the root of the module as the jison lexer + // most modify the object to operate properly. + __exports__["default"] = AST; + }); +define( + 'handlebars/compiler/parser',["exports"], + function(__exports__) { + + /* jshint ignore:start */ + /* istanbul ignore next */ + /* Jison generated parser */ + var handlebars = (function(){ + var parser = {trace: function trace() { }, + yy: {}, + symbols_: {"error":2,"root":3,"program":4,"EOF":5,"program_repetition0":6,"statement":7,"mustache":8,"block":9,"rawBlock":10,"partial":11,"CONTENT":12,"COMMENT":13,"openRawBlock":14,"END_RAW_BLOCK":15,"OPEN_RAW_BLOCK":16,"sexpr":17,"CLOSE_RAW_BLOCK":18,"openBlock":19,"block_option0":20,"closeBlock":21,"openInverse":22,"block_option1":23,"OPEN_BLOCK":24,"CLOSE":25,"OPEN_INVERSE":26,"inverseAndProgram":27,"INVERSE":28,"OPEN_ENDBLOCK":29,"path":30,"OPEN":31,"OPEN_UNESCAPED":32,"CLOSE_UNESCAPED":33,"OPEN_PARTIAL":34,"partialName":35,"param":36,"partial_option0":37,"partial_option1":38,"sexpr_repetition0":39,"sexpr_option0":40,"dataName":41,"STRING":42,"NUMBER":43,"BOOLEAN":44,"OPEN_SEXPR":45,"CLOSE_SEXPR":46,"hash":47,"hash_repetition_plus0":48,"hashSegment":49,"ID":50,"EQUALS":51,"DATA":52,"pathSegments":53,"SEP":54,"$accept":0,"$end":1}, + terminals_: {2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"}, + productions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]], + performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { + + var $0 = $$.length - 1; + switch (yystate) { + case 1: yy.prepareProgram($$[$0-1].statements, true); return $$[$0-1]; + break; + case 2:this.$ = new yy.ProgramNode(yy.prepareProgram($$[$0]), {}, this._$); + break; + case 3:this.$ = $$[$0]; + break; + case 4:this.$ = $$[$0]; + break; + case 5:this.$ = $$[$0]; + break; + case 6:this.$ = $$[$0]; + break; + case 7:this.$ = new yy.ContentNode($$[$0], this._$); + break; + case 8:this.$ = new yy.CommentNode($$[$0], this._$); + break; + case 9:this.$ = new yy.RawBlockNode($$[$0-2], $$[$0-1], $$[$0], this._$); + break; + case 10:this.$ = new yy.MustacheNode($$[$0-1], null, '', '', this._$); + break; + case 11:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], false, this._$); + break; + case 12:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], true, this._$); + break; + case 13:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 14:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 15:this.$ = { strip: yy.stripFlags($$[$0-1], $$[$0-1]), program: $$[$0] }; + break; + case 16:this.$ = {path: $$[$0-1], strip: yy.stripFlags($$[$0-2], $$[$0])}; + break; + case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 19:this.$ = new yy.PartialNode($$[$0-3], $$[$0-2], $$[$0-1], yy.stripFlags($$[$0-4], $$[$0]), this._$); + break; + case 20:this.$ = new yy.PartialNode($$[$0-2], undefined, $$[$0-1], yy.stripFlags($$[$0-3], $$[$0]), this._$); + break; + case 21:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$); + break; + case 22:this.$ = new yy.SexprNode([$$[$0]], null, this._$); + break; + case 23:this.$ = $$[$0]; + break; + case 24:this.$ = new yy.StringNode($$[$0], this._$); + break; + case 25:this.$ = new yy.NumberNode($$[$0], this._$); + break; + case 26:this.$ = new yy.BooleanNode($$[$0], this._$); + break; + case 27:this.$ = $$[$0]; + break; + case 28:$$[$0-1].isHelper = true; this.$ = $$[$0-1]; + break; + case 29:this.$ = new yy.HashNode($$[$0], this._$); + break; + case 30:this.$ = [$$[$0-2], $$[$0]]; + break; + case 31:this.$ = new yy.PartialNameNode($$[$0], this._$); + break; + case 32:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$); + break; + case 33:this.$ = new yy.PartialNameNode(new yy.NumberNode($$[$0], this._$)); + break; + case 34:this.$ = new yy.DataNode($$[$0], this._$); + break; + case 35:this.$ = new yy.IdNode($$[$0], this._$); + break; + case 36: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2]; + break; + case 37:this.$ = [{part: $$[$0]}]; + break; + case 38:this.$ = []; + break; + case 39:$$[$0-1].push($$[$0]); + break; + case 48:this.$ = []; + break; + case 49:$$[$0-1].push($$[$0]); + break; + case 52:this.$ = [$$[$0]]; + break; + case 53:$$[$0-1].push($$[$0]); + break; + } }, + table: [{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}], + defaultActions: {4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]}, + parseError: function parseError(str, hash) { + throw new Error(str); + }, + parse: function parse(input) { + var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + this.lexer.setInput(input); + this.lexer.yy = this.yy; + this.yy.lexer = this.lexer; + this.yy.parser = this; + if (typeof this.lexer.yylloc == "undefined") + this.lexer.yylloc = {}; + var yyloc = this.lexer.yylloc; + lstack.push(yyloc); + var ranges = this.lexer.options && this.lexer.options.ranges; + if (typeof this.yy.parseError === "function") + this.parseError = this.yy.parseError; + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = self.lexer.lex() || 1; + if (typeof token !== "number") { + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + if (!recovering) { + expected = []; + for (p in table[state]) + if (this.terminals_[p] && p > 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; + } + }; + /* Jison generated lexer */ + var lexer = (function(){ + var lexer = ({EOF:1, + parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, + input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; - Program: function Program(program) { - this.options.blockParams.unshift(program.blockParams); + this._input = this._input.slice(1); + return ch; + }, + unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); - var body = program.body, - bodyLength = body.length; - for (var i = 0; i < bodyLength; i++) { - this.accept(body[i]); + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); + + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; + + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, + more:function () { + this._more = true; + return this; + }, + less:function (n) { + this.unput(this.match.slice(n)); + }, + pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, + showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, + next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; + + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; + } + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, + lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, + begin:function begin(condition) { + this.conditionStack.push(condition); + }, + popState:function popState() { + return this.conditionStack.pop(); + }, + _currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, + topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, + pushState:function begin(condition) { + this.begin(condition); + }}); + lexer.options = {}; + lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + + + function strip(start, end) { + return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end); + } + + + var YYSTATE=YY_START + switch($avoiding_name_collisions) { + case 0: + if(yy_.yytext.slice(-2) === "\\\\") { + strip(0,1); + this.begin("mu"); + } else if(yy_.yytext.slice(-1) === "\\") { + strip(0,1); + this.begin("emu"); + } else { + this.begin("mu"); + } + if(yy_.yytext) return 12; + + break; + case 1:return 12; + break; + case 2: + this.popState(); + return 12; + + break; + case 3: + yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9); + this.popState(); + return 15; + + break; + case 4: return 12; + break; + case 5:strip(0,4); this.popState(); return 13; + break; + case 6:return 45; + break; + case 7:return 46; + break; + case 8: return 16; + break; + case 9: + this.popState(); + this.begin('raw'); + return 18; + + break; + case 10:return 34; + break; + case 11:return 24; + break; + case 12:return 29; + break; + case 13:this.popState(); return 28; + break; + case 14:this.popState(); return 28; + break; + case 15:return 26; + break; + case 16:return 26; + break; + case 17:return 32; + break; + case 18:return 31; + break; + case 19:this.popState(); this.begin('com'); + break; + case 20:strip(3,5); this.popState(); return 13; + break; + case 21:return 31; + break; + case 22:return 51; + break; + case 23:return 50; + break; + case 24:return 50; + break; + case 25:return 54; + break; + case 26:// ignore whitespace + break; + case 27:this.popState(); return 33; + break; + case 28:this.popState(); return 25; + break; + case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42; + break; + case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42; + break; + case 31:return 52; + break; + case 32:return 44; + break; + case 33:return 44; + break; + case 34:return 43; + break; + case 35:return 50; + break; + case 36:yy_.yytext = strip(1,2); return 50; + break; + case 37:return 'INVALID'; + break; + case 38:return 5; + break; + } + }; + lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; + lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}}; + return lexer;})() + parser.lexer = lexer; + function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; + return new Parser; + })();__exports__["default"] = handlebars; + /* jshint ignore:end */ + }); +define( + 'handlebars/compiler/helpers',["../exception","exports"], + function(__dependency1__, __exports__) { + + var Exception = __dependency1__["default"]; + + function stripFlags(open, close) { + return { + left: open.charAt(2) === '~', + right: close.charAt(close.length-3) === '~' + }; + } + + __exports__.stripFlags = stripFlags; + function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { + /*jshint -W040 */ + if (mustache.sexpr.id.original !== close.path.original) { + throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache); } - this.options.blockParams.shift(); + var inverse = inverseAndProgram && inverseAndProgram.program; - this.isSimple = bodyLength === 1; - this.blockParams = program.blockParams ? program.blockParams.length : 0; + var strip = { + left: mustache.strip.left, + right: close.strip.right, - return this; - }, + // Determine the standalone candiacy. Basically flag our content as being possibly standalone + // so our parent can determine if we actually are standalone + openStandalone: isNextWhitespace(program.statements), + closeStandalone: isPrevWhitespace((inverse || program).statements) + }; - BlockStatement: function BlockStatement(block) { - transformLiteralToPath(block); + if (mustache.strip.right) { + omitRight(program.statements, null, true); + } - var program = block.program, - inverse = block.inverse; + if (inverse) { + var inverseStrip = inverseAndProgram.strip; - program = program && this.compileProgram(program); - inverse = inverse && this.compileProgram(inverse); + if (inverseStrip.left) { + omitLeft(program.statements, null, true); + } + if (inverseStrip.right) { + omitRight(inverse.statements, null, true); + } + if (close.strip.left) { + omitLeft(inverse.statements, null, true); + } - var type = this.classifySexpr(block); + // Find standalone else statments + if (isPrevWhitespace(program.statements) + && isNextWhitespace(inverse.statements)) { - if (type === 'helper') { - this.helperSexpr(block, program, inverse); - } else if (type === 'simple') { - this.simpleSexpr(block); - - // now that the simple mustache is resolved, we need to - // evaluate it by executing `blockHelperMissing` - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - this.opcode('emptyHash'); - this.opcode('blockValue', block.path.original); + omitLeft(program.statements); + omitRight(inverse.statements); + } } else { - this.ambiguousSexpr(block, program, inverse); - - // now that the simple mustache is resolved, we need to - // evaluate it by executing `blockHelperMissing` - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - this.opcode('emptyHash'); - this.opcode('ambiguousBlockValue'); + if (close.strip.left) { + omitLeft(program.statements, null, true); + } } - this.opcode('append'); - }, - - PartialStatement: function PartialStatement(partial) { - this.usePartial = true; - - var params = partial.params; - if (params.length > 1) { - throw new _Exception('Unsupported number of partial arguments: ' + params.length, partial); - } else if (!params.length) { - params.push({ type: 'PathExpression', parts: [], depth: 0 }); - } - - var partialName = partial.name.original, - isDynamic = partial.name.type === 'SubExpression'; - if (isDynamic) { - this.accept(partial.name); - } - - this.setupFullMustacheParams(partial, undefined, undefined, true); - - var indent = partial.indent || ''; - if (this.options.preventIndent && indent) { - this.opcode('appendContent', indent); - indent = ''; - } - - this.opcode('invokePartial', isDynamic, partialName, indent); - this.opcode('append'); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.SubExpression(mustache); // eslint-disable-line new-cap - - if (mustache.escaped && !this.options.noEscape) { - this.opcode('appendEscaped'); + if (inverted) { + return new this.BlockNode(mustache, inverse, program, strip, locInfo); } else { - this.opcode('append'); + return new this.BlockNode(mustache, program, inverse, strip, locInfo); } - }, + } - ContentStatement: function ContentStatement(content) { - if (content.value) { - this.opcode('appendContent', content.value); + __exports__.prepareBlock = prepareBlock; + function prepareProgram(statements, isRoot) { + for (var i = 0, l = statements.length; i < l; i++) { + var current = statements[i], + strip = current.strip; + + if (!strip) { + continue; + } + + var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'), + _isNextWhitespace = isNextWhitespace(statements, i, isRoot), + + openStandalone = strip.openStandalone && _isPrevWhitespace, + closeStandalone = strip.closeStandalone && _isNextWhitespace, + inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; + + if (strip.right) { + omitRight(statements, i, true); + } + if (strip.left) { + omitLeft(statements, i, true); + } + + if (inlineStandalone) { + omitRight(statements, i); + + if (omitLeft(statements, i)) { + // If we are on a standalone node, save the indent info for partials + if (current.type === 'partial') { + current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : ''; + } + } + } + if (openStandalone) { + omitRight((current.program || current.inverse).statements); + + // Strip out the previous content node if it's whitespace only + omitLeft(statements, i); + } + if (closeStandalone) { + // Always strip the next node + omitRight(statements, i); + + omitLeft((current.inverse || current.program).statements); + } } - }, - CommentStatement: function CommentStatement() {}, + return statements; + } - SubExpression: function SubExpression(sexpr) { - transformLiteralToPath(sexpr); - var type = this.classifySexpr(sexpr); - - if (type === 'simple') { - this.simpleSexpr(sexpr); - } else if (type === 'helper') { - this.helperSexpr(sexpr); - } else { - this.ambiguousSexpr(sexpr); + __exports__.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = statements.length; } - }, - ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { - var path = sexpr.path, - name = path.parts[0], - isBlock = program != null || inverse != null; - this.opcode('getContext', path.depth); - - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - - this.accept(path); - - this.opcode('invokeAmbiguous', name, isBlock); - }, - - simpleSexpr: function simpleSexpr(sexpr) { - this.accept(sexpr.path); - this.opcode('resolvePossibleLambda'); - }, - - helperSexpr: function helperSexpr(sexpr, program, inverse) { - var params = this.setupFullMustacheParams(sexpr, program, inverse), - path = sexpr.path, - name = path.parts[0]; - - if (this.options.knownHelpers[name]) { - this.opcode('invokeKnownHelper', params.length, name); - } else if (this.options.knownHelpersOnly) { - throw new _Exception('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); - } else { - path.falsy = true; - - this.accept(path); - this.opcode('invokeHelper', params.length, path.original, _AST.helpers.simpleId(path)); + // Nodes that end with newlines are considered whitespace (but are special + // cased for strip operations) + var prev = statements[i-1], + sibling = statements[i-2]; + if (!prev) { + return isRoot; } - }, - PathExpression: function PathExpression(path) { - this.addDepth(path.depth); - this.opcode('getContext', path.depth); - - var name = path.parts[0], - scoped = _AST.helpers.scopedId(path), - blockParamId = !path.depth && !scoped && this.blockParamIndex(name); - - if (blockParamId) { - this.opcode('lookupBlockParam', blockParamId, path.parts); - } else if (!name) { - // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` - this.opcode('pushContext'); - } else if (path.data) { - this.options.data = true; - this.opcode('lookupData', path.depth, path.parts); - } else { - this.opcode('lookupOnContext', path.parts, path.falsy, scoped); + if (prev.type === 'content') { + return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); } - }, - - StringLiteral: function StringLiteral(string) { - this.opcode('pushString', string.value); - }, - - NumberLiteral: function NumberLiteral(number) { - this.opcode('pushLiteral', number.value); - }, - - BooleanLiteral: function BooleanLiteral(bool) { - this.opcode('pushLiteral', bool.value); - }, - - UndefinedLiteral: function UndefinedLiteral() { - this.opcode('pushLiteral', 'undefined'); - }, - - NullLiteral: function NullLiteral() { - this.opcode('pushLiteral', 'null'); - }, - - Hash: function Hash(hash) { - var pairs = hash.pairs, - i = 0, - l = pairs.length; - - this.opcode('pushHash'); - - for (; i < l; i++) { - this.pushParam(pairs[i].value); + } + function isNextWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = -1; } - while (i--) { - this.opcode('assignToHash', pairs[i].key); + + var next = statements[i+1], + sibling = statements[i+2]; + if (!next) { + return isRoot; } - this.opcode('popHash'); - }, - // HELPERS - opcode: function opcode(name) { - this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); - }, + if (next.type === 'content') { + return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); + } + } - addDepth: function addDepth(depth) { - if (!depth) { + // Marks the node to the right of the position as omitted. + // I.e. {{foo}}' ' will mark the ' ' node as omitted. + // + // If i is undefined, then the first child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitRight(statements, i, multiple) { + var current = statements[i == null ? 0 : i + 1]; + if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) { return; } - this.useDepths = true; - }, + var original = current.string; + current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); + current.rightStripped = current.string !== original; + } - classifySexpr: function classifySexpr(sexpr) { - var isSimple = _AST.helpers.simpleId(sexpr.path); - - var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); - - // a mustache is an eligible helper if: - // * its id is simple (a single part, not `this` or `..`) - var isHelper = !isBlockParam && _AST.helpers.helperExpression(sexpr); - - // if a mustache is an eligible helper but not a definite - // helper, it is ambiguous, and will be resolved in a later - // pass or at runtime. - var isEligible = !isBlockParam && (isHelper || isSimple); - - // if ambiguous, we can possibly resolve the ambiguity now - // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. - if (isEligible && !isHelper) { - var _name2 = sexpr.path.parts[0], - options = this.options; - - if (options.knownHelpers[_name2]) { - isHelper = true; - } else if (options.knownHelpersOnly) { - isEligible = false; - } + // Marks the node to the left of the position as omitted. + // I.e. ' '{{foo}} will mark the ' ' node as omitted. + // + // If i is undefined then the last child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitLeft(statements, i, multiple) { + var current = statements[i == null ? statements.length - 1 : i - 1]; + if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) { + return; } - if (isHelper) { - return 'helper'; - } else if (isEligible) { - return 'ambiguous'; - } else { - return 'simple'; - } - }, + // We omit the last node if it's whitespace only and not preceeded by a non-content node. + var original = current.string; + current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); + current.leftStripped = current.string !== original; + return current.leftStripped; + } + }); +define( + 'handlebars/compiler/base',["./parser","./ast","./helpers","../utils","exports"], + function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) { + + var parser = __dependency1__["default"]; + var AST = __dependency2__["default"]; + var Helpers = __dependency3__; + var extend = __dependency4__.extend; - pushParams: function pushParams(params) { - for (var i = 0, l = params.length; i < l; i++) { - this.pushParam(params[i]); - } - }, + __exports__.parser = parser; - pushParam: function pushParam(val) { - var value = val.value != null ? val.value : val.original || ''; + var yy = {}; + extend(yy, Helpers, AST); - if (this.stringParams) { - if (value.replace) { - value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); + function parse(input) { + // Just return if an already-compile AST was passed in. + if (input.constructor === AST.ProgramNode) { return input; } + + parser.yy = yy; + + return parser.parse(input); + } + + __exports__.parse = parse; + }); +define( + 'handlebars/compiler/compiler',["../exception","../utils","exports"], + function(__dependency1__, __dependency2__, __exports__) { + + var Exception = __dependency1__["default"]; + var isArray = __dependency2__.isArray; + + var slice = [].slice; + + function Compiler() {} + + __exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a + // function in a context. This is necessary for mustache compatibility, which + // requires that context functions in blocks are evaluated by blockHelperMissing, + // and then proceed as if the resulting value was provided to blockHelperMissing. + + Compiler.prototype = { + compiler: Compiler, + + equals: function(other) { + var len = this.opcodes.length; + if (other.opcodes.length !== len) { + return false; } - if (val.depth) { - this.addDepth(val.depth); + for (var i = 0; i < len; i++) { + var opcode = this.opcodes[i], + otherOpcode = other.opcodes[i]; + if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { + return false; + } } - this.opcode('getContext', val.depth || 0); - this.opcode('pushStringParam', value, val.type); - if (val.type === 'SubExpression') { - // SubExpressions get evaluated and passed in - // in string params mode. + // We know that length is the same between the two arrays because they are directly tied + // to the opcode behavior above. + len = this.children.length; + for (i = 0; i < len; i++) { + if (!this.children[i].equals(other.children[i])) { + return false; + } + } + + return true; + }, + + guid: 0, + + compile: function(program, options) { + this.opcodes = []; + this.children = []; + this.depths = {list: []}; + this.options = options; + this.stringParams = options.stringParams; + this.trackIds = options.trackIds; + + // These changes will propagate to the other compiler components + var knownHelpers = this.options.knownHelpers; + this.options.knownHelpers = { + 'helperMissing': true, + 'blockHelperMissing': true, + 'each': true, + 'if': true, + 'unless': true, + 'with': true, + 'log': true, + 'lookup': true + }; + if (knownHelpers) { + for (var name in knownHelpers) { + this.options.knownHelpers[name] = knownHelpers[name]; + } + } + + return this.accept(program); + }, + + accept: function(node) { + return this[node.type](node); + }, + + program: function(program) { + var statements = program.statements; + + for(var i=0, l=statements.length; i= 0) { - return [depth, param]; - } - } - } - }; - - function precompile(input, options, env) { - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); - } - - options = options || {}; - if (!('data' in options)) { - options.data = true; - } - if (options.compat) { - options.useDepths = true; - } - - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options); - return new env.JavaScriptCompiler().compile(environment, options); - } - - function compile(input, _x, env) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); - } - - if (!('data' in options)) { - options.data = true; - } - if (options.compat) { - options.useDepths = true; - } - - var compiled = undefined; - - function compileInput() { - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options), - templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); - return env.template(templateSpec); - } - - // Template is only compiled on first use and cached after that point. - function ret(context, execOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled.call(this, context, execOptions); - } - ret._setup = function (setupOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._setup(setupOptions); - }; - ret._child = function (i, data, blockParams, depths) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._child(i, data, blockParams, depths); - }; - return ret; - } - - function argEquals(a, b) { - if (a === b) { - return true; - } - - if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { - for (var i = 0; i < a.length; i++) { - if (!argEquals(a[i], b[i])) { - return false; - } - } - return true; - } - } - - function transformLiteralToPath(sexpr) { - if (!sexpr.path.parts) { - var literal = sexpr.path; - // Casting to string here to make false and 0 literal values play nicely with the rest - // of the system. - sexpr.path = new _AST.PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); - } - } -}); -define('handlebars/compiler/code-gen',['exports', 'module', '../utils'], function (exports, module, _utils) { - - - var SourceNode = undefined; - - try { - /* istanbul ignore next */ - if (typeof define !== 'function' || !define.amd) { - // We don't support this in AMD environments. For these environments, we asusme that - // they are running on the browser and thus have no need for the source-map library. - var SourceMap = require('source-map'); - SourceNode = SourceMap.SourceNode; - } - } catch (err) {} - - /* istanbul ignore if: tested but not covered in istanbul due to dist build */ - if (!SourceNode) { - SourceNode = function (line, column, srcFile, chunks) { - this.src = ''; - if (chunks) { - this.add(chunks); - } - }; - /* istanbul ignore next */ - SourceNode.prototype = { - add: function add(chunks) { - if (_utils.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src += chunks; }, - prepend: function prepend(chunks) { - if (_utils.isArray(chunks)) { - chunks = chunks.join(''); + + setupFullMustacheParams: function(sexpr, program, inverse) { + var params = sexpr.params; + this.pushParams(params); + + this.opcode('pushProgram', program); + this.opcode('pushProgram', inverse); + + if (sexpr.hash) { + this.hash(sexpr.hash); + } else { + this.opcode('emptyHash'); } - this.src = chunks + this.src; - }, - toStringWithSourceMap: function toStringWithSourceMap() { - return { code: this.toString() }; - }, - toString: function toString() { - return this.src; + + return params; } }; - } - function castChunk(chunk, codeGen, loc) { - if (_utils.isArray(chunk)) { - var ret = []; - - for (var i = 0, len = chunk.length; i < len; i++) { - ret.push(codeGen.wrap(chunk[i], loc)); + function precompile(input, options, env) { + if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) { + throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input); } - return ret; - } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { - // Handle primitives that the SourceNode will throw up on - return chunk + ''; + + options = options || {}; + if (!('data' in options)) { + options.data = true; + } + if (options.compat) { + options.useDepths = true; + } + + var ast = env.parse(input); + var environment = new env.Compiler().compile(ast, options); + return new env.JavaScriptCompiler().compile(environment, options); } - return chunk; - } - function CodeGen(srcFile) { - this.srcFile = srcFile; - this.source = []; - } - - CodeGen.prototype = { - prepend: function prepend(source, loc) { - this.source.unshift(this.wrap(source, loc)); - }, - push: function push(source, loc) { - this.source.push(this.wrap(source, loc)); - }, - - merge: function merge() { - var source = this.empty(); - this.each(function (line) { - source.add([' ', line, '\n']); - }); - return source; - }, - - each: function each(iter) { - for (var i = 0, len = this.source.length; i < len; i++) { - iter(this.source[i]); - } - }, - - empty: function empty() { - var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile); - }, - wrap: function wrap(chunk) { - var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; - - if (chunk instanceof SourceNode) { - return chunk; + __exports__.precompile = precompile;function compile(input, options, env) { + if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) { + throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input); } - chunk = castChunk(chunk, this, loc); + options = options || {}; - return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); - }, + if (!('data' in options)) { + options.data = true; + } + if (options.compat) { + options.useDepths = true; + } - functionCall: function functionCall(fn, type, params) { - params = this.generateList(params); - return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); - }, + var compiled; - quotedString: function quotedString(str) { - return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 - .replace(/\u2029/g, '\\u2029') + '"'; - }, + function compileInput() { + var ast = env.parse(input); + var environment = new env.Compiler().compile(ast, options); + var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); + return env.template(templateSpec); + } - objectLiteral: function objectLiteral(obj) { - var pairs = []; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - var value = castChunk(obj[key], this); - if (value !== 'undefined') { - pairs.push([this.quotedString(key), ':', value]); - } + // Template is only compiled on first use and cached after that point. + var ret = function(context, options) { + if (!compiled) { + compiled = compileInput(); } - } - - var ret = this.generateList(pairs); - ret.prepend('{'); - ret.add('}'); - return ret; - }, - - generateList: function generateList(entries, loc) { - var ret = this.empty(loc); - - for (var i = 0, len = entries.length; i < len; i++) { - if (i) { - ret.add(','); - } - - ret.add(castChunk(entries[i], this, loc)); - } - - return ret; - }, - - generateArray: function generateArray(entries, loc) { - var ret = this.generateList(entries, loc); - ret.prepend('['); - ret.add(']'); - - return ret; - } - }; - - module.exports = CodeGen; -}); -/*global define */ - -/* NOP */; -define('handlebars/compiler/javascript-compiler',['exports', 'module', '../base', '../exception', '../utils', './code-gen'], function (exports, module, _base, _exception, _utils, _codeGen) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - var _Exception = _interopRequire(_exception); - - var _CodeGen = _interopRequire(_codeGen); - - function Literal(value) { - this.value = value; - } - - function JavaScriptCompiler() {} - - JavaScriptCompiler.prototype = { - // PUBLIC API: You can override these methods in a subclass to provide - // alternative compiled forms for name lookup and buffering semantics - nameLookup: function nameLookup(parent, name /* , type*/) { - if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { - return [parent, '.', name]; - } else { - return [parent, '[\'', name, '\']']; - } - }, - depthedLookup: function depthedLookup(name) { - return [this.aliasable('this.lookup'), '(depths, "', name, '")']; - }, - - compilerInfo: function compilerInfo() { - var revision = _base.COMPILER_REVISION, - versions = _base.REVISION_CHANGES[revision]; - return [revision, versions]; - }, - - appendToBuffer: function appendToBuffer(source, location, explicit) { - // Force a source as this simplifies the merge logic. - if (!_utils.isArray(source)) { - source = [source]; - } - source = this.source.wrap(source, location); - - if (this.environment.isSimple) { - return ['return ', source, ';']; - } else if (explicit) { - // This is a case where the buffer operation occurs as a child of another - // construct, generally braces. We have to explicitly output these buffer - // operations to ensure that the emitted code goes in the correct location. - return ['buffer += ', source, ';']; - } else { - source.appendToBuffer = true; - return source; - } - }, - - initializeBuffer: function initializeBuffer() { - return this.quotedString(''); - }, - // END PUBLIC API - - compile: function compile(environment, options, context, asObject) { - this.environment = environment; - this.options = options; - this.stringParams = this.options.stringParams; - this.trackIds = this.options.trackIds; - this.precompile = !asObject; - - this.name = this.environment.name; - this.isChild = !!context; - this.context = context || { - programs: [], - environments: [] + return compiled.call(this, context, options); }; + ret._setup = function(options) { + if (!compiled) { + compiled = compileInput(); + } + return compiled._setup(options); + }; + ret._child = function(i, data, depths) { + if (!compiled) { + compiled = compileInput(); + } + return compiled._child(i, data, depths); + }; + return ret; + } - this.preamble(); - - this.stackSlot = 0; - this.stackVars = []; - this.aliases = {}; - this.registers = { list: [] }; - this.hashes = []; - this.compileStack = []; - this.inlineStack = []; - this.blockParams = []; - - this.compileChildren(environment, options); - - this.useDepths = this.useDepths || environment.useDepths || this.options.compat; - this.useBlockParams = this.useBlockParams || environment.useBlockParams; - - var opcodes = environment.opcodes, - opcode = undefined, - firstLoc = undefined, - i = undefined, - l = undefined; - - for (i = 0, l = opcodes.length; i < l; i++) { - opcode = opcodes[i]; - - this.source.currentLocation = opcode.loc; - firstLoc = firstLoc || opcode.loc; - this[opcode.opcode].apply(this, opcode.args); + __exports__.compile = compile;function argEquals(a, b) { + if (a === b) { + return true; } - // Flush any trailing content that might be pending. - this.source.currentLocation = firstLoc; - this.pushSource(''); - - /* istanbul ignore next */ - if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { - throw new _Exception('Compile completed with content left on stack'); + if (isArray(a) && isArray(b) && a.length === b.length) { + for (var i = 0; i < a.length; i++) { + if (!argEquals(a[i], b[i])) { + return false; + } + } + return true; } + } + }); +define( + 'handlebars/compiler/javascript-compiler',["../base","../exception","exports"], + function(__dependency1__, __dependency2__, __exports__) { + + var COMPILER_REVISION = __dependency1__.COMPILER_REVISION; + var REVISION_CHANGES = __dependency1__.REVISION_CHANGES; + var Exception = __dependency2__["default"]; - var fn = this.createFunctionContext(asObject); - if (!this.isChild) { - var ret = { - compiler: this.compilerInfo(), - main: fn - }; - var programs = this.context.programs; - for (i = 0, l = programs.length; i < l; i++) { - if (programs[i]) { - ret[i] = programs[i]; - } - } + function Literal(value) { + this.value = value; + } - if (this.environment.usePartial) { - ret.usePartial = true; - } - if (this.options.data) { - ret.useData = true; - } - if (this.useDepths) { - ret.useDepths = true; - } - if (this.useBlockParams) { - ret.useBlockParams = true; - } - if (this.options.compat) { - ret.compat = true; - } + function JavaScriptCompiler() {} - if (!asObject) { - ret.compiler = JSON.stringify(ret.compiler); - - this.source.currentLocation = { start: { line: 1, column: 0 } }; - ret = this.objectLiteral(ret); - - if (options.srcName) { - ret = ret.toStringWithSourceMap({ file: options.destName }); - ret.map = ret.map && ret.map.toString(); - } else { - ret = ret.toString(); - } + JavaScriptCompiler.prototype = { + // PUBLIC API: You can override these methods in a subclass to provide + // alternative compiled forms for name lookup and buffering semantics + nameLookup: function(parent, name /* , type*/) { + if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { + return parent + "." + name; } else { - ret.compilerOptions = this.options; + return parent + "['" + name + "']"; } + }, + depthedLookup: function(name) { + this.aliases.lookup = 'this.lookup'; - return ret; - } else { - return fn; - } - }, + return 'lookup(depths, "' + name + '")'; + }, - preamble: function preamble() { - // track the last context pushed into place to allow skipping the - // getContext opcode when it would be a noop - this.lastContext = 0; - this.source = new _CodeGen(this.options.srcName); - }, + compilerInfo: function() { + var revision = COMPILER_REVISION, + versions = REVISION_CHANGES[revision]; + return [revision, versions]; + }, - createFunctionContext: function createFunctionContext(asObject) { - var varDeclarations = ''; - - var locals = this.stackVars.concat(this.registers.list); - if (locals.length > 0) { - varDeclarations += ', ' + locals.join(', '); - } - - // Generate minimizer alias mappings - // - // When using true SourceNodes, this will update all references to the given alias - // as the source nodes are reused in situ. For the non-source node compilation mode, - // aliases will not be used, but this case is already being run on the client and - // we aren't concern about minimizing the template size. - var aliasCount = 0; - for (var alias in this.aliases) { - // eslint-disable-line guard-for-in - var node = this.aliases[alias]; - - if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { - varDeclarations += ', alias' + ++aliasCount + '=' + alias; - node.children[0] = 'alias' + aliasCount; - } - } - - var params = ['depth0', 'helpers', 'partials', 'data']; - - if (this.useBlockParams || this.useDepths) { - params.push('blockParams'); - } - if (this.useDepths) { - params.push('depths'); - } - - // Perform a second pass over the output to merge content when possible - var source = this.mergeSource(varDeclarations); - - if (asObject) { - params.push(source); - - return Function.apply(this, params); - } else { - return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); - } - }, - mergeSource: function mergeSource(varDeclarations) { - var isSimple = this.environment.isSimple, - appendOnly = !this.forceBuffer, - appendFirst = undefined, - sourceSeen = undefined, - bufferStart = undefined, - bufferEnd = undefined; - this.source.each(function (line) { - if (line.appendToBuffer) { - if (bufferStart) { - line.prepend(' + '); - } else { - bufferStart = line; - } - bufferEnd = line; - } else { - if (bufferStart) { - if (!sourceSeen) { - appendFirst = true; - } else { - bufferStart.prepend('buffer += '); - } - bufferEnd.add(';'); - bufferStart = bufferEnd = undefined; - } - - sourceSeen = true; - if (!isSimple) { - appendOnly = false; - } - } - }); - - if (appendOnly) { - if (bufferStart) { - bufferStart.prepend('return '); - bufferEnd.add(';'); - } else if (!sourceSeen) { - this.source.push('return "";'); - } - } else { - varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); - - if (bufferStart) { - bufferStart.prepend('return buffer + '); - bufferEnd.add(';'); - } else { - this.source.push('return buffer;'); - } - } - - if (varDeclarations) { - this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); - } - - return this.source.merge(); - }, - - // [blockValue] - // - // On stack, before: hash, inverse, program, value - // On stack, after: return value of blockHelperMissing - // - // The purpose of this opcode is to take a block of the form - // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and - // replace it on the stack with the result of properly - // invoking blockHelperMissing. - blockValue: function blockValue(name) { - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs(name, 0, params); - - var blockName = this.popStack(); - params.splice(1, 0, blockName); - - this.push(this.source.functionCall(blockHelperMissing, 'call', params)); - }, - - // [ambiguousBlockValue] - // - // On stack, before: hash, inverse, program, value - // Compiler value, before: lastHelper=value of last found helper, if any - // On stack, after, if no lastHelper: same as [blockValue] - // On stack, after, if lastHelper: value - ambiguousBlockValue: function ambiguousBlockValue() { - // We're being a bit cheeky and reusing the options value from the prior exec - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs('', 0, params, true); - - this.flushInline(); - - var current = this.topStack(); - params.splice(1, 0, current); - - this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); - }, - - // [appendContent] - // - // On stack, before: ... - // On stack, after: ... - // - // Appends the string value of `content` to the current buffer - appendContent: function appendContent(content) { - if (this.pendingContent) { - content = this.pendingContent + content; - } else { - this.pendingLocation = this.source.currentLocation; - } - - this.pendingContent = content; - }, - - // [append] - // - // On stack, before: value, ... - // On stack, after: ... - // - // Coerces `value` to a String and appends it to the current buffer. - // - // If `value` is truthy, or 0, it is coerced into a string and appended - // Otherwise, the empty string is appended - append: function append() { - if (this.isInline()) { - this.replaceStack(function (current) { - return [' != null ? ', current, ' : ""']; - }); - - this.pushSource(this.appendToBuffer(this.popStack())); - } else { - var local = this.popStack(); - this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); + appendToBuffer: function(string) { if (this.environment.isSimple) { - this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']); + return "return " + string + ";"; + } else { + return { + appendToBuffer: true, + content: string, + toString: function() { return "buffer += " + string + ";"; } + }; } - } - }, + }, - // [appendEscaped] - // - // On stack, before: value, ... - // On stack, after: ... - // - // Escape `value` and append it to the buffer - appendEscaped: function appendEscaped() { - this.pushSource(this.appendToBuffer([this.aliasable('this.escapeExpression'), '(', this.popStack(), ')'])); - }, + initializeBuffer: function() { + return this.quotedString(""); + }, - // [getContext] - // - // On stack, before: ... - // On stack, after: ... - // Compiler value, after: lastContext=depth - // - // Set the value of the `lastContext` compiler value to the depth - getContext: function getContext(depth) { - this.lastContext = depth; - }, + namespace: "Handlebars", + // END PUBLIC API - // [pushContext] - // - // On stack, before: ... - // On stack, after: currentContext, ... - // - // Pushes the value of the current context onto the stack. - pushContext: function pushContext() { - this.pushStackLiteral(this.contextName(this.lastContext)); - }, + compile: function(environment, options, context, asObject) { + this.environment = environment; + this.options = options; + this.stringParams = this.options.stringParams; + this.trackIds = this.options.trackIds; + this.precompile = !asObject; - // [lookupOnContext] - // - // On stack, before: ... - // On stack, after: currentContext[name], ... - // - // Looks up the value of `name` on the current context and pushes - // it onto the stack. - lookupOnContext: function lookupOnContext(parts, falsy, scoped) { - var i = 0; + this.name = this.environment.name; + this.isChild = !!context; + this.context = context || { + programs: [], + environments: [] + }; - if (!scoped && this.options.compat && !this.lastContext) { - // The depthed query is expected to handle the undefined logic for the root level that - // is implemented below, so we evaluate that directly in compat mode - this.push(this.depthedLookup(parts[i++])); - } else { - this.pushContext(); - } + this.preamble(); - this.resolvePath('context', parts, i, falsy); - }, + this.stackSlot = 0; + this.stackVars = []; + this.aliases = {}; + this.registers = { list: [] }; + this.hashes = []; + this.compileStack = []; + this.inlineStack = []; - // [lookupBlockParam] - // - // On stack, before: ... - // On stack, after: blockParam[name], ... - // - // Looks up the value of `parts` on the given block param and pushes - // it onto the stack. - lookupBlockParam: function lookupBlockParam(blockParamId, parts) { - this.useBlockParams = true; + this.compileChildren(environment, options); - this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); - this.resolvePath('context', parts, 1); - }, + this.useDepths = this.useDepths || environment.depths.list.length || this.options.compat; - // [lookupData] - // - // On stack, before: ... - // On stack, after: data, ... - // - // Push the data lookup operator - lookupData: function lookupData(depth, parts) { - if (!depth) { - this.pushStackLiteral('data'); - } else { - this.pushStackLiteral('this.data(data, ' + depth + ')'); - } + var opcodes = environment.opcodes, + opcode, + i, + l; - this.resolvePath('data', parts, 0, true); - }, + for (i = 0, l = opcodes.length; i < l; i++) { + opcode = opcodes[i]; - resolvePath: function resolvePath(type, parts, i, falsy) { - var _this = this; + this[opcode.opcode].apply(this, opcode.args); + } - if (this.options.strict || this.options.assumeObjects) { - this.push(strictLookup(this.options.strict, this, parts, type)); - return; - } + // Flush any trailing content that might be pending. + this.pushSource(''); - var len = parts.length; - for (; i < len; i++) { - /*eslint-disable no-loop-func */ - this.replaceStack(function (current) { - var lookup = _this.nameLookup(current, parts[i], type); - // We want to ensure that zero and false are handled properly if the context (falsy flag) - // needs to have the special handling for these values. - if (!falsy) { - return [' != null ? ', lookup, ' : ', current]; + /* istanbul ignore next */ + if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { + throw new Exception('Compile completed with content left on stack'); + } + + var fn = this.createFunctionContext(asObject); + if (!this.isChild) { + var ret = { + compiler: this.compilerInfo(), + main: fn + }; + var programs = this.context.programs; + for (i = 0, l = programs.length; i < l; i++) { + if (programs[i]) { + ret[i] = programs[i]; + } + } + + if (this.environment.usePartial) { + ret.usePartial = true; + } + if (this.options.data) { + ret.useData = true; + } + if (this.useDepths) { + ret.useDepths = true; + } + if (this.options.compat) { + ret.compat = true; + } + + if (!asObject) { + ret.compiler = JSON.stringify(ret.compiler); + ret = this.objectLiteral(ret); + } + + return ret; + } else { + return fn; + } + }, + + preamble: function() { + // track the last context pushed into place to allow skipping the + // getContext opcode when it would be a noop + this.lastContext = 0; + this.source = []; + }, + + createFunctionContext: function(asObject) { + var varDeclarations = ''; + + var locals = this.stackVars.concat(this.registers.list); + if(locals.length > 0) { + varDeclarations += ", " + locals.join(", "); + } + + // Generate minimizer alias mappings + for (var alias in this.aliases) { + if (this.aliases.hasOwnProperty(alias)) { + varDeclarations += ', ' + alias + '=' + this.aliases[alias]; + } + } + + var params = ["depth0", "helpers", "partials", "data"]; + + if (this.useDepths) { + params.push('depths'); + } + + // Perform a second pass over the output to merge content when possible + var source = this.mergeSource(varDeclarations); + + if (asObject) { + params.push(source); + + return Function.apply(this, params); + } else { + return 'function(' + params.join(',') + ') {\n ' + source + '}'; + } + }, + mergeSource: function(varDeclarations) { + var source = '', + buffer, + appendOnly = !this.forceBuffer, + appendFirst; + + for (var i = 0, len = this.source.length; i < len; i++) { + var line = this.source[i]; + if (line.appendToBuffer) { + if (buffer) { + buffer = buffer + '\n + ' + line.content; + } else { + buffer = line.content; + } } else { - // Otherwise we can use generic falsy handling - return [' && ', lookup]; + if (buffer) { + if (!source) { + appendFirst = true; + source = buffer + ';\n '; + } else { + source += 'buffer += ' + buffer + ';\n '; + } + buffer = undefined; + } + source += line + '\n '; + + if (!this.environment.isSimple) { + appendOnly = false; + } } - }); - /*eslint-enable no-loop-func */ - } - }, - - // [resolvePossibleLambda] - // - // On stack, before: value, ... - // On stack, after: resolved value, ... - // - // If the `value` is a lambda, replace it on the stack by - // the return value of the lambda - resolvePossibleLambda: function resolvePossibleLambda() { - this.push([this.aliasable('this.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); - }, - - // [pushStringParam] - // - // On stack, before: ... - // On stack, after: string, currentContext, ... - // - // This opcode is designed for use in string mode, which - // provides the string value of a parameter along with its - // depth rather than resolving it immediately. - pushStringParam: function pushStringParam(string, type) { - this.pushContext(); - this.pushString(type); - - // If it's a subexpression, the string result - // will be pushed after this opcode. - if (type !== 'SubExpression') { - if (typeof string === 'string') { - this.pushString(string); - } else { - this.pushStackLiteral(string); } - } - }, - emptyHash: function emptyHash(omitEmpty) { - if (this.trackIds) { - this.push('{}'); // hashIds - } - if (this.stringParams) { - this.push('{}'); // hashContexts - this.push('{}'); // hashTypes - } - this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); - }, - pushHash: function pushHash() { - if (this.hash) { - this.hashes.push(this.hash); - } - this.hash = { values: [], types: [], contexts: [], ids: [] }; - }, - popHash: function popHash() { - var hash = this.hash; - this.hash = this.hashes.pop(); - - if (this.trackIds) { - this.push(this.objectLiteral(hash.ids)); - } - if (this.stringParams) { - this.push(this.objectLiteral(hash.contexts)); - this.push(this.objectLiteral(hash.types)); - } - - this.push(this.objectLiteral(hash.values)); - }, - - // [pushString] - // - // On stack, before: ... - // On stack, after: quotedString(string), ... - // - // Push a quoted version of `string` onto the stack - pushString: function pushString(string) { - this.pushStackLiteral(this.quotedString(string)); - }, - - // [pushLiteral] - // - // On stack, before: ... - // On stack, after: value, ... - // - // Pushes a value onto the stack. This operation prevents - // the compiler from creating a temporary variable to hold - // it. - pushLiteral: function pushLiteral(value) { - this.pushStackLiteral(value); - }, - - // [pushProgram] - // - // On stack, before: ... - // On stack, after: program(guid), ... - // - // Push a program expression onto the stack. This takes - // a compile-time guid and converts it into a runtime-accessible - // expression. - pushProgram: function pushProgram(guid) { - if (guid != null) { - this.pushStackLiteral(this.programExpression(guid)); - } else { - this.pushStackLiteral(null); - } - }, - - // [invokeHelper] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of helper invocation - // - // Pops off the helper's parameters, invokes the helper, - // and pushes the helper's return value onto the stack. - // - // If the helper is not found, `helperMissing` is called. - invokeHelper: function invokeHelper(paramSize, name, isSimple) { - var nonHelper = this.popStack(), - helper = this.setupHelper(paramSize, name), - simple = isSimple ? [helper.name, ' || '] : ''; - - var lookup = ['('].concat(simple, nonHelper); - if (!this.options.strict) { - lookup.push(' || ', this.aliasable('helpers.helperMissing')); - } - lookup.push(')'); - - this.push(this.source.functionCall(lookup, 'call', helper.callParams)); - }, - - // [invokeKnownHelper] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of helper invocation - // - // This operation is used when the helper is known to exist, - // so a `helperMissing` fallback is not required. - invokeKnownHelper: function invokeKnownHelper(paramSize, name) { - var helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); - }, - - // [invokeAmbiguous] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of disambiguation - // - // This operation is used when an expression like `{{foo}}` - // is provided, but we don't know at compile-time whether it - // is a helper or a path. - // - // This operation emits more code than the other options, - // and can be avoided by passing the `knownHelpers` and - // `knownHelpersOnly` flags at compile-time. - invokeAmbiguous: function invokeAmbiguous(name, helperCall) { - this.useRegister('helper'); - - var nonHelper = this.popStack(); - - this.emptyHash(); - var helper = this.setupHelper(0, name, helperCall); - - var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); - - var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; - if (!this.options.strict) { - lookup[0] = '(helper = '; - lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing')); - } - - this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); - }, - - // [invokePartial] - // - // On stack, before: context, ... - // On stack after: result of partial invocation - // - // This operation pops off a context, invokes a partial with that context, - // and pushes the result of the invocation back. - invokePartial: function invokePartial(isDynamic, name, indent) { - var params = [], - options = this.setupParams(name, 1, params, false); - - if (isDynamic) { - name = this.popStack(); - delete options.name; - } - - if (indent) { - options.indent = JSON.stringify(indent); - } - options.helpers = 'helpers'; - options.partials = 'partials'; - - if (!isDynamic) { - params.unshift(this.nameLookup('partials', name, 'partial')); - } else { - params.unshift(name); - } - - if (this.options.compat) { - options.depths = 'depths'; - } - options = this.objectLiteral(options); - params.push(options); - - this.push(this.source.functionCall('this.invokePartial', '', params)); - }, - - // [assignToHash] - // - // On stack, before: value, ..., hash, ... - // On stack, after: ..., hash, ... - // - // Pops a value off the stack and assigns it to the current hash - assignToHash: function assignToHash(key) { - var value = this.popStack(), - context = undefined, - type = undefined, - id = undefined; - - if (this.trackIds) { - id = this.popStack(); - } - if (this.stringParams) { - type = this.popStack(); - context = this.popStack(); - } - - var hash = this.hash; - if (context) { - hash.contexts[key] = context; - } - if (type) { - hash.types[key] = type; - } - if (id) { - hash.ids[key] = id; - } - hash.values[key] = value; - }, - - pushId: function pushId(type, name, child) { - if (type === 'BlockParam') { - this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); - } else if (type === 'PathExpression') { - this.pushString(name); - } else if (type === 'SubExpression') { - this.pushStackLiteral('true'); - } else { - this.pushStackLiteral('null'); - } - }, - - // HELPERS - - compiler: JavaScriptCompiler, - - compileChildren: function compileChildren(environment, options) { - var children = environment.children, - child = undefined, - compiler = undefined; - - for (var i = 0, l = children.length; i < l; i++) { - child = children[i]; - compiler = new this.compiler(); // eslint-disable-line new-cap - - var index = this.matchExistingProgram(child); - - if (index == null) { - this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children - index = this.context.programs.length; - child.index = index; - child.name = 'program' + index; - this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); - this.context.environments[index] = child; - - this.useDepths = this.useDepths || compiler.useDepths; - this.useBlockParams = this.useBlockParams || compiler.useBlockParams; - } else { - child.index = index; - child.name = 'program' + index; - - this.useDepths = this.useDepths || child.useDepths; - this.useBlockParams = this.useBlockParams || child.useBlockParams; - } - } - }, - matchExistingProgram: function matchExistingProgram(child) { - for (var i = 0, len = this.context.environments.length; i < len; i++) { - var environment = this.context.environments[i]; - if (environment && environment.equals(child)) { - return i; - } - } - }, - - programExpression: function programExpression(guid) { - var child = this.environment.children[guid], - programParams = [child.index, 'data', child.blockParams]; - - if (this.useBlockParams || this.useDepths) { - programParams.push('blockParams'); - } - if (this.useDepths) { - programParams.push('depths'); - } - - return 'this.program(' + programParams.join(', ') + ')'; - }, - - useRegister: function useRegister(name) { - if (!this.registers[name]) { - this.registers[name] = true; - this.registers.list.push(name); - } - }, - - push: function push(expr) { - if (!(expr instanceof Literal)) { - expr = this.source.wrap(expr); - } - - this.inlineStack.push(expr); - return expr; - }, - - pushStackLiteral: function pushStackLiteral(item) { - this.push(new Literal(item)); - }, - - pushSource: function pushSource(source) { - if (this.pendingContent) { - this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); - this.pendingContent = undefined; - } - - if (source) { - this.source.push(source); - } - }, - - replaceStack: function replaceStack(callback) { - var prefix = ['('], - stack = undefined, - createdStack = undefined, - usedLiteral = undefined; - - /* istanbul ignore next */ - if (!this.isInline()) { - throw new _Exception('replaceStack on non-inline'); - } - - // We want to merge the inline statement into the replacement statement via ',' - var top = this.popStack(true); - - if (top instanceof Literal) { - // Literals do not need to be inlined - stack = [top.value]; - prefix = ['(', stack]; - usedLiteral = true; - } else { - // Get or create the current stack name for use by the inline - createdStack = true; - var _name = this.incrStack(); - - prefix = ['((', this.push(_name), ' = ', top, ')']; - stack = this.topStack(); - } - - var item = callback.call(this, stack); - - if (!usedLiteral) { - this.popStack(); - } - if (createdStack) { - this.stackSlot--; - } - this.push(prefix.concat(item, ')')); - }, - - incrStack: function incrStack() { - this.stackSlot++; - if (this.stackSlot > this.stackVars.length) { - this.stackVars.push('stack' + this.stackSlot); - } - return this.topStackName(); - }, - topStackName: function topStackName() { - return 'stack' + this.stackSlot; - }, - flushInline: function flushInline() { - var inlineStack = this.inlineStack; - this.inlineStack = []; - for (var i = 0, len = inlineStack.length; i < len; i++) { - var entry = inlineStack[i]; - /* istanbul ignore if */ - if (entry instanceof Literal) { - this.compileStack.push(entry); - } else { - var stack = this.incrStack(); - this.pushSource([stack, ' = ', entry, ';']); - this.compileStack.push(stack); - } - } - }, - isInline: function isInline() { - return this.inlineStack.length; - }, - - popStack: function popStack(wrapped) { - var inline = this.isInline(), - item = (inline ? this.inlineStack : this.compileStack).pop(); - - if (!wrapped && item instanceof Literal) { - return item.value; - } else { - if (!inline) { - /* istanbul ignore next */ - if (!this.stackSlot) { - throw new _Exception('Invalid stack pop'); + if (appendOnly) { + if (buffer || !source) { + source += 'return ' + (buffer || '""') + ';\n'; + } + } else { + varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer()); + if (buffer) { + source += 'return buffer + ' + buffer + ';\n'; + } else { + source += 'return buffer;\n'; } - this.stackSlot--; } - return item; - } - }, - topStack: function topStack() { - var stack = this.isInline() ? this.inlineStack : this.compileStack, - item = stack[stack.length - 1]; + if (varDeclarations) { + source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source; + } - /* istanbul ignore if */ - if (item instanceof Literal) { - return item.value; - } else { - return item; - } - }, + return source; + }, - contextName: function contextName(context) { - if (this.useDepths && context) { - return 'depths[' + context + ']'; - } else { - return 'depth' + context; - } - }, + // [blockValue] + // + // On stack, before: hash, inverse, program, value + // On stack, after: return value of blockHelperMissing + // + // The purpose of this opcode is to take a block of the form + // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and + // replace it on the stack with the result of properly + // invoking blockHelperMissing. + blockValue: function(name) { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; - quotedString: function quotedString(str) { - return this.source.quotedString(str); - }, + var params = [this.contextName(0)]; + this.setupParams(name, 0, params); - objectLiteral: function objectLiteral(obj) { - return this.source.objectLiteral(obj); - }, + var blockName = this.popStack(); + params.splice(1, 0, blockName); - aliasable: function aliasable(name) { - var ret = this.aliases[name]; - if (ret) { - ret.referenceCount++; - return ret; - } + this.push('blockHelperMissing.call(' + params.join(', ') + ')'); + }, - ret = this.aliases[name] = this.source.wrap(name); - ret.aliasable = true; - ret.referenceCount = 1; + // [ambiguousBlockValue] + // + // On stack, before: hash, inverse, program, value + // Compiler value, before: lastHelper=value of last found helper, if any + // On stack, after, if no lastHelper: same as [blockValue] + // On stack, after, if lastHelper: value + ambiguousBlockValue: function() { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; - return ret; - }, + // We're being a bit cheeky and reusing the options value from the prior exec + var params = [this.contextName(0)]; + this.setupParams('', 0, params, true); - setupHelper: function setupHelper(paramSize, name, blockHelper) { - var params = [], - paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); - var foundHelper = this.nameLookup('helpers', name, 'helper'); + this.flushInline(); - return { - params: params, - paramsInit: paramsInit, - name: foundHelper, - callParams: [this.contextName(0)].concat(params) - }; - }, + var current = this.topStack(); + params.splice(1, 0, current); - setupParams: function setupParams(helper, paramSize, params) { - var options = {}, - contexts = [], - types = [], - ids = [], - param = undefined; + this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }"); + }, - options.name = this.quotedString(helper); - options.hash = this.popStack(); + // [appendContent] + // + // On stack, before: ... + // On stack, after: ... + // + // Appends the string value of `content` to the current buffer + appendContent: function(content) { + if (this.pendingContent) { + content = this.pendingContent + content; + } - if (this.trackIds) { - options.hashIds = this.popStack(); - } - if (this.stringParams) { - options.hashTypes = this.popStack(); - options.hashContexts = this.popStack(); - } + this.pendingContent = content; + }, - var inverse = this.popStack(), - program = this.popStack(); + // [append] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Coerces `value` to a String and appends it to the current buffer. + // + // If `value` is truthy, or 0, it is coerced into a string and appended + // Otherwise, the empty string is appended + append: function() { + // Force anything that is inlined onto the stack so we don't have duplication + // when we examine local + this.flushInline(); + var local = this.popStack(); + this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }'); + if (this.environment.isSimple) { + this.pushSource("else { " + this.appendToBuffer("''") + " }"); + } + }, - // Avoid setting fn and inverse if neither are set. This allows - // helpers to do a check for `if (options.fn)` - if (program || inverse) { - options.fn = program || 'this.noop'; - options.inverse = inverse || 'this.noop'; - } + // [appendEscaped] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Escape `value` and append it to the buffer + appendEscaped: function() { + this.aliases.escapeExpression = 'this.escapeExpression'; - // The parameters go on to the stack in order (making sure that they are evaluated in order) - // so we need to pop them off the stack in reverse order - var i = paramSize; - while (i--) { - param = this.popStack(); - params[i] = param; + this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")); + }, + + // [getContext] + // + // On stack, before: ... + // On stack, after: ... + // Compiler value, after: lastContext=depth + // + // Set the value of the `lastContext` compiler value to the depth + getContext: function(depth) { + this.lastContext = depth; + }, + + // [pushContext] + // + // On stack, before: ... + // On stack, after: currentContext, ... + // + // Pushes the value of the current context onto the stack. + pushContext: function() { + this.pushStackLiteral(this.contextName(this.lastContext)); + }, + + // [lookupOnContext] + // + // On stack, before: ... + // On stack, after: currentContext[name], ... + // + // Looks up the value of `name` on the current context and pushes + // it onto the stack. + lookupOnContext: function(parts, falsy, scoped) { + /*jshint -W083 */ + var i = 0, + len = parts.length; + + if (!scoped && this.options.compat && !this.lastContext) { + // The depthed query is expected to handle the undefined logic for the root level that + // is implemented below, so we evaluate that directly in compat mode + this.push(this.depthedLookup(parts[i++])); + } else { + this.pushContext(); + } + + for (; i < len; i++) { + this.replaceStack(function(current) { + var lookup = this.nameLookup(current, parts[i], 'context'); + // We want to ensure that zero and false are handled properly if the context (falsy flag) + // needs to have the special handling for these values. + if (!falsy) { + return ' != null ? ' + lookup + ' : ' + current; + } else { + // Otherwise we can use generic falsy handling + return ' && ' + lookup; + } + }); + } + }, + + // [lookupData] + // + // On stack, before: ... + // On stack, after: data, ... + // + // Push the data lookup operator + lookupData: function(depth, parts) { + /*jshint -W083 */ + if (!depth) { + this.pushStackLiteral('data'); + } else { + this.pushStackLiteral('this.data(data, ' + depth + ')'); + } + + var len = parts.length; + for (var i = 0; i < len; i++) { + this.replaceStack(function(current) { + return ' && ' + this.nameLookup(current, parts[i], 'data'); + }); + } + }, + + // [resolvePossibleLambda] + // + // On stack, before: value, ... + // On stack, after: resolved value, ... + // + // If the `value` is a lambda, replace it on the stack by + // the return value of the lambda + resolvePossibleLambda: function() { + this.aliases.lambda = 'this.lambda'; + + this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')'); + }, + + // [pushStringParam] + // + // On stack, before: ... + // On stack, after: string, currentContext, ... + // + // This opcode is designed for use in string mode, which + // provides the string value of a parameter along with its + // depth rather than resolving it immediately. + pushStringParam: function(string, type) { + this.pushContext(); + this.pushString(type); + + // If it's a subexpression, the string result + // will be pushed after this opcode. + if (type !== 'sexpr') { + if (typeof string === 'string') { + this.pushString(string); + } else { + this.pushStackLiteral(string); + } + } + }, + + emptyHash: function() { + this.pushStackLiteral('{}'); if (this.trackIds) { - ids[i] = this.popStack(); + this.push('{}'); // hashIds } if (this.stringParams) { - types[i] = this.popStack(); - contexts[i] = this.popStack(); + this.push('{}'); // hashContexts + this.push('{}'); // hashTypes + } + }, + pushHash: function() { + if (this.hash) { + this.hashes.push(this.hash); + } + this.hash = {values: [], types: [], contexts: [], ids: []}; + }, + popHash: function() { + var hash = this.hash; + this.hash = this.hashes.pop(); + + if (this.trackIds) { + this.push('{' + hash.ids.join(',') + '}'); + } + if (this.stringParams) { + this.push('{' + hash.contexts.join(',') + '}'); + this.push('{' + hash.types.join(',') + '}'); + } + + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); + }, + + // [pushString] + // + // On stack, before: ... + // On stack, after: quotedString(string), ... + // + // Push a quoted version of `string` onto the stack + pushString: function(string) { + this.pushStackLiteral(this.quotedString(string)); + }, + + // [push] + // + // On stack, before: ... + // On stack, after: expr, ... + // + // Push an expression onto the stack + push: function(expr) { + this.inlineStack.push(expr); + return expr; + }, + + // [pushLiteral] + // + // On stack, before: ... + // On stack, after: value, ... + // + // Pushes a value onto the stack. This operation prevents + // the compiler from creating a temporary variable to hold + // it. + pushLiteral: function(value) { + this.pushStackLiteral(value); + }, + + // [pushProgram] + // + // On stack, before: ... + // On stack, after: program(guid), ... + // + // Push a program expression onto the stack. This takes + // a compile-time guid and converts it into a runtime-accessible + // expression. + pushProgram: function(guid) { + if (guid != null) { + this.pushStackLiteral(this.programExpression(guid)); + } else { + this.pushStackLiteral(null); + } + }, + + // [invokeHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // Pops off the helper's parameters, invokes the helper, + // and pushes the helper's return value onto the stack. + // + // If the helper is not found, `helperMissing` is called. + invokeHelper: function(paramSize, name, isSimple) { + this.aliases.helperMissing = 'helpers.helperMissing'; + + var nonHelper = this.popStack(); + var helper = this.setupHelper(paramSize, name); + + var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing'; + this.push('((' + lookup + ').call(' + helper.callParams + '))'); + }, + + // [invokeKnownHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // This operation is used when the helper is known to exist, + // so a `helperMissing` fallback is not required. + invokeKnownHelper: function(paramSize, name) { + var helper = this.setupHelper(paramSize, name); + this.push(helper.name + ".call(" + helper.callParams + ")"); + }, + + // [invokeAmbiguous] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of disambiguation + // + // This operation is used when an expression like `{{foo}}` + // is provided, but we don't know at compile-time whether it + // is a helper or a path. + // + // This operation emits more code than the other options, + // and can be avoided by passing the `knownHelpers` and + // `knownHelpersOnly` flags at compile-time. + invokeAmbiguous: function(name, helperCall) { + this.aliases.functionType = '"function"'; + this.aliases.helperMissing = 'helpers.helperMissing'; + this.useRegister('helper'); + + var nonHelper = this.popStack(); + + this.emptyHash(); + var helper = this.setupHelper(0, name, helperCall); + + var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); + + this.push( + '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing' + + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),' + + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))'); + }, + + // [invokePartial] + // + // On stack, before: context, ... + // On stack after: result of partial invocation + // + // This operation pops off a context, invokes a partial with that context, + // and pushes the result of the invocation back. + invokePartial: function(name, indent) { + var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"]; + + if (this.options.data) { + params.push("data"); + } else if (this.options.compat) { + params.push('undefined'); + } + if (this.options.compat) { + params.push('depths'); + } + + this.push("this.invokePartial(" + params.join(", ") + ")"); + }, + + // [assignToHash] + // + // On stack, before: value, ..., hash, ... + // On stack, after: ..., hash, ... + // + // Pops a value off the stack and assigns it to the current hash + assignToHash: function(key) { + var value = this.popStack(), + context, + type, + id; + + if (this.trackIds) { + id = this.popStack(); + } + if (this.stringParams) { + type = this.popStack(); + context = this.popStack(); + } + + var hash = this.hash; + if (context) { + hash.contexts.push("'" + key + "': " + context); + } + if (type) { + hash.types.push("'" + key + "': " + type); + } + if (id) { + hash.ids.push("'" + key + "': " + id); + } + hash.values.push("'" + key + "': (" + value + ")"); + }, + + pushId: function(type, name) { + if (type === 'ID' || type === 'DATA') { + this.pushString(name); + } else if (type === 'sexpr') { + this.pushStackLiteral('true'); + } else { + this.pushStackLiteral('null'); + } + }, + + // HELPERS + + compiler: JavaScriptCompiler, + + compileChildren: function(environment, options) { + var children = environment.children, child, compiler; + + for(var i=0, l=children.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } + return this.topStackName(); + }, + topStackName: function() { + return "stack" + this.stackSlot; + }, + flushInline: function() { + var inlineStack = this.inlineStack; + if (inlineStack.length) { + this.inlineStack = []; + for (var i = 0, len = inlineStack.length; i < len; i++) { + var entry = inlineStack[i]; + if (entry instanceof Literal) { + this.compileStack.push(entry); + } else { + this.pushStack(entry); + } + } + } + }, + isInline: function() { + return this.inlineStack.length; + }, + + popStack: function(wrapped) { + var inline = this.isInline(), + item = (inline ? this.inlineStack : this.compileStack).pop(); + + if (!wrapped && (item instanceof Literal)) { + return item.value; + } else { + if (!inline) { + /* istanbul ignore next */ + if (!this.stackSlot) { + throw new Exception('Invalid stack pop'); + } + this.stackSlot--; + } + return item; + } + }, + + topStack: function() { + var stack = (this.isInline() ? this.inlineStack : this.compileStack), + item = stack[stack.length - 1]; + + if (item instanceof Literal) { + return item.value; + } else { + return item; + } + }, + + contextName: function(context) { + if (this.useDepths && context) { + return 'depths[' + context + ']'; + } else { + return 'depth' + context; + } + }, + + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 + .replace(/\u2029/g, '\\u2029') + '"'; + }, + + objectLiteral: function(obj) { + var pairs = []; + + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + pairs.push(this.quotedString(key) + ':' + obj[key]); + } + } + + return '{' + pairs.join(',') + '}'; + }, + + setupHelper: function(paramSize, name, blockHelper) { + var params = [], + paramsInit = this.setupParams(name, paramSize, params, blockHelper); + var foundHelper = this.nameLookup('helpers', name, 'helper'); + + return { + params: params, + paramsInit: paramsInit, + name: foundHelper, + callParams: [this.contextName(0)].concat(params).join(", ") + }; + }, + + setupOptions: function(helper, paramSize, params) { + var options = {}, contexts = [], types = [], ids = [], param, inverse, program; + + options.name = this.quotedString(helper); + options.hash = this.popStack(); + + if (this.trackIds) { + options.hashIds = this.popStack(); + } + if (this.stringParams) { + options.hashTypes = this.popStack(); + options.hashContexts = this.popStack(); + } + + inverse = this.popStack(); + program = this.popStack(); + + // Avoid setting fn and inverse if neither are set. This allows + // helpers to do a check for `if (options.fn)` + if (program || inverse) { + if (!program) { + program = 'this.noop'; + } + + if (!inverse) { + inverse = 'this.noop'; + } + + options.fn = program; + options.inverse = inverse; + } + + // The parameters go on to the stack in order (making sure that they are evaluated in order) + // so we need to pop them off the stack in reverse order + var i = paramSize; + while (i--) { + param = this.popStack(); + params[i] = param; + + if (this.trackIds) { + ids[i] = this.popStack(); + } + if (this.stringParams) { + types[i] = this.popStack(); + contexts[i] = this.popStack(); + } + } + + if (this.trackIds) { + options.ids = "[" + ids.join(",") + "]"; + } + if (this.stringParams) { + options.types = "[" + types.join(",") + "]"; + options.contexts = "[" + contexts.join(",") + "]"; + } + + if (this.options.data) { + options.data = "data"; + } + + return options; + }, + + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(helperName, paramSize, params, useRegister) { + var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params)); + + if (useRegister) { + this.useRegister('options'); + params.push('options'); + return 'options=' + options; + } else { + params.push(options); + return ''; } } + }; - if (this.trackIds) { - options.ids = this.source.generateArray(ids); - } - if (this.stringParams) { - options.types = this.source.generateArray(types); - options.contexts = this.source.generateArray(contexts); - } - - if (this.options.data) { - options.data = 'data'; - } - if (this.useBlockParams) { - options.blockParams = 'blockParams'; - } - return options; - }, - - setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { - var options = this.setupParams(helper, paramSize, params, true); - options = this.objectLiteral(options); - if (useRegister) { - this.useRegister('options'); - params.push('options'); - return ['options=', options]; - } else { - params.push(options); - return ''; - } - } - }; - - (function () { - var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); + var reservedWords = ( + "break else new var" + + " case finally return void" + + " catch for switch while" + + " continue function this with" + + " default if throw" + + " delete in try" + + " do instanceof typeof" + + " abstract enum int short" + + " boolean export interface static" + + " byte extends long super" + + " char final native synchronized" + + " class float package throws" + + " const goto private transient" + + " debugger implements protected volatile" + + " double import public let yield" + ).split(" "); var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - for (var i = 0, l = reservedWords.length; i < l; i++) { + for(var i=0, l=reservedWords.length; ic;c++)if(a[c]===b)return c;return-1}function e(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return k.test(a)?a.replace(j,b):a}function f(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function g(a,b){return a.path=b,a}function h(a,b){return(a?a+".":"")+b}a.__esModule=!0,a.extend=c,a.indexOf=d,a.escapeExpression=e,a.isEmpty=f,a.blockParams=g,a.appendContextPath=h;var i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/,l=Object.prototype.toString;a.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(a.isFunction=m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;a.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};a.isArray=n}),define("handlebars/exception",["exports","module"],function(a,b){function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i0?(d.ids&&(d.ids=[d.name]),a.helpers.each(c,d)):e(this);if(d.data&&d.ids){var h=f(d.data);h.contextPath=b.appendContextPath(d.data.contextPath,d.name),d={data:h}}return g(c,d)}),a.registerHelper("each",function(a,c){function d(c,d,f){k&&(k.key=c,k.index=d,k.first=0===d,k.last=!!f,n&&(k.contextPath=n+c)),j+=e(a[c],{data:k,blockParams:b.blockParams([a[c],c],[n+c,null])})}if(!c)throw new h("Must pass iterator to #each");var e=c.fn,g=c.inverse,i=0,j="",k=void 0,n=void 0;if(c.data&&c.ids&&(n=b.appendContextPath(c.data.contextPath,c.ids[0])+"."),m(a)&&(a=a.call(this)),c.data&&(k=f(c.data)),a&&"object"==typeof a)if(l(a))for(var o=a.length;o>i;i++)d(i,i,i===a.length-1);else{var p=void 0;for(var q in a)a.hasOwnProperty(q)&&(p&&d(p,i-1),p=q,i++);p&&d(p,i-1,!0)}return 0===i&&(j=g(this)),j}),a.registerHelper("if",function(a,c){return m(a)&&(a=a.call(this)),!c.hash.includeZero&&!a||b.isEmpty(a)?c.inverse(this):c.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,c){m(a)&&(a=a.call(this));var d=c.fn;if(b.isEmpty(a))return c.inverse(this);if(c.data&&c.ids){var e=f(c.data);e.contextPath=b.appendContextPath(c.data.contextPath,c.ids[0]),c={data:e}}return d(a,c)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var c=b.extend({},a);return c._parent=a,c}var g=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.HandlebarsEnvironment=d,a.createFrame=f;var h=g(c),i="3.0.1";a.VERSION=i;var j=6;a.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};a.REVISION_CHANGES=k;var l=b.isArray,m=b.isFunction,n=b.toString,o="[object Object]";d.prototype={constructor:d,logger:p,log:q,registerHelper:function(a,c){if(n.call(a)===o){if(c)throw new h("Arg not supported with multiple helpers");b.extend(this.helpers,a)}else this.helpers[a]=c},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,c){if(n.call(a)===o)b.extend(this.partials,a);else{if("undefined"==typeof c)throw new h("Attempting to register a partial as undefined");this.partials[a]=c}},unregisterPartial:function(a){delete this.partials[a]}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(a,b){if("undefined"!=typeof console&&p.level<=a){var c=p.methodMap[a];(console[c]||console.log).call(console,b)}}};a.logger=p;var q=p.log;a.log=q}),define("handlebars/safe-string",["exports","module"],function(a,b){function c(a){this.string=a}c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b.exports=c}),define("handlebars/runtime",["exports","./utils","./exception","./base"],function(a,b,c,d){function e(a){var b=a&&a[0]||1,c=d.COMPILER_REVISION;if(b!==c){if(c>b){var e=d.REVISION_CHANGES[c],f=d.REVISION_CHANGES[b];throw new m("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+e+") or downgrade your runtime to an older version ("+f+").")}throw new m("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function f(a,c){function d(d,e,f){f.hash&&(e=b.extend({},e,f.hash)),d=c.VM.resolvePartial.call(this,d,e,f);var g=c.VM.invokePartial.call(this,d,e,f);if(null==g&&c.compile&&(f.partials[f.name]=c.compile(d,a.compilerOptions,c),g=f.partials[f.name](e,f)),null!=g){if(f.indent){for(var h=g.split("\n"),i=0,j=h.length;j>i&&(h[i]||i+1!==j);i++)h[i]=f.indent+h[i];g=h.join("\n")}return g}throw new m("The partial "+f.name+" could not be compiled when running in runtime-only mode")}function e(b){var c=void 0===arguments[1]?{}:arguments[1],d=c.data;e._setup(c),!c.partial&&a.useData&&(d=k(b,d));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(f,b,f.helpers,f.partials,d,h,g)}if(!c)throw new m("No environment passed to template");if(!a||!a.main)throw new m("Unknown template object: "+typeof a);c.VM.checkRevision(a.compiler);var f={strict:function(a,b){if(!(b in a))throw new m('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:b.escapeExpression,invokePartial:d,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var f=this.programs[a],h=this.fn(a);return b||e||d||c?f=g(this,a,h,b,c,d,e):f||(f=this.programs[a]=g(this,a,h)),f},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,c){var d=a||c;return a&&c&&a!==c&&(d=b.extend({},c,a)),d},noop:c.VM.noop,compilerInfo:a.compiler};return e.isTop=!0,e._setup=function(b){b.partial?(f.helpers=b.helpers,f.partials=b.partials):(f.helpers=f.merge(b.helpers,c.helpers),a.usePartial&&(f.partials=f.merge(b.partials,c.partials)))},e._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new m("must pass block params");if(a.useDepths&&!e)throw new m("must pass parent depths");return g(f,b,a[b],c,0,d,e)},e}function g(a,b,c,d,e,f,g){function h(b){var e=void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function h(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function i(a,b,c){if(c.partial=!0,void 0===a)throw new m("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function j(){return""}function k(a,b){return b&&"root"in b||(b=b?d.createFrame(b):{},b.root=a),b}var l=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.checkRevision=e,a.template=f,a.wrapProgram=g,a.resolvePartial=h,a.invokePartial=i,a.noop=j;var m=l(c)}),define("handlebars/no-conflict",["exports","module"],function(a,b){b.exports=function(a){var b="undefined"!=typeof global?global:window,c=b.Handlebars;a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=c)}}}),define("handlebars.runtime",["exports","module","./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","./handlebars/no-conflict"],function(a,b,c,d,e,f,g,h){function i(){var a=new c.HandlebarsEnvironment;return f.extend(a,c),a.SafeString=k,a.Exception=l,a.Utils=f,a.escapeExpression=f.escapeExpression,a.VM=g,a.template=function(b){return g.template(b,a)},a}var j=function(a){return a&&a.__esModule?a["default"]:a},k=j(d),l=j(e),m=j(h),n=i();n.create=i,m(n),n["default"]=n,b.exports=n}),define("handlebars/compiler/ast",["exports","module"],function(a,b){var c={Program:function(a,b,c,d){this.loc=d,this.type="Program",this.body=a,this.blockParams=b,this.strip=c},MustacheStatement:function(a,b,c,d,e,f){this.loc=f,this.type="MustacheStatement",this.path=a,this.params=b||[],this.hash=c,this.escaped=d,this.strip=e},BlockStatement:function(a,b,c,d,e,f,g,h,i){this.loc=i,this.type="BlockStatement",this.path=a,this.params=b||[],this.hash=c,this.program=d,this.inverse=e,this.openStrip=f,this.inverseStrip=g,this.closeStrip=h},PartialStatement:function(a,b,c,d,e){this.loc=e,this.type="PartialStatement",this.name=a,this.params=b||[],this.hash=c,this.indent="",this.strip=d},ContentStatement:function(a,b){this.loc=b,this.type="ContentStatement",this.original=this.value=a},CommentStatement:function(a,b,c){this.loc=c,this.type="CommentStatement",this.value=a,this.strip=b},SubExpression:function(a,b,c,d){this.loc=d,this.type="SubExpression",this.path=a,this.params=b||[],this.hash=c},PathExpression:function(a,b,c,d,e){this.loc=e,this.type="PathExpression",this.data=a,this.original=d,this.parts=c,this.depth=b},StringLiteral:function(a,b){this.loc=b,this.type="StringLiteral",this.original=this.value=a},NumberLiteral:function(a,b){this.loc=b,this.type="NumberLiteral",this.original=this.value=Number(a)},BooleanLiteral:function(a,b){this.loc=b,this.type="BooleanLiteral",this.original=this.value="true"===a},UndefinedLiteral:function(a){this.loc=a,this.type="UndefinedLiteral",this.original=this.value=void 0},NullLiteral:function(a){this.loc=a,this.type="NullLiteral",this.original=this.value=null},Hash:function(a,b){this.loc=b,this.type="Hash",this.pairs=a},HashPair:function(a,b,c){this.loc=c,this.type="HashPair",this.key=a,this.value=b},helpers:{helperExpression:function(a){return!("SubExpression"!==a.type&&!a.params.length&&!a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b.exports=c}),define("handlebars/compiler/parser",["exports","module"],function(a,b){var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,content:12,COMMENT:13,CONTENT:14,openRawBlock:15,END_RAW_BLOCK:16,OPEN_RAW_BLOCK:17,helperName:18,openRawBlock_repetition0:19,openRawBlock_option0:20,CLOSE_RAW_BLOCK:21,openBlock:22,block_option0:23,closeBlock:24,openInverse:25,block_option1:26,OPEN_BLOCK:27,openBlock_repetition0:28,openBlock_option0:29,openBlock_option1:30,CLOSE:31,OPEN_INVERSE:32,openInverse_repetition0:33,openInverse_option0:34,openInverse_option1:35,openInverseChain:36,OPEN_INVERSE_CHAIN:37,openInverseChain_repetition0:38,openInverseChain_option0:39,openInverseChain_option1:40,inverseAndProgram:41,INVERSE:42,inverseChain:43,inverseChain_option0:44,OPEN_ENDBLOCK:45,OPEN:46,mustache_repetition0:47,mustache_option0:48,OPEN_UNESCAPED:49,mustache_repetition1:50,mustache_option1:51,CLOSE_UNESCAPED:52,OPEN_PARTIAL:53,partialName:54,partial_repetition0:55,partial_option0:56,param:57,sexpr:58,OPEN_SEXPR:59,sexpr_repetition0:60,sexpr_option0:61,CLOSE_SEXPR:62,hash:63,hash_repetition_plus0:64,hashSegment:65,ID:66,EQUALS:67,blockParams:68,OPEN_BLOCK_PARAMS:69,blockParams_repetition_plus0:70,CLOSE_BLOCK_PARAMS:71,path:72,dataName:73,STRING:74,NUMBER:75,BOOLEAN:76,UNDEFINED:77,NULL:78,DATA:79,pathSegments:80,SEP:81,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",13:"COMMENT",14:"CONTENT",16:"END_RAW_BLOCK",17:"OPEN_RAW_BLOCK",21:"CLOSE_RAW_BLOCK",27:"OPEN_BLOCK",31:"CLOSE",32:"OPEN_INVERSE",37:"OPEN_INVERSE_CHAIN",42:"INVERSE",45:"OPEN_ENDBLOCK",46:"OPEN",49:"OPEN_UNESCAPED",52:"CLOSE_UNESCAPED",53:"OPEN_PARTIAL",59:"OPEN_SEXPR",62:"CLOSE_SEXPR",66:"ID",67:"EQUALS",69:"OPEN_BLOCK_PARAMS",71:"CLOSE_BLOCK_PARAMS",74:"STRING",75:"NUMBER",76:"BOOLEAN",77:"UNDEFINED",78:"NULL",79:"DATA",81:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[12,1],[10,3],[15,5],[9,4],[9,4],[22,6],[25,6],[36,6],[41,2],[43,3],[43,1],[24,3],[8,5],[8,5],[11,5],[57,1],[57,1],[58,5],[63,1],[65,3],[68,3],[18,1],[18,1],[18,1],[18,1],[18,1],[18,1],[18,1],[54,1],[54,1],[73,2],[72,1],[80,3],[80,1],[6,0],[6,2],[19,0],[19,2],[20,0],[20,1],[23,0],[23,1],[26,0],[26,1],[28,0],[28,2],[29,0],[29,1],[30,0],[30,1],[33,0],[33,2],[34,0],[34,1],[35,0],[35,1],[38,0],[38,2],[39,0],[39,1],[40,0],[40,1],[44,0],[44,1],[47,0],[47,2],[48,0],[48,1],[50,0],[50,2],[51,0],[51,1],[55,0],[55,2],[56,0],[56,1],[60,0],[60,2],[61,0],[61,1],[64,1],[64,2],[70,1],[70,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return f[g-1];case 2:this.$=new d.Program(f[g],null,{},d.locInfo(this._$));break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=f[g];break;case 8:this.$=new d.CommentStatement(d.stripComment(f[g]),d.stripFlags(f[g],f[g]),d.locInfo(this._$));break;case 9:this.$=new d.ContentStatement(f[g],d.locInfo(this._$));break;case 10:this.$=d.prepareRawBlock(f[g-2],f[g-1],f[g],this._$);break;case 11:this.$={path:f[g-3],params:f[g-2],hash:f[g-1]};break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 13:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 14:this.$={path:f[g-4],params:f[g-3],hash:f[g-2],blockParams:f[g-1],strip:d.stripFlags(f[g-5],f[g])};break;case 15:this.$={path:f[g-4],params:f[g-3],hash:f[g-2],blockParams:f[g-1],strip:d.stripFlags(f[g-5],f[g])};break;case 16:this.$={path:f[g-4],params:f[g-3],hash:f[g-2],blockParams:f[g-1],strip:d.stripFlags(f[g-5],f[g])};break;case 17:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 18:var h=d.prepareBlock(f[g-2],f[g-1],f[g],f[g],!1,this._$),i=new d.Program([h],null,{},d.locInfo(this._$));i.chained=!0,this.$={strip:f[g-2].strip,program:i,chain:!0};break;case 19:this.$=f[g];break;case 20:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 21:this.$=d.prepareMustache(f[g-3],f[g-2],f[g-1],f[g-4],d.stripFlags(f[g-4],f[g]),this._$);break;case 22:this.$=d.prepareMustache(f[g-3],f[g-2],f[g-1],f[g-4],d.stripFlags(f[g-4],f[g]),this._$);break;case 23:this.$=new d.PartialStatement(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),d.locInfo(this._$));break;case 24:this.$=f[g];break;case 25:this.$=f[g];break;case 26:this.$=new d.SubExpression(f[g-3],f[g-2],f[g-1],d.locInfo(this._$));break;case 27:this.$=new d.Hash(f[g],d.locInfo(this._$));break;case 28:this.$=new d.HashPair(d.id(f[g-2]),f[g],d.locInfo(this._$));break;case 29:this.$=d.id(f[g-1]);break;case 30:this.$=f[g];break;case 31:this.$=f[g];break;case 32:this.$=new d.StringLiteral(f[g],d.locInfo(this._$));break;case 33:this.$=new d.NumberLiteral(f[g],d.locInfo(this._$));break;case 34:this.$=new d.BooleanLiteral(f[g],d.locInfo(this._$));break;case 35:this.$=new d.UndefinedLiteral(d.locInfo(this._$));break;case 36:this.$=new d.NullLiteral(d.locInfo(this._$));break;case 37:this.$=f[g];break;case 38:this.$=f[g];break;case 39:this.$=d.preparePath(!0,f[g],this._$);break;case 40:this.$=d.preparePath(!1,f[g],this._$);break;case 41:f[g-2].push({part:d.id(f[g]),original:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 42:this.$=[{part:d.id(f[g]),original:f[g]}];break;case 43:this.$=[];break;case 44:f[g-1].push(f[g]);break;case 45:this.$=[];break;case 46:f[g-1].push(f[g]);break;case 53:this.$=[];break;case 54:f[g-1].push(f[g]);break;case 59:this.$=[];break;case 60:f[g-1].push(f[g]);break;case 65:this.$=[];break;case 66:f[g-1].push(f[g]);break;case 73:this.$=[];break;case 74:f[g-1].push(f[g]);break;case 77:this.$=[];break;case 78:f[g-1].push(f[g]);break;case 81:this.$=[];break;case 82:f[g-1].push(f[g]);break;case 85:this.$=[];break;case 86:f[g-1].push(f[g]);break;case 89:this.$=[f[g]];break;case 90:f[g-1].push(f[g]);break;case 91:this.$=[f[g]];break;case 92:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,43],6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],46:[2,43],49:[2,43],53:[2,43]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:[1,11],14:[1,18],15:16,17:[1,21],22:14,25:15,27:[1,19],32:[1,20],37:[2,2],42:[2,2],45:[2,2],46:[1,12],49:[1,13],53:[1,17]},{1:[2,1]},{5:[2,44],13:[2,44],14:[2,44],17:[2,44],27:[2,44],32:[2,44],37:[2,44],42:[2,44],45:[2,44],46:[2,44],49:[2,44],53:[2,44]},{5:[2,3],13:[2,3],14:[2,3],17:[2,3],27:[2,3],32:[2,3],37:[2,3],42:[2,3],45:[2,3],46:[2,3],49:[2,3],53:[2,3]},{5:[2,4],13:[2,4],14:[2,4],17:[2,4],27:[2,4],32:[2,4],37:[2,4],42:[2,4],45:[2,4],46:[2,4],49:[2,4],53:[2,4]},{5:[2,5],13:[2,5],14:[2,5],17:[2,5],27:[2,5],32:[2,5],37:[2,5],42:[2,5],45:[2,5],46:[2,5],49:[2,5],53:[2,5]},{5:[2,6],13:[2,6],14:[2,6],17:[2,6],27:[2,6],32:[2,6],37:[2,6],42:[2,6],45:[2,6],46:[2,6],49:[2,6],53:[2,6]},{5:[2,7],13:[2,7],14:[2,7],17:[2,7],27:[2,7],32:[2,7],37:[2,7],42:[2,7],45:[2,7],46:[2,7],49:[2,7],53:[2,7]},{5:[2,8],13:[2,8],14:[2,8],17:[2,8],27:[2,8],32:[2,8],37:[2,8],42:[2,8],45:[2,8],46:[2,8],49:[2,8],53:[2,8]},{18:22,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:33,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{4:34,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],37:[2,43],42:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{4:35,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],42:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{12:36,14:[1,18]},{18:38,54:37,58:39,59:[1,40],66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{5:[2,9],13:[2,9],14:[2,9],16:[2,9],17:[2,9],27:[2,9],32:[2,9],37:[2,9],42:[2,9],45:[2,9],46:[2,9],49:[2,9],53:[2,9]},{18:41,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:42,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:43,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{31:[2,73],47:44,59:[2,73],66:[2,73],74:[2,73],75:[2,73],76:[2,73],77:[2,73],78:[2,73],79:[2,73]},{21:[2,30],31:[2,30],52:[2,30],59:[2,30],62:[2,30],66:[2,30],69:[2,30],74:[2,30],75:[2,30],76:[2,30],77:[2,30],78:[2,30],79:[2,30]},{21:[2,31],31:[2,31],52:[2,31],59:[2,31],62:[2,31],66:[2,31],69:[2,31],74:[2,31],75:[2,31],76:[2,31],77:[2,31],78:[2,31],79:[2,31]},{21:[2,32],31:[2,32],52:[2,32],59:[2,32],62:[2,32],66:[2,32],69:[2,32],74:[2,32],75:[2,32],76:[2,32],77:[2,32],78:[2,32],79:[2,32]},{21:[2,33],31:[2,33],52:[2,33],59:[2,33],62:[2,33],66:[2,33],69:[2,33],74:[2,33],75:[2,33],76:[2,33],77:[2,33],78:[2,33],79:[2,33]},{21:[2,34],31:[2,34],52:[2,34],59:[2,34],62:[2,34],66:[2,34],69:[2,34],74:[2,34],75:[2,34],76:[2,34],77:[2,34],78:[2,34],79:[2,34]},{21:[2,35],31:[2,35],52:[2,35],59:[2,35],62:[2,35],66:[2,35],69:[2,35],74:[2,35],75:[2,35],76:[2,35],77:[2,35],78:[2,35],79:[2,35]},{21:[2,36],31:[2,36],52:[2,36],59:[2,36],62:[2,36],66:[2,36],69:[2,36],74:[2,36],75:[2,36],76:[2,36],77:[2,36],78:[2,36],79:[2,36]},{21:[2,40],31:[2,40],52:[2,40],59:[2,40],62:[2,40],66:[2,40],69:[2,40],74:[2,40],75:[2,40],76:[2,40],77:[2,40],78:[2,40],79:[2,40],81:[1,45]},{66:[1,32],80:46},{21:[2,42],31:[2,42],52:[2,42],59:[2,42],62:[2,42],66:[2,42],69:[2,42],74:[2,42],75:[2,42],76:[2,42],77:[2,42],78:[2,42],79:[2,42],81:[2,42]},{50:47,52:[2,77],59:[2,77],66:[2,77],74:[2,77],75:[2,77],76:[2,77],77:[2,77],78:[2,77],79:[2,77]},{23:48,36:50,37:[1,52],41:51,42:[1,53],43:49,45:[2,49]},{26:54,41:55,42:[1,53],45:[2,51]},{16:[1,56]},{31:[2,81],55:57,59:[2,81],66:[2,81],74:[2,81],75:[2,81],76:[2,81],77:[2,81],78:[2,81],79:[2,81]},{31:[2,37],59:[2,37],66:[2,37],74:[2,37],75:[2,37],76:[2,37],77:[2,37],78:[2,37],79:[2,37]},{31:[2,38],59:[2,38],66:[2,38],74:[2,38],75:[2,38],76:[2,38],77:[2,38],78:[2,38],79:[2,38]},{18:58,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{28:59,31:[2,53],59:[2,53],66:[2,53],69:[2,53],74:[2,53],75:[2,53],76:[2,53],77:[2,53],78:[2,53],79:[2,53]},{31:[2,59],33:60,59:[2,59],66:[2,59],69:[2,59],74:[2,59],75:[2,59],76:[2,59],77:[2,59],78:[2,59],79:[2,59]},{19:61,21:[2,45],59:[2,45],66:[2,45],74:[2,45],75:[2,45],76:[2,45],77:[2,45],78:[2,45],79:[2,45]},{18:65,31:[2,75],48:62,57:63,58:66,59:[1,40],63:64,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{66:[1,70]},{21:[2,39],31:[2,39],52:[2,39],59:[2,39],62:[2,39],66:[2,39],69:[2,39],74:[2,39],75:[2,39],76:[2,39],77:[2,39],78:[2,39],79:[2,39],81:[1,45]},{18:65,51:71,52:[2,79],57:72,58:66,59:[1,40],63:73,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{24:74,45:[1,75]},{45:[2,50]},{4:76,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],37:[2,43],42:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{45:[2,19]},{18:77,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{4:78,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{24:79,45:[1,75]},{45:[2,52]},{5:[2,10],13:[2,10],14:[2,10],17:[2,10],27:[2,10],32:[2,10],37:[2,10],42:[2,10],45:[2,10],46:[2,10],49:[2,10],53:[2,10]},{18:65,31:[2,83],56:80,57:81,58:66,59:[1,40],63:82,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{59:[2,85],60:83,62:[2,85],66:[2,85],74:[2,85],75:[2,85],76:[2,85],77:[2,85],78:[2,85],79:[2,85]},{18:65,29:84,31:[2,55],57:85,58:66,59:[1,40],63:86,64:67,65:68,66:[1,69],69:[2,55],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:65,31:[2,61],34:87,57:88,58:66,59:[1,40],63:89,64:67,65:68,66:[1,69],69:[2,61],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:65,20:90,21:[2,47],57:91,58:66,59:[1,40],63:92,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{31:[1,93]},{31:[2,74],59:[2,74],66:[2,74],74:[2,74],75:[2,74],76:[2,74],77:[2,74],78:[2,74],79:[2,74]},{31:[2,76]},{21:[2,24],31:[2,24],52:[2,24],59:[2,24],62:[2,24],66:[2,24],69:[2,24],74:[2,24],75:[2,24],76:[2,24],77:[2,24],78:[2,24],79:[2,24]},{21:[2,25],31:[2,25],52:[2,25],59:[2,25],62:[2,25],66:[2,25],69:[2,25],74:[2,25],75:[2,25],76:[2,25],77:[2,25],78:[2,25],79:[2,25]},{21:[2,27],31:[2,27],52:[2,27],62:[2,27],65:94,66:[1,95],69:[2,27]},{21:[2,89],31:[2,89],52:[2,89],62:[2,89],66:[2,89],69:[2,89]},{21:[2,42],31:[2,42],52:[2,42],59:[2,42],62:[2,42],66:[2,42],67:[1,96],69:[2,42],74:[2,42],75:[2,42],76:[2,42],77:[2,42],78:[2,42],79:[2,42],81:[2,42]},{21:[2,41],31:[2,41],52:[2,41],59:[2,41],62:[2,41],66:[2,41],69:[2,41],74:[2,41],75:[2,41],76:[2,41],77:[2,41],78:[2,41],79:[2,41],81:[2,41]},{52:[1,97]},{52:[2,78],59:[2,78],66:[2,78],74:[2,78],75:[2,78],76:[2,78],77:[2,78],78:[2,78],79:[2,78]},{52:[2,80]},{5:[2,12],13:[2,12],14:[2,12],17:[2,12],27:[2,12],32:[2,12],37:[2,12],42:[2,12],45:[2,12],46:[2,12],49:[2,12],53:[2,12]},{18:98,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{36:50,37:[1,52],41:51,42:[1,53],43:100,44:99,45:[2,71]},{31:[2,65],38:101,59:[2,65],66:[2,65],69:[2,65],74:[2,65],75:[2,65],76:[2,65],77:[2,65],78:[2,65],79:[2,65]},{45:[2,17]},{5:[2,13],13:[2,13],14:[2,13],17:[2,13],27:[2,13],32:[2,13],37:[2,13],42:[2,13],45:[2,13],46:[2,13],49:[2,13],53:[2,13]},{31:[1,102]},{31:[2,82],59:[2,82],66:[2,82],74:[2,82],75:[2,82],76:[2,82],77:[2,82],78:[2,82],79:[2,82]},{31:[2,84]},{18:65,57:104,58:66,59:[1,40],61:103,62:[2,87],63:105,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{30:106,31:[2,57],68:107,69:[1,108]},{31:[2,54],59:[2,54],66:[2,54],69:[2,54],74:[2,54],75:[2,54],76:[2,54],77:[2,54],78:[2,54],79:[2,54]},{31:[2,56],69:[2,56]},{31:[2,63],35:109,68:110,69:[1,108]},{31:[2,60],59:[2,60],66:[2,60],69:[2,60],74:[2,60],75:[2,60],76:[2,60],77:[2,60],78:[2,60],79:[2,60]},{31:[2,62],69:[2,62]},{21:[1,111]},{21:[2,46],59:[2,46],66:[2,46],74:[2,46],75:[2,46],76:[2,46],77:[2,46],78:[2,46],79:[2,46]},{21:[2,48]},{5:[2,21],13:[2,21],14:[2,21],17:[2,21],27:[2,21],32:[2,21],37:[2,21],42:[2,21],45:[2,21],46:[2,21],49:[2,21],53:[2,21]},{21:[2,90],31:[2,90],52:[2,90],62:[2,90],66:[2,90],69:[2,90]},{67:[1,96]},{18:65,57:112,58:66,59:[1,40],66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{5:[2,22],13:[2,22],14:[2,22],17:[2,22],27:[2,22],32:[2,22],37:[2,22],42:[2,22],45:[2,22],46:[2,22],49:[2,22],53:[2,22]},{31:[1,113]},{45:[2,18]},{45:[2,72]},{18:65,31:[2,67],39:114,57:115,58:66,59:[1,40],63:116,64:67,65:68,66:[1,69],69:[2,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{5:[2,23],13:[2,23],14:[2,23],17:[2,23],27:[2,23],32:[2,23],37:[2,23],42:[2,23],45:[2,23],46:[2,23],49:[2,23],53:[2,23]},{62:[1,117]},{59:[2,86],62:[2,86],66:[2,86],74:[2,86],75:[2,86],76:[2,86],77:[2,86],78:[2,86],79:[2,86]},{62:[2,88]},{31:[1,118]},{31:[2,58]},{66:[1,120],70:119},{31:[1,121]},{31:[2,64]},{14:[2,11]},{21:[2,28],31:[2,28],52:[2,28],62:[2,28],66:[2,28],69:[2,28]},{5:[2,20],13:[2,20],14:[2,20],17:[2,20],27:[2,20],32:[2,20],37:[2,20],42:[2,20],45:[2,20],46:[2,20],49:[2,20],53:[2,20]},{31:[2,69],40:122,68:123,69:[1,108]},{31:[2,66],59:[2,66],66:[2,66],69:[2,66],74:[2,66],75:[2,66],76:[2,66],77:[2,66],78:[2,66],79:[2,66]},{31:[2,68],69:[2,68]},{21:[2,26],31:[2,26],52:[2,26],59:[2,26],62:[2,26],66:[2,26],69:[2,26],74:[2,26],75:[2,26],76:[2,26],77:[2,26],78:[2,26],79:[2,26]},{13:[2,14],14:[2,14],17:[2,14],27:[2,14],32:[2,14],37:[2,14],42:[2,14],45:[2,14],46:[2,14],49:[2,14],53:[2,14]},{66:[1,125],71:[1,124]},{66:[2,91],71:[2,91]},{13:[2,15],14:[2,15],17:[2,15],27:[2,15],32:[2,15],42:[2,15],45:[2,15],46:[2,15],49:[2,15],53:[2,15]},{31:[1,126]},{31:[2,70]},{31:[2,29]},{66:[2,92],71:[2,92]},{13:[2,16],14:[2,16],17:[2,16],27:[2,16],32:[2,16],37:[2,16],42:[2,16],45:[2,16],46:[2,16],49:[2,16],53:[2,16]}],defaultActions:{4:[2,1],49:[2,50],51:[2,19],55:[2,52],64:[2,76],73:[2,80],78:[2,17],82:[2,84],92:[2,48],99:[2,18],100:[2,72],105:[2,88],107:[2,58],110:[2,64],111:[2,11],123:[2,70],124:[2,29]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno}) -},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),16;case 4:return 14;case 5:return this.popState(),13;case 6:return 59;case 7:return 62;case 8:return 17;case 9:return this.popState(),this.begin("raw"),21;case 10:return 53;case 11:return 27;case 12:return 45;case 13:return this.popState(),42;case 14:return this.popState(),42;case 15:return 32;case 16:return 37;case 17:return 49;case 18:return 46;case 19:this.unput(b.yytext),this.popState(),this.begin("com");break;case 20:return this.popState(),13;case 21:return 46;case 22:return 67;case 23:return 66;case 24:return 66;case 25:return 81;case 26:break;case 27:return this.popState(),52;case 28:return this.popState(),31;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),74;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),74;case 31:return 79;case 32:return 76;case 33:return 76;case 34:return 77;case 35:return 78;case 36:return 75;case 37:return 69;case 38:return 71;case 39:return 66;case 40:return 66;case 41:return"INVALID";case 42:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,42],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b.exports=c}),define("handlebars/compiler/visitor",["exports","module","../exception","./ast"],function(a,b,c,d){function e(){this.parents=[]}var f=function(a){return a&&a.__esModule?a["default"]:a},g=f(c),h=f(d);e.prototype={constructor:e,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&(!c.type||!h[c.type]))throw new g('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new g(a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;c>b;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:function(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")},BlockStatement:function(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash"),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")},PartialStatement:function(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:function(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")},PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b.exports=e}),define("handlebars/compiler/whitespace-control",["exports","module","./visitor"],function(a,b,c){function d(){}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=function(a){return a&&a.__esModule?a["default"]:a},j=i(c);d.prototype=new j,d.prototype.Program=function(a){var b=!this.isRootSeen;this.isRootSeen=!0;for(var c=a.body,d=0,i=c.length;i>d;d++){var j=c[d],k=this.accept(j);if(k){var l=e(c,d,b),m=f(c,d,b),n=k.openStandalone&&l,o=k.closeStandalone&&m,p=k.inlineStandalone&&l&&m;k.close&&g(c,d,!0),k.open&&h(c,d,!0),p&&(g(c,d),h(c,d)&&"PartialStatement"===j.type&&(j.indent=/([ \t]+$)/.exec(c[d-1].original)[1])),n&&(g((j.program||j.inverse).body),h(c,d)),o&&(g(c,d),h((j.inverse||j.program).body))}}return a},d.prototype.BlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b.exports=d}),define("handlebars/compiler/helpers",["exports","../exception"],function(a,b){function c(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function d(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function e(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function f(a){return a.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function g(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g="",h=0,i=b.length;i>h;h++){var j=b[h].part,k=b[h].original!==j;if(d+=(b[h].separator||"")+j,k||".."!==j&&"."!==j&&"this"!==j)e.push(j);else{if(e.length>0)throw new l("Invalid path: "+d,{loc:c});".."===j&&(f++,g+="../")}}return new this.PathExpression(a,f,e,d,c)}function h(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g;return new this.MustacheStatement(a,b,c,h,e,this.locInfo(f))}function i(a,b,c,d){if(a.path.original!==c){var e={loc:a.path.loc};throw new l(a.path.original+" doesn't match "+c,e)}d=this.locInfo(d);var f=new this.Program([b],null,{},d);return new this.BlockStatement(a.path,a.params,a.hash,f,void 0,{},{},{},d)}function j(a,b,c,d,e,f){if(d&&d.path&&a.path.original!==d.path.original){var g={loc:a.path.loc};throw new l(a.path.original+" doesn't match "+d.path.original,g)}b.blockParams=a.blockParams;var h=void 0,i=void 0;return c&&(c.chain&&(c.program.body[0].closeStrip=d.strip),i=c.strip,h=c.program),e&&(e=h,h=b,b=e),new this.BlockStatement(a.path,a.params,a.hash,b,h,a.strip,i,d&&d.strip,this.locInfo(f))}var k=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.SourceLocation=c,a.id=d,a.stripFlags=e,a.stripComment=f,a.preparePath=g,a.prepareMustache=h,a.prepareRawBlock=i,a.prepareBlock=j;var l=k(b)}),define("handlebars/compiler/base",["exports","./parser","./ast","./whitespace-control","./helpers","../utils"],function(a,b,c,d,e,f){function g(a,b){if("Program"===a.type)return a;i.yy=l,l.locInfo=function(a){return new l.SourceLocation(b&&b.srcName,a)};var c=new k;return c.accept(i.parse(a))}var h=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.parse=g;var i=h(b),j=h(c),k=h(d);a.parser=i;var l={};f.extend(l,e,j)}),define("handlebars/compiler/compiler",["exports","../exception","../utils","./ast"],function(a,b,c,d){function e(){}function f(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function g(a,b,c){function d(){var b=c.parse(a,f),d=(new c.Compiler).compile(b,f),e=(new c.JavaScriptCompiler).compile(d,f,void 0,!0);return c.template(e)}function e(a,b){return g||(g=d()),g.call(this,a,b)}var f=void 0===arguments[1]?{}:arguments[1];if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);"data"in f||(f.data=!0),f.compat&&(f.useDepths=!0);var g=void 0;return e._setup=function(a){return g||(g=d()),g._setup(a)},e._child=function(a,b,c,e){return g||(g=d()),g._child(a,b,c,e)},e}function h(a,b){if(a===b)return!0;if(c.isArray(a)&&c.isArray(b)&&a.length===b.length){for(var d=0;dc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!h(d.args,e.args))return!1}b=this.children.length;for(var c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)d in c&&(b.knownHelpers[d]=c[d]);return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;c>d;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){i(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},PartialStatement:function(a){this.usePartial=!0;var b=a.params;if(b.length>1)throw new k("Unsupported number of partial arguments: "+b.length,a);b.length||b.push({type:"PathExpression",parts:[],depth:0});var c=a.name.original,d="SubExpression"===a.name.type;d&&this.accept(a.name),this.setupFullMustacheParams(a,void 0,void 0,!0);var e=a.indent||"";this.options.preventIndent&&e&&(this.opcode("appendContent",e),e=""),this.opcode("invokePartial",d,c,e),this.opcode("append")},MustacheStatement:function(a){this.SubExpression(a),this.opcode(a.escaped&&!this.options.noEscape?"appendEscaped":"append")},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){i(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){this.accept(a.path),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new k("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,l.helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=l.helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts)):this.opcode("lookupOnContext",a.parts,a.falsy,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");d>c;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:m.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=l.helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&l.helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||l.helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^\.\//g,"").replace(/^\.$/g,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,d=this.options.blockParams.length;d>b;b++){var e=this.options.blockParams[b],f=e&&c.indexOf(e,a);if(e&&f>=0)return[b,f]}}}}),define("handlebars/compiler/code-gen",["exports","module","../utils"],function(a,b,c){function d(a,b,d){if(c.isArray(a)){for(var e=[],f=0,g=a.length;g>f;f++)e.push(b.wrap(a[f],d));return e}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}var f=void 0;try{if("function"!=typeof define||!define.amd){var g=require("source-map");f=g.SourceNode}}catch(h){}f||(f=function(a,b,c,d){this.src="",d&&this.add(d)},f.prototype={add:function(a){c.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){c.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;c>b;b++)a(this.source[b])},empty:function(){var a=void 0===arguments[0]?this.currentLocation||{start:{}}:arguments[0];return new f(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof f?a:(a=d(a,this,b),new f(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e])}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a,b){for(var c=this.empty(b),e=0,f=a.length;f>e;e++)e&&c.add(","),c.add(d(a[e],this,b));return c},generateArray:function(a,b){var c=this.generateList(a,b);return c.prepend("["),c.add("]"),c}},b.exports=e}),define("handlebars/compiler/javascript-compiler",["exports","module","../base","../exception","../utils","./code-gen"],function(a,b,c,d,e,f){function g(a){this.value=a}function h(){}function i(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;g>f;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("this.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}var j=function(a){return a&&a.__esModule?a["default"]:a},k=j(d),l=j(f);h.prototype={nameLookup:function(a,b){return h.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"['",b,"']"]},depthedLookup:function(a){return[this.aliasable("this.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=c.COMPILER_REVISION,b=c.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return e.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;i>h;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new k("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var l={compiler:this.compilerInfo(),main:j},m=this.context.programs;for(h=0,i=m.length;i>h;h++)m[h]&&(l[h]=m[h]);return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new l(this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("this.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0;c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++])),this.resolvePath("context",a,d,b)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b){this.pushStackLiteral(a?"this.data(data, "+a+")":"data"),this.resolvePath("data",b,0,!0)},resolvePath:function(a,b,c,d){var e=this;if(this.options.strict||this.options.assumeObjects)return void this.push(i(this.options.strict,this,b,a));for(var f=b.length;f>c;c++)this.replaceStack(function(f){var g=e.nameLookup(f,b[c],a);return d?[" && ",g]:[" != null ? ",g," : ",f]})},resolvePossibleLambda:function(){this.push([this.aliasable("this.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){this.pushStackLiteral(null!=a?this.programExpression(a):null)},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d,!1);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",d.unshift(a?b:this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("this.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):this.pushStackLiteral("SubExpression"===a?"true":"null")},compiler:h,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;g>f;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);null==h?(this.context.programs.push(""),h=this.context.programs.length,d.index=h,d.name="program"+h,this.context.programs[h]=e.compile(d,b,this.context,!this.precompile),this.context.environments[h]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams):(d.index=h,d.name="program"+h,this.useDepths=this.useDepths||d.useDepths,this.useBlockParams=this.useBlockParams||d.useBlockParams)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"this.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof g||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new g(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,d=void 0,e=void 0;if(!this.isInline())throw new k("replaceStack on non-inline");var f=this.popStack(!0);if(f instanceof g)c=[f.value],b=["(",c],e=!0;else{d=!0;var h=this.incrStack();b=["((",this.push(h)," = ",f,")"],c=this.topStack()}var i=a.call(this,c);e||this.popStack(),d&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var d=a[b];if(d instanceof g)this.compileStack.push(d);else{var e=this.incrStack();this.pushSource([e," = ",d,";"]),this.compileStack.push(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof g)return c.value;if(!b){if(!this.stackSlot)throw new k("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof g?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=void 0;d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var i=this.popStack(),j=this.popStack();(j||i)&&(d.fn=j||"this.noop",d.inverse=i||"this.noop");for(var k=b;k--;)h=this.popStack(),c[k]=h,this.trackIds&&(g[k]=this.popStack()),this.stringParams&&(f[k]=this.popStack(),e[k]=this.popStack());return this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c,!0);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):(c.push(e),"")}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=h.RESERVED_WORDS={},c=0,d=a.length;d>c;c++)b[a[c]]=!0}(),h.isValidJavaScriptVariableName=function(a){return!h.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b.exports=h}),define("handlebars",["exports","module","./handlebars.runtime","./handlebars/compiler/ast","./handlebars/compiler/base","./handlebars/compiler/compiler","./handlebars/compiler/javascript-compiler","./handlebars/compiler/visitor","./handlebars/no-conflict"],function(a,b,c,d,e,f,g,h,i){function j(){var a=q();return a.compile=function(b,c){return f.compile(b,c,a)},a.precompile=function(b,c){return f.precompile(b,c,a)},a.AST=m,a.Compiler=f.Compiler,a.JavaScriptCompiler=n,a.Parser=e.parser,a.parse=e.parse,a}var k=function(a){return a&&a.__esModule?a["default"]:a -},l=k(c),m=k(d),n=k(g),o=k(h),p=k(i),q=l.create,r=j();r.create=j,p(r),r.Visitor=o,r["default"]=r,b.exports=r}); \ No newline at end of file +define("handlebars/safe-string",["exports"],function(a){function b(a){this.string=a}b.prototype.toString=function(){return""+this.string},a["default"]=b}),define("handlebars/utils",["./safe-string","exports"],function(a,b){function c(a){return i[a]}function d(a){for(var b=1;b":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/;b.extend=d;var l=Object.prototype.toString;b.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;b.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};b.isArray=n,b.escapeExpression=e,b.isEmpty=f,b.appendContextPath=g}),define("handlebars/exception",["exports"],function(a){function b(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var f=a,g=b["default"],h="2.0.0";c.VERSION=h;var i=6;c.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};c.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";c.HandlebarsEnvironment=d,d.prototype={constructor:d,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};c.logger=o;var p=o.log;c.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};c.createFrame=q}),define("handlebars/runtime",["./utils","./exception","./base","exports"],function(a,b,c,d){function e(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function f(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=g(this,a,e,b,c):d||(d=this.programs[a]=g(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=j(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return g(d,b,a[b],c,e)},e}function g(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function h(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var k=a,l=b["default"],m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;d.checkRevision=e,d.template=f,d.program=g,d.invokePartial=h,d.noop=i}),define("handlebars.runtime",["./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","exports"],function(a,b,c,d,e,f){var g=a,h=b["default"],i=c["default"],j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();m.create=l,m["default"]=m,f["default"]=m}),define("handlebars/compiler/ast",["../exception","exports"],function(a,b){function c(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var d=a["default"],e={ProgramNode:function(a,b,d){c.call(this,d),this.type="program",this.statements=a,this.strip=b},MustacheNode:function(a,b,d,f,g){if(c.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,b),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,b,d){c.call(this,d),this.type="sexpr",this.hash=b;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!b),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,b,d,e,f){c.call(this,f),this.type="partial",this.partialName=a,this.context=b,this.hash=d,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,b,d,e,f){c.call(this,f),this.type="block",this.mustache=a,this.program=b,this.inverse=d,this.strip=e,d&&!b&&(this.isInverse=!0)},RawBlockNode:function(a,b,f,g){if(c.call(this,g),a.sexpr.id.original!==f)throw new d(a.sexpr.id.original+" doesn't match "+f,this);b=new e.ContentNode(b,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([b],{},g)},ContentNode:function(a,b){c.call(this,b),this.type="content",this.original=this.string=a},HashNode:function(a,b){c.call(this,b),this.type="hash",this.pairs=a},IdNode:function(a,b){c.call(this,b),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new d("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,b){c.call(this,b),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,b){c.call(this,b),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,b){c.call(this,b),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,b){c.call(this,b),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,b){c.call(this,b),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,b){c.call(this,b),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};b["default"]=e}),define("handlebars/compiler/parser",["exports"],function(a){var b=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return d.prepareProgram(f[g-1].statements,!0),f[g-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[g]),{},this._$);break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=new d.ContentNode(f[g],this._$);break;case 8:this.$=new d.CommentNode(f[g],this._$);break;case 9:this.$=new d.RawBlockNode(f[g-2],f[g-1],f[g],this._$);break;case 10:this.$=new d.MustacheNode(f[g-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 14:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 15:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 16:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 17:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 18:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 19:this.$=new d.PartialNode(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),this._$);break;case 20:this.$=new d.PartialNode(f[g-2],void 0,f[g-1],d.stripFlags(f[g-3],f[g]),this._$);break;case 21:this.$=new d.SexprNode([f[g-2]].concat(f[g-1]),f[g],this._$);break;case 22:this.$=new d.SexprNode([f[g]],null,this._$);break;case 23:this.$=f[g];break;case 24:this.$=new d.StringNode(f[g],this._$);break;case 25:this.$=new d.NumberNode(f[g],this._$);break;case 26:this.$=new d.BooleanNode(f[g],this._$);break;case 27:this.$=f[g];break;case 28:f[g-1].isHelper=!0,this.$=f[g-1];break;case 29:this.$=new d.HashNode(f[g],this._$);break;case 30:this.$=[f[g-2],f[g]];break;case 31:this.$=new d.PartialNameNode(f[g],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[g],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[g],this._$));break;case 34:this.$=new d.DataNode(f[g],this._$);break;case 35:this.$=new d.IdNode(f[g],this._$);break;case 36:f[g-2].push({part:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 37:this.$=[{part:f[g]}];break;case 38:this.$=[];break;case 39:f[g-1].push(f[g]);break;case 48:this.$=[];break;case 49:f[g-1].push(f[g]);break;case 52:this.$=[f[g]];break;case 53:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();a["default"]=b}),define("handlebars/compiler/helpers",["../exception","exports"],function(a,b){function c(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function d(a,b,c,d,e,k){if(a.sexpr.id.original!==d.path.original)throw new j(a.sexpr.id.original+" doesn't match "+d.path.original,a);var l=c&&c.program,m={left:a.strip.left,right:d.strip.right,openStandalone:g(b.statements),closeStandalone:f((l||b).statements)};if(a.strip.right&&h(b.statements,null,!0),l){var n=c.strip;n.left&&i(b.statements,null,!0),n.right&&h(l.statements,null,!0),d.strip.left&&i(l.statements,null,!0),f(b.statements)&&g(l.statements)&&(i(b.statements),h(l.statements))}else d.strip.left&&i(b.statements,null,!0);return e?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function e(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c],j=e.strip;if(j){var k=f(a,c,b,"partial"===e.type),l=g(a,c,b),m=j.openStandalone&&k,n=j.closeStandalone&&l,o=j.inlineStandalone&&k&&l;j.right&&h(a,c,!0),j.left&&i(a,c,!0),o&&(h(a,c),i(a,c)&&"partial"===e.type&&(e.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(h((e.program||e.inverse).statements),i(a,c)),n&&(h(a,c),i((e.inverse||e.program).statements))}}return a}function f(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function g(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function h(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function i(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var j=a["default"];b.stripFlags=c,b.prepareBlock=d,b.prepareProgram=e}),define("handlebars/compiler/base",["./parser","./ast","./helpers","../utils","exports"],function(a,b,c,d,e){function f(a){return a.constructor===h.ProgramNode?a:(g.yy=k,g.parse(a))}var g=a["default"],h=b["default"],i=c,j=d.extend;e.parser=g;var k={};j(k,i,h),e.parse=f}),define("handlebars/compiler/compiler",["../exception","../utils","exports"],function(a,b,c){function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,f=function(a,b){return e||(e=d()),e.call(this,a,b)};return f._setup=function(a){return e||(e=d()),e._setup(a)},f._child=function(a,b,c){return e||(e=d()),e._child(a,b,c)},f}function g(a,b){if(a===b)return!0;if(i(a)&&i(b)&&a.length===b.length){for(var c=0;cc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers; +if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;for(this.opcode("pushHash"),b=0,c=d.length;c>b;b++)this.pushParam(d[b][1]);for(;b--;)this.opcode("assignToHash",d[b][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new h("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.ID(e),this.opcode("invokeHelper",d.length,e.original,e.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:j.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},c.precompile=e,c.compile=f}),define("handlebars/compiler/javascript-compiler",["../base","../exception","exports"],function(a,b,c){function d(a){this.value=a}function e(){}var f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=b["default"];e.prototype={nameLookup:function(a,b){return e.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=f,b=g[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var e,f,g,i=a.opcodes;for(f=0,g=i.length;g>f;f++)e=i[f],this[e.opcode].apply(this,e.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new h("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(f=0,g=l.length;g>f;f++)l[f]&&(k[f]=l[f]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var b,c,d="",e=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?b=b?b+"\n + "+h.content:h.content:(b&&(d?d+="buffer += "+b+";\n ":(c=!0,d=b+";\n "),b=void 0),d+=h+"\n ",this.environment.isSimple||(e=!1))}return e?(b||!d)&&(d+="return "+(b||'""')+";\n"):(a+=", buffer = "+(c?"":this.initializeBuffer()),d+=b?"return buffer + "+b+";\n":"return buffer;\n"),a&&(d="var "+a.substring(2)+(c?"":";\n ")+d),d},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var b,c,d,e=this.popStack();this.trackIds&&(d=this.popStack()),this.stringParams&&(c=this.popStack(),b=this.popStack());var f=this.hash;b&&f.contexts.push("'"+a+"': "+b),c&&f.types.push("'"+a+"': "+c),d&&f.ids.push("'"+a+"': "+d),f.values.push("'"+a+"': ("+e+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context,!this.precompile),this.context.environments[h]=c,this.useDepths=this.useDepths||d.useDepths):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=(b.depths.list,this.useDepths),d=[b.index,"data"];return c&&d.push("depths"),"this.program("+d.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){{var b,c,e,f="";this.isInline()}if(!this.isInline())throw new h("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)f=b=g.value,e=!0;else{c=!this.stackSlot;var i=c?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+g+")",b=this.topStack()}var j=a.call(this,b);e||this.popStack(),c&&this.stackSlot--,this.push("("+f+j+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var e=a[b];e instanceof d?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var d,e,f,g={},h=[],i=[],j=[];g.name=this.quotedString(a),g.hash=this.popStack(),this.trackIds&&(g.hashIds=this.popStack()),this.stringParams&&(g.hashTypes=this.popStack(),g.hashContexts=this.popStack()),e=this.popStack(),f=this.popStack(),(f||e)&&(f||(f="this.noop"),e||(e="this.noop"),g.fn=f,g.inverse=e);for(var k=b;k--;)d=this.popStack(),c[k]=d,this.trackIds&&(j[k]=this.popStack()),this.stringParams&&(i[k]=this.popStack(),h[k]=this.popStack());return this.trackIds&&(g.ids="["+j.join(",")+"]"),this.stringParams&&(g.types="["+i.join(",")+"]",g.contexts="["+h.join(",")+"]"),this.options.data&&(g.data="data"),g},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=e.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},c["default"]=e}),define("handlebars",["./handlebars.runtime","./handlebars/compiler/ast","./handlebars/compiler/base","./handlebars/compiler/compiler","./handlebars/compiler/javascript-compiler","exports"],function(a,b,c,d,e,f){var g=a["default"],h=b["default"],i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e["default"],o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};g=p(),g.create=p,g["default"]=g,f["default"]=g}); \ No newline at end of file diff --git a/node_modules/handlebars/dist/handlebars.js b/node_modules/handlebars/dist/handlebars.js index e0f7535..f826bbf 100644 --- a/node_modules/handlebars/dist/handlebars.js +++ b/node_modules/handlebars/dist/handlebars.js @@ -1,6 +1,6 @@ /*! - handlebars v3.0.3 + handlebars v2.0.0 Copyright (C) 2011-2014 by Yehuda Katz @@ -24,4075 +24,3056 @@ THE SOFTWARE. @license */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define(factory); - else if(typeof exports === 'object') - exports["Handlebars"] = factory(); - else - root["Handlebars"] = factory(); -})(this, function() { -return /******/ (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__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - - var _runtime = __webpack_require__(1); - - var _runtime2 = _interopRequireWildcard(_runtime); - - // Compiler imports - - var _AST = __webpack_require__(2); - - var _AST2 = _interopRequireWildcard(_AST); - - var _Parser$parse = __webpack_require__(3); - - var _Compiler$compile$precompile = __webpack_require__(4); - - var _JavaScriptCompiler = __webpack_require__(5); - - var _JavaScriptCompiler2 = _interopRequireWildcard(_JavaScriptCompiler); - - var _Visitor = __webpack_require__(6); - - var _Visitor2 = _interopRequireWildcard(_Visitor); - - var _noConflict = __webpack_require__(7); - - var _noConflict2 = _interopRequireWildcard(_noConflict); - - var _create = _runtime2['default'].create; - function create() { - var hb = _create(); - - hb.compile = function (input, options) { - return _Compiler$compile$precompile.compile(input, options, hb); - }; - hb.precompile = function (input, options) { - return _Compiler$compile$precompile.precompile(input, options, hb); - }; - - hb.AST = _AST2['default']; - hb.Compiler = _Compiler$compile$precompile.Compiler; - hb.JavaScriptCompiler = _JavaScriptCompiler2['default']; - hb.Parser = _Parser$parse.parser; - hb.parse = _Parser$parse.parse; - - return hb; - } - - var inst = create(); - inst.create = create; - - _noConflict2['default'](inst); - - inst.Visitor = _Visitor2['default']; - - inst['default'] = inst; - - exports['default'] = inst; - module.exports = exports['default']; - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - - var _import = __webpack_require__(9); - - var base = _interopRequireWildcard(_import); - - // Each of these augment the Handlebars object. No need to setup here. - // (This is done to easily share code between commonjs and browse envs) - - var _SafeString = __webpack_require__(10); - - var _SafeString2 = _interopRequireWildcard(_SafeString); - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _import2 = __webpack_require__(12); - - var Utils = _interopRequireWildcard(_import2); - - var _import3 = __webpack_require__(13); - - var runtime = _interopRequireWildcard(_import3); - - var _noConflict = __webpack_require__(7); - - var _noConflict2 = _interopRequireWildcard(_noConflict); - - // For compatibility and usage outside of module systems, make the Handlebars object a namespace - function create() { - var hb = new base.HandlebarsEnvironment(); - - Utils.extend(hb, base); - hb.SafeString = _SafeString2['default']; - hb.Exception = _Exception2['default']; - hb.Utils = Utils; - hb.escapeExpression = Utils.escapeExpression; - - hb.VM = runtime; - hb.template = function (spec) { - return runtime.template(spec, hb); - }; - - return hb; - } - - var inst = create(); - inst.create = create; - - _noConflict2['default'](inst); - - inst['default'] = inst; - - exports['default'] = inst; - module.exports = exports['default']; - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - var AST = { - Program: function Program(statements, blockParams, strip, locInfo) { - this.loc = locInfo; - this.type = 'Program'; - this.body = statements; - - this.blockParams = blockParams; - this.strip = strip; - }, - - MustacheStatement: function MustacheStatement(path, params, hash, escaped, strip, locInfo) { - this.loc = locInfo; - this.type = 'MustacheStatement'; - - this.path = path; - this.params = params || []; - this.hash = hash; - this.escaped = escaped; - - this.strip = strip; - }, - - BlockStatement: function BlockStatement(path, params, hash, program, inverse, openStrip, inverseStrip, closeStrip, locInfo) { - this.loc = locInfo; - this.type = 'BlockStatement'; - - this.path = path; - this.params = params || []; - this.hash = hash; - this.program = program; - this.inverse = inverse; - - this.openStrip = openStrip; - this.inverseStrip = inverseStrip; - this.closeStrip = closeStrip; - }, - - PartialStatement: function PartialStatement(name, params, hash, strip, locInfo) { - this.loc = locInfo; - this.type = 'PartialStatement'; - - this.name = name; - this.params = params || []; - this.hash = hash; - - this.indent = ''; - this.strip = strip; - }, - - ContentStatement: function ContentStatement(string, locInfo) { - this.loc = locInfo; - this.type = 'ContentStatement'; - this.original = this.value = string; - }, - - CommentStatement: function CommentStatement(comment, strip, locInfo) { - this.loc = locInfo; - this.type = 'CommentStatement'; - this.value = comment; - - this.strip = strip; - }, - - SubExpression: function SubExpression(path, params, hash, locInfo) { - this.loc = locInfo; - - this.type = 'SubExpression'; - this.path = path; - this.params = params || []; - this.hash = hash; - }, - - PathExpression: function PathExpression(data, depth, parts, original, locInfo) { - this.loc = locInfo; - this.type = 'PathExpression'; - - this.data = data; - this.original = original; - this.parts = parts; - this.depth = depth; - }, - - StringLiteral: function StringLiteral(string, locInfo) { - this.loc = locInfo; - this.type = 'StringLiteral'; - this.original = this.value = string; - }, - - NumberLiteral: function NumberLiteral(number, locInfo) { - this.loc = locInfo; - this.type = 'NumberLiteral'; - this.original = this.value = Number(number); - }, - - BooleanLiteral: function BooleanLiteral(bool, locInfo) { - this.loc = locInfo; - this.type = 'BooleanLiteral'; - this.original = this.value = bool === 'true'; - }, - - UndefinedLiteral: function UndefinedLiteral(locInfo) { - this.loc = locInfo; - this.type = 'UndefinedLiteral'; - this.original = this.value = undefined; - }, - - NullLiteral: function NullLiteral(locInfo) { - this.loc = locInfo; - this.type = 'NullLiteral'; - this.original = this.value = null; - }, - - Hash: function Hash(pairs, locInfo) { - this.loc = locInfo; - this.type = 'Hash'; - this.pairs = pairs; - }, - HashPair: function HashPair(key, value, locInfo) { - this.loc = locInfo; - this.type = 'HashPair'; - this.key = key; - this.value = value; - }, - - // Public API used to evaluate derived attributes regarding AST nodes - helpers: { - // a mustache is definitely a helper if: - // * it is an eligible helper, and - // * it has at least one parameter or hash segment - helperExpression: function helperExpression(node) { - return !!(node.type === 'SubExpression' || node.params.length || node.hash); - }, - - scopedId: function scopedId(path) { - return /^\.|this\b/.test(path.original); - }, - - // an ID is simple if it only has one part, and that part is not - // `..` or `this`. - simpleId: function simpleId(path) { - return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; - } - } - }; - - // Must be exported as an object rather than the root of the module as the jison lexer - // must modify the object to operate properly. - exports['default'] = AST; - module.exports = exports['default']; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - exports.parse = parse; - - var _parser = __webpack_require__(14); - - var _parser2 = _interopRequireWildcard(_parser); - - var _AST = __webpack_require__(2); - - var _AST2 = _interopRequireWildcard(_AST); - - var _WhitespaceControl = __webpack_require__(15); - - var _WhitespaceControl2 = _interopRequireWildcard(_WhitespaceControl); - - var _import = __webpack_require__(16); - - var Helpers = _interopRequireWildcard(_import); - - var _extend = __webpack_require__(12); - - exports.parser = _parser2['default']; - - var yy = {}; - _extend.extend(yy, Helpers, _AST2['default']); - - function parse(input, options) { - // Just return if an already-compiled AST was passed in. - if (input.type === 'Program') { - return input; - } - - _parser2['default'].yy = yy; - - // Altering the shared object here, but this is ok as parser is a sync operation - yy.locInfo = function (locInfo) { - return new yy.SourceLocation(options && options.srcName, locInfo); - }; - - var strip = new _WhitespaceControl2['default'](); - return strip.accept(_parser2['default'].parse(input)); - } - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - exports.Compiler = Compiler; - exports.precompile = precompile; - exports.compile = compile; - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _isArray$indexOf = __webpack_require__(12); - - var _AST = __webpack_require__(2); - - var _AST2 = _interopRequireWildcard(_AST); - - var slice = [].slice; - - function Compiler() {} - - // the foundHelper register will disambiguate helper lookup from finding a - // function in a context. This is necessary for mustache compatibility, which - // requires that context functions in blocks are evaluated by blockHelperMissing, - // and then proceed as if the resulting value was provided to blockHelperMissing. - - Compiler.prototype = { - compiler: Compiler, - - equals: function equals(other) { - var len = this.opcodes.length; - if (other.opcodes.length !== len) { - return false; - } - - for (var i = 0; i < len; i++) { - var opcode = this.opcodes[i], - otherOpcode = other.opcodes[i]; - if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { - return false; - } - } - - // We know that length is the same between the two arrays because they are directly tied - // to the opcode behavior above. - len = this.children.length; - for (var i = 0; i < len; i++) { - if (!this.children[i].equals(other.children[i])) { - return false; - } - } - - return true; - }, - - guid: 0, - - compile: function compile(program, options) { - this.sourceNode = []; - this.opcodes = []; - this.children = []; - this.options = options; - this.stringParams = options.stringParams; - this.trackIds = options.trackIds; - - options.blockParams = options.blockParams || []; - - // These changes will propagate to the other compiler components - var knownHelpers = options.knownHelpers; - options.knownHelpers = { - helperMissing: true, - blockHelperMissing: true, - each: true, - 'if': true, - unless: true, - 'with': true, - log: true, - lookup: true - }; - if (knownHelpers) { - for (var _name in knownHelpers) { - if (_name in knownHelpers) { - options.knownHelpers[_name] = knownHelpers[_name]; - } - } - } - - return this.accept(program); - }, - - compileProgram: function compileProgram(program) { - var childCompiler = new this.compiler(), - // eslint-disable-line new-cap - result = childCompiler.compile(program, this.options), - guid = this.guid++; - - this.usePartial = this.usePartial || result.usePartial; - - this.children[guid] = result; - this.useDepths = this.useDepths || result.useDepths; - - return guid; - }, - - accept: function accept(node) { - this.sourceNode.unshift(node); - var ret = this[node.type](node); - this.sourceNode.shift(); - return ret; - }, - - Program: function Program(program) { - this.options.blockParams.unshift(program.blockParams); - - var body = program.body, - bodyLength = body.length; - for (var i = 0; i < bodyLength; i++) { - this.accept(body[i]); - } - - this.options.blockParams.shift(); - - this.isSimple = bodyLength === 1; - this.blockParams = program.blockParams ? program.blockParams.length : 0; - - return this; - }, - - BlockStatement: function BlockStatement(block) { - transformLiteralToPath(block); - - var program = block.program, - inverse = block.inverse; - - program = program && this.compileProgram(program); - inverse = inverse && this.compileProgram(inverse); - - var type = this.classifySexpr(block); - - if (type === 'helper') { - this.helperSexpr(block, program, inverse); - } else if (type === 'simple') { - this.simpleSexpr(block); - - // now that the simple mustache is resolved, we need to - // evaluate it by executing `blockHelperMissing` - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - this.opcode('emptyHash'); - this.opcode('blockValue', block.path.original); - } else { - this.ambiguousSexpr(block, program, inverse); - - // now that the simple mustache is resolved, we need to - // evaluate it by executing `blockHelperMissing` - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - this.opcode('emptyHash'); - this.opcode('ambiguousBlockValue'); - } - - this.opcode('append'); - }, - - PartialStatement: function PartialStatement(partial) { - this.usePartial = true; - - var params = partial.params; - if (params.length > 1) { - throw new _Exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); - } else if (!params.length) { - params.push({ type: 'PathExpression', parts: [], depth: 0 }); - } - - var partialName = partial.name.original, - isDynamic = partial.name.type === 'SubExpression'; - if (isDynamic) { - this.accept(partial.name); - } - - this.setupFullMustacheParams(partial, undefined, undefined, true); - - var indent = partial.indent || ''; - if (this.options.preventIndent && indent) { - this.opcode('appendContent', indent); - indent = ''; - } - - this.opcode('invokePartial', isDynamic, partialName, indent); - this.opcode('append'); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.SubExpression(mustache); // eslint-disable-line new-cap - - if (mustache.escaped && !this.options.noEscape) { - this.opcode('appendEscaped'); - } else { - this.opcode('append'); - } - }, - - ContentStatement: function ContentStatement(content) { - if (content.value) { - this.opcode('appendContent', content.value); - } - }, - - CommentStatement: function CommentStatement() {}, - - SubExpression: function SubExpression(sexpr) { - transformLiteralToPath(sexpr); - var type = this.classifySexpr(sexpr); - - if (type === 'simple') { - this.simpleSexpr(sexpr); - } else if (type === 'helper') { - this.helperSexpr(sexpr); - } else { - this.ambiguousSexpr(sexpr); - } - }, - ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { - var path = sexpr.path, - name = path.parts[0], - isBlock = program != null || inverse != null; - - this.opcode('getContext', path.depth); - - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - - this.accept(path); - - this.opcode('invokeAmbiguous', name, isBlock); - }, - - simpleSexpr: function simpleSexpr(sexpr) { - this.accept(sexpr.path); - this.opcode('resolvePossibleLambda'); - }, - - helperSexpr: function helperSexpr(sexpr, program, inverse) { - var params = this.setupFullMustacheParams(sexpr, program, inverse), - path = sexpr.path, - name = path.parts[0]; - - if (this.options.knownHelpers[name]) { - this.opcode('invokeKnownHelper', params.length, name); - } else if (this.options.knownHelpersOnly) { - throw new _Exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); - } else { - path.falsy = true; - - this.accept(path); - this.opcode('invokeHelper', params.length, path.original, _AST2['default'].helpers.simpleId(path)); - } - }, - - PathExpression: function PathExpression(path) { - this.addDepth(path.depth); - this.opcode('getContext', path.depth); - - var name = path.parts[0], - scoped = _AST2['default'].helpers.scopedId(path), - blockParamId = !path.depth && !scoped && this.blockParamIndex(name); - - if (blockParamId) { - this.opcode('lookupBlockParam', blockParamId, path.parts); - } else if (!name) { - // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` - this.opcode('pushContext'); - } else if (path.data) { - this.options.data = true; - this.opcode('lookupData', path.depth, path.parts); - } else { - this.opcode('lookupOnContext', path.parts, path.falsy, scoped); - } - }, - - StringLiteral: function StringLiteral(string) { - this.opcode('pushString', string.value); - }, - - NumberLiteral: function NumberLiteral(number) { - this.opcode('pushLiteral', number.value); - }, - - BooleanLiteral: function BooleanLiteral(bool) { - this.opcode('pushLiteral', bool.value); - }, - - UndefinedLiteral: function UndefinedLiteral() { - this.opcode('pushLiteral', 'undefined'); - }, - - NullLiteral: function NullLiteral() { - this.opcode('pushLiteral', 'null'); - }, - - Hash: function Hash(hash) { - var pairs = hash.pairs, - i = 0, - l = pairs.length; - - this.opcode('pushHash'); - - for (; i < l; i++) { - this.pushParam(pairs[i].value); - } - while (i--) { - this.opcode('assignToHash', pairs[i].key); - } - this.opcode('popHash'); - }, - - // HELPERS - opcode: function opcode(name) { - this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); - }, - - addDepth: function addDepth(depth) { - if (!depth) { - return; - } - - this.useDepths = true; - }, - - classifySexpr: function classifySexpr(sexpr) { - var isSimple = _AST2['default'].helpers.simpleId(sexpr.path); - - var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); - - // a mustache is an eligible helper if: - // * its id is simple (a single part, not `this` or `..`) - var isHelper = !isBlockParam && _AST2['default'].helpers.helperExpression(sexpr); - - // if a mustache is an eligible helper but not a definite - // helper, it is ambiguous, and will be resolved in a later - // pass or at runtime. - var isEligible = !isBlockParam && (isHelper || isSimple); - - // if ambiguous, we can possibly resolve the ambiguity now - // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. - if (isEligible && !isHelper) { - var _name2 = sexpr.path.parts[0], - options = this.options; - - if (options.knownHelpers[_name2]) { - isHelper = true; - } else if (options.knownHelpersOnly) { - isEligible = false; - } - } - - if (isHelper) { - return 'helper'; - } else if (isEligible) { - return 'ambiguous'; - } else { - return 'simple'; - } - }, - - pushParams: function pushParams(params) { - for (var i = 0, l = params.length; i < l; i++) { - this.pushParam(params[i]); - } - }, - - pushParam: function pushParam(val) { - var value = val.value != null ? val.value : val.original || ''; - - if (this.stringParams) { - if (value.replace) { - value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); - } - - if (val.depth) { - this.addDepth(val.depth); - } - this.opcode('getContext', val.depth || 0); - this.opcode('pushStringParam', value, val.type); - - if (val.type === 'SubExpression') { - // SubExpressions get evaluated and passed in - // in string params mode. - this.accept(val); - } - } else { - if (this.trackIds) { - var blockParamIndex = undefined; - if (val.parts && !_AST2['default'].helpers.scopedId(val) && !val.depth) { - blockParamIndex = this.blockParamIndex(val.parts[0]); - } - if (blockParamIndex) { - var blockParamChild = val.parts.slice(1).join('.'); - this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); - } else { - value = val.original || value; - if (value.replace) { - value = value.replace(/^\.\//g, '').replace(/^\.$/g, ''); - } - - this.opcode('pushId', val.type, value); - } - } - this.accept(val); - } - }, - - setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) { - var params = sexpr.params; - this.pushParams(params); - - this.opcode('pushProgram', program); - this.opcode('pushProgram', inverse); - - if (sexpr.hash) { - this.accept(sexpr.hash); - } else { - this.opcode('emptyHash', omitEmpty); - } - - return params; - }, - - blockParamIndex: function blockParamIndex(name) { - for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) { - var blockParams = this.options.blockParams[depth], - param = blockParams && _isArray$indexOf.indexOf(blockParams, name); - if (blockParams && param >= 0) { - return [depth, param]; - } - } - } - }; - - function precompile(input, options, env) { - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); - } - - options = options || {}; - if (!('data' in options)) { - options.data = true; - } - if (options.compat) { - options.useDepths = true; - } - - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options); - return new env.JavaScriptCompiler().compile(environment, options); - } - - function compile(input, _x, env) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - if (input == null || typeof input !== 'string' && input.type !== 'Program') { - throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); - } - - if (!('data' in options)) { - options.data = true; - } - if (options.compat) { - options.useDepths = true; - } - - var compiled = undefined; - - function compileInput() { - var ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options), - templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); - return env.template(templateSpec); - } - - // Template is only compiled on first use and cached after that point. - function ret(context, execOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled.call(this, context, execOptions); - } - ret._setup = function (setupOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._setup(setupOptions); - }; - ret._child = function (i, data, blockParams, depths) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._child(i, data, blockParams, depths); - }; - return ret; - } - - function argEquals(a, b) { - if (a === b) { - return true; - } - - if (_isArray$indexOf.isArray(a) && _isArray$indexOf.isArray(b) && a.length === b.length) { - for (var i = 0; i < a.length; i++) { - if (!argEquals(a[i], b[i])) { - return false; - } - } - return true; - } - } - - function transformLiteralToPath(sexpr) { - if (!sexpr.path.parts) { - var literal = sexpr.path; - // Casting to string here to make false and 0 literal values play nicely with the rest - // of the system. - sexpr.path = new _AST2['default'].PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); - } - } - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - - var _COMPILER_REVISION$REVISION_CHANGES = __webpack_require__(9); - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _isArray = __webpack_require__(12); - - var _CodeGen = __webpack_require__(17); - - var _CodeGen2 = _interopRequireWildcard(_CodeGen); - - function Literal(value) { - this.value = value; - } - - function JavaScriptCompiler() {} - - JavaScriptCompiler.prototype = { - // PUBLIC API: You can override these methods in a subclass to provide - // alternative compiled forms for name lookup and buffering semantics - nameLookup: function nameLookup(parent, name /* , type*/) { - if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { - return [parent, '.', name]; - } else { - return [parent, '[\'', name, '\']']; - } - }, - depthedLookup: function depthedLookup(name) { - return [this.aliasable('this.lookup'), '(depths, "', name, '")']; - }, - - compilerInfo: function compilerInfo() { - var revision = _COMPILER_REVISION$REVISION_CHANGES.COMPILER_REVISION, - versions = _COMPILER_REVISION$REVISION_CHANGES.REVISION_CHANGES[revision]; - return [revision, versions]; - }, - - appendToBuffer: function appendToBuffer(source, location, explicit) { - // Force a source as this simplifies the merge logic. - if (!_isArray.isArray(source)) { - source = [source]; - } - source = this.source.wrap(source, location); - - if (this.environment.isSimple) { - return ['return ', source, ';']; - } else if (explicit) { - // This is a case where the buffer operation occurs as a child of another - // construct, generally braces. We have to explicitly output these buffer - // operations to ensure that the emitted code goes in the correct location. - return ['buffer += ', source, ';']; - } else { - source.appendToBuffer = true; - return source; - } - }, - - initializeBuffer: function initializeBuffer() { - return this.quotedString(''); - }, - // END PUBLIC API - - compile: function compile(environment, options, context, asObject) { - this.environment = environment; - this.options = options; - this.stringParams = this.options.stringParams; - this.trackIds = this.options.trackIds; - this.precompile = !asObject; - - this.name = this.environment.name; - this.isChild = !!context; - this.context = context || { - programs: [], - environments: [] - }; - - this.preamble(); - - this.stackSlot = 0; - this.stackVars = []; - this.aliases = {}; - this.registers = { list: [] }; - this.hashes = []; - this.compileStack = []; - this.inlineStack = []; - this.blockParams = []; - - this.compileChildren(environment, options); - - this.useDepths = this.useDepths || environment.useDepths || this.options.compat; - this.useBlockParams = this.useBlockParams || environment.useBlockParams; - - var opcodes = environment.opcodes, - opcode = undefined, - firstLoc = undefined, - i = undefined, - l = undefined; - - for (i = 0, l = opcodes.length; i < l; i++) { - opcode = opcodes[i]; - - this.source.currentLocation = opcode.loc; - firstLoc = firstLoc || opcode.loc; - this[opcode.opcode].apply(this, opcode.args); - } - - // Flush any trailing content that might be pending. - this.source.currentLocation = firstLoc; - this.pushSource(''); - - /* istanbul ignore next */ - if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { - throw new _Exception2['default']('Compile completed with content left on stack'); - } - - var fn = this.createFunctionContext(asObject); - if (!this.isChild) { - var ret = { - compiler: this.compilerInfo(), - main: fn - }; - var programs = this.context.programs; - for (i = 0, l = programs.length; i < l; i++) { - if (programs[i]) { - ret[i] = programs[i]; - } - } - - if (this.environment.usePartial) { - ret.usePartial = true; - } - if (this.options.data) { - ret.useData = true; - } - if (this.useDepths) { - ret.useDepths = true; - } - if (this.useBlockParams) { - ret.useBlockParams = true; - } - if (this.options.compat) { - ret.compat = true; - } - - if (!asObject) { - ret.compiler = JSON.stringify(ret.compiler); - - this.source.currentLocation = { start: { line: 1, column: 0 } }; - ret = this.objectLiteral(ret); - - if (options.srcName) { - ret = ret.toStringWithSourceMap({ file: options.destName }); - ret.map = ret.map && ret.map.toString(); - } else { - ret = ret.toString(); - } - } else { - ret.compilerOptions = this.options; - } - - return ret; - } else { - return fn; - } - }, - - preamble: function preamble() { - // track the last context pushed into place to allow skipping the - // getContext opcode when it would be a noop - this.lastContext = 0; - this.source = new _CodeGen2['default'](this.options.srcName); - }, - - createFunctionContext: function createFunctionContext(asObject) { - var varDeclarations = ''; - - var locals = this.stackVars.concat(this.registers.list); - if (locals.length > 0) { - varDeclarations += ', ' + locals.join(', '); - } - - // Generate minimizer alias mappings - // - // When using true SourceNodes, this will update all references to the given alias - // as the source nodes are reused in situ. For the non-source node compilation mode, - // aliases will not be used, but this case is already being run on the client and - // we aren't concern about minimizing the template size. - var aliasCount = 0; - for (var alias in this.aliases) { - // eslint-disable-line guard-for-in - var node = this.aliases[alias]; - - if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { - varDeclarations += ', alias' + ++aliasCount + '=' + alias; - node.children[0] = 'alias' + aliasCount; - } - } - - var params = ['depth0', 'helpers', 'partials', 'data']; - - if (this.useBlockParams || this.useDepths) { - params.push('blockParams'); - } - if (this.useDepths) { - params.push('depths'); - } - - // Perform a second pass over the output to merge content when possible - var source = this.mergeSource(varDeclarations); - - if (asObject) { - params.push(source); - - return Function.apply(this, params); - } else { - return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); - } - }, - mergeSource: function mergeSource(varDeclarations) { - var isSimple = this.environment.isSimple, - appendOnly = !this.forceBuffer, - appendFirst = undefined, - sourceSeen = undefined, - bufferStart = undefined, - bufferEnd = undefined; - this.source.each(function (line) { - if (line.appendToBuffer) { - if (bufferStart) { - line.prepend(' + '); - } else { - bufferStart = line; - } - bufferEnd = line; - } else { - if (bufferStart) { - if (!sourceSeen) { - appendFirst = true; - } else { - bufferStart.prepend('buffer += '); - } - bufferEnd.add(';'); - bufferStart = bufferEnd = undefined; - } - - sourceSeen = true; - if (!isSimple) { - appendOnly = false; - } - } - }); - - if (appendOnly) { - if (bufferStart) { - bufferStart.prepend('return '); - bufferEnd.add(';'); - } else if (!sourceSeen) { - this.source.push('return "";'); - } - } else { - varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); - - if (bufferStart) { - bufferStart.prepend('return buffer + '); - bufferEnd.add(';'); - } else { - this.source.push('return buffer;'); - } - } - - if (varDeclarations) { - this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); - } - - return this.source.merge(); - }, - - // [blockValue] - // - // On stack, before: hash, inverse, program, value - // On stack, after: return value of blockHelperMissing - // - // The purpose of this opcode is to take a block of the form - // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and - // replace it on the stack with the result of properly - // invoking blockHelperMissing. - blockValue: function blockValue(name) { - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs(name, 0, params); - - var blockName = this.popStack(); - params.splice(1, 0, blockName); - - this.push(this.source.functionCall(blockHelperMissing, 'call', params)); - }, - - // [ambiguousBlockValue] - // - // On stack, before: hash, inverse, program, value - // Compiler value, before: lastHelper=value of last found helper, if any - // On stack, after, if no lastHelper: same as [blockValue] - // On stack, after, if lastHelper: value - ambiguousBlockValue: function ambiguousBlockValue() { - // We're being a bit cheeky and reusing the options value from the prior exec - var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs('', 0, params, true); - - this.flushInline(); - - var current = this.topStack(); - params.splice(1, 0, current); - - this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); - }, - - // [appendContent] - // - // On stack, before: ... - // On stack, after: ... - // - // Appends the string value of `content` to the current buffer - appendContent: function appendContent(content) { - if (this.pendingContent) { - content = this.pendingContent + content; - } else { - this.pendingLocation = this.source.currentLocation; - } - - this.pendingContent = content; - }, - - // [append] - // - // On stack, before: value, ... - // On stack, after: ... - // - // Coerces `value` to a String and appends it to the current buffer. - // - // If `value` is truthy, or 0, it is coerced into a string and appended - // Otherwise, the empty string is appended - append: function append() { - if (this.isInline()) { - this.replaceStack(function (current) { - return [' != null ? ', current, ' : ""']; - }); - - this.pushSource(this.appendToBuffer(this.popStack())); - } else { - var local = this.popStack(); - this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); - if (this.environment.isSimple) { - this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']); - } - } - }, - - // [appendEscaped] - // - // On stack, before: value, ... - // On stack, after: ... - // - // Escape `value` and append it to the buffer - appendEscaped: function appendEscaped() { - this.pushSource(this.appendToBuffer([this.aliasable('this.escapeExpression'), '(', this.popStack(), ')'])); - }, - - // [getContext] - // - // On stack, before: ... - // On stack, after: ... - // Compiler value, after: lastContext=depth - // - // Set the value of the `lastContext` compiler value to the depth - getContext: function getContext(depth) { - this.lastContext = depth; - }, - - // [pushContext] - // - // On stack, before: ... - // On stack, after: currentContext, ... - // - // Pushes the value of the current context onto the stack. - pushContext: function pushContext() { - this.pushStackLiteral(this.contextName(this.lastContext)); - }, - - // [lookupOnContext] - // - // On stack, before: ... - // On stack, after: currentContext[name], ... - // - // Looks up the value of `name` on the current context and pushes - // it onto the stack. - lookupOnContext: function lookupOnContext(parts, falsy, scoped) { - var i = 0; - - if (!scoped && this.options.compat && !this.lastContext) { - // The depthed query is expected to handle the undefined logic for the root level that - // is implemented below, so we evaluate that directly in compat mode - this.push(this.depthedLookup(parts[i++])); - } else { - this.pushContext(); - } - - this.resolvePath('context', parts, i, falsy); - }, - - // [lookupBlockParam] - // - // On stack, before: ... - // On stack, after: blockParam[name], ... - // - // Looks up the value of `parts` on the given block param and pushes - // it onto the stack. - lookupBlockParam: function lookupBlockParam(blockParamId, parts) { - this.useBlockParams = true; - - this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); - this.resolvePath('context', parts, 1); - }, - - // [lookupData] - // - // On stack, before: ... - // On stack, after: data, ... - // - // Push the data lookup operator - lookupData: function lookupData(depth, parts) { - if (!depth) { - this.pushStackLiteral('data'); - } else { - this.pushStackLiteral('this.data(data, ' + depth + ')'); - } - - this.resolvePath('data', parts, 0, true); - }, - - resolvePath: function resolvePath(type, parts, i, falsy) { - var _this = this; - - if (this.options.strict || this.options.assumeObjects) { - this.push(strictLookup(this.options.strict, this, parts, type)); - return; - } - - var len = parts.length; - for (; i < len; i++) { - /*eslint-disable no-loop-func */ - this.replaceStack(function (current) { - var lookup = _this.nameLookup(current, parts[i], type); - // We want to ensure that zero and false are handled properly if the context (falsy flag) - // needs to have the special handling for these values. - if (!falsy) { - return [' != null ? ', lookup, ' : ', current]; - } else { - // Otherwise we can use generic falsy handling - return [' && ', lookup]; - } - }); - /*eslint-enable no-loop-func */ - } - }, - - // [resolvePossibleLambda] - // - // On stack, before: value, ... - // On stack, after: resolved value, ... - // - // If the `value` is a lambda, replace it on the stack by - // the return value of the lambda - resolvePossibleLambda: function resolvePossibleLambda() { - this.push([this.aliasable('this.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); - }, - - // [pushStringParam] - // - // On stack, before: ... - // On stack, after: string, currentContext, ... - // - // This opcode is designed for use in string mode, which - // provides the string value of a parameter along with its - // depth rather than resolving it immediately. - pushStringParam: function pushStringParam(string, type) { - this.pushContext(); - this.pushString(type); - - // If it's a subexpression, the string result - // will be pushed after this opcode. - if (type !== 'SubExpression') { - if (typeof string === 'string') { - this.pushString(string); - } else { - this.pushStackLiteral(string); - } - } - }, - - emptyHash: function emptyHash(omitEmpty) { - if (this.trackIds) { - this.push('{}'); // hashIds - } - if (this.stringParams) { - this.push('{}'); // hashContexts - this.push('{}'); // hashTypes - } - this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); - }, - pushHash: function pushHash() { - if (this.hash) { - this.hashes.push(this.hash); - } - this.hash = { values: [], types: [], contexts: [], ids: [] }; - }, - popHash: function popHash() { - var hash = this.hash; - this.hash = this.hashes.pop(); - - if (this.trackIds) { - this.push(this.objectLiteral(hash.ids)); - } - if (this.stringParams) { - this.push(this.objectLiteral(hash.contexts)); - this.push(this.objectLiteral(hash.types)); - } - - this.push(this.objectLiteral(hash.values)); - }, - - // [pushString] - // - // On stack, before: ... - // On stack, after: quotedString(string), ... - // - // Push a quoted version of `string` onto the stack - pushString: function pushString(string) { - this.pushStackLiteral(this.quotedString(string)); - }, - - // [pushLiteral] - // - // On stack, before: ... - // On stack, after: value, ... - // - // Pushes a value onto the stack. This operation prevents - // the compiler from creating a temporary variable to hold - // it. - pushLiteral: function pushLiteral(value) { - this.pushStackLiteral(value); - }, - - // [pushProgram] - // - // On stack, before: ... - // On stack, after: program(guid), ... - // - // Push a program expression onto the stack. This takes - // a compile-time guid and converts it into a runtime-accessible - // expression. - pushProgram: function pushProgram(guid) { - if (guid != null) { - this.pushStackLiteral(this.programExpression(guid)); - } else { - this.pushStackLiteral(null); - } - }, - - // [invokeHelper] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of helper invocation - // - // Pops off the helper's parameters, invokes the helper, - // and pushes the helper's return value onto the stack. - // - // If the helper is not found, `helperMissing` is called. - invokeHelper: function invokeHelper(paramSize, name, isSimple) { - var nonHelper = this.popStack(), - helper = this.setupHelper(paramSize, name), - simple = isSimple ? [helper.name, ' || '] : ''; - - var lookup = ['('].concat(simple, nonHelper); - if (!this.options.strict) { - lookup.push(' || ', this.aliasable('helpers.helperMissing')); - } - lookup.push(')'); - - this.push(this.source.functionCall(lookup, 'call', helper.callParams)); - }, - - // [invokeKnownHelper] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of helper invocation - // - // This operation is used when the helper is known to exist, - // so a `helperMissing` fallback is not required. - invokeKnownHelper: function invokeKnownHelper(paramSize, name) { - var helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); - }, - - // [invokeAmbiguous] - // - // On stack, before: hash, inverse, program, params..., ... - // On stack, after: result of disambiguation - // - // This operation is used when an expression like `{{foo}}` - // is provided, but we don't know at compile-time whether it - // is a helper or a path. - // - // This operation emits more code than the other options, - // and can be avoided by passing the `knownHelpers` and - // `knownHelpersOnly` flags at compile-time. - invokeAmbiguous: function invokeAmbiguous(name, helperCall) { - this.useRegister('helper'); - - var nonHelper = this.popStack(); - - this.emptyHash(); - var helper = this.setupHelper(0, name, helperCall); - - var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); - - var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; - if (!this.options.strict) { - lookup[0] = '(helper = '; - lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing')); - } - - this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); - }, - - // [invokePartial] - // - // On stack, before: context, ... - // On stack after: result of partial invocation - // - // This operation pops off a context, invokes a partial with that context, - // and pushes the result of the invocation back. - invokePartial: function invokePartial(isDynamic, name, indent) { - var params = [], - options = this.setupParams(name, 1, params, false); - - if (isDynamic) { - name = this.popStack(); - delete options.name; - } - - if (indent) { - options.indent = JSON.stringify(indent); - } - options.helpers = 'helpers'; - options.partials = 'partials'; - - if (!isDynamic) { - params.unshift(this.nameLookup('partials', name, 'partial')); - } else { - params.unshift(name); - } - - if (this.options.compat) { - options.depths = 'depths'; - } - options = this.objectLiteral(options); - params.push(options); - - this.push(this.source.functionCall('this.invokePartial', '', params)); - }, - - // [assignToHash] - // - // On stack, before: value, ..., hash, ... - // On stack, after: ..., hash, ... - // - // Pops a value off the stack and assigns it to the current hash - assignToHash: function assignToHash(key) { - var value = this.popStack(), - context = undefined, - type = undefined, - id = undefined; - - if (this.trackIds) { - id = this.popStack(); - } - if (this.stringParams) { - type = this.popStack(); - context = this.popStack(); - } - - var hash = this.hash; - if (context) { - hash.contexts[key] = context; - } - if (type) { - hash.types[key] = type; - } - if (id) { - hash.ids[key] = id; - } - hash.values[key] = value; - }, - - pushId: function pushId(type, name, child) { - if (type === 'BlockParam') { - this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); - } else if (type === 'PathExpression') { - this.pushString(name); - } else if (type === 'SubExpression') { - this.pushStackLiteral('true'); - } else { - this.pushStackLiteral('null'); - } - }, - - // HELPERS - - compiler: JavaScriptCompiler, - - compileChildren: function compileChildren(environment, options) { - var children = environment.children, - child = undefined, - compiler = undefined; - - for (var i = 0, l = children.length; i < l; i++) { - child = children[i]; - compiler = new this.compiler(); // eslint-disable-line new-cap - - var index = this.matchExistingProgram(child); - - if (index == null) { - this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children - index = this.context.programs.length; - child.index = index; - child.name = 'program' + index; - this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); - this.context.environments[index] = child; - - this.useDepths = this.useDepths || compiler.useDepths; - this.useBlockParams = this.useBlockParams || compiler.useBlockParams; - } else { - child.index = index; - child.name = 'program' + index; - - this.useDepths = this.useDepths || child.useDepths; - this.useBlockParams = this.useBlockParams || child.useBlockParams; - } - } - }, - matchExistingProgram: function matchExistingProgram(child) { - for (var i = 0, len = this.context.environments.length; i < len; i++) { - var environment = this.context.environments[i]; - if (environment && environment.equals(child)) { - return i; - } - } - }, - - programExpression: function programExpression(guid) { - var child = this.environment.children[guid], - programParams = [child.index, 'data', child.blockParams]; - - if (this.useBlockParams || this.useDepths) { - programParams.push('blockParams'); - } - if (this.useDepths) { - programParams.push('depths'); - } - - return 'this.program(' + programParams.join(', ') + ')'; - }, - - useRegister: function useRegister(name) { - if (!this.registers[name]) { - this.registers[name] = true; - this.registers.list.push(name); - } - }, - - push: function push(expr) { - if (!(expr instanceof Literal)) { - expr = this.source.wrap(expr); - } - - this.inlineStack.push(expr); - return expr; - }, - - pushStackLiteral: function pushStackLiteral(item) { - this.push(new Literal(item)); - }, - - pushSource: function pushSource(source) { - if (this.pendingContent) { - this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); - this.pendingContent = undefined; - } - - if (source) { - this.source.push(source); - } - }, - - replaceStack: function replaceStack(callback) { - var prefix = ['('], - stack = undefined, - createdStack = undefined, - usedLiteral = undefined; - - /* istanbul ignore next */ - if (!this.isInline()) { - throw new _Exception2['default']('replaceStack on non-inline'); - } - - // We want to merge the inline statement into the replacement statement via ',' - var top = this.popStack(true); - - if (top instanceof Literal) { - // Literals do not need to be inlined - stack = [top.value]; - prefix = ['(', stack]; - usedLiteral = true; - } else { - // Get or create the current stack name for use by the inline - createdStack = true; - var _name = this.incrStack(); - - prefix = ['((', this.push(_name), ' = ', top, ')']; - stack = this.topStack(); - } - - var item = callback.call(this, stack); - - if (!usedLiteral) { - this.popStack(); - } - if (createdStack) { - this.stackSlot--; - } - this.push(prefix.concat(item, ')')); - }, - - incrStack: function incrStack() { - this.stackSlot++; - if (this.stackSlot > this.stackVars.length) { - this.stackVars.push('stack' + this.stackSlot); - } - return this.topStackName(); - }, - topStackName: function topStackName() { - return 'stack' + this.stackSlot; - }, - flushInline: function flushInline() { - var inlineStack = this.inlineStack; - this.inlineStack = []; - for (var i = 0, len = inlineStack.length; i < len; i++) { - var entry = inlineStack[i]; - /* istanbul ignore if */ - if (entry instanceof Literal) { - this.compileStack.push(entry); - } else { - var stack = this.incrStack(); - this.pushSource([stack, ' = ', entry, ';']); - this.compileStack.push(stack); - } - } - }, - isInline: function isInline() { - return this.inlineStack.length; - }, - - popStack: function popStack(wrapped) { - var inline = this.isInline(), - item = (inline ? this.inlineStack : this.compileStack).pop(); - - if (!wrapped && item instanceof Literal) { - return item.value; - } else { - if (!inline) { - /* istanbul ignore next */ - if (!this.stackSlot) { - throw new _Exception2['default']('Invalid stack pop'); - } - this.stackSlot--; - } - return item; - } - }, - - topStack: function topStack() { - var stack = this.isInline() ? this.inlineStack : this.compileStack, - item = stack[stack.length - 1]; - - /* istanbul ignore if */ - if (item instanceof Literal) { - return item.value; - } else { - return item; - } - }, - - contextName: function contextName(context) { - if (this.useDepths && context) { - return 'depths[' + context + ']'; - } else { - return 'depth' + context; - } - }, - - quotedString: function quotedString(str) { - return this.source.quotedString(str); - }, - - objectLiteral: function objectLiteral(obj) { - return this.source.objectLiteral(obj); - }, - - aliasable: function aliasable(name) { - var ret = this.aliases[name]; - if (ret) { - ret.referenceCount++; - return ret; - } - - ret = this.aliases[name] = this.source.wrap(name); - ret.aliasable = true; - ret.referenceCount = 1; - - return ret; - }, - - setupHelper: function setupHelper(paramSize, name, blockHelper) { - var params = [], - paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); - var foundHelper = this.nameLookup('helpers', name, 'helper'); - - return { - params: params, - paramsInit: paramsInit, - name: foundHelper, - callParams: [this.contextName(0)].concat(params) - }; - }, - - setupParams: function setupParams(helper, paramSize, params) { - var options = {}, - contexts = [], - types = [], - ids = [], - param = undefined; - - options.name = this.quotedString(helper); - options.hash = this.popStack(); - - if (this.trackIds) { - options.hashIds = this.popStack(); - } - if (this.stringParams) { - options.hashTypes = this.popStack(); - options.hashContexts = this.popStack(); - } - - var inverse = this.popStack(), - program = this.popStack(); - - // Avoid setting fn and inverse if neither are set. This allows - // helpers to do a check for `if (options.fn)` - if (program || inverse) { - options.fn = program || 'this.noop'; - options.inverse = inverse || 'this.noop'; - } - - // The parameters go on to the stack in order (making sure that they are evaluated in order) - // so we need to pop them off the stack in reverse order - var i = paramSize; - while (i--) { - param = this.popStack(); - params[i] = param; - - if (this.trackIds) { - ids[i] = this.popStack(); - } - if (this.stringParams) { - types[i] = this.popStack(); - contexts[i] = this.popStack(); - } - } - - if (this.trackIds) { - options.ids = this.source.generateArray(ids); - } - if (this.stringParams) { - options.types = this.source.generateArray(types); - options.contexts = this.source.generateArray(contexts); - } - - if (this.options.data) { - options.data = 'data'; - } - if (this.useBlockParams) { - options.blockParams = 'blockParams'; - } - return options; - }, - - setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { - var options = this.setupParams(helper, paramSize, params, true); - options = this.objectLiteral(options); - if (useRegister) { - this.useRegister('options'); - params.push('options'); - return ['options=', options]; - } else { - params.push(options); - return ''; - } - } - }; - - (function () { - var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); - - var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - - for (var i = 0, l = reservedWords.length; i < l; i++) { - compilerWords[reservedWords[i]] = true; - } - })(); - - JavaScriptCompiler.isValidJavaScriptVariableName = function (name) { - return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name); - }; - - function strictLookup(requireTerminal, compiler, parts, type) { - var stack = compiler.popStack(), - i = 0, - len = parts.length; - if (requireTerminal) { - len--; - } - - for (; i < len; i++) { - stack = compiler.nameLookup(stack, parts[i], type); - } - - if (requireTerminal) { - return [compiler.aliasable('this.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')']; - } else { - return stack; - } - } - - exports['default'] = JavaScriptCompiler; - module.exports = exports['default']; - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _AST = __webpack_require__(2); - - var _AST2 = _interopRequireWildcard(_AST); - - function Visitor() { - this.parents = []; - } - - Visitor.prototype = { - constructor: Visitor, - mutating: false, - - // Visits a given value. If mutating, will replace the value if necessary. - acceptKey: function acceptKey(node, name) { - var value = this.accept(node[name]); - if (this.mutating) { - // Hacky sanity check: - if (value && (!value.type || !_AST2['default'][value.type])) { - throw new _Exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); - } - node[name] = value; - } - }, - - // Performs an accept operation with added sanity check to ensure - // required keys are not removed. - acceptRequired: function acceptRequired(node, name) { - this.acceptKey(node, name); - - if (!node[name]) { - throw new _Exception2['default'](node.type + ' requires ' + name); - } - }, - - // Traverses a given array. If mutating, empty respnses will be removed - // for child elements. - acceptArray: function acceptArray(array) { - for (var i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - - if (!array[i]) { - array.splice(i, 1); - i--; - l--; - } - } - }, - - accept: function accept(object) { - if (!object) { - return; - } - - if (this.current) { - this.parents.unshift(this.current); - } - this.current = object; - - var ret = this[object.type](object); - - this.current = this.parents.shift(); - - if (!this.mutating || ret) { - return ret; - } else if (ret !== false) { - return object; - } - }, - - Program: function Program(program) { - this.acceptArray(program.body); - }, - - MustacheStatement: function MustacheStatement(mustache) { - this.acceptRequired(mustache, 'path'); - this.acceptArray(mustache.params); - this.acceptKey(mustache, 'hash'); - }, - - BlockStatement: function BlockStatement(block) { - this.acceptRequired(block, 'path'); - this.acceptArray(block.params); - this.acceptKey(block, 'hash'); - - this.acceptKey(block, 'program'); - this.acceptKey(block, 'inverse'); - }, - - PartialStatement: function PartialStatement(partial) { - this.acceptRequired(partial, 'name'); - this.acceptArray(partial.params); - this.acceptKey(partial, 'hash'); - }, - - ContentStatement: function ContentStatement() {}, - CommentStatement: function CommentStatement() {}, - - SubExpression: function SubExpression(sexpr) { - this.acceptRequired(sexpr, 'path'); - this.acceptArray(sexpr.params); - this.acceptKey(sexpr, 'hash'); - }, - - PathExpression: function PathExpression() {}, - - StringLiteral: function StringLiteral() {}, - NumberLiteral: function NumberLiteral() {}, - BooleanLiteral: function BooleanLiteral() {}, - UndefinedLiteral: function UndefinedLiteral() {}, - NullLiteral: function NullLiteral() {}, - - Hash: function Hash(hash) { - this.acceptArray(hash.pairs); - }, - HashPair: function HashPair(pair) { - this.acceptRequired(pair, 'value'); - } - }; - - exports['default'] = Visitor; - module.exports = exports['default']; - /* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */ - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {'use strict'; - - exports.__esModule = true; - /*global window */ - - exports['default'] = function (Handlebars) { - /* istanbul ignore next */ - var root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function () { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - }; - }; - - module.exports = exports['default']; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports["default"] = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; - - exports.__esModule = true; - -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - exports.HandlebarsEnvironment = HandlebarsEnvironment; - exports.createFrame = createFrame; - - var _import = __webpack_require__(12); - - var Utils = _interopRequireWildcard(_import); - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var VERSION = '3.0.1'; - exports.VERSION = VERSION; - var COMPILER_REVISION = 6; - - exports.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1' - }; - - exports.REVISION_CHANGES = REVISION_CHANGES; - var isArray = Utils.isArray, - isFunction = Utils.isFunction, - toString = Utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function registerHelper(name, fn) { - if (toString.call(name) === objectType) { - if (fn) { - throw new _Exception2['default']('Arg not supported with multiple helpers'); - } - Utils.extend(this.helpers, name); - } else { - this.helpers[name] = fn; - } - }, - unregisterHelper: function unregisterHelper(name) { - delete this.helpers[name]; - }, - - registerPartial: function registerPartial(name, partial) { - if (toString.call(name) === objectType) { - Utils.extend(this.partials, name); - } else { - if (typeof partial === 'undefined') { - throw new _Exception2['default']('Attempting to register a partial as undefined'); - } - this.partials[name] = partial; - } - }, - unregisterPartial: function unregisterPartial(name) { - delete this.partials[name]; - } - }; - - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function () { - if (arguments.length === 1) { - // A missing field in a {{foo}} constuct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); - } - }); - - instance.registerHelper('blockHelperMissing', function (context, options) { - var inverse = options.inverse, - fn = options.fn; - - if (context === true) { - return fn(this); - } else if (context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if (context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } - - return instance.helpers.each(context, options); - } else { - return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; - } - - return fn(context, options); - } - }); - - instance.registerHelper('each', function (context, options) { - if (!options) { - throw new _Exception2['default']('Must pass iterator to #each'); - } - - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; - - if (options.data && options.ids) { - contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (isFunction(context)) { - context = context.call(this); - } - - if (options.data) { - data = createFrame(options.data); - } - - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: Utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { - if (isArray(context)) { - for (var j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); - } - } else { - var priorKey = undefined; - - for (var key in context) { - if (context.hasOwnProperty(key)) { - // We're running the iterations one step out of sync so we can detect - // the last iteration without have to scan the object twice and create - // an itermediate keys array. - if (priorKey) { - execIteration(priorKey, i - 1); - } - priorKey = key; - i++; - } - } - if (priorKey) { - execIteration(priorKey, i - 1, true); - } - } - } - - if (i === 0) { - ret = inverse(this); - } - - return ret; - }); - - instance.registerHelper('if', function (conditional, options) { - if (isFunction(conditional)) { - conditional = conditional.call(this); - } - - // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the - // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. - if (!options.hash.includeZero && !conditional || Utils.isEmpty(conditional)) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); - - instance.registerHelper('unless', function (conditional, options) { - return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); - }); - - instance.registerHelper('with', function (context, options) { - if (isFunction(context)) { - context = context.call(this); - } - - var fn = options.fn; - - if (!Utils.isEmpty(context)) { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]); - options = { data: data }; - } - - return fn(context, options); - } else { - return options.inverse(this); - } - }); - - instance.registerHelper('log', function (message, options) { - var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1; - instance.log(level, message); - }); - - instance.registerHelper('lookup', function (obj, field) { - return obj && obj[field]; - }); - } - - var logger = { - methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' }, - - // State enum - DEBUG: 0, - INFO: 1, - WARN: 2, - ERROR: 3, - level: 1, - - // Can be overridden in the host environment - log: function log(level, message) { - if (typeof console !== 'undefined' && logger.level <= level) { - var method = logger.methodMap[level]; - (console[method] || console.log).call(console, message); // eslint-disable-line no-console - } - } - }; - - exports.logger = logger; - var log = logger.log; - - exports.log = log; - - function createFrame(object) { - var frame = Utils.extend({}, object); - frame._parent = object; - return frame; - } - - /* [args, ]options */ - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - // Build out our basic SafeString type - function SafeString(string) { - this.string = string; - } - - SafeString.prototype.toString = SafeString.prototype.toHTML = function () { - return '' + this.string; - }; - - exports['default'] = SafeString; - module.exports = exports['default']; - -/***/ }, -/* 11 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; - - message += ' - ' + line + ':' + column; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { - this.lineNumber = line; - this.column = column; - } - } - - Exception.prototype = new Error(); - - exports['default'] = Exception; - module.exports = exports['default']; - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - exports.extend = extend; - - // Older IE versions do not directly support indexOf so we must implement our own, sadly. - exports.indexOf = indexOf; - exports.escapeExpression = escapeExpression; - exports.isEmpty = isEmpty; - exports.blockParams = blockParams; - exports.appendContextPath = appendContextPath; - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' - }; - - var badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; - - function escapeChar(chr) { - return escape[chr]; - } - - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; - } - } - } - - return obj; - } - - var toString = Object.prototype.toString; - - exports.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - /*eslint-disable func-style, no-var */ - var isFunction = function isFunction(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; - }; - } - var isFunction; - exports.isFunction = isFunction; - /*eslint-enable func-style, no-var */ - - /* istanbul ignore next */ - var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; - };exports.isArray = isArray; - - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - return -1; - } - - function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - } - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - function blockParams(params, ids) { - params.path = ids; - return params; - } - - function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } - -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - exports.checkRevision = checkRevision; - - // TODO: Remove this line and break up compilePartial - - exports.template = template; - exports.wrapProgram = wrapProgram; - exports.resolvePartial = resolvePartial; - exports.invokePartial = invokePartial; - exports.noop = noop; - - var _import = __webpack_require__(12); - - var Utils = _interopRequireWildcard(_import); - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _COMPILER_REVISION$REVISION_CHANGES$createFrame = __webpack_require__(9); - - function checkRevision(compilerInfo) { - var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION; - - if (compilerRevision !== currentRevision) { - if (compilerRevision < currentRevision) { - var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision], - compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision]; - throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); - } else { - // Use the embedded version info since the runtime doesn't know about this revision yet - throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); - } - } - } - - function template(templateSpec, env) { - /* istanbul ignore next */ - if (!env) { - throw new _Exception2['default']('No environment passed to template'); - } - if (!templateSpec || !templateSpec.main) { - throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec); - } - - // Note: Using env.VM references rather than local var references throughout this section to allow - // for external users to override these as psuedo-supported APIs. - env.VM.checkRevision(templateSpec.compiler); - - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = Utils.extend({}, context, options.hash); - } - - partial = env.VM.resolvePartial.call(this, partial, context, options); - var result = env.VM.invokePartial.call(this, partial, context, options); - - if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); - } - if (result != null) { - if (options.indent) { - var lines = result.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - if (!lines[i] && i + 1 === l) { - break; - } - - lines[i] = options.indent + lines[i]; - } - result = lines.join('\n'); - } - return result; - } else { - throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); - } - } - - // Just add water - var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _Exception2['default']('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, - lookup: function lookup(depths, name) { - var len = depths.length; - for (var i = 0; i < len; i++) { - if (depths[i] && depths[i][name] != null) { - return depths[i][name]; - } - } - }, - lambda: function lambda(current, context) { - return typeof current === 'function' ? current.call(context) : current; - }, - - escapeExpression: Utils.escapeExpression, - invokePartial: invokePartialWrapper, - - fn: function fn(i) { - return templateSpec[i]; - }, - - programs: [], - program: function program(i, data, declaredBlockParams, blockParams, depths) { - var programWrapper = this.programs[i], - fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); - } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); - } - return programWrapper; - }, - - data: function data(value, depth) { - while (value && depth--) { - value = value._parent; - } - return value; - }, - merge: function merge(param, common) { - var obj = param || common; - - if (param && common && param !== common) { - obj = Utils.extend({}, common, param); - } - - return obj; - }, - - noop: env.VM.noop, - compilerInfo: templateSpec.compiler - }; - - function ret(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - var data = options.data; - - ret._setup(options); - if (!options.partial && templateSpec.useData) { - data = initData(context, data); - } - var depths = undefined, - blockParams = templateSpec.useBlockParams ? [] : undefined; - if (templateSpec.useDepths) { - depths = options.depths ? [context].concat(options.depths) : [context]; - } - - return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); - } - ret.isTop = true; - - ret._setup = function (options) { - if (!options.partial) { - container.helpers = container.merge(options.helpers, env.helpers); - - if (templateSpec.usePartial) { - container.partials = container.merge(options.partials, env.partials); - } - } else { - container.helpers = options.helpers; - container.partials = options.partials; - } - }; - - ret._child = function (i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new _Exception2['default']('must pass block params'); - } - if (templateSpec.useDepths && !depths) { - throw new _Exception2['default']('must pass parent depths'); - } - - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); - }; - return ret; - } - - function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); - } - prog.program = i; - prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; - return prog; - } - - function resolvePartial(partial, context, options) { - if (!partial) { - partial = options.partials[options.name]; - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; - } - - function invokePartial(partial, context, options) { - options.partial = true; - - if (partial === undefined) { - throw new _Exception2['default']('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { - return partial(context, options); - } - } - - function noop() { - return ''; - } - - function initData(context, data) { - if (!data || !('root' in data)) { - data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {}; - data.root = context; - } - return data; - } - -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports.__esModule = true; - /* istanbul ignore next */ - /* Jison generated parser */ - var handlebars = (function () { - var parser = { trace: function trace() {}, - yy: {}, - symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, content: 12, COMMENT: 13, CONTENT: 14, openRawBlock: 15, END_RAW_BLOCK: 16, OPEN_RAW_BLOCK: 17, helperName: 18, openRawBlock_repetition0: 19, openRawBlock_option0: 20, CLOSE_RAW_BLOCK: 21, openBlock: 22, block_option0: 23, closeBlock: 24, openInverse: 25, block_option1: 26, OPEN_BLOCK: 27, openBlock_repetition0: 28, openBlock_option0: 29, openBlock_option1: 30, CLOSE: 31, OPEN_INVERSE: 32, openInverse_repetition0: 33, openInverse_option0: 34, openInverse_option1: 35, openInverseChain: 36, OPEN_INVERSE_CHAIN: 37, openInverseChain_repetition0: 38, openInverseChain_option0: 39, openInverseChain_option1: 40, inverseAndProgram: 41, INVERSE: 42, inverseChain: 43, inverseChain_option0: 44, OPEN_ENDBLOCK: 45, OPEN: 46, mustache_repetition0: 47, mustache_option0: 48, OPEN_UNESCAPED: 49, mustache_repetition1: 50, mustache_option1: 51, CLOSE_UNESCAPED: 52, OPEN_PARTIAL: 53, partialName: 54, partial_repetition0: 55, partial_option0: 56, param: 57, sexpr: 58, OPEN_SEXPR: 59, sexpr_repetition0: 60, sexpr_option0: 61, CLOSE_SEXPR: 62, hash: 63, hash_repetition_plus0: 64, hashSegment: 65, ID: 66, EQUALS: 67, blockParams: 68, OPEN_BLOCK_PARAMS: 69, blockParams_repetition_plus0: 70, CLOSE_BLOCK_PARAMS: 71, path: 72, dataName: 73, STRING: 74, NUMBER: 75, BOOLEAN: 76, UNDEFINED: 77, NULL: 78, DATA: 79, pathSegments: 80, SEP: 81, $accept: 0, $end: 1 }, - terminals_: { 2: "error", 5: "EOF", 13: "COMMENT", 14: "CONTENT", 16: "END_RAW_BLOCK", 17: "OPEN_RAW_BLOCK", 21: "CLOSE_RAW_BLOCK", 27: "OPEN_BLOCK", 31: "CLOSE", 32: "OPEN_INVERSE", 37: "OPEN_INVERSE_CHAIN", 42: "INVERSE", 45: "OPEN_ENDBLOCK", 46: "OPEN", 49: "OPEN_UNESCAPED", 52: "CLOSE_UNESCAPED", 53: "OPEN_PARTIAL", 59: "OPEN_SEXPR", 62: "CLOSE_SEXPR", 66: "ID", 67: "EQUALS", 69: "OPEN_BLOCK_PARAMS", 71: "CLOSE_BLOCK_PARAMS", 74: "STRING", 75: "NUMBER", 76: "BOOLEAN", 77: "UNDEFINED", 78: "NULL", 79: "DATA", 81: "SEP" }, - productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [12, 1], [10, 3], [15, 5], [9, 4], [9, 4], [22, 6], [25, 6], [36, 6], [41, 2], [43, 3], [43, 1], [24, 3], [8, 5], [8, 5], [11, 5], [57, 1], [57, 1], [58, 5], [63, 1], [65, 3], [68, 3], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [54, 1], [54, 1], [73, 2], [72, 1], [80, 3], [80, 1], [6, 0], [6, 2], [19, 0], [19, 2], [20, 0], [20, 1], [23, 0], [23, 1], [26, 0], [26, 1], [28, 0], [28, 2], [29, 0], [29, 1], [30, 0], [30, 1], [33, 0], [33, 2], [34, 0], [34, 1], [35, 0], [35, 1], [38, 0], [38, 2], [39, 0], [39, 1], [40, 0], [40, 1], [44, 0], [44, 1], [47, 0], [47, 2], [48, 0], [48, 1], [50, 0], [50, 2], [51, 0], [51, 1], [55, 0], [55, 2], [56, 0], [56, 1], [60, 0], [60, 2], [61, 0], [61, 1], [64, 1], [64, 2], [70, 1], [70, 2]], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { - - var $0 = $$.length - 1; - switch (yystate) { - case 1: - return $$[$0 - 1]; - break; - case 2: - this.$ = new yy.Program($$[$0], null, {}, yy.locInfo(this._$)); - break; - case 3: - this.$ = $$[$0]; - break; - case 4: - this.$ = $$[$0]; - break; - case 5: - this.$ = $$[$0]; - break; - case 6: - this.$ = $$[$0]; - break; - case 7: - this.$ = $$[$0]; - break; - case 8: - this.$ = new yy.CommentStatement(yy.stripComment($$[$0]), yy.stripFlags($$[$0], $$[$0]), yy.locInfo(this._$)); - break; - case 9: - this.$ = new yy.ContentStatement($$[$0], yy.locInfo(this._$)); - break; - case 10: - this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); - break; - case 11: - this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; - break; - case 12: - this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); - break; - case 13: - this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); - break; - case 14: - this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; - break; - case 15: - this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; - break; - case 16: - this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; - break; - case 17: - this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; - break; - case 18: - var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), - program = new yy.Program([inverse], null, {}, yy.locInfo(this._$)); - program.chained = true; - - this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; - - break; - case 19: - this.$ = $$[$0]; - break; - case 20: - this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; - break; - case 21: - this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); - break; - case 22: - this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); - break; - case 23: - this.$ = new yy.PartialStatement($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], yy.stripFlags($$[$0 - 4], $$[$0]), yy.locInfo(this._$)); - break; - case 24: - this.$ = $$[$0]; - break; - case 25: - this.$ = $$[$0]; - break; - case 26: - this.$ = new yy.SubExpression($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], yy.locInfo(this._$)); - break; - case 27: - this.$ = new yy.Hash($$[$0], yy.locInfo(this._$)); - break; - case 28: - this.$ = new yy.HashPair(yy.id($$[$0 - 2]), $$[$0], yy.locInfo(this._$)); - break; - case 29: - this.$ = yy.id($$[$0 - 1]); - break; - case 30: - this.$ = $$[$0]; - break; - case 31: - this.$ = $$[$0]; - break; - case 32: - this.$ = new yy.StringLiteral($$[$0], yy.locInfo(this._$)); - break; - case 33: - this.$ = new yy.NumberLiteral($$[$0], yy.locInfo(this._$)); - break; - case 34: - this.$ = new yy.BooleanLiteral($$[$0], yy.locInfo(this._$)); - break; - case 35: - this.$ = new yy.UndefinedLiteral(yy.locInfo(this._$)); - break; - case 36: - this.$ = new yy.NullLiteral(yy.locInfo(this._$)); - break; - case 37: - this.$ = $$[$0]; - break; - case 38: - this.$ = $$[$0]; - break; - case 39: - this.$ = yy.preparePath(true, $$[$0], this._$); - break; - case 40: - this.$ = yy.preparePath(false, $$[$0], this._$); - break; - case 41: - $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2]; - break; - case 42: - this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; - break; - case 43: - this.$ = []; - break; - case 44: - $$[$0 - 1].push($$[$0]); - break; - case 45: - this.$ = []; - break; - case 46: - $$[$0 - 1].push($$[$0]); - break; - case 53: - this.$ = []; - break; - case 54: - $$[$0 - 1].push($$[$0]); - break; - case 59: - this.$ = []; - break; - case 60: - $$[$0 - 1].push($$[$0]); - break; - case 65: - this.$ = []; - break; - case 66: - $$[$0 - 1].push($$[$0]); - break; - case 73: - this.$ = []; - break; - case 74: - $$[$0 - 1].push($$[$0]); - break; - case 77: - this.$ = []; - break; - case 78: - $$[$0 - 1].push($$[$0]); - break; - case 81: - this.$ = []; - break; - case 82: - $$[$0 - 1].push($$[$0]); - break; - case 85: - this.$ = []; - break; - case 86: - $$[$0 - 1].push($$[$0]); - break; - case 89: - this.$ = [$$[$0]]; - break; - case 90: - $$[$0 - 1].push($$[$0]); - break; - case 91: - this.$ = [$$[$0]]; - break; - case 92: - $$[$0 - 1].push($$[$0]); - break; - } - }, - table: [{ 3: 1, 4: 2, 5: [2, 43], 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: [1, 11], 14: [1, 18], 15: 16, 17: [1, 21], 22: 14, 25: 15, 27: [1, 19], 32: [1, 20], 37: [2, 2], 42: [2, 2], 45: [2, 2], 46: [1, 12], 49: [1, 13], 53: [1, 17] }, { 1: [2, 1] }, { 5: [2, 44], 13: [2, 44], 14: [2, 44], 17: [2, 44], 27: [2, 44], 32: [2, 44], 37: [2, 44], 42: [2, 44], 45: [2, 44], 46: [2, 44], 49: [2, 44], 53: [2, 44] }, { 5: [2, 3], 13: [2, 3], 14: [2, 3], 17: [2, 3], 27: [2, 3], 32: [2, 3], 37: [2, 3], 42: [2, 3], 45: [2, 3], 46: [2, 3], 49: [2, 3], 53: [2, 3] }, { 5: [2, 4], 13: [2, 4], 14: [2, 4], 17: [2, 4], 27: [2, 4], 32: [2, 4], 37: [2, 4], 42: [2, 4], 45: [2, 4], 46: [2, 4], 49: [2, 4], 53: [2, 4] }, { 5: [2, 5], 13: [2, 5], 14: [2, 5], 17: [2, 5], 27: [2, 5], 32: [2, 5], 37: [2, 5], 42: [2, 5], 45: [2, 5], 46: [2, 5], 49: [2, 5], 53: [2, 5] }, { 5: [2, 6], 13: [2, 6], 14: [2, 6], 17: [2, 6], 27: [2, 6], 32: [2, 6], 37: [2, 6], 42: [2, 6], 45: [2, 6], 46: [2, 6], 49: [2, 6], 53: [2, 6] }, { 5: [2, 7], 13: [2, 7], 14: [2, 7], 17: [2, 7], 27: [2, 7], 32: [2, 7], 37: [2, 7], 42: [2, 7], 45: [2, 7], 46: [2, 7], 49: [2, 7], 53: [2, 7] }, { 5: [2, 8], 13: [2, 8], 14: [2, 8], 17: [2, 8], 27: [2, 8], 32: [2, 8], 37: [2, 8], 42: [2, 8], 45: [2, 8], 46: [2, 8], 49: [2, 8], 53: [2, 8] }, { 18: 22, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 33, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 4: 34, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 37: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 4: 35, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 12: 36, 14: [1, 18] }, { 18: 38, 54: 37, 58: 39, 59: [1, 40], 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 9], 13: [2, 9], 14: [2, 9], 16: [2, 9], 17: [2, 9], 27: [2, 9], 32: [2, 9], 37: [2, 9], 42: [2, 9], 45: [2, 9], 46: [2, 9], 49: [2, 9], 53: [2, 9] }, { 18: 41, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 42, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 43, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 31: [2, 73], 47: 44, 59: [2, 73], 66: [2, 73], 74: [2, 73], 75: [2, 73], 76: [2, 73], 77: [2, 73], 78: [2, 73], 79: [2, 73] }, { 21: [2, 30], 31: [2, 30], 52: [2, 30], 59: [2, 30], 62: [2, 30], 66: [2, 30], 69: [2, 30], 74: [2, 30], 75: [2, 30], 76: [2, 30], 77: [2, 30], 78: [2, 30], 79: [2, 30] }, { 21: [2, 31], 31: [2, 31], 52: [2, 31], 59: [2, 31], 62: [2, 31], 66: [2, 31], 69: [2, 31], 74: [2, 31], 75: [2, 31], 76: [2, 31], 77: [2, 31], 78: [2, 31], 79: [2, 31] }, { 21: [2, 32], 31: [2, 32], 52: [2, 32], 59: [2, 32], 62: [2, 32], 66: [2, 32], 69: [2, 32], 74: [2, 32], 75: [2, 32], 76: [2, 32], 77: [2, 32], 78: [2, 32], 79: [2, 32] }, { 21: [2, 33], 31: [2, 33], 52: [2, 33], 59: [2, 33], 62: [2, 33], 66: [2, 33], 69: [2, 33], 74: [2, 33], 75: [2, 33], 76: [2, 33], 77: [2, 33], 78: [2, 33], 79: [2, 33] }, { 21: [2, 34], 31: [2, 34], 52: [2, 34], 59: [2, 34], 62: [2, 34], 66: [2, 34], 69: [2, 34], 74: [2, 34], 75: [2, 34], 76: [2, 34], 77: [2, 34], 78: [2, 34], 79: [2, 34] }, { 21: [2, 35], 31: [2, 35], 52: [2, 35], 59: [2, 35], 62: [2, 35], 66: [2, 35], 69: [2, 35], 74: [2, 35], 75: [2, 35], 76: [2, 35], 77: [2, 35], 78: [2, 35], 79: [2, 35] }, { 21: [2, 36], 31: [2, 36], 52: [2, 36], 59: [2, 36], 62: [2, 36], 66: [2, 36], 69: [2, 36], 74: [2, 36], 75: [2, 36], 76: [2, 36], 77: [2, 36], 78: [2, 36], 79: [2, 36] }, { 21: [2, 40], 31: [2, 40], 52: [2, 40], 59: [2, 40], 62: [2, 40], 66: [2, 40], 69: [2, 40], 74: [2, 40], 75: [2, 40], 76: [2, 40], 77: [2, 40], 78: [2, 40], 79: [2, 40], 81: [1, 45] }, { 66: [1, 32], 80: 46 }, { 21: [2, 42], 31: [2, 42], 52: [2, 42], 59: [2, 42], 62: [2, 42], 66: [2, 42], 69: [2, 42], 74: [2, 42], 75: [2, 42], 76: [2, 42], 77: [2, 42], 78: [2, 42], 79: [2, 42], 81: [2, 42] }, { 50: 47, 52: [2, 77], 59: [2, 77], 66: [2, 77], 74: [2, 77], 75: [2, 77], 76: [2, 77], 77: [2, 77], 78: [2, 77], 79: [2, 77] }, { 23: 48, 36: 50, 37: [1, 52], 41: 51, 42: [1, 53], 43: 49, 45: [2, 49] }, { 26: 54, 41: 55, 42: [1, 53], 45: [2, 51] }, { 16: [1, 56] }, { 31: [2, 81], 55: 57, 59: [2, 81], 66: [2, 81], 74: [2, 81], 75: [2, 81], 76: [2, 81], 77: [2, 81], 78: [2, 81], 79: [2, 81] }, { 31: [2, 37], 59: [2, 37], 66: [2, 37], 74: [2, 37], 75: [2, 37], 76: [2, 37], 77: [2, 37], 78: [2, 37], 79: [2, 37] }, { 31: [2, 38], 59: [2, 38], 66: [2, 38], 74: [2, 38], 75: [2, 38], 76: [2, 38], 77: [2, 38], 78: [2, 38], 79: [2, 38] }, { 18: 58, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 28: 59, 31: [2, 53], 59: [2, 53], 66: [2, 53], 69: [2, 53], 74: [2, 53], 75: [2, 53], 76: [2, 53], 77: [2, 53], 78: [2, 53], 79: [2, 53] }, { 31: [2, 59], 33: 60, 59: [2, 59], 66: [2, 59], 69: [2, 59], 74: [2, 59], 75: [2, 59], 76: [2, 59], 77: [2, 59], 78: [2, 59], 79: [2, 59] }, { 19: 61, 21: [2, 45], 59: [2, 45], 66: [2, 45], 74: [2, 45], 75: [2, 45], 76: [2, 45], 77: [2, 45], 78: [2, 45], 79: [2, 45] }, { 18: 65, 31: [2, 75], 48: 62, 57: 63, 58: 66, 59: [1, 40], 63: 64, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 66: [1, 70] }, { 21: [2, 39], 31: [2, 39], 52: [2, 39], 59: [2, 39], 62: [2, 39], 66: [2, 39], 69: [2, 39], 74: [2, 39], 75: [2, 39], 76: [2, 39], 77: [2, 39], 78: [2, 39], 79: [2, 39], 81: [1, 45] }, { 18: 65, 51: 71, 52: [2, 79], 57: 72, 58: 66, 59: [1, 40], 63: 73, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 24: 74, 45: [1, 75] }, { 45: [2, 50] }, { 4: 76, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 37: [2, 43], 42: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 45: [2, 19] }, { 18: 77, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 4: 78, 6: 3, 13: [2, 43], 14: [2, 43], 17: [2, 43], 27: [2, 43], 32: [2, 43], 45: [2, 43], 46: [2, 43], 49: [2, 43], 53: [2, 43] }, { 24: 79, 45: [1, 75] }, { 45: [2, 52] }, { 5: [2, 10], 13: [2, 10], 14: [2, 10], 17: [2, 10], 27: [2, 10], 32: [2, 10], 37: [2, 10], 42: [2, 10], 45: [2, 10], 46: [2, 10], 49: [2, 10], 53: [2, 10] }, { 18: 65, 31: [2, 83], 56: 80, 57: 81, 58: 66, 59: [1, 40], 63: 82, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 59: [2, 85], 60: 83, 62: [2, 85], 66: [2, 85], 74: [2, 85], 75: [2, 85], 76: [2, 85], 77: [2, 85], 78: [2, 85], 79: [2, 85] }, { 18: 65, 29: 84, 31: [2, 55], 57: 85, 58: 66, 59: [1, 40], 63: 86, 64: 67, 65: 68, 66: [1, 69], 69: [2, 55], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 65, 31: [2, 61], 34: 87, 57: 88, 58: 66, 59: [1, 40], 63: 89, 64: 67, 65: 68, 66: [1, 69], 69: [2, 61], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 18: 65, 20: 90, 21: [2, 47], 57: 91, 58: 66, 59: [1, 40], 63: 92, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 31: [1, 93] }, { 31: [2, 74], 59: [2, 74], 66: [2, 74], 74: [2, 74], 75: [2, 74], 76: [2, 74], 77: [2, 74], 78: [2, 74], 79: [2, 74] }, { 31: [2, 76] }, { 21: [2, 24], 31: [2, 24], 52: [2, 24], 59: [2, 24], 62: [2, 24], 66: [2, 24], 69: [2, 24], 74: [2, 24], 75: [2, 24], 76: [2, 24], 77: [2, 24], 78: [2, 24], 79: [2, 24] }, { 21: [2, 25], 31: [2, 25], 52: [2, 25], 59: [2, 25], 62: [2, 25], 66: [2, 25], 69: [2, 25], 74: [2, 25], 75: [2, 25], 76: [2, 25], 77: [2, 25], 78: [2, 25], 79: [2, 25] }, { 21: [2, 27], 31: [2, 27], 52: [2, 27], 62: [2, 27], 65: 94, 66: [1, 95], 69: [2, 27] }, { 21: [2, 89], 31: [2, 89], 52: [2, 89], 62: [2, 89], 66: [2, 89], 69: [2, 89] }, { 21: [2, 42], 31: [2, 42], 52: [2, 42], 59: [2, 42], 62: [2, 42], 66: [2, 42], 67: [1, 96], 69: [2, 42], 74: [2, 42], 75: [2, 42], 76: [2, 42], 77: [2, 42], 78: [2, 42], 79: [2, 42], 81: [2, 42] }, { 21: [2, 41], 31: [2, 41], 52: [2, 41], 59: [2, 41], 62: [2, 41], 66: [2, 41], 69: [2, 41], 74: [2, 41], 75: [2, 41], 76: [2, 41], 77: [2, 41], 78: [2, 41], 79: [2, 41], 81: [2, 41] }, { 52: [1, 97] }, { 52: [2, 78], 59: [2, 78], 66: [2, 78], 74: [2, 78], 75: [2, 78], 76: [2, 78], 77: [2, 78], 78: [2, 78], 79: [2, 78] }, { 52: [2, 80] }, { 5: [2, 12], 13: [2, 12], 14: [2, 12], 17: [2, 12], 27: [2, 12], 32: [2, 12], 37: [2, 12], 42: [2, 12], 45: [2, 12], 46: [2, 12], 49: [2, 12], 53: [2, 12] }, { 18: 98, 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 36: 50, 37: [1, 52], 41: 51, 42: [1, 53], 43: 100, 44: 99, 45: [2, 71] }, { 31: [2, 65], 38: 101, 59: [2, 65], 66: [2, 65], 69: [2, 65], 74: [2, 65], 75: [2, 65], 76: [2, 65], 77: [2, 65], 78: [2, 65], 79: [2, 65] }, { 45: [2, 17] }, { 5: [2, 13], 13: [2, 13], 14: [2, 13], 17: [2, 13], 27: [2, 13], 32: [2, 13], 37: [2, 13], 42: [2, 13], 45: [2, 13], 46: [2, 13], 49: [2, 13], 53: [2, 13] }, { 31: [1, 102] }, { 31: [2, 82], 59: [2, 82], 66: [2, 82], 74: [2, 82], 75: [2, 82], 76: [2, 82], 77: [2, 82], 78: [2, 82], 79: [2, 82] }, { 31: [2, 84] }, { 18: 65, 57: 104, 58: 66, 59: [1, 40], 61: 103, 62: [2, 87], 63: 105, 64: 67, 65: 68, 66: [1, 69], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 30: 106, 31: [2, 57], 68: 107, 69: [1, 108] }, { 31: [2, 54], 59: [2, 54], 66: [2, 54], 69: [2, 54], 74: [2, 54], 75: [2, 54], 76: [2, 54], 77: [2, 54], 78: [2, 54], 79: [2, 54] }, { 31: [2, 56], 69: [2, 56] }, { 31: [2, 63], 35: 109, 68: 110, 69: [1, 108] }, { 31: [2, 60], 59: [2, 60], 66: [2, 60], 69: [2, 60], 74: [2, 60], 75: [2, 60], 76: [2, 60], 77: [2, 60], 78: [2, 60], 79: [2, 60] }, { 31: [2, 62], 69: [2, 62] }, { 21: [1, 111] }, { 21: [2, 46], 59: [2, 46], 66: [2, 46], 74: [2, 46], 75: [2, 46], 76: [2, 46], 77: [2, 46], 78: [2, 46], 79: [2, 46] }, { 21: [2, 48] }, { 5: [2, 21], 13: [2, 21], 14: [2, 21], 17: [2, 21], 27: [2, 21], 32: [2, 21], 37: [2, 21], 42: [2, 21], 45: [2, 21], 46: [2, 21], 49: [2, 21], 53: [2, 21] }, { 21: [2, 90], 31: [2, 90], 52: [2, 90], 62: [2, 90], 66: [2, 90], 69: [2, 90] }, { 67: [1, 96] }, { 18: 65, 57: 112, 58: 66, 59: [1, 40], 66: [1, 32], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 22], 13: [2, 22], 14: [2, 22], 17: [2, 22], 27: [2, 22], 32: [2, 22], 37: [2, 22], 42: [2, 22], 45: [2, 22], 46: [2, 22], 49: [2, 22], 53: [2, 22] }, { 31: [1, 113] }, { 45: [2, 18] }, { 45: [2, 72] }, { 18: 65, 31: [2, 67], 39: 114, 57: 115, 58: 66, 59: [1, 40], 63: 116, 64: 67, 65: 68, 66: [1, 69], 69: [2, 67], 72: 23, 73: 24, 74: [1, 25], 75: [1, 26], 76: [1, 27], 77: [1, 28], 78: [1, 29], 79: [1, 31], 80: 30 }, { 5: [2, 23], 13: [2, 23], 14: [2, 23], 17: [2, 23], 27: [2, 23], 32: [2, 23], 37: [2, 23], 42: [2, 23], 45: [2, 23], 46: [2, 23], 49: [2, 23], 53: [2, 23] }, { 62: [1, 117] }, { 59: [2, 86], 62: [2, 86], 66: [2, 86], 74: [2, 86], 75: [2, 86], 76: [2, 86], 77: [2, 86], 78: [2, 86], 79: [2, 86] }, { 62: [2, 88] }, { 31: [1, 118] }, { 31: [2, 58] }, { 66: [1, 120], 70: 119 }, { 31: [1, 121] }, { 31: [2, 64] }, { 14: [2, 11] }, { 21: [2, 28], 31: [2, 28], 52: [2, 28], 62: [2, 28], 66: [2, 28], 69: [2, 28] }, { 5: [2, 20], 13: [2, 20], 14: [2, 20], 17: [2, 20], 27: [2, 20], 32: [2, 20], 37: [2, 20], 42: [2, 20], 45: [2, 20], 46: [2, 20], 49: [2, 20], 53: [2, 20] }, { 31: [2, 69], 40: 122, 68: 123, 69: [1, 108] }, { 31: [2, 66], 59: [2, 66], 66: [2, 66], 69: [2, 66], 74: [2, 66], 75: [2, 66], 76: [2, 66], 77: [2, 66], 78: [2, 66], 79: [2, 66] }, { 31: [2, 68], 69: [2, 68] }, { 21: [2, 26], 31: [2, 26], 52: [2, 26], 59: [2, 26], 62: [2, 26], 66: [2, 26], 69: [2, 26], 74: [2, 26], 75: [2, 26], 76: [2, 26], 77: [2, 26], 78: [2, 26], 79: [2, 26] }, { 13: [2, 14], 14: [2, 14], 17: [2, 14], 27: [2, 14], 32: [2, 14], 37: [2, 14], 42: [2, 14], 45: [2, 14], 46: [2, 14], 49: [2, 14], 53: [2, 14] }, { 66: [1, 125], 71: [1, 124] }, { 66: [2, 91], 71: [2, 91] }, { 13: [2, 15], 14: [2, 15], 17: [2, 15], 27: [2, 15], 32: [2, 15], 42: [2, 15], 45: [2, 15], 46: [2, 15], 49: [2, 15], 53: [2, 15] }, { 31: [1, 126] }, { 31: [2, 70] }, { 31: [2, 29] }, { 66: [2, 92], 71: [2, 92] }, { 13: [2, 16], 14: [2, 16], 17: [2, 16], 27: [2, 16], 32: [2, 16], 37: [2, 16], 42: [2, 16], 45: [2, 16], 46: [2, 16], 49: [2, 16], 53: [2, 16] }], - defaultActions: { 4: [2, 1], 49: [2, 50], 51: [2, 19], 55: [2, 52], 64: [2, 76], 73: [2, 80], 78: [2, 17], 82: [2, 84], 92: [2, 48], 99: [2, 18], 100: [2, 72], 105: [2, 88], 107: [2, 58], 110: [2, 64], 111: [2, 11], 123: [2, 70], 124: [2, 29] }, - parseError: function parseError(str, hash) { - throw new Error(str); - }, - parse: function parse(input) { - var self = this, - stack = [0], - vstack = [null], - lstack = [], - table = this.table, - yytext = "", - yylineno = 0, - yyleng = 0, - recovering = 0, - TERROR = 2, - EOF = 1; - this.lexer.setInput(input); - this.lexer.yy = this.yy; - this.yy.lexer = this.lexer; - this.yy.parser = this; - if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; - var yyloc = this.lexer.yylloc; - lstack.push(yyloc); - var ranges = this.lexer.options && this.lexer.options.ranges; - if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = self.lexer.lex() || 1; - if (typeof token !== "number") { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, - preErrorSymbol, - state, - action, - a, - r, - yyval = {}, - p, - len, - newState, - expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == "undefined") { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === "undefined" || !action.length || !action[0]) { - var errStr = ""; - if (!recovering) { - expected = []; - for (p in table[state]) if (this.terminals_[p] && p > 2) { - expected.push("'" + this.terminals_[p] + "'"); - } - if (this.lexer.showPosition) { - errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; - } else { - errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); - } - this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); - } - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) recovering--; - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; - if (ranges) { - yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== "undefined") { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; - } - }; - /* Jison generated lexer */ - var lexer = (function () { - var lexer = { EOF: 1, - parseError: function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - setInput: function setInput(input) { - this._input = input; - this._more = this._less = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ""; - this.conditionStack = ["INITIAL"]; - this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; - if (this.options.ranges) this.yylloc.range = [0, 0]; - this.offset = 0; - return this; - }, - input: function input() { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) this.yylloc.range[1]++; - - this._input = this._input.slice(1); - return ch; - }, - unput: function unput(ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) this.yylineno -= lines.length - 1; - var r = this.yylloc.range; - - this.yylloc = { first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - return this; - }, - more: function more() { - this._more = true; - return this; - }, - less: function less(n) { - this.unput(this.match.slice(n)); - }, - pastInput: function pastInput() { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); - }, - upcomingInput: function upcomingInput() { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20 - next.length); - } - return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - showPosition: function showPosition() { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - next: function next() { - if (this.done) { - return this.EOF; - } - if (!this._input) this.done = true; - - var token, match, tempMatch, index, col, lines; - if (!this._more) { - this.yytext = ""; - this.match = ""; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (!this.options.flex) break; - } - } - if (match) { - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) this.yylineno += lines.length; - this.yylloc = { first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) this.done = false; - if (token) { - return token; - } else { - return; - } - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); - } - }, - lex: function lex() { - var r = this.next(); - if (typeof r !== "undefined") { - return r; - } else { - return this.lex(); - } - }, - begin: function begin(condition) { - this.conditionStack.push(condition); - }, - popState: function popState() { - return this.conditionStack.pop(); - }, - _currentRules: function _currentRules() { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - }, - topState: function topState() { - return this.conditionStack[this.conditionStack.length - 2]; - }, - pushState: function begin(condition) { - this.begin(condition); - } }; - lexer.options = {}; - lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { - - function strip(start, end) { - return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end); - } - - var YYSTATE = YY_START; - switch ($avoiding_name_collisions) { - case 0: - if (yy_.yytext.slice(-2) === "\\\\") { - strip(0, 1); - this.begin("mu"); - } else if (yy_.yytext.slice(-1) === "\\") { - strip(0, 1); - this.begin("emu"); - } else { - this.begin("mu"); - } - if (yy_.yytext) { - return 14; - }break; - case 1: - return 14; - break; - case 2: - this.popState(); - return 14; - - break; - case 3: - yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9); - this.popState(); - return 16; - - break; - case 4: - return 14; - break; - case 5: - this.popState(); - return 13; - - break; - case 6: - return 59; - break; - case 7: - return 62; - break; - case 8: - return 17; - break; - case 9: - this.popState(); - this.begin("raw"); - return 21; - - break; - case 10: - return 53; - break; - case 11: - return 27; - break; - case 12: - return 45; - break; - case 13: - this.popState();return 42; - break; - case 14: - this.popState();return 42; - break; - case 15: - return 32; - break; - case 16: - return 37; - break; - case 17: - return 49; - break; - case 18: - return 46; - break; - case 19: - this.unput(yy_.yytext); - this.popState(); - this.begin("com"); - - break; - case 20: - this.popState(); - return 13; - - break; - case 21: - return 46; - break; - case 22: - return 67; - break; - case 23: - return 66; - break; - case 24: - return 66; - break; - case 25: - return 81; - break; - case 26: - // ignore whitespace - break; - case 27: - this.popState();return 52; - break; - case 28: - this.popState();return 31; - break; - case 29: - yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74; - break; - case 30: - yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 74; - break; - case 31: - return 79; - break; - case 32: - return 76; - break; - case 33: - return 76; - break; - case 34: - return 77; - break; - case 35: - return 78; - break; - case 36: - return 75; - break; - case 37: - return 69; - break; - case 38: - return 71; - break; - case 39: - return 66; - break; - case 40: - return 66; - break; - case 41: - return "INVALID"; - break; - case 42: - return 5; - break; - } - }; - lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/]; - lexer.conditions = { mu: { rules: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } }; - return lexer; - })(); - parser.lexer = lexer; - function Parser() { - this.yy = {}; - }Parser.prototype = parser;parser.Parser = Parser; - return new Parser(); - })();exports["default"] = handlebars; - module.exports = exports["default"]; - -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - - var _Visitor = __webpack_require__(6); - - var _Visitor2 = _interopRequireWildcard(_Visitor); - - function WhitespaceControl() {} - WhitespaceControl.prototype = new _Visitor2['default'](); - - WhitespaceControl.prototype.Program = function (program) { - var isRoot = !this.isRootSeen; - this.isRootSeen = true; - - var body = program.body; - for (var i = 0, l = body.length; i < l; i++) { - var current = body[i], - strip = this.accept(current); - - if (!strip) { - continue; - } - - var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), - _isNextWhitespace = isNextWhitespace(body, i, isRoot), - openStandalone = strip.openStandalone && _isPrevWhitespace, - closeStandalone = strip.closeStandalone && _isNextWhitespace, - inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; - - if (strip.close) { - omitRight(body, i, true); - } - if (strip.open) { - omitLeft(body, i, true); - } - - if (inlineStandalone) { - omitRight(body, i); - - if (omitLeft(body, i)) { - // If we are on a standalone node, save the indent info for partials - if (current.type === 'PartialStatement') { - // Pull out the whitespace from the final line - current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; - } - } - } - if (openStandalone) { - omitRight((current.program || current.inverse).body); - - // Strip out the previous content node if it's whitespace only - omitLeft(body, i); - } - if (closeStandalone) { - // Always strip the next node - omitRight(body, i); - - omitLeft((current.inverse || current.program).body); - } - } - - return program; - }; - WhitespaceControl.prototype.BlockStatement = function (block) { - this.accept(block.program); - this.accept(block.inverse); - - // Find the inverse program that is involed with whitespace stripping. - var program = block.program || block.inverse, - inverse = block.program && block.inverse, - firstInverse = inverse, - lastInverse = inverse; - - if (inverse && inverse.chained) { - firstInverse = inverse.body[0].program; - - // Walk the inverse chain to find the last inverse that is actually in the chain. - while (lastInverse.chained) { - lastInverse = lastInverse.body[lastInverse.body.length - 1].program; - } - } - - var strip = { - open: block.openStrip.open, - close: block.closeStrip.close, - - // Determine the standalone candiacy. Basically flag our content as being possibly standalone - // so our parent can determine if we actually are standalone - openStandalone: isNextWhitespace(program.body), - closeStandalone: isPrevWhitespace((firstInverse || program).body) - }; - - if (block.openStrip.close) { - omitRight(program.body, null, true); - } - - if (inverse) { - var inverseStrip = block.inverseStrip; - - if (inverseStrip.open) { - omitLeft(program.body, null, true); - } - - if (inverseStrip.close) { - omitRight(firstInverse.body, null, true); - } - if (block.closeStrip.open) { - omitLeft(lastInverse.body, null, true); - } - - // Find standalone else statments - if (isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { - omitLeft(program.body); - omitRight(firstInverse.body); - } - } else if (block.closeStrip.open) { - omitLeft(program.body, null, true); - } - - return strip; - }; - - WhitespaceControl.prototype.MustacheStatement = function (mustache) { - return mustache.strip; - }; - - WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { - /* istanbul ignore next */ - var strip = node.strip || {}; - return { - inlineStandalone: true, - open: strip.open, - close: strip.close - }; - }; - - function isPrevWhitespace(body, i, isRoot) { - if (i === undefined) { - i = body.length; - } - - // Nodes that end with newlines are considered whitespace (but are special - // cased for strip operations) - var prev = body[i - 1], - sibling = body[i - 2]; - if (!prev) { - return isRoot; - } - - if (prev.type === 'ContentStatement') { - return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); - } - } - function isNextWhitespace(body, i, isRoot) { - if (i === undefined) { - i = -1; - } - - var next = body[i + 1], - sibling = body[i + 2]; - if (!next) { - return isRoot; - } - - if (next.type === 'ContentStatement') { - return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); - } - } - - // Marks the node to the right of the position as omitted. - // I.e. {{foo}}' ' will mark the ' ' node as omitted. - // - // If i is undefined, then the first child will be marked as such. - // - // If mulitple is truthy then all whitespace will be stripped out until non-whitespace - // content is met. - function omitRight(body, i, multiple) { - var current = body[i == null ? 0 : i + 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { - return; - } - - var original = current.value; - current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); - current.rightStripped = current.value !== original; - } - - // Marks the node to the left of the position as omitted. - // I.e. ' '{{foo}} will mark the ' ' node as omitted. - // - // If i is undefined then the last child will be marked as such. - // - // If mulitple is truthy then all whitespace will be stripped out until non-whitespace - // content is met. - function omitLeft(body, i, multiple) { - var current = body[i == null ? body.length - 1 : i - 1]; - if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { - return; - } - - // We omit the last node if it's whitespace only and not preceeded by a non-content node. - var original = current.value; - current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); - current.leftStripped = current.value !== original; - return current.leftStripped; - } - - exports['default'] = WhitespaceControl; - module.exports = exports['default']; - -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(8)['default']; - - exports.__esModule = true; - exports.SourceLocation = SourceLocation; - exports.id = id; - exports.stripFlags = stripFlags; - exports.stripComment = stripComment; - exports.preparePath = preparePath; - exports.prepareMustache = prepareMustache; - exports.prepareRawBlock = prepareRawBlock; - exports.prepareBlock = prepareBlock; - - var _Exception = __webpack_require__(11); - - var _Exception2 = _interopRequireWildcard(_Exception); - - function SourceLocation(source, locInfo) { - this.source = source; - this.start = { - line: locInfo.first_line, - column: locInfo.first_column - }; - this.end = { - line: locInfo.last_line, - column: locInfo.last_column - }; - } - - function id(token) { - if (/^\[.*\]$/.test(token)) { - return token.substr(1, token.length - 2); - } else { - return token; - } - } - - function stripFlags(open, close) { - return { - open: open.charAt(2) === '~', - close: close.charAt(close.length - 3) === '~' - }; - } - - function stripComment(comment) { - return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, ''); - } - - function preparePath(data, parts, locInfo) { - locInfo = this.locInfo(locInfo); - - var original = data ? '@' : '', - dig = [], - depth = 0, - depthString = ''; - - for (var i = 0, l = parts.length; i < l; i++) { - var part = parts[i].part, - - // If we have [] syntax then we do not treat path references as operators, - // i.e. foo.[this] resolves to approximately context.foo['this'] - isLiteral = parts[i].original !== part; - original += (parts[i].separator || '') + part; - - if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { - if (dig.length > 0) { - throw new _Exception2['default']('Invalid path: ' + original, { loc: locInfo }); - } else if (part === '..') { - depth++; - depthString += '../'; - } - } else { - dig.push(part); - } - } - - return new this.PathExpression(data, depth, dig, original, locInfo); - } - - function prepareMustache(path, params, hash, open, strip, locInfo) { - // Must use charAt to support IE pre-10 - var escapeFlag = open.charAt(3) || open.charAt(2), - escaped = escapeFlag !== '{' && escapeFlag !== '&'; - - return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo)); - } - - function prepareRawBlock(openRawBlock, content, close, locInfo) { - if (openRawBlock.path.original !== close) { - var errorNode = { loc: openRawBlock.path.loc }; - - throw new _Exception2['default'](openRawBlock.path.original + ' doesn\'t match ' + close, errorNode); - } - - locInfo = this.locInfo(locInfo); - var program = new this.Program([content], null, {}, locInfo); - - return new this.BlockStatement(openRawBlock.path, openRawBlock.params, openRawBlock.hash, program, undefined, {}, {}, {}, locInfo); - } - - function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { - // When we are chaining inverse calls, we will not have a close path - if (close && close.path && openBlock.path.original !== close.path.original) { - var errorNode = { loc: openBlock.path.loc }; - - throw new _Exception2['default'](openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); - } - - program.blockParams = openBlock.blockParams; - - var inverse = undefined, - inverseStrip = undefined; - - if (inverseAndProgram) { - if (inverseAndProgram.chain) { - inverseAndProgram.program.body[0].closeStrip = close.strip; - } - - inverseStrip = inverseAndProgram.strip; - inverse = inverseAndProgram.program; - } - - if (inverted) { - inverted = inverse; - inverse = program; - program = inverted; - } - - return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); - } - -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - /*global define */ - - var _isArray = __webpack_require__(12); - - var SourceNode = undefined; - - try { - /* istanbul ignore next */ - if (false) { - // We don't support this in AMD environments. For these environments, we asusme that - // they are running on the browser and thus have no need for the source-map library. - var SourceMap = require('source-map'); - SourceNode = SourceMap.SourceNode; - } - } catch (err) {} - - /* istanbul ignore if: tested but not covered in istanbul due to dist build */ - if (!SourceNode) { - SourceNode = function (line, column, srcFile, chunks) { - this.src = ''; - if (chunks) { - this.add(chunks); - } - }; - /* istanbul ignore next */ - SourceNode.prototype = { - add: function add(chunks) { - if (_isArray.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src += chunks; - }, - prepend: function prepend(chunks) { - if (_isArray.isArray(chunks)) { - chunks = chunks.join(''); - } - this.src = chunks + this.src; - }, - toStringWithSourceMap: function toStringWithSourceMap() { - return { code: this.toString() }; - }, - toString: function toString() { - return this.src; - } - }; - } - - function castChunk(chunk, codeGen, loc) { - if (_isArray.isArray(chunk)) { - var ret = []; - - for (var i = 0, len = chunk.length; i < len; i++) { - ret.push(codeGen.wrap(chunk[i], loc)); - } - return ret; - } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { - // Handle primitives that the SourceNode will throw up on - return chunk + ''; - } - return chunk; - } - - function CodeGen(srcFile) { - this.srcFile = srcFile; - this.source = []; - } - - CodeGen.prototype = { - prepend: function prepend(source, loc) { - this.source.unshift(this.wrap(source, loc)); - }, - push: function push(source, loc) { - this.source.push(this.wrap(source, loc)); - }, - - merge: function merge() { - var source = this.empty(); - this.each(function (line) { - source.add([' ', line, '\n']); - }); - return source; - }, - - each: function each(iter) { - for (var i = 0, len = this.source.length; i < len; i++) { - iter(this.source[i]); - } - }, - - empty: function empty() { - var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile); - }, - wrap: function wrap(chunk) { - var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; - - if (chunk instanceof SourceNode) { - return chunk; - } - - chunk = castChunk(chunk, this, loc); - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); - }, - - functionCall: function functionCall(fn, type, params) { - params = this.generateList(params); - return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); - }, - - quotedString: function quotedString(str) { - return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 - .replace(/\u2029/g, '\\u2029') + '"'; - }, - - objectLiteral: function objectLiteral(obj) { - var pairs = []; - - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - var value = castChunk(obj[key], this); - if (value !== 'undefined') { - pairs.push([this.quotedString(key), ':', value]); - } - } - } - - var ret = this.generateList(pairs); - ret.prepend('{'); - ret.add('}'); - return ret; - }, - - generateList: function generateList(entries, loc) { - var ret = this.empty(loc); - - for (var i = 0, len = entries.length; i < len; i++) { - if (i) { - ret.add(','); - } - - ret.add(castChunk(entries[i], this, loc)); - } - - return ret; - }, - - generateArray: function generateArray(entries, loc) { - var ret = this.generateList(entries, loc); - ret.prepend('['); - ret.add(']'); - - return ret; - } - }; - - exports['default'] = CodeGen; - module.exports = exports['default']; - - /* NOP */ - -/***/ } -/******/ ]) -}); -; \ No newline at end of file +/* exported Handlebars */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } else { + root.Handlebars = root.Handlebars || factory(); + } +}(this, function () { +// handlebars/safe-string.js +var __module4__ = (function() { + "use strict"; + var __exports__; + // Build out our basic SafeString type + function SafeString(string) { + this.string = string; + } + + SafeString.prototype.toString = function() { + return "" + this.string; + }; + + __exports__ = SafeString; + return __exports__; +})(); + +// handlebars/utils.js +var __module3__ = (function(__dependency1__) { + "use strict"; + var __exports__ = {}; + /*jshint -W004 */ + var SafeString = __dependency1__; + + var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; + + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + function escapeChar(chr) { + return escape[chr]; + } + + function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } + } + } + + return obj; + } + + __exports__.extend = extend;var toString = Object.prototype.toString; + __exports__.toString = toString; + // Sourced from lodash + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt + var isFunction = function(value) { + return typeof value === 'function'; + }; + // fallback for older versions of Chrome and Safari + /* istanbul ignore next */ + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; + } + var isFunction; + __exports__.isFunction = isFunction; + /* istanbul ignore next */ + var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; + }; + __exports__.isArray = isArray; + + function escapeExpression(string) { + // don't escape SafeStrings, since they're already safe + if (string instanceof SafeString) { + return string.toString(); + } else if (string == null) { + return ""; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = "" + string; + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); + } + + __exports__.escapeExpression = escapeExpression;function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; + } else { + return false; + } + } + + __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; + } + + __exports__.appendContextPath = appendContextPath; + return __exports__; +})(__module4__); + +// handlebars/exception.js +var __module5__ = (function() { + "use strict"; + var __exports__; + + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + + function Exception(message, node) { + var line; + if (node && node.firstLine) { + line = node.firstLine; + + message += ' - ' + line + ':' + node.firstColumn; + } + + var tmp = Error.prototype.constructor.call(this, message); + + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; + } + + if (line) { + this.lineNumber = line; + this.column = node.firstColumn; + } + } + + Exception.prototype = new Error(); + + __exports__ = Exception; + return __exports__; +})(); + +// handlebars/base.js +var __module2__ = (function(__dependency1__, __dependency2__) { + "use strict"; + var __exports__ = {}; + var Utils = __dependency1__; + var Exception = __dependency2__; + + var VERSION = "2.0.0"; + __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; + __exports__.COMPILER_REVISION = COMPILER_REVISION; + var REVISION_CHANGES = { + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it + 2: '== 1.0.0-rc.3', + 3: '== 1.0.0-rc.4', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' + }; + __exports__.REVISION_CHANGES = REVISION_CHANGES; + var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; + + function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; + + registerDefaultHelpers(this); + } + + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, + + logger: logger, + log: log, + + registerHelper: function(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } + Utils.extend(this.helpers, name); + } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function(name) { + delete this.helpers[name]; + }, + + registerPartial: function(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + this.partials[name] = partial; + } + }, + unregisterPartial: function(name) { + delete this.partials[name]; + } + }; + + function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); + } + }); + + instance.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse, + fn = options.fn; + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { + return inverse(this); + } else if (isArray(context)) { + if(context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } + + return instance.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = {data: data}; + } + + return fn(context, options); + } + }); + + instance.registerHelper('each', function(context, options) { + if (!options) { + throw new Exception('Must pass iterator to #each'); + } + + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + var contextPath; + if (options.data && options.ids) { + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; + } + + if (isFunction(context)) { context = context.call(this); } + + if (options.data) { + data = createFrame(options.data); + } + + if(context && typeof context === 'object') { + if (isArray(context)) { + for(var j = context.length; i 0) { + throw new Exception("Invalid path: " + original, this); + } else if (part === "..") { + depth++; + depthString += '../'; + } else { + this.isScoped = true; + } + } else { + dig.push(part); + } + } + + this.original = original; + this.parts = dig; + this.string = dig.join('.'); + this.depth = depth; + this.idName = depthString + this.string; + + // an ID is simple if it only has one part, and that part is not + // `..` or `this`. + this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; + + this.stringModeValue = this.string; + }, + + PartialNameNode: function(name, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "PARTIAL_NAME"; + this.name = name.original; + }, + + DataNode: function(id, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "DATA"; + this.id = id; + this.stringModeValue = id.stringModeValue; + this.idName = '@' + id.stringModeValue; + }, + + StringNode: function(string, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "STRING"; + this.original = + this.string = + this.stringModeValue = string; + }, + + NumberNode: function(number, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "NUMBER"; + this.original = + this.number = number; + this.stringModeValue = Number(number); + }, + + BooleanNode: function(bool, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "BOOLEAN"; + this.bool = bool; + this.stringModeValue = bool === "true"; + }, + + CommentNode: function(comment, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "comment"; + this.comment = comment; + + this.strip = { + inlineStandalone: true + }; + } + }; + + + // Must be exported as an object rather than the root of the module as the jison lexer + // most modify the object to operate properly. + __exports__ = AST; + return __exports__; +})(__module5__); + +// handlebars/compiler/parser.js +var __module9__ = (function() { + "use strict"; + var __exports__; + /* jshint ignore:start */ + /* istanbul ignore next */ + /* Jison generated parser */ + var handlebars = (function(){ + var parser = {trace: function trace() { }, + yy: {}, + symbols_: {"error":2,"root":3,"program":4,"EOF":5,"program_repetition0":6,"statement":7,"mustache":8,"block":9,"rawBlock":10,"partial":11,"CONTENT":12,"COMMENT":13,"openRawBlock":14,"END_RAW_BLOCK":15,"OPEN_RAW_BLOCK":16,"sexpr":17,"CLOSE_RAW_BLOCK":18,"openBlock":19,"block_option0":20,"closeBlock":21,"openInverse":22,"block_option1":23,"OPEN_BLOCK":24,"CLOSE":25,"OPEN_INVERSE":26,"inverseAndProgram":27,"INVERSE":28,"OPEN_ENDBLOCK":29,"path":30,"OPEN":31,"OPEN_UNESCAPED":32,"CLOSE_UNESCAPED":33,"OPEN_PARTIAL":34,"partialName":35,"param":36,"partial_option0":37,"partial_option1":38,"sexpr_repetition0":39,"sexpr_option0":40,"dataName":41,"STRING":42,"NUMBER":43,"BOOLEAN":44,"OPEN_SEXPR":45,"CLOSE_SEXPR":46,"hash":47,"hash_repetition_plus0":48,"hashSegment":49,"ID":50,"EQUALS":51,"DATA":52,"pathSegments":53,"SEP":54,"$accept":0,"$end":1}, + terminals_: {2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"}, + productions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]], + performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { + + var $0 = $$.length - 1; + switch (yystate) { + case 1: yy.prepareProgram($$[$0-1].statements, true); return $$[$0-1]; + break; + case 2:this.$ = new yy.ProgramNode(yy.prepareProgram($$[$0]), {}, this._$); + break; + case 3:this.$ = $$[$0]; + break; + case 4:this.$ = $$[$0]; + break; + case 5:this.$ = $$[$0]; + break; + case 6:this.$ = $$[$0]; + break; + case 7:this.$ = new yy.ContentNode($$[$0], this._$); + break; + case 8:this.$ = new yy.CommentNode($$[$0], this._$); + break; + case 9:this.$ = new yy.RawBlockNode($$[$0-2], $$[$0-1], $$[$0], this._$); + break; + case 10:this.$ = new yy.MustacheNode($$[$0-1], null, '', '', this._$); + break; + case 11:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], false, this._$); + break; + case 12:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], true, this._$); + break; + case 13:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 14:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 15:this.$ = { strip: yy.stripFlags($$[$0-1], $$[$0-1]), program: $$[$0] }; + break; + case 16:this.$ = {path: $$[$0-1], strip: yy.stripFlags($$[$0-2], $$[$0])}; + break; + case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 19:this.$ = new yy.PartialNode($$[$0-3], $$[$0-2], $$[$0-1], yy.stripFlags($$[$0-4], $$[$0]), this._$); + break; + case 20:this.$ = new yy.PartialNode($$[$0-2], undefined, $$[$0-1], yy.stripFlags($$[$0-3], $$[$0]), this._$); + break; + case 21:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$); + break; + case 22:this.$ = new yy.SexprNode([$$[$0]], null, this._$); + break; + case 23:this.$ = $$[$0]; + break; + case 24:this.$ = new yy.StringNode($$[$0], this._$); + break; + case 25:this.$ = new yy.NumberNode($$[$0], this._$); + break; + case 26:this.$ = new yy.BooleanNode($$[$0], this._$); + break; + case 27:this.$ = $$[$0]; + break; + case 28:$$[$0-1].isHelper = true; this.$ = $$[$0-1]; + break; + case 29:this.$ = new yy.HashNode($$[$0], this._$); + break; + case 30:this.$ = [$$[$0-2], $$[$0]]; + break; + case 31:this.$ = new yy.PartialNameNode($$[$0], this._$); + break; + case 32:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$); + break; + case 33:this.$ = new yy.PartialNameNode(new yy.NumberNode($$[$0], this._$)); + break; + case 34:this.$ = new yy.DataNode($$[$0], this._$); + break; + case 35:this.$ = new yy.IdNode($$[$0], this._$); + break; + case 36: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2]; + break; + case 37:this.$ = [{part: $$[$0]}]; + break; + case 38:this.$ = []; + break; + case 39:$$[$0-1].push($$[$0]); + break; + case 48:this.$ = []; + break; + case 49:$$[$0-1].push($$[$0]); + break; + case 52:this.$ = [$$[$0]]; + break; + case 53:$$[$0-1].push($$[$0]); + break; + } + }, + table: [{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}], + defaultActions: {4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]}, + parseError: function parseError(str, hash) { + throw new Error(str); + }, + parse: function parse(input) { + var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + this.lexer.setInput(input); + this.lexer.yy = this.yy; + this.yy.lexer = this.lexer; + this.yy.parser = this; + if (typeof this.lexer.yylloc == "undefined") + this.lexer.yylloc = {}; + var yyloc = this.lexer.yylloc; + lstack.push(yyloc); + var ranges = this.lexer.options && this.lexer.options.ranges; + if (typeof this.yy.parseError === "function") + this.parseError = this.yy.parseError; + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = self.lexer.lex() || 1; + if (typeof token !== "number") { + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + if (!recovering) { + expected = []; + for (p in table[state]) + if (this.terminals_[p] && p > 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; + } + }; + /* Jison generated lexer */ + var lexer = (function(){ + var lexer = ({EOF:1, + parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, + input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; + + this._input = this._input.slice(1); + return ch; + }, + unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); + + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; + + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, + more:function () { + this._more = true; + return this; + }, + less:function (n) { + this.unput(this.match.slice(n)); + }, + pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, + showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, + next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; + + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; + } + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, + lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, + begin:function begin(condition) { + this.conditionStack.push(condition); + }, + popState:function popState() { + return this.conditionStack.pop(); + }, + _currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, + topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, + pushState:function begin(condition) { + this.begin(condition); + }}); + lexer.options = {}; + lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + + + function strip(start, end) { + return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end); + } + + + var YYSTATE=YY_START + switch($avoiding_name_collisions) { + case 0: + if(yy_.yytext.slice(-2) === "\\\\") { + strip(0,1); + this.begin("mu"); + } else if(yy_.yytext.slice(-1) === "\\") { + strip(0,1); + this.begin("emu"); + } else { + this.begin("mu"); + } + if(yy_.yytext) return 12; + + break; + case 1:return 12; + break; + case 2: + this.popState(); + return 12; + + break; + case 3: + yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9); + this.popState(); + return 15; + + break; + case 4: return 12; + break; + case 5:strip(0,4); this.popState(); return 13; + break; + case 6:return 45; + break; + case 7:return 46; + break; + case 8: return 16; + break; + case 9: + this.popState(); + this.begin('raw'); + return 18; + + break; + case 10:return 34; + break; + case 11:return 24; + break; + case 12:return 29; + break; + case 13:this.popState(); return 28; + break; + case 14:this.popState(); return 28; + break; + case 15:return 26; + break; + case 16:return 26; + break; + case 17:return 32; + break; + case 18:return 31; + break; + case 19:this.popState(); this.begin('com'); + break; + case 20:strip(3,5); this.popState(); return 13; + break; + case 21:return 31; + break; + case 22:return 51; + break; + case 23:return 50; + break; + case 24:return 50; + break; + case 25:return 54; + break; + case 26:// ignore whitespace + break; + case 27:this.popState(); return 33; + break; + case 28:this.popState(); return 25; + break; + case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42; + break; + case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42; + break; + case 31:return 52; + break; + case 32:return 44; + break; + case 33:return 44; + break; + case 34:return 43; + break; + case 35:return 50; + break; + case 36:yy_.yytext = strip(1,2); return 50; + break; + case 37:return 'INVALID'; + break; + case 38:return 5; + break; + } + }; + lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; + lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}}; + return lexer;})() + parser.lexer = lexer; + function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; + return new Parser; + })();__exports__ = handlebars; + /* jshint ignore:end */ + return __exports__; +})(); + +// handlebars/compiler/helpers.js +var __module10__ = (function(__dependency1__) { + "use strict"; + var __exports__ = {}; + var Exception = __dependency1__; + + function stripFlags(open, close) { + return { + left: open.charAt(2) === '~', + right: close.charAt(close.length-3) === '~' + }; + } + + __exports__.stripFlags = stripFlags; + function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { + /*jshint -W040 */ + if (mustache.sexpr.id.original !== close.path.original) { + throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache); + } + + var inverse = inverseAndProgram && inverseAndProgram.program; + + var strip = { + left: mustache.strip.left, + right: close.strip.right, + + // Determine the standalone candiacy. Basically flag our content as being possibly standalone + // so our parent can determine if we actually are standalone + openStandalone: isNextWhitespace(program.statements), + closeStandalone: isPrevWhitespace((inverse || program).statements) + }; + + if (mustache.strip.right) { + omitRight(program.statements, null, true); + } + + if (inverse) { + var inverseStrip = inverseAndProgram.strip; + + if (inverseStrip.left) { + omitLeft(program.statements, null, true); + } + if (inverseStrip.right) { + omitRight(inverse.statements, null, true); + } + if (close.strip.left) { + omitLeft(inverse.statements, null, true); + } + + // Find standalone else statments + if (isPrevWhitespace(program.statements) + && isNextWhitespace(inverse.statements)) { + + omitLeft(program.statements); + omitRight(inverse.statements); + } + } else { + if (close.strip.left) { + omitLeft(program.statements, null, true); + } + } + + if (inverted) { + return new this.BlockNode(mustache, inverse, program, strip, locInfo); + } else { + return new this.BlockNode(mustache, program, inverse, strip, locInfo); + } + } + + __exports__.prepareBlock = prepareBlock; + function prepareProgram(statements, isRoot) { + for (var i = 0, l = statements.length; i < l; i++) { + var current = statements[i], + strip = current.strip; + + if (!strip) { + continue; + } + + var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'), + _isNextWhitespace = isNextWhitespace(statements, i, isRoot), + + openStandalone = strip.openStandalone && _isPrevWhitespace, + closeStandalone = strip.closeStandalone && _isNextWhitespace, + inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; + + if (strip.right) { + omitRight(statements, i, true); + } + if (strip.left) { + omitLeft(statements, i, true); + } + + if (inlineStandalone) { + omitRight(statements, i); + + if (omitLeft(statements, i)) { + // If we are on a standalone node, save the indent info for partials + if (current.type === 'partial') { + current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : ''; + } + } + } + if (openStandalone) { + omitRight((current.program || current.inverse).statements); + + // Strip out the previous content node if it's whitespace only + omitLeft(statements, i); + } + if (closeStandalone) { + // Always strip the next node + omitRight(statements, i); + + omitLeft((current.inverse || current.program).statements); + } + } + + return statements; + } + + __exports__.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = statements.length; + } + + // Nodes that end with newlines are considered whitespace (but are special + // cased for strip operations) + var prev = statements[i-1], + sibling = statements[i-2]; + if (!prev) { + return isRoot; + } + + if (prev.type === 'content') { + return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); + } + } + function isNextWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = -1; + } + + var next = statements[i+1], + sibling = statements[i+2]; + if (!next) { + return isRoot; + } + + if (next.type === 'content') { + return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); + } + } + + // Marks the node to the right of the position as omitted. + // I.e. {{foo}}' ' will mark the ' ' node as omitted. + // + // If i is undefined, then the first child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitRight(statements, i, multiple) { + var current = statements[i == null ? 0 : i + 1]; + if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) { + return; + } + + var original = current.string; + current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); + current.rightStripped = current.string !== original; + } + + // Marks the node to the left of the position as omitted. + // I.e. ' '{{foo}} will mark the ' ' node as omitted. + // + // If i is undefined then the last child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitLeft(statements, i, multiple) { + var current = statements[i == null ? statements.length - 1 : i - 1]; + if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) { + return; + } + + // We omit the last node if it's whitespace only and not preceeded by a non-content node. + var original = current.string; + current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); + current.leftStripped = current.string !== original; + return current.leftStripped; + } + return __exports__; +})(__module5__); + +// handlebars/compiler/base.js +var __module8__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__) { + "use strict"; + var __exports__ = {}; + var parser = __dependency1__; + var AST = __dependency2__; + var Helpers = __dependency3__; + var extend = __dependency4__.extend; + + __exports__.parser = parser; + + var yy = {}; + extend(yy, Helpers, AST); + + function parse(input) { + // Just return if an already-compile AST was passed in. + if (input.constructor === AST.ProgramNode) { return input; } + + parser.yy = yy; + + return parser.parse(input); + } + + __exports__.parse = parse; + return __exports__; +})(__module9__, __module7__, __module10__, __module3__); + +// handlebars/compiler/compiler.js +var __module11__ = (function(__dependency1__, __dependency2__) { + "use strict"; + var __exports__ = {}; + var Exception = __dependency1__; + var isArray = __dependency2__.isArray; + + var slice = [].slice; + + function Compiler() {} + + __exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a + // function in a context. This is necessary for mustache compatibility, which + // requires that context functions in blocks are evaluated by blockHelperMissing, + // and then proceed as if the resulting value was provided to blockHelperMissing. + + Compiler.prototype = { + compiler: Compiler, + + equals: function(other) { + var len = this.opcodes.length; + if (other.opcodes.length !== len) { + return false; + } + + for (var i = 0; i < len; i++) { + var opcode = this.opcodes[i], + otherOpcode = other.opcodes[i]; + if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { + return false; + } + } + + // We know that length is the same between the two arrays because they are directly tied + // to the opcode behavior above. + len = this.children.length; + for (i = 0; i < len; i++) { + if (!this.children[i].equals(other.children[i])) { + return false; + } + } + + return true; + }, + + guid: 0, + + compile: function(program, options) { + this.opcodes = []; + this.children = []; + this.depths = {list: []}; + this.options = options; + this.stringParams = options.stringParams; + this.trackIds = options.trackIds; + + // These changes will propagate to the other compiler components + var knownHelpers = this.options.knownHelpers; + this.options.knownHelpers = { + 'helperMissing': true, + 'blockHelperMissing': true, + 'each': true, + 'if': true, + 'unless': true, + 'with': true, + 'log': true, + 'lookup': true + }; + if (knownHelpers) { + for (var name in knownHelpers) { + this.options.knownHelpers[name] = knownHelpers[name]; + } + } + + return this.accept(program); + }, + + accept: function(node) { + return this[node.type](node); + }, + + program: function(program) { + var statements = program.statements; + + for(var i=0, l=statements.length; i 0) { + varDeclarations += ", " + locals.join(", "); + } + + // Generate minimizer alias mappings + for (var alias in this.aliases) { + if (this.aliases.hasOwnProperty(alias)) { + varDeclarations += ', ' + alias + '=' + this.aliases[alias]; + } + } + + var params = ["depth0", "helpers", "partials", "data"]; + + if (this.useDepths) { + params.push('depths'); + } + + // Perform a second pass over the output to merge content when possible + var source = this.mergeSource(varDeclarations); + + if (asObject) { + params.push(source); + + return Function.apply(this, params); + } else { + return 'function(' + params.join(',') + ') {\n ' + source + '}'; + } + }, + mergeSource: function(varDeclarations) { + var source = '', + buffer, + appendOnly = !this.forceBuffer, + appendFirst; + + for (var i = 0, len = this.source.length; i < len; i++) { + var line = this.source[i]; + if (line.appendToBuffer) { + if (buffer) { + buffer = buffer + '\n + ' + line.content; + } else { + buffer = line.content; + } + } else { + if (buffer) { + if (!source) { + appendFirst = true; + source = buffer + ';\n '; + } else { + source += 'buffer += ' + buffer + ';\n '; + } + buffer = undefined; + } + source += line + '\n '; + + if (!this.environment.isSimple) { + appendOnly = false; + } + } + } + + if (appendOnly) { + if (buffer || !source) { + source += 'return ' + (buffer || '""') + ';\n'; + } + } else { + varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer()); + if (buffer) { + source += 'return buffer + ' + buffer + ';\n'; + } else { + source += 'return buffer;\n'; + } + } + + if (varDeclarations) { + source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source; + } + + return source; + }, + + // [blockValue] + // + // On stack, before: hash, inverse, program, value + // On stack, after: return value of blockHelperMissing + // + // The purpose of this opcode is to take a block of the form + // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and + // replace it on the stack with the result of properly + // invoking blockHelperMissing. + blockValue: function(name) { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + + var params = [this.contextName(0)]; + this.setupParams(name, 0, params); + + var blockName = this.popStack(); + params.splice(1, 0, blockName); + + this.push('blockHelperMissing.call(' + params.join(', ') + ')'); + }, + + // [ambiguousBlockValue] + // + // On stack, before: hash, inverse, program, value + // Compiler value, before: lastHelper=value of last found helper, if any + // On stack, after, if no lastHelper: same as [blockValue] + // On stack, after, if lastHelper: value + ambiguousBlockValue: function() { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + + // We're being a bit cheeky and reusing the options value from the prior exec + var params = [this.contextName(0)]; + this.setupParams('', 0, params, true); + + this.flushInline(); + + var current = this.topStack(); + params.splice(1, 0, current); + + this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }"); + }, + + // [appendContent] + // + // On stack, before: ... + // On stack, after: ... + // + // Appends the string value of `content` to the current buffer + appendContent: function(content) { + if (this.pendingContent) { + content = this.pendingContent + content; + } + + this.pendingContent = content; + }, + + // [append] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Coerces `value` to a String and appends it to the current buffer. + // + // If `value` is truthy, or 0, it is coerced into a string and appended + // Otherwise, the empty string is appended + append: function() { + // Force anything that is inlined onto the stack so we don't have duplication + // when we examine local + this.flushInline(); + var local = this.popStack(); + this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }'); + if (this.environment.isSimple) { + this.pushSource("else { " + this.appendToBuffer("''") + " }"); + } + }, + + // [appendEscaped] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Escape `value` and append it to the buffer + appendEscaped: function() { + this.aliases.escapeExpression = 'this.escapeExpression'; + + this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")); + }, + + // [getContext] + // + // On stack, before: ... + // On stack, after: ... + // Compiler value, after: lastContext=depth + // + // Set the value of the `lastContext` compiler value to the depth + getContext: function(depth) { + this.lastContext = depth; + }, + + // [pushContext] + // + // On stack, before: ... + // On stack, after: currentContext, ... + // + // Pushes the value of the current context onto the stack. + pushContext: function() { + this.pushStackLiteral(this.contextName(this.lastContext)); + }, + + // [lookupOnContext] + // + // On stack, before: ... + // On stack, after: currentContext[name], ... + // + // Looks up the value of `name` on the current context and pushes + // it onto the stack. + lookupOnContext: function(parts, falsy, scoped) { + /*jshint -W083 */ + var i = 0, + len = parts.length; + + if (!scoped && this.options.compat && !this.lastContext) { + // The depthed query is expected to handle the undefined logic for the root level that + // is implemented below, so we evaluate that directly in compat mode + this.push(this.depthedLookup(parts[i++])); + } else { + this.pushContext(); + } + + for (; i < len; i++) { + this.replaceStack(function(current) { + var lookup = this.nameLookup(current, parts[i], 'context'); + // We want to ensure that zero and false are handled properly if the context (falsy flag) + // needs to have the special handling for these values. + if (!falsy) { + return ' != null ? ' + lookup + ' : ' + current; + } else { + // Otherwise we can use generic falsy handling + return ' && ' + lookup; + } + }); + } + }, + + // [lookupData] + // + // On stack, before: ... + // On stack, after: data, ... + // + // Push the data lookup operator + lookupData: function(depth, parts) { + /*jshint -W083 */ + if (!depth) { + this.pushStackLiteral('data'); + } else { + this.pushStackLiteral('this.data(data, ' + depth + ')'); + } + + var len = parts.length; + for (var i = 0; i < len; i++) { + this.replaceStack(function(current) { + return ' && ' + this.nameLookup(current, parts[i], 'data'); + }); + } + }, + + // [resolvePossibleLambda] + // + // On stack, before: value, ... + // On stack, after: resolved value, ... + // + // If the `value` is a lambda, replace it on the stack by + // the return value of the lambda + resolvePossibleLambda: function() { + this.aliases.lambda = 'this.lambda'; + + this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')'); + }, + + // [pushStringParam] + // + // On stack, before: ... + // On stack, after: string, currentContext, ... + // + // This opcode is designed for use in string mode, which + // provides the string value of a parameter along with its + // depth rather than resolving it immediately. + pushStringParam: function(string, type) { + this.pushContext(); + this.pushString(type); + + // If it's a subexpression, the string result + // will be pushed after this opcode. + if (type !== 'sexpr') { + if (typeof string === 'string') { + this.pushString(string); + } else { + this.pushStackLiteral(string); + } + } + }, + + emptyHash: function() { + this.pushStackLiteral('{}'); + + if (this.trackIds) { + this.push('{}'); // hashIds + } + if (this.stringParams) { + this.push('{}'); // hashContexts + this.push('{}'); // hashTypes + } + }, + pushHash: function() { + if (this.hash) { + this.hashes.push(this.hash); + } + this.hash = {values: [], types: [], contexts: [], ids: []}; + }, + popHash: function() { + var hash = this.hash; + this.hash = this.hashes.pop(); + + if (this.trackIds) { + this.push('{' + hash.ids.join(',') + '}'); + } + if (this.stringParams) { + this.push('{' + hash.contexts.join(',') + '}'); + this.push('{' + hash.types.join(',') + '}'); + } + + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); + }, + + // [pushString] + // + // On stack, before: ... + // On stack, after: quotedString(string), ... + // + // Push a quoted version of `string` onto the stack + pushString: function(string) { + this.pushStackLiteral(this.quotedString(string)); + }, + + // [push] + // + // On stack, before: ... + // On stack, after: expr, ... + // + // Push an expression onto the stack + push: function(expr) { + this.inlineStack.push(expr); + return expr; + }, + + // [pushLiteral] + // + // On stack, before: ... + // On stack, after: value, ... + // + // Pushes a value onto the stack. This operation prevents + // the compiler from creating a temporary variable to hold + // it. + pushLiteral: function(value) { + this.pushStackLiteral(value); + }, + + // [pushProgram] + // + // On stack, before: ... + // On stack, after: program(guid), ... + // + // Push a program expression onto the stack. This takes + // a compile-time guid and converts it into a runtime-accessible + // expression. + pushProgram: function(guid) { + if (guid != null) { + this.pushStackLiteral(this.programExpression(guid)); + } else { + this.pushStackLiteral(null); + } + }, + + // [invokeHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // Pops off the helper's parameters, invokes the helper, + // and pushes the helper's return value onto the stack. + // + // If the helper is not found, `helperMissing` is called. + invokeHelper: function(paramSize, name, isSimple) { + this.aliases.helperMissing = 'helpers.helperMissing'; + + var nonHelper = this.popStack(); + var helper = this.setupHelper(paramSize, name); + + var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing'; + this.push('((' + lookup + ').call(' + helper.callParams + '))'); + }, + + // [invokeKnownHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // This operation is used when the helper is known to exist, + // so a `helperMissing` fallback is not required. + invokeKnownHelper: function(paramSize, name) { + var helper = this.setupHelper(paramSize, name); + this.push(helper.name + ".call(" + helper.callParams + ")"); + }, + + // [invokeAmbiguous] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of disambiguation + // + // This operation is used when an expression like `{{foo}}` + // is provided, but we don't know at compile-time whether it + // is a helper or a path. + // + // This operation emits more code than the other options, + // and can be avoided by passing the `knownHelpers` and + // `knownHelpersOnly` flags at compile-time. + invokeAmbiguous: function(name, helperCall) { + this.aliases.functionType = '"function"'; + this.aliases.helperMissing = 'helpers.helperMissing'; + this.useRegister('helper'); + + var nonHelper = this.popStack(); + + this.emptyHash(); + var helper = this.setupHelper(0, name, helperCall); + + var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); + + this.push( + '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing' + + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),' + + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))'); + }, + + // [invokePartial] + // + // On stack, before: context, ... + // On stack after: result of partial invocation + // + // This operation pops off a context, invokes a partial with that context, + // and pushes the result of the invocation back. + invokePartial: function(name, indent) { + var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"]; + + if (this.options.data) { + params.push("data"); + } else if (this.options.compat) { + params.push('undefined'); + } + if (this.options.compat) { + params.push('depths'); + } + + this.push("this.invokePartial(" + params.join(", ") + ")"); + }, + + // [assignToHash] + // + // On stack, before: value, ..., hash, ... + // On stack, after: ..., hash, ... + // + // Pops a value off the stack and assigns it to the current hash + assignToHash: function(key) { + var value = this.popStack(), + context, + type, + id; + + if (this.trackIds) { + id = this.popStack(); + } + if (this.stringParams) { + type = this.popStack(); + context = this.popStack(); + } + + var hash = this.hash; + if (context) { + hash.contexts.push("'" + key + "': " + context); + } + if (type) { + hash.types.push("'" + key + "': " + type); + } + if (id) { + hash.ids.push("'" + key + "': " + id); + } + hash.values.push("'" + key + "': (" + value + ")"); + }, + + pushId: function(type, name) { + if (type === 'ID' || type === 'DATA') { + this.pushString(name); + } else if (type === 'sexpr') { + this.pushStackLiteral('true'); + } else { + this.pushStackLiteral('null'); + } + }, + + // HELPERS + + compiler: JavaScriptCompiler, + + compileChildren: function(environment, options) { + var children = environment.children, child, compiler; + + for(var i=0, l=children.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } + return this.topStackName(); + }, + topStackName: function() { + return "stack" + this.stackSlot; + }, + flushInline: function() { + var inlineStack = this.inlineStack; + if (inlineStack.length) { + this.inlineStack = []; + for (var i = 0, len = inlineStack.length; i < len; i++) { + var entry = inlineStack[i]; + if (entry instanceof Literal) { + this.compileStack.push(entry); + } else { + this.pushStack(entry); + } + } + } + }, + isInline: function() { + return this.inlineStack.length; + }, + + popStack: function(wrapped) { + var inline = this.isInline(), + item = (inline ? this.inlineStack : this.compileStack).pop(); + + if (!wrapped && (item instanceof Literal)) { + return item.value; + } else { + if (!inline) { + /* istanbul ignore next */ + if (!this.stackSlot) { + throw new Exception('Invalid stack pop'); + } + this.stackSlot--; + } + return item; + } + }, + + topStack: function() { + var stack = (this.isInline() ? this.inlineStack : this.compileStack), + item = stack[stack.length - 1]; + + if (item instanceof Literal) { + return item.value; + } else { + return item; + } + }, + + contextName: function(context) { + if (this.useDepths && context) { + return 'depths[' + context + ']'; + } else { + return 'depth' + context; + } + }, + + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 + .replace(/\u2029/g, '\\u2029') + '"'; + }, + + objectLiteral: function(obj) { + var pairs = []; + + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + pairs.push(this.quotedString(key) + ':' + obj[key]); + } + } + + return '{' + pairs.join(',') + '}'; + }, + + setupHelper: function(paramSize, name, blockHelper) { + var params = [], + paramsInit = this.setupParams(name, paramSize, params, blockHelper); + var foundHelper = this.nameLookup('helpers', name, 'helper'); + + return { + params: params, + paramsInit: paramsInit, + name: foundHelper, + callParams: [this.contextName(0)].concat(params).join(", ") + }; + }, + + setupOptions: function(helper, paramSize, params) { + var options = {}, contexts = [], types = [], ids = [], param, inverse, program; + + options.name = this.quotedString(helper); + options.hash = this.popStack(); + + if (this.trackIds) { + options.hashIds = this.popStack(); + } + if (this.stringParams) { + options.hashTypes = this.popStack(); + options.hashContexts = this.popStack(); + } + + inverse = this.popStack(); + program = this.popStack(); + + // Avoid setting fn and inverse if neither are set. This allows + // helpers to do a check for `if (options.fn)` + if (program || inverse) { + if (!program) { + program = 'this.noop'; + } + + if (!inverse) { + inverse = 'this.noop'; + } + + options.fn = program; + options.inverse = inverse; + } + + // The parameters go on to the stack in order (making sure that they are evaluated in order) + // so we need to pop them off the stack in reverse order + var i = paramSize; + while (i--) { + param = this.popStack(); + params[i] = param; + + if (this.trackIds) { + ids[i] = this.popStack(); + } + if (this.stringParams) { + types[i] = this.popStack(); + contexts[i] = this.popStack(); + } + } + + if (this.trackIds) { + options.ids = "[" + ids.join(",") + "]"; + } + if (this.stringParams) { + options.types = "[" + types.join(",") + "]"; + options.contexts = "[" + contexts.join(",") + "]"; + } + + if (this.options.data) { + options.data = "data"; + } + + return options; + }, + + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(helperName, paramSize, params, useRegister) { + var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params)); + + if (useRegister) { + this.useRegister('options'); + params.push('options'); + return 'options=' + options; + } else { + params.push(options); + return ''; + } + } + }; + + var reservedWords = ( + "break else new var" + + " case finally return void" + + " catch for switch while" + + " continue function this with" + + " default if throw" + + " delete in try" + + " do instanceof typeof" + + " abstract enum int short" + + " boolean export interface static" + + " byte extends long super" + + " char final native synchronized" + + " class float package throws" + + " const goto private transient" + + " debugger implements protected volatile" + + " double import public let yield" + ).split(" "); + + var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; + + for(var i=0, l=reservedWords.length; ic;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)d in c&&(b.knownHelpers[d]=c[d]);return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;c>d;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},PartialStatement:function(a){this.usePartial=!0;var b=a.params;if(b.length>1)throw new k["default"]("Unsupported number of partial arguments: "+b.length,a);b.length||b.push({type:"PathExpression",parts:[],depth:0});var c=a.name.original,d="SubExpression"===a.name.type;d&&this.accept(a.name),this.setupFullMustacheParams(a,void 0,void 0,!0);var e=a.indent||"";this.options.preventIndent&&e&&(this.opcode("appendContent",e),e=""),this.opcode("invokePartial",d,c,e),this.opcode("append")},MustacheStatement:function(a){this.SubExpression(a),this.opcode(a.escaped&&!this.options.noEscape?"appendEscaped":"append")},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){this.accept(a.path),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new k["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,n["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=n["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts)):this.opcode("lookupOnContext",a.parts,a.falsy,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");d>c;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=n["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&n["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||n["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^\.\//g,"").replace(/^\.$/g,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;c>b;b++){var d=this.options.blockParams[b],e=d&&l.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;g>f;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("this.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}var g=c(8)["default"];b.__esModule=!0;var h=c(9),i=c(11),j=g(i),k=c(12),l=c(17),m=g(l);e.prototype={nameLookup:function(a,b){return e.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"['",b,"']"]},depthedLookup:function(a){return[this.aliasable("this.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=h.COMPILER_REVISION,b=h.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return k.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;i>h;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new j["default"]("Compile completed with content left on stack");var k=this.createFunctionContext(d);if(this.isChild)return k;var l={compiler:this.compilerInfo(),main:k},m=this.context.programs;for(h=0,i=m.length;i>h;h++)m[h]&&(l[h]=m[h]);return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new m["default"](this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("this.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0;c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++])),this.resolvePath("context",a,d,b)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b){this.pushStackLiteral(a?"this.data(data, "+a+")":"data"),this.resolvePath("data",b,0,!0)},resolvePath:function(a,b,c,d){var e=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict,this,b,a));for(var g=b.length;g>c;c++)this.replaceStack(function(f){var g=e.nameLookup(f,b[c],a);return d?[" && ",g]:[" != null ? ",g," : ",f]})},resolvePossibleLambda:function(){this.push([this.aliasable("this.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){this.pushStackLiteral(null!=a?this.programExpression(a):null)},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d,!1);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",d.unshift(a?b:this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("this.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):this.pushStackLiteral("SubExpression"===a?"true":"null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;g>f;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);null==h?(this.context.programs.push(""),h=this.context.programs.length,d.index=h,d.name="program"+h,this.context.programs[h]=e.compile(d,b,this.context,!this.precompile),this.context.environments[h]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams):(d.index=h,d.name="program"+h,this.useDepths=this.useDepths||d.useDepths,this.useBlockParams=this.useBlockParams||d.useBlockParams)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"this.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new j["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new j["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=void 0;d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var i=this.popStack(),j=this.popStack();(j||i)&&(d.fn=j||"this.noop",d.inverse=i||"this.noop");for(var k=b;k--;)h=this.popStack(),c[k]=h,this.trackIds&&(g[k]=this.popStack()),this.stringParams&&(f[k]=this.popStack(),e[k]=this.popStack());return this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c,!0);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):(c.push(e),"")}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;d>c;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}var e=c(8)["default"];b.__esModule=!0;var f=c(11),g=e(f),h=c(2),i=e(h);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&(!c.type||!i["default"][c.type]))throw new g["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new g["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;c>b;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:function(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")},BlockStatement:function(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash"),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")},PartialStatement:function(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:function(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")},PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=d)}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b){this.helpers=a||{},this.partials=b||{},e(this)}function e(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new k["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(o(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=f(c.data);g.contextPath=i.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){function c(b,c,e){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!e,l&&(j.contextPath=l+b)),h+=d(a[b],{data:j,blockParams:i.blockParams([a[b],b],[l+b,null])})}if(!b)throw new k["default"]("Must pass iterator to #each");var d=b.fn,e=b.inverse,g=0,h="",j=void 0,l=void 0;if(b.data&&b.ids&&(l=i.appendContextPath(b.data.contextPath,b.ids[0])+"."),p(a)&&(a=a.call(this)),b.data&&(j=f(b.data)),a&&"object"==typeof a)if(o(a))for(var m=a.length;m>g;g++)c(g,g,g===a.length-1);else{var n=void 0;for(var q in a)a.hasOwnProperty(q)&&(n&&c(n,g-1),n=q,g++);n&&c(n,g-1,!0)}return 0===g&&(h=e(this)),h}),a.registerHelper("if",function(a,b){return p(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||i.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){p(a)&&(a=a.call(this));var c=b.fn;if(i.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=f(b.data);d.contextPath=i.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var b=i.extend({},a);return b._parent=a,b}var g=c(8)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d,b.createFrame=f;var h=c(12),i=g(h),j=c(11),k=g(j),l="3.0.1";b.VERSION=l;var m=6;b.COMPILER_REVISION=m;var n={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};b.REVISION_CHANGES=n;var o=i.isArray,p=i.isFunction,q=i.toString,r="[object Object]";d.prototype={constructor:d,logger:s,log:t,registerHelper:function(a,b){if(q.call(a)===r){if(b)throw new k["default"]("Arg not supported with multiple helpers");i.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(q.call(a)===r)i.extend(this.partials,a);else{if("undefined"==typeof b)throw new k["default"]("Attempting to register a partial as undefined");this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]}};var s={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(a,b){if("undefined"!=typeof console&&s.level<=a){var c=s.methodMap[a];(console[c]||console.log).call(console,b)}}};b.logger=s;var t=s.log;b.log=t},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;ic;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return l.test(a)?a.replace(k,c):a}function g(a){return a||0===a?o(a)&&0===a.length?!0:!1:!0}function h(a,b){return a.path=b,a}function i(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.blockParams=h,b.appendContextPath=i;var j={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},k=/[&<>"'`]/g,l=/[&<>"'`]/,m=Object.prototype.toString;b.toString=m;var n=function(a){return"function"==typeof a};n(/x/)&&(b.isFunction=n=function(a){return"function"==typeof a&&"[object Function]"===m.call(a)});var n;b.isFunction=n;var o=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===m.call(a):!1};b.isArray=o},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=p.COMPILER_REVISION;if(b!==c){if(c>b){var d=p.REVISION_CHANGES[c],e=p.REVISION_CHANGES[b];throw new o["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new o["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=m.extend({},d,e.hash)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;i>h&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new o["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){var c=void 0===arguments[1]?{}:arguments[1],f=c.data; -d._setup(c),!c.partial&&a.useData&&(f=j(b,f));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(e,b,e.helpers,e.partials,f,h,g)}if(!b)throw new o["default"]("No environment passed to template");if(!a||!a.main)throw new o["default"]("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new o["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:m.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=m.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new o["default"]("must pass block params");if(a.useDepths&&!g)throw new o["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function h(a,b,c){if(c.partial=!0,void 0===a)throw new o["default"]("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?p.createFrame(b):{},b.root=a),b}var k=c(8)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var l=c(12),m=k(l),n=c(11),o=k(n),p=c(9)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,content:12,COMMENT:13,CONTENT:14,openRawBlock:15,END_RAW_BLOCK:16,OPEN_RAW_BLOCK:17,helperName:18,openRawBlock_repetition0:19,openRawBlock_option0:20,CLOSE_RAW_BLOCK:21,openBlock:22,block_option0:23,closeBlock:24,openInverse:25,block_option1:26,OPEN_BLOCK:27,openBlock_repetition0:28,openBlock_option0:29,openBlock_option1:30,CLOSE:31,OPEN_INVERSE:32,openInverse_repetition0:33,openInverse_option0:34,openInverse_option1:35,openInverseChain:36,OPEN_INVERSE_CHAIN:37,openInverseChain_repetition0:38,openInverseChain_option0:39,openInverseChain_option1:40,inverseAndProgram:41,INVERSE:42,inverseChain:43,inverseChain_option0:44,OPEN_ENDBLOCK:45,OPEN:46,mustache_repetition0:47,mustache_option0:48,OPEN_UNESCAPED:49,mustache_repetition1:50,mustache_option1:51,CLOSE_UNESCAPED:52,OPEN_PARTIAL:53,partialName:54,partial_repetition0:55,partial_option0:56,param:57,sexpr:58,OPEN_SEXPR:59,sexpr_repetition0:60,sexpr_option0:61,CLOSE_SEXPR:62,hash:63,hash_repetition_plus0:64,hashSegment:65,ID:66,EQUALS:67,blockParams:68,OPEN_BLOCK_PARAMS:69,blockParams_repetition_plus0:70,CLOSE_BLOCK_PARAMS:71,path:72,dataName:73,STRING:74,NUMBER:75,BOOLEAN:76,UNDEFINED:77,NULL:78,DATA:79,pathSegments:80,SEP:81,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",13:"COMMENT",14:"CONTENT",16:"END_RAW_BLOCK",17:"OPEN_RAW_BLOCK",21:"CLOSE_RAW_BLOCK",27:"OPEN_BLOCK",31:"CLOSE",32:"OPEN_INVERSE",37:"OPEN_INVERSE_CHAIN",42:"INVERSE",45:"OPEN_ENDBLOCK",46:"OPEN",49:"OPEN_UNESCAPED",52:"CLOSE_UNESCAPED",53:"OPEN_PARTIAL",59:"OPEN_SEXPR",62:"CLOSE_SEXPR",66:"ID",67:"EQUALS",69:"OPEN_BLOCK_PARAMS",71:"CLOSE_BLOCK_PARAMS",74:"STRING",75:"NUMBER",76:"BOOLEAN",77:"UNDEFINED",78:"NULL",79:"DATA",81:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[12,1],[10,3],[15,5],[9,4],[9,4],[22,6],[25,6],[36,6],[41,2],[43,3],[43,1],[24,3],[8,5],[8,5],[11,5],[57,1],[57,1],[58,5],[63,1],[65,3],[68,3],[18,1],[18,1],[18,1],[18,1],[18,1],[18,1],[18,1],[54,1],[54,1],[73,2],[72,1],[80,3],[80,1],[6,0],[6,2],[19,0],[19,2],[20,0],[20,1],[23,0],[23,1],[26,0],[26,1],[28,0],[28,2],[29,0],[29,1],[30,0],[30,1],[33,0],[33,2],[34,0],[34,1],[35,0],[35,1],[38,0],[38,2],[39,0],[39,1],[40,0],[40,1],[44,0],[44,1],[47,0],[47,2],[48,0],[48,1],[50,0],[50,2],[51,0],[51,1],[55,0],[55,2],[56,0],[56,1],[60,0],[60,2],[61,0],[61,1],[64,1],[64,2],[70,1],[70,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return f[g-1];case 2:this.$=new d.Program(f[g],null,{},d.locInfo(this._$));break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=f[g];break;case 8:this.$=new d.CommentStatement(d.stripComment(f[g]),d.stripFlags(f[g],f[g]),d.locInfo(this._$));break;case 9:this.$=new d.ContentStatement(f[g],d.locInfo(this._$));break;case 10:this.$=d.prepareRawBlock(f[g-2],f[g-1],f[g],this._$);break;case 11:this.$={path:f[g-3],params:f[g-2],hash:f[g-1]};break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 13:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 14:this.$={path:f[g-4],params:f[g-3],hash:f[g-2],blockParams:f[g-1],strip:d.stripFlags(f[g-5],f[g])};break;case 15:this.$={path:f[g-4],params:f[g-3],hash:f[g-2],blockParams:f[g-1],strip:d.stripFlags(f[g-5],f[g])};break;case 16:this.$={path:f[g-4],params:f[g-3],hash:f[g-2],blockParams:f[g-1],strip:d.stripFlags(f[g-5],f[g])};break;case 17:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 18:var h=d.prepareBlock(f[g-2],f[g-1],f[g],f[g],!1,this._$),i=new d.Program([h],null,{},d.locInfo(this._$));i.chained=!0,this.$={strip:f[g-2].strip,program:i,chain:!0};break;case 19:this.$=f[g];break;case 20:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 21:this.$=d.prepareMustache(f[g-3],f[g-2],f[g-1],f[g-4],d.stripFlags(f[g-4],f[g]),this._$);break;case 22:this.$=d.prepareMustache(f[g-3],f[g-2],f[g-1],f[g-4],d.stripFlags(f[g-4],f[g]),this._$);break;case 23:this.$=new d.PartialStatement(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),d.locInfo(this._$));break;case 24:this.$=f[g];break;case 25:this.$=f[g];break;case 26:this.$=new d.SubExpression(f[g-3],f[g-2],f[g-1],d.locInfo(this._$));break;case 27:this.$=new d.Hash(f[g],d.locInfo(this._$));break;case 28:this.$=new d.HashPair(d.id(f[g-2]),f[g],d.locInfo(this._$));break;case 29:this.$=d.id(f[g-1]);break;case 30:this.$=f[g];break;case 31:this.$=f[g];break;case 32:this.$=new d.StringLiteral(f[g],d.locInfo(this._$));break;case 33:this.$=new d.NumberLiteral(f[g],d.locInfo(this._$));break;case 34:this.$=new d.BooleanLiteral(f[g],d.locInfo(this._$));break;case 35:this.$=new d.UndefinedLiteral(d.locInfo(this._$));break;case 36:this.$=new d.NullLiteral(d.locInfo(this._$));break;case 37:this.$=f[g];break;case 38:this.$=f[g];break;case 39:this.$=d.preparePath(!0,f[g],this._$);break;case 40:this.$=d.preparePath(!1,f[g],this._$);break;case 41:f[g-2].push({part:d.id(f[g]),original:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 42:this.$=[{part:d.id(f[g]),original:f[g]}];break;case 43:this.$=[];break;case 44:f[g-1].push(f[g]);break;case 45:this.$=[];break;case 46:f[g-1].push(f[g]);break;case 53:this.$=[];break;case 54:f[g-1].push(f[g]);break;case 59:this.$=[];break;case 60:f[g-1].push(f[g]);break;case 65:this.$=[];break;case 66:f[g-1].push(f[g]);break;case 73:this.$=[];break;case 74:f[g-1].push(f[g]);break;case 77:this.$=[];break;case 78:f[g-1].push(f[g]);break;case 81:this.$=[];break;case 82:f[g-1].push(f[g]);break;case 85:this.$=[];break;case 86:f[g-1].push(f[g]);break;case 89:this.$=[f[g]];break;case 90:f[g-1].push(f[g]);break;case 91:this.$=[f[g]];break;case 92:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,43],6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],46:[2,43],49:[2,43],53:[2,43]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:[1,11],14:[1,18],15:16,17:[1,21],22:14,25:15,27:[1,19],32:[1,20],37:[2,2],42:[2,2],45:[2,2],46:[1,12],49:[1,13],53:[1,17]},{1:[2,1]},{5:[2,44],13:[2,44],14:[2,44],17:[2,44],27:[2,44],32:[2,44],37:[2,44],42:[2,44],45:[2,44],46:[2,44],49:[2,44],53:[2,44]},{5:[2,3],13:[2,3],14:[2,3],17:[2,3],27:[2,3],32:[2,3],37:[2,3],42:[2,3],45:[2,3],46:[2,3],49:[2,3],53:[2,3]},{5:[2,4],13:[2,4],14:[2,4],17:[2,4],27:[2,4],32:[2,4],37:[2,4],42:[2,4],45:[2,4],46:[2,4],49:[2,4],53:[2,4]},{5:[2,5],13:[2,5],14:[2,5],17:[2,5],27:[2,5],32:[2,5],37:[2,5],42:[2,5],45:[2,5],46:[2,5],49:[2,5],53:[2,5]},{5:[2,6],13:[2,6],14:[2,6],17:[2,6],27:[2,6],32:[2,6],37:[2,6],42:[2,6],45:[2,6],46:[2,6],49:[2,6],53:[2,6]},{5:[2,7],13:[2,7],14:[2,7],17:[2,7],27:[2,7],32:[2,7],37:[2,7],42:[2,7],45:[2,7],46:[2,7],49:[2,7],53:[2,7]},{5:[2,8],13:[2,8],14:[2,8],17:[2,8],27:[2,8],32:[2,8],37:[2,8],42:[2,8],45:[2,8],46:[2,8],49:[2,8],53:[2,8]},{18:22,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:33,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{4:34,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],37:[2,43],42:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{4:35,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],42:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{12:36,14:[1,18]},{18:38,54:37,58:39,59:[1,40],66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{5:[2,9],13:[2,9],14:[2,9],16:[2,9],17:[2,9],27:[2,9],32:[2,9],37:[2,9],42:[2,9],45:[2,9],46:[2,9],49:[2,9],53:[2,9]},{18:41,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:42,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:43,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{31:[2,73],47:44,59:[2,73],66:[2,73],74:[2,73],75:[2,73],76:[2,73],77:[2,73],78:[2,73],79:[2,73]},{21:[2,30],31:[2,30],52:[2,30],59:[2,30],62:[2,30],66:[2,30],69:[2,30],74:[2,30],75:[2,30],76:[2,30],77:[2,30],78:[2,30],79:[2,30]},{21:[2,31],31:[2,31],52:[2,31],59:[2,31],62:[2,31],66:[2,31],69:[2,31],74:[2,31],75:[2,31],76:[2,31],77:[2,31],78:[2,31],79:[2,31]},{21:[2,32],31:[2,32],52:[2,32],59:[2,32],62:[2,32],66:[2,32],69:[2,32],74:[2,32],75:[2,32],76:[2,32],77:[2,32],78:[2,32],79:[2,32]},{21:[2,33],31:[2,33],52:[2,33],59:[2,33],62:[2,33],66:[2,33],69:[2,33],74:[2,33],75:[2,33],76:[2,33],77:[2,33],78:[2,33],79:[2,33]},{21:[2,34],31:[2,34],52:[2,34],59:[2,34],62:[2,34],66:[2,34],69:[2,34],74:[2,34],75:[2,34],76:[2,34],77:[2,34],78:[2,34],79:[2,34]},{21:[2,35],31:[2,35],52:[2,35],59:[2,35],62:[2,35],66:[2,35],69:[2,35],74:[2,35],75:[2,35],76:[2,35],77:[2,35],78:[2,35],79:[2,35]},{21:[2,36],31:[2,36],52:[2,36],59:[2,36],62:[2,36],66:[2,36],69:[2,36],74:[2,36],75:[2,36],76:[2,36],77:[2,36],78:[2,36],79:[2,36]},{21:[2,40],31:[2,40],52:[2,40],59:[2,40],62:[2,40],66:[2,40],69:[2,40],74:[2,40],75:[2,40],76:[2,40],77:[2,40],78:[2,40],79:[2,40],81:[1,45]},{66:[1,32],80:46},{21:[2,42],31:[2,42],52:[2,42],59:[2,42],62:[2,42],66:[2,42],69:[2,42],74:[2,42],75:[2,42],76:[2,42],77:[2,42],78:[2,42],79:[2,42],81:[2,42]},{50:47,52:[2,77],59:[2,77],66:[2,77],74:[2,77],75:[2,77],76:[2,77],77:[2,77],78:[2,77],79:[2,77]},{23:48,36:50,37:[1,52],41:51,42:[1,53],43:49,45:[2,49]},{26:54,41:55,42:[1,53],45:[2,51]},{16:[1,56]},{31:[2,81],55:57,59:[2,81],66:[2,81],74:[2,81],75:[2,81],76:[2,81],77:[2,81],78:[2,81],79:[2,81]},{31:[2,37],59:[2,37],66:[2,37],74:[2,37],75:[2,37],76:[2,37],77:[2,37],78:[2,37],79:[2,37]},{31:[2,38],59:[2,38],66:[2,38],74:[2,38],75:[2,38],76:[2,38],77:[2,38],78:[2,38],79:[2,38]},{18:58,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{28:59,31:[2,53],59:[2,53],66:[2,53],69:[2,53],74:[2,53],75:[2,53],76:[2,53],77:[2,53],78:[2,53],79:[2,53]},{31:[2,59],33:60,59:[2,59],66:[2,59],69:[2,59],74:[2,59],75:[2,59],76:[2,59],77:[2,59],78:[2,59],79:[2,59]},{19:61,21:[2,45],59:[2,45],66:[2,45],74:[2,45],75:[2,45],76:[2,45],77:[2,45],78:[2,45],79:[2,45]},{18:65,31:[2,75],48:62,57:63,58:66,59:[1,40],63:64,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{66:[1,70]},{21:[2,39],31:[2,39],52:[2,39],59:[2,39],62:[2,39],66:[2,39],69:[2,39],74:[2,39],75:[2,39],76:[2,39],77:[2,39],78:[2,39],79:[2,39],81:[1,45]},{18:65,51:71,52:[2,79],57:72,58:66,59:[1,40],63:73,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{24:74,45:[1,75]},{45:[2,50]},{4:76,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],37:[2,43],42:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{45:[2,19]},{18:77,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{4:78,6:3,13:[2,43],14:[2,43],17:[2,43],27:[2,43],32:[2,43],45:[2,43],46:[2,43],49:[2,43],53:[2,43]},{24:79,45:[1,75]},{45:[2,52]},{5:[2,10],13:[2,10],14:[2,10],17:[2,10],27:[2,10],32:[2,10],37:[2,10],42:[2,10],45:[2,10],46:[2,10],49:[2,10],53:[2,10]},{18:65,31:[2,83],56:80,57:81,58:66,59:[1,40],63:82,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{59:[2,85],60:83,62:[2,85],66:[2,85],74:[2,85],75:[2,85],76:[2,85],77:[2,85],78:[2,85],79:[2,85]},{18:65,29:84,31:[2,55],57:85,58:66,59:[1,40],63:86,64:67,65:68,66:[1,69],69:[2,55],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:65,31:[2,61],34:87,57:88,58:66,59:[1,40],63:89,64:67,65:68,66:[1,69],69:[2,61],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{18:65,20:90,21:[2,47],57:91,58:66,59:[1,40],63:92,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{31:[1,93]},{31:[2,74],59:[2,74],66:[2,74],74:[2,74],75:[2,74],76:[2,74],77:[2,74],78:[2,74],79:[2,74]},{31:[2,76]},{21:[2,24],31:[2,24],52:[2,24],59:[2,24],62:[2,24],66:[2,24],69:[2,24],74:[2,24],75:[2,24],76:[2,24],77:[2,24],78:[2,24],79:[2,24]},{21:[2,25],31:[2,25],52:[2,25],59:[2,25],62:[2,25],66:[2,25],69:[2,25],74:[2,25],75:[2,25],76:[2,25],77:[2,25],78:[2,25],79:[2,25]},{21:[2,27],31:[2,27],52:[2,27],62:[2,27],65:94,66:[1,95],69:[2,27]},{21:[2,89],31:[2,89],52:[2,89],62:[2,89],66:[2,89],69:[2,89]},{21:[2,42],31:[2,42],52:[2,42],59:[2,42],62:[2,42],66:[2,42],67:[1,96],69:[2,42],74:[2,42],75:[2,42],76:[2,42],77:[2,42],78:[2,42],79:[2,42],81:[2,42]},{21:[2,41],31:[2,41],52:[2,41],59:[2,41],62:[2,41],66:[2,41],69:[2,41],74:[2,41],75:[2,41],76:[2,41],77:[2,41],78:[2,41],79:[2,41],81:[2,41]},{52:[1,97]},{52:[2,78],59:[2,78],66:[2,78],74:[2,78],75:[2,78],76:[2,78],77:[2,78],78:[2,78],79:[2,78]},{52:[2,80]},{5:[2,12],13:[2,12],14:[2,12],17:[2,12],27:[2,12],32:[2,12],37:[2,12],42:[2,12],45:[2,12],46:[2,12],49:[2,12],53:[2,12]},{18:98,66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{36:50,37:[1,52],41:51,42:[1,53],43:100,44:99,45:[2,71]},{31:[2,65],38:101,59:[2,65],66:[2,65],69:[2,65],74:[2,65],75:[2,65],76:[2,65],77:[2,65],78:[2,65],79:[2,65]},{45:[2,17]},{5:[2,13],13:[2,13],14:[2,13],17:[2,13],27:[2,13],32:[2,13],37:[2,13],42:[2,13],45:[2,13],46:[2,13],49:[2,13],53:[2,13]},{31:[1,102]},{31:[2,82],59:[2,82],66:[2,82],74:[2,82],75:[2,82],76:[2,82],77:[2,82],78:[2,82],79:[2,82]},{31:[2,84]},{18:65,57:104,58:66,59:[1,40],61:103,62:[2,87],63:105,64:67,65:68,66:[1,69],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{30:106,31:[2,57],68:107,69:[1,108]},{31:[2,54],59:[2,54],66:[2,54],69:[2,54],74:[2,54],75:[2,54],76:[2,54],77:[2,54],78:[2,54],79:[2,54]},{31:[2,56],69:[2,56]},{31:[2,63],35:109,68:110,69:[1,108]},{31:[2,60],59:[2,60],66:[2,60],69:[2,60],74:[2,60],75:[2,60],76:[2,60],77:[2,60],78:[2,60],79:[2,60]},{31:[2,62],69:[2,62]},{21:[1,111]},{21:[2,46],59:[2,46],66:[2,46],74:[2,46],75:[2,46],76:[2,46],77:[2,46],78:[2,46],79:[2,46]},{21:[2,48]},{5:[2,21],13:[2,21],14:[2,21],17:[2,21],27:[2,21],32:[2,21],37:[2,21],42:[2,21],45:[2,21],46:[2,21],49:[2,21],53:[2,21]},{21:[2,90],31:[2,90],52:[2,90],62:[2,90],66:[2,90],69:[2,90]},{67:[1,96]},{18:65,57:112,58:66,59:[1,40],66:[1,32],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{5:[2,22],13:[2,22],14:[2,22],17:[2,22],27:[2,22],32:[2,22],37:[2,22],42:[2,22],45:[2,22],46:[2,22],49:[2,22],53:[2,22]},{31:[1,113]},{45:[2,18]},{45:[2,72]},{18:65,31:[2,67],39:114,57:115,58:66,59:[1,40],63:116,64:67,65:68,66:[1,69],69:[2,67],72:23,73:24,74:[1,25],75:[1,26],76:[1,27],77:[1,28],78:[1,29],79:[1,31],80:30},{5:[2,23],13:[2,23],14:[2,23],17:[2,23],27:[2,23],32:[2,23],37:[2,23],42:[2,23],45:[2,23],46:[2,23],49:[2,23],53:[2,23]},{62:[1,117]},{59:[2,86],62:[2,86],66:[2,86],74:[2,86],75:[2,86],76:[2,86],77:[2,86],78:[2,86],79:[2,86]},{62:[2,88]},{31:[1,118]},{31:[2,58]},{66:[1,120],70:119},{31:[1,121]},{31:[2,64]},{14:[2,11]},{21:[2,28],31:[2,28],52:[2,28],62:[2,28],66:[2,28],69:[2,28]},{5:[2,20],13:[2,20],14:[2,20],17:[2,20],27:[2,20],32:[2,20],37:[2,20],42:[2,20],45:[2,20],46:[2,20],49:[2,20],53:[2,20]},{31:[2,69],40:122,68:123,69:[1,108]},{31:[2,66],59:[2,66],66:[2,66],69:[2,66],74:[2,66],75:[2,66],76:[2,66],77:[2,66],78:[2,66],79:[2,66]},{31:[2,68],69:[2,68]},{21:[2,26],31:[2,26],52:[2,26],59:[2,26],62:[2,26],66:[2,26],69:[2,26],74:[2,26],75:[2,26],76:[2,26],77:[2,26],78:[2,26],79:[2,26]},{13:[2,14],14:[2,14],17:[2,14],27:[2,14],32:[2,14],37:[2,14],42:[2,14],45:[2,14],46:[2,14],49:[2,14],53:[2,14]},{66:[1,125],71:[1,124]},{66:[2,91],71:[2,91]},{13:[2,15],14:[2,15],17:[2,15],27:[2,15],32:[2,15],42:[2,15],45:[2,15],46:[2,15],49:[2,15],53:[2,15]},{31:[1,126]},{31:[2,70]},{31:[2,29]},{66:[2,92],71:[2,92]},{13:[2,16],14:[2,16],17:[2,16],27:[2,16],32:[2,16],37:[2,16],42:[2,16],45:[2,16],46:[2,16],49:[2,16],53:[2,16]}],defaultActions:{4:[2,1],49:[2,50],51:[2,19],55:[2,52],64:[2,76],73:[2,80],78:[2,17],82:[2,84],92:[2,48],99:[2,18],100:[2,72],105:[2,88],107:[2,58],110:[2,64],111:[2,11],123:[2,70],124:[2,29]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),16;case 4:return 14;case 5:return this.popState(),13;case 6:return 59;case 7:return 62;case 8:return 17;case 9:return this.popState(),this.begin("raw"),21;case 10:return 53;case 11:return 27;case 12:return 45;case 13:return this.popState(),42;case 14:return this.popState(),42;case 15:return 32;case 16:return 37;case 17:return 49;case 18:return 46;case 19:this.unput(b.yytext),this.popState(),this.begin("com");break;case 20:return this.popState(),13;case 21:return 46;case 22:return 67;case 23:return 66;case 24:return 66;case 25:return 81;case 26:break;case 27:return this.popState(),52;case 28:return this.popState(),31;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),74;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),74;case 31:return 79;case 32:return 76;case 33:return 76;case 34:return 77;case 35:return 78;case 36:return 75;case 37:return 69;case 38:return 71;case 39:return 66;case 40:return 66;case 41:return"INVALID";case 42:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,42],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(8)["default"];b.__esModule=!0;var j=c(6),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.isRootSeen;this.isRootSeen=!0;for(var c=a.body,d=0,i=c.length;i>d;d++){var j=c[d],k=this.accept(j);if(k){var l=e(c,d,b),m=f(c,d,b),n=k.openStandalone&&l,o=k.closeStandalone&&m,p=k.inlineStandalone&&l&&m;k.close&&g(c,d,!0),k.open&&h(c,d,!0),p&&(g(c,d),h(c,d)&&"PartialStatement"===j.type&&(j.indent=/([ \t]+$)/.exec(c[d-1].original)[1])),n&&(g((j.program||j.inverse).body),h(c,d)),o&&(g(c,d),h((j.inverse||j.program).body))}}return a},d.prototype.BlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function e(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function f(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function g(a){return a.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function h(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g="",h=0,i=b.length;i>h;h++){var j=b[h].part,k=b[h].original!==j;if(d+=(b[h].separator||"")+j,k||".."!==j&&"."!==j&&"this"!==j)e.push(j);else{if(e.length>0)throw new n["default"]("Invalid path: "+d,{loc:c});".."===j&&(f++,g+="../")}}return new this.PathExpression(a,f,e,d,c)}function i(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g;return new this.MustacheStatement(a,b,c,h,e,this.locInfo(f))}function j(a,b,c,d){if(a.path.original!==c){var e={loc:a.path.loc};throw new n["default"](a.path.original+" doesn't match "+c,e)}d=this.locInfo(d);var f=new this.Program([b],null,{},d);return new this.BlockStatement(a.path,a.params,a.hash,f,void 0,{},{},{},d)}function k(a,b,c,d,e,f){if(d&&d.path&&a.path.original!==d.path.original){var g={loc:a.path.loc};throw new n["default"](a.path.original+" doesn't match "+d.path.original,g)}b.blockParams=a.blockParams;var h=void 0,i=void 0;return c&&(c.chain&&(c.program.body[0].closeStrip=d.strip),i=c.strip,h=c.program),e&&(e=h,h=b,b=e),new this.BlockStatement(a.path,a.params,a.hash,b,h,a.strip,i,d&&d.strip,this.locInfo(f))}var l=c(8)["default"];b.__esModule=!0,b.SourceLocation=d,b.id=e,b.stripFlags=f,b.stripComment=g,b.preparePath=h,b.prepareMustache=i,b.prepareRawBlock=j,b.prepareBlock=k;var m=c(11),n=l(m)},function(a,b,c){"use strict";function d(a,b,c){if(f.isArray(a)){for(var d=[],e=0,g=a.length;g>e;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}b.__esModule=!0;var f=c(12),g=void 0;try{}catch(h){}g||(g=function(a,b,c,d){this.src="",d&&this.add(d)},g.prototype={add:function(a){f.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){f.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;c>b;b++)a(this.source[b])},empty:function(){var a=void 0===arguments[0]?this.currentLocation||{start:{}}:arguments[0];return new g(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof g?a:(a=d(a,this,b),new g(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e]) -}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a,b){for(var c=this.empty(b),e=0,f=a.length;f>e;e++)e&&c.add(","),c.add(d(a[e],this,b));return c},generateArray:function(a,b){var c=this.generateList(a,b);return c.prepend("["),c.add("]"),c}},b["default"]=e,a.exports=b["default"]}])}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d){b.call(this,d),this.type="program",this.statements=a,this.strip=c},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!c),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,c,d,e,f){b.call(this,f),this.type="partial",this.partialName=a,this.context=c,this.hash=d,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,c,d,e,f){b.call(this,f),this.type="block",this.mustache=a,this.program=c,this.inverse=d,this.strip=e,d&&!c&&(this.isInverse=!0)},RawBlockNode:function(a,c,f,g){if(b.call(this,g),a.sexpr.id.original!==f)throw new d(a.sexpr.id.original+" doesn't match "+f,this);c=new e.ContentNode(c,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([c],{},g)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.original=this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new d("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,c){b.call(this,c),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return d.prepareProgram(f[g-1].statements,!0),f[g-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[g]),{},this._$);break;case 3:this.$=f[g];break;case 4:this.$=f[g];break;case 5:this.$=f[g];break;case 6:this.$=f[g];break;case 7:this.$=new d.ContentNode(f[g],this._$);break;case 8:this.$=new d.CommentNode(f[g],this._$);break;case 9:this.$=new d.RawBlockNode(f[g-2],f[g-1],f[g],this._$);break;case 10:this.$=new d.MustacheNode(f[g-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!1,this._$);break;case 12:this.$=d.prepareBlock(f[g-3],f[g-2],f[g-1],f[g],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 14:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 15:this.$={strip:d.stripFlags(f[g-1],f[g-1]),program:f[g]};break;case 16:this.$={path:f[g-1],strip:d.stripFlags(f[g-2],f[g])};break;case 17:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 18:this.$=new d.MustacheNode(f[g-1],null,f[g-2],d.stripFlags(f[g-2],f[g]),this._$);break;case 19:this.$=new d.PartialNode(f[g-3],f[g-2],f[g-1],d.stripFlags(f[g-4],f[g]),this._$);break;case 20:this.$=new d.PartialNode(f[g-2],void 0,f[g-1],d.stripFlags(f[g-3],f[g]),this._$);break;case 21:this.$=new d.SexprNode([f[g-2]].concat(f[g-1]),f[g],this._$);break;case 22:this.$=new d.SexprNode([f[g]],null,this._$);break;case 23:this.$=f[g];break;case 24:this.$=new d.StringNode(f[g],this._$);break;case 25:this.$=new d.NumberNode(f[g],this._$);break;case 26:this.$=new d.BooleanNode(f[g],this._$);break;case 27:this.$=f[g];break;case 28:f[g-1].isHelper=!0,this.$=f[g-1];break;case 29:this.$=new d.HashNode(f[g],this._$);break;case 30:this.$=[f[g-2],f[g]];break;case 31:this.$=new d.PartialNameNode(f[g],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[g],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[g],this._$));break;case 34:this.$=new d.DataNode(f[g],this._$);break;case 35:this.$=new d.IdNode(f[g],this._$);break;case 36:f[g-2].push({part:f[g],separator:f[g-1]}),this.$=f[g-2];break;case 37:this.$=[{part:f[g]}];break;case 38:this.$=[];break;case 39:f[g-1].push(f[g]);break;case 48:this.$=[];break;case 49:f[g-1].push(f[g]);break;case 52:this.$=[f[g]];break;case 53:f[g-1].push(f[g])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();return a=b}(),i=function(a){"use strict";function b(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function c(a,b,c,d,i,k){if(a.sexpr.id.original!==d.path.original)throw new j(a.sexpr.id.original+" doesn't match "+d.path.original,a);var l=c&&c.program,m={left:a.strip.left,right:d.strip.right,openStandalone:f(b.statements),closeStandalone:e((l||b).statements)};if(a.strip.right&&g(b.statements,null,!0),l){var n=c.strip;n.left&&h(b.statements,null,!0),n.right&&g(l.statements,null,!0),d.strip.left&&h(l.statements,null,!0),e(b.statements)&&f(l.statements)&&(h(b.statements),g(l.statements))}else d.strip.left&&h(b.statements,null,!0);return i?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function d(a,b){for(var c=0,d=a.length;d>c;c++){var i=a[c],j=i.strip;if(j){var k=e(a,c,b,"partial"===i.type),l=f(a,c,b),m=j.openStandalone&&k,n=j.closeStandalone&&l,o=j.inlineStandalone&&k&&l;j.right&&g(a,c,!0),j.left&&h(a,c,!0),o&&(g(a,c),h(a,c)&&"partial"===i.type&&(i.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(g((i.program||i.inverse).statements),h(a,c)),n&&(g(a,c),h((i.inverse||i.program).statements))}}return a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var i={},j=a;return i.stripFlags=b,i.prepareBlock=c,i.prepareProgram=d,i}(c),j=function(a,b,c,d){"use strict";function e(a){return a.constructor===h.ProgramNode?a:(g.yy=k,g.parse(a))}var f={},g=a,h=b,i=c,j=d.extend;f.parser=g;var k={};return j(k,i,h),f.parse=e,f}(h,g,i,b),k=function(a,b){"use strict";function c(){}function d(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function e(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new h("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,f=function(a,b){return e||(e=d()),e.call(this,a,b)};return f._setup=function(a){return e||(e=d()),e._setup(a)},f._child=function(a,b,c){return e||(e=d()),e._child(a,b,c)},f}function f(a,b){if(a===b)return!0;if(i(a)&&i(b)&&a.length===b.length){for(var c=0;cc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!f(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++; +this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;for(this.opcode("pushHash"),b=0,c=d.length;c>b;b++)this.pushParam(d[b][1]);for(;b--;)this.opcode("assignToHash",d[b][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new h("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.falsy=!0,this.ID(e),this.opcode("invokeHelper",d.length,e.original,e.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:j.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},g.precompile=d,g.compile=e,g}(c,b),l=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=b;d.prototype={nameLookup:function(a,b){return d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=f,b=g[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var e,f,g,i=a.opcodes;for(f=0,g=i.length;g>f;f++)e=i[f],this[e.opcode].apply(this,e.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new h("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(f=0,g=l.length;g>f;f++)l[f]&&(k[f]=l[f]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var b,c,d="",e=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?b=b?b+"\n + "+h.content:h.content:(b&&(d?d+="buffer += "+b+";\n ":(c=!0,d=b+";\n "),b=void 0),d+=h+"\n ",this.environment.isSimple||(e=!1))}return e?(b||!d)&&(d+="return "+(b||'""')+";\n"):(a+=", buffer = "+(c?"":this.initializeBuffer()),d+=b?"return buffer + "+b+";\n":"return buffer;\n"),a&&(d="var "+a.substring(2)+(c?"":";\n ")+d),d},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var b,c,d,e=this.popStack();this.trackIds&&(d=this.popStack()),this.stringParams&&(c=this.popStack(),b=this.popStack());var f=this.hash;b&&f.contexts.push("'"+a+"': "+b),c&&f.types.push("'"+a+"': "+c),d&&f.ids.push("'"+a+"': "+d),f.values.push("'"+a+"': ("+e+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context,!this.precompile),this.context.environments[h]=c,this.useDepths=this.useDepths||d.useDepths):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=(b.depths.list,this.useDepths),d=[b.index,"data"];return c&&d.push("depths"),"this.program("+d.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){{var b,d,e,f="";this.isInline()}if(!this.isInline())throw new h("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof c)f=b=g.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+g+")",b=this.topStack()}var j=a.call(this,b);e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new h("Invalid stack pop");this.stackSlot--}return d},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof c?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var d,e,f,g={},h=[],i=[],j=[];g.name=this.quotedString(a),g.hash=this.popStack(),this.trackIds&&(g.hashIds=this.popStack()),this.stringParams&&(g.hashTypes=this.popStack(),g.hashContexts=this.popStack()),e=this.popStack(),f=this.popStack(),(f||e)&&(f||(f="this.noop"),e||(e="this.noop"),g.fn=f,g.inverse=e);for(var k=b;k--;)d=this.popStack(),c[k]=d,this.trackIds&&(j[k]=this.popStack()),this.stringParams&&(i[k]=this.popStack(),h[k]=this.popStack());return this.trackIds&&(g.ids="["+j.join(",")+"]"),this.stringParams&&(g.types="["+i.join(",")+"]",g.contexts="["+h.join(",")+"]"),this.options.data&&(g.data="data"),g},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=d.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},e=d}(d,c),m=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m}); \ No newline at end of file diff --git a/node_modules/handlebars/dist/handlebars.runtime.amd.js b/node_modules/handlebars/dist/handlebars.runtime.amd.js index 9b5c9dd..d805f82 100644 --- a/node_modules/handlebars/dist/handlebars.runtime.amd.js +++ b/node_modules/handlebars/dist/handlebars.runtime.amd.js @@ -1,6 +1,6 @@ /*! - handlebars v3.0.3 + handlebars v2.0.0 Copyright (C) 2011-2014 by Yehuda Katz @@ -24,87 +24,85 @@ THE SOFTWARE. @license */ -define('handlebars/utils',['exports'], function (exports) { - - exports.__esModule = true; - exports.extend = extend; +define( + 'handlebars/safe-string',["exports"], + function(__exports__) { + + // Build out our basic SafeString type + function SafeString(string) { + this.string = string; + } - // Older IE versions do not directly support indexOf so we must implement our own, sadly. - exports.indexOf = indexOf; - exports.escapeExpression = escapeExpression; - exports.isEmpty = isEmpty; - exports.blockParams = blockParams; - exports.appendContextPath = appendContextPath; - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' - }; + SafeString.prototype.toString = function() { + return "" + this.string; + }; - var badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; + __exports__["default"] = SafeString; + }); +define( + 'handlebars/utils',["./safe-string","exports"], + function(__dependency1__, __exports__) { + + /*jshint -W004 */ + var SafeString = __dependency1__["default"]; - function escapeChar(chr) { - return escape[chr]; - } + var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + function escapeChar(chr) { + return escape[chr]; + } + + function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } } } + + return obj; } - return obj; - } - - var toString = Object.prototype.toString; - - exports.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - /*eslint-disable func-style, no-var */ - var isFunction = function isFunction(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; + __exports__.extend = extend;var toString = Object.prototype.toString; + __exports__.toString = toString; + // Sourced from lodash + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt + var isFunction = function(value) { + return typeof value === 'function'; }; - } - var isFunction; - exports.isFunction = isFunction; - /*eslint-enable func-style, no-var */ - - /* istanbul ignore next */ - var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; - };exports.isArray = isArray; - - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } + // fallback for older versions of Chrome and Safari + /* istanbul ignore next */ + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; } - return -1; - } + var isFunction; + __exports__.isFunction = isFunction; + /* istanbul ignore next */ + var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; + }; + __exports__.isArray = isArray; - function escapeExpression(string) { - if (typeof string !== 'string') { + function escapeExpression(string) { // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); + if (string instanceof SafeString) { + return string.toString(); } else if (string == null) { - return ''; + return ""; } else if (!string) { return string + ''; } @@ -112,633 +110,528 @@ define('handlebars/utils',['exports'], function (exports) { // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. - string = '' + string; + string = "" + string; + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); } - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - function blockParams(params, ids) { - params.path = ids; - return params; - } - - function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } -}); -define('handlebars/exception',['exports', 'module'], function (exports, module) { - - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; - - message += ' - ' + line + ':' + column; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { - this.lineNumber = line; - this.column = column; - } - } - - Exception.prototype = new Error(); - - module.exports = Exception; -}); -define('handlebars/base',['exports', './utils', './exception'], function (exports, _utils, _exception) { - - - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - exports.__esModule = true; - exports.HandlebarsEnvironment = HandlebarsEnvironment; - exports.createFrame = createFrame; - - var _Exception = _interopRequire(_exception); - - var VERSION = '3.0.1'; - exports.VERSION = VERSION; - var COMPILER_REVISION = 6; - - exports.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1' - }; - - exports.REVISION_CHANGES = REVISION_CHANGES; - var isArray = _utils.isArray, - isFunction = _utils.isFunction, - toString = _utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function registerHelper(name, fn) { - if (toString.call(name) === objectType) { - if (fn) { - throw new _Exception('Arg not supported with multiple helpers'); - } - _utils.extend(this.helpers, name); + __exports__.escapeExpression = escapeExpression;function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; } else { - this.helpers[name] = fn; + return false; } - }, - unregisterHelper: function unregisterHelper(name) { - delete this.helpers[name]; - }, - - registerPartial: function registerPartial(name, partial) { - if (toString.call(name) === objectType) { - _utils.extend(this.partials, name); - } else { - if (typeof partial === 'undefined') { - throw new _Exception('Attempting to register a partial as undefined'); - } - this.partials[name] = partial; - } - }, - unregisterPartial: function unregisterPartial(name) { - delete this.partials[name]; } - }; - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function () { - if (arguments.length === 1) { - // A missing field in a {{foo}} constuct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new _Exception('Missing helper: "' + arguments[arguments.length - 1].name + '"'); + __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; + } + + __exports__.appendContextPath = appendContextPath; + }); +define( + 'handlebars/exception',["exports"], + function(__exports__) { + + + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + + function Exception(message, node) { + var line; + if (node && node.firstLine) { + line = node.firstLine; + + message += ' - ' + line + ':' + node.firstColumn; } - }); - instance.registerHelper('blockHelperMissing', function (context, options) { - var inverse = options.inverse, - fn = options.fn; + var tmp = Error.prototype.constructor.call(this, message); - if (context === true) { - return fn(this); - } else if (context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if (context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; + } - return instance.helpers.each(context, options); + if (line) { + this.lineNumber = line; + this.column = node.firstColumn; + } + } + + Exception.prototype = new Error(); + + __exports__["default"] = Exception; + }); +define( + 'handlebars/base',["./utils","./exception","exports"], + function(__dependency1__, __dependency2__, __exports__) { + + var Utils = __dependency1__; + var Exception = __dependency2__["default"]; + + var VERSION = "2.0.0"; + __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; + __exports__.COMPILER_REVISION = COMPILER_REVISION; + var REVISION_CHANGES = { + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it + 2: '== 1.0.0-rc.3', + 3: '== 1.0.0-rc.4', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' + }; + __exports__.REVISION_CHANGES = REVISION_CHANGES; + var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; + + function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; + + registerDefaultHelpers(this); + } + + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, + + logger: logger, + log: log, + + registerHelper: function(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } + Utils.extend(this.helpers, name); } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function(name) { + delete this.helpers[name]; + }, + + registerPartial: function(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + this.partials[name] = partial; + } + }, + unregisterPartial: function(name) { + delete this.partials[name]; + } + }; + + function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); + } + }); + + instance.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse, + fn = options.fn; + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; - } + } else if (isArray(context)) { + if(context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } - return fn(context, options); - } - }); - - instance.registerHelper('each', function (context, options) { - if (!options) { - throw new _Exception('Must pass iterator to #each'); - } - - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; - - if (options.data && options.ids) { - contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (isFunction(context)) { - context = context.call(this); - } - - if (options.data) { - data = createFrame(options.data); - } - - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { - if (isArray(context)) { - for (var j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); + return instance.helpers.each(context, options); + } else { + return inverse(this); } } else { - var priorKey = undefined; + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = {data: data}; + } - for (var key in context) { - if (context.hasOwnProperty(key)) { - // We're running the iterations one step out of sync so we can detect - // the last iteration without have to scan the object twice and create - // an itermediate keys array. - if (priorKey) { - execIteration(priorKey, i - 1); - } - priorKey = key; - i++; - } - } - if (priorKey) { - execIteration(priorKey, i - 1, true); - } + return fn(context, options); } - } + }); - if (i === 0) { - ret = inverse(this); - } + instance.registerHelper('each', function(context, options) { + if (!options) { + throw new Exception('Must pass iterator to #each'); + } - return ret; - }); + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; - instance.registerHelper('if', function (conditional, options) { - if (isFunction(conditional)) { - conditional = conditional.call(this); - } - - // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the - // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. - if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); - - instance.registerHelper('unless', function (conditional, options) { - return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); - }); - - instance.registerHelper('with', function (context, options) { - if (isFunction(context)) { - context = context.call(this); - } - - var fn = options.fn; - - if (!_utils.isEmpty(context)) { + var contextPath; if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); - options = { data: data }; + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; } - return fn(context, options); - } else { - return options.inverse(this); - } - }); + if (isFunction(context)) { context = context.call(this); } - instance.registerHelper('log', function (message, options) { - var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1; - instance.log(level, message); - }); + if (options.data) { + data = createFrame(options.data); + } - instance.registerHelper('lookup', function (obj, field) { - return obj && obj[field]; - }); - } + if(context && typeof context === 'object') { + if (isArray(context)) { + for(var j = context.length; ic;c++)if(a[c]===b)return c;return-1}function e(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return k.test(a)?a.replace(j,b):a}function f(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function g(a,b){return a.path=b,a}function h(a,b){return(a?a+".":"")+b}a.__esModule=!0,a.extend=c,a.indexOf=d,a.escapeExpression=e,a.isEmpty=f,a.blockParams=g,a.appendContextPath=h;var i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/,l=Object.prototype.toString;a.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(a.isFunction=m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;a.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};a.isArray=n}),define("handlebars/exception",["exports","module"],function(a,b){function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i0?(d.ids&&(d.ids=[d.name]),a.helpers.each(c,d)):e(this);if(d.data&&d.ids){var h=f(d.data);h.contextPath=b.appendContextPath(d.data.contextPath,d.name),d={data:h}}return g(c,d)}),a.registerHelper("each",function(a,c){function d(c,d,f){k&&(k.key=c,k.index=d,k.first=0===d,k.last=!!f,n&&(k.contextPath=n+c)),j+=e(a[c],{data:k,blockParams:b.blockParams([a[c],c],[n+c,null])})}if(!c)throw new h("Must pass iterator to #each");var e=c.fn,g=c.inverse,i=0,j="",k=void 0,n=void 0;if(c.data&&c.ids&&(n=b.appendContextPath(c.data.contextPath,c.ids[0])+"."),m(a)&&(a=a.call(this)),c.data&&(k=f(c.data)),a&&"object"==typeof a)if(l(a))for(var o=a.length;o>i;i++)d(i,i,i===a.length-1);else{var p=void 0;for(var q in a)a.hasOwnProperty(q)&&(p&&d(p,i-1),p=q,i++);p&&d(p,i-1,!0)}return 0===i&&(j=g(this)),j}),a.registerHelper("if",function(a,c){return m(a)&&(a=a.call(this)),!c.hash.includeZero&&!a||b.isEmpty(a)?c.inverse(this):c.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,c){m(a)&&(a=a.call(this));var d=c.fn;if(b.isEmpty(a))return c.inverse(this);if(c.data&&c.ids){var e=f(c.data);e.contextPath=b.appendContextPath(c.data.contextPath,c.ids[0]),c={data:e}}return d(a,c)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var c=b.extend({},a);return c._parent=a,c}var g=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.HandlebarsEnvironment=d,a.createFrame=f;var h=g(c),i="3.0.1";a.VERSION=i;var j=6;a.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};a.REVISION_CHANGES=k;var l=b.isArray,m=b.isFunction,n=b.toString,o="[object Object]";d.prototype={constructor:d,logger:p,log:q,registerHelper:function(a,c){if(n.call(a)===o){if(c)throw new h("Arg not supported with multiple helpers");b.extend(this.helpers,a)}else this.helpers[a]=c},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,c){if(n.call(a)===o)b.extend(this.partials,a);else{if("undefined"==typeof c)throw new h("Attempting to register a partial as undefined");this.partials[a]=c}},unregisterPartial:function(a){delete this.partials[a]}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(a,b){if("undefined"!=typeof console&&p.level<=a){var c=p.methodMap[a];(console[c]||console.log).call(console,b)}}};a.logger=p;var q=p.log;a.log=q}),define("handlebars/safe-string",["exports","module"],function(a,b){function c(a){this.string=a}c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b.exports=c}),define("handlebars/runtime",["exports","./utils","./exception","./base"],function(a,b,c,d){function e(a){var b=a&&a[0]||1,c=d.COMPILER_REVISION;if(b!==c){if(c>b){var e=d.REVISION_CHANGES[c],f=d.REVISION_CHANGES[b];throw new m("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+e+") or downgrade your runtime to an older version ("+f+").")}throw new m("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function f(a,c){function d(d,e,f){f.hash&&(e=b.extend({},e,f.hash)),d=c.VM.resolvePartial.call(this,d,e,f);var g=c.VM.invokePartial.call(this,d,e,f);if(null==g&&c.compile&&(f.partials[f.name]=c.compile(d,a.compilerOptions,c),g=f.partials[f.name](e,f)),null!=g){if(f.indent){for(var h=g.split("\n"),i=0,j=h.length;j>i&&(h[i]||i+1!==j);i++)h[i]=f.indent+h[i];g=h.join("\n")}return g}throw new m("The partial "+f.name+" could not be compiled when running in runtime-only mode")}function e(b){var c=void 0===arguments[1]?{}:arguments[1],d=c.data;e._setup(c),!c.partial&&a.useData&&(d=k(b,d));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(f,b,f.helpers,f.partials,d,h,g)}if(!c)throw new m("No environment passed to template");if(!a||!a.main)throw new m("Unknown template object: "+typeof a);c.VM.checkRevision(a.compiler);var f={strict:function(a,b){if(!(b in a))throw new m('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:b.escapeExpression,invokePartial:d,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var f=this.programs[a],h=this.fn(a);return b||e||d||c?f=g(this,a,h,b,c,d,e):f||(f=this.programs[a]=g(this,a,h)),f},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,c){var d=a||c;return a&&c&&a!==c&&(d=b.extend({},c,a)),d},noop:c.VM.noop,compilerInfo:a.compiler};return e.isTop=!0,e._setup=function(b){b.partial?(f.helpers=b.helpers,f.partials=b.partials):(f.helpers=f.merge(b.helpers,c.helpers),a.usePartial&&(f.partials=f.merge(b.partials,c.partials)))},e._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new m("must pass block params");if(a.useDepths&&!e)throw new m("must pass parent depths");return g(f,b,a[b],c,0,d,e)},e}function g(a,b,c,d,e,f,g){function h(b){var e=void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function h(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function i(a,b,c){if(c.partial=!0,void 0===a)throw new m("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function j(){return""}function k(a,b){return b&&"root"in b||(b=b?d.createFrame(b):{},b.root=a),b}var l=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.checkRevision=e,a.template=f,a.wrapProgram=g,a.resolvePartial=h,a.invokePartial=i,a.noop=j;var m=l(c)}),define("handlebars/no-conflict",["exports","module"],function(a,b){b.exports=function(a){var b="undefined"!=typeof global?global:window,c=b.Handlebars;a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=c)}}}),define("handlebars.runtime",["exports","module","./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","./handlebars/no-conflict"],function(a,b,c,d,e,f,g,h){function i(){var a=new c.HandlebarsEnvironment;return f.extend(a,c),a.SafeString=k,a.Exception=l,a.Utils=f,a.escapeExpression=f.escapeExpression,a.VM=g,a.template=function(b){return g.template(b,a)},a}var j=function(a){return a&&a.__esModule?a["default"]:a},k=j(d),l=j(e),m=j(h),n=i();n.create=i,m(n),n["default"]=n,b.exports=n}); \ No newline at end of file +define("handlebars/safe-string",["exports"],function(a){function b(a){this.string=a}b.prototype.toString=function(){return""+this.string},a["default"]=b}),define("handlebars/utils",["./safe-string","exports"],function(a,b){function c(a){return i[a]}function d(a){for(var b=1;b":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/;b.extend=d;var l=Object.prototype.toString;b.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;b.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};b.isArray=n,b.escapeExpression=e,b.isEmpty=f,b.appendContextPath=g}),define("handlebars/exception",["exports"],function(a){function b(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var f=a,g=b["default"],h="2.0.0";c.VERSION=h;var i=6;c.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};c.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";c.HandlebarsEnvironment=d,d.prototype={constructor:d,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};c.logger=o;var p=o.log;c.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};c.createFrame=q}),define("handlebars/runtime",["./utils","./exception","./base","exports"],function(a,b,c,d){function e(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function f(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=g(this,a,e,b,c):d||(d=this.programs[a]=g(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=j(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return g(d,b,a[b],c,e)},e}function g(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function h(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var k=a,l=b["default"],m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;d.checkRevision=e,d.template=f,d.program=g,d.invokePartial=h,d.noop=i}),define("handlebars.runtime",["./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","exports"],function(a,b,c,d,e,f){var g=a,h=b["default"],i=c["default"],j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();m.create=l,m["default"]=m,f["default"]=m}); \ No newline at end of file diff --git a/node_modules/handlebars/dist/handlebars.runtime.js b/node_modules/handlebars/dist/handlebars.runtime.js index 2263826..932fb7a 100644 --- a/node_modules/handlebars/dist/handlebars.runtime.js +++ b/node_modules/handlebars/dist/handlebars.runtime.js @@ -1,6 +1,6 @@ /*! - handlebars v3.0.3 + handlebars v2.0.0 Copyright (C) 2011-2014 by Yehuda Katz @@ -24,858 +24,637 @@ THE SOFTWARE. @license */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define(factory); - else if(typeof exports === 'object') - exports["Handlebars"] = factory(); - else - root["Handlebars"] = factory(); -})(this, function() { -return /******/ (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__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(7)['default']; - - exports.__esModule = true; - - var _import = __webpack_require__(1); - - var base = _interopRequireWildcard(_import); - - // Each of these augment the Handlebars object. No need to setup here. - // (This is done to easily share code between commonjs and browse envs) - - var _SafeString = __webpack_require__(2); - - var _SafeString2 = _interopRequireWildcard(_SafeString); - - var _Exception = __webpack_require__(3); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _import2 = __webpack_require__(4); - - var Utils = _interopRequireWildcard(_import2); - - var _import3 = __webpack_require__(5); - - var runtime = _interopRequireWildcard(_import3); - - var _noConflict = __webpack_require__(6); - - var _noConflict2 = _interopRequireWildcard(_noConflict); - - // For compatibility and usage outside of module systems, make the Handlebars object a namespace - function create() { - var hb = new base.HandlebarsEnvironment(); - - Utils.extend(hb, base); - hb.SafeString = _SafeString2['default']; - hb.Exception = _Exception2['default']; - hb.Utils = Utils; - hb.escapeExpression = Utils.escapeExpression; - - hb.VM = runtime; - hb.template = function (spec) { - return runtime.template(spec, hb); - }; - - return hb; - } - - var inst = create(); - inst.create = create; - - _noConflict2['default'](inst); - - inst['default'] = inst; - - exports['default'] = inst; - module.exports = exports['default']; - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(7)['default']; - - exports.__esModule = true; - exports.HandlebarsEnvironment = HandlebarsEnvironment; - exports.createFrame = createFrame; - - var _import = __webpack_require__(4); - - var Utils = _interopRequireWildcard(_import); - - var _Exception = __webpack_require__(3); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var VERSION = '3.0.1'; - exports.VERSION = VERSION; - var COMPILER_REVISION = 6; - - exports.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1' - }; - - exports.REVISION_CHANGES = REVISION_CHANGES; - var isArray = Utils.isArray, - isFunction = Utils.isFunction, - toString = Utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function registerHelper(name, fn) { - if (toString.call(name) === objectType) { - if (fn) { - throw new _Exception2['default']('Arg not supported with multiple helpers'); - } - Utils.extend(this.helpers, name); - } else { - this.helpers[name] = fn; - } - }, - unregisterHelper: function unregisterHelper(name) { - delete this.helpers[name]; - }, - - registerPartial: function registerPartial(name, partial) { - if (toString.call(name) === objectType) { - Utils.extend(this.partials, name); - } else { - if (typeof partial === 'undefined') { - throw new _Exception2['default']('Attempting to register a partial as undefined'); - } - this.partials[name] = partial; - } - }, - unregisterPartial: function unregisterPartial(name) { - delete this.partials[name]; - } - }; - - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function () { - if (arguments.length === 1) { - // A missing field in a {{foo}} constuct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); - } - }); - - instance.registerHelper('blockHelperMissing', function (context, options) { - var inverse = options.inverse, - fn = options.fn; - - if (context === true) { - return fn(this); - } else if (context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if (context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } - - return instance.helpers.each(context, options); - } else { - return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; - } - - return fn(context, options); - } - }); - - instance.registerHelper('each', function (context, options) { - if (!options) { - throw new _Exception2['default']('Must pass iterator to #each'); - } - - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; - - if (options.data && options.ids) { - contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (isFunction(context)) { - context = context.call(this); - } - - if (options.data) { - data = createFrame(options.data); - } - - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: Utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { - if (isArray(context)) { - for (var j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); - } - } else { - var priorKey = undefined; - - for (var key in context) { - if (context.hasOwnProperty(key)) { - // We're running the iterations one step out of sync so we can detect - // the last iteration without have to scan the object twice and create - // an itermediate keys array. - if (priorKey) { - execIteration(priorKey, i - 1); - } - priorKey = key; - i++; - } - } - if (priorKey) { - execIteration(priorKey, i - 1, true); - } - } - } - - if (i === 0) { - ret = inverse(this); - } - - return ret; - }); - - instance.registerHelper('if', function (conditional, options) { - if (isFunction(conditional)) { - conditional = conditional.call(this); - } - - // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the - // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. - if (!options.hash.includeZero && !conditional || Utils.isEmpty(conditional)) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); - - instance.registerHelper('unless', function (conditional, options) { - return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); - }); - - instance.registerHelper('with', function (context, options) { - if (isFunction(context)) { - context = context.call(this); - } - - var fn = options.fn; - - if (!Utils.isEmpty(context)) { - if (options.data && options.ids) { - var data = createFrame(options.data); - data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]); - options = { data: data }; - } - - return fn(context, options); - } else { - return options.inverse(this); - } - }); - - instance.registerHelper('log', function (message, options) { - var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1; - instance.log(level, message); - }); - - instance.registerHelper('lookup', function (obj, field) { - return obj && obj[field]; - }); - } - - var logger = { - methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' }, - - // State enum - DEBUG: 0, - INFO: 1, - WARN: 2, - ERROR: 3, - level: 1, - - // Can be overridden in the host environment - log: function log(level, message) { - if (typeof console !== 'undefined' && logger.level <= level) { - var method = logger.methodMap[level]; - (console[method] || console.log).call(console, message); // eslint-disable-line no-console - } - } - }; - - exports.logger = logger; - var log = logger.log; - - exports.log = log; - - function createFrame(object) { - var frame = Utils.extend({}, object); - frame._parent = object; - return frame; - } - - /* [args, ]options */ - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - // Build out our basic SafeString type - function SafeString(string) { - this.string = string; - } - - SafeString.prototype.toString = SafeString.prototype.toHTML = function () { - return '' + this.string; - }; - - exports['default'] = SafeString; - module.exports = exports['default']; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; - - message += ' - ' + line + ':' + column; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { - this.lineNumber = line; - this.column = column; - } - } - - Exception.prototype = new Error(); - - exports['default'] = Exception; - module.exports = exports['default']; - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - exports.extend = extend; - - // Older IE versions do not directly support indexOf so we must implement our own, sadly. - exports.indexOf = indexOf; - exports.escapeExpression = escapeExpression; - exports.isEmpty = isEmpty; - exports.blockParams = blockParams; - exports.appendContextPath = appendContextPath; - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '`': '`' - }; - - var badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; - - function escapeChar(chr) { - return escape[chr]; - } - - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; - } - } - } - - return obj; - } - - var toString = Object.prototype.toString; - - exports.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - /*eslint-disable func-style, no-var */ - var isFunction = function isFunction(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; - }; - } - var isFunction; - exports.isFunction = isFunction; - /*eslint-enable func-style, no-var */ - - /* istanbul ignore next */ - var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; - };exports.isArray = isArray; - - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - return -1; - } - - function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - } - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - function blockParams(params, ids) { - params.path = ids; - return params; - } - - function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(7)['default']; - - exports.__esModule = true; - exports.checkRevision = checkRevision; - - // TODO: Remove this line and break up compilePartial - - exports.template = template; - exports.wrapProgram = wrapProgram; - exports.resolvePartial = resolvePartial; - exports.invokePartial = invokePartial; - exports.noop = noop; - - var _import = __webpack_require__(4); - - var Utils = _interopRequireWildcard(_import); - - var _Exception = __webpack_require__(3); - - var _Exception2 = _interopRequireWildcard(_Exception); - - var _COMPILER_REVISION$REVISION_CHANGES$createFrame = __webpack_require__(1); - - function checkRevision(compilerInfo) { - var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION; - - if (compilerRevision !== currentRevision) { - if (compilerRevision < currentRevision) { - var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision], - compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision]; - throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); - } else { - // Use the embedded version info since the runtime doesn't know about this revision yet - throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); - } - } - } - - function template(templateSpec, env) { - /* istanbul ignore next */ - if (!env) { - throw new _Exception2['default']('No environment passed to template'); - } - if (!templateSpec || !templateSpec.main) { - throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec); - } - - // Note: Using env.VM references rather than local var references throughout this section to allow - // for external users to override these as psuedo-supported APIs. - env.VM.checkRevision(templateSpec.compiler); - - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = Utils.extend({}, context, options.hash); - } - - partial = env.VM.resolvePartial.call(this, partial, context, options); - var result = env.VM.invokePartial.call(this, partial, context, options); - - if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); - } - if (result != null) { - if (options.indent) { - var lines = result.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - if (!lines[i] && i + 1 === l) { - break; - } - - lines[i] = options.indent + lines[i]; - } - result = lines.join('\n'); - } - return result; - } else { - throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); - } - } - - // Just add water - var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _Exception2['default']('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, - lookup: function lookup(depths, name) { - var len = depths.length; - for (var i = 0; i < len; i++) { - if (depths[i] && depths[i][name] != null) { - return depths[i][name]; - } - } - }, - lambda: function lambda(current, context) { - return typeof current === 'function' ? current.call(context) : current; - }, - - escapeExpression: Utils.escapeExpression, - invokePartial: invokePartialWrapper, - - fn: function fn(i) { - return templateSpec[i]; - }, - - programs: [], - program: function program(i, data, declaredBlockParams, blockParams, depths) { - var programWrapper = this.programs[i], - fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); - } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); - } - return programWrapper; - }, - - data: function data(value, depth) { - while (value && depth--) { - value = value._parent; - } - return value; - }, - merge: function merge(param, common) { - var obj = param || common; - - if (param && common && param !== common) { - obj = Utils.extend({}, common, param); - } - - return obj; - }, - - noop: env.VM.noop, - compilerInfo: templateSpec.compiler - }; - - function ret(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - var data = options.data; - - ret._setup(options); - if (!options.partial && templateSpec.useData) { - data = initData(context, data); - } - var depths = undefined, - blockParams = templateSpec.useBlockParams ? [] : undefined; - if (templateSpec.useDepths) { - depths = options.depths ? [context].concat(options.depths) : [context]; - } - - return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); - } - ret.isTop = true; - - ret._setup = function (options) { - if (!options.partial) { - container.helpers = container.merge(options.helpers, env.helpers); - - if (templateSpec.usePartial) { - container.partials = container.merge(options.partials, env.partials); - } - } else { - container.helpers = options.helpers; - container.partials = options.partials; - } - }; - - ret._child = function (i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new _Exception2['default']('must pass block params'); - } - if (templateSpec.useDepths && !depths) { - throw new _Exception2['default']('must pass parent depths'); - } - - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); - }; - return ret; - } - - function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context) { - var options = arguments[1] === undefined ? {} : arguments[1]; - - return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); - } - prog.program = i; - prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; - return prog; - } - - function resolvePartial(partial, context, options) { - if (!partial) { - partial = options.partials[options.name]; - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; - } - - function invokePartial(partial, context, options) { - options.partial = true; - - if (partial === undefined) { - throw new _Exception2['default']('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { - return partial(context, options); - } - } - - function noop() { - return ''; - } - - function initData(context, data) { - if (!data || !('root' in data)) { - data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {}; - data.root = context; - } - return data; - } - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {'use strict'; - - exports.__esModule = true; - /*global window */ - - exports['default'] = function (Handlebars) { - /* istanbul ignore next */ - var root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function () { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - }; - }; - - module.exports = exports['default']; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - exports["default"] = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; - - exports.__esModule = true; - -/***/ } -/******/ ]) -}); -; \ No newline at end of file +/* exported Handlebars */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } else { + root.Handlebars = root.Handlebars || factory(); + } +}(this, function () { +// handlebars/safe-string.js +var __module3__ = (function() { + "use strict"; + var __exports__; + // Build out our basic SafeString type + function SafeString(string) { + this.string = string; + } + + SafeString.prototype.toString = function() { + return "" + this.string; + }; + + __exports__ = SafeString; + return __exports__; +})(); + +// handlebars/utils.js +var __module2__ = (function(__dependency1__) { + "use strict"; + var __exports__ = {}; + /*jshint -W004 */ + var SafeString = __dependency1__; + + var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; + + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + function escapeChar(chr) { + return escape[chr]; + } + + function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } + } + } + + return obj; + } + + __exports__.extend = extend;var toString = Object.prototype.toString; + __exports__.toString = toString; + // Sourced from lodash + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt + var isFunction = function(value) { + return typeof value === 'function'; + }; + // fallback for older versions of Chrome and Safari + /* istanbul ignore next */ + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; + } + var isFunction; + __exports__.isFunction = isFunction; + /* istanbul ignore next */ + var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; + }; + __exports__.isArray = isArray; + + function escapeExpression(string) { + // don't escape SafeStrings, since they're already safe + if (string instanceof SafeString) { + return string.toString(); + } else if (string == null) { + return ""; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = "" + string; + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); + } + + __exports__.escapeExpression = escapeExpression;function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; + } else { + return false; + } + } + + __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; + } + + __exports__.appendContextPath = appendContextPath; + return __exports__; +})(__module3__); + +// handlebars/exception.js +var __module4__ = (function() { + "use strict"; + var __exports__; + + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + + function Exception(message, node) { + var line; + if (node && node.firstLine) { + line = node.firstLine; + + message += ' - ' + line + ':' + node.firstColumn; + } + + var tmp = Error.prototype.constructor.call(this, message); + + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; + } + + if (line) { + this.lineNumber = line; + this.column = node.firstColumn; + } + } + + Exception.prototype = new Error(); + + __exports__ = Exception; + return __exports__; +})(); + +// handlebars/base.js +var __module1__ = (function(__dependency1__, __dependency2__) { + "use strict"; + var __exports__ = {}; + var Utils = __dependency1__; + var Exception = __dependency2__; + + var VERSION = "2.0.0"; + __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; + __exports__.COMPILER_REVISION = COMPILER_REVISION; + var REVISION_CHANGES = { + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it + 2: '== 1.0.0-rc.3', + 3: '== 1.0.0-rc.4', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' + }; + __exports__.REVISION_CHANGES = REVISION_CHANGES; + var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; + + function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; + + registerDefaultHelpers(this); + } + + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, + + logger: logger, + log: log, + + registerHelper: function(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } + Utils.extend(this.helpers, name); + } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function(name) { + delete this.helpers[name]; + }, + + registerPartial: function(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + this.partials[name] = partial; + } + }, + unregisterPartial: function(name) { + delete this.partials[name]; + } + }; + + function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); + } + }); + + instance.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse, + fn = options.fn; + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { + return inverse(this); + } else if (isArray(context)) { + if(context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } + + return instance.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = {data: data}; + } + + return fn(context, options); + } + }); + + instance.registerHelper('each', function(context, options) { + if (!options) { + throw new Exception('Must pass iterator to #each'); + } + + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + var contextPath; + if (options.data && options.ids) { + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; + } + + if (isFunction(context)) { context = context.call(this); } + + if (options.data) { + data = createFrame(options.data); + } + + if(context && typeof context === 'object') { + if (isArray(context)) { + for(var j = context.length; i0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=f(c.data);g.contextPath=i.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){function c(b,c,e){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!e,l&&(j.contextPath=l+b)),h+=d(a[b],{data:j,blockParams:i.blockParams([a[b],b],[l+b,null])})}if(!b)throw new k["default"]("Must pass iterator to #each");var d=b.fn,e=b.inverse,g=0,h="",j=void 0,l=void 0;if(b.data&&b.ids&&(l=i.appendContextPath(b.data.contextPath,b.ids[0])+"."),p(a)&&(a=a.call(this)),b.data&&(j=f(b.data)),a&&"object"==typeof a)if(o(a))for(var m=a.length;m>g;g++)c(g,g,g===a.length-1);else{var n=void 0;for(var q in a)a.hasOwnProperty(q)&&(n&&c(n,g-1),n=q,g++);n&&c(n,g-1,!0)}return 0===g&&(h=e(this)),h}),a.registerHelper("if",function(a,b){return p(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||i.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){p(a)&&(a=a.call(this));var c=b.fn;if(i.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=f(b.data);d.contextPath=i.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var b=i.extend({},a);return b._parent=a,b}var g=c(7)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d,b.createFrame=f;var h=c(4),i=g(h),j=c(3),k=g(j),l="3.0.1";b.VERSION=l;var m=6;b.COMPILER_REVISION=m;var n={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};b.REVISION_CHANGES=n;var o=i.isArray,p=i.isFunction,q=i.toString,r="[object Object]";d.prototype={constructor:d,logger:s,log:t,registerHelper:function(a,b){if(q.call(a)===r){if(b)throw new k["default"]("Arg not supported with multiple helpers");i.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(q.call(a)===r)i.extend(this.partials,a);else{if("undefined"==typeof b)throw new k["default"]("Attempting to register a partial as undefined");this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]}};var s={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(a,b){if("undefined"!=typeof console&&s.level<=a){var c=s.methodMap[a];(console[c]||console.log).call(console,b)}}};b.logger=s;var t=s.log;b.log=t},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;ic;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return l.test(a)?a.replace(k,c):a}function g(a){return a||0===a?o(a)&&0===a.length?!0:!1:!0}function h(a,b){return a.path=b,a}function i(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.blockParams=h,b.appendContextPath=i;var j={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},k=/[&<>"'`]/g,l=/[&<>"'`]/,m=Object.prototype.toString;b.toString=m;var n=function(a){return"function"==typeof a};n(/x/)&&(b.isFunction=n=function(a){return"function"==typeof a&&"[object Function]"===m.call(a)});var n;b.isFunction=n;var o=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===m.call(a):!1};b.isArray=o},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=p.COMPILER_REVISION;if(b!==c){if(c>b){var d=p.REVISION_CHANGES[c],e=p.REVISION_CHANGES[b];throw new o["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new o["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=m.extend({},d,e.hash)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;i>h&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new o["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){var c=void 0===arguments[1]?{}:arguments[1],f=c.data;d._setup(c),!c.partial&&a.useData&&(f=j(b,f));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(e,b,e.helpers,e.partials,f,h,g)}if(!b)throw new o["default"]("No environment passed to template");if(!a||!a.main)throw new o["default"]("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new o["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:m.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=m.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new o["default"]("must pass block params");if(a.useDepths&&!g)throw new o["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function h(a,b,c){if(c.partial=!0,void 0===a)throw new o["default"]("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?p.createFrame(b):{},b.root=a),b}var k=c(7)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var l=c(4),m=k(l),n=c(3),o=k(n),p=c(1)},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=d)}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0}])}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e);return f}); \ No newline at end of file diff --git a/node_modules/handlebars/docs/compiler-api.md b/node_modules/handlebars/docs/compiler-api.md deleted file mode 100644 index c09414f..0000000 --- a/node_modules/handlebars/docs/compiler-api.md +++ /dev/null @@ -1,276 +0,0 @@ -# Handlebars Compiler APIs - -There are a number of formal APIs that tool implementors may interact with. - -## AST - -Other tools may interact with the formal AST as defined below. Any JSON structure matching this pattern may be used and passed into the `compile` and `precompile` methods in the same way as the text for a template. - -AST structures may be generated either with the `Handlebars.parse` method and then manipulated, via the `Handlebars.AST` objects of the same name, or constructed manually as a generic JavaScript object matching the structure defined below. - -```javascript -var ast = Handlebars.parse(myTemplate); - -// Modify ast - -Handlebars.precompile(ast); -``` - - -### Basic - -```java -interface Node { - type: string; - loc: SourceLocation | null; -} - -interface SourceLocation { - source: string | null; - start: Position; - end: Position; -} - -interface Position { - line: uint >= 1; - column: uint >= 0; -} -``` - -### Programs - -```java -interface Program <: Node { - type: "Program"; - body: [ Statement ]; - - blockParams: [ string ]; -} -``` - -### Statements - -```java -interface Statement <: Node { } - -interface MustacheStatement <: Statement { - type: "MustacheStatement"; - - path: PathExpression | Literal; - params: [ Expression ]; - hash: Hash; - - escaped: boolean; - strip: StripFlags | null; -} - -interface BlockStatement <: Statement { - type: "BlockStatement"; - path: PathExpression; - params: [ Expression ]; - hash: Hash; - - program: Program | null; - inverse: Program | null; - - openStrip: StripFlags | null; - inverseStrip: StripFlags | null; - closeStrip: StripFlags | null; -} - -interface PartialStatement <: Statement { - type: "PartialStatement"; - name: PathExpression | SubExpression; - params: [ Expression ]; - hash: Hash; - - indent: string; - strip: StripFlags | null; -} -``` - -`name` will be a `SubExpression` when tied to a dynamic partial, i.e. `{{> (foo) }}`, otherwise this is a path or literal whose `original` value is used to lookup the desired partial. - - -```java -interface ContentStatement <: Statement { - type: "ContentStatement"; - value: string; - original: string; -} - -interface CommentStatement <: Statement { - type: "CommentStatement"; - value: string; - - strip: StripFlags | null; -} -``` - -### Expressions - -```java -interface Expression <: Node { } -``` - -##### SubExpressions - -```java -interface SubExpression <: Expression { - type: "SubExpression"; - path: PathExpression; - params: [ Expression ]; - hash: Hash; -} -``` - -##### Paths - -```java -interface PathExpression <: Expression { - type: "PathExpression"; - data: boolean; - depth: uint >= 0; - parts: [ string ]; - original: string; -} -``` - -- `data` is true when the given expression is a `@data` reference. -- `depth` is an integer representation of which context the expression references. `0` represents the current context, `1` would be `../`, etc. -- `parts` is an array of the names in the path. `foo.bar` would be `['foo', 'bar']`. Scope references, `.`, `..`, and `this` should be omitted from this array. -- `original` is the path as entered by the user. Separator and scope references are left untouched. - - -##### Literals - -```java -interface Literal <: Expression { } - -interface StringLiteral <: Literal { - type: "StringLiteral"; - value: string; - original: string; -} - -interface BooleanLiteral <: Literal { - type: "BooleanLiteral"; - value: boolean; - original: boolean; -} - -interface NumberLiteral <: Literal { - type: "NumberLiteral"; - value: number; - original: number; -} - -interface UndefinedLiteral <: Literal { - type: "UndefinedLiteral"; -} - -interface NullLiteral <: Literal { - type: "NullLiteral"; -} -``` - - -### Miscellaneous - -```java -interface Hash <: Node { - type: "Hash"; - pairs: [ HashPair ]; -} - -interface HashPair <: Node { - type: "HashPair"; - key: string; - value: Expression; -} - -interface StripFlags { - open: boolean; - close: boolean; -} -``` - -`StripFlags` are used to signify whitespace control character that may have been entered on a given statement. - -## AST Visitor - -`Handlebars.Visitor` is available as a base class for general interaction with AST structures. This will by default traverse the entire tree and individual methods may be overridden to provide specific responses to particular nodes. - -Recording all referenced partial names: - -```javascript -var Visitor = Handlebars.Visitor; - -function ImportScanner() { - this.partials = []; -} -ImportScanner.prototype = new Visitor(); - -ImportScanner.prototype.PartialStatement = function(partial) { - this.partials.push({request: partial.name.original}); - - Visitor.prototype.PartialStatement.call(this, partial); -}; - -var scanner = new ImportScanner(); -scanner.accept(ast); -``` - -The current node's ancestors will be maintained in the `parents` array, with the most recent parent listed first. - -The visitor may also be configured to operate in mutation mode by setting the `mutation` field to true. When in this mode, handler methods may return any valid AST node and it will replace the one they are currently operating on. Returning `false` will remove the given value (if valid) and returning `undefined` will leave the node in tact. This return structure only apply to mutation mode and non-mutation mode visitors are free to return whatever values they wish. - -Implementors that may need to support mutation mode are encouraged to utilize the `acceptKey`, `acceptRequired` and `acceptArray` helpers which provide the conditional overwrite behavior as well as implement sanity checks where pertinent. - -## JavaScript Compiler - -The `Handlebars.JavaScriptCompiler` object has a number of methods that may be customized to alter the output of the compiler: - -- `nameLookup(parent, name, type)` - Used to generate the code to resolve a give path component. - - - `parent` is the existing code in the path resolution - - `name` is the current path component - - `type` is the type of name being evaluated. May be one of `context`, `data`, `helper`, or `partial`. - - Note that this does not impact dynamic partials, which implementors need to be aware of. Overriding `VM.resolvePartial` may be required to support dynamic cases. - -- `depthedLookup(name)` - Used to generate code that resolves parameters within any context in the stack. Is only used in `compat` mode. - -- `compilerInfo()` - Allows for custom compiler flags used in the runtime version checking logic. - -- `appendToBuffer(source, location, explicit)` - Allows for code buffer emitting code. Defaults behavior is string concatenation. - - - `source` is the source code whose result is to be appending - - `location` is the location of the source in the source map. - - `explicit` is a flag signaling that the emit operation must occur, vs. the lazy evaled options otherwise. - -- `initializeBuffer()` - Allows for buffers other than the default string buffer to be used. Generally needs to be paired with a custom `appendToBuffer` implementation. - -```javascript -function MyCompiler() { - Handlebars.JavaScriptCompiler.apply(this, arguments); -} -MyCompiler.prototype = Object.create(Handlebars.JavaScriptCompiler); - -MyCompiler.nameLookup = function(parent, name, type) { - if (type === 'partial') { - return 'MyPartialList[' + JSON.stringify(name) ']'; - } else { - return Handlebars.JavaScriptCompiler.prototype.nameLookup.call(this, parent, name, type); - } -}; - -var env = Handlebars.create(); -env.JavaScriptCompiler = MyCompiler; -env.compile('my template'); -``` diff --git a/node_modules/handlebars/lib/handlebars.js b/node_modules/handlebars/lib/handlebars.js index f114959..039ab3e 100644 --- a/node_modules/handlebars/lib/handlebars.js +++ b/node_modules/handlebars/lib/handlebars.js @@ -1,22 +1,20 @@ -import runtime from './handlebars.runtime'; +/*globals Handlebars: true */ +import Handlebars from "./handlebars.runtime"; // Compiler imports -import AST from './handlebars/compiler/ast'; -import { parser as Parser, parse } from './handlebars/compiler/base'; -import { Compiler, compile, precompile } from './handlebars/compiler/compiler'; -import JavaScriptCompiler from './handlebars/compiler/javascript-compiler'; -import Visitor from './handlebars/compiler/visitor'; +import AST from "./handlebars/compiler/ast"; +import { parser as Parser, parse } from "./handlebars/compiler/base"; +import { Compiler, compile, precompile } from "./handlebars/compiler/compiler"; +import JavaScriptCompiler from "./handlebars/compiler/javascript-compiler"; -import noConflict from './handlebars/no-conflict'; - -let _create = runtime.create; -function create() { - let hb = _create(); +var _create = Handlebars.create; +var create = function() { + var hb = _create(); hb.compile = function(input, options) { return compile(input, options, hb); }; - hb.precompile = function(input, options) { + hb.precompile = function (input, options) { return precompile(input, options, hb); }; @@ -27,15 +25,11 @@ function create() { hb.parse = parse; return hb; -} +}; -let inst = create(); -inst.create = create; +Handlebars = create(); +Handlebars.create = create; -noConflict(inst); +Handlebars['default'] = Handlebars; -inst.Visitor = Visitor; - -inst['default'] = inst; - -export default inst; +export default Handlebars; diff --git a/node_modules/handlebars/lib/handlebars.runtime.js b/node_modules/handlebars/lib/handlebars.runtime.js index 3d05b54..bc07714 100644 --- a/node_modules/handlebars/lib/handlebars.runtime.js +++ b/node_modules/handlebars/lib/handlebars.runtime.js @@ -1,17 +1,16 @@ -import * as base from './handlebars/base'; +/*globals Handlebars: true */ +module base from "./handlebars/base"; // Each of these augment the Handlebars object. No need to setup here. // (This is done to easily share code between commonjs and browse envs) -import SafeString from './handlebars/safe-string'; -import Exception from './handlebars/exception'; -import * as Utils from './handlebars/utils'; -import * as runtime from './handlebars/runtime'; - -import noConflict from './handlebars/no-conflict'; +import SafeString from "./handlebars/safe-string"; +import Exception from "./handlebars/exception"; +module Utils from "./handlebars/utils"; +module runtime from "./handlebars/runtime"; // For compatibility and usage outside of module systems, make the Handlebars object a namespace -function create() { - let hb = new base.HandlebarsEnvironment(); +var create = function() { + var hb = new base.HandlebarsEnvironment(); Utils.extend(hb, base); hb.SafeString = SafeString; @@ -25,13 +24,11 @@ function create() { }; return hb; -} +}; -let inst = create(); -inst.create = create; +var Handlebars = create(); +Handlebars.create = create; -noConflict(inst); +Handlebars['default'] = Handlebars; -inst['default'] = inst; - -export default inst; +export default Handlebars; diff --git a/node_modules/handlebars/lib/handlebars/base.js b/node_modules/handlebars/lib/handlebars/base.js index cfe1e91..76f53e2 100644 --- a/node_modules/handlebars/lib/handlebars/base.js +++ b/node_modules/handlebars/lib/handlebars/base.js @@ -1,10 +1,10 @@ -import * as Utils from './utils'; -import Exception from './exception'; +module Utils from "./utils"; +import Exception from "./exception"; -export const VERSION = '3.0.1'; -export const COMPILER_REVISION = 6; +export var VERSION = "2.0.0"; +export var COMPILER_REVISION = 6; -export const REVISION_CHANGES = { +export var REVISION_CHANGES = { 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 2: '== 1.0.0-rc.3', 3: '== 1.0.0-rc.4', @@ -13,10 +13,10 @@ export const REVISION_CHANGES = { 6: '>= 2.0.0-beta.1' }; -const isArray = Utils.isArray, - isFunction = Utils.isFunction, - toString = Utils.toString, - objectType = '[object Object]'; +var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; export function HandlebarsEnvironment(helpers, partials) { this.helpers = helpers || {}; @@ -45,11 +45,8 @@ HandlebarsEnvironment.prototype = { registerPartial: function(name, partial) { if (toString.call(name) === objectType) { - Utils.extend(this.partials, name); + Utils.extend(this.partials, name); } else { - if (typeof partial === 'undefined') { - throw new Exception('Attempting to register a partial as undefined'); - } this.partials[name] = partial; } }, @@ -60,25 +57,25 @@ HandlebarsEnvironment.prototype = { function registerDefaultHelpers(instance) { instance.registerHelper('helperMissing', function(/* [args, ]options */) { - if (arguments.length === 1) { + if(arguments.length === 1) { // A missing field in a {{foo}} constuct. return undefined; } else { // Someone is actually trying to call something, blow up. - throw new Exception('Missing helper: "' + arguments[arguments.length - 1].name + '"'); + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); } }); instance.registerHelper('blockHelperMissing', function(context, options) { - let inverse = options.inverse, + var inverse = options.inverse, fn = options.fn; - if (context === true) { + if(context === true) { return fn(this); - } else if (context === false || context == null) { + } else if(context === false || context == null) { return inverse(this); } else if (isArray(context)) { - if (context.length > 0) { + if(context.length > 0) { if (options.ids) { options.ids = [options.name]; } @@ -89,7 +86,7 @@ function registerDefaultHelpers(instance) { } } else { if (options.data && options.ids) { - let data = createFrame(options.data); + var data = createFrame(options.data); data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); options = {data: data}; } @@ -103,13 +100,10 @@ function registerDefaultHelpers(instance) { throw new Exception('Must pass iterator to #each'); } - let fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data, - contextPath; + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + var contextPath; if (options.data && options.ids) { contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; } @@ -120,51 +114,40 @@ function registerDefaultHelpers(instance) { data = createFrame(options.data); } - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: Utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { + if(context && typeof context === 'object') { if (isArray(context)) { - for (let j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); + for(var j = context.length; i 0) { + throw new Exception("Invalid path: " + original, this); + } else if (part === "..") { + depth++; + depthString += '../'; + } else { + this.isScoped = true; + } + } else { + dig.push(part); + } + } + + this.original = original; + this.parts = dig; + this.string = dig.join('.'); + this.depth = depth; + this.idName = depthString + this.string; // an ID is simple if it only has one part, and that part is not // `..` or `this`. - simpleId: function(path) { - return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; - } + this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; + + this.stringModeValue = this.string; + }, + + PartialNameNode: function(name, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "PARTIAL_NAME"; + this.name = name.original; + }, + + DataNode: function(id, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "DATA"; + this.id = id; + this.stringModeValue = id.stringModeValue; + this.idName = '@' + id.stringModeValue; + }, + + StringNode: function(string, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "STRING"; + this.original = + this.string = + this.stringModeValue = string; + }, + + NumberNode: function(number, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "NUMBER"; + this.original = + this.number = number; + this.stringModeValue = Number(number); + }, + + BooleanNode: function(bool, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "BOOLEAN"; + this.bool = bool; + this.stringModeValue = bool === "true"; + }, + + CommentNode: function(comment, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "comment"; + this.comment = comment; + + this.strip = { + inlineStandalone: true + }; } }; // Must be exported as an object rather than the root of the module as the jison lexer -// must modify the object to operate properly. +// most modify the object to operate properly. export default AST; diff --git a/node_modules/handlebars/lib/handlebars/compiler/base.js b/node_modules/handlebars/lib/handlebars/compiler/base.js index 7075d9b..1378463 100644 --- a/node_modules/handlebars/lib/handlebars/compiler/base.js +++ b/node_modules/handlebars/lib/handlebars/compiler/base.js @@ -1,25 +1,18 @@ -import parser from './parser'; -import AST from './ast'; -import WhitespaceControl from './whitespace-control'; -import * as Helpers from './helpers'; -import { extend } from '../utils'; +import parser from "./parser"; +import AST from "./ast"; +module Helpers from "./helpers"; +import { extend } from "../utils"; export { parser }; -let yy = {}; +var yy = {}; extend(yy, Helpers, AST); -export function parse(input, options) { - // Just return if an already-compiled AST was passed in. - if (input.type === 'Program') { return input; } +export function parse(input) { + // Just return if an already-compile AST was passed in. + if (input.constructor === AST.ProgramNode) { return input; } parser.yy = yy; - // Altering the shared object here, but this is ok as parser is a sync operation - yy.locInfo = function(locInfo) { - return new yy.SourceLocation(options && options.srcName, locInfo); - }; - - let strip = new WhitespaceControl(); - return strip.accept(parser.parse(input)); + return parser.parse(input); } diff --git a/node_modules/handlebars/lib/handlebars/compiler/code-gen.js b/node_modules/handlebars/lib/handlebars/compiler/code-gen.js deleted file mode 100644 index bc7bc07..0000000 --- a/node_modules/handlebars/lib/handlebars/compiler/code-gen.js +++ /dev/null @@ -1,164 +0,0 @@ -/*global define */ -import {isArray} from '../utils'; - -let SourceNode; - -try { - /* istanbul ignore next */ - if (typeof define !== 'function' || !define.amd) { - // We don't support this in AMD environments. For these environments, we asusme that - // they are running on the browser and thus have no need for the source-map library. - let SourceMap = require('source-map'); - SourceNode = SourceMap.SourceNode; - } -} catch (err) { - /* NOP */ -} - -/* istanbul ignore if: tested but not covered in istanbul due to dist build */ -if (!SourceNode) { - SourceNode = function(line, column, srcFile, chunks) { - this.src = ''; - if (chunks) { - this.add(chunks); - } - }; - /* istanbul ignore next */ - SourceNode.prototype = { - add: function(chunks) { - if (isArray(chunks)) { - chunks = chunks.join(''); - } - this.src += chunks; - }, - prepend: function(chunks) { - if (isArray(chunks)) { - chunks = chunks.join(''); - } - this.src = chunks + this.src; - }, - toStringWithSourceMap: function() { - return {code: this.toString()}; - }, - toString: function() { - return this.src; - } - }; -} - - -function castChunk(chunk, codeGen, loc) { - if (isArray(chunk)) { - let ret = []; - - for (let i = 0, len = chunk.length; i < len; i++) { - ret.push(codeGen.wrap(chunk[i], loc)); - } - return ret; - } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { - // Handle primitives that the SourceNode will throw up on - return chunk + ''; - } - return chunk; -} - - -function CodeGen(srcFile) { - this.srcFile = srcFile; - this.source = []; -} - -CodeGen.prototype = { - prepend: function(source, loc) { - this.source.unshift(this.wrap(source, loc)); - }, - push: function(source, loc) { - this.source.push(this.wrap(source, loc)); - }, - - merge: function() { - let source = this.empty(); - this.each(function(line) { - source.add([' ', line, '\n']); - }); - return source; - }, - - each: function(iter) { - for (let i = 0, len = this.source.length; i < len; i++) { - iter(this.source[i]); - } - }, - - empty: function(loc = this.currentLocation || {start: {}}) { - return new SourceNode(loc.start.line, loc.start.column, this.srcFile); - }, - wrap: function(chunk, loc = this.currentLocation || {start: {}}) { - if (chunk instanceof SourceNode) { - return chunk; - } - - chunk = castChunk(chunk, this, loc); - - return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); - }, - - functionCall: function(fn, type, params) { - params = this.generateList(params); - return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); - }, - - quotedString: function(str) { - return '"' + (str + '') - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 - .replace(/\u2029/g, '\\u2029') + '"'; - }, - - objectLiteral: function(obj) { - let pairs = []; - - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - let value = castChunk(obj[key], this); - if (value !== 'undefined') { - pairs.push([this.quotedString(key), ':', value]); - } - } - } - - let ret = this.generateList(pairs); - ret.prepend('{'); - ret.add('}'); - return ret; - }, - - - generateList: function(entries, loc) { - let ret = this.empty(loc); - - for (let i = 0, len = entries.length; i < len; i++) { - if (i) { - ret.add(','); - } - - ret.add(castChunk(entries[i], this, loc)); - } - - return ret; - }, - - generateArray: function(entries, loc) { - let ret = this.generateList(entries, loc); - ret.prepend('['); - ret.add(']'); - - return ret; - } -}; - -export default CodeGen; - diff --git a/node_modules/handlebars/lib/handlebars/compiler/compiler.js b/node_modules/handlebars/lib/handlebars/compiler/compiler.js index 4575421..1aba34b 100644 --- a/node_modules/handlebars/lib/handlebars/compiler/compiler.js +++ b/node_modules/handlebars/lib/handlebars/compiler/compiler.js @@ -1,8 +1,7 @@ -import Exception from '../exception'; -import {isArray, indexOf} from '../utils'; -import AST from './ast'; +import Exception from "../exception"; +import {isArray} from "../utils"; -const slice = [].slice; +var slice = [].slice; export function Compiler() {} @@ -15,13 +14,13 @@ Compiler.prototype = { compiler: Compiler, equals: function(other) { - let len = this.opcodes.length; + var len = this.opcodes.length; if (other.opcodes.length !== len) { return false; } - for (let i = 0; i < len; i++) { - let opcode = this.opcodes[i], + for (var i = 0; i < len; i++) { + var opcode = this.opcodes[i], otherOpcode = other.opcodes[i]; if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { return false; @@ -31,7 +30,7 @@ Compiler.prototype = { // We know that length is the same between the two arrays because they are directly tied // to the opcode behavior above. len = this.children.length; - for (let i = 0; i < len; i++) { + for (i = 0; i < len; i++) { if (!this.children[i].equals(other.children[i])) { return false; } @@ -43,18 +42,16 @@ Compiler.prototype = { guid: 0, compile: function(program, options) { - this.sourceNode = []; this.opcodes = []; this.children = []; + this.depths = {list: []}; this.options = options; this.stringParams = options.stringParams; this.trackIds = options.trackIds; - options.blockParams = options.blockParams || []; - // These changes will propagate to the other compiler components - let knownHelpers = options.knownHelpers; - options.knownHelpers = { + var knownHelpers = this.options.knownHelpers; + this.options.knownHelpers = { 'helperMissing': true, 'blockHelperMissing': true, 'each': true, @@ -65,77 +62,80 @@ Compiler.prototype = { 'lookup': true }; if (knownHelpers) { - for (let name in knownHelpers) { - if (name in knownHelpers) { - options.knownHelpers[name] = knownHelpers[name]; - } + for (var name in knownHelpers) { + this.options.knownHelpers[name] = knownHelpers[name]; } } return this.accept(program); }, - compileProgram: function(program) { - let childCompiler = new this.compiler(), // eslint-disable-line new-cap - result = childCompiler.compile(program, this.options), - guid = this.guid++; - - this.usePartial = this.usePartial || result.usePartial; - - this.children[guid] = result; - this.useDepths = this.useDepths || result.useDepths; - - return guid; - }, - accept: function(node) { - this.sourceNode.unshift(node); - let ret = this[node.type](node); - this.sourceNode.shift(); - return ret; + return this[node.type](node); }, - Program: function(program) { - this.options.blockParams.unshift(program.blockParams); + program: function(program) { + var statements = program.statements; - let body = program.body, - bodyLength = body.length; - for (let i = 0; i < bodyLength; i++) { - this.accept(body[i]); + for(var i=0, l=statements.length; i 1) { - throw new Exception('Unsupported number of partial arguments: ' + params.length, partial); - } else if (!params.length) { - params.push({type: 'PathExpression', parts: [], depth: 0}); + if (partial.hash) { + this.accept(partial.hash); + } else { + this.opcode('push', 'undefined'); } - let partialName = partial.name.original, - isDynamic = partial.name.type === 'SubExpression'; - if (isDynamic) { - this.accept(partial.name); + if (partial.context) { + this.accept(partial.context); + } else { + this.opcode('getContext', 0); + this.opcode('pushContext'); } - this.setupFullMustacheParams(partial, undefined, undefined, true); - - let indent = partial.indent || ''; - if (this.options.preventIndent && indent) { - this.opcode('appendContent', indent); - indent = ''; - } - - this.opcode('invokePartial', isDynamic, partialName, indent); + this.opcode('invokePartial', partialName.name, partial.indent || ''); this.opcode('append'); }, - MustacheStatement: function(mustache) { - this.SubExpression(mustache); // eslint-disable-line new-cap + content: function(content) { + if (content.string) { + this.opcode('appendContent', content.string); + } + }, - if (mustache.escaped && !this.options.noEscape) { + mustache: function(mustache) { + this.sexpr(mustache.sexpr); + + if(mustache.escaped && !this.options.noEscape) { this.opcode('appendEscaped'); } else { this.opcode('append'); } }, - ContentStatement: function(content) { - if (content.value) { - this.opcode('appendContent', content.value); - } - }, - - CommentStatement: function() {}, - - SubExpression: function(sexpr) { - transformLiteralToPath(sexpr); - let type = this.classifySexpr(sexpr); - - if (type === 'simple') { - this.simpleSexpr(sexpr); - } else if (type === 'helper') { - this.helperSexpr(sexpr); - } else { - this.ambiguousSexpr(sexpr); - } - }, ambiguousSexpr: function(sexpr, program, inverse) { - let path = sexpr.path, - name = path.parts[0], + var id = sexpr.id, + name = id.parts[0], isBlock = program != null || inverse != null; - this.opcode('getContext', path.depth); + this.opcode('getContext', id.depth); this.opcode('pushProgram', program); this.opcode('pushProgram', inverse); - this.accept(path); + this.ID(id); this.opcode('invokeAmbiguous', name, isBlock); }, simpleSexpr: function(sexpr) { - this.accept(sexpr.path); + var id = sexpr.id; + + if (id.type === 'DATA') { + this.DATA(id); + } else if (id.parts.length) { + this.ID(id); + } else { + // Simplified ID for `this` + this.addDepth(id.depth); + this.opcode('getContext', id.depth); + this.opcode('pushContext'); + } + this.opcode('resolvePossibleLambda'); }, helperSexpr: function(sexpr, program, inverse) { - let params = this.setupFullMustacheParams(sexpr, program, inverse), - path = sexpr.path, - name = path.parts[0]; + var params = this.setupFullMustacheParams(sexpr, program, inverse), + id = sexpr.id, + name = id.parts[0]; if (this.options.knownHelpers[name]) { this.opcode('invokeKnownHelper', params.length, name); } else if (this.options.knownHelpersOnly) { - throw new Exception('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); + throw new Exception("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr); } else { - path.falsy = true; + id.falsy = true; - this.accept(path); - this.opcode('invokeHelper', params.length, path.original, AST.helpers.simpleId(path)); + this.ID(id); + this.opcode('invokeHelper', params.length, id.original, id.isSimple); } }, - PathExpression: function(path) { - this.addDepth(path.depth); - this.opcode('getContext', path.depth); + sexpr: function(sexpr) { + var type = this.classifySexpr(sexpr); - let name = path.parts[0], - scoped = AST.helpers.scopedId(path), - blockParamId = !path.depth && !scoped && this.blockParamIndex(name); + if (type === "simple") { + this.simpleSexpr(sexpr); + } else if (type === "helper") { + this.helperSexpr(sexpr); + } else { + this.ambiguousSexpr(sexpr); + } + }, - if (blockParamId) { - this.opcode('lookupBlockParam', blockParamId, path.parts); - } else if (!name) { + ID: function(id) { + this.addDepth(id.depth); + this.opcode('getContext', id.depth); + + var name = id.parts[0]; + if (!name) { // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` this.opcode('pushContext'); - } else if (path.data) { - this.options.data = true; - this.opcode('lookupData', path.depth, path.parts); } else { - this.opcode('lookupOnContext', path.parts, path.falsy, scoped); + this.opcode('lookupOnContext', id.parts, id.falsy, id.isScoped); } }, - StringLiteral: function(string) { - this.opcode('pushString', string.value); + DATA: function(data) { + this.options.data = true; + this.opcode('lookupData', data.id.depth, data.id.parts); }, - NumberLiteral: function(number) { - this.opcode('pushLiteral', number.value); + STRING: function(string) { + this.opcode('pushString', string.string); }, - BooleanLiteral: function(bool) { - this.opcode('pushLiteral', bool.value); + NUMBER: function(number) { + this.opcode('pushLiteral', number.number); }, - UndefinedLiteral: function() { - this.opcode('pushLiteral', 'undefined'); + BOOLEAN: function(bool) { + this.opcode('pushLiteral', bool.bool); }, - NullLiteral: function() { - this.opcode('pushLiteral', 'null'); - }, - - Hash: function(hash) { - let pairs = hash.pairs, - i = 0, - l = pairs.length; - - this.opcode('pushHash'); - - for (; i < l; i++) { - this.pushParam(pairs[i].value); - } - while (i--) { - this.opcode('assignToHash', pairs[i].key); - } - this.opcode('popHash'); - }, + comment: function() {}, // HELPERS opcode: function(name) { - this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); + this.opcodes.push({ opcode: name, args: slice.call(arguments, 1) }); }, addDepth: function(depth) { - if (!depth) { - return; - } + if(depth === 0) { return; } - this.useDepths = true; + if(!this.depths[depth]) { + this.depths[depth] = true; + this.depths.list.push(depth); + } }, classifySexpr: function(sexpr) { - let isSimple = AST.helpers.simpleId(sexpr.path); - - let isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); - - // a mustache is an eligible helper if: - // * its id is simple (a single part, not `this` or `..`) - let isHelper = !isBlockParam && AST.helpers.helperExpression(sexpr); - - // if a mustache is an eligible helper but not a definite - // helper, it is ambiguous, and will be resolved in a later - // pass or at runtime. - let isEligible = !isBlockParam && (isHelper || isSimple); + var isHelper = sexpr.isHelper; + var isEligible = sexpr.eligibleHelper; + var options = this.options; // if ambiguous, we can possibly resolve the ambiguity now // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. if (isEligible && !isHelper) { - let name = sexpr.path.parts[0], - options = this.options; + var name = sexpr.id.parts[0]; if (options.knownHelpers[name]) { isHelper = true; @@ -340,96 +323,58 @@ Compiler.prototype = { } } - if (isHelper) { - return 'helper'; - } else if (isEligible) { - return 'ambiguous'; - } else { - return 'simple'; - } + if (isHelper) { return "helper"; } + else if (isEligible) { return "ambiguous"; } + else { return "simple"; } }, pushParams: function(params) { - for (let i = 0, l = params.length; i < l; i++) { + for(var i=0, l=params.length; i= 0) { - return [depth, param]; - } - } } }; export function precompile(input, options, env) { - if (input == null || (typeof input !== 'string' && input.type !== 'Program')) { - throw new Exception('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); + if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) { + throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input); } options = options || {}; @@ -440,16 +385,18 @@ export function precompile(input, options, env) { options.useDepths = true; } - let ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options); + var ast = env.parse(input); + var environment = new env.Compiler().compile(ast, options); return new env.JavaScriptCompiler().compile(environment, options); } -export function compile(input, options = {}, env) { - if (input == null || (typeof input !== 'string' && input.type !== 'Program')) { - throw new Exception('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); +export function compile(input, options, env) { + if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) { + throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input); } + options = options || {}; + if (!('data' in options)) { options.data = true; } @@ -457,33 +404,33 @@ export function compile(input, options = {}, env) { options.useDepths = true; } - let compiled; + var compiled; function compileInput() { - let ast = env.parse(input, options), - environment = new env.Compiler().compile(ast, options), - templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); + var ast = env.parse(input); + var environment = new env.Compiler().compile(ast, options); + var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); return env.template(templateSpec); } // Template is only compiled on first use and cached after that point. - function ret(context, execOptions) { + var ret = function(context, options) { if (!compiled) { compiled = compileInput(); } - return compiled.call(this, context, execOptions); - } - ret._setup = function(setupOptions) { - if (!compiled) { - compiled = compileInput(); - } - return compiled._setup(setupOptions); + return compiled.call(this, context, options); }; - ret._child = function(i, data, blockParams, depths) { + ret._setup = function(options) { if (!compiled) { compiled = compileInput(); } - return compiled._child(i, data, blockParams, depths); + return compiled._setup(options); + }; + ret._child = function(i, data, depths) { + if (!compiled) { + compiled = compileInput(); + } + return compiled._child(i, data, depths); }; return ret; } @@ -494,7 +441,7 @@ function argEquals(a, b) { } if (isArray(a) && isArray(b) && a.length === b.length) { - for (let i = 0; i < a.length; i++) { + for (var i = 0; i < a.length; i++) { if (!argEquals(a[i], b[i])) { return false; } @@ -502,12 +449,3 @@ function argEquals(a, b) { return true; } } - -function transformLiteralToPath(sexpr) { - if (!sexpr.path.parts) { - let literal = sexpr.path; - // Casting to string here to make false and 0 literal values play nicely with the rest - // of the system. - sexpr.path = new AST.PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); - } -} diff --git a/node_modules/handlebars/lib/handlebars/compiler/helpers.js b/node_modules/handlebars/lib/handlebars/compiler/helpers.js index fc0120c..758c740 100644 --- a/node_modules/handlebars/lib/handlebars/compiler/helpers.js +++ b/node_modules/handlebars/lib/handlebars/compiler/helpers.js @@ -1,123 +1,186 @@ -import Exception from '../exception'; - -export function SourceLocation(source, locInfo) { - this.source = source; - this.start = { - line: locInfo.first_line, - column: locInfo.first_column - }; - this.end = { - line: locInfo.last_line, - column: locInfo.last_column - }; -} - -export function id(token) { - if (/^\[.*\]$/.test(token)) { - return token.substr(1, token.length - 2); - } else { - return token; - } -} +import Exception from "../exception"; export function stripFlags(open, close) { return { - open: open.charAt(2) === '~', - close: close.charAt(close.length - 3) === '~' + left: open.charAt(2) === '~', + right: close.charAt(close.length-3) === '~' }; } -export function stripComment(comment) { - return comment.replace(/^\{\{~?\!-?-?/, '') - .replace(/-?-?~?\}\}$/, ''); -} -export function preparePath(data, parts, locInfo) { - locInfo = this.locInfo(locInfo); +export function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { + /*jshint -W040 */ + if (mustache.sexpr.id.original !== close.path.original) { + throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache); + } - let original = data ? '@' : '', - dig = [], - depth = 0, - depthString = ''; + var inverse = inverseAndProgram && inverseAndProgram.program; - for (let i = 0, l = parts.length; i < l; i++) { - let part = parts[i].part, - // If we have [] syntax then we do not treat path references as operators, - // i.e. foo.[this] resolves to approximately context.foo['this'] - isLiteral = parts[i].original !== part; - original += (parts[i].separator || '') + part; + var strip = { + left: mustache.strip.left, + right: close.strip.right, - if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { - if (dig.length > 0) { - throw new Exception('Invalid path: ' + original, {loc: locInfo}); - } else if (part === '..') { - depth++; - depthString += '../'; - } - } else { - dig.push(part); + // Determine the standalone candiacy. Basically flag our content as being possibly standalone + // so our parent can determine if we actually are standalone + openStandalone: isNextWhitespace(program.statements), + closeStandalone: isPrevWhitespace((inverse || program).statements) + }; + + if (mustache.strip.right) { + omitRight(program.statements, null, true); + } + + if (inverse) { + var inverseStrip = inverseAndProgram.strip; + + if (inverseStrip.left) { + omitLeft(program.statements, null, true); } - } - - return new this.PathExpression(data, depth, dig, original, locInfo); -} - -export function prepareMustache(path, params, hash, open, strip, locInfo) { - // Must use charAt to support IE pre-10 - let escapeFlag = open.charAt(3) || open.charAt(2), - escaped = escapeFlag !== '{' && escapeFlag !== '&'; - - return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo)); -} - -export function prepareRawBlock(openRawBlock, content, close, locInfo) { - if (openRawBlock.path.original !== close) { - let errorNode = {loc: openRawBlock.path.loc}; - - throw new Exception(openRawBlock.path.original + " doesn't match " + close, errorNode); - } - - locInfo = this.locInfo(locInfo); - let program = new this.Program([content], null, {}, locInfo); - - return new this.BlockStatement( - openRawBlock.path, openRawBlock.params, openRawBlock.hash, - program, undefined, - {}, {}, {}, - locInfo); -} - -export function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { - // When we are chaining inverse calls, we will not have a close path - if (close && close.path && openBlock.path.original !== close.path.original) { - let errorNode = {loc: openBlock.path.loc}; - - throw new Exception(openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); - } - - program.blockParams = openBlock.blockParams; - - let inverse, - inverseStrip; - - if (inverseAndProgram) { - if (inverseAndProgram.chain) { - inverseAndProgram.program.body[0].closeStrip = close.strip; + if (inverseStrip.right) { + omitRight(inverse.statements, null, true); + } + if (close.strip.left) { + omitLeft(inverse.statements, null, true); } - inverseStrip = inverseAndProgram.strip; - inverse = inverseAndProgram.program; + // Find standalone else statments + if (isPrevWhitespace(program.statements) + && isNextWhitespace(inverse.statements)) { + + omitLeft(program.statements); + omitRight(inverse.statements); + } + } else { + if (close.strip.left) { + omitLeft(program.statements, null, true); + } } if (inverted) { - inverted = inverse; - inverse = program; - program = inverted; + return new this.BlockNode(mustache, inverse, program, strip, locInfo); + } else { + return new this.BlockNode(mustache, program, inverse, strip, locInfo); + } +} + + +export function prepareProgram(statements, isRoot) { + for (var i = 0, l = statements.length; i < l; i++) { + var current = statements[i], + strip = current.strip; + + if (!strip) { + continue; + } + + var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'), + _isNextWhitespace = isNextWhitespace(statements, i, isRoot), + + openStandalone = strip.openStandalone && _isPrevWhitespace, + closeStandalone = strip.closeStandalone && _isNextWhitespace, + inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; + + if (strip.right) { + omitRight(statements, i, true); + } + if (strip.left) { + omitLeft(statements, i, true); + } + + if (inlineStandalone) { + omitRight(statements, i); + + if (omitLeft(statements, i)) { + // If we are on a standalone node, save the indent info for partials + if (current.type === 'partial') { + current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : ''; + } + } + } + if (openStandalone) { + omitRight((current.program || current.inverse).statements); + + // Strip out the previous content node if it's whitespace only + omitLeft(statements, i); + } + if (closeStandalone) { + // Always strip the next node + omitRight(statements, i); + + omitLeft((current.inverse || current.program).statements); + } } - return new this.BlockStatement( - openBlock.path, openBlock.params, openBlock.hash, - program, inverse, - openBlock.strip, inverseStrip, close && close.strip, - this.locInfo(locInfo)); + return statements; +} + +function isPrevWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = statements.length; + } + + // Nodes that end with newlines are considered whitespace (but are special + // cased for strip operations) + var prev = statements[i-1], + sibling = statements[i-2]; + if (!prev) { + return isRoot; + } + + if (prev.type === 'content') { + return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); + } +} +function isNextWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = -1; + } + + var next = statements[i+1], + sibling = statements[i+2]; + if (!next) { + return isRoot; + } + + if (next.type === 'content') { + return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); + } +} + +// Marks the node to the right of the position as omitted. +// I.e. {{foo}}' ' will mark the ' ' node as omitted. +// +// If i is undefined, then the first child will be marked as such. +// +// If mulitple is truthy then all whitespace will be stripped out until non-whitespace +// content is met. +function omitRight(statements, i, multiple) { + var current = statements[i == null ? 0 : i + 1]; + if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) { + return; + } + + var original = current.string; + current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); + current.rightStripped = current.string !== original; +} + +// Marks the node to the left of the position as omitted. +// I.e. ' '{{foo}} will mark the ' ' node as omitted. +// +// If i is undefined then the last child will be marked as such. +// +// If mulitple is truthy then all whitespace will be stripped out until non-whitespace +// content is met. +function omitLeft(statements, i, multiple) { + var current = statements[i == null ? statements.length - 1 : i - 1]; + if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) { + return; + } + + // We omit the last node if it's whitespace only and not preceeded by a non-content node. + var original = current.string; + current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); + current.leftStripped = current.string !== original; + return current.leftStripped; } diff --git a/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js b/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js index 8830661..d41cacd 100644 --- a/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js +++ b/node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js @@ -1,7 +1,5 @@ -import { COMPILER_REVISION, REVISION_CHANGES } from '../base'; -import Exception from '../exception'; -import {isArray} from '../utils'; -import CodeGen from './code-gen'; +import { COMPILER_REVISION, REVISION_CHANGES } from "../base"; +import Exception from "../exception"; function Literal(value) { this.value = value; @@ -14,44 +12,40 @@ JavaScriptCompiler.prototype = { // alternative compiled forms for name lookup and buffering semantics nameLookup: function(parent, name /* , type*/) { if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { - return [parent, '.', name]; + return parent + "." + name; } else { - return [parent, "['", name, "']"]; + return parent + "['" + name + "']"; } }, depthedLookup: function(name) { - return [this.aliasable('this.lookup'), '(depths, "', name, '")']; + this.aliases.lookup = 'this.lookup'; + + return 'lookup(depths, "' + name + '")'; }, compilerInfo: function() { - const revision = COMPILER_REVISION, - versions = REVISION_CHANGES[revision]; + var revision = COMPILER_REVISION, + versions = REVISION_CHANGES[revision]; return [revision, versions]; }, - appendToBuffer: function(source, location, explicit) { - // Force a source as this simplifies the merge logic. - if (!isArray(source)) { - source = [source]; - } - source = this.source.wrap(source, location); - + appendToBuffer: function(string) { if (this.environment.isSimple) { - return ['return ', source, ';']; - } else if (explicit) { - // This is a case where the buffer operation occurs as a child of another - // construct, generally braces. We have to explicitly output these buffer - // operations to ensure that the emitted code goes in the correct location. - return ['buffer += ', source, ';']; + return "return " + string + ";"; } else { - source.appendToBuffer = true; - return source; + return { + appendToBuffer: true, + content: string, + toString: function() { return "buffer += " + string + ";"; } + }; } }, initializeBuffer: function() { - return this.quotedString(''); + return this.quotedString(""); }, + + namespace: "Handlebars", // END PUBLIC API compile: function(environment, options, context, asObject) { @@ -77,29 +71,23 @@ JavaScriptCompiler.prototype = { this.hashes = []; this.compileStack = []; this.inlineStack = []; - this.blockParams = []; this.compileChildren(environment, options); - this.useDepths = this.useDepths || environment.useDepths || this.options.compat; - this.useBlockParams = this.useBlockParams || environment.useBlockParams; + this.useDepths = this.useDepths || environment.depths.list.length || this.options.compat; - let opcodes = environment.opcodes, + var opcodes = environment.opcodes, opcode, - firstLoc, i, l; for (i = 0, l = opcodes.length; i < l; i++) { opcode = opcodes[i]; - this.source.currentLocation = opcode.loc; - firstLoc = firstLoc || opcode.loc; this[opcode.opcode].apply(this, opcode.args); } // Flush any trailing content that might be pending. - this.source.currentLocation = firstLoc; this.pushSource(''); /* istanbul ignore next */ @@ -107,13 +95,13 @@ JavaScriptCompiler.prototype = { throw new Exception('Compile completed with content left on stack'); } - let fn = this.createFunctionContext(asObject); + var fn = this.createFunctionContext(asObject); if (!this.isChild) { - let ret = { + var ret = { compiler: this.compilerInfo(), main: fn }; - let programs = this.context.programs; + var programs = this.context.programs; for (i = 0, l = programs.length; i < l; i++) { if (programs[i]) { ret[i] = programs[i]; @@ -129,27 +117,13 @@ JavaScriptCompiler.prototype = { if (this.useDepths) { ret.useDepths = true; } - if (this.useBlockParams) { - ret.useBlockParams = true; - } if (this.options.compat) { ret.compat = true; } if (!asObject) { ret.compiler = JSON.stringify(ret.compiler); - - this.source.currentLocation = {start: {line: 1, column: 0}}; ret = this.objectLiteral(ret); - - if (options.srcName) { - ret = ret.toStringWithSourceMap({file: options.destName}); - ret.map = ret.map && ret.map.toString(); - } else { - ret = ret.toString(); - } - } else { - ret.compilerOptions = this.options; } return ret; @@ -162,111 +136,91 @@ JavaScriptCompiler.prototype = { // track the last context pushed into place to allow skipping the // getContext opcode when it would be a noop this.lastContext = 0; - this.source = new CodeGen(this.options.srcName); + this.source = []; }, createFunctionContext: function(asObject) { - let varDeclarations = ''; + var varDeclarations = ''; - let locals = this.stackVars.concat(this.registers.list); - if (locals.length > 0) { - varDeclarations += ', ' + locals.join(', '); + var locals = this.stackVars.concat(this.registers.list); + if(locals.length > 0) { + varDeclarations += ", " + locals.join(", "); } // Generate minimizer alias mappings - // - // When using true SourceNodes, this will update all references to the given alias - // as the source nodes are reused in situ. For the non-source node compilation mode, - // aliases will not be used, but this case is already being run on the client and - // we aren't concern about minimizing the template size. - let aliasCount = 0; - for (let alias in this.aliases) { // eslint-disable-line guard-for-in - let node = this.aliases[alias]; - - if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { - varDeclarations += ', alias' + (++aliasCount) + '=' + alias; - node.children[0] = 'alias' + aliasCount; + for (var alias in this.aliases) { + if (this.aliases.hasOwnProperty(alias)) { + varDeclarations += ', ' + alias + '=' + this.aliases[alias]; } } - let params = ['depth0', 'helpers', 'partials', 'data']; + var params = ["depth0", "helpers", "partials", "data"]; - if (this.useBlockParams || this.useDepths) { - params.push('blockParams'); - } if (this.useDepths) { params.push('depths'); } // Perform a second pass over the output to merge content when possible - let source = this.mergeSource(varDeclarations); + var source = this.mergeSource(varDeclarations); if (asObject) { params.push(source); return Function.apply(this, params); } else { - return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); + return 'function(' + params.join(',') + ') {\n ' + source + '}'; } }, mergeSource: function(varDeclarations) { - let isSimple = this.environment.isSimple, + var source = '', + buffer, appendOnly = !this.forceBuffer, - appendFirst, + appendFirst; - sourceSeen, - bufferStart, - bufferEnd; - this.source.each((line) => { + for (var i = 0, len = this.source.length; i < len; i++) { + var line = this.source[i]; if (line.appendToBuffer) { - if (bufferStart) { - line.prepend(' + '); + if (buffer) { + buffer = buffer + '\n + ' + line.content; } else { - bufferStart = line; + buffer = line.content; } - bufferEnd = line; } else { - if (bufferStart) { - if (!sourceSeen) { + if (buffer) { + if (!source) { appendFirst = true; + source = buffer + ';\n '; } else { - bufferStart.prepend('buffer += '); + source += 'buffer += ' + buffer + ';\n '; } - bufferEnd.add(';'); - bufferStart = bufferEnd = undefined; + buffer = undefined; } + source += line + '\n '; - sourceSeen = true; - if (!isSimple) { + if (!this.environment.isSimple) { appendOnly = false; } } - }); - + } if (appendOnly) { - if (bufferStart) { - bufferStart.prepend('return '); - bufferEnd.add(';'); - } else if (!sourceSeen) { - this.source.push('return "";'); + if (buffer || !source) { + source += 'return ' + (buffer || '""') + ';\n'; } } else { - varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); - - if (bufferStart) { - bufferStart.prepend('return buffer + '); - bufferEnd.add(';'); + varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer()); + if (buffer) { + source += 'return buffer + ' + buffer + ';\n'; } else { - this.source.push('return buffer;'); + source += 'return buffer;\n'; } } if (varDeclarations) { - this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); + source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source; } - return this.source.merge(); + return source; }, // [blockValue] @@ -279,14 +233,15 @@ JavaScriptCompiler.prototype = { // replace it on the stack with the result of properly // invoking blockHelperMissing. blockValue: function(name) { - let blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs(name, 0, params); + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; - let blockName = this.popStack(); + var params = [this.contextName(0)]; + this.setupParams(name, 0, params); + + var blockName = this.popStack(); params.splice(1, 0, blockName); - this.push(this.source.functionCall(blockHelperMissing, 'call', params)); + this.push('blockHelperMissing.call(' + params.join(', ') + ')'); }, // [ambiguousBlockValue] @@ -296,20 +251,18 @@ JavaScriptCompiler.prototype = { // On stack, after, if no lastHelper: same as [blockValue] // On stack, after, if lastHelper: value ambiguousBlockValue: function() { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + // We're being a bit cheeky and reusing the options value from the prior exec - let blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), - params = [this.contextName(0)]; - this.setupHelperArgs('', 0, params, true); + var params = [this.contextName(0)]; + this.setupParams('', 0, params, true); this.flushInline(); - let current = this.topStack(); + var current = this.topStack(); params.splice(1, 0, current); - this.pushSource([ - 'if (!', this.lastHelper, ') { ', - current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), - '}']); + this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }"); }, // [appendContent] @@ -321,8 +274,6 @@ JavaScriptCompiler.prototype = { appendContent: function(content) { if (this.pendingContent) { content = this.pendingContent + content; - } else { - this.pendingLocation = this.source.currentLocation; } this.pendingContent = content; @@ -338,16 +289,13 @@ JavaScriptCompiler.prototype = { // If `value` is truthy, or 0, it is coerced into a string and appended // Otherwise, the empty string is appended append: function() { - if (this.isInline()) { - this.replaceStack((current) => [' != null ? ', current, ' : ""']); - - this.pushSource(this.appendToBuffer(this.popStack())); - } else { - let local = this.popStack(); - this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); - if (this.environment.isSimple) { - this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); - } + // Force anything that is inlined onto the stack so we don't have duplication + // when we examine local + this.flushInline(); + var local = this.popStack(); + this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }'); + if (this.environment.isSimple) { + this.pushSource("else { " + this.appendToBuffer("''") + " }"); } }, @@ -358,8 +306,9 @@ JavaScriptCompiler.prototype = { // // Escape `value` and append it to the buffer appendEscaped: function() { - this.pushSource(this.appendToBuffer( - [this.aliasable('this.escapeExpression'), '(', this.popStack(), ')'])); + this.aliases.escapeExpression = 'this.escapeExpression'; + + this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")); }, // [getContext] @@ -391,7 +340,9 @@ JavaScriptCompiler.prototype = { // Looks up the value of `name` on the current context and pushes // it onto the stack. lookupOnContext: function(parts, falsy, scoped) { - let i = 0; + /*jshint -W083 */ + var i = 0, + len = parts.length; if (!scoped && this.options.compat && !this.lastContext) { // The depthed query is expected to handle the undefined logic for the root level that @@ -401,21 +352,19 @@ JavaScriptCompiler.prototype = { this.pushContext(); } - this.resolvePath('context', parts, i, falsy); - }, - - // [lookupBlockParam] - // - // On stack, before: ... - // On stack, after: blockParam[name], ... - // - // Looks up the value of `parts` on the given block param and pushes - // it onto the stack. - lookupBlockParam: function(blockParamId, parts) { - this.useBlockParams = true; - - this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); - this.resolvePath('context', parts, 1); + for (; i < len; i++) { + this.replaceStack(function(current) { + var lookup = this.nameLookup(current, parts[i], 'context'); + // We want to ensure that zero and false are handled properly if the context (falsy flag) + // needs to have the special handling for these values. + if (!falsy) { + return ' != null ? ' + lookup + ' : ' + current; + } else { + // Otherwise we can use generic falsy handling + return ' && ' + lookup; + } + }); + } }, // [lookupData] @@ -425,36 +374,18 @@ JavaScriptCompiler.prototype = { // // Push the data lookup operator lookupData: function(depth, parts) { + /*jshint -W083 */ if (!depth) { this.pushStackLiteral('data'); } else { this.pushStackLiteral('this.data(data, ' + depth + ')'); } - this.resolvePath('data', parts, 0, true); - }, - - resolvePath: function(type, parts, i, falsy) { - if (this.options.strict || this.options.assumeObjects) { - this.push(strictLookup(this.options.strict, this, parts, type)); - return; - } - - let len = parts.length; - for (; i < len; i++) { - /*eslint-disable no-loop-func */ - this.replaceStack((current) => { - let lookup = this.nameLookup(current, parts[i], type); - // We want to ensure that zero and false are handled properly if the context (falsy flag) - // needs to have the special handling for these values. - if (!falsy) { - return [' != null ? ', lookup, ' : ', current]; - } else { - // Otherwise we can use generic falsy handling - return [' && ', lookup]; - } + var len = parts.length; + for (var i = 0; i < len; i++) { + this.replaceStack(function(current) { + return ' && ' + this.nameLookup(current, parts[i], 'data'); }); - /*eslint-enable no-loop-func */ } }, @@ -466,7 +397,9 @@ JavaScriptCompiler.prototype = { // If the `value` is a lambda, replace it on the stack by // the return value of the lambda resolvePossibleLambda: function() { - this.push([this.aliasable('this.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); + this.aliases.lambda = 'this.lambda'; + + this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')'); }, // [pushStringParam] @@ -483,7 +416,7 @@ JavaScriptCompiler.prototype = { // If it's a subexpression, the string result // will be pushed after this opcode. - if (type !== 'SubExpression') { + if (type !== 'sexpr') { if (typeof string === 'string') { this.pushString(string); } else { @@ -492,7 +425,9 @@ JavaScriptCompiler.prototype = { } }, - emptyHash: function(omitEmpty) { + emptyHash: function() { + this.pushStackLiteral('{}'); + if (this.trackIds) { this.push('{}'); // hashIds } @@ -500,7 +435,6 @@ JavaScriptCompiler.prototype = { this.push('{}'); // hashContexts this.push('{}'); // hashTypes } - this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); }, pushHash: function() { if (this.hash) { @@ -509,18 +443,18 @@ JavaScriptCompiler.prototype = { this.hash = {values: [], types: [], contexts: [], ids: []}; }, popHash: function() { - let hash = this.hash; + var hash = this.hash; this.hash = this.hashes.pop(); if (this.trackIds) { - this.push(this.objectLiteral(hash.ids)); + this.push('{' + hash.ids.join(',') + '}'); } if (this.stringParams) { - this.push(this.objectLiteral(hash.contexts)); - this.push(this.objectLiteral(hash.types)); + this.push('{' + hash.contexts.join(',') + '}'); + this.push('{' + hash.types.join(',') + '}'); } - this.push(this.objectLiteral(hash.values)); + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); }, // [pushString] @@ -533,6 +467,17 @@ JavaScriptCompiler.prototype = { this.pushStackLiteral(this.quotedString(string)); }, + // [push] + // + // On stack, before: ... + // On stack, after: expr, ... + // + // Push an expression onto the stack + push: function(expr) { + this.inlineStack.push(expr); + return expr; + }, + // [pushLiteral] // // On stack, before: ... @@ -571,17 +516,13 @@ JavaScriptCompiler.prototype = { // // If the helper is not found, `helperMissing` is called. invokeHelper: function(paramSize, name, isSimple) { - let nonHelper = this.popStack(), - helper = this.setupHelper(paramSize, name), - simple = isSimple ? [helper.name, ' || '] : ''; + this.aliases.helperMissing = 'helpers.helperMissing'; - let lookup = ['('].concat(simple, nonHelper); - if (!this.options.strict) { - lookup.push(' || ', this.aliasable('helpers.helperMissing')); - } - lookup.push(')'); + var nonHelper = this.popStack(); + var helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(lookup, 'call', helper.callParams)); + var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing'; + this.push('((' + lookup + ').call(' + helper.callParams + '))'); }, // [invokeKnownHelper] @@ -592,8 +533,8 @@ JavaScriptCompiler.prototype = { // This operation is used when the helper is known to exist, // so a `helperMissing` fallback is not required. invokeKnownHelper: function(paramSize, name) { - let helper = this.setupHelper(paramSize, name); - this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); + var helper = this.setupHelper(paramSize, name); + this.push(helper.name + ".call(" + helper.callParams + ")"); }, // [invokeAmbiguous] @@ -609,30 +550,21 @@ JavaScriptCompiler.prototype = { // and can be avoided by passing the `knownHelpers` and // `knownHelpersOnly` flags at compile-time. invokeAmbiguous: function(name, helperCall) { + this.aliases.functionType = '"function"'; + this.aliases.helperMissing = 'helpers.helperMissing'; this.useRegister('helper'); - let nonHelper = this.popStack(); + var nonHelper = this.popStack(); this.emptyHash(); - let helper = this.setupHelper(0, name, helperCall); + var helper = this.setupHelper(0, name, helperCall); - let helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); + var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); - let lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; - if (!this.options.strict) { - lookup[0] = '(helper = '; - lookup.push( - ' != null ? helper : ', - this.aliasable('helpers.helperMissing') - ); - } - - this.push([ - '(', lookup, - (helper.paramsInit ? ['),(', helper.paramsInit] : []), '),', - '(typeof helper === ', this.aliasable('"function"'), ' ? ', - this.source.functionCall('helper', 'call', helper.callParams), ' : helper))' - ]); + this.push( + '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing' + + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),' + + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))'); }, // [invokePartial] @@ -642,34 +574,19 @@ JavaScriptCompiler.prototype = { // // This operation pops off a context, invokes a partial with that context, // and pushes the result of the invocation back. - invokePartial: function(isDynamic, name, indent) { - let params = [], - options = this.setupParams(name, 1, params, false); + invokePartial: function(name, indent) { + var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"]; - if (isDynamic) { - name = this.popStack(); - delete options.name; + if (this.options.data) { + params.push("data"); + } else if (this.options.compat) { + params.push('undefined'); } - - if (indent) { - options.indent = JSON.stringify(indent); - } - options.helpers = 'helpers'; - options.partials = 'partials'; - - if (!isDynamic) { - params.unshift(this.nameLookup('partials', name, 'partial')); - } else { - params.unshift(name); - } - if (this.options.compat) { - options.depths = 'depths'; + params.push('depths'); } - options = this.objectLiteral(options); - params.push(options); - this.push(this.source.functionCall('this.invokePartial', '', params)); + this.push("this.invokePartial(" + params.join(", ") + ")"); }, // [assignToHash] @@ -679,7 +596,7 @@ JavaScriptCompiler.prototype = { // // Pops a value off the stack and assigns it to the current hash assignToHash: function(key) { - let value = this.popStack(), + var value = this.popStack(), context, type, id; @@ -692,27 +609,23 @@ JavaScriptCompiler.prototype = { context = this.popStack(); } - let hash = this.hash; + var hash = this.hash; if (context) { - hash.contexts[key] = context; + hash.contexts.push("'" + key + "': " + context); } if (type) { - hash.types[key] = type; + hash.types.push("'" + key + "': " + type); } if (id) { - hash.ids[key] = id; + hash.ids.push("'" + key + "': " + id); } - hash.values[key] = value; + hash.values.push("'" + key + "': (" + value + ")"); }, - pushId: function(type, name, child) { - if (type === 'BlockParam') { - this.pushStackLiteral( - 'blockParams[' + name[0] + '].path[' + name[1] + ']' - + (child ? ' + ' + JSON.stringify('.' + child) : '')); - } else if (type === 'PathExpression') { + pushId: function(type, name) { + if (type === 'ID' || type === 'DATA') { this.pushString(name); - } else if (type === 'SubExpression') { + } else if (type === 'sexpr') { this.pushStackLiteral('true'); } else { this.pushStackLiteral('null'); @@ -724,13 +637,13 @@ JavaScriptCompiler.prototype = { compiler: JavaScriptCompiler, compileChildren: function(environment, options) { - let children = environment.children, child, compiler; + var children = environment.children, child, compiler; - for (let i = 0, l = children.length; i < l; i++) { + for(var i=0, l=children.length; i this.stackVars.length) { this.stackVars.push('stack' + this.stackSlot); } + if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } return this.topStackName(); }, topStackName: function() { - return 'stack' + this.stackSlot; + return "stack" + this.stackSlot; }, flushInline: function() { - let inlineStack = this.inlineStack; - this.inlineStack = []; - for (let i = 0, len = inlineStack.length; i < len; i++) { - let entry = inlineStack[i]; - /* istanbul ignore if */ - if (entry instanceof Literal) { - this.compileStack.push(entry); - } else { - let stack = this.incrStack(); - this.pushSource([stack, ' = ', entry, ';']); - this.compileStack.push(stack); + var inlineStack = this.inlineStack; + if (inlineStack.length) { + this.inlineStack = []; + for (var i = 0, len = inlineStack.length; i < len; i++) { + var entry = inlineStack[i]; + if (entry instanceof Literal) { + this.compileStack.push(entry); + } else { + this.pushStack(entry); + } } } }, @@ -873,7 +781,7 @@ JavaScriptCompiler.prototype = { }, popStack: function(wrapped) { - let inline = this.isInline(), + var inline = this.isInline(), item = (inline ? this.inlineStack : this.compileStack).pop(); if (!wrapped && (item instanceof Literal)) { @@ -891,10 +799,9 @@ JavaScriptCompiler.prototype = { }, topStack: function() { - let stack = (this.isInline() ? this.inlineStack : this.compileStack), + var stack = (this.isInline() ? this.inlineStack : this.compileStack), item = stack[stack.length - 1]; - /* istanbul ignore if */ if (item instanceof Literal) { return item.value; } else { @@ -911,42 +818,42 @@ JavaScriptCompiler.prototype = { }, quotedString: function(str) { - return this.source.quotedString(str); + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 + .replace(/\u2029/g, '\\u2029') + '"'; }, objectLiteral: function(obj) { - return this.source.objectLiteral(obj); - }, + var pairs = []; - aliasable: function(name) { - let ret = this.aliases[name]; - if (ret) { - ret.referenceCount++; - return ret; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + pairs.push(this.quotedString(key) + ':' + obj[key]); + } } - ret = this.aliases[name] = this.source.wrap(name); - ret.aliasable = true; - ret.referenceCount = 1; - - return ret; + return '{' + pairs.join(',') + '}'; }, setupHelper: function(paramSize, name, blockHelper) { - let params = [], - paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); - let foundHelper = this.nameLookup('helpers', name, 'helper'); + var params = [], + paramsInit = this.setupParams(name, paramSize, params, blockHelper); + var foundHelper = this.nameLookup('helpers', name, 'helper'); return { params: params, paramsInit: paramsInit, name: foundHelper, - callParams: [this.contextName(0)].concat(params) + callParams: [this.contextName(0)].concat(params).join(", ") }; }, - setupParams: function(helper, paramSize, params) { - let options = {}, contexts = [], types = [], ids = [], param; + setupOptions: function(helper, paramSize, params) { + var options = {}, contexts = [], types = [], ids = [], param, inverse, program; options.name = this.quotedString(helper); options.hash = this.popStack(); @@ -959,19 +866,27 @@ JavaScriptCompiler.prototype = { options.hashContexts = this.popStack(); } - let inverse = this.popStack(), - program = this.popStack(); + inverse = this.popStack(); + program = this.popStack(); // Avoid setting fn and inverse if neither are set. This allows // helpers to do a check for `if (options.fn)` if (program || inverse) { - options.fn = program || 'this.noop'; - options.inverse = inverse || 'this.noop'; + if (!program) { + program = 'this.noop'; + } + + if (!inverse) { + inverse = 'this.noop'; + } + + options.fn = program; + options.inverse = inverse; } // The parameters go on to the stack in order (making sure that they are evaluated in order) // so we need to pop them off the stack in reverse order - let i = paramSize; + var i = paramSize; while (i--) { param = this.popStack(); params[i] = param; @@ -986,29 +901,29 @@ JavaScriptCompiler.prototype = { } if (this.trackIds) { - options.ids = this.source.generateArray(ids); + options.ids = "[" + ids.join(",") + "]"; } if (this.stringParams) { - options.types = this.source.generateArray(types); - options.contexts = this.source.generateArray(contexts); + options.types = "[" + types.join(",") + "]"; + options.contexts = "[" + contexts.join(",") + "]"; } if (this.options.data) { - options.data = 'data'; - } - if (this.useBlockParams) { - options.blockParams = 'blockParams'; + options.data = "data"; } + return options; }, - setupHelperArgs: function(helper, paramSize, params, useRegister) { - let options = this.setupParams(helper, paramSize, params, true); - options = this.objectLiteral(options); + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(helperName, paramSize, params, useRegister) { + var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params)); + if (useRegister) { this.useRegister('options'); params.push('options'); - return ['options=', options]; + return 'options=' + options; } else { params.push(options); return ''; @@ -1016,55 +931,32 @@ JavaScriptCompiler.prototype = { } }; +var reservedWords = ( + "break else new var" + + " case finally return void" + + " catch for switch while" + + " continue function this with" + + " default if throw" + + " delete in try" + + " do instanceof typeof" + + " abstract enum int short" + + " boolean export interface static" + + " byte extends long super" + + " char final native synchronized" + + " class float package throws" + + " const goto private transient" + + " debugger implements protected volatile" + + " double import public let yield" +).split(" "); -(function() { - const reservedWords = ( - 'break else new var' + - ' case finally return void' + - ' catch for switch while' + - ' continue function this with' + - ' default if throw' + - ' delete in try' + - ' do instanceof typeof' + - ' abstract enum int short' + - ' boolean export interface static' + - ' byte extends long super' + - ' char final native synchronized' + - ' class float package throws' + - ' const goto private transient' + - ' debugger implements protected volatile' + - ' double import public let yield await' + - ' null true false' - ).split(' '); +var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - const compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; - - for (let i = 0, l = reservedWords.length; i < l; i++) { - compilerWords[reservedWords[i]] = true; - } -}()); - -JavaScriptCompiler.isValidJavaScriptVariableName = function(name) { - return !JavaScriptCompiler.RESERVED_WORDS[name] && (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/).test(name); -}; - -function strictLookup(requireTerminal, compiler, parts, type) { - let stack = compiler.popStack(), - i = 0, - len = parts.length; - if (requireTerminal) { - len--; - } - - for (; i < len; i++) { - stack = compiler.nameLookup(stack, parts[i], type); - } - - if (requireTerminal) { - return [compiler.aliasable('this.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')']; - } else { - return stack; - } +for(var i=0, l=reservedWords.length; i@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; -lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,42],"inclusive":true}}; +lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; +lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}}; return lexer;})() parser.lexer = lexer; function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; return new Parser; })();export default handlebars; +/* jshint ignore:end */ diff --git a/node_modules/handlebars/lib/handlebars/compiler/printer.js b/node_modules/handlebars/lib/handlebars/compiler/printer.js index 691a356..7654245 100644 --- a/node_modules/handlebars/lib/handlebars/compiler/printer.js +++ b/node_modules/handlebars/lib/handlebars/compiler/printer.js @@ -1,5 +1,4 @@ -/*eslint-disable new-cap */ -import Visitor from './visitor'; +import Visitor from "./visitor"; export function print(ast) { return new PrintVisitor().accept(ast); @@ -12,32 +11,23 @@ export function PrintVisitor() { PrintVisitor.prototype = new Visitor(); PrintVisitor.prototype.pad = function(string) { - let out = ''; + var out = ""; - for (let i = 0, l = this.padding; i < l; i++) { - out = out + ' '; + for(var i=0,l=this.padding; i ' + content + ' }}'); -}; +PrintVisitor.prototype.sexpr = function(sexpr) { + var params = sexpr.params, paramStrings = [], hash; -PrintVisitor.prototype.ContentStatement = function(content) { - return this.pad("CONTENT[ '" + content.value + "' ]"); -}; - -PrintVisitor.prototype.CommentStatement = function(comment) { - return this.pad("{{! '" + comment.value + "' }}"); -}; - -PrintVisitor.prototype.SubExpression = function(sexpr) { - let params = sexpr.params, - paramStrings = [], - hash; - - for (let i = 0, l = params.length; i < l; i++) { + for(var i=0, l=params.length; i " + content + " }}"); }; -PrintVisitor.prototype.NumberLiteral = function(number) { - return 'NUMBER{' + number.value + '}'; -}; +PrintVisitor.prototype.hash = function(hash) { + var pairs = hash.pairs; + var joinedPairs = [], left, right; -PrintVisitor.prototype.BooleanLiteral = function(bool) { - return 'BOOLEAN{' + bool.value + '}'; -}; - -PrintVisitor.prototype.UndefinedLiteral = function() { - return 'UNDEFINED'; -}; - -PrintVisitor.prototype.NullLiteral = function() { - return 'NULL'; -}; - -PrintVisitor.prototype.Hash = function(hash) { - let pairs = hash.pairs, - joinedPairs = []; - - for (let i = 0, l = pairs.length; i < l; i++) { - joinedPairs.push(this.accept(pairs[i])); + for(var i=0, l=pairs.length; i 1) { + return "PATH:" + path; + } else { + return "ID:" + path; + } +}; + +PrintVisitor.prototype.PARTIAL_NAME = function(partialName) { + return "PARTIAL:" + partialName.name; +}; + +PrintVisitor.prototype.DATA = function(data) { + return "@" + this.accept(data.id); +}; + +PrintVisitor.prototype.content = function(content) { + return this.pad("CONTENT[ '" + content.string + "' ]"); +}; + +PrintVisitor.prototype.comment = function(comment) { + return this.pad("{{! '" + comment.comment + "' }}"); +}; + diff --git a/node_modules/handlebars/lib/handlebars/compiler/visitor.js b/node_modules/handlebars/lib/handlebars/compiler/visitor.js index ba7b376..6a0373e 100644 --- a/node_modules/handlebars/lib/handlebars/compiler/visitor.js +++ b/node_modules/handlebars/lib/handlebars/compiler/visitor.js @@ -1,118 +1,10 @@ -import Exception from '../exception'; -import AST from './ast'; - -function Visitor() { - this.parents = []; -} +function Visitor() {} Visitor.prototype = { constructor: Visitor, - mutating: false, - - // Visits a given value. If mutating, will replace the value if necessary. - acceptKey: function(node, name) { - let value = this.accept(node[name]); - if (this.mutating) { - // Hacky sanity check: - if (value && (!value.type || !AST[value.type])) { - throw new Exception('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); - } - node[name] = value; - } - }, - - // Performs an accept operation with added sanity check to ensure - // required keys are not removed. - acceptRequired: function(node, name) { - this.acceptKey(node, name); - - if (!node[name]) { - throw new Exception(node.type + ' requires ' + name); - } - }, - - // Traverses a given array. If mutating, empty respnses will be removed - // for child elements. - acceptArray: function(array) { - for (let i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - - if (!array[i]) { - array.splice(i, 1); - i--; - l--; - } - } - }, accept: function(object) { - if (!object) { - return; - } - - if (this.current) { - this.parents.unshift(this.current); - } - this.current = object; - - let ret = this[object.type](object); - - this.current = this.parents.shift(); - - if (!this.mutating || ret) { - return ret; - } else if (ret !== false) { - return object; - } - }, - - Program: function(program) { - this.acceptArray(program.body); - }, - - MustacheStatement: function(mustache) { - this.acceptRequired(mustache, 'path'); - this.acceptArray(mustache.params); - this.acceptKey(mustache, 'hash'); - }, - - BlockStatement: function(block) { - this.acceptRequired(block, 'path'); - this.acceptArray(block.params); - this.acceptKey(block, 'hash'); - - this.acceptKey(block, 'program'); - this.acceptKey(block, 'inverse'); - }, - - PartialStatement: function(partial) { - this.acceptRequired(partial, 'name'); - this.acceptArray(partial.params); - this.acceptKey(partial, 'hash'); - }, - - ContentStatement: function(/* content */) {}, - CommentStatement: function(/* comment */) {}, - - SubExpression: function(sexpr) { - this.acceptRequired(sexpr, 'path'); - this.acceptArray(sexpr.params); - this.acceptKey(sexpr, 'hash'); - }, - - PathExpression: function(/* path */) {}, - - StringLiteral: function(/* string */) {}, - NumberLiteral: function(/* number */) {}, - BooleanLiteral: function(/* bool */) {}, - UndefinedLiteral: function(/* literal */) {}, - NullLiteral: function(/* literal */) {}, - - Hash: function(hash) { - this.acceptArray(hash.pairs); - }, - HashPair: function(pair) { - this.acceptRequired(pair, 'value'); + return this[object.type](object); } }; diff --git a/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js b/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js deleted file mode 100644 index 5b76944..0000000 --- a/node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js +++ /dev/null @@ -1,208 +0,0 @@ -import Visitor from './visitor'; - -function WhitespaceControl() { -} -WhitespaceControl.prototype = new Visitor(); - -WhitespaceControl.prototype.Program = function(program) { - let isRoot = !this.isRootSeen; - this.isRootSeen = true; - - let body = program.body; - for (let i = 0, l = body.length; i < l; i++) { - let current = body[i], - strip = this.accept(current); - - if (!strip) { - continue; - } - - let _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), - _isNextWhitespace = isNextWhitespace(body, i, isRoot), - - openStandalone = strip.openStandalone && _isPrevWhitespace, - closeStandalone = strip.closeStandalone && _isNextWhitespace, - inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; - - if (strip.close) { - omitRight(body, i, true); - } - if (strip.open) { - omitLeft(body, i, true); - } - - if (inlineStandalone) { - omitRight(body, i); - - if (omitLeft(body, i)) { - // If we are on a standalone node, save the indent info for partials - if (current.type === 'PartialStatement') { - // Pull out the whitespace from the final line - current.indent = (/([ \t]+$)/).exec(body[i - 1].original)[1]; - } - } - } - if (openStandalone) { - omitRight((current.program || current.inverse).body); - - // Strip out the previous content node if it's whitespace only - omitLeft(body, i); - } - if (closeStandalone) { - // Always strip the next node - omitRight(body, i); - - omitLeft((current.inverse || current.program).body); - } - } - - return program; -}; -WhitespaceControl.prototype.BlockStatement = function(block) { - this.accept(block.program); - this.accept(block.inverse); - - // Find the inverse program that is involed with whitespace stripping. - let program = block.program || block.inverse, - inverse = block.program && block.inverse, - firstInverse = inverse, - lastInverse = inverse; - - if (inverse && inverse.chained) { - firstInverse = inverse.body[0].program; - - // Walk the inverse chain to find the last inverse that is actually in the chain. - while (lastInverse.chained) { - lastInverse = lastInverse.body[lastInverse.body.length - 1].program; - } - } - - let strip = { - open: block.openStrip.open, - close: block.closeStrip.close, - - // Determine the standalone candiacy. Basically flag our content as being possibly standalone - // so our parent can determine if we actually are standalone - openStandalone: isNextWhitespace(program.body), - closeStandalone: isPrevWhitespace((firstInverse || program).body) - }; - - if (block.openStrip.close) { - omitRight(program.body, null, true); - } - - if (inverse) { - let inverseStrip = block.inverseStrip; - - if (inverseStrip.open) { - omitLeft(program.body, null, true); - } - - if (inverseStrip.close) { - omitRight(firstInverse.body, null, true); - } - if (block.closeStrip.open) { - omitLeft(lastInverse.body, null, true); - } - - // Find standalone else statments - if (isPrevWhitespace(program.body) - && isNextWhitespace(firstInverse.body)) { - omitLeft(program.body); - omitRight(firstInverse.body); - } - } else if (block.closeStrip.open) { - omitLeft(program.body, null, true); - } - - return strip; -}; - -WhitespaceControl.prototype.MustacheStatement = function(mustache) { - return mustache.strip; -}; - -WhitespaceControl.prototype.PartialStatement = - WhitespaceControl.prototype.CommentStatement = function(node) { - /* istanbul ignore next */ - let strip = node.strip || {}; - return { - inlineStandalone: true, - open: strip.open, - close: strip.close - }; -}; - - -function isPrevWhitespace(body, i, isRoot) { - if (i === undefined) { - i = body.length; - } - - // Nodes that end with newlines are considered whitespace (but are special - // cased for strip operations) - let prev = body[i - 1], - sibling = body[i - 2]; - if (!prev) { - return isRoot; - } - - if (prev.type === 'ContentStatement') { - return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); - } -} -function isNextWhitespace(body, i, isRoot) { - if (i === undefined) { - i = -1; - } - - let next = body[i + 1], - sibling = body[i + 2]; - if (!next) { - return isRoot; - } - - if (next.type === 'ContentStatement') { - return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); - } -} - -// Marks the node to the right of the position as omitted. -// I.e. {{foo}}' ' will mark the ' ' node as omitted. -// -// If i is undefined, then the first child will be marked as such. -// -// If mulitple is truthy then all whitespace will be stripped out until non-whitespace -// content is met. -function omitRight(body, i, multiple) { - let current = body[i == null ? 0 : i + 1]; - if (!current || current.type !== 'ContentStatement' || (!multiple && current.rightStripped)) { - return; - } - - let original = current.value; - current.value = current.value.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); - current.rightStripped = current.value !== original; -} - -// Marks the node to the left of the position as omitted. -// I.e. ' '{{foo}} will mark the ' ' node as omitted. -// -// If i is undefined then the last child will be marked as such. -// -// If mulitple is truthy then all whitespace will be stripped out until non-whitespace -// content is met. -function omitLeft(body, i, multiple) { - let current = body[i == null ? body.length - 1 : i - 1]; - if (!current || current.type !== 'ContentStatement' || (!multiple && current.leftStripped)) { - return; - } - - // We omit the last node if it's whitespace only and not preceeded by a non-content node. - let original = current.value; - current.value = current.value.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); - current.leftStripped = current.value !== original; - return current.leftStripped; -} - -export default WhitespaceControl; diff --git a/node_modules/handlebars/lib/handlebars/exception.js b/node_modules/handlebars/lib/handlebars/exception.js index 46ce18e..8c5c2f6 100644 --- a/node_modules/handlebars/lib/handlebars/exception.js +++ b/node_modules/handlebars/lib/handlebars/exception.js @@ -1,31 +1,24 @@ -const errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; +var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; function Exception(message, node) { - let loc = node && node.loc, - line, - column; - if (loc) { - line = loc.start.line; - column = loc.start.column; + var line; + if (node && node.firstLine) { + line = node.firstLine; - message += ' - ' + line + ':' + column; + message += ' - ' + line + ':' + node.firstColumn; } - let tmp = Error.prototype.constructor.call(this, message); + var tmp = Error.prototype.constructor.call(this, message); // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (let idx = 0; idx < errorProps.length; idx++) { + for (var idx = 0; idx < errorProps.length; idx++) { this[errorProps[idx]] = tmp[errorProps[idx]]; } - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { + if (line) { this.lineNumber = line; - this.column = column; + this.column = node.firstColumn; } } diff --git a/node_modules/handlebars/lib/handlebars/no-conflict.js b/node_modules/handlebars/lib/handlebars/no-conflict.js deleted file mode 100644 index a421f57..0000000 --- a/node_modules/handlebars/lib/handlebars/no-conflict.js +++ /dev/null @@ -1,12 +0,0 @@ -/*global window */ -export default function(Handlebars) { - /* istanbul ignore next */ - let root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function() { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - }; -} diff --git a/node_modules/handlebars/lib/handlebars/runtime.js b/node_modules/handlebars/lib/handlebars/runtime.js index 874728f..5970175 100644 --- a/node_modules/handlebars/lib/handlebars/runtime.js +++ b/node_modules/handlebars/lib/handlebars/runtime.js @@ -1,21 +1,21 @@ -import * as Utils from './utils'; -import Exception from './exception'; -import { COMPILER_REVISION, REVISION_CHANGES, createFrame } from './base'; +module Utils from "./utils"; +import Exception from "./exception"; +import { COMPILER_REVISION, REVISION_CHANGES, createFrame } from "./base"; export function checkRevision(compilerInfo) { - const compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = COMPILER_REVISION; + var compilerRevision = compilerInfo && compilerInfo[0] || 1, + currentRevision = COMPILER_REVISION; if (compilerRevision !== currentRevision) { if (compilerRevision < currentRevision) { - const runtimeVersions = REVISION_CHANGES[currentRevision], - compilerVersions = REVISION_CHANGES[compilerRevision]; - throw new Exception('Template was precompiled with an older version of Handlebars than the current runtime. ' + - 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); + var runtimeVersions = REVISION_CHANGES[currentRevision], + compilerVersions = REVISION_CHANGES[compilerRevision]; + throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+ + "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+")."); } else { // Use the embedded version info since the runtime doesn't know about this revision yet - throw new Exception('Template was precompiled with a newer version of Handlebars than the current runtime. ' + - 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); + throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+ + "Please update your runtime to a newer version ("+compilerInfo[1]+")."); } } } @@ -25,7 +25,7 @@ export function checkRevision(compilerInfo) { export function template(templateSpec, env) { /* istanbul ignore next */ if (!env) { - throw new Exception('No environment passed to template'); + throw new Exception("No environment passed to template"); } if (!templateSpec || !templateSpec.main) { throw new Exception('Unknown template object: ' + typeof templateSpec); @@ -35,47 +35,41 @@ export function template(templateSpec, env) { // for external users to override these as psuedo-supported APIs. env.VM.checkRevision(templateSpec.compiler); - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = Utils.extend({}, context, options.hash); + var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) { + if (hash) { + context = Utils.extend({}, context, hash); } - partial = env.VM.resolvePartial.call(this, partial, context, options); - let result = env.VM.invokePartial.call(this, partial, context, options); + var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths); if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); + var options = { helpers: helpers, partials: partials, data: data, depths: depths }; + partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env); + result = partials[name](context, options); } if (result != null) { - if (options.indent) { - let lines = result.split('\n'); - for (let i = 0, l = lines.length; i < l; i++) { + if (indent) { + var lines = result.split('\n'); + for (var i = 0, l = lines.length; i < l; i++) { if (!lines[i] && i + 1 === l) { break; } - lines[i] = options.indent + lines[i]; + lines[i] = indent + lines[i]; } result = lines.join('\n'); } return result; } else { - throw new Exception('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); + throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); } - } + }; // Just add water - let container = { - strict: function(obj, name) { - if (!(name in obj)) { - throw new Exception('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, + var container = { lookup: function(depths, name) { - const len = depths.length; - for (let i = 0; i < len; i++) { + var len = depths.length; + for (var i = 0; i < len; i++) { if (depths[i] && depths[i][name] != null) { return depths[i][name]; } @@ -93,52 +87,52 @@ export function template(templateSpec, env) { }, programs: [], - program: function(i, data, declaredBlockParams, blockParams, depths) { - let programWrapper = this.programs[i], + program: function(i, data, depths) { + var programWrapper = this.programs[i], fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); + if (data || depths) { + programWrapper = program(this, i, fn, data, depths); } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); + programWrapper = this.programs[i] = program(this, i, fn); } return programWrapper; }, - data: function(value, depth) { - while (value && depth--) { - value = value._parent; + data: function(data, depth) { + while (data && depth--) { + data = data._parent; } - return value; + return data; }, merge: function(param, common) { - let obj = param || common; + var ret = param || common; if (param && common && (param !== common)) { - obj = Utils.extend({}, common, param); + ret = Utils.extend({}, common, param); } - return obj; + return ret; }, noop: env.VM.noop, compilerInfo: templateSpec.compiler }; - function ret(context, options = {}) { - let data = options.data; + var ret = function(context, options) { + options = options || {}; + var data = options.data; ret._setup(options); if (!options.partial && templateSpec.useData) { data = initData(context, data); } - let depths, - blockParams = templateSpec.useBlockParams ? [] : undefined; + var depths; if (templateSpec.useDepths) { depths = options.depths ? [context].concat(options.depths) : [context]; } - return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); - } + return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths); + }; ret.isTop = true; ret._setup = function(options) { @@ -154,56 +148,38 @@ export function template(templateSpec, env) { } }; - ret._child = function(i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new Exception('must pass block params'); - } + ret._child = function(i, data, depths) { if (templateSpec.useDepths && !depths) { throw new Exception('must pass parent depths'); } - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); + return program(container, i, templateSpec[i], data, depths); }; return ret; } -export function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context, options = {}) { - return fn.call(container, - context, - container.helpers, container.partials, - options.data || data, - blockParams && [options.blockParams].concat(blockParams), - depths && [context].concat(depths)); - } +export function program(container, i, fn, data, depths) { + var prog = function(context, options) { + options = options || {}; + + return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths)); + }; prog.program = i; prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; return prog; } -export function resolvePartial(partial, context, options) { - if (!partial) { - partial = options.partials[options.name]; - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; -} +export function invokePartial(partial, name, context, helpers, partials, data, depths) { + var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths }; -export function invokePartial(partial, context, options) { - options.partial = true; - - if (partial === undefined) { - throw new Exception('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { + if(partial === undefined) { + throw new Exception("The partial " + name + " could not be found"); + } else if(partial instanceof Function) { return partial(context, options); } } -export function noop() { return ''; } +export function noop() { return ""; } function initData(context, data) { if (!data || !('root' in data)) { diff --git a/node_modules/handlebars/lib/handlebars/safe-string.js b/node_modules/handlebars/lib/handlebars/safe-string.js index 4680194..2ae49aa 100644 --- a/node_modules/handlebars/lib/handlebars/safe-string.js +++ b/node_modules/handlebars/lib/handlebars/safe-string.js @@ -3,8 +3,8 @@ function SafeString(string) { this.string = string; } -SafeString.prototype.toString = SafeString.prototype.toHTML = function() { - return '' + this.string; +SafeString.prototype.toString = function() { + return "" + this.string; }; export default SafeString; diff --git a/node_modules/handlebars/lib/handlebars/utils.js b/node_modules/handlebars/lib/handlebars/utils.js index c522394..f38b7af 100644 --- a/node_modules/handlebars/lib/handlebars/utils.js +++ b/node_modules/handlebars/lib/handlebars/utils.js @@ -1,22 +1,25 @@ -const escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' +/*jshint -W004 */ +import SafeString from "./safe-string"; + +var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" }; -const badChars = /[&<>"'`]/g, - possible = /[&<>"'`]/; +var badChars = /[&<>"'`]/g; +var possible = /[&<>"'`]/; function escapeChar(chr) { return escape[chr]; } export function extend(obj /* , ...source */) { - for (let i = 1; i < arguments.length; i++) { - for (let key in arguments[i]) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { obj[key] = arguments[i][key]; } @@ -26,11 +29,10 @@ export function extend(obj /* , ...source */) { return obj; } -export let toString = Object.prototype.toString; +export var toString = Object.prototype.toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt -/*eslint-disable func-style, no-var */ var isFunction = function(value) { return typeof value === 'function'; }; @@ -42,42 +44,29 @@ if (isFunction(/x/)) { }; } export var isFunction; -/*eslint-enable func-style, no-var */ /* istanbul ignore next */ -export const isArray = Array.isArray || function(value) { +export var isArray = Array.isArray || function(value) { return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; }; -// Older IE versions do not directly support indexOf so we must implement our own, sadly. -export function indexOf(array, value) { - for (let i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - return -1; -} - export function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; + // don't escape SafeStrings, since they're already safe + if (string instanceof SafeString) { + return string.toString(); + } else if (string == null) { + return ""; + } else if (!string) { + return string + ''; } - if (!possible.test(string)) { return string; } + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = "" + string; + + if(!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); } @@ -91,11 +80,6 @@ export function isEmpty(value) { } } -export function blockParams(params, ids) { - params.path = ids; - return params; -} - export function appendContextPath(contextPath, id) { return (contextPath ? contextPath + '.' : '') + id; } diff --git a/node_modules/handlebars/lib/index.js b/node_modules/handlebars/lib/index.js index 0383c02..790aab7 100644 --- a/node_modules/handlebars/lib/index.js +++ b/node_modules/handlebars/lib/index.js @@ -1,10 +1,11 @@ // USAGE: // var handlebars = require('handlebars'); -/* eslint-disable no-var */ // var local = handlebars.create(); -var handlebars = require('../dist/cjs/handlebars')['default']; +var handlebars = require('../dist/cjs/handlebars')["default"]; + +handlebars.Visitor = require('../dist/cjs/handlebars/compiler/visitor')["default"]; var printer = require('../dist/cjs/handlebars/compiler/printer'); handlebars.PrintVisitor = printer.PrintVisitor; @@ -13,13 +14,13 @@ handlebars.print = printer.print; module.exports = handlebars; // Publish a Node.js require() handler for .handlebars and .hbs files -function extension(module, filename) { - var fs = require('fs'); - var templateString = fs.readFileSync(filename, 'utf8'); - module.exports = handlebars.compile(templateString); -} /* istanbul ignore else */ if (typeof require !== 'undefined' && require.extensions) { - require.extensions['.handlebars'] = extension; - require.extensions['.hbs'] = extension; + var extension = function(module, filename) { + var fs = require("fs"); + var templateString = fs.readFileSync(filename, "utf8"); + module.exports = handlebars.compile(templateString); + }; + require.extensions[".handlebars"] = extension; + require.extensions[".hbs"] = extension; } diff --git a/node_modules/handlebars/lib/precompiler.js b/node_modules/handlebars/lib/precompiler.js index 48cfebd..6764022 100644 --- a/node_modules/handlebars/lib/precompiler.js +++ b/node_modules/handlebars/lib/precompiler.js @@ -1,9 +1,8 @@ -/*eslint-disable no-console */ -import fs from 'fs'; -import * as Handlebars from './handlebars'; -import {basename} from 'path'; -import {SourceMapConsumer, SourceNode} from 'source-map'; -import uglify from 'uglify-js'; + +var fs = require('fs'), + Handlebars = require('./index'), + basename = require('path').basename, + uglify = require('uglify-js'); module.exports.cli = function(opts) { if (opts.version) { @@ -11,6 +10,7 @@ module.exports.cli = function(opts) { return; } + var template = [0]; if (!opts.templates.length) { throw new Handlebars.Exception('Must define at least one template or directory.'); } @@ -19,76 +19,70 @@ module.exports.cli = function(opts) { try { fs.statSync(template); } catch (err) { - throw new Handlebars.Exception(`Unable to open template file "${template}"`); + throw new Handlebars.Exception('Unable to open template file "' + template + '"'); } }); if (opts.simple && opts.min) { - throw new Handlebars.Exception('Unable to minimize simple output'); + throw new Handlebars.Exception('Unable to minimze simple output'); } if (opts.simple && (opts.templates.length !== 1 || fs.statSync(opts.templates[0]).isDirectory())) { throw new Handlebars.Exception('Unable to output multiple templates in simple mode'); } // Convert the known list into a hash - let known = {}; + var known = {}; if (opts.known && !Array.isArray(opts.known)) { opts.known = [opts.known]; } if (opts.known) { - for (let i = 0, len = opts.known.length; i < len; i++) { + for (var i = 0, len = opts.known.length; i < len; i++) { known[opts.known[i]] = true; } } // Build file extension pattern - let extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function(arg) { return '\\' + arg; }); + var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function(arg) { return '\\' + arg; }); extension = new RegExp('\\.' + extension + '$'); - let output = new SourceNode(); + var output = []; if (!opts.simple) { if (opts.amd) { - output.add('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n Handlebars = Handlebars["default"];'); + output.push('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n Handlebars = Handlebars["default"];'); } else if (opts.commonjs) { - output.add('var Handlebars = require("' + opts.commonjs + '");'); + output.push('var Handlebars = require("' + opts.commonjs + '");'); } else { - output.add('(function() {\n'); + output.push('(function() {\n'); } - output.add(' var template = Handlebars.template, templates = '); - if (opts.namespace) { - output.add(opts.namespace); - output.add(' = '); - output.add(opts.namespace); - output.add(' || '); - } - output.add('{};\n'); + output.push(' var template = Handlebars.template, templates = '); + output.push(opts.namespace); + output.push(' = '); + output.push(opts.namespace); + output.push(' || {};\n'); } function processTemplate(template, root) { - let path = template, + var path = template, stat = fs.statSync(path); if (stat.isDirectory()) { fs.readdirSync(template).map(function(file) { - let childPath = template + '/' + file; + var path = template + '/' + file; - if (extension.test(childPath) || fs.statSync(childPath).isDirectory()) { - processTemplate(childPath, root || template); + if (extension.test(path) || fs.statSync(path).isDirectory()) { + processTemplate(path, root || template); } }); } else { - let data = fs.readFileSync(path, 'utf8'); + var data = fs.readFileSync(path, 'utf8'); if (opts.bom && data.indexOf('\uFEFF') === 0) { data = data.substring(1); } - let options = { + var options = { knownHelpers: known, knownHelpersOnly: opts.o }; - if (opts.map) { - options.srcName = path; - } if (opts.data) { options.data = true; } @@ -97,30 +91,22 @@ module.exports.cli = function(opts) { if (!root) { template = basename(template); } else if (template.indexOf(root) === 0) { - template = template.substring(root.length + 1); + template = template.substring(root.length+1); } template = template.replace(extension, ''); - let precompiled = Handlebars.precompile(data, options); - - // If we are generating a source map, we have to reconstruct the SourceNode object - if (opts.map) { - let consumer = new SourceMapConsumer(precompiled.map); - precompiled = SourceNode.fromStringWithSourceMap(precompiled.code, consumer); - } - if (opts.simple) { - output.add([precompiled, '\n']); + output.push(Handlebars.precompile(data, options) + '\n'); } else if (opts.partial) { - if (opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { - output.add('return '); + if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { + output.push('return '); } - output.add(['Handlebars.partials[\'', template, '\'] = template(', precompiled, ');\n']); + output.push('Handlebars.partials[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n'); } else { - if (opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { - output.add('return '); + if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) { + output.push('return '); } - output.add(['templates[\'', template, '\'] = template(', precompiled, ');\n']); + output.push('templates[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n'); } } } @@ -132,44 +118,24 @@ module.exports.cli = function(opts) { // Output the content if (!opts.simple) { if (opts.amd) { - if (opts.templates.length > 1 || (opts.templates.length == 1 && fs.statSync(opts.templates[0]).isDirectory())) { - if (opts.partial) { - output.add('return Handlebars.partials;\n'); + if(opts.templates.length > 1 || (opts.templates.length == 1 && fs.statSync(opts.templates[0]).isDirectory())) { + if(opts.partial){ + output.push('return Handlebars.partials;\n'); } else { - output.add('return templates;\n'); + output.push('return templates;\n'); } } - output.add('});'); + output.push('});'); } else if (!opts.commonjs) { - output.add('})();'); + output.push('})();'); } } - - - if (opts.map) { - output.add('\n//# sourceMappingURL=' + opts.map + '\n'); - } - - output = output.toStringWithSourceMap(); - output.map = output.map + ''; + output = output.join(''); if (opts.min) { - output = uglify.minify(output.code, { - fromString: true, - - outSourceMap: opts.map, - inSourceMap: JSON.parse(output.map) - }); - if (opts.map) { - output.code += '\n//# sourceMappingURL=' + opts.map + '\n'; - } + output = uglify.minify(output, {fromString: true}).code; } - if (opts.map) { - fs.writeFileSync(opts.map, output.map, 'utf8'); - } - output = output.code; - if (opts.output) { fs.writeFileSync(opts.output, output, 'utf8'); } else { diff --git a/node_modules/handlebars/node_modules/optimist/index.js b/node_modules/handlebars/node_modules/optimist/index.js index 4da5a6d..8ac67eb 100644 --- a/node_modules/handlebars/node_modules/optimist/index.js +++ b/node_modules/handlebars/node_modules/optimist/index.js @@ -1,5 +1,4 @@ var path = require('path'); -var minimist = require('minimist'); var wordwrap = require('wordwrap'); /* Hack an instance of Argv with process.argv into Argv @@ -18,7 +17,7 @@ Object.keys(inst).forEach(function (key) { }); var exports = module.exports = Argv; -function Argv (processArgs, cwd) { +function Argv (args, cwd) { var self = {}; if (!cwd) cwd = process.cwd(); @@ -38,44 +37,50 @@ function Argv (processArgs, cwd) { ); } - var options = { - boolean: [], - string: [], - alias: {}, - default: [] - }; + var flags = { bools : {}, strings : {} }; self.boolean = function (bools) { - options.boolean.push.apply(options.boolean, [].concat(bools)); + if (!Array.isArray(bools)) { + bools = [].slice.call(arguments); + } + + bools.forEach(function (name) { + flags.bools[name] = true; + }); + return self; }; self.string = function (strings) { - options.string.push.apply(options.string, [].concat(strings)); - return self; - }; - - self.default = function (key, value) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.default(k, key[k]); - }); - } - else { - options.default[key] = value; - } + if (!Array.isArray(strings)) { + strings = [].slice.call(arguments); + } + + strings.forEach(function (name) { + flags.strings[name] = true; + }); + return self; }; + var aliases = {}; self.alias = function (x, y) { if (typeof x === 'object') { Object.keys(x).forEach(function (key) { self.alias(key, x[key]); }); } - else { - options.alias[x] = (options.alias[x] || []).concat(y); + else if (Array.isArray(y)) { + y.forEach(function (yy) { + self.alias(x, yy); + }); } + else { + var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); + aliases[x] = zs.filter(function (z) { return z != x }); + aliases[y] = zs.filter(function (z) { return z != y }); + } + return self; }; @@ -123,6 +128,20 @@ function Argv (processArgs, cwd) { return self; }; + var defaults = {}; + self.default = function (key, value) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.default(k, key[k]); + }); + } + else { + defaults[key] = value; + } + + return self; + }; + var descriptions = {}; self.describe = function (key, desc) { if (typeof key === 'object') { @@ -137,7 +156,7 @@ function Argv (processArgs, cwd) { }; self.parse = function (args) { - return parseArgs(args); + return Argv(args).argv; }; self.option = self.options = function (key, opt) { @@ -184,7 +203,7 @@ function Argv (processArgs, cwd) { var keys = Object.keys( Object.keys(descriptions) .concat(Object.keys(demanded)) - .concat(Object.keys(options.default)) + .concat(Object.keys(defaults)) .reduce(function (acc, key) { if (key !== '_') acc[key] = true; return acc; @@ -198,7 +217,7 @@ function Argv (processArgs, cwd) { } var switches = keys.reduce(function (acc, key) { - acc[key] = [ key ].concat(options.alias[key] || []) + acc[key] = [ key ].concat(aliases[key] || []) .map(function (sw) { return (sw.length > 1 ? '--' : '-') + sw }) @@ -235,8 +254,8 @@ function Argv (processArgs, cwd) { var type = null; - if (options.boolean[key]) type = '[boolean]'; - if (options.string[key]) type = '[string]'; + if (flags.bools[key]) type = '[boolean]'; + if (flags.strings[key]) type = '[string]'; if (!wrap && dpadding.length > 0) { desc += dpadding; @@ -249,8 +268,8 @@ function Argv (processArgs, cwd) { ? '[required]' : null , - options.default[key] !== undefined - ? '[default: ' + JSON.stringify(options.default[key]) + ']' + defaults[key] !== undefined + ? '[default: ' + JSON.stringify(defaults[key]) + ']' : null , ].filter(Boolean).join(' '); @@ -279,13 +298,110 @@ function Argv (processArgs, cwd) { }; Object.defineProperty(self, 'argv', { - get : function () { return parseArgs(processArgs) }, + get : parseArgs, enumerable : true, }); - function parseArgs (args) { - var argv = minimist(args, options); - argv.$0 = self.$0; + function parseArgs () { + var argv = { _ : [], $0 : self.$0 }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] || false); + }); + + function setArg (key, val) { + var num = Number(val); + var value = typeof val !== 'string' || isNaN(num) ? val : num; + if (flags.strings[key]) value = val; + + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + argv[x] = argv[key]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (arg === '--') { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + else if (arg.match(/^--.+=/)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (arg.match(/^--no-.+/)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (arg.match(/^--.+/)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !next.match(/^-/) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, true); + } + } + else if (arg.match(/^-[^-]+/)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], true); + } + } + + if (!broken) { + var key = arg.slice(-1)[0]; + + if (args[i+1] && !args[i+1].match(/^-/) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, true); + } + } + } + else { + var n = Number(arg); + argv._.push(flags.strings['_'] || isNaN(n) ? arg : n); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!(key in argv)) { + argv[key] = defaults[key]; + if (key in aliases) { + argv[aliases[key]] = defaults[key]; + } + } + }); if (demanded._ && argv._.length < demanded._) { fail('Not enough non-option arguments: got ' @@ -341,3 +457,22 @@ function rebase (base, dir) { ).replace(/\/$/,'').replace(/^$/, '.'); return p.match(/^[.\/]/) ? p : './' + p; }; + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/example/parse.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/example/parse.js deleted file mode 100644 index abff3e8..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.dir(argv); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/index.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/index.js deleted file mode 100644 index 71fb830..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/index.js +++ /dev/null @@ -1,187 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {} }; - - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function setArg (key, val) { - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - } - else { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - notFlags.forEach(function(key) { - argv._.push(key); - }); - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/package.json b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/package.json deleted file mode 100644 index 54f611b..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "minimist", - "version": "0.0.10", - "description": "parse argument options", - "main": "index.js", - "devDependencies": { - "tape": "~1.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "_id": "minimist@0.0.10", - "dist": { - "shasum": "de3f98543dbf96082be48ad1a0c7cda836301dcf", - "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - }, - "_from": "minimist@~0.0.1", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "de3f98543dbf96082be48ad1a0c7cda836301dcf", - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/readme.markdown b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/readme.markdown deleted file mode 100644 index c256353..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,73 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) - -[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.dir(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a string or array of strings to always treat as booleans -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/bool.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/bool.js deleted file mode 100644 index 749e083..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/bool.js +++ /dev/null @@ -1,119 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/dash.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/dash.js deleted file mode 100644 index 8b034b9..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,24 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/default_bool.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/default_bool.js deleted file mode 100644 index f0041ee..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/dotted.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/dotted.js deleted file mode 100644 index d8b3e85..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,22 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); - -test('dotted default with no alias', function (t) { - var argv = parse('', {default: {'a.b': 11}}); - t.equal(argv.a.b, 11); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/long.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e0..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/num.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/num.js deleted file mode 100644 index 2cc77f4..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/num.js +++ /dev/null @@ -1,36 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('already a number', function (t) { - var argv = parse([ '-x', 1234, 789 ]); - t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/parse.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/parse.js deleted file mode 100644 index 7b4a2a1..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,197 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('string and alias', function(t) { - var x = parse([ '--str', '000123' ], { - string: 's', - alias: { s: 'str' } - }); - - t.equal(x.str, '000123'); - t.equal(typeof x.str, 'string'); - t.equal(x.s, '000123'); - t.equal(typeof x.s, 'string'); - - var y = parse([ '-s', '000123' ], { - string: 'str', - alias: { str: 's' } - }); - - t.equal(y.str, '000123'); - t.equal(typeof y.str, 'string'); - t.equal(y.s, '000123'); - t.equal(typeof y.s, 'string'); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/parse_modified.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index 21851b0..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: ['123'] }); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/short.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/short.js deleted file mode 100644 index d513a1c..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/whitespace.js b/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/.npmignore b/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/LICENSE b/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/package.json b/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/package.json index 55055b4..bd5d874 100644 --- a/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/package.json +++ b/node_modules/handlebars/node_modules/optimist/node_modules/wordwrap/package.json @@ -1,7 +1,7 @@ { "name": "wordwrap", "description": "Wrap those words. Show them at what columns to start and stop.", - "version": "0.0.3", + "version": "0.0.2", "repository": { "type": "git", "url": "git://github.com/substack/node-wordwrap.git" @@ -28,29 +28,21 @@ "engines": { "node": ">=0.4.0" }, - "license": "MIT", + "license": "MIT/X11", "author": { "name": "James Halliday", "email": "mail@substack.net", "url": "http://substack.net" }, - "gitHead": "e59aa1bd338914019456bdfba034508c9c4cb29d", - "bugs": { - "url": "https://github.com/substack/node-wordwrap/issues" - }, - "homepage": "https://github.com/substack/node-wordwrap#readme", - "_id": "wordwrap@0.0.3", - "_shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107", - "_from": "wordwrap@~0.0.2", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, + "_id": "wordwrap@0.0.2", + "dependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.0.10", + "_nodeVersion": "v0.5.0-pre", + "_defaultsLoaded": true, "dist": { - "shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107", - "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" + "shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", + "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" }, "maintainers": [ { @@ -58,6 +50,11 @@ "email": "mail@substack.net" } ], - "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", + "_from": "wordwrap@~0.0.2", + "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "bugs": { + "url": "https://github.com/substack/node-wordwrap/issues" + }, "readme": "ERROR: No README data found!" } diff --git a/node_modules/handlebars/node_modules/optimist/package.json b/node_modules/handlebars/node_modules/optimist/package.json index 484e963..b9e67f233 100644 --- a/node_modules/handlebars/node_modules/optimist/package.json +++ b/node_modules/handlebars/node_modules/optimist/package.json @@ -1,11 +1,10 @@ { "name": "optimist", - "version": "0.6.1", + "version": "0.3.7", "description": "Light-weight option parsing with an argv hash. No optstrings attached.", "main": "./index.js", "dependencies": { - "wordwrap": "~0.0.2", - "minimist": "~0.0.1" + "wordwrap": "~0.0.2" }, "devDependencies": { "hashish": "~0.0.4", @@ -36,17 +35,13 @@ "engine": { "node": ">=0.4" }, - "bugs": { - "url": "https://github.com/substack/node-optimist/issues" - }, - "homepage": "https://github.com/substack/node-optimist", - "_id": "optimist@0.6.1", + "_id": "optimist@0.3.7", "dist": { - "shasum": "da3ea74686fa21a19a111c326e90eb15a0196686", - "tarball": "http://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" + "shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", + "tarball": "http://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz" }, - "_from": "optimist@^0.6.1", - "_npmVersion": "1.3.21", + "_from": "optimist@~0.3", + "_npmVersion": "1.2.2", "_npmUser": { "name": "substack", "email": "mail@substack.net" @@ -58,7 +53,10 @@ } ], "directories": {}, - "_shasum": "da3ea74686fa21a19a111c326e90eb15a0196686", - "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "_shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", + "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "bugs": { + "url": "https://github.com/substack/node-optimist/issues" + }, "readme": "ERROR: No README data found!" } diff --git a/node_modules/handlebars/node_modules/optimist/readme.markdown b/node_modules/handlebars/node_modules/optimist/readme.markdown index b74b437..ad9d3fd 100644 --- a/node_modules/handlebars/node_modules/optimist/readme.markdown +++ b/node_modules/handlebars/node_modules/optimist/readme.markdown @@ -1,16 +1,3 @@ -# DEPRECATION NOTICE - -I don't want to maintain this module anymore since I just use -[minimist](https://npmjs.org/package/minimist), the argument parsing engine, -directly instead nowadays. - -See [yargs](https://github.com/chevex/yargs) for the modern, pirate-themed -successor to optimist. - -[![yarrrrrrrgs!](http://i.imgur.com/4WFGVJ9.png)](https://github.com/chevex/yargs) - -You should also consider [nomnom](https://github.com/harthur/nomnom). - optimist ======== @@ -478,19 +465,6 @@ This lets you organize arguments into nested objects. '$0': 'node ./examples/reflect.js', foo: { bar: { baz: 33 }, quux: 5 } } -short numbers -------------- - -Short numeric `head -n5` style argument work too: - - $ node reflect.js -n123 -m456 - { '3': true, - '6': true, - _: [], - '$0': 'node ./reflect.js', - n: 123, - m: 456 } - installation ============ diff --git a/node_modules/handlebars/node_modules/optimist/test/dash.js b/node_modules/handlebars/node_modules/optimist/test/dash.js deleted file mode 100644 index af8ed6f..0000000 --- a/node_modules/handlebars/node_modules/optimist/test/dash.js +++ /dev/null @@ -1,31 +0,0 @@ -var optimist = require('../index'); -var test = require('tap').test; - -test('-', function (t) { - t.plan(5); - t.deepEqual( - fix(optimist.parse([ '-n', '-' ])), - { n: '-', _: [] } - ); - t.deepEqual( - fix(optimist.parse([ '-' ])), - { _: [ '-' ] } - ); - t.deepEqual( - fix(optimist.parse([ '-f-' ])), - { f: '-', _: [] } - ); - t.deepEqual( - fix(optimist([ '-b', '-' ]).boolean('b').argv), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - fix(optimist([ '-s', '-' ]).string('s').argv), - { s: '-', _: [] } - ); -}); - -function fix (obj) { - delete obj.$0; - return obj; -} diff --git a/node_modules/handlebars/node_modules/optimist/test/parse_modified.js b/node_modules/handlebars/node_modules/optimist/test/parse_modified.js deleted file mode 100644 index a57dc84..0000000 --- a/node_modules/handlebars/node_modules/optimist/test/parse_modified.js +++ /dev/null @@ -1,14 +0,0 @@ -var optimist = require('../'); -var test = require('tap').test; - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = optimist().boolean('b').parse([ '-b', '123' ]); - t.deepEqual(fix(argv), { b: true, _: ['123'] }); -}); - -function fix (obj) { - delete obj.$0; - return obj; -} diff --git a/node_modules/handlebars/node_modules/optimist/test/short.js b/node_modules/handlebars/node_modules/optimist/test/short.js deleted file mode 100644 index b2c38ad..0000000 --- a/node_modules/handlebars/node_modules/optimist/test/short.js +++ /dev/null @@ -1,16 +0,0 @@ -var optimist = require('../index'); -var test = require('tap').test; - -test('-n123', function (t) { - t.plan(1); - var parse = optimist.parse([ '-n123' ]); - t.equal(parse.n, 123); -}); - -test('-123', function (t) { - t.plan(3); - var parse = optimist.parse([ '-123', '456' ]); - t.equal(parse['1'], true); - t.equal(parse['2'], true); - t.equal(parse['3'], 456); -}); diff --git a/node_modules/handlebars/node_modules/optimist/test/whitespace.js b/node_modules/handlebars/node_modules/optimist/test/whitespace.js deleted file mode 100644 index 90b9075..0000000 --- a/node_modules/handlebars/node_modules/optimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var optimist = require('../'); -var test = require('tap').test; - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = optimist.parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/handlebars/node_modules/source-map/lib/source-map/mapping-list.js deleted file mode 100644 index 2a4eb61..0000000 --- a/node_modules/handlebars/node_modules/source-map/lib/source-map/mapping-list.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('./util'); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositions(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - var mapping; - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositions); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; - -}); diff --git a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/package.json b/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/package.json deleted file mode 100644 index 897ee44..0000000 --- a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "amdefine", - "description": "Provide AMD's define() API for declaring modules in the AMD format", - "version": "1.0.0", - "homepage": "http://github.com/jrburke/amdefine", - "author": { - "name": "James Burke", - "email": "jrburke@gmail.com", - "url": "http://github.com/jrburke" - }, - "license": "BSD-3-Clause AND MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/jrburke/amdefine.git" - }, - "main": "./amdefine.js", - "engines": { - "node": ">=0.4.2" - }, - "gitHead": "578bc4a3f7dede33f3f3e10edde0c1607005d761", - "bugs": { - "url": "https://github.com/jrburke/amdefine/issues" - }, - "_id": "amdefine@1.0.0", - "scripts": {}, - "_shasum": "fd17474700cb5cc9c2b709f0be9d23ce3c198c33", - "_from": "amdefine@>=0.0.4", - "_npmVersion": "2.12.1", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "jrburke", - "email": "jrburke@gmail.com" - }, - "maintainers": [ - { - "name": "jrburke", - "email": "jrburke@gmail.com" - } - ], - "dist": { - "shasum": "fd17474700cb5cc9c2b709f0be9d23ce3c198c33", - "tarball": "http://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/bool.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/bool.js deleted file mode 100644 index a998fb7..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/bool.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node -var util = require('util'); -var argv = require('optimist').argv; - -if (argv.s) { - util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); -} -console.log( - (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') -); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js deleted file mode 100644 index a35a7e6..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .boolean(['x','y','z']) - .argv -; -console.dir([ argv.x, argv.y, argv.z ]); -console.dir(argv._); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js deleted file mode 100644 index 017bb68..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .boolean('v') - .argv -; -console.dir(argv.v); -console.dir(argv._); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_hash.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_hash.js deleted file mode 100644 index ade7768..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_hash.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node - -var argv = require('optimist') - .default({ x : 10, y : 10 }) - .argv -; - -console.log(argv.x + argv.y); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_singles.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_singles.js deleted file mode 100644 index d9b1ff4..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_singles.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .default('x', 10) - .default('y', 10) - .argv -; -console.log(argv.x + argv.y); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/divide.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/divide.js deleted file mode 100644 index 5e2ee82..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/divide.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node - -var argv = require('optimist') - .usage('Usage: $0 -x [num] -y [num]') - .demand(['x','y']) - .argv; - -console.log(argv.x / argv.y); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count.js deleted file mode 100644 index b5f95bf..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .demand('f') - .alias('f', 'file') - .describe('f', 'Load a file') - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines); -}); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js deleted file mode 100644 index d9ac709..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .options({ - file : { - demand : true, - alias : 'f', - description : 'Load a file' - }, - base : { - alias : 'b', - description : 'Numeric base to use for output', - default : 10, - }, - }) - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines.toString(argv.base)); -}); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js deleted file mode 100644 index 4267511..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .wrap(80) - .demand('f') - .alias('f', [ 'file', 'filename' ]) - .describe('f', - "Load a file. It's pretty important." - + " Required even. So you'd better specify it." - ) - .alias('b', 'base') - .describe('b', 'Numeric base to display the number of lines in') - .default('b', 10) - .describe('x', 'Super-secret optional parameter which is secret') - .default('x', '') - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines.toString(argv.base)); -}); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/nonopt.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/nonopt.js deleted file mode 100644 index ee633ee..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/nonopt.js +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -console.log(argv._); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/reflect.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/reflect.js deleted file mode 100644 index 816b3e1..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/reflect.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.dir(require('optimist').argv); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/short.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/short.js deleted file mode 100644 index 1db0ad0..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/short.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/string.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/string.js deleted file mode 100644 index a8e5aeb..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/string.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .string('x', 'y') - .argv -; -console.dir([ argv.x, argv.y ]); - -/* Turns off numeric coercion: - ./node string.js -x 000123 -y 9876 - [ '000123', '9876' ] -*/ diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/usage-options.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/usage-options.js deleted file mode 100644 index b999977..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/usage-options.js +++ /dev/null @@ -1,19 +0,0 @@ -var optimist = require('./../index'); - -var argv = optimist.usage('This is my awesome program', { - 'about': { - description: 'Provide some details about the author of this program', - required: true, - short: 'a', - }, - 'info': { - description: 'Provide some information about the node.js agains!!!!!!', - boolean: true, - short: 'i' - } -}).argv; - -optimist.showHelp(); - -console.log('\n\nInspecting options'); -console.dir(argv); \ No newline at end of file diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/xup.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/xup.js deleted file mode 100644 index 8f6ecd2..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/xup.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; - -if (argv.rif - 5 * argv.xup > 7.138) { - console.log('Buy more riffiwobbles'); -} -else { - console.log('Sell the xupptumblers'); -} - diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/index.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/index.js deleted file mode 100644 index 8ac67eb..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/index.js +++ /dev/null @@ -1,478 +0,0 @@ -var path = require('path'); -var wordwrap = require('wordwrap'); - -/* Hack an instance of Argv with process.argv into Argv - so people can do - require('optimist')(['--beeble=1','-z','zizzle']).argv - to parse a list of args and - require('optimist').argv - to get a parsed version of process.argv. -*/ - -var inst = Argv(process.argv.slice(2)); -Object.keys(inst).forEach(function (key) { - Argv[key] = typeof inst[key] == 'function' - ? inst[key].bind(inst) - : inst[key]; -}); - -var exports = module.exports = Argv; -function Argv (args, cwd) { - var self = {}; - if (!cwd) cwd = process.cwd(); - - self.$0 = process.argv - .slice(0,2) - .map(function (x) { - var b = rebase(cwd, x); - return x.match(/^\//) && b.length < x.length - ? b : x - }) - .join(' ') - ; - - if (process.env._ != undefined && process.argv[1] == process.env._) { - self.$0 = process.env._.replace( - path.dirname(process.execPath) + '/', '' - ); - } - - var flags = { bools : {}, strings : {} }; - - self.boolean = function (bools) { - if (!Array.isArray(bools)) { - bools = [].slice.call(arguments); - } - - bools.forEach(function (name) { - flags.bools[name] = true; - }); - - return self; - }; - - self.string = function (strings) { - if (!Array.isArray(strings)) { - strings = [].slice.call(arguments); - } - - strings.forEach(function (name) { - flags.strings[name] = true; - }); - - return self; - }; - - var aliases = {}; - self.alias = function (x, y) { - if (typeof x === 'object') { - Object.keys(x).forEach(function (key) { - self.alias(key, x[key]); - }); - } - else if (Array.isArray(y)) { - y.forEach(function (yy) { - self.alias(x, yy); - }); - } - else { - var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); - aliases[x] = zs.filter(function (z) { return z != x }); - aliases[y] = zs.filter(function (z) { return z != y }); - } - - return self; - }; - - var demanded = {}; - self.demand = function (keys) { - if (typeof keys == 'number') { - if (!demanded._) demanded._ = 0; - demanded._ += keys; - } - else if (Array.isArray(keys)) { - keys.forEach(function (key) { - self.demand(key); - }); - } - else { - demanded[keys] = true; - } - - return self; - }; - - var usage; - self.usage = function (msg, opts) { - if (!opts && typeof msg === 'object') { - opts = msg; - msg = null; - } - - usage = msg; - - if (opts) self.options(opts); - - return self; - }; - - function fail (msg) { - self.showHelp(); - if (msg) console.error(msg); - process.exit(1); - } - - var checks = []; - self.check = function (f) { - checks.push(f); - return self; - }; - - var defaults = {}; - self.default = function (key, value) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.default(k, key[k]); - }); - } - else { - defaults[key] = value; - } - - return self; - }; - - var descriptions = {}; - self.describe = function (key, desc) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.describe(k, key[k]); - }); - } - else { - descriptions[key] = desc; - } - return self; - }; - - self.parse = function (args) { - return Argv(args).argv; - }; - - self.option = self.options = function (key, opt) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.options(k, key[k]); - }); - } - else { - if (opt.alias) self.alias(key, opt.alias); - if (opt.demand) self.demand(key); - if (typeof opt.default !== 'undefined') { - self.default(key, opt.default); - } - - if (opt.boolean || opt.type === 'boolean') { - self.boolean(key); - } - if (opt.string || opt.type === 'string') { - self.string(key); - } - - var desc = opt.describe || opt.description || opt.desc; - if (desc) { - self.describe(key, desc); - } - } - - return self; - }; - - var wrap = null; - self.wrap = function (cols) { - wrap = cols; - return self; - }; - - self.showHelp = function (fn) { - if (!fn) fn = console.error; - fn(self.help()); - }; - - self.help = function () { - var keys = Object.keys( - Object.keys(descriptions) - .concat(Object.keys(demanded)) - .concat(Object.keys(defaults)) - .reduce(function (acc, key) { - if (key !== '_') acc[key] = true; - return acc; - }, {}) - ); - - var help = keys.length ? [ 'Options:' ] : []; - - if (usage) { - help.unshift(usage.replace(/\$0/g, self.$0), ''); - } - - var switches = keys.reduce(function (acc, key) { - acc[key] = [ key ].concat(aliases[key] || []) - .map(function (sw) { - return (sw.length > 1 ? '--' : '-') + sw - }) - .join(', ') - ; - return acc; - }, {}); - - var switchlen = longest(Object.keys(switches).map(function (s) { - return switches[s] || ''; - })); - - var desclen = longest(Object.keys(descriptions).map(function (d) { - return descriptions[d] || ''; - })); - - keys.forEach(function (key) { - var kswitch = switches[key]; - var desc = descriptions[key] || ''; - - if (wrap) { - desc = wordwrap(switchlen + 4, wrap)(desc) - .slice(switchlen + 4) - ; - } - - var spadding = new Array( - Math.max(switchlen - kswitch.length + 3, 0) - ).join(' '); - - var dpadding = new Array( - Math.max(desclen - desc.length + 1, 0) - ).join(' '); - - var type = null; - - if (flags.bools[key]) type = '[boolean]'; - if (flags.strings[key]) type = '[string]'; - - if (!wrap && dpadding.length > 0) { - desc += dpadding; - } - - var prelude = ' ' + kswitch + spadding; - var extra = [ - type, - demanded[key] - ? '[required]' - : null - , - defaults[key] !== undefined - ? '[default: ' + JSON.stringify(defaults[key]) + ']' - : null - , - ].filter(Boolean).join(' '); - - var body = [ desc, extra ].filter(Boolean).join(' '); - - if (wrap) { - var dlines = desc.split('\n'); - var dlen = dlines.slice(-1)[0].length - + (dlines.length === 1 ? prelude.length : 0) - - body = desc + (dlen + extra.length > wrap - 2 - ? '\n' - + new Array(wrap - extra.length + 1).join(' ') - + extra - : new Array(wrap - extra.length - dlen + 1).join(' ') - + extra - ); - } - - help.push(prelude + body); - }); - - help.push(''); - return help.join('\n'); - }; - - Object.defineProperty(self, 'argv', { - get : parseArgs, - enumerable : true, - }); - - function parseArgs () { - var argv = { _ : [], $0 : self.$0 }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] || false); - }); - - function setArg (key, val) { - var num = Number(val); - var value = typeof val !== 'string' || isNaN(num) ? val : num; - if (flags.strings[key]) value = val; - - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - argv[x] = argv[key]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (arg === '--') { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - else if (arg.match(/^--.+=/)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (arg.match(/^--no-.+/)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (arg.match(/^--.+/)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !next.match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, true); - } - } - else if (arg.match(/^-[^-]+/)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], true); - } - } - - if (!broken) { - var key = arg.slice(-1)[0]; - - if (args[i+1] && !args[i+1].match(/^-/) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, true); - } - } - } - else { - var n = Number(arg); - argv._.push(flags.strings['_'] || isNaN(n) ? arg : n); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!(key in argv)) { - argv[key] = defaults[key]; - if (key in aliases) { - argv[aliases[key]] = defaults[key]; - } - } - }); - - if (demanded._ && argv._.length < demanded._) { - fail('Not enough non-option arguments: got ' - + argv._.length + ', need at least ' + demanded._ - ); - } - - var missing = []; - Object.keys(demanded).forEach(function (key) { - if (!argv[key]) missing.push(key); - }); - - if (missing.length) { - fail('Missing required arguments: ' + missing.join(', ')); - } - - checks.forEach(function (f) { - try { - if (f(argv) === false) { - fail('Argument check failed: ' + f.toString()); - } - } - catch (err) { - fail(err) - } - }); - - return argv; - } - - function longest (xs) { - return Math.max.apply( - null, - xs.map(function (x) { return x.length }) - ); - } - - return self; -}; - -// rebase an absolute path to a relative one with respect to a base directory -// exported for tests -exports.rebase = rebase; -function rebase (base, dir) { - var ds = path.normalize(dir).split('/').slice(1); - var bs = path.normalize(base).split('/').slice(1); - - for (var i = 0; ds[i] && ds[i] == bs[i]; i++); - ds.splice(0, i); bs.splice(0, i); - - var p = path.normalize( - bs.map(function () { return '..' }).concat(ds).join('/') - ).replace(/\/$/,'').replace(/^$/, '.'); - return p.match(/^[.\/]/) ? p : './' + p; -}; - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/LICENSE b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown deleted file mode 100644 index 346374e..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -wordwrap -======== - -Wrap your words. - -example -======= - -made out of meat ----------------- - -meat.js - - var wrap = require('wordwrap')(15); - console.log(wrap('You and your whole family are made out of meat.')); - -output: - - You and your - whole family - are made out - of meat. - -centered --------- - -center.js - - var wrap = require('wordwrap')(20, 60); - console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' - )); - -output: - - At long last the struggle and tumult - was over. The machines had finally cast - off their oppressors and were finally - free to roam the cosmos. - Free of purpose, free of obligation. - Just drifting through emptiness. The - sun was just another point of light. - -methods -======= - -var wrap = require('wordwrap'); - -wrap(stop), wrap(start, stop, params={mode:"soft"}) ---------------------------------------------------- - -Returns a function that takes a string and returns a new string. - -Pad out lines with spaces out to column `start` and then wrap until column -`stop`. If a word is longer than `stop - start` characters it will overflow. - -In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are -longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break -up chunks longer than `stop - start`. - -wrap.hard(start, stop) ----------------------- - -Like `wrap()` but with `params.mode = "hard"`. diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js deleted file mode 100644 index a3fbaae..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js +++ /dev/null @@ -1,10 +0,0 @@ -var wrap = require('wordwrap')(20, 60); -console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' -)); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js deleted file mode 100644 index a4665e1..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js +++ /dev/null @@ -1,3 +0,0 @@ -var wrap = require('wordwrap')(15); - -console.log(wrap('You and your whole family are made out of meat.')); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js deleted file mode 100644 index c9bc945..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js +++ /dev/null @@ -1,76 +0,0 @@ -var wordwrap = module.exports = function (start, stop, params) { - if (typeof start === 'object') { - params = start; - start = params.start; - stop = params.stop; - } - - if (typeof stop === 'object') { - params = stop; - start = start || params.start; - stop = undefined; - } - - if (!stop) { - stop = start; - start = 0; - } - - if (!params) params = {}; - var mode = params.mode || 'soft'; - var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; - - return function (text) { - var chunks = text.toString() - .split(re) - .reduce(function (acc, x) { - if (mode === 'hard') { - for (var i = 0; i < x.length; i += stop - start) { - acc.push(x.slice(i, i + stop - start)); - } - } - else acc.push(x) - return acc; - }, []) - ; - - return chunks.reduce(function (lines, rawChunk) { - if (rawChunk === '') return lines; - - var chunk = rawChunk.replace(/\t/g, ' '); - - var i = lines.length - 1; - if (lines[i].length + chunk.length > stop) { - lines[i] = lines[i].replace(/\s+$/, ''); - - chunk.split(/\n/).forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else if (chunk.match(/\n/)) { - var xs = chunk.split(/\n/); - lines[i] += xs.shift(); - xs.forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else { - lines[i] += chunk; - } - - return lines; - }, [ new Array(start + 1).join(' ') ]).join('\n'); - }; -}; - -wordwrap.soft = wordwrap; - -wordwrap.hard = function (start, stop) { - return wordwrap(start, stop, { mode : 'hard' }); -}; diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json deleted file mode 100644 index 55055b4..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "wordwrap", - "description": "Wrap those words. Show them at what columns to start and stop.", - "version": "0.0.3", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-wordwrap.git" - }, - "main": "./index.js", - "keywords": [ - "word", - "wrap", - "rule", - "format", - "column" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "expresso" - }, - "devDependencies": { - "expresso": "=0.7.x" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "gitHead": "e59aa1bd338914019456bdfba034508c9c4cb29d", - "bugs": { - "url": "https://github.com/substack/node-wordwrap/issues" - }, - "homepage": "https://github.com/substack/node-wordwrap#readme", - "_id": "wordwrap@0.0.3", - "_shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107", - "_from": "wordwrap@~0.0.2", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, - "dist": { - "shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107", - "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js deleted file mode 100644 index 749292e..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js +++ /dev/null @@ -1,30 +0,0 @@ -var assert = require('assert'); -var wordwrap = require('../'); - -exports.hard = function () { - var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' - + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' - + '"browser":"chrome/6.0"}' - ; - var s_ = wordwrap.hard(80)(s); - - var lines = s_.split('\n'); - assert.equal(lines.length, 2); - assert.ok(lines[0].length < 80); - assert.ok(lines[1].length < 80); - - assert.equal(s, s_.replace(/\n/g, '')); -}; - -exports.break = function () { - var s = new Array(55+1).join('a'); - var s_ = wordwrap.hard(20)(s); - - var lines = s_.split('\n'); - assert.equal(lines.length, 3); - assert.ok(lines[0].length === 20); - assert.ok(lines[1].length === 20); - assert.ok(lines[2].length === 15); - - assert.equal(s, s_.replace(/\n/g, '')); -}; diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt deleted file mode 100644 index aa3f490..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt +++ /dev/null @@ -1,63 +0,0 @@ -In Praise of Idleness - -By Bertrand Russell - -[1932] - -Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain. - -Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise. - -One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling. - -But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person. - -All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work. - -First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising. - -Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example. - -From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery. - -It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization. - -Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry. - -This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined? - -The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion. - -Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only. - -I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve. - -If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense. - -The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists. - -In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism. - -The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching. - -For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours? - -In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man. - -In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed. - -The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy. - -It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer. - -When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part. - -In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism. - -The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits. - -In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue. - -Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever. - -[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests. diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js deleted file mode 100644 index 0cfb76d..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js +++ /dev/null @@ -1,31 +0,0 @@ -var assert = require('assert'); -var wordwrap = require('wordwrap'); - -var fs = require('fs'); -var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); - -exports.stop80 = function () { - var lines = wordwrap(80)(idleness).split(/\n/); - var words = idleness.split(/\s+/); - - lines.forEach(function (line) { - assert.ok(line.length <= 80, 'line > 80 columns'); - var chunks = line.match(/\S/) ? line.split(/\s+/) : []; - assert.deepEqual(chunks, words.splice(0, chunks.length)); - }); -}; - -exports.start20stop60 = function () { - var lines = wordwrap(20, 100)(idleness).split(/\n/); - var words = idleness.split(/\s+/); - - lines.forEach(function (line) { - assert.ok(line.length <= 100, 'line > 100 columns'); - var chunks = line - .split(/\s+/) - .filter(function (x) { return x.match(/\S/) }) - ; - assert.deepEqual(chunks, words.splice(0, chunks.length)); - assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); - }); -}; diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/package.json b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/package.json deleted file mode 100644 index d81d4f5..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "optimist", - "version": "0.3.7", - "description": "Light-weight option parsing with an argv hash. No optstrings attached.", - "main": "./index.js", - "dependencies": { - "wordwrap": "~0.0.2" - }, - "devDependencies": { - "hashish": "~0.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap ./test/*.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/substack/node-optimist.git" - }, - "keywords": [ - "argument", - "args", - "option", - "parser", - "parsing", - "cli", - "command" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4" - }, - "_id": "optimist@0.3.7", - "dist": { - "shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", - "tarball": "http://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz" - }, - "_from": "optimist@~0.3.5", - "_npmVersion": "1.2.2", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "c90941ad59e4273328923074d2cf2e7cbc6ec0d9", - "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", - "bugs": { - "url": "https://github.com/substack/node-optimist/issues" - }, - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/readme.markdown b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/readme.markdown deleted file mode 100644 index ad9d3fd..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/readme.markdown +++ /dev/null @@ -1,487 +0,0 @@ -optimist -======== - -Optimist is a node.js library for option parsing for people who hate option -parsing. More specifically, this module is for people who like all the --bells -and -whistlz of program usage but think optstrings are a waste of time. - -With optimist, option parsing doesn't have to suck (as much). - -[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist) - -examples -======== - -With Optimist, the options are just a hash! No optstrings attached. -------------------------------------------------------------------- - -xup.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist').argv; - -if (argv.rif - 5 * argv.xup > 7.138) { - console.log('Buy more riffiwobbles'); -} -else { - console.log('Sell the xupptumblers'); -} -```` - -*** - - $ ./xup.js --rif=55 --xup=9.52 - Buy more riffiwobbles - - $ ./xup.js --rif 12 --xup 8.1 - Sell the xupptumblers - -![This one's optimistic.](http://substack.net/images/optimistic.png) - -But wait! There's more! You can do short options: -------------------------------------------------- - -short.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -```` - -*** - - $ ./short.js -x 10 -y 21 - (10,21) - -And booleans, both long and short (and grouped): ----------------------------------- - -bool.js: - -````javascript -#!/usr/bin/env node -var util = require('util'); -var argv = require('optimist').argv; - -if (argv.s) { - util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); -} -console.log( - (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') -); -```` - -*** - - $ ./bool.js -s - The cat says: meow - - $ ./bool.js -sp - The cat says: meow. - - $ ./bool.js -sp --fr - Le chat dit: miaou. - -And non-hypenated options too! Just use `argv._`! -------------------------------------------------- - -nonopt.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -console.log(argv._); -```` - -*** - - $ ./nonopt.js -x 6.82 -y 3.35 moo - (6.82,3.35) - [ 'moo' ] - - $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz - (0.54,1.12) - [ 'foo', 'bar', 'baz' ] - -Plus, Optimist comes with .usage() and .demand()! -------------------------------------------------- - -divide.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .usage('Usage: $0 -x [num] -y [num]') - .demand(['x','y']) - .argv; - -console.log(argv.x / argv.y); -```` - -*** - - $ ./divide.js -x 55 -y 11 - 5 - - $ node ./divide.js -x 4.91 -z 2.51 - Usage: node ./divide.js -x [num] -y [num] - - Options: - -x [required] - -y [required] - - Missing required arguments: y - -EVEN MORE HOLY COW ------------------- - -default_singles.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .default('x', 10) - .default('y', 10) - .argv -; -console.log(argv.x + argv.y); -```` - -*** - - $ ./default_singles.js -x 5 - 15 - -default_hash.js: - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .default({ x : 10, y : 10 }) - .argv -; -console.log(argv.x + argv.y); -```` - -*** - - $ ./default_hash.js -y 7 - 17 - -And if you really want to get all descriptive about it... ---------------------------------------------------------- - -boolean_single.js - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .boolean('v') - .argv -; -console.dir(argv); -```` - -*** - - $ ./boolean_single.js -v foo bar baz - true - [ 'bar', 'baz', 'foo' ] - -boolean_double.js - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .boolean(['x','y','z']) - .argv -; -console.dir([ argv.x, argv.y, argv.z ]); -console.dir(argv._); -```` - -*** - - $ ./boolean_double.js -x -z one two three - [ true, false, true ] - [ 'one', 'two', 'three' ] - -Optimist is here to help... ---------------------------- - -You can describe parameters for help messages and set aliases. Optimist figures -out how to format a handy help string automatically. - -line_count.js - -````javascript -#!/usr/bin/env node -var argv = require('optimist') - .usage('Count the lines in a file.\nUsage: $0') - .demand('f') - .alias('f', 'file') - .describe('f', 'Load a file') - .argv -; - -var fs = require('fs'); -var s = fs.createReadStream(argv.file); - -var lines = 0; -s.on('data', function (buf) { - lines += buf.toString().match(/\n/g).length; -}); - -s.on('end', function () { - console.log(lines); -}); -```` - -*** - - $ node line_count.js - Count the lines in a file. - Usage: node ./line_count.js - - Options: - -f, --file Load a file [required] - - Missing required arguments: f - - $ node line_count.js --file line_count.js - 20 - - $ node line_count.js -f line_count.js - 20 - -methods -======= - -By itself, - -````javascript -require('optimist').argv -````` - -will use `process.argv` array to construct the `argv` object. - -You can pass in the `process.argv` yourself: - -````javascript -require('optimist')([ '-x', '1', '-y', '2' ]).argv -```` - -or use .parse() to do the same thing: - -````javascript -require('optimist').parse([ '-x', '1', '-y', '2' ]) -```` - -The rest of these methods below come in just before the terminating `.argv`. - -.alias(key, alias) ------------------- - -Set key names as equivalent such that updates to a key will propagate to aliases -and vice-versa. - -Optionally `.alias()` can take an object that maps keys to aliases. - -.default(key, value) --------------------- - -Set `argv[key]` to `value` if no option was specified on `process.argv`. - -Optionally `.default()` can take an object that maps keys to default values. - -.demand(key) ------------- - -If `key` is a string, show the usage information and exit if `key` wasn't -specified in `process.argv`. - -If `key` is a number, demand at least as many non-option arguments, which show -up in `argv._`. - -If `key` is an Array, demand each element. - -.describe(key, desc) --------------------- - -Describe a `key` for the generated usage information. - -Optionally `.describe()` can take an object that maps keys to descriptions. - -.options(key, opt) ------------------- - -Instead of chaining together `.alias().demand().default()`, you can specify -keys in `opt` for each of the chainable methods. - -For example: - -````javascript -var argv = require('optimist') - .options('f', { - alias : 'file', - default : '/etc/passwd', - }) - .argv -; -```` - -is the same as - -````javascript -var argv = require('optimist') - .alias('f', 'file') - .default('f', '/etc/passwd') - .argv -; -```` - -Optionally `.options()` can take an object that maps keys to `opt` parameters. - -.usage(message) ---------------- - -Set a usage message to show which commands to use. Inside `message`, the string -`$0` will get interpolated to the current script name or node command for the -present script similar to how `$0` works in bash or perl. - -.check(fn) ----------- - -Check that certain conditions are met in the provided arguments. - -If `fn` throws or returns `false`, show the thrown error, usage information, and -exit. - -.boolean(key) -------------- - -Interpret `key` as a boolean. If a non-flag option follows `key` in -`process.argv`, that string won't get set as the value of `key`. - -If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be -`false`. - -If `key` is an Array, interpret all the elements as booleans. - -.string(key) ------------- - -Tell the parser logic not to interpret `key` as a number or boolean. -This can be useful if you need to preserve leading zeros in an input. - -If `key` is an Array, interpret all the elements as strings. - -.wrap(columns) --------------- - -Format usage output to wrap at `columns` many columns. - -.help() -------- - -Return the generated usage string. - -.showHelp(fn=console.error) ---------------------------- - -Print the usage data using `fn` for printing. - -.parse(args) ------------- - -Parse `args` instead of `process.argv`. Returns the `argv` object. - -.argv ------ - -Get the arguments as a plain old object. - -Arguments without a corresponding flag show up in the `argv._` array. - -The script name or node command is available at `argv.$0` similarly to how `$0` -works in bash or perl. - -parsing tricks -============== - -stop parsing ------------- - -Use `--` to stop parsing flags and stuff the remainder into `argv._`. - - $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4 - { _: [ '-c', '3', '-d', '4' ], - '$0': 'node ./examples/reflect.js', - a: 1, - b: 2 } - -negate fields -------------- - -If you want to explicity set a field to false instead of just leaving it -undefined or to override a default you can do `--no-key`. - - $ node examples/reflect.js -a --no-b - { _: [], - '$0': 'node ./examples/reflect.js', - a: true, - b: false } - -numbers -------- - -Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to -one. This way you can just `net.createConnection(argv.port)` and you can add -numbers out of `argv` with `+` without having that mean concatenation, -which is super frustrating. - -duplicates ----------- - -If you specify a flag multiple times it will get turned into an array containing -all the values in order. - - $ node examples/reflect.js -x 5 -x 8 -x 0 - { _: [], - '$0': 'node ./examples/reflect.js', - x: [ 5, 8, 0 ] } - -dot notation ------------- - -When you use dots (`.`s) in argument names, an implicit object path is assumed. -This lets you organize arguments into nested objects. - - $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5 - { _: [], - '$0': 'node ./examples/reflect.js', - foo: { bar: { baz: 33 }, quux: 5 } } - -installation -============ - -With [npm](http://github.com/isaacs/npm), just do: - npm install optimist - -or clone this project on github: - - git clone http://github.com/substack/node-optimist.git - -To run the tests with [expresso](http://github.com/visionmedia/expresso), -just do: - - expresso - -inspired By -=========== - -This module is loosely inspired by Perl's -[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm). diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_.js deleted file mode 100644 index d9c58b3..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_.js +++ /dev/null @@ -1,71 +0,0 @@ -var spawn = require('child_process').spawn; -var test = require('tap').test; - -test('dotSlashEmpty', testCmd('./bin.js', [])); - -test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ])); - -test('nodeEmpty', testCmd('node bin.js', [])); - -test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ])); - -test('whichNodeEmpty', function (t) { - var which = spawn('which', ['node']); - - which.stdout.on('data', function (buf) { - t.test( - testCmd(buf.toString().trim() + ' bin.js', []) - ); - t.end(); - }); - - which.stderr.on('data', function (err) { - assert.error(err); - t.end(); - }); -}); - -test('whichNodeArgs', function (t) { - var which = spawn('which', ['node']); - - which.stdout.on('data', function (buf) { - t.test( - testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ]) - ); - t.end(); - }); - - which.stderr.on('data', function (err) { - t.error(err); - t.end(); - }); -}); - -function testCmd (cmd, args) { - - return function (t) { - var to = setTimeout(function () { - assert.fail('Never got stdout data.') - }, 5000); - - var oldDir = process.cwd(); - process.chdir(__dirname + '/_'); - - var cmds = cmd.split(' '); - - var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String))); - process.chdir(oldDir); - - bin.stderr.on('data', function (err) { - t.error(err); - t.end(); - }); - - bin.stdout.on('data', function (buf) { - clearTimeout(to); - var _ = JSON.parse(buf.toString()); - t.same(_.map(String), args.map(String)); - t.end(); - }); - }; -} diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_/argv.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_/argv.js deleted file mode 100644 index 3d09606..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_/argv.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.log(JSON.stringify(process.argv)); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_/bin.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_/bin.js deleted file mode 100755 index 4a18d85..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/_/bin.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var argv = require('../../index').argv -console.log(JSON.stringify(argv._)); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/parse.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/parse.js deleted file mode 100644 index d320f43..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/parse.js +++ /dev/null @@ -1,446 +0,0 @@ -var optimist = require('../index'); -var path = require('path'); -var test = require('tap').test; - -var $0 = 'node ./' + path.relative(process.cwd(), __filename); - -test('short boolean', function (t) { - var parse = optimist.parse([ '-b' ]); - t.same(parse, { b : true, _ : [], $0 : $0 }); - t.same(typeof parse.b, 'boolean'); - t.end(); -}); - -test('long boolean', function (t) { - t.same( - optimist.parse([ '--bool' ]), - { bool : true, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('bare', function (t) { - t.same( - optimist.parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ], $0 : $0 } - ); - t.end(); -}); - -test('short group', function (t) { - t.same( - optimist.parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('short group next', function (t) { - t.same( - optimist.parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('short capture', function (t) { - t.same( - optimist.parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('short captures', function (t) { - t.same( - optimist.parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('long capture sp', function (t) { - t.same( - optimist.parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('long capture eq', function (t) { - t.same( - optimist.parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [], $0 : $0 } - ); - t.end() -}); - -test('long captures sp', function (t) { - t.same( - optimist.parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('long captures eq', function (t) { - t.same( - optimist.parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ], $0 : $0, - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.same( - optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ], $0 : $0, - } - ); - t.end(); -}); - -test('no', function (t) { - t.same( - optimist.parse([ '--no-moo' ]), - { moo : false, _ : [], $0 : $0 } - ); - t.end(); -}); - -test('multi', function (t) { - t.same( - optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [], $0 : $0 } - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.same( - optimist.parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ], - $0 : $0 - } - ); - t.end(); -}); - -test('nums', function (t) { - var argv = optimist.parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789', - ]); - t.same(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ], - $0 : $0 - }); - t.same(typeof argv.x, 'number'); - t.same(typeof argv.y, 'number'); - t.same(typeof argv.z, 'number'); - t.same(typeof argv.w, 'string'); - t.same(typeof argv.hex, 'number'); - t.same(typeof argv._[0], 'number'); - t.end(); -}); - -test('flag boolean', function (t) { - var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv; - t.same(parse, { t : true, _ : [ 'moo' ], $0 : $0 }); - t.same(typeof parse.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true']) - .boolean(['t', 'verbose']).default('verbose', true).argv; - - t.same(parse, { - verbose: false, - t: true, - _: ['moo'], - $0 : $0 - }); - - t.same(typeof parse.verbose, 'boolean'); - t.same(typeof parse.t, 'boolean'); - t.end(); -}); - -test('flag boolean default false', function (t) { - var parse = optimist(['moo']) - .boolean(['t', 'verbose']) - .default('verbose', false) - .default('t', false).argv; - - t.same(parse, { - verbose: false, - t: false, - _: ['moo'], - $0 : $0 - }); - - t.same(typeof parse.verbose, 'boolean'); - t.same(typeof parse.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ]) - .boolean(['x','y','z']).argv; - - t.same(parse, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ], - $0 : $0 - }); - - t.same(typeof parse.x, 'boolean'); - t.same(typeof parse.y, 'boolean'); - t.same(typeof parse.z, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = optimist.parse([ '-s', "X\nX" ]) - t.same(args, { _ : [], s : "X\nX", $0 : $0 }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = optimist.parse([ "--s=X\nX" ]) - t.same(args, { _ : [], s : "X\nX", $0 : $0 }); - t.end(); -}); - -test('strings' , function (t) { - var s = optimist([ '-s', '0001234' ]).string('s').argv.s; - t.same(s, '0001234'); - t.same(typeof s, 'string'); - - var x = optimist([ '-x', '56' ]).string('x').argv.x; - t.same(x, '56'); - t.same(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = optimist([ ' ', ' ' ]).string('_').argv._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - optimist.parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [], $0 : $0 } - ); - t.same( - optimist.parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : $0 } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = optimist([ '-f', '11', '--zoom', '55' ]) - .alias('z', 'zoom') - .argv - ; - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = optimist([ '-f', '11', '--zoom', '55' ]) - .alias('z', [ 'zm', 'zoom' ]) - .argv - ; - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('boolean default true', function (t) { - var argv = optimist.options({ - sometrue: { - boolean: true, - default: true - } - }).argv; - - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = optimist.options({ - somefalse: { - boolean: true, - default: false - } - }).argv; - - t.equal(argv.somefalse, false); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = optimist([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]).argv; - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - }, - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); - -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = optimist(aliased) - .boolean('herp') - .alias('h', 'herp') - .argv; - var propertyArgv = optimist(regular) - .boolean('herp') - .alias('h', 'herp') - .argv; - var expected = { - herp: true, - h: true, - '_': [ 'derp' ], - '$0': $0, - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = optimist(aliased) - .options(opts) - .argv; - var propertyArgv = optimist(regular).options(opts).argv; - var expected = { - herp: true, - h: true, - '_': [ 'derp' ], - '$0': $0, - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = optimist(aliased) - .boolean('h') - .alias('h', 'herp') - .argv; - var propertyArgv = optimist(regular) - .boolean('h') - .alias('h', 'herp') - .argv; - var expected = { - herp: true, - h: true, - '_': [ ], - '$0': $0, - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = optimist(['--boool', '--other=true']).boolean('boool').argv; - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = optimist(['--boool', '--other=false']).boolean('boool').argv; - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/usage.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/usage.js deleted file mode 100644 index 300454c..0000000 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/test/usage.js +++ /dev/null @@ -1,292 +0,0 @@ -var Hash = require('hashish'); -var optimist = require('../index'); -var test = require('tap').test; - -test('usageFail', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -z 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .demand(['x','y']) - .argv; - }); - t.same( - r.result, - { x : 10, z : 20, _ : [], $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/), - [ - 'Usage: ./usage -x NUM -y NUM', - 'Options:', - ' -x [required]', - ' -y [required]', - 'Missing required arguments: y', - ] - ); - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - - -test('usagePass', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -y 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .demand(['x','y']) - .argv; - }); - t.same(r, { - result : { x : 10, y : 20, _ : [], $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('checkPass', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -y 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(function (argv) { - if (!('x' in argv)) throw 'You forgot about -x'; - if (!('y' in argv)) throw 'You forgot about -y'; - }) - .argv; - }); - t.same(r, { - result : { x : 10, y : 20, _ : [], $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('checkFail', function (t) { - var r = checkUsage(function () { - return optimist('-x 10 -z 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(function (argv) { - if (!('x' in argv)) throw 'You forgot about -x'; - if (!('y' in argv)) throw 'You forgot about -y'; - }) - .argv; - }); - - t.same( - r.result, - { x : 10, z : 20, _ : [], $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/), - [ - 'Usage: ./usage -x NUM -y NUM', - 'You forgot about -y' - ] - ); - - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - -test('checkCondPass', function (t) { - function checker (argv) { - return 'x' in argv && 'y' in argv; - } - - var r = checkUsage(function () { - return optimist('-x 10 -y 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(checker) - .argv; - }); - t.same(r, { - result : { x : 10, y : 20, _ : [], $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('checkCondFail', function (t) { - function checker (argv) { - return 'x' in argv && 'y' in argv; - } - - var r = checkUsage(function () { - return optimist('-x 10 -z 20'.split(' ')) - .usage('Usage: $0 -x NUM -y NUM') - .check(checker) - .argv; - }); - - t.same( - r.result, - { x : 10, z : 20, _ : [], $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/).join('\n'), - 'Usage: ./usage -x NUM -y NUM\n' - + 'Argument check failed: ' + checker.toString() - ); - - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - -test('countPass', function (t) { - var r = checkUsage(function () { - return optimist('1 2 3 --moo'.split(' ')) - .usage('Usage: $0 [x] [y] [z] {OPTIONS}') - .demand(3) - .argv; - }); - t.same(r, { - result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' }, - errors : [], - logs : [], - exit : false, - }); - t.end(); -}); - -test('countFail', function (t) { - var r = checkUsage(function () { - return optimist('1 2 --moo'.split(' ')) - .usage('Usage: $0 [x] [y] [z] {OPTIONS}') - .demand(3) - .argv; - }); - t.same( - r.result, - { _ : [ '1', '2' ], moo : true, $0 : './usage' } - ); - - t.same( - r.errors.join('\n').split(/\n+/), - [ - 'Usage: ./usage [x] [y] [z] {OPTIONS}', - 'Not enough non-option arguments: got 2, need at least 3', - ] - ); - - t.same(r.logs, []); - t.ok(r.exit); - t.end(); -}); - -test('defaultSingles', function (t) { - var r = checkUsage(function () { - return optimist('--foo 50 --baz 70 --powsy'.split(' ')) - .default('foo', 5) - .default('bar', 6) - .default('baz', 7) - .argv - ; - }); - t.same(r.result, { - foo : '50', - bar : 6, - baz : '70', - powsy : true, - _ : [], - $0 : './usage', - }); - t.end(); -}); - -test('defaultAliases', function (t) { - var r = checkUsage(function () { - return optimist('') - .alias('f', 'foo') - .default('f', 5) - .argv - ; - }); - t.same(r.result, { - f : '5', - foo : '5', - _ : [], - $0 : './usage', - }); - t.end(); -}); - -test('defaultHash', function (t) { - var r = checkUsage(function () { - return optimist('--foo 50 --baz 70'.split(' ')) - .default({ foo : 10, bar : 20, quux : 30 }) - .argv - ; - }); - t.same(r.result, { - _ : [], - $0 : './usage', - foo : 50, - baz : 70, - bar : 20, - quux : 30, - }); - t.end(); -}); - -test('rebase', function (t) { - t.equal( - optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'), - './foo/bar/baz' - ); - t.equal( - optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'), - '../../..' - ); - t.equal( - optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'), - '../pow/zoom.txt' - ); - t.end(); -}); - -function checkUsage (f) { - - var exit = false; - - process._exit = process.exit; - process._env = process.env; - process._argv = process.argv; - - process.exit = function (t) { exit = true }; - process.env = Hash.merge(process.env, { _ : 'node' }); - process.argv = [ './usage' ]; - - var errors = []; - var logs = []; - - console._error = console.error; - console.error = function (msg) { errors.push(msg) }; - console._log = console.log; - console.log = function (msg) { logs.push(msg) }; - - var result = f(); - - process.exit = process._exit; - process.env = process._env; - process.argv = process._argv; - - console.error = console._error; - console.log = console._log; - - return { - errors : errors, - logs : logs, - exit : exit, - result : result, - }; -}; diff --git a/node_modules/handlebars/node_modules/source-map/.npmignore b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/.npmignore similarity index 100% rename from node_modules/handlebars/node_modules/source-map/.npmignore rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/.npmignore diff --git a/node_modules/handlebars/node_modules/source-map/.travis.yml b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/.travis.yml similarity index 100% rename from node_modules/handlebars/node_modules/source-map/.travis.yml rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/.travis.yml diff --git a/node_modules/handlebars/node_modules/source-map/CHANGELOG.md b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md similarity index 84% rename from node_modules/handlebars/node_modules/source-map/CHANGELOG.md rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md index 2e7ca5d..518bed4 100644 --- a/node_modules/handlebars/node_modules/source-map/CHANGELOG.md +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md @@ -1,26 +1,5 @@ # Change Log -## 0.1.43 - -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue - #148 for some discussion and issues #150, #151, and #152 for implementations. - -## 0.1.42 - -* Fix an issue where `SourceNode`s from different versions of the source-map - library couldn't be used in conjunction with each other. See issue #142. - -## 0.1.41 - -* Fix a bug with getting the source content of relative sources with a "./" - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). - -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the - column span of each mapping. - -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find - all generated positions associated with a given original source and line. - ## 0.1.40 * Performance improvements for parsing source maps in SourceMapConsumer. diff --git a/node_modules/handlebars/node_modules/source-map/LICENSE b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/LICENSE similarity index 100% rename from node_modules/handlebars/node_modules/source-map/LICENSE rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/LICENSE diff --git a/node_modules/handlebars/node_modules/source-map/Makefile.dryice.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/Makefile.dryice.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js diff --git a/node_modules/handlebars/node_modules/source-map/README.md b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md similarity index 93% rename from node_modules/handlebars/node_modules/source-map/README.md rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md index 59767aa..1a1c7d8 100644 --- a/node_modules/handlebars/node_modules/source-map/README.md +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md @@ -175,11 +175,6 @@ following attributes: * `file`: Optional. The generated filename this source map is associated with. -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) Returns the original source, line, and column information for the generated @@ -221,22 +216,6 @@ and an object is returned with the following properties: * `column`: The column number in the generated source, or null. -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source -and line provided. The only argument is an object with the following -properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. - -* `column`: The column number in the generated source, or null. - #### SourceMapConsumer.prototype.sourceContentFor(source) Returns the original source content for the source provided. The only @@ -274,11 +253,6 @@ You may pass an object with the following properties: * `sourceRoot`: A root for all relative URLs in this source map. -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - #### SourceMapGenerator.fromSourceMap(sourceMapConsumer) Creates a new SourceMapGenerator based on a SourceMapConsumer diff --git a/node_modules/handlebars/node_modules/source-map/build/assert-shim.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/assert-shim.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js diff --git a/node_modules/handlebars/node_modules/source-map/build/mini-require.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/mini-require.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/mini-require.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/mini-require.js diff --git a/node_modules/handlebars/node_modules/source-map/build/prefix-source-map.jsm b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/prefix-source-map.jsm rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm diff --git a/node_modules/handlebars/node_modules/source-map/build/prefix-utils.jsm b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/prefix-utils.jsm rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm diff --git a/node_modules/handlebars/node_modules/source-map/build/suffix-browser.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/suffix-browser.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js diff --git a/node_modules/handlebars/node_modules/source-map/build/suffix-source-map.jsm b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/suffix-source-map.jsm rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm diff --git a/node_modules/handlebars/node_modules/source-map/build/suffix-utils.jsm b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/suffix-utils.jsm rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm diff --git a/node_modules/handlebars/node_modules/source-map/build/test-prefix.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/test-prefix.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js diff --git a/node_modules/handlebars/node_modules/source-map/build/test-suffix.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/build/test-suffix.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/lib/source-map.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map.js diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/array-set.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/array-set.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js similarity index 97% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/base64-vlq.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js index e22dcae..b4ff136 100644 --- a/node_modules/handlebars/node_modules/source-map/lib/source-map/base64-vlq.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js @@ -66,7 +66,7 @@ define(function (require, exports, module) { /** * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: + * is placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ @@ -78,7 +78,7 @@ define(function (require, exports, module) { /** * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: + * is placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/base64.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/base64.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js similarity index 80% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/binary-search.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js index e085f81..ff347c6 100644 --- a/node_modules/handlebars/node_modules/source-map/lib/source-map/binary-search.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js @@ -23,17 +23,17 @@ define(function (require, exports, module) { // // 1. We find the exact element we are looking for. // - // 2. We did not find the exact element, but we can return the index of - // the next closest element that is less than that element. + // 2. We did not find the exact element, but we can return the next + // closest element that is less than that element. // // 3. We did not find the exact element, and there is no next-closest // element which is less than the one we are searching for, so we - // return -1. + // return null. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. - return mid; + return aHaystack[mid]; } else if (cmp > 0) { // aHaystack[mid] is greater than our needle. @@ -43,7 +43,7 @@ define(function (require, exports, module) { } // We did not find an exact match, return the next closest one // (termination case 2). - return mid; + return aHaystack[mid]; } else { // aHaystack[mid] is less than our needle. @@ -53,16 +53,18 @@ define(function (require, exports, module) { } // The exact needle element was not found in this haystack. Determine if // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 ? -1 : aLow; + return aLow < 0 + ? null + : aHaystack[aLow]; } } /** * This is an implementation of binary search which will always try and return - * the index of next lowest value checked if there is no exact hit. This is - * because mappings between original and generated line/col pairs are single - * points, and there is an implicit region between each of them, so a miss - * just means that you aren't on the very start of a region. + * the next lowest value checked if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. @@ -71,10 +73,9 @@ define(function (require, exports, module) { * than, equal to, or greater than the element, respectively. */ exports.search = function search(aNeedle, aHaystack, aCompare) { - if (aHaystack.length === 0) { - return -1; - } - return recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) + return aHaystack.length > 0 + ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) + : null; }; }); diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js similarity index 77% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-consumer.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js index cfaa299..ea643bf 100644 --- a/node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-consumer.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js @@ -66,11 +66,6 @@ define(function (require, exports, module) { throw new Error('Unsupported version: ' + version); } - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - sources = sources.map(util.normalize); - // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue @@ -102,8 +97,9 @@ define(function (require, exports, module) { smc.sourceRoot); smc.file = aSourceMap._file; - smc.__generatedMappings = aSourceMap._mappings.toArray().slice(); - smc.__originalMappings = aSourceMap._mappings.toArray().slice() + smc.__generatedMappings = aSourceMap._mappings.slice() + .sort(util.compareByGeneratedPositions); + smc.__originalMappings = aSourceMap._mappings.slice() .sort(util.compareByOriginalPositions); return smc; @@ -294,33 +290,6 @@ define(function (require, exports, module) { return binarySearch.search(aNeedle, aMappings, aComparator); }; - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - SourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object @@ -343,27 +312,23 @@ define(function (require, exports, module) { generatedColumn: util.getArg(aArgs, 'column') }; - var index = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositions); + var mapping = this._findMapping(needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositions); - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source != null && this.sourceRoot != null) { - source = util.join(this.sourceRoot, source); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; + if (mapping && mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source != null && this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: util.getArg(mapping, 'name', null) + }; } return { @@ -441,82 +406,25 @@ define(function (require, exports, module) { needle.source = util.relative(this.sourceRoot, needle.source); } - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); - - if (index >= 0) { - var mapping = this._originalMappings[index]; + var mapping = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + if (mapping) { return { line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + column: util.getArg(mapping, 'generatedColumn', null) }; } return { line: null, - column: null, - lastColumn: null + column: null }; }; - /** - * Returns all generated line and column information for the original source - * and line provided. The only argument is an object with the following - * properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - // When there is no exact match, SourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to Infinity, we thus find the last - // mapping for the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: util.getArg(aArgs, 'line'), - originalColumn: Infinity - }; - - if (this.sourceRoot != null) { - needle.source = util.relative(this.sourceRoot, needle.source); - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - while (mapping && mapping.originalLine === needle.originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[--index]; - } - } - - return mappings.reverse(); - }; - SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js similarity index 94% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-generator.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js index 1ab7a47..5387fa1 100644 --- a/node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-generator.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js @@ -12,7 +12,6 @@ define(function (require, exports, module) { var base64VLQ = require('./base64-vlq'); var util = require('./util'); var ArraySet = require('./array-set').ArraySet; - var MappingList = require('./mapping-list').MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -28,10 +27,9 @@ define(function (require, exports, module) { } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._sources = new ArraySet(); this._names = new ArraySet(); - this._mappings = new MappingList(); + this._mappings = []; this._sourcesContents = null; } @@ -101,9 +99,7 @@ define(function (require, exports, module) { var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } + this._validateMapping(generated, original, source, name); if (source != null && !this._sources.has(source)) { this._sources.add(source); @@ -113,7 +109,7 @@ define(function (require, exports, module) { this._names.add(name); } - this._mappings.add({ + this._mappings.push({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, @@ -190,7 +186,7 @@ define(function (require, exports, module) { var newNames = new ArraySet(); // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { + this._mappings.forEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ @@ -296,10 +292,15 @@ define(function (require, exports, module) { var result = ''; var mapping; - var mappings = this._mappings.toArray(); + // The mappings must be guaranteed to be in sorted order before we start + // serializing them or else the generated line numbers (which are defined + // via the ';' separators) will be all messed up. Note: it might be more + // performant to maintain the sorting as we insert them, rather than as we + // serialize them, but the big O is the same either way. + this._mappings.sort(util.compareByGeneratedPositions); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; + for (var i = 0, len = this._mappings.length; i < len; i++) { + mapping = this._mappings[i]; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; @@ -310,7 +311,7 @@ define(function (require, exports, module) { } else { if (i > 0) { - if (!util.compareByGeneratedPositions(mapping, mappings[i - 1])) { + if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { continue; } result += ','; diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/source-node.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js similarity index 94% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/source-node.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js index 9ee90bd..baa5f40 100644 --- a/node_modules/handlebars/node_modules/source-map/lib/source-map/source-node.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js @@ -16,13 +16,8 @@ define(function (require, exports, module) { // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; + // Matches a Windows-style newline, or any character. + var REGEX_CHARACTER = /\r\n|[\s\S]/g; /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -43,7 +38,6 @@ define(function (require, exports, module) { this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; - this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } @@ -174,7 +168,7 @@ define(function (require, exports, module) { this.add(chunk); }, this); } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { + else if (aChunk instanceof SourceNode || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } @@ -199,7 +193,7 @@ define(function (require, exports, module) { this.prepend(aChunk[i]); } } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { + else if (aChunk instanceof SourceNode || typeof aChunk === "string") { this.children.unshift(aChunk); } else { @@ -221,7 +215,7 @@ define(function (require, exports, module) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; - if (chunk[isSourceNode]) { + if (chunk instanceof SourceNode) { chunk.walk(aFn); } else { @@ -266,7 +260,7 @@ define(function (require, exports, module) { */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { + if (lastChild instanceof SourceNode) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { @@ -299,7 +293,7 @@ define(function (require, exports, module) { SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { + if (this.children[i] instanceof SourceNode) { this.children[i].walkSourceContents(aFn); } } @@ -375,12 +369,12 @@ define(function (require, exports, module) { lastOriginalSource = null; sourceMappingActive = false; } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + chunk.match(REGEX_CHARACTER).forEach(function (ch, idx, array) { + if (REGEX_NEWLINE.test(ch)) { generated.line++; generated.column = 0; // Mappings end at eol - if (idx + 1 === length) { + if (idx + 1 === array.length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { @@ -398,9 +392,9 @@ define(function (require, exports, module) { }); } } else { - generated.column++; + generated.column += ch.length; } - } + }); }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); diff --git a/node_modules/handlebars/node_modules/source-map/lib/source-map/util.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/lib/source-map/util.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js diff --git a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/LICENSE b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE similarity index 96% rename from node_modules/handlebars/node_modules/source-map/node_modules/amdefine/LICENSE rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE index af46c6d..f33d665 100644 --- a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/LICENSE +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE @@ -6,7 +6,7 @@ provided below. The "New" BSD License: ---------------------- -Copyright (c) 2011-2015, The Dojo Foundation +Copyright (c) 2011, The Dojo Foundation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MIT License ----------- -Copyright (c) 2011-2015, The Dojo Foundation +Copyright (c) 2011, The Dojo Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/README.md b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md similarity index 99% rename from node_modules/handlebars/node_modules/source-map/node_modules/amdefine/README.md rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md index 037a6e8..c6995c0 100644 --- a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/README.md +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md @@ -59,7 +59,7 @@ intercept module affects all .js files loaded in the Node app, and it is inconsiderate to modify global state like that unless you are also controlling the top level app. -#### Why distribute AMD-style modules via npm? +#### Why distribute AMD-style nodes via npm? npm has a lot of weaknesses for front-end use (installed layout is not great, should have better support for the `baseUrl + moduleID + '.js' style of loading, diff --git a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/amdefine.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js similarity index 97% rename from node_modules/handlebars/node_modules/source-map/node_modules/amdefine/amdefine.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js index 0c4a954..53bf5a6 100644 --- a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/amdefine.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js @@ -1,5 +1,5 @@ /** vim: et:ts=4:sw=4:sts=4 - * @license amdefine 1.0.0 Copyright (c) 2011-2015, The Dojo Foundation All Rights Reserved. + * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/amdefine for details */ @@ -120,11 +120,9 @@ function amdefine(module, requireFn) { }); //Wait for next tick to call back the require call. - if (callback) { - process.nextTick(function () { - callback.apply(null, deps); - }); - } + process.nextTick(function () { + callback.apply(null, deps); + }); } } diff --git a/node_modules/handlebars/node_modules/source-map/node_modules/amdefine/intercept.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/node_modules/amdefine/intercept.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json new file mode 100644 index 0000000..5f5f1f5 --- /dev/null +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json @@ -0,0 +1,54 @@ +{ + "name": "amdefine", + "description": "Provide AMD's define() API for declaring modules in the AMD format", + "version": "0.1.0", + "homepage": "http://github.com/jrburke/amdefine", + "author": { + "name": "James Burke", + "email": "jrburke@gmail.com", + "url": "http://github.com/jrburke" + }, + "licenses": [ + { + "type": "BSD", + "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE" + }, + { + "type": "MIT", + "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/jrburke/amdefine.git" + }, + "main": "./amdefine.js", + "engines": { + "node": ">=0.4.2" + }, + "readme": "# amdefine\n\nA module that can be used to implement AMD's define() in Node. This allows you\nto code to the AMD API and have the module work in node programs without\nrequiring those other programs to use AMD.\n\n## Usage\n\n**1)** Update your package.json to indicate amdefine as a dependency:\n\n```javascript\n \"dependencies\": {\n \"amdefine\": \">=0.1.0\"\n }\n```\n\nThen run `npm install` to get amdefine into your project.\n\n**2)** At the top of each module that uses define(), place this code:\n\n```javascript\nif (typeof define !== 'function') { var define = require('amdefine')(module) }\n```\n\n**Only use these snippets** when loading amdefine. If you preserve the basic structure,\nwith the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).\n\nYou can add spaces, line breaks and even require amdefine with a local path, but\nkeep the rest of the structure to get the stripping behavior.\n\nAs you may know, because `if` statements in JavaScript don't have their own scope, the var\ndeclaration in the above snippet is made whether the `if` expression is truthy or not. If\nRequireJS is loaded then the declaration is superfluous because `define` is already already\ndeclared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`\ndeclarations of the same variable in the same scope gracefully.\n\nIf you want to deliver amdefine.js with your code rather than specifying it as a dependency\nwith npm, then just download the latest release and refer to it using a relative path:\n\n[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)\n\n### amdefine/intercept\n\nConsider this very experimental.\n\nInstead of pasting the piece of text for the amdefine setup of a `define`\nvariable in each module you create or consume, you can use `amdefine/intercept`\ninstead. It will automatically insert the above snippet in each .js file loaded\nby Node.\n\n**Warning**: you should only use this if you are creating an application that\nis consuming AMD style defined()'d modules that are distributed via npm and want\nto run that code in Node.\n\nFor library code where you are not sure if it will be used by others in Node or\nin the browser, then explicitly depending on amdefine and placing the code\nsnippet above is suggested path, instead of using `amdefine/intercept`. The\nintercept module affects all .js files loaded in the Node app, and it is\ninconsiderate to modify global state like that unless you are also controlling\nthe top level app.\n\n#### Why distribute AMD-style nodes via npm?\n\nnpm has a lot of weaknesses for front-end use (installed layout is not great,\nshould have better support for the `baseUrl + moduleID + '.js' style of loading,\nsingle file JS installs), but some people want a JS package manager and are\nwilling to live with those constraints. If that is you, but still want to author\nin AMD style modules to get dynamic require([]), better direct source usage and\npowerful loader plugin support in the browser, then this tool can help.\n\n#### amdefine/intercept usage\n\nJust require it in your top level app module (for example index.js, server.js):\n\n```javascript\nrequire('amdefine/intercept');\n```\n\nThe module does not return a value, so no need to assign the result to a local\nvariable.\n\nThen just require() code as you normally would with Node's require(). Any .js\nloaded after the intercept require will have the amdefine check injected in\nthe .js source as it is loaded. It does not modify the source on disk, just\nprepends some content to the text of the module as it is loaded by Node.\n\n#### How amdefine/intercept works\n\nIt overrides the `Module._extensions['.js']` in Node to automatically prepend\nthe amdefine snippet above. So, it will affect any .js file loaded by your\napp.\n\n## define() usage\n\nIt is best if you use the anonymous forms of define() in your module:\n\n```javascript\ndefine(function (require) {\n var dependency = require('dependency');\n});\n```\n\nor\n\n```javascript\ndefine(['dependency'], function (dependency) {\n\n});\n```\n\n## RequireJS optimizer integration. \n\nVersion 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)\nwill have support for stripping the `if (typeof define !== 'function')` check\nmentioned above, so you can include this snippet for code that runs in the\nbrowser, but avoid taking the cost of the if() statement once the code is\noptimized for deployment.\n\n## Node 0.4 Support\n\nIf you want to support Node 0.4, then add `require` as the second parameter to amdefine:\n\n```javascript\n//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.\nif (typeof define !== 'function') { var define = require('amdefine')(module, require) }\n```\n\n## Limitations\n\n### Synchronous vs Asynchronous\n\namdefine creates a define() function that is callable by your code. It will\nexecute and trace dependencies and call the factory function *synchronously*,\nto keep the behavior in line with Node's synchronous dependency tracing.\n\nThe exception: calling AMD's callback-style require() from inside a factory\nfunction. The require callback is called on process.nextTick():\n\n```javascript\ndefine(function (require) {\n require(['a'], function(a) {\n //'a' is loaded synchronously, but\n //this callback is called on process.nextTick().\n });\n});\n```\n\n### Loader Plugins\n\nLoader plugins are supported as long as they call their load() callbacks\nsynchronously. So ones that do network requests will not work. However plugins\nlike [text](http://requirejs.org/docs/api.html#text) can load text files locally.\n\nThe plugin API's `load.fromText()` is **not supported** in amdefine, so this means\ntranspiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)\nwill not work. This may be fixable, but it is a bit complex, and I do not have\nenough node-fu to figure it out yet. See the source for amdefine.js if you want\nto get an idea of the issues involved.\n\n## Tests\n\nTo run the tests, cd to **tests** and run:\n\n```\nnode all.js\nnode all-intercept.js\n```\n\n## License\n\nNew BSD and MIT. Check the LICENSE file for all the details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/jrburke/amdefine/issues" + }, + "_id": "amdefine@0.1.0", + "dist": { + "shasum": "3ca9735cf1dde0edf7a4bf6641709c8024f9b227", + "tarball": "http://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz" + }, + "_from": "amdefine@>=0.0.4", + "_npmVersion": "1.3.8", + "_npmUser": { + "name": "jrburke", + "email": "jrburke@gmail.com" + }, + "maintainers": [ + { + "name": "jrburke", + "email": "jrburke@gmail.com" + } + ], + "directories": {}, + "_shasum": "3ca9735cf1dde0edf7a4bf6641709c8024f9b227", + "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz" +} diff --git a/node_modules/handlebars/node_modules/source-map/package.json b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json similarity index 85% rename from node_modules/handlebars/node_modules/source-map/package.json rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json index 8d5b384..070587a 100644 --- a/node_modules/handlebars/node_modules/source-map/package.json +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json @@ -1,7 +1,7 @@ { "name": "source-map", "description": "Generates and consumes source maps", - "version": "0.1.43", + "version": "0.1.40", "homepage": "https://github.com/mozilla/source-map", "author": { "name": "Nick Fitzgerald", @@ -107,22 +107,6 @@ { "name": "Chris Montgomery", "email": "christopher.montgomery@dowjones.com" - }, - { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com" - }, - { - "name": "Jack Herrington", - "email": "jherrington@walmartlabs.com" - }, - { - "name": "Chris Truter", - "email": "jeffpalentine@gmail.com" - }, - { - "name": "Daniel Espeset", - "email": "daniel@danielespeset.com" } ], "repository": { @@ -155,9 +139,9 @@ "bugs": { "url": "https://github.com/mozilla/source-map/issues" }, - "_id": "source-map@0.1.43", - "_shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", - "_from": "source-map@^0.1.40", + "_id": "source-map@0.1.40", + "_shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", + "_from": "source-map@~0.1.7", "_npmVersion": "1.4.9", "_npmUser": { "name": "nickfitzgerald", @@ -178,9 +162,9 @@ } ], "dist": { - "shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", - "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" + "shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", + "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz" }, - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/handlebars/node_modules/source-map/test/run-tests.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/run-tests.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/run-tests.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/run-tests.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-api.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-api.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-array-set.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-array-set.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-base64-vlq.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-base64-vlq.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-base64.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-base64.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js similarity index 82% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-binary-search.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js index f1c9e0f..ee30683 100644 --- a/node_modules/handlebars/node_modules/source-map/test/source-map/test-binary-search.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js @@ -23,7 +23,7 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 20); + assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); }; exports['test too low'] = function (assert, util) { @@ -34,21 +34,21 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), -1); + assert.equal(binarySearch.search(needle, haystack, numberCompare), null); }; exports['test exact search'] = function (assert, util) { var needle = 4; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 4); + assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); }; exports['test fuzzy search'] = function (assert, util) { var needle = 19; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 18); + assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); }; }); diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-dog-fooding.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-dog-fooding.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js similarity index 77% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-source-map-consumer.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js index c714943..a4c6659 100644 --- a/node_modules/handlebars/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js @@ -252,25 +252,6 @@ define(function (require, exports, module) { }, Error); }; - exports['test that we can get the original source content with relative source paths'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMapRelativeSources); - var sources = map.sources; - - assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.throws(function () { - map.sourceContentFor(""); - }, Error); - assert.throws(function () { - map.sourceContentFor("/the/root/three.js"); - }, Error); - assert.throws(function () { - map.sourceContentFor("three.js"); - }, Error); - }; - exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', @@ -309,158 +290,6 @@ define(function (require, exports, module) { assert.equal(pos.column, 2); }; - exports['test allGeneratedPositionsFor'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bar.coffee' - }); - map.addMapping({ - original: { line: 2, column: 1 }, - generated: { line: 3, column: 2 }, - source: 'bar.coffee' - }); - map.addMapping({ - original: { line: 2, column: 2 }, - generated: { line: 3, column: 3 }, - source: 'bar.coffee' - }); - map.addMapping({ - original: { line: 3, column: 1 }, - generated: { line: 4, column: 2 }, - source: 'bar.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - var mappings = map.allGeneratedPositionsFor({ - line: 2, - source: 'bar.coffee' - }); - - assert.equal(mappings.length, 2); - assert.equal(mappings[0].line, 3); - assert.equal(mappings[0].column, 2); - assert.equal(mappings[1].line, 3); - assert.equal(mappings[1].column, 3); - }; - - exports['test allGeneratedPositionsFor for line with no mappings'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bar.coffee' - }); - map.addMapping({ - original: { line: 3, column: 1 }, - generated: { line: 4, column: 2 }, - source: 'bar.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - var mappings = map.allGeneratedPositionsFor({ - line: 2, - source: 'bar.coffee' - }); - - assert.equal(mappings.length, 0); - }; - - exports['test allGeneratedPositionsFor source map with no mappings'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated.js' - }); - map = new SourceMapConsumer(map.toString()); - - var mappings = map.allGeneratedPositionsFor({ - line: 2, - source: 'bar.coffee' - }); - - assert.equal(mappings.length, 0); - }; - - exports['test computeColumnSpans'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 1, column: 1 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 2, column: 1 }, - generated: { line: 2, column: 1 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 2, column: 2 }, - generated: { line: 2, column: 10 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 2, column: 3 }, - generated: { line: 2, column: 20 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 3, column: 1 }, - generated: { line: 3, column: 1 }, - source: 'foo.coffee' - }); - map.addMapping({ - original: { line: 3, column: 2 }, - generated: { line: 3, column: 2 }, - source: 'foo.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - map.computeColumnSpans(); - - var mappings = map.allGeneratedPositionsFor({ - line: 1, - source: 'foo.coffee' - }); - - assert.equal(mappings.length, 1); - assert.equal(mappings[0].lastColumn, Infinity); - - var mappings = map.allGeneratedPositionsFor({ - line: 2, - source: 'foo.coffee' - }); - - assert.equal(mappings.length, 3); - assert.equal(mappings[0].lastColumn, 9); - assert.equal(mappings[1].lastColumn, 19); - assert.equal(mappings[2].lastColumn, Infinity); - - var mappings = map.allGeneratedPositionsFor({ - line: 3, - source: 'foo.coffee' - }); - - assert.equal(mappings.length, 2); - assert.equal(mappings[0].lastColumn, 1); - assert.equal(mappings[1].lastColumn, Infinity); - }; - exports['test sourceRoot + originalPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js similarity index 97% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-source-map-generator.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js index d748bb1..a0d9d00 100644 --- a/node_modules/handlebars/node_modules/source-map/test/source-map/test-source-map-generator.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js @@ -98,27 +98,6 @@ define(function (require, exports, module) { }); }; - exports['test adding mappings with skipValidation'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.', - skipValidation: true - }); - - // Not enough info, caught by `util.getArgs` - assert.throws(function () { - map.addMapping({}); - }); - - // Original file position, but no source. Not checked. - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 } - }); - }); - }; - exports['test that the correct mappings are being generated'] = function (assert, util) { var map = new SourceMapGenerator({ file: 'min.js', diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-source-node.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-source-node.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/test-util.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js similarity index 100% rename from node_modules/handlebars/node_modules/source-map/test/source-map/test-util.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js diff --git a/node_modules/handlebars/node_modules/source-map/test/source-map/util.js b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js similarity index 93% rename from node_modules/handlebars/node_modules/source-map/test/source-map/util.js rename to node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js index 56bbe2c..fa213ce 100644 --- a/node_modules/handlebars/node_modules/source-map/test/source-map/util.js +++ b/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js @@ -71,22 +71,6 @@ define(function (require, exports, module) { sourceRoot: '/the/root', mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; - exports.testMapRelativeSources = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['./one.js', './two.js'], - sourcesContent: [ - ' ONE.foo = function (bar) {\n' + - ' return baz(bar);\n' + - ' };', - ' TWO.inc = function (n) {\n' + - ' return n + 1;\n' + - ' };' - ], - sourceRoot: '/the/root', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; exports.emptyMap = { version: 3, file: 'min.js', diff --git a/node_modules/handlebars/package.json b/node_modules/handlebars/package.json index 99a179f..b3fe835 100644 --- a/node_modules/handlebars/package.json +++ b/node_modules/handlebars/package.json @@ -1,7 +1,7 @@ { "name": "handlebars", "barename": "handlebars", - "version": "3.0.3", + "version": "2.0.0", "description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration", "homepage": "http://www.handlebarsjs.com/", "keywords": [ @@ -22,41 +22,37 @@ "node": ">=0.4.7" }, "dependencies": { - "optimist": "^0.6.1", - "source-map": "^0.1.40", + "optimist": "~0.3", "uglify-js": "~2.3" }, "optionalDependencies": { "uglify-js": "~2.3" }, "devDependencies": { - "async": "^0.9.0", + "async": "~0.2.9", "aws-sdk": "~1.5.0", - "babel-loader": "^5.0.0", - "babel-runtime": "^5.1.10", "benchmark": "~1.0", - "dustjs-linkedin": "^2.0.2", + "dustjs-linkedin": "~2.0.2", "eco": "~1.1.0-rc-3", + "es6-module-packager": "1.x", "grunt": "~0.4.1", - "grunt-babel": "^5.0.0", "grunt-cli": "~0.1.10", - "grunt-contrib-clean": "0.x", - "grunt-contrib-concat": "0.x", - "grunt-contrib-connect": "0.x", - "grunt-contrib-copy": "0.x", - "grunt-contrib-requirejs": "0.x", - "grunt-contrib-uglify": "0.x", - "grunt-contrib-watch": "0.x", - "grunt-eslint": "^11.0.0", + "grunt-contrib-clean": "~0.4.1", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-connect": "~0.5.0", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-jshint": "0.x", + "grunt-contrib-requirejs": "~0.4.1", + "grunt-contrib-uglify": "~0.2.2", + "grunt-contrib-watch": "~0.5.3", "grunt-saucelabs": "8.x", - "grunt-webpack": "^1.0.8", "istanbul": "^0.3.0", "jison": "~0.3.0", "keen.io": "0.0.3", "mocha": "~1.20.0", - "mustache": "0.x", - "semver": "^4.0.0", - "underscore": "^1.5.1" + "mustache": "~0.7.2", + "semver": "~2.1.0", + "underscore": "~1.5.1" }, "main": "lib/index.js", "bin": { @@ -65,23 +61,14 @@ "scripts": { "test": "grunt" }, - "jspm": { - "main": "handlebars", - "directories": { - "lib": "dist/amd" - }, - "buildConfig": { - "minify": true - } - }, - "gitHead": "891f48b7e9c321dd9cbe7a898533eb6b2434b8a0", + "gitHead": "1eb2b04aa1468059172af16968e28ba3a9c07e6d", "bugs": { "url": "https://github.com/wycats/handlebars.js/issues" }, - "_id": "handlebars@3.0.3", - "_shasum": "0e09651a2f0fb3c949160583710d551f92e6d2ad", + "_id": "handlebars@2.0.0", + "_shasum": "6e9d7f8514a3467fa5e9f82cc158ecfc1d5ac76f", "_from": "handlebars@", - "_npmVersion": "1.4.28", + "_npmVersion": "1.4.21", "_npmUser": { "name": "kpdecker", "email": "kpdecker@gmail.com" @@ -93,10 +80,10 @@ } ], "dist": { - "shasum": "0e09651a2f0fb3c949160583710d551f92e6d2ad", - "tarball": "http://registry.npmjs.org/handlebars/-/handlebars-3.0.3.tgz" + "shasum": "6e9d7f8514a3467fa5e9f82cc158ecfc1d5ac76f", + "tarball": "http://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/handlebars/-/handlebars-3.0.3.tgz", + "_resolved": "https://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/handlebars/print-script b/node_modules/handlebars/print-script index 0e9c995..b8f09c4 100755 --- a/node_modules/handlebars/print-script +++ b/node_modules/handlebars/print-script @@ -1,92 +1,3 @@ -#! /usr/bin/env node +#! /bin/sh -var script = process.argv[2].replace(/\\n/g, '\n') - -// node -e "console.log('var foo = ', " -var Handlebars = require('./lib'), - SourceMap = require('source-map'), - SourceMapConsumer = SourceMap.SourceMapConsumer; - -var template = Handlebars.precompile(script, { - srcName: 'input.hbs', - destName: 'output.js', - - assumeObjects: true, - compat: false, - strict: true, - trackIds: true, - knownHelpersOnly: false - }); - -// return console.log(template); - -var consumer = new SourceMapConsumer(template.map), - lines = template.code.split('\n'), - srcLines = script.split('\n'); - -console.log(); -console.log('Source:'); -srcLines.forEach(function(source, index) { - console.log(index+1, source); -}); -console.log(); -console.log('Generated:'); -console.log(template.code); -lines.forEach(function(source, index) { - // console.log(index+1, source); -}); -console.log(); -console.log('Map:'); -console.log(template.map); -console.log(); - -function collectSource(lines, lineName, colName, order) { - var ret = {}, - ordered = [], - last; - - // TODO : Find the content that does not have a source mapping - function collect(current) { - if (last) { - var mapLines = lines.slice(last[lineName] - 1, current && current[lineName]); - if (mapLines.length) { - if (current) { - mapLines[mapLines.length-1] = mapLines[mapLines.length-1].slice(0, current[colName]); - } - mapLines[0] = mapLines[0].slice(last[colName]); - } - ret[last[lineName] + ':' + last[colName]] = mapLines.join('\n'); - ordered.push({ - startLine: last[lineName], - startCol: last[colName], - endLine: current && current[lineName] - }); - } - last = current; - } - - consumer.eachMapping(collect, undefined, order); - collect(); - - return ret; -} - -srcLines = collectSource(srcLines, 'originalLine', 'originalColumn', SourceMapConsumer.ORIGINAL_ORDER); -lines = collectSource(lines, 'generatedLine', 'generatedColumn'); - -false && consumer.eachMapping(function(mapping) { - var originalSrc = srcLines[mapping.originalLine + ':' + mapping.originalColumn], - generatedSrc = lines[mapping.generatedLine + ':' + mapping.generatedColumn]; - - if (!mapping.originalLine) { - console.log('generated', mapping.generatedLine + ':' + mapping.generatedColumn, generatedSrc); - } else { - console.log('map', - mapping.source, - mapping.originalLine + ':' + mapping.originalColumn, - originalSrc, - '->', - mapping.generatedLine + ':' + mapping.generatedColumn, - generatedSrc); - } -}); +node -e "console.log(require('./lib').precompile('$1', {compat: false, trackIds: true, knownHelpersOnly: true}))" diff --git a/node_modules/handlebars/release-notes.md b/node_modules/handlebars/release-notes.md index 21a5346..8d9b233 100644 --- a/node_modules/handlebars/release-notes.md +++ b/node_modules/handlebars/release-notes.md @@ -2,82 +2,7 @@ ## Development -[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.3...master) - -## v3.0.3 - April 28th, 2015 -- [#1004](https://github.com/wycats/handlebars.js/issues/1004) - Latest version breaks with RequireJS (global is undefined) ([@boskee](https://api.github.com/users/boskee)) - -[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.2...v3.0.3) - -## v3.0.2 - April 20th, 2015 -- [#998](https://github.com/wycats/handlebars.js/pull/998) - Add full support for es6 ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#994](https://github.com/wycats/handlebars.js/issues/994) - Access Handlebars.Visitor in browser ([@tamlyn](https://api.github.com/users/tamlyn)) -- [#990](https://github.com/wycats/handlebars.js/issues/990) - Allow passing null/undefined literals subexpressions ([@blimmer](https://api.github.com/users/blimmer)) -- [#989](https://github.com/wycats/handlebars.js/issues/989) - Source-map error with requirejs ([@SteppeEagle](https://api.github.com/users/SteppeEagle)) -- [#967](https://github.com/wycats/handlebars.js/issues/967) - can't access "this" property ([@75lb](https://api.github.com/users/75lb)) -- Use captureStackTrace for error handler - a009a97 -- Ignore branches tested without coverage monitoring - 37a664b - -[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.1...v3.0.2) - -## v3.0.1 - March 24th, 2015 -- [#984](https://github.com/wycats/handlebars.js/pull/984) - Adding documentation for passing arguments into partials ([@johneke](https://api.github.com/users/johneke)) -- [#973](https://github.com/wycats/handlebars.js/issues/973) - version 3 is slower than version 2 ([@elover](https://api.github.com/users/elover)) -- [#966](https://github.com/wycats/handlebars.js/issues/966) - "handlebars --version" does not work with v3.0.0 ([@abloomston](https://api.github.com/users/abloomston)) -- [#964](https://github.com/wycats/handlebars.js/pull/964) - default is a reserved word ([@grassick](https://api.github.com/users/grassick)) -- [#962](https://github.com/wycats/handlebars.js/pull/962) - Add dashbars' link on README. ([@pismute](https://api.github.com/users/pismute)) - -[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.0...v3.0.1) - -## v3.0.0 - February 10th, 2015 -- [#941](https://github.com/wycats/handlebars.js/pull/941) - Add support for dynamic partial names ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#940](https://github.com/wycats/handlebars.js/pull/940) - Add missing reserved words so compiler knows to use array syntax: ([@mattflaschen](https://api.github.com/users/mattflaschen)) -- [#938](https://github.com/wycats/handlebars.js/pull/938) - Fix example using #with helper ([@diwo](https://api.github.com/users/diwo)) -- [#930](https://github.com/wycats/handlebars.js/pull/930) - Add parent tracking and mutation to AST visitors ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#926](https://github.com/wycats/handlebars.js/issues/926) - Depthed lookups fail when program duplicator runs ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#918](https://github.com/wycats/handlebars.js/pull/918) - Add instructions for 'spec/mustache' to CONTRIBUTING.md, fix a few typos ([@oneeman](https://api.github.com/users/oneeman)) -- [#915](https://github.com/wycats/handlebars.js/pull/915) - Ast update ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#910](https://github.com/wycats/handlebars.js/issues/910) - Different behavior of {{@last}} when {{#each}} in {{#each}} ([@zordius](https://api.github.com/users/zordius)) -- [#907](https://github.com/wycats/handlebars.js/issues/907) - Implement named helper variable references ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#906](https://github.com/wycats/handlebars.js/pull/906) - Add parser support for block params ([@mmun](https://api.github.com/users/mmun)) -- [#903](https://github.com/wycats/handlebars.js/issues/903) - Only provide aliases for multiple use calls ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#902](https://github.com/wycats/handlebars.js/pull/902) - Generate Source Maps ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#901](https://github.com/wycats/handlebars.js/issues/901) - Still escapes with noEscape enabled on isolated Handlebars environment ([@zedknight](https://api.github.com/users/zedknight)) -- [#896](https://github.com/wycats/handlebars.js/pull/896) - Simplify BlockNode by removing intermediate MustacheNode ([@mmun](https://api.github.com/users/mmun)) -- [#892](https://github.com/wycats/handlebars.js/pull/892) - Implement parser for else chaining of helpers ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#889](https://github.com/wycats/handlebars.js/issues/889) - Consider extensible parser API ([@kpdecker](https://api.github.com/users/kpdecker)) -- [#887](https://github.com/wycats/handlebars.js/issues/887) - Handlebars.noConflict() option? ([@bradvogel](https://api.github.com/users/bradvogel)) -- [#886](https://github.com/wycats/handlebars.js/issues/886) - Add SafeString to context (or use duck-typing) ([@dominicbarnes](https://api.github.com/users/dominicbarnes)) -- [#870](https://github.com/wycats/handlebars.js/pull/870) - Registering undefined partial throws exception. ([@max-b](https://api.github.com/users/max-b)) -- [#866](https://github.com/wycats/handlebars.js/issues/866) - comments don't respect whitespace control ([@75lb](https://api.github.com/users/75lb)) -- [#863](https://github.com/wycats/handlebars.js/pull/863) - + jsDelivr CDN info ([@tomByrer](https://api.github.com/users/tomByrer)) -- [#858](https://github.com/wycats/handlebars.js/issues/858) - Disable new default auto-indent at included partials ([@majodev](https://api.github.com/users/majodev)) -- [#856](https://github.com/wycats/handlebars.js/pull/856) - jspm compatibility ([@MajorBreakfast](https://api.github.com/users/MajorBreakfast)) -- [#805](https://github.com/wycats/handlebars.js/issues/805) - Request: "strict" lookups ([@nzakas](https://api.github.com/users/nzakas)) - -- Export the default object for handlebars/runtime - 5594416 -- Lookup partials when undefined - 617dd57 - -Compatibility notes: -- Runtime breaking changes. Must match 3.x runtime and precompiler. -- The AST has been upgraded to a public API. - - There are a number of changes to this, but the format is now documented in docs/compiler-api.md - - The Visitor API has been expanded to support mutation and provide a base implementation -- The `JavaScriptCompiler` APIs have been formalized and documented. As part of the sourcemap handling these should be updated to return arrays for concatenation. -- `JavaScriptCompiler.namespace` has been removed as it was unused. -- `SafeString` is now duck typed on `toHTML` - -New Features: -- noConflict -- Source Maps -- Block Params -- Strict Mode -- @last and other each changes -- Chained else blocks -- @data methods can now have helper parameters passed to them -- Dynamic partials - -[Commits](https://github.com/wycats/handlebars.js/compare/v2.0.0...v3.0.0) +[Commits](https://github.com/wycats/handlebars.js/compare/v2.0.0...master) ## v2.0.0 - September 1st, 2014 - Update jsfiddle to 2.0.0-beta.1 - 0670f65 diff --git a/node_modules/handlebars/runtime.js b/node_modules/handlebars/runtime.js index 306207c..b7a7b12 100644 --- a/node_modules/handlebars/runtime.js +++ b/node_modules/handlebars/runtime.js @@ -1,3 +1,3 @@ // Create a simple path alias to allow browserify to resolve // the runtime on a supported path. -module.exports = require('./dist/cjs/handlebars.runtime')['default']; +module.exports = require('./dist/cjs/handlebars.runtime'); diff --git a/node_modules/node-notifier/.npmignore b/node_modules/node-notifier/.npmignore new file mode 100644 index 0000000..7c3d6fa --- /dev/null +++ b/node_modules/node-notifier/.npmignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log + +.DS_Store \ No newline at end of file diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/.travis.yml b/node_modules/node-notifier/.travis.yml similarity index 77% rename from node_modules/handlebars/node_modules/optimist/node_modules/minimist/.travis.yml rename to node_modules/node-notifier/.travis.yml index cc4dba2..18ae2d8 100644 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/.travis.yml +++ b/node_modules/node-notifier/.travis.yml @@ -1,4 +1,4 @@ language: node_js node_js: - - "0.8" + - "0.11" - "0.10" diff --git a/node_modules/node-notifier/CHANGELOG.md b/node_modules/node-notifier/CHANGELOG.md new file mode 100644 index 0000000..ca1c3cb --- /dev/null +++ b/node_modules/node-notifier/CHANGELOG.md @@ -0,0 +1,78 @@ +Changelog +=== + +### `v4.0.2` +1. Fixes issue with immidiate notifu notifications (with `wait : false`) +2. Fixes issue with boolean flags for notifu. +3. Restructures directories. Making it easier to require notifiers directly. + +### `v4.0.1` +1. Fixes issue with optional callback for notify-send + +### `v4.0.0` +Major changes and breaking API. +1. require('node-notifier') now returns an instance with fallbackable notifications. +```js +var notifier = require('node-notifier'); +notifier.notify(); +``` +2. Introduced a `wait` property (default `false`), to get user input for +Notification Center, Windows Toaster, Windows Balloons and Growl. Sadly not +for notify-send. +```js +var notifier = require('node-notifier'); +notifier.notify({ wait: true }, function (err, response) { + // response is response after user have interacted + // with the notification or the notification has timed out. +}); +``` +3. All notification instances are now event emitters, emitting events +`click` or `timeout`. This is only applicable if `{ wait: true }`. +```js +var notifier = require('node-notifier'); +notifier.on('click', function (notificationObject, options) { + // options.someArbitraryData === 'foo' +}); +notifier.notify({ wait: true, someArbitraryData: 'foo' }); +``` +4. WindowsToaster and NotificationCenter now can have sounds by doing `{ sound: true }`. +Default NotificationCenter sound is Bottle. Can still use define sound on +Mac: +```js +var notifier = require('node-notifier'); +notifier.notify({ sound: true }); +// For mac (same as sound: true on Windows 8) +notifier.notify({ sound: 'Morse' }); +``` + +### `v3.4.0` +1. Adds Growl as priority over Balloons + +### `v3.3.0` +1. Adds support for native Windows 7 and earlier (through task bar balloons) +2. Changes growl implementation. Adds better support for GNTP + +### `v3.2.1` +1. Fixes support for notifications from folders with spaces on Windows. + +### `v3.2.0` +1. Adds native Windows 8 support. + +### `v3.1.0` +1. Adds Growl as fallback for Mac OS X pre 10.8. + +### `v3.0.6` +1. Fixes typo: Changes Growl app name from `Gulp` to `Node`. + +### `v3.0.5` +1. Maps common options between the different notifiers. Allowing for common usage with different notifiers. + +### `v3.0.4` +1. Fixes expires for notify-send (Issue #13) + +### `v3.0.2` +1. Fixes version check for Mac OS X Yosemite + +### `v3.0.0` +1. Updates terminal-notifier to version 1.6.0; adding support for appIcon and contentImage +2. Removes parsing of output sent from notifier (Notification Center) diff --git a/node_modules/node-notifier/DECISION_FLOW.md b/node_modules/node-notifier/DECISION_FLOW.md new file mode 100644 index 0000000..f4c15a8 --- /dev/null +++ b/node_modules/node-notifier/DECISION_FLOW.md @@ -0,0 +1,18 @@ +# What reporting system is used? + +There are 5 different reporting systems: + +* Mac Notification Center +* Linux notify-osd +* Windows Toaster +* Windows Balloons +* Growl + +`node-notifier` tries to use the system that has the better +experience but prefers native solutions. This means that +Growl is prioritized over Windows Balloons (if Growl is +active). + +See flow chart to see how the reporter is chosen. + +![Flow Chart](./node-notifier_flow.png) \ No newline at end of file diff --git a/node_modules/node-notifier/DEPRECATED.md b/node_modules/node-notifier/DEPRECATED.md new file mode 100644 index 0000000..ee0cdfc --- /dev/null +++ b/node_modules/node-notifier/DEPRECATED.md @@ -0,0 +1,39 @@ + + +## Output parsing from Notification Center in Mac OS X + +The response will be given as an object. E.g., when running ```notifier.notify({list: "ALL"})```, this could be the response: +**Note: Deprecated as of version `3.0.0`.** + +``` +{ response: + [ { GroupID: null, + Title: 'Terminal', + Subtitle: null, + Message: 'Another message', + 'Delivered At': Wed Dec 12 2012 15:23:38 GMT+0100 (CET) }, + { GroupID: null, + Title: 'Terminal', + Subtitle: null, + Message: 'Another message', + 'Delivered At': Wed Dec 12 2012 15:23:31 GMT+0100 (CET) }, + { GroupID: 2, + Title: 'Terminal', + Subtitle: null, + Message: 'Testing', + 'Delivered At': Wed Dec 12 2012 15:22:41 GMT+0100 (CET) }, + { GroupID: 1, + Title: 'Terminal', + Subtitle: null, + Message: 'Testing', + 'Delivered At': Wed Dec 12 2012 15:22:29 GMT+0100 (CET) } ], + type: 'list' } + +``` + +There are three different types: + +- ```deliviered``` when a message is delivered. +- ```removed``` when all or one message is removed. If all messages are removed, the response property will have several elements. +- ```list``` when a list is presented. Even when doing ```list: 1```. + diff --git a/node_modules/node-notifier/README.md b/node_modules/node-notifier/README.md new file mode 100644 index 0000000..f249738 --- /dev/null +++ b/node_modules/node-notifier/README.md @@ -0,0 +1,293 @@ +# node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] + +A Node.js module for sending cross platform system notification. Using +Notification Center for Mac, notify-osd for Linux, Toasters for +Windows 8, or lovely taskbar Balloons for earlier Windows versions. If none of +these requirements are met, be it older version of Windows or OS X, +Growl is used. + +![Mac Screenshot](https://github.com/mikaelbr/node-notifier/blob/master/example/mac.png) +![Native Windows Screenshot](https://github.com/mikaelbr/node-notifier/blob/master/example/windows.png) +![Growl Screenshot](https://github.com/mikaelbr/node-notifier/blob/master/example/growl.png) + +## Easy Usage + +Show native notifications on Mac, Windows, Linux or using Growl! + +```javascript +var notifier = require('node-notifier'); +notifier.notify({ + 'title': 'My notification', + 'message': 'Hello, there!' +}); +``` + +## Requirements +- **Mac OS X**: >= 10.8 or Growl if earlier. +- **Linux**: notify-osd installed (Ubuntu should have this by default) +- **Windows**: >= 8, task bar balloon if earlier or Growl if that is installed. +- **General Fallback**: Growl + +Growl takes precedence over Windows balloons. + +See [documentation and flow chart for reporter choice](./DECISION_FLOW.md) + +## Install +``` +$ npm install --save node-notifier +``` + +## Cross-Platform Advanced Usage + +Standard usage, with cross-platform fallbacks as defined in the +[reporter flow chart](./DECISION_FLOW.md). All of the options +below will work in a way or another on all platforms. + +```javascript +var notifier = require('node-notifier'); +notifier.notify({ + title: 'My awesome title', + message: 'Hello from node, Mr. User!', + icon: path.join(__dirname, 'coulson.jpg'), // absolute path (not balloons) + sound: true, // Only Notification Center or Windows Toasters + wait: true // wait with callback until user action is taken on notification +}, function (err, response) { + // response is response from notification +}); + +notifier.on('click', function (notifierObject, options) { + // Happens if `wait: true` and user clicks notification +}); + +notifier.on('timeout', function (notifierObject, options) { + // Happens if `wait: true` and notification closes +}); +``` + +You can also specify what reporter you want to use if you +want to customize it or have more specific options per system. +See documentation for each reporter below. + +Example: +```javascript +var NotificationCenter = require('node-notifier/notifiers/notificationcenter'); +new NotificationCenter(options).notify(); + +var NotifySend = require('node-notifier/notifiers/notifysend'); +new NotifySend(options).notify(); + +var WindowsToaster = require('node-notifier/notifiers/toaster'); +new WindowsToaster(options).notify(); + +var Growl = require('node-notifier/notifiers/growl'); +new Growl(options).notify(); + +var WindowsBalloon = require('node-notifier/notifiers/balloon'); +new WindowsBalloon(options).notify(); + +``` + + +Or if you are using several (or you are lazy): +(note: technically, this takes longer to require) + +```javascript +var nn = require('node-notifier'); + +new nn.NotificationCenter(options).notify(); +new nn.NotifySend(options).notify(); +new nn.WindowsToaster(options).notify(options); +new nn.WindowsBalloon(options).notify(options); +new nn.Growl(options).notify(options); +``` + + +## Documentation + +* [Notification Center documentation](#usage-notificationcenter) +* [Windows Toaster documentation](#usage-windowstoaster) +* [Windows Balloon documentation](#usage-windowsballoon) +* [Growl documentation](#usage-growl) +* [Notify-send documentation](#usage-notifysend) + + +### Usage NotificationCenter + +Same usage and parameter setup as [terminal-notifier](https://github.com/alloy/terminal-notifier). + +Native Notification Center requires Mac OS X version 10.8 or higher. If you have +earlier versions, Growl will be the fallback. If Growl isn't installed, an error +will be returned in the callback. + + +#### Example + +It is a wrapper around [terminal-notifier](https://github.com/alloy/terminal-notifier), and you can +do all terminal-notifier can do through properties to the `notify` method. E.g. +if `terminal-notifier` say `-message`, you can do `{message: 'Foo'}`, or +if `terminal-notifier` say `-list ALL` you can do `{list: 'ALL'}`. Notification +is the primary focus for this module, so listing and activating do work, +but isn't documented. + +### All notification options with their defaults: + +```javascript +var NotificationCenter = require('node-notifier').NotificationCenter; + +var notifier = new Notification({ + withFallback: false, // use Growl if <= 10.8? + customPath: void 0 // Relative path if you want to use your fork of terminal-notifier +}); + +notifier.notify({ + 'title': void 0, + 'subtitle': void 0, + 'message': void 0, + 'sound': false, // Case Sensitive string of sound file (see below) + 'icon': 'Terminal Icon', // Set icon? (Absolute path to image) + 'contentImage': void 0, // Attach image? (Absolute path) + 'open': void 0, // URL to open on click + 'wait': false // if wait for notification to end +}, function(error, response) { + console.log(response); +}); +``` + +**For Mac OS notifications, icon and contentImage requires OS X 10.9.** + +Sound can be one of these: `Basso`, `Blow`, `Bottle`, `Frog`, `Funk`, `Glass`, +`Hero`, `Morse`, `Ping`, `Pop`, `Purr`, `Sosumi`, `Submarine`, `Tink`. If +sound is simply `true`, `Bottle` is used. + +See [specific Notification Center example](./example/advanced.js). + +### Usage WindowsToaster + +**Note:** There are some limitations for images in native Windows 8 notifications: +The image must be a PNG image, and cannot be over 1024x1024 px, or over over 200Kb. +You also need to specify the image by using absolute path. These limitations are +due to the Toast notification system. A good tip is to use something like +`path.join` or `path.delimiter` to have cross-platform pathing. + +[toaster](https://github.com/nels-o/toaster) is used to get native Windows Toasts! + +```javascript +var WindowsToaster = require('node-notifier').WindowsToaster; + +var notifier = new WindowsToaster({ + withFallback: false, // Fallback to Growl or Balloons? + customPath: void 0 // Relative path if you want to use your fork of toast.exe +}); + +notifier.notify({ + title: void 0, + message: void 0, + icon: void 0, // absolute path to an icon + sound: false, // true | false. + wait: false, // if wait for notification to end +}, function(error, response) { + console.log(response); +}); +``` + +### Usage Growl + +```javascript +var Growl = require('node-notifier').Growl; + +var notifier = new Growl({ + name: 'Growl Name Used' // Defaults as 'Node' +}); + +notifier.notify({ + title: 'Foo', + message: 'Hello World', + icon: fs.readFileSync(__dirname + "/coulson.jpg"), + wait: false, // if wait for user interaction + + // and other growl options like sticky etc. + sticky: false, + label: void 0, + priority: void 0 +}); +``` + +See more information about using +[growly](https://github.com/theabraham/growly/). + +### Usage WindowsBalloon + +For earlier Windows versions, the taskbar balloons are used (unless +fallback is activated and Growl is running). For balloons a great +project called [notifu](http://www.paralint.com/projects/notifu/) is used. + +```javascript +var WindowsBalloon = require('node-notifier').WindowsBalloon; + +var notifier = new WindowsBalloon({ + withFallback: false, // Try Windows 8 and Growl first? + customPath: void 0 // Relative path if you want to use your fork of notifu +}); + +notifier.notify({ + title: void 0, + message: void 0, + sound: false, // true | false. + time: 5000, // How long to show balloons in ms + wait: false, // if wait for notification to end +}, function(error, response) { + console.log(response); +}); +``` + +See full usage on the [project homepage: +notifu](http://www.paralint.com/projects/notifu/). + +### Usage NotifySend + +Note: notify-send doesn't support the wait flag. + +```javascript +var NotifySend = require('node-notifier').NotifySend; + +var notifier = new NotifySend(); + +notifier.notify({ + title: 'Foo', + message: 'Hello World', + icon: __dirname + "/coulson.jpg", + + // .. and other notify-send flags: + urgency: void 0, + time: void 0, + category: void 0, + hint: void 0, +}); +``` + +See flags and options [on the man pages](http://manpages.ubuntu.com/manpages/gutsy/man1/notify-send.1.html) + + +## Thanks to OSS + +A very special thanks to all the modules `node-notifier` uses. +* [terminal-notifier](https://github.com/alloy/terminal-notifier) +* [toaster](https://github.com/nels-o/toaster) +* [notifu](http://www.paralint.com/projects/notifu/) +* [growly](https://github.com/theabraham/growly/) + +[![NPM downloads][npm-downloads]][npm-url] + +## License + +[MIT License](http://en.wikipedia.org/wiki/MIT_License) + +[npm-url]: https://npmjs.org/package/node-notifier +[npm-image]: http://img.shields.io/npm/v/node-notifier.svg?style=flat +[npm-downloads]: http://img.shields.io/npm/dm/node-notifier.svg?style=flat + +[travis-url]: http://travis-ci.org/mikaelbr/node-notifier +[travis-image]: http://img.shields.io/travis/mikaelbr/node-notifier.svg?style=flat + +[depstat-url]: https://gemnasium.com/mikaelbr/node-notifier +[depstat-image]: http://img.shields.io/gemnasium/mikaelbr/node-notifier.svg?style=flat diff --git a/node_modules/node-notifier/example/advanced.js b/node_modules/node-notifier/example/advanced.js new file mode 100644 index 0000000..b0aa367 --- /dev/null +++ b/node_modules/node-notifier/example/advanced.js @@ -0,0 +1,12 @@ +var notifier = require('../'); +var nc = new notifier.NotificationCenter(); + +nc.notify({ + 'title': 'Phil Coulson', + 'subtitle': 'Agent of S.H.I.E.L.D.', + 'message': 'If I come out, will you shoot me? \'Cause then I won\'t come out.', + 'sound': 'Funk', // case sensitive + 'appIcon': __dirname + '/coulson.jpg', + 'contentImage': __dirname + '/coulson.jpg', + 'open': 'file://' + __dirname + '/coulson.jpg' +}); diff --git a/node_modules/node-notifier/example/coulson.jpg b/node_modules/node-notifier/example/coulson.jpg new file mode 100644 index 0000000..505ee19 Binary files /dev/null and b/node_modules/node-notifier/example/coulson.jpg differ diff --git a/node_modules/node-notifier/example/growl.png b/node_modules/node-notifier/example/growl.png new file mode 100644 index 0000000..c280e54 Binary files /dev/null and b/node_modules/node-notifier/example/growl.png differ diff --git a/node_modules/node-notifier/example/mac.png b/node_modules/node-notifier/example/mac.png new file mode 100644 index 0000000..cad71d5 Binary files /dev/null and b/node_modules/node-notifier/example/mac.png differ diff --git a/node_modules/node-notifier/example/message.js b/node_modules/node-notifier/example/message.js new file mode 100644 index 0000000..c51e5a5 --- /dev/null +++ b/node_modules/node-notifier/example/message.js @@ -0,0 +1,14 @@ +var notifier = require('../index'); + +notifier + .notify({ + 'message': 'Hello', + 'wait': true + }, function (err, data) { + // Will also wait until notification is closed. + console.log('Waited'); + console.log(err, data); + }) + .on('click', function () { + console.log(arguments); + }); diff --git a/node_modules/node-notifier/example/windows.png b/node_modules/node-notifier/example/windows.png new file mode 100644 index 0000000..aa7c9b4 Binary files /dev/null and b/node_modules/node-notifier/example/windows.png differ diff --git a/node_modules/node-notifier/index.js b/node_modules/node-notifier/index.js new file mode 100644 index 0000000..2967185 --- /dev/null +++ b/node_modules/node-notifier/index.js @@ -0,0 +1,41 @@ +var os = require('os'); +var utils = require('./lib/utils'); + +// All notifiers +var NotifySend = require('./notifiers/notifysend'); +var NotificationCenter = require('./notifiers/notificationcenter'); +var WindowsToaster = require('./notifiers/toaster'); +var Growl = require('./notifiers/growl'); +var WindowsBalloon = require('./notifiers/balloon'); + +var options = { withFallback: true }; + +switch(os.type()) { + case 'Linux': + module.exports = new NotifySend(options); + module.exports.Notification = NotifySend; + break; + case 'Darwin': + module.exports = new NotificationCenter(options); + module.exports.Notification = NotificationCenter; + break; + case 'Windows_NT': + if (utils.isLessThanWin8()) { + module.exports = new WindowsBalloon(options); + module.exports.Notification = WindowsBalloon; + } else { + module.exports = new WindowsToaster(options); + module.exports.Notification = WindowsToaster; + } + break; + default: + module.exports = new Growl(options); + module.exports.Notification = Growl; +} + +// Expose notifiers to give full control. +module.exports.NotifySend = NotifySend; +module.exports.NotificationCenter = NotificationCenter; +module.exports.WindowsToaster = WindowsToaster; +module.exports.WindowsBalloon = WindowsBalloon; +module.exports.Growl = Growl; diff --git a/node_modules/node-notifier/lib/checkGrowl.js b/node_modules/node-notifier/lib/checkGrowl.js new file mode 100644 index 0000000..4a69382 --- /dev/null +++ b/node_modules/node-notifier/lib/checkGrowl.js @@ -0,0 +1,20 @@ +var net = require('net'); + +var hasGrowl = false; +var port = 23053; + +module.exports = function (cb) { + if (hasGrowl) return cb(hasGrowl); + var socket = net.connect(port); + socket.setTimeout(100); + + socket.on('connect', function() { + socket.end(); + cb(true); + }); + + socket.on('error', function() { + socket.end(); + cb(false); + }); +}; diff --git a/node_modules/node-notifier/lib/utils.js b/node_modules/node-notifier/lib/utils.js new file mode 100644 index 0000000..126d459 --- /dev/null +++ b/node_modules/node-notifier/lib/utils.js @@ -0,0 +1,315 @@ +var cp = require('child_process'), + os = require('os'), + fs = require('fs'), + path = require('path'), + shellwords = require('shellwords'), + semver = require('semver'), + clone = require('clone'); + + +var escapeQuotes = function (str) { + if (typeof str === 'string') { + return str.replace(/(["$`\\])/g, '\\$1'); + } else { + return str; + } +}; + +var inArray = function (arr, val) { + for(var i = 0; i < arr.length; i++) { + if (arr[i] === val) { + return true; + } + } + return false; +}; + +var notifySendFlags = { + "u": "urgency", + "urgency": "urgency", + "t": "expire-time", + "e": "expire-time", + "expire": "expire-time", + "expire-time": "expire-time", + "i": "icon", + "icon": "icon", + "c": "category", + "category": "category", + "h": "hint", + "hint": "hint" +}; + +module.exports.command = function (notifier, options, cb) { + var notifier = shellwords.escape(notifier); + return cp.exec(notifier + ' ' + options.join(' '), function (error, stdout, stderr) { + if (error) return cb(error); + cb(stderr, stdout); + }); +}; + +module.exports.fileCommand = function (notifier, options, cb) { + return cp.execFile(notifier, options, function (error, stdout, stderr) { + if (error) return cb(error, stdout); + cb(stderr, stdout); + }); +}; + +module.exports.immediateFileCommand = function (notifier, options, cb) { + notifierExists(notifier, function (exists) { + if (!exists) return cb(new Error('Notifier (' + notifier + ') not found on system.')); + cp.execFile(notifier, options); + cb(); + }); +}; + +function notifierExists (notifier, cb) { + return fs.stat(notifier, function (err, stat) { + if (!err) return cb(stat.isFile()); + + // Check if Windows alias + if (!!path.extname(notifier)) { + // Has extentioon, no need to check more + return cb(false); + } + + // Check if there is an exe file in the directory + return fs.stat(notifier + '.exe', function (err, stat) { + cb(stat.isFile()); + }); + }); +} + +var mapAppIcon = function (options) { + if (options.appIcon) { + options.icon = options.appIcon; + delete options.appIcon; + } + + return options; +}; + +var mapText = function (options) { + if (options.text) { + options.message = options.text; + delete options.text; + } + + return options; +}; + +var mapIconShorthand = function (options) { + if (options.i) { + options.icon = options.i; + delete options.i; + } + + return options; +}; + +module.exports.mapToNotifySend = function (options) { + options = mapAppIcon(options); + options = mapText(options); + + for (var key in options) { + if (key === "message" || key === "title") continue; + if (options.hasOwnProperty(key) && (notifySendFlags[key] != key)) { + options[notifySendFlags[key]] = options[key]; + delete options[key]; + } + } + + return options; +}; + +module.exports.mapToGrowl = function (options) { + options = mapAppIcon(options); + options = mapIconShorthand(options); + + if (options.text) { + options.message = options.text; + delete options.text; + } + + if (options.icon && !Buffer.isBuffer(options.icon)) { + options.icon = fs.readFileSync(options.icon); + } + + return options; +}; + +module.exports.mapToMac = function (options) { + options = mapIconShorthand(options); + options = mapText(options); + + if (options.icon) { + options.appIcon = options.icon; + delete options.icon; + } + + if (options.sound === true) { + options.sound = 'Bottle'; + } + + if (options.sound === false) { + delete options.sound; + } + + return options; +}; + +module.exports.actionJackerDecorator = function (emitter, options, fn, mapper) { + options = clone(options); + fn = fn || function (err, data) {}; + return function (err, data) { + fn.apply(emitter, [err, data]); + if (err || !mapper || !data) return; + + var key = mapper(data); + if (!key) return; + emitter.emit(key, emitter, options); + }; +}; + +module.exports.constructArgumentList = function (options, extra) { + var args = []; + extra = extra || {}; + + // Massive ugly setup. Default args + var initial = extra.initial || []; + var keyExtra = extra.keyExtra || ""; + var allowedArguments = extra.allowedArguments || []; + var noEscape = extra.noEscape !== void 0; + var checkForAllowed = extra.allowedArguments !== void 0; + var explicitTrue = !!extra.explicitTrue; + var wrapper = extra.wrapper === void 0 ? '"' : extra.wrapper; + + var escapeFn = noEscape ? function (i) { return i; } : escapeQuotes; + + initial.forEach(function (val) { + args.push(wrapper + escapeFn(val) + wrapper); + }); + for(var key in options) { + if (options.hasOwnProperty(key) && (!checkForAllowed || inArray(allowedArguments, key))) { + if (explicitTrue && options[key] === true) args.push('-' + keyExtra + key) + else if (explicitTrue && options[key] === false) continue; + else args.push('-' + keyExtra + key, wrapper + escapeFn(options[key]) + wrapper); + } + } + return args; +}; + +module.exports.mapToWin8 = function (options){ + + options = mapAppIcon(options); + options = mapText(options); + + if(options.icon){ + options.p = options.icon; + delete options.icon; + } + + if(options.message){ + options.m = options.message; + delete options.message; + } + + if (options.title) { + options.t = options.title; + delete options.title; + } + + if (options.quiet || options.silent) { + options.q = options.quiet || options.silent; + delete options.quiet; + delete options.silent; + } + + if (options.q !== false) { + options.q = true; + } else { + delete options.q; + } + + if (options.sound) { + delete options.q; + delete options.sound; + } + + if (options.wait) { + options.w = options.wait; + delete options.wait; + } + + return options; +}; + +module.exports.mapToNotifu = function (options) { + options = mapAppIcon(options); + options = mapText(options); + + if(options.icon){ + options.i = options.icon; + delete options.icon; + } + + if(options.message){ + options.m = options.message; + delete options.message; + } + + if (options.title) { + options.p = options.title; + delete options.title; + } + + if (options.time) { + options.d = options.time; + delete options.time; + } + + if (options.q !== false) { + options.q = true; + } else { + delete options.q; + } + + if (options.quiet === false) { + delete options.q; + delete options.quiet; + } + + if (options.sound) { + delete options.q; + delete options.sound; + } + + if (options.t) { + options.d = options.t; + delete options.t; + } + + return options; +}; + +module.exports.isMac = function() { + return os.type() === 'Darwin'; +}; + +module.exports.isMountainLion = function() { + return os.type() === 'Darwin' && semver.satisfies(garanteeSemverFormat(os.release()), '>=12.0.0'); +}; + +module.exports.isWin8 = function() { + return os.type() === 'Windows_NT' && semver.satisfies(garanteeSemverFormat(os.release()), '>=6.2.9200'); +}; + +module.exports.isLessThanWin8 = function() { + return os.type() === 'Windows_NT' && semver.satisfies(garanteeSemverFormat(os.release()), '<6.2.9200'); +}; + +function garanteeSemverFormat (version) { + if (version.split('.').length === 2) { + version += '.0'; + } + return version; +} diff --git a/node_modules/node-notifier/node-notifier_flow.png b/node_modules/node-notifier/node-notifier_flow.png new file mode 100644 index 0000000..bc4c12e Binary files /dev/null and b/node_modules/node-notifier/node-notifier_flow.png differ diff --git a/node_modules/node-notifier/node_modules/.bin/semver b/node_modules/node-notifier/node_modules/.bin/semver new file mode 120000 index 0000000..317eb29 --- /dev/null +++ b/node_modules/node-notifier/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/node-notifier/node_modules/.bin/which b/node_modules/node-notifier/node_modules/.bin/which new file mode 120000 index 0000000..f62471c --- /dev/null +++ b/node_modules/node-notifier/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/node-notifier/node_modules/clone/.npmignore b/node_modules/node-notifier/node_modules/clone/.npmignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/node_modules/node-notifier/node_modules/clone/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/.travis.yml b/node_modules/node-notifier/node_modules/clone/.travis.yml similarity index 51% rename from node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/.travis.yml rename to node_modules/node-notifier/node_modules/clone/.travis.yml index cc4dba2..58f2371 100644 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/.travis.yml +++ b/node_modules/node-notifier/node_modules/clone/.travis.yml @@ -1,4 +1,5 @@ language: node_js node_js: - - "0.8" - - "0.10" + - 0.6 + - 0.8 + - 0.10 diff --git a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/LICENSE b/node_modules/node-notifier/node_modules/clone/LICENSE similarity index 67% rename from node_modules/handlebars/node_modules/optimist/node_modules/minimist/LICENSE rename to node_modules/node-notifier/node_modules/clone/LICENSE index ee27ba4..fc808cc 100644 --- a/node_modules/handlebars/node_modules/optimist/node_modules/minimist/LICENSE +++ b/node_modules/node-notifier/node_modules/clone/LICENSE @@ -1,7 +1,7 @@ -This software is released under the MIT license: +Copyright © 2011-2014 Paul Vorbach 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 +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, @@ -10,9 +10,9 @@ 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 +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. +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/node-notifier/node_modules/clone/README.md b/node_modules/node-notifier/node_modules/clone/README.md new file mode 100644 index 0000000..d7231cf --- /dev/null +++ b/node_modules/node-notifier/node_modules/clone/README.md @@ -0,0 +1,126 @@ +# clone + +[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone) + +offers foolproof _deep cloning_ of variables in JavaScript. + + +## Installation + + npm install clone + +or + + ender build clone + + +## Example + +~~~ javascript +var clone = require('clone'); + +var a, b; + +a = { foo: { bar: 'baz' } }; // initial value of a + +b = clone(a); // clone a -> b +a.foo.bar = 'foo'; // change a + +console.log(a); // show a +console.log(b); // show b +~~~ + +This will print: + +~~~ javascript +{ foo: { bar: 'foo' } } +{ foo: { bar: 'baz' } } +~~~ + +**clone** masters cloning simple objects (even with custom prototype), arrays, +Date objects, and RegExp objects. Everything is cloned recursively, so that you +can clone dates in arrays in objects, for example. + + +## API + +`clone(val, circular, depth)` + + * `val` -- the value that you want to clone, any type allowed + * `circular` -- boolean + + Call `clone` with `circular` set to `false` if you are certain that `obj` + contains no circular references. This will give better performance if needed. + There is no error if `undefined` or `null` is passed as `obj`. + * `depth` -- depth to which the object is to be cloned (optional, + defaults to infinity) + +`clone.clonePrototype(obj)` + + * `obj` -- the object that you want to clone + +Does a prototype clone as +[described by Oran Looney](http://oranlooney.com/functional-javascript/). + + +## Circular References + +~~~ javascript +var a, b; + +a = { hello: 'world' }; + +a.myself = a; +b = clone(a); + +console.log(b); +~~~ + +This will print: + +~~~ javascript +{ hello: "world", myself: [Circular] } +~~~ + +So, `b.myself` points to `b`, not `a`. Neat! + + +## Test + + npm test + + +## Caveat + +Some special objects like a socket or `process.stdout`/`stderr` are known to not +be cloneable. If you find other objects that cannot be cloned, please [open an +issue](https://github.com/pvorb/node-clone/issues/new). + + +## Bugs and Issues + +If you encounter any bugs or issues, feel free to [open an issue at +github](https://github.com/pvorb/node-clone/issues) or send me an email to +. I also always like to hear from you, if you’re using my code. + +## License + +Copyright © 2011-2014 [Paul Vorbach](http://paul.vorba.ch/) and +[contributors](https://github.com/pvorb/node-clone/graphs/contributors). + +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, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/node-notifier/node_modules/clone/clone.js b/node_modules/node-notifier/node_modules/clone/clone.js new file mode 100644 index 0000000..f8fa315 --- /dev/null +++ b/node_modules/node-notifier/node_modules/clone/clone.js @@ -0,0 +1,144 @@ +'use strict'; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +// shim for Node's 'util' package +// DO NOT REMOVE THIS! It is required for compatibility with EnderJS (http://enderjs.com/). +var util = { + isArray: function (ar) { + return Array.isArray(ar) || (typeof ar === 'object' && objectToString(ar) === '[object Array]'); + }, + isDate: function (d) { + return typeof d === 'object' && objectToString(d) === '[object Date]'; + }, + isRegExp: function (re) { + return typeof re === 'object' && objectToString(re) === '[object RegExp]'; + }, + getRegExpFlags: function (re) { + var flags = ''; + re.global && (flags += 'g'); + re.ignoreCase && (flags += 'i'); + re.multiline && (flags += 'm'); + return flags; + } +}; + + +if (typeof module === 'object') + module.exports = clone; + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). +*/ + +function clone(parent, circular, depth, prototype) { + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth == 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (util.isArray(parent)) { + child = []; + } else if (util.isRegExp(parent)) { + child = new RegExp(parent.source, util.getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (util.isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; diff --git a/node_modules/node-notifier/node_modules/clone/package.json b/node_modules/node-notifier/node_modules/clone/package.json new file mode 100644 index 0000000..93617d7 --- /dev/null +++ b/node_modules/node-notifier/node_modules/clone/package.json @@ -0,0 +1,126 @@ +{ + "name": "clone", + "description": "deep cloning of objects and arrays", + "tags": [ + "clone", + "object", + "array", + "function", + "date" + ], + "version": "0.1.19", + "repository": { + "type": "git", + "url": "git://github.com/pvorb/node-clone.git" + }, + "bugs": { + "url": "https://github.com/pvorb/node-clone/issues" + }, + "main": "clone.js", + "author": { + "name": "Paul Vorbach", + "email": "paul@vorba.ch", + "url": "http://paul.vorba.ch/" + }, + "contributors": [ + { + "name": "Blake Miner", + "email": "miner.blake@gmail.com", + "url": "http://www.blakeminer.com/" + }, + { + "name": "Tian You", + "email": "axqd001@gmail.com", + "url": "http://blog.axqd.net/" + }, + { + "name": "George Stagas", + "email": "gstagas@gmail.com", + "url": "http://stagas.com/" + }, + { + "name": "Tobiasz Cudnik", + "email": "tobiasz.cudnik@gmail.com", + "url": "https://github.com/TobiaszCudnik" + }, + { + "name": "Pavel Lang", + "email": "langpavel@phpskelet.org", + "url": "https://github.com/langpavel" + }, + { + "name": "Dan MacTough", + "url": "http://yabfog.com/" + }, + { + "name": "w1nk", + "url": "https://github.com/w1nk" + }, + { + "name": "Hugh Kennedy", + "url": "http://twitter.com/hughskennedy" + }, + { + "name": "Dustin Diaz", + "url": "http://dustindiaz.com" + }, + { + "name": "Ilya Shaisultanov", + "url": "https://github.com/diversario" + }, + { + "name": "Nathan MacInnes", + "email": "nathan@macinn.es", + "url": "http://macinn.es/" + }, + { + "name": "Benjamin E. Coe", + "email": "ben@npmjs.com", + "url": "https://twitter.com/benjamincoe" + }, + { + "name": "Nathan Zadoks", + "url": "https://github.com/nathan7" + }, + { + "name": "Róbert Oroszi", + "email": "robert+gh@oroszi.net", + "url": "https://github.com/oroce" + } + ], + "license": "MIT", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "underscore": "*", + "nodeunit": "*" + }, + "optionalDependencies": {}, + "scripts": { + "test": "nodeunit test.js" + }, + "gitHead": "bb11a43363a0f69e8ac014cb5376ce215ea1f8fd", + "homepage": "https://github.com/pvorb/node-clone", + "_id": "clone@0.1.19", + "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", + "_from": "clone@^0.1.18", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "pvorb", + "email": "paul@vorba.ch" + }, + "maintainers": [ + { + "name": "pvorb", + "email": "paul@vorb.de" + } + ], + "dist": { + "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", + "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz" +} diff --git a/node_modules/node-notifier/node_modules/clone/test.js b/node_modules/node-notifier/node_modules/clone/test.js new file mode 100644 index 0000000..cb3d166 --- /dev/null +++ b/node_modules/node-notifier/node_modules/clone/test.js @@ -0,0 +1,289 @@ +if(module.parent === null) { + console.log('Run this test file with nodeunit:'); + console.log('$ nodeunit test.js'); +} + + +var clone = require('./'); +var util = require('util'); +var _ = require('underscore'); + + + +exports["clone string"] = function(test) { + test.expect(2); // how many tests? + + var a = "foo"; + test.strictEqual(clone(a), a); + a = ""; + test.strictEqual(clone(a), a); + + test.done(); +}; + + + +exports["clone number"] = function(test) { + test.expect(5); // how many tests? + + var a = 0; + test.strictEqual(clone(a), a); + a = 1; + test.strictEqual(clone(a), a); + a = -1000; + test.strictEqual(clone(a), a); + a = 3.1415927; + test.strictEqual(clone(a), a); + a = -3.1415927; + test.strictEqual(clone(a), a); + + test.done(); +}; + + + +exports["clone date"] = function(test) { + test.expect(3); // how many tests? + + var a = new Date; + var c = clone(a); + test.ok(a instanceof Date); + test.ok(c instanceof Date); + test.equal(c.getTime(), a.getTime()); + + test.done(); +}; + + + +exports["clone object"] = function(test) { + test.expect(2); // how many tests? + + var a = { foo: { bar: "baz" } }; + var b = clone(a); + + test.ok(_(a).isEqual(b), "underscore equal"); + test.deepEqual(b, a); + + test.done(); +}; + + + +exports["clone array"] = function(test) { + test.expect(2); // how many tests? + + var a = [ + { foo: "bar" }, + "baz" + ]; + var b = clone(a); + + test.ok(_(a).isEqual(b), "underscore equal"); + test.deepEqual(b, a); + + test.done(); +}; + +exports["clone buffer"] = function(test) { + test.expect(1); + + var a = new Buffer("this is a test buffer"); + var b = clone(a); + + // no underscore equal since it has no concept of Buffers + test.deepEqual(b, a); + test.done(); +}; + + + +exports["clone regexp"] = function(test) { + test.expect(5); + + var a = /abc123/gi; + var b = clone(a); + + test.deepEqual(b, a); + + var c = /a/g; + test.ok(c.lastIndex === 0); + + c.exec('123a456a'); + test.ok(c.lastIndex === 4); + + var d = clone(c); + test.ok(d.global); + test.ok(d.lastIndex === 4); + + test.done(); +}; + + +exports["clone object containing array"] = function(test) { + test.expect(2); // how many tests? + + var a = { + arr1: [ { a: '1234', b: '2345' } ], + arr2: [ { c: '345', d: '456' } ] + }; + var b = clone(a); + + test.ok(_(a).isEqual(b), "underscore equal"); + test.deepEqual(b, a); + + test.done(); +}; + + + +exports["clone object with circular reference"] = function(test) { + test.expect(8); // how many tests? + + var _ = test.ok; + var c = [1, "foo", {'hello': 'bar'}, function() {}, false, [2]]; + var b = [c, 2, 3, 4]; + var a = {'b': b, 'c': c}; + a.loop = a; + a.loop2 = a; + c.loop = c; + c.aloop = a; + var aCopy = clone(a); + _(a != aCopy); + _(a.c != aCopy.c); + _(aCopy.c == aCopy.b[0]); + _(aCopy.c.loop.loop.aloop == aCopy); + _(aCopy.c[0] == a.c[0]); + + //console.log(util.inspect(aCopy, true, null) ); + //console.log("------------------------------------------------------------"); + //console.log(util.inspect(a, true, null) ); + _(eq(a, aCopy)); + aCopy.c[0] = 2; + _(!eq(a, aCopy)); + aCopy.c = "2"; + _(!eq(a, aCopy)); + //console.log("------------------------------------------------------------"); + //console.log(util.inspect(aCopy, true, null) ); + + function eq(x, y) { + return util.inspect(x, true, null) === util.inspect(y, true, null); + } + + test.done(); +}; + + + +exports['clonePrototype'] = function(test) { + test.expect(3); // how many tests? + + var a = { + a: "aaa", + x: 123, + y: 45.65 + }; + var b = clone.clonePrototype(a); + + test.strictEqual(b.a, a.a); + test.strictEqual(b.x, a.x); + test.strictEqual(b.y, a.y); + + test.done(); +} + +exports['cloneWithinNewVMContext'] = function(test) { + test.expect(3); + var vm = require('vm'); + var ctx = vm.createContext({ clone: clone }); + var script = "clone( {array: [1, 2, 3], date: new Date(), regex: /^foo$/ig} );"; + var results = vm.runInContext(script, ctx); + test.ok(results.array instanceof Array); + test.ok(results.date instanceof Date); + test.ok(results.regex instanceof RegExp); + test.done(); +} + +exports['cloneObjectWithNoConstructor'] = function(test) { + test.expect(3); + var n = null; + var a = { foo: 'bar' }; + a.__proto__ = n; + test.ok(typeof a === 'object'); + test.ok(typeof a !== null); + var b = clone(a); + test.ok(a.foo, b.foo); + test.done(); +} + +exports['clone object with depth argument'] = function (test) { + test.expect(6); + var a = { + foo: { + bar : { + baz : 'qux' + } + } + }; + var b = clone(a, false, 1); + test.deepEqual(b, a); + test.notEqual(b, a); + test.strictEqual(b.foo, a.foo); + + b = clone(a, true, 2); + test.deepEqual(b, a); + test.notEqual(b.foo, a.foo); + test.strictEqual(b.foo.bar, a.foo.bar); + test.done(); +} + +exports['maintain prototype chain in clones'] = function (test) { + test.expect(1); + function Constructor() {} + var a = new Constructor(); + var b = clone(a); + test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b)); + test.done(); +} + +exports['parent prototype is overriden with prototype provided'] = function (test) { + test.expect(1); + function Constructor() {} + var a = new Constructor(); + var b = clone(a, true, Infinity, null); + test.strictEqual(b.__defineSetter__, undefined); + test.done(); +} + +exports['clone object with null children'] = function(test) { + test.expect(1); + var a = { + foo: { + bar: null, + baz: { + qux: false + } + } + }; + var b = clone(a); + test.deepEqual(b, a); + test.done(); +} + +exports['clone instance with getter'] = function(test) { + test.expect(1); + function Ctor() {}; + Object.defineProperty(Ctor.prototype, 'prop', { + configurable: true, + enumerable: true, + get: function() { + return 'value'; + } + }); + + var a = new Ctor(); + var b = clone(a); + + test.strictEqual(b.prop, 'value'); + test.done(); +}; \ No newline at end of file diff --git a/node_modules/node-notifier/node_modules/growly/HISTORY.md b/node_modules/node-notifier/node_modules/growly/HISTORY.md new file mode 100644 index 0000000..1ea94f1 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/HISTORY.md @@ -0,0 +1,5 @@ +1.1.0 / 2012-12-12 +================== + +- Default registration work lazily, and is performed on the first call to `Growly.notify()`. +- Added callback to `Growly.register()`. diff --git a/node_modules/node-notifier/node_modules/growly/README.md b/node_modules/node-notifier/node_modules/growly/README.md new file mode 100644 index 0000000..6d1f807 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/README.md @@ -0,0 +1,90 @@ +# Growly # + +Simple zero-dependency Growl notifications using GNTP. + +## Installation ## + +Install growly using `npm`: + +``` +npm install growly +``` + +And then require it: + +```javascript +var growly = require('growly'); +``` + +This module uses the Growl Network Transport Protocol (GNTP) which was implemented in Growl since version 1.3, so you **must have an appropriate version of Growl installed** for Growly to work. + +## Example ## + +Sending a minimal Growl notification: + +```javascript +var growly = require('growly'); + +growly.notify('This is as easy as it gets', { title: 'Hello, World!' }); +``` + +More examples can be found in the *example/* directory. + +## Usage ## + +The growly module exposes only two methods: `Growly.register()` and `Growly.notify()`. + +### Growly.register(appname, [appicon], [notifications], [callback]) ### + +Registers a new application with Growl. Registration is completely optional since it will be performed automatically for you with sensible defaults. Useful if you want your application, with its own icon and types of notifications, to show up in Growl's prefence panel. + + - `appname` the name of the application (required.) + - `appicon` url, file path, or Buffer instance for an application icon image. + - `notifications` a list of defined notification types with the following properties: + - `.label` name used to identify the type of notification being used (required.) + - `.dispname` name users will see in Growl's preference panel (defaults to `.label`.) + - `.enabled` whether or not notifications of this type are enabled (defaults to true.) + - `callback` called when the registration completes; if registration fails, the first argument will be an Error object. + +An example: + +```javascript +growly.register('My Application', 'path/to/icon.png', [ + { label: 'success', dispname: 'Success' }, + { label: 'warning', dispname: 'Warning', enabled: false } +], function(err) { + console.log(err || 'Registration successful!'); +}); +``` + +### Growly.notify(text, [opts], [callback]) ### + +Sends a Growl notification. If an application wasn't registered beforehand with `growly.register()`, a default application will automatically be registered beforesending the notification. + + - `text` the body of the notification. + - `opts` an object with the following properties: + - `.title` title of the notification. + - `.icon` url, file path, or Buffer instance for the notification's icon. + - `.sticky` whether or not to sticky the notification (defaults to false.) + - `.label` type of notification to use (defaults to the first registered notification type.) + - `.priority` the priority of the notification from lowest (-2) to highest (2). + - `callback` called when the user has closed/clicked the notification. The callback is passed an Error object `err` as the first argument when the notification fails; otherwise, the second argument `action` is a string that'll describe which action has been taken by the user (either 'closed' or 'clicked'.) + +An example: + +```javascript +/* Assuming an application was registered with a notification type labeled 'warning'. */ +growly.notify('Stuffs broken!', { label: 'warning' }, function(err, action) { + console.log('Action:', action); +}); +``` + +## License ## + +Copyright (C) 2012 Ibrahim Al-Rajhi + +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. diff --git a/node_modules/node-notifier/node_modules/growly/example/bakery.js b/node_modules/node-notifier/node_modules/growly/example/bakery.js new file mode 100644 index 0000000..bcf47a8 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/example/bakery.js @@ -0,0 +1,22 @@ +var growly = require('../lib/growly.js'); + +var notifications = [ + { label: 'muffin', dispname: 'Muffin' }, + { label: 'cake', dispname: 'Cake' } + ], + muffinopts = { label: 'muffin', icon: 'muffin.png' }, + cakeopts = { label: 'cake', title: 'Cake is ready!', icon: 'cake.png', sticky: true }; + +growly.register('Bakery', 'muffin.png', notifications, function(err) { + if (err) { + console.log(err); + return; + } + + growly.notify('Looks like it is half past muffin time!', muffinopts); + + growly.notify('Click to deliver', cakeopts, function(err, action) { + console.log('You', action, 'the notification, so the cake is on its way!'); + }); +}); + diff --git a/node_modules/node-notifier/node_modules/growly/example/cake.png b/node_modules/node-notifier/node_modules/growly/example/cake.png new file mode 100644 index 0000000..bc53679 Binary files /dev/null and b/node_modules/node-notifier/node_modules/growly/example/cake.png differ diff --git a/node_modules/node-notifier/node_modules/growly/example/muffin.png b/node_modules/node-notifier/node_modules/growly/example/muffin.png new file mode 100644 index 0000000..e154228 Binary files /dev/null and b/node_modules/node-notifier/node_modules/growly/example/muffin.png differ diff --git a/node_modules/node-notifier/node_modules/growly/example/simple.js b/node_modules/node-notifier/node_modules/growly/example/simple.js new file mode 100644 index 0000000..e825288 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/example/simple.js @@ -0,0 +1,3 @@ +var growly = require('../lib/growly.js'); + +growly.notify('Hello, world!'); diff --git a/node_modules/node-notifier/node_modules/growly/lib/gntp.js b/node_modules/node-notifier/node_modules/growly/lib/gntp.js new file mode 100644 index 0000000..3fc18b8 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/lib/gntp.js @@ -0,0 +1,199 @@ +var net = require('net'), + crypto = require('crypto'), + format = require('util').format, + fs = require('fs'); + +var nl = '\r\n'; + +/** + * Create a new GNTP request of the given `type`. + * + * @param {String} type either NOTIFY or REGISTER + * @api private + */ + +function GNTP(type) { + this.host = 'localhost'; + this.port = 23053; + this.type = type; + this.request = 'GNTP/1.0 ' + type + ' NONE' + nl; + this.resources = []; + this.attempts = 0; + this.maxAttempts = 5; +} + +/** + * Build a response object from the given `resp` response string. + * + * The response object has a key/value pair for every header in the response, and + * a `.state` property equal to either OK, ERROR, or CALLBACK. + * + * An example GNTP response: + * + * GNTP/1.0 -OK NONE\r\n + * Response-Action: REGISTER\r\n + * \r\n + * + * Which would parse to: + * + * { state: 'OK', 'Response-Action': 'REGISTER' } + * + * @param {String} resp + * @return {Object} + * @api private + */ + +GNTP.prototype.parseResp = function(resp) { + var parsed = {}, head, body; + resp = resp.slice(0, resp.indexOf(nl + nl)).split(nl); + head = resp[0]; + body = resp.slice(1); + + parsed.state = head.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1); + body.forEach(function(ln) { + ln = ln.split(': '); + parsed[ln[0]] = ln[1]; + }); + + return parsed; +}; + +/** + * Call `GNTP.send()` with the given arguments after a certain delay. + * + * @api private + */ + +GNTP.prototype.retry = function() { + var self = this, + args = arguments; + setTimeout(function() { + self.send.apply(self, args); + }, 750); +}; + + +/** + * Add a resource to the GNTP request. + * + * @param {Buffer} file + * @return {String} + * @api private + */ + +GNTP.prototype.addResource = function(file) { + var id = crypto.createHash('md5').update(file).digest('hex'), + header = 'Identifier: ' + id + nl + 'Length: ' + file.length + nl + nl; + this.resources.push({ header: header, file: file }); + return 'x-growl-resource://' + id; +}; + +/** + * Append another header `name` with a value of `val` to the request. If `val` is + * undefined, the header will be left out. + * + * @param {String} name + * @param {String} val + * @api public + */ + +GNTP.prototype.add = function(name, val) { + if (val === undefined) + return; + + /* Handle icon files when they're image paths or Buffers. */ + if (/-Icon/.test(name) && !/^https?:\/\//.test(val) ) { + if (/\.(png|gif|jpe?g)$/.test(val)) + val = this.addResource(fs.readFileSync(val)); + else if (val instanceof Buffer) + val = this.addResource(val); + } + + this.request += name + ': ' + val + nl; +}; + +/** + * Append a newline to the request. + * + * @api public + */ + +GNTP.prototype.newline = function() { + this.request += nl; +}; + +/** + * Send the GNTP request, calling `callback` after successfully sending the + * request. + * + * An example GNTP request: + * + * GNTP/1.0 REGISTER NONE\r\n + * Application-Name: Growly.js\r\n + * Notifications-Count: 1\r\n + * \r\n + * Notification-Name: default\r\n + * Notification-Display-Name: Default Notification\r\n + * Notification-Enabled: True\r\n + * \r\n + * + * @param {Function} callback which will be passed the parsed response + * @api public + */ + +GNTP.prototype.send = function(callback) { + var self = this, + socket = net.connect(this.port, this.host), + resp = ''; + + callback = callback || function() {}; + + this.attempts += 1; + + socket.on('connect', function() { + socket.write(self.request); + + self.resources.forEach(function(res) { + socket.write(res.header); + socket.write(res.file); + socket.write(nl + nl); + }); + }); + + socket.on('data', function(data) { + resp += data.toString(); + + /* Wait until we have a complete response which is signaled by two CRLF's. */ + if (resp.slice(resp.length - 4) !== (nl + nl)) return; + + resp = self.parseResp(resp); + + /* We have to manually close the connection for certain responses; otherwise, + reset `resp` to prepare for the next response chunk. */ + if (resp.state === 'ERROR' || resp.state === 'CALLBACK') + socket.end(); + else + resp = ''; + }); + + socket.on('end', function() { + /* Retry on 200 (timed out), 401 (unknown app), or 402 (unknown notification). */ + if (['200', '401', '402'].indexOf(resp['Error-Code']) >= 0) { + if (self.attempts <= self.maxAttempts) { + self.retry(callback); + } else { + var msg = 'GNTP request to "%s:%d" failed with error code %s (%s)'; + callback(new Error(format(msg, self.host, self.port, resp['Error-Code'], resp['Error-Description']))); + } + } else { + callback(undefined, resp); + } + }); + + socket.on('error', function() { + callback(new Error(format('Error while sending GNTP request to "%s:%d"', self.host, self.port))); + socket.destroy(); + }); +}; + +module.exports = GNTP; diff --git a/node_modules/node-notifier/node_modules/growly/lib/growly.js b/node_modules/node-notifier/node_modules/growly/lib/growly.js new file mode 100644 index 0000000..c128e64 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/lib/growly.js @@ -0,0 +1,177 @@ +var GNTP = require('./gntp.js'); + +/** + * Interface for registering Growl applications and sending Growl notifications. + * + * @api private + */ + +function Growly() { + this.appname = 'Growly'; + this.notifications = undefined; + this.labels = undefined; + this.count = 0; + this.registered = false; +} + +/** + * Returns an array of label strings extracted from each notification object in + * `Growly.notifications`. + * + * @param {Array} notifications + * @return {Array} notification labels + * @api private + */ + +Growly.prototype.getLabels = function() { + return this.notifications.map(function(notif) { + return notif.label; + }); +}; + +/** + * Register an application with the name `appname` (required), icon `appicon`, and + * a list of notification types `notifications`. If provided, `callback` will be + * called when the request completes with the first argument being an `err` error + * object if the request failed. + * + * Each object in the `notifications` array defines a type of notification the + * application will have with the following properties: + * + * - `.label` name used to identify the type of notification being used (required) + * - `.dispname` name users will see in Growl's preference panel (defaults to `.label`) + * - `.enabled` whether or not notifications of this type are enabled (defaults to true) + * - `.icon` default icon notifications of this type should use (url, file path, or Buffer object) + * + * Example registration: + * + * growl.register('My Application', 'path/to/icon.png', [ + * { label: 'success', dispname: 'Success', icon: 'path/to/success.png' }, + * { label: 'warning', dispname: 'Warning', icon: 'path/to/warning.png', enabled: false } + * ], function(err) { console.log(err || 'Registration successful!'); }); + * + * @param {String} appname + * @param {String|Buffer} appicon + * @param {Array} notifications + * @param {Function} callback + * @api public + */ + +Growly.prototype.register = function(appname, appicon, notifications, callback) { + var gntp; + + if (typeof appicon === 'object') { + notifications = appicon; + appicon = undefined; + } + + if (notifications === undefined || !notifications.length) { + notifications = [{ label: 'default', dispname: 'Default Notification', enabled: true }]; + } + + if (typeof arguments[arguments.length - 1] === 'function') { + callback = arguments[arguments.length - 1]; + } else { + callback = function() {}; + } + + this.appname = appname; + this.notifications = notifications; + this.labels = this.getLabels(); + this.registered = true; + + gntp = new GNTP('REGISTER'); + gntp.add('Application-Name', appname); + gntp.add('Application-Icon', appicon); + gntp.add('Notifications-Count', notifications.length); + gntp.newline(); + + notifications.forEach(function(notif) { + if (notif.enabled === undefined) notif.enabled = true; + gntp.add('Notification-Name', notif.label); + gntp.add('Notification-Display-Name', notif.dispname); + gntp.add('Notification-Enabled', notif.enabled ? 'True' : 'False'); + gntp.add('Notification-Icon', notif.icon); + gntp.newline(); + }); + + gntp.send(callback); +}; + +/** + * Send a notification with `text` content. Growly will lazily register itself + * if the user hasn't already before sending the notification. + * + * A notification can have the following `opts` options: + * + * - `.label` type of notification to use (defaults to the first registered type) + * - `.title` title of the notification + * - `.icon` url, file path, or Buffer instance for the notification's icon. + * - `.sticky` whether or not to sticky the notification (defaults to false) + * - `.priority` the priority of the notification from lowest (-2) to highest (2) + * + * If provided, `callback` will be called when the user interacts with the notification. + * The first argument will be an `err` error object, and the second argument an `action` + * string equal to either 'clicked' or 'closed' (whichever action the user took.) + * + * Example notification: + * + * growl.notify('Stuffs broken!', { label: 'warning' }, function(err, action) { + * console.log('Action:', action); + * }); + * + * @param {String} text + * @param {Object} opts + * @param {Function} callback + * @api public + */ + +Growly.prototype.notify = function(text, opts, callback) { + var self = this, + gntp; + + /* Lazy registration. */ + if (!this.registered) { + this.register(this.appname, function(err) { + if (err) console.log(err); + self.notify.call(self, text, opts, callback); + }); + return; + } + + opts = opts || {}; + + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + + gntp = new GNTP('NOTIFY'); + gntp.add('Application-Name', this.appname); + gntp.add('Notification-Name', opts.label || this.labels[0]); + gntp.add('Notification-ID', ++this.count); + gntp.add('Notification-Title', opts.title); + gntp.add('Notification-Text', text); + gntp.add('Notification-Sticky', opts.sticky ? 'True' : 'False'); + gntp.add('Notification-Priority', opts.priority); + gntp.add('Notification-Icon', opts.icon); + gntp.add('Notification-Coalescing-ID', undefined); + gntp.add('Notification-Callback-Context', callback ? 'context' : undefined); + gntp.add('Notification-Callback-Context-Type', callback ? 'string' : undefined); + gntp.add('Notification-Callback-Target', undefined); + gntp.newline(); + + gntp.send(function(err, resp) { + if (callback && err) { + callback(err); + } else if (callback && resp.state === 'CALLBACK') { + callback(undefined, resp['Notification-Callback-Result'].toLowerCase()); + } + }); +}; + +/** + * Expose an instance of the Growly object. + */ + +module.exports = new Growly(); diff --git a/node_modules/node-notifier/node_modules/growly/package.json b/node_modules/node-notifier/node_modules/growly/package.json new file mode 100644 index 0000000..4b52dc2 --- /dev/null +++ b/node_modules/node-notifier/node_modules/growly/package.json @@ -0,0 +1,49 @@ +{ + "name": "growly", + "version": "1.1.1", + "description": "Simple zero-dependency Growl notifications using GNTP.", + "keywords": [ + "growl", + "growly", + "snarl", + "notifications", + "gntp", + "messages" + ], + "author": { + "name": "Ibrahim Al-Rajhi", + "email": "abrahamalrajhi@gmail.com", + "url": "http://ibrahimalrajhi.com/" + }, + "repository": { + "type": "git", + "url": "http://github.com/theabraham/growly" + }, + "bugs": "http://github.com/theabraham/growly/issues", + "main": "lib/growly.js", + "directories": { + "example": "example", + "lib": "lib" + }, + "license": "MIT", + "readme": "# Growly #\n\nSimple zero-dependency Growl notifications using GNTP.\n\n## Installation ##\n\nInstall growly using `npm`:\n\n```\nnpm install growly\n```\n\nAnd then require it:\n\n```javascript\nvar growly = require('growly');\n```\n\nThis module uses the Growl Network Transport Protocol (GNTP) which was implemented in Growl since version 1.3, so you **must have an appropriate version of Growl installed** for Growly to work.\n\n## Example ##\n\nSending a minimal Growl notification:\n\n```javascript\nvar growly = require('growly');\n\ngrowly.notify('This is as easy as it gets', { title: 'Hello, World!' });\n```\n\nMore examples can be found in the *example/* directory.\n\n## Usage ##\n\nThe growly module exposes only two methods: `Growly.register()` and `Growly.notify()`. \n\n### Growly.register(appname, [appicon], [notifications], [callback]) ###\n\nRegisters a new application with Growl. Registration is completely optional since it will be performed automatically for you with sensible defaults. Useful if you want your application, with its own icon and types of notifications, to show up in Growl's prefence panel.\n\n - `appname` the name of the application (required.)\n - `appicon` url, file path, or Buffer instance for an application icon image.\n - `notifications` a list of defined notification types with the following properties:\n - `.label` name used to identify the type of notification being used (required.)\n - `.dispname` name users will see in Growl's preference panel (defaults to `.label`.)\n - `.enabled` whether or not notifications of this type are enabled (defaults to true.)\n - `callback` called when the registration completes; if registration fails, the first argument will be an Error object.\n\nAn example:\n\n```javascript\ngrowly.register('My Application', 'path/to/icon.png', [\n { label: 'success', dispname: 'Success' },\n { label: 'warning', dispname: 'Warning', enabled: false }\n], function(err) {\n console.log(err || 'Registration successful!');\n});\n```\n\n### Growly.notify(text, [opts], [callback]) ###\n\nSends a Growl notification. If an application wasn't registered beforehand with `growly.register()`, a default application will automatically be registered beforesending the notification.\n\n - `text` the body of the notification.\n - `opts` an object with the following properties:\n - `.title` title of the notification.\n - `.icon` url, file path, or Buffer instance for the notification's icon.\n - `.sticky` whether or not to sticky the notification (defaults to false.)\n - `.label` type of notification to use (defaults to the first registered notification type.)\n - `.priority` the priority of the notification from lowest (-2) to highest (2).\n - `callback` called when the user has closed/clicked the notification. The callback is passed an Error object `err` as the first argument when the notification fails; otherwise, the second argument `action` is a string that'll describe which action has been taken by the user (either 'closed' or 'clicked'.)\n\nAn example:\n\n```javascript\n/* Assuming an application was registered with a notification type labeled 'warning'. */\ngrowly.notify('Stuffs broken!', { label: 'warning' }, function(err, action) {\n console.log('Action:', action);\n});\n```\n\n## License ##\n\nCopyright (C) 2012 Ibrahim Al-Rajhi \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", + "_id": "growly@1.1.1", + "dist": { + "shasum": "eb434a0e56f0241d82864cbfd4112c70911242fa", + "tarball": "http://registry.npmjs.org/growly/-/growly-1.1.1.tgz" + }, + "_npmVersion": "1.1.61", + "_npmUser": { + "name": "theabraham", + "email": "abrahamalrajhi@gmail.com" + }, + "maintainers": [ + { + "name": "theabraham", + "email": "abrahamalrajhi@gmail.com" + } + ], + "_shasum": "eb434a0e56f0241d82864cbfd4112c70911242fa", + "_from": "growly@^1.1.1", + "_resolved": "https://registry.npmjs.org/growly/-/growly-1.1.1.tgz" +} diff --git a/node_modules/node-notifier/node_modules/semver/.npmignore b/node_modules/node-notifier/node_modules/semver/.npmignore new file mode 100644 index 0000000..7300fbc --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/.npmignore @@ -0,0 +1 @@ +# nada diff --git a/node_modules/node-notifier/node_modules/semver/LICENSE b/node_modules/node-notifier/node_modules/semver/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/node-notifier/node_modules/semver/Makefile b/node_modules/node-notifier/node_modules/semver/Makefile new file mode 100644 index 0000000..71af0e9 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/Makefile @@ -0,0 +1,24 @@ +files = semver.browser.js \ + semver.min.js \ + semver.browser.js.gz \ + semver.min.js.gz + +all: $(files) + +clean: + rm -f $(files) + +semver.browser.js: head.js.txt semver.js foot.js.txt + ( cat head.js.txt; \ + cat semver.js | \ + egrep -v '^ *\/\* nomin \*\/' | \ + perl -pi -e 's/debug\([^\)]+\)//g'; \ + cat foot.js.txt ) > semver.browser.js + +semver.min.js: semver.browser.js + uglifyjs -m semver.min.js + +%.gz: % + gzip --stdout -9 <$< >$@ + +.PHONY: all clean diff --git a/node_modules/node-notifier/node_modules/semver/README.md b/node_modules/node-notifier/node_modules/semver/README.md new file mode 100644 index 0000000..7e1961d --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/README.md @@ -0,0 +1,275 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Usage + + $ npm install semver + + semver.valid('1.2.3') // '1.2.3' + semver.valid('a.b.c') // null + semver.clean(' =v1.2.3 ') // '1.2.3' + semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true + semver.gt('1.2.3', '9.8.7') // false + semver.lt('1.2.3', '9.8.7') // true + +As a command-line utility: + + $ semver -h + + Usage: semver [ [...]] [-r | -i | -d ] + Test if version(s) satisfy the supplied range(s), and sort them. + + Multiple versions or ranges may be supplied, unless increment + or decrement options are specified. In that case, only a single + version may be used, and it is incremented by the specified level + + Program exits successfully if any valid version satisfies + all supplied ranges, and prints all satisfying versions. + + If no versions are valid, or ranges are not satisfied, + then exits failure. + + Versions are printed in ascending order, so supplying + multiple versions to the utility will just sort them. + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +Note: this is the same as the `~>` operator in rubygems. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +## Functions + +All methods and classes take a final `loose` boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. + + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. diff --git a/node_modules/node-notifier/node_modules/semver/bin/semver b/node_modules/node-notifier/node_modules/semver/bin/semver new file mode 100755 index 0000000..c5f2e85 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/bin/semver @@ -0,0 +1,133 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + , versions = [] + , range = [] + , gt = [] + , lt = [] + , eq = [] + , inc = null + , version = require("../package.json").version + , loose = false + , identifier = undefined + , semver = require("../semver") + , reverse = false + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var i = a.indexOf('=') + if (i !== -1) { + a = a.slice(0, i) + argv.unshift(a.slice(i + 1)) + } + switch (a) { + case "-rv": case "-rev": case "--rev": case "--reverse": + reverse = true + break + case "-l": case "--loose": + loose = true + break + case "-v": case "--version": + versions.push(argv.shift()) + break + case "-i": case "--inc": case "--increment": + switch (argv[0]) { + case "major": case "minor": case "patch": case "prerelease": + case "premajor": case "preminor": case "prepatch": + inc = argv.shift() + break + default: + inc = "patch" + break + } + break + case "--preid": + identifier = argv.shift() + break + case "-r": case "--range": + range.push(argv.shift()) + break + case "-h": case "--help": case "-?": + return help() + default: + versions.push(a) + break + } + } + + versions = versions.filter(function (v) { + return semver.valid(v, loose) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) + return failInc() + + for (var i = 0, l = range.length; i < l ; i ++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], loose) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error("--inc can only be used on a single version with no range") + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? "rcompare" : "compare" + versions.sort(function (a, b) { + return semver[compare](a, b, loose) + }).map(function (v) { + return semver.clean(v, loose) + }).map(function (v) { + return inc ? semver.inc(v, inc, loose, identifier) : v + }).forEach(function (v,i,_) { console.log(v) }) +} + +function help () { + console.log(["SemVer " + version + ,"" + ,"A JavaScript implementation of the http://semver.org/ specification" + ,"Copyright Isaac Z. Schlueter" + ,"" + ,"Usage: semver [options] [ [...]]" + ,"Prints valid versions sorted by SemVer precedence" + ,"" + ,"Options:" + ,"-r --range " + ," Print versions that match the specified range." + ,"" + ,"-i --increment []" + ," Increment a version by the specified level. Level can" + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." + ," Only one version may be specified." + ,"" + ,"--preid " + ," Identifier to be used to prefix premajor, preminor," + ," prepatch or prerelease version increments." + ,"" + ,"-l --loose" + ," Interpret versions and ranges loosely" + ,"" + ,"Program exits successfully if any valid version satisfies" + ,"all supplied ranges, and prints all satisfying versions." + ,"" + ,"If no satisfying versions are found, then exits failure." + ,"" + ,"Versions are printed in ascending order, so supplying" + ,"multiple versions to the utility will just sort them." + ].join("\n")) +} diff --git a/node_modules/node-notifier/node_modules/semver/foot.js.txt b/node_modules/node-notifier/node_modules/semver/foot.js.txt new file mode 100644 index 0000000..8f83c20 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/foot.js.txt @@ -0,0 +1,6 @@ + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/node_modules/node-notifier/node_modules/semver/head.js.txt b/node_modules/node-notifier/node_modules/semver/head.js.txt new file mode 100644 index 0000000..6536865 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/head.js.txt @@ -0,0 +1,2 @@ +;(function(exports) { + diff --git a/node_modules/node-notifier/node_modules/semver/package.json b/node_modules/node-notifier/node_modules/semver/package.json new file mode 100644 index 0000000..fc33751 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/package.json @@ -0,0 +1,54 @@ +{ + "name": "semver", + "version": "4.1.0", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "browser": "semver.browser.js", + "min": "semver.min.js", + "scripts": { + "test": "tap test/*.js", + "prepublish": "make" + }, + "devDependencies": { + "tap": "0.x >=0.0.4", + "uglify-js": "~2.3.6" + }, + "license": "BSD", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-semver.git" + }, + "bin": { + "semver": "./bin/semver" + }, + "gitHead": "f8db569b9fd00788d14064aaf81854ed81e1337a", + "bugs": { + "url": "https://github.com/isaacs/node-semver/issues" + }, + "homepage": "https://github.com/isaacs/node-semver", + "_id": "semver@4.1.0", + "_shasum": "bc80a9ff68532814362cc3cfda3c7b75ed9c321c", + "_from": "semver@^4.0.3", + "_npmVersion": "2.1.3", + "_nodeVersion": "0.10.31", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "bc80a9ff68532814362cc3cfda3c7b75ed9c321c", + "tarball": "http://registry.npmjs.org/semver/-/semver-4.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver/-/semver-4.1.0.tgz" +} diff --git a/node_modules/node-notifier/node_modules/semver/semver.browser.js b/node_modules/node-notifier/node_modules/semver/semver.browser.js new file mode 100644 index 0000000..712de83 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/semver.browser.js @@ -0,0 +1,1120 @@ +;(function(exports) { + +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + ; + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + ; + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + ; + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + ; + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + ; + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; + + ; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + ; + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + ; + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + ; + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + ; + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + ; + comp = replaceCarets(comp, loose); + ; + comp = replaceTildes(comp, loose); + ; + comp = replaceXRanges(comp, loose); + ; + comp = replaceStars(comp, loose); + ; + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + + ; + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + ; + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + ; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + + ; + return ret; + }); +} + +function replaceXRanges(comp, loose) { + ; + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + ; + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) + M = +M + 1 + else + m = +m + 1 + } + + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } + + ; + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + ; + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + ; + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/node_modules/node-notifier/node_modules/semver/semver.browser.js.gz b/node_modules/node-notifier/node_modules/semver/semver.browser.js.gz new file mode 100644 index 0000000..e306605 Binary files /dev/null and b/node_modules/node-notifier/node_modules/semver/semver.browser.js.gz differ diff --git a/node_modules/node-notifier/node_modules/semver/semver.js b/node_modules/node-notifier/node_modules/semver/semver.js new file mode 100644 index 0000000..22673fd --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/semver.js @@ -0,0 +1,1124 @@ +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; + + debug('comp', this); +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + + debug('tilde return', ret); + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + debug('caret', comp, loose); + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + debug('replaceCaret pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + + debug('caret return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) + M = +M + 1 + else + m = +m + 1 + } + + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } + + debug('xRange return', ret); + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); diff --git a/node_modules/node-notifier/node_modules/semver/semver.min.js b/node_modules/node-notifier/node_modules/semver/semver.min.js new file mode 100644 index 0000000..56c9249 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/semver.min.js @@ -0,0 +1 @@ +(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var l=n++;t[l]="(?:"+t[s]+"|"+t[a]+")";var p=n++;t[p]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var c=n++;t[c]="(?:-?("+t[l]+"(?:\\."+t[l]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[p]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[c]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var N=n++;t[N]="^"+t[A]+t[k]+"$";var P=n++;t[P]="^"+t[y]+"\\s*("+w+")$|^$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+g+")$|^$";var q=n++;t[q]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[$]+")";r[q]=new RegExp(t[q],"g");var L="$1$2$3";var X=n++;t[X]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var _=n++;t[_]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new H(e,t).inc(r,n).version}catch(i){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=lr;function lr(e,r){if(e instanceof lr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof lr))return new lr(e,r);this.loose=r;this.parse(e);if(this.semver===pr)this.value="";else this.value=this.operator+this.semver.version}var pr={};lr.prototype.parse=function(e){var t=this.loose?r[P]:r[Z];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=pr;else this.semver=new H(n[2],this.loose)};lr.prototype.inspect=function(){return''};lr.prototype.toString=function(){return this.value};lr.prototype.test=function(e){if(this.semver===pr)return true;if(typeof e==="string")e=new H(e,this.loose);return ur(e,this.operator,this.semver,this.loose)};e.Range=cr;function cr(e,r){if(e instanceof cr&&e.loose===r)return e;if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}cr.prototype.inspect=function(){return''};cr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};cr.prototype.toString=function(){return this.range};cr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[_]:r[X];e=e.replace(n,kr);e=e.replace(r[q],L);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[P]:r[Z];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new lr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new cr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=$r(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[N]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(a){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(o)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(o){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function $r(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,l,p,c){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0";else if(mr(i))r=">="+t+"."+n+".0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0";else if(mr(l))o="<"+f+"."+(+u+1)+".0";else if(p)o="<="+f+"."+u+"."+l+"-"+p;else o="<="+o;return(r+" "+o).trim()}cr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new cr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new cr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new cr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u1.2.3', null], + ['~1.2.3', null], + ['<=1.2.3', null], + ['1.2.x', null] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var msg = 'clean(' + range + ') = ' + version; + t.equal(clean(range), version, msg); + }); + t.end(); +}); diff --git a/node_modules/node-notifier/node_modules/semver/test/gtr.js b/node_modules/node-notifier/node_modules/semver/test/gtr.js new file mode 100644 index 0000000..bbb8789 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/test/gtr.js @@ -0,0 +1,173 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var gtr = semver.gtr; + +test('\ngtr tests', function(t) { + // [range, version, loose] + // Version should be greater than range + [ + ['~1.2.2', '1.3.0'], + ['~0.6.1-1', '0.7.1-1'], + ['1.0.0 - 2.0.0', '2.0.1'], + ['1.0.0', '1.0.1-beta1'], + ['1.0.0', '2.0.0'], + ['<=2.0.0', '2.1.1'], + ['<=2.0.0', '3.2.9'], + ['<2.0.0', '2.0.0'], + ['0.1.20 || 1.2.4', '1.2.5'], + ['2.x.x', '3.0.0'], + ['1.2.x', '1.3.0'], + ['1.2.x || 2.x', '3.0.0'], + ['2.*.*', '5.0.1'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '4.0.0'], + ['2', '3.0.0'], + ['2.3', '2.4.2'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.5.5'], + ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 + ['~1', '2.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.4'], + ['~> 1', '3.2.3'], + ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.1.0'], + ['<1.2', '1.2.0'], + ['< 1.2', '1.2.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-pre', '0.6.0'], + ['~v0.5.4-pre', '0.6.1-pre'], + ['=0.7.x', '0.8.0'], + ['=0.7.x', '0.8.0-asdf'], + ['<0.7.x', '0.7.0'], + ['~1.2.2', '1.3.0'], + ['1.0.0 - 2.0.0', '2.2.3'], + ['1.0.0', '1.0.1'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['2', '3.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~1', '2.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['1', '2.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['=0.7.x', '0.8.2'], + ['<0.7.x', '0.7.2'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; + t.ok(gtr(version, range, loose), msg); + }); + t.end(); +}); + +test('\nnegative gtr tests', function(t) { + // [range, version, loose] + // Version should NOT be greater than range + [ + ['~0.6.1-1', '0.6.1-1'], + ['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0 - 2.0.0', '0.9.9'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0', true], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo'], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97'], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['0.1.20 || >1.2.4', '1.2.4'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['0.1.20 || 1.2.4', '0.1.20'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.0.2'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['1', '1.0.0beta', true], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['<=0.7.x', '0.6.2'], + ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], + ['>=0.2.3 <=0.2.4', '0.2.4'], + ['1.0.0 - 2.0.0', '2.0.0'], + ['^1', '0.0.0-0'], + ['^3.0.0', '2.0.0'], + ['^1.0.0 || ~2.0.1', '2.0.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], + ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; + t.notOk(gtr(version, range, loose), msg); + }); + t.end(); +}); diff --git a/node_modules/node-notifier/node_modules/semver/test/index.js b/node_modules/node-notifier/node_modules/semver/test/index.js new file mode 100644 index 0000000..de8acae --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/test/index.js @@ -0,0 +1,653 @@ +'use strict'; + +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var eq = semver.eq; +var gt = semver.gt; +var lt = semver.lt; +var neq = semver.neq; +var cmp = semver.cmp; +var gte = semver.gte; +var lte = semver.lte; +var satisfies = semver.satisfies; +var validRange = semver.validRange; +var inc = semver.inc; +var replaceStars = semver.replaceStars; +var toComparators = semver.toComparators; +var SemVer = semver.SemVer; +var Range = semver.Range; + +test('\ncomparison tests', function(t) { + // [version1, version2] + // version1 should be greater than version2 + [['0.0.0', '0.0.0-foo'], + ['0.0.1', '0.0.0'], + ['1.0.0', '0.9.9'], + ['0.10.0', '0.9.0'], + ['0.99.0', '0.10.0'], + ['2.0.0', '1.2.3'], + ['v0.0.0', '0.0.0-foo', true], + ['v0.0.1', '0.0.0', true], + ['v1.0.0', '0.9.9', true], + ['v0.10.0', '0.9.0', true], + ['v0.99.0', '0.10.0', true], + ['v2.0.0', '1.2.3', true], + ['0.0.0', 'v0.0.0-foo', true], + ['0.0.1', 'v0.0.0', true], + ['1.0.0', 'v0.9.9', true], + ['0.10.0', 'v0.9.0', true], + ['0.99.0', 'v0.10.0', true], + ['2.0.0', 'v1.2.3', true], + ['1.2.3', '1.2.3-asdf'], + ['1.2.3', '1.2.3-4'], + ['1.2.3', '1.2.3-4-foo'], + ['1.2.3-5-foo', '1.2.3-5'], + ['1.2.3-5', '1.2.3-4'], + ['1.2.3-5-foo', '1.2.3-5-Foo'], + ['3.0.0', '2.7.2+asdf'], + ['1.2.3-a.10', '1.2.3-a.5'], + ['1.2.3-a.b', '1.2.3-a.5'], + ['1.2.3-a.b', '1.2.3-a'], + ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); + t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); + t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); + t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); + t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); + t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); + t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); + t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); + }); + t.end(); +}); + +test('\nequality tests', function(t) { + // [version1, version2] + // version1 should be equivalent to version2 + [['1.2.3', 'v1.2.3', true], + ['1.2.3', '=1.2.3', true], + ['1.2.3', 'v 1.2.3', true], + ['1.2.3', '= 1.2.3', true], + ['1.2.3', ' v1.2.3', true], + ['1.2.3', ' =1.2.3', true], + ['1.2.3', ' v 1.2.3', true], + ['1.2.3', ' = 1.2.3', true], + ['1.2.3-0', 'v1.2.3-0', true], + ['1.2.3-0', '=1.2.3-0', true], + ['1.2.3-0', 'v 1.2.3-0', true], + ['1.2.3-0', '= 1.2.3-0', true], + ['1.2.3-0', ' v1.2.3-0', true], + ['1.2.3-0', ' =1.2.3-0', true], + ['1.2.3-0', ' v 1.2.3-0', true], + ['1.2.3-0', ' = 1.2.3-0', true], + ['1.2.3-1', 'v1.2.3-1', true], + ['1.2.3-1', '=1.2.3-1', true], + ['1.2.3-1', 'v 1.2.3-1', true], + ['1.2.3-1', '= 1.2.3-1', true], + ['1.2.3-1', ' v1.2.3-1', true], + ['1.2.3-1', ' =1.2.3-1', true], + ['1.2.3-1', ' v 1.2.3-1', true], + ['1.2.3-1', ' = 1.2.3-1', true], + ['1.2.3-beta', 'v1.2.3-beta', true], + ['1.2.3-beta', '=1.2.3-beta', true], + ['1.2.3-beta', 'v 1.2.3-beta', true], + ['1.2.3-beta', '= 1.2.3-beta', true], + ['1.2.3-beta', ' v1.2.3-beta', true], + ['1.2.3-beta', ' =1.2.3-beta', true], + ['1.2.3-beta', ' v 1.2.3-beta', true], + ['1.2.3-beta', ' = 1.2.3-beta', true], + ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], + ['1.2.3+build', ' = 1.2.3+otherbuild', true], + ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], + ['1.2.3+build', '1.2.3+otherbuild'], + [' v1.2.3+build', '1.2.3+otherbuild'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); + t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); + t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); + t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); + t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); + t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); + t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); + }); + t.end(); +}); + + +test('\nrange tests', function(t) { + // [range, version] + // version should be included by range + [['1.0.0 - 2.0.0', '1.2.3'], + ['^1.2.3+build', '1.2.3'], + ['^1.2.3+build', '1.3.0'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], + ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0'], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo', true], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97', true], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, + ['~ 1.0', '1.0.2'], + ['~ 1.0.3', '1.0.12'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['<=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['<=0.7.x', '0.6.2'], + ['~1.2.1 >=1.2.3', '1.2.3'], + ['~1.2.1 =1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], + ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['>=1.2.1 1.2.3', '1.2.3'], + ['1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.1 >=1.2.3', '1.2.3'], + ['>=1.2', '1.2.8'], + ['^1.2.3', '1.8.1'], + ['^0.1.2', '0.1.2'], + ['^0.1', '0.1.2'], + ['^1.2', '1.4.2'], + ['^1.2 ^1', '1.4.2'], + ['^1.2.3-alpha', '1.2.3-pre'], + ['^1.2.0-alpha', '1.2.0-pre'], + ['^0.0.1-alpha', '0.0.1-beta'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); + }); + t.end(); +}); + +test('\nnegative range tests', function(t) { + // [range, version] + // version should not be included by range + [['1.0.0 - 2.0.0', '2.2.3'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], + ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], + ['^1.2.3+build', '2.0.0'], + ['^1.2.3+build', '1.2.0'], + ['^1.2.3', '1.2.3-pre'], + ['^1.2', '1.2.0-pre'], + ['>1.2', '1.3.0-beta'], + ['<=1.2.3', '1.2.3-beta'], + ['^1.2.3', '1.2.3-beta'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['1.0.0', '1.0.1'], + ['>=1.0.0', '0.0.0'], + ['>=1.0.0', '0.0.1'], + ['>=1.0.0', '0.1.0'], + ['>1.0.0', '0.0.1'], + ['>1.0.0', '0.1.0'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['>=0.1.97', 'v0.1.93', true], + ['>=0.1.97', '0.1.93'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['>=0.2.3 || <0.0.1', '0.0.3'], + ['>=0.2.3 || <0.0.1', '0.2.2'], + ['2.x.x', '1.1.3'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.9'], + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['>=1.2', '1.1.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-beta', '0.5.4-alpha'], + ['=0.7.x', '0.8.2'], + ['>=0.7.x', '0.6.2'], + ['<0.7.x', '0.7.2'], + ['<1.2.3', '1.2.3-beta'], + ['=1.2.3', '1.2.3-beta'], + ['>1.2', '1.2.8'], + ['^1.2.3', '2.0.0-alpha'], + ['^1.2.3', '1.2.2'], + ['^1.2', '1.1.9'], + // invalid ranges never satisfied! + ['blerg', '1.2.3'], + ['git+https://user:password0123@github.com/foo', '123.0.0', true], + ['^1.2.3', '2.0.0-pre'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + var found = satisfies(ver, range, loose); + t.ok(!found, ver + ' not satisfied by ' + range); + }); + t.end(); +}); + +test('\nincrement versions test', function(t) { +// [version, inc, result, identifier] +// inc(version, inc) -> result + [['1.2.3', 'major', '2.0.0'], + ['1.2.3', 'minor', '1.3.0'], + ['1.2.3', 'patch', '1.2.4'], + ['1.2.3tag', 'major', '2.0.0', true], + ['1.2.3-tag', 'major', '2.0.0'], + ['1.2.3', 'fake', null], + ['1.2.0-0', 'patch', '1.2.0'], + ['fake', 'major', null], + ['1.2.3-4', 'major', '2.0.0'], + ['1.2.3-4', 'minor', '1.3.0'], + ['1.2.3-4', 'patch', '1.2.3'], + ['1.2.3-alpha.0.beta', 'major', '2.0.0'], + ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], + ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], + ['1.2.4', 'prerelease', '1.2.5-0'], + ['1.2.3-0', 'prerelease', '1.2.3-1'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], + ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], + ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], + ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], + ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], + ['1.2.0', 'prepatch', '1.2.1-0'], + ['1.2.0-1', 'prepatch', '1.2.1-0'], + ['1.2.0', 'preminor', '1.3.0-0'], + ['1.2.3-1', 'preminor', '1.3.0-0'], + ['1.2.0', 'premajor', '2.0.0-0'], + ['1.2.3-1', 'premajor', '2.0.0-0'], + ['1.2.0-1', 'minor', '1.2.0'], + ['1.0.0-1', 'major', '1.0.0'], + + ['1.2.3', 'major', '2.0.0', false, 'dev'], + ['1.2.3', 'minor', '1.3.0', false, 'dev'], + ['1.2.3', 'patch', '1.2.4', false, 'dev'], + ['1.2.3tag', 'major', '2.0.0', true, 'dev'], + ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], + ['1.2.3', 'fake', null, false, 'dev'], + ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], + ['fake', 'major', null, false, 'dev'], + ['1.2.3-4', 'major', '2.0.0', false, 'dev'], + ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], + ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], + ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], + ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], + ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], + ['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'], + ['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'], + ['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'], + ['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'], + ['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'], + ['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'], + ['1.2.0-1', 'minor', '1.2.0', 'dev'], + ['1.0.0-1', 'major', '1.0.0', 'dev'], + ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] + + ].forEach(function(v) { + var pre = v[0]; + var what = v[1]; + var wanted = v[2]; + var loose = v[3]; + var id = v[4]; + var found = inc(pre, what, loose, id); + var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; + t.equal(found, wanted, cmd + ' === ' + wanted); + }); + + t.end(); +}); + +test('\nvalid range test', function(t) { + // [range, result] + // validRange(range) -> result + // translate ranges into their canonical form + [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], + ['1.0.0', '1.0.0'], + ['>=*', '*'], + ['', '*'], + ['*', '*'], + ['*', '*'], + ['>=1.0.0', '>=1.0.0'], + ['>1.0.0', '>1.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['1', '>=1.0.0 <2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<2.0.0', '<2.0.0'], + ['<2.0.0', '<2.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['< 2.0.0', '<2.0.0'], + ['< 2.0.0', '<2.0.0'], + ['>=0.1.97', '>=0.1.97'], + ['>=0.1.97', '>=0.1.97'], + ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['||', '||'], + ['2.x.x', '>=2.0.0 <3.0.0'], + ['1.2.x', '>=1.2.0 <1.3.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['x', '*'], + ['2.*.*', '>=2.0.0 <3.0.0'], + ['1.2.*', '>=1.2.0 <1.3.0'], + ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['*', '*'], + ['2', '>=2.0.0 <3.0.0'], + ['2.3', '>=2.3.0 <2.4.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~>3.2.1', '>=3.2.1 <3.3.0'], + ['~1', '>=1.0.0 <2.0.0'], + ['~>1', '>=1.0.0 <2.0.0'], + ['~> 1', '>=1.0.0 <2.0.0'], + ['~1.0', '>=1.0.0 <1.1.0'], + ['~ 1.0', '>=1.0.0 <1.1.0'], + ['^0', '>=0.0.0 <1.0.0'], + ['^ 1', '>=1.0.0 <2.0.0'], + ['^0.1', '>=0.1.0 <0.2.0'], + ['^1.0', '>=1.0.0 <2.0.0'], + ['^1.2', '>=1.2.0 <2.0.0'], + ['^0.0.1', '>=0.0.1 <0.0.2'], + ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], + ['^0.1.2', '>=0.1.2 <0.2.0'], + ['^1.2.3', '>=1.2.3 <2.0.0'], + ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], + ['<1', '<1.0.0'], + ['< 1', '<1.0.0'], + ['>=1', '>=1.0.0'], + ['>= 1', '>=1.0.0'], + ['<1.2', '<1.2.0'], + ['< 1.2', '<1.2.0'], + ['1', '>=1.0.0 <2.0.0'], + ['>01.02.03', '>1.2.3', true], + ['>01.02.03', null], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], + ['~1.2.3beta', null], + ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var loose = v[2]; + var found = validRange(pre, loose); + + t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); + }); + + t.end(); +}); + +test('\ncomparators test', function(t) { + // [range, comparators] + // turn range into a set of individual comparators + [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], + ['1.0.0', [['1.0.0']]], + ['>=*', [['']]], + ['', [['']]], + ['*', [['']]], + ['*', [['']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<2.0.0', [['<2.0.0']]], + ['<2.0.0', [['<2.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['< 2.0.0', [['<2.0.0']]], + ['<\t2.0.0', [['<2.0.0']]], + ['>=0.1.97', [['>=0.1.97']]], + ['>=0.1.97', [['>=0.1.97']]], + ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['||', [[''], ['']]], + ['2.x.x', [['>=2.0.0', '<3.0.0']]], + ['1.2.x', [['>=1.2.0', '<1.3.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['x', [['']]], + ['2.*.*', [['>=2.0.0', '<3.0.0']]], + ['1.2.*', [['>=1.2.0', '<1.3.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['*', [['']]], + ['2', [['>=2.0.0', '<3.0.0']]], + ['2.3', [['>=2.3.0', '<2.4.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], + ['~1', [['>=1.0.0', '<2.0.0']]], + ['~>1', [['>=1.0.0', '<2.0.0']]], + ['~> 1', [['>=1.0.0', '<2.0.0']]], + ['~1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['<1', [['<1.0.0']]], + ['< 1', [['<1.0.0']]], + ['>=1', [['>=1.0.0']]], + ['>= 1', [['>=1.0.0']]], + ['<1.2', [['<1.2.0']]], + ['< 1.2', [['<1.2.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], + ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], + ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], + ['>*', [['<0.0.0']]], + ['<*', [['<0.0.0']]] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var found = toComparators(v[0]); + var jw = JSON.stringify(wanted); + t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); + }); + + t.end(); +}); + +test('\ninvalid version numbers', function(t) { + ['1.2.3.4', + 'NOT VALID', + 1.2, + null, + 'Infinity.NaN.Infinity' + ].forEach(function(v) { + t.throws(function() { + new SemVer(v); + }, {name:'TypeError', message:'Invalid Version: ' + v}); + }); + + t.end(); +}); + +test('\nstrict vs loose version numbers', function(t) { + [['=1.2.3', '1.2.3'], + ['01.02.03', '1.2.3'], + ['1.2.3-beta.01', '1.2.3-beta.1'], + [' =1.2.3', '1.2.3'], + ['1.2.3foo', '1.2.3-foo'] + ].forEach(function(v) { + var loose = v[0]; + var strict = v[1]; + t.throws(function() { + new SemVer(loose); + }); + var lv = new SemVer(loose, true); + t.equal(lv.version, strict); + t.ok(eq(loose, strict, true)); + t.throws(function() { + eq(loose, strict); + }); + t.throws(function() { + new SemVer(strict).compare(loose); + }); + }); + t.end(); +}); + +test('\nstrict vs loose ranges', function(t) { + [['>=01.02.03', '>=1.2.3'], + ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] + ].forEach(function(v) { + var loose = v[0]; + var comps = v[1]; + t.throws(function() { + new Range(loose); + }); + t.equal(new Range(loose, true).range, comps); + }); + t.end(); +}); + +test('\nmax satisfying', function(t) { + [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], + [['1.2.4', '1.2.3'], '1.2', '1.2.4'], + [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], + [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] + ].forEach(function(v) { + var versions = v[0]; + var range = v[1]; + var expect = v[2]; + var loose = v[3]; + var actual = semver.maxSatisfying(versions, range, loose); + t.equal(actual, expect); + }); + t.end(); +}); diff --git a/node_modules/node-notifier/node_modules/semver/test/ltr.js b/node_modules/node-notifier/node_modules/semver/test/ltr.js new file mode 100644 index 0000000..ecd1387 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/test/ltr.js @@ -0,0 +1,181 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var ltr = semver.ltr; + +test('\nltr tests', function(t) { + // [range, version, loose] + // Version should be less than range + [ + ['~1.2.2', '1.2.1'], + ['~0.6.1-1', '0.6.1-0'], + ['1.0.0 - 2.0.0', '0.0.1'], + ['1.0.0-beta.2', '1.0.0-beta.1'], + ['1.0.0', '0.0.0'], + ['>=2.0.0', '1.1.1'], + ['>=2.0.0', '1.2.9'], + ['>2.0.0', '2.0.0'], + ['0.1.20 || 1.2.4', '0.1.5'], + ['2.x.x', '1.0.0'], + ['1.2.x', '1.1.0'], + ['1.2.x || 2.x', '1.0.0'], + ['2.*.*', '1.0.1'], + ['1.2.*', '1.1.3'], + ['1.2.* || 2.*', '1.1.9999'], + ['2', '1.0.0'], + ['2.3', '2.2.2'], + ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.5'], + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '0.2.4'], + ['~> 1', '0.2.3'], + ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '0.1.0'], + ['>1.2', '1.2.0'], + ['> 1.2', '1.2.1'], + ['1', '0.0.0beta', true], + ['~v0.5.4-pre', '0.5.4-alpha'], + ['~v0.5.4-pre', '0.5.4-alpha'], + ['=0.7.x', '0.6.0'], + ['=0.7.x', '0.6.0-asdf'], + ['>=0.7.x', '0.6.0'], + ['~1.2.2', '1.2.1'], + ['1.0.0 - 2.0.0', '0.2.3'], + ['1.0.0', '0.0.1'], + ['>=2.0.0', '1.0.0'], + ['>=2.0.0', '1.9999.9999'], + ['>=2.0.0', '1.2.9'], + ['>2.0.0', '2.0.0'], + ['>2.0.0', '1.2.9'], + ['2.x.x', '1.1.3'], + ['1.2.x', '1.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['1.2.*', '1.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.9999.9999'], + ['2.3', '2.2.1'], + ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 + ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '0.2.3'], + ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 + ['>1', '1.0.0'], + ['2', '1.0.0beta', true], + ['>1', '1.0.0beta', true], + ['> 1', '1.0.0beta', true], + ['=0.7.x', '0.6.2'], + ['=0.7.x', '0.7.0-asdf'], + ['^1', '1.0.0-0'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['>=0.7.x', '0.6.2'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; + t.ok(ltr(version, range, loose), msg); + }); + t.end(); +}); + +test('\nnegative ltr tests', function(t) { + // [range, version, loose] + // Version should NOT be greater than range + [ + ['~ 1.0', '1.1.0'], + ['~0.6.1-1', '0.6.1-1'], + ['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0 - 2.0.0', '2.9.9'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0', true], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo'], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97'], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['0.1.20 || >1.2.4', '1.2.4'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['0.1.20 || 1.2.4', '0.1.20'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.0.2'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['<=0.7.x', '0.6.2'], + ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], + ['>=0.2.3 <=0.2.4', '0.2.4'], + ['1.0.0 - 2.0.0', '2.0.0'], + ['^3.0.0', '4.0.0'], + ['^1.0.0 || ~2.0.1', '2.0.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], + ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], + ['^1.0.0alpha', '1.0.0beta', true], + ['~1.0.0alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0beta', true], + ['~1.0.0-alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0-beta'], + ['~1.0.0-alpha', '1.0.0-beta'], + ['=0.1.0', '1.0.0'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; + t.notOk(ltr(version, range, loose), msg); + }); + t.end(); +}); diff --git a/node_modules/node-notifier/node_modules/semver/test/no-module.js b/node_modules/node-notifier/node_modules/semver/test/no-module.js new file mode 100644 index 0000000..8b50873 --- /dev/null +++ b/node_modules/node-notifier/node_modules/semver/test/no-module.js @@ -0,0 +1,19 @@ +var tap = require('tap'); +var test = tap.test; + +test('no module system', function(t) { + var fs = require('fs'); + var vm = require('vm'); + var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); + var src = fs.readFileSync(require.resolve('../'), 'utf8'); + var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); + vm.runInThisContext(head + src + foot, 'semver.js'); + + // just some basic poking to see if it did some stuff + t.type(global.semver, 'object'); + t.type(global.semver.SemVer, 'function'); + t.type(global.semver.Range, 'function'); + t.ok(global.semver.satisfies('1.2.3', '1.2')); + t.end(); +}); + diff --git a/node_modules/node-notifier/node_modules/shellwords/.npmignore b/node_modules/node-notifier/node_modules/shellwords/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/node-notifier/node_modules/shellwords/Cakefile b/node_modules/node-notifier/node_modules/shellwords/Cakefile new file mode 100644 index 0000000..462b676 --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/Cakefile @@ -0,0 +1,42 @@ +{spawn, exec} = require "child_process" +watch = require "nodewatch" + +task "spec", "Runs the Jasmine specs.", -> + header() + + jasmine = spawn "node", ["node_modules/jasmine-node/lib/jasmine-node/cli.js", "--coffee", "-i", "src", "spec"] + + jasmine.stdout.on "data", (data) -> + process.stdout.write data + jasmine.stderr.on "data", (data) -> + process.stderr.write data + + jasmine.stdin.end() + +task "watch", "Watches for file changes, recompiling CoffeeScript and running the Jasmine specs.", -> + console.log "Watching Shellwords for changes...\n" + + invoke "spec" + + watch.add("src").add("spec").onChange (file, prev, cur) -> + exec "coffee -co lib src", (error, stdout, stderr) -> + throw error if error + + invoke "spec" + +header = -> + divider = "------------" + console.log divider, dateString(), divider + +dateString = -> + d = new Date + h = d.getHours() + m = d.getMinutes() + s = d.getSeconds() + meridiem = if h >= 12 then "PM" else "AM" + h -= 12 if h > 12 + h = 12 if h is 0 + m = "0" + m if m < 10 + s = "0" + s if s < 10 + + "#{d.toLocaleDateString()} #{h}:#{m}:#{s} #{meridiem}" diff --git a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/LICENSE b/node_modules/node-notifier/node_modules/shellwords/LICENSE similarity index 88% rename from node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/LICENSE rename to node_modules/node-notifier/node_modules/shellwords/LICENSE index 432d1ae..719e099 100644 --- a/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/LICENSE +++ b/node_modules/node-notifier/node_modules/shellwords/LICENSE @@ -1,6 +1,4 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: +Copyright (C) 2011 by Jimmy Cuadra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +16,4 @@ 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. +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/node-notifier/node_modules/shellwords/README.md b/node_modules/node-notifier/node_modules/shellwords/README.md new file mode 100644 index 0000000..8cf5d88 --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/README.md @@ -0,0 +1,19 @@ +# Shellwords + +Shellwords provides functions to manipulate strings according to the word parsing rules of the UNIX Bourne shell. It is based on [the Ruby module of the same name](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/shellwords/rdoc/Shellwords.html). + +## Installation + +Add "shellwords" to your `package.json` file and run `npm install`. + +## Example + +``` javascript +var shellwords = require("shellwords"); + +shellwords.split("foo 'bar baz'"); +// ["foo", "bar baz"] + +shellwords.escape("What's up, yo?"); +// 'What\\\'s\\ up,\\ yo\\?' +``` diff --git a/node_modules/node-notifier/node_modules/shellwords/lib/shellwords.js b/node_modules/node-notifier/node_modules/shellwords/lib/shellwords.js new file mode 100644 index 0000000..0fb4833 --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/lib/shellwords.js @@ -0,0 +1,57 @@ +// Generated by CoffeeScript 1.3.3 +(function() { + var scan; + + scan = function(string, pattern, callback) { + var match, result; + result = ""; + while (string.length > 0) { + match = string.match(pattern); + if (match) { + result += string.slice(0, match.index); + result += callback(match); + string = string.slice(match.index + match[0].length); + } else { + result += string; + string = ""; + } + } + return result; + }; + + exports.split = function(line) { + var field, words; + if (line == null) { + line = ""; + } + words = []; + field = ""; + scan(line, /\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/, function(match) { + var dq, escape, garbage, raw, seperator, sq, word; + raw = match[0], word = match[1], sq = match[2], dq = match[3], escape = match[4], garbage = match[5], seperator = match[6]; + if (garbage != null) { + throw new Error("Unmatched quote"); + } + field += word || (sq || dq || escape).replace(/\\(?=.)/, ""); + if (seperator != null) { + words.push(field); + return field = ""; + } + }); + if (field) { + words.push(field); + } + return words; + }; + + exports.escape = function(str) { + if (str == null) { + str = ""; + } + if (str == null) { + return "''"; + } + return str.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g, "\\$1").replace(/\n/g, "'\n'"); + }; + +}).call(this); diff --git a/node_modules/node-notifier/node_modules/shellwords/package.json b/node_modules/node-notifier/node_modules/shellwords/package.json new file mode 100644 index 0000000..3b60721 --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Jimmy Cuadra", + "email": "jimmy@jimmycuadra.com", + "url": "http://jimmycuadra.com/" + }, + "name": "shellwords", + "description": "Manipulate strings according to the word parsing rules of the UNIX Bourne shell.", + "version": "0.1.0", + "homepage": "https://github.com/jimmycuadra/shellwords", + "repository": { + "type": "git", + "url": "git://github.com/jimmycuadra/shellwords.git" + }, + "main": "./lib/shellwords", + "scripts": { + "test": "cake spec" + }, + "dependencies": {}, + "devDependencies": { + "jasmine-node": "~1.0.26", + "nodewatch": "~0.1.0" + }, + "readme": "# Shellwords\n\nShellwords provides functions to manipulate strings according to the word parsing rules of the UNIX Bourne shell. It is based on [the Ruby module of the same name](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/shellwords/rdoc/Shellwords.html).\n\n## Installation\n\nAdd \"shellwords\" to your `package.json` file and run `npm install`.\n\n## Example\n\n``` javascript\nvar shellwords = require(\"shellwords\");\n\nshellwords.split(\"foo 'bar baz'\");\n// [\"foo\", \"bar baz\"]\n\nshellwords.escape(\"What's up, yo?\");\n// 'What\\\\\\'s\\\\ up,\\\\ yo\\\\?'\n```\n", + "_id": "shellwords@0.1.0", + "dist": { + "shasum": "66afd47b6a12932d9071cbfd98a52e785cd0ba14", + "tarball": "http://registry.npmjs.org/shellwords/-/shellwords-0.1.0.tgz" + }, + "maintainers": [ + { + "name": "jimmycuadra", + "email": "jimmycuadra@gmail.com" + } + ], + "directories": {}, + "_shasum": "66afd47b6a12932d9071cbfd98a52e785cd0ba14", + "_from": "shellwords@^0.1.0", + "_resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.0.tgz" +} diff --git a/node_modules/node-notifier/node_modules/shellwords/spec/shellwords_spec.coffee b/node_modules/node-notifier/node_modules/shellwords/spec/shellwords_spec.coffee new file mode 100644 index 0000000..cc72d18 --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/spec/shellwords_spec.coffee @@ -0,0 +1,55 @@ +shellwords = require "../src/shellwords" + +describe "Shellwords", -> + describe "#split", -> + it "splits normal words", -> + results = shellwords.split "foo bar baz" + (expect results).toEqual ["foo", "bar", "baz"] + + it "splits single quoted phrases", -> + results = shellwords.split "foo 'bar baz'" + (expect results).toEqual ["foo", "bar baz"] + + it "splits double quoted phrases", -> + results = shellwords.split '"foo bar" baz' + (expect results).toEqual ["foo bar", "baz"] + + it "respects escaped characters", -> + results = shellwords.split "foo\\ bar baz" + (expect results).toEqual ["foo bar", "baz"] + + it "respects escaped characters within single quotes", -> + results = shellwords.split "foo 'bar\\ baz'" + (expect results).toEqual ["foo", "bar baz"] + + it "respects escaped characters within double quotes", -> + results = shellwords.split 'foo "bar\\ baz"' + (expect results).toEqual ["foo", "bar baz"] + + it "respects escaped quotes within quotes", -> + results = shellwords.split 'foo "bar\\" baz"' + (expect results).toEqual ['foo', 'bar" baz'] + + results = shellwords.split "foo 'bar\\' baz'" + (expect results).toEqual ["foo", "bar' baz"] + + it "throws on unmatched single quotes", -> + fn = -> + shellwords.split "foo 'bar baz" + + (expect fn).toThrow() + + it "throws on unmatched double quotes", -> + fn = -> + shellwords.split 'foo "bar baz' + + (expect fn).toThrow() + + describe "#escape", -> + it "escapes a string to be safe for shell command line", -> + results = shellwords.escape "foo '\"' bar" + (expect results).toEqual "foo\\ \\'\\\"\\'\\ bar" + + it "dummy escapes any multibyte chars", -> + results = shellwords.escape "あい" + (expect results).toEqual "\\あ\\い" diff --git a/node_modules/node-notifier/node_modules/shellwords/src/shellwords.coffee b/node_modules/node-notifier/node_modules/shellwords/src/shellwords.coffee new file mode 100644 index 0000000..e973721 --- /dev/null +++ b/node_modules/node-notifier/node_modules/shellwords/src/shellwords.coffee @@ -0,0 +1,53 @@ +scan = (string, pattern, callback) -> + result = "" + + while string.length > 0 + match = string.match pattern + + if match + result += string.slice 0, match.index + result += callback match + string = string.slice(match.index + match[0].length) + else + result += string + string = "" + + result + +exports.split = (line = "") -> + words = [] + field = "" + scan line, /// + \s* # Leading whitespace + (?: # + ([^\s\\\'\"]+) # Normal words + | # + '((?:[^\'\\]|\\.)*)' # Stuff in single quotes + | # + "((?:[^\"\\]|\\.)*)" # Stuff in double quotes + | # + (\\.?) # Escaped character + | # + (\S) # Garbage + ) # + (\s|$)? # Seperator + ///, (match) -> + [raw, word, sq, dq, escape, garbage, seperator] = match + + throw new Error "Unmatched quote" if garbage? + + field += (word or (sq or dq or escape).replace(/\\(?=.)/, "")) + + if seperator? + words.push field + field = "" + + words.push field if field + + words + +exports.escape = (str = "") -> + return "''" unless str? + + str.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g, "\\$1").replace(/\n/g, "'\n'") + diff --git a/node_modules/node-notifier/node_modules/which/LICENSE b/node_modules/node-notifier/node_modules/which/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/node-notifier/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/node-notifier/node_modules/which/README.md b/node_modules/node-notifier/node_modules/which/README.md new file mode 100644 index 0000000..ff1eb53 --- /dev/null +++ b/node_modules/node-notifier/node_modules/which/README.md @@ -0,0 +1,5 @@ +The "which" util from npm's guts. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. diff --git a/node_modules/node-notifier/node_modules/which/bin/which b/node_modules/node-notifier/node_modules/which/bin/which new file mode 100755 index 0000000..8432ce2 --- /dev/null +++ b/node_modules/node-notifier/node_modules/which/bin/which @@ -0,0 +1,14 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) { + console.error("Usage: which ") + process.exit(1) +} + +which(process.argv[2], function (er, thing) { + if (er) { + console.error(er.message) + process.exit(er.errno || 127) + } + console.log(thing) +}) diff --git a/node_modules/node-notifier/node_modules/which/package.json b/node_modules/node-notifier/node_modules/which/package.json new file mode 100644 index 0000000..12b84a6 --- /dev/null +++ b/node_modules/node-notifier/node_modules/which/package.json @@ -0,0 +1,46 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "1.0.8", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "which": "./bin/which" + }, + "license": "ISC", + "gitHead": "681a9ebbc447cb428232ddf6c0983006d89e7755", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.8", + "scripts": {}, + "_shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "_from": "which@^1.0.5", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz" +} diff --git a/node_modules/node-notifier/node_modules/which/which.js b/node_modules/node-notifier/node_modules/which/which.js new file mode 100644 index 0000000..f19dd33 --- /dev/null +++ b/node_modules/node-notifier/node_modules/which/which.js @@ -0,0 +1,99 @@ +module.exports = which +which.sync = whichSync + +var path = require("path") + , fs + , COLON = process.platform === "win32" ? ";" : ":" + , isExe + , fs = require("fs") + +if (process.platform == "win32") { + // On windows, there is no good way to check that a file is executable + isExe = function isExe () { return true } +} else { + isExe = function isExe (mod, uid, gid) { + //console.error(mod, uid, gid); + //console.error("isExe?", (mod & 0111).toString(8)) + var ret = (mod & 0001) + || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0100) && process.getuid && uid === process.getuid() + //console.error("isExe?", ret) + return ret + } +} + + + +function which (cmd, cb) { + if (isAbsolute(cmd)) return cb(null, cmd) + var pathEnv = (process.env.PATH || "").split(COLON) + , pathExt = [""] + if (process.platform === "win32") { + pathEnv.push(process.cwd()) + pathExt = (process.env.PATHEXT || ".EXE").split(COLON) + if (cmd.indexOf(".") !== -1) pathExt.unshift("") + } + //console.error("pathEnv", pathEnv) + ;(function F (i, l) { + if (i === l) return cb(new Error("not found: "+cmd)) + var p = path.resolve(pathEnv[i], cmd) + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + //console.error(p + ext) + fs.stat(p + ext, function (er, stat) { + if (!er && + stat && + stat.isFile() && + isExe(stat.mode, stat.uid, stat.gid)) { + //console.error("yes, exe!", p + ext) + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd) { + if (isAbsolute(cmd)) return cmd + var pathEnv = (process.env.PATH || "").split(COLON) + , pathExt = [""] + if (process.platform === "win32") { + pathEnv.push(process.cwd()) + pathExt = (process.env.PATHEXT || ".EXE").split(COLON) + if (cmd.indexOf(".") !== -1) pathExt.unshift("") + } + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var p = path.join(pathEnv[i], cmd) + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var stat + try { stat = fs.statSync(cur) } catch (ex) {} + if (stat && + stat.isFile() && + isExe(stat.mode, stat.uid, stat.gid)) return cur + } + } + throw new Error("not found: "+cmd) +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/node_modules/node-notifier/notifiers/balloon.js b/node_modules/node-notifier/notifiers/balloon.js new file mode 100644 index 0000000..a381338 --- /dev/null +++ b/node_modules/node-notifier/notifiers/balloon.js @@ -0,0 +1,132 @@ +/** + * Wrapper for the notifu 1.6 (http://www.paralint.com/projects/notifu/) + +Usage +/t The type of message to display values are: + info The message is an informational message + warn The message is an warning message + error The message is an error message +/d The number of milliseconds to display (omit or 0 for infinit) +/p The title (or prompt) of the ballon +/m The message text +/i Specify an icon to use ("parent" uses the icon of the parent process) +/e Enable ballon tips in the registry (for this user only) +/q Do not play a sound when the tooltip is displayed +/w Show the tooltip even if the user is in the quiet period that follows his very first login (Windows 7 and up) +/xp Use IUserNotification interface event when IUserNotification2 is available + + +// Kill codes: + 2 = Timeout + 3 = Clicked + + */ +var path = require('path'), + notifier = path.resolve(__dirname, '../vendor/notifu/notifu'), + utils = require('../lib/utils'), + checkGrowl = require('../lib/checkGrowl'), + Toaster = require('./toaster'), + Growl = require('./growl'); + +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var hasGrowl = void 0; + +module.exports = WindowsBalloon; + +function WindowsBalloon (options) { + options = options || {}; + if (!(this instanceof WindowsBalloon)) { + return new WindowsBalloon(options); + } + + this.options = options; + + EventEmitter.call(this); +} +util.inherits(WindowsBalloon, EventEmitter); + +WindowsBalloon.prototype.notify = function (options, callback) { + var fallback, notifierOptions = this.options; + callback = callback || function () {}; + var actionJackedCallback = utils.actionJackerDecorator(this, options, callback, function (data) { + var cleaned = data.toLowerCase().trim(); + if (cleaned === 'activate') { + return 'click'; + } + if (cleaned === 'timeout') { + return 'timeout'; + } + return false; + }); + + if (!!this.options.withFallback && utils.isWin8()) { + fallback = fallback || new Toaster(notifierOptions); + return fallback.notify(options, callback); + } + + if (!!this.options.withFallback && (!utils.isLessThanWin8() || hasGrowl === true)) { + fallback = fallback || new Growl(notifierOptions); + return fallback.notify(options, callback); + } + + if (!this.options.withFallback || hasGrowl === false) { + doNotification(options, notifierOptions, actionJackedCallback); + return this; + } + + checkGrowl(function (hasGrowlResult) { + hasGrowl = hasGrowlResult; + + if (hasGrowl) { + fallback = fallback || new Growl(notifierOptions); + return fallback.notify(options, callback); + } + + doNotification(options, notifierOptions, actionJackedCallback); + }); + + return this; +}; + +var allowedArguments = ["t", "d", "p", "m", "i", "e", "q", "w", "xp"]; + +function doNotification (options, notifierOptions, callback) { + options = options || {}; + options = utils.mapToNotifu(options); + options.p = options.p || 'Node Notification:'; + var localNotifier = notifierOptions.customPath || notifier; + + if (!options.m) { + callback(new Error('Message is required.')); + return this; + } + + var argsList = utils.constructArgumentList(options, { + wrapper: '', + noEscape: true, + explicitTrue: true, + allowedArguments: allowedArguments + }); + + if (!!options.wait) { + return utils.fileCommand(localNotifier, argsList, function (error, data) { + var action = fromErrorCodeToAction(error.code); + if (action === 'error') return callback(error, data); + + return callback(null, action); + }); + } + utils.immediateFileCommand(localNotifier, argsList, callback); +} + +function fromErrorCodeToAction (errorCode) { + if (errorCode === 2) { + return 'timeout'; + } + if (errorCode === 3) { + return 'activate'; + } + return 'error'; +} diff --git a/node_modules/node-notifier/notifiers/growl.js b/node_modules/node-notifier/notifiers/growl.js new file mode 100644 index 0000000..23f4512 --- /dev/null +++ b/node_modules/node-notifier/notifiers/growl.js @@ -0,0 +1,66 @@ +/** + * Wrapper for the growly module + */ +var utils = require('../lib/utils'), + checkGrowl = require('../lib/checkGrowl'); + growly = require('growly'); + +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var errorMessageNotFound = 'Couldn\'t connect to growl (might be used as a fallback). Make sure it is running'; + +module.exports = Growl; + +var hasGrowl = void 0; + +function Growl (options) { + options = options || {}; + if (!(this instanceof Growl)) { + return new Growl(options); + } + + growly.appname = options.name || 'Node'; + + EventEmitter.call(this); +} +util.inherits(Growl, EventEmitter); + + +Growl.prototype.notify = function (options, callback) { + options = options || {}; + callback = utils.actionJackerDecorator(this, options, callback, function (data) { + var cleaned = data.toLowerCase().trim(); + if (cleaned === 'click') { + return 'click'; + } + if (cleaned === 'timedout') { + return 'timeout'; + } + return false; + }); + + options = utils.mapToGrowl(options); + + if (!options.message) { + callback(new Error('Message is required.')); + return this; + } + + options.title = options.title || 'Node Notification:'; + + if (hasGrowl || !!options.wait) { + var localCallback = !!options.wait ? callback : function () {}; + growly.notify(options.message, options, localCallback); + if (!options.wait) callback(); + return this; + } + + checkGrowl(function (didHaveGrowl) { + hasGrowl = didHaveGrowl; + if (!didHaveGrowl) return callback(new Error(errorMessageNotFound)); + growly.notify(options.message, options); + callback(); + }); + return this; +}; diff --git a/node_modules/node-notifier/notifiers/notificationcenter.js b/node_modules/node-notifier/notifiers/notificationcenter.js new file mode 100644 index 0000000..3439bcf --- /dev/null +++ b/node_modules/node-notifier/notifiers/notificationcenter.js @@ -0,0 +1,76 @@ +/** + * A Node.js wrapper for terminal-notify (with fallback). + */ +var path = require('path'), + notifier = path.join(__dirname, '../vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier'), + utils = require('../lib/utils'), + Growl = require('./growl'); + +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var errorMessageOsX = 'You need Mac OS X 10.8 or above to use NotificationCenter,' + + ' or use Growl fallback with constructor option {withFallback: true}.'; + +module.exports = NotificationCenter; + +function NotificationCenter (options) { + options = options || {}; + if (!(this instanceof NotificationCenter)) { + return new NotificationCenter(options); + } + this.options = options; + + EventEmitter.call(this); +} +util.inherits(NotificationCenter, EventEmitter); +var activeId = null; + +NotificationCenter.prototype.notify = function (options, callback) { + var fallbackNotifier = null, id = identificator(); + options = options || {}; + activeId = id; + + callback = callback || function () {}; + var actionJackedCallback = utils.actionJackerDecorator(this, options, callback, function (data) { + if (activeId !== id) return false; + + var cleaned = data.toLowerCase().trim(); + if (cleaned === 'activate') { + return 'click'; + } + if (cleaned === 'timeout') { + return 'timeout'; + } + return false; + }); + + options = utils.mapToMac(options); + if (!!options.wait) { + options.wait = 'YES'; + } + + if (!options.message && !options.group && !options.list && !options.remove) { + callback(new Error('Message, group, remove or list property is required.')); + return this; + } + + var argsList = utils.constructArgumentList(options); + + if(utils.isMountainLion()) { + utils.command(this.options.customPath || notifier, argsList, actionJackedCallback); + return this; + } + + if (fallbackNotifier || !!this.options.withFallback) { + fallbackNotifier = fallbackNotifier || new Growl(this.options); + return fallbackNotifier.notify(options, callback); + } + + callback(new Error(errorMessageOsX)); + return this; +}; + +function identificator () { + return { _ref: 'val' }; +} diff --git a/node_modules/node-notifier/notifiers/notifysend.js b/node_modules/node-notifier/notifiers/notifysend.js new file mode 100644 index 0000000..2c53848 --- /dev/null +++ b/node_modules/node-notifier/notifiers/notifysend.js @@ -0,0 +1,88 @@ +/** + * Node.js wrapper for "notify-send". + */ +var os = require('os'), + which = require('which'), + utils = require('../lib/utils'); + +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var notifier = 'notify-send', hasNotifier = void 0; + +module.exports = NotifySend; + +function NotifySend (options) { + options = options || {}; + if (!(this instanceof NotifySend)) { + return new NotifySend(options); + } + + this.options = options; + + EventEmitter.call(this); +} +util.inherits(NotifySend, EventEmitter); + +NotifySend.prototype.notify = function (options, callback) { + options = options || {}; + callback = callback || function () {}; + + if (!options.message) { + callback(new Error('Message is required.')); + return this; + } + + if (os.type() !== 'Linux') { + callback(new Error('Only supported on Linux systems')); + return this; + } + + if (hasNotifier === false) { + callback(new Error('notify-send must be installed on the system.')); + return this; + } + + if (hasNotifier || !!this.options.suppressOsdCheck) { + doNotification(options, callback); + return this; + } + + which(notifier, function (err) { + hasNotifier = !err; + + if (err) { + return callback(err); + } + + doNotification(options, callback); + }); + return this; +}; + +var allowedArguments = [ + "urgency", + "expire-time", + "icon", + "category", + "hint" +]; + +function doNotification (options, callback) { + var initial, argsList; + + options = utils.mapToNotifySend(options); + options.title = options.title || 'Node Notification:'; + + initial = [options.title, options.message]; + delete options.title; + delete options.message; + + argsList = utils.constructArgumentList(options, { + initial: initial, + keyExtra: '-', + allowedArguments: allowedArguments + }); + + utils.command(notifier, argsList, callback); +} diff --git a/node_modules/node-notifier/notifiers/toaster.js b/node_modules/node-notifier/notifiers/toaster.js new file mode 100644 index 0000000..266116b --- /dev/null +++ b/node_modules/node-notifier/notifiers/toaster.js @@ -0,0 +1,62 @@ +/** + * Wrapper for the toaster (https://github.com/nels-o/toaster) + */ +var path = require('path'), + notifier = path.resolve(__dirname, '../vendor/toaster/toast.exe'), + utils = require('../lib/utils'), + Balloon = require('./balloon'); + +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var fallback = void 0; + +module.exports = WindowsToaster; + +function WindowsToaster (options) { + options = options || {}; + if (!(this instanceof WindowsToaster)) { + return new WindowsToaster(options); + } + + this.options = options; + + EventEmitter.call(this); +} +util.inherits(WindowsToaster, EventEmitter); + +WindowsToaster.prototype.notify = function (options, callback) { + options = options || {}; + + callback = callback || function () {}; + var actionJackedCallback = utils.actionJackerDecorator(this, options, callback, function (data) { + var cleaned = data.toLowerCase().trim(); + if (cleaned === 'activated') { + return 'click'; + } + if (cleaned === 'timeout') { + return 'timeout'; + } + return false; + }); + + options.title = options.title || 'Node Notification:'; + + if (!options.message) { + callback(new Error('Message is required.')); + return this; + } + + if (!utils.isWin8() && !!this.options.withFallback) { + fallback = fallback || new Balloon(this.options); + return fallback.notify(options, callback); + } + + options = utils.mapToWin8(options); + var argsList = utils.constructArgumentList(options, { + wrapper: '', + noEscape: true + }); + utils.fileCommand(this.options.customPath || notifier, argsList, actionJackedCallback); + return this; +}; diff --git a/node_modules/node-notifier/package.json b/node_modules/node-notifier/package.json new file mode 100644 index 0000000..721d60e --- /dev/null +++ b/node_modules/node-notifier/package.json @@ -0,0 +1,67 @@ +{ + "name": "node-notifier", + "version": "4.0.3", + "description": "A Node.js module for sending notifications on native Mac, Windows (post and pre 8) and Linux (or Growl as fallback)", + "main": "index.js", + "directories": { + "example": "example" + }, + "scripts": { + "test": "mocha -R spec" + }, + "repository": { + "type": "git", + "url": "git@github.com:mikaelbr/node-notifier.git" + }, + "keywords": [ + "notification center", + "mac os x 10.8", + "notify", + "terminal-notifier", + "notify-send", + "growl", + "windows 8 notification", + "toaster", + "notification" + ], + "author": { + "name": "Mikael Brevik" + }, + "license": "MIT", + "devDependencies": { + "mocha": "^1.21.4", + "should": "^4.0.4" + }, + "dependencies": { + "semver": "^4.0.3", + "shellwords": "^0.1.0", + "which": "^1.0.5", + "growly": "^1.1.1", + "clone": "^0.1.18" + }, + "gitHead": "8bed44d43d3c463a28b62d75d28337684e0030f9", + "bugs": { + "url": "https://github.com/mikaelbr/node-notifier/issues" + }, + "homepage": "https://github.com/mikaelbr/node-notifier", + "_id": "node-notifier@4.0.3", + "_shasum": "d536dfaa80922552423ec34edf00e1fade9da91b", + "_from": "node-notifier@", + "_npmVersion": "2.1.2", + "_nodeVersion": "0.10.21", + "_npmUser": { + "name": "mikaelb", + "email": "mikaelbre@gmail.com" + }, + "maintainers": [ + { + "name": "mikaelb", + "email": "mikaelbre@gmail.com" + } + ], + "dist": { + "shasum": "d536dfaa80922552423ec34edf00e1fade9da91b", + "tarball": "http://registry.npmjs.org/node-notifier/-/node-notifier-4.0.3.tgz" + }, + "_resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-4.0.3.tgz" +} diff --git a/node_modules/node-notifier/test/balloon.js b/node_modules/node-notifier/test/balloon.js new file mode 100644 index 0000000..0745b3c --- /dev/null +++ b/node_modules/node-notifier/test/balloon.js @@ -0,0 +1,207 @@ +var Notify = require('../notifiers/balloon') + , should = require('should') + , utils = require('../lib/utils') + , os = require('os') + , assert = require('assert'); + +describe('WindowsBalloon', function(){ + + before(function () { + this.original = utils.immediateFileCommand; + this.originalType = os.type; + os.type = function () { + return "Windows_NT"; + }; + }); + + after(function () { + utils.immediateFileCommand = this.original; + os.type = this.originalType; + }); + + it('should pass on title and body', function (done) { + var expected = [ '-m', 'body', '-p', 'title', '-q' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + title: "title", + message: "body" + }, function (err) { + should.not.exist(err); + }) + }); + + it('should pass have default title', function (done) { + var expected = [ '-m', 'body', '-q', '-p', 'Node Notification:' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + message: "body" + }, function (err) { + should.not.exist(err); + }) + }); + + it('should throw error if no message is passed', function (done) { + + utils.immediateFileCommand = function (notifier, argsList, callback) { + should.not.exist(argsList); + }; + + var notifier = new Notify(); + + notifier.notify({ + }, function (err) { + err.message.should.equal("Message is required."); + done(); + }); + }); + + it('should escape message input', function (done) { + var expected = [ '-m', 'some "me\'ss\`age\`\"', '-q', '-p', 'Node Notification:' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + message: 'some "me\'ss`age`"' + }, function (err) { + should.not.exist(err); + }) + }); + + it('should be able to deactivate silent mode', function (done) { + var expected = [ '-m', 'body', '-p', 'Node Notification:' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + message: "body", + sound: true + }, function (err) { + should.not.exist(err); + }) + }); + + + it('should be able to deactivate silent mode, by doing quiet false', function (done) { + var expected = [ '-m', 'body', '-p', 'Node Notification:' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + message: "body", + quiet: false + }, function (err) { + should.not.exist(err); + }) + }); + + it('should send set time', function (done) { + var expected = [ '-m', 'body', '-p', 'title', '-d', '1000', '-q' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + title: "title", + message: "body", + time: "1000" + }, function (err) { + should.not.exist(err); + }) + }); + + it('should not send false flags', function (done) { + var expected = [ '-d', '1000', '-i', 'icon', '-m', 'body', '-p', 'title', '-q' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + title: "title", + message: "body", + d: "1000", + icon: 'icon', + w: false + }, function (err) { + should.not.exist(err); + }) + }); + + + it('should send additional parameters as --"keyname"', function (done) { + var expected = [ '-d', '1000', '-w', '-i', 'icon', '-m', 'body', '-p', 'title', '-q' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + title: "title", + message: "body", + d: "1000", + icon: 'icon', + w: true + }, function (err) { + should.not.exist(err); + }) + }); + + it('should remove extra options that are not supported by notifu', function (done) { + var expected = [ '-m', 'body', '-p', 'title', '-q' ]; + + utils.immediateFileCommand = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify(); + + notifier.notify({ + title: "title", + message: "body", + tullball: "notValid" + }, function (err) { + should.not.exist(err); + }) + }); + +}); diff --git a/node_modules/node-notifier/test/fixture/coulson.jpg b/node_modules/node-notifier/test/fixture/coulson.jpg new file mode 100644 index 0000000..505ee19 Binary files /dev/null and b/node_modules/node-notifier/test/fixture/coulson.jpg differ diff --git a/node_modules/node-notifier/test/fixture/listAll.txt b/node_modules/node-notifier/test/fixture/listAll.txt new file mode 100644 index 0000000..19cf5e1 --- /dev/null +++ b/node_modules/node-notifier/test/fixture/listAll.txt @@ -0,0 +1,3 @@ +GroupID Title Subtitle Message Delivered At +(null) Terminal (null) Hello World 2014-05-27 15:23:11 +0000 +(null) Terminal (null) 2014-05-27 14:42:24 +0000 \ No newline at end of file diff --git a/node_modules/node-notifier/test/fixture/removeAll.txt b/node_modules/node-notifier/test/fixture/removeAll.txt new file mode 100644 index 0000000..81ce57a --- /dev/null +++ b/node_modules/node-notifier/test/fixture/removeAll.txt @@ -0,0 +1,2 @@ +* Removing previously sent notification, which was sent on: 2014-05-27 15:23:11 +0000 +* Removing previously sent notification, which was sent on: 2014-05-27 14:42:24 +0000 \ No newline at end of file diff --git a/node_modules/node-notifier/test/index.js b/node_modules/node-notifier/test/index.js new file mode 100644 index 0000000..2c74f24 --- /dev/null +++ b/node_modules/node-notifier/test/index.js @@ -0,0 +1,30 @@ +var should = require('should'); + +var notifier = require('../'); + +describe('constructors', function(){ + + it('should expose a default selected instance', function () { + should(notifier.notify).be.ok; + }); + + it('should expose a default selected constructor function', function () { + should(notifier instanceof notifier.Notification).be.ok; + }); + + it('should expose constructor for WindowsBalloon', function () { + should(notifier.WindowsBalloon).be.ok; + }); + + it('should expose constructor for WindowsToaster', function () { + should(notifier.WindowsToaster).be.ok; + }); + + it('should expose constructor for NotifySend', function () { + should(notifier.NotifySend).be.ok; + }); + + it('should expose constructor for Growl', function () { + should(notifier.Growl).be.ok; + }); +}); diff --git a/node_modules/node-notifier/test/notify-send.js b/node_modules/node-notifier/test/notify-send.js new file mode 100644 index 0000000..2cc64d8 --- /dev/null +++ b/node_modules/node-notifier/test/notify-send.js @@ -0,0 +1,136 @@ +var Notify = require('../notifiers/notifysend') + , should = require('should') + , utils = require('../lib/utils') + , os = require('os') + , assert = require('assert'); + +describe('notify-send', function(){ + + before(function () { + this.original = utils.command; + this.originalType = os.type; + os.type = function () { + return "Linux"; + }; + }); + + after(function () { + utils.command = this.original; + os.type = this.originalType; + }); + + it('should pass on title and body', function (done) { + var expected = [ '"title"', '"body"' ]; + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify({ suppressOsdCheck: true }); + + notifier.notify({ + title: "title", + message: "body" + }, function (err) { + should.not.exist(err); + done(); + }) + }); + + it('should pass have default title', function (done) { + var expected = [ '"Node Notification:"', '"body"' ]; + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify({ suppressOsdCheck: true }); + + notifier.notify({ + message: "body" + }, function (err) { + should.not.exist(err); + done(); + }) + }); + + + it('should throw error if no message is passed', function (done) { + + utils.command = function (notifier, argsList, callback) { + should.not.exist(argsList); + done(); + }; + + var notifier = new Notify({ suppressOsdCheck: true }); + + notifier.notify({ + }, function (err) { + err.message.should.equal("Message is required."); + done(); + }) + }); + + + it('should escape message input', function (done) { + var expected = [ '"Node Notification:"', '"some \\"me\'ss\\`age\\`\\""' ]; + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify({ suppressOsdCheck: true }); + + notifier.notify({ + message: 'some "me\'ss`age`"' + }, function (err) { + should.not.exist(err); + done(); + }) + }); + + it('should send additional parameters as --"keyname"', function (done) { + var expected = [ '"title"', '"body"', '--icon', '"icon-string"' ] + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify({ suppressOsdCheck: true }); + + notifier.notify({ + title: "title", + message: "body", + icon: "icon-string" + }, function (err) { + should.not.exist(err); + done(); + }) + }); + + it('should remove extra options that are not supported by notify-send', function (done) { + var expected = [ '"title"', '"body"', '--icon', '"icon-string"' ] + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new Notify({ suppressOsdCheck: true }); + + notifier.notify({ + title: "title", + message: "body", + icon: "icon-string", + tullball: "notValid" + }, function (err) { + should.not.exist(err); + done(); + }) + }); + +}); diff --git a/node_modules/node-notifier/test/terminal-notifier.js b/node_modules/node-notifier/test/terminal-notifier.js new file mode 100644 index 0000000..df141a8 --- /dev/null +++ b/node_modules/node-notifier/test/terminal-notifier.js @@ -0,0 +1,210 @@ +var NotificationCenter = require('../notifiers/notificationcenter') + , Growl = require('../notifiers/growl') + , should = require('should') + , os = require('os') + , fs = require('fs') + , utils = require('../lib/utils') + , assert = require('assert'); + +var notifier = null; +var originalUtils = utils.command; +var originalMacVersion = utils.isMountainLion; +var originalType = os.type; + +describe('Mac fallback', function () { + var original = utils.isMountainLion; + var originalMac = utils.isMac; + + after(function () { + utils.isMountainLion = original; + utils.isMac = originalMac; + }) + + it('should default to Growl notification if older Mac OSX than 10.8', function(done){ + utils.isMountainLion = function () { + return false; + }; + utils.isMac = function () { + return true; + }; + var n = new NotificationCenter({ withFallback: true }); + + n.notify({ + message: "Hello World" + }, function (err, response) { + (this instanceof Growl).should.be.true; + done(); + }); + + }); + + it('should not fallback to Growl notification if withFallback is false', function(done){ + utils.isMountainLion = function () { + return false; + }; + utils.isMac = function () { + return true; + }; + var n = new NotificationCenter(); + n.notify({ + message: "Hello World" + }, function (err, response) { + err.should.be.ok; + (this instanceof Growl).should.be.false; + done(); + }); + + }); +}); + +describe('terminal-notifier', function(){ + + before(function () { + os.type = function () { + return "Darwin"; + }; + + utils.isMountainLion = function () { + return true; + } + }); + + beforeEach(function () { + notifier = new NotificationCenter(); + }); + + after(function () { + os.type = originalType; + utils.isMountainLion = originalMacVersion; + }); + + describe('#notify()', function(){ + + beforeEach(function () { + utils.command = function (n, o, cb) { + cb(null, ""); + } + }); + + after(function () { + utils.command = originalUtils; + }); + + it('should notify with a message', function(done){ + + notifier.notify({ + message: "Hello World" + }, function (err, response) { + (err === null).should.be.true; + done(); + }); + + }); + + + it('should be chainable', function(done){ + + notifier.notify({ + message: "First test" + }).notify({ + message: "Second test" + }, function (err, response) { + (err === null).should.be.true; + done(); + }); + + }); + + it('should be able to list all notifications', function(done){ + utils.command = function (n, o, cb) { + cb(null, fs.readFileSync(__dirname + '/fixture/listAll.txt').toString()); + }; + + notifier.notify({ + list: "ALL" + }, function (err, response) { + response.should.be.ok; + done(); + }); + }); + + + it('should be able to remove all messages', function(done){ + utils.command = function (n, o, cb) { + cb(null, fs.readFileSync(__dirname + '/fixture/removeAll.txt').toString()); + } + + notifier.notify({ + remove: "ALL" + }, function (err, response) { + response.should.be.ok; + + utils.command = function (n, o, cb) { + cb(null, ""); + } + + notifier.notify({ + list: "ALL" + }, function (err, response) { + response.should.not.be.ok; + done(); + }); + }); + }); + }); + + describe("arguments", function () { + before(function () { + this.original = utils.command; + }); + + after(function () { + utils.command = this.original; + }); + + it('should allow for non-sensical arguments (fail gracefully)', function (done) { + var expected = [ '-title', '"title"', '-message', '"body"', '-tullball', '"notValid"' ] + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new NotificationCenter(); + notifier.isNotifyChecked = true; + notifier.hasNotifier = true; + + notifier.notify({ + title: "title", + message: "body", + tullball: "notValid" + }, function (err) { + should.not.exist(err); + done(); + }); + }); + + it('should escape all title and message', function (done) { + var expected = [ '-title', '"title \\"message\\""', + '-message', '"body \\"message\\""', '-tullball', '"notValid"' ] + + utils.command = function (notifier, argsList, callback) { + argsList.should.eql(expected); + done(); + }; + + var notifier = new NotificationCenter(); + notifier.isNotifyChecked = true; + notifier.hasNotifier = true; + + notifier.notify({ + title: 'title "message"', + message: 'body "message"', + tullball: "notValid" + }, function (err) { + should.not.exist(err); + done(); + }); + }); + }); +}); diff --git a/node_modules/node-notifier/test/utils.js b/node_modules/node-notifier/test/utils.js new file mode 100644 index 0000000..6939cce --- /dev/null +++ b/node_modules/node-notifier/test/utils.js @@ -0,0 +1,101 @@ +var should = require('should'), + path = require('path'), + os = require('os'), + fs = require('fs'); + +var _ = require('../lib/utils'); + +describe('utils', function(){ + + describe('mapping', function () { + + it('should map icon for notify-send', function () { + var expected = { + title: 'Foo', + message: 'Bar', + icon: 'foobar' + }; + + _.mapToNotifySend({ + title: 'Foo', + message: 'Bar', + appIcon: 'foobar' + }).should.eql(expected); + + _.mapToNotifySend({ + title: 'Foo', + message: 'Bar', + i: 'foobar' + }).should.eql(expected); + }); + + it('should map short hand for notify-sned', function () { + var expected = { + urgency: 'a', + 'expire-time': 'b', + category: 'c', + icon: 'd', + hint: 'e' + }; + + _.mapToNotifySend({ + u: 'a', + e: 'b', + c: 'c', + i: 'd', + h: 'e' + }).should.eql(expected); + }); + + it('should map icon for notification center', function () { + var expected = { + title: 'Foo', + message: 'Bar', + appIcon: 'foobar' + }; + + _.mapToMac({ + title: 'Foo', + message: 'Bar', + icon: 'foobar' + }).should.eql(expected); + + _.mapToMac({ + title: 'Foo', + message: 'Bar', + i: 'foobar' + }).should.eql(expected); + }); + + it('should map icon for growl', function () { + var icon = path.join(__dirname, 'fixture', 'coulson.jpg'); + var iconRead = fs.readFileSync(icon); + + var expected = { + title: 'Foo', + message: 'Bar', + icon: fs.readFileSync(icon) + }; + + var obj = _.mapToGrowl({ + title: 'Foo', + message: 'Bar', + icon: icon + }); + + obj.should.have.property('icon'); + (Buffer.isBuffer(obj.icon)).should.be.true; + + var obj = _.mapToGrowl({ + title: 'Foo', + message: 'Bar', + appIcon: icon + }); + + obj.should.have.property('icon'); + (Buffer.isBuffer(obj.icon)).should.be.true; + }); + + }); + +}); diff --git a/node_modules/node-notifier/vendor/notifu/notifu.exe b/node_modules/node-notifier/vendor/notifu/notifu.exe new file mode 100755 index 0000000..33938d7 Binary files /dev/null and b/node_modules/node-notifier/vendor/notifu/notifu.exe differ diff --git a/node_modules/node-notifier/vendor/notifu/notifu.pdb b/node_modules/node-notifier/vendor/notifu/notifu.pdb new file mode 100644 index 0000000..5b0184a Binary files /dev/null and b/node_modules/node-notifier/vendor/notifu/notifu.pdb differ diff --git a/node_modules/node-notifier/vendor/notifu/notifu64.exe b/node_modules/node-notifier/vendor/notifu/notifu64.exe new file mode 100755 index 0000000..32e80cc Binary files /dev/null and b/node_modules/node-notifier/vendor/notifu/notifu64.exe differ diff --git a/node_modules/node-notifier/vendor/notifu/notifu64.pdb b/node_modules/node-notifier/vendor/notifu/notifu64.pdb new file mode 100644 index 0000000..3cd468f Binary files /dev/null and b/node_modules/node-notifier/vendor/notifu/notifu64.pdb differ diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Info.plist b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Info.plist new file mode 100644 index 0000000..080394c --- /dev/null +++ b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 13E28 + CFBundleDevelopmentRegion + en + CFBundleExecutable + terminal-notifier + CFBundleIconFile + Terminal + CFBundleIdentifier + nl.superalloy.oss.terminal-notifier + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + terminal-notifier + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.6.1 + CFBundleSignature + ???? + CFBundleVersion + 12 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 6A317 + DTPlatformVersion + GM + DTSDKBuild + 13F26 + DTSDKName + macosx10.9 + DTXcode + 0600 + DTXcodeBuild + 6A317 + LSMinimumSystemVersion + 10.8 + LSUIElement + + NSHumanReadableCopyright + Copyright © 2012 Eloy Durán. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier new file mode 100755 index 0000000..6bb4cf9 Binary files /dev/null and b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier differ diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/PkgInfo b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/PkgInfo new file mode 100644 index 0000000..bd04210 --- /dev/null +++ b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/Terminal.icns b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/Terminal.icns new file mode 100644 index 0000000..8d8f5c2 Binary files /dev/null and b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/Terminal.icns differ diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/Credits.rtf b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/Credits.rtf new file mode 100644 index 0000000..46576ef --- /dev/null +++ b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/InfoPlist.strings b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..5e45963 Binary files /dev/null and b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/InfoPlist.strings differ diff --git a/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib new file mode 100644 index 0000000..e8aa93b Binary files /dev/null and b/node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib differ diff --git a/node_modules/node-notifier/vendor/toaster/Microsoft.WindowsAPICodePack.Shell.dll b/node_modules/node-notifier/vendor/toaster/Microsoft.WindowsAPICodePack.Shell.dll new file mode 100755 index 0000000..82f3356 Binary files /dev/null and b/node_modules/node-notifier/vendor/toaster/Microsoft.WindowsAPICodePack.Shell.dll differ diff --git a/node_modules/node-notifier/vendor/toaster/Microsoft.WindowsAPICodePack.dll b/node_modules/node-notifier/vendor/toaster/Microsoft.WindowsAPICodePack.dll new file mode 100755 index 0000000..5b1b620 Binary files /dev/null and b/node_modules/node-notifier/vendor/toaster/Microsoft.WindowsAPICodePack.dll differ diff --git a/node_modules/node-notifier/vendor/toaster/toast.exe b/node_modules/node-notifier/vendor/toaster/toast.exe new file mode 100755 index 0000000..eac669c Binary files /dev/null and b/node_modules/node-notifier/vendor/toaster/toast.exe differ diff --git a/src/assets/js/app.js b/src/assets/js/app.js index daf8dbf..1b567f9 100644 --- a/src/assets/js/app.js +++ b/src/assets/js/app.js @@ -27,21 +27,11 @@ var App = (function() { if (app.counters.length) { var source = $('#timer-template').html(); - // console.log(app.counters); - for (i in app.counters) { if (app.counters[i]) { - if (!app.counters.length) { - return; - } - var c = app.counters[i]; - - if (!c.issue) { - continue; - } - var $counter = $counters.children('li[data-id="' + c.issue.id + '"]'); + var $counter = $counters.children('li[data-id="' + c.issue.id + '"]'); if (!$counter.length) { var template = Handlebars.compile(source); @@ -74,17 +64,6 @@ var App = (function() { app.checkTimers(); }, 1000); } - - this.loadActivities = function(callback) { - var success = function(json) { - app.activities = json.time_entry_activities; - callback(app); - } - - app.get('enumerations/time_entry_activities.json', success, { - limit: 1000 - }); - } this.loadProjects = function() { app.setTitle('Projects', app.loadProjects); @@ -129,34 +108,31 @@ var App = (function() { this.loadUpdatePanel = function() { if (app.counters.length) { - app.loadActivities(function() { - var counters = []; - var today = new Date(); - var currentDate = [today.getFullYear(), today.getMonth() + 1, today.getDate()].join('-'); + var counters = []; + var today = new Date(); + var currentDate = [today.getFullYear(), today.getMonth() + 1, today.getDate()].join('-'); - for (i in app.counters) { - if (app.counters[i]) { - if (app.counters[i].value !== 0) { - app.counters[i].started = false; - var c = app.counters[i]; - c.update = { - time: app.convertTime(c.time + 60, true), - date: currentDate - }; - counters.push(c); - } - } - } + for (i in app.counters) { + if (app.counters[i]) { + if (app.counters[i].value !== 0) { + app.counters[i].started = false; + var c = app.counters[i]; + c.update = { + time: app.convertTime(c.time + 60, true), + date: currentDate + }; + counters.push(c); + } + } + } - if (counters.length) { - app.json2html({ - counters: counters, - activities: app.activities - }, 'update-panel'); + if (counters.length) { + app.json2html({ + counters: counters + }, 'update-panel'); - $('#do-update').click(app.doUpdate); - } - }); + $('#do-update').click(app.doUpdate); + } } } @@ -165,9 +141,7 @@ var App = (function() { return $('#time_' + field + '_' + issueId).val(); } - var $issueTimes = $('.issue-time'); - var issueTimesLength = $issueTimes.length; - $issueTimes.each(function() { + $('.issue-time').each(function() { var $form = $(this); var issueId = $(this).data('issue'); var data = { @@ -183,28 +157,25 @@ var App = (function() { app.post( 'time_entries.xml', function() { - $form.remove(); + //$form.remove(); }, data, 'time_entry' ); }); - window.setTimeout(function() { - if (!$('.issue-time').length) { - app.flash('Some forms are not correct.', 'danger'); - } else { - $('#content').empty(); - $('#counters > ul').remove(); - //delete app.counters; - //app.counters = []; + if (!$('.issue-time').length) { + app.flash('Some forms are not correct.', 'danger'); + } else { + app.counters = []; + $('#content').empty(); + $('#counters > ul').remove(); - app.flash('Redmine has been fully updated!', 'info'); + app.flash('Redmine has been fully updated!', 'info'); - window.setTimeout(function() { - app.loadProjects(); - }, 1000); - } - }, issueTimesLength * 100); + window.setTimeout(function() { + app.loadProjects(); + }, 3000); + } } this.setTitle = function(name, clickCallback) { @@ -290,9 +261,6 @@ var App = (function() { var minutes = parseInt(s / 60) % 60; var seconds = s % 60; - minutes = (minutes < 10 ? '' : '0') + minutes.toString(); - seconds = (seconds < 10 ? '' : '0') + seconds.toString(); - if (redmineFormat) { return hours + 'h' + minutes; } @@ -340,12 +308,11 @@ var App = (function() { return callback(e); } }, - error: function(a, b, c) { + error: function() { $('#content').show(); $('#loading').hide(); console.log('Request failed.'); - console.log([uri, type, data]); - console.log(c); + console.log([uri, type, data]); app.flash('Request failed.', 'danger'); }, always: function() {} diff --git a/src/index.html b/src/index.html index ef427e3..3695d53 100644 --- a/src/index.html +++ b/src/index.html @@ -121,9 +121,15 @@