';
- html += '';
- html += '';
-
- //adjust maxDate to reflect the maxSpan setting in order to
- //grey out end dates beyond the maxSpan
- if (this.endDate == null && this.maxSpan) {
- var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day');
- if (!maxDate || maxLimit.isBefore(maxDate)) {
- maxDate = maxLimit;
- }
- }
-
- for (var row = 0; row < 6; row++) {
- html += '
';
-
- // add week number
- if (this.showWeekNumbers)
- html += '
' + calendar[row][0].week() + '
';
- else if (this.showISOWeekNumbers)
- html += '
' + calendar[row][0].isoWeek() + '
';
-
- for (var col = 0; col < 7; col++) {
-
- var classes = [];
-
- //highlight today's date
- if (calendar[row][col].isSame(new Date(), "day"))
- classes.push('today');
-
- //highlight weekends
- if (calendar[row][col].isoWeekday() > 5)
- classes.push('weekend');
-
- //grey out the dates in other months displayed at beginning and end of this calendar
- if (calendar[row][col].month() != calendar[1][1].month())
- classes.push('off');
-
- //don't allow selection of dates before the minimum date
- if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day'))
- classes.push('off', 'disabled');
-
- //don't allow selection of dates after the maximum date
- if (maxDate && calendar[row][col].isAfter(maxDate, 'day'))
- classes.push('off', 'disabled');
-
- //don't allow selection of date if a custom function decides it's invalid
- if (this.isInvalidDate(calendar[row][col]))
- classes.push('off', 'disabled');
-
- //highlight the currently selected start date
- if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD'))
- classes.push('active', 'start-date');
-
- //highlight the currently selected end date
- if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD'))
- classes.push('active', 'end-date');
-
- //highlight dates in-between the selected dates
- if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate)
- classes.push('in-range');
-
- //apply custom classes for this date
- var isCustom = this.isCustomDate(calendar[row][col]);
- if (isCustom !== false) {
- if (typeof isCustom === 'string')
- classes.push(isCustom);
- else
- Array.prototype.push.apply(classes, isCustom);
- }
-
- var cname = '', disabled = false;
- for (var i = 0; i < classes.length; i++) {
- cname += classes[i] + ' ';
- if (classes[i] == 'disabled')
- disabled = true;
- }
- if (!disabled)
- cname += 'available';
-
- html += '
' + calendar[row][col].date() + '
';
-
- }
- html += '
';
- }
-
- html += '';
- html += '
';
-
- this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html);
-
- },
-
- renderTimePicker: function(side) {
-
- // Don't bother updating the time picker if it's currently disabled
- // because an end date hasn't been clicked yet
- if (side == 'right' && !this.endDate) return;
-
- var html, selected, minDate, maxDate = this.maxDate;
-
- if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isAfter(this.maxDate)))
- maxDate = this.startDate.clone().add(this.maxSpan);
-
- if (side == 'left') {
- selected = this.startDate.clone();
- minDate = this.minDate;
- } else if (side == 'right') {
- selected = this.endDate.clone();
- minDate = this.startDate;
-
- //Preserve the time already selected
- var timeSelector = this.container.find('.drp-calendar.right .calendar-time');
- if (timeSelector.html() != '') {
-
- selected.hour(selected.hour() || timeSelector.find('.hourselect option:selected').val());
- selected.minute(selected.minute() || timeSelector.find('.minuteselect option:selected').val());
- selected.second(selected.second() || timeSelector.find('.secondselect option:selected').val());
-
- if (!this.timePicker24Hour) {
- var ampm = timeSelector.find('.ampmselect option:selected').val();
- if (ampm === 'PM' && selected.hour() < 12)
- selected.hour(selected.hour() + 12);
- if (ampm === 'AM' && selected.hour() === 12)
- selected.hour(0);
- }
-
- }
-
- if (selected.isBefore(this.startDate))
- selected = this.startDate.clone();
-
- if (maxDate && selected.isAfter(maxDate))
- selected = maxDate.clone();
-
- }
-
- //
- // hours
- //
-
- html = ' ';
-
- //
- // minutes
- //
-
- html += ': ';
-
- //
- // seconds
- //
-
- if (this.timePickerSeconds) {
- html += ': ';
- }
-
- //
- // AM/PM
- //
-
- if (!this.timePicker24Hour) {
- html += '';
- }
-
- this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html);
-
- },
-
- updateFormInputs: function() {
-
- if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
- this.container.find('button.applyBtn').removeAttr('disabled');
- } else {
- this.container.find('button.applyBtn').attr('disabled', 'disabled');
- }
-
- },
-
- move: function() {
- var parentOffset = { top: 0, left: 0 },
- containerTop;
- var parentRightEdge = $(window).width();
- if (!this.parentEl.is('body')) {
- parentOffset = {
- top: this.parentEl.offset().top - this.parentEl.scrollTop(),
- left: this.parentEl.offset().left - this.parentEl.scrollLeft()
- };
- parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
- }
-
- if (this.drops == 'up')
- containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
- else
- containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
- this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('drop-up');
-
- if (this.opens == 'left') {
- this.container.css({
- top: containerTop,
- right: parentRightEdge - this.element.offset().left - this.element.outerWidth(),
- left: 'auto'
- });
- if (this.container.offset().left < 0) {
- this.container.css({
- right: 'auto',
- left: 9
- });
- }
- } else if (this.opens == 'center') {
- this.container.css({
- top: containerTop,
- left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
- - this.container.outerWidth() / 2,
- right: 'auto'
- });
- if (this.container.offset().left < 0) {
- this.container.css({
- right: 'auto',
- left: 9
- });
- }
- } else {
- this.container.css({
- top: containerTop,
- left: this.element.offset().left - parentOffset.left,
- right: 'auto'
- });
- if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
- this.container.css({
- left: 'auto',
- right: 0
- });
- }
- }
- },
-
- show: function(e) {
- if (this.isShowing) return;
-
- // Create a click proxy that is private to this instance of datepicker, for unbinding
- this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
-
- // Bind global datepicker mousedown for hiding and
- $(document)
- .on('mousedown.daterangepicker', this._outsideClickProxy)
- // also support mobile devices
- .on('touchend.daterangepicker', this._outsideClickProxy)
- // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
- .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
- // and also close when focus changes to outside the picker (eg. tabbing between controls)
- .on('focusin.daterangepicker', this._outsideClickProxy);
-
- // Reposition the picker if the window is resized while it's open
- $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
-
- this.oldStartDate = this.startDate.clone();
- this.oldEndDate = this.endDate.clone();
- this.previousRightTime = this.endDate.clone();
-
- this.updateView();
- this.container.show();
- this.move();
- this.element.trigger('show.daterangepicker', this);
- this.isShowing = true;
- },
-
- hide: function(e) {
- if (!this.isShowing) return;
-
- //incomplete date selection, revert to last values
- if (!this.endDate) {
- this.startDate = this.oldStartDate.clone();
- this.endDate = this.oldEndDate.clone();
- }
-
- //if a new date range was selected, invoke the user callback function
- if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
- this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel);
-
- //if picker is attached to a text input, update it
- this.updateElement();
-
- $(document).off('.daterangepicker');
- $(window).off('.daterangepicker');
- this.container.hide();
- this.element.trigger('hide.daterangepicker', this);
- this.isShowing = false;
- },
-
- toggle: function(e) {
- if (this.isShowing) {
- this.hide();
- } else {
- this.show();
- }
- },
-
- outsideClick: function(e) {
- var target = $(e.target);
- // if the page is clicked anywhere except within the daterangerpicker/button
- // itself then call this.hide()
- if (
- // ie modal dialog fix
- e.type == "focusin" ||
- target.closest(this.element).length ||
- target.closest(this.container).length ||
- target.closest('.calendar-table').length
- ) return;
- this.hide();
- this.element.trigger('outsideClick.daterangepicker', this);
- },
-
- showCalendars: function() {
- this.container.addClass('show-calendar');
- this.move();
- this.element.trigger('showCalendar.daterangepicker', this);
- },
-
- hideCalendars: function() {
- this.container.removeClass('show-calendar');
- this.element.trigger('hideCalendar.daterangepicker', this);
- },
-
- clickRange: function(e) {
- var label = e.target.getAttribute('data-range-key');
- this.chosenLabel = label;
- if (label == this.locale.customRangeLabel) {
- this.showCalendars();
- } else {
- var dates = this.ranges[label];
- this.startDate = dates[0];
- this.endDate = dates[1];
-
- if (!this.timePicker) {
- this.startDate.startOf('day');
- this.endDate.endOf('day');
- }
-
- if (!this.alwaysShowCalendars)
- this.hideCalendars();
- this.clickApply();
- }
- },
-
- clickPrev: function(e) {
- var cal = $(e.target).parents('.drp-calendar');
- if (cal.hasClass('left')) {
- this.leftCalendar.month.subtract(1, 'month');
- if (this.linkedCalendars)
- this.rightCalendar.month.subtract(1, 'month');
- } else {
- this.rightCalendar.month.subtract(1, 'month');
- }
- this.updateCalendars();
- },
-
- clickNext: function(e) {
- var cal = $(e.target).parents('.drp-calendar');
- if (cal.hasClass('left')) {
- this.leftCalendar.month.add(1, 'month');
- } else {
- this.rightCalendar.month.add(1, 'month');
- if (this.linkedCalendars)
- this.leftCalendar.month.add(1, 'month');
- }
- this.updateCalendars();
- },
-
- hoverDate: function(e) {
-
- //ignore dates that can't be selected
- if (!$(e.target).hasClass('available')) return;
-
- var title = $(e.target).attr('data-title');
- var row = title.substr(1, 1);
- var col = title.substr(3, 1);
- var cal = $(e.target).parents('.drp-calendar');
- var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
- //highlight the dates between the start date and the date being hovered as a potential end date
- var leftCalendar = this.leftCalendar;
- var rightCalendar = this.rightCalendar;
- var startDate = this.startDate;
- if (!this.endDate) {
- this.container.find('.drp-calendar tbody td').each(function(index, el) {
-
- //skip week numbers, only look at dates
- if ($(el).hasClass('week')) return;
-
- var title = $(el).attr('data-title');
- var row = title.substr(1, 1);
- var col = title.substr(3, 1);
- var cal = $(el).parents('.drp-calendar');
- var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];
-
- if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) {
- $(el).addClass('in-range');
- } else {
- $(el).removeClass('in-range');
- }
-
- });
- }
-
- },
-
- clickDate: function(e) {
-
- if (!$(e.target).hasClass('available')) return;
-
- var title = $(e.target).attr('data-title');
- var row = title.substr(1, 1);
- var col = title.substr(3, 1);
- var cal = $(e.target).parents('.drp-calendar');
- var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
- //
- // this function needs to do a few things:
- // * alternate between selecting a start and end date for the range,
- // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date
- // * if autoapply is enabled, and an end date was chosen, apply the selection
- // * if single date picker mode, and time picker isn't enabled, apply the selection immediately
- // * if one of the inputs above the calendars was focused, cancel that manual input
- //
-
- if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start
- if (this.timePicker) {
- var hour = parseInt(this.container.find('.left .hourselect').val(), 10);
- if (!this.timePicker24Hour) {
- var ampm = this.container.find('.left .ampmselect').val();
- if (ampm === 'PM' && hour < 12)
- hour += 12;
- if (ampm === 'AM' && hour === 12)
- hour = 0;
- }
- var minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
- var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
- date = date.clone().hour(hour).minute(minute).second(second);
- }
- this.endDate = null;
- this.setStartDate(date.clone());
- } else if (!this.endDate && date.isBefore(this.startDate)) {
- //special case: clicking the same date for start/end,
- //but the time of the end date is before the start date
- this.setEndDate(this.startDate.clone());
- } else { // picking end
- if (this.timePicker) {
- var hour = parseInt(this.container.find('.right .hourselect').val(), 10);
- if (!this.timePicker24Hour) {
- var ampm = this.container.find('.right .ampmselect').val();
- if (ampm === 'PM' && hour < 12)
- hour += 12;
- if (ampm === 'AM' && hour === 12)
- hour = 0;
- }
- var minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
- var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
- date = date.clone().hour(hour).minute(minute).second(second);
- }
- this.setEndDate(date.clone());
- if (this.autoApply) {
- this.calculateChosenLabel();
- this.clickApply();
- }
- }
-
- if (this.singleDatePicker) {
- this.setEndDate(this.startDate);
- if (!this.timePicker)
- this.clickApply();
- }
-
- this.updateView();
-
- //This is to cancel the blur event handler if the mouse was in one of the inputs
- e.stopPropagation();
-
- },
-
- calculateChosenLabel: function () {
- var customRange = true;
- var i = 0;
- for (var range in this.ranges) {
- if (this.timePicker) {
- var format = this.timePickerSeconds ? "YYYY-MM-DD hh:mm:ss" : "YYYY-MM-DD hh:mm";
- //ignore times when comparing dates if time picker seconds is not enabled
- if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
- customRange = false;
- this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
- break;
- }
- } else {
- //ignore times when comparing dates if time picker is not enabled
- if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) {
- customRange = false;
- this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
- break;
- }
- }
- i++;
- }
- if (customRange) {
- if (this.showCustomRangeLabel) {
- this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key');
- } else {
- this.chosenLabel = null;
- }
- this.showCalendars();
- }
- },
-
- clickApply: function(e) {
- this.hide();
- this.element.trigger('apply.daterangepicker', this);
- },
-
- clickCancel: function(e) {
- this.startDate = this.oldStartDate;
- this.endDate = this.oldEndDate;
- this.hide();
- this.element.trigger('cancel.daterangepicker', this);
- },
-
- monthOrYearChanged: function(e) {
- var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'),
- leftOrRight = isLeft ? 'left' : 'right',
- cal = this.container.find('.drp-calendar.'+leftOrRight);
-
- // Month must be Number for new moment versions
- var month = parseInt(cal.find('.monthselect').val(), 10);
- var year = cal.find('.yearselect').val();
-
- if (!isLeft) {
- if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
- month = this.startDate.month();
- year = this.startDate.year();
- }
- }
-
- if (this.minDate) {
- if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
- month = this.minDate.month();
- year = this.minDate.year();
- }
- }
-
- if (this.maxDate) {
- if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
- month = this.maxDate.month();
- year = this.maxDate.year();
- }
- }
-
- if (isLeft) {
- this.leftCalendar.month.month(month).year(year);
- if (this.linkedCalendars)
- this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month');
- } else {
- this.rightCalendar.month.month(month).year(year);
- if (this.linkedCalendars)
- this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month');
- }
- this.updateCalendars();
- },
-
- timeChanged: function(e) {
-
- var cal = $(e.target).closest('.drp-calendar'),
- isLeft = cal.hasClass('left');
-
- var hour = parseInt(cal.find('.hourselect').val(), 10);
- var minute = parseInt(cal.find('.minuteselect').val(), 10);
- var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;
-
- if (!this.timePicker24Hour) {
- var ampm = cal.find('.ampmselect').val();
- if (ampm === 'PM' && hour < 12)
- hour += 12;
- if (ampm === 'AM' && hour === 12)
- hour = 0;
- }
-
- if (isLeft) {
- var start = this.startDate.clone();
- start.hour(hour);
- start.minute(minute);
- start.second(second);
- this.setStartDate(start);
- if (this.singleDatePicker) {
- this.endDate = this.startDate.clone();
- } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {
- this.setEndDate(start.clone());
- }
- } else if (this.endDate) {
- var end = this.endDate.clone();
- end.hour(hour);
- end.minute(minute);
- end.second(second);
- this.setEndDate(end);
- }
-
- //update the calendars so all clickable dates reflect the new time component
- this.updateCalendars();
-
- //update the form inputs above the calendars with the new time
- this.updateFormInputs();
-
- //re-render the time pickers because changing one selection can affect what's enabled in another
- this.renderTimePicker('left');
- this.renderTimePicker('right');
-
- },
-
- elementChanged: function() {
- if (!this.element.is('input')) return;
- if (!this.element.val().length) return;
-
- var dateString = this.element.val().split(this.locale.separator),
- start = null,
- end = null;
-
- if (dateString.length === 2) {
- start = moment(dateString[0], this.locale.format);
- end = moment(dateString[1], this.locale.format);
- }
-
- if (this.singleDatePicker || start === null || end === null) {
- start = moment(this.element.val(), this.locale.format);
- end = start;
- }
-
- if (!start.isValid() || !end.isValid()) return;
-
- this.setStartDate(start);
- this.setEndDate(end);
- this.updateView();
- },
-
- keydown: function(e) {
- //hide on tab or enter
- if ((e.keyCode === 9) || (e.keyCode === 13)) {
- this.hide();
- }
-
- //hide on esc and prevent propagation
- if (e.keyCode === 27) {
- e.preventDefault();
- e.stopPropagation();
-
- this.hide();
- }
- },
-
- updateElement: function() {
- if (this.element.is('input') && this.autoUpdateInput) {
- var newValue = this.startDate.format(this.locale.format);
- if (!this.singleDatePicker) {
- newValue += this.locale.separator + this.endDate.format(this.locale.format);
- }
- if (newValue !== this.element.val()) {
- this.element.val(newValue).trigger('change');
- }
- }
- },
-
- remove: function() {
- this.container.remove();
- this.element.off('.daterangepicker');
- this.element.removeData();
- }
-
- };
-
- $.fn.daterangepicker = function(options, callback) {
- var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options);
- this.each(function() {
- var el = $(this);
- if (el.data('daterangepicker'))
- el.data('daterangepicker').remove();
- el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback));
- });
- return this;
- };
-
- return DateRangePicker;
-
-}));
diff --git a/public/assets/prototype/js/edison.js b/public/assets/prototype/js/edison.js
deleted file mode 100644
index 08fb4c9..0000000
--- a/public/assets/prototype/js/edison.js
+++ /dev/null
@@ -1,2028 +0,0 @@
-
-// Underscore.js 1.5.2
-// http://underscorejs.org
-// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-
-(function() {
-
- // Baseline setup
- // --------------
-
- // Establish the root object, `window` in the browser, or `exports` on the server.
- var root = this;
-
- // Save the previous value of the `_` variable.
- var previousUnderscore = root._;
-
- // Establish the object that gets returned to break out of a loop iteration.
- var breaker = {};
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
- // Create quick reference variables for speed access to core prototypes.
- var
- push = ArrayProto.push,
- slice = ArrayProto.slice,
- concat = ArrayProto.concat,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // All **ECMAScript 5** native function implementations that we hope to use
- // are declared here.
- var
- nativeForEach = ArrayProto.forEach,
- nativeMap = ArrayProto.map,
- nativeReduce = ArrayProto.reduce,
- nativeReduceRight = ArrayProto.reduceRight,
- nativeFilter = ArrayProto.filter,
- nativeEvery = ArrayProto.every,
- nativeSome = ArrayProto.some,
- nativeIndexOf = ArrayProto.indexOf,
- nativeLastIndexOf = ArrayProto.lastIndexOf,
- nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeBind = FuncProto.bind;
-
- // Create a safe reference to the Underscore object for use below.
- var _ = function(obj) {
- if (obj instanceof _) return obj;
- if (!(this instanceof _)) return new _(obj);
- this._wrapped = obj;
- };
-
- // Export the Underscore object for **Node.js**, with
- // backwards-compatibility for the old `require()` API. If we're in
- // the browser, add `_` as a global object via a string identifier,
- // for Closure Compiler "advanced" mode.
- if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- exports = module.exports = _;
- }
- exports._ = _;
- } else {
- root._ = _;
- }
-
- // Current version.
- _.VERSION = '1.5.2';
-
- // Collection Functions
- // --------------------
-
- // The cornerstone, an `each` implementation, aka `forEach`.
- // Handles objects with the built-in `forEach`, arrays, and raw objects.
- // Delegates to **ECMAScript 5**'s native `forEach` if available.
- var each = _.each = _.forEach = function(obj, iterator, context) {
- if (obj == null) return;
- if (nativeForEach && obj.forEach === nativeForEach) {
- obj.forEach(iterator, context);
- } else if (obj.length === +obj.length) {
- for (var i = 0, length = obj.length; i < length; i++) {
- if (iterator.call(context, obj[i], i, obj) === breaker) return;
- }
- } else {
- var keys = _.keys(obj);
- for (var i = 0, length = keys.length; i < length; i++) {
- if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
- }
- }
- };
-
- // Return the results of applying the iterator to each element.
- // Delegates to **ECMAScript 5**'s native `map` if available.
- _.map = _.collect = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
- each(obj, function(value, index, list) {
- results.push(iterator.call(context, value, index, list));
- });
- return results;
- };
-
- var reduceError = 'Reduce of empty array with no initial value';
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
- _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduce && obj.reduce === nativeReduce) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
- }
- each(obj, function(value, index, list) {
- if (!initial) {
- memo = value;
- initial = true;
- } else {
- memo = iterator.call(context, memo, value, index, list);
- }
- });
- if (!initial) throw new TypeError(reduceError);
- return memo;
- };
-
- // The right-associative version of reduce, also known as `foldr`.
- // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
- _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
- }
- var length = obj.length;
- if (length !== +length) {
- var keys = _.keys(obj);
- length = keys.length;
- }
- each(obj, function(value, index, list) {
- index = keys ? keys[--length] : --length;
- if (!initial) {
- memo = obj[index];
- initial = true;
- } else {
- memo = iterator.call(context, memo, obj[index], index, list);
- }
- });
- if (!initial) throw new TypeError(reduceError);
- return memo;
- };
-
- // Return the first value which passes a truth test. Aliased as `detect`.
- _.find = _.detect = function(obj, iterator, context) {
- var result;
- any(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) {
- result = value;
- return true;
- }
- });
- return result;
- };
-
- // Return all the elements that pass a truth test.
- // Delegates to **ECMAScript 5**'s native `filter` if available.
- // Aliased as `select`.
- _.filter = _.select = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
- each(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) results.push(value);
- });
- return results;
- };
-
- // Return all the elements for which a truth test fails.
- _.reject = function(obj, iterator, context) {
- return _.filter(obj, function(value, index, list) {
- return !iterator.call(context, value, index, list);
- }, context);
- };
-
- // Determine whether all of the elements match a truth test.
- // Delegates to **ECMAScript 5**'s native `every` if available.
- // Aliased as `all`.
- _.every = _.all = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = true;
- if (obj == null) return result;
- if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
- each(obj, function(value, index, list) {
- if (!(result = result && iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if at least one element in the object matches a truth test.
- // Delegates to **ECMAScript 5**'s native `some` if available.
- // Aliased as `any`.
- var any = _.some = _.any = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = false;
- if (obj == null) return result;
- if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
- each(obj, function(value, index, list) {
- if (result || (result = iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if the array or object contains a given value (using `===`).
- // Aliased as `include`.
- _.contains = _.include = function(obj, target) {
- if (obj == null) return false;
- if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
- return any(obj, function(value) {
- return value === target;
- });
- };
-
- // Invoke a method (with arguments) on every item in a collection.
- _.invoke = function(obj, method) {
- var args = slice.call(arguments, 2);
- var isFunc = _.isFunction(method);
- return _.map(obj, function(value) {
- return (isFunc ? method : value[method]).apply(value, args);
- });
- };
-
- // Convenience version of a common use case of `map`: fetching a property.
- _.pluck = function(obj, key) {
- return _.map(obj, function(value){ return value[key]; });
- };
-
- // Convenience version of a common use case of `filter`: selecting only objects
- // containing specific `key:value` pairs.
- _.where = function(obj, attrs, first) {
- if (_.isEmpty(attrs)) return first ? void 0 : [];
- return _[first ? 'find' : 'filter'](obj, function(value) {
- for (var key in attrs) {
- if (attrs[key] !== value[key]) return false;
- }
- return true;
- });
- };
-
- // Convenience version of a common use case of `find`: getting the first object
- // containing specific `key:value` pairs.
- _.findWhere = function(obj, attrs) {
- return _.where(obj, attrs, true);
- };
-
- // Return the maximum element or (element-based computation).
- // Can't optimize arrays of integers longer than 65,535 elements.
- // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
- _.max = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
- return Math.max.apply(Math, obj);
- }
- if (!iterator && _.isEmpty(obj)) return -Infinity;
- var result = {computed : -Infinity, value: -Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed > result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Return the minimum element (or element-based computation).
- _.min = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
- return Math.min.apply(Math, obj);
- }
- if (!iterator && _.isEmpty(obj)) return Infinity;
- var result = {computed : Infinity, value: Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed < result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Shuffle an array, using the modern version of the
- // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
- _.shuffle = function(obj) {
- var rand;
- var index = 0;
- var shuffled = [];
- each(obj, function(value) {
- rand = _.random(index++);
- shuffled[index - 1] = shuffled[rand];
- shuffled[rand] = value;
- });
- return shuffled;
- };
-
- // Sample **n** random values from an array.
- // If **n** is not specified, returns a single random element from the array.
- // The internal `guard` argument allows it to work with `map`.
- _.sample = function(obj, n, guard) {
- if (arguments.length < 2 || guard) {
- return obj[_.random(obj.length - 1)];
- }
- return _.shuffle(obj).slice(0, Math.max(0, n));
- };
-
- // An internal function to generate lookup iterators.
- var lookupIterator = function(value) {
- return _.isFunction(value) ? value : function(obj){ return obj[value]; };
- };
-
- // Sort the object's values by a criterion produced by an iterator.
- _.sortBy = function(obj, value, context) {
- var iterator = lookupIterator(value);
- return _.pluck(_.map(obj, function(value, index, list) {
- return {
- value: value,
- index: index,
- criteria: iterator.call(context, value, index, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index - right.index;
- }), 'value');
- };
-
- // An internal function used for aggregate "group by" operations.
- var group = function(behavior) {
- return function(obj, value, context) {
- var result = {};
- var iterator = value == null ? _.identity : lookupIterator(value);
- each(obj, function(value, index) {
- var key = iterator.call(context, value, index, obj);
- behavior(result, key, value);
- });
- return result;
- };
- };
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- _.groupBy = group(function(result, key, value) {
- (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
- });
-
- // Indexes the object's values by a criterion, similar to `groupBy`, but for
- // when you know that your index values will be unique.
- _.indexBy = group(function(result, key, value) {
- result[key] = value;
- });
-
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- _.countBy = group(function(result, key) {
- _.has(result, key) ? result[key]++ : result[key] = 1;
- });
-
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- _.sortedIndex = function(array, obj, iterator, context) {
- iterator = iterator == null ? _.identity : lookupIterator(iterator);
- var value = iterator.call(context, obj);
- var low = 0, high = array.length;
- while (low < high) {
- var mid = (low + high) >>> 1;
- iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
- }
- return low;
- };
-
- // Safely create a real, live array from anything iterable.
- _.toArray = function(obj) {
- if (!obj) return [];
- if (_.isArray(obj)) return slice.call(obj);
- if (obj.length === +obj.length) return _.map(obj, _.identity);
- return _.values(obj);
- };
-
- // Return the number of elements in an object.
- _.size = function(obj) {
- if (obj == null) return 0;
- return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
- };
-
- // Array Functions
- // ---------------
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. Aliased as `head` and `take`. The **guard** check
- // allows it to work with `_.map`.
- _.first = _.head = _.take = function(array, n, guard) {
- if (array == null) return void 0;
- return (n == null) || guard ? array[0] : slice.call(array, 0, n);
- };
-
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N. The **guard** check allows it to work with
- // `_.map`.
- _.initial = function(array, n, guard) {
- return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
- };
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array. The **guard** check allows it to work with `_.map`.
- _.last = function(array, n, guard) {
- if (array == null) return void 0;
- if ((n == null) || guard) {
- return array[array.length - 1];
- } else {
- return slice.call(array, Math.max(array.length - n, 0));
- }
- };
-
- // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
- // Especially useful on the arguments object. Passing an **n** will return
- // the rest N values in the array. The **guard**
- // check allows it to work with `_.map`.
- _.rest = _.tail = _.drop = function(array, n, guard) {
- return slice.call(array, (n == null) || guard ? 1 : n);
- };
-
- // Trim out all falsy values from an array.
- _.compact = function(array) {
- return _.filter(array, _.identity);
- };
-
- // Internal implementation of a recursive `flatten` function.
- var flatten = function(input, shallow, output) {
- if (shallow && _.every(input, _.isArray)) {
- return concat.apply(output, input);
- }
- each(input, function(value) {
- if (_.isArray(value) || _.isArguments(value)) {
- shallow ? push.apply(output, value) : flatten(value, shallow, output);
- } else {
- output.push(value);
- }
- });
- return output;
- };
-
- // Flatten out an array, either recursively (by default), or just one level.
- _.flatten = function(array, shallow) {
- return flatten(array, shallow, []);
- };
-
- // Return a version of the array that does not contain the specified value(s).
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // Aliased as `unique`.
- _.uniq = _.unique = function(array, isSorted, iterator, context) {
- if (_.isFunction(isSorted)) {
- context = iterator;
- iterator = isSorted;
- isSorted = false;
- }
- var initial = iterator ? _.map(array, iterator, context) : array;
- var results = [];
- var seen = [];
- each(initial, function(value, index) {
- if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
- seen.push(value);
- results.push(array[index]);
- }
- });
- return results;
- };
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- _.union = function() {
- return _.uniq(_.flatten(arguments, true));
- };
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- _.intersection = function(array) {
- var rest = slice.call(arguments, 1);
- return _.filter(_.uniq(array), function(item) {
- return _.every(rest, function(other) {
- return _.indexOf(other, item) >= 0;
- });
- });
- };
-
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- _.difference = function(array) {
- var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
- return _.filter(array, function(value){ return !_.contains(rest, value); });
- };
-
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- _.zip = function() {
- var length = _.max(_.pluck(arguments, "length").concat(0));
- var results = new Array(length);
- for (var i = 0; i < length; i++) {
- results[i] = _.pluck(arguments, '' + i);
- }
- return results;
- };
-
- // Converts lists into objects. Pass either a single array of `[key, value]`
- // pairs, or two parallel arrays of the same length -- one of keys, and one of
- // the corresponding values.
- _.object = function(list, values) {
- if (list == null) return {};
- var result = {};
- for (var i = 0, length = list.length; i < length; i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- };
-
- // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
- // we need this function. Return the position of the first occurrence of an
- // item in an array, or -1 if the item is not included in the array.
- // Delegates to **ECMAScript 5**'s native `indexOf` if available.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- _.indexOf = function(array, item, isSorted) {
- if (array == null) return -1;
- var i = 0, length = array.length;
- if (isSorted) {
- if (typeof isSorted == 'number') {
- i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
- } else {
- i = _.sortedIndex(array, item);
- return array[i] === item ? i : -1;
- }
- }
- if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
- for (; i < length; i++) if (array[i] === item) return i;
- return -1;
- };
-
- // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
- _.lastIndexOf = function(array, item, from) {
- if (array == null) return -1;
- var hasIndex = from != null;
- if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
- return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
- }
- var i = (hasIndex ? from : array.length);
- while (i--) if (array[i] === item) return i;
- return -1;
- };
-
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](http://docs.python.org/library/functions.html#range).
- _.range = function(start, stop, step) {
- if (arguments.length <= 1) {
- stop = start || 0;
- start = 0;
- }
- step = arguments[2] || 1;
-
- var length = Math.max(Math.ceil((stop - start) / step), 0);
- var idx = 0;
- var range = new Array(length);
-
- while(idx < length) {
- range[idx++] = start;
- start += step;
- }
-
- return range;
- };
-
- // Function (ahem) Functions
- // ------------------
-
- // Reusable constructor function for prototype setting.
- var ctor = function(){};
-
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
- // available.
- _.bind = function(func, context) {
- var args, bound;
- if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
- if (!_.isFunction(func)) throw new TypeError;
- args = slice.call(arguments, 2);
- return bound = function() {
- if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
- ctor.prototype = func.prototype;
- var self = new ctor;
- ctor.prototype = null;
- var result = func.apply(self, args.concat(slice.call(arguments)));
- if (Object(result) === result) return result;
- return self;
- };
- };
-
- // Partially apply a function by creating a version that has had some of its
- // arguments pre-filled, without changing its dynamic `this` context.
- _.partial = function(func) {
- var args = slice.call(arguments, 1);
- return function() {
- return func.apply(this, args.concat(slice.call(arguments)));
- };
- };
-
- // Bind all of an object's methods to that object. Useful for ensuring that
- // all callbacks defined on an object belong to it.
- _.bindAll = function(obj) {
- var funcs = slice.call(arguments, 1);
- if (funcs.length === 0) throw new Error("bindAll must be passed function names");
- each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
- return obj;
- };
-
- // Memoize an expensive function by storing its results.
- _.memoize = function(func, hasher) {
- var memo = {};
- hasher || (hasher = _.identity);
- return function() {
- var key = hasher.apply(this, arguments);
- return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
- };
- };
-
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- _.delay = function(func, wait) {
- var args = slice.call(arguments, 2);
- return setTimeout(function(){ return func.apply(null, args); }, wait);
- };
-
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- _.defer = function(func) {
- return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
- };
-
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time. Normally, the throttled function will run
- // as much as it can, without ever going more than once per `wait` duration;
- // but if you'd like to disable the execution on the leading edge, pass
- // `{leading: false}`. To disable execution on the trailing edge, ditto.
- _.throttle = function(func, wait, options) {
- var context, args, result;
- var timeout = null;
- var previous = 0;
- options || (options = {});
- var later = function() {
- previous = options.leading === false ? 0 : new Date;
- timeout = null;
- result = func.apply(context, args);
- };
- return function() {
- var now = new Date;
- if (!previous && options.leading === false) previous = now;
- var remaining = wait - (now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0) {
- clearTimeout(timeout);
- timeout = null;
- previous = now;
- result = func.apply(context, args);
- } else if (!timeout && options.trailing !== false) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
- };
-
- // Returns a function, that, as long as it continues to be invoked, will not
- // be triggered. The function will be called after it stops being called for
- // N milliseconds. If `immediate` is passed, trigger the function on the
- // leading edge, instead of the trailing.
- _.debounce = function(func, wait, immediate) {
- var timeout, args, context, timestamp, result;
- return function() {
- context = this;
- args = arguments;
- timestamp = new Date();
- var later = function() {
- var last = (new Date()) - timestamp;
- if (last < wait) {
- timeout = setTimeout(later, wait - last);
- } else {
- timeout = null;
- if (!immediate) result = func.apply(context, args);
- }
- };
- var callNow = immediate && !timeout;
- if (!timeout) {
- timeout = setTimeout(later, wait);
- }
- if (callNow) result = func.apply(context, args);
- return result;
- };
- };
-
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- _.once = function(func) {
- var ran = false, memo;
- return function() {
- if (ran) return memo;
- ran = true;
- memo = func.apply(this, arguments);
- func = null;
- return memo;
- };
- };
-
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- _.wrap = function(func, wrapper) {
- return function() {
- var args = [func];
- push.apply(args, arguments);
- return wrapper.apply(this, args);
- };
- };
-
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- _.compose = function() {
- var funcs = arguments;
- return function() {
- var args = arguments;
- for (var i = funcs.length - 1; i >= 0; i--) {
- args = [funcs[i].apply(this, args)];
- }
- return args[0];
- };
- };
-
- // Returns a function that will only be executed after being called N times.
- _.after = function(times, func) {
- return function() {
- if (--times < 1) {
- return func.apply(this, arguments);
- }
- };
- };
-
- // Object Functions
- // ----------------
-
- // Retrieve the names of an object's properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`
- _.keys = nativeKeys || function(obj) {
- if (obj !== Object(obj)) throw new TypeError('Invalid object');
- var keys = [];
- for (var key in obj) if (_.has(obj, key)) keys.push(key);
- return keys;
- };
-
- // Retrieve the values of an object's properties.
- _.values = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- var values = new Array(length);
- for (var i = 0; i < length; i++) {
- values[i] = obj[keys[i]];
- }
- return values;
- };
-
- // Convert an object into a list of `[key, value]` pairs.
- _.pairs = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- var pairs = new Array(length);
- for (var i = 0; i < length; i++) {
- pairs[i] = [keys[i], obj[keys[i]]];
- }
- return pairs;
- };
-
- // Invert the keys and values of an object. The values must be serializable.
- _.invert = function(obj) {
- var result = {};
- var keys = _.keys(obj);
- for (var i = 0, length = keys.length; i < length; i++) {
- result[obj[keys[i]]] = keys[i];
- }
- return result;
- };
-
- // Return a sorted list of the function names available on the object.
- // Aliased as `methods`
- _.functions = _.methods = function(obj) {
- var names = [];
- for (var key in obj) {
- if (_.isFunction(obj[key])) names.push(key);
- }
- return names.sort();
- };
-
- // Extend a given object with all the properties in passed-in object(s).
- _.extend = function(obj) {
- each(slice.call(arguments, 1), function(source) {
- if (source) {
- for (var prop in source) {
- obj[prop] = source[prop];
- }
- }
- });
- return obj;
- };
-
- // Return a copy of the object only containing the whitelisted properties.
- _.pick = function(obj) {
- var copy = {};
- var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
- each(keys, function(key) {
- if (key in obj) copy[key] = obj[key];
- });
- return copy;
- };
-
- // Return a copy of the object without the blacklisted properties.
- _.omit = function(obj) {
- var copy = {};
- var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
- for (var key in obj) {
- if (!_.contains(keys, key)) copy[key] = obj[key];
- }
- return copy;
- };
-
- // Fill in a given object with default properties.
- _.defaults = function(obj) {
- each(slice.call(arguments, 1), function(source) {
- if (source) {
- for (var prop in source) {
- if (obj[prop] === void 0) obj[prop] = source[prop];
- }
- }
- });
- return obj;
- };
-
- // Create a (shallow-cloned) duplicate of an object.
- _.clone = function(obj) {
- if (!_.isObject(obj)) return obj;
- return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
- };
-
- // Invokes interceptor with the obj, and then returns obj.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- _.tap = function(obj, interceptor) {
- interceptor(obj);
- return obj;
- };
-
- // Internal recursive comparison function for `isEqual`.
- var eq = function(a, b, aStack, bStack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
- if (a === b) return a !== 0 || 1 / a == 1 / b;
- // A strict comparison is necessary because `null == undefined`.
- if (a == null || b == null) return a === b;
- // Unwrap any wrapped objects.
- if (a instanceof _) a = a._wrapped;
- if (b instanceof _) b = b._wrapped;
- // Compare `[[Class]]` names.
- var className = toString.call(a);
- if (className != toString.call(b)) return false;
- switch (className) {
- // Strings, numbers, dates, and booleans are compared by value.
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return a == String(b);
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
- // other numeric values.
- return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a == +b;
- // RegExps are compared by their source patterns and flags.
- case '[object RegExp]':
- return a.source == b.source &&
- a.global == b.global &&
- a.multiline == b.multiline &&
- a.ignoreCase == b.ignoreCase;
- }
- if (typeof a != 'object' || typeof b != 'object') return false;
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
- var length = aStack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (aStack[length] == a) return bStack[length] == b;
- }
- // Objects with different constructors are not equivalent, but `Object`s
- // from different frames are.
- var aCtor = a.constructor, bCtor = b.constructor;
- if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
- _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
- return false;
- }
- // Add the first object to the stack of traversed objects.
- aStack.push(a);
- bStack.push(b);
- var size = 0, result = true;
- // Recursively compare objects and arrays.
- if (className == '[object Array]') {
- // Compare array lengths to determine if a deep comparison is necessary.
- size = a.length;
- result = size == b.length;
- if (result) {
- // Deep compare the contents, ignoring non-numeric properties.
- while (size--) {
- if (!(result = eq(a[size], b[size], aStack, bStack))) break;
- }
- }
- } else {
- // Deep compare objects.
- for (var key in a) {
- if (_.has(a, key)) {
- // Count the expected number of properties.
- size++;
- // Deep compare each member.
- if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
- }
- }
- // Ensure that both objects contain the same number of properties.
- if (result) {
- for (key in b) {
- if (_.has(b, key) && !(size--)) break;
- }
- result = !size;
- }
- }
- // Remove the first object from the stack of traversed objects.
- aStack.pop();
- bStack.pop();
- return result;
- };
-
- // Perform a deep comparison to check if two objects are equal.
- _.isEqual = function(a, b) {
- return eq(a, b, [], []);
- };
-
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- _.isEmpty = function(obj) {
- if (obj == null) return true;
- if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
- for (var key in obj) if (_.has(obj, key)) return false;
- return true;
- };
-
- // Is a given value a DOM element?
- _.isElement = function(obj) {
- return !!(obj && obj.nodeType === 1);
- };
-
- // Is a given value an array?
- // Delegates to ECMA5's native Array.isArray
- _.isArray = nativeIsArray || function(obj) {
- return toString.call(obj) == '[object Array]';
- };
-
- // Is a given variable an object?
- _.isObject = function(obj) {
- return obj === Object(obj);
- };
-
- // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
- each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
- _['is' + name] = function(obj) {
- return toString.call(obj) == '[object ' + name + ']';
- };
- });
-
- // Define a fallback version of the method in browsers (ahem, IE), where
- // there isn't any inspectable "Arguments" type.
- if (!_.isArguments(arguments)) {
- _.isArguments = function(obj) {
- return !!(obj && _.has(obj, 'callee'));
- };
- }
-
- // Optimize `isFunction` if appropriate.
- if (typeof (/./) !== 'function') {
- _.isFunction = function(obj) {
- return typeof obj === 'function';
- };
- }
-
- // Is a given object a finite number?
- _.isFinite = function(obj) {
- return isFinite(obj) && !isNaN(parseFloat(obj));
- };
-
- // Is the given value `NaN`? (NaN is the only number which does not equal itself).
- _.isNaN = function(obj) {
- return _.isNumber(obj) && obj != +obj;
- };
-
- // Is a given value a boolean?
- _.isBoolean = function(obj) {
- return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
- };
-
- // Is a given value equal to null?
- _.isNull = function(obj) {
- return obj === null;
- };
-
- // Is a given variable undefined?
- _.isUndefined = function(obj) {
- return obj === void 0;
- };
-
- // Shortcut function for checking if an object has a given property directly
- // on itself (in other words, not on a prototype).
- _.has = function(obj, key) {
- return hasOwnProperty.call(obj, key);
- };
-
- // Utility Functions
- // -----------------
-
- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
- // previous owner. Returns a reference to the Underscore object.
- _.noConflict = function() {
- root._ = previousUnderscore;
- return this;
- };
-
- // Keep the identity function around for default iterators.
- _.identity = function(value) {
- return value;
- };
-
- // Run a function **n** times.
- _.times = function(n, iterator, context) {
- var accum = Array(Math.max(0, n));
- for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
- return accum;
- };
-
- // Return a random integer between min and max (inclusive).
- _.random = function(min, max) {
- if (max == null) {
- max = min;
- min = 0;
- }
- return min + Math.floor(Math.random() * (max - min + 1));
- };
-
- // List of HTML entities for escaping.
- var entityMap = {
- escape: {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": '''
- }
- };
- entityMap.unescape = _.invert(entityMap.escape);
-
- // Regexes containing the keys and values listed immediately above.
- var entityRegexes = {
- escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
- unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
- };
-
- // Functions for escaping and unescaping strings to/from HTML interpolation.
- _.each(['escape', 'unescape'], function(method) {
- _[method] = function(string) {
- if (string == null) return '';
- return ('' + string).replace(entityRegexes[method], function(match) {
- return entityMap[method][match];
- });
- };
- });
-
- // If the value of the named `property` is a function then invoke it with the
- // `object` as context; otherwise, return it.
- _.result = function(object, property) {
- if (object == null) return void 0;
- var value = object[property];
- return _.isFunction(value) ? value.call(object) : value;
- };
-
- // Add your own custom functions to the Underscore object.
- _.mixin = function(obj) {
- each(_.functions(obj), function(name) {
- var func = _[name] = obj[name];
- _.prototype[name] = function() {
- var args = [this._wrapped];
- push.apply(args, arguments);
- return result.call(this, func.apply(_, args));
- };
- });
- };
-
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- _.uniqueId = function(prefix) {
- var id = ++idCounter + '';
- return prefix ? prefix + id : id;
- };
-
- // By default, Underscore uses ERB-style template delimiters, change the
- // following template settings to use alternative delimiters.
- _.templateSettings = {
- evaluate : /<%([\s\S]+?)%>/g,
- interpolate : /<%=([\s\S]+?)%>/g,
- escape : /<%-([\s\S]+?)%>/g
- };
-
- // When customizing `templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /(.)^/;
-
- // Certain characters need to be escaped so that they can be put into a
- // string literal.
- var escapes = {
- "'": "'",
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\t': 't',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
-
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- _.template = function(text, data, settings) {
- var render;
- settings = _.defaults({}, settings, _.templateSettings);
-
- // Combine delimiters into one regular expression via alternation.
- var matcher = new RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
-
- // Compile the template source, escaping string literals appropriately.
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset)
- .replace(escaper, function(match) { return '\\' + escapes[match]; });
-
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- }
- if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- }
- if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
- index = offset + match.length;
- return match;
- });
- source += "';\n";
-
- // If a variable is not specified, place data values in local scope.
- if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
-
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + "return __p;\n";
-
- try {
- render = new Function(settings.variable || 'obj', '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
-
- if (data) return render(data, _);
- var template = function(data) {
- return render.call(this, data, _);
- };
-
- // Provide the compiled function source as a convenience for precompilation.
- template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
-
- return template;
- };
-
- // Add a "chain" function, which will delegate to the wrapper.
- _.chain = function(obj) {
- return _(obj).chain();
- };
-
- // OOP
- // ---------------
- // If Underscore is called as a function, it returns a wrapped object that
- // can be used OO-style. This wrapper holds altered versions of all the
- // underscore functions. Wrapped objects may be chained.
-
- // Helper function to continue chaining intermediate results.
- var result = function(obj) {
- return this._chain ? _(obj).chain() : obj;
- };
-
- // Add all of the Underscore functions to the wrapper object.
- _.mixin(_);
-
- // Add all mutator Array functions to the wrapper.
- each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- var obj = this._wrapped;
- method.apply(obj, arguments);
- if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
- return result.call(this, obj);
- };
- });
-
- // Add all accessor Array functions to the wrapper.
- each(['concat', 'join', 'slice'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- return result.call(this, method.apply(this._wrapped, arguments));
- };
- });
-
- _.extend(_.prototype, {
-
- // Start chaining a wrapped Underscore object.
- chain: function() {
- this._chain = true;
- return this;
- },
-
- // Extracts the result from a wrapped and chained object.
- value: function() {
- return this._wrapped;
- }
-
- });
-
-}).call(this);
-
-define("underscore", (function (global) {
- return function () {
- var ret, fn;
- return ret || global._;
- };
-}(this)));
-
-define('edison/lib/microevent',[], function() {
-
- /**
- * MicroEvent - to make any js object an event emitter (server or browser)
- *
- * - pure javascript - server compatible, browser compatible
- * - dont rely on the browser doms
- * - super simple - you get it immediatly, no mistery, no magic involved
- *
- * - create a MicroEventDebug with goodies to debug
- * - make it safer to use
- */
- var MicroEvent = function(){};
- MicroEvent.prototype = {
- bind : function(event, fct){
- this._events = this._events || {};
- this._events[event] = this._events[event] || [];
- this._events[event].push(fct);
- },
- unbind : function(event, fct){
- this._events = this._events || {};
- if( event in this._events === false ) return;
- this._events[event].splice(this._events[event].indexOf(fct), 1);
- },
- trigger : function(event /* , args... */){
- this._events = this._events || {};
- if( event in this._events === false ) return;
- for(var i = 0; i < this._events[event].length; i++){
- this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1));
- }
- }
- };
-
- /**
- * mixin will delegate all MicroEvent.js function in the destination object
- *
- * - require('MicroEvent').mixin(Foobar) will make Foobar able to use MicroEvent
- *
- * @param {Object} the object which will support MicroEvent
- */
- MicroEvent.mixin = function(destObject){
- var props = ['bind', 'unbind', 'trigger'];
- for(var i = 0; i < props.length; i ++){
- if( typeof destObject === 'function' ){
- destObject.prototype[props[i]] = MicroEvent.prototype[props[i]];
- }else{
- destObject[props[i]] = MicroEvent.prototype[props[i]];
- }
- }
- }
-
- return MicroEvent;
-
-});
-
-define('edison/lib/sandbox',['require','underscore','./microevent'],function(require) {
-
- var _ = require('underscore'),
- MicroEvent = require('./microevent');
-
- var Sandbox = function(route) {
- this.route = route;
- };
-
- _.extend(Sandbox.prototype, {
-
- 'get': function(name) {
- name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
- results = regex.exec(window.location.hash);
- return results == null ? null : decodeURIComponent(results[1].replace(/\+/g, " "));
- }
-
- });
-
- MicroEvent.mixin(Sandbox.prototype);
-
- return Sandbox;
-
-});
-
-define('edison/lib/route',['require','underscore','./sandbox'],function(require) {
-
- var _ = require('underscore'),
- Sandbox = require('./sandbox');
-
- /**
- * @class Route
- */
- var Route = function(options, section, edison) {
-
- _.defaults(options, {
- 'init': function(fn) {
- fn();
- }
- });
-
- var self = this;
- self.title = null;
- self.name = options.name;
- self.section = section;
- self.callback = options.callback;
- self.extensions = options.extend;
- self.template = options.template || "";
- self.cleanup = options.cleanup;
-
- self.log = function() {
- if ( !edison.getDebug() ) {
- return;
- }
- console.log(arguments);
- };
-
- /**
- * Returns a string indicating the name of the section + this route.
- */
- self.getPath = function() {
- return section.getName() + '/' + self.name;
- };
-
- self.log('New route defined: ' + self.getPath());
-
- _.each(edison.getRouteExtensions(), function(ext) {
- _.extend(Sandbox.prototype, ext);
- });
-
- self.sandbox = new Sandbox();
- self.sandbox.section = section.getSandbox();
-
- self.init = function(id, fn) {
- options.init.call(self.sandbox, function() {
- if ( edison.getActiveSection() !== self.section ) {
- // The user is making their first entry into this section.
- self.log('Initial entry into section: ' + section.getName());
- self.section.loadTemplate();
- self.section.runCallback();
- Sandbox.prototype.container = document.getElementById('route');
- self.loadTemplate();
- } else {
- // The user is navigating within the same section.
- Sandbox.prototype.container = document.getElementById('route');
- self.loadTemplate();
- }
- edison.setActiveSection(self.section);
- edison.setActiveRoute(self.api);
- self.callback.call(self.sandbox, id);
- fn();
- });
- };
-
- _.each(self.extensions, function(fnc, extname) {
- self.sandbox[extname] = function() {
- fnc.apply(self.sandbox, arguments);
- };
- });
-
- self.loadTemplate = function() {
- var tpl = document.createElement('div');
- tpl.innerHTML = self.template;
- tpl.setAttribute('id', 'section_' + self.section.getName() + '_route_' + self.name);
- tpl.className = 'route';
- edison.insertTemplate(tpl);
- };
-
- /**
- * Public Interface
- */
- self.api = {
- getCallback: function() {
- return self.callback;
- },
- getSandbox: function() {
- return self.sandbox;
- },
- getName: function() {
- return self.name;
- },
- init: function() {
- self.init.apply(self, arguments);
- },
- getTitle: function() {
- return self.title;
- },
- getFullPath: function() {
- return this.getFullPath.apply(self, arguments);
- },
- cleanup: function() {
- if ( _.isFunction(self.cleanup) ) {
- self.cleanup.call(self.sandbox);
- }
- }
- };
-
- return self.api;
-
- };
-
- _.extend(Route.prototype, {
-
- /**
- * Returns the hashbang path at which this route can be accessed: section_name/route_name
- */
- 'getFullPath': function() {
- return this.section.getName() + '/' + this.name;
- }
-
- });
-
- return Route;
-
-});
-
-define('edison/lib/section',['require','underscore','./route','./sandbox'],function(require) {
-
- var _ = require('underscore'),
- Route = require('./route'),
- Sandbox = require('./sandbox');
-
- /**
- * @class Section
- */
- var Section = function(options, edison) {
-
- var self = this;
- self.edison = edison;
- self.name = options.name;
- self.controller = options.controller;
- self.callback = options.callback;
- self.extensions = options.extend;
- self.parent_section = options.parent_section;
- self.template = options.template || "";
- self.templateData = options.templateData;
- self.cleanup = options.cleanup;
- self.routes = {};
-
- self.createRoute = function(options) {
- options = options || {};
- _.defaults(options, {
- 'name': null,
- 'callback': null,
- 'extend': {},
- 'cleanup': null
- });
- if ( !_.isString(options.name) || options.name === '' ) {
- throw 'Invalid `name` specified.';
- }
- var name_check = options.name.replace(/\W/g, '');
- if ( name_check !== options.name ) {
- throw 'Invalid `name` specified.';
- }
- if ( !_.isFunction(options.callback) && !_.isNull(options.callback) ) {
- throw 'Invalid `callback` specified.';
- }
- if ( !_.isObject(options.extend) ) {
- throw 'Invalid `extend` value specified.';
- }
- if ( !_.isNull(options.cleanup) && !_.isFunction(options.cleanup) ) {
- throw 'Invalid `cleanup` value specified.';
- }
- options.template_container_selector = '.route';
- var route = new Route(options, self.api, edison);
- self.routes[options.name] = route;
- return route;
- };
-
- self.log = function() {
- if ( !edison.getDebug() ) {
- return;
- }
- console.log(arguments);
- };
-
- _.each(edison.getRouteExtensions(), function(ext) {
- _.extend(Sandbox.prototype, ext);
- });
-
- _.extend(Sandbox.prototype, self.extensions);
-
- self.sandbox = new Sandbox(this);
-
- self.loadTemplate = function() {
- var tpl = document.createElement('div');
- tpl.innerHTML = self.template;
- tpl.setAttribute('id', 'edison_section');
- tpl.className = 'section';
- edison.insertSectionTemplate(tpl);
- };
-
- self.api = {
- createRoute: self.createRoute.bind(self),
- getRoutes: function() {
- return self.routes;
- },
- hasRoute: function(name) {
- if ( _.isUndefined(self.routes[name]) ) {
- return false;
- }
- return true;
- },
- getRoute: function(name) {
- return self.routes[name];
- },
- getDefaultRoute: function() {
- var routes = _.keys(self.routes);
- var route_name = routes[0];
- return self.routes[route_name];
- },
- getName: function() {
- return self.name;
- },
- getController: function() {
- return self.controller;
- },
- runCallback: function() {
- self.loadTemplate();
- self.callback.call(self.sandbox);
- },
- getParentSection: function() {
- return self.parent_section;
- },
- cleanup: function() {
- if ( _.isFunction(self.cleanup) ) {
- self.cleanup.call(self.sandbox);
- }
- },
- getSandbox: function() {
- return self.sandbox;
- },
- loadTemplate: function() {
- return self.loadTemplate();
- }
- };
-
- return self.api;
-
- };
-
- return Section;
-
-});
-
-define('edison/lib/router',['require','underscore','./microevent'],function(require) {
-
- var _ = require('underscore'),
- MicroEvent = require('./microevent');
-
- /**
- * @class Router
- */
- var Router = function(edison) {
- this.init.apply(this, _.toArray(arguments));
- /*
- return {
- 'bind': this.bind.apply(this)
- };
- */
- };
-
- MicroEvent.mixin(Router.prototype);
-
- _.extend(Router.prototype, {
-
- 'edison': null,
-
- 'listening': false,
-
- 'init': function(edison) {
- this.edison = edison;
- },
-
- 'listen': function() {
- var self = this;
- if ( this.listening ) {
- return;
- }
- this.listening = true;
- this.bind('hash_change', function(data) {
- self.onHashChange(data);
- });
- this.watchURL();
- },
-
- 'watchURL': function() {
- window.onhashchange = this.processHashChange.bind(this);
- if ( window.location.hash ) {
- this.processHashChange();
- }
- },
-
- 'processHashChange': function() {
- this.trigger('hash_change', {
- 'hash': window.location.hash
- });
- },
-
- 'onHashChange': function(data) {
- var processed;
- data = data || {};
- _.defaults(data, {
- 'hash': null
- });
- if ( !data.hash ) {
- return;
- }
- try {
- processed = this.processHash(data.hash);
- } catch(e) {
- return;
- }
- this.trigger('on_route', processed);
- },
-
- 'processHash': function(hash) {
- if ( hash.indexOf('#') === 0 && hash.indexOf('!') === 1 ) {
- hash = hash.substring(2);
- }
- if ( hash === '' ) {
- throw 'Invalid hash.';
- }
- var address = null,
- tmp = hash.split('?'),
- section_name = null,
- route_name = null,
- route_id = null;
- if ( tmp.length === 1 ) {
- address = tmp.pop();
- } else {
- address = tmp.shift();
- }
- if ( address.indexOf('/') < 0 ) {
- section_name = address;
- } else {
- tmp = address.split('/');
- switch ( tmp.length ) {
- case 1:
- section_name = tmp.pop();
- break;
- case 2:
- section_name = tmp.shift();
- route_name = tmp.shift();
- break;
- case 3:
- section_name = tmp.shift();
- route_name = tmp.shift();
- route_id = tmp.shift();
- break;
- }
- }
- var params = {};
- return {
- 'section_name': section_name,
- 'route_name': route_name,
- 'route_id': route_id
- };
- }
-
- });
-
- return Router;
-
-});
-
-define('edison/lib/util',[], function() {
-
- return {
-
- /**
- * Returns true / false as to whether the browser supports the HTML5 History API
- */
- 'supportsHistoryAPI': function() {
- return !!(window.history && history.pushState);
- }
-
- };
-
-});
-
-define('edison/lib/edison',['require','underscore','./section','./route','./router','./util'],function(require) {
-
- var _ = require('underscore'),
- Section = require('./section'),
- Route = require('./route'),
- Router = require('./router'),
- util = require('./util');
-
- var Edison = function() {
- this.init.apply(this, _.toArray(arguments));
- return {
- 'createSection': this.createSection.bind(this),
- 'initRoutes': this.initRoutes.bind(this),
- 'extend': this.extend.bind(this),
- 'extendCleanup': this.extendCleanup.bind(this)
- };
- };
-
- _.extend(Edison.prototype, {
-
- 'init': function(options) {
- options = options || {};
- _.defaults(options, this.options);
- this.options = options;
- if ( !_.isBoolean(options.pushState) ) {
- options.pushState = false;
- }
- if ( !options.container ) {
- throw 'A value must be specified for `container.`';
- } else {
- this.route_container = document.getElementById(options.container);
- if ( ! this.route_container ) {
- throw 'Specified route container does not exist: `' + options.container + '.`';
- }
- if ( options.pushState && util.supportsHistoryAPI() ) {
- this.enablePushState = true;
- }
- }
- },
-
- 'options': {
- 'container': null,
- 'pushState': false
- },
-
- 'debug': false,
-
- 'enablePushState': false,
-
- 'routes_initialized': false,
-
- 'sections': {},
-
- 'active_parent_section': null,
-
- 'active_section': null,
-
- 'active_section_intervals': [],
-
- 'active_parent_section_intervals': [],
-
- 'active_route': null,
-
- 'Routes': null,
-
- 'route_extensions': [],
-
- 'log': function() {
- if ( !this.debug ) {
- return;
- }
- console.log(arguments);
- },
-
- 'createSection': function(options) {
- options = options || {};
- _.defaults(options, {
- 'name': null,
- 'callback': null,
- 'extend': {},
- 'cleanup': null
- });
- if ( !_.isString(options.name) || options.name === '' ) {
- throw 'Invalid `name` specified.';
- }
- var name_check = options.name.replace(/\W/g, '');
- if ( name_check !== options.name ) {
- throw 'Invalid `name` specified.';
- }
- if ( !_.isFunction(options.callback) && !_.isNull(options.callback) ) {
- throw 'Invalid `callback` specified.';
- }
- if ( !_.isObject(options.extend) ) {
- throw 'Invalid `extend` value specified.';
- }
- if ( !_.isNull(options.cleanup) && !_.isFunction(options.cleanup) ) {
- throw 'Invalid `cleanup` value specified.';
- }
- this.sections[options.name] = new Section(options, this);
- return this.sections[options.name];
- },
-
- 'checkParentSection': function(section_name) {
- if ( _.isString(this.sections[section_name].getParentSection()) ) {
- if ( this.active_parent_section !== this.sections[section_name].getParentSection() ) {
- if ( !_.empty(this.active_parent_section) ) {
- this.active_parent_section.cleanup();
- this.clearParentSectionIntervals();
- }
- this.active_parent_section = this.sections[section_name].getParentSection();
- var parentSection = this.sections[section_name].getParentSection();
- this.sections[parentSection].runCallback();
- }
- } else {
- this.active_parent_section = null;
- this.clearParentSectionIntervals();
- }
- },
-
- 'clearParentSectionIntervals': function() {
- _.each(this.active_parent_section_intervals, function(interval_id) {
- clearInterval(interval_id);
- });
- },
-
- 'initRoutes': function() {
- var self = this;
- this.log('Initializing routes...');
- if ( this.routes_initialized ) {
- return;
- }
- this.routes_initialized = true;
- this.router = new Router(this);
- this.router.bind('on_route', this.onRoute.bind(this));
- this.router.listen();
- },
-
- 'onRoute': function(data) {
- this.log('onRoute', data);
- var self = this;
- if ( !this.sections[data.section_name] ) {
- return;
- }
- var section = this.sections[data.section_name],
- route;
- if ( !data.route_name ) {
- route = section.getDefaultRoute();
- } else {
- route = section.getRoute(data.route_name);
- }
- if ( !route ) {
- return;
- }
-
- _.each(self.active_section_intervals, function(interval_id) {
- clearInterval(interval_id);
- });
-
- var previousRoute = this.getActiveRoute();
- if ( previousRoute ) {
- previousRoute.cleanup();
- _.each(this.cleanupExtenders, function(ce) {
- ce.call(previousRoute.getSandbox());
- });
- }
-
- var previousSection = this.getActiveSection();
- if ( previousSection ) {
- if ( previousSection.getName() !== data.section_name ) {
- previousSection.cleanup();
- }
- }
-
- this.checkParentSection(data.section_name);
- route.init(data.route_id, function(err) {
- if ( err ) {
- // todo - ?
- }
- });
- },
-
- 'navigate': function(route, leave_history) {
- var opts = {
- trigger: true,
- replace : leave_history
- };
- this.Routes.navigate(route, opts);
- },
-
- 'setActiveSection': function(section) {
- this.active_section = section;
- },
-
- 'setActiveRoute': function(route) {
- this.active_route = route;
- },
-
- 'getDebug': function() {
- return this.debug;
- },
-
- 'getActiveSection': function() {
- return this.active_section;
- },
-
- 'getActiveRoute': function() {
- return this.active_route;
- },
-
- 'createSectionInterval': function(fn, interval) {
- this.active_section_intervals.push(setInterval(fn, interval));
- },
-
- 'createParentSectionInterval': function(fn, interval) {
- this.active_parent_section_intervals.push(setInterval(fn, interval));
- },
-
- 'getRoutes': function() {
- return this.Routes;
- },
-
- 'insertSectionTemplate': function(template) {
- this.route_container.innerHTML = '';
- this.route_container.appendChild(template);
- },
-
- 'insertTemplate': function(template) {
- var container = document.getElementById('route');
- container.innerHTML = '';
- container.appendChild(template);
- },
-
- 'extend': function(ext) {
- if ( !_.isObject(ext) ) {
- throw 'Invalid extension(s) specified: expected an object.';
- }
- this.route_extensions.push(ext);
- },
-
- 'getRouteExtensions': function() {
- return this.route_extensions;
- },
-
- 'cleanupExtenders': [],
-
- 'extendCleanup': function(fn) {
- if ( !_.isFunction(fn) ) {
- throw 'extendCleanup expects a single parameter: a callback function.';
- }
- this.cleanupExtenders.push(fn);
- }
-
- });
-
- return Edison;
-
-});
-
-/**
- * @package Edison
- */
-define('edison', ['require','./lib/edison'],function(require) {
- return require('./lib/edison');
-});
-
-define("edison/main", function(){});
diff --git a/public/assets/prototype/js/edison.min.js b/public/assets/prototype/js/edison.min.js
deleted file mode 100644
index 2743c15..0000000
--- a/public/assets/prototype/js/edison.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Underscore.js 1.5.2
-// http://underscorejs.org
-// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-
-(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i":">",'"':""","'":"'"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this)),define("edison/lib/microevent",[],function(){var e=function(){};return e.prototype={bind:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},unbind:function(e,t){this._events=this._events||{};if(e in this._events==0)return;this._events[e].splice(this._events[e].indexOf(t),1)},trigger:function(e){this._events=this._events||{};if(e in this._events==0)return;for(var t=0;t",s.cleanup=e.cleanup,s.log=function(){if(!i.getDebug())return;console.log(arguments)},s.getPath=function(){return r.getName()+"/"+s.name},s.log("New route defined: "+s.getPath()),t.each(i.getRouteExtensions(),function(e){t.extend(n.prototype,e)}),s.sandbox=new n,s.sandbox.section=r.getSandbox(),s.init=function(t,o){e.init.call(s.sandbox,function(){i.getActiveSection()!==s.section?(s.log("Initial entry into section: "+r.getName()),s.section.loadTemplate(),s.section.runCallback(),n.prototype.container=document.getElementById("route"),s.loadTemplate()):(n.prototype.container=document.getElementById("route"),s.loadTemplate()),i.setActiveSection(s.section),i.setActiveRoute(s.api),s.callback.call(s.sandbox,t),o()})},t.each(s.extensions,function(e,t){s.sandbox[t]=function(){e.apply(s.sandbox,arguments)}}),s.loadTemplate=function(){var e=document.createElement("div");e.innerHTML=s.template,e.setAttribute("id","section_"+s.section.getName()+"_route_"+s.name),e.className="route",i.insertTemplate(e)},s.api={getCallback:function(){return s.callback},getSandbox:function(){return s.sandbox},getName:function(){return s.name},init:function(){s.init.apply(s,arguments)},getTitle:function(){return s.title},getFullPath:function(){return this.getFullPath.apply(s,arguments)},cleanup:function(){t.isFunction(s.cleanup)&&s.cleanup.call(s.sandbox)}},s.api};return t.extend(r.prototype,{getFullPath:function(){return this.section.getName()+"/"+this.name}}),r}),define("edison/lib/section",["require","underscore","./route","./sandbox"],function(e){var t=e("underscore"),n=e("./route"),r=e("./sandbox"),i=function(e,i){var s=this;return s.edison=i,s.name=e.name,s.controller=e.controller,s.callback=e.callback,s.extensions=e.extend,s.parent_section=e.parent_section,s.template=e.template||"",s.templateData=e.templateData,s.cleanup=e.cleanup,s.routes={},s.createRoute=function(e){e=e||{},t.defaults(e,{name:null,callback:null,extend:{},cleanup:null});if(!t.isString(e.name)||e.name==="")throw"Invalid `name` specified.";var r=e.name.replace(/\W/g,"");if(r!==e.name)throw"Invalid `name` specified.";if(!t.isFunction(e.callback)&&!t.isNull(e.callback))throw"Invalid `callback` specified.";if(!t.isObject(e.extend))throw"Invalid `extend` value specified.";if(!t.isNull(e.cleanup)&&!t.isFunction(e.cleanup))throw"Invalid `cleanup` value specified.";e.template_container_selector=".route";var o=new n(e,s.api,i);return s.routes[e.name]=o,o},s.log=function(){if(!i.getDebug())return;console.log(arguments)},t.each(i.getRouteExtensions(),function(e){t.extend(r.prototype,e)}),t.extend(r.prototype,s.extensions),s.sandbox=new r(this),s.loadTemplate=function(){var e=document.createElement("div");e.innerHTML=s.template,e.setAttribute("id","edison_section"),e.className="section",i.insertSectionTemplate(e)},s.api={createRoute:s.createRoute.bind(s),getRoutes:function(){return s.routes},hasRoute:function(e){return t.isUndefined(s.routes[e])?!1:!0},getRoute:function(e){return s.routes[e]},getDefaultRoute:function(){var e=t.keys(s.routes),n=e[0];return s.routes[n]},getName:function(){return s.name},getController:function(){return s.controller},runCallback:function(){s.loadTemplate(),s.callback.call(s.sandbox)},getParentSection:function(){return s.parent_section},cleanup:function(){t.isFunction(s.cleanup)&&s.cleanup.call(s.sandbox)},getSandbox:function(){return s.sandbox},loadTemplate:function(){return s.loadTemplate()}},s.api};return i}),define("edison/lib/router",["require","underscore","./microevent"],function(e){var t=e("underscore"),n=e("./microevent"),r=function(e){this.init.apply(this,t.toArray(arguments))};return n.mixin(r.prototype),t.extend(r.prototype,{edison:null,listening:!1,init:function(e){this.edison=e},listen:function(){var e=this;if(this.listening)return;this.listening=!0,this.bind("hash_change",function(t){e.onHashChange(t)}),this.watchURL()},watchURL:function(){window.onhashchange=this.processHashChange.bind(this),window.location.hash&&this.processHashChange()},processHashChange:function(){this.trigger("hash_change",{hash:window.location.hash})},onHashChange:function(e){var n;e=e||{},t.defaults(e,{hash:null});if(!e.hash)return;try{n=this.processHash(e.hash)}catch(r){return}this.trigger("on_route",n)},processHash:function(e){e.indexOf("#")===0&&e.indexOf("!")===1&&(e=e.substring(2));if(e==="")throw"Invalid hash.";var t=null,n=e.split("?"),r=null,i=null,s=null;n.length===1?t=n.pop():t=n.shift();if(t.indexOf("/")<0)r=t;else{n=t.split("/");switch(n.length){case 1:r=n.pop();break;case 2:r=n.shift(),i=n.shift();break;case 3:r=n.shift(),i=n.shift(),s=n.shift()}}var o={};return{section_name:r,route_name:i,route_id:s}}}),r}),define("edison/lib/util",[],function(){return{supportsHistoryAPI:function(){return!!window.history&&!!history.pushState}}}),define("edison/lib/edison",["require","underscore","./section","./route","./router","./util"],function(e){var t=e("underscore"),n=e("./section"),r=e("./route"),i=e("./router"),s=e("./util"),o=function(){return this.init.apply(this,t.toArray(arguments)),{createSection:this.createSection.bind(this),initRoutes:this.initRoutes.bind(this),extend:this.extend.bind(this),extendCleanup:this.extendCleanup.bind(this)}};return t.extend(o.prototype,{init:function(e){e=e||{},t.defaults(e,this.options),this.options=e,t.isBoolean(e.pushState)||(e.pushState=!1);if(!e.container)throw"A value must be specified for `container.`";this.route_container=document.getElementById(e.container);if(!this.route_container)throw"Specified route container does not exist: `"+e.container+".`";e.pushState&&s.supportsHistoryAPI()&&(this.enablePushState=!0)},options:{container:null,pushState:!1},debug:!1,enablePushState:!1,routes_initialized:!1,sections:{},active_parent_section:null,active_section:null,active_section_intervals:[],active_parent_section_intervals:[],active_route:null,Routes:null,route_extensions:[],log:function(){if(!this.debug)return;console.log(arguments)},createSection:function(e){e=e||{},t.defaults(e,{name:null,callback:null,extend:{},cleanup:null});if(!t.isString(e.name)||e.name==="")throw"Invalid `name` specified.";var r=e.name.replace(/\W/g,"");if(r!==e.name)throw"Invalid `name` specified.";if(!t.isFunction(e.callback)&&!t.isNull(e.callback))throw"Invalid `callback` specified.";if(!t.isObject(e.extend))throw"Invalid `extend` value specified.";if(!t.isNull(e.cleanup)&&!t.isFunction(e.cleanup))throw"Invalid `cleanup` value specified.";return this.sections[e.name]=new n(e,this),this.sections[e.name]},checkParentSection:function(e){if(t.isString(this.sections[e].getParentSection())){if(this.active_parent_section!==this.sections[e].getParentSection()){t.empty(this.active_parent_section)||(this.active_parent_section.cleanup(),this.clearParentSectionIntervals()),this.active_parent_section=this.sections[e].getParentSection();var n=this.sections[e].getParentSection();this.sections[n].runCallback()}}else this.active_parent_section=null,this.clearParentSectionIntervals()},clearParentSectionIntervals:function(){t.each(this.active_parent_section_intervals,function(e){clearInterval(e)})},initRoutes:function(){var e=this;this.log("Initializing routes...");if(this.routes_initialized)return;this.routes_initialized=!0,this.router=new i(this),this.router.bind("on_route",this.onRoute.bind(this)),this.router.listen()},onRoute:function(e){this.log("onRoute",e);var n=this;if(!this.sections[e.section_name])return;var r=this.sections[e.section_name],i;e.route_name?i=r.getRoute(e.route_name):i=r.getDefaultRoute();if(!i)return;t.each(n.active_section_intervals,function(e){clearInterval(e)});var s=this.getActiveRoute();s&&(s.cleanup(),t.each(this.cleanupExtenders,function(e){e.call(s.getSandbox())}));var o=this.getActiveSection();o&&o.getName()!==e.section_name&&o.cleanup(),this.checkParentSection(e.section_name),i.init(e.route_id,function(e){e})},navigate:function(e,t){var n={trigger:!0,replace:t};this.Routes.navigate(e,n)},setActiveSection:function(e){this.active_section=e},setActiveRoute:function(e){this.active_route=e},getDebug:function(){return this.debug},getActiveSection:function(){return this.active_section},getActiveRoute:function(){return this.active_route},createSectionInterval:function(e,t){this.active_section_intervals.push(setInterval(e,t))},createParentSectionInterval:function(e,t){this.active_parent_section_intervals.push(setInterval(e,t))},getRoutes:function(){return this.Routes},insertSectionTemplate:function(e){this.route_container.innerHTML="",this.route_container.appendChild(e)},insertTemplate:function(e){var t=document.getElementById("route");t.innerHTML="",t.appendChild(e)},extend:function(e){if(!t.isObject(e))throw"Invalid extension(s) specified: expected an object.";this.route_extensions.push(e)},getRouteExtensions:function(){return this.route_extensions},cleanupExtenders:[],extendCleanup:function(e){if(!t.isFunction(e))throw"extendCleanup expects a single parameter: a callback function.";this.cleanupExtenders.push(e)}}),o}),define("edison",["require","./lib/edison"],function(e){return e("./lib/edison")}),define("edison/main",function(){});
\ No newline at end of file
diff --git a/public/assets/prototype/js/grapnel.js b/public/assets/prototype/js/grapnel.js
deleted file mode 100644
index c7ce2ee..0000000
--- a/public/assets/prototype/js/grapnel.js
+++ /dev/null
@@ -1,424 +0,0 @@
-/****
- * Grapnel
- * https://github.com/bytecipher/grapnel
- *
- * @author Greg Sabia Tucker
- * @link http://bytecipher.io
- * @version 0.6.3
- *
- * Released under MIT License. See LICENSE.txt or http://opensource.org/licenses/MIT
-*/
-
-!(function(root) {
-
- function Grapnel(opts) {
- "use strict";
-
- var self = this; // Scope reference
- this.events = {}; // Event Listeners
- this.state = null; // Router state object
- this.options = opts || {}; // Options
- this.options.env = this.options.env || (!!(Object.keys(root).length === 0 && process && process.browser !== true) ? 'server' : 'client');
- this.options.mode = this.options.mode || (!!(this.options.env !== 'server' && this.options.pushState && root.history && root.history.pushState) ? 'pushState' : 'hashchange');
- this.version = '0.6.3'; // Version
-
- if ('function' === typeof root.addEventListener) {
- root.addEventListener('hashchange', function() {
- self.trigger('hashchange');
- });
-
- root.addEventListener('popstate', function(e) {
- // Make sure popstate doesn't run on init -- this is a common issue with Safari and old versions of Chrome
- if (self.state && self.state.previousState === null) return false;
-
- self.trigger('navigate');
- });
- }
-
- return this;
- };
- /**
- * Create a RegExp Route from a string
- * This is the heart of the router and I've made it as small as possible!
- *
- * @param {String} Path of route
- * @param {Array} Array of keys to fill
- * @param {Bool} Case sensitive comparison
- * @param {Bool} Strict mode
- */
- Grapnel.regexRoute = function(path, keys, sensitive, strict) {
- if (path instanceof RegExp) return path;
- if (path instanceof Array) path = '(' + path.join('|') + ')';
- // Build route RegExp
- path = path.concat(strict ? '' : '/?')
- .replace(/\/\(/g, '(?:/')
- .replace(/\+/g, '__plus__')
- .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional) {
- keys.push({
- name: key,
- optional: !!optional
- });
- slash = slash || '';
-
- return '' + (optional ? '' : slash) + '(?:' + (optional ? slash : '') + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' + (optional || '');
- })
- .replace(/([\/.])/g, '\\$1')
- .replace(/__plus__/g, '(.+)')
- .replace(/\*/g, '(.*)');
-
- return new RegExp('^' + path + '$', sensitive ? '' : 'i');
- };
- /**
- * ForEach workaround utility
- *
- * @param {Array} to iterate
- * @param {Function} callback
- */
- Grapnel._forEach = function(a, callback) {
- if (typeof Array.prototype.forEach === 'function') return Array.prototype.forEach.call(a, callback);
- // Replicate forEach()
- return function(c, next) {
- for (var i = 0, n = this.length; i < n; ++i) {
- c.call(next, this[i], i, this);
- }
- }.call(a, callback);
- };
- /**
- * Add an route and handler
- *
- * @param {String|RegExp} route name
- * @return {self} Router
- */
- Grapnel.prototype.get = Grapnel.prototype.add = function(route) {
- var self = this,
- middleware = Array.prototype.slice.call(arguments, 1, -1),
- handler = Array.prototype.slice.call(arguments, -1)[0],
- request = new Request(route);
-
- var invoke = function RouteHandler() {
- // Build request parameters
- var req = request.parse(self.path());
- // Check if matches are found
- if (req.match) {
- // Match found
- var extra = {
- route: route,
- params: req.params,
- req: req,
- regex: req.match
- };
- // Create call stack -- add middleware first, then handler
- var stack = new CallStack(self, extra).enqueue(middleware.concat(handler));
- // Trigger main event
- self.trigger('match', stack, req);
- // Continue?
- if (!stack.runCallback) return self;
- // Previous state becomes current state
- stack.previousState = self.state;
- // Save new state
- self.state = stack;
- // Prevent this handler from being called if parent handler in stack has instructed not to propagate any more events
- if (stack.parent() && stack.parent().propagateEvent === false) {
- stack.propagateEvent = false;
- return self;
- }
- // Call handler
- stack.callback();
- }
- // Returns self
- return self;
- };
- // Event name
- var eventName = (self.options.mode !== 'pushState' && self.options.env !== 'server') ? 'hashchange' : 'navigate';
- // Invoke when route is defined, and once again when app navigates
- return invoke().on(eventName, invoke);
- };
- /**
- * Fire an event listener
- *
- * @param {String} event name
- * @param {Mixed} [attributes] Parameters that will be applied to event handler
- * @return {self} Router
- */
- Grapnel.prototype.trigger = function(event) {
- var self = this,
- params = Array.prototype.slice.call(arguments, 1);
- // Call matching events
- if (this.events[event]) {
- Grapnel._forEach(this.events[event], function(fn) {
- fn.apply(self, params);
- });
- }
-
- return this;
- };
- /**
- * Add an event listener
- *
- * @param {String} event name (multiple events can be called when separated by a space " ")
- * @param {Function} callback
- * @return {self} Router
- */
- Grapnel.prototype.on = Grapnel.prototype.bind = function(event, handler) {
- var self = this,
- events = event.split(' ');
-
- Grapnel._forEach(events, function(event) {
- if (self.events[event]) {
- self.events[event].push(handler);
- } else {
- self.events[event] = [handler];
- }
- });
-
- return this;
- };
- /**
- * Allow event to be called only once
- *
- * @param {String} event name(s)
- * @param {Function} callback
- * @return {self} Router
- */
- Grapnel.prototype.once = function(event, handler) {
- var ran = false;
-
- return this.on(event, function() {
- if (ran) return false;
- ran = true;
- handler.apply(this, arguments);
- handler = null;
- return true;
- });
- };
- /**
- * @param {String} Route context (without trailing slash)
- * @param {[Function]} Middleware (optional)
- * @return {Function} Adds route to context
- */
- Grapnel.prototype.context = function(context) {
- var self = this,
- middleware = Array.prototype.slice.call(arguments, 1);
-
- return function() {
- var value = arguments[0],
- submiddleware = (arguments.length > 2) ? Array.prototype.slice.call(arguments, 1, -1) : [],
- handler = Array.prototype.slice.call(arguments, -1)[0],
- prefix = (context.slice(-1) !== '/' && value !== '/' && value !== '') ? context + '/' : context,
- path = (value.substr(0, 1) !== '/') ? value : value.substr(1),
- pattern = prefix + path;
-
- return self.add.apply(self, [pattern].concat(middleware).concat(submiddleware).concat([handler]));
- }
- };
- /**
- * Navigate through history API
- *
- * @param {String} Pathname
- * @return {self} Router
- */
- Grapnel.prototype.navigate = function(path) {
- return this.path(path).trigger('navigate');
- };
-
- Grapnel.prototype.path = function(pathname) {
- var self = this,
- frag;
-
- if ('string' === typeof pathname) {
- // Set path
- if (self.options.mode === 'pushState') {
- frag = (self.options.root) ? (self.options.root + pathname) : pathname;
- root.history.pushState({}, null, frag);
- } else if (root.location) {
- root.location.hash = (self.options.hashBang ? '!' : '') + pathname;
- } else {
- root._pathname = pathname || '';
- }
-
- return this;
- } else if ('undefined' === typeof pathname) {
- // Get path
- if (self.options.mode === 'pushState') {
- frag = root.location.pathname.replace(self.options.root, '');
- } else if (self.options.mode !== 'pushState' && root.location) {
- frag = (root.location.hash) ? root.location.hash.split((self.options.hashBang ? '#!' : '#'))[1] : '';
- } else {
- frag = root._pathname || '';
- }
-
- return frag;
- } else if (pathname === false) {
- // Clear path
- if (self.options.mode === 'pushState') {
- root.history.pushState({}, null, self.options.root || '/');
- } else if (root.location) {
- root.location.hash = (self.options.hashBang) ? '!' : '';
- }
-
- return self;
- }
- };
- /**
- * Create routes based on an object
- *
- * @param {Object} [Options, Routes]
- * @param {Object Routes}
- * @return {self} Router
- */
- Grapnel.listen = function() {
- var opts, routes;
- if (arguments[0] && arguments[1]) {
- opts = arguments[0];
- routes = arguments[1];
- } else {
- routes = arguments[0];
- }
- // Return a new Grapnel instance
- return (function() {
- // TODO: Accept multi-level routes
- for (var key in routes) {
- this.add.call(this, key, routes[key]);
- }
-
- return this;
- }).call(new Grapnel(opts || {}));
- };
- /**
- * Create a call stack that can be enqueued by handlers and middleware
- *
- * @param {Object} Router
- * @param {Object} Extend
- * @return {self} CallStack
- */
- function CallStack(router, extendObj) {
- this.stack = CallStack.global.slice(0);
- this.router = router;
- this.runCallback = true;
- this.callbackRan = false;
- this.propagateEvent = true;
- this.value = router.path();
-
- for (var key in extendObj) {
- this[key] = extendObj[key];
- }
-
- return this;
- };
- /**
- * Build request parameters and allow them to be checked against a string (usually the current path)
- *
- * @param {String} Route
- * @return {self} Request
- */
- function Request(route) {
- this.route = route;
- this.keys = [];
- this.regex = Grapnel.regexRoute(route, this.keys);
- };
- // This allows global middleware
- CallStack.global = [];
- /**
- * Prevent a callback from being called
- *
- * @return {self} CallStack
- */
- CallStack.prototype.preventDefault = function() {
- this.runCallback = false;
- };
- /**
- * Prevent any future callbacks from being called
- *
- * @return {self} CallStack
- */
- CallStack.prototype.stopPropagation = function() {
- this.propagateEvent = false;
- };
- /**
- * Get parent state
- *
- * @return {Object} Previous state
- */
- CallStack.prototype.parent = function() {
- var hasParentEvents = !!(this.previousState && this.previousState.value && this.previousState.value == this.value);
- return (hasParentEvents) ? this.previousState : false;
- };
- /**
- * Run a callback (calls to next)
- *
- * @return {self} CallStack
- */
- CallStack.prototype.callback = function() {
- this.callbackRan = true;
- this.timeStamp = Date.now();
- this.next();
- };
- /**
- * Add handler or middleware to the stack
- *
- * @param {Function|Array} Handler or a array of handlers
- * @param {Int} Index to start inserting
- * @return {self} CallStack
- */
- CallStack.prototype.enqueue = function(handler, atIndex) {
- var handlers = (!Array.isArray(handler)) ? [handler] : ((atIndex < handler.length) ? handler.reverse() : handler);
-
- while (handlers.length) {
- this.stack.splice(atIndex || this.stack.length + 1, 0, handlers.shift());
- }
-
- return this;
- };
- /**
- * Call to next item in stack -- this adds the `req`, `event`, and `next()` arguments to all middleware
- *
- * @return {self} CallStack
- */
- CallStack.prototype.next = function() {
- var self = this;
-
- return this.stack.shift().call(this.router, this.req, this, function next() {
- self.next.call(self);
- });
- };
- /**
- * Match a path string -- returns a request object if there is a match -- returns false otherwise
- *
- * @return {Object} req
- */
- Request.prototype.parse = function(path) {
- var match = path.match(this.regex),
- self = this;
-
- var req = {
- params: {},
- keys: this.keys,
- matches: (match || []).slice(1),
- match: match
- };
- // Build parameters
- Grapnel._forEach(req.matches, function(value, i) {
- var key = (self.keys[i] && self.keys[i].name) ? self.keys[i].name : i;
- // Parameter key will be its key or the iteration index. This is useful if a wildcard (*) is matched
- req.params[key] = (value) ? decodeURIComponent(value) : undefined;
- });
-
- return req;
- };
-
- // Append utility constructors to Grapnel
- Grapnel.CallStack = CallStack;
- Grapnel.Request = Request;
-
- if ('function' === typeof root.define && !root.define.amd.grapnel) {
- root.define(function(require, exports, module) {
- root.define.amd.grapnel = true;
- return Grapnel;
- });
- } else if ('object' === typeof module && 'object' === typeof module.exports) {
- module.exports = exports = Grapnel;
- } else {
- root.Grapnel = Grapnel;
- }
-
-}).call({}, ('object' === typeof window) ? window : this);
diff --git a/public/assets/prototype/js/grapnel.min.js b/public/assets/prototype/js/grapnel.min.js
deleted file mode 100644
index 0ddf82a..0000000
--- a/public/assets/prototype/js/grapnel.min.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/****
- * Grapnel
- * https://github.com/baseprime/grapnel
- *
- * @author Greg Sabia Tucker
- * @link http://basepri.me
- * @version 0.6.4
- *
- * Released under MIT License. See LICENSE.txt or http://opensource.org/licenses/MIT
-*/
-
-!function(a){function b(b){"use strict";var c=this;return this.events={},this.state=null,this.options=b||{},this.options.env=this.options.env||(0===Object.keys(a).length&&process&&process.browser!==!0?"server":"client"),this.options.mode=this.options.mode||("server"!==this.options.env&&this.options.pushState&&a.history&&a.history.pushState?"pushState":"hashchange"),this.version="0.6.4","function"==typeof a.addEventListener&&(a.addEventListener("hashchange",function(){c.trigger("hashchange")}),a.addEventListener("popstate",function(a){return(!c.state||null!==c.state.previousState)&&void c.trigger("navigate")})),this}function c(a,b){this.stack=c.global.slice(0),this.router=a,this.runCallback=!0,this.callbackRan=!1,this.propagateEvent=!0,this.value=a.path();for(var d in b)this[d]=b[d];return this}function d(a){this.route=a,this.keys=[],this.regex=b.regexRoute(a,this.keys)}b.regexRoute=function(a,b,c,d){return a instanceof RegExp?a:(a instanceof Array&&(a="("+a.join("|")+")"),a=a.concat(d?"":"/?").replace(/\/\(/g,"(?:/").replace(/\+/g,"__plus__").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g,function(a,c,d,e,f,g){return b.push({name:e,optional:!!g}),c=c||"",""+(g?"":c)+"(?:"+(g?c:"")+(d||"")+(f||d&&"([^/.]+?)"||"([^/]+?)")+")"+(g||"")}).replace(/([\/.])/g,"\\$1").replace(/__plus__/g,"(.+)").replace(/\*/g,"(.*)"),new RegExp("^"+a+"$",c?"":"i"))},b._forEach=function(a,b){return"function"==typeof Array.prototype.forEach?Array.prototype.forEach.call(a,b):function(a,b){for(var c=0,d=this.length;c2?Array.prototype.slice.call(arguments,1,-1):[],f=Array.prototype.slice.call(arguments,-1)[0],g="/"!==a.slice(-1)&&"/"!==d&&""!==d?a+"/":a,h="/"!==d.substr(0,1)?d:d.substr(1),i=g+h;return b.add.apply(b,[i].concat(c).concat(e).concat([f]))}},b.prototype.navigate=function(a){return this.path(a).trigger("navigate")},b.prototype.path=function(b){var c,d=this;return"string"==typeof b?("pushState"===d.options.mode?(c=d.options.root?d.options.root+b:b,a.history.pushState({},null,c)):a.location?a.location.hash=(d.options.hashBang?"!":"")+b:a._pathname=b||"",this):"undefined"==typeof b?c="pushState"===d.options.mode?a.location.pathname.replace(d.options.root,""):"pushState"!==d.options.mode&&a.location?a.location.hash?a.location.hash.split(d.options.hashBang?"#!":"#")[1]:"":a._pathname||"":b===!1?("pushState"===d.options.mode?a.history.pushState({},null,d.options.root||"/"):a.location&&(a.location.hash=d.options.hashBang?"!":""),d):void 0},b.listen=function(){var a,c;return arguments[0]&&arguments[1]?(a=arguments[0],c=arguments[1]):c=arguments[0],function(){for(var a in c)this.add.call(this,a,c[a]);return this}.call(new b(a||{}))},c.global=[],c.prototype.preventDefault=function(){this.runCallback=!1},c.prototype.stopPropagation=function(){this.propagateEvent=!1},c.prototype.parent=function(){var a=!(!this.previousState||!this.previousState.value||this.previousState.value!=this.value);return!!a&&this.previousState},c.prototype.callback=function(){this.callbackRan=!0,this.timeStamp=Date.now(),this.next()},c.prototype.enqueue=function(a,b){for(var c=Array.isArray(a)?b= 2.0.0-beta.1',
- 7: '>= 4.0.0'
- };
-
- exports.REVISION_CHANGES = REVISION_CHANGES;
- var objectType = '[object Object]';
-
- function HandlebarsEnvironment(helpers, partials, decorators) {
- this.helpers = helpers || {};
- this.partials = partials || {};
- this.decorators = decorators || {};
-
- _helpers.registerDefaultHelpers(this);
- _decorators.registerDefaultDecorators(this);
- }
-
- HandlebarsEnvironment.prototype = {
- constructor: HandlebarsEnvironment,
-
- logger: _logger2['default'],
- log: _logger2['default'].log,
-
- registerHelper: function registerHelper(name, fn) {
- if (_utils.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 (_utils.toString.call(name) === objectType) {
- _utils.extend(this.partials, name);
- } else {
- if (typeof partial === 'undefined') {
- throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
- }
- this.partials[name] = partial;
- }
- },
- unregisterPartial: function unregisterPartial(name) {
- delete this.partials[name];
- },
-
- registerDecorator: function registerDecorator(name, fn) {
- if (_utils.toString.call(name) === objectType) {
- if (fn) {
- throw new _exception2['default']('Arg not supported with multiple decorators');
- }
- _utils.extend(this.decorators, name);
- } else {
- this.decorators[name] = fn;
- }
- },
- unregisterDecorator: function unregisterDecorator(name) {
- delete this.decorators[name];
- }
- };
-
- var log = _logger2['default'].log;
-
- exports.log = log;
- exports.createFrame = _utils.createFrame;
- exports.logger = _logger2['default'];
-
-/***/ },
-/* 5 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
- exports.extend = extend;
- exports.indexOf = indexOf;
- exports.escapeExpression = escapeExpression;
- exports.isEmpty = isEmpty;
- exports.createFrame = createFrame;
- 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 */
- 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.isFunction = isFunction;
-
- /* eslint-enable func-style */
-
- /* istanbul ignore next */
- var isArray = Array.isArray || function (value) {
- return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
- };
-
- exports.isArray = isArray;
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
-
- 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 createFrame(object) {
- var frame = extend({}, object);
- frame._parent = object;
- return frame;
- }
-
- function blockParams(params, ids) {
- params.path = ids;
- return params;
- }
-
- function appendContextPath(contextPath, id) {
- return (contextPath ? contextPath + '.' : '') + id;
- }
-
-/***/ },
-/* 6 */
-/***/ function(module, exports) {
-
- '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]];
- }
-
- /* istanbul ignore else */
- 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'];
-
-/***/ },
-/* 7 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.registerDefaultHelpers = registerDefaultHelpers;
-
- var _helpersBlockHelperMissing = __webpack_require__(8);
-
- var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
-
- var _helpersEach = __webpack_require__(9);
-
- var _helpersEach2 = _interopRequireDefault(_helpersEach);
-
- var _helpersHelperMissing = __webpack_require__(10);
-
- var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
-
- var _helpersIf = __webpack_require__(11);
-
- var _helpersIf2 = _interopRequireDefault(_helpersIf);
-
- var _helpersLog = __webpack_require__(12);
-
- var _helpersLog2 = _interopRequireDefault(_helpersLog);
-
- var _helpersLookup = __webpack_require__(13);
-
- var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
-
- var _helpersWith = __webpack_require__(14);
-
- var _helpersWith2 = _interopRequireDefault(_helpersWith);
-
- function registerDefaultHelpers(instance) {
- _helpersBlockHelperMissing2['default'](instance);
- _helpersEach2['default'](instance);
- _helpersHelperMissing2['default'](instance);
- _helpersIf2['default'](instance);
- _helpersLog2['default'](instance);
- _helpersLookup2['default'](instance);
- _helpersWith2['default'](instance);
- }
-
-/***/ },
-/* 8 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- 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 (_utils.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 = _utils.createFrame(options.data);
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
- options = { data: data };
- }
-
- return fn(context, options);
- }
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 9 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- exports['default'] = function (instance) {
- 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 (_utils.isFunction(context)) {
- context = context.call(this);
- }
-
- if (options.data) {
- data = _utils.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 (_utils.isArray(context)) {
- for (var j = context.length; i < j; i++) {
- if (i in context) {
- 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 !== undefined) {
- execIteration(priorKey, i - 1);
- }
- priorKey = key;
- i++;
- }
- }
- if (priorKey !== undefined) {
- execIteration(priorKey, i - 1, true);
- }
- }
- }
-
- if (i === 0) {
- ret = inverse(this);
- }
-
- return ret;
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 10 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- exports['default'] = function (instance) {
- instance.registerHelper('helperMissing', function () /* [args, ]options */{
- if (arguments.length === 1) {
- // A missing field in a {{foo}} construct.
- return undefined;
- } else {
- // Someone is actually trying to call something, blow up.
- throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
- }
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 11 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- instance.registerHelper('if', function (conditional, options) {
- if (_utils.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 });
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 12 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- exports['default'] = function (instance) {
- instance.registerHelper('log', function () /* message, options */{
- var args = [undefined],
- options = arguments[arguments.length - 1];
- for (var i = 0; i < arguments.length - 1; i++) {
- args.push(arguments[i]);
- }
-
- var level = 1;
- if (options.hash.level != null) {
- level = options.hash.level;
- } else if (options.data && options.data.level != null) {
- level = options.data.level;
- }
- args[0] = level;
-
- instance.log.apply(instance, args);
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 13 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- exports['default'] = function (instance) {
- instance.registerHelper('lookup', function (obj, field) {
- return obj && obj[field];
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 14 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- instance.registerHelper('with', function (context, options) {
- if (_utils.isFunction(context)) {
- context = context.call(this);
- }
-
- var fn = options.fn;
-
- if (!_utils.isEmpty(context)) {
- var data = options.data;
- if (options.data && options.ids) {
- data = _utils.createFrame(options.data);
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
- }
-
- return fn(context, {
- data: data,
- blockParams: _utils.blockParams([context], [data && data.contextPath])
- });
- } else {
- return options.inverse(this);
- }
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 15 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.registerDefaultDecorators = registerDefaultDecorators;
-
- var _decoratorsInline = __webpack_require__(16);
-
- var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
-
- function registerDefaultDecorators(instance) {
- _decoratorsInline2['default'](instance);
- }
-
-/***/ },
-/* 16 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- instance.registerDecorator('inline', function (fn, props, container, options) {
- var ret = fn;
- if (!props.partials) {
- props.partials = {};
- ret = function (context, options) {
- // Create a new partials stack frame prior to exec.
- var original = container.partials;
- container.partials = _utils.extend({}, original, props.partials);
- var ret = fn(context, options);
- container.partials = original;
- return ret;
- };
- }
-
- props.partials[options.args[0]] = options.fn;
-
- return ret;
- });
- };
-
- module.exports = exports['default'];
-
-/***/ },
-/* 17 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- var logger = {
- methodMap: ['debug', 'info', 'warn', 'error'],
- level: 'info',
-
- // Maps a given level value to the `methodMap` indexes above.
- lookupLevel: function lookupLevel(level) {
- if (typeof level === 'string') {
- var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
- if (levelMap >= 0) {
- level = levelMap;
- } else {
- level = parseInt(level, 10);
- }
- }
-
- return level;
- },
-
- // Can be overridden in the host environment
- log: function log(level) {
- level = logger.lookupLevel(level);
-
- if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
- var method = logger.methodMap[level];
- if (!console[method]) {
- // eslint-disable-line no-console
- method = 'log';
- }
-
- for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- message[_key - 1] = arguments[_key];
- }
-
- console[method].apply(console, message); // eslint-disable-line no-console
- }
- }
- };
-
- exports['default'] = logger;
- module.exports = exports['default'];
-
-/***/ },
-/* 18 */
-/***/ function(module, exports) {
-
- // Build out our basic SafeString type
- 'use strict';
-
- exports.__esModule = true;
- function SafeString(string) {
- this.string = string;
- }
-
- SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
- return '' + this.string;
- };
-
- exports['default'] = SafeString;
- module.exports = exports['default'];
-
-/***/ },
-/* 19 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireWildcard = __webpack_require__(3)['default'];
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.checkRevision = checkRevision;
- exports.template = template;
- exports.wrapProgram = wrapProgram;
- exports.resolvePartial = resolvePartial;
- exports.invokePartial = invokePartial;
- exports.noop = noop;
-
- var _utils = __webpack_require__(5);
-
- var Utils = _interopRequireWildcard(_utils);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _base = __webpack_require__(4);
-
- 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 _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);
- }
-
- templateSpec.main.decorator = templateSpec.main_d;
-
- // 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);
- if (options.ids) {
- options.ids[0] = true;
- }
- }
-
- 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) {
- var ret = templateSpec[i];
- ret.decorator = templateSpec[i + '_d'];
- return ret;
- },
-
- 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.length <= 1 || 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) {
- if (options.depths) {
- depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths;
- } else {
- depths = [context];
- }
- }
-
- function main(context /*, options*/) {
- return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
- }
- main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
- return main(context, options);
- }
- 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 || templateSpec.useDecorators) {
- container.decorators = container.merge(options.decorators, env.decorators);
- }
- } else {
- container.helpers = options.helpers;
- container.partials = options.partials;
- container.decorators = options.decorators;
- }
- };
-
- 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.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
-
- var currentDepths = depths;
- if (depths && context !== depths[0]) {
- currentDepths = [context].concat(depths);
- }
-
- return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
- }
-
- prog = executeDecorators(fn, prog, container, depths, data, blockParams);
-
- prog.program = i;
- prog.depth = depths ? depths.length : 0;
- prog.blockParams = declaredBlockParams || 0;
- return prog;
- }
-
- function resolvePartial(partial, context, options) {
- if (!partial) {
- if (options.name === '@partial-block') {
- partial = options.data['partial-block'];
- } else {
- 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 (options.ids) {
- options.data.contextPath = options.ids[0] || options.data.contextPath;
- }
-
- var partialBlock = undefined;
- if (options.fn && options.fn !== noop) {
- options.data = _base.createFrame(options.data);
- partialBlock = options.data['partial-block'] = options.fn;
-
- if (partialBlock.partials) {
- options.partials = Utils.extend({}, options.partials, partialBlock.partials);
- }
- }
-
- if (partial === undefined && partialBlock) {
- partial = partialBlock;
- }
-
- 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 ? _base.createFrame(data) : {};
- data.root = context;
- }
- return data;
- }
-
- function executeDecorators(fn, prog, container, depths, data, blockParams) {
- if (fn.decorator) {
- var props = {};
- prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
- Utils.extend(prog, props);
- }
- return prog;
- }
-
-/***/ },
-/* 20 */
-/***/ function(module, exports) {
-
- /* WEBPACK VAR INJECTION */(function(global) {/* global window */
- 'use strict';
-
- exports.__esModule = true;
-
- 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;
- }
- return Handlebars;
- };
- };
-
- module.exports = exports['default'];
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
-/* 21 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
- var AST = {
- // 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.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && 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'];
-
-/***/ },
-/* 22 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- var _interopRequireWildcard = __webpack_require__(3)['default'];
-
- exports.__esModule = true;
- exports.parse = parse;
-
- var _parser = __webpack_require__(23);
-
- var _parser2 = _interopRequireDefault(_parser);
-
- var _whitespaceControl = __webpack_require__(24);
-
- var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
-
- var _helpers = __webpack_require__(26);
-
- var Helpers = _interopRequireWildcard(_helpers);
-
- var _utils = __webpack_require__(5);
-
- exports.parser = _parser2['default'];
-
- var yy = {};
- _utils.extend(yy, Helpers);
-
- 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'](options);
- return strip.accept(_parser2['default'].parse(input));
- }
-
-/***/ },
-/* 23 */
-/***/ function(module, exports) {
-
- /* istanbul ignore next */
- /* Jison generated parser */
- "use strict";
-
- 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, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
- terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
- productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
- /**/) {
-
- var $0 = $$.length - 1;
- switch (yystate) {
- case 1:
- return $$[$0 - 1];
- break;
- case 2:
- this.$ = yy.prepareProgram($$[$0]);
- 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.$ = $$[$0];
- break;
- case 9:
- this.$ = {
- type: 'CommentStatement',
- value: yy.stripComment($$[$0]),
- strip: yy.stripFlags($$[$0], $$[$0]),
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 10:
- this.$ = {
- type: 'ContentStatement',
- original: $$[$0],
- value: $$[$0],
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 11:
- this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
- break;
- case 12:
- this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
- break;
- case 13:
- this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
- break;
- case 14:
- this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
- break;
- case 15:
- this.$ = { open: $$[$0 - 5], 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.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
- break;
- case 18:
- this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
- break;
- case 19:
- var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
- program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
- program.chained = true;
-
- this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
-
- break;
- case 20:
- this.$ = $$[$0];
- break;
- case 21:
- this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
- break;
- case 22:
- this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
- break;
- case 23:
- this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
- break;
- case 24:
- this.$ = {
- type: 'PartialStatement',
- name: $$[$0 - 3],
- params: $$[$0 - 2],
- hash: $$[$0 - 1],
- indent: '',
- strip: yy.stripFlags($$[$0 - 4], $$[$0]),
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 25:
- this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
- break;
- case 26:
- this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
- break;
- case 27:
- this.$ = $$[$0];
- break;
- case 28:
- this.$ = $$[$0];
- break;
- case 29:
- this.$ = {
- type: 'SubExpression',
- path: $$[$0 - 3],
- params: $$[$0 - 2],
- hash: $$[$0 - 1],
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 30:
- this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
- break;
- case 31:
- this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
- break;
- case 32:
- this.$ = yy.id($$[$0 - 1]);
- break;
- case 33:
- this.$ = $$[$0];
- break;
- case 34:
- this.$ = $$[$0];
- break;
- case 35:
- this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
- break;
- case 36:
- this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
- break;
- case 37:
- this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
- break;
- case 38:
- this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
- break;
- case 39:
- this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
- break;
- case 40:
- this.$ = $$[$0];
- break;
- case 41:
- this.$ = $$[$0];
- break;
- case 42:
- this.$ = yy.preparePath(true, $$[$0], this._$);
- break;
- case 43:
- this.$ = yy.preparePath(false, $$[$0], this._$);
- break;
- case 44:
- $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
- break;
- case 45:
- this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
- break;
- case 46:
- this.$ = [];
- break;
- case 47:
- $$[$0 - 1].push($$[$0]);
- break;
- case 48:
- this.$ = [$$[$0]];
- break;
- case 49:
- $$[$0 - 1].push($$[$0]);
- break;
- case 50:
- this.$ = [];
- break;
- case 51:
- $$[$0 - 1].push($$[$0]);
- break;
- case 58:
- this.$ = [];
- break;
- case 59:
- $$[$0 - 1].push($$[$0]);
- break;
- case 64:
- this.$ = [];
- break;
- case 65:
- $$[$0 - 1].push($$[$0]);
- break;
- case 70:
- this.$ = [];
- break;
- case 71:
- $$[$0 - 1].push($$[$0]);
- break;
- case 78:
- this.$ = [];
- break;
- case 79:
- $$[$0 - 1].push($$[$0]);
- break;
- case 82:
- this.$ = [];
- break;
- case 83:
- $$[$0 - 1].push($$[$0]);
- break;
- case 86:
- this.$ = [];
- break;
- case 87:
- $$[$0 - 1].push($$[$0]);
- break;
- case 90:
- this.$ = [];
- break;
- case 91:
- $$[$0 - 1].push($$[$0]);
- break;
- case 94:
- this.$ = [];
- break;
- case 95:
- $$[$0 - 1].push($$[$0]);
- break;
- case 98:
- this.$ = [$$[$0]];
- break;
- case 99:
- $$[$0 - 1].push($$[$0]);
- break;
- case 100:
- this.$ = [$$[$0]];
- break;
- case 101:
- $$[$0 - 1].push($$[$0]);
- break;
- }
- },
- table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
- defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
- 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 15;
-
- break;
- case 1:
- return 15;
- break;
- case 2:
- this.popState();
- return 15;
-
- break;
- case 3:
- this.begin('raw');return 15;
- break;
- case 4:
- this.popState();
- // Should be using `this.topState()` below, but it currently
- // returns the second top instead of the first top. Opened an
- // issue about it at https://github.com/zaach/jison/issues/291
- if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
- return 15;
- } else {
- yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
- return 'END_RAW_BLOCK';
- }
-
- break;
- case 5:
- return 15;
- break;
- case 6:
- this.popState();
- return 14;
-
- break;
- case 7:
- return 65;
- break;
- case 8:
- return 68;
- break;
- case 9:
- return 19;
- break;
- case 10:
- this.popState();
- this.begin('raw');
- return 23;
-
- break;
- case 11:
- return 55;
- break;
- case 12:
- return 60;
- break;
- case 13:
- return 29;
- break;
- case 14:
- return 47;
- break;
- case 15:
- this.popState();return 44;
- break;
- case 16:
- this.popState();return 44;
- break;
- case 17:
- return 34;
- break;
- case 18:
- return 39;
- break;
- case 19:
- return 51;
- break;
- case 20:
- return 48;
- break;
- case 21:
- this.unput(yy_.yytext);
- this.popState();
- this.begin('com');
-
- break;
- case 22:
- this.popState();
- return 14;
-
- break;
- case 23:
- return 48;
- break;
- case 24:
- return 73;
- break;
- case 25:
- return 72;
- break;
- case 26:
- return 72;
- break;
- case 27:
- return 87;
- break;
- case 28:
- // ignore whitespace
- break;
- case 29:
- this.popState();return 54;
- break;
- case 30:
- this.popState();return 33;
- break;
- case 31:
- yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
- break;
- case 32:
- yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
- break;
- case 33:
- return 85;
- break;
- case 34:
- return 82;
- break;
- case 35:
- return 82;
- break;
- case 36:
- return 83;
- break;
- case 37:
- return 84;
- break;
- case 38:
- return 81;
- break;
- case 39:
- return 75;
- break;
- case 40:
- return 77;
- break;
- case 41:
- return 72;
- break;
- case 42:
- yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
- break;
- case 43:
- return 'INVALID';
- break;
- case 44:
- 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": [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], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
- return lexer;
- })();
- parser.lexer = lexer;
- function Parser() {
- this.yy = {};
- }Parser.prototype = parser;parser.Parser = Parser;
- return new Parser();
- })();exports.__esModule = true;
- exports['default'] = handlebars;
-
-/***/ },
-/* 24 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _visitor = __webpack_require__(25);
-
- var _visitor2 = _interopRequireDefault(_visitor);
-
- function WhitespaceControl() {
- var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
-
- this.options = options;
- }
- WhitespaceControl.prototype = new _visitor2['default']();
-
- WhitespaceControl.prototype.Program = function (program) {
- var doStandalone = !this.options.ignoreStandalone;
-
- 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 (doStandalone && 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 (doStandalone && openStandalone) {
- omitRight((current.program || current.inverse).body);
-
- // Strip out the previous content node if it's whitespace only
- omitLeft(body, i);
- }
- if (doStandalone && closeStandalone) {
- // Always strip the next node
- omitRight(body, i);
-
- omitLeft((current.inverse || current.program).body);
- }
- }
-
- return program;
- };
-
- WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = 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 (!this.options.ignoreStandalone && 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.Decorator = 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'];
-
-/***/ },
-/* 25 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- 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: This may have a few false positives for type for the helper
- // methods but will generally do the right thing without a lot of overhead.
- if (value && !Visitor.prototype[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;
- }
-
- /* istanbul ignore next: Sanity code */
- if (!this[object.type]) {
- throw new _exception2['default']('Unknown type: ' + object.type, object);
- }
-
- 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: visitSubExpression,
- Decorator: visitSubExpression,
-
- BlockStatement: visitBlock,
- DecoratorBlock: visitBlock,
-
- PartialStatement: visitPartial,
- PartialBlockStatement: function PartialBlockStatement(partial) {
- visitPartial.call(this, partial);
-
- this.acceptKey(partial, 'program');
- },
-
- ContentStatement: function ContentStatement() /* content */{},
- CommentStatement: function CommentStatement() /* comment */{},
-
- SubExpression: visitSubExpression,
-
- PathExpression: function PathExpression() /* path */{},
-
- StringLiteral: function StringLiteral() /* string */{},
- NumberLiteral: function NumberLiteral() /* number */{},
- BooleanLiteral: function BooleanLiteral() /* bool */{},
- UndefinedLiteral: function UndefinedLiteral() /* literal */{},
- NullLiteral: function NullLiteral() /* literal */{},
-
- Hash: function Hash(hash) {
- this.acceptArray(hash.pairs);
- },
- HashPair: function HashPair(pair) {
- this.acceptRequired(pair, 'value');
- }
- };
-
- function visitSubExpression(mustache) {
- this.acceptRequired(mustache, 'path');
- this.acceptArray(mustache.params);
- this.acceptKey(mustache, 'hash');
- }
- function visitBlock(block) {
- visitSubExpression.call(this, block);
-
- this.acceptKey(block, 'program');
- this.acceptKey(block, 'inverse');
- }
- function visitPartial(partial) {
- this.acceptRequired(partial, 'name');
- this.acceptArray(partial.params);
- this.acceptKey(partial, 'hash');
- }
-
- exports['default'] = Visitor;
- module.exports = exports['default'];
-
-/***/ },
-/* 26 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['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;
- exports.prepareProgram = prepareProgram;
- exports.preparePartialBlock = preparePartialBlock;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- function validateClose(open, close) {
- close = close.path ? close.path.original : close;
-
- if (open.path.original !== close) {
- var errorNode = { loc: open.path.loc };
-
- throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
- }
- }
-
- 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, loc) {
- loc = this.locInfo(loc);
-
- 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: loc });
- } else if (part === '..') {
- depth++;
- depthString += '../';
- }
- } else {
- dig.push(part);
- }
- }
-
- return {
- type: 'PathExpression',
- data: data,
- depth: depth,
- parts: dig,
- original: original,
- loc: loc
- };
- }
-
- 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 !== '&';
-
- var decorator = /\*/.test(open);
- return {
- type: decorator ? 'Decorator' : 'MustacheStatement',
- path: path,
- params: params,
- hash: hash,
- escaped: escaped,
- strip: strip,
- loc: this.locInfo(locInfo)
- };
- }
-
- function prepareRawBlock(openRawBlock, contents, close, locInfo) {
- validateClose(openRawBlock, close);
-
- locInfo = this.locInfo(locInfo);
- var program = {
- type: 'Program',
- body: contents,
- strip: {},
- loc: locInfo
- };
-
- return {
- type: 'BlockStatement',
- path: openRawBlock.path,
- params: openRawBlock.params,
- hash: openRawBlock.hash,
- program: program,
- openStrip: {},
- inverseStrip: {},
- closeStrip: {},
- loc: locInfo
- };
- }
-
- function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
- if (close && close.path) {
- validateClose(openBlock, close);
- }
-
- var decorator = /\*/.test(openBlock.open);
-
- program.blockParams = openBlock.blockParams;
-
- var inverse = undefined,
- inverseStrip = undefined;
-
- if (inverseAndProgram) {
- if (decorator) {
- throw new _exception2['default']('Unexpected inverse block on decorator', 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 {
- type: decorator ? 'DecoratorBlock' : 'BlockStatement',
- path: openBlock.path,
- params: openBlock.params,
- hash: openBlock.hash,
- program: program,
- inverse: inverse,
- openStrip: openBlock.strip,
- inverseStrip: inverseStrip,
- closeStrip: close && close.strip,
- loc: this.locInfo(locInfo)
- };
- }
-
- function prepareProgram(statements, loc) {
- if (!loc && statements.length) {
- var firstLoc = statements[0].loc,
- lastLoc = statements[statements.length - 1].loc;
-
- /* istanbul ignore else */
- if (firstLoc && lastLoc) {
- loc = {
- source: firstLoc.source,
- start: {
- line: firstLoc.start.line,
- column: firstLoc.start.column
- },
- end: {
- line: lastLoc.end.line,
- column: lastLoc.end.column
- }
- };
- }
- }
-
- return {
- type: 'Program',
- body: statements,
- strip: {},
- loc: loc
- };
- }
-
- function preparePartialBlock(open, program, close, locInfo) {
- validateClose(open, close);
-
- return {
- type: 'PartialBlockStatement',
- name: open.path,
- params: open.params,
- hash: open.hash,
- program: program,
- openStrip: open.strip,
- closeStrip: close && close.strip,
- loc: this.locInfo(locInfo)
- };
- }
-
-/***/ },
-/* 27 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* eslint-disable new-cap */
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.Compiler = Compiler;
- exports.precompile = precompile;
- exports.compile = compile;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _utils = __webpack_require__(5);
-
- var _ast = __webpack_require__(21);
-
- var _ast2 = _interopRequireDefault(_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) {
- /* istanbul ignore else */
- 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) {
- /* istanbul ignore next: Sanity code */
- if (!this[node.type]) {
- throw new _exception2['default']('Unknown type: ' + node.type, 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');
- },
-
- DecoratorBlock: function DecoratorBlock(decorator) {
- var program = decorator.program && this.compileProgram(decorator.program);
- var params = this.setupFullMustacheParams(decorator, program, undefined),
- path = decorator.path;
-
- this.useDecorators = true;
- this.opcode('registerDecorator', params.length, path.original);
- },
-
- PartialStatement: function PartialStatement(partial) {
- this.usePartial = true;
-
- var program = partial.program;
- if (program) {
- program = this.compileProgram(partial.program);
- }
-
- var params = partial.params;
- if (params.length > 1) {
- throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
- } else if (!params.length) {
- if (this.options.explicitPartialContext) {
- this.opcode('pushLiteral', 'undefined');
- } else {
- 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, program, 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');
- },
- PartialBlockStatement: function PartialBlockStatement(partialBlock) {
- this.PartialStatement(partialBlock);
- },
-
- MustacheStatement: function MustacheStatement(mustache) {
- this.SubExpression(mustache);
-
- if (mustache.escaped && !this.options.noEscape) {
- this.opcode('appendEscaped');
- } else {
- this.opcode('append');
- }
- },
- Decorator: function Decorator(decorator) {
- this.DecoratorBlock(decorator);
- },
-
- 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);
-
- path.strict = true;
- this.accept(path);
-
- this.opcode('invokeAmbiguous', name, isBlock);
- },
-
- simpleSexpr: function simpleSexpr(sexpr) {
- var path = sexpr.path;
- path.strict = true;
- this.accept(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.strict = true;
- 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, path.strict);
- } else {
- this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, 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(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
- }
-
- 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 && _utils.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, options, env) {
- if (options === undefined) options = {};
-
- 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 (_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 = {
- type: 'PathExpression',
- data: false,
- depth: 0,
- parts: [literal.original + ''],
- original: literal.original + '',
- loc: literal.loc
- };
- }
- }
-
-/***/ },
-/* 28 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _base = __webpack_require__(4);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _utils = __webpack_require__(5);
-
- var _codeGen = __webpack_require__(29);
-
- var _codeGen2 = _interopRequireDefault(_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, '[', JSON.stringify(name), ']'];
- }
- },
- depthedLookup: function depthedLookup(name) {
- return [this.aliasable('container.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 || {
- decorators: [],
- 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 || environment.useDecorators || 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');
- }
-
- if (!this.decorators.isEmpty()) {
- this.useDecorators = true;
-
- this.decorators.prepend('var decorators = container.decorators;\n');
- this.decorators.push('return fn;');
-
- if (asObject) {
- this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
- } else {
- this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
- this.decorators.push('}\n');
- this.decorators = this.decorators.merge();
- }
- } else {
- this.decorators = undefined;
- }
-
- var fn = this.createFunctionContext(asObject);
- if (!this.isChild) {
- var ret = {
- compiler: this.compilerInfo(),
- main: fn
- };
-
- if (this.decorators) {
- ret.main_d = this.decorators; // eslint-disable-line camelcase
- ret.useDecorators = true;
- }
-
- var _context = this.context;
- var programs = _context.programs;
- var decorators = _context.decorators;
-
- for (i = 0, l = programs.length; i < l; i++) {
- if (programs[i]) {
- ret[i] = programs[i];
- if (decorators[i]) {
- ret[i + '_d'] = decorators[i];
- ret.useDecorators = true;
- }
- }
- }
-
- 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);
- this.decorators = 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 = ['container', '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('container.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, strict, 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, strict);
- },
-
- // [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, strict) {
- if (!depth) {
- this.pushStackLiteral('data');
- } else {
- this.pushStackLiteral('container.data(data, ' + depth + ')');
- }
-
- this.resolvePath('data', parts, 0, true, strict);
- },
-
- resolvePath: function resolvePath(type, parts, i, falsy, strict) {
- // istanbul ignore next
-
- var _this = this;
-
- if (this.options.strict || this.options.assumeObjects) {
- this.push(strictLookup(this.options.strict && 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('container.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);
- }
- },
-
- // [registerDecorator]
- //
- // On stack, before: hash, program, params..., ...
- // On stack, after: ...
- //
- // Pops off the decorator's parameters, invokes the decorator,
- // and inserts the decorator into the decorators list.
- registerDecorator: function registerDecorator(paramSize, name) {
- var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
- options = this.setupHelperArgs(name, paramSize);
-
- this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
- },
-
- // [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);
-
- if (isDynamic) {
- name = this.popStack();
- delete options.name;
- }
-
- if (indent) {
- options.indent = JSON.stringify(indent);
- }
- options.helpers = 'helpers';
- options.partials = 'partials';
- options.decorators = 'container.decorators';
-
- 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('container.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.decorators[index] = compiler.decorators;
- 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 'container.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'),
- callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : {}');
-
- return {
- params: params,
- paramsInit: paramsInit,
- name: foundHelper,
- callParams: [callContext].concat(params)
- };
- },
-
- setupParams: function setupParams(helper, paramSize, params) {
- var options = {},
- contexts = [],
- types = [],
- ids = [],
- objectArgs = !params,
- param = undefined;
-
- if (objectArgs) {
- params = [];
- }
-
- 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 || 'container.noop';
- options.inverse = inverse || 'container.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 (objectArgs) {
- options.args = this.source.generateArray(params);
- }
-
- 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);
- options = this.objectLiteral(options);
- if (useRegister) {
- this.useRegister('options');
- params.push('options');
- return ['options=', options];
- } else if (params) {
- params.push(options);
- return '';
- } else {
- return options;
- }
- }
- };
-
- (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('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
- } else {
- return stack;
- }
- }
-
- exports['default'] = JavaScriptCompiler;
- module.exports = exports['default'];
-
-/***/ },
-/* 29 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* global define */
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- 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) {}
- /* 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 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 = {
- isEmpty: function isEmpty() {
- return !this.source.length;
- },
- 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 = this.currentLocation || { start: {} };
- return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
- },
- wrap: function wrap(chunk) {
- var loc = arguments.length <= 1 || 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) {
- var ret = this.empty();
-
- for (var i = 0, len = entries.length; i < len; i++) {
- if (i) {
- ret.add(',');
- }
-
- ret.add(castChunk(entries[i], this));
- }
-
- return ret;
- },
-
- generateArray: function generateArray(entries) {
- var ret = this.generateList(entries);
- ret.prepend('[');
- ret.add(']');
-
- return ret;
- }
- };
-
- exports['default'] = CodeGen;
- module.exports = exports['default'];
-
-/***/ }
-/******/ ])
-});
-;
\ No newline at end of file
diff --git a/public/assets/prototype/js/handlebars.js b/public/assets/prototype/js/handlebars.js
deleted file mode 100644
index 11b5133..0000000
--- a/public/assets/prototype/js/handlebars.js
+++ /dev/null
@@ -1,4839 +0,0 @@
-/**!
-
- @license
- handlebars v4.0.13
-
-Copyright (C) 2011-2017 by Yehuda Katz
-
-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.
-
-*/
-(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 _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _handlebarsRuntime = __webpack_require__(2);
-
- var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
-
- // Compiler imports
-
- var _handlebarsCompilerAst = __webpack_require__(35);
-
- var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
-
- var _handlebarsCompilerBase = __webpack_require__(36);
-
- var _handlebarsCompilerCompiler = __webpack_require__(41);
-
- var _handlebarsCompilerJavascriptCompiler = __webpack_require__(42);
-
- var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
-
- var _handlebarsCompilerVisitor = __webpack_require__(39);
-
- var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
-
- var _handlebarsNoConflict = __webpack_require__(34);
-
- var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
-
- var _create = _handlebarsRuntime2['default'].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);
- };
-
- hb.AST = _handlebarsCompilerAst2['default'];
- hb.Compiler = _handlebarsCompilerCompiler.Compiler;
- hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
- hb.Parser = _handlebarsCompilerBase.parser;
- hb.parse = _handlebarsCompilerBase.parse;
-
- return hb;
- }
-
- var inst = create();
- inst.create = create;
-
- _handlebarsNoConflict2['default'](inst);
-
- inst.Visitor = _handlebarsCompilerVisitor2['default'];
-
- inst['default'] = inst;
-
- exports['default'] = inst;
- module.exports = exports['default'];
-
-/***/ }),
-/* 1 */
-/***/ (function(module, exports) {
-
- "use strict";
-
- exports["default"] = function (obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- };
-
- exports.__esModule = true;
-
-/***/ }),
-/* 2 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireWildcard = __webpack_require__(3)['default'];
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _handlebarsBase = __webpack_require__(4);
-
- var base = _interopRequireWildcard(_handlebarsBase);
-
- // 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 _handlebarsSafeString = __webpack_require__(21);
-
- var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
-
- var _handlebarsException = __webpack_require__(6);
-
- var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
-
- var _handlebarsUtils = __webpack_require__(5);
-
- var Utils = _interopRequireWildcard(_handlebarsUtils);
-
- var _handlebarsRuntime = __webpack_require__(22);
-
- var runtime = _interopRequireWildcard(_handlebarsRuntime);
-
- var _handlebarsNoConflict = __webpack_require__(34);
-
- var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
-
- // 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 = _handlebarsSafeString2['default'];
- hb.Exception = _handlebarsException2['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;
-
- _handlebarsNoConflict2['default'](inst);
-
- inst['default'] = inst;
-
- exports['default'] = inst;
- module.exports = exports['default'];
-
-/***/ }),
-/* 3 */
-/***/ (function(module, exports) {
-
- "use strict";
-
- exports["default"] = function (obj) {
- if (obj && obj.__esModule) {
- return obj;
- } else {
- var newObj = {};
-
- if (obj != null) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
- }
- }
-
- newObj["default"] = obj;
- return newObj;
- }
- };
-
- exports.__esModule = true;
-
-/***/ }),
-/* 4 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.HandlebarsEnvironment = HandlebarsEnvironment;
-
- var _utils = __webpack_require__(5);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _helpers = __webpack_require__(10);
-
- var _decorators = __webpack_require__(18);
-
- var _logger = __webpack_require__(20);
-
- var _logger2 = _interopRequireDefault(_logger);
-
- var VERSION = '4.0.13';
- exports.VERSION = VERSION;
- var COMPILER_REVISION = 7;
-
- 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',
- 7: '>= 4.0.0'
- };
-
- exports.REVISION_CHANGES = REVISION_CHANGES;
- var objectType = '[object Object]';
-
- function HandlebarsEnvironment(helpers, partials, decorators) {
- this.helpers = helpers || {};
- this.partials = partials || {};
- this.decorators = decorators || {};
-
- _helpers.registerDefaultHelpers(this);
- _decorators.registerDefaultDecorators(this);
- }
-
- HandlebarsEnvironment.prototype = {
- constructor: HandlebarsEnvironment,
-
- logger: _logger2['default'],
- log: _logger2['default'].log,
-
- registerHelper: function registerHelper(name, fn) {
- if (_utils.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 (_utils.toString.call(name) === objectType) {
- _utils.extend(this.partials, name);
- } else {
- if (typeof partial === 'undefined') {
- throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
- }
- this.partials[name] = partial;
- }
- },
- unregisterPartial: function unregisterPartial(name) {
- delete this.partials[name];
- },
-
- registerDecorator: function registerDecorator(name, fn) {
- if (_utils.toString.call(name) === objectType) {
- if (fn) {
- throw new _exception2['default']('Arg not supported with multiple decorators');
- }
- _utils.extend(this.decorators, name);
- } else {
- this.decorators[name] = fn;
- }
- },
- unregisterDecorator: function unregisterDecorator(name) {
- delete this.decorators[name];
- }
- };
-
- var log = _logger2['default'].log;
-
- exports.log = log;
- exports.createFrame = _utils.createFrame;
- exports.logger = _logger2['default'];
-
-/***/ }),
-/* 5 */
-/***/ (function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
- exports.extend = extend;
- exports.indexOf = indexOf;
- exports.escapeExpression = escapeExpression;
- exports.isEmpty = isEmpty;
- exports.createFrame = createFrame;
- 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 */
- 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.isFunction = isFunction;
-
- /* eslint-enable func-style */
-
- /* istanbul ignore next */
- var isArray = Array.isArray || function (value) {
- return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
- };
-
- exports.isArray = isArray;
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
-
- 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 createFrame(object) {
- var frame = extend({}, object);
- frame._parent = object;
- return frame;
- }
-
- function blockParams(params, ids) {
- params.path = ids;
- return params;
- }
-
- function appendContextPath(contextPath, id) {
- return (contextPath ? contextPath + '.' : '') + id;
- }
-
-/***/ }),
-/* 6 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _Object$defineProperty = __webpack_require__(7)['default'];
-
- 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]];
- }
-
- /* istanbul ignore else */
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, Exception);
- }
-
- try {
- if (loc) {
- this.lineNumber = line;
-
- // Work around issue under safari where we can't directly set the column value
- /* istanbul ignore next */
- if (_Object$defineProperty) {
- Object.defineProperty(this, 'column', {
- value: column,
- enumerable: true
- });
- } else {
- this.column = column;
- }
- }
- } catch (nop) {
- /* Ignore if the browser is very particular */
- }
- }
-
- Exception.prototype = new Error();
-
- exports['default'] = Exception;
- module.exports = exports['default'];
-
-/***/ }),
-/* 7 */
-/***/ (function(module, exports, __webpack_require__) {
-
- module.exports = { "default": __webpack_require__(8), __esModule: true };
-
-/***/ }),
-/* 8 */
-/***/ (function(module, exports, __webpack_require__) {
-
- var $ = __webpack_require__(9);
- module.exports = function defineProperty(it, key, desc){
- return $.setDesc(it, key, desc);
- };
-
-/***/ }),
-/* 9 */
-/***/ (function(module, exports) {
-
- var $Object = Object;
- module.exports = {
- create: $Object.create,
- getProto: $Object.getPrototypeOf,
- isEnum: {}.propertyIsEnumerable,
- getDesc: $Object.getOwnPropertyDescriptor,
- setDesc: $Object.defineProperty,
- setDescs: $Object.defineProperties,
- getKeys: $Object.keys,
- getNames: $Object.getOwnPropertyNames,
- getSymbols: $Object.getOwnPropertySymbols,
- each: [].forEach
- };
-
-/***/ }),
-/* 10 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.registerDefaultHelpers = registerDefaultHelpers;
-
- var _helpersBlockHelperMissing = __webpack_require__(11);
-
- var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
-
- var _helpersEach = __webpack_require__(12);
-
- var _helpersEach2 = _interopRequireDefault(_helpersEach);
-
- var _helpersHelperMissing = __webpack_require__(13);
-
- var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
-
- var _helpersIf = __webpack_require__(14);
-
- var _helpersIf2 = _interopRequireDefault(_helpersIf);
-
- var _helpersLog = __webpack_require__(15);
-
- var _helpersLog2 = _interopRequireDefault(_helpersLog);
-
- var _helpersLookup = __webpack_require__(16);
-
- var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
-
- var _helpersWith = __webpack_require__(17);
-
- var _helpersWith2 = _interopRequireDefault(_helpersWith);
-
- function registerDefaultHelpers(instance) {
- _helpersBlockHelperMissing2['default'](instance);
- _helpersEach2['default'](instance);
- _helpersHelperMissing2['default'](instance);
- _helpersIf2['default'](instance);
- _helpersLog2['default'](instance);
- _helpersLookup2['default'](instance);
- _helpersWith2['default'](instance);
- }
-
-/***/ }),
-/* 11 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- 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 (_utils.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 = _utils.createFrame(options.data);
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
- options = { data: data };
- }
-
- return fn(context, options);
- }
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 12 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- exports['default'] = function (instance) {
- 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 (_utils.isFunction(context)) {
- context = context.call(this);
- }
-
- if (options.data) {
- data = _utils.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 (_utils.isArray(context)) {
- for (var j = context.length; i < j; i++) {
- if (i in context) {
- 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 !== undefined) {
- execIteration(priorKey, i - 1);
- }
- priorKey = key;
- i++;
- }
- }
- if (priorKey !== undefined) {
- execIteration(priorKey, i - 1, true);
- }
- }
- }
-
- if (i === 0) {
- ret = inverse(this);
- }
-
- return ret;
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 13 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- exports['default'] = function (instance) {
- instance.registerHelper('helperMissing', function () /* [args, ]options */{
- if (arguments.length === 1) {
- // A missing field in a {{foo}} construct.
- return undefined;
- } else {
- // Someone is actually trying to call something, blow up.
- throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
- }
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 14 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- instance.registerHelper('if', function (conditional, options) {
- if (_utils.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 });
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 15 */
-/***/ (function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- exports['default'] = function (instance) {
- instance.registerHelper('log', function () /* message, options */{
- var args = [undefined],
- options = arguments[arguments.length - 1];
- for (var i = 0; i < arguments.length - 1; i++) {
- args.push(arguments[i]);
- }
-
- var level = 1;
- if (options.hash.level != null) {
- level = options.hash.level;
- } else if (options.data && options.data.level != null) {
- level = options.data.level;
- }
- args[0] = level;
-
- instance.log.apply(instance, args);
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 16 */
-/***/ (function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- exports['default'] = function (instance) {
- instance.registerHelper('lookup', function (obj, field) {
- return obj && obj[field];
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 17 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- instance.registerHelper('with', function (context, options) {
- if (_utils.isFunction(context)) {
- context = context.call(this);
- }
-
- var fn = options.fn;
-
- if (!_utils.isEmpty(context)) {
- var data = options.data;
- if (options.data && options.ids) {
- data = _utils.createFrame(options.data);
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
- }
-
- return fn(context, {
- data: data,
- blockParams: _utils.blockParams([context], [data && data.contextPath])
- });
- } else {
- return options.inverse(this);
- }
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 18 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.registerDefaultDecorators = registerDefaultDecorators;
-
- var _decoratorsInline = __webpack_require__(19);
-
- var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
-
- function registerDefaultDecorators(instance) {
- _decoratorsInline2['default'](instance);
- }
-
-/***/ }),
-/* 19 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- exports['default'] = function (instance) {
- instance.registerDecorator('inline', function (fn, props, container, options) {
- var ret = fn;
- if (!props.partials) {
- props.partials = {};
- ret = function (context, options) {
- // Create a new partials stack frame prior to exec.
- var original = container.partials;
- container.partials = _utils.extend({}, original, props.partials);
- var ret = fn(context, options);
- container.partials = original;
- return ret;
- };
- }
-
- props.partials[options.args[0]] = options.fn;
-
- return ret;
- });
- };
-
- module.exports = exports['default'];
-
-/***/ }),
-/* 20 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- var logger = {
- methodMap: ['debug', 'info', 'warn', 'error'],
- level: 'info',
-
- // Maps a given level value to the `methodMap` indexes above.
- lookupLevel: function lookupLevel(level) {
- if (typeof level === 'string') {
- var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
- if (levelMap >= 0) {
- level = levelMap;
- } else {
- level = parseInt(level, 10);
- }
- }
-
- return level;
- },
-
- // Can be overridden in the host environment
- log: function log(level) {
- level = logger.lookupLevel(level);
-
- if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
- var method = logger.methodMap[level];
- if (!console[method]) {
- // eslint-disable-line no-console
- method = 'log';
- }
-
- for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- message[_key - 1] = arguments[_key];
- }
-
- console[method].apply(console, message); // eslint-disable-line no-console
- }
- }
- };
-
- exports['default'] = logger;
- module.exports = exports['default'];
-
-/***/ }),
-/* 21 */
-/***/ (function(module, exports) {
-
- // Build out our basic SafeString type
- 'use strict';
-
- exports.__esModule = true;
- function SafeString(string) {
- this.string = string;
- }
-
- SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
- return '' + this.string;
- };
-
- exports['default'] = SafeString;
- module.exports = exports['default'];
-
-/***/ }),
-/* 22 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _Object$seal = __webpack_require__(23)['default'];
-
- var _interopRequireWildcard = __webpack_require__(3)['default'];
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.checkRevision = checkRevision;
- exports.template = template;
- exports.wrapProgram = wrapProgram;
- exports.resolvePartial = resolvePartial;
- exports.invokePartial = invokePartial;
- exports.noop = noop;
-
- var _utils = __webpack_require__(5);
-
- var Utils = _interopRequireWildcard(_utils);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _base = __webpack_require__(4);
-
- 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 _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);
- }
-
- templateSpec.main.decorator = templateSpec.main_d;
-
- // 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);
- if (options.ids) {
- options.ids[0] = true;
- }
- }
-
- 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) {
- var ret = templateSpec[i];
- ret.decorator = templateSpec[i + '_d'];
- return ret;
- },
-
- 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;
- },
- // An empty object to use as replacement for null-contexts
- nullContext: _Object$seal({}),
-
- noop: env.VM.noop,
- compilerInfo: templateSpec.compiler
- };
-
- function ret(context) {
- var options = arguments.length <= 1 || 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) {
- if (options.depths) {
- depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
- } else {
- depths = [context];
- }
- }
-
- function main(context /*, options*/) {
- return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
- }
- main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
- return main(context, options);
- }
- 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 || templateSpec.useDecorators) {
- container.decorators = container.merge(options.decorators, env.decorators);
- }
- } else {
- container.helpers = options.helpers;
- container.partials = options.partials;
- container.decorators = options.decorators;
- }
- };
-
- 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.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
-
- var currentDepths = depths;
- if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
- currentDepths = [context].concat(depths);
- }
-
- return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
- }
-
- prog = executeDecorators(fn, prog, container, depths, data, blockParams);
-
- prog.program = i;
- prog.depth = depths ? depths.length : 0;
- prog.blockParams = declaredBlockParams || 0;
- return prog;
- }
-
- function resolvePartial(partial, context, options) {
- if (!partial) {
- if (options.name === '@partial-block') {
- partial = options.data['partial-block'];
- } else {
- 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) {
- // Use the current closure context to save the partial-block if this partial
- var currentPartialBlock = options.data && options.data['partial-block'];
- options.partial = true;
- if (options.ids) {
- options.data.contextPath = options.ids[0] || options.data.contextPath;
- }
-
- var partialBlock = undefined;
- if (options.fn && options.fn !== noop) {
- (function () {
- options.data = _base.createFrame(options.data);
- // Wrapper function to get access to currentPartialBlock from the closure
- var fn = options.fn;
- partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
-
- // Restore the partial-block from the closure for the execution of the block
- // i.e. the part inside the block of the partial call.
- options.data = _base.createFrame(options.data);
- options.data['partial-block'] = currentPartialBlock;
- return fn(context, options);
- };
- if (fn.partials) {
- options.partials = Utils.extend({}, options.partials, fn.partials);
- }
- })();
- }
-
- if (partial === undefined && partialBlock) {
- partial = partialBlock;
- }
-
- 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 ? _base.createFrame(data) : {};
- data.root = context;
- }
- return data;
- }
-
- function executeDecorators(fn, prog, container, depths, data, blockParams) {
- if (fn.decorator) {
- var props = {};
- prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
- Utils.extend(prog, props);
- }
- return prog;
- }
-
-/***/ }),
-/* 23 */
-/***/ (function(module, exports, __webpack_require__) {
-
- module.exports = { "default": __webpack_require__(24), __esModule: true };
-
-/***/ }),
-/* 24 */
-/***/ (function(module, exports, __webpack_require__) {
-
- __webpack_require__(25);
- module.exports = __webpack_require__(30).Object.seal;
-
-/***/ }),
-/* 25 */
-/***/ (function(module, exports, __webpack_require__) {
-
- // 19.1.2.17 Object.seal(O)
- var isObject = __webpack_require__(26);
-
- __webpack_require__(27)('seal', function($seal){
- return function seal(it){
- return $seal && isObject(it) ? $seal(it) : it;
- };
- });
-
-/***/ }),
-/* 26 */
-/***/ (function(module, exports) {
-
- module.exports = function(it){
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
-
-/***/ }),
-/* 27 */
-/***/ (function(module, exports, __webpack_require__) {
-
- // most Object methods by ES6 should accept primitives
- var $export = __webpack_require__(28)
- , core = __webpack_require__(30)
- , fails = __webpack_require__(33);
- module.exports = function(KEY, exec){
- var fn = (core.Object || {})[KEY] || Object[KEY]
- , exp = {};
- exp[KEY] = exec(fn);
- $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
- };
-
-/***/ }),
-/* 28 */
-/***/ (function(module, exports, __webpack_require__) {
-
- var global = __webpack_require__(29)
- , core = __webpack_require__(30)
- , ctx = __webpack_require__(31)
- , PROTOTYPE = 'prototype';
-
- var $export = function(type, name, source){
- var IS_FORCED = type & $export.F
- , IS_GLOBAL = type & $export.G
- , IS_STATIC = type & $export.S
- , IS_PROTO = type & $export.P
- , IS_BIND = type & $export.B
- , IS_WRAP = type & $export.W
- , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
- , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
- , key, own, out;
- if(IS_GLOBAL)source = name;
- for(key in source){
- // contains in native
- own = !IS_FORCED && target && key in target;
- if(own && key in exports)continue;
- // export native or passed
- out = own ? target[key] : source[key];
- // prevent global pollution for namespaces
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
- // bind timers to global for call from export context
- : IS_BIND && own ? ctx(out, global)
- // wrap global constructors for prevent change them in library
- : IS_WRAP && target[key] == out ? (function(C){
- var F = function(param){
- return this instanceof C ? new C(param) : C(param);
- };
- F[PROTOTYPE] = C[PROTOTYPE];
- return F;
- // make static versions for prototype methods
- })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
- }
- };
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- module.exports = $export;
-
-/***/ }),
-/* 29 */
-/***/ (function(module, exports) {
-
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
- if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
-
-/***/ }),
-/* 30 */
-/***/ (function(module, exports) {
-
- var core = module.exports = {version: '1.2.6'};
- if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
-
-/***/ }),
-/* 31 */
-/***/ (function(module, exports, __webpack_require__) {
-
- // optional / simple context binding
- var aFunction = __webpack_require__(32);
- module.exports = function(fn, that, length){
- aFunction(fn);
- if(that === undefined)return fn;
- switch(length){
- case 1: return function(a){
- return fn.call(that, a);
- };
- case 2: return function(a, b){
- return fn.call(that, a, b);
- };
- case 3: return function(a, b, c){
- return fn.call(that, a, b, c);
- };
- }
- return function(/* ...args */){
- return fn.apply(that, arguments);
- };
- };
-
-/***/ }),
-/* 32 */
-/***/ (function(module, exports) {
-
- module.exports = function(it){
- if(typeof it != 'function')throw TypeError(it + ' is not a function!');
- return it;
- };
-
-/***/ }),
-/* 33 */
-/***/ (function(module, exports) {
-
- module.exports = function(exec){
- try {
- return !!exec();
- } catch(e){
- return true;
- }
- };
-
-/***/ }),
-/* 34 */
-/***/ (function(module, exports) {
-
- /* WEBPACK VAR INJECTION */(function(global) {/* global window */
- 'use strict';
-
- exports.__esModule = true;
-
- 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;
- }
- return Handlebars;
- };
- };
-
- module.exports = exports['default'];
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ }),
-/* 35 */
-/***/ (function(module, exports) {
-
- 'use strict';
-
- exports.__esModule = true;
- var AST = {
- // 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.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && 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'];
-
-/***/ }),
-/* 36 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- var _interopRequireWildcard = __webpack_require__(3)['default'];
-
- exports.__esModule = true;
- exports.parse = parse;
-
- var _parser = __webpack_require__(37);
-
- var _parser2 = _interopRequireDefault(_parser);
-
- var _whitespaceControl = __webpack_require__(38);
-
- var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
-
- var _helpers = __webpack_require__(40);
-
- var Helpers = _interopRequireWildcard(_helpers);
-
- var _utils = __webpack_require__(5);
-
- exports.parser = _parser2['default'];
-
- var yy = {};
- _utils.extend(yy, Helpers);
-
- 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'](options);
- return strip.accept(_parser2['default'].parse(input));
- }
-
-/***/ }),
-/* 37 */
-/***/ (function(module, exports) {
-
- // File ignored in coverage tests via setting in .istanbul.yml
- /* Jison generated parser */
- "use strict";
-
- exports.__esModule = true;
- 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, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
- terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
- productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
-
- var $0 = $$.length - 1;
- switch (yystate) {
- case 1:
- return $$[$0 - 1];
- break;
- case 2:
- this.$ = yy.prepareProgram($$[$0]);
- 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.$ = $$[$0];
- break;
- case 9:
- this.$ = {
- type: 'CommentStatement',
- value: yy.stripComment($$[$0]),
- strip: yy.stripFlags($$[$0], $$[$0]),
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 10:
- this.$ = {
- type: 'ContentStatement',
- original: $$[$0],
- value: $$[$0],
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 11:
- this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
- break;
- case 12:
- this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
- break;
- case 13:
- this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
- break;
- case 14:
- this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
- break;
- case 15:
- this.$ = { open: $$[$0 - 5], 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.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
- break;
- case 18:
- this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
- break;
- case 19:
- var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
- program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
- program.chained = true;
-
- this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
-
- break;
- case 20:
- this.$ = $$[$0];
- break;
- case 21:
- this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
- break;
- case 22:
- this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
- break;
- case 23:
- this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
- break;
- case 24:
- this.$ = {
- type: 'PartialStatement',
- name: $$[$0 - 3],
- params: $$[$0 - 2],
- hash: $$[$0 - 1],
- indent: '',
- strip: yy.stripFlags($$[$0 - 4], $$[$0]),
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 25:
- this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
- break;
- case 26:
- this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
- break;
- case 27:
- this.$ = $$[$0];
- break;
- case 28:
- this.$ = $$[$0];
- break;
- case 29:
- this.$ = {
- type: 'SubExpression',
- path: $$[$0 - 3],
- params: $$[$0 - 2],
- hash: $$[$0 - 1],
- loc: yy.locInfo(this._$)
- };
-
- break;
- case 30:
- this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
- break;
- case 31:
- this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
- break;
- case 32:
- this.$ = yy.id($$[$0 - 1]);
- break;
- case 33:
- this.$ = $$[$0];
- break;
- case 34:
- this.$ = $$[$0];
- break;
- case 35:
- this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
- break;
- case 36:
- this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
- break;
- case 37:
- this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
- break;
- case 38:
- this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
- break;
- case 39:
- this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
- break;
- case 40:
- this.$ = $$[$0];
- break;
- case 41:
- this.$ = $$[$0];
- break;
- case 42:
- this.$ = yy.preparePath(true, $$[$0], this._$);
- break;
- case 43:
- this.$ = yy.preparePath(false, $$[$0], this._$);
- break;
- case 44:
- $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
- break;
- case 45:
- this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
- break;
- case 46:
- this.$ = [];
- break;
- case 47:
- $$[$0 - 1].push($$[$0]);
- break;
- case 48:
- this.$ = [$$[$0]];
- break;
- case 49:
- $$[$0 - 1].push($$[$0]);
- break;
- case 50:
- this.$ = [];
- break;
- case 51:
- $$[$0 - 1].push($$[$0]);
- break;
- case 58:
- this.$ = [];
- break;
- case 59:
- $$[$0 - 1].push($$[$0]);
- break;
- case 64:
- this.$ = [];
- break;
- case 65:
- $$[$0 - 1].push($$[$0]);
- break;
- case 70:
- this.$ = [];
- break;
- case 71:
- $$[$0 - 1].push($$[$0]);
- break;
- case 78:
- this.$ = [];
- break;
- case 79:
- $$[$0 - 1].push($$[$0]);
- break;
- case 82:
- this.$ = [];
- break;
- case 83:
- $$[$0 - 1].push($$[$0]);
- break;
- case 86:
- this.$ = [];
- break;
- case 87:
- $$[$0 - 1].push($$[$0]);
- break;
- case 90:
- this.$ = [];
- break;
- case 91:
- $$[$0 - 1].push($$[$0]);
- break;
- case 94:
- this.$ = [];
- break;
- case 95:
- $$[$0 - 1].push($$[$0]);
- break;
- case 98:
- this.$ = [$$[$0]];
- break;
- case 99:
- $$[$0 - 1].push($$[$0]);
- break;
- case 100:
- this.$ = [$$[$0]];
- break;
- case 101:
- $$[$0 - 1].push($$[$0]);
- break;
- }
- },
- table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
- defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
- 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 15;
-
- break;
- case 1:
- return 15;
- break;
- case 2:
- this.popState();
- return 15;
-
- break;
- case 3:
- this.begin('raw');return 15;
- break;
- case 4:
- this.popState();
- // Should be using `this.topState()` below, but it currently
- // returns the second top instead of the first top. Opened an
- // issue about it at https://github.com/zaach/jison/issues/291
- if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
- return 15;
- } else {
- yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
- return 'END_RAW_BLOCK';
- }
-
- break;
- case 5:
- return 15;
- break;
- case 6:
- this.popState();
- return 14;
-
- break;
- case 7:
- return 65;
- break;
- case 8:
- return 68;
- break;
- case 9:
- return 19;
- break;
- case 10:
- this.popState();
- this.begin('raw');
- return 23;
-
- break;
- case 11:
- return 55;
- break;
- case 12:
- return 60;
- break;
- case 13:
- return 29;
- break;
- case 14:
- return 47;
- break;
- case 15:
- this.popState();return 44;
- break;
- case 16:
- this.popState();return 44;
- break;
- case 17:
- return 34;
- break;
- case 18:
- return 39;
- break;
- case 19:
- return 51;
- break;
- case 20:
- return 48;
- break;
- case 21:
- this.unput(yy_.yytext);
- this.popState();
- this.begin('com');
-
- break;
- case 22:
- this.popState();
- return 14;
-
- break;
- case 23:
- return 48;
- break;
- case 24:
- return 73;
- break;
- case 25:
- return 72;
- break;
- case 26:
- return 72;
- break;
- case 27:
- return 87;
- break;
- case 28:
- // ignore whitespace
- break;
- case 29:
- this.popState();return 54;
- break;
- case 30:
- this.popState();return 33;
- break;
- case 31:
- yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
- break;
- case 32:
- yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
- break;
- case 33:
- return 85;
- break;
- case 34:
- return 82;
- break;
- case 35:
- return 82;
- break;
- case 36:
- return 83;
- break;
- case 37:
- return 84;
- break;
- case 38:
- return 81;
- break;
- case 39:
- return 75;
- break;
- case 40:
- return 77;
- break;
- case 41:
- return 72;
- break;
- case 42:
- yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
- break;
- case 43:
- return 'INVALID';
- break;
- case 44:
- 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": [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], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "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"];
-
-/***/ }),
-/* 38 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _visitor = __webpack_require__(39);
-
- var _visitor2 = _interopRequireDefault(_visitor);
-
- function WhitespaceControl() {
- var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
-
- this.options = options;
- }
- WhitespaceControl.prototype = new _visitor2['default']();
-
- WhitespaceControl.prototype.Program = function (program) {
- var doStandalone = !this.options.ignoreStandalone;
-
- 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 (doStandalone && 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 (doStandalone && openStandalone) {
- omitRight((current.program || current.inverse).body);
-
- // Strip out the previous content node if it's whitespace only
- omitLeft(body, i);
- }
- if (doStandalone && closeStandalone) {
- // Always strip the next node
- omitRight(body, i);
-
- omitLeft((current.inverse || current.program).body);
- }
- }
-
- return program;
- };
-
- WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = 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 (!this.options.ignoreStandalone && 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.Decorator = 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'];
-
-/***/ }),
-/* 39 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- 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: This may have a few false positives for type for the helper
- // methods but will generally do the right thing without a lot of overhead.
- if (value && !Visitor.prototype[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;
- }
-
- /* istanbul ignore next: Sanity code */
- if (!this[object.type]) {
- throw new _exception2['default']('Unknown type: ' + object.type, object);
- }
-
- 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: visitSubExpression,
- Decorator: visitSubExpression,
-
- BlockStatement: visitBlock,
- DecoratorBlock: visitBlock,
-
- PartialStatement: visitPartial,
- PartialBlockStatement: function PartialBlockStatement(partial) {
- visitPartial.call(this, partial);
-
- this.acceptKey(partial, 'program');
- },
-
- ContentStatement: function ContentStatement() /* content */{},
- CommentStatement: function CommentStatement() /* comment */{},
-
- SubExpression: visitSubExpression,
-
- PathExpression: function PathExpression() /* path */{},
-
- StringLiteral: function StringLiteral() /* string */{},
- NumberLiteral: function NumberLiteral() /* number */{},
- BooleanLiteral: function BooleanLiteral() /* bool */{},
- UndefinedLiteral: function UndefinedLiteral() /* literal */{},
- NullLiteral: function NullLiteral() /* literal */{},
-
- Hash: function Hash(hash) {
- this.acceptArray(hash.pairs);
- },
- HashPair: function HashPair(pair) {
- this.acceptRequired(pair, 'value');
- }
- };
-
- function visitSubExpression(mustache) {
- this.acceptRequired(mustache, 'path');
- this.acceptArray(mustache.params);
- this.acceptKey(mustache, 'hash');
- }
- function visitBlock(block) {
- visitSubExpression.call(this, block);
-
- this.acceptKey(block, 'program');
- this.acceptKey(block, 'inverse');
- }
- function visitPartial(partial) {
- this.acceptRequired(partial, 'name');
- this.acceptArray(partial.params);
- this.acceptKey(partial, 'hash');
- }
-
- exports['default'] = Visitor;
- module.exports = exports['default'];
-
-/***/ }),
-/* 40 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['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;
- exports.prepareProgram = prepareProgram;
- exports.preparePartialBlock = preparePartialBlock;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- function validateClose(open, close) {
- close = close.path ? close.path.original : close;
-
- if (open.path.original !== close) {
- var errorNode = { loc: open.path.loc };
-
- throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
- }
- }
-
- 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, loc) {
- loc = this.locInfo(loc);
-
- var original = data ? '@' : '',
- dig = [],
- depth = 0;
-
- 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: loc });
- } else if (part === '..') {
- depth++;
- }
- } else {
- dig.push(part);
- }
- }
-
- return {
- type: 'PathExpression',
- data: data,
- depth: depth,
- parts: dig,
- original: original,
- loc: loc
- };
- }
-
- 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 !== '&';
-
- var decorator = /\*/.test(open);
- return {
- type: decorator ? 'Decorator' : 'MustacheStatement',
- path: path,
- params: params,
- hash: hash,
- escaped: escaped,
- strip: strip,
- loc: this.locInfo(locInfo)
- };
- }
-
- function prepareRawBlock(openRawBlock, contents, close, locInfo) {
- validateClose(openRawBlock, close);
-
- locInfo = this.locInfo(locInfo);
- var program = {
- type: 'Program',
- body: contents,
- strip: {},
- loc: locInfo
- };
-
- return {
- type: 'BlockStatement',
- path: openRawBlock.path,
- params: openRawBlock.params,
- hash: openRawBlock.hash,
- program: program,
- openStrip: {},
- inverseStrip: {},
- closeStrip: {},
- loc: locInfo
- };
- }
-
- function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
- if (close && close.path) {
- validateClose(openBlock, close);
- }
-
- var decorator = /\*/.test(openBlock.open);
-
- program.blockParams = openBlock.blockParams;
-
- var inverse = undefined,
- inverseStrip = undefined;
-
- if (inverseAndProgram) {
- if (decorator) {
- throw new _exception2['default']('Unexpected inverse block on decorator', 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 {
- type: decorator ? 'DecoratorBlock' : 'BlockStatement',
- path: openBlock.path,
- params: openBlock.params,
- hash: openBlock.hash,
- program: program,
- inverse: inverse,
- openStrip: openBlock.strip,
- inverseStrip: inverseStrip,
- closeStrip: close && close.strip,
- loc: this.locInfo(locInfo)
- };
- }
-
- function prepareProgram(statements, loc) {
- if (!loc && statements.length) {
- var firstLoc = statements[0].loc,
- lastLoc = statements[statements.length - 1].loc;
-
- /* istanbul ignore else */
- if (firstLoc && lastLoc) {
- loc = {
- source: firstLoc.source,
- start: {
- line: firstLoc.start.line,
- column: firstLoc.start.column
- },
- end: {
- line: lastLoc.end.line,
- column: lastLoc.end.column
- }
- };
- }
- }
-
- return {
- type: 'Program',
- body: statements,
- strip: {},
- loc: loc
- };
- }
-
- function preparePartialBlock(open, program, close, locInfo) {
- validateClose(open, close);
-
- return {
- type: 'PartialBlockStatement',
- name: open.path,
- params: open.params,
- hash: open.hash,
- program: program,
- openStrip: open.strip,
- closeStrip: close && close.strip,
- loc: this.locInfo(locInfo)
- };
- }
-
-/***/ }),
-/* 41 */
-/***/ (function(module, exports, __webpack_require__) {
-
- /* eslint-disable new-cap */
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
- exports.Compiler = Compiler;
- exports.precompile = precompile;
- exports.compile = compile;
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _utils = __webpack_require__(5);
-
- var _ast = __webpack_require__(35);
-
- var _ast2 = _interopRequireDefault(_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) {
- // the next line should use "Object.keys", but the code has been like this a long time and changing it, might
- // cause backwards-compatibility issues... It's an old library...
- // eslint-disable-next-line guard-for-in
- 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 accept(node) {
- /* istanbul ignore next: Sanity code */
- if (!this[node.type]) {
- throw new _exception2['default']('Unknown type: ' + node.type, 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');
- },
-
- DecoratorBlock: function DecoratorBlock(decorator) {
- var program = decorator.program && this.compileProgram(decorator.program);
- var params = this.setupFullMustacheParams(decorator, program, undefined),
- path = decorator.path;
-
- this.useDecorators = true;
- this.opcode('registerDecorator', params.length, path.original);
- },
-
- PartialStatement: function PartialStatement(partial) {
- this.usePartial = true;
-
- var program = partial.program;
- if (program) {
- program = this.compileProgram(partial.program);
- }
-
- var params = partial.params;
- if (params.length > 1) {
- throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
- } else if (!params.length) {
- if (this.options.explicitPartialContext) {
- this.opcode('pushLiteral', 'undefined');
- } else {
- 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, program, 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');
- },
- PartialBlockStatement: function PartialBlockStatement(partialBlock) {
- this.PartialStatement(partialBlock);
- },
-
- MustacheStatement: function MustacheStatement(mustache) {
- this.SubExpression(mustache);
-
- if (mustache.escaped && !this.options.noEscape) {
- this.opcode('appendEscaped');
- } else {
- this.opcode('append');
- }
- },
- Decorator: function Decorator(decorator) {
- this.DecoratorBlock(decorator);
- },
-
- 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);
-
- path.strict = true;
- this.accept(path);
-
- this.opcode('invokeAmbiguous', name, isBlock);
- },
-
- simpleSexpr: function simpleSexpr(sexpr) {
- var path = sexpr.path;
- path.strict = true;
- this.accept(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.strict = true;
- 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, path.strict);
- } else {
- this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, 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(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
- }
-
- 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 && _utils.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, options, env) {
- if (options === undefined) options = {};
-
- 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);
- }
-
- options = _utils.extend({}, options);
- 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 = {
- type: 'PathExpression',
- data: false,
- depth: 0,
- parts: [literal.original + ''],
- original: literal.original + '',
- loc: literal.loc
- };
- }
- }
-
-/***/ }),
-/* 42 */
-/***/ (function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _interopRequireDefault = __webpack_require__(1)['default'];
-
- exports.__esModule = true;
-
- var _base = __webpack_require__(4);
-
- var _exception = __webpack_require__(6);
-
- var _exception2 = _interopRequireDefault(_exception);
-
- var _utils = __webpack_require__(5);
-
- var _codeGen = __webpack_require__(43);
-
- var _codeGen2 = _interopRequireDefault(_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 (name === 'constructor') {
- return ['(', parent, '.propertyIsEnumerable(\'constructor\') ? ', parent, '.constructor : undefined', ')'];
- }
- if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
- return [parent, '.', name];
- } else {
- return [parent, '[', JSON.stringify(name), ']'];
- }
- },
- depthedLookup: function depthedLookup(name) {
- return [this.aliasable('container.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 || {
- decorators: [],
- 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 || environment.useDecorators || 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');
- }
-
- if (!this.decorators.isEmpty()) {
- this.useDecorators = true;
-
- this.decorators.prepend('var decorators = container.decorators;\n');
- this.decorators.push('return fn;');
-
- if (asObject) {
- this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
- } else {
- this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
- this.decorators.push('}\n');
- this.decorators = this.decorators.merge();
- }
- } else {
- this.decorators = undefined;
- }
-
- var fn = this.createFunctionContext(asObject);
- if (!this.isChild) {
- var ret = {
- compiler: this.compilerInfo(),
- main: fn
- };
-
- if (this.decorators) {
- ret.main_d = this.decorators; // eslint-disable-line camelcase
- ret.useDecorators = true;
- }
-
- var _context = this.context;
- var programs = _context.programs;
- var decorators = _context.decorators;
-
- for (i = 0, l = programs.length; i < l; i++) {
- if (programs[i]) {
- ret[i] = programs[i];
- if (decorators[i]) {
- ret[i + '_d'] = decorators[i];
- ret.useDecorators = true;
- }
- }
- }
-
- 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);
- this.decorators = 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 = ['container', '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('container.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, strict, 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, strict);
- },
-
- // [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, strict) {
- if (!depth) {
- this.pushStackLiteral('data');
- } else {
- this.pushStackLiteral('container.data(data, ' + depth + ')');
- }
-
- this.resolvePath('data', parts, 0, true, strict);
- },
-
- resolvePath: function resolvePath(type, parts, i, falsy, strict) {
- // istanbul ignore next
-
- var _this = this;
-
- if (this.options.strict || this.options.assumeObjects) {
- this.push(strictLookup(this.options.strict && 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('container.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);
- }
- },
-
- // [registerDecorator]
- //
- // On stack, before: hash, program, params..., ...
- // On stack, after: ...
- //
- // Pops off the decorator's parameters, invokes the decorator,
- // and inserts the decorator into the decorators list.
- registerDecorator: function registerDecorator(paramSize, name) {
- var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
- options = this.setupHelperArgs(name, paramSize);
-
- this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
- },
-
- // [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);
-
- if (isDynamic) {
- name = this.popStack();
- delete options.name;
- }
-
- if (indent) {
- options.indent = JSON.stringify(indent);
- }
- options.helpers = 'helpers';
- options.partials = 'partials';
- options.decorators = 'container.decorators';
-
- 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('container.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 existing = this.matchExistingProgram(child);
-
- if (existing == null) {
- this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
- var 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.decorators[index] = compiler.decorators;
- this.context.environments[index] = child;
-
- this.useDepths = this.useDepths || compiler.useDepths;
- this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
- child.useDepths = this.useDepths;
- child.useBlockParams = this.useBlockParams;
- } else {
- child.index = existing.index;
- child.name = 'program' + existing.index;
-
- this.useDepths = this.useDepths || existing.useDepths;
- this.useBlockParams = this.useBlockParams || existing.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 environment;
- }
- }
- },
-
- 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 'container.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'),
- callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');
-
- return {
- params: params,
- paramsInit: paramsInit,
- name: foundHelper,
- callParams: [callContext].concat(params)
- };
- },
-
- setupParams: function setupParams(helper, paramSize, params) {
- var options = {},
- contexts = [],
- types = [],
- ids = [],
- objectArgs = !params,
- param = undefined;
-
- if (objectArgs) {
- params = [];
- }
-
- 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 || 'container.noop';
- options.inverse = inverse || 'container.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 (objectArgs) {
- options.args = this.source.generateArray(params);
- }
-
- 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);
- options = this.objectLiteral(options);
- if (useRegister) {
- this.useRegister('options');
- params.push('options');
- return ['options=', options];
- } else if (params) {
- params.push(options);
- return '';
- } else {
- return options;
- }
- }
- };
-
- (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('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
- } else {
- return stack;
- }
- }
-
- exports['default'] = JavaScriptCompiler;
- module.exports = exports['default'];
-
-/***/ }),
-/* 43 */
-/***/ (function(module, exports, __webpack_require__) {
-
- /* global define */
- 'use strict';
-
- exports.__esModule = true;
-
- var _utils = __webpack_require__(5);
-
- 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) {}
- /* 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 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 = {
- isEmpty: function isEmpty() {
- return !this.source.length;
- },
- 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 = this.currentLocation || { start: {} };
- return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
- },
- wrap: function wrap(chunk) {
- var loc = arguments.length <= 1 || 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) {
- var ret = this.empty();
-
- for (var i = 0, len = entries.length; i < len; i++) {
- if (i) {
- ret.add(',');
- }
-
- ret.add(castChunk(entries[i], this));
- }
-
- return ret;
- },
-
- generateArray: function generateArray(entries) {
- var ret = this.generateList(entries);
- ret.prepend('[');
- ret.add(']');
-
- return ret;
- }
- };
-
- exports['default'] = CodeGen;
- module.exports = exports['default'];
-
-/***/ })
-/******/ ])
-});
-;
\ No newline at end of file
diff --git a/public/assets/prototype/js/jquery-3.1.1.min.js b/public/assets/prototype/js/jquery-3.1.1.min.js
deleted file mode 100644
index 4c5be4c..0000000
--- a/public/assets/prototype/js/jquery-3.1.1.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
-!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),
-a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,""],thead:[1,"