diff --git a/action/index.js b/action/index.js index f0778db2..eae70493 100644 --- a/action/index.js +++ b/action/index.js @@ -1 +1 @@ -module.exports=function(e,r){"use strict";var t={};function __webpack_require__(r){if(t[r]){return t[r].exports}var n=t[r]={i:r,l:false,exports:{}};e[r].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(11)}r(__webpack_require__);return startup()}({1:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};Object.defineProperty(r,"__esModule",{value:true});const a=t(129);const i=t(622);const o=t(669);const u=t(672);const s=o.promisify(a.exec);function cp(e,r,t={}){return n(this,void 0,void 0,function*(){const{force:n,recursive:a}=readCopyOptions(t);const o=(yield u.exists(r))?yield u.stat(r):null;if(o&&o.isFile()&&!n){return}const s=o&&o.isDirectory()?i.join(r,i.basename(e)):r;if(!(yield u.exists(e))){throw new Error(`no such file or directory: ${e}`)}const c=yield u.stat(e);if(c.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,s,0,n)}}else{if(i.relative(e,s)===""){throw new Error(`'${s}' and '${e}' are the same file`)}yield copyFile(e,s,n)}})}r.cp=cp;function mv(e,r,t={}){return n(this,void 0,void 0,function*(){if(yield u.exists(r)){let n=true;if(yield u.isDirectory(r)){r=i.join(r,i.basename(e));n=yield u.exists(r)}if(n){if(t.force==null||t.force){yield rmRF(r)}else{throw new Error("Destination already exists")}}}yield mkdirP(i.dirname(r));yield u.rename(e,r)})}r.mv=mv;function rmRF(e){return n(this,void 0,void 0,function*(){if(u.IS_WINDOWS){try{if(yield u.isDirectory(e,true)){yield s(`rd /s /q "${e}"`)}else{yield s(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield u.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let r=false;try{r=yield u.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(r){yield s(`rm -rf "${e}"`)}else{yield u.unlink(e)}}})}r.rmRF=rmRF;function mkdirP(e){return n(this,void 0,void 0,function*(){yield u.mkdirP(e)})}r.mkdirP=mkdirP;function which(e,r){return n(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(r){const r=yield which(e,false);if(!r){if(u.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{const r=[];if(u.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(i.delimiter)){if(e){r.push(e)}}}if(u.isRooted(e)){const t=yield u.tryGetExecutablePath(e,r);if(t){return t}return""}if(e.includes("/")||u.IS_WINDOWS&&e.includes("\\")){return""}const t=[];if(process.env.PATH){for(const e of process.env.PATH.split(i.delimiter)){if(e){t.push(e)}}}for(const n of t){const t=yield u.tryGetExecutablePath(n+i.sep+e,r);if(t){return t}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}r.which=which;function readCopyOptions(e){const r=e.force==null?true:e.force;const t=Boolean(e.recursive);return{force:r,recursive:t}}function cpDirRecursive(e,r,t,a){return n(this,void 0,void 0,function*(){if(t>=255)return;t++;yield mkdirP(r);const n=yield u.readdir(e);for(const i of n){const n=`${e}/${i}`;const o=`${r}/${i}`;const s=yield u.lstat(n);if(s.isDirectory()){yield cpDirRecursive(n,o,t,a)}else{yield copyFile(n,o,a)}}yield u.chmod(r,(yield u.stat(e)).mode)})}function copyFile(e,r,t){return n(this,void 0,void 0,function*(){if((yield u.lstat(e)).isSymbolicLink()){try{yield u.lstat(r);yield u.unlink(r)}catch(e){if(e.code==="EPERM"){yield u.chmod(r,"0666");yield u.unlink(r)}}const t=yield u.readlink(e);yield u.symlink(t,r,u.IS_WINDOWS?"junction":null)}else if(!(yield u.exists(r))||t){yield u.copyFile(e,r)}})}},9:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};Object.defineProperty(r,"__esModule",{value:true});const a=t(87);const i=t(614);const o=t(129);const u=t(622);const s=t(1);const c=t(672);const f=process.platform==="win32";class ToolRunner extends i.EventEmitter{constructor(e,r,t){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=r||[];this.options=t||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,r){const t=this._getSpawnFileName();const n=this._getSpawnArgs(e);let a=r?"":"[command]";if(f){if(this._isCmdFile()){a+=t;for(const e of n){a+=` ${e}`}}else if(e.windowsVerbatimArguments){a+=`"${t}"`;for(const e of n){a+=` ${e}`}}else{a+=this._windowsQuoteCmdArg(t);for(const e of n){a+=` ${this._windowsQuoteCmdArg(e)}`}}}else{a+=t;for(const e of n){a+=` ${e}`}}return a}_processLineBuffer(e,r,t){try{let n=r+e.toString();let i=n.indexOf(a.EOL);while(i>-1){const e=n.substring(0,i);t(e);n=n.substring(i+a.EOL.length);i=n.indexOf(a.EOL)}r=n}catch(e){this._debug(`error processing line. Failed with error ${e}`)}}_getSpawnFileName(){if(f){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(f){if(this._isCmdFile()){let r=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const t of this.args){r+=" ";r+=e.windowsVerbatimArguments?t:this._windowsQuoteCmdArg(t)}r+='"';return[r]}}return this.args}_endsWith(e,r){return e.endsWith(r)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const r=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let t=false;for(const n of e){if(r.some(e=>e===n)){t=true;break}}if(!t){return e}let n='"';let a=true;for(let r=e.length;r>0;r--){n+=e[r-1];if(a&&e[r-1]==="\\"){n+="\\"}else if(e[r-1]==='"'){a=true;n+='"'}else{a=false}}n+='"';return n.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let r='"';let t=true;for(let n=e.length;n>0;n--){r+=e[n-1];if(t&&e[n-1]==="\\"){r+="\\"}else if(e[n-1]==='"'){t=true;r+="\\"}else{t=false}}r+='"';return r.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const r={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};r.outStream=e.outStream||process.stdout;r.errStream=e.errStream||process.stderr;return r}_getSpawnOptions(e,r){e=e||{};const t={};t.cwd=e.cwd;t.env=e.env;t["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){t.argv0=`"${r}"`}return t}exec(){return n(this,void 0,void 0,function*(){if(!c.isRooted(this.toolPath)&&(this.toolPath.includes("/")||f&&this.toolPath.includes("\\"))){this.toolPath=u.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield s.which(this.toolPath,true);return new Promise((e,r)=>{this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const t=this._cloneExecOptions(this.options);if(!t.silent&&t.outStream){t.outStream.write(this._getCommandString(t)+a.EOL)}const n=new ExecState(t,this.toolPath);n.on("debug",e=>{this._debug(e)});const i=this._getSpawnFileName();const u=o.spawn(i,this._getSpawnArgs(t),this._getSpawnOptions(this.options,i));const s="";if(u.stdout){u.stdout.on("data",e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!t.silent&&t.outStream){t.outStream.write(e)}this._processLineBuffer(e,s,e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}})})}const c="";if(u.stderr){u.stderr.on("data",e=>{n.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!t.silent&&t.errStream&&t.outStream){const r=t.failOnStdErr?t.errStream:t.outStream;r.write(e)}this._processLineBuffer(e,c,e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}})})}u.on("error",e=>{n.processError=e.message;n.processExited=true;n.processClosed=true;n.CheckComplete()});u.on("exit",e=>{n.processExitCode=e;n.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);n.CheckComplete()});u.on("close",e=>{n.processExitCode=e;n.processExited=true;n.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);n.CheckComplete()});n.on("done",(t,n)=>{if(s.length>0){this.emit("stdline",s)}if(c.length>0){this.emit("errline",c)}u.removeAllListeners();if(t){r(t)}else{e(n)}})})})}}r.ToolRunner=ToolRunner;function argStringToArray(e){const r=[];let t=false;let n=false;let a="";function append(e){if(n&&e!=='"'){a+="\\"}a+=e;n=false}for(let i=0;i0){r.push(a);a=""}continue}append(o)}if(a.length>0){r.push(a.trim())}return r}r.argStringToArray=argStringToArray;class ExecState extends i.EventEmitter{constructor(e,r){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!r){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=r;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const r=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(r)}e._setResult()}}},11:function(e,r,t){"use strict";t.r(r);var n=t(622);var a=t.n(n);class action_Action{static get supportedPlatforms(){return["linux"]}static get isRunningLocally(){return process.env.RUNNER_WORKSPACE===undefined}static get isRunningFromSource(){return a().basename(__dirname)==="model"}static get name(){return"unity-builder"}static get rootFolder(){if(action_Action.isRunningFromSource){return a().dirname(a().dirname(a().dirname(__filename)))}return a().dirname(a().dirname(__filename))}static get actionFolder(){return`${action_Action.rootFolder}/action`}static get dockerfile(){return`${action_Action.actionFolder}/Dockerfile`}static get workspace(){return process.env.GITHUB_WORKSPACE}static checkCompatibility(){const e=process.platform;if(!action_Action.supportedPlatforms.includes(e)){throw new Error(`Currently ${e}-platform is not supported`)}}}var i=action_Action;class Platform{static get default(){return Platform.types.StandaloneWindows64}static get types(){return{StandaloneOSX:"StandaloneOSX",StandaloneWindows:"StandaloneWindows",StandaloneWindows64:"StandaloneWindows64",StandaloneLinux64:"StandaloneLinux64",iOS:"iOS",Android:"Android",WebGL:"WebGL",WSAPlayer:"WSAPlayer",PS4:"PS4",XboxOne:"XboxOne",tvOS:"tvOS",Switch:"Switch",Lumin:"Lumin",BJM:"BJM",Stadia:"Stadia",Facebook:"Facebook",NoTarget:"NoTarget",Test:"Test"}}static isWindows(e){switch(e){case Platform.types.StandaloneWindows:case Platform.types.StandaloneWindows64:return true;default:return false}}static isAndroid(e){switch(e){case Platform.types.Android:return true;default:return false}}}var o=Platform;class build_parameters_BuildParameters{static create(e){const{version:r,targetPlatform:t,projectPath:n,buildName:a,buildsPath:i,buildMethod:o,buildVersion:u,customParameters:s}=e;return{version:r,platform:t,projectPath:n,buildName:a,buildPath:`${i}/${t}`,buildFile:this.parseBuildFile(a,t),buildMethod:o,buildVersion:u,customParameters:s}}static parseBuildFile(e,r){if(o.isWindows(r)){return`${e}.exe`}if(o.isAndroid(r)){return`${e}.apk`}return e}}var u=build_parameters_BuildParameters;var s=t(747);var c=t.n(s);class Unity{static get libraryFolder(){return"Library"}}var f=Unity;var l=t(470);var v=t(986);class NotImplementedException extends Error{constructor(e){super(e);this.name="NotImplementedException"}}var d=NotImplementedException;class ValidationError extends Error{constructor(e){super(e);this.name="ValidationError"}}var p=ValidationError;class system_System{static async run(e,r,t){let n="";let a="";const i={stdout:e=>{n+=e.toString()},stderr:e=>{a+=e.toString()}};const o=await Object(v.exec)(e,r,{...t,listeners:i});if(o!==0){throw new Error(a)}return n}}var h=system_System;class versioning_Versioning{static get strategies(){return{None:"None",Semantic:"Semantic",Tag:"Tag",Custom:"Custom"}}static get branch(){return this.headRef||this.ref.slice(11)}static get headRef(){return process.env.GITHUB_HEAD_REF}static get ref(){return process.env.GITHUB_REF}static get descriptionRegex(){return/^v([\d.]+)-(\d+)-g(\w+)-?(\w+)*/g}static async determineVersion(e,r){if(!Object.hasOwnProperty.call(this.strategies,e)){throw new p(`Versioning strategy should be one of ${Object.values(this.strategies).join(", ")}.`)}let t;switch(e){case this.strategies.None:t="none";break;case this.strategies.Custom:t=r;break;case this.strategies.Semantic:t=await this.generateSemanticVersion();break;case this.strategies.Tag:t=await this.generateTagVersion();break;default:throw new d(`Strategy ${e} is not implemented.`)}return t}static async generateSemanticVersion(){await this.fetchAll();if(await this.isDirty()){throw new Error("Branch is dirty. Refusing to base semantic version on uncommitted changes")}if(!await this.hasAnyVersionTags()){const e=`0.0.${await this.getTotalNumberOfCommits()}`;Object(l.info)(`Generated version ${e} (no version tags found).`);return e}const{tag:e,commits:r,hash:t}=await this.parseSemanticVersion();Object(l.info)(`Found semantic version ${e}.${r} for ${this.branch}@${t}`);return`${e}.${r}`}static async generateTagVersion(){let e=await this.getTag();if(e.charAt(0)==="v"){e=e.slice(1)}return e}static async parseSemanticVersion(){const e=await this.getVersionDescription();const[r,t,n,a]=this.descriptionRegex.exec(e);if(!r){throw new Error(`Failed to parse git describe output: "${e}"`)}return{match:r,tag:t,commits:n,hash:a}}static async fetchAll(){await Object(v.exec)("git",["fetch","--all"])}static async getVersionDescription(){return h.run("git",["describe","--long","--tags","--always",`origin/${this.branch}`])}static async isDirty(){const e=await h.run("git",["status","--porcelain"]);return e!==""}static async getTag(){return h.run("git",["tag","--points-at","HEAD"])}static async hasAnyVersionTags(){const e=await h.run("git",["tag","--list","--merged","HEAD","|","grep v[0-9]*","|","wc -l"]);return e!=="0"}static async getTotalNumberOfCommits(){const e=await h.run("git",["rev-list","--count","HEAD"]);return parseInt(e,10)}}const y=t(470);class input_Input{static async getFromUser(){const e=y.getInput("unityVersion");const r=y.getInput("targetPlatform")||o.default;const t=y.getInput("projectPath")||".";const n=y.getInput("buildName")||r;const a=y.getInput("buildsPath")||"build";const i=y.getInput("buildMethod");const u=y.getInput("versioning")||"Semantic";const s=y.getInput("version")||"";const c=y.getInput("customParameters")||"";const f=t.replace(/\/$/,"");const l=await versioning_Versioning.determineVersion(u,s);return{version:e,targetPlatform:r,projectPath:f,buildName:n,buildsPath:a,buildMethod:i,buildVersion:l,customParameters:c}}}var g=input_Input;class project_Project{static get relativePath(){const e=g.getFromUser().then(e=>e.projectPath);return`${e}`}static get absolutePath(){const{workspace:e}=i;return`${e}/${this.relativePath}`}static get libraryFolder(){return`${this.relativePath}/${f.libraryFolder}`}}var b=project_Project;class cache_Cache{static verify(){if(!c().existsSync(b.libraryFolder)){this.notifyAboutCachingPossibility()}}static notifyAboutCachingPossibility(){if(i.isRunningLocally){return}console.log(`\n Library folder does not exist.\n Consider setting up caching to speed up your workflow\n If this is not your first build.`)}}var m=cache_Cache;var _=typeof global=="object"&&global&&global.Object===Object&&global;var w=_;var x=typeof self=="object"&&self&&self.Object===Object&&self;var S=w||x||Function("return this")();var O=S;var j=O.Symbol;var I=j;var A=Object.prototype;var E=A.hasOwnProperty;var k=A.toString;var P=I?I.toStringTag:undefined;function getRawTag(e){var r=E.call(e,P),t=e[P];try{e[P]=undefined;var n=true}catch(e){}var a=k.call(e);if(n){if(r){e[P]=t}else{delete e[P]}}return a}var C=getRawTag;var R=Object.prototype;var W=R.toString;function objectToString(e){return W.call(e)}var T=objectToString;var M="[object Null]",B="[object Undefined]";var D=I?I.toStringTag:undefined;function baseGetTag(e){if(e==null){return e===undefined?B:M}return D&&D in Object(e)?C(e):T(e)}var L=baseGetTag;function isObjectLike(e){return e!=null&&typeof e=="object"}var F=isObjectLike;var N="[object Symbol]";function isSymbol(e){return typeof e=="symbol"||F(e)&&L(e)==N}var $=isSymbol;var U=0/0;function baseToNumber(e){if(typeof e=="number"){return e}if($(e)){return U}return+e}var z=baseToNumber;function arrayMap(e,r){var t=-1,n=e==null?0:e.length,a=Array(n);while(++t0){if(++r>=mr){return arguments[0]}}else{r=0}return e.apply(undefined,arguments)}}var xr=shortOut;var Sr=xr(Ue);var Or=Sr;var jr=/\{\n\/\* \[wrapped with (.+)\] \*/,Ir=/,? & /;function getWrapDetails(e){var r=e.match(jr);return r?r[1].split(Ir):[]}var Ar=getWrapDetails;var Er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function insertWrapDetails(e,r){var t=r.length;if(!t){return e}var n=t-1;r[n]=(t>1?"& ":"")+r[n];r=r.join(t>2?", ":" ");return e.replace(Er,"{\n/* [wrapped with "+r+"] */\n")}var kr=insertWrapDetails;function constant(e){return function(){return e}}var Pr=constant;var Cr=function(){try{var e=Be(Object,"defineProperty");e({},"",{});return e}catch(e){}}();var Rr=Cr;var Wr=!Rr?pe:function(e,r){return Rr(e,"toString",{configurable:true,enumerable:false,value:Pr(r),writable:true})};var Tr=Wr;var Mr=xr(Tr);var Br=Mr;function arrayEach(e,r){var t=-1,n=e==null?0:e.length;while(++t-1}var Ur=arrayIncludes;var zr=1,qr=2,Hr=8,Vr=16,Gr=32,Kr=64,Zr=128,Xr=256,Yr=512;var Jr=[["ary",Zr],["bind",zr],["bindKey",qr],["curry",Hr],["curryRight",Vr],["flip",Yr],["partial",Gr],["partialRight",Kr],["rearg",Xr]];function updateWrapDetails(e,r){Dr(Jr,function(t){var n="_."+t[0];if(r&t[1]&&!Ur(e,n)){e.push(n)}});return e.sort()}var Qr=updateWrapDetails;function setWrapToString(e,r,t){var n=r+"";return Br(e,kr(n,Qr(Ar(n),t)))}var et=setWrapToString;var rt=1,tt=2,nt=4,at=8,it=32,ot=64;function createRecurry(e,r,t,n,a,i,o,u,s,c){var f=r&at,l=f?o:undefined,v=f?undefined:o,d=f?i:undefined,p=f?undefined:i;r|=f?it:ot;r&=~(f?ot:it);if(!(r&nt)){r&=~(rt|tt)}var h=[e,r,a,d,l,p,v,u,s,c];var y=t.apply(undefined,h);if(br(e)){Or(y,h)}y.placeholder=n;return et(y,e,r)}var ut=createRecurry;function getHolder(e){var r=e;return r.placeholder}var st=getHolder;var ct=9007199254740991;var ft=/^(?:0|[1-9]\d*)$/;function isIndex(e,r){var t=typeof e;r=r==null?ct:r;return!!r&&(t=="number"||t!="symbol"&&ft.test(e))&&(e>-1&&e%1==0&&e1){g.reverse()}if(f&&s-1&&e%1==0&&e<=rn}var tn=isLength;function isArrayLike(e){return e!=null&&tn(e.length)&&!me(e)}var nn=isArrayLike;function isIterateeCall(e,r,t){if(!ee(t)){return false}var n=typeof r;if(n=="number"?nn(t)&<(r,t.length):n=="string"&&r in t){return Gt(t[r],e)}return false}var an=isIterateeCall;function createAssigner(e){return en(function(r,t){var n=-1,a=t.length,i=a>1?t[a-1]:undefined,o=a>2?t[2]:undefined;i=e.length>3&&typeof i=="function"?(a--,i):undefined;if(o&&an(t[0],t[1],o)){i=a<3?undefined:i;a=1}r=Object(r);while(++n-1}var ri=listCacheHas;function listCacheSet(e,r){var t=this.__data__,n=Xa(t,e);if(n<0){++this.size;t.push([e,r])}else{t[n][1]=r}return this}var ti=listCacheSet;function ListCache(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r0&&t(u)){if(r>1){baseFlatten(u,r-1,t,n,a)}else{ki(a,u)}}else if(!n){a[a.length]=u}}return a}var Ri=baseFlatten;function flatten(e){var r=e==null?0:e.length;return r?Ri(e,1):[]}var Wi=flatten;function flatRest(e){return Br(Qt(e,undefined,Wi),e+"")}var Ti=flatRest;var Mi=Ti(Ei);var Bi=Mi;var Di=fa(Object.getPrototypeOf,Object);var Li=Di;var Fi="[object Object]";var Ni=Function.prototype,$i=Object.prototype;var Ui=Ni.toString;var zi=$i.hasOwnProperty;var qi=Ui.call(Object);function isPlainObject(e){if(!F(e)||L(e)!=Fi){return false}var r=Li(e);if(r===null){return true}var t=zi.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Ui.call(t)==qi}var Hi=isPlainObject;var Vi="[object DOMException]",Gi="[object Error]";function isError(e){if(!F(e)){return false}var r=L(e);return r==Gi||r==Vi||typeof e.message=="string"&&typeof e.name=="string"&&!Hi(e)}var Ki=isError;var Zi=en(function(e,r){try{return Ze(e,undefined,r)}catch(e){return Ki(e)?e:new Error(e)}});var Xi=Zi;var Yi="Expected a function";function before(e,r){var t;if(typeof r!="function"){throw new TypeError(Yi)}e=le(e);return function(){if(--e>0){t=r.apply(this,arguments)}if(e<=1){r=undefined}return t}}var Ji=before;var Qi=1,eo=32;var ro=en(function(e,r,t){var n=Qi;if(t.length){var a=ht(t,st(ro));n|=eo}return zt(e,n,r,t,a)});ro.placeholder={};var to=ro;var no=Ti(function(e,r){Dr(r,function(r){r=ji(r);Vt(e,r,to(e[r],e))});return e});var ao=no;var io=1,oo=2,uo=32;var so=en(function(e,r,t){var n=io|oo;if(t.length){var a=ht(t,st(so));n|=uo}return zt(r,n,e,t,a)});so.placeholder={};var co=so;function baseSlice(e,r,t){var n=-1,a=e.length;if(r<0){r=-r>a?0:a+r}t=t>a?a:t;if(t<0){t+=a}a=r>t?0:t-r>>>0;r>>>=0;var i=Array(a);while(++n=n?e:fo(e,r,t)}var lo=castSlice;var vo="\\ud800-\\udfff",po="\\u0300-\\u036f",ho="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",go=po+ho+yo,bo="\\ufe0e\\ufe0f";var mo="\\u200d";var _o=RegExp("["+mo+vo+go+bo+"]");function hasUnicode(e){return _o.test(e)}var wo=hasUnicode;function asciiToArray(e){return e.split("")}var xo=asciiToArray;var So="\\ud800-\\udfff",Oo="\\u0300-\\u036f",jo="\\ufe20-\\ufe2f",Io="\\u20d0-\\u20ff",Ao=Oo+jo+Io,Eo="\\ufe0e\\ufe0f";var ko="["+So+"]",Po="["+Ao+"]",Co="\\ud83c[\\udffb-\\udfff]",Ro="(?:"+Po+"|"+Co+")",Wo="[^"+So+"]",To="(?:\\ud83c[\\udde6-\\uddff]){2}",Mo="[\\ud800-\\udbff][\\udc00-\\udfff]",Bo="\\u200d";var Do=Ro+"?",Lo="["+Eo+"]?",Fo="(?:"+Bo+"(?:"+[Wo,To,Mo].join("|")+")"+Lo+Do+")*",No=Lo+Do+Fo,$o="(?:"+[Wo+Po+"?",Po,To,Mo,ko].join("|")+")";var Uo=RegExp(Co+"(?="+Co+")|"+$o+No,"g");function unicodeToArray(e){return e.match(Uo)||[]}var zo=unicodeToArray;function stringToArray(e){return wo(e)?zo(e):xo(e)}var qo=stringToArray;function createCaseFirst(e){return function(r){r=xi(r);var t=wo(r)?qo(r):undefined;var n=t?t[0]:r.charAt(0);var a=t?lo(t,1).join(""):r.slice(1);return n[e]()+a}}var Ho=createCaseFirst;var Vo=Ho("toUpperCase");var Go=Vo;function capitalize(e){return Go(xi(e).toLowerCase())}var Ko=capitalize;function arrayReduce(e,r,t,n){var a=-1,i=e==null?0:e.length;if(n&&i){t=e[++a]}while(++a=r?e:r}}return e}var hs=baseClamp;function clamp(e,r,t){if(t===undefined){t=r;r=undefined}if(t!==undefined){t=ue(t);t=t===t?t:0}if(r!==undefined){r=ue(r);r=r===r?r:0}return hs(ue(e),r,t)}var ys=clamp;function stackClear(){this.__data__=new ni;this.size=0}var gs=stackClear;function stackDelete(e){var r=this.__data__,t=r["delete"](e);this.size=r.size;return t}var bs=stackDelete;function stackGet(e){return this.__data__.get(e)}var ms=stackGet;function stackHas(e){return this.__data__.has(e)}var _s=stackHas;var ws=200;function stackSet(e,r){var t=this.__data__;if(t instanceof ni){var n=t.__data__;if(!ii||n.lengthu)){return false}var c=i.get(e);if(c&&i.get(r)){return c==r}var f=-1,l=true,v=t&el?new Xf:undefined;i.set(e,r);i.set(r,e);while(++f=r||t<0||l&&n>=i}function timerExpired(){var e=xv();if(shouldInvoke(e)){return trailingEdge(e)}u=setTimeout(timerExpired,remainingWait(e))}function trailingEdge(e){u=undefined;if(v&&n){return invokeFunc(e)}n=a=undefined;return o}function cancel(){if(u!==undefined){clearTimeout(u)}c=0;n=s=a=u=undefined}function flush(){return u===undefined?o:trailingEdge(xv())}function debounced(){var e=xv(),t=shouldInvoke(e);n=arguments;a=this;s=e;if(t){if(u===undefined){return leadingEdge(s)}if(l){clearTimeout(u);u=setTimeout(timerExpired,r);return invokeFunc(s)}}if(u===undefined){u=setTimeout(timerExpired,r)}return o}debounced.cancel=cancel;debounced.flush=flush;return debounced}var Iv=debounce;function defaultTo(e,r){return e==null||e!==e?r:e}var Av=defaultTo;var Ev=Object.prototype;var kv=Ev.hasOwnProperty;var Pv=en(function(e,r){e=Object(e);var t=-1;var n=r.length;var a=n>2?r[2]:undefined;if(a&&an(r[0],r[1],a)){n=1}while(++t=Xv){i=Jf;o=false;r=new Xf(r)}e:while(++a=0&&e.slice(t,a)==r}var wd=endsWith;function baseToPairs(e,r){return q(r,function(r){return[r,e[r]]})}var xd=baseToPairs;function setToPairs(e){var r=-1,t=Array(e.size);e.forEach(function(e){t[++r]=[e,e]});return t}var Sd=setToPairs;var Od="[object Map]",jd="[object Set]";function createToPairs(e){return function(r){var t=lc(r);if(t==Od){return tl(r)}if(t==jd){return Sd(r)}return xd(r,e(r))}}var Id=createToPairs;var Ad=Id(ya);var Ed=Ad;var kd=Id(ja);var Pd=kd;var Cd={"&":"&","<":"<",">":">",'"':""","'":"'"};var Rd=Xo(Cd);var Wd=Rd;var Td=/[&<>"']/g,Md=RegExp(Td.source);function escape_escape(e){e=xi(e);return e&&Md.test(e)?e.replace(Td,Wd):e}var Bd=escape_escape;var Dd=/[\\^$.*+?()[\]{}|]/g,Ld=RegExp(Dd.source);function escapeRegExp(e){e=xi(e);return e&&Ld.test(e)?e.replace(Dd,"\\$&"):e}var Fd=escapeRegExp;function arrayEvery(e,r){var t=-1,n=e==null?0:e.length;while(++ta?0:a+t}n=n===undefined||n>a?a:le(n);if(n<0){n+=a}n=t>n?0:qd(n);while(t-1?a[i?r[o]:o]:undefined}}var Zd=createFind;var Xd=Math.max;function findIndex(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=t==null?0:le(t);if(a<0){a=Xd(n+a,0)}return Lr(e,Kl(r,3),a)}var Yd=findIndex;var Jd=Zd(Yd);var Qd=Jd;function baseFindKey(e,r,t){var n;t(e,function(e,t,a){if(r(e,t,a)){n=t;return false}});return n}var ep=baseFindKey;function findKey(e,r){return ep(e,Kl(r,3),ov)}var rp=findKey;var tp=Math.max,np=Math.min;function findLastIndex(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=n-1;if(t!==undefined){a=le(t);a=t<0?tp(n+a,0):np(a,n-1)}return Lr(e,Kl(r,3),a,true)}var ap=findLastIndex;var ip=Zd(ap);var op=ip;function findLastKey(e,r){return ep(e,Kl(r,3),gd)}var up=findLastKey;function head(e){return e&&e.length?e[0]:undefined}var sp=head;function baseMap(e,r){var t=-1,n=nn(e)?Array(e.length):[];cv(e,function(e,a,i){n[++t]=r(e,a,i)});return n}var cp=baseMap;function map_map(e,r){var t=V(e)?q:cp;return t(e,Kl(r,3))}var fp=map_map;function flatMap(e,r){return Ri(fp(e,r),1)}var lp=flatMap;var vp=1/0;function flatMapDeep(e,r){return Ri(fp(e,r),vp)}var dp=flatMapDeep;function flatMapDepth(e,r,t){t=t===undefined?1:le(t);return Ri(fp(e,r),t)}var pp=flatMapDepth;var hp=1/0;function flattenDeep(e){var r=e==null?0:e.length;return r?Ri(e,hp):[]}var yp=flattenDeep;function flattenDepth(e,r){var t=e==null?0:e.length;if(!t){return[]}r=r===undefined?1:le(r);return Ri(e,r)}var gp=flattenDepth;var bp=512;function flip(e){return zt(e,bp)}var mp=flip;var _p=ss("floor");var wp=_p;var xp="Expected a function";var Sp=8,Op=32,jp=128,Ip=256;function createFlow(e){return Ti(function(r){var t=r.length,n=t,a=vr.prototype.thru;if(e){r.reverse()}while(n--){var i=r[n];if(typeof i!="function"){throw new TypeError(xp)}if(a&&!o&&lr(i)=="wrapper"){var o=new vr([],true)}}n=o?n:t;while(++nr}var qp=baseGt;function createRelationalOperation(e){return function(r,t){if(!(typeof r=="string"&&typeof t=="string")){r=ue(r);t=ue(t)}return e(r,t)}}var Hp=createRelationalOperation;var Vp=Hp(qp);var Gp=Vp;var Kp=Hp(function(e,r){return e>=r});var Zp=Kp;var Xp=Object.prototype;var Yp=Xp.hasOwnProperty;function baseHas(e,r){return e!=null&&Yp.call(e,r)}var Jp=baseHas;function has(e,r){return e!=null&&Nl(e,r,Jp)}var Qp=has;var eh=Math.max,rh=Math.min;function baseInRange(e,r,t){return e>=rh(r,t)&&e-1:!!a&&$r(e,r,t)>-1}var ch=includes_includes;var fh=Math.max;function indexOf_indexOf(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=t==null?0:le(t);if(a<0){a=fh(n+a,0)}return $r(e,r,a)}var lh=indexOf_indexOf;function initial(e){var r=e==null?0:e.length;return r?fo(e,0,-1):[]}var vh=initial;var dh=Math.min;function baseIntersection(e,r,t){var n=t?Zv:Ur,a=e[0].length,i=e.length,o=i,u=Array(i),s=Infinity,c=[];while(o--){var f=e[o];if(o&&r){f=q(f,Yn(r))}s=dh(f.length,s);u[o]=!t&&(r||a>=120&&f.length>=120)?new Xf(o&&f):undefined}f=e[0];var l=-1,v=u[0];e:while(++l=-Oy&&e<=Oy}var jy=isSafeInteger;function isUndefined(e){return e===undefined}var Iy=isUndefined;var Ay="[object WeakMap]";function isWeakMap(e){return F(e)&&lc(e)==Ay}var Ey=isWeakMap;var ky="[object WeakSet]";function isWeakSet(e){return F(e)&&L(e)==ky}var Py=isWeakSet;var Cy=1;function iteratee_iteratee(e){return Kl(typeof e=="function"?e:Wf(e,Cy))}var Ry=iteratee_iteratee;var Wy=Array.prototype;var Ty=Wy.join;function join(e,r){return e==null?"":Ty.call(e,r)}var My=join;var By=ts(function(e,r,t){return e+(t?"-":"")+r.toLowerCase()});var Dy=By;var Ly=lv(function(e,r,t){Vt(e,t,r)});var Fy=Ly;function strictLastIndexOf(e,r,t){var n=t+1;while(n--){if(e[n]===r){return n}}return n}var Ny=strictLastIndexOf;var $y=Math.max,Uy=Math.min;function lastIndexOf(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=n;if(t!==undefined){a=le(t);a=a<0?$y(n+a,0):Uy(a,n-1)}return r===r?Ny(e,r,a):Lr(e,Fr,a,true)}var zy=lastIndexOf;var qy=ts(function(e,r,t){return e+(t?" ":"")+r.toLowerCase()});var Hy=qy;var Vy=Ho("toLowerCase");var Gy=Vy;function baseLt(e,r){return e=this.__values__.length,r=e?undefined:this.__values__[this.__index__++];return{done:e,value:r}}var Cg=wrapperNext;function baseNth(e,r){var t=e.length;if(!t){return}r+=r<0?t:0;return lt(r,t)?e[r]:undefined}var Rg=baseNth;function nth(e,r){return e&&e.length?Rg(e,le(r)):undefined}var Wg=nth;function nthArg(e){e=le(e);return en(function(r){return Rg(r,e)})}var Tg=nthArg;function baseUnset(e,r){r=Si(r,e);e=Wh(e,r);return e==null||delete e[ji(ed(r))]}var Mg=baseUnset;function customOmitClone(e){return Hi(e)?undefined:e}var Bg=customOmitClone;var Dg=1,Lg=2,Fg=4;var Ng=Ti(function(e,r){var t={};if(e==null){return t}var n=false;r=q(r,function(r){r=Si(r,e);n||(n=r.length>1);return r});Yt(e,Vs(e),t);if(n){t=Wf(t,Dg|Lg|Fg,Bg)}var a=r.length;while(a--){Mg(t,r[a])}return t});var $g=Ng;function baseSet(e,r,t,n){if(!ee(e)){return e}r=Si(r,e);var a=-1,i=r.length,o=i-1,u=e;while(u!=null&&++ar||i&&o&&s&&!u&&!c||n&&o&&s||!t&&s||!a){return 1}if(!n&&!i&&!c&&e=u){return s}var c=t[n];return s*(c=="desc"?-1:1)}}return e.index-r.index}var Zg=compareMultiple;function baseOrderBy(e,r,t){var n=-1;r=q(r.length?r:[pe],Yn(Kl));var a=cp(e,function(e,t,a){var i=q(r,function(r){return r(e)});return{criteria:i,index:++n,value:e}});return Gg(a,function(e,r){return Zg(e,r,t)})}var Xg=baseOrderBy;function orderBy(e,r,t,n){if(e==null){return[]}if(!V(r)){r=r==null?[]:[r]}t=n?undefined:t;if(!V(t)){t=t==null?[]:[t]}return Xg(e,r,t)}var Yg=orderBy;function createOver(e){return Ti(function(r){r=q(r,Yn(Kl));return en(function(t){var n=this;return e(r,function(e){return Ze(e,n,t)})})})}var Jg=createOver;var Qg=Jg(q);var eb=Qg;var rb=en;var tb=rb;var nb=Math.min;var ab=tb(function(e,r){r=r.length==1&&V(r[0])?q(r[0],Yn(Kl)):q(Ri(r,1),Yn(Kl));var t=r.length;return en(function(n){var a=-1,i=nb(n.length,t);while(++afb){return t}do{if(r%2){t+=e}r=lb(r/2);if(r){e+=e}}while(r);return t}var vb=baseRepeat;var db=Hl("length");var pb=db;var hb="\\ud800-\\udfff",yb="\\u0300-\\u036f",gb="\\ufe20-\\ufe2f",bb="\\u20d0-\\u20ff",mb=yb+gb+bb,_b="\\ufe0e\\ufe0f";var wb="["+hb+"]",xb="["+mb+"]",Sb="\\ud83c[\\udffb-\\udfff]",Ob="(?:"+xb+"|"+Sb+")",jb="[^"+hb+"]",Ib="(?:\\ud83c[\\udde6-\\uddff]){2}",Ab="[\\ud800-\\udbff][\\udc00-\\udfff]",Eb="\\u200d";var kb=Ob+"?",Pb="["+_b+"]?",Cb="(?:"+Eb+"(?:"+[jb,Ib,Ab].join("|")+")"+Pb+kb+")*",Rb=Pb+kb+Cb,Wb="(?:"+[jb+xb+"?",xb,Ib,Ab,wb].join("|")+")";var Tb=RegExp(Sb+"(?="+Sb+")|"+Wb+Rb,"g");function unicodeSize(e){var r=Tb.lastIndex=0;while(Tb.test(e)){++r}return r}var Mb=unicodeSize;function stringSize(e){return wo(e)?Mb(e):pb(e)}var Bb=stringSize;var Db=Math.ceil;function createPadding(e,r){r=r===undefined?" ":X(r);var t=r.length;if(t<2){return t?vb(r,e):r}var n=vb(r,Db(e/Bb(r)));return wo(r)?lo(qo(n),0,e).join(""):n.slice(0,e)}var Lb=createPadding;var Fb=Math.ceil,Nb=Math.floor;function pad(e,r,t){e=xi(e);r=le(r);var n=r?Bb(e):0;if(!r||n>=r){return e}var a=(r-n)/2;return Lb(Nb(a),t)+e+Lb(Fb(a),t)}var $b=pad;function padEnd(e,r,t){e=xi(e);r=le(r);var n=r?Bb(e):0;return r&&n-1){if(u!==e){sm.call(u,s,1)}sm.call(e,s,1)}}return e}var cm=basePullAll;function pullAll(e,r){return e&&e.length&&r&&r.length?cm(e,r):e}var fm=pullAll;var lm=en(fm);var vm=lm;function pullAllBy(e,r,t){return e&&e.length&&r&&r.length?cm(e,r,Kl(t,2)):e}var dm=pullAllBy;function pullAllWith(e,r,t){return e&&e.length&&r&&r.length?cm(e,r,undefined,t):e}var pm=pullAllWith;var hm=Array.prototype;var ym=hm.splice;function basePullAt(e,r){var t=e?r.length:0,n=t-1;while(t--){var a=r[t];if(t==n||a!==i){var i=a;if(lt(a)){ym.call(e,a,1)}else{Mg(e,a)}}}return e}var gm=basePullAt;var bm=Ti(function(e,r){var t=e==null?0:e.length,n=Ei(e,r);gm(e,q(r,function(e){return lt(e,t)?+e:e}).sort(Kg));return n});var mm=bm;var _m=Math.floor,wm=Math.random;function baseRandom(e,r){return e+_m(wm()*(r-e+1))}var xm=baseRandom;var Sm=parseFloat;var Om=Math.min,jm=Math.random;function random(e,r,t){if(t&&typeof t!="boolean"&&an(e,r,t)){r=t=undefined}if(t===undefined){if(typeof r=="boolean"){t=r;r=undefined}else if(typeof e=="boolean"){t=e;e=undefined}}if(e===undefined&&r===undefined){e=0;r=1}else{e=fe(e);if(r===undefined){r=e;e=0}else{r=fe(r)}}if(e>r){var n=e;e=r;r=n}if(t||e%1||r%1){var a=jm();return Om(e+a*(r-e+Sm("1e-"+((a+"").length-1))),r)}return xm(e,r)}var Im=random;var Am=Math.ceil,Em=Math.max;function baseRange(e,r,t,n){var a=-1,i=Em(Am((r-e)/(t||1)),0),o=Array(i);while(i--){o[n?i:++a]=e;e+=t}return o}var km=baseRange;function createRange(e){return function(r,t,n){if(n&&typeof n!="number"&&an(r,t,n)){t=n=undefined}r=fe(r);if(t===undefined){t=r;r=0}else{t=fe(t)}n=n===undefined?r1&&an(e,r[0],r[1])){r=[]}else if(t>2&&an(r[0],r[1],r[2])){r=[r[0]]}return Xg(e,Ri(r,1),[])});var w_=__;var x_=4294967295,S_=x_-1;var O_=Math.floor,j_=Math.min;function baseSortedIndexBy(e,r,t,n){r=t(r);var a=0,i=e==null?0:e.length,o=r!==r,u=r===null,s=$(r),c=r===undefined;while(a>>1;function baseSortedIndex(e,r,t){var n=0,a=e==null?n:e.length;if(typeof r=="number"&&r===r&&a<=E_){while(n>>1,o=e[i];if(o!==null&&!$(o)&&(t?o<=r:o>>0;if(!t){return[]}e=xi(e);if(e&&(typeof r=="string"||r!=null&&!Sy(r))){r=X(r);if(!r&&wo(e)){return lo(qo(e),0,t)}}return e.split(r,t)}var N_=split;var $_="Expected a function";var U_=Math.max;function spread(e,r){if(typeof e!="function"){throw new TypeError($_)}r=r==null?0:U_(le(r),0);return en(function(t){var n=t[r],a=lo(t,0,r);if(n){ki(a,n)}return Ze(e,this,a)})}var z_=spread;var q_=ts(function(e,r,t){return e+(t?" ":"")+Go(r)});var H_=q_;function startsWith(e,r,t){e=xi(e);t=t==null?0:hs(le(t),0,e.length);r=X(r);return e.slice(t,t+r.length)==r}var V_=startsWith;function stubObject(){return{}}var G_=stubObject;function stubString(){return""}var K_=stubString;function stubTrue(){return true}var Z_=stubTrue;var X_=Y(function(e,r){return e-r},0);var Y_=X_;function sum(e){return e&&e.length?sg(e,pe):0}var J_=sum;function sumBy(e,r){return e&&e.length?sg(e,Kl(r,2)):0}var Q_=sumBy;function tail(e){var r=e==null?0:e.length;return r?fo(e,1,r):[]}var ew=tail;function take(e,r,t){if(!(e&&e.length)){return[]}r=t||r===undefined?1:le(r);return fo(e,0,r<0?0:r)}var rw=take;function takeRight(e,r,t){var n=e==null?0:e.length;if(!n){return[]}r=t||r===undefined?1:le(r);r=n-r;return fo(e,r<0?0:r,n)}var tw=takeRight;function takeRightWhile(e,r){return e&&e.length?cd(e,Kl(r,3),false,true):[]}var nw=takeRightWhile;function takeWhile(e,r){return e&&e.length?cd(e,Kl(r,3)):[]}var aw=takeWhile;function tap(e,r){r(e);return e}var iw=tap;var ow=Object.prototype;var uw=ow.hasOwnProperty;function customDefaultsAssignIn(e,r,t,n){if(e===undefined||Gt(e,ow[t])&&!uw.call(n,t)){return r}return e}var sw=customDefaultsAssignIn;var cw={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function escapeStringChar(e){return"\\"+cw[e]}var fw=escapeStringChar;var lw=/<%=([\s\S]+?)%>/g;var vw=lw;var dw=/<%-([\s\S]+?)%>/g;var pw=dw;var hw=/<%([\s\S]+?)%>/g;var yw=hw;var gw={escape:pw,evaluate:yw,interpolate:vw,variable:"",imports:{_:{escape:Bd}}};var bw=gw;var mw=/\b__p \+= '';/g,_w=/\b(__p \+=) '' \+/g,ww=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var xw=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Sw=/($^)/;var Ow=/['\n\r\u2028\u2029\\]/g;var jw=Object.prototype;var Iw=jw.hasOwnProperty;function template(e,r,t){var n=bw.imports._.templateSettings||bw;if(t&&an(e,r,t)){r=undefined}e=xi(e);r=ka({},r,n,sw);var a=ka({},r.imports,n.imports,sw),i=ya(a),o=oh(a,i);var u,s,c=0,f=r.interpolate||Sw,l="__p += '";var v=RegExp((r.escape||Sw).source+"|"+f.source+"|"+(f===vw?xw:Sw).source+"|"+(r.evaluate||Sw).source+"|$","g");var d=Iw.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/[\r\n]/g," ")+"\n":"";e.replace(v,function(r,t,n,a,i,o){n||(n=a);l+=e.slice(c,o).replace(Ow,fw);if(t){u=true;l+="' +\n__e("+t+") +\n'"}if(i){s=true;l+="';\n"+i+";\n__p += '"}if(n){l+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"}c=o+r.length;return r});l+="';\n";var p=Iw.call(r,"variable")&&r.variable;if(!p){l="with (obj) {\n"+l+"\n}\n"}l=(s?l.replace(mw,""):l).replace(_w,"$1").replace(ww,"$1;");l="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var h=Xi(function(){return Function(i,d+"return "+l).apply(undefined,o)});h.source=l;if(Ki(h)){throw h}return h}var Aw=template;var Ew="Expected a function";function throttle(e,r,t){var n=true,a=true;if(typeof e!="function"){throw new TypeError(Ew)}if(ee(t)){n="leading"in t?!!t.leading:n;a="trailing"in t?!!t.trailing:a}return Iv(e,r,{leading:n,maxWait:r,trailing:a})}var kw=throttle;function thru(e,r){return r(e)}var Pw=thru;var Cw=9007199254740991;var Rw=4294967295;var Ww=Math.min;function times(e,r){e=le(e);if(e<1||e>Cw){return[]}var t=Rw,n=Ww(e,Rw);r=vd(r);e-=Rw;var a=cn(n,r);while(++t-1){}return t}var qw=charsEndIndex;function charsStartIndex(e,r){var t=-1,n=e.length;while(++t-1){}return t}var Hw=charsStartIndex;var Vw=/^\s+|\s+$/g;function trim(e,r,t){e=xi(e);if(e&&(t||r===undefined)){return e.replace(Vw,"")}if(!e||!(r=X(r))){return e}var n=qo(e),a=qo(r),i=Hw(n,a),o=qw(n,a)+1;return lo(n,i,o).join("")}var Gw=trim;var Kw=/\s+$/;function trimEnd(e,r,t){e=xi(e);if(e&&(t||r===undefined)){return e.replace(Kw,"")}if(!e||!(r=X(r))){return e}var n=qo(e),a=qw(n,qo(r))+1;return lo(n,0,a).join("")}var Zw=trimEnd;var Xw=/^\s+/;function trimStart(e,r,t){e=xi(e);if(e&&(t||r===undefined)){return e.replace(Xw,"")}if(!e||!(r=X(r))){return e}var n=qo(e),a=Hw(n,qo(r));return lo(n,a).join("")}var Yw=trimStart;var Jw=30,Qw="...";var ex=/\w*$/;function truncate(e,r){var t=Jw,n=Qw;if(ee(r)){var a="separator"in r?r.separator:a;t="length"in r?le(r.length):t;n="omission"in r?X(r.omission):n}e=xi(e);var i=e.length;if(wo(e)){var o=qo(e);i=o.length}if(t>=i){return e}var u=t-Bb(n);if(u<1){return n}var s=o?lo(o,0,u).join(""):e.slice(0,u);if(a===undefined){return s+n}if(o){u+=s.length-u}if(Sy(a)){if(e.slice(u).search(a)){var c,f=s;if(!a.global){a=RegExp(a.source,xi(ex.exec(a))+"g")}a.lastIndex=0;while(c=a.exec(f)){var l=c.index}s=s.slice(0,l===undefined?u:l)}}else if(e.indexOf(X(a),u)!=u){var v=s.lastIndexOf(a);if(v>-1){s=s.slice(0,v)}}return s+n}var rx=truncate;function unary(e){return Ht(e,1)}var tx=unary;var nx={"&":"&","<":"<",">":">",""":'"',"'":"'"};var ax=Xo(nx);var ix=ax;var ox=/&(?:amp|lt|gt|quot|#39);/g,ux=RegExp(ox.source);function unescape_unescape(e){e=xi(e);return e&&ux.test(e)?e.replace(ox,ix):e}var sx=unescape_unescape;var cx=1/0;var fx=!(Js&&1/nl(new Js([,-0]))[1]==cx)?ar:function(e){return new Js(e)};var lx=fx;var vx=200;function baseUniq(e,r,t){var n=-1,a=Ur,i=e.length,o=true,u=[],s=u;if(t){o=false;a=Zv}else if(i>=vx){var c=r?null:lx(e);if(c){return nl(c)}o=false;a=Jf;s=new Xf}else{s=r?[]:u}e:while(++n1||this.__actions__.length||!(n instanceof nr)||!lt(t)){return this.thru(a)}n=n.slice(t,+t+(r?1:0));n.__actions__.push({func:Pw,args:[a],thisArg:undefined});return new vr(n,this.__chain__).thru(function(e){if(r&&!e.length){e.push(undefined)}return e})});var Fx=Lx;function wrapperChain(){return ls(this)}var Nx=wrapperChain;function wrapperReverse(){var e=this.__wrapped__;if(e instanceof nr){var r=e;if(this.__actions__.length){r=new nr(this)}r=r.reverse();r.__actions__.push({func:Pw,args:[Ym],thisArg:undefined});return new vr(r,this.__chain__)}return this.thru(Ym)}var $x=wrapperReverse;function baseXor(e,r,t){var n=e.length;if(n<2){return n?dx(e[0]):[]}var a=-1,i=Array(n);while(++a1?e[r-1]:undefined;t=typeof t=="function"?(e.pop(),t):undefined;return Ex(e,t)});var rS=eS;var tS={chunk:ps,compact:Hf,concat:Vf,difference:Qv,differenceBy:td,differenceWith:ad,drop:ud,dropRight:sd,dropRightWhile:fd,dropWhile:ld,fill:Vd,findIndex:Yd,findLastIndex:ap,first:sp,flatten:Wi,flattenDeep:yp,flattenDepth:gp,fromPairs:Bp,head:sp,indexOf:lh,initial:vh,intersection:gh,intersectionBy:mh,intersectionWith:wh,join:My,last:ed,lastIndexOf:zy,nth:Wg,pull:vm,pullAll:fm,pullAllBy:dm,pullAllWith:pm,pullAt:mm,remove:zm,reverse:Ym,slice:h_,sortedIndex:P_,sortedIndexBy:C_,sortedIndexOf:R_,sortedLastIndex:W_,sortedLastIndexBy:T_,sortedLastIndexOf:M_,sortedUniq:D_,sortedUniqBy:L_,tail:ew,take:rw,takeRight:tw,takeRightWhile:nw,takeWhile:aw,union:hx,unionBy:gx,unionWith:mx,uniq:_x,uniqBy:wx,uniqWith:xx,unzip:Ax,unzipWith:Ex,without:Bx,xor:qx,xorBy:Vx,xorWith:Kx,zip:Xx,zipObject:Jx,zipObjectDeep:Qx,zipWith:rS};var nS={countBy:hv,each:dd,eachRight:_d,every:Ud,filter:Kd,find:Qd,findLast:op,flatMap:lp,flatMapDeep:dp,flatMapDepth:pp,forEach:dd,forEachRight:_d,groupBy:zp,includes:ch,invokeMap:Lh,keyBy:Fy,map:fp,orderBy:Yg,partition:em,reduce:Fm,reduceRight:$m,reject:Um,sample:t_,sampleSize:o_,shuffle:l_,size:p_,some:m_,sortBy:w_};var aS={now:xv};var iS={after:de,ary:Ht,before:Ji,bind:to,bindKey:co,curry:bv,curryRight:_v,debounce:Iv,defer:Vv,delay:Kv,flip:mp,memoize:hi,negate:jg,once:Vg,overArgs:ib,partial:Zb,partialRight:Jb,rearg:Dm,rest:Gm,spread:z_,throttle:kw,unary:tx,wrap:Dx};var oS={castArray:is,clone:Mf,cloneDeep:Lf,cloneDeepWith:$f,cloneWith:zf,conformsTo:rv,eq:Gt,gt:Gp,gte:Zp,isArguments:yn,isArray:V,isArrayBuffer:zh,isArrayLike:nn,isArrayLikeObject:Wv,isBoolean:Hh,isBuffer:On,isDate:Xh,isElement:Yh,isEmpty:ty,isEqual:ny,isEqualWith:ay,isError:Ki,isFinite:oy,isFunction:me,isInteger:uy,isLength:tn,isMap:Xc,isMatch:sy,isMatchWith:cy,isNaN:vy,isNative:yy,isNil:gy,isNull:by,isNumber:ly,isObject:ee,isObjectLike:F,isPlainObject:Hi,isRegExp:Sy,isSafeInteger:jy,isSet:rf,isString:ih,isSymbol:$,isTypedArray:oa,isUndefined:Iy,isWeakMap:Ey,isWeakSet:Py,lt:Xy,lte:Jy,toArray:Pg,toFinite:fe,toInteger:le,toLength:qd,toNumber:ue,toPlainObject:Mv,toSafeInteger:$w,toString:xi};var uS={add:Q,ceil:fs,divide:od,floor:wp,max:og,maxBy:ug,mean:lg,meanBy:vg,min:mg,minBy:_g,multiply:Sg,round:Qm,subtract:Y_,sum:J_,sumBy:Q_};var sS={clamp:ys,inRange:nh,random:Im};var cS={assign:_a,assignIn:Aa,assignInWith:ka,assignWith:Ca,at:Bi,create:yv,defaults:Cv,defaultsDeep:Uv,entries:Ed,entriesIn:Pd,extend:Aa,extendWith:ka,findKey:rp,findLastKey:up,forIn:Rp,forInRight:Wp,forOwn:Tp,forOwnRight:Mp,functions:Lp,functionsIn:Fp,get:Ai,has:Qp,hasIn:$l,invert:Ah,invertBy:Rh,invoke:Bh,keys:ya,keysIn:ja,mapKeys:Qy,mapValues:eg,merge:pg,mergeWith:Nv,omit:$g,omitBy:Hg,pick:nm,pickBy:qg,result:Km,set:u_,setWith:s_,toPairs:Ed,toPairsIn:Pd,transform:zw,unset:jx,update:Px,updateWith:Cx,values:uh,valuesIn:Tx};var fS={at:Fx,chain:ls,commit:qf,lodash:gr,next:Cg,plant:am,reverse:$x,tap:iw,thru:Pw,toIterator:Mw,toJSON:Dw,value:Dw,valueOf:Dw,wrapperChain:Nx};var lS={camelCase:as,capitalize:Ko,deburr:uu,endsWith:wd,escape:Bd,escapeRegExp:Fd,kebabCase:Dy,lowerCase:Hy,lowerFirst:Gy,pad:$b,padEnd:Ub,padStart:zb,parseInt:Vb,repeat:qm,replace:Hm,snakeCase:g_,split:N_,startCase:H_,startsWith:V_,template:Aw,templateSettings:bw,toLower:Lw,toUpper:Uw,trim:Gw,trimEnd:Zw,trimStart:Yw,truncate:rx,unescape:sx,upperCase:Wx,upperFirst:Go,words:Qu};var vS={attempt:Xi,bindAll:ao,cond:Xl,conforms:ev,constant:Pr,defaultTo:Av,flow:kp,flowRight:Cp,identity:pe,iteratee:Ry,matches:tg,matchesProperty:ag,method:yg,methodOf:bg,mixin:wg,noop:ar,nthArg:Tg,over:eb,overEvery:ub,overSome:cb,property:Gl,propertyOf:im,range:Rm,rangeRight:Tm,stubArray:Ws,stubFalse:gn,stubObject:G_,stubString:K_,stubTrue:Z_,times:Tw,toPath:Fw,uniqueId:Ox};function lazyClone(){var e=new nr(this.__wrapped__);e.__actions__=dr(this.__actions__);e.__dir__=this.__dir__;e.__filtered__=this.__filtered__;e.__iteratees__=dr(this.__iteratees__);e.__takeCount__=this.__takeCount__;e.__views__=dr(this.__views__);return e}var dS=lazyClone;function lazyReverse(){if(this.__filtered__){var e=new nr(this);e.__dir__=-1;e.__filtered__=true}else{e=this.clone();e.__dir__*=-1}return e}var pS=lazyReverse;var hS=Math.max,yS=Math.min;function getView(e,r,t){var n=-1,a=t.length;while(++n0||r<0)){return new nr(t)}if(e<0){t=t.takeRight(-e)}else if(e){t=t.drop(e)}if(r!==undefined){r=le(r);t=r<0?t.dropRight(-r):t.take(r-e)}return t};nr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};nr.prototype.toArray=function(){return this.take(IS)};ov(nr.prototype,function(e,r){var t=/^(?:filter|find|map|reject)|While$/.test(r),n=/^(?:head|last)$/.test(r),a=gr[n?"take"+(r=="last"?"Right":""):r],i=n||/^find/.test(r);if(!a){return}gr.prototype[r]=function(){var r=this.__wrapped__,o=n?[1]:arguments,u=r instanceof nr,s=o[0],c=u||V(r);var f=function(e){var r=a.apply(gr,ki([e],o));return n&&l?r[0]:r};if(c&&t&&typeof s=="function"&&s.length!=1){u=c=false}var l=this.__chain__,v=!!this.__actions__.length,d=i&&!l,p=u&&!v;if(!i&&c){r=p?r:new nr(this);var h=e.apply(r,o);h.__actions__.push({func:Pw,args:[f],thisArg:undefined});return new vr(h,l)}if(d&&p){return e.apply(this,o)}h=this.thru(f);return d?n?h.value()[0]:h.value():h}});Dr(["pop","push","shift","sort","splice","unshift"],function(e){var r=AS[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);gr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var a=this.value();return r.apply(V(a)?a:[],e)}return this[t](function(t){return r.apply(V(t)?t:[],e)})}});ov(nr.prototype,function(e,r){var t=gr[r];if(t){var n=t.name+"";if(!kS.call(sr,n)){sr[n]=[]}sr[n].push({name:r,func:t})}});sr[xt(undefined,SS).name]=[{name:"wrapper",func:undefined}];nr.prototype.clone=dS;nr.prototype.reverse=pS;nr.prototype.value=wS;gr.prototype.at=fS.at;gr.prototype.chain=fS.wrapperChain;gr.prototype.commit=fS.commit;gr.prototype.next=fS.next;gr.prototype.plant=fS.plant;gr.prototype.reverse=fS.reverse;gr.prototype.toJSON=gr.prototype.valueOf=gr.prototype.value=fS.value;gr.prototype.first=gr.prototype.head;if(PS){gr.prototype[PS]=fS.toIterator}var TS=gr;class image_tag_ImageTag{constructor(e){const{repository:r="gableroux",name:t="unity3d",version:n="2019.2.11f1",platform:a}=e;if(!image_tag_ImageTag.versionPattern.test(n)){throw new Error(`Invalid version "${n}".`)}if(!Qp(image_tag_ImageTag.targetPlatformToImageSuffixMap,a)){throw new Error(`Platform "${a}" is currently not supported.`)}const i=Ai(image_tag_ImageTag.targetPlatformToImageSuffixMap,a,image_tag_ImageTag.imageSuffixes.generic);Object.assign(this,{repository:r,name:t,version:n,platform:a,builderPlatform:i})}static get versionPattern(){return/^20\d{2}\.\d\.\w{3,4}|3$/}static get imageSuffixes(){return{generic:"",webgl:"webgl",mac:"mac",windows:"windows",android:"android",ios:"ios",facebook:"facebook"}}static get targetPlatformToImageSuffixMap(){const{generic:e,webgl:r,mac:t,windows:n,android:a,ios:i,facebook:u}=image_tag_ImageTag.imageSuffixes;return{[o.types.StandaloneOSX]:t,[o.types.StandaloneWindows]:n,[o.types.StandaloneWindows64]:n,[o.types.StandaloneLinux64]:n,[o.types.iOS]:i,[o.types.Android]:a,[o.types.WebGL]:r,[o.types.WSAPlayer]:n,[o.types.PS4]:n,[o.types.XboxOne]:n,[o.types.tvOS]:n,[o.types.Switch]:n,[o.types.Lumin]:n,[o.types.BJM]:n,[o.types.Stadia]:n,[o.types.Facebook]:u,[o.types.NoTarget]:e,[o.types.Test]:e}}get tag(){return Zw(`${this.version}-${this.builderPlatform}`,"-")}get image(){return Yw(`${this.repository}/${this.name}`,"/")}toString(){const{image:e,tag:r}=this;return`${e}:${r}`}}var MS=image_tag_ImageTag;class docker_Docker{static async build(e,r=false){const{path:t,dockerfile:n,baseImage:a}=e;const{version:i,platform:o}=a;const u=new MS({repository:"",name:"unity-builder",version:i,platform:o});const s=`docker build ${t} --file ${n} --build-arg IMAGE=${a} --tag ${u}`;await Object(v.exec)(s,null,{silent:r});return u}static async run(e,r,t=false){const{version:n,workspace:a,platform:i,projectPath:o,buildName:u,buildPath:s,buildFile:c,buildMethod:f,buildVersion:l,customParameters:d}=r;const p=`docker run --workdir /github/workspace --rm --env UNITY_LICENSE --env UNITY_LICENSE_FILE --env UNITY_EMAIL --env UNITY_PASSWORD --env UNITY_SERIAL --env UNITY_VERSION="${n}" --env PROJECT_PATH="${o}" --env BUILD_TARGET="${i}" --env BUILD_NAME="${u}" --env BUILD_PATH="${s}" --env BUILD_FILE="${c}" --env BUILD_METHOD="${f}" --env VERSION="${l}" --env CUSTOM_PARAMETERS="${d}" --env HOME=/github/home --env GITHUB_REF --env GITHUB_SHA --env GITHUB_REPOSITORY --env GITHUB_ACTOR --env GITHUB_WORKFLOW --env GITHUB_HEAD_REF --env GITHUB_BASE_REF --env GITHUB_EVENT_NAME --env GITHUB_WORKSPACE=/github/workspace --env GITHUB_ACTION --env GITHUB_EVENT_PATH --env RUNNER_OS --env RUNNER_TOOL_CACHE --env RUNNER_TEMP --env RUNNER_WORKSPACE --volume "/var/run/docker.sock":"/var/run/docker.sock" --volume "/home/runner/work/_temp/_github_home":"/github/home" --volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" --volume "${a}":"/github/workspace" ${e}`;await Object(v.exec)(p,null,{silent:t})}}var BS=docker_Docker;const DS=t(470);async function src_action(){i.checkCompatibility();m.verify();const{dockerfile:e,workspace:r,actionFolder:t}=i;const n=u.create(await g.getFromUser());const a=new MS(n);const o=await BS.build({path:t,dockerfile:e,baseImage:a});await BS.run(o,{workspace:r,...n})}src_action().catch(e=>{DS.setFailed(e.message)})},87:function(e){e.exports=require("os")},129:function(e){e.exports=require("child_process")},357:function(e){e.exports=require("assert")},431:function(e,r,t){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(Object.hasOwnProperty.call(e,t))r[t]=e[t];r["default"]=e;return r};Object.defineProperty(r,"__esModule",{value:true});const a=n(t(87));function issueCommand(e,r,t){const n=new Command(e,r,t);process.stdout.write(n.toString()+a.EOL)}r.issueCommand=issueCommand;function issue(e,r=""){issueCommand(e,{},r)}r.issue=issue;const i="::";class Command{constructor(e,r,t){if(!e){e="missing.command"}this.command=e;this.properties=r;this.message=t}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let r=true;for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const n=this.properties[t];if(n){if(r){r=false}else{e+=","}e+=`${t}=${escapeProperty(n)}`}}}}e+=`${i}${escapeData(this.message)}`;return e}}function escapeData(e){return(e||"").replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return(e||"").replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},470:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(Object.hasOwnProperty.call(e,t))r[t]=e[t];r["default"]=e;return r};Object.defineProperty(r,"__esModule",{value:true});const i=t(431);const o=a(t(87));const u=a(t(622));var s;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(s=r.ExitCode||(r.ExitCode={}));function exportVariable(e,r){process.env[e]=r;i.issueCommand("set-env",{name:e},r)}r.exportVariable=exportVariable;function setSecret(e){i.issueCommand("add-mask",{},e)}r.setSecret=setSecret;function addPath(e){i.issueCommand("add-path",{},e);process.env["PATH"]=`${e}${u.delimiter}${process.env["PATH"]}`}r.addPath=addPath;function getInput(e,r){const t=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(r&&r.required&&!t){throw new Error(`Input required and not supplied: ${e}`)}return t.trim()}r.getInput=getInput;function setOutput(e,r){i.issueCommand("set-output",{name:e},r)}r.setOutput=setOutput;function setFailed(e){process.exitCode=s.Failure;error(e)}r.setFailed=setFailed;function debug(e){i.issueCommand("debug",{},e)}r.debug=debug;function error(e){i.issue("error",e)}r.error=error;function warning(e){i.issue("warning",e)}r.warning=warning;function info(e){process.stdout.write(e+o.EOL)}r.info=info;function startGroup(e){i.issue("group",e)}r.startGroup=startGroup;function endGroup(){i.issue("endgroup")}r.endGroup=endGroup;function group(e,r){return n(this,void 0,void 0,function*(){startGroup(e);let t;try{t=yield r()}finally{endGroup()}return t})}r.group=group;function saveState(e,r){i.issueCommand("save-state",{name:e},r)}r.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}r.getState=getState},614:function(e){e.exports=require("events")},622:function(e){e.exports=require("path")},669:function(e){e.exports=require("util")},672:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};var a;Object.defineProperty(r,"__esModule",{value:true});const i=t(357);const o=t(747);const u=t(622);a=o.promises,r.chmod=a.chmod,r.copyFile=a.copyFile,r.lstat=a.lstat,r.mkdir=a.mkdir,r.readdir=a.readdir,r.readlink=a.readlink,r.rename=a.rename,r.rmdir=a.rmdir,r.stat=a.stat,r.symlink=a.symlink,r.unlink=a.unlink;r.IS_WINDOWS=process.platform==="win32";function exists(e){return n(this,void 0,void 0,function*(){try{yield r.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true})}r.exists=exists;function isDirectory(e,t=false){return n(this,void 0,void 0,function*(){const n=t?yield r.stat(e):yield r.lstat(e);return n.isDirectory()})}r.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(r.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}r.isRooted=isRooted;function mkdirP(e,t=1e3,a=1){return n(this,void 0,void 0,function*(){i.ok(e,"a path argument must be provided");e=u.resolve(e);if(a>=t)return r.mkdir(e);try{yield r.mkdir(e);return}catch(n){switch(n.code){case"ENOENT":{yield mkdirP(u.dirname(e),t,a+1);yield r.mkdir(e);return}default:{let t;try{t=yield r.stat(e)}catch(e){throw n}if(!t.isDirectory())throw n}}}})}r.mkdirP=mkdirP;function tryGetExecutablePath(e,t){return n(this,void 0,void 0,function*(){let n=undefined;try{n=yield r.stat(e)}catch(r){if(r.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${r}`)}}if(n&&n.isFile()){if(r.IS_WINDOWS){const r=u.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===r)){return e}}else{if(isUnixExecutable(n)){return e}}}const a=e;for(const i of t){e=a+i;n=undefined;try{n=yield r.stat(e)}catch(r){if(r.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${r}`)}}if(n&&n.isFile()){if(r.IS_WINDOWS){try{const t=u.dirname(e);const n=u.basename(e).toUpperCase();for(const a of yield r.readdir(t)){if(n===a.toUpperCase()){e=u.join(t,a);break}}}catch(r){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${r}`)}return e}else{if(isUnixExecutable(n)){return e}}}}return""})}r.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(r.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}},747:function(e){e.exports=require("fs")},986:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};Object.defineProperty(r,"__esModule",{value:true});const a=t(9);function exec(e,r,t){return n(this,void 0,void 0,function*(){const n=a.argStringToArray(e);if(n.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const i=n[0];r=n.slice(1).concat(r||[]);const o=new a.ToolRunner(i,r,t);return o.exec()})}r.exec=exec}},function(e){"use strict";!function(){e.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}}();!function(){var r=Object.prototype.hasOwnProperty;e.d=function(e,t,n){if(!r.call(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}}}();!function(){e.t=function(r,t){if(t&1)r=this(r);if(t&8)return r;if(t&4&&typeof r==="object"&&r&&r.__esModule)return r;var n=Object.create(null);e.r(n);Object.defineProperty(n,"default",{enumerable:true,value:r});if(t&2&&typeof r!="string")for(var a in r)e.d(n,a,function(e){return r[e]}.bind(null,a));return n}}();!function(){e.n=function(r){var t=r&&r.__esModule?function getDefault(){return r["default"]}:function getModuleExports(){return r};e.d(t,"a",t);return t}}();!function(){e.hmd=function(e){e=Object.create(e);if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});Object.defineProperty(e,"exports",{enumerable:true,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}});return e}}()}); \ No newline at end of file +module.exports=function(e,r){"use strict";var t={};function __webpack_require__(r){if(t[r]){return t[r].exports}var n=t[r]={i:r,l:false,exports:{}};e[r].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(11)}r(__webpack_require__);return startup()}({1:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};Object.defineProperty(r,"__esModule",{value:true});const a=t(129);const i=t(622);const o=t(669);const u=t(672);const s=o.promisify(a.exec);function cp(e,r,t={}){return n(this,void 0,void 0,function*(){const{force:n,recursive:a}=readCopyOptions(t);const o=(yield u.exists(r))?yield u.stat(r):null;if(o&&o.isFile()&&!n){return}const s=o&&o.isDirectory()?i.join(r,i.basename(e)):r;if(!(yield u.exists(e))){throw new Error(`no such file or directory: ${e}`)}const c=yield u.stat(e);if(c.isDirectory()){if(!a){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,s,0,n)}}else{if(i.relative(e,s)===""){throw new Error(`'${s}' and '${e}' are the same file`)}yield copyFile(e,s,n)}})}r.cp=cp;function mv(e,r,t={}){return n(this,void 0,void 0,function*(){if(yield u.exists(r)){let n=true;if(yield u.isDirectory(r)){r=i.join(r,i.basename(e));n=yield u.exists(r)}if(n){if(t.force==null||t.force){yield rmRF(r)}else{throw new Error("Destination already exists")}}}yield mkdirP(i.dirname(r));yield u.rename(e,r)})}r.mv=mv;function rmRF(e){return n(this,void 0,void 0,function*(){if(u.IS_WINDOWS){try{if(yield u.isDirectory(e,true)){yield s(`rd /s /q "${e}"`)}else{yield s(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield u.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let r=false;try{r=yield u.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(r){yield s(`rm -rf "${e}"`)}else{yield u.unlink(e)}}})}r.rmRF=rmRF;function mkdirP(e){return n(this,void 0,void 0,function*(){yield u.mkdirP(e)})}r.mkdirP=mkdirP;function which(e,r){return n(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(r){const r=yield which(e,false);if(!r){if(u.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}}try{const r=[];if(u.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(i.delimiter)){if(e){r.push(e)}}}if(u.isRooted(e)){const t=yield u.tryGetExecutablePath(e,r);if(t){return t}return""}if(e.includes("/")||u.IS_WINDOWS&&e.includes("\\")){return""}const t=[];if(process.env.PATH){for(const e of process.env.PATH.split(i.delimiter)){if(e){t.push(e)}}}for(const n of t){const t=yield u.tryGetExecutablePath(n+i.sep+e,r);if(t){return t}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}r.which=which;function readCopyOptions(e){const r=e.force==null?true:e.force;const t=Boolean(e.recursive);return{force:r,recursive:t}}function cpDirRecursive(e,r,t,a){return n(this,void 0,void 0,function*(){if(t>=255)return;t++;yield mkdirP(r);const n=yield u.readdir(e);for(const i of n){const n=`${e}/${i}`;const o=`${r}/${i}`;const s=yield u.lstat(n);if(s.isDirectory()){yield cpDirRecursive(n,o,t,a)}else{yield copyFile(n,o,a)}}yield u.chmod(r,(yield u.stat(e)).mode)})}function copyFile(e,r,t){return n(this,void 0,void 0,function*(){if((yield u.lstat(e)).isSymbolicLink()){try{yield u.lstat(r);yield u.unlink(r)}catch(e){if(e.code==="EPERM"){yield u.chmod(r,"0666");yield u.unlink(r)}}const t=yield u.readlink(e);yield u.symlink(t,r,u.IS_WINDOWS?"junction":null)}else if(!(yield u.exists(r))||t){yield u.copyFile(e,r)}})}},9:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};Object.defineProperty(r,"__esModule",{value:true});const a=t(87);const i=t(614);const o=t(129);const u=t(622);const s=t(1);const c=t(672);const f=process.platform==="win32";class ToolRunner extends i.EventEmitter{constructor(e,r,t){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=r||[];this.options=t||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,r){const t=this._getSpawnFileName();const n=this._getSpawnArgs(e);let a=r?"":"[command]";if(f){if(this._isCmdFile()){a+=t;for(const e of n){a+=` ${e}`}}else if(e.windowsVerbatimArguments){a+=`"${t}"`;for(const e of n){a+=` ${e}`}}else{a+=this._windowsQuoteCmdArg(t);for(const e of n){a+=` ${this._windowsQuoteCmdArg(e)}`}}}else{a+=t;for(const e of n){a+=` ${e}`}}return a}_processLineBuffer(e,r,t){try{let n=r+e.toString();let i=n.indexOf(a.EOL);while(i>-1){const e=n.substring(0,i);t(e);n=n.substring(i+a.EOL.length);i=n.indexOf(a.EOL)}r=n}catch(e){this._debug(`error processing line. Failed with error ${e}`)}}_getSpawnFileName(){if(f){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(f){if(this._isCmdFile()){let r=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const t of this.args){r+=" ";r+=e.windowsVerbatimArguments?t:this._windowsQuoteCmdArg(t)}r+='"';return[r]}}return this.args}_endsWith(e,r){return e.endsWith(r)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const r=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let t=false;for(const n of e){if(r.some(e=>e===n)){t=true;break}}if(!t){return e}let n='"';let a=true;for(let r=e.length;r>0;r--){n+=e[r-1];if(a&&e[r-1]==="\\"){n+="\\"}else if(e[r-1]==='"'){a=true;n+='"'}else{a=false}}n+='"';return n.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let r='"';let t=true;for(let n=e.length;n>0;n--){r+=e[n-1];if(t&&e[n-1]==="\\"){r+="\\"}else if(e[n-1]==='"'){t=true;r+="\\"}else{t=false}}r+='"';return r.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const r={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};r.outStream=e.outStream||process.stdout;r.errStream=e.errStream||process.stderr;return r}_getSpawnOptions(e,r){e=e||{};const t={};t.cwd=e.cwd;t.env=e.env;t["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){t.argv0=`"${r}"`}return t}exec(){return n(this,void 0,void 0,function*(){if(!c.isRooted(this.toolPath)&&(this.toolPath.includes("/")||f&&this.toolPath.includes("\\"))){this.toolPath=u.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield s.which(this.toolPath,true);return new Promise((e,r)=>{this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const t=this._cloneExecOptions(this.options);if(!t.silent&&t.outStream){t.outStream.write(this._getCommandString(t)+a.EOL)}const n=new ExecState(t,this.toolPath);n.on("debug",e=>{this._debug(e)});const i=this._getSpawnFileName();const u=o.spawn(i,this._getSpawnArgs(t),this._getSpawnOptions(this.options,i));const s="";if(u.stdout){u.stdout.on("data",e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!t.silent&&t.outStream){t.outStream.write(e)}this._processLineBuffer(e,s,e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}})})}const c="";if(u.stderr){u.stderr.on("data",e=>{n.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!t.silent&&t.errStream&&t.outStream){const r=t.failOnStdErr?t.errStream:t.outStream;r.write(e)}this._processLineBuffer(e,c,e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}})})}u.on("error",e=>{n.processError=e.message;n.processExited=true;n.processClosed=true;n.CheckComplete()});u.on("exit",e=>{n.processExitCode=e;n.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);n.CheckComplete()});u.on("close",e=>{n.processExitCode=e;n.processExited=true;n.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);n.CheckComplete()});n.on("done",(t,n)=>{if(s.length>0){this.emit("stdline",s)}if(c.length>0){this.emit("errline",c)}u.removeAllListeners();if(t){r(t)}else{e(n)}})})})}}r.ToolRunner=ToolRunner;function argStringToArray(e){const r=[];let t=false;let n=false;let a="";function append(e){if(n&&e!=='"'){a+="\\"}a+=e;n=false}for(let i=0;i0){r.push(a);a=""}continue}append(o)}if(a.length>0){r.push(a.trim())}return r}r.argStringToArray=argStringToArray;class ExecState extends i.EventEmitter{constructor(e,r){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!r){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=r;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const r=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(r)}e._setResult()}}},11:function(e,r,t){"use strict";t.r(r);var n=t(622);var a=t.n(n);class action_Action{static get supportedPlatforms(){return["linux"]}static get isRunningLocally(){return process.env.RUNNER_WORKSPACE===undefined}static get isRunningFromSource(){return a().basename(__dirname)==="model"}static get name(){return"unity-builder"}static get rootFolder(){if(action_Action.isRunningFromSource){return a().dirname(a().dirname(a().dirname(__filename)))}return a().dirname(a().dirname(__filename))}static get actionFolder(){return`${action_Action.rootFolder}/action`}static get dockerfile(){return`${action_Action.actionFolder}/Dockerfile`}static get workspace(){return process.env.GITHUB_WORKSPACE}static checkCompatibility(){const e=process.platform;if(!action_Action.supportedPlatforms.includes(e)){throw new Error(`Currently ${e}-platform is not supported`)}}}var i=action_Action;class Platform{static get default(){return Platform.types.StandaloneWindows64}static get types(){return{StandaloneOSX:"StandaloneOSX",StandaloneWindows:"StandaloneWindows",StandaloneWindows64:"StandaloneWindows64",StandaloneLinux64:"StandaloneLinux64",iOS:"iOS",Android:"Android",WebGL:"WebGL",WSAPlayer:"WSAPlayer",PS4:"PS4",XboxOne:"XboxOne",tvOS:"tvOS",Switch:"Switch",Lumin:"Lumin",BJM:"BJM",Stadia:"Stadia",Facebook:"Facebook",NoTarget:"NoTarget",Test:"Test"}}static isWindows(e){switch(e){case Platform.types.StandaloneWindows:case Platform.types.StandaloneWindows64:return true;default:return false}}static isAndroid(e){switch(e){case Platform.types.Android:return true;default:return false}}}var o=Platform;class build_parameters_BuildParameters{static create(e){const{version:r,targetPlatform:t,projectPath:n,buildName:a,buildsPath:i,buildMethod:o,buildVersion:u,customParameters:s}=e;return{version:r,platform:t,projectPath:n,buildName:a,buildPath:`${i}/${t}`,buildFile:this.parseBuildFile(a,t),buildMethod:o,buildVersion:u,customParameters:s}}static parseBuildFile(e,r){if(o.isWindows(r)){return`${e}.exe`}if(o.isAndroid(r)){return`${e}.apk`}return e}}var u=build_parameters_BuildParameters;var s=t(747);var c=t.n(s);class Unity{static get libraryFolder(){return"Library"}}var f=Unity;var l=t(470);class NotImplementedException extends Error{constructor(e){super(e);this.name="NotImplementedException"}}var v=NotImplementedException;class ValidationError extends Error{constructor(e){super(e);this.name="ValidationError"}}var d=ValidationError;var p=t(986);class system_System{static async run(e,r,t){let n="";let a="";const i={stdout:e=>{n+=e.toString()},stderr:e=>{a+=e.toString()}};const o=await Object(p.exec)(e,r,{...t,listeners:i});if(o!==0){throw new Error(a)}return n}}var h=system_System;class versioning_Versioning{static get strategies(){return{None:"None",Semantic:"Semantic",Tag:"Tag",Custom:"Custom"}}static get branch(){return this.headRef||this.ref&&this.ref.slice(11)}static get headRef(){return process.env.GITHUB_HEAD_REF}static get ref(){return process.env.GITHUB_REF}static get descriptionRegex(){return/^v([\d.]+)-(\d+)-g(\w+)-?(\w+)*/g}static async determineVersion(e,r){if(!Object.hasOwnProperty.call(this.strategies,e)){throw new d(`Versioning strategy should be one of ${Object.values(this.strategies).join(", ")}.`)}let t;switch(e){case this.strategies.None:t="none";break;case this.strategies.Custom:t=r;break;case this.strategies.Semantic:t=await this.generateSemanticVersion();break;case this.strategies.Tag:t=await this.generateTagVersion();break;default:throw new v(`Strategy ${e} is not implemented.`)}return t}static async generateSemanticVersion(){await this.fetchAll();if(await this.isDirty()){throw new Error("Branch is dirty. Refusing to base semantic version on uncommitted changes")}if(!await this.hasAnyVersionTags()){const e=`0.0.${await this.getTotalNumberOfCommits()}`;Object(l.info)(`Generated version ${e} (no version tags found).`);return e}const{tag:e,commits:r,hash:t}=await this.parseSemanticVersion();Object(l.info)(`Found semantic version ${e}.${r} for ${this.branch}@${t}`);return`${e}.${r}`}static async generateTagVersion(){let e=await this.getTag();if(e.charAt(0)==="v"){e=e.slice(1)}return e}static async parseSemanticVersion(){const e=await this.getVersionDescription();try{const[r,t,n,a]=this.descriptionRegex.exec(e);return{match:r,tag:t,commits:n,hash:a}}catch(r){throw new Error(`Failed to parse git describe output: "${e}".`)}}static async fetchAll(){await h.run("git",["fetch","--all"])}static async getVersionDescription(){return h.run("git",["describe","--long","--tags","--always",`origin/${this.branch}`])}static async isDirty(){const e=await h.run("git",["status","--porcelain"]);return e!==""}static async getTag(){return h.run("git",["tag","--points-at","HEAD"])}static async hasAnyVersionTags(){const e=await h.run("git",["tag","--list","--merged","HEAD","|","grep v[0-9]*","|","wc -l"]);return e!=="0"}static async getTotalNumberOfCommits(){const e=await h.run("git",["rev-list","--count","HEAD"]);return parseInt(e,10)}}const y=t(470);class input_Input{static async getFromUser(){const e=y.getInput("unityVersion");const r=y.getInput("targetPlatform")||o.default;const t=y.getInput("projectPath")||".";const n=y.getInput("buildName")||r;const a=y.getInput("buildsPath")||"build";const i=y.getInput("buildMethod");const u=y.getInput("versioning")||"Semantic";const s=y.getInput("version")||"";const c=y.getInput("customParameters")||"";const f=t.replace(/\/$/,"");const l=await versioning_Versioning.determineVersion(u,s);return{version:e,targetPlatform:r,projectPath:f,buildName:n,buildsPath:a,buildMethod:i,buildVersion:l,customParameters:c}}}var g=input_Input;class project_Project{static get relativePath(){const e=g.getFromUser().then(e=>e.projectPath);return`${e}`}static get absolutePath(){const{workspace:e}=i;return`${e}/${this.relativePath}`}static get libraryFolder(){return`${this.relativePath}/${f.libraryFolder}`}}var b=project_Project;class cache_Cache{static verify(){if(!c().existsSync(b.libraryFolder)){this.notifyAboutCachingPossibility()}}static notifyAboutCachingPossibility(){if(i.isRunningLocally){return}console.log(`\n Library folder does not exist.\n Consider setting up caching to speed up your workflow\n If this is not your first build.`)}}var m=cache_Cache;var _=typeof global=="object"&&global&&global.Object===Object&&global;var w=_;var x=typeof self=="object"&&self&&self.Object===Object&&self;var S=w||x||Function("return this")();var O=S;var j=O.Symbol;var I=j;var A=Object.prototype;var E=A.hasOwnProperty;var k=A.toString;var P=I?I.toStringTag:undefined;function getRawTag(e){var r=E.call(e,P),t=e[P];try{e[P]=undefined;var n=true}catch(e){}var a=k.call(e);if(n){if(r){e[P]=t}else{delete e[P]}}return a}var C=getRawTag;var R=Object.prototype;var W=R.toString;function objectToString(e){return W.call(e)}var T=objectToString;var M="[object Null]",B="[object Undefined]";var D=I?I.toStringTag:undefined;function baseGetTag(e){if(e==null){return e===undefined?B:M}return D&&D in Object(e)?C(e):T(e)}var L=baseGetTag;function isObjectLike(e){return e!=null&&typeof e=="object"}var F=isObjectLike;var N="[object Symbol]";function isSymbol(e){return typeof e=="symbol"||F(e)&&L(e)==N}var $=isSymbol;var U=0/0;function baseToNumber(e){if(typeof e=="number"){return e}if($(e)){return U}return+e}var z=baseToNumber;function arrayMap(e,r){var t=-1,n=e==null?0:e.length,a=Array(n);while(++t0){if(++r>=mr){return arguments[0]}}else{r=0}return e.apply(undefined,arguments)}}var xr=shortOut;var Sr=xr(Ue);var Or=Sr;var jr=/\{\n\/\* \[wrapped with (.+)\] \*/,Ir=/,? & /;function getWrapDetails(e){var r=e.match(jr);return r?r[1].split(Ir):[]}var Ar=getWrapDetails;var Er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function insertWrapDetails(e,r){var t=r.length;if(!t){return e}var n=t-1;r[n]=(t>1?"& ":"")+r[n];r=r.join(t>2?", ":" ");return e.replace(Er,"{\n/* [wrapped with "+r+"] */\n")}var kr=insertWrapDetails;function constant(e){return function(){return e}}var Pr=constant;var Cr=function(){try{var e=Be(Object,"defineProperty");e({},"",{});return e}catch(e){}}();var Rr=Cr;var Wr=!Rr?pe:function(e,r){return Rr(e,"toString",{configurable:true,enumerable:false,value:Pr(r),writable:true})};var Tr=Wr;var Mr=xr(Tr);var Br=Mr;function arrayEach(e,r){var t=-1,n=e==null?0:e.length;while(++t-1}var Ur=arrayIncludes;var zr=1,qr=2,Hr=8,Vr=16,Gr=32,Kr=64,Zr=128,Xr=256,Yr=512;var Jr=[["ary",Zr],["bind",zr],["bindKey",qr],["curry",Hr],["curryRight",Vr],["flip",Yr],["partial",Gr],["partialRight",Kr],["rearg",Xr]];function updateWrapDetails(e,r){Dr(Jr,function(t){var n="_."+t[0];if(r&t[1]&&!Ur(e,n)){e.push(n)}});return e.sort()}var Qr=updateWrapDetails;function setWrapToString(e,r,t){var n=r+"";return Br(e,kr(n,Qr(Ar(n),t)))}var et=setWrapToString;var rt=1,tt=2,nt=4,at=8,it=32,ot=64;function createRecurry(e,r,t,n,a,i,o,u,s,c){var f=r&at,l=f?o:undefined,v=f?undefined:o,d=f?i:undefined,p=f?undefined:i;r|=f?it:ot;r&=~(f?ot:it);if(!(r&nt)){r&=~(rt|tt)}var h=[e,r,a,d,l,p,v,u,s,c];var y=t.apply(undefined,h);if(br(e)){Or(y,h)}y.placeholder=n;return et(y,e,r)}var ut=createRecurry;function getHolder(e){var r=e;return r.placeholder}var st=getHolder;var ct=9007199254740991;var ft=/^(?:0|[1-9]\d*)$/;function isIndex(e,r){var t=typeof e;r=r==null?ct:r;return!!r&&(t=="number"||t!="symbol"&&ft.test(e))&&(e>-1&&e%1==0&&e1){g.reverse()}if(f&&s-1&&e%1==0&&e<=rn}var tn=isLength;function isArrayLike(e){return e!=null&&tn(e.length)&&!me(e)}var nn=isArrayLike;function isIterateeCall(e,r,t){if(!ee(t)){return false}var n=typeof r;if(n=="number"?nn(t)&<(r,t.length):n=="string"&&r in t){return Gt(t[r],e)}return false}var an=isIterateeCall;function createAssigner(e){return en(function(r,t){var n=-1,a=t.length,i=a>1?t[a-1]:undefined,o=a>2?t[2]:undefined;i=e.length>3&&typeof i=="function"?(a--,i):undefined;if(o&&an(t[0],t[1],o)){i=a<3?undefined:i;a=1}r=Object(r);while(++n-1}var ri=listCacheHas;function listCacheSet(e,r){var t=this.__data__,n=Xa(t,e);if(n<0){++this.size;t.push([e,r])}else{t[n][1]=r}return this}var ti=listCacheSet;function ListCache(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r0&&t(u)){if(r>1){baseFlatten(u,r-1,t,n,a)}else{ki(a,u)}}else if(!n){a[a.length]=u}}return a}var Ri=baseFlatten;function flatten(e){var r=e==null?0:e.length;return r?Ri(e,1):[]}var Wi=flatten;function flatRest(e){return Br(Qt(e,undefined,Wi),e+"")}var Ti=flatRest;var Mi=Ti(Ei);var Bi=Mi;var Di=fa(Object.getPrototypeOf,Object);var Li=Di;var Fi="[object Object]";var Ni=Function.prototype,$i=Object.prototype;var Ui=Ni.toString;var zi=$i.hasOwnProperty;var qi=Ui.call(Object);function isPlainObject(e){if(!F(e)||L(e)!=Fi){return false}var r=Li(e);if(r===null){return true}var t=zi.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Ui.call(t)==qi}var Hi=isPlainObject;var Vi="[object DOMException]",Gi="[object Error]";function isError(e){if(!F(e)){return false}var r=L(e);return r==Gi||r==Vi||typeof e.message=="string"&&typeof e.name=="string"&&!Hi(e)}var Ki=isError;var Zi=en(function(e,r){try{return Ze(e,undefined,r)}catch(e){return Ki(e)?e:new Error(e)}});var Xi=Zi;var Yi="Expected a function";function before(e,r){var t;if(typeof r!="function"){throw new TypeError(Yi)}e=le(e);return function(){if(--e>0){t=r.apply(this,arguments)}if(e<=1){r=undefined}return t}}var Ji=before;var Qi=1,eo=32;var ro=en(function(e,r,t){var n=Qi;if(t.length){var a=ht(t,st(ro));n|=eo}return zt(e,n,r,t,a)});ro.placeholder={};var to=ro;var no=Ti(function(e,r){Dr(r,function(r){r=ji(r);Vt(e,r,to(e[r],e))});return e});var ao=no;var io=1,oo=2,uo=32;var so=en(function(e,r,t){var n=io|oo;if(t.length){var a=ht(t,st(so));n|=uo}return zt(r,n,e,t,a)});so.placeholder={};var co=so;function baseSlice(e,r,t){var n=-1,a=e.length;if(r<0){r=-r>a?0:a+r}t=t>a?a:t;if(t<0){t+=a}a=r>t?0:t-r>>>0;r>>>=0;var i=Array(a);while(++n=n?e:fo(e,r,t)}var lo=castSlice;var vo="\\ud800-\\udfff",po="\\u0300-\\u036f",ho="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",go=po+ho+yo,bo="\\ufe0e\\ufe0f";var mo="\\u200d";var _o=RegExp("["+mo+vo+go+bo+"]");function hasUnicode(e){return _o.test(e)}var wo=hasUnicode;function asciiToArray(e){return e.split("")}var xo=asciiToArray;var So="\\ud800-\\udfff",Oo="\\u0300-\\u036f",jo="\\ufe20-\\ufe2f",Io="\\u20d0-\\u20ff",Ao=Oo+jo+Io,Eo="\\ufe0e\\ufe0f";var ko="["+So+"]",Po="["+Ao+"]",Co="\\ud83c[\\udffb-\\udfff]",Ro="(?:"+Po+"|"+Co+")",Wo="[^"+So+"]",To="(?:\\ud83c[\\udde6-\\uddff]){2}",Mo="[\\ud800-\\udbff][\\udc00-\\udfff]",Bo="\\u200d";var Do=Ro+"?",Lo="["+Eo+"]?",Fo="(?:"+Bo+"(?:"+[Wo,To,Mo].join("|")+")"+Lo+Do+")*",No=Lo+Do+Fo,$o="(?:"+[Wo+Po+"?",Po,To,Mo,ko].join("|")+")";var Uo=RegExp(Co+"(?="+Co+")|"+$o+No,"g");function unicodeToArray(e){return e.match(Uo)||[]}var zo=unicodeToArray;function stringToArray(e){return wo(e)?zo(e):xo(e)}var qo=stringToArray;function createCaseFirst(e){return function(r){r=xi(r);var t=wo(r)?qo(r):undefined;var n=t?t[0]:r.charAt(0);var a=t?lo(t,1).join(""):r.slice(1);return n[e]()+a}}var Ho=createCaseFirst;var Vo=Ho("toUpperCase");var Go=Vo;function capitalize(e){return Go(xi(e).toLowerCase())}var Ko=capitalize;function arrayReduce(e,r,t,n){var a=-1,i=e==null?0:e.length;if(n&&i){t=e[++a]}while(++a=r?e:r}}return e}var hs=baseClamp;function clamp(e,r,t){if(t===undefined){t=r;r=undefined}if(t!==undefined){t=ue(t);t=t===t?t:0}if(r!==undefined){r=ue(r);r=r===r?r:0}return hs(ue(e),r,t)}var ys=clamp;function stackClear(){this.__data__=new ni;this.size=0}var gs=stackClear;function stackDelete(e){var r=this.__data__,t=r["delete"](e);this.size=r.size;return t}var bs=stackDelete;function stackGet(e){return this.__data__.get(e)}var ms=stackGet;function stackHas(e){return this.__data__.has(e)}var _s=stackHas;var ws=200;function stackSet(e,r){var t=this.__data__;if(t instanceof ni){var n=t.__data__;if(!ii||n.lengthu)){return false}var c=i.get(e);if(c&&i.get(r)){return c==r}var f=-1,l=true,v=t&el?new Xf:undefined;i.set(e,r);i.set(r,e);while(++f=r||t<0||l&&n>=i}function timerExpired(){var e=xv();if(shouldInvoke(e)){return trailingEdge(e)}u=setTimeout(timerExpired,remainingWait(e))}function trailingEdge(e){u=undefined;if(v&&n){return invokeFunc(e)}n=a=undefined;return o}function cancel(){if(u!==undefined){clearTimeout(u)}c=0;n=s=a=u=undefined}function flush(){return u===undefined?o:trailingEdge(xv())}function debounced(){var e=xv(),t=shouldInvoke(e);n=arguments;a=this;s=e;if(t){if(u===undefined){return leadingEdge(s)}if(l){clearTimeout(u);u=setTimeout(timerExpired,r);return invokeFunc(s)}}if(u===undefined){u=setTimeout(timerExpired,r)}return o}debounced.cancel=cancel;debounced.flush=flush;return debounced}var Iv=debounce;function defaultTo(e,r){return e==null||e!==e?r:e}var Av=defaultTo;var Ev=Object.prototype;var kv=Ev.hasOwnProperty;var Pv=en(function(e,r){e=Object(e);var t=-1;var n=r.length;var a=n>2?r[2]:undefined;if(a&&an(r[0],r[1],a)){n=1}while(++t=Xv){i=Jf;o=false;r=new Xf(r)}e:while(++a=0&&e.slice(t,a)==r}var wd=endsWith;function baseToPairs(e,r){return q(r,function(r){return[r,e[r]]})}var xd=baseToPairs;function setToPairs(e){var r=-1,t=Array(e.size);e.forEach(function(e){t[++r]=[e,e]});return t}var Sd=setToPairs;var Od="[object Map]",jd="[object Set]";function createToPairs(e){return function(r){var t=lc(r);if(t==Od){return tl(r)}if(t==jd){return Sd(r)}return xd(r,e(r))}}var Id=createToPairs;var Ad=Id(ya);var Ed=Ad;var kd=Id(ja);var Pd=kd;var Cd={"&":"&","<":"<",">":">",'"':""","'":"'"};var Rd=Xo(Cd);var Wd=Rd;var Td=/[&<>"']/g,Md=RegExp(Td.source);function escape_escape(e){e=xi(e);return e&&Md.test(e)?e.replace(Td,Wd):e}var Bd=escape_escape;var Dd=/[\\^$.*+?()[\]{}|]/g,Ld=RegExp(Dd.source);function escapeRegExp(e){e=xi(e);return e&&Ld.test(e)?e.replace(Dd,"\\$&"):e}var Fd=escapeRegExp;function arrayEvery(e,r){var t=-1,n=e==null?0:e.length;while(++ta?0:a+t}n=n===undefined||n>a?a:le(n);if(n<0){n+=a}n=t>n?0:qd(n);while(t-1?a[i?r[o]:o]:undefined}}var Zd=createFind;var Xd=Math.max;function findIndex(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=t==null?0:le(t);if(a<0){a=Xd(n+a,0)}return Lr(e,Kl(r,3),a)}var Yd=findIndex;var Jd=Zd(Yd);var Qd=Jd;function baseFindKey(e,r,t){var n;t(e,function(e,t,a){if(r(e,t,a)){n=t;return false}});return n}var ep=baseFindKey;function findKey(e,r){return ep(e,Kl(r,3),ov)}var rp=findKey;var tp=Math.max,np=Math.min;function findLastIndex(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=n-1;if(t!==undefined){a=le(t);a=t<0?tp(n+a,0):np(a,n-1)}return Lr(e,Kl(r,3),a,true)}var ap=findLastIndex;var ip=Zd(ap);var op=ip;function findLastKey(e,r){return ep(e,Kl(r,3),gd)}var up=findLastKey;function head(e){return e&&e.length?e[0]:undefined}var sp=head;function baseMap(e,r){var t=-1,n=nn(e)?Array(e.length):[];cv(e,function(e,a,i){n[++t]=r(e,a,i)});return n}var cp=baseMap;function map_map(e,r){var t=V(e)?q:cp;return t(e,Kl(r,3))}var fp=map_map;function flatMap(e,r){return Ri(fp(e,r),1)}var lp=flatMap;var vp=1/0;function flatMapDeep(e,r){return Ri(fp(e,r),vp)}var dp=flatMapDeep;function flatMapDepth(e,r,t){t=t===undefined?1:le(t);return Ri(fp(e,r),t)}var pp=flatMapDepth;var hp=1/0;function flattenDeep(e){var r=e==null?0:e.length;return r?Ri(e,hp):[]}var yp=flattenDeep;function flattenDepth(e,r){var t=e==null?0:e.length;if(!t){return[]}r=r===undefined?1:le(r);return Ri(e,r)}var gp=flattenDepth;var bp=512;function flip(e){return zt(e,bp)}var mp=flip;var _p=ss("floor");var wp=_p;var xp="Expected a function";var Sp=8,Op=32,jp=128,Ip=256;function createFlow(e){return Ti(function(r){var t=r.length,n=t,a=vr.prototype.thru;if(e){r.reverse()}while(n--){var i=r[n];if(typeof i!="function"){throw new TypeError(xp)}if(a&&!o&&lr(i)=="wrapper"){var o=new vr([],true)}}n=o?n:t;while(++nr}var qp=baseGt;function createRelationalOperation(e){return function(r,t){if(!(typeof r=="string"&&typeof t=="string")){r=ue(r);t=ue(t)}return e(r,t)}}var Hp=createRelationalOperation;var Vp=Hp(qp);var Gp=Vp;var Kp=Hp(function(e,r){return e>=r});var Zp=Kp;var Xp=Object.prototype;var Yp=Xp.hasOwnProperty;function baseHas(e,r){return e!=null&&Yp.call(e,r)}var Jp=baseHas;function has(e,r){return e!=null&&Nl(e,r,Jp)}var Qp=has;var eh=Math.max,rh=Math.min;function baseInRange(e,r,t){return e>=rh(r,t)&&e-1:!!a&&$r(e,r,t)>-1}var ch=includes_includes;var fh=Math.max;function indexOf_indexOf(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=t==null?0:le(t);if(a<0){a=fh(n+a,0)}return $r(e,r,a)}var lh=indexOf_indexOf;function initial(e){var r=e==null?0:e.length;return r?fo(e,0,-1):[]}var vh=initial;var dh=Math.min;function baseIntersection(e,r,t){var n=t?Zv:Ur,a=e[0].length,i=e.length,o=i,u=Array(i),s=Infinity,c=[];while(o--){var f=e[o];if(o&&r){f=q(f,Yn(r))}s=dh(f.length,s);u[o]=!t&&(r||a>=120&&f.length>=120)?new Xf(o&&f):undefined}f=e[0];var l=-1,v=u[0];e:while(++l=-Oy&&e<=Oy}var jy=isSafeInteger;function isUndefined(e){return e===undefined}var Iy=isUndefined;var Ay="[object WeakMap]";function isWeakMap(e){return F(e)&&lc(e)==Ay}var Ey=isWeakMap;var ky="[object WeakSet]";function isWeakSet(e){return F(e)&&L(e)==ky}var Py=isWeakSet;var Cy=1;function iteratee_iteratee(e){return Kl(typeof e=="function"?e:Wf(e,Cy))}var Ry=iteratee_iteratee;var Wy=Array.prototype;var Ty=Wy.join;function join(e,r){return e==null?"":Ty.call(e,r)}var My=join;var By=ts(function(e,r,t){return e+(t?"-":"")+r.toLowerCase()});var Dy=By;var Ly=lv(function(e,r,t){Vt(e,t,r)});var Fy=Ly;function strictLastIndexOf(e,r,t){var n=t+1;while(n--){if(e[n]===r){return n}}return n}var Ny=strictLastIndexOf;var $y=Math.max,Uy=Math.min;function lastIndexOf(e,r,t){var n=e==null?0:e.length;if(!n){return-1}var a=n;if(t!==undefined){a=le(t);a=a<0?$y(n+a,0):Uy(a,n-1)}return r===r?Ny(e,r,a):Lr(e,Fr,a,true)}var zy=lastIndexOf;var qy=ts(function(e,r,t){return e+(t?" ":"")+r.toLowerCase()});var Hy=qy;var Vy=Ho("toLowerCase");var Gy=Vy;function baseLt(e,r){return e=this.__values__.length,r=e?undefined:this.__values__[this.__index__++];return{done:e,value:r}}var Cg=wrapperNext;function baseNth(e,r){var t=e.length;if(!t){return}r+=r<0?t:0;return lt(r,t)?e[r]:undefined}var Rg=baseNth;function nth(e,r){return e&&e.length?Rg(e,le(r)):undefined}var Wg=nth;function nthArg(e){e=le(e);return en(function(r){return Rg(r,e)})}var Tg=nthArg;function baseUnset(e,r){r=Si(r,e);e=Wh(e,r);return e==null||delete e[ji(ed(r))]}var Mg=baseUnset;function customOmitClone(e){return Hi(e)?undefined:e}var Bg=customOmitClone;var Dg=1,Lg=2,Fg=4;var Ng=Ti(function(e,r){var t={};if(e==null){return t}var n=false;r=q(r,function(r){r=Si(r,e);n||(n=r.length>1);return r});Yt(e,Vs(e),t);if(n){t=Wf(t,Dg|Lg|Fg,Bg)}var a=r.length;while(a--){Mg(t,r[a])}return t});var $g=Ng;function baseSet(e,r,t,n){if(!ee(e)){return e}r=Si(r,e);var a=-1,i=r.length,o=i-1,u=e;while(u!=null&&++ar||i&&o&&s&&!u&&!c||n&&o&&s||!t&&s||!a){return 1}if(!n&&!i&&!c&&e=u){return s}var c=t[n];return s*(c=="desc"?-1:1)}}return e.index-r.index}var Zg=compareMultiple;function baseOrderBy(e,r,t){var n=-1;r=q(r.length?r:[pe],Yn(Kl));var a=cp(e,function(e,t,a){var i=q(r,function(r){return r(e)});return{criteria:i,index:++n,value:e}});return Gg(a,function(e,r){return Zg(e,r,t)})}var Xg=baseOrderBy;function orderBy(e,r,t,n){if(e==null){return[]}if(!V(r)){r=r==null?[]:[r]}t=n?undefined:t;if(!V(t)){t=t==null?[]:[t]}return Xg(e,r,t)}var Yg=orderBy;function createOver(e){return Ti(function(r){r=q(r,Yn(Kl));return en(function(t){var n=this;return e(r,function(e){return Ze(e,n,t)})})})}var Jg=createOver;var Qg=Jg(q);var eb=Qg;var rb=en;var tb=rb;var nb=Math.min;var ab=tb(function(e,r){r=r.length==1&&V(r[0])?q(r[0],Yn(Kl)):q(Ri(r,1),Yn(Kl));var t=r.length;return en(function(n){var a=-1,i=nb(n.length,t);while(++afb){return t}do{if(r%2){t+=e}r=lb(r/2);if(r){e+=e}}while(r);return t}var vb=baseRepeat;var db=Hl("length");var pb=db;var hb="\\ud800-\\udfff",yb="\\u0300-\\u036f",gb="\\ufe20-\\ufe2f",bb="\\u20d0-\\u20ff",mb=yb+gb+bb,_b="\\ufe0e\\ufe0f";var wb="["+hb+"]",xb="["+mb+"]",Sb="\\ud83c[\\udffb-\\udfff]",Ob="(?:"+xb+"|"+Sb+")",jb="[^"+hb+"]",Ib="(?:\\ud83c[\\udde6-\\uddff]){2}",Ab="[\\ud800-\\udbff][\\udc00-\\udfff]",Eb="\\u200d";var kb=Ob+"?",Pb="["+_b+"]?",Cb="(?:"+Eb+"(?:"+[jb,Ib,Ab].join("|")+")"+Pb+kb+")*",Rb=Pb+kb+Cb,Wb="(?:"+[jb+xb+"?",xb,Ib,Ab,wb].join("|")+")";var Tb=RegExp(Sb+"(?="+Sb+")|"+Wb+Rb,"g");function unicodeSize(e){var r=Tb.lastIndex=0;while(Tb.test(e)){++r}return r}var Mb=unicodeSize;function stringSize(e){return wo(e)?Mb(e):pb(e)}var Bb=stringSize;var Db=Math.ceil;function createPadding(e,r){r=r===undefined?" ":X(r);var t=r.length;if(t<2){return t?vb(r,e):r}var n=vb(r,Db(e/Bb(r)));return wo(r)?lo(qo(n),0,e).join(""):n.slice(0,e)}var Lb=createPadding;var Fb=Math.ceil,Nb=Math.floor;function pad(e,r,t){e=xi(e);r=le(r);var n=r?Bb(e):0;if(!r||n>=r){return e}var a=(r-n)/2;return Lb(Nb(a),t)+e+Lb(Fb(a),t)}var $b=pad;function padEnd(e,r,t){e=xi(e);r=le(r);var n=r?Bb(e):0;return r&&n-1){if(u!==e){sm.call(u,s,1)}sm.call(e,s,1)}}return e}var cm=basePullAll;function pullAll(e,r){return e&&e.length&&r&&r.length?cm(e,r):e}var fm=pullAll;var lm=en(fm);var vm=lm;function pullAllBy(e,r,t){return e&&e.length&&r&&r.length?cm(e,r,Kl(t,2)):e}var dm=pullAllBy;function pullAllWith(e,r,t){return e&&e.length&&r&&r.length?cm(e,r,undefined,t):e}var pm=pullAllWith;var hm=Array.prototype;var ym=hm.splice;function basePullAt(e,r){var t=e?r.length:0,n=t-1;while(t--){var a=r[t];if(t==n||a!==i){var i=a;if(lt(a)){ym.call(e,a,1)}else{Mg(e,a)}}}return e}var gm=basePullAt;var bm=Ti(function(e,r){var t=e==null?0:e.length,n=Ei(e,r);gm(e,q(r,function(e){return lt(e,t)?+e:e}).sort(Kg));return n});var mm=bm;var _m=Math.floor,wm=Math.random;function baseRandom(e,r){return e+_m(wm()*(r-e+1))}var xm=baseRandom;var Sm=parseFloat;var Om=Math.min,jm=Math.random;function random(e,r,t){if(t&&typeof t!="boolean"&&an(e,r,t)){r=t=undefined}if(t===undefined){if(typeof r=="boolean"){t=r;r=undefined}else if(typeof e=="boolean"){t=e;e=undefined}}if(e===undefined&&r===undefined){e=0;r=1}else{e=fe(e);if(r===undefined){r=e;e=0}else{r=fe(r)}}if(e>r){var n=e;e=r;r=n}if(t||e%1||r%1){var a=jm();return Om(e+a*(r-e+Sm("1e-"+((a+"").length-1))),r)}return xm(e,r)}var Im=random;var Am=Math.ceil,Em=Math.max;function baseRange(e,r,t,n){var a=-1,i=Em(Am((r-e)/(t||1)),0),o=Array(i);while(i--){o[n?i:++a]=e;e+=t}return o}var km=baseRange;function createRange(e){return function(r,t,n){if(n&&typeof n!="number"&&an(r,t,n)){t=n=undefined}r=fe(r);if(t===undefined){t=r;r=0}else{t=fe(t)}n=n===undefined?r1&&an(e,r[0],r[1])){r=[]}else if(t>2&&an(r[0],r[1],r[2])){r=[r[0]]}return Xg(e,Ri(r,1),[])});var w_=__;var x_=4294967295,S_=x_-1;var O_=Math.floor,j_=Math.min;function baseSortedIndexBy(e,r,t,n){r=t(r);var a=0,i=e==null?0:e.length,o=r!==r,u=r===null,s=$(r),c=r===undefined;while(a>>1;function baseSortedIndex(e,r,t){var n=0,a=e==null?n:e.length;if(typeof r=="number"&&r===r&&a<=E_){while(n>>1,o=e[i];if(o!==null&&!$(o)&&(t?o<=r:o>>0;if(!t){return[]}e=xi(e);if(e&&(typeof r=="string"||r!=null&&!Sy(r))){r=X(r);if(!r&&wo(e)){return lo(qo(e),0,t)}}return e.split(r,t)}var N_=split;var $_="Expected a function";var U_=Math.max;function spread(e,r){if(typeof e!="function"){throw new TypeError($_)}r=r==null?0:U_(le(r),0);return en(function(t){var n=t[r],a=lo(t,0,r);if(n){ki(a,n)}return Ze(e,this,a)})}var z_=spread;var q_=ts(function(e,r,t){return e+(t?" ":"")+Go(r)});var H_=q_;function startsWith(e,r,t){e=xi(e);t=t==null?0:hs(le(t),0,e.length);r=X(r);return e.slice(t,t+r.length)==r}var V_=startsWith;function stubObject(){return{}}var G_=stubObject;function stubString(){return""}var K_=stubString;function stubTrue(){return true}var Z_=stubTrue;var X_=Y(function(e,r){return e-r},0);var Y_=X_;function sum(e){return e&&e.length?sg(e,pe):0}var J_=sum;function sumBy(e,r){return e&&e.length?sg(e,Kl(r,2)):0}var Q_=sumBy;function tail(e){var r=e==null?0:e.length;return r?fo(e,1,r):[]}var ew=tail;function take(e,r,t){if(!(e&&e.length)){return[]}r=t||r===undefined?1:le(r);return fo(e,0,r<0?0:r)}var rw=take;function takeRight(e,r,t){var n=e==null?0:e.length;if(!n){return[]}r=t||r===undefined?1:le(r);r=n-r;return fo(e,r<0?0:r,n)}var tw=takeRight;function takeRightWhile(e,r){return e&&e.length?cd(e,Kl(r,3),false,true):[]}var nw=takeRightWhile;function takeWhile(e,r){return e&&e.length?cd(e,Kl(r,3)):[]}var aw=takeWhile;function tap(e,r){r(e);return e}var iw=tap;var ow=Object.prototype;var uw=ow.hasOwnProperty;function customDefaultsAssignIn(e,r,t,n){if(e===undefined||Gt(e,ow[t])&&!uw.call(n,t)){return r}return e}var sw=customDefaultsAssignIn;var cw={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function escapeStringChar(e){return"\\"+cw[e]}var fw=escapeStringChar;var lw=/<%=([\s\S]+?)%>/g;var vw=lw;var dw=/<%-([\s\S]+?)%>/g;var pw=dw;var hw=/<%([\s\S]+?)%>/g;var yw=hw;var gw={escape:pw,evaluate:yw,interpolate:vw,variable:"",imports:{_:{escape:Bd}}};var bw=gw;var mw=/\b__p \+= '';/g,_w=/\b(__p \+=) '' \+/g,ww=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var xw=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Sw=/($^)/;var Ow=/['\n\r\u2028\u2029\\]/g;var jw=Object.prototype;var Iw=jw.hasOwnProperty;function template(e,r,t){var n=bw.imports._.templateSettings||bw;if(t&&an(e,r,t)){r=undefined}e=xi(e);r=ka({},r,n,sw);var a=ka({},r.imports,n.imports,sw),i=ya(a),o=oh(a,i);var u,s,c=0,f=r.interpolate||Sw,l="__p += '";var v=RegExp((r.escape||Sw).source+"|"+f.source+"|"+(f===vw?xw:Sw).source+"|"+(r.evaluate||Sw).source+"|$","g");var d=Iw.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/[\r\n]/g," ")+"\n":"";e.replace(v,function(r,t,n,a,i,o){n||(n=a);l+=e.slice(c,o).replace(Ow,fw);if(t){u=true;l+="' +\n__e("+t+") +\n'"}if(i){s=true;l+="';\n"+i+";\n__p += '"}if(n){l+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"}c=o+r.length;return r});l+="';\n";var p=Iw.call(r,"variable")&&r.variable;if(!p){l="with (obj) {\n"+l+"\n}\n"}l=(s?l.replace(mw,""):l).replace(_w,"$1").replace(ww,"$1;");l="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var h=Xi(function(){return Function(i,d+"return "+l).apply(undefined,o)});h.source=l;if(Ki(h)){throw h}return h}var Aw=template;var Ew="Expected a function";function throttle(e,r,t){var n=true,a=true;if(typeof e!="function"){throw new TypeError(Ew)}if(ee(t)){n="leading"in t?!!t.leading:n;a="trailing"in t?!!t.trailing:a}return Iv(e,r,{leading:n,maxWait:r,trailing:a})}var kw=throttle;function thru(e,r){return r(e)}var Pw=thru;var Cw=9007199254740991;var Rw=4294967295;var Ww=Math.min;function times(e,r){e=le(e);if(e<1||e>Cw){return[]}var t=Rw,n=Ww(e,Rw);r=vd(r);e-=Rw;var a=cn(n,r);while(++t-1){}return t}var qw=charsEndIndex;function charsStartIndex(e,r){var t=-1,n=e.length;while(++t-1){}return t}var Hw=charsStartIndex;var Vw=/^\s+|\s+$/g;function trim(e,r,t){e=xi(e);if(e&&(t||r===undefined)){return e.replace(Vw,"")}if(!e||!(r=X(r))){return e}var n=qo(e),a=qo(r),i=Hw(n,a),o=qw(n,a)+1;return lo(n,i,o).join("")}var Gw=trim;var Kw=/\s+$/;function trimEnd(e,r,t){e=xi(e);if(e&&(t||r===undefined)){return e.replace(Kw,"")}if(!e||!(r=X(r))){return e}var n=qo(e),a=qw(n,qo(r))+1;return lo(n,0,a).join("")}var Zw=trimEnd;var Xw=/^\s+/;function trimStart(e,r,t){e=xi(e);if(e&&(t||r===undefined)){return e.replace(Xw,"")}if(!e||!(r=X(r))){return e}var n=qo(e),a=Hw(n,qo(r));return lo(n,a).join("")}var Yw=trimStart;var Jw=30,Qw="...";var ex=/\w*$/;function truncate(e,r){var t=Jw,n=Qw;if(ee(r)){var a="separator"in r?r.separator:a;t="length"in r?le(r.length):t;n="omission"in r?X(r.omission):n}e=xi(e);var i=e.length;if(wo(e)){var o=qo(e);i=o.length}if(t>=i){return e}var u=t-Bb(n);if(u<1){return n}var s=o?lo(o,0,u).join(""):e.slice(0,u);if(a===undefined){return s+n}if(o){u+=s.length-u}if(Sy(a)){if(e.slice(u).search(a)){var c,f=s;if(!a.global){a=RegExp(a.source,xi(ex.exec(a))+"g")}a.lastIndex=0;while(c=a.exec(f)){var l=c.index}s=s.slice(0,l===undefined?u:l)}}else if(e.indexOf(X(a),u)!=u){var v=s.lastIndexOf(a);if(v>-1){s=s.slice(0,v)}}return s+n}var rx=truncate;function unary(e){return Ht(e,1)}var tx=unary;var nx={"&":"&","<":"<",">":">",""":'"',"'":"'"};var ax=Xo(nx);var ix=ax;var ox=/&(?:amp|lt|gt|quot|#39);/g,ux=RegExp(ox.source);function unescape_unescape(e){e=xi(e);return e&&ux.test(e)?e.replace(ox,ix):e}var sx=unescape_unescape;var cx=1/0;var fx=!(Js&&1/nl(new Js([,-0]))[1]==cx)?ar:function(e){return new Js(e)};var lx=fx;var vx=200;function baseUniq(e,r,t){var n=-1,a=Ur,i=e.length,o=true,u=[],s=u;if(t){o=false;a=Zv}else if(i>=vx){var c=r?null:lx(e);if(c){return nl(c)}o=false;a=Jf;s=new Xf}else{s=r?[]:u}e:while(++n1||this.__actions__.length||!(n instanceof nr)||!lt(t)){return this.thru(a)}n=n.slice(t,+t+(r?1:0));n.__actions__.push({func:Pw,args:[a],thisArg:undefined});return new vr(n,this.__chain__).thru(function(e){if(r&&!e.length){e.push(undefined)}return e})});var Fx=Lx;function wrapperChain(){return ls(this)}var Nx=wrapperChain;function wrapperReverse(){var e=this.__wrapped__;if(e instanceof nr){var r=e;if(this.__actions__.length){r=new nr(this)}r=r.reverse();r.__actions__.push({func:Pw,args:[Ym],thisArg:undefined});return new vr(r,this.__chain__)}return this.thru(Ym)}var $x=wrapperReverse;function baseXor(e,r,t){var n=e.length;if(n<2){return n?dx(e[0]):[]}var a=-1,i=Array(n);while(++a1?e[r-1]:undefined;t=typeof t=="function"?(e.pop(),t):undefined;return Ex(e,t)});var rS=eS;var tS={chunk:ps,compact:Hf,concat:Vf,difference:Qv,differenceBy:td,differenceWith:ad,drop:ud,dropRight:sd,dropRightWhile:fd,dropWhile:ld,fill:Vd,findIndex:Yd,findLastIndex:ap,first:sp,flatten:Wi,flattenDeep:yp,flattenDepth:gp,fromPairs:Bp,head:sp,indexOf:lh,initial:vh,intersection:gh,intersectionBy:mh,intersectionWith:wh,join:My,last:ed,lastIndexOf:zy,nth:Wg,pull:vm,pullAll:fm,pullAllBy:dm,pullAllWith:pm,pullAt:mm,remove:zm,reverse:Ym,slice:h_,sortedIndex:P_,sortedIndexBy:C_,sortedIndexOf:R_,sortedLastIndex:W_,sortedLastIndexBy:T_,sortedLastIndexOf:M_,sortedUniq:D_,sortedUniqBy:L_,tail:ew,take:rw,takeRight:tw,takeRightWhile:nw,takeWhile:aw,union:hx,unionBy:gx,unionWith:mx,uniq:_x,uniqBy:wx,uniqWith:xx,unzip:Ax,unzipWith:Ex,without:Bx,xor:qx,xorBy:Vx,xorWith:Kx,zip:Xx,zipObject:Jx,zipObjectDeep:Qx,zipWith:rS};var nS={countBy:hv,each:dd,eachRight:_d,every:Ud,filter:Kd,find:Qd,findLast:op,flatMap:lp,flatMapDeep:dp,flatMapDepth:pp,forEach:dd,forEachRight:_d,groupBy:zp,includes:ch,invokeMap:Lh,keyBy:Fy,map:fp,orderBy:Yg,partition:em,reduce:Fm,reduceRight:$m,reject:Um,sample:t_,sampleSize:o_,shuffle:l_,size:p_,some:m_,sortBy:w_};var aS={now:xv};var iS={after:de,ary:Ht,before:Ji,bind:to,bindKey:co,curry:bv,curryRight:_v,debounce:Iv,defer:Vv,delay:Kv,flip:mp,memoize:hi,negate:jg,once:Vg,overArgs:ib,partial:Zb,partialRight:Jb,rearg:Dm,rest:Gm,spread:z_,throttle:kw,unary:tx,wrap:Dx};var oS={castArray:is,clone:Mf,cloneDeep:Lf,cloneDeepWith:$f,cloneWith:zf,conformsTo:rv,eq:Gt,gt:Gp,gte:Zp,isArguments:yn,isArray:V,isArrayBuffer:zh,isArrayLike:nn,isArrayLikeObject:Wv,isBoolean:Hh,isBuffer:On,isDate:Xh,isElement:Yh,isEmpty:ty,isEqual:ny,isEqualWith:ay,isError:Ki,isFinite:oy,isFunction:me,isInteger:uy,isLength:tn,isMap:Xc,isMatch:sy,isMatchWith:cy,isNaN:vy,isNative:yy,isNil:gy,isNull:by,isNumber:ly,isObject:ee,isObjectLike:F,isPlainObject:Hi,isRegExp:Sy,isSafeInteger:jy,isSet:rf,isString:ih,isSymbol:$,isTypedArray:oa,isUndefined:Iy,isWeakMap:Ey,isWeakSet:Py,lt:Xy,lte:Jy,toArray:Pg,toFinite:fe,toInteger:le,toLength:qd,toNumber:ue,toPlainObject:Mv,toSafeInteger:$w,toString:xi};var uS={add:Q,ceil:fs,divide:od,floor:wp,max:og,maxBy:ug,mean:lg,meanBy:vg,min:mg,minBy:_g,multiply:Sg,round:Qm,subtract:Y_,sum:J_,sumBy:Q_};var sS={clamp:ys,inRange:nh,random:Im};var cS={assign:_a,assignIn:Aa,assignInWith:ka,assignWith:Ca,at:Bi,create:yv,defaults:Cv,defaultsDeep:Uv,entries:Ed,entriesIn:Pd,extend:Aa,extendWith:ka,findKey:rp,findLastKey:up,forIn:Rp,forInRight:Wp,forOwn:Tp,forOwnRight:Mp,functions:Lp,functionsIn:Fp,get:Ai,has:Qp,hasIn:$l,invert:Ah,invertBy:Rh,invoke:Bh,keys:ya,keysIn:ja,mapKeys:Qy,mapValues:eg,merge:pg,mergeWith:Nv,omit:$g,omitBy:Hg,pick:nm,pickBy:qg,result:Km,set:u_,setWith:s_,toPairs:Ed,toPairsIn:Pd,transform:zw,unset:jx,update:Px,updateWith:Cx,values:uh,valuesIn:Tx};var fS={at:Fx,chain:ls,commit:qf,lodash:gr,next:Cg,plant:am,reverse:$x,tap:iw,thru:Pw,toIterator:Mw,toJSON:Dw,value:Dw,valueOf:Dw,wrapperChain:Nx};var lS={camelCase:as,capitalize:Ko,deburr:uu,endsWith:wd,escape:Bd,escapeRegExp:Fd,kebabCase:Dy,lowerCase:Hy,lowerFirst:Gy,pad:$b,padEnd:Ub,padStart:zb,parseInt:Vb,repeat:qm,replace:Hm,snakeCase:g_,split:N_,startCase:H_,startsWith:V_,template:Aw,templateSettings:bw,toLower:Lw,toUpper:Uw,trim:Gw,trimEnd:Zw,trimStart:Yw,truncate:rx,unescape:sx,upperCase:Wx,upperFirst:Go,words:Qu};var vS={attempt:Xi,bindAll:ao,cond:Xl,conforms:ev,constant:Pr,defaultTo:Av,flow:kp,flowRight:Cp,identity:pe,iteratee:Ry,matches:tg,matchesProperty:ag,method:yg,methodOf:bg,mixin:wg,noop:ar,nthArg:Tg,over:eb,overEvery:ub,overSome:cb,property:Gl,propertyOf:im,range:Rm,rangeRight:Tm,stubArray:Ws,stubFalse:gn,stubObject:G_,stubString:K_,stubTrue:Z_,times:Tw,toPath:Fw,uniqueId:Ox};function lazyClone(){var e=new nr(this.__wrapped__);e.__actions__=dr(this.__actions__);e.__dir__=this.__dir__;e.__filtered__=this.__filtered__;e.__iteratees__=dr(this.__iteratees__);e.__takeCount__=this.__takeCount__;e.__views__=dr(this.__views__);return e}var dS=lazyClone;function lazyReverse(){if(this.__filtered__){var e=new nr(this);e.__dir__=-1;e.__filtered__=true}else{e=this.clone();e.__dir__*=-1}return e}var pS=lazyReverse;var hS=Math.max,yS=Math.min;function getView(e,r,t){var n=-1,a=t.length;while(++n0||r<0)){return new nr(t)}if(e<0){t=t.takeRight(-e)}else if(e){t=t.drop(e)}if(r!==undefined){r=le(r);t=r<0?t.dropRight(-r):t.take(r-e)}return t};nr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};nr.prototype.toArray=function(){return this.take(IS)};ov(nr.prototype,function(e,r){var t=/^(?:filter|find|map|reject)|While$/.test(r),n=/^(?:head|last)$/.test(r),a=gr[n?"take"+(r=="last"?"Right":""):r],i=n||/^find/.test(r);if(!a){return}gr.prototype[r]=function(){var r=this.__wrapped__,o=n?[1]:arguments,u=r instanceof nr,s=o[0],c=u||V(r);var f=function(e){var r=a.apply(gr,ki([e],o));return n&&l?r[0]:r};if(c&&t&&typeof s=="function"&&s.length!=1){u=c=false}var l=this.__chain__,v=!!this.__actions__.length,d=i&&!l,p=u&&!v;if(!i&&c){r=p?r:new nr(this);var h=e.apply(r,o);h.__actions__.push({func:Pw,args:[f],thisArg:undefined});return new vr(h,l)}if(d&&p){return e.apply(this,o)}h=this.thru(f);return d?n?h.value()[0]:h.value():h}});Dr(["pop","push","shift","sort","splice","unshift"],function(e){var r=AS[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);gr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var a=this.value();return r.apply(V(a)?a:[],e)}return this[t](function(t){return r.apply(V(t)?t:[],e)})}});ov(nr.prototype,function(e,r){var t=gr[r];if(t){var n=t.name+"";if(!kS.call(sr,n)){sr[n]=[]}sr[n].push({name:r,func:t})}});sr[xt(undefined,SS).name]=[{name:"wrapper",func:undefined}];nr.prototype.clone=dS;nr.prototype.reverse=pS;nr.prototype.value=wS;gr.prototype.at=fS.at;gr.prototype.chain=fS.wrapperChain;gr.prototype.commit=fS.commit;gr.prototype.next=fS.next;gr.prototype.plant=fS.plant;gr.prototype.reverse=fS.reverse;gr.prototype.toJSON=gr.prototype.valueOf=gr.prototype.value=fS.value;gr.prototype.first=gr.prototype.head;if(PS){gr.prototype[PS]=fS.toIterator}var TS=gr;class image_tag_ImageTag{constructor(e){const{repository:r="gableroux",name:t="unity3d",version:n="2019.2.11f1",platform:a}=e;if(!image_tag_ImageTag.versionPattern.test(n)){throw new Error(`Invalid version "${n}".`)}if(!Qp(image_tag_ImageTag.targetPlatformToImageSuffixMap,a)){throw new Error(`Platform "${a}" is currently not supported.`)}const i=Ai(image_tag_ImageTag.targetPlatformToImageSuffixMap,a,image_tag_ImageTag.imageSuffixes.generic);Object.assign(this,{repository:r,name:t,version:n,platform:a,builderPlatform:i})}static get versionPattern(){return/^20\d{2}\.\d\.\w{3,4}|3$/}static get imageSuffixes(){return{generic:"",webgl:"webgl",mac:"mac",windows:"windows",android:"android",ios:"ios",facebook:"facebook"}}static get targetPlatformToImageSuffixMap(){const{generic:e,webgl:r,mac:t,windows:n,android:a,ios:i,facebook:u}=image_tag_ImageTag.imageSuffixes;return{[o.types.StandaloneOSX]:t,[o.types.StandaloneWindows]:n,[o.types.StandaloneWindows64]:n,[o.types.StandaloneLinux64]:n,[o.types.iOS]:i,[o.types.Android]:a,[o.types.WebGL]:r,[o.types.WSAPlayer]:n,[o.types.PS4]:n,[o.types.XboxOne]:n,[o.types.tvOS]:n,[o.types.Switch]:n,[o.types.Lumin]:n,[o.types.BJM]:n,[o.types.Stadia]:n,[o.types.Facebook]:u,[o.types.NoTarget]:e,[o.types.Test]:e}}get tag(){return Zw(`${this.version}-${this.builderPlatform}`,"-")}get image(){return Yw(`${this.repository}/${this.name}`,"/")}toString(){const{image:e,tag:r}=this;return`${e}:${r}`}}var MS=image_tag_ImageTag;class docker_Docker{static async build(e,r=false){const{path:t,dockerfile:n,baseImage:a}=e;const{version:i,platform:o}=a;const u=new MS({repository:"",name:"unity-builder",version:i,platform:o});const s=`docker build ${t} --file ${n} --build-arg IMAGE=${a} --tag ${u}`;await Object(p.exec)(s,null,{silent:r});return u}static async run(e,r,t=false){const{version:n,workspace:a,platform:i,projectPath:o,buildName:u,buildPath:s,buildFile:c,buildMethod:f,buildVersion:l,customParameters:v}=r;const d=`docker run --workdir /github/workspace --rm --env UNITY_LICENSE --env UNITY_LICENSE_FILE --env UNITY_EMAIL --env UNITY_PASSWORD --env UNITY_SERIAL --env UNITY_VERSION="${n}" --env PROJECT_PATH="${o}" --env BUILD_TARGET="${i}" --env BUILD_NAME="${u}" --env BUILD_PATH="${s}" --env BUILD_FILE="${c}" --env BUILD_METHOD="${f}" --env VERSION="${l}" --env CUSTOM_PARAMETERS="${v}" --env HOME=/github/home --env GITHUB_REF --env GITHUB_SHA --env GITHUB_REPOSITORY --env GITHUB_ACTOR --env GITHUB_WORKFLOW --env GITHUB_HEAD_REF --env GITHUB_BASE_REF --env GITHUB_EVENT_NAME --env GITHUB_WORKSPACE=/github/workspace --env GITHUB_ACTION --env GITHUB_EVENT_PATH --env RUNNER_OS --env RUNNER_TOOL_CACHE --env RUNNER_TEMP --env RUNNER_WORKSPACE --volume "/var/run/docker.sock":"/var/run/docker.sock" --volume "/home/runner/work/_temp/_github_home":"/github/home" --volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" --volume "${a}":"/github/workspace" ${e}`;await Object(p.exec)(d,null,{silent:t})}}var BS=docker_Docker;const DS=t(470);async function src_action(){i.checkCompatibility();m.verify();const{dockerfile:e,workspace:r,actionFolder:t}=i;const n=u.create(await g.getFromUser());const a=new MS(n);const o=await BS.build({path:t,dockerfile:e,baseImage:a});await BS.run(o,{workspace:r,...n})}src_action().catch(e=>{DS.setFailed(e.message)})},87:function(e){e.exports=require("os")},129:function(e){e.exports=require("child_process")},357:function(e){e.exports=require("assert")},431:function(e,r,t){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(Object.hasOwnProperty.call(e,t))r[t]=e[t];r["default"]=e;return r};Object.defineProperty(r,"__esModule",{value:true});const a=n(t(87));function issueCommand(e,r,t){const n=new Command(e,r,t);process.stdout.write(n.toString()+a.EOL)}r.issueCommand=issueCommand;function issue(e,r=""){issueCommand(e,{},r)}r.issue=issue;const i="::";class Command{constructor(e,r,t){if(!e){e="missing.command"}this.command=e;this.properties=r;this.message=t}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let r=true;for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const n=this.properties[t];if(n){if(r){r=false}else{e+=","}e+=`${t}=${escapeProperty(n)}`}}}}e+=`${i}${escapeData(this.message)}`;return e}}function escapeData(e){return(e||"").replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return(e||"").replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},470:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)if(Object.hasOwnProperty.call(e,t))r[t]=e[t];r["default"]=e;return r};Object.defineProperty(r,"__esModule",{value:true});const i=t(431);const o=a(t(87));const u=a(t(622));var s;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(s=r.ExitCode||(r.ExitCode={}));function exportVariable(e,r){process.env[e]=r;i.issueCommand("set-env",{name:e},r)}r.exportVariable=exportVariable;function setSecret(e){i.issueCommand("add-mask",{},e)}r.setSecret=setSecret;function addPath(e){i.issueCommand("add-path",{},e);process.env["PATH"]=`${e}${u.delimiter}${process.env["PATH"]}`}r.addPath=addPath;function getInput(e,r){const t=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(r&&r.required&&!t){throw new Error(`Input required and not supplied: ${e}`)}return t.trim()}r.getInput=getInput;function setOutput(e,r){i.issueCommand("set-output",{name:e},r)}r.setOutput=setOutput;function setFailed(e){process.exitCode=s.Failure;error(e)}r.setFailed=setFailed;function debug(e){i.issueCommand("debug",{},e)}r.debug=debug;function error(e){i.issue("error",e)}r.error=error;function warning(e){i.issue("warning",e)}r.warning=warning;function info(e){process.stdout.write(e+o.EOL)}r.info=info;function startGroup(e){i.issue("group",e)}r.startGroup=startGroup;function endGroup(){i.issue("endgroup")}r.endGroup=endGroup;function group(e,r){return n(this,void 0,void 0,function*(){startGroup(e);let t;try{t=yield r()}finally{endGroup()}return t})}r.group=group;function saveState(e,r){i.issueCommand("save-state",{name:e},r)}r.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}r.getState=getState},614:function(e){e.exports=require("events")},622:function(e){e.exports=require("path")},669:function(e){e.exports=require("util")},672:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};var a;Object.defineProperty(r,"__esModule",{value:true});const i=t(357);const o=t(747);const u=t(622);a=o.promises,r.chmod=a.chmod,r.copyFile=a.copyFile,r.lstat=a.lstat,r.mkdir=a.mkdir,r.readdir=a.readdir,r.readlink=a.readlink,r.rename=a.rename,r.rmdir=a.rmdir,r.stat=a.stat,r.symlink=a.symlink,r.unlink=a.unlink;r.IS_WINDOWS=process.platform==="win32";function exists(e){return n(this,void 0,void 0,function*(){try{yield r.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true})}r.exists=exists;function isDirectory(e,t=false){return n(this,void 0,void 0,function*(){const n=t?yield r.stat(e):yield r.lstat(e);return n.isDirectory()})}r.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(r.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}r.isRooted=isRooted;function mkdirP(e,t=1e3,a=1){return n(this,void 0,void 0,function*(){i.ok(e,"a path argument must be provided");e=u.resolve(e);if(a>=t)return r.mkdir(e);try{yield r.mkdir(e);return}catch(n){switch(n.code){case"ENOENT":{yield mkdirP(u.dirname(e),t,a+1);yield r.mkdir(e);return}default:{let t;try{t=yield r.stat(e)}catch(e){throw n}if(!t.isDirectory())throw n}}}})}r.mkdirP=mkdirP;function tryGetExecutablePath(e,t){return n(this,void 0,void 0,function*(){let n=undefined;try{n=yield r.stat(e)}catch(r){if(r.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${r}`)}}if(n&&n.isFile()){if(r.IS_WINDOWS){const r=u.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===r)){return e}}else{if(isUnixExecutable(n)){return e}}}const a=e;for(const i of t){e=a+i;n=undefined;try{n=yield r.stat(e)}catch(r){if(r.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${r}`)}}if(n&&n.isFile()){if(r.IS_WINDOWS){try{const t=u.dirname(e);const n=u.basename(e).toUpperCase();for(const a of yield r.readdir(t)){if(n===a.toUpperCase()){e=u.join(t,a);break}}}catch(r){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${r}`)}return e}else{if(isUnixExecutable(n)){return e}}}}return""})}r.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(r.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}},747:function(e){e.exports=require("fs")},986:function(e,r,t){"use strict";var n=this&&this.__awaiter||function(e,r,t,n){function adopt(e){return e instanceof t?e:new t(function(r){r(e)})}return new(t||(t=Promise))(function(t,a){function fulfilled(e){try{step(n.next(e))}catch(e){a(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){a(e)}}function step(e){e.done?t(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())})};Object.defineProperty(r,"__esModule",{value:true});const a=t(9);function exec(e,r,t){return n(this,void 0,void 0,function*(){const n=a.argStringToArray(e);if(n.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const i=n[0];r=n.slice(1).concat(r||[]);const o=new a.ToolRunner(i,r,t);return o.exec()})}r.exec=exec}},function(e){"use strict";!function(){e.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}}();!function(){var r=Object.prototype.hasOwnProperty;e.d=function(e,t,n){if(!r.call(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}}}();!function(){e.t=function(r,t){if(t&1)r=this(r);if(t&8)return r;if(t&4&&typeof r==="object"&&r&&r.__esModule)return r;var n=Object.create(null);e.r(n);Object.defineProperty(n,"default",{enumerable:true,value:r});if(t&2&&typeof r!="string")for(var a in r)e.d(n,a,function(e){return r[e]}.bind(null,a));return n}}();!function(){e.n=function(r){var t=r&&r.__esModule?function getDefault(){return r["default"]}:function getModuleExports(){return r};e.d(t,"a",t);return t}}();!function(){e.hmd=function(e){e=Object.create(e);if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});Object.defineProperty(e,"exports",{enumerable:true,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}});return e}}()}); \ No newline at end of file diff --git a/src/jest.setup.js b/src/jest.setup.js index 657a3840..ac4c6e94 100644 --- a/src/jest.setup.js +++ b/src/jest.setup.js @@ -1,9 +1,25 @@ expect.extend({ + toBeOfType(received, expectedType) { + const type = typeof received; + + const pass = type === expectedType; + const message = () => ` + Expected value to be of type ${this.utils.printExpected(expectedType)}, + but received ${this.utils.printReceived(type)}`; + + return { + message, + pass, + }; + }, + toBeEitherAFunctionOrAnObject(received) { const type = typeof received; const pass = ['object', 'function'].includes(type); - const message = `Expected a function or an object, received ${type}`; + const message = () => `Expected a ${this.utils.printExpected('function')} + or an ${this.utils.printExpected('object')}, + but received ${type}`; return { message, @@ -11,5 +27,3 @@ expect.extend({ }; }, }); - -jest.mock('./model/input'); diff --git a/src/model/__mocks__/versioning.js b/src/model/__mocks__/versioning.js deleted file mode 100644 index e83d029f..00000000 --- a/src/model/__mocks__/versioning.js +++ /dev/null @@ -1,5 +0,0 @@ -export const mockDetermineVersion = jest.fn(); - -export default { - determineVersion: mockDetermineVersion, -}; diff --git a/src/model/__snapshots__/versioning.test.js.snap b/src/model/__snapshots__/versioning.test.js.snap new file mode 100644 index 00000000..af76fcf3 --- /dev/null +++ b/src/model/__snapshots__/versioning.test.js.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Versioning determineVersion throws for invalid strategy 0 1`] = `"Versioning strategy should be one of None, Semantic, Tag, Custom."`; + +exports[`Versioning determineVersion throws for invalid strategy null 1`] = `"Versioning strategy should be one of None, Semantic, Tag, Custom."`; + +exports[`Versioning determineVersion throws for invalid strategy somethingRandom 1`] = `"Versioning strategy should be one of None, Semantic, Tag, Custom."`; + +exports[`Versioning determineVersion throws for invalid strategy undefined 1`] = `"Versioning strategy should be one of None, Semantic, Tag, Custom."`; diff --git a/src/model/cache.test.js b/src/model/cache.test.js index 8dd827e0..29afe8fa 100644 --- a/src/model/cache.test.js +++ b/src/model/cache.test.js @@ -1,5 +1,7 @@ import Cache from './cache'; +jest.mock('./input'); + describe('Cache', () => { describe('Verification', () => { it('does not throw', () => { diff --git a/src/model/input.test.js b/src/model/input.test.js index fafd5f7e..c282a9e5 100644 --- a/src/model/input.test.js +++ b/src/model/input.test.js @@ -1,11 +1,12 @@ -import { mockDetermineVersion } from './__mocks__/versioning'; import Input from './input'; +import Versioning from './versioning'; -jest.restoreAllMocks(); -jest.mock('./versioning'); +const determineVersion = jest + .spyOn(Versioning, 'determineVersion') + .mockImplementation(() => '1.3.37'); -beforeEach(() => { - mockDetermineVersion.mockClear(); +afterEach(() => { + jest.clearAllMocks(); }); describe('Input', () => { @@ -18,11 +19,9 @@ describe('Input', () => { await expect(typeof (await Input.getFromUser())).toStrictEqual('object'); }); - it.skip('calls version generator once', async () => { + it('calls version generator once', async () => { await Input.getFromUser(); - - // Todo - make sure the versioning mock is actually hit after restoreAllMocks is used. - expect(mockDetermineVersion).toHaveBeenCalledTimes(1); + expect(determineVersion).toHaveBeenCalledTimes(1); }); }); }); diff --git a/src/model/project.test.js b/src/model/project.test.js index 8dadfaeb..b900929d 100644 --- a/src/model/project.test.js +++ b/src/model/project.test.js @@ -1,5 +1,7 @@ import Project from './project'; +jest.mock('./input'); + describe('Platform', () => { describe('relativePath', () => { it('does not throw', () => { diff --git a/src/model/versioning.js b/src/model/versioning.js index 120ebad8..57b71bd3 100644 --- a/src/model/versioning.js +++ b/src/model/versioning.js @@ -1,5 +1,4 @@ import * as core from '@actions/core'; -import { exec } from '@actions/exec'; import NotImplementedException from './error/not-implemented-exception'; import ValidationError from './error/validation-error'; import System from './system'; @@ -13,7 +12,8 @@ export default class Versioning { * Get the branch name of the (related) branch */ static get branch() { - return this.headRef || this.ref.slice(11); + // Todo - use optional chaining (https://github.com/zeit/ncc/issues/534) + return this.headRef || (this.ref && this.ref.slice(11)); } /** @@ -113,22 +113,23 @@ export default class Versioning { */ static async parseSemanticVersion() { const description = await this.getVersionDescription(); - const [match, tag, commits, hash] = this.descriptionRegex.exec(description); - if (!match) { - throw new Error(`Failed to parse git describe output: "${description}"`); + try { + const [match, tag, commits, hash] = this.descriptionRegex.exec(description); + + return { + match, + tag, + commits, + hash, + }; + } catch (error) { + throw new Error(`Failed to parse git describe output: "${description}".`); } - - return { - match, - tag, - commits, - hash, - }; } static async fetchAll() { - await exec('git', ['fetch', '--all']); + await System.run('git', ['fetch', '--all']); } /** diff --git a/src/model/versioning.test.js b/src/model/versioning.test.js new file mode 100644 index 00000000..18af31e7 --- /dev/null +++ b/src/model/versioning.test.js @@ -0,0 +1,245 @@ +import NotImplementedException from './error/not-implemented-exception'; +import System from './system'; +import Versioning from './versioning'; + +afterEach(() => { + jest.restoreAllMocks(); +}); + +describe('Versioning', () => { + describe('strategies', () => { + it('returns an object', () => { + expect(typeof Versioning.strategies).toStrictEqual('object'); + }); + + it('has items', () => { + expect(Object.values(Versioning.strategies).length).toBeGreaterThan(2); + }); + + it('has an opt out option', () => { + expect(Versioning.strategies).toHaveProperty('None'); + }); + + it('has the semantic option', () => { + expect(Versioning.strategies).toHaveProperty('Semantic'); + }); + + it('has a strategy for tags', () => { + expect(Versioning.strategies).toHaveProperty('Tag'); + }); + + it('has an option that allows custom input', () => { + expect(Versioning.strategies).toHaveProperty('Custom'); + }); + }); + + describe('branch', () => { + it('returns headRef when set', () => { + const headReference = jest + .spyOn(Versioning, 'headRef', 'get') + .mockReturnValue('feature-branch-1'); + + expect(Versioning.branch).toStrictEqual('feature-branch-1'); + expect(headReference).toHaveBeenCalledTimes(1); + }); + + it('returns part of Ref when set', () => { + const reference = jest + .spyOn(Versioning, 'ref', 'get') + .mockReturnValue('refs/heads/feature-branch-2'); + + expect(Versioning.branch).toStrictEqual('feature-branch-2'); + expect(reference).toHaveBeenCalledTimes(2); + }); + + it('prefers headRef over ref when set', () => { + const headReference = jest + .spyOn(Versioning, 'headRef', 'get') + .mockReturnValue('feature-branch-1'); + const reference = jest + .spyOn(Versioning, 'ref', 'get') + .mockReturnValue('refs/heads/feature-2'); + + expect(Versioning.branch).toStrictEqual('feature-branch-1'); + expect(headReference).toHaveBeenCalledTimes(1); + expect(reference).toHaveBeenCalledTimes(0); + }); + + it('returns undefined when headRef and ref are not set', () => { + const headReference = jest.spyOn(Versioning, 'headRef', 'get').mockReturnValue(undefined); + const reference = jest.spyOn(Versioning, 'ref', 'get').mockReturnValue(undefined); + + expect(Versioning.branch).not.toBeDefined(); + + expect(headReference).toHaveBeenCalledTimes(1); + expect(reference).toHaveBeenCalledTimes(1); + }); + }); + + describe('descriptionRegex', () => { + it('is a valid regex', () => { + expect(Versioning.descriptionRegex).toBeInstanceOf(RegExp); + }); + + test.each(['v1.1-1-g12345678', 'v0.1-2-g12345678', 'v0.0-500-gA9B6C3D0-dirty'])( + 'is happy with valid %s', + description => { + expect(Versioning.descriptionRegex.test(description)).toBeTruthy(); + }, + ); + + test.each([null, undefined, 'v0', 'v0.1', 'v0.1.2', 'v0.1-2', 'v0.1-2-g'])( + 'does not like %s', + description => { + expect(Versioning.descriptionRegex.test(description)).toBeFalsy(); + // Also never expect without the v to work for any of these cases. + expect(Versioning.descriptionRegex.test(description?.substr(1))).toBeFalsy(); + }, + ); + }); + + describe('determineVersion', () => { + test.each([null, undefined, 0, 'somethingRandom'])( + 'throws for invalid strategy %s', + async strategy => { + await expect(Versioning.determineVersion(strategy)).rejects.toThrowErrorMatchingSnapshot(); + }, + ); + + describe('opt out strategy', () => { + it("returns 'none'", async () => { + await expect(Versioning.determineVersion('None', 'v1.0')).resolves.toMatchInlineSnapshot( + `"none"`, + ); + }); + }); + + describe('custom strategy', () => { + test.each([null, undefined, 0, 'v0.1', '1', 'CamelCase', 'dashed-version'])( + 'returns the inputVersion for %s', + async inputVersion => { + await expect(Versioning.determineVersion('Custom', inputVersion)).resolves.toStrictEqual( + inputVersion, + ); + }, + ); + }); + + describe('semantic strategy', () => { + it('refers to generateSemanticVersion', async () => { + const generateSemanticVersion = jest + .spyOn(Versioning, 'generateSemanticVersion') + .mockResolvedValue('1.3.37'); + + await expect(Versioning.determineVersion('Semantic')).resolves.toStrictEqual('1.3.37'); + expect(generateSemanticVersion).toHaveBeenCalledTimes(1); + }); + }); + + describe('tag strategy', () => { + it('refers to generateTagVersion', async () => { + const generateTagVersion = jest + .spyOn(Versioning, 'generateTagVersion') + .mockResolvedValue('0.1'); + + await expect(Versioning.determineVersion('Tag')).resolves.toStrictEqual('0.1'); + expect(generateTagVersion).toHaveBeenCalledTimes(1); + }); + }); + + describe('not implemented strategy', () => { + it('throws a not implemented exception', async () => { + const strategy = 'Test'; + jest.spyOn(Versioning, 'strategies', 'get').mockReturnValue({ [strategy]: strategy }); + await expect(Versioning.determineVersion(strategy)).rejects.toThrowError( + NotImplementedException, + ); + }); + }); + }); + + describe('generateTagVersion', () => { + it('removes the v', async () => { + jest.spyOn(Versioning, 'getTag').mockResolvedValue('v1.3.37'); + await expect(Versioning.generateTagVersion()).resolves.toStrictEqual('1.3.37'); + }); + }); + + describe('parseSemanticVersion', () => { + it('returns the named parts', async () => { + jest.spyOn(Versioning, 'getVersionDescription').mockResolvedValue('v0.1-2-g12345678'); + + await expect(Versioning.parseSemanticVersion()).resolves.toMatchObject({ + tag: '0.1', + commits: '2', + hash: '12345678', + }); + }); + + it('throws when no match could be made', async () => { + jest.spyOn(Versioning, 'getVersionDescription').mockResolvedValue('no-match-can-be-made'); + + await expect(Versioning.parseSemanticVersion()).rejects.toThrowErrorMatchingInlineSnapshot( + `"Failed to parse git describe output: \\"no-match-can-be-made\\"."`, + ); + }); + }); + + describe('getVersionDescription', () => { + it('returns the commands output', async () => { + const runOutput = 'someValue'; + jest.spyOn(System, 'run').mockResolvedValue(runOutput); + await expect(Versioning.getVersionDescription()).resolves.toStrictEqual(runOutput); + }); + }); + + describe('fetchAll', () => { + it('awaits the command', async () => { + jest.spyOn(System, 'run').mockResolvedValue(null); + await expect(Versioning.fetchAll()).resolves.not.toThrow(); + }); + }); + + describe('isDirty', () => { + it('returns true when there are files listed', async () => { + const runOutput = 'file.ext\nfile2.ext'; + jest.spyOn(System, 'run').mockResolvedValue(runOutput); + await expect(Versioning.isDirty()).resolves.toStrictEqual(true); + }); + + it('returns false when there is no output', async () => { + const runOutput = ''; + jest.spyOn(System, 'run').mockResolvedValue(runOutput); + await expect(Versioning.isDirty()).resolves.toStrictEqual(false); + }); + }); + + describe('getTag', () => { + it('returns the commands output', async () => { + const runOutput = 'v1.0'; + jest.spyOn(System, 'run').mockResolvedValue(runOutput); + await expect(Versioning.getTag()).resolves.toStrictEqual(runOutput); + }); + }); + + describe('hasAnyVersionTags', () => { + it('returns false when the command returns 0', async () => { + const runOutput = '0'; + jest.spyOn(System, 'run').mockResolvedValue(runOutput); + await expect(Versioning.hasAnyVersionTags()).resolves.toStrictEqual(false); + }); + + it('returns true when the command returns >= 0', async () => { + const runOutput = '9'; + jest.spyOn(System, 'run').mockResolvedValue(runOutput); + await expect(Versioning.hasAnyVersionTags()).resolves.toStrictEqual(true); + }); + }); + + describe('getTotalNumberOfCommits', () => { + it('returns a number from the command', async () => { + jest.spyOn(System, 'run').mockResolvedValue('9'); + await expect(Versioning.getTotalNumberOfCommits()).resolves.toStrictEqual(9); + }); + }); +});