/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2017 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * ___________________
 *
 *  Copyright 2012 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and may be covered by U.S. and Foreign Patents,
 * patents in process, and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2016 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property laws,
* including trade secret and or copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

define("acplugins/generic-rhp-app/js/ac-generic-rhp-app",["plugins-common/ac-plugins"],function(e){var i=e.GenericRhpApp;return i||(i=e.GenericRhpApp={}),i}),define("acplugins/generic-rhp-app/js/templates/rhp/generic-rhp-app-tool",[],function(){return'<!-- Copyright 2012 Adobe Systems Incorporated. All Rights Reserved. --><div class="rhp genericrhpapptool ui-theme theme-container"><div class="rhp genericrhpapp-content"><div class="rhp heading theme-text"><%= heading %></div><div class="rhp icon" title= "<%= icon_tooltip %>"    tabindex="0" role="button" aria-labelledby= "<%= icon_tooltip %>"></div><div class="rhp description theme-text"><%= description %></div></div><input type="button" class="rhp control-button genericrhpapp-start   theme-button theme-button-label site-catalyst" tabindex="0"    aria-labelledby="<%= start %>" value="<%= start %>" role="button"/></div>'}),define("aictools/aic",["aicx/ac-aicx"],function(e){return window.AiC=_.extend(window.AiC||{},{getBaseUrl:function(){return e.getBaseAicUrl()+"createpdf/"},getBaseUriApi:function(){return this.getBaseUrl()+"api/"},appEvents:_.extend({},Backbone.Events),init:function(e){return this.initializedPromise||(this.initializedPromise=$.Deferred()),this.appApi||!e?this.initializedPromise.promise():(this.appApi=e,AiC.appApi.done(_.bind(function(){try{var e=AiC.appApi.routerApi,i=_.map(e.getQueryParams(),function(e,i){return i+":"+e+";"}).join("");1===e.getPathname().indexOf("my_plan")&&LOG("requestType=deeplink	requestPath="+e.getPathname().substr(1)+"	requestParams="+i+"	requestHash="+AiC.appApi.routerApi.getHash().substr(1)+"	requestHost="+location.host,LOG.INFO,{logConsole:!1,logServer:!0})}catch(n){}this.initializedPromise.resolve()},this)),this.initializedPromise.promise())}}),window.AiC}),define("aictools/util/localize",["aictools/aic"],function(e){return e.Localize={htmlTrim:function(e){return e.replace(/<!--(.*?)-->\s*/,"")},htmlSanitize:function(e){function i(e){return _.isString(e)||_.isNumber(e)||_.isBoolean(e)||_.isDate(e)}var n={};if(i(e))n=this.htmlSanitizeString(e.toString());else{if(!_.isObject(e))throw"localize: invalid object: "+e.toString();_.each(e,_.bind(function(e,t){if(!i(e))throw"localize: Value for key: "+t+" is missing or invalid";n[t]=this.htmlSanitizeString(e.toString())},this))}return n},htmlSanitizeString:function(e){var i=e,n=i.indexOf("<%="),t=i.indexOf("%>");if(n>=0&&t>n)throw"Unprocessed template parameter: "+i;return i=_.escape(i)}},e.Localize}),define("acplugins/generic-rhp-app/js/nls/ui-strings",{root:!0,"xx-xx":!0,"de-de":!0,"en-gb":!0,"es-es":!0,"fr-fr":!0,"it-it":!0,"ja-jp":!0,"da-dk":!0,"fi-fi":!0,"nb-no":!0,"nl-nl":!0,"pt-br":!0,"sv-se":!0,"zh-cn":!0,"zh-tw":!0,"ko-kr":!0,"cs-cz":!0,"hu-hu":!0,"pl-pl":!0,"ru-ru":!0,"uk-ua":!0,"tr-tr":!0,"sk-sk":!0,"sl-si":!0,"bg-bg":!0}),define("acplugins/generic-rhp-app/js/nls/root/ui-strings",{GENERIC_RHP_APP_REDACT:"Redact",GENERIC_RHP_APP_TOOL_VIEW_TITLE_RHP_REDACT:"Permanently delete sensitive text, graphics, or hidden data",GENERIC_RHP_APP_ICON_TOOLTIP_REDACT:"Learn more",GENERIC_RHP_APP_START_REDACT:"Learn more",GENERIC_RHP_APP_HEADING_REDACT:"Adobe Acrobat Pro DC",GENERIC_RHP_APP_RHP_GO_URL_REDACT:"http://www.google.com",GENERIC_RHP_APP_PROTECT:"Protect",GENERIC_RHP_APP_TOOL_VIEW_TITLE_RHP_PROTECT:"Prevent others from copying, printing &amp; editing the information in PDFs",GENERIC_RHP_APP_ICON_TOOLTIP_PROTECT:"Learn more",GENERIC_RHP_APP_START_PROTECT:"Learn more",GENERIC_RHP_APP_HEADING_PROTECT:"Adobe Acrobat Pro DC",GENERIC_RHP_APP_RHP_GO_URL_PROTECT:"http://www.google.com",GENERIC_RHP_APP_OPTIMIZE:"Optimize PDF",GENERIC_RHP_APP_TOOL_VIEW_TITLE_RHP_OPTIMIZE:"Reduce PDF file size, enable fast web view, control image and font options",GENERIC_RHP_APP_ICON_TOOLTIP_OPTIMIZE:"Learn more",GENERIC_RHP_APP_START_OPTIMIZE:"Learn more",GENERIC_RHP_APP_HEADING_OPTIMIZE:"Adobe Acrobat Pro DC",GENERIC_RHP_APP_RHP_GO_URL_OPTIMIZE:"http://www.google.com"}),define("acplugins/generic-rhp-app/js/constants/generic-rhp-app-plugin-map",["i18n!acplugins/generic-rhp-app/js/nls/ui-strings"],function(e){var i={protect_rhp:{HEADING:e.GENERIC_RHP_APP_HEADING_PROTECT,VIEW_TITLE_RHP:e.GENERIC_RHP_APP_TOOL_VIEW_TITLE_RHP_PROTECT,ICON_TOOLTIP:e.GENERIC_RHP_APP_ICON_TOOLTIP_PROTECT,START:e.GENERIC_RHP_APP_START_PROTECT,ID:"ProtectPDFRdrApp",RHP_GO_URL:e.GENERIC_RHP_APP_RHP_GO_URL_PROTECT},redact_rhp:{HEADING:e.GENERIC_RHP_APP_HEADING_REDACT,VIEW_TITLE_RHP:e.GENERIC_RHP_APP_TOOL_VIEW_TITLE_RHP_REDACT,ICON_TOOLTIP:e.GENERIC_RHP_APP_ICON_TOOLTIP_REDACT,START:e.GENERIC_RHP_APP_START_REDACT,ID:"RedactPDFRdrApp",RHP_GO_URL:e.GENERIC_RHP_APP_RHP_GO_URL_REDACT},optimize_rhp:{HEADING:e.GENERIC_RHP_APP_HEADING_OPTIMIZE,VIEW_TITLE_RHP:e.GENERIC_RHP_APP_TOOL_VIEW_TITLE_RHP_OPTIMIZE,ICON_TOOLTIP:e.GENERIC_RHP_APP_ICON_TOOLTIP_OPTIMIZE,START:e.GENERIC_RHP_APP_START_OPTIMIZE,ID:"OptimizePDFRdrApp",RHP_GO_URL:e.GENERIC_RHP_APP_RHP_GO_URL_OPTIMIZE}};return i}),define("acplugins/generic-rhp-app/js/ops/plugin/starting-plugin-op",["core/ac-core","acplugins/generic-rhp-app/js/ac-generic-rhp-app","core/ops/op"],function(e,i){return i.StartingPluginOp=e.Op.extend({run:function(){return this._getResolvedPromise()}}),i.StartingPluginOp}),define("acplugins/generic-rhp-app/js/ops/full-preview-overlay/selecting-full-preview-overlay-op",["core/ac-core","acplugins/generic-rhp-app/js/ac-generic-rhp-app","core/ops/op"],function(e,i){return i.SelectingFullPreviewOverlayOp=e.Op.extend({run:function(){return e.opFactory.create("SelectingPluginOp",this.options).run("full_preview_overlay_example")}}),i.SelectingFullPreviewOverlayOp}),define("acplugins/generic-rhp-app/js/ops/op-factory",["core/ac-core","acplugins/generic-rhp-app/js/ac-generic-rhp-app","acplugins/generic-rhp-app/js/ops/plugin/starting-plugin-op","acplugins/generic-rhp-app/js/ops/full-preview-overlay/selecting-full-preview-overlay-op"],function(e,i){i.OpFactory=e.Op.extend({create:function(e,n){var t=i[e];return t?new t(n):void LOG(0,"AcGenricRhpApp.OpFactory.create: Unrecognized class: "+e)}})}),define("acplugins/generic-rhp-app/js/generic-rhp-app",["acplugins/generic-rhp-app/js/ac-generic-rhp-app","acplugins/generic-rhp-app/js/ops/op-factory"],function(e){_.extend(e,{init:function(){e.opFactory=new e.OpFactory}})}),define("acplugins/generic-rhp-app/js/plugin",["acplugins/generic-rhp-app/js/ac-generic-rhp-app","acplugins/generic-rhp-app/js/generic-rhp-app"],function(e){e.init()}),define("acplugins/generic-rhp-app/js/views/selector-view",["core/ac-core","acplugins/generic-rhp-app/js/ac-generic-rhp-app","i18n!acplugins/generic-rhp-app/js/nls/ui-strings","core/views/plugin-selector-view"],function(e,i){return i.SelectorView=e.PluginSelectorView.extend({getSelectorLabel:function(){return"generic-rhp-app"},getSelectorIconClass:function(){return"genericrhpapp-toolbar-icon"},getSiteCatalystName:function(){return"generic-rhp-app"}}),i.SelectorView}),define("acplugins/generic-rhp-app/js/plugins/rhp/generic-rhp-app-selector",["acplugins/generic-rhp-app/js/ac-generic-rhp-app","acplugins/generic-rhp-app/js/views/selector-view","acplugins/generic-rhp-app/js/generic-rhp-app"],function(e){return e.SelectorView}),define("acplugins/generic-rhp-app/js/plugins/rhp/generic-rhp-app-tool-view",["core/ac-core","files/ac-files","acplugins/generic-rhp-app/js/ac-generic-rhp-app","acplugins/generic-rhp-app/js/templates/rhp/generic-rhp-app-tool","aictools/util/localize","core/utils/sc-analytics","acplugins/generic-rhp-app/js/constants/generic-rhp-app-plugin-map","core/views/plugin-content-view","acplugins/generic-rhp-app/js/plugin","acplugins/generic-rhp-app/js/plugins/rhp/generic-rhp-app-selector"],function(e,i,n,t,p,r,o){return n.ToolView=e.PluginContentView.extend({events:{"click .genericrhpapp-start":"_onStartClick","click .icon":"_onIconClick","keydown .icon":"_onKeyDown"},initialize:function(i){e.PluginContentView.prototype.initialize.call(this,i)},template:_.template(t),_onStartClick:function(){var e=[r.TOOLS,this.getSiteCatalystName(),r.START_NOW,r.CLICKED,r.RHP,this.options.pluginInfo.ID];this.options.appApi.siteCatalystApi.logScEvent(e),this.options.appApi.rnaApi.done(_.bind(function(e){this._launchAppSsoUrl(e)},this));var i=[r.TOOLS,this.getSiteCatalystName(),r.UPSELL_STARTED,r.RHP,this.options.pluginInfo.ID];this.options.appApi.siteCatalystApi.logScEvent(i)},_onIconClick:function(){this.options.appApi.rnaApi.done(_.bind(function(e){this._launchAppSsoUrl(e)},this))},_launchAppSsoUrl:function(e){e.rnaServicesAPI.handleCloudLinkedApps(this.options.pluginInfo.ID).done(_.bind(function(i){i||this._launchAppGoUrl(e)},this))},_launchAppGoUrl:function(e){e.rnaServicesAPI.invokeMethod({methodName:"CheckToolEntitledInInstalledAcrobat",methodArgs:this.options.pluginInfo.ID}).then(_.bind(function(i){i||e.rnaServicesAPI.invokeMethod({methodName:"CheckAcrobatEntitlementForUser",methodArgs:this.options.pluginInfo.ID})},this),_.bind(function(){e.rnaServicesAPI.invokeMethod({methodName:"CheckAcrobatEntitlementForUser",methodArgs:this.options.pluginInfo.ID})},this))},setHtml:function(e){return this.$el.html(this.template(p.htmlSanitize(e))),this.$el},render:function(){this.$el;if(this.$el.addClass("genericrhpapp-rhp"),e.PluginContentView.prototype.render.call(this),!($("#genericrhpapptool").length>0)){this.setHtml({heading:this.options.pluginInfo.HEADING,description:this.options.pluginInfo.VIEW_TITLE_RHP,icon_tooltip:this.options.pluginInfo.ICON_TOOLTIP,start:this.options.pluginInfo.START}),this._renderChildViews();var i=[r.TOOLS,this.getSiteCatalystName(),r.START_NOW,r.SHOWN,r.RHP,this.options.pluginInfo.ID];this.options.appApi.siteCatalystApi.logScEvent(i)}},_onKeyDown:function(e){var i=e.keyCode,n=$(e.target),t=$.Event("click");switch(i){case 13:case 32:n.trigger(t),e.preventDefault()}},selectPlugin:function(){var e=this.options;return this.options=_.extend({},e,{pluginInfo:o[e.pluginId]}),e.appApi.displayApi.applyUIThemeStyles(this.$el).then(_.bind(function(){this.render(),this.options.appApi.displayApi.showSpinner(!1)},this)),this._startPlugin().then(_.bind(function(){return this.render(),n.opFactory.create("SelectingFullPreviewOverlayOp",_.extend({},e,{})).run()},this))},getSiteCatalystName:function(){return this.options.pluginId},_renderChildViews:function(){return void 0},_startPlugin:function(){var e=this._startingPluginPromise;return e||(e=this._startingPluginPromise=n.opFactory.create("StartingPluginOp",this.options).run()),e}}),n.ToolView});