!function(a){"use strict";var b,c,d,e,f,g={".js":[],".json":[],".css":[],".html":[]},h="function"==typeof require?require:null;return e=function(a){var b=new Error("Could not find module '"+a+"'");return b.code="MODULE_NOT_FOUND",b},f=function(a,b,c){var d,e;if("function"==typeof a[b+c])return b+c;for(d=0;e=g[c][d];++d)if("function"==typeof a[b+e])return b+e;return null},b=function(a,d,g,h,i,j){var k,l,m,n,o,p;for(g=g.split("/"),k=g.pop(),"."!==k&&".."!==k||(g.push(k),k="");null!=(l=g.shift());)if(l&&"."!==l&&(".."===l?(a=d.pop(),j=j.slice(0,j.lastIndexOf("/"))):(d.push(a),a=a[l],j+="/"+l),!a))throw e(h);if(k&&"function"!=typeof a[k]&&(p=f(a,k,".js"),p||(p=f(a,k,".json")),p||(p=f(a,k,".css")),p||(p=f(a,k,".html")),p?k=p:2!==i&&"object"==typeof a[k]&&(d.push(a),a=a[k],j+="/"+k,k="")),!k)return 1!==i&&a[":mainpath:"]?b(a,d,a[":mainpath:"],h,1,j):b(a,d,"index",h,2,j);if(!(o=a[k]))throw e(h);return o.hasOwnProperty("module")?o.module.exports:(m={},o.module=n={exports:m,id:j+"/"+k},o.call(m,m,n,c(a,d,j)),n.exports)},d=function(c,d,f,g){var i,j=f,k=f.charAt(0),l=0;if("/"===k){if(j=j.slice(1),!(c=a["/"])){if(h)return h(f);throw e(f)}g="/",d=[]}else if("."!==k){if(i=j.split("/",1)[0],!(c=a[i])){if(h)return h(f);throw e(f)}g=i,d=[],j=j.slice(i.length+1),j||(j=c[":mainpath:"],j?l=1:(j="index",l=2))}return b(c,d,j,f,l,g)},(c=function(a,b,c){return function(e){return d(a,[].concat(b),e,c)}})(a,[],"")}({workspace:{js:{admin:{"_utils.js":function(exports,module,require){eval("( function ( $ ) {\n\n\tmodule.exports = {\n\n\t\ttemplateSettings: {\n\t\t\tescape: /<#-([\\s\\S]+?)#>/g,\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /<#=([\\s\\S]+?)#>/g\n\t\t},\n\n\t\ttpl: function ( tpl_path, opt ) {\n\n\t\t\tvar _html = $( 'script#' + tpl_path.replace( /\\//g, '-' ) ).html() || '',\n\t\t\t\targs = [ _html ];\n\n\t\t\targs.push( this.templateSettings );\n\n\t\t\tif ( opt ) {\n\t\t\t\treturn _.template.apply( _, args )( opt );\n\t\t\t}\n\t\t\treturn _.template.apply( _, args );\n\t\t}\n\t};\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/_utils.js")},"collections.js":function(exports,module,require){eval("module.exports = {\n\n\tProducts: Backbone.Collection.extend( {\n\n\t\tmodel: require( './models' ).Product,\n\n\t\tbuildDependencies: function () {\n\t\t\tvar self = this;\n\n\t\t\tfunction getByTag( tag ) {\n\t\t\t\treturn self.findWhere( {tag: tag} );\n\t\t\t}\n\n\t\t\t/* build up dependencies between products */\n\t\t\tthis.each( function ( product ) {\n\t\t\t\tvar deps = product.get( 'dependencies' );\n\t\t\t\tif ( deps && deps.length ) {\n\t\t\t\t\tproduct.dependencies = deps.map( getByTag );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * reorder models so that deps come before products\n\t\t\t */\n\t\t\tthis.models.forEach( function ( model ) {\n\t\t\t\tif ( model.dependencies ) {\n\t\t\t\t\tmodel.dependencies.forEach( function ( dep ) {\n\t\t\t\t\t\tself.remove( dep );\n\t\t\t\t\t\tdep.isDependedUpon = true;\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tthis.models.forEach( function ( model, index ) {\n\t\t\t\tif ( model.dependencies ) {\n\t\t\t\t\tself.add( model.dependencies, {at: index} );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\n\t\tproduct_purchased: function () {\n\n\t\t\tvar available = this.where( {status: 'available'} );\n\n\t\t\treturn this.length - available.length;\n\t\t}\n\n\t} ),\n\n\tMessages: Backbone.Collection.extend( {\n\n\t\tinitialize: function ( args ) {\n\n\n\t\t},\n\n\t\tdisplay: function () {\n\n\t\t\tthis.each( function ( model, index, list ) {\n\n\t\t\t\tTPM.Notification[ model.get( 'status' ) ]( model.get( 'message' ) );\n\n\t\t\t}, this );\n\n\t\t}\n\t} )\n};\n//# sourceURL=workspace/js/admin/collections.js")},"index.js":function(exports,module,require){eval("( function ( $ ) {\n\n\tvar TPM = window.TPM || {};\n\tTPM.Views = TPM.Views || {};\n\tTPM.Models = TPM.Models || {};\n\tTPM.Collections = TPM.Collections || {};\n\tTPM.Modals = TPM.Modals || {};\n\n\t$.extend( TPM, require( './_utils' ) );\n\n\t$( function () {\n\n\t\tTPM.$app = $( '#tpm-app' );\n\n\t\tif ( TPM.$app.length <= 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tBackbone.emulateHTTP = true;\n\n\t\t$.extend( TPM.Views, require( './views' ) );\n\t\t$.extend( TPM.Models, require( './models' ) );\n\t\t$.extend( TPM.Collections, require( './collections' ) );\n\t\t$.extend( TPM.Modals, require( './modals' ) );\n\n\t\t//initialize notification view\n\t\tTPM.Notification = new TPM.Views.Notification();\n\n\t\tvar product_collection = new TPM.Collections.Products( TPM.products );\n\t\tproduct_collection.buildDependencies();\n\n\t\tvar messages_collection = new TPM.Collections.Messages( TPM.messages );\n\t\tmessages_collection.display();\n\n\n\t\tTPM.BottomBar = new TPM.Views.BottomBar( {\n\t\t\tcollection: product_collection\n\t\t} );\n\n\t\tTPM.ProductList = new TPM.Views.ProductList( {\n\t\t\tcollection: product_collection\n\t\t} );\n\n\t\t$( '#tpm-client-mode' ).on( 'click', function () {\n\t\t\tvar modal = new TPM.Modals.ClientMode();\n\t\t\tmodal.open();\n\t\t} );\n\n\n\t\tTPM.$app.html( TPM.ProductList.$el );\n\t\tTPM.$app.append( TPM.BottomBar.$el );\n\t} );\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/index.js")},modals:{"client-mode.js":function(exports,module,require){eval("( function ( $ ) {\n\n\n\tmodule.exports = Backbone.View.extend( {\n\n\t\ttemplate: TPM.tpl( 'modals/client-mode' ),\n\n\t\tclassName: 'tpm-modal',\n\n\t\tevents: {\n\t\t\t'click .close': 'close',\n\t\t\t'click .tpm-modal-submit': 'submit',\n\t\t\t'click .tpm-modal-cancel': 'close'\n\t\t},\n\n\t\tinitialize: function () {\n\n\t\t\tthis.render();\n\t\t},\n\n\t\trender: function () {\n\n\t\t\tthis.$el.html( this.template( {\n\t\t\t\tmodel: this.model\n\t\t\t} ) );\n\t\t},\n\n\t\tclose: function () {\n\n\t\t\tthis.remove();\n\t\t},\n\n\t\topen: function () {\n\n\t\t\tthis._get_body().append( this.$el ).addClass( 'tpm-modal-visible' );\n\t\t},\n\n\t\t_get_body: function () {\n\n\t\t\tif ( ! this.$body || this.$body.length <= 0 ) {\n\t\t\t\tthis.$body = $( 'body' );\n\t\t\t}\n\n\t\t\treturn this.$body;\n\t\t},\n\n\t\tsubmit: function () {\n\n\t\t\tthis.$( '.close' ).remove();\n\t\t\tthis.$( '.tpm-button-gray' ).remove();\n\t\t\tthis.$( '.tpm-modal-submit' )\n\t\t\t .attr( 'disabled', 'disabled' )\n\t\t\t .html( 'Loading...' ); //todo: translate this\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'post',\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'tpm_client_mode'\n\t\t\t\t},\n\t\t\t\tcomplete: function () {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t} );\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/modals/client-mode.js")}},"modals.js":function(exports,module,require){eval("(function ( $ ) {\n\n\tmodule.exports = {\n\t\tClientMode: require( './modals/client-mode' )\n\t};\n\n})( jQuery );\n//# sourceURL=workspace/js/admin/modals.js")},models:{"product.js":function(exports,module,require){eval("(function ( $ ) {\n\n\tmodule.exports = Backbone.Model.extend( {\n\n\t\tdefaults: {\n\t\t\tdescription: 'product description'\n\t\t},\n\n\t\tis_skin: function () {\n\n\t\t\treturn this.get( 'type' ) === 'skin';\n\t\t},\n\n\t\tinstall_and_activate: function ( credentials ) {\n\n\t\t\tvar model = this;\n\n\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\tmodel.set( 'status', 'installing' );\n\n\t\t\t\t$.ajax( {\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'tpm_install_and_activate_product',\n\t\t\t\t\t\tcredentials: credentials.toJSON(),\n\t\t\t\t\t\ttag: model.get( 'tag' )\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function ( response ) {\n\n\t\t\t\t\t\tif ( response.success === true ) {\n\t\t\t\t\t\t\tresolve( {\n\t\t\t\t\t\t\t\tmodel: model,\n\t\t\t\t\t\t\t\tresponse: response.data\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treject( {\n\t\t\t\t\t\t\t\tmodel: model,\n\t\t\t\t\t\t\t\tresponse: response.data\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function ( response ) {\n\t\t\t\t\t\treject( {\n\t\t\t\t\t\t\tmodel: model,\n\t\t\t\t\t\t\tresponse: response.data\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t} );\n\t\t},\n\n\t\tactivate: function () {\n\n\t\t\tvar model = this;\n\n\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\tmodel.set( 'status', 'Activating...' );\n\n\t\t\t\t$.ajax( {\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'tpm_activate_product',\n\t\t\t\t\t\ttag: model.get( 'tag' )\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function ( response ) {\n\n\t\t\t\t\t\tif ( response.success === true ) {\n\t\t\t\t\t\t\tresolve( {\n\t\t\t\t\t\t\t\tmodel: model,\n\t\t\t\t\t\t\t\tresponse: response.data\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treject( {\n\t\t\t\t\t\t\t\tmodel: model,\n\t\t\t\t\t\t\t\tresponse: response.data\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function ( response ) {\n\t\t\t\t\t\treject( {\n\t\t\t\t\t\t\tmodel: model,\n\t\t\t\t\t\t\tresponse: response.data\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t} );\n\t\t},\n\n\t\tget_status: function () {\n\n\t\t\tvar statues = {\n\t\t\t\t'to_install': 'Queued',\n\t\t\t\t'to_license': 'To be licensed',\n\t\t\t\t'installed': 'Installed',\n\t\t\t\t'installing': 'Processing',\n\t\t\t\t'failed': 'Failed',\n\t\t\t\t'activating': 'Activating',\n\t\t\t\t'activated': 'Activated',\n\t\t\t\t'to_activate': 'Queued',\n\t\t\t\t'not_installed': 'Not Installed',\n\t\t\t\t'not_activated': 'Not Activated',\n\t\t\t\t'not_licensed': 'Not Licensed',\n\t\t\t\t'ready': 'Ready to use',\n\t\t\t};\n\n\t\t\treturn statues[this.get( 'status' )] ? statues[this.get( 'status' )] : this.get( 'message' );\n\t\t},\n\n\t\t/**\n\t\t * Return if this is a product or a theme\n\t\t *\n\t\t * @returns {string}\n\t\t */\n\t\tproductOrTheme: function () {\n\t\t\treturn this.get( 'type' ) === 'plugin' ? 'Product' : 'Theme';\n\t\t}\n\t} );\n})( jQuery );\n//# sourceURL=workspace/js/admin/models/product.js")}},"models.js":function(exports,module,require){eval("module.exports = {\n\tProduct: require( './models/product' )\n};\n//# sourceURL=workspace/js/admin/models.js")},views:{"bottom-bar.js":function(exports,module,require){eval("(function ( $, wp ) {\n\n\twp = wp || {};\n\twp.updates = wp.updates || {};\n\n\tmodule.exports = Backbone.View.extend( {\n\n\t\ttemplate: TPM.tpl( 'bottom-bar' ),\n\n\t\tevents: {\n\t\t\t'click button#tpm-install': function ( event ) {\n\n\t\t\t\tvar collection = new Backbone.Collection( this.collection.where( {checked: true} ) );\n\n\t\t\t\t//if credentials are needed for filesystem\n\t\t\t\tif ( wp.updates.shouldRequestFilesystemCredentials && collection.where( {status: 'to_install'} ).length > 0 ) {\n\n\t\t\t\t\t//if credentials are available\n\t\t\t\t\tif ( wp.updates.filesystemCredentials.available ) {\n\n\t\t\t\t\t\tvar _method = event.currentTarget.dataset.fn;\n\t\t\t\t\t\tthis[_method]( this.read_credentials(), collection );\n\n\t\t\t\t\t} else { //if credentials have to be read from user\n\n\t\t\t\t\t\twp.updates.maybeRequestFilesystemCredentials( event );\n\n\t\t\t\t\t\tvar $filesystemModal = $( '#request-filesystem-credentials-dialog' );\n\n\t\t\t\t\t\t$filesystemModal.off( 'submit', 'form' ).on( 'submit', 'form', _.bind( function ( submit_event ) {\n\n\t\t\t\t\t\t\tsubmit_event.preventDefault();\n\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.ftp.hostname = $( '#hostname' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.ftp.username = $( '#username' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.ftp.password = $( '#password' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.ftp.connectionType = $( 'input[name=\"connection_type\"]:checked' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.ssh.publicKey = $( '#public_key' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.ssh.privateKey = $( '#private_key' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.fsNonce = $( '#_fs_nonce' ).val();\n\t\t\t\t\t\t\twp.updates.filesystemCredentials.available = true;\n\n\t\t\t\t\t\t\twp.updates.ajaxLocked = false;\n\n\t\t\t\t\t\t\twp.updates.requestForCredentialsModalClose();\n\n\t\t\t\t\t\t\tvar _method = event.currentTarget.dataset.fn;\n\t\t\t\t\t\t\tthis[_method]( this.read_credentials(), collection );\n\n\t\t\t\t\t\t}, this ) );\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar _method = event.currentTarget.dataset.fn;\n\t\t\t\t\tthis[_method]( this.read_credentials(), collection );\n\t\t\t\t}\n\t\t\t},\n\t\t\t'click button#tpm-back': function ( event ) {\n\t\t\t\tvar redirectTo = event.currentTarget.getAttribute( 'data-redirect' );\n\n\t\t\t\twindow.location = redirectTo ? redirectTo : TPM.tpm_url;\n\t\t\t}\n\t\t},\n\n\t\tinitialize: function () {\n\n\t\t\tthis.$el.attr( 'id', 'tpm-bottom-bar' );\n\n\t\t\tthis.$el.html( this.template() );\n\n\t\t\tthis.listenTo( this.collection, 'change:checked', this.update_button );\n\n\t\t\tthis.$action_button = this.$( '#tpm-install' ).first();\n\t\t\tthis.$back_button = this.$( '#tpm-back' ).first();\n\t\t},\n\n\t\tupdate_button: function () {\n\n\t\t\tvar selected_collection = new Backbone.Collection( this.collection.where( {checked: true} ) ),\n\t\t\t\ttotal = selected_collection.length;\n\t\t\tthis.$action_button.find( 'span' ).last().text( '(' + total + ')' );\n\n\t\t\tif ( total <= 0 ) {\n\t\t\t\tthis.$action_button.attr( 'disabled', 'disabled' );\n\t\t\t} else {\n\t\t\t\tthis.$action_button.removeAttr( 'disabled' );\n\t\t\t}\n\n\t\t\tvar _selected_statuses = _.uniq( selected_collection.pluck( 'status' ) ),\n\t\t\t\t_statuses = {\n\t\t\t\t\t'to_install': 'Install',\n\t\t\t\t\t'to_activate': 'Activate',\n\t\t\t\t\t'to_license': 'License',\n\t\t\t\t};\n\n\t\t\tvar _text = '';\n\t\t\t_text = Object.values( _selected_statuses.slice( 0, _selected_statuses.length - 1 ) ).join( ', ' );\n\n\t\t\tif ( _selected_statuses.length >= 2 ) {\n\t\t\t\t_text += ' and ';\n\t\t\t}\n\n\t\t\t_text += _selected_statuses[_selected_statuses.length - 1] || '';\n\n\t\t\tObject.keys( _statuses ).map( function ( key ) {\n\t\t\t\t_text = _text.replace( key, _statuses[key] );\n\t\t\t} );\n\n\t\t\tthis.$action_button.find( 'span' ).first().text( _text + ' selected products' );\n\t\t},\n\n\t\t/**\n\t\t * @param credentials Backbone.Model\n\t\t * @param collection Backbone.Collection\n\t\t */\n\t\tinstall: function ( credentials, collection ) {\n\n\t\t\tTPM.ProductList.remove();\n\n\t\t\tthis.product_manager = new TPM.Views.ProductManager( {\n\t\t\t\tcollection: collection,\n\t\t\t\tmodel: credentials\n\t\t\t} );\n\n\t\t\tthis.installing_button();\n\n\t\t\tthis.product_manager.install_and_activate();\n\n\t\t\tTPM.$app.prepend( this.product_manager.$el );\n\t\t},\n\n\t\tinstalling_button: function () {\n\n\t\t\tthis.$action_button\n\t\t\t .html( 'Installing products…' )\n\t\t\t .addClass( 'tpm-spin-it' )\n\t\t\t .attr( 'disabled', 'disabled' )\n\t\t\t;\n\t\t},\n\n\t\tactivating_button: function () {\n\t\t\tthis.$action_button\n\t\t\t .attr( 'disabled', 'disabled' )\n\t\t\t .html( 'Activating products… ' )\n\t\t\t .addClass( 'tpm-spin-it' );\n\t\t},\n\n\t\t/**\n\t\t * Show the button that redirects to thrive dashboard\n\t\t */\n\t\tshowThriveDashboardButton: function () {\n\t\t\tthis.$back_button\n\t\t\t .html( TPM.t.go_to_TD )\n\t\t\t .attr( 'data-redirect', TPM.tve_dash_url );\n\t\t},\n\n\t\t/**\n\t\t * Show the button to activate thrive theme builder from tpm\n\t\t */\n\t\tshowTTBActivationButton: function() {\n\t\t\tthis.toggle_back_button( false );\n\t\t\tthis.activate_button( 'Activate Thrive Theme Builder' );\n\t\t\tthis.$action_button.addClass( 'blue-button' );\n\t\t},\n\n\t\t/**\n\t\t * Show redirect to TTB dashboard button\n\t\t */\n\t\tshowTTBDashboardButton: function () {\n\t\t\tthis.$action_button.hide();\n\t\t\tthis.$back_button\n\t\t\t .html( TPM.t.go_to_TTB_dashboard )\n\t\t\t .attr( 'data-redirect', TPM.ttb_url )\n\t\t\t .show();\n\t\t},\n\n\t\tactivation_complete_button: function () {\n\t\t\tthis.$action_button\n\t\t\t .removeClass( 'tpm-spin-it' )\n\t\t\t .removeAttr( 'disabled' )\n\t\t\t .attr( 'data-fn', 'reload' )\n\t\t\t .html( 'Back to dashboard' );\n\t\t},\n\n\t\t/**\n\t\t * Show activate button\n\t\t *\n\t\t * @param {string} html\n\t\t */\n\t\tactivate_button: function ( html ) {\n\t\t\tthis.$action_button\n\t\t\t .attr( 'data-fn', 'activate' )\n\t\t\t .removeAttr( 'disabled' )\n\t\t\t .removeClass( 'tpm-spin-it' )\n\t\t\t .html( html ? html : 'Activate products' )\n\t\t\t\t.show();\n\t\t},\n\n\t\tactivate: function () {\n\n\t\t\tthis.activating_button();\n\n\t\t\tthis.product_manager.execute_activation();\n\n\t\t},\n\n\t\ttoggle_back_button: function ( display ) {\n\n\t\t\tif ( typeof display === 'undefined' ) {\n\t\t\t\tdisplay = false;\n\t\t\t}\n\n\t\t\tvar _method = display ? 'show' : 'hide';\n\n\t\t\tthis.$back_button[_method]();\n\t\t},\n\n\t\treload: function () {\n\n\t\t\treturn window.location.reload();\n\t\t},\n\n\t\t/**\n\t\t *\n\t\t * @return {{Backbone.Model}}\n\t\t */\n\t\tread_credentials: function () {\n\n\t\t\tvar credentials = _.extend( _defaults = {\n\t\t\t\tconnection_type: '',\n\t\t\t\thostname: '',\n\t\t\t\tusername: '',\n\t\t\t\tpassword: '',\n\t\t\t\t_fs_nonce: '',\n\t\t\t}, {\n\t\t\t\thostname: wp.updates.filesystemCredentials.ftp.hostname,\n\t\t\t\tusername: wp.updates.filesystemCredentials.ftp.username,\n\t\t\t\tpassword: wp.updates.filesystemCredentials.ftp.password,\n\t\t\t\tconnection_type: wp.updates.filesystemCredentials.ftp.connectionType,\n\t\t\t\tpublic_key: wp.updates.filesystemCredentials.ssh.publicKey,\n\t\t\t\tprivate_key: wp.updates.filesystemCredentials.ssh.privateKey,\n\t\t\t\t_fs_nonce: wp.updates.filesystemCredentials.fsNonce\n\t\t\t} );\n\n\t\t\treturn new Backbone.Model( credentials );\n\t\t}\n\t} );\n})( jQuery, window.wp );\n//# sourceURL=workspace/js/admin/views/bottom-bar.js")},"item-status.js":function(exports,module,require){eval("( function ( $ ) {\n\n\tmodule.exports = Backbone.View.extend( {\n\n\t\tclassName: 'tpm-status-item',\n\n\t\ttemplate: TPM.tpl( 'install/item-status' ),\n\n\t\tinitialize: function () {\n\n\t\t\tthis.listenTo( this.model, 'change', this.status_changed );\n\n\t\t\tthis.render();\n\n\t\t\tthis.$status = this.$( '.tpm-product-status' );\n\t\t\tthis.$extra = this.$( '.tpm-status-extra' );\n\t\t},\n\n\t\trender: function () {\n\n\t\t\tthis.$el.html( this.template( {model: this.model} ) );\n\t\t},\n\n\t\tstatus_changed: function () {\n\n\t\t\tthis.$status.attr( 'class', 'tpm-product-status tpm-' + this.model.get( 'status' ) );\n\n\t\t\tthis.$status.html( this.model.get_status() );\n\t\t\t/**\n\t\t\t * Extra error details\n\t\t\t */\n\t\t\tthis.$extra.html( this.model.get( 'extra' ) || '' ).attr( 'class', 'tpm-status-extra tpm-' + this.model.get( 'status' ) );\n\t\t}\n\n\t} );\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/views/item-status.js")},"notification.js":function(exports,module,require){eval("( function ( $ ) {\n\n\tmodule.exports = Backbone.View.extend( {\n\n\t\ttemplate: TPM.tpl( 'notification' ),\n\n\t\tevents: {\n\t\t\t'click #tpm-close-notification': 'hide'\n\t\t},\n\n\t\tdisplay_time: 10, //sec\n\n\t\tinitialize: function () {\n\t\t\tthis.$el.attr( 'id', 'tpm-notification-box' );\n\t\t\tthis.render();\n\t\t},\n\n\t\trender: function () {\n\n\t\t\tthis.$el.html( this.template() );\n\n\t\t\t$( 'body' ).append( this.$el );\n\t\t},\n\n\t\tsuccess: function ( message ) {\n\n\t\t\tthis.$( 'h3' ).text( 'Success!' );\n\t\t\tthis.$el.addClass( 'tpm-success' );\n\t\t\tthis.$( 'p' ).html( message );\n\n\t\t\tthis.show();\n\t\t},\n\n\t\terror: function ( message ) {\n\n\t\t\tthis.$( 'h3' ).text( 'Ooops!' );\n\t\t\tthis.$el.addClass( 'tpm-error' );\n\t\t\tthis.$( 'p' ).html( message );\n\n\t\t\tthis.show();\n\t\t},\n\n\t\twarning: function ( message ) {\n\n\t\t\tthis.$( 'h3' ).text( 'Warning' );\n\t\t\tthis.$el.addClass( 'tpm-notice' );\n\t\t\tthis.$( 'p' ).html( message );\n\n\t\t\tthis.show();\n\t\t},\n\n\t\tshow: function () {\n\n\t\t\tthis.$el.addClass( 'tpm-show' );\n\t\t\tthis.timeout = setTimeout( _.bind( this.hide, this ), this.display_time * 1000 );\n\t\t},\n\n\t\thide: function () {\n\n\t\t\tclearTimeout( this.timeout );\n\t\t\tthis.$el.removeClass( 'tpm-show tpm-error tpm-notice tpm-success' );\n\t\t}\n\t} );\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/views/notification.js")},"product-list.js":function(exports,module,require){eval("(function ( $ ) {\n\tmodule.exports = Backbone.View.extend( {\n\n\t\ttemplate: TPM.tpl( 'product/list' ),\n\n\t\t$plugins_list: null,\n\t\t$themes_list: null,\n\t\t$skins_list: null,\n\n\t\t//products typed collections\n\t\tplugins: null,\n\t\tthemes: null,\n\t\tskins: null,\n\n\t\tevents: {\n\t\t\t'change input[type=\"checkbox\"]': function ( event ) {\n\t\t\t\tvar checkbox = event.currentTarget;\n\n\t\t\t\tif ( typeof this[checkbox.dataset.fn] === 'function' ) {\n\t\t\t\t\tthis[checkbox.dataset.fn]( checkbox.dataset.args );\n\n\t\t\t\t} else if ( checkbox.dataset.type === 'plugin' || checkbox.dataset.type === 'theme' || checkbox.dataset.type === 'skin' ) {\n\n\t\t\t\t\tthis.manage_select_deselect( checkbox.dataset.type + 's' );\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * For each element with class tpm-toggle\n\t\t\t * - find a target which is set on data-toggle\n\t\t\t * - slide the target up/down based if has .tpm-hidden css class\n\t\t\t * - sets an icon based if the target is displayed or hidden\n\t\t\t *\n\t\t\t * @param event {Event}\n\t\t\t */\n\t\t\t'click .tpm-toggle': function ( event ) {\n\n\t\t\t\tvar $target = this.$( event.currentTarget.dataset.toggle );\n\t\t\t\tvar duration = 200;\n\n\t\t\t\tif ( $target.hasClass( 'tpm-hidden' ) ) {\n\t\t\t\t\t$target.slideDown( duration, function () {\n\t\t\t\t\t\t$( event.currentTarget ).find( 'span' ).last().html( '-' );\n\t\t\t\t\t} );\n\t\t\t\t\t$target.removeClass( 'tpm-hidden' );\n\n\t\t\t\t} else {\n\t\t\t\t\t$target.slideUp( duration, function () {\n\t\t\t\t\t\t$( event.currentTarget ).find( 'span' ).last().html( '+' );\n\t\t\t\t\t} );\n\t\t\t\t\t$target.addClass( 'tpm-hidden' );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tinitialize: function () {\n\n\t\t\tthis.$el.html( this.template() );\n\n\t\t\tthis.$el.attr( 'id', 'tpl-product-list' );\n\n\t\t\tthis.$plugins_list = this.$( '#tpm-plugins-list' );\n\t\t\tthis.$themes_list = this.$( '#tpm-themes-list' );\n\t\t\tthis.$skins_list = this.$( '#tpm-skins-list' );\n\n\t\t\tif ( this.collection.length <= 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.plugins = new Backbone.Collection( this.collection.where( {type: 'plugin'} ) );\n\t\t\tthis.themes = new Backbone.Collection( this.collection.where( {type: 'theme'} ) );\n\t\t\tthis.skins = new Backbone.Collection( this.collection.where( {type: 'skin'} ) );\n\n\t\t\tif ( !this.skins.length ) {\n\t\t\t\tthis.$( '#tpm-skins-wrapper' ).hide();\n\t\t\t\tthis.$( '.tpm-toggle' ).click();\n\t\t\t}\n\n\t\t\tthis.render();\n\n\t\t\tif ( this.collection.product_purchased() <= 0 ) {\n\t\t\t\tTPM.Notification.warning( \"It looks like you don't have any activations. You can manage your activations from Thrive Themes account\" );\n\t\t\t}\n\t\t},\n\n\t\tselect_all: function ( collection_name ) {\n\n\t\t\tif ( this[collection_name] instanceof Backbone.Collection ) {\n\n\t\t\t\tvar to_install = this[collection_name].filter( function ( model ) {\n\t\t\t\t\tvar _status = model.get( 'status' );\n\t\t\t\t\treturn _status !== 'ready' && _status !== 'available' && _status !== 'activated';\n\t\t\t\t} );\n\n\t\t\t\t_.each( to_install, function ( model ) {\n\t\t\t\t\tmodel.set( 'checked', true );\n\t\t\t\t} );\n\n\t\t\t\t/**\n\t\t\t\t * on select all themes do not select TTB theme which is hidden for the user to select\n\t\t\t\t */\n\t\t\t\tif ( collection_name === 'themes' ) {\n\t\t\t\t\tvar ttb = this[collection_name].findWhere( {tag: 'ttb'} );\n\t\t\t\t\tttb instanceof Backbone.Model ? ttb.attributes.checked = false : null;\n\t\t\t\t}\n\n\t\t\t\tthis.$( '#tpm-' + collection_name + '-select-all' ).prop( 'checked', true );\n\t\t\t\tthis.$( '#tpm-' + collection_name + '-deselect-all' ).prop( 'checked', false );\n\t\t\t}\n\t\t},\n\n\t\tdeselect_all: function ( collection_name ) {\n\n\t\t\tif ( this[collection_name] instanceof Backbone.Collection ) {\n\t\t\t\tthis[collection_name].each( function ( model ) {\n\t\t\t\t\tmodel.set( 'checked', false );\n\t\t\t\t} );\n\t\t\t\tthis.$( '#tpm-' + collection_name + '-deselect-all' ).prop( 'checked', true );\n\t\t\t\tthis.$( '#tpm-' + collection_name + '-select-all' ).prop( 'checked', false );\n\t\t\t}\n\t\t},\n\n\t\tmanage_select_deselect: function ( type ) {\n\n\t\t\tif ( type !== 'themes' && type !== 'plugins' && type !== 'skin' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar to_install = this[type].filter( function ( model ) {\n\t\t\t\t\tvar _status = model.get( 'status' );\n\t\t\t\t\treturn _status !== 'ready' && _status !== 'available';\n\t\t\t\t} ).length,\n\t\t\t\tchecked = this[type].where( {checked: true} ).length;\n\n\t\t\tif ( checked === 0 ) {\n\t\t\t\tthis.$( '#tpm-' + type + '-deselect-all' ).prop( 'checked', true );\n\t\t\t\tthis.$( '#tpm-' + type + '-select-all' ).prop( 'checked', false );\n\t\t\t} else if ( checked === to_install ) {\n\t\t\t\tthis.$( '#tpm-' + type + '-deselect-all' ).prop( 'checked', false );\n\t\t\t\tthis.$( '#tpm-' + type + '-select-all' ).prop( 'checked', true );\n\t\t\t} else {\n\t\t\t\tthis.$( '#tpm-' + type + '-deselect-all' ).prop( 'checked', false );\n\t\t\t\tthis.$( '#tpm-' + type + '-select-all' ).prop( 'checked', false );\n\t\t\t}\n\t\t},\n\n\t\trender: function () {\n\n\t\t\t//render plugins\n\t\t\tthis.plugins.each( function ( model ) {\n\n\t\t\t\tvar view = new TPM.Views.Product( {\n\t\t\t\t\tmodel: model\n\t\t\t\t} );\n\n\t\t\t\tthis.$plugins_list.append( view.$el );\n\t\t\t}, this );\n\n\t\t\t//render themes\n\t\t\tthis.themes.each( function ( model ) {\n\n\t\t\t\tif ( model.get( 'hidden' ) === true ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar view = new TPM.Views.Product( {\n\t\t\t\t\tmodel: model\n\t\t\t\t} );\n\n\t\t\t\tthis.$themes_list.append( view.$el );\n\t\t\t}, this );\n\n\t\t\t//render ttb\n\t\t\tvar ttbView = new TPM.Views.Product( {\n\t\t\t\tmodel: this.collection.findWhere( {tag: 'ttb'} )\n\t\t\t} );\n\t\t\tthis.$skins_list.append( ttbView.$el );\n\n\t\t\tvar _plugins = this.manage_options( 'plugins' );\n\t\t\tvar _themes = this.manage_options( 'themes' );\n\t\t\tvar _skins = this.manage_options( 'skins' );\n\n\n\t\t\t//we know all to_install plugins are to be unselected by default\n\t\t\tif ( _plugins ) {\n\t\t\t\tthis.$( '#tpm-plugins-deselect-all' ).prop( 'checked', true );\n\t\t\t}\n\n\t\t\t//we know all to_install themes are to be unselected by default\n\t\t\tif ( _themes ) {\n\t\t\t\tthis.$( '#tpm-themes-deselect-all' ).prop( 'checked', true );\n\t\t\t}\n\n\t\t\t//we know all to_install skins are to be unselected by default\n\t\t\tif ( _skins ) {\n\t\t\t\tthis.$( '#tpm-skins-deselect-all' ).prop( 'checked', true );\n\t\t\t}\n\n\t\t\tTPM.BottomBar.update_button();\n\t\t},\n\n\t\t/**\n\t\t * Hide select all and deselect all options based on type: plugins|themes\n\t\t * If they are no longer necessary hide them\n\t\t *\n\t\t * @param collection_name string and accepts only: themes or plugins\n\t\t * @throws Error\n\t\t */\n\t\tmanage_options: function ( collection_name ) {\n\n\t\t\tif ( collection_name !== 'plugins' && collection_name !== 'themes' && collection_name !== 'skins' ) {\n\t\t\t\tthrow new Error( 'Invalid type to manage options for themes|plugins' );\n\t\t\t}\n\n\t\t\tvar _items = this[collection_name].where( {status: 'ready'} ).length\n\t\t\t + this[collection_name].where( {status: 'available'} ).length\n\t\t\t + this[collection_name].where( {status: 'activated'} ).length\n\t\t\t + this[collection_name].where( {hidden: true} ).length;\n\n\t\t\t//we do not display options if there is only 1 product\n\t\t\t_items = parseInt( _items );\n\n\t\t\tif ( _items >= this[collection_name].length ) {\n\t\t\t\tthis.$( 'label[for=\"tpm-' + collection_name + '-select-all\"]' )\n\t\t\t\t .addClass( 'tpm-disabled' )\n\t\t\t\t .find( 'input' )\n\t\t\t\t .attr( 'disabled', 'disabled' )\n\t\t\t\t .prop( 'checked', false );\n\t\t\t\tthis.$( 'label[for=\"tpm-' + collection_name + '-deselect-all\"]' )\n\t\t\t\t .addClass( 'tpm-disabled' )\n\t\t\t\t .find( 'input' )\n\t\t\t\t .attr( 'disabled', 'disabled' )\n\t\t\t\t .prop( 'checked', false );\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t} );\n})( jQuery );\n//# sourceURL=workspace/js/admin/views/product-list.js")},"product-manager.js":function(exports,module,require){ eval("( function ( $ ) {\n\n\tmodule.exports = Backbone.View.extend( {\n\n\t\tclassName: 'tpm-product-manager',\n\n\t\ttemplate: TPM.tpl( 'product/product-manager' ),\n\n\t\tinitialize: function () {\n\n\t\t\tthis.render();\n\t\t},\n\n\t\trender: function () {\n\n\t\t\tthis.$el.html( this.template() );\n\t\t},\n\n\t\texecute_install: function () {\n\n\t\t\tTPM.BottomBar.toggle_back_button( false );\n\n\t\t\tvar self = this;\n\n\t\t\tvar on_success = function ( model ) {\n\t\t\t\tmodel.set( 'status', 'installed' );\n\t\t\t};\n\n\t\t\tvar on_error = function ( model ) {\n\t\t\t\tmodel.set( 'status', 'failed' );\n\t\t\t};\n\n\t\t\tthis.collection.each( function ( model, index, list ) {\n\n\t\t\t\tvar view = new TPM.Views.ItemStatus( {\n\t\t\t\t\tmodel: model\n\t\t\t\t} );\n\n\t\t\t\tthis.$el.append( view.$el );\n\n\t\t\t}, this );\n\n\t\t\tPromise.resolve().then( function () {\n\n\t\t\t\treturn self.collection.reduce( function ( chain, model ) {\n\n\t\t\t\t\treturn chain.then( function () {\n\t\t\t\t\t\t//install the model and return it's promise\n\t\t\t\t\t\treturn model.install();\n\n\t\t\t\t\t} ).then( on_success, on_error );\n\n\t\t\t\t}, Promise.resolve() );\n\n\t\t\t} ).then( function () {\n\n\t\t\t\tif ( self.collection.where( {status: 'failed'} ).length ) {\n\t\t\t\t\tTPM.Notification.warning( 'Some of the products could not be installed. Please try again!' );\n\t\t\t\t} else {\n\t\t\t\t\tTPM.Notification.success( 'The selected products were installed successfully.' );\n\t\t\t\t}\n\n\t\t\t\tself.$( 'h1' ).text( 'Activate products' );\n\t\t\t\tTPM.BottomBar.activate_button();\n\t\t\t\tTPM.BottomBar.toggle_back_button( true );\n\t\t\t} );\n\t\t},\n\n\t\tinstall_and_activate: function () {\n\n\t\t\tTPM.BottomBar.toggle_back_button( false );\n\n\t\t\tvar self = this,\n\t\t\t\tto_process_count = this.collection.length;\n\n\t\t\tvar handle_response = function ( attr ) {\n\n\t\t\t\tvar _model = attr.model && attr.model instanceof Backbone.Model ? attr.model : null,\n\t\t\t\t\t_status = attr.response && attr.response.status ? attr.response.status : null;\n\n\t\t\t\tif ( _model && _status ) {\n\t\t\t\t\t_model.set( 'status', _status );\n\t\t\t\t\t_model.set( 'message', attr.response.message );\n\t\t\t\t\t_model.set( 'extra', attr.response && attr.response.extra );\n\t\t\t\t\tif ( _model.dependencies && _model.dependencies.length ) {\n\t\t\t\t\t\t_model.dependencies.forEach( function ( product ) {\n\t\t\t\t\t\t\tproduct.set( 'status', _status );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Render status for each item\n\t\t\t */\n\t\t\tthis.collection.each( function ( model, index, list ) {\n\n\t\t\t\tvar view = new TPM.Views.ItemStatus( {\n\t\t\t\t\tmodel: model\n\t\t\t\t} );\n\n\t\t\t\tthis.$el.append( view.$el );\n\n\t\t\t}, this );\n\n\t\t\tPromise.resolve().then( function () {\n\n\t\t\t\treturn self.collection.reduce( function ( chain, model ) {\n\n\t\t\t\t\treturn chain.then( function () {\n\t\t\t\t\t\t//install and activate the model and return its promise\n\t\t\t\t\t\treturn model.install_and_activate( self.model );\n\n\t\t\t\t\t} ).then( handle_response, handle_response );\n\n\t\t\t\t}, Promise.resolve() );\n\n\t\t\t} ).then( function () {\n\t\t\t\tvar successFullProducts = self.collection.filter( function ( item ) {\n\t\t\t\t\treturn item.get( 'status' ) === 'ready' || item.get( 'status' ) === 'installed';\n\t\t\t\t} );\n\n\t\t\t\tvar readyProducts = self.collection.filter( function ( item ) {\n\t\t\t\t\treturn item.get( 'status' ) === 'ready';\n\t\t\t\t} );\n\n\t\t\t\tvar installedProducts = self.collection.filter( function ( item ) {\n\t\t\t\t\treturn item.get( 'status' ) === 'installed';\n\t\t\t\t} );\n\n\t\t\t\tif ( successFullProducts.length !== to_process_count ) {\n\t\t\t\t\tTPM.Notification.warning( 'Some of the products could not be installed and register. Please try again!' );\n\t\t\t\t} else if ( readyProducts.length === to_process_count ) { //all products were to be activate only\n\t\t\t\t\tTPM.Notification.success(\n\t\t\t\t\t\treadyProducts.length === 1\n\t\t\t\t\t\t\t? 'The selected product was activated successfully.'\n\t\t\t\t\t\t\t: 'The selected products were activated successfully.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( installedProducts.length === to_process_count ) { //all products were to be installed only\n\t\t\t\t\tTPM.Notification.success(\n\t\t\t\t\t\tinstalledProducts.length === 1\n\t\t\t\t\t\t\t? 'The selected product was installed successfully.'\n\t\t\t\t\t\t\t: 'The selected products were installed successfully.'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tTPM.Notification.success( 'The selected products were installed successfully.' );\n\t\t\t\t}\n\n\t\t\t\tTPM.BottomBar.$action_button.hide();\n\t\t\t\tTPM.BottomBar.toggle_back_button( true );\n\n\t\t\t\t/* If we have at least one product ready, show the Thrive Dashboard Button */\n\t\t\t\tif ( self.collection.where( {status: 'ready'} ).length ) {\n\t\t\t\t\tTPM.BottomBar.showThriveDashboardButton();\n\t\t\t\t}\n\n\t\t\t\t/* If the theme is installed / activated, we need to handle it separately */\n\t\t\t\tself.handleThemeButton( self.collection );\n\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Show button based on theme status\n\t\t *\n\t\t * @param collection\n\t\t */\n\t\thandleThemeButton: function ( collection ) {\n\t\t\tvar theme = collection.findWhere( {'tag': 'ttb'} );\n\n\t\t\tif ( theme ) {\n\t\t\t\tvar themeStatus = theme.get( 'status' );\n\n\t\t\t\tif ( themeStatus === 'installed' ) {\n\t\t\t\t\tTPM.BottomBar.showTTBActivationButton();\n\t\t\t\t} else if ( themeStatus === 'ready' ) {\n\t\t\t\t\tTPM.BottomBar.showTTBDashboardButton();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\texecute_activation: function () {\n\n\t\t\tTPM.BottomBar.toggle_back_button( false );\n\t\t\tvar collection = new Backbone.Collection( this.collection.where( {status: 'installed'} ) );\n\t\t\tcollection.each( function ( model ) {\n\t\t\t\tmodel.set( 'status', 'activating' );\n\t\t\t} );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'post',\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'tpm_activate_products',\n\t\t\t\t\ttags: collection.pluck( 'tag' )\n\t\t\t\t},\n\t\t\t\tsuccess: function ( result ) {\n\n\t\t\t\t\tif ( result.success !== true ) {\n\n\t\t\t\t\t\t_.each( result.data, function ( tag, index ) {\n\t\t\t\t\t\t\tvar model = collection.findWhere( {tag: tag} );\n\t\t\t\t\t\t\tif ( model instanceof Backbone.Model ) {\n\t\t\t\t\t\t\t\tmodel.set( 'status', 'failed' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\treturn TPM.Notification.error( 'Something went wrong and products could not be activated. Please try again or contact our support team!' );\n\t\t\t\t\t}\n\n\t\t\t\t\tvar all = true;\n\n\t\t\t\t\t_.each( result.data, function ( activated ) {\n\t\t\t\t\t\tif ( all === true && activated === false ) {\n\t\t\t\t\t\t\tall = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( all === true ) {\n\n\t\t\t\t\t\tcollection.each( function ( model ) {\n\t\t\t\t\t\t\tmodel.set( 'status', 'activated' );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tTPM.Notification.success( 'The selected products were activated successfully.' );\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * find out if there is a theme activated\n\t\t\t\t\t\t * so that the user is redirected to TTB dashboard when clicks on the button\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvar theme = collection.filter( function ( model ) {\n\t\t\t\t\t\t\treturn model.get( 'tag' ) === 'ttb' && model.get( 'status' ) === 'activated';\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tif ( theme.length ) {\n\t\t\t\t\t\t\tTPM.BottomBar.showTTBDashboardButton();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_.each( result.data, function ( activated, tag ) {\n\n\t\t\t\t\t\t\tvar model = collection.findWhere( {tag: tag} );\n\t\t\t\t\t\t\tif ( model instanceof Backbone.Model ) {\n\t\t\t\t\t\t\t\tmodel.set( 'status', activated === true ? 'activated' : 'failed' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tTPM.Notification.warning( 'Some products could not be activated. Please try again or contact our support team!' );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function () {\n\t\t\t\t\treturn TPM.Notification.error( 'Something went wrong. The activation request could not be made!' );\n\t\t\t\t},\n\t\t\t\tcomplete: function () {\n\t\t\t\t\tTPM.BottomBar.activation_complete_button();\n\t\t\t\t}\n\t\t\t} )\n\t\t}\n\t} );\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/views/product-manager.js")},"product.js":function(exports,module,require){eval("(function ( $ ) {\n\n\n\tmodule.exports = Backbone.View.extend( {\n\n\t\tclassName: 'tpm-product-elem',\n\n\t\ttemplate: TPM.tpl( 'product/item' ),\n\t\tskin_template: TPM.tpl( 'product/skin' ),\n\n\t\tevents: {\n\t\t\t'click input[type=\"checkbox\"]': function ( event ) {\n\t\t\t\tthis.model.set( 'checked', event.currentTarget.checked );\n\t\t\t}\n\t\t},\n\n\t\tinitialize: function () {\n\n\t\t\tthis.listenTo( this.model, 'change:checked', function ( model ) {\n\t\t\t\tthis.$( 'input[type=\"checkbox\"]' ).prop( 'checked', !! this.model.get( 'checked' ) );\n\t\t\t\tif ( model.dependencies ) {\n\t\t\t\t\tmodel.dependencies.forEach( function ( product ) {\n\t\t\t\t\t\tproduct.set( 'checked', !! model.get( 'checked' ) );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tthis.$el.attr( 'id', this.model.get( 'tag' ) );\n\n\t\t\tthis.render();\n\t\t},\n\n\t\trender: function () {\n\n\t\t\tvar template = this.model.is_skin() ? this.skin_template : this.template;\n\n\t\t\tthis.model.is_skin() ? this.$el.addClass( 'ttb-skin' ) : '';\n\n\t\t\tthis.$el.html( template( {\n\t\t\t\tmodel: this.model\n\t\t\t} ) );\n\n\t\t\tthis.render_options();\n\t\t},\n\n\t\t/**\n\t\t * appends html in product box on footer\n\t\t */\n\t\trender_footer: function ( template ) {\n\n\t\t\tvar templates = {\n\t\t\t\tavailable: TPM.tpl( 'product/status/available' ),\n\t\t\t\tactivated: TPM.tpl( 'product/status/activated' ),\n\t\t\t\tto_install: TPM.tpl( 'product/status/to_install' ),\n\t\t\t\tto_activate: TPM.tpl( 'product/status/to_activate' ),\n\t\t\t\tto_license: TPM.tpl( 'product/status/to_license' ),\n\t\t\t\tready: TPM.tpl( 'product/status/installed' )\n\t\t\t};\n\n\t\t\tif ( typeof templates[template] !== 'function' ) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\treturn templates[template]( {model: this.model} );\n\t\t},\n\n\t\trender_options: function () {\n\n\t\t\tthis.$el.append( this.render_footer( this.model.get( 'status' ) ) );\n\n\t\t\tswitch ( this.model.get( 'status' ) ) {\n\t\t\t\tcase 'available':\n\t\t\t\t\tthis.$el.addClass( 'not-purchased' );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.$el.addClass( this.model.get( 'status' ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} );\n\n})( jQuery );\n//# sourceURL=workspace/js/admin/views/product.js")}},"views.js":function(exports,module,require){eval("( function ( $ ) {\n\n\tmodule.exports = {\n\t\tProduct: require( './views/product' ),\n\t\tProductList: require( './views/product-list' ),\n\t\tProductManager: require( './views/product-manager' ),\n\t\tItemStatus: require( './views/item-status' ),\n\t\tBottomBar: require( './views/bottom-bar' ),\n\t\tNotification: require( './views/notification' )\n\t};\n\n} )( jQuery );\n//# sourceURL=workspace/js/admin/views.js")}}}}})("workspace/js/admin/index");