/************************************************************************!
*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2015-2020 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 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.
**************************************************************************/!function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=171)}({15:function(e,r){e.exports=require("child_process")},16:function(e,r){e.exports=require("fs-extra")},171:function(e,r,n){var t=n(9),o=n(16),i=n(15),a=process.argv.slice(2),l={darwin:{installPath:"/Library/Application Support/Adobe/Vulcan/specifiers/",appName:"CCLibrary.app",appFolder:"../../.."},win32:{installPath:t.join(process.env["CommonProgramFiles(x86)"]||"","Adobe","Vulcan","specifiers"),appName:"CCLibrary.exe",appFolder:".."}},s=t.resolve(l[process.platform].installPath),c="/Library/Logs/CreativeCloud/Creative Cloud Libraries";"win32"===process.platform&&(c=t.join(process.env.TEMP,"CreativeCloud","Creative Cloud Libraries"));var u=t.resolve(c,"./CCLibraryProcessInstall.log");try{o.ensureDirSync(c)}catch(e){console.error("Error with log directory permissions ",e)}function p(){console.log.apply(console,arguments);try{var e=(new Date).toString()+":"+Array.prototype.slice.call(arguments).join(" ")+n(20).EOL;o.appendFileSync(u,e,"utf-8")}catch(e){console.error("Error writing to log file",e)}}var f=Date.now(),d=function(e,r){var n=e?"Success ":`Failed with ${r}`;p(n+="("+(Date.now()-f)+"ms)"),process.exit(0)};if(process.on("unhandledRejection",(function(e,r){p("Unhandled Rejection at:",r,"reason:",e)})),process.on("uncaughtException",(function(e){p("Uncaught Exception:",e,e.stack)})),p("Version: ",global.version," Build: ","3"),process.chdir(__dirname),-1!==a.indexOf("install")){var b='<SpecifierManifest Version="1.0"><Name>cclibraries</Name><Version>1</Version><Locale></Locale><Group></Group><Path>{{path}}</Path></SpecifierManifest>'.replace("{{path}}",t.resolve(t.join(__dirname,l[process.platform].appFolder,l[process.platform].appName)));p("Installing..."),o.ensureDir(s,(function(e){e&&(p("Unable to install: ",e),d(!1,101)),o.writeFile(t.join(s,"cclibraries.xml"),b,{encoding:"utf8"},(function(e){e&&(p("Unable to install: ",e),d(!1,102));try{o.utimesSync(s,new Date,new Date)}catch(e){}}))}))}else-1!==a.indexOf("uninstall")?function(e){p("Killing CCLibrary process...");const r="darwin"===process.platform?'pkill -f ".*CCLibrary.app/Contents/MacOS/../js/server.js$"':"taskkill /f /t /im CCLibrary.exe";i.exec(r,(function(r,n,t){r?(p(`Error while killing CCLibrary process : ${r}\nstdout: ${n}\nstderr: ${t}`),e(!1)):(p(`CCLibrary process successfully killed.\nstdout ${n}\nstderr: ${t}`),e(!0))}))}((function(){-1!==a.indexOf("--update=true")&&(p("Uninstalling as part of update: no action required"),d(!0)),p("Uninstalling..."),o.unlink(t.join(s,"cclibraries.xml"),(function(e){e&&("ENOENT"===e.code?p("Vulcan specifier not installed. Nothing to remove."):(p("Unable to uninstall: ",e),d(!1,104)))}))})):-1!==a.indexOf("--test")?(p("Testing customhook OK"),d(!0)):(p("Expected to be invoked with argument: install or uninstall"),d(!1,100))},20:function(e,r){e.exports=require("os")},9:function(e,r){e.exports=require("path")}});