text: 'use strict';
  
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  
  var objects = require('../objects');
  var optimization = require('../optimization');
  var utils = require('../utils');
  
  module.exports = function () {
      /**
       * @constructor
       * @param {string} name
       * @param {*} content
       */
      function Page(name, content) {
          _classCallCheck(this, Page);
  
          this.name = name;
          this.content = content;
      }
  
      /**
       * @return {string}
       */
  
  
      _createClass(Page, [{
          key: 'toString',
          value: function toString() {
              var _this = this;
  
              var output = '@page';
              if (this.name) {
                  output += ' ' + this.name;
              }
              output += '{';
              output += this.content.map(function (content, i) {
                  var inst = content.toString();
                  if (content instanceof objects.Declaration && i !== _this.content.length - 1) {
                      return inst + ';';
                  }
                  return inst;
              }).join('');
              output += '}';
              return output;
          }
  
          /**
           * @param {int} indent
           * @return {string}
           */
  
      }, {
          key: 'pretty',
          value: function pretty(indent) {
              var output = '';
              output += utils.indent('@page ' + (this.name ? this.name + ' ' : '') + '{') + '\n';
              output += this.content.map(function (line) {
                  return utils.indent(line.pretty(indent + 1) + ';', indent + 1);
              }).join('\n') + '\n';
              output += utils.indent('}', indent) + '\n';
              return output;
          }
  
          /**
           * @param {object} kw
           * @return {Page}
           */
  
      }, {
          key: 'optimize',
          value: function optimize(kw) {
              this.content = optimization.optimizeBlocks(this.content, kw);
              return this;
          }
      }]);
  
      return Page;
  }();