From 071f1ac4e63e51bf74ccb8c850ad7902cdf973f9 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 10 Feb 2016 02:41:56 +0100 Subject: [PATCH 1/9] Added new tests to the AssetManager module --- test/runner/main.js | 1 + test/specs/asset_manager/main.js | 46 +++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/test/runner/main.js b/test/runner/main.js index 4574136a0..289a0d01a 100644 --- a/test/runner/main.js +++ b/test/runner/main.js @@ -1,6 +1,7 @@ require(['../src/config/require-config.js', 'config/config.js'], function() { require(['chai', + 'sinon', 'specs/main.js', 'specs/asset_manager/main.js', 'specs/asset_manager/model/Asset.js', diff --git a/test/specs/asset_manager/main.js b/test/specs/asset_manager/main.js index 0ccc64d5f..ce1b39c6c 100644 --- a/test/specs/asset_manager/main.js +++ b/test/specs/asset_manager/main.js @@ -1,17 +1,57 @@ define(['AssetManager'], function(AssetManager) { - + describe('Asset Manager', function() { - + describe('Main', function() { it('Object exists', function() { AssetManager.should.be.exist; }); - + it('No assets inside', function() { var obj = new AssetManager(); obj.getAssets().length.should.be.empty; }); + + it('AssetsView exists and is an instance of Backbone.View', function() { + var obj = new AssetManager(); + obj.am.should.be.exist; + obj.am.should.be.an.instanceOf(Backbone.View); + }); + + it('FileUpload exists and is an instance of Backbone.View', function() { + var obj = new AssetManager(); + obj.fu.should.be.exist; + obj.fu.should.be.an.instanceOf(Backbone.View); + }); + + it('Target is assigning', function() { + var obj = new AssetManager(); + var t = 'target'; + obj.setTarget(t); + obj.am.collection.target.should.equal(t); + }); + + it('onSelect callback is assigning', function() { + var obj = new AssetManager(); + var cb = function(){ + return 'callback'; + }; + obj.onSelect(cb); + obj.am.collection.onSelect.should.equal(cb); + }); + + it('Render propagates', function() { + var obj = new AssetManager(), + jq = { $el: $('
') }; + sinon.stub(obj.am, "render").returns(jq); + sinon.stub(obj.fu, "render").returns(jq); + obj.render(); + obj.am.render.calledOnce.should.equal(true); + obj.fu.render.calledOnce.should.equal(true); + obj.rendered.should.not.be.empty; + }); + }); }); }); \ No newline at end of file From f049e4adfc54bc6632501936146745acc77615b5 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 15 Feb 2016 23:27:06 +0100 Subject: [PATCH 2/9] New tests for AssetManager --- test/runner/main.js | 3 + test/specs/asset_manager/model/AssetImage.js | 24 ++++++ test/specs/asset_manager/model/Assets.js | 13 +++ test/specs/asset_manager/view/AssetsView.js | 91 ++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 test/specs/asset_manager/model/AssetImage.js create mode 100644 test/specs/asset_manager/model/Assets.js create mode 100644 test/specs/asset_manager/view/AssetsView.js diff --git a/test/runner/main.js b/test/runner/main.js index 289a0d01a..808fe74f7 100644 --- a/test/runner/main.js +++ b/test/runner/main.js @@ -5,6 +5,9 @@ require(['../src/config/require-config.js', 'config/config.js'], function() { 'specs/main.js', 'specs/asset_manager/main.js', 'specs/asset_manager/model/Asset.js', + 'specs/asset_manager/model/AssetImage.js', + 'specs/asset_manager/model/Assets.js', + 'specs/asset_manager/view/AssetsView.js', ], function(chai) { var should = chai.should(), diff --git a/test/specs/asset_manager/model/AssetImage.js b/test/specs/asset_manager/model/AssetImage.js new file mode 100644 index 000000000..4dfaaeed6 --- /dev/null +++ b/test/specs/asset_manager/model/AssetImage.js @@ -0,0 +1,24 @@ +define(['AssetManager/model/AssetImage'], + function(AssetImage) { + + describe('Asset Manager', function() { + + describe('AssetImage', function() { + it('Object exists', function() { + AssetImage.should.be.exist; + }); + + it('Has default values', function() { + var obj = new AssetImage({}); + obj.get('type').should.equal("image"); + obj.get('src').should.equal(""); + obj.get('unitDim').should.equal("px"); + obj.get('height').should.equal(0); + obj.get('width').should.equal(0); + obj.getExtension().should.be.empty; + obj.getFilename().should.be.empty; + }); + + }); + }); +}); \ No newline at end of file diff --git a/test/specs/asset_manager/model/Assets.js b/test/specs/asset_manager/model/Assets.js new file mode 100644 index 000000000..ff3977c5c --- /dev/null +++ b/test/specs/asset_manager/model/Assets.js @@ -0,0 +1,13 @@ +define(['AssetManager/model/Assets'], + function(Assets) { + + describe('Asset Manager', function() { + + describe('Assets', function() { + it('Object exists', function() { + Assets.should.be.exist; + }); + + }); + }); +}); \ No newline at end of file diff --git a/test/specs/asset_manager/view/AssetsView.js b/test/specs/asset_manager/view/AssetsView.js new file mode 100644 index 000000000..b3e336cb6 --- /dev/null +++ b/test/specs/asset_manager/view/AssetsView.js @@ -0,0 +1,91 @@ +define(['AssetManager/view/AssetsView', 'AssetManager/model/Assets'], + function(AssetsView, Assets) { + + describe('Asset Manager', function() { + + describe('AssetsView', function() { + + before(function () { + this.$fixtures = $("#fixtures"); + this.$fixture = $('
'); + }); + + beforeEach(function () { + this.coll = new Assets([]); + this.view = new AssetsView({ + config : {}, + collection: this.coll + }); + this.$fixture.empty().appendTo(this.$fixtures); + this.$fixture.html(this.view.render().el); + }); + + afterEach(function () { + this.view.collection.reset(); + }); + + after(function () { + this.$fixture.remove(); + }); + + it('Object exists', function() { + AssetsView.should.be.exist; + }); + + it("Collection is empty", function (){ + this.view.$el.html().should.be.empty; + }); + + it("Add new asset", function (){ + sinon.stub(this.view, "addAsset"); + this.coll.add({}); + this.view.addAsset.calledOnce.should.equal(true); + }); + + it("Render new asset", function (){ + this.coll.add({}); + this.view.$el.html().should.not.be.empty; + }); + + it("Render correctly new asset", function (){ + this.coll.add({}); + var $asset = this.view.$el.children().first(); + $asset.prop("tagName").should.equal('DIV'); + $asset.html().should.be.empty; + }); + + it("Render correctly new image asset", function (){ + this.coll.add({ type: 'image'}); + var $asset = this.view.$el.children().first(); + $asset.prop("tagName").should.equal('DIV'); + $asset.html().should.not.be.empty; + }); + + it("Clean collection from asset", function (){ + var model = this.coll.add({}); + this.coll.remove(model); + this.view.$el.html().should.be.empty; + }); + + it("Load no assets", function (){ + (this.view.load() === null).should.be.true; + }); + + it("Load assets", function (){ + var obj = { test: '1' }; + this.view.storagePrv = { load : function(){} }; + sinon.stub(this.view.storagePrv, "load").returns(obj); + this.view.load().should.equal(obj); + }); + + it("Deselect works", function (){ + this.coll.add([{},{}]); + var $asset = this.view.$el.children().first(); + $asset.attr('class', this.view.pfx + 'highlight'); + this.coll.trigger('deselectAll'); + $asset.attr('class').should.be.empty; + }); + + }); + }); +}); \ No newline at end of file From c27fe808866ea22569efb93c5deb1dcf2b609e65 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 16 Feb 2016 20:27:07 +0100 Subject: [PATCH 3/9] Added tests for AssetManager --- src/asset_manager/view/AssetView.js | 14 ++-- src/asset_manager/view/FileUploader.js | 2 +- test/runner/main.js | 3 + .../asset_manager/view/AssetImageView.js | 77 +++++++++++++++++++ test/specs/asset_manager/view/AssetView.js | 42 ++++++++++ test/specs/asset_manager/view/FileUploader.js | 77 +++++++++++++++++++ 6 files changed, 207 insertions(+), 8 deletions(-) create mode 100644 test/specs/asset_manager/view/AssetImageView.js create mode 100644 test/specs/asset_manager/view/AssetView.js create mode 100644 test/specs/asset_manager/view/FileUploader.js diff --git a/src/asset_manager/view/AssetView.js b/src/asset_manager/view/AssetView.js index 1658a0d31..8bb17c629 100644 --- a/src/asset_manager/view/AssetView.js +++ b/src/asset_manager/view/AssetView.js @@ -1,17 +1,17 @@ -define(['backbone'], +define(['backbone'], function (Backbone) { - /** + /** * @class AssetView * */ return Backbone.View.extend({ - + initialize: function(o) { - this.options = o; - this.config = o.config || {}; - this.pfx = this.config.stylePrefix; + this.options = o; + this.config = o.config || {}; + this.pfx = this.config.stylePrefix || ''; this.className = this.pfx + 'asset'; this.listenTo( this.model, 'destroy remove', this.remove ); }, - + }); }); diff --git a/src/asset_manager/view/FileUploader.js b/src/asset_manager/view/FileUploader.js index d0d3a1c31..8d7821e4e 100644 --- a/src/asset_manager/view/FileUploader.js +++ b/src/asset_manager/view/FileUploader.js @@ -13,7 +13,7 @@ define(['backbone', 'text!./../template/fileUploader.html'], initialize: function(o) { this.options = o || {}; this.config = o.config || {}; - this.pfx = this.config.stylePrefix; + this.pfx = this.config.stylePrefix || ''; this.target = this.collection || {}; this.uploadId = this.pfx + 'uploadFile'; this.disabled = this.config.disableUpload; diff --git a/test/runner/main.js b/test/runner/main.js index 808fe74f7..a5f261438 100644 --- a/test/runner/main.js +++ b/test/runner/main.js @@ -8,6 +8,9 @@ require(['../src/config/require-config.js', 'config/config.js'], function() { 'specs/asset_manager/model/AssetImage.js', 'specs/asset_manager/model/Assets.js', 'specs/asset_manager/view/AssetsView.js', + 'specs/asset_manager/view/AssetView.js', + 'specs/asset_manager/view/AssetImageView.js', + 'specs/asset_manager/view/FileUploader.js', ], function(chai) { var should = chai.should(), diff --git a/test/specs/asset_manager/view/AssetImageView.js b/test/specs/asset_manager/view/AssetImageView.js new file mode 100644 index 000000000..dc28fd5b3 --- /dev/null +++ b/test/specs/asset_manager/view/AssetImageView.js @@ -0,0 +1,77 @@ +define(['AssetManager/view/AssetImageView', 'AssetManager/model/AssetImage', 'AssetManager/model/Assets'], + function(AssetImageView, AssetImage, Assets) { + + describe('Asset Manager', function() { + + describe('AssetImageView', function() { + + before(function () { + this.$fixtures = $("#fixtures"); + this.$fixture = $('
'); + }); + + beforeEach(function () { + var coll = new Assets(); + var model = coll.add({ type:'image', src: '/test' }); + this.view = new AssetImageView({ + config : {}, + model: model + }); + this.$fixture.empty().appendTo(this.$fixtures); + this.$fixture.html(this.view.render().el); + }); + + afterEach(function () { + this.view.model.destroy(); + }); + + after(function () { + this.$fixture.remove(); + }); + + it('Object exists', function() { + AssetImageView.should.be.exist; + }); + + describe('Asset should be rendered correctly', function() { + + it('Has preview box', function() { + var $asset = this.view.$el; + $asset.find('#preview').should.have.property(0); + }); + + it('Has meta box', function() { + var $asset = this.view.$el; + $asset.find('#meta').should.have.property(0); + }); + + it('Has close button', function() { + var $asset = this.view.$el; + $asset.find('#close').should.have.property(0); + }); + + }); + + it('Could be selected', function() { + sinon.stub(this.view, 'updateTarget'); + this.view.$el.trigger('click'); + this.view.$el.attr('class').should.contain('highlight'); + this.view.updateTarget.calledOnce.should.equal(true); + }); + + it('Could be chosen', function() { + sinon.stub(this.view, 'updateTarget'); + this.view.$el.trigger('dblclick'); + this.view.updateTarget.calledOnce.should.equal(true); + }); + + it('Could be removed', function() { + var spy = sinon.spy(); + this.view.model.on("remove", spy); + this.view.$el.find('#close').trigger('click'); + spy.called.should.equal(true); + }); + + }); + }); +}); \ No newline at end of file diff --git a/test/specs/asset_manager/view/AssetView.js b/test/specs/asset_manager/view/AssetView.js new file mode 100644 index 000000000..4bf7f4a25 --- /dev/null +++ b/test/specs/asset_manager/view/AssetView.js @@ -0,0 +1,42 @@ +define(['AssetManager/view/AssetView', 'AssetManager/model/Asset', 'AssetManager/model/Assets'], + function(AssetView, Asset, Assets) { + + describe('Asset Manager', function() { + + describe('AssetView', function() { + + before(function () { + this.$fixtures = $("#fixtures"); + this.$fixture = $('
'); + }); + + beforeEach(function () { + var coll = new Assets(); + var model = coll.add({}); + this.view = new AssetView({ + config : {}, + model: model + }); + this.$fixture.empty().appendTo(this.$fixtures); + this.$fixture.html(this.view.render().el); + }); + + afterEach(function () { + this.view.model.destroy(); + }); + + after(function () { + this.$fixture.remove(); + }); + + it('Object exists', function() { + AssetView.should.be.exist; + }); + + it('Has correct prefix', function() { + this.view.pfx.should.equal(''); + }); + + }); + }); +}); \ No newline at end of file diff --git a/test/specs/asset_manager/view/FileUploader.js b/test/specs/asset_manager/view/FileUploader.js new file mode 100644 index 000000000..d9bfec677 --- /dev/null +++ b/test/specs/asset_manager/view/FileUploader.js @@ -0,0 +1,77 @@ +define(['AssetManager/view/FileUploader'], + function(FileUploader) { + + describe('Asset Manager', function() { + + describe('File Uploader', function() { + + before(function () { + this.$fixtures = $("#fixtures"); + this.$fixture = $('
'); + }); + + beforeEach(function () { + this.view = new FileUploader({ config : {} }); + this.$fixture.empty().appendTo(this.$fixtures); + this.$fixture.html(this.view.render().el); + }); + + afterEach(function () { + this.view.remove(); + }); + + after(function () { + this.$fixture.remove(); + }); + + it('Object exists', function() { + FileUploader.should.be.exist; + }); + + it('Has correct prefix', function() { + this.view.pfx.should.equal(''); + }); + + describe('Should be rendered correctly', function() { + + it('Has title', function() { + this.view.$el.find('#title').should.have.property(0); + }); + + it('Title is empty', function() { + this.view.$el.find('#title').html().should.equal(''); + }); + + it('Has file input', function() { + this.view.$el.find('input[type=file]').should.have.property(0); + }); + + it('File input is enabled', function() { + this.view.$el.find('input[type=file]').prop('disabled').should.equal(false); + }); + + }); + + describe('Interprets configurations correctly', function() { + + it('Has correct title', function() { + var view = new FileUploader({ config : { + uploadText : 'Test', + } }); + view.render(); + view.$el.find('#title').html().should.equal('Test'); + }); + + it('Could be disabled', function() { + var view = new FileUploader({ config : { + disableUpload: true, + } }); + view.render(); + view.$el.find('input[type=file]').prop('disabled').should.equal(true); + }); + + }); + + }); + }); +}); \ No newline at end of file From 71887e82166689238979448ad6f53a7459106d20 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 17 Feb 2016 03:27:27 +0100 Subject: [PATCH 4/9] Tests for Components --- Gruntfile.js | 2 +- src/dom_components/main.js | 46 ++++++-- src/dom_components/model/Component.js | 13 ++- test/runner/main.js | 1 + test/specs/components/model/componentModel.js | 36 ------ test/specs/components/model/components.js | 58 ---------- test/specs/dom_components/main.js | 46 ++++++++ test/specs/dom_components/model/Component.js | 109 ++++++++++++++++++ .../view/componentView.js | 0 9 files changed, 202 insertions(+), 109 deletions(-) delete mode 100644 test/specs/components/model/componentModel.js delete mode 100644 test/specs/components/model/components.js create mode 100644 test/specs/dom_components/main.js create mode 100644 test/specs/dom_components/model/Component.js rename test/specs/{components => dom_components}/view/componentView.js (100%) diff --git a/Gruntfile.js b/Gruntfile.js index 3bf1c2b5b..1ab7592a3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -167,7 +167,7 @@ module.exports = function(grunt) { test: { files: ['test/specs/**/*.js'], tasks: ['mocha'], - options: { livereload: true }, //default port 35729 + //options: { livereload: true }, //default port 35729 } }, diff --git a/src/dom_components/main.js b/src/dom_components/main.js index bc1ff8c6d..044f38196 100644 --- a/src/dom_components/main.js +++ b/src/dom_components/main.js @@ -16,7 +16,7 @@ define(function(require) { ComponentImageView = require('./view/ComponentImageView'), ComponentTextView = require('./view/ComponentTextView'); - // Set default options + // Set default options for (var name in defaults) { if (!(name in c)) c[name] = defaults[name]; @@ -34,26 +34,56 @@ define(function(require) { if(!c.wrapper.style) c.wrapper.style = {}; + c.wrapper.style.position = 'relative'; this.component = new Component(c.wrapper); var obj = { - model : this.component, - config : c, + model: this.component, + config: c, }; - this.ComponentView = new ComponentView(obj); + this.c = c; + this.ComponentView = new ComponentView(obj); } Components.prototype = { - render : function(){ - return this.ComponentView.render().$el; - }, - + /** + * Returns main wrapper which will contain all new components + * + * @return {Object} + */ getComponent : function(){ return this.component; }, + + /** + * Returns main wrapper which will contain all new components + * + * @return {Object} + */ + getWrapper: function(){ + return this.getComponent(); + }, + + /** + * Returns children from the wrapper + * + * @return {Object} + */ + getComponents: function(){ + return this.getWrapper().get('components'); + }, + + /** + * Render and returns wrapper + * + * @return {Object} + */ + render : function(){ + return this.ComponentView.render().el; + }, }; return Components; diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 9d1c0a249..c77160541 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -7,7 +7,7 @@ define(['backbone','./Components'], defaults: { tagName : 'div', - type : '', + type : '', editable : false, removable : true, movable : true, @@ -18,12 +18,13 @@ define(['backbone','./Components'], status : '', previousModel : '', content : '', - style : {}, - attributes : {}, + style : {}, + attributes : {}, }, - initialize: function(options) { - this.defaultC = options.components || []; + initialize: function(o) { + this.config = o || {}; + this.defaultC = this.config.components || []; this.components = new Components(this.defaultC); this.set('components', this.components); }, @@ -47,7 +48,7 @@ define(['backbone','./Components'], /** * Get name of the component * - * @return string + * @return {String} * */ getName: function(){ if(!this.name){ diff --git a/test/runner/main.js b/test/runner/main.js index a5f261438..7efbeb7f8 100644 --- a/test/runner/main.js +++ b/test/runner/main.js @@ -11,6 +11,7 @@ require(['../src/config/require-config.js', 'config/config.js'], function() { 'specs/asset_manager/view/AssetView.js', 'specs/asset_manager/view/AssetImageView.js', 'specs/asset_manager/view/FileUploader.js', + 'specs/dom_components/main.js', ], function(chai) { var should = chai.should(), diff --git a/test/specs/components/model/componentModel.js b/test/specs/components/model/componentModel.js deleted file mode 100644 index 8b5f285d5..000000000 --- a/test/specs/components/model/componentModel.js +++ /dev/null @@ -1,36 +0,0 @@ -define(['componentModel'], - function(componentModel) { - describe('Component', function() { - - it('Contiene valori di default', function() {//Has default values - var model = new componentModel({}); - var modelComponents = model.components; - model.should.be.ok; - model.get('tagName').should.equal("div"); - model.get('classes').should.be.empty; - model.get('css').should.be.empty; - model.get('attributes').should.be.empty; - modelComponents.models.should.be.empty; - }); - it('Non ci sono altri componenti all\'interno ', function() {//No other components inside - var model = new componentModel({}); - var modelComponents = model.components; - model.should.be.ok; - modelComponents.models.should.be.empty; - }); - it('Imposta valori passati', function() {//Sets passed attributes - var model = new componentModel({ - tagName : 'span', - classes : ['one','two','three'], - css : { 'one':'vone', 'two':'vtwo', }, - attributes : { 'data-one':'vone', 'data-two':'vtwo', }, - }); - model.should.be.ok; - model.get('tagName').should.equal("span"); - model.get('classes').should.have.length(3); - model.get('css').should.have.keys(["one", "two",]); - model.get('attributes').should.have.keys(["data-one", "data-two",]); - }); - it('Possibilità di istanziare componenti annidati'); //Possibility to init nested components - }); -}); \ No newline at end of file diff --git a/test/specs/components/model/components.js b/test/specs/components/model/components.js deleted file mode 100644 index a42d8a85a..000000000 --- a/test/specs/components/model/components.js +++ /dev/null @@ -1,58 +0,0 @@ -define(['Components'], - function(Components) { - describe('Components', function() { - before(function () { - this.collection = new Components(); - this.collection.localStorage._clear(); - }); - after(function () { - this.collection = null; - }); - describe('Creazione', function() { - it('Contiene valori di default', function() {//Has default values - this.collection.should.be.ok; - this.collection.should.have.length(0); - }); - }); - describe('Modifica', function() { - beforeEach(function () { - this.collection.create({ - tagName : 'span', - classes : ['one','two','three'], - css : { 'one':'vone', 'two':'vtwo', }, - attributes : { 'data-one':'vone', 'data-two':'vtwo', }, - }); - }); - afterEach(function () { - this.collection.localStorage._clear(); - this.collection.reset(); - }); - it('Contiene un singolo componente', function(done) { //Has single object - var collection = this.collection, model; - - collection.once("reset", function () { - collection.should.have.length(1); - model = collection.at(0); - model.should.be.ok; - model.get('tagName').should.equal("span"); - model.get('classes').should.have.length(3); - model.get('css').should.have.keys(["one", "two",]); - model.get('attributes').should.have.keys(["data-one", "data-two",]); - done(); - }); - collection.fetch({ reset: true }); - }); - - it("Componenete eliminabile", function (done) { //Can delete a component - var collection = this.collection, model; - collection.should.have.length(1); - collection.once("remove", function () { - collection.should.have.length(0); - done(); - }); - - model = collection.shift(); - }); - }); - }); - }); \ No newline at end of file diff --git a/test/specs/dom_components/main.js b/test/specs/dom_components/main.js new file mode 100644 index 000000000..eab7363ab --- /dev/null +++ b/test/specs/dom_components/main.js @@ -0,0 +1,46 @@ +var modulePath = './../../../test/specs/dom_components'; + +define([ + 'DomComponents', + modulePath + '/model/Component' + ], + function(DomComponents, + ComponentModels + ) { + + describe('DOM Components', function() { + + describe('Main', function() { + + beforeEach(function () { + this.obj = new DomComponents(); + }); + + afterEach(function () { + delete this.obj; + }); + + it('Object exists', function() { + DomComponents.should.be.exist; + }); + + it('Wrapper exists', function() { + this.obj.getWrapper().should.not.be.empty; + }); + + it('No components inside', function() { + this.obj.getComponents().length.should.equal(0); + }); + + it('Render wrapper', function() { + sinon.stub(this.obj.ComponentView, "render").returns({ el: '' }); + this.obj.render(); + this.obj.ComponentView.render.calledOnce.should.equal(true); + }); + + }); + + ComponentModels.run(); + + }); +}); \ No newline at end of file diff --git a/test/specs/dom_components/model/Component.js b/test/specs/dom_components/model/Component.js new file mode 100644 index 000000000..6d83ad92d --- /dev/null +++ b/test/specs/dom_components/model/Component.js @@ -0,0 +1,109 @@ +define(['DomComponents/model/Component', + 'DomComponents/model/ComponentImage', + 'DomComponents/model/ComponentText', + 'DomComponents/model/Components'], + function(Component, ComponentImage, ComponentText, Components) { + + return { + run : function(){ + describe('Component', function() { + + beforeEach(function () { + this.obj = new Component(); + }); + + afterEach(function () { + delete this.obj; + }); + + it('Has no children', function() { + this.obj.get('components').length.should.equal(0); + }); + + it('Clones correctly', function() { + var sAttr = this.obj.attributes; + var cloned = this.obj.clone(); + var eAttr = cloned.attributes; + sAttr.components = {}; + eAttr.components = {}; + sAttr.should.deep.equal(eAttr); + }); + + it('Has expected name', function() { + this.obj.cid = 'c999'; + this.obj.getName().should.equal('Box999'); + }); + + it('Has expected name 2', function() { + this.obj.cid = 'c999'; + this.obj.set('type','testType'); + this.obj.getName().should.equal('TestTypeBox999'); + }); + + }); + + describe('Image Component', function() { + + beforeEach(function () { + this.obj = new ComponentImage(); + }); + + afterEach(function () { + delete this.obj; + }); + + it('Has src property', function() { + this.obj.has('src').should.equal(true); + }); + + it('Not droppable', function() { + this.obj.get('droppable').should.equal(false); + }); + + }); + + describe('Text Component', function() { + + beforeEach(function () { + this.obj = new ComponentText(); + }); + + afterEach(function () { + delete this.obj; + }); + + it('Has content property', function() { + this.obj.has('content').should.equal(true); + }); + + it('Not droppable', function() { + this.obj.get('droppable').should.equal(false); + }); + + }); + + describe('Components', function() { + + it('Creates component correctly', function() { + var c = new Components(); + var m = c.add({}); + m.should.be.an.instanceOf(Component); + }); + + it('Creates image component correctly', function() { + var c = new Components(); + var m = c.add({ type: 'image' }); + m.should.be.an.instanceOf(ComponentImage); + }); + + it('Creates text component correctly', function() { + var c = new Components(); + var m = c.add({ type: 'text' }); + m.should.be.an.instanceOf(ComponentText); + }); + + }); + } + }; + +}); \ No newline at end of file diff --git a/test/specs/components/view/componentView.js b/test/specs/dom_components/view/componentView.js similarity index 100% rename from test/specs/components/view/componentView.js rename to test/specs/dom_components/view/componentView.js From 4964d249021734c45fc7ed6472071b65dc83805c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 19 Feb 2016 13:05:18 +0100 Subject: [PATCH 5/9] Started Class Manager --- package.json | 2 +- src/class_manager/config/config.js | 7 ++ src/class_manager/main.js | 47 ++++++++++++ src/class_manager/model/Class.js | 14 ++++ src/class_manager/model/Classes.js | 11 +++ src/class_manager/view/ClassItemsView.js | 93 ++++++++++++++++++++++++ src/config/require-config.js | 1 + src/dom_components/main.js | 1 - src/editor/config/config.js | 3 + src/editor/model/Editor.js | 12 +++ 10 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 src/class_manager/config/config.js create mode 100644 src/class_manager/main.js create mode 100644 src/class_manager/model/Class.js create mode 100644 src/class_manager/model/Classes.js create mode 100644 src/class_manager/view/ClassItemsView.js diff --git a/package.json b/package.json index 13cdabddf..e0422c1e9 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "editor" ], "scripts": { - "postinstall": "node_modules/.bin/bower install --config.interactive=false", + "postinstall": "node ./node_modules/bower/bin/bower install --config.interactive=false", "build": "node_modules/.bin/grunt build", "test": "node_modules/.bin/grunt test", "dev": "node_modules/.bin/grunt dev" diff --git a/src/class_manager/config/config.js b/src/class_manager/config/config.js new file mode 100644 index 000000000..afb6bd83e --- /dev/null +++ b/src/class_manager/config/config.js @@ -0,0 +1,7 @@ +define(function () { + return { + + // Default classes + classes : [], + }; +}); \ No newline at end of file diff --git a/src/class_manager/main.js b/src/class_manager/main.js new file mode 100644 index 000000000..c6a0bf657 --- /dev/null +++ b/src/class_manager/main.js @@ -0,0 +1,47 @@ +define(function(require) { + /** + * @class ClassManager + * @param {Object} config Configurations + * + * */ + var ClassManager = function(config) + { + var c = config || {}, + def = require('./config/config'), + Classes = require('./model/Classes'); + + for (var name in def) { + if (!(name in c)) + c[name] = def[name]; + } + + this.classes = new Classes(c.classes); + + this.Classes = Classes; + }; + + ClassManager.prototype = { + + /** + * Get collection of classes + * + * @return {Object} + * */ + getClasses : function() { + return this.classes; + }, + + /** + * Get class by its name + * + * @return {Object|null} + * */ + getClass : function(id) { + var res = this.classes.where({name: id}); + return res.length ? res[0] : null; + }, + }; + + return ClassManager; + +}); \ No newline at end of file diff --git a/src/class_manager/model/Class.js b/src/class_manager/model/Class.js new file mode 100644 index 000000000..3c08ec3cb --- /dev/null +++ b/src/class_manager/model/Class.js @@ -0,0 +1,14 @@ +define(['backbone'], + function (Backbone) { + /** + * @class Class + * */ + return Backbone.Model.extend({ + + defaults: { + label: '', + name: '', + }, + + }); +}); diff --git a/src/class_manager/model/Classes.js b/src/class_manager/model/Classes.js new file mode 100644 index 000000000..a96d33a5b --- /dev/null +++ b/src/class_manager/model/Classes.js @@ -0,0 +1,11 @@ +define(['backbone','./Class'], + function (Backbone, Class) { + /** + * @class Classes + * */ + return Backbone.Collection.extend({ + + model: Class, + + }); +}); diff --git a/src/class_manager/view/ClassItemsView.js b/src/class_manager/view/ClassItemsView.js new file mode 100644 index 000000000..9a1e23d82 --- /dev/null +++ b/src/class_manager/view/ClassItemsView.js @@ -0,0 +1,93 @@ +define(['backbone', 'text!./../template/classItems.html'], + function (Backbone, itemsTemplate) { + /** + * @class ClassItemsView + * */ + return Backbone.View.extend({ + + template: _.template(itemsTemplate), + + events:{ + 'click .add': 'startNewClass', + 'keyup .input' : 'onInputKeyUp' + }, + + initialize: function(o) { + this.events['click #'+this.pfx+'add'] = 'addLayer'; + + if(!this.layers){ + this.layers = new Layers(); + this.model.set('layers', this.layers); + this.$layers = new LayersView({ + collection : this.layers, + stackModel : this.model, + preview : this.model.get('preview'), + config : o.config + }); + } + + this.targetCl = this.target.classes; + + this.listenTo( this.targetCl, 'add', this.addClass); + this.listenTo( this.targetCl, 'reset', this.renderClasses); + + this.delegateEvents(); + }, + + onInputKeyUp: function(e){ + if (e.keyCode === 13) { + this.addItem(); + }else{ + this.searchItem(); + } + }, + + /** + * Add new object to collection + * @param Object Model + * @param Object Fragment collection + * + * @return Object Object created + * */ + addToClasses: function(model, fragmentEl){ + var fragment = fragmentEl || null; + var viewObject = ClassTagView; + + var view = new viewObject({ + model: model, + config: this.config, + }); + var rendered = view.render().el; + + if(fragment) + fragment.appendChild( rendered ); + else + this.$classes.append(rendered); + + return rendered; + }, + + renderClasses: function() { + var fragment = document.createDocumentFragment(); + this.$classes.empty(); + + this.collection.each(function(model){ + this.addToClasses(model, fragment); + },this); + + this.$classes.append(fragment); + return this; + }, + + + /** @inheritdoc */ + render : function(){ + this.renderLabel(); + this.renderField(); + this.renderLayers(); + this.$el.attr('class', this.className); + return this; + }, + + }); +}); diff --git a/src/config/require-config.js b/src/config/require-config.js index 6224512b1..84e6cc784 100644 --- a/src/config/require-config.js +++ b/src/config/require-config.js @@ -35,6 +35,7 @@ require.config({ packages : [ { name: 'AssetManager', location: 'asset_manager', }, { name: 'StyleManager', location: 'style_manager', }, + { name: 'ClassManager', location: 'class_manager', }, { name: 'StorageManager', location: 'storage_manager', }, { name: 'Navigator', location: 'navigator', }, { name: 'DomComponents', location: 'dom_components', }, diff --git a/src/dom_components/main.js b/src/dom_components/main.js index 044f38196..f3e4ee96b 100644 --- a/src/dom_components/main.js +++ b/src/dom_components/main.js @@ -28,7 +28,6 @@ define(function(require) { // If there is no components try to append defaults if(!c.wrapper.components.length && c.defaults.length){ - console.log('Set defaults'); c.wrapper.components = c.defaults; } diff --git a/src/editor/config/config.js b/src/editor/config/config.js index d93722d58..9b06d527b 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -61,6 +61,9 @@ define(function () { //Configurations for Commands commands : {}, + //Configurations for Class Manager + classManager : {}, + }; return config; }); \ No newline at end of file diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 6eeed6691..7454377a1 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -10,6 +10,7 @@ define([ 'Canvas', 'RichTextEditor', 'DomComponents', + 'ClassManager', 'Panels'], function( Backbone, @@ -23,6 +24,7 @@ define([ Canvas, RichTextEditor, DomComponents, + ClassManager, Panels ){ return Backbone.Model.extend({ @@ -40,6 +42,7 @@ define([ this.compName = this.config.storagePrefix + 'components' + this.config.id; this.set('Config', c); + this.initClassManager(); this.initStorage(); this.initModal(); this.initAssetManager(); @@ -54,6 +57,15 @@ define([ this.on('change:selectedComponent', this.componentSelected, this); }, + /** + * Initialize Class manager + * */ + initClassManager: function() + { + this.clm = new ClassManager(this.config.classManager); + this.set('ClassManager', this.clm); + }, + /** * Initialize components * */ From 6712935be21a36265091451820232df0d6e663bc Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 19 Feb 2016 15:38:03 +0100 Subject: [PATCH 6/9] Added travis.yml and node-sass --- .gitignore | 3 ++- .travis.yml | 3 +++ Gruntfile.js | 2 +- README.md | 25 ++++++++++++++++++++++--- bower.json | 2 +- dist/css/grapes.min.css | 2 +- dist/grapes.min.js | 4 ++-- package.json | 16 +++++++++------- src/dom_components/main.js | 1 - styles/css/font-awesome.css | 23 +++++++++++++---------- styles/css/main.css | 30 ++++++++++++++++-------------- 11 files changed, 70 insertions(+), 41 deletions(-) create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index 3a8c396a8..d8c5ed254 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ .DS_Store .settings/ .sass-cache/ -style/.sass-cache/ .project +npm-debug.log +style/.sass-cache/ grapes.sublime-project grapes.sublime-workspace diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..207204103 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.7" \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 1ab7592a3..4a2f28ec2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,10 +14,10 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-bowercopy'); grunt.loadNpmTasks('grunt-mocha'); + grunt.loadNpmTasks('grunt-sass'); grunt.initConfig({ appDir: appPath, diff --git a/README.md b/README.md index 2cffd1971..d8c0c1acf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [GrapesJS](http://grapesjs.com) +# [GrapesJS](http://grapesjs.com) [![Build Status](https://travis-ci.org/artf/grapesjs.svg?branch=master)](https://travis-ci.org/artf/grapesjs)

GrapesJS

@@ -105,7 +105,7 @@ var config = { container: '', // Enable/Disable the possibility to copy (ctrl + c) and paste (ctrl + v) elements - copyPaste : true, + copyPaste: true, // Enable/Disable undo manager undoManager: true, @@ -156,6 +156,17 @@ Tests are run by [PhantomJS](http://phantomjs.org/) using [Mocha](https://mochaj $ npm run test ``` +### Tech + +GrapesJS is built on top of this amazing open source projects: + +* [Backbone] - gives Backbone to web applications +* [Backbone.Undo] - a simple Backbone undo-manager +* [Keymaster] - keyboard shortcuts +* [CodeMirror] - versatile text editor +* [Spectrum] - no hassle colorpicker +* [FontAwesome] - the iconic font and CSS framework + ### Contributing @@ -164,4 +175,12 @@ Any kind of help is welcome. At the moment there is no generic guidelines so use ## License -BSD 3-clause \ No newline at end of file +BSD 3-clause + + +[Backbone]: +[Backbone.Undo]: +[Keymaster]: +[CodeMirror]: +[Spectrum]: +[FontAwesome]: \ No newline at end of file diff --git a/bower.json b/bower.json index 3d33a737c..a0ab2de16 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "grapesjs", "description": "Open source Web Template Editor", - "version": "0.1.0", + "version": "0.1.1", "author": "Artur Arseniev", "homepage": "http://grapesjs.com", "main": [ diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css index aa6bd357d..558c64b7f 100644 --- a/dist/css/grapes.min.css +++ b/dist/css/grapes.min.css @@ -3,4 +3,4 @@ @charset "UTF-8";.sp-alpha-handle,.sp-slider{opacity:.8;background-color:#ccc}.fa-fw,.fa-li,.sp-container button,.wte-pn-panel{text-align:center}.clear,.sp-cf:after,.wte-sm-sector{clear:both}.sp-container{position:absolute;top:0;left:0;display:inline-block;z-index:9999994;overflow:hidden}.sp-container.sp-flat,.sp-top{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{width:100%;display:inline-block}.sp-alpha-handle,.sp-color,.sp-dragger,.sp-hue,.sp-sat,.sp-slider,.sp-top-inner,.sp-val{position:absolute}.sp-top-inner{top:0;left:0;bottom:0;right:0}.sp-color{top:0;left:0;bottom:0}.sp-hue{top:0;right:0;bottom:0;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha,.sp-clear{display:none}.sp-alpha-handle{top:-4px;bottom:-4px;left:50%;background:#fff;opacity:.8}.sp-alpha{bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:1px solid #333}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0;right:0;bottom:0;left:84%;height:28px}.sp-alpha,.sp-alpha-handle,.sp-clear,.sp-container,.sp-container button,.sp-container.sp-dragging .sp-input,.sp-dragger,.sp-preview,.sp-replacer,.sp-slider{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-buttons-disabled .sp-button-container,.sp-container.sp-input-disabled .sp-input-container,.sp-container.sp-palette-buttons-disabled .sp-palette-button-container,.sp-initial-disabled .sp-initial,.sp-palette-disabled .sp-palette-container,.sp-palette-only .sp-picker-container{display:none}.sp-sat{background-image:-webkit-gradient(linear,0 0,100% 0,from(#FFF),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(left,#FFF,rgba(204,154,129,0));background-image:-moz-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-o-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-ms-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:linear-gradient(to right,#fff,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81')}.sp-val{background-image:-webkit-gradient(linear,0 100%,0 0,from(#000),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-moz-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-o-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-ms-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:linear-gradient(to top,#000,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000')}.sp-hue{background:-moz-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-ms-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-o-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(.17,#ff0),color-stop(.33,#0f0),color-stop(.5,#0ff),color-stop(.67,#00f),color-stop(.83,#f0f),to(red));background:-webkit-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00')}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00')}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff')}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff')}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff')}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000')}.sp-hidden{display:none!important}.sp-cf:after,.sp-cf:before{content:"";display:table}@media (max-device-width:480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;top:0;left:0}.sp-slider{top:0;right:-1px;background:#fff;opacity:.8}.sp-container{padding:0}.sp-clear,.sp-color,.sp-container,.sp-container button,.sp-container input,.sp-hue{font:400 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-clear,.sp-color,.sp-hue{border:1px solid #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container,.sp-input{width:100%}.sp-input{font-size:12px!important;border:1px inset;padding:4px 5px;margin:0;background:0 0;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-palette-container,.sp-picker-container{float:left;position:relative;padding:10px 10px 300px;margin-bottom:-290px}.sp-picker-container{width:172px}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;cursor:pointer}.sp-palette .sp-thumb-el.sp-thumb-active,.sp-palette .sp-thumb-el:hover{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:1px solid #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-button-container,.sp-palette-button-container{float:right}.fa-pull-left,.sp-dd{float:left}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;border:1px solid #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer.sp-active,.sp-replacer:hover{border-color:#F0C49B;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;font-size:10px}.sp-preview{width:25px;height:20px;border:1px solid #222;margin-right:5px;float:left;z-index:0}.sp-palette{max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:1px solid #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top,#eee,#ccc);background-image:-moz-linear-gradient(top,#eee,#ccc);background-image:-ms-linear-gradient(top,#eee,#ccc);background-image:-o-linear-gradient(top,#eee,#ccc);background-image:linear-gradient(to bottom,#eee,#ccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;font-size:14px;line-height:1;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top,#ddd,#bbb);background-image:-moz-linear-gradient(top,#ddd,#bbb);background-image:-ms-linear-gradient(top,#ddd,#bbb);background-image:-o-linear-gradient(top,#ddd,#bbb);background-image:linear-gradient(to bottom,#ddd,#bbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{margin:0 5px 0 0;padding:2px;vertical-align:middle}.fa.fa-pull-left,.fa.pull-left{margin-right:.3em}.sp-palette span.sp-thumb-active,.sp-palette span:hover{border-color:#000}.sp-alpha,.sp-preview,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-alpha-inner,.sp-preview-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.fa,.fa-stack{display:inline-block}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}/*! * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome-webfont.eot?v=4.5.0);src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0) format("embedded-opentype"),url(../fonts/fontawesome-webfont.woff2?v=4.5.0) format("woff2"),url(../fonts/fontawesome-webfont.woff?v=4.5.0) format("woff"),url(../fonts/fontawesome-webfont.ttf?v=4.5.0) format("truetype"),url(../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa.fa-pull-right,.fa.pull-right{margin-left:.3em}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-right,.pull-right{float:right}.pull-left{float:left}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.wte-test::btn{color:'#fff'}.opac50{opacity:.5;filter:alpha(opacity=50)}.checker-bg,.wte-sm-sector .wte-sm-property .wte-sm-layer>#wte-sm-preview-box{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}body{background-color:#eee;font-family:Helvetica,sans-serif;margin:0}#wte-app,.wte-editor,body,html{height:100%}.no-select,.wte-com-no-select,.wte-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}#wte-app{height:100%;min-width:1250px}.wte-editor{position:relative;border:3px solid #444;border-left:none;border-right:none;box-sizing:border-box}.wte-cv-canvas{position:absolute;width:80%;height:100%;top:0;left:3.5%;overflow:auto;z-index:1}.wte-cv-canvas>div{height:100%;overflow:auto;width:100%}.wte-cv-canvas *{box-sizing:border-box}.btn-cl,.wte-am-assets #wte-am-close,.wte-mdl-dialog .wte-mdl-btn-close{font-size:25px;opacity:.3;filter:alpha(opacity=30);cursor:pointer}.btn-cl:hover,.wte-am-assets #wte-am-close:hover,.wte-mdl-dialog .wte-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.dragged,.wte-nv-opac50{opacity:.5;filter:alpha(opacity=50)}#commands.panel{min-width:35px;height:100%;z-index:3}#options.panel{z-index:4;bottom:0}#views.panel{width:16.5%;font-weight:lighter;color:#eee;right:0;top:0;z-index:3;height:100%;padding:0}#views.panel .c{height:100%}#commands.panel,#options.panel{width:3.5%;left:0}#options .c{display:table;margin:0 auto}body.dragging,body.dragging *{cursor:move!important}.dragged{position:absolute;z-index:2000}ol.example li.placeholder{position:relative}.wte-com-placeholder,.wte-pn-panel,ol.example li.placeholder:before{position:absolute}.no-dots,.ui-resizable-handle{border:none!important;margin:0!important;outline:0!important}.wte-com-dashed div{outline:#888 dashed 1px;outline-offset:-2px;box-sizing:border-box}.wte-cv-canvas .wte-comp-selected{outline:#3b97e3 solid 3px!important}.wte-com-hover,div.wte-com-hover{outline:#3b97e3 solid 1px}.wte-com-hover-delete,div.wte-com-hover-delete{outline:#DD3636 solid 2px;opacity:.5;filter:alpha(opacity=50)}.wte-com-hover-move,div.wte-com-hover-move{outline:#ffca6f solid 3px}.wte-com-badge,.wte-com-badge-red,.wte-com-badge-yellow{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px}.wte-com-badge-red{background-color:#DD3636}.wte-com-badge-yellow{background-color:#ffca6f}.wte-com-placeholder-int{background-color:#62c462;height:100%;width:100%;pointer-events:'none';padding:2px}.wte-pn-panel{background-color:#444;display:inline-block;padding:5px;box-sizing:border-box;z-index:3}.wte-pn-panel#wte-pn-commands,.wte-pn-panel#wte-pn-options{min-width:35px;height:100%;width:3.5%;left:0}.wte-pn-panel#wte-pn-options{bottom:0;height:auto}.wte-pn-panel#wte-pn-views{border-bottom:2px solid #3c3c3c;right:0;width:16.5%;z-index:4}.wte-pn-panel#wte-pn-views-container{height:100%;padding:52px 0 0;right:0;width:16.5%;overflow:auto}.wte-pn-btn{box-sizing:border-box;height:35px;width:35px;line-height:35px;background-color:transparent;border:none;color:#eee;font-size:25px;margin-bottom:5px;border-radius:2px;cursor:pointer;padding:0 5px;position:relative}.wte-pn-btn.wte-pn-active{background-color:#3a3a3a;box-shadow:0 0 3px #2d2d2d inset}.wte-pn-btn>.wte-pn-arrow-rd{border-bottom:5px solid #eee;border-left:5px solid transparent;bottom:2px;right:2px;position:absolute}.wte-pn-btn>.wte-pn-buttons{background-color:#444;border-radius:2px;position:absolute;display:none;left:50px;top:0;padding:5px}.wte-pn-btn>.wte-pn-buttons.wte-pn-visible{display:block}.wte-pn-btn>.wte-pn-buttons>.wte-pn-arrow-l{border-bottom:5px solid transparent;border-right:5px solid #444;border-top:5px solid transparent;left:-5px;top:15px;position:absolute}.tempComp,.wte-nv-navigator .wte-nv-item.wte-nv-hide{opacity:.55;filter:alpha(opacity=55)}.wte-nv-navigator{position:relative;height:100%}.wte-nv-navigator #wte-nv-placeholder{width:100%;position:absolute}.wte-nv-navigator #wte-nv-placeholder #wte-nv-plh-int{height:100%;padding:1px}.wte-nv-navigator #wte-nv-placeholder #wte-nv-plh-int.wte-nv-insert{background-color:#62c462}.wte-nv-navigator .wte-nv-item{color:#eee;font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.3)}.wte-nv-navigator .wte-nv-item #wte-nv-counter{font-size:10px;position:absolute;right:27px;top:9px}.wte-nv-navigator .wte-nv-item #wte-nv-btn-eye{height:auto!important;width:auto!important;font-size:13px;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;color:#aeaeae;cursor:pointer;z-index:1}.wte-nv-navigator .wte-nv-item .wte-nv-title{font-size:11px;padding:7px 10px 7px 30px}.wte-nv-navigator .wte-nv-item #wte-nv-caret{font-size:7px;width:8px}.wte-nv-item .wte-nv-title{background-color:#3a3a3a;font-size:13px;letter-spacing:1px;padding:7px 10px 7px 25px;text-shadow:0 1px 0 #252525;border-bottom:1px solid #303030;border-top:1px solid #414141;cursor:pointer}.wte-nv-item .wte-nv-children .wte-nv-title{border-left:1px solid #3f3f3f}.wte-nv-item>.wte-nv-children{margin-left:15px;display:none}.wte-nv-item.open>.wte-nv-children{display:block}.wte-nv-item>.wte-nv-no-chld>#wte-nv-caret::before{content:''}.wte-nv-item>#wte-nv-move{color:#6f6f6f;position:absolute;cursor:move;font-size:12px;right:0;top:0;padding:7px 10px 7px 5px}.wte-nv-item.wte-nv-selected{border:2px solid #3b97e3}.btn.expand,.wte-nv-navigator .wte-nv-item .expand#wte-nv-btn-eye{background-image:none}.tempComp{background-color:#5b5b5b;border:2px dashed #ccc;outline:0!important;position:absolute;z-index:55}.wte-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:#ffca6f solid 3px;outline-offset:-3px;text-align:center;font-size:16.67px;cursor:pointer}.wte-sm-header,.wte-sm-sector{color:#eee;font-weight:lighter}.wte-comp-image-placeholder.fa-picture-o::after{content:"\f03e"}.wte-sm-close-btn,.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box #wte-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.wte-sm-close-btn:hover,.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box #wte-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.wte-sm-header{font-size:11px;padding:10px;text-shadow:0 1px 0 #252525}.wte-sm-sector{border-bottom:1px solid #303030;text-align:left}.wte-sm-sector #wte-sm-caret{padding-right:5px;font-size:11px}.wte-sm-sector .wte-sm-title{background-color:#3a3a3a;font-size:13px;letter-spacing:1px;padding:12px 10px 12px 20px;text-shadow:0 1px 0 #252525;border-bottom:1px solid #303030;border-top:1px solid #414141;cursor:pointer}.wte-sm-sector .wte-sm-label{margin:5px 5px 2px 0}.wte-sm-sector .wte-sm-field{width:100%;position:relative}.wte-sm-sector .wte-sm-field input{box-sizing:border-box;color:#d5d5d5;background:0 0;border:none;padding:3px 21px 3px 0;width:100%}.wte-sm-sector .wte-sm-field select{background:0 0;border:none;color:transparent;width:100%;padding:2px 0;text-shadow:0 0 0 #d5d5d5;position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wte-sm-sector .wte-sm-field select::-ms-expand{display:none}.wte-sm-sector .wte-sm-field .wte-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:#b1b1b1;cursor:pointer}.wte-sm-sector .wte-sm-field .wte-sm-int-arrows,.wte-sm-sector .wte-sm-field .wte-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.wte-sm-sector .wte-sm-field .wte-sm-sel-arrow{cursor:pointer}.wte-sm-sector .wte-sm-field .wte-sm-d-arrow,.wte-sm-sector .wte-sm-field .wte-sm-d-s-arrow,.wte-sm-sector .wte-sm-field .wte-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.wte-sm-sector .wte-sm-field .wte-sm-u-arrow{border-bottom:4px solid #b1b1b1;top:4px}.wte-sm-sector .wte-sm-field .wte-sm-d-arrow,.wte-sm-sector .wte-sm-field .wte-sm-d-s-arrow{border-top:4px solid #b1b1b1;bottom:4px}.wte-sm-sector .wte-sm-field .wte-sm-d-s-arrow{bottom:7px}.wte-sm-sector .wte-sm-field.wte-sm-color,.wte-sm-sector .wte-sm-field.wte-sm-composite,.wte-sm-sector .wte-sm-field.wte-sm-integer,.wte-sm-sector .wte-sm-field.wte-sm-list,.wte-sm-sector .wte-sm-field.wte-sm-select{background-color:#333;border:1px solid #292929;box-shadow:1px 1px 0 #575757;color:#d5d5d5;border-radius:2px;box-sizing:border-box;padding:0 5px}.wte-sm-sector .wte-sm-field.wte-sm-select{padding:0}.wte-sm-sector .wte-sm-field.wte-sm-select select{height:20px}.wte-sm-sector .wte-sm-field.wte-sm-select option{margin:5px 0}.wte-sm-sector .wte-sm-field.wte-sm-composite{background-color:transparent;border:1px solid #333}.wte-sm-sector .wte-sm-field.wte-sm-list{width:auto;padding:0;overflow:hidden;float:left}.wte-sm-sector .wte-sm-field.wte-sm-list input{display:none}.wte-sm-sector .wte-sm-field.wte-sm-list label{cursor:pointer;padding:5px;display:block}.wte-sm-sector .wte-sm-field.wte-sm-list .wte-sm-radio:checked+label{background-color:#5b5b5b}.wte-sm-sector .wte-sm-field.wte-sm-list .wte-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.wte-sm-sector .wte-sm-field.wte-sm-integer select{width:auto;padding:0;color:transparent}.wte-sm-sector .wte-sm-list .wte-sm-el{float:left;border-left:1px solid #252525;text-shadow:0 1px 0 #232323}.wte-sm-sector .wte-sm-list .wte-sm-el:first-child{border:none}.wte-sm-sector .wte-sm-list .wte-sm-el:hover{background:#3a3a3a}.wte-sm-sector .wte-sm-properties{font-size:11px;padding:10px 5px}.wte-sm-sector .wte-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.wte-sm-sector .wte-sm-property.wte-sm-composite,.wte-sm-sector .wte-sm-property.wte-sm-file,.wte-sm-sector .wte-sm-property.wte-sm-list,.wte-sm-sector .wte-sm-property.wte-sm-stack{width:100%}.wte-sm-sector .wte-sm-property .wte-sm-btn{background-color:#5b5b5b;border-radius:2px;box-shadow:1px 1px 0 #3f3f3f,1px 1px 0 #656565 inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#eee;box-sizing:border-box;text-shadow:-1px -1px 0 #3a3a3a;border:none;opacity:.85;filter:alpha(opacity=85)}.wte-sm-sector .wte-sm-property .wte-sm-btn-c{box-sizing:border-box;float:left;width:100%;padding:0 5px}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box{background-color:#414141;border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box.wte-sm-show{border:1px solid #3f3f3f;padding:3px 5px}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box #wte-sm-close{display:block}.wte-sm-sector .wte-sm-property.wte-sm-file .wte-sm-show #wte-sm-preview-file{height:50px}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.wte-sm-sector .wte-sm-property .wte-sm-layers{background-color:#3a3a3a;border:1px solid #333;box-shadow:1px 1px 0 #575757;border-radius:2px;margin-top:5px;min-height:30px}.wte-sm-sector .wte-sm-property .wte-sm-layer{background-color:#454545;border-radius:2px;box-shadow:1px 1px 0 #333,1px 1px 0 #515151 inset;margin:2px;padding:7px;position:relative;cursor:pointer}.wte-sm-sector .wte-sm-property .wte-sm-layer>#wte-sm-preview-box{height:15px;position:absolute;right:27px;top:6px;width:15px}.wte-sm-sector .wte-sm-property .wte-sm-layer #wte-sm-preview,.wte-sm-sector .wte-sm-property .wte-sm-layer #wte-sm-preview-box{border-radius:2px}.wte-sm-sector .wte-sm-property .wte-sm-layer #wte-sm-close-layer{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.wte-sm-sector .wte-sm-property .wte-sm-layer>#wte-sm-preview-box #wte-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover!important}.wte-sm-sector .wte-sm-property .wte-sm-layer.wte-sm-active{background-color:#4c4c4c}.wte-sm-sector .wte-sm-property .wte-sm-layer.wte-sm-no-preview #wte-sm-preview-box{display:none}.wte-sm-sector .wte-sm-stack .wte-sm-properties{padding-top:5px}.wte-sm-sector .wte-sm-stack #wte-sm-add{background:0 0;border:none;color:#fff;cursor:pointer;font-size:22px;line-height:10px;position:absolute;right:0;top:-20px;opacity:.75}.wte-sm-sector .wte-sm-stack #wte-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.wte-sm-sector .wte-sm-color-picker{background-color:#eee;border:2px solid #575757;box-sizing:border-box;cursor:pointer;height:100%;width:20px;position:absolute;right:0;top:0}.wte-sm-sector .wte-sm-btn-upload #wte-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.wte-sm-sector .wte-sm-btn-upload #wte-sm-label{padding:2px 0}.wte-mdl-backlayer{background-color:#000;position:absolute;top:0;z-index:1;width:100%;height:100%;opacity:.5;filter:alpha(opacity=50)}.wte-mdl-container{position:absolute;top:0;z-index:10;width:100%;height:100%}.wte-mdl-dialog{background-color:#494949;border-bottom:2px solid #353535;text-shadow:-1px -1px 0 #353535;margin:30px auto 0;max-width:850px;width:90%;color:#eee;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.wte-mdl-dialog .wte-mdl-btn-close{position:absolute;right:15px;top:5px}.wte-mdl-content,.wte-mdl-header{padding:10px 15px;clear:both}.wte-mdl-header{position:relative;border-bottom:1px solid #3a3a3a;padding:15px 15px 7px}.wte-mdl-content{border-top:1px solid #515151}.wte-am-assets{background-color:#3a3a3a;border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:auto}.wte-am-assets .wte-am-highlight{background-color:#444}.wte-am-assets .wte-am-asset{border-bottom:1px solid #323232;padding:5px;cursor:pointer;position:relative}.wte-am-assets .wte-am-asset:hover #wte-am-close{display:block}.wte-am-assets .wte-am-asset #wte-am-preview{height:70px;width:30%;background-position:center center;background-size:cover;background-repeat:no-repeat;background-color:#444;border-radius:2px;float:left}.wte-am-assets #wte-am-close{position:absolute;right:5px;top:0;display:none}.wte-am-assets #wte-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.wte-am-assets #wte-am-meta>div{margin-bottom:5px}.wte-am-assets #wte-am-meta #wte-am-dimensions{font-size:10px;opacity:.5;filter:alpha(opacity=50)}.wte-am-file-uploader{width:55%;float:left}.wte-am-file-uploader>form{background-color:#3a3a3a;border:2px dashed #999;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.wte-am-file-uploader>form.wte-am-hover{border:2px solid #62c462;color:#75cb75}.wte-am-file-uploader>form.wte-am-disabled{border-color:red}.wte-am-file-uploader>form #wte-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.wte-am-file-uploader #wte-am-title{position:absolute;padding:150px 10px;width:100%}.wte-cm-editor-c{float:left;box-sizing:border-box;width:50%}.wte-cm-editor-c .CodeMirror{height:450px}.wte-cm-editor{font-size:12px}.wte-cm-editor#wte-cm-htmlmixed{padding-right:10px;border-right:1px solid #3a3a3a}.wte-cm-editor#wte-cm-htmlmixed #wte-cm-title{color:#a97d44}.wte-cm-editor#wte-cm-css{padding-left:10px;border-left:1px solid #515151}.wte-cm-editor#wte-cm-css #wte-cm-title{color:#ddca7e}.wte-cm-editor #wte-cm-title{background-color:#3a3a3a;font-size:12px;padding:5px 10px 3px;text-align:right}#wte-rte-toolbar{background-color:#444;border:1px solid #3a3a3a;position:absolute;border-radius:3px;overflow:hidden;z-index:5}#wte-rte-toolbar .wte-rte-btn{color:#eee;padding:5px;width:25px;border-right:1px solid #353535;text-align:center;cursor:pointer}#wte-rte-toolbar .wte-rte-btn:last-child{border-right:none}#wte-rte-toolbar .wte-rte-btn.btn-info{background-color:#323232}#wte-rte-toolbar .wte-rte-btn:hover{background-color:#515151}.sp-hue,.sp-slider{cursor:row-resize}.sp-color,.sp-dragger{cursor:crosshair}.sp-alpha-handle,.sp-alpha-inner{cursor:col-resize}.sp-hue{left:90%}.sp-color{right:15%}.sp-container{background-color:#454545;border:1px solid #333;box-shadow:0 0 7px #111;border-radius:3px}.sp-picker-container{border:none}.colpick_dark .colpick_color{outline:#333 solid 1px}.sp-cancel,.sp-cancel:hover{bottom:-8px;color:#777!important;font-size:25px;left:0;position:absolute;text-decoration:none}.sp-alpha-handle{border:1px solid #555;width:4px}.sp-color,.sp-hue{border:1px solid #333}.sp-slider{border:1px solid #555;height:3px;left:-4px;width:22px}.sp-dragger{background:0 0;box-shadow:0 0 0 1px #111}.sp-button-container{float:none;width:100%;position:relative;text-align:right}.sp-container button,.sp-container button:active,.sp-container button:hover{background:#333;border-color:#292929;color:#757575;text-shadow:none;box-shadow:none;padding:3px 5px} \ No newline at end of file + */@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome-webfont.eot?v=4.5.0);src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0) format("embedded-opentype"),url(../fonts/fontawesome-webfont.woff2?v=4.5.0) format("woff2"),url(../fonts/fontawesome-webfont.woff?v=4.5.0) format("woff"),url(../fonts/fontawesome-webfont.ttf?v=4.5.0) format("truetype"),url(../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857em}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa.fa-pull-right,.fa.pull-right{margin-left:.3em}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-right,.pull-right{float:right}.pull-left{float:left}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.wte-test::btn{color:'#fff'}.opac50{opacity:.5;filter:alpha(opacity=50)}.checker-bg,.wte-sm-sector .wte-sm-property .wte-sm-layer>#wte-sm-preview-box{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}body{background-color:#eee;font-family:Helvetica,sans-serif;margin:0}#wte-app,.wte-editor,body,html{height:100%}.no-select,.wte-com-no-select,.wte-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}#wte-app{height:100%;min-width:1250px}.wte-editor{position:relative;border:3px solid #444;border-left:none;border-right:none;box-sizing:border-box}.wte-cv-canvas{position:absolute;width:80%;height:100%;top:0;left:3.5%;overflow:auto;z-index:1}.wte-cv-canvas>div{height:100%;overflow:auto;width:100%}.wte-cv-canvas *{box-sizing:border-box}.btn-cl,.wte-am-assets #wte-am-close,.wte-mdl-dialog .wte-mdl-btn-close{font-size:25px;opacity:.3;filter:alpha(opacity=30);cursor:pointer}.btn-cl:hover,.wte-am-assets #wte-am-close:hover,.wte-mdl-dialog .wte-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.dragged,.wte-nv-opac50{opacity:.5;filter:alpha(opacity=50)}#commands.panel{min-width:35px;height:100%;z-index:3}#options.panel{z-index:4;bottom:0}#views.panel{width:16.5%;font-weight:lighter;color:#eee;right:0;top:0;z-index:3;height:100%;padding:0}#views.panel .c{height:100%}#commands.panel,#options.panel{width:3.5%;left:0}#options .c{display:table;margin:0 auto}body.dragging,body.dragging *{cursor:move!important}.dragged{position:absolute;z-index:2000}ol.example li.placeholder{position:relative}.wte-com-placeholder,.wte-pn-panel,ol.example li.placeholder:before{position:absolute}.no-dots,.ui-resizable-handle{border:none!important;margin:0!important;outline:0!important}.wte-com-dashed div{outline:#888 dashed 1px;outline-offset:-2px;box-sizing:border-box}.wte-cv-canvas .wte-comp-selected{outline:#3b97e3 solid 3px!important}.wte-com-hover,div.wte-com-hover{outline:#3b97e3 solid 1px}.wte-com-hover-delete,div.wte-com-hover-delete{outline:#DD3636 solid 2px;opacity:.5;filter:alpha(opacity=50)}.wte-com-hover-move,div.wte-com-hover-move{outline:#ffca6f solid 3px}.wte-com-badge,.wte-com-badge-red,.wte-com-badge-yellow{pointer-events:none;background-color:#3b97e3;color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px}.wte-com-badge-red{background-color:#DD3636}.wte-com-badge-yellow{background-color:#ffca6f}.wte-com-placeholder-int{background-color:#62c462;height:100%;width:100%;pointer-events:'none';padding:2px}.wte-pn-panel{background-color:#444;display:inline-block;padding:5px;box-sizing:border-box;z-index:3}.wte-pn-panel#wte-pn-commands,.wte-pn-panel#wte-pn-options{min-width:35px;height:100%;width:3.5%;left:0}.wte-pn-panel#wte-pn-options{bottom:0;height:auto}.wte-pn-panel#wte-pn-views{border-bottom:2px solid #3c3c3c;right:0;width:16.5%;z-index:4}.wte-pn-panel#wte-pn-views-container{height:100%;padding:52px 0 0;right:0;width:16.5%;overflow:auto}.wte-pn-btn{box-sizing:border-box;height:35px;width:35px;line-height:35px;background-color:transparent;border:none;color:#eee;font-size:25px;margin-bottom:5px;border-radius:2px;cursor:pointer;padding:0 5px;position:relative}.wte-pn-btn.wte-pn-active{background-color:#3a3a3a;box-shadow:0 0 3px #2d2d2d inset}.wte-pn-btn>.wte-pn-arrow-rd{border-bottom:5px solid #eee;border-left:5px solid transparent;bottom:2px;right:2px;position:absolute}.wte-pn-btn>.wte-pn-buttons{background-color:#444;border-radius:2px;position:absolute;display:none;left:50px;top:0;padding:5px}.wte-pn-btn>.wte-pn-buttons.wte-pn-visible{display:block}.wte-pn-btn>.wte-pn-buttons>.wte-pn-arrow-l{border-bottom:5px solid transparent;border-right:5px solid #444;border-top:5px solid transparent;left:-5px;top:15px;position:absolute}.tempComp,.wte-nv-navigator .wte-nv-item.wte-nv-hide{opacity:.55;filter:alpha(opacity=55)}.wte-nv-navigator{position:relative;height:100%}.wte-nv-navigator #wte-nv-placeholder{width:100%;position:absolute}.wte-nv-navigator #wte-nv-placeholder #wte-nv-plh-int{height:100%;padding:1px}.wte-nv-navigator #wte-nv-placeholder #wte-nv-plh-int.wte-nv-insert{background-color:#62c462}.wte-nv-navigator .wte-nv-item{color:#eee;font-weight:lighter;text-align:left;position:relative;background-color:rgba(0,0,0,.3)}.wte-nv-navigator .wte-nv-item #wte-nv-counter{font-size:10px;position:absolute;right:27px;top:9px}.wte-nv-navigator .wte-nv-item #wte-nv-btn-eye{height:auto!important;width:auto!important;font-size:13px;left:0;top:0;padding:7px 5px 7px 10px;position:absolute;color:#aeaeae;cursor:pointer;z-index:1}.wte-nv-navigator .wte-nv-item .wte-nv-title{font-size:11px;padding:7px 10px 7px 30px}.wte-nv-navigator .wte-nv-item #wte-nv-caret{font-size:7px;width:8px}.wte-nv-item .wte-nv-title{background-color:#3a3a3a;font-size:13px;letter-spacing:1px;padding:7px 10px 7px 25px;text-shadow:0 1px 0 #252525;border-bottom:1px solid #303030;border-top:1px solid #414141;cursor:pointer}.wte-nv-item .wte-nv-children .wte-nv-title{border-left:1px solid #3f3f3f}.wte-nv-item>.wte-nv-children{margin-left:15px;display:none}.wte-nv-item.open>.wte-nv-children{display:block}.wte-nv-item>.wte-nv-no-chld>#wte-nv-caret::before{content:''}.wte-nv-item>#wte-nv-move{color:#6f6f6f;position:absolute;cursor:move;font-size:12px;right:0;top:0;padding:7px 10px 7px 5px}.wte-nv-item.wte-nv-selected{border:2px solid #3b97e3}.btn.expand,.wte-nv-navigator .wte-nv-item .expand#wte-nv-btn-eye{background-image:none}.tempComp{background-color:#5b5b5b;border:2px dashed #ccc;outline:0!important;position:absolute;z-index:55}.wte-comp-image-placeholder{display:block;background-color:#f5f5f5;color:#777;height:50px;width:50px;line-height:50px;outline:#ffca6f solid 3px;outline-offset:-3px;text-align:center;font-size:16.67px;cursor:pointer}.wte-sm-header,.wte-sm-sector{color:#eee;font-weight:lighter}.wte-comp-image-placeholder.fa-picture-o::after{content:"\f03e"}.wte-sm-close-btn,.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box #wte-sm-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.wte-sm-close-btn:hover,.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box #wte-sm-close:hover{opacity:.7;filter:alpha(opacity=70)}.wte-sm-header{font-size:11px;padding:10px;text-shadow:0 1px 0 #252525}.wte-sm-sector{border-bottom:1px solid #303030;text-align:left}.wte-sm-sector #wte-sm-caret{padding-right:5px;font-size:11px}.wte-sm-sector .wte-sm-title{background-color:#3a3a3a;font-size:13px;letter-spacing:1px;padding:12px 10px 12px 20px;text-shadow:0 1px 0 #252525;border-bottom:1px solid #303030;border-top:1px solid #414141;cursor:pointer}.wte-sm-sector .wte-sm-label{margin:5px 5px 2px 0}.wte-sm-sector .wte-sm-field{width:100%;position:relative}.wte-sm-sector .wte-sm-field input{box-sizing:border-box;color:#d5d5d5;background:0 0;border:none;padding:3px 21px 3px 0;width:100%}.wte-sm-sector .wte-sm-field select{background:0 0;border:none;color:transparent;width:100%;padding:2px 0;text-shadow:0 0 0 #d5d5d5;position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wte-sm-sector .wte-sm-field select::-ms-expand{display:none}.wte-sm-sector .wte-sm-field .wte-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:#b1b1b1;cursor:pointer}.wte-sm-sector .wte-sm-field .wte-sm-int-arrows,.wte-sm-sector .wte-sm-field .wte-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.wte-sm-sector .wte-sm-field .wte-sm-sel-arrow{cursor:pointer}.wte-sm-sector .wte-sm-field .wte-sm-d-arrow,.wte-sm-sector .wte-sm-field .wte-sm-d-s-arrow,.wte-sm-sector .wte-sm-field .wte-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid transparent;border-right:4px solid transparent;cursor:pointer}.wte-sm-sector .wte-sm-field .wte-sm-u-arrow{border-bottom:4px solid #b1b1b1;top:4px}.wte-sm-sector .wte-sm-field .wte-sm-d-arrow,.wte-sm-sector .wte-sm-field .wte-sm-d-s-arrow{border-top:4px solid #b1b1b1;bottom:4px}.wte-sm-sector .wte-sm-field .wte-sm-d-s-arrow{bottom:7px}.wte-sm-sector .wte-sm-field.wte-sm-color,.wte-sm-sector .wte-sm-field.wte-sm-composite,.wte-sm-sector .wte-sm-field.wte-sm-integer,.wte-sm-sector .wte-sm-field.wte-sm-list,.wte-sm-sector .wte-sm-field.wte-sm-select{background-color:#333;border:1px solid #292929;box-shadow:1px 1px 0 #575757;color:#d5d5d5;border-radius:2px;box-sizing:border-box;padding:0 5px}.wte-sm-sector .wte-sm-field.wte-sm-select{padding:0}.wte-sm-sector .wte-sm-field.wte-sm-select select{height:20px}.wte-sm-sector .wte-sm-field.wte-sm-select option{margin:5px 0}.wte-sm-sector .wte-sm-field.wte-sm-composite{background-color:transparent;border:1px solid #333}.wte-sm-sector .wte-sm-field.wte-sm-list{width:auto;padding:0;overflow:hidden;float:left}.wte-sm-sector .wte-sm-field.wte-sm-list input{display:none}.wte-sm-sector .wte-sm-field.wte-sm-list label{cursor:pointer;padding:5px;display:block}.wte-sm-sector .wte-sm-field.wte-sm-list .wte-sm-radio:checked+label{background-color:#5b5b5b}.wte-sm-sector .wte-sm-field.wte-sm-list .wte-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.wte-sm-sector .wte-sm-field.wte-sm-integer select{width:auto;padding:0;color:transparent}.wte-sm-sector .wte-sm-list .wte-sm-el{float:left;border-left:1px solid #252525;text-shadow:0 1px 0 #232323}.wte-sm-sector .wte-sm-list .wte-sm-el:first-child{border:none}.wte-sm-sector .wte-sm-list .wte-sm-el:hover{background:#3a3a3a}.wte-sm-sector .wte-sm-properties{font-size:11px;padding:10px 5px}.wte-sm-sector .wte-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.wte-sm-sector .wte-sm-property.wte-sm-composite,.wte-sm-sector .wte-sm-property.wte-sm-file,.wte-sm-sector .wte-sm-property.wte-sm-list,.wte-sm-sector .wte-sm-property.wte-sm-stack{width:100%}.wte-sm-sector .wte-sm-property .wte-sm-btn{background-color:#5b5b5b;border-radius:2px;box-shadow:1px 1px 0 #3f3f3f,1px 1px 0 #656565 inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:#eee;box-sizing:border-box;text-shadow:-1px -1px 0 #3a3a3a;border:none;opacity:.85;filter:alpha(opacity=85)}.wte-sm-sector .wte-sm-property .wte-sm-btn-c{box-sizing:border-box;float:left;width:100%;padding:0 5px}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box{background-color:#414141;border-radius:2px;margin-top:5px;position:relative;overflow:hidden}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box.wte-sm-show{border:1px solid #3f3f3f;padding:3px 5px}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-box #wte-sm-close{display:block}.wte-sm-sector .wte-sm-property.wte-sm-file .wte-sm-show #wte-sm-preview-file{height:50px}.wte-sm-sector .wte-sm-property.wte-sm-file #wte-sm-preview-file{background-size:auto 100%;background-repeat:no-repeat;background-position:center center}.wte-sm-sector .wte-sm-property .wte-sm-layers{background-color:#3a3a3a;border:1px solid #333;box-shadow:1px 1px 0 #575757;border-radius:2px;margin-top:5px;min-height:30px}.wte-sm-sector .wte-sm-property .wte-sm-layer{background-color:#454545;border-radius:2px;box-shadow:1px 1px 0 #333,1px 1px 0 #515151 inset;margin:2px;padding:7px;position:relative;cursor:pointer}.wte-sm-sector .wte-sm-property .wte-sm-layer>#wte-sm-preview-box{height:15px;position:absolute;right:27px;top:6px;width:15px}.wte-sm-sector .wte-sm-property .wte-sm-layer #wte-sm-preview,.wte-sm-sector .wte-sm-property .wte-sm-layer #wte-sm-preview-box{border-radius:2px}.wte-sm-sector .wte-sm-property .wte-sm-layer #wte-sm-close-layer{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.2;filter:alpha(opacity=20)}.wte-sm-sector .wte-sm-property .wte-sm-layer>#wte-sm-preview-box #wte-sm-preview{background-color:#fff;height:100%;width:100%;background-size:cover!important}.wte-sm-sector .wte-sm-property .wte-sm-layer.wte-sm-active{background-color:#4c4c4c}.wte-sm-sector .wte-sm-property .wte-sm-layer.wte-sm-no-preview #wte-sm-preview-box{display:none}.wte-sm-sector .wte-sm-stack .wte-sm-properties{padding-top:5px}.wte-sm-sector .wte-sm-stack #wte-sm-add{background:0 0;border:none;color:#fff;cursor:pointer;font-size:22px;line-height:10px;position:absolute;right:0;top:-20px;opacity:.75}.wte-sm-sector .wte-sm-stack #wte-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.wte-sm-sector .wte-sm-color-picker{background-color:#eee;border:2px solid #575757;box-sizing:border-box;cursor:pointer;height:100%;width:20px;position:absolute;right:0;top:0}.wte-sm-sector .wte-sm-btn-upload #wte-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.wte-sm-sector .wte-sm-btn-upload #wte-sm-label{padding:2px 0}.wte-mdl-backlayer{background-color:#000;position:absolute;top:0;z-index:1;width:100%;height:100%;opacity:.5;filter:alpha(opacity=50)}.wte-mdl-container{position:absolute;top:0;z-index:10;width:100%;height:100%}.wte-mdl-dialog{background-color:#494949;border-bottom:2px solid #353535;text-shadow:-1px -1px 0 #353535;margin:30px auto 0;max-width:850px;width:90%;color:#eee;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.wte-mdl-dialog .wte-mdl-btn-close{position:absolute;right:15px;top:5px}.wte-mdl-content,.wte-mdl-header{padding:10px 15px;clear:both}.wte-mdl-header{position:relative;border-bottom:1px solid #3a3a3a;padding:15px 15px 7px}.wte-mdl-content{border-top:1px solid #515151}.wte-am-assets{background-color:#3a3a3a;border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:auto}.wte-am-assets .wte-am-highlight{background-color:#444}.wte-am-assets .wte-am-asset{border-bottom:1px solid #323232;padding:5px;cursor:pointer;position:relative}.wte-am-assets .wte-am-asset:hover #wte-am-close{display:block}.wte-am-assets .wte-am-asset #wte-am-preview{height:70px;width:30%;background-position:center center;background-size:cover;background-repeat:no-repeat;background-color:#444;border-radius:2px;float:left}.wte-am-assets #wte-am-close{position:absolute;right:5px;top:0;display:none}.wte-am-assets #wte-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.wte-am-assets #wte-am-meta>div{margin-bottom:5px}.wte-am-assets #wte-am-meta #wte-am-dimensions{font-size:10px;opacity:.5;filter:alpha(opacity=50)}.wte-am-file-uploader{width:55%;float:left}.wte-am-file-uploader>form{background-color:#3a3a3a;border:2px dashed #999;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.wte-am-file-uploader>form.wte-am-hover{border:2px solid #62c462;color:#75cb75}.wte-am-file-uploader>form.wte-am-disabled{border-color:red}.wte-am-file-uploader>form #wte-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:150px 10px;width:100%;box-sizing:border-box}.wte-am-file-uploader #wte-am-title{position:absolute;padding:150px 10px;width:100%}.wte-cm-editor-c{float:left;box-sizing:border-box;width:50%}.wte-cm-editor-c .CodeMirror{height:450px}.wte-cm-editor{font-size:12px}.wte-cm-editor#wte-cm-htmlmixed{padding-right:10px;border-right:1px solid #3a3a3a}.wte-cm-editor#wte-cm-htmlmixed #wte-cm-title{color:#a97d44}.wte-cm-editor#wte-cm-css{padding-left:10px;border-left:1px solid #515151}.wte-cm-editor#wte-cm-css #wte-cm-title{color:#ddca7e}.wte-cm-editor #wte-cm-title{background-color:#3a3a3a;font-size:12px;padding:5px 10px 3px;text-align:right}#wte-rte-toolbar{background-color:#444;border:1px solid #3a3a3a;position:absolute;border-radius:3px;overflow:hidden;z-index:5}#wte-rte-toolbar .wte-rte-btn{color:#eee;padding:5px;width:25px;border-right:1px solid #353535;text-align:center;cursor:pointer}#wte-rte-toolbar .wte-rte-btn:last-child{border-right:none}#wte-rte-toolbar .wte-rte-btn.btn-info{background-color:#323232}#wte-rte-toolbar .wte-rte-btn:hover{background-color:#515151}.sp-hue,.sp-slider{cursor:row-resize}.sp-color,.sp-dragger{cursor:crosshair}.sp-alpha-handle,.sp-alpha-inner{cursor:col-resize}.sp-hue{left:90%}.sp-color{right:15%}.sp-container{background-color:#454545;border:1px solid #333;box-shadow:0 0 7px #111;border-radius:3px}.sp-picker-container{border:none}.colpick_dark .colpick_color{outline:#333 solid 1px}.sp-cancel,.sp-cancel:hover{bottom:-8px;color:#777!important;font-size:25px;left:0;position:absolute;text-decoration:none}.sp-alpha-handle{border:1px solid #555;width:4px}.sp-color,.sp-hue{border:1px solid #333}.sp-slider{border:1px solid #555;height:3px;left:-4px;width:22px}.sp-dragger{background:0 0;box-shadow:0 0 0 1px #111}.sp-button-container{float:none;width:100%;position:relative;text-align:right}.sp-container button,.sp-container button:active,.sp-container button:hover{background:#333;border-color:#292929;color:#757575;text-shadow:none;box-shadow:none;padding:3px 5px} \ No newline at end of file diff --git a/dist/grapes.min.js b/dist/grapes.min.js index 2b4ad2496..f08722a83 100644 --- a/dist/grapes.min.js +++ b/dist/grapes.min.js @@ -1,6 +1,6 @@ /*! grapesjs - v0.1.0 */ !function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports&&"object"==typeof module?module.exports=mod():a.grapesjs=a.GrapesJS=b()}(this,function(){var a,b,c;return function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,b){return function(){var c=v.call(arguments,0);return"string"!=typeof c[0]&&1===c.length&&c.push(null),n.apply(d,c.concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[],v=typeof c;if(f=f||a,"undefined"===v||"function"===v){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=u(d,f,4);var g=!B(c)&&t.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function b(a){return function(b,c,d){c=v(c,d);for(var e=A(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function d(a,b,c){return function(d,e,f){var g=0,h=A(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(l.call(d,g,h),t.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function e(a,b){var c=G.length,d=a.constructor,e=t.isFunction(d)&&d.prototype||i,f="constructor";for(t.has(a,f)&&!t.contains(b,f)&&b.push(f);c--;)f=G[c],f in a&&a[f]!==e[f]&&!t.contains(b,f)&&b.push(f)}var f=this,g=f._,h=Array.prototype,i=Object.prototype,j=Function.prototype,k=h.push,l=h.slice,m=i.toString,n=i.hasOwnProperty,o=Array.isArray,p=Object.keys,q=j.bind,r=Object.create,s=function(){},t=function(a){return a instanceof t?a:this instanceof t?void(this._wrapped=a):new t(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports._=t):f._=t,t.VERSION="1.8.3";var u=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},v=function(a,b,c){return null==a?t.identity:t.isFunction(a)?u(a,b,c):t.isObject(a)?t.matcher(a):t.property(a)};t.iteratee=function(a,b){return v(a,b,1/0)};var w=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},x=function(a){if(!t.isObject(a))return{};if(r)return r(a);s.prototype=a;var b=new s;return s.prototype=null,b},y=function(a){return function(b){return null==b?void 0:b[a]}},z=Math.pow(2,53)-1,A=y("length"),B=function(a){var b=A(a);return"number"==typeof b&&b>=0&&z>=b};t.each=t.forEach=function(a,b,c){b=u(b,c);var d,e;if(B(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=t.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},t.map=t.collect=function(a,b,c){b=v(b,c);for(var d=!B(a)&&t.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},t.reduce=t.foldl=t.inject=a(1),t.reduceRight=t.foldr=a(-1),t.find=t.detect=function(a,b,c){var d;return d=B(a)?t.findIndex(a,b,c):t.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},t.filter=t.select=function(a,b,c){var d=[];return b=v(b,c),t.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},t.reject=function(a,b,c){return t.filter(a,t.negate(v(b)),c)},t.every=t.all=function(a,b,c){b=v(b,c);for(var d=!B(a)&&t.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},t.some=t.any=function(a,b,c){b=v(b,c);for(var d=!B(a)&&t.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},t.contains=t.includes=t.include=function(a,b,c,d){return B(a)||(a=t.values(a)),("number"!=typeof c||d)&&(c=0),t.indexOf(a,b,c)>=0},t.invoke=function(a,b){var c=l.call(arguments,2),d=t.isFunction(b);return t.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},t.pluck=function(a,b){return t.map(a,t.property(b))},t.where=function(a,b){return t.filter(a,t.matcher(b))},t.findWhere=function(a,b){return t.find(a,t.matcher(b))},t.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=B(a)?a:t.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=v(b,c),t.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},t.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=B(a)?a:t.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=v(b,c),t.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},t.shuffle=function(a){for(var b,c=B(a)?a:t.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=t.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},t.sample=function(a,b,c){return null==b||c?(B(a)||(a=t.values(a)),a[t.random(a.length-1)]):t.shuffle(a).slice(0,Math.max(0,b))},t.sortBy=function(a,b,c){return b=v(b,c),t.pluck(t.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var C=function(a){return function(b,c,d){var e={};return c=v(c,d),t.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};t.groupBy=C(function(a,b,c){t.has(a,c)?a[c].push(b):a[c]=[b]}),t.indexBy=C(function(a,b,c){a[c]=b}),t.countBy=C(function(a,b,c){t.has(a,c)?a[c]++:a[c]=1}),t.toArray=function(a){return a?t.isArray(a)?l.call(a):B(a)?t.map(a,t.identity):t.values(a):[]},t.size=function(a){return null==a?0:B(a)?a.length:t.keys(a).length},t.partition=function(a,b,c){b=v(b,c);var d=[],e=[];return t.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},t.first=t.head=t.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:t.initial(a,a.length-b)},t.initial=function(a,b,c){return l.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},t.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:t.rest(a,Math.max(0,a.length-b))},t.rest=t.tail=t.drop=function(a,b,c){return l.call(a,null==b||c?1:b)},t.compact=function(a){return t.filter(a,t.identity)};var D=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=A(a);h>g;g++){var i=a[g];if(B(i)&&(t.isArray(i)||t.isArguments(i))){b||(i=D(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};t.flatten=function(a,b){return D(a,b,!1)},t.without=function(a){return t.difference(a,l.call(arguments,1))},t.uniq=t.unique=function(a,b,c,d){t.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=v(c,d));for(var e=[],f=[],g=0,h=A(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?t.contains(f,j)||(f.push(j),e.push(i)):t.contains(e,i)||e.push(i)}return e},t.union=function(){return t.uniq(D(arguments,!0,!0))},t.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=A(a);e>d;d++){var f=a[d];if(!t.contains(b,f)){for(var g=1;c>g&&t.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},t.difference=function(a){var b=D(arguments,!0,!0,1);return t.filter(a,function(a){return!t.contains(b,a)})},t.zip=function(){return t.unzip(arguments)},t.unzip=function(a){for(var b=a&&t.max(a,A).length||0,c=Array(b),d=0;b>d;d++)c[d]=t.pluck(a,d);return c},t.object=function(a,b){for(var c={},d=0,e=A(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},t.findIndex=b(1),t.findLastIndex=b(-1),t.sortedIndex=function(a,b,c,d){c=v(c,d,1);for(var e=c(b),f=0,g=A(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var E=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=x(a.prototype),g=a.apply(f,e);return t.isObject(g)?g:f};t.bind=function(a,b){if(q&&a.bind===q)return q.apply(a,l.call(arguments,1));if(!t.isFunction(a))throw new TypeError("Bind must be called on a function");var c=l.call(arguments,2),d=function(){return E(a,d,b,this,c.concat(l.call(arguments)))};return d},t.partial=function(a){var b=l.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===t?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=t.bind(a[c],a);return a},t.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return t.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},t.delay=function(a,b){var c=l.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},t.defer=t.partial(t.delay,t,1),t.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:t.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=t.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},t.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=t.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=t.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},t.wrap=function(a,b){return t.partial(b,a)},t.negate=function(a){return function(){return!a.apply(this,arguments)}},t.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},t.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},t.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},t.once=t.partial(t.before,2);var F=!{toString:null}.propertyIsEnumerable("toString"),G=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];t.keys=function(a){if(!t.isObject(a))return[];if(p)return p(a);var b=[];for(var c in a)t.has(a,c)&&b.push(c);return F&&e(a,b),b},t.allKeys=function(a){if(!t.isObject(a))return[];var b=[];for(var c in a)b.push(c);return F&&e(a,b),b},t.values=function(a){for(var b=t.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},t.mapObject=function(a,b,c){b=v(b,c);for(var d,e=t.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},t.pairs=function(a){for(var b=t.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},t.invert=function(a){for(var b={},c=t.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},t.functions=t.methods=function(a){var b=[];for(var c in a)t.isFunction(a[c])&&b.push(c);return b.sort()},t.extend=w(t.allKeys),t.extendOwn=t.assign=w(t.keys),t.findKey=function(a,b,c){b=v(b,c);for(var d,e=t.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},t.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;t.isFunction(b)?(e=t.allKeys(g),d=u(b,c)):(e=D(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},t.omit=function(a,b,c){if(t.isFunction(b))b=t.negate(b);else{var d=t.map(D(arguments,!1,!1,1),String);b=function(a,b){return!t.contains(d,b)}}return t.pick(a,b,c)},t.defaults=w(t.allKeys,!0),t.create=function(a,b){var c=x(a);return b&&t.extendOwn(c,b),c},t.clone=function(a){return t.isObject(a)?t.isArray(a)?a.slice():t.extend({},a):a},t.tap=function(a,b){return b(a),a},t.isMatch=function(a,b){var c=t.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var H=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof t&&(a=a._wrapped),b instanceof t&&(b=b._wrapped);var e=m.call(a);if(e!==m.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(t.isFunction(g)&&g instanceof g&&t.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!H(a[i],b[i],c,d))return!1}else{var j,k=t.keys(a);if(i=k.length,t.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!t.has(b,j)||!H(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};t.isEqual=function(a,b){return H(a,b)},t.isEmpty=function(a){return null==a?!0:B(a)&&(t.isArray(a)||t.isString(a)||t.isArguments(a))?0===a.length:0===t.keys(a).length},t.isElement=function(a){return!(!a||1!==a.nodeType)},t.isArray=o||function(a){return"[object Array]"===m.call(a)},t.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},t.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){t["is"+a]=function(b){return m.call(b)==="[object "+a+"]"}}),t.isArguments(arguments)||(t.isArguments=function(a){return t.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(t.isFunction=function(a){return"function"==typeof a||!1}),t.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},t.isNaN=function(a){return t.isNumber(a)&&a!==+a},t.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===m.call(a)},t.isNull=function(a){return null===a},t.isUndefined=function(a){return void 0===a},t.has=function(a,b){return null!=a&&n.call(a,b)},t.noConflict=function(){return f._=g,this},t.identity=function(a){return a},t.constant=function(a){return function(){return a}},t.noop=function(){},t.property=y,t.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},t.matcher=t.matches=function(a){return a=t.extendOwn({},a),function(b){return t.isMatch(b,a)}},t.times=function(a,b,c){var d=Array(Math.max(0,a));b=u(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},t.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},t.now=Date.now||function(){return(new Date).getTime()};var I={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},J=t.invert(I),K=function(a){var b=function(b){return a[b]},c="(?:"+t.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};t.escape=K(I),t.unescape=K(J),t.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),t.isFunction(d)?d.call(a):d};var L=0;t.uniqueId=function(a){var b=++L+"";return a?a+b:b},t.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var M=/(.)^/,N={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,P=function(a){return"\\"+N[a]};t.template=function(a,b,c){!b&&c&&(b=c),b=t.defaults({},b,t.templateSettings);var d=RegExp([(b.escape||M).source,(b.interpolate||M).source,(b.evaluate||M).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(O,P),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,t)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},t.chain=function(a){var b=t(a);return b._chain=!0,b};var Q=function(a,b){return a._chain?t(b).chain():b};t.mixin=function(a){t.each(t.functions(a),function(b){var c=t[b]=a[b];t.prototype[b]=function(){var a=[this._wrapped];return k.apply(a,arguments),Q(this,c.apply(t,a))}})},t.mixin(t),t.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=h[a];t.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],Q(this,c)}}),t.each(["concat","join","slice"],function(a){var b=h[a];t.prototype[a]=function(){return Q(this,b.apply(this._wrapped,arguments))}}),t.prototype.value=function(){return this._wrapped},t.prototype.valueOf=t.prototype.toJSON=t.prototype.value,t.prototype.toString=function(){return""+this._wrapped},"function"==typeof c&&c.amd&&c("underscore",[],function(){return t})}.call(this),c("jquery",[],function(){return jQuery}),function(a){var d="object"==typeof self&&self.self==self&&self||"object"==typeof global&&global.global==global&&global;if("function"==typeof c&&c.amd)c("backbone",["underscore","jquery","exports"],function(b,c,e){d.Backbone=a(d,e,b,c)});else if("undefined"!=typeof exports){var e,f=b("underscore");try{e=b("jquery")}catch(g){}a(d,exports,f,e)}else d.Backbone=a(d,{},d._,d.jQuery||d.Zepto||d.ender||d.$)}(function(a,b,c,d){var e=a.Backbone,f=Array.prototype.slice;b.VERSION="1.2.3",b.$=d,b.noConflict=function(){return a.Backbone=e,this},b.emulateHTTP=!1,b.emulateJSON=!1;var g=function(a,b,d){switch(a){case 1:return function(){return c[b](this[d])};case 2:return function(a){return c[b](this[d],a)};case 3:return function(a,e){return c[b](this[d],i(a,this),e)};case 4:return function(a,e,f){return c[b](this[d],i(a,this),e,f)};default:return function(){var a=f.call(arguments);return a.unshift(this[d]),c[b].apply(c,a)}}},h=function(a,b,d){c.each(b,function(b,e){c[e]&&(a.prototype[e]=g(b,e,d))})},i=function(a,b){return c.isFunction(a)?a:c.isObject(a)&&!b._isModel(a)?j(a):c.isString(a)?function(b){return b.get(a)}:a},j=function(a){var b=c.matches(a);return function(a){return b(a.attributes)}},k=b.Events={},l=/\s+/,m=function(a,b,d,e,f){var g,h=0;if(d&&"object"==typeof d){void 0!==e&&"context"in f&&void 0===f.context&&(f.context=e);for(g=c.keys(d);hd;d++)c[d]=arguments[d+1];return m(r,this._events,a,void 0,c),this};var r=function(a,b,c,d){if(a){var e=a[b],f=a.all;e&&f&&(f=f.slice()),e&&s(e,d),f&&s(f,[b].concat(d))}return a},s=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++df;f++)a[f+c]=b[f];for(f=0;fe&&(e+=this.length+1);for(var f,g=[],h=[],i=[],j={},k=b.add,l=b.merge,m=b.remove,n=!1,o=this.comparator&&null==e&&b.sort!==!1,p=c.isString(this.comparator)?this.comparator:null,q=0;qa&&(a+=this.length),this.models[a]},where:function(a,b){return this[b?"find":"filter"](a)},findWhere:function(a){return this.where(a,!0)},sort:function(a){var b=this.comparator;if(!b)throw new Error("Cannot sort a set without a comparator");a||(a={});var d=b.length;return c.isFunction(b)&&(b=c.bind(b,this)),1===d||c.isString(b)?this.models=this.sortBy(b):this.models.sort(b), -a.silent||this.trigger("sort",this,a),this},pluck:function(a){return c.invoke(this.models,"get",a)},fetch:function(a){a=c.extend({parse:!0},a);var b=a.success,d=this;return a.success=function(c){var e=a.reset?"reset":"set";d[e](c,a),b&&b.call(a.context,d,c,a),d.trigger("sync",d,c,a)},P(this,a),this.sync("read",this,a)},create:function(a,b){b=b?c.clone(b):{};var d=b.wait;if(a=this._prepareModel(a,b),!a)return!1;d||this.add(a,b);var e=this,f=b.success;return b.success=function(a,b,c){d&&e.add(a,c),f&&f.call(c.context,a,b,c)},a.save(null,b),a},parse:function(a,b){return a},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(a){return a[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(this._isModel(a))return a.collection||(a.collection=this),a;b=b?c.clone(b):{},b.collection=this;var d=new this.model(a,b);return d.validationError?(this.trigger("invalid",this,d.validationError,b),!1):d},_removeModels:function(a,b){for(var c=[],d=0;d7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(L,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var b=this.root.slice(0,-1)||"/";return this.location.replace(b+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var d=document.body,e=d.insertBefore(this.iframe,d.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}var f=window.addEventListener||function(a,b){return attachEvent("on"+a,b)};return this._usePushState?f("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?f("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.options.silent?void 0:this.loadUrl()},stop:function(){var a=window.removeEventListener||function(a,b){return detachEvent("on"+a,b)};this._usePushState?a("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&a("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),J.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();return b===this.fragment&&this.iframe&&(b=this.getHash(this.iframe.contentWindow)),b===this.fragment?!1:(this.iframe&&this.navigate(b),void this.loadUrl())},loadUrl:function(a){return this.matchRoot()?(a=this.fragment=this.getFragment(a),c.some(this.handlers,function(b){return b.route.test(a)?(b.callback(a),!0):void 0})):!1},navigate:function(a,b){if(!J.started)return!1;b&&b!==!0||(b={trigger:!!b}),a=this.getFragment(a||"");var c=this.root;(""===a||"?"===a.charAt(0))&&(c=c.slice(0,-1)||"/");var d=c+a;if(a=this.decodeFragment(a.replace(M,"")),this.fragment!==a){if(this.fragment=a,this._usePushState)this.history[b.replace?"replaceState":"pushState"]({},document.title,d);else{if(!this._wantsHashChange)return this.location.assign(d);if(this._updateHash(this.location,a,b.replace),this.iframe&&a!==this.getHash(this.iframe.contentWindow)){var e=this.iframe.contentWindow;b.replace||(e.document.open(),e.document.close()),this._updateHash(e.location,a,b.replace)}}return b.trigger?this.loadUrl(a):void 0}},_updateHash:function(a,b,c){if(c){var d=a.href.replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash="#"+b}}),b.history=new J;var N=function(a,b){var d,e=this;d=a&&c.has(a,"constructor")?a.constructor:function(){return e.apply(this,arguments)},c.extend(d,e,b);var f=function(){this.constructor=d};return f.prototype=e.prototype,d.prototype=new f,a&&c.extend(d.prototype,a),d.__super__=e.prototype,d};t.extend=v.extend=E.extend=A.extend=J.extend=N;var O=function(){throw new Error('A "url" property or function must be specified')},P=function(a,b){var c=b.error;b.error=function(d){c&&c.call(b.context,a,d,b),a.trigger("error",a,d,b)}};return b}),function(a){"function"==typeof c&&c.amd?c("backboneUndo",["underscore","backbone"],a):"undefined"!=typeof exports?module.exports=a(b("underscore"),b("backbone")):a(_,Backbone)}(function(a,b){function c(a,b,c){return c.length<=4?a.call(b,c[0],c[1],c[2],c[3]):a.apply(b,c)}function d(a,b){return n.call(a,b)}function e(b,c){return null==b?!1:(a.isArray(c)||(c=d(arguments,1)),a.all(c,function(a){return a in b}))}function f(){this.registeredObjects=[],this.cidIndexes=[]}function g(b,c,d,e){for(var f,g=0,h=c.length;h>g;g++)if(f=c[g]){if("on"===b){if(!e.objectRegistry.register(f))continue}else if(!e.objectRegistry.unregister(f))continue;a.isFunction(f[b])&&f[b]("all",d,e)}}function h(b,c){var d=c.type,e=c.undoTypes,f=!e[d]||e[d][b];a.isFunction(f)&&f(c.object,c.before,c.after,c.options)}function i(b,c,d,e,f){if(!(d.isCurrentlyUndoRedoing||"undo"===b&&-1===d.pointer||"redo"===b&&d.pointer===d.length-1)){d.isCurrentlyUndoRedoing=!0;var g,h,i="undo"===b;for(f?h=i&&d.pointer===d.length-1||!i&&-1===d.pointer?a.clone(d.models):n.apply(d.models,i?[0,d.pointer]:[d.pointer,d.length-1]):(g=d.at(i?d.pointer:d.pointer+1),h=e?d.where({magicFusionIndex:g.get("magicFusionIndex")}):[g]),d.pointer+=(i?-1:1)*h.length;g=i?h.pop():h.shift();)g[b]();d.isCurrentlyUndoRedoing=!1,c.trigger(b,c)}}function j(a,b){var d=a.condition,e=typeof d;return"function"===e?!!c(d,a,b):"boolean"===e?d:!0}function k(a,b,d,f){if(a.track&&!a.isCurrentlyUndoRedoing&&b in f&&j(f[b],d)){var g,h=c(f[b].on,f[b],d);if(e(h,"object","before","after")){if(h.type=b,h.magicFusionIndex=o(),h.undoTypes=f,a.pointera.maximumStackLength&&(a.shift(),a.pointer--)}}}function l(){}function m(b,c,d,f){if("object"==typeof c)return a.each(c,function(a,c){2===b?m(b,a,d,f):m(b,c,a,d)});switch(b){case 0:e(d,"undo","redo","on")&&a.all(a.pick(d,"undo","redo","on"),a.isFunction)&&(f[c]=d);break;case 1:f[c]&&a.isObject(d)&&(f[c]=a.extend({},f[c],d));break;case 2:delete f[c]}return this}var n=Array.prototype.slice,o=function(){function b(){d++,c=!0,a.defer(function(){c=!1})}var c=!1,d=-1;return function(){return c||b(),d}}();f.prototype={isRegistered:function(b){return b&&b.cid?this.registeredObjects[b.cid]:a.contains(this.registeredObjects,b)},register:function(a){return this.isRegistered(a)?!1:(a&&a.cid?(this.registeredObjects[a.cid]=a,this.cidIndexes.push(a.cid)):this.registeredObjects.push(a),!0)},unregister:function(b){if(this.isRegistered(b)){if(b&&b.cid)delete this.registeredObjects[b.cid],this.cidIndexes.splice(a.indexOf(this.cidIndexes,b.cid),1);else{var c=a.indexOf(this.registeredObjects,b);this.registeredObjects.splice(c,1)}return!0}return!1},get:function(){return a.map(this.cidIndexes,function(a){return this.registeredObjects[a]},this).concat(this.registeredObjects)}};var p={add:{undo:function(a,b,c,d){a.remove(c,d)},redo:function(a,b,c,d){d.index&&(d.at=d.index),a.add(c,d)},on:function(b,c,d){return{object:c,before:void 0,after:b,options:a.clone(d)}}},remove:{undo:function(a,b,c,d){"index"in d&&(d.at=d.index),a.add(b,d)},redo:function(a,b,c,d){a.remove(b,d)},on:function(b,c,d){return{object:c,before:b,after:void 0,options:a.clone(d)}}},change:{undo:function(b,c,d,e){a.isEmpty(c)?a.each(a.keys(d),b.unset,b):(b.set(c),e&&e.unsetData&&e.unsetData.before&&e.unsetData.before.length&&a.each(e.unsetData.before,b.unset,b))},redo:function(b,c,d,e){a.isEmpty(d)?a.each(a.keys(c),b.unset,b):(b.set(d),e&&e.unsetData&&e.unsetData.after&&e.unsetData.after.length&&a.each(e.unsetData.after,b.unset,b))},on:function(b,c){var d=b.changedAttributes(),e=a.keys(d),f=a.pick(b.previousAttributes(),e),g=a.keys(f),h=(c||(c={})).unsetData={after:[],before:[]};return e.length!=g.length&&(e.length>g.length?a.each(e,function(a){a in f||h.before.push(a)},this):a.each(g,function(a){a in d||h.after.push(a)})),{object:b,before:f,after:d,options:a.clone(c)}}},reset:{undo:function(a,b,c){a.reset(b)},redo:function(a,b,c){a.reset(c)},on:function(b,c){return{object:b,before:c.previousModels,after:a.clone(b.models)}}}};l.prototype=p;var q=b.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(a){h("undo",this.attributes)},redo:function(a){h("redo",this.attributes)}}),r=b.Collection.extend({model:q,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(a){this.maximumStackLength=a}}),s=b.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(b){this.stack=new r,this.objectRegistry=new f,this.undoTypes=new l,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(a,b){this.stack.setMaxLength(b)},this),b&&b.track&&this.startTracking(),b&&b.register&&(a.isArray(b.register)||a.isArguments(b.register)?c(this.register,this,b.register):this.register(b.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(a){k(this.stack,a,d(arguments,1),this.undoTypes)},register:function(){g("on",arguments,this._addToStack,this)},unregister:function(){g("off",arguments,this._addToStack,this)},unregisterAll:function(){c(this.unregister,this,this.objectRegistry.get())},undo:function(a){i("undo",this,this.stack,a)},undoAll:function(){i("undo",this,this.stack,!1,!0)},redo:function(a){i("redo",this,this.stack,a)},redoAll:function(){i("redo",this,this.stack,!1,!0)},isAvailable:function(a){var b=this.stack,c=b.length;switch(a){case"undo":return c>0&&b.pointer>-1;case"redo":return c>0&&b.pointer0;for(f in v)(!v[f]&&b(e.mods,+f)>-1||v[f]&&-1==b(e.mods,+f))&&(i=!1);(0!=e.mods.length||v[16]||v[18]||v[17]||v[91])&&!i||e.method(a,e)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}function f(a){var c,d=a.keyCode,e=b(A,d);if(e>=0&&A.splice(e,1),(93==d||224==d)&&(d=91),d in v){v[d]=!1;for(c in x)x[c]==d&&(h[c]=!1)}}function g(){for(t in v)v[t]=!1;for(t in x)h[t]=!1}function h(a,b,c){var d,e;d=p(a),void 0===c&&(c=b,b="all");for(var f=0;f1&&(e=q(a),a=[a[a.length-1]]),a=a[0],a=z(a),a in u||(u[a]=[]),u[a].push({shortcut:d[f],scope:b,method:c,key:d[f],mods:e})}function i(a,b){var d,e,f,g,h,i=[];for(d=p(a),g=0;g1&&(i=q(e)),a=e[e.length-1],a=z(a),void 0===b&&(b=n()),!u[a])return;for(f=0;ft;t++)y["f"+t]=111+t;var B={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(t in x)h[t]=!1;r(document,"keydown",function(a){e(a)}),r(document,"keyup",f),r(window,"focus",g);var C=a.key;a.key=h,a.key.setScope=m,a.key.getScope=n,a.key.deleteScope=o,a.key.filter=l,a.key.isPressed=j,a.key.getPressedKeyCodes=k,a.key.noConflict=s,a.key.unbind=i,"undefined"!=typeof module&&(module.exports=h)}(this),c("keymaster",function(a){return function(){var b;return b||a.keymaster}}(this)),c("AssetManager/config/config",[],function(){return{stylePrefix:"am-",assets:[],storageType:"local",storageName:"assets",urlStore:"http://localhost/assets/store",urlLoad:"http://localhost/assets/load",paramsStore:{},paramsLoad:{},beforeSend:function(a,b){},onComplete:function(a,b){},urlUpload:"http://localhost/assets/upload",uploadText:"Drop files here or click to upload",disableUpload:!1,storeOnChange:!0,storeAfterUpload:!1}}),c("AssetManager/model/Asset",["backbone"],function(a){return a.Model.extend({defaults:{type:"none",src:""},initialize:function(a){this.options=a||{}},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}})}),c("AssetManager/model/Assets",["backbone","./Asset"],function(a,b){return a.Collection.extend({model:b})}),c("AssetManager/view/AssetView",["backbone"],function(a){return a.View.extend({initialize:function(a){this.options=a,this.config=a.config||{},this.pfx=this.config.stylePrefix,this.className=this.pfx+"asset",this.listenTo(this.model,"destroy remove",this.remove)}})}),c("text",["module"],function(a){"use strict";var c,d,e,f,g,h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/]*>\s*([\s\S]+)\s*<\/body>/im,k="undefined"!=typeof location&&location.href,l=k&&location.protocol&&location.protocol.replace(/\:/,""),m=k&&location.hostname,n=k&&(location.port||void 0),o={},p=a.config&&a.config()||{};return c={version:"2.0.14",strip:function(a){if(a){a=a.replace(i,"");var b=a.match(j);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=h[b];try{a=new ActiveXObject(c)}catch(d){}if(a){h=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.lastIndexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,d,e){var f,g,h,i=c.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==b||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,b,d,e){d=b?c.strip(d):d,p.isBuild&&(o[a]=d),e(d)},load:function(a,b,d,e){if(e&&e.isBuild&&!e.inlineText)return void d();p.isBuild=e&&e.isBuild;var f=c.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=b.toUrl(g),i=p.useXhr||c.useXhr;return 0===h.indexOf("empty:")?void d():void(!k||i(h,l,m,n)?c.get(h,function(b){c.finishLoad(a,f.strip,b,d)},function(a){d.error&&d.error(a)}):b([g],function(a){c.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}))},write:function(a,b,d,e){if(o.hasOwnProperty(b)){var f=c.jsEscape(o[b]);d.asModule(a+"!"+b,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,b,d,e,f){var g=c.parseName(b),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";c.load(i,d,function(b){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},c.write(a,i,d,f)},f)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]?(d=b.nodeRequire("fs"),c.get=function(a,b,c){try{var e=d.readFileSync(a,"utf8");"\ufeff"===e[0]&&(e=e.substring(1)),b(e)}catch(f){c&&c(f)}}):"xhr"===p.env||!p.env&&c.createXhr()?c.get=function(a,b,d,e){var f,g=c.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);p.onXhr&&p.onXhr(g,a),g.onreadystatechange=function(c){var e,f;4===g.readyState&&(e=g.status||0,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d&&d(f)):b(g.responseText),p.onXhrComplete&&p.onXhrComplete(g,a))},g.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?c.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(e=Components.classes,f=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),g="@mozilla.org/windows-registry-key;1"in e,c.get=function(a,b){var c,d,h,i={};g&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=e["@mozilla.org/network/file-input-stream;1"].createInstance(f.nsIFileInputStream),c.init(h,1,0,!1),d=e["@mozilla.org/intl/converter-input-stream;1"].createInstance(f.nsIConverterInputStream),d.init(c,"utf-8",c.available(),f.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),d.readString(c.available(),i),d.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),c}),c("text!AssetManager/template/assetImage.html",[],function(){return'
\n
\n
<%= name %>
\n
<%= dim %>
\n
\n
\n
'}),c("AssetManager/view/AssetImageView",["./AssetView","text!./../template/assetImage.html"],function(a,b){return a.extend({events:{click:"selected",dblclick:"chosen"},template:_.template(b),initialize:function(b){a.prototype.initialize.apply(this,arguments),this.className+=" "+this.pfx+"asset-image",this.events["click #"+this.pfx+"close"]="removeItem",this.delegateEvents()},selected:function(){this.model.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),this.updateTarget(this.model.get("src"))},chosen:function(){this.updateTarget(this.model.get("src"));var a=this.model.collection.onSelect;a&&"function"==typeof a&&a(this.model)},updateTarget:function(a){var b=this.model.collection.target;if(b&&b.set){var c=_.clone(b.get("attributes"));c["class"]=[],b.set("attributes",c),b.set("src",a)}},removeItem:function(a){a.stopPropagation(),this.model.collection.remove(this.model)},render:function(){var a=this.model.get("name"),b=this.model.get("width")&&this.model.get("height")?this.model.get("width")+" x "+this.model.get("height"):"";return a=a?a:this.model.get("src").split("/").pop(),a=a&&a.length>30?a.substring(0,30)+"...":a,b=b?b+(this.model.get("unitDim")?this.model.get("unitDim"):" px"):"",this.$el.html(this.template({name:a,src:this.model.get("src"),dim:b,pfx:this.pfx})),this.$el.attr("class",this.className),this}})}),c("text!AssetManager/template/fileUploader.html",[],function(){return'
\n
<%= title %>
\n multiple/>\n
\n
'}),c("AssetManager/view/FileUploader",["backbone","text!./../template/fileUploader.html"],function(a,b){return a.View.extend({template:_.template(b),events:{},initialize:function(a){this.options=a||{},this.config=a.config||{},this.pfx=this.config.stylePrefix,this.target=this.collection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=this.config.disableUpload,this.events["change #"+this.uploadId]="uploadFile",this.delegateEvents()},uploadFile:function(a){for(var b=a.dataTransfer?a.dataTransfer.files:a.target.files,c=new FormData,d=0;d-1&&(f=c);var g=new f({model:a,config:this.config}),h=g.render().el;return e?e.appendChild(h):this.$el.prepend(h),h},deselectAll:function(){this.$el.find("."+this.pfx+"highlight").removeClass(this.pfx+"highlight")},render:function(){var a=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(b){this.addAsset(b,a)},this),this.$el.append(a),this.$el.attr("class",this.className),this}})}),c("AssetManager/main",["require","./config/config","./model/Assets","./view/AssetsView","./view/FileUploader"],function(a){var b=function(b){var c=b||{},d=a("./config/config"),e=a("./model/Assets"),f=a("./view/AssetsView"),g=a("./view/FileUploader");for(var h in d)h in c||(c[h]=d[h]);this.assets=new e(c.assets);var i={collection:this.assets,config:c};this.am=new f(i),this.fu=new g(i)};return b.prototype={getAssets:function(){return this.assets},setTarget:function(a){this.am.collection.target=a},onSelect:function(a){this.am.collection.onSelect=a},render:function(a){return(!this.rendered||a)&&(this.rendered=this.am.render().$el.add(this.fu.render().$el)),this.rendered}},b}),c("AssetManager",["AssetManager/main"],function(a){return a}),c("StorageManager/config/config",[],function(){return{autosave:1,storageType:"local",changesBeforeSave:1,remoteStorage:{storeComponents:!0,storeStyles:!1,storeHTML:!1,urlStore:"",urlLoad:"",urlUpload:"",paramsStore:{},paramsLoad:{},beforeSend:function(a,b){},onComplete:function(a,b){}},localStorage:{}}}),c("StorageManager/model/LocalStorage",["backbone"],function(a){return a.Model.extend({ +a.silent||this.trigger("sort",this,a),this},pluck:function(a){return c.invoke(this.models,"get",a)},fetch:function(a){a=c.extend({parse:!0},a);var b=a.success,d=this;return a.success=function(c){var e=a.reset?"reset":"set";d[e](c,a),b&&b.call(a.context,d,c,a),d.trigger("sync",d,c,a)},P(this,a),this.sync("read",this,a)},create:function(a,b){b=b?c.clone(b):{};var d=b.wait;if(a=this._prepareModel(a,b),!a)return!1;d||this.add(a,b);var e=this,f=b.success;return b.success=function(a,b,c){d&&e.add(a,c),f&&f.call(c.context,a,b,c)},a.save(null,b),a},parse:function(a,b){return a},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(a){return a[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(this._isModel(a))return a.collection||(a.collection=this),a;b=b?c.clone(b):{},b.collection=this;var d=new this.model(a,b);return d.validationError?(this.trigger("invalid",this,d.validationError,b),!1):d},_removeModels:function(a,b){for(var c=[],d=0;d7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(L,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var b=this.root.slice(0,-1)||"/";return this.location.replace(b+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var d=document.body,e=d.insertBefore(this.iframe,d.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}var f=window.addEventListener||function(a,b){return attachEvent("on"+a,b)};return this._usePushState?f("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?f("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.options.silent?void 0:this.loadUrl()},stop:function(){var a=window.removeEventListener||function(a,b){return detachEvent("on"+a,b)};this._usePushState?a("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&a("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),J.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();return b===this.fragment&&this.iframe&&(b=this.getHash(this.iframe.contentWindow)),b===this.fragment?!1:(this.iframe&&this.navigate(b),void this.loadUrl())},loadUrl:function(a){return this.matchRoot()?(a=this.fragment=this.getFragment(a),c.some(this.handlers,function(b){return b.route.test(a)?(b.callback(a),!0):void 0})):!1},navigate:function(a,b){if(!J.started)return!1;b&&b!==!0||(b={trigger:!!b}),a=this.getFragment(a||"");var c=this.root;(""===a||"?"===a.charAt(0))&&(c=c.slice(0,-1)||"/");var d=c+a;if(a=this.decodeFragment(a.replace(M,"")),this.fragment!==a){if(this.fragment=a,this._usePushState)this.history[b.replace?"replaceState":"pushState"]({},document.title,d);else{if(!this._wantsHashChange)return this.location.assign(d);if(this._updateHash(this.location,a,b.replace),this.iframe&&a!==this.getHash(this.iframe.contentWindow)){var e=this.iframe.contentWindow;b.replace||(e.document.open(),e.document.close()),this._updateHash(e.location,a,b.replace)}}return b.trigger?this.loadUrl(a):void 0}},_updateHash:function(a,b,c){if(c){var d=a.href.replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash="#"+b}}),b.history=new J;var N=function(a,b){var d,e=this;d=a&&c.has(a,"constructor")?a.constructor:function(){return e.apply(this,arguments)},c.extend(d,e,b);var f=function(){this.constructor=d};return f.prototype=e.prototype,d.prototype=new f,a&&c.extend(d.prototype,a),d.__super__=e.prototype,d};t.extend=v.extend=E.extend=A.extend=J.extend=N;var O=function(){throw new Error('A "url" property or function must be specified')},P=function(a,b){var c=b.error;b.error=function(d){c&&c.call(b.context,a,d,b),a.trigger("error",a,d,b)}};return b}),function(a){"function"==typeof c&&c.amd?c("backboneUndo",["underscore","backbone"],a):"undefined"!=typeof exports?module.exports=a(b("underscore"),b("backbone")):a(_,Backbone)}(function(a,b){function c(a,b,c){return c.length<=4?a.call(b,c[0],c[1],c[2],c[3]):a.apply(b,c)}function d(a,b){return n.call(a,b)}function e(b,c){return null==b?!1:(a.isArray(c)||(c=d(arguments,1)),a.all(c,function(a){return a in b}))}function f(){this.registeredObjects=[],this.cidIndexes=[]}function g(b,c,d,e){for(var f,g=0,h=c.length;h>g;g++)if(f=c[g]){if("on"===b){if(!e.objectRegistry.register(f))continue}else if(!e.objectRegistry.unregister(f))continue;a.isFunction(f[b])&&f[b]("all",d,e)}}function h(b,c){var d=c.type,e=c.undoTypes,f=!e[d]||e[d][b];a.isFunction(f)&&f(c.object,c.before,c.after,c.options)}function i(b,c,d,e,f){if(!(d.isCurrentlyUndoRedoing||"undo"===b&&-1===d.pointer||"redo"===b&&d.pointer===d.length-1)){d.isCurrentlyUndoRedoing=!0;var g,h,i="undo"===b;for(f?h=i&&d.pointer===d.length-1||!i&&-1===d.pointer?a.clone(d.models):n.apply(d.models,i?[0,d.pointer]:[d.pointer,d.length-1]):(g=d.at(i?d.pointer:d.pointer+1),h=e?d.where({magicFusionIndex:g.get("magicFusionIndex")}):[g]),d.pointer+=(i?-1:1)*h.length;g=i?h.pop():h.shift();)g[b]();d.isCurrentlyUndoRedoing=!1,c.trigger(b,c)}}function j(a,b){var d=a.condition,e=typeof d;return"function"===e?!!c(d,a,b):"boolean"===e?d:!0}function k(a,b,d,f){if(a.track&&!a.isCurrentlyUndoRedoing&&b in f&&j(f[b],d)){var g,h=c(f[b].on,f[b],d);if(e(h,"object","before","after")){if(h.type=b,h.magicFusionIndex=o(),h.undoTypes=f,a.pointera.maximumStackLength&&(a.shift(),a.pointer--)}}}function l(){}function m(b,c,d,f){if("object"==typeof c)return a.each(c,function(a,c){2===b?m(b,a,d,f):m(b,c,a,d)});switch(b){case 0:e(d,"undo","redo","on")&&a.all(a.pick(d,"undo","redo","on"),a.isFunction)&&(f[c]=d);break;case 1:f[c]&&a.isObject(d)&&(f[c]=a.extend({},f[c],d));break;case 2:delete f[c]}return this}var n=Array.prototype.slice,o=function(){function b(){d++,c=!0,a.defer(function(){c=!1})}var c=!1,d=-1;return function(){return c||b(),d}}();f.prototype={isRegistered:function(b){return b&&b.cid?this.registeredObjects[b.cid]:a.contains(this.registeredObjects,b)},register:function(a){return this.isRegistered(a)?!1:(a&&a.cid?(this.registeredObjects[a.cid]=a,this.cidIndexes.push(a.cid)):this.registeredObjects.push(a),!0)},unregister:function(b){if(this.isRegistered(b)){if(b&&b.cid)delete this.registeredObjects[b.cid],this.cidIndexes.splice(a.indexOf(this.cidIndexes,b.cid),1);else{var c=a.indexOf(this.registeredObjects,b);this.registeredObjects.splice(c,1)}return!0}return!1},get:function(){return a.map(this.cidIndexes,function(a){return this.registeredObjects[a]},this).concat(this.registeredObjects)}};var p={add:{undo:function(a,b,c,d){a.remove(c,d)},redo:function(a,b,c,d){d.index&&(d.at=d.index),a.add(c,d)},on:function(b,c,d){return{object:c,before:void 0,after:b,options:a.clone(d)}}},remove:{undo:function(a,b,c,d){"index"in d&&(d.at=d.index),a.add(b,d)},redo:function(a,b,c,d){a.remove(b,d)},on:function(b,c,d){return{object:c,before:b,after:void 0,options:a.clone(d)}}},change:{undo:function(b,c,d,e){a.isEmpty(c)?a.each(a.keys(d),b.unset,b):(b.set(c),e&&e.unsetData&&e.unsetData.before&&e.unsetData.before.length&&a.each(e.unsetData.before,b.unset,b))},redo:function(b,c,d,e){a.isEmpty(d)?a.each(a.keys(c),b.unset,b):(b.set(d),e&&e.unsetData&&e.unsetData.after&&e.unsetData.after.length&&a.each(e.unsetData.after,b.unset,b))},on:function(b,c){var d=b.changedAttributes(),e=a.keys(d),f=a.pick(b.previousAttributes(),e),g=a.keys(f),h=(c||(c={})).unsetData={after:[],before:[]};return e.length!=g.length&&(e.length>g.length?a.each(e,function(a){a in f||h.before.push(a)},this):a.each(g,function(a){a in d||h.after.push(a)})),{object:b,before:f,after:d,options:a.clone(c)}}},reset:{undo:function(a,b,c){a.reset(b)},redo:function(a,b,c){a.reset(c)},on:function(b,c){return{object:b,before:c.previousModels,after:a.clone(b.models)}}}};l.prototype=p;var q=b.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(a){h("undo",this.attributes)},redo:function(a){h("redo",this.attributes)}}),r=b.Collection.extend({model:q,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(a){this.maximumStackLength=a}}),s=b.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(b){this.stack=new r,this.objectRegistry=new f,this.undoTypes=new l,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(a,b){this.stack.setMaxLength(b)},this),b&&b.track&&this.startTracking(),b&&b.register&&(a.isArray(b.register)||a.isArguments(b.register)?c(this.register,this,b.register):this.register(b.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(a){k(this.stack,a,d(arguments,1),this.undoTypes)},register:function(){g("on",arguments,this._addToStack,this)},unregister:function(){g("off",arguments,this._addToStack,this)},unregisterAll:function(){c(this.unregister,this,this.objectRegistry.get())},undo:function(a){i("undo",this,this.stack,a)},undoAll:function(){i("undo",this,this.stack,!1,!0)},redo:function(a){i("redo",this,this.stack,a)},redoAll:function(){i("redo",this,this.stack,!1,!0)},isAvailable:function(a){var b=this.stack,c=b.length;switch(a){case"undo":return c>0&&b.pointer>-1;case"redo":return c>0&&b.pointer0;for(f in v)(!v[f]&&b(e.mods,+f)>-1||v[f]&&-1==b(e.mods,+f))&&(i=!1);(0!=e.mods.length||v[16]||v[18]||v[17]||v[91])&&!i||e.method(a,e)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}function f(a){var c,d=a.keyCode,e=b(A,d);if(e>=0&&A.splice(e,1),(93==d||224==d)&&(d=91),d in v){v[d]=!1;for(c in x)x[c]==d&&(h[c]=!1)}}function g(){for(t in v)v[t]=!1;for(t in x)h[t]=!1}function h(a,b,c){var d,e;d=p(a),void 0===c&&(c=b,b="all");for(var f=0;f1&&(e=q(a),a=[a[a.length-1]]),a=a[0],a=z(a),a in u||(u[a]=[]),u[a].push({shortcut:d[f],scope:b,method:c,key:d[f],mods:e})}function i(a,b){var d,e,f,g,h,i=[];for(d=p(a),g=0;g1&&(i=q(e)),a=e[e.length-1],a=z(a),void 0===b&&(b=n()),!u[a])return;for(f=0;ft;t++)y["f"+t]=111+t;var B={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(t in x)h[t]=!1;r(document,"keydown",function(a){e(a)}),r(document,"keyup",f),r(window,"focus",g);var C=a.key;a.key=h,a.key.setScope=m,a.key.getScope=n,a.key.deleteScope=o,a.key.filter=l,a.key.isPressed=j,a.key.getPressedKeyCodes=k,a.key.noConflict=s,a.key.unbind=i,"undefined"!=typeof module&&(module.exports=h)}(this),c("keymaster",function(a){return function(){var b;return b||a.keymaster}}(this)),c("AssetManager/config/config",[],function(){return{stylePrefix:"am-",assets:[],storageType:"local",storageName:"assets",urlStore:"http://localhost/assets/store",urlLoad:"http://localhost/assets/load",paramsStore:{},paramsLoad:{},beforeSend:function(a,b){},onComplete:function(a,b){},urlUpload:"http://localhost/assets/upload",uploadText:"Drop files here or click to upload",disableUpload:!1,storeOnChange:!0,storeAfterUpload:!1}}),c("AssetManager/model/Asset",["backbone"],function(a){return a.Model.extend({defaults:{type:"none",src:""},initialize:function(a){this.options=a||{}},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}})}),c("AssetManager/model/Assets",["backbone","./Asset"],function(a,b){return a.Collection.extend({model:b})}),c("AssetManager/view/AssetView",["backbone"],function(a){return a.View.extend({initialize:function(a){this.options=a,this.config=a.config||{},this.pfx=this.config.stylePrefix||"",this.className=this.pfx+"asset",this.listenTo(this.model,"destroy remove",this.remove)}})}),c("text",["module"],function(a){"use strict";var c,d,e,f,g,h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/]*>\s*([\s\S]+)\s*<\/body>/im,k="undefined"!=typeof location&&location.href,l=k&&location.protocol&&location.protocol.replace(/\:/,""),m=k&&location.hostname,n=k&&(location.port||void 0),o={},p=a.config&&a.config()||{};return c={version:"2.0.14",strip:function(a){if(a){a=a.replace(i,"");var b=a.match(j);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=h[b];try{a=new ActiveXObject(c)}catch(d){}if(a){h=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.lastIndexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,d,e){var f,g,h,i=c.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==b||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,b,d,e){d=b?c.strip(d):d,p.isBuild&&(o[a]=d),e(d)},load:function(a,b,d,e){if(e&&e.isBuild&&!e.inlineText)return void d();p.isBuild=e&&e.isBuild;var f=c.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=b.toUrl(g),i=p.useXhr||c.useXhr;return 0===h.indexOf("empty:")?void d():void(!k||i(h,l,m,n)?c.get(h,function(b){c.finishLoad(a,f.strip,b,d)},function(a){d.error&&d.error(a)}):b([g],function(a){c.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}))},write:function(a,b,d,e){if(o.hasOwnProperty(b)){var f=c.jsEscape(o[b]);d.asModule(a+"!"+b,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,b,d,e,f){var g=c.parseName(b),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";c.load(i,d,function(b){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},c.write(a,i,d,f)},f)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]?(d=b.nodeRequire("fs"),c.get=function(a,b,c){try{var e=d.readFileSync(a,"utf8");"\ufeff"===e[0]&&(e=e.substring(1)),b(e)}catch(f){c&&c(f)}}):"xhr"===p.env||!p.env&&c.createXhr()?c.get=function(a,b,d,e){var f,g=c.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);p.onXhr&&p.onXhr(g,a),g.onreadystatechange=function(c){var e,f;4===g.readyState&&(e=g.status||0,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d&&d(f)):b(g.responseText),p.onXhrComplete&&p.onXhrComplete(g,a))},g.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?c.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(e=Components.classes,f=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),g="@mozilla.org/windows-registry-key;1"in e,c.get=function(a,b){var c,d,h,i={};g&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=e["@mozilla.org/network/file-input-stream;1"].createInstance(f.nsIFileInputStream),c.init(h,1,0,!1),d=e["@mozilla.org/intl/converter-input-stream;1"].createInstance(f.nsIConverterInputStream),d.init(c,"utf-8",c.available(),f.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),d.readString(c.available(),i),d.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),c}),c("text!AssetManager/template/assetImage.html",[],function(){return'
\n
\n
<%= name %>
\n
<%= dim %>
\n
\n
\n
'}),c("AssetManager/view/AssetImageView",["./AssetView","text!./../template/assetImage.html"],function(a,b){return a.extend({events:{click:"selected",dblclick:"chosen"},template:_.template(b),initialize:function(b){a.prototype.initialize.apply(this,arguments),this.className+=" "+this.pfx+"asset-image",this.events["click #"+this.pfx+"close"]="removeItem",this.delegateEvents()},selected:function(){this.model.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),this.updateTarget(this.model.get("src"))},chosen:function(){this.updateTarget(this.model.get("src"));var a=this.model.collection.onSelect;a&&"function"==typeof a&&a(this.model)},updateTarget:function(a){var b=this.model.collection.target;if(b&&b.set){var c=_.clone(b.get("attributes"));c["class"]=[],b.set("attributes",c),b.set("src",a)}},removeItem:function(a){a.stopPropagation(),this.model.collection.remove(this.model)},render:function(){var a=this.model.get("name"),b=this.model.get("width")&&this.model.get("height")?this.model.get("width")+" x "+this.model.get("height"):"";return a=a?a:this.model.get("src").split("/").pop(),a=a&&a.length>30?a.substring(0,30)+"...":a,b=b?b+(this.model.get("unitDim")?this.model.get("unitDim"):" px"):"",this.$el.html(this.template({name:a,src:this.model.get("src"),dim:b,pfx:this.pfx})),this.$el.attr("class",this.className),this}})}),c("text!AssetManager/template/fileUploader.html",[],function(){return'
\n
<%= title %>
\n multiple/>\n
\n
'}),c("AssetManager/view/FileUploader",["backbone","text!./../template/fileUploader.html"],function(a,b){return a.View.extend({template:_.template(b),events:{},initialize:function(a){this.options=a||{},this.config=a.config||{},this.pfx=this.config.stylePrefix||"",this.target=this.collection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=this.config.disableUpload,this.events["change #"+this.uploadId]="uploadFile",this.delegateEvents()},uploadFile:function(a){for(var b=a.dataTransfer?a.dataTransfer.files:a.target.files,c=new FormData,d=0;d-1&&(f=c);var g=new f({model:a,config:this.config}),h=g.render().el;return e?e.appendChild(h):this.$el.prepend(h),h},deselectAll:function(){this.$el.find("."+this.pfx+"highlight").removeClass(this.pfx+"highlight")},render:function(){var a=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(b){this.addAsset(b,a)},this),this.$el.append(a),this.$el.attr("class",this.className),this}})}),c("AssetManager/main",["require","./config/config","./model/Assets","./view/AssetsView","./view/FileUploader"],function(a){var b=function(b){var c=b||{},d=a("./config/config"),e=a("./model/Assets"),f=a("./view/AssetsView"),g=a("./view/FileUploader");for(var h in d)h in c||(c[h]=d[h]);this.assets=new e(c.assets);var i={collection:this.assets,config:c};this.am=new f(i),this.fu=new g(i)};return b.prototype={getAssets:function(){return this.assets},setTarget:function(a){this.am.collection.target=a},onSelect:function(a){this.am.collection.onSelect=a},render:function(a){return(!this.rendered||a)&&(this.rendered=this.am.render().$el.add(this.fu.render().$el)),this.rendered}},b}),c("AssetManager",["AssetManager/main"],function(a){return a}),c("StorageManager/config/config",[],function(){return{autosave:1,storageType:"local",changesBeforeSave:1,remoteStorage:{storeComponents:!0,storeStyles:!1,storeHTML:!1,urlStore:"",urlLoad:"",urlUpload:"",paramsStore:{},paramsLoad:{},beforeSend:function(a,b){},onComplete:function(a,b){}},localStorage:{}}}),c("StorageManager/model/LocalStorage",["backbone"],function(a){return a.Model.extend({ defaults:{checkSupport:!0,errorNoSupport:"Error encountered while parsing JSON response"},getId:function(){return"local"},store:function(a,b){this.checkStorageEnvironment(),localStorage.setItem(a,b)},load:function(a){var b=null;this.checkStorageEnvironment(),localStorage.getItem(a)&&(b=localStorage.getItem(a));try{var c="Loading '"+a+"': ";if(!b)throw c+" Resource was not found"}catch(d){console.warn(d)}return b},remove:function(a){this.checkStorageEnvironment(),localStorage.removeItem(a)},checkStorageEnvironment:function(){this.get("checkSupport")&&(localStorage||console.warn(this.get("errorNoSupport")))}})}),c("StorageManager/model/RemoteStorage",["backbone"],function(a){return a.Model.extend({defaults:{urlLoad:"http://localhost/load",urlStore:"http://localhost/store",beforeSend:function(){},onComplete:function(){},paramsStore:{},paramsLoad:{},errorLoad:"Response is not a valid JSON"},getId:function(){return"remote"},store:function(a,b){var c=new FormData,d=this.get("paramsStore");c.append(a,b);for(var e in d)c.append(e,d[e]);$.ajax({url:this.get("urlStore"),beforeSend:this.get("beforeSend"),complete:this.get("onComplete"),type:"POST",processData:!1,contentType:!1,data:c})},load:function(a){var b=null,c=this;return $.ajax({url:this.get("urlLoad"),beforeSend:this.get("beforeSend"),complete:this.get("onComplete"),data:this.get("paramsLoad"),async:!1,type:"GET"}).done(function(d){try{var e="Loading '"+a+"': ";if("object"!=typeof d)throw e+c.get("errorLoad");if(b=d.data?d.data[a]:d[a],!b)throw e+" Resource was not found"}catch(f){console.warn(f)}}),b},remove:function(a){}})}),c("StorageManager/model/StorageInterface",[],function(){function a(){}return a.prototype={getId:function(){},store:function(a,b){},load:function(a){},remove:function(a){}},a}),c("StorageManager/main",["require","./config/config","./model/LocalStorage","./model/RemoteStorage","./model/StorageInterface"],function(a){function b(b){var c=b||{},d=a("./config/config"),e=a("./model/LocalStorage"),f=a("./model/RemoteStorage"),g=a("./model/StorageInterface");for(var h in d)h in c||(c[h]=d[h]);this.providers={},this.defaultProviders={},this.autosave=c.autosave,this.currentProvider=c.storageType||null,this.changesBeforeSave=c.changesBeforeSave,this.si=new g;var i=new e(c.localStorage),j=new f(c.remoteStorage);this.defaultProviders[i.getId()]=i,this.defaultProviders[j.getId()]=j}return b.prototype={isAutosave:function(){return this.autosave},setAutosave:function(a){return this.autosave=a,this},getChangesBeforeSave:function(){return this.changesBeforeSave},setChangesBeforeSave:function(a){return this.changesBeforeSave=a,this},addProvider:function(a){for(var b in this.si)a[b]||console.warn("addProvider: method '"+b+"' was not found inside '"+a.getId()+"' object");return this.providers[a.getId()]=a,this.currentProvider||(this.currentProvider=a.getId()),this},getProvider:function(a){var b=null;return a&&this.providers[a]&&(b=this.providers[a]),b},getProviders:function(){return this.providers},getCurrentProvider:function(){return this.currentProvider||this.loadDefaultProviders(),this.getProvider(this.currentProvider)},setCurrentProvider:function(a){return this.currentProvider=a,this},loadDefaultProviders:function(){for(var a in this.defaultProviders)this.addProvider(this.defaultProviders[a]);return this},store:function(a,b){return this.getCurrentProvider().store(a,b)},load:function(a){return this.getCurrentProvider().load(a)},remove:function(a){return this.getCurrentProvider().remove(a)}},b}),c("StorageManager",["StorageManager/main"],function(a){return a}),c("ModalDialog/config/config",[],function(){return{stylePrefix:"mdl-",title:"",content:"",backdrop:!0}}),c("ModalDialog/model/Modal",["backbone"],function(a){return a.Model.extend({defaults:{title:"",content:"",open:!1}})}),c("text!ModalDialog/template/modal.html",[],function(){return'
\n
\n
<%= title %>
\n
\n
\n
\n
<%= content %>
\n
\n
\n
\n
'}),c("ModalDialog/view/ModalView",["backbone","text!./../template/modal.html"],function(a,b){return a.View.extend({template:_.template(b),events:{},initialize:function(a){this.config=a.config||{},this.pfx=this.config.stylePrefix,this.listenTo(this.model,"change:open",this.updateOpen),this.listenTo(this.model,"change:title",this.updateTitle),this.listenTo(this.model,"change:content",this.updateContent),this.events["click ."+this.pfx+"btn-close"]="hide",this.config.backdrop&&(this.events["click ."+this.pfx+"backlayer"]="hide"),this.delegateEvents()},updateContent:function(){this.$content||(this.$content=this.$el.find("."+this.pfx+"content #"+this.pfx+"c")),this.$content.html(this.model.get("content"))},updateTitle:function(){this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),this.$title.html(this.model.get("title"))},updateOpen:function(){this.model.get("open")?this.$el.show():this.$el.hide()},hide:function(){this.model.set("open",0)},show:function(){this.model.set("open",1)},setTitle:function(a){return this.model.set("title",a),this},setContent:function(a){return this.model.set("content",a),this},render:function(){var a=this.model.toJSON();return a.pfx=this.pfx,this.$el.html(this.template(a)),this.$el.attr("class",this.pfx+"container"),this.updateOpen(),this}})}),c("ModalDialog/main",["require","./config/config","./model/Modal","./view/ModalView"],function(a){function b(b){var c=b||{},d=a("./config/config"),e=a("./model/Modal"),f=a("./view/ModalView");for(var g in d)g in c||(c[g]=d[g]);this.model=new e(c);var h={model:this.model,config:c};this.modal=new f(h)}return b.prototype={getModel:function(){return this.model},render:function(){return this.modal.render().$el},show:function(){return this.modal.show()},hide:function(){return this.modal.hide()},setTitle:function(a){return this.modal.setTitle(a)},setContent:function(a){return this.modal.setContent(a)}},b}),c("ModalDialog",["ModalDialog/main"],function(a){return a}),c("CodeManager/config/config",[],function(){return{stylePrefix:"cm-"}}),c("CodeManager/model/GeneratorInterface",[],function(){function a(){}return a.prototype={getId:function(){},build:function(a){}},a}),c("CodeManager/model/HtmlGenerator",["backbone"],function(a){return a.Model.extend({getId:function(){return"html"},build:function(a){var b=a.get("components")||a,c="";return b.each(function(a){var b=a.get("tagName"),d=0,e="",f=a.get("components");_.each(a.get("attributes"),function(a,b){"onmousedown"!=b&&(e+=a&&"style"!=b?" "+b+'="'+a+'" ':"")}),"image"==a.get("type")&&(b="img",d=1,e+='src="'+a.get("src")+'"'),c+="<"+b+' id="'+a.cid+'"'+e+(d?"/":"")+">"+a.get("content"),f.length&&(c+=this.build(f)),d||(c+="")},this),c}})}),c("CodeManager/model/CssGenerator",["backbone"],function(a){return a.Model.extend({getId:function(){return"css"},build:function(a){var b=a.get("components")||a,c="";return b.each(function(a){var b=a.get("style"),d=a.get("components");if(b&&0!==Object.keys(b).length){c+="#"+a.cid+"{";for(var e in b)b.hasOwnProperty(e)&&(c+=e+": "+b[e]+";");c+="}"}d.length&&(c+=this.build(d))},this),c}})}),c("CodeManager/model/JsonGenerator",["backbone"],function(a){return a.Model.extend({getId:function(){return"json"},build:function(b){var c=b.toJSON();return _.each(c,function(b,d){var e=c[d];if(e instanceof a.Model)c[d]=this.build(e);else if(e instanceof a.Collection){var f=e;c[d]=[],f.length&&f.each(function(a,b){c[d][b]=this.build(a)},this)}},this),c}})}),c("CodeManager/model/EditorInterface",[],function(){function a(){}return a.prototype={getId:function(){},setContent:function(a){},init:function(a){}},a}),function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof c&&c.amd)return c("codemirror/lib/codemirror",[],a);(this||window).CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Ke(d):{},Ke($f,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new wg(e,d.mode,null,d.lineSeparator)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Cf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new De,keySeq:null,specialChars:null};var i=this;sf&&11>tf&&setTimeout(function(){i.display.input.reset(!0)},20),Qb(this),We(),ub(this),this.curOp.forceUpdate=!0,Xd(this,e),d.autofocus&&!Cf||i.hasFocus()?setTimeout(Le(qc,this),20):rc(this);for(var k in _f)_f.hasOwnProperty(k)&&_f[k](this,d[k],ag);w(this),d.finishInit&&d.finishInit(this);for(var l=0;ltf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),uf||pf&&Cf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Na(a,100),a.state.modeGen++,a.curOp&&Jb(a)}function e(a){a.options.lineWrapping?(Yg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Xg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Jb(a),hb(a),setTimeout(function(){s(a)},100)}function f(a){var b=sb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/tb(a.display)-3);return function(e){if(vd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Ge(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Sa(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ua(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Pe("div",[Pe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Pe("div",[Pe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),Cg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),Cg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,sf&&8>tf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Xg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),Cg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?ec(b,a):dc(b,a)},b),b.display.scrollbars.addClass&&Yg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Ra(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=be(b,d),g=be(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=be(b,ce(Yd(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=be(b,ce(Yd(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Pb(a))return!1;w(a)&&(Lb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromg&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Jf&&(f=td(a.doc,f),g=ud(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Ob(a,f,g),c.viewOffset=ce(Yd(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Pb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Se();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Se()!=j&&j.offsetHeight&&j.focus(),Qe(c.cursorDiv),Qe(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Na(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Va(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Sa(a.display)-Wa(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ia(a),E(a,e),s(a,e)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ia(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Ua(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;dtf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=sb(b)),(i>.001||-.001>i)&&(_d(f.line,e),G(f.line),f.rest))for(var j=0;j=b&&l.lineNumber;l.changes&&(Ge(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Qe(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;etf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Pe("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Ld(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var e=K(b);b.gutterBackground=Pe("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=K(b),g=b.gutter=Pe("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(a.display.input.setUneditable(g),e.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Pe("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),f)for(var h=0;h1)if(Mf&&Mf.join("\n")==b){if(d.ranges.length%Mf.length==0){i=[];for(var j=0;j=0;j--){var k=d.ranges[j],l=k.from(),m=k.to();k.empty()&&(c&&c>0?l=Kf(l.line,l.ch-c):a.state.overwrite&&!g&&(m=Kf(m.line,Math.min(Yd(f,m.line).text.length,m.ch+Fe(h).length))));var n=a.curOp.updateInput,o={from:l,to:m,text:i?i[j%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};zc(a.doc,o),xe(a,"inputRead",a,o)}b&&!g&&_(a,b),Lc(a),a.curOp.updateInput=n,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function $(a,b){var c=a.clipboardData&&a.clipboardData.getData("text/plain");return c?(a.preventDefault(),b.isReadOnly()||b.options.disableInput||Db(b,function(){Z(b,c,0,null,"paste")}),!0):void 0}function _(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h-1){g=Nc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Yd(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Nc(a,e.head.line,"smart"));g&&xe(a,"electricInput",a,e.head.line)}}}function aa(a){for(var b=[],c=[],d=0;de?j.map:k[e],g=0;ge?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Kf(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Ug(e,b))return ga(Kf(ae(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Fe(a.rest):a.line;return ga(Kf(ae(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ga(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ga(Kf(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ga(Kf(l.line,l.ch+n),f);n+=m.textContent.length}}function ja(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var k,l=b.getAttribute("cm-marker");if(l){var m=a.findMarks(Kf(d,0),Kf(e+1,0),f(+l));return void(m.length&&(k=m[0].find())&&(h+=Zd(a.doc,k.from,k.to).join(j)))}if("false"==b.getAttribute("contenteditable"))return;for(var n=0;n=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new la(i?h:g,i?g:h))}}return new ka(a,b)}function na(a,b){return new ka([new la(a,b||a)],0)}function oa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function pa(a,b){if(b.linec?Kf(c,Yd(a,c).text.length):qa(b,Yd(a,b.line).text.length)}function qa(a,b){var c=a.ch;return null==c||c>b?Kf(a.line,b):0>c?Kf(a.line,0):a}function ra(a,b){return b>=a.first&&b=b.ch:h.to>b.ch))){if(e&&(Fg(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j,k=i.find(0>d?1:-1);if((0>d?i.inclusiveRight:i.inclusiveLeft)&&(k=Ha(a,k,-d,f)),k&&k.line==b.line&&(j=Lf(k,c))&&(0>d?0>j:j>0))return Fa(a,k,b,d,e)}var l=i.find(0>d?-1:1);return(0>d?i.inclusiveLeft:i.inclusiveRight)&&(l=Ha(a,l,d,f)),l?Fa(a,l,b,d,e):null}}return b}function Ga(a,b,c,d,e){var f=d||1,g=Fa(a,b,c,f,e)||!e&&Fa(a,b,c,f,!0)||Fa(a,b,c,-f,e)||!e&&Fa(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,Kf(a.first,0))}function Ha(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?pa(a,Kf(b.line-1)):null:c>0&&b.ch==(d||Yd(a,b.line)).text.length?b.lineb&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Pe("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return mb(a,Kf(b,c),"div",l,d)}var h,i,l=Yd(g,b),m=l.text.length;return _e(de(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottomi.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Ta(a.display),j=i.left,k=Math.max(f.sizerWidth,Va(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Yd(g,l.line),o=Yd(g,m.line),p=rd(n)==rd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Na(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=gg(b.mode,Qa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,i=Hd(a,f,h?gg(b.mode,d):d,!0);f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&mc?(Na(a,a.options.workDelay),!0):void 0}),e.length&&Db(a,function(){for(var b=0;bg;--h){if(h<=f.first)return f.first;var i=Yd(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Mg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Qa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Pa(a,b,c),g=f>d.first&&Yd(d,f-1).stateAfter;return g=g?gg(d.mode,g):hg(d.mode),d.iter(f,b,function(c){Jd(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Ya(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function Za(a,b){b=rd(b);var c=ae(b),d=a.display.externalMeasured=new Hb(a.doc,b,c);d.lineN=c;var e=d.built=Ld(a,d);return d.text=e.pre,Re(a.display.lineMeasure,e.pre),d}function $a(a,b,c,d){return bb(a,ab(a,b),c,d)}function _a(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bb?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;hk;k++){for(;h&&Oe(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+itf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(sf&&a.options.lineWrapping){var l=Qg(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Qf}else e=Qg(g,h,i).getBoundingClientRect()||Qf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}sf&&11>tf&&(e=eb(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(sf&&9>tf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+tb(a.display),top:m.top,bottom:m.bottom}:Qf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;kc.from?g(a-1):g(a,d)}d=d||Yd(a.doc,b.line),e||(e=ab(a,d));var i=de(d),j=b.ch;if(!i)return g(j);var k=jf(i,j),l=h(j,k);return null!=eh&&(l.other=h(j,eh)),l}function ob(a,b){var c=0,b=pa(a.doc,b);a.options.lineWrapping||(c=tb(a.display)*b.ch);var d=Yd(a.doc,b.line),e=ce(d)+Ra(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function pb(a,b,c,d){var e=Kf(a,b);return e.xRel=d,c&&(e.outside=!0),e}function qb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return pb(d.first,0,!0,-1);var e=be(d,c),f=d.first+d.size-1;if(e>f)return pb(d.first+d.size-1,Yd(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Yd(d,e);;){var h=rb(a,g,e,b,c),i=pd(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=ae(g=j.to.line)}}function rb(a,b,c,d,e){function f(d){var e=nb(a,Kf(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:gq)return pb(c,n,r,1);for(;;){if(k?n==m||n==lf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Oe(b.text.charAt(s));)++s;var u=pb(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=lf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function sb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Nf){Nf=Pe("pre");for(var b=0;49>b;++b)Nf.appendChild(document.createTextNode("x")),Nf.appendChild(Pe("br"));Nf.appendChild(document.createTextNode("x"))}Re(a.measure,Nf);var c=Nf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Qe(a.measure),c||1}function tb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Pe("span","xxxxxxxxxx"),c=Pe("pre",[b]);Re(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function ub(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Sf},Rf?Rf.ops.push(a.curOp):a.curOp.ownsGroup=Rf={ops:[a.curOp],delayedCallbacks:[]}}function vb(a){var b=a.delayedCallbacks,c=0;do{for(;c=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function zb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function Ab(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=$a(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ua(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Va(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function Bb(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeftf;f=d){var g=new Hb(a.doc,Yd(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Jb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Jf&&td(a.doc,b)e.viewFrom?Lb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Lb(a);else if(b<=e.viewFrom){var f=Nb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Lb(a)}else if(c>=e.viewTo){var f=Nb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Lb(a)}else{var g=Nb(a,b,b,-1),h=Nb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Ib(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Lb(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Mb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Ge(g,c)&&g.push(c)}}}function Lb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Mb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Nb(a,b,c,d){var e,f=Mb(a,b),g=a.display.view;if(!Jf||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;td(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Ob(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Ib(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Ib(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Mb(a,c)))),d.viewTo=c}function Pb(a){for(var b=a.display.view,c=0,d=0;d400}var e=a.display;Cg(e.scroller,"mousedown",Eb(a,Vb)),sf&&11>tf?Cg(e.scroller,"dblclick",Eb(a,function(b){if(!ze(a,b)){var c=Ub(a,b);if(c&&!$b(a,b)&&!Tb(a.display,b)){zg(b);var d=a.findWordAt(c);ua(a.doc,d.anchor,d.head)}}})):Cg(e.scroller,"dblclick",function(b){ze(a,b)||zg(b)}),Hf||Cg(e.scroller,"contextmenu",function(b){sc(a,b)});var f,g={end:0};Cg(e.scroller,"touchstart",function(a){if(!c(a)){clearTimeout(f);var b=+new Date;e.activeTouch={start:b,moved:!1,prev:b-g.end<=300?g:null},1==a.touches.length&&(e.activeTouch.left=a.touches[0].pageX,e.activeTouch.top=a.touches[0].pageY)}}),Cg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),Cg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Tb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new la(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new la(Kf(h.line,0),pa(a.doc,Kf(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),zg(c)}b()}),Cg(e.scroller,"touchcancel",b),Cg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(dc(a,e.scroller.scrollTop),ec(a,e.scroller.scrollLeft,!0),Fg(a,"scroll",a))}),Cg(e.scroller,"mousewheel",function(b){fc(a,b)}),Cg(e.scroller,"DOMMouseScroll",function(b){fc(a,b)}),Cg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(b){ze(a,b)||Bg(b)},over:function(b){ze(a,b)||(bc(a,b),Bg(b))},start:function(b){ac(a,b)},drop:Eb(a,_b),leave:function(){cc(a)}};var h=e.input.getField();Cg(h,"keyup",function(b){nc.call(a,b)}),Cg(h,"keydown",Eb(a,lc)),Cg(h,"keypress",Eb(a,oc)),Cg(h,"focus",Le(qc,a)),Cg(h,"blur",Le(rc,a))}function Rb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?Cg:Eg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.enter),g(b.display.scroller,"dragover",f.over),g(b.display.scroller,"dragleave",f.leave),g(b.display.scroller,"drop",f.drop)}}function Sb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Tb(a,b){for(var c=ue(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ub(a,b,c,d){var e=a.display;if(!c&&"true"==ue(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=qb(a,f,g);if(d&&1==j.xRel&&(i=Yd(a.doc,j.line).text).length==j.ch){var k=Mg(i,i.length,a.options.tabSize)-i.length;j=Kf(j.line,Math.max(0,Math.round((f-Ta(a.display).left)/tb(a.display))-k))}return j}function Vb(a){var b=this,c=b.display;if(!(c.activeTouch&&c.input.supportsTouch()||ze(b,a))){if(c.shift=a.shiftKey,Tb(c,a))return void(uf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!$b(b,a)){var d=Ub(b,a);switch(window.focus(),ve(a)){case 1:b.state.selectingText?b.state.selectingText(a):d?Wb(b,a,d):ue(a)==c.scroller&&zg(a);break;case 2:uf&&(b.state.lastMiddleDown=+new Date),d&&ua(b.doc,d),setTimeout(function(){c.input.focus()},20),zg(a);break;case 3:Hf?sc(b,a):pc(b)}}}}function Wb(a,b,c){sf?setTimeout(Le(Y,a),0):a.curOp.focus=Se();var d,e=+new Date;Pf&&Pf.time>e-400&&0==Lf(Pf.pos,c)?d="triple":Of&&Of.time>e-400&&0==Lf(Of.pos,c)?(d="double",Pf={time:e,pos:c}):(d="single",Of={time:e,pos:c});var f,g=a.doc.sel,h=Df?b.metaKey:b.ctrlKey;a.options.dragDrop&&$g&&!a.isReadOnly()&&"single"==d&&(f=g.contains(c))>-1&&(Lf((f=g.ranges[f]).from(),c)<0||c.xRel>0)&&(Lf(f.to(),c)>0||c.xRel<0)?Xb(a,b,c,h):Yb(a,b,c,d,h)}function Xb(a,b,c,d){var e=a.display,f=+new Date,g=Eb(a,function(h){uf&&(e.scroller.draggable=!1),a.state.draggingText=!1,Eg(document,"mouseup",g),Eg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(zg(h),!d&&+new Date-200=o;o++){var r=Yd(j,o).text,s=Ng(r,i,f);i==n?e.push(new la(Kf(o,s),Kf(o,s))):r.length>s&&e.push(new la(Kf(o,s),Kf(o,Ng(r,n,f))))}e.length||e.push(new la(c,c)),Aa(j,ma(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new la(Kf(b.line,0),pa(j,Kf(b.line+1,0)));Lf(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new la(pa(j,u),v),Aa(j,ma(e,l),Kg)}}function g(b){var c=++s,e=Ub(a,b,!0,"rect"==d);if(e)if(0!=Lf(e,q)){a.curOp.focus=Se(),f(e);var h=u(i,j);(e.line>=h.to||e.liner.bottom?20:0;k&&setTimeout(Eb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){a.state.selectingText=!1,s=1/0,zg(b),i.input.focus(),Eg(document,"mousemove",t),Eg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;zg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new la(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new la(c,c)),c=Ub(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ta(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new la(Kf(c.line,0),pa(j,Kf(c.line+1,0)));k=a.display.shift||j.extend?ta(j,k,p.anchor,p.head):p}else k=ta(j,k,c);e?-1==l?(l=n.length,Aa(j,ma(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Aa(j,ma(n.slice(0,l).concat(n.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),m=j.sel):wa(j,l,k,Kg):(l=0,Aa(j,new ka([k],0),Kg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Eb(a,function(a){ve(a)?g(a):h(a)}),v=Eb(a,h);a.state.selectingText=v,Cg(document,"mousemove",t),Cg(document,"mouseup",v)}function Zb(a,b,c,d){try{var e=b.clientX,f=b.clientY}catch(b){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&zg(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Be(a,c))return te(b);f-=h.top-g.viewOffset;for(var i=0;i=e){var k=be(a.doc,f),l=a.options.gutters[i];return Fg(a,c,a,k,l,b),te(b)}}}function $b(a,b){return Zb(a,b,"gutterClick",!0)}function _b(a){var b=this;if(cc(b),!ze(b,a)&&!Tb(b.display,a)){zg(a),sf&&(Tf=+new Date);var c=Ub(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||-1!=Ge(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=Eb(b,function(){var a=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a=""),f[d]=a,++g==e){c=pa(b.doc,c);var i={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};zc(b.doc,i),za(b.doc,na(c,Zf(i)))}}),h.readAsText(a)}},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(Df?a.altKey:a.ctrlKey))var j=b.listSelections();if(Ba(b.doc,na(c,c)),j)for(var i=0;ig.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&Df&&uf)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;lm?n=Math.max(0,n+m-50):o=Math.min(a.doc.height,o+m+50),D(a,{top:n,bottom:o})}20>Uf&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Vf=(Vf*Uf+c)/(Uf+1),++Uf)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function gc(a,b,c){if("string"==typeof b&&(b=ig[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Ig}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function hc(a,b,c){for(var d=0;dtf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=jc(b,a);xf&&(Yf=d?c:null,!d&&88==c&&!bh&&(Df?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||mc(b)}}function mc(a){function b(a){18!=a.keyCode&&a.altKey||(Xg(c,"CodeMirror-crosshair"),Eg(document,"keyup",b),Eg(document,"mouseover",b))}var c=a.display.lineDiv;Yg(c,"CodeMirror-crosshair"),Cg(document,"keyup",b),Cg(document,"mouseover",b)}function nc(a){16==a.keyCode&&(this.doc.sel.shift=!1), ze(this,a)}function oc(a){var b=this;if(!(Tb(b.display,a)||ze(b,a)||a.ctrlKey&&!a.altKey||Df&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(xf&&c==Yf)return Yf=null,void zg(a);if(!xf||a.which&&!(a.which<10)||!jc(b,a)){var e=String.fromCharCode(null==d?c:d);kc(b,a,e)||b.display.input.onKeyPress(a)}}}function pc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,rc(a))},100)}function qc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Fg(a,"focus",a),a.state.focused=!0,Yg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),uf&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ma(a))}function rc(a){a.state.delayingBlurEvent||(a.state.focused&&(Fg(a,"blur",a),a.state.focused=!1,Xg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function sc(a,b){Tb(a.display,b)||tc(a,b)||ze(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function tc(a,b){return Be(a,"gutterContextMenu")?Zb(a,b,"gutterContextMenu",!1):!1}function uc(a,b){if(Lf(a,b.from)<0)return a;if(Lf(a,b.to)<=0)return Zf(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Zf(b).ch-b.to.ch),Kf(c,d)}function vc(a,b){for(var c=[],d=0;d=0;--e)Ac(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Ac(a,b)}}function Ac(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Lf(b.from,b.to)){var c=vc(a,b);ie(a,b,c,a.cm?a.cm.curOp.id:NaN),Dc(a,b,c,ed(a,b));var d=[];Wd(a,function(a,c){c||-1!=Ge(d,a.history)||(se(a.history,b),d.push(a.history)),Dc(a,b,null,ed(a,b))})}}function Bc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i=0;--i){var l=d.changes[i];if(l.origin=b,k&&!yc(a,l,!1))return void(g.length=0);j.push(fe(a,l));var m=i?vc(a,l):Fe(g);Dc(a,l,m,gd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Zf(l)});var n=[];Wd(a,function(a,b){b||-1!=Ge(n,a.history)||(se(a.history,l),n.push(a.history)),Dc(a,l,null,gd(a,l))})}}}}function Cc(a,b){if(0!=b&&(a.first+=b,a.sel=new ka(He(a.sel.ranges,function(a){return new la(Kf(a.anchor.line+b,a.anchor.ch),Kf(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Jb(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;da.lastLine())){if(b.from.linef&&(b={from:b.from,to:Kf(f,Yd(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Zd(a,b.from,b.to),c||(c=vc(a,b)),a.cm?Ec(a.cm,b,d):Td(a,b,d),Ba(a,c,Jg)}}function Ec(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=ae(rd(Yd(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&Ae(a),Td(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),Na(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Jb(a):g.line!=h.line||1!=b.text.length||Sd(a.doc,b)?Jb(a,g.line,h.line+1,k):Kb(a,g.line,"text");var m=Be(a,"changes"),n=Be(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&xe(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Fc(a,b,c,d,e){if(d||(d=c),Lf(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),zc(a,{from:c,to:d,text:b,origin:e})}function Gc(a,b){if(!ze(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!Af){var f=Pe("div","​",null,"position: absolute; top: "+(b.top-c.viewOffset-Ra(a.display))+"px; height: "+(b.bottom-b.top+Ua(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Hc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=nb(a,b),h=c&&c!=b?nb(a,c):g,i=Jc(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(dc(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(ec(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Ic(a,b,c,d,e){var f=Jc(a,b,c,d,e);null!=f.scrollTop&&dc(a,f.scrollTop),null!=f.scrollLeft&&ec(a,f.scrollLeft)}function Jc(a,b,c,d,e){var f=a.display,g=sb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Wa(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Sa(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Va(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Kc(a,b,c){(null!=b||null!=c)&&Mc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Lc(a){Mc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Kf(b.line,b.ch-1):b,d=Kf(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Mc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=ob(a,b.from),d=ob(a,b.to),e=Jc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Nc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Qa(a,b):c="prev");var g=a.options.tabSize,h=Yd(f,b),i=Mg(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Ig||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Mg(Yd(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Ee(j-m)),l!=k)return Fc(f,l,Kf(b,0),Kf(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n=0;b--)Fc(a.doc,"",d[b].from,d[b].to,"+delete");Lc(a)})}function Qc(a,b,c,d,e){function f(){var b=h+c;return b=a.first+a.size?l=!1:(h=b,k=Yd(a,b))}function g(a){var b=(e?lf:mf)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?df:cf)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Yd(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||g(!p);p=!1){var q=k.text.charAt(i)||"\n",r=Me(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,g());break}if(r&&(m=r),c>0&&!g(!p))break}var s=Ga(a,Kf(h,i),b,j,!0);return l||(s.hitSide=!0),s}function Rc(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*sb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=qb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Sc(b,c,d,e){a.defaults[b]=c,d&&(_f[b]=e?function(a,b,c){c!=ag&&d(a,b,c)}:d)}function Tc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Pe("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(qd(a,b.line,b,c,f)||b.line!=c.line&&qd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Jf=!0}f.addToHistory&&ie(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&rd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&_d(a,0),bd(a,new $c(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){vd(a,b)&&_d(b,0)}),f.clearOnEnter&&Cg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(If=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++og,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Jb(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Kb(j,k,"text");f.atomic&&Da(j.doc),xe(j,"markerAdded",j,f)}return f}function Wc(a,b,c,d,e){d=Ke(d),d.shared=!1;var f=[Vc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Wd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Vc(a,pa(a,b),pa(a,c),d,e));for(var i=0;i=b:f.to>b);(d||(d=[])).push(new $c(g,f.from,i?null:f.to))}}return d}function dd(a,b,c){if(a)for(var d,e=0;e=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(p);o.push(i)}return o}function fd(a){for(var b=0;b0)){var k=[i,1],l=Lf(j.from,h.from),m=Lf(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function id(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Lf(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(Lf(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function rd(a){for(var b;b=od(a);)a=b.find(-1,!0).line;return a}function sd(a){for(var b,c;b=pd(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function td(a,b){var c=Yd(a,b),d=rd(c);return c==d?b:ae(d)}function ud(a,b){if(b>a.lastLine())return b;var c,d=Yd(a,b);if(!vd(a,d))return b;for(;c=pd(d);)d=c.find(1,!0).line;return ae(d)+1}function vd(a,b){var c=Jf&&b.markedSpans;if(c)for(var d,e=0;ef;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Fd(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?gg(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=pa(g,b);var i,j=Yd(g,b.line),k=Qa(a,b.line,c),l=new ng(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.posa.options.maxHighlightLength?(h=!1,g&&Jd(a,b,d,l.pos),l.pos=b.length,i=null):i=Cd(Ed(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;jj;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Id(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Qa(a,ae(b)),e=Hd(a,b,b.text.length>a.options.maxHighlightLength?gg(a.doc.mode,d):d);b.stateAfter=d,b.styles=e.styles,e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Jd(a,b,c,d){var e=a.doc.mode,f=new ng(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&Dd(e,c);!f.eol();)Ed(e,f,c),f.start=f.pos}function Kd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?ug:tg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Ld(a,b){var c=Pe("span",null,null,uf?"padding-right: .1px":null),d={pre:Pe("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,splitSpaces:(sf||uf)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Nd,Ze(a.display.measure)&&(f=de(g))&&(d.addToken=Pd(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&ae(g);Rd(g,d,Id(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Ue(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Ue(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Ye(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return uf&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),Fg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Ue(d.pre.className,d.textClass||"")),d}function Md(a){var b=Pe("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Nd(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Od):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));sf&&9>tf?k.appendChild(Pe("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Pe("span",Ee(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else if("\r"==m[0]||"\n"==m[0]){var o=k.appendChild(Pe("span","\r"==m[0]?"␍":"␤","cm-invalidchar"));o.setAttribute("cm-text",m[0]),a.col+=1}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),sf&&9>tf?k.appendChild(Pe("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),sf&&9>tf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Pe("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Od(a){for(var b=" ",c=0;cj&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Qd(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b}function Rd(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s,t=[],u=0;uo||w.collapsed&&v.to==o&&v.from==o)?(null!=v.to&&v.to!=o&&r>v.to&&(r=v.to,j=""),w.className&&(i+=" "+w.className),w.css&&(h=(h?h+";":"")+w.css),w.startStyle&&v.from==o&&(k+=" "+w.startStyle),w.endStyle&&v.to==r&&(s||(s=[])).push(w.endStyle,v.to),w.title&&!l&&(l=w.title),w.collapsed&&(!m||md(m.marker,w)<0)&&(m=v)):v.from>o&&r>v.from&&(r=v.from)}if(s)for(var u=0;u=n)break;for(var x=Math.min(n,r);;){if(q){var y=o+q.length;if(!m){var z=y>x?q.slice(0,x-o):q;b.addToken(b,z,g?g+i:i,k,o+z.length==r?j:"",l,h)}if(y>=x){q=q.slice(x-o),o=x;break}o=y,k=""}q=e.slice(f,f=c[p++]),g=Kd(c[p++],b.cm.options)}}else for(var p=1;pc;++c)f.push(new sg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Yd(a,h.line),l=Yd(a,i.line),m=Fe(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Sd(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new sg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}xe(a,"change",a,b)}function Ud(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Zd(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function $d(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function _d(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function ae(a){if(null==a.parent)return null;for(var b=a.parent,c=Ge(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function be(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function ce(a){a=rd(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Fe(a.done)):void 0}function ie(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=he(e,e.lastOp==d))){var h=Fe(f.changes);0==Lf(b.from,b.to)&&0==Lf(b.from,h.to)?h.to=Zf(b):f.changes.push(fe(a,b))}else{var i=Fe(e.done);for(i&&i.ranges||le(a.sel,e.done),f={changes:[fe(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Fg(a,"historyAdded")}function je(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function ke(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||je(a,f,Fe(e.done),b))?e.done[e.done.length-1]=b:le(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&ge(e.undone)}function le(a,b){var c=Fe(b);c&&c.ranges&&c.equals(a)||b.push(a)}function me(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ne(a){if(!a)return null;for(var b,c=0;c-1&&(Fe(h)[l]=k[l],delete k[l])}}}return e}function qe(a,b,c,d){c0?d.slice():Dg:d||Dg}function xe(a,b){function c(a){return function(){a.apply(null,f)}}var d=we(a,b,!1);if(d.length){var e,f=Array.prototype.slice.call(arguments,2); @@ -10,4 +10,4 @@ Rf?e=Rf.delayedCallbacks:Gg?e=Gg:(e=Gg=[],setTimeout(ye,0));for(var g=0;g-1?a.backUp(d.length-e):d.match(/<\/?$/)&&(a.backUp(d.length),a.match(b,!1)||a.match(d)),c}function c(a){var b=i[a];return b?b:i[a]=new RegExp("\\s+"+a+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function d(a,b){for(var d,e=a.pos;e>=0&&"<"!==a.string.charAt(e);)e--;return 0>e?e:(d=a.string.slice(e,a.pos).match(c(b)))?d[2]:""}function e(a,b){return new RegExp((b?"^":"")+"","i")}function f(a,b){for(var c in a)for(var d=b[c]||(b[c]=[]),e=a[c],f=e.length-1;f>=0;f--)d.unshift(e[f])}function g(a,b){for(var c=0;c"===d.current()&&(h=g(m,d))){var o=a.getMode(c,h),p=e(l,!0),q=e(l,!1);f.token=function(a,c){return a.match(p,!1)?(c.token=i,c.localState=c.localMode=null,null):b(a,q,c.localMode.token(a,c.localState))},f.localMode=o,f.localState=a.startState(o,j.indent(f.htmlState,""))}return n}var j=a.getMode(c,{name:"xml",htmlMode:!0,multilineTagIndentFactor:d.multilineTagIndentFactor,multilineTagIndentPastTag:d.multilineTagIndentPastTag}),k={},l=d&&d.tags,m=d&&d.scriptTypes;if(f(h,k),l&&f(l,k),m)for(var n=m.length-1;n>=0;n--)k.script.unshift(["type",m[n].matches,m[n].mode]);return{startState:function(){var a=j.startState();return{token:i,localMode:null,localState:null,htmlState:a}},copyState:function(b){var c;return b.localState&&(c=a.copyState(b.localMode,b.localState)),{token:b.token,localMode:b.localMode,localState:c,htmlState:a.copyState(j,b.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(b,c){return!b.localMode||/^\s*<\//.test(c)?j.indent(b.htmlState,c):b.localMode.indent?b.localMode.indent(b.localState,c):a.Pass},innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||j}}}},"xml","javascript","css"),a.defineMIME("text/html","htmlmixed")}),function(a){"object"==typeof exports&&"object"==typeof module?a(b("codemirror/lib/codemirror")):"function"==typeof c&&c.amd?c("formatting",["codemirror/lib/codemirror"],a):a(CodeMirror)}(function(a){a.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(a,b){return/^[;{}]$/.test(b)}}),a.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(a,b,c,d){return this.jsonMode?/^[\[,{]$/.test(b)||/^}/.test(c):";"==b&&d.lexical&&")"==d.lexical.type?!1:/^[;{}]$/.test(b)&&!/^;/.test(c)}});var b=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;a.extendMode("xml",{commentStart:"",newlineAfterToken:function(a,c,d,e){var f=!1;return"html"==this.configuration&&(f=e.context?b.test(e.context.tagName):!1),!f&&("tag"==a&&/>$/.test(c)&&e.context||/^-1&&h>-1&&h>g&&(a=a.substr(0,g)+a.substring(g+f.commentStart.length,h)+a.substr(h+f.commentEnd.length)),e.replaceRange(a,c,d)}})}),a.defineExtension("autoIndentRange",function(a,b){var c=this;this.operation(function(){for(var d=a.line;d<=b.line;d++)c.indentLine(d,"smart")})}),a.defineExtension("autoFormatRange",function(b,c){function d(){j+="\n",l=!0,++k}for(var e=this,f=e.getMode(),g=e.getRange(b,c).split("\n"),h=a.copyState(f,e.getTokenAt(b).state),i=e.getOption("tabSize"),j="",k=0,l=0===b.ch,m=0;m=a;++a)e.indentLine(a,"smart");e.setSelection(b,e.getCursor(!1))})})}),c("CodeManager/model/CodeMirrorEditor",["backbone","codemirror/lib/codemirror","codemirror/mode/htmlmixed/htmlmixed","codemirror/mode/css/css","formatting"],function(a,b,c,d,e){return a.Model.extend({defaults:{input:"",label:"",codeName:"",theme:"",readOnly:!0,lineNumbers:!0},getId:function(){return"CodeMirror"},init:function(a){return this.editor=b.fromTextArea(a,{dragDrop:!1,lineNumbers:this.get("lineNumbers"),readOnly:this.get("readOnly"),mode:this.get("codeName"),theme:this.get("theme")}),this},setContent:function(a){this.editor&&(this.editor.setValue(a),this.editor.autoFormatRange&&(b.commands.selectAll(this.editor),this.editor.autoFormatRange(this.editor.getCursor(!0),this.editor.getCursor(!1)),b.commands.goDocStart(this.editor)))}})}),c("text!CodeManager/template/editor.html",[],function(){return'
\n
<%= label %>
\n
\n
\n'}),c("CodeManager/view/EditorView",["backbone","text!./../template/editor.html"],function(a,b){return a.View.extend({template:_.template(b),initialize:function(a){this.config=a.config||{},this.pfx=this.config.stylePrefix},render:function(){var a=this.model.toJSON();return a.pfx=this.pfx,this.$el.html(this.template(a)),this.$el.attr("class",this.pfx+"editor-c"),this.$el.find("#"+this.pfx+"code").html(this.model.get("input")),this}})}),c("CodeManager/main",["require","./config/config","./model/GeneratorInterface","./model/HtmlGenerator","./model/CssGenerator","./model/JsonGenerator","./model/EditorInterface","./model/CodeMirrorEditor","./view/EditorView"],function(a){function b(b){var c=b||{},d=a("./config/config"),e=a("./model/GeneratorInterface"),f=a("./model/HtmlGenerator"),g=a("./model/CssGenerator"),h=a("./model/JsonGenerator"),i=a("./model/EditorInterface"),j=a("./model/CodeMirrorEditor"),k=a("./view/EditorView");for(var l in d)l in c||(c[l]=d[l]);this.gi=new e,this.generators={},this.defaultGenerators={},this.currentGenerator=null,this.ei=new i,this.editors={},this.defaultEditors={},this.currentEditor=null;var m=new f,n=new g,o=new h,p=new j;this.defaultGenerators[m.getId()]=m,this.defaultGenerators[n.getId()]=n,this.defaultGenerators[o.getId()]=o,this.defaultEditors[p.getId()]=p,this.EditorView=k,this.config=c}return b.prototype={addGenerator:function(a){for(var b in this.gi)if(!a[b])return void console.warn("addGenerator: method '"+b+"' was not found");var c=a.getId();return this.generators[c]=a,this.currentGenerator||(this.currentGenerator=c),this},getGenerator:function(a){return a&&this.generators[a]&&(generator=this.generators[a]),generator?generator:null},getGenerators:function(){return this.generators},getCurrentGenerator:function(){return this.currentGenerator||this.loadDefaultGenerators(),this.getGenerator(this.currentGenerator)},setCurrentGenerator:function(a){return this.currentGenerator=a,this},loadDefaultGenerators:function(){for(var a in this.defaultGenerators)this.addGenerator(this.defaultGenerators[a]);return this},addEditor:function(a){for(var b in this.ei)if(!a[b])return void console.warn("addEditor: method '"+b+"' was not found");var c=a.getId();return this.editors[c]=a,this.currentEditor||(this.currentEditor=c),this},getEditor:function(a){return a&&this.editors[a]&&(editor=this.editors[a]),editor?editor:null},getEditors:function(){return this.editors},getCurrentEditor:function(){return this.currentEditor||this.loadDefaultEditors(),this.getEditor(this.currentEditor)},setCurrentEditor:function(a){return this.currentEditor=a,this},loadDefaultEditors:function(){for(var a in this.defaultEditors)this.addEditor(this.defaultEditors[a]);return this},getCode:function(a,b){var c=b||this.currentGenerator,d=this.generators[c];return d?d.build(a):null},updateEditor:function(a,b){a.setContent(b)}},b}),c("CodeManager",["CodeManager/main"],function(a){return a}),c("Commands/config/config",[],function(){return{ESCAPE_KEY:27,stylePrefix:"com-",defaults:[],em:null,firstCentered:!0,newFixedH:!1,minComponentH:50,minComponentW:50}}),c("Commands/view/CommandAbstract",["backbone"],function(a){return a.View.extend({initialize:function(a){this.config=a,this.editorModel=this.em=a.em||{},this.canvasId=a.canvasId||"",this.wrapperId=a.wrapperId||"wrapper",this.pfx=a.stylePrefix,this.hoverClass=this.pfx+"hover",this.badgeClass=this.pfx+"badge",this.plhClass=this.pfx+"placeholder",this.setElement(this.editorModel.get("$editor").find("#"+this.canvasId)),this.$canvas=this.$el,this.$wrapper=this.$canvas.find("#"+this.wrapperId),this.init(a)},init:function(a){},run:function(a,b){console.warn("No run method found")},stop:function(a,b){console.warn("No stop method found")}})}),c("Commands/view/SelectComponent",[],function(){return{init:function(a){_.bindAll(this,"onHover","onOut","onClick")},enable:function(){_.bindAll(this,"copyComp","pasteComp");var a=this.config.em.get("Config");this.startSelectComponent(),a.copyPaste&&(key("⌘+c, ctrl+c",this.copyComp),key("⌘+v, ctrl+v",this.pasteComp))},copyComp:function(){var a=this.editorModel.get("selectedComponent");a&&a.get("copyable")&&this.editorModel.set("clipboard",a)},pasteComp:function(){var a=this.editorModel.get("clipboard"),b=this.editorModel.get("selectedComponent");if(a&&b&&b.collection){var c=b.collection.indexOf(b),d=a.clone();b.collection.add(d,{at:c+1})}},startSelectComponent:function(){this.$el.find("*").on("mouseover",this.onHover).on("mouseout",this.onOut).on("click",this.onClick),this.selEl=this.$el.find("*")},onHover:function(a){a.stopPropagation(),$(a.target).addClass(this.hoverClass),this.attachBadge(a.target)},onOut:function(a){a.stopPropagation(),$(a.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e4,top:-1e4})},onClick:function(a){var b=$(a.target).data("model").get("stylable");(b instanceof Array||b)&&this.onSelect(a,a.target)},stopSelectComponent:function(a){this.selEl&&this.selEl.trigger("mouseout").off("mouseover mouseout click"),this.selEl=null},onSelect:function(a,b){a.stopPropagation();var c=this.editorModel.get("selectedComponent");c&&c.set("status","");var d=$(b).data("model");d&&(this.editorModel.set("selectedComponent",d),d.set("status","selected"))},clean:function(){this.$el.find("*").removeClass(this.hoverClass)},attachBadge:function(a){var b=$(a).data("model");if(b&&b.get("badgable")){this.badge||this.createBadge();var c=this.badge.outerHeight();this.updateBadgeLabel(b);var d=$(a);this.wrapper||(this.wrapper=this.$wrapper),this.wrapperTop||(this.wrapperTop=this.wrapper.offset()?this.wrapper.offset().top:0),this.wrapperLeft||(this.wrapperLeft=this.wrapper.offset()?this.wrapper.offset().left:0);var e=d.offset().top-this.wrapperTop+this.wrapper.scrollTop(),f=d.offset().left-this.wrapperLeft+this.wrapper.scrollLeft();e-c>this.wrapperTop&&(e-=c),this.badge.css({left:f,top:e})}},createBadge:function(){this.badge=$("
",{"class":this.badgeClass+" no-dots"}).appendTo(this.$wrapper)},removeBadge:function(){this.badge&&(this.badge.remove(),delete this.badge)},updateBadgeLabel:function(a){a&&this.badge.html(a.getName())},run:function(a,b){this.enable(),this.render()},stop:function(){var a=this.editorModel.get("selectedComponent");a&&a.set("status",""),this.$el.unbind(),this.removeBadge(),this.clean(),this.$el.find("*").unbind("mouseover").unbind("mouseout").unbind("click"),this.editorModel.set("selectedComponent",null),key.unbind("⌘+c, ctrl+c"),key.unbind("⌘+v, ctrl+v")}}}),c("Commands/view/SelectPosition",[],function(){return{init:function(a){_.bindAll(this,"selectingPosition","itemLeft"),this.config=a},getPositionPlaceholder:function(){return this.$plh},createPositionPlaceholder:function(){return this.$plh=$("
",{"class":this.plhClass+" no-dots"}).css({"pointer-events":"none"}).data("helper",1),this.$plh.append($("
",{"class":this.plhClass+"-int no-dots"})),this.$plh.appendTo(this.$wrapper),this.$plh},enable:function(){this.startSelectPosition()},startSelectPosition:function(){this.isPointed=!1,this.$wrapper.on("mousemove",this.selectingPosition)},stopSelectPosition:function(){this.$wrapper.off("mousemove",this.selectingPosition),this.posTargetCollection=null,this.posIndex="after"==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?$(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?$(this.cDim[this.posIndex][5]).parent():$(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},selectingPosition:function(a){this.isPointed=!0,this.wp||(this.$wp=this.$wrapper,this.wp=this.$wp[0]);var b=this.$wp.offset();this.wpT=b.top,this.wpL=b.left,this.wpScT=this.$wp.scrollTop(),this.wpScL=this.$wp.scrollLeft(),this.$plh||this.createPositionPlaceholder(),this.rY=a.pageY-this.wpT+this.wpScT,this.rX=a.pageX-this.wpL+this.wpScL,this.entered(a),this.updatePosition(this.rX,this.rY);var c=this.posIndex+":"+this.posMethod;this.lastPos&&this.lastPos==c||(this.updatePositionPlaceholder(this.posIndex,this.posMethod),this.lastPos=c)},updatePosition:function(a,b){this.posMethod="before",this.posIndex=0;for(var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;kd||f&&h>f||c&&c>e))if(j[4]){if(this.posIndex=k,h>b){this.posMethod="before";break}this.posMethod="after"}else i>b&&(f=i),g>a?(d=g,this.posMethod="before"):(c=g,this.posMethod="after"),this.posIndex=k;this.posIndex==this.cDim.length&&"after"==this.posMethod&&this.posIndex--},updatePositionPlaceholder:function(a,b){var c=0,d=0,e=0,f=0,g=2,h="px",i=5,j=this.$plh[0];if(this.cDim[a]){var k=this.cDim[a];k[4]?(e=k[3]+h,c="before"==b?k[0]-g:k[0]+k[2]-g,d=k[1],f="auto"):(e="auto",c=k[0]+g,f=k[2]-2*g+h,d="before"==b?k[1]-g:k[1]+k[3]-g)}else if(this.$targetEl){var l=this.$targetEl[0],m=this.$targetEl.offset();c=m.top-this.wpT+this.wpScT+i,d=m.left-this.wpL+this.wpScL+i,e=parseInt(l.offsetWidth)-2*i+h,f="auto"}j.style.top=c+h,j.style.left=d+h,e&&(j.style.width=e),f&&(j.style.height=f)},entered:function(a){this.outsideElem&&this.outsideElem==a.target?this.nearToBorders(a)&&a.target.parentNode!=this.wp.parentNode?this.cDim=this.getChildrenDim(a.target.parentNode):this.nearToBorders(a)||(this.cDim=this.getChildrenDim()):(this.outsideElem=a.target,this.$targetEl=$(a.target),$(this.outsideElem).on("mouseleave",this.itemLeft),this.cDim=this.getChildrenDim(),this.dimT=this.getTargetDim(a),this.nearToBorders(a)&&a.target.parentNode!=this.wp.parentNode&&(this.cDim=this.getChildrenDim(a.target.parentNode)))},nearToBorders:function(a){var b=7;if(this.dimT){var c=this.dimT;return c[2]<40&&(b=5),c[0]+b>this.rY||this.rY>c[0]+c[2]-b||c[1]+b>this.rX||this.rX>c[1]+c[3]-b?1:0}},nearToFloat:function(){var a=this.posIndex,b=this.posIsLastEl;return 0!==this.cDim.length&&(!b&&!this.cDim[a][4]||this.cDim[a-1]&&!this.cDim[a-1][4]||b&&!this.cDim[a-1][4])?1:0},getTargetDim:function(a){var b=a.target,c=$(b);return[b.offsetTop,b.offsetLeft,c.outerHeight(),c.outerWidth()]},getChildrenDim:function(a){var b=[],c=a||this.outsideElem,d=this.isInFlow,e=this;return $(c.childNodes).each(function(){var a=$(this);"#text"==this.nodeName||a.data("helper")||b.push([this.offsetTop,this.offsetLeft,a.outerHeight(),a.outerWidth(),d(e,this),this])}),b},itemLeft:function(a){$(this.outsideElem).off("mouseleave",this.itemLeft),this.outsideElem=null,this.$targetEl=null,this.lastPos=null},isInFlow:function(a,b){var c=$(b),d=-1;return c.length?c.height()",{"class":"tempComp"}).css(this.newElemOrig),this.newElem.data("helper",1),$("body").append(this.newElem),this.parentElem=this.newElem.parent(),this.targetC=this.outsideElem,$(document).mousemove(this.draw),$(document).mouseup(this.endDraw),$(document).keypress(this.rollback)},draw:function(a){this.isDragged=!0,this.updateComponentSize(a)},endDraw:function(a){$(document).off("mouseup",this.endDraw),$(document).off("mousemove",this.draw),$(document).off("keypress",this.rollback);var b={};this.isDragged&&(this.updateComponentSize(a),this.setRequirements(this.tempComponent),b=this.create(null,this.tempComponent,this.posIndex,this.posMethod)),this.getPositionPlaceholder()&&this.getPositionPlaceholder().removeClass("change-placeholder"),this.startSelectPosition(),this.removeCreationPlaceholder(),this.afterDraw(b)},create:function(a,b,c,d){var e=c||0;if(this.posTargetCollection&&this.posTargetModel.get("droppable")){this.config.firstCentered&&this.$wrapper.get(0)==this.posTargetEl.get(0)&&(b.style.margin="0 auto"),this.nearToFloat()&&(b.style["float"]="left"),this.beforeCreation(b);var f=this.posTargetCollection.add(b,{at:e,silent:!1});return this.afterCreation(f),f}console.warn("Invalid target position")},setRequirements:function(a){var b=this.config;return a.style.width.replace(/\D/g,"")",{"class":"tempComp"}).css({top:a.pageY-this.canvasTop+this.$canvas.scrollTop(),left:a.pageX-this.canvasLeft+this.$canvas.scrollLeft(),width:$(a.target).width(),height:$(a.target).height(),position:"absolute","pointer-events":"none"}).data("helper",1).appendTo(this.$el),this.startSelectPosition(),this.$el.on("mousemove",this.onMove),$(document).on("mouseup",this.endMove),$(document).on("keypress",this.rollback))},onMove:function(a){this.moved=!0;var b=a.pageY-this.canvasTop+this.$canvas.scrollTop(),c=a.pageX-this.canvasLeft+this.$canvas.scrollLeft();this.helperObj[0].style.top=b+"px",this.helperObj[0].style.left=c+"px"},endMove:function(a){this.$el.off("mousemove",this.onMove),$(document).off("mouseup",this.endMove),$(document).off("keypress",this.rollback),this.helperObj.remove(),this.removePositionPlaceholder(),this.stopSelectPosition(),this.moved&&this.move(null,this.$selectedEl,this.posIndex,this.posMethod),this.unfreezeComponent(this.$selectedEl),this.enable()},move:function(a,b,c,d){var e=c||0,f=b.data("model"),g=f.collection,h=this.posTargetCollection,i=this.posTargetModel;if(h&&i.get("droppable")){var j=h.add({css:{}},{at:e}),k=g.remove(f);h.add(k,{at:e}),h.remove(j)}else console.warn("Invalid target position")},freezeComponent:function(a){a.css({"pointer-events":"none"}),a.addClass("freezed")},unfreezeComponent:function(a){a.css({"pointer-events":"auto"}),a.removeClass("freezed")},rollback:function(a,b){var c=a.which||a.keyCode;(c==this.opt.ESCAPE_KEY||b)&&(this.moved=!1,this.endMove())},last:function(){this.placeholder.remove(),this.placeholderStart.remove(),this.helperObj.remove(),this.$el.off("mousemove",this.move),$(document).off("mouseup",this.endMove),$(document).off("keypress",this.rollback)},run:function(){this.enable()},stop:function(){this.stopSelectComponent(),this.$el.css("cursor",""),this.$el.unbind(),this.$el.removeClass(this.noSelClass)}})}),c("Commands/view/TextComponent",["backbone","./CreateComponent"],function(a,b){return _.extend({},b,{beforeDraw:function(a){a.type="text",a.style||(a.style={}),a.style.padding="10px"},afterDraw:function(a){a&&a.set&&(a.trigger("focus"),this.sender&&this.sender.set("active",!1))}})}),c("Commands/view/ExportTemplate",[],function(){return{run:function(a,b){this.sender=b,this.components=a.get("Canvas").getWrapper().get("components"),this.modal=a.get("Modal")||null,this.cm=a.get("CodeManager")||null,this.enable()},buildEditor:function(a,b,c){this.codeMirror||(this.codeMirror=this.cm.getEditor("CodeMirror"));var d=$("