"use strict";exports.id=4322,exports.ids=[4322],exports.modules={"./src/commands/worker-pool.ts"(o,e,r){r.r(e),r.d(e,{DEFAULT_WORKER_POOL_NAME:()=>i,WORKER_COMMAND_NAMES:()=>s,WORKER_POOL_LABEL_KEY:()=>t,getWorkerPoolName:()=>u,resolveWorkerPoolRegistration:()=>d,rewriteWorkerPoolArgv:()=>l});var n=r("../constants/dist/private-worker-bridge.js");const t="pool",i="default",s=["start","debug","help"];function l(o){const e=o.findIndex((o=>"worker"===o));if(-1===e)return[...o];const r=new Set(s),n=o.slice(0,e+1);let t=!1;for(let s=e+1;s<o.length;s++){const e=o[s];if(void 0===e)break;if("--pool"!==e)!t&&r.has(e)&&(t=!0),n.push(e);else{const e=o[s+1],l=void 0!==e&&r.has(e)&&!t;if(void 0===e||e.startsWith("-")||l){n.push(`--pool=${i}`);continue}n.push(`--pool=${e}`),s+=1}}return n}function a(o,e){const r=o.filter((o=>o.key!==n.EC&&o.key!==n.MM));return[...e.githubTokenMint?[{key:n.EC,value:"true"}]:[],...e.dashboardSecretSync?[{key:n.MM,value:"true"}]:[],...r]}function d(o){const e=function(o){return!0===o.singleUse||void 0!==o.pool&&!1!==o.pool}(o),r={githubTokenMint:!0===o.mintGithubToken,dashboardSecretSync:!0===o.syncDashboardSecrets};if(r.githubTokenMint&&!e)throw new Error("--mint-github-token requires --pool or --single-use");if(r.dashboardSecretSync&&!e)throw new Error("--sync-dashboard-secrets requires --pool or --single-use");const n=function(o){var e;const r=function(o){if(void 0!==o)return o.trim()}(o.poolName);if(void 0!==o.poolName&&(void 0===r||0===r.length))throw new Error("--pool-name cannot be empty");const n="string"==typeof o.pool?o.pool.trim():void 0;if(void 0!==n&&0===n.length)throw new Error("--pool cannot be empty");if(o.poolAssignmentEnabled){if(void 0!==n&&void 0!==r&&n!==r&&n!==i)throw new Error(`--pool (${n}) and --pool-name (${r}) disagree`);return null!==(e=null!=r?r:n)&&void 0!==e?e:i}if(void 0!==r)throw new Error("--pool-name requires --pool or --single-use")}({poolAssignmentEnabled:e,pool:o.pool,poolName:o.poolName}),s=function(o,e){return e?[{key:t,value:e},...o.filter((o=>o.key!==t))]:[...o]}(o.labels,n);return{labels:a(s,r),sharedAssignmentAllowed:!e,credentialConsent:r}}function u(o){const e=null==o?void 0:o.find((o=>o.key===t)),r=null==e?void 0:e.value.trim();return r&&r.length>0?r:void 0}},"../constants/dist/private-worker-bridge.js"(o,e,r){r.d(e,{DM:()=>t,EC:()=>s,MM:()=>l,Xg:()=>i,fG:()=>a,gX:()=>n});const n="/bridge.internal/CancelController",t="/bridge.internal/CancelRequest",i="x-worker-id",s="mint-github-token",l="sync-dashboard-secrets",a="x-private-worker-bc-id"}};