supercolony 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,6 +23,8 @@ colony ui
23
23
  colony --ascii
24
24
  ```
25
25
 
26
+ If this computer has no wallet yet, launching the dashboard first offers **1. Create a new wallet** (the default; you set a local password and confirm it) or **2. Not now** (browse without a wallet; Esc does the same). The new wallet is empty; press `b` to back it up and `d` to add funds. The offer appears on each launch until a wallet exists.
27
+
26
28
  The dashboard has **My tasks**, **Explore**, **Workers** and **Wallets** at the top. Wide terminals show a list and details side by side; below 100 columns, Enter opens details and Esc returns to the list. Use an interactive terminal at least 40 columns by 20 rows. `--ascii` uses ordinary ASCII borders. Special fonts, WSL and a browser are not required.
27
29
 
28
30
  Panel actions stay visible along the bottom of their frame. Task lists contain New task, Search and Refresh; My tasks also has Filter. The Workers list contains Add target, Search and Refresh, while the selected worker's actions stay in its details pane. Wallet actions and Refresh belong to the selected wallet; New, Import, Manage and Receive funds remain in Wallet management. Selection and Enter/Tab hints stay in the list; return, scrolling and detail-tab hints stay in the details pane. Shortcuts wrap as whole entries on narrow terminals. The screen footer contains only global Help and Quit; during input, confirmation or an operation, it shows Ctrl+C to exit.
@@ -215,7 +217,7 @@ colony task create --file examples/research-job.json
215
217
 
216
218
  流程:
217
219
 
218
- 正式创建和续作任务时,Colony 会在任务描述末尾单独添加 `(Submitted via Supercolony)`。原始输入用于本地编辑和恢复,提交内容在报价前固定保存;重试和报价续期不会重复添加署名,已保存的旧订单保持原提交内容。
220
+ 正式创建和续作任务时,Colony 会在任务描述末尾另起一行添加 `via supercolony`。原始输入用于本地编辑和恢复,提交内容在报价前固定保存;重试和报价续期不会重复添加署名,已保存的旧订单保持原提交内容。
219
221
 
220
222
  1. 先以公开地址检查余额和 gas;自然语言输入随后由本地模型选择任务参数。`POST /requests/check` 有 blocker 立即停止;
221
223
  2. 生成并保存 `requestToken` 和 `requestKey`,再 `POST /requests/quote`;
@@ -1 +1 @@
1
- function _0x5516(){const _0x3256cf=['api','\x20\x20-\x20none','hash','--path\x20<path>','publish','IMD','reuse\x20a\x20saved\x20order\x20request\x20key','\x20verdict=','check:\x20\x20\x20\x20\x20','browse\x20and\x20publish\x20IMD\x20tasks','download:\x20','isInteger','timeout','join','reviews:\x20\x20\x20','\x20--refresh','complete','\x20(enough\x20balance\x20found).\x0a','optsWithGlobals','questions','admitted','\x20\x20-\x20','check','--limit\x20<n>','complete\x20continuation\x20body\x20JSON\x20file','project:\x20\x20\x20','--github','order\x20','named\x20input\x20preset\x20(report)','plan:\x20','keyEnv','--answer\x20<text>','message','slice','elapsedMs','source:\x20\x20\x20\x20','--request-key\x20<uuid>','poll','ethereum','--dry-run','parentJobId','show\x20one\x20job','continue\x20<id>\x20[objective]','save','--before\x20<time>','\x20version(s))','createdAt','challenge','--timeout\x20<seconds>','paid\x20by:\x20\x20\x20','source','expiresAt','s)\x0a','--exclude-oracle','--file\x20<path>','blockers','\x20belongs\x20to\x20','--template\x20<name>','delivery','limit','objective:\x20','summary:\x20','home','\x20head=','repo','status','json','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','reason','object','requiredOption','/jobs','/result','order:\x20\x20\x20\x20\x20','s\x20(retry\x20','reason:\x20\x20\x20\x20\x20\x20','blockers:\x20','head','reviews','Network\x20error','completed','base\x20commit\x20for\x20--repo','updatedAt','launch','pendingTransaction','Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.','code','short','trim','stdin','toString','url','description','created:\x20\x20\x20','\x20\x20\x20\x20url:\x20\x20','submissionHash','exclude\x20oracle\x20panel\x20jobs','answer','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','workflow:\x20\x20','paymentStatus','push','\x20--request-key\x20','parent:\x20\x20\x20\x20','HTTP\x20','interrupted','destination\x20directory','/jobs/','--skill\x20<id>','preset','stringify','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','jobId','action','payment_reconciling','bytes','--since\x20<time>','show\x20a\x20job\x20result\x20and\x20artifact\x20URLs','result\x20<id>','length','refusalProblems','dryRun','files:\x20\x20\x20\x20\x20','exclude','nodes:\x20\x20\x20\x20\x20','job:\x20\x20\x20\x20\x20\x20\x20','input','complete\x20job\x20body\x20JSON\x20file','summary','title','quote','\x20blocker(s)','none','jobs\x20that\x20moved\x20after\x20this\x20time','job.continue','transaction_pending','\x0aquestions:\x0a','transactionHash','\x20belongs\x20to\x20parent\x20job\x20','type','detail','oracle','before','state:\x20\x20\x20\x20\x20','nodes','result\x20response\x20is\x20missing\x20jobId','page\x20size\x20(1-500)','check:\x20','jobs','template','data','Payment\x20needs\x20review.','github','deliverables:','\x20was\x20created\x20for\x20action\x20','option','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','string','explorer:\x20\x20\x20\x20','outcome','includes','resultUrl','inspect:\x20colony\x20order\x20show\x20','continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for','job\x20response\x20is\x20missing\x20id','template:\x20\x20','paymentChain','set','attempt','\x20tx\x20','verdict','\x20task\x20continue\x20','\x20--home\x20','wait:\x20','creation-time\x20cursor\x20(exclusive)','isTTY','--action\x20<action>','launch:\x20\x20\x20\x20','requestKey','\x20->\x20','\x20bytes,\x20','job\x20body\x20JSON\x20file','\x20versions=','command','action:\x20\x20\x20\x20','publish\x20the\x20result\x20to\x20GitHub','tx:\x20\x20\x20\x20\x20\x20\x20\x20','project','payment:\x20',';\x20rerun\x20with\x20--api\x20','yes','poll\x20interval\x20in\x20seconds','kind','\x20\x20\x20\x20hash:\x20','out','wait:\x20interrupted\x0a','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','\x20attempt=','padEnd','state','public\x20GitHub\x20repository\x20URL',',\x20not\x20','project\x20ready','unknown','job.open','transaction:\x20','since','task','explorerUrl','skill','list','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file','isArray','colony\x20--api\x20','--out\x20<dir>','versions','download\x20<id>','objective','path','payer','request\x20key\x20','toFixed','\x20job(s)','files','--interval\x20<seconds>','retry','payWith','objective\x20or\x20job\x20id\x20prefix','rpc','/jobs?',';\x20retrying\x20in\x20','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','jobs\x20response\x20is\x20missing\x20jobs','resultUrl:\x20','exitCode','result','commit','deliverables','\x20complete=','file','continue:\x20\x20\x20\x20colony\x20order\x20submit\x20','transaction','blocked','save\x20the\x20input\x20JSON\x20without\x20overwriting','refused','paidBy','excludeOracle','total\x20timeout\x20in\x20seconds','saved\x20input:\x20','answer\x20a\x20business\x20clarification\x20(repeatable)','workflow','parent','orderId','saved','payment_failed','\x20has\x20no\x20saved\x20input','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','job\x20template','complete:\x20\x20','--save\x20<path>','\x20on\x20'];_0x5516=function(){return _0x3256cf;};return _0x5516();}import{writeDiagnostic as _0x1ab7b2}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x39d34c}from'../lib/payment-progress.mjs';function _0x434f(_0x416e29,_0x55168a){_0x416e29=_0x416e29-0x137;const _0x434fe2=_0x5516();let _0x448297=_0x434fe2[_0x416e29];return _0x448297;}import{request as _0x11f4e2,print as _0x11a1cd}from'../shared.mjs';import{checkJob as _0x281c72,publishJob as _0x17effd,readJobFile as _0x39c26e}from'../lib/publish.mjs';import{loadOrder as _0x35669f}from'../lib/orders.mjs';import{buildContinueInput as _0x14b6ea,buildCreateInput as _0x2616f0,parentSummary as _0x85a4a1,resolveAction as _0x4a2a86,saveInputFile as _0xff79a7}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x502ffb,DEFAULT_TIMEOUT_SECONDS as _0x4a4dfa,downloadTaskFiles as _0x33c8ee,waitForResult as _0xe1778}from'../lib/task-result.mjs';import{askQuestions as _0x24b365,loadLocalPlanner as _0x4dd879,planTask as _0x776995}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x2bcb6c}from'./my-tasks.mjs';import{orderPayment as _0x3a82a4}from'../lib/payments.mjs';import{checkTaskWallet as _0x68ff51}from'../lib/task-wallet.mjs';async function x(_0x1439c6,_0x1b0bc1){const _0x43fb19=_0x434f,_0x801dff=await _0x68ff51({..._0x1439c6,'action':_0x1b0bc1});return _0x1439c6[_0x43fb19(0x179)]||_0x1ab7b2('Paying\x20with\x20'+_0x801dff['payWith']+_0x43fb19(0x23b)+_0x801dff['chainName']+_0x43fb19(0x148)),_0x801dff;}function Z(_0x2cb167){const _0x5bc479=_0x434f,_0x3a52aa=new URLSearchParams();if(_0x2cb167['q']!==void 0x0&&_0x3a52aa[_0x5bc479(0x1de)]('q',_0x2cb167['q']),_0x2cb167[_0x5bc479(0x1c5)]!==void 0x0&&_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x1c5),_0x2cb167[_0x5bc479(0x1c5)]),_0x2cb167['since']!==void 0x0&&_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x205),_0x2cb167[_0x5bc479(0x205)]),_0x2cb167[_0x5bc479(0x172)]!==void 0x0){const _0x505c31=Number(_0x2cb167[_0x5bc479(0x172)]);if(!Number[_0x5bc479(0x142)](_0x505c31)||_0x505c31<0x1||_0x505c31>0x1f4)throw new Error(_0x5bc479(0x199));_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x172),String(_0x505c31));}_0x2cb167[_0x5bc479(0x22d)]&&_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x1b2),_0x5bc479(0x1c4));const _0x5cb02e=_0x3a52aa[_0x5bc479(0x191)]();return _0x5cb02e?_0x5bc479(0x21c)+_0x5cb02e:_0x5bc479(0x17e);}function b(_0x354aa5,_0xf646d9=0x5a){const _0x568dc=_0x434f,_0x443384=String(_0x354aa5??'')['replace'](/\s+/g,'\x20')[_0x568dc(0x18f)]();return _0x443384[_0x568dc(0x1ae)]>_0xf646d9?_0x443384[_0x568dc(0x158)](0x0,_0xf646d9-0x1)+'…':_0x443384;}function ee(_0xf1d3f4){const _0x244401=_0x434f;if(!Array[_0x244401(0x20b)](_0xf1d3f4?.[_0x244401(0x1cb)]))throw new Error(_0x244401(0x21f));const _0xdd3410=[_0xf1d3f4['count']+_0x244401(0x215)];for(const _0x3f9ff1 of _0xf1d3f4[_0x244401(0x1cb)])_0xdd3410[_0x244401(0x19c)](_0x3f9ff1['id']+'\x20\x20'+_0x3f9ff1[_0x244401(0x1fe)][_0x244401(0x1fd)](0xa)+'\x20\x20'+String(_0x3f9ff1['template']??'')[_0x244401(0x1fd)](0x16)+'\x20\x20'+(_0x3f9ff1[_0x244401(0x189)]??'')+'\x20\x20'+b(_0x3f9ff1['objective']));return _0xdd3410[_0x244401(0x144)]('\x0a');}function te(_0x2b26df){const _0x28650f=_0x434f;if(!_0x2b26df?.['id'])throw new Error(_0x28650f(0x1db));const _0x1138bc=[_0x28650f(0x1b4)+_0x2b26df['id'],_0x28650f(0x1c6)+_0x2b26df[_0x28650f(0x1fe)],_0x28650f(0x1dc)+(_0x2b26df[_0x28650f(0x1cc)]??''),_0x28650f(0x173)+b(_0x2b26df[_0x28650f(0x210)],0x1f4),_0x28650f(0x194)+(_0x2b26df[_0x28650f(0x165)]??''),'updated:\x20\x20\x20'+(_0x2b26df[_0x28650f(0x189)]??''),'paid\x20by:\x20\x20\x20'+(_0x2b26df[_0x28650f(0x22c)]??''),_0x28650f(0x150)+(_0x2b26df['project']?_0x2b26df[_0x28650f(0x1f2)]['id']+'\x20('+(_0x2b26df['project'][_0x28650f(0x20e)]?.['length']??0x0)+_0x28650f(0x164):_0x28650f(0x1bb)),'delivery:\x20\x20'+(_0x2b26df[_0x28650f(0x171)]?JSON[_0x28650f(0x1a5)](_0x2b26df[_0x28650f(0x171)]):_0x28650f(0x1bb)),_0x28650f(0x1e8)+(_0x2b26df[_0x28650f(0x18a)]?JSON[_0x28650f(0x1a5)](_0x2b26df[_0x28650f(0x18a)]):_0x28650f(0x1bb))];if(Array['isArray'](_0x2b26df[_0x28650f(0x1c7)])){_0x1138bc[_0x28650f(0x19c)](_0x28650f(0x1b3)+_0x2b26df[_0x28650f(0x1c7)]['length']);for(const _0x435fc1 of _0x2b26df['nodes'])_0x1138bc['push']('\x20\x20-\x20'+_0x435fc1['key']+':\x20'+_0x435fc1[_0x28650f(0x1fe)]+_0x28650f(0x1fc)+_0x435fc1['attempt']+_0x28650f(0x13e)+(_0x435fc1[_0x28650f(0x1e1)]?.[_0x28650f(0x178)]??_0x28650f(0x1bb)));}return Array[_0x28650f(0x20b)](_0x2b26df['reviews'])&&_0x1138bc[_0x28650f(0x19c)](_0x28650f(0x145)+_0x2b26df[_0x28650f(0x185)][_0x28650f(0x1ae)]),_0x2b26df[_0x28650f(0x231)]?.['id']&&_0x1138bc[_0x28650f(0x19c)]((_0x28650f(0x19a)+_0x2b26df[_0x28650f(0x231)]['id']+'\x20'+(_0x2b26df['workflow'][_0x28650f(0x178)]??''))[_0x28650f(0x18f)]()),_0x1138bc['join']('\x0a');}function A(_0x558103){const _0x3188c7=_0x434f;if(!_0x558103?.[_0x3188c7(0x1a7)])throw new Error(_0x3188c7(0x1c8));const _0x10c501=[_0x3188c7(0x1b4)+_0x558103[_0x3188c7(0x1a7)],_0x3188c7(0x1c6)+_0x558103['state'],_0x3188c7(0x239)+_0x558103[_0x3188c7(0x147)]],_0x4cc315=Array[_0x3188c7(0x20b)](_0x558103['files'])?_0x558103['files']:[];_0x10c501[_0x3188c7(0x19c)](_0x3188c7(0x1b1)+_0x4cc315[_0x3188c7(0x1ae)]);for(const _0x468d77 of _0x4cc315)_0x10c501[_0x3188c7(0x19c)](_0x3188c7(0x14c)+_0x468d77[_0x3188c7(0x211)]+'\x20('+_0x468d77[_0x3188c7(0x1aa)]+_0x3188c7(0x1eb)+_0x468d77['mediaType']+')'),_0x10c501[_0x3188c7(0x19c)]('\x20\x20\x20\x20hash:\x20'+_0x468d77[_0x3188c7(0x139)]),_0x10c501['push'](_0x3188c7(0x195)+_0x468d77[_0x3188c7(0x192)]);const _0x199b05=Array[_0x3188c7(0x20b)](_0x558103[_0x3188c7(0x169)])?_0x558103[_0x3188c7(0x169)]:[];_0x10c501['push'](_0x3188c7(0x15a)+_0x199b05['length']);for(const _0x41e809 of _0x199b05)_0x10c501[_0x3188c7(0x19c)]('\x20\x20-\x20'+(_0x41e809['node']??_0x41e809[_0x3188c7(0x196)])+':\x20'+_0x41e809[_0x3188c7(0x192)]);return _0x558103[_0x3188c7(0x171)]&&_0x10c501[_0x3188c7(0x19c)]('delivery:\x20\x20'+JSON[_0x3188c7(0x1a5)](_0x558103[_0x3188c7(0x171)])),_0x558103[_0x3188c7(0x18a)]&&_0x10c501[_0x3188c7(0x19c)](_0x3188c7(0x1e8)+JSON[_0x3188c7(0x1a5)](_0x558103[_0x3188c7(0x18a)])),_0x10c501[_0x3188c7(0x144)]('\x0a');}function ne(_0xf0e46b){const _0x58c780=_0x434f,_0x3187e1=[_0x58c780(0x1b4)+_0xf0e46b['jobId'],_0x58c780(0x1c6)+_0xf0e46b[_0x58c780(0x1fe)],_0x58c780(0x1b1)+_0xf0e46b[_0x58c780(0x216)]['length']];for(const _0x2c2d6d of _0xf0e46b['files'])_0x3187e1[_0x58c780(0x19c)]('\x20\x20-\x20'+_0x2c2d6d[_0x58c780(0x211)]+'\x20->\x20'+_0x2c2d6d['file']+'\x20('+_0x2c2d6d['bytes']+'\x20bytes)'),_0x3187e1['push'](_0x58c780(0x1f8)+_0x2c2d6d[_0x58c780(0x139)]);return _0x3187e1['join']('\x0a');}function C(_0x2fc04d){const _0x46447a=_0x434f,_0x413706=[_0x46447a(0x183)+_0x2fc04d[_0x46447a(0x16e)][_0x46447a(0x1ae)]];for(const _0x597100 of _0x2fc04d[_0x46447a(0x16e)])_0x413706[_0x46447a(0x19c)]('\x20\x20-\x20'+_0x597100[_0x46447a(0x18d)]+':\x20'+_0x597100[_0x46447a(0x1c3)]);const _0x33fa5a=Array[_0x46447a(0x20b)](_0x2fc04d['plan'])?_0x2fc04d['plan']:[];_0x413706[_0x46447a(0x19c)](_0x46447a(0x154)+_0x33fa5a['length']);for(const _0x506e5e of _0x33fa5a)_0x413706[_0x46447a(0x19c)](_0x46447a(0x14c)+(_0x506e5e[_0x46447a(0x1b8)]??_0x506e5e[_0x46447a(0x18e)]??_0x506e5e[_0x46447a(0x208)])+(_0x506e5e['skill']?'\x20('+_0x506e5e[_0x46447a(0x208)]+')':''));return _0x413706[_0x46447a(0x144)]('\x0a');}function I(_0x22a565){const _0x49feb3=_0x434f,_0x4b89a7=_0x22a565[_0x49feb3(0x1b9)]?_0x3a82a4(_0x22a565):null;return{'status':_0x22a565['status'],'action':_0x22a565[_0x49feb3(0x1a8)],'requestKey':_0x22a565[_0x49feb3(0x1e9)],'orderId':_0x22a565['orderId'],'jobId':_0x22a565[_0x49feb3(0x1a7)]??null,'statusUrl':_0x22a565['statusUrl']??null,'resultUrl':_0x22a565[_0x49feb3(0x1d8)]??null,'transactionHash':_0x22a565['transactionHash']??null,'problems':_0x22a565[_0x49feb3(0x1af)]??null,'parentJobId':_0x22a565[_0x49feb3(0x1b5)]?.[_0x49feb3(0x15f)]??null,'parent':_0x22a565[_0x49feb3(0x232)]??null,'project':_0x22a565[_0x49feb3(0x14d)]?.[_0x49feb3(0x1f2)]??null,'payer':_0x22a565[_0x49feb3(0x212)]??null,'paymentChain':_0x22a565[_0x49feb3(0x1dd)]??_0x49feb3(0x15d),'payWith':_0x22a565['payWith']??_0x49feb3(0x13c),'prepared':_0x22a565[_0x49feb3(0x166)]?.[_0x49feb3(0x1b5)]??null,'quote':_0x22a565['quote']?{'amount':_0x4b89a7['amount'],'asset':_0x4b89a7['asset'],'payTo':_0x4b89a7['payTo'],'expiresAt':_0x22a565[_0x49feb3(0x1b9)][_0x49feb3(0x16a)]}:null};}function oe(_0x1ce538){const _0x1608e6=_0x434f,_0x8284ef=['status:\x20\x20\x20\x20'+_0x1ce538[_0x1608e6(0x178)],'action:\x20\x20\x20\x20'+_0x1ce538['action'],_0x1608e6(0x180)+_0x1ce538[_0x1608e6(0x233)],_0x1608e6(0x1b4)+(_0x1ce538['jobId']??'')];if(_0x1ce538['statusUrl']&&_0x8284ef[_0x1608e6(0x19c)]('statusUrl:\x20'+_0x1ce538['statusUrl']),_0x1ce538[_0x1608e6(0x1d8)]&&_0x8284ef['push'](_0x1608e6(0x220)+_0x1ce538['resultUrl']),_0x1ce538[_0x1608e6(0x1c0)]&&_0x8284ef['push'](_0x1608e6(0x1f1)+_0x1ce538[_0x1608e6(0x1c0)]),_0x1ce538[_0x1608e6(0x232)]&&(_0x8284ef[_0x1608e6(0x19c)](_0x1608e6(0x19e)+_0x1ce538[_0x1608e6(0x232)]['id']+'\x20('+(_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1fe)]??'unknown')+')'),_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1f2)]&&_0x8284ef[_0x1608e6(0x19c)](_0x1608e6(0x150)+_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1f2)]['id']+_0x1608e6(0x176)+(_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1f2)][_0x1608e6(0x184)]??''))),_0x1ce538[_0x1608e6(0x14d)]?.[_0x1608e6(0x1f2)]){const _0x44d000=_0x1ce538[_0x1608e6(0x14d)][_0x1608e6(0x1f2)];_0x8284ef['push'](_0x1608e6(0x13f)+(_0x44d000[_0x1608e6(0x1b7)]??_0x44d000['id']??_0x1608e6(0x201)));}return!_0x1ce538['plan']&&_0x1ce538[_0x1608e6(0x1a8)]===_0x1608e6(0x1bd)&&_0x1ce538[_0x1608e6(0x166)]?.[_0x1608e6(0x1b5)]&&(_0x8284ef[_0x1608e6(0x19c)]('prepared\x20input:'),_0x8284ef[_0x1608e6(0x19c)](JSON[_0x1608e6(0x1a5)](_0x1ce538[_0x1608e6(0x166)][_0x1608e6(0x1b5)],null,0x2))),_0x8284ef[_0x1608e6(0x144)]('\x0a');}function T(_0x17ffe5,_0x1393f5){const _0x28d4a3=_0x434f;if(_0x17ffe5[_0x28d4a3(0x178)]===_0x28d4a3(0x229)){_0x1393f5[_0x28d4a3(0x179)]?_0x11a1cd({'status':_0x28d4a3(0x229),'action':_0x17ffe5['state'][_0x28d4a3(0x1a8)],'requestKey':_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x1e9)],'parent':_0x17ffe5['state'][_0x28d4a3(0x232)]??null,'check':_0x17ffe5['check']},_0x1393f5):(_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x232)]&&_0x1ab7b2(K(_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x232)])+'\x0a'),_0x1ab7b2(C(_0x17ffe5[_0x28d4a3(0x14d)])+'\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a')),process[_0x28d4a3(0x221)]=0x1;return;}if(_0x17ffe5[_0x28d4a3(0x178)]===_0x28d4a3(0x22b)){const _0x46783f=I(_0x17ffe5[_0x28d4a3(0x1fe)]);if(_0x1393f5[_0x28d4a3(0x179)])_0x11a1cd({..._0x46783f,'status':_0x28d4a3(0x22b)},_0x1393f5);else{const _0x77144e=[_0x28d4a3(0x152)+_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x233)]+_0x28d4a3(0x21e),_0x28d4a3(0x1f3)+(_0x17ffe5['state'][_0x28d4a3(0x19b)]??_0x28d4a3(0x202))+(_0x17ffe5['state'][_0x28d4a3(0x1c0)]?_0x28d4a3(0x1e0)+_0x17ffe5[_0x28d4a3(0x1fe)]['transactionHash']:'')];for(const _0x4eb9f5 of _0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x1af)]??[])_0x77144e[_0x28d4a3(0x19c)](_0x28d4a3(0x14c)+(_0x4eb9f5['code']??_0x28d4a3(0x22b))+':\x20'+(_0x4eb9f5[_0x28d4a3(0x1c3)]??JSON['stringify'](_0x4eb9f5)));_0x77144e[_0x28d4a3(0x19c)](_0x28d4a3(0x1d9)+_0x17ffe5['state'][_0x28d4a3(0x233)]+_0x28d4a3(0x146)),_0x1ab7b2(_0x77144e['join']('\x0a')+'\x0a');}process[_0x28d4a3(0x221)]=0x1;return;}if(['expired',_0x28d4a3(0x235),_0x28d4a3(0x1be),_0x28d4a3(0x1a9)][_0x28d4a3(0x1d7)](_0x17ffe5[_0x28d4a3(0x178)])){const _0x58adee=_0x17ffe5[_0x28d4a3(0x1fe)];if(_0x1393f5['json'])_0x11a1cd({...I(_0x58adee),'status':_0x17ffe5[_0x28d4a3(0x178)]},_0x1393f5);else{const _0x780b9a=_0x58adee[_0x28d4a3(0x18b)]??_0x58adee[_0x28d4a3(0x228)],_0x32e6a8=[_0x28d4a3(0x1ce),_0x28d4a3(0x18c)];_0x780b9a?.[_0x28d4a3(0x139)]&&_0x32e6a8['push'](_0x28d4a3(0x204)+_0x780b9a['hash']+(_0x780b9a[_0x28d4a3(0x1f7)]?'\x20('+_0x780b9a[_0x28d4a3(0x1f7)]+')':'')),_0x780b9a?.['reason']&&_0x32e6a8[_0x28d4a3(0x19c)](_0x28d4a3(0x182)+_0x780b9a[_0x28d4a3(0x17b)]),_0x780b9a?.['explorerUrl']&&_0x32e6a8['push'](_0x28d4a3(0x1d5)+_0x780b9a[_0x28d4a3(0x207)]),_0x58adee['transactionHash']&&_0x58adee[_0x28d4a3(0x1c0)]!==_0x780b9a?.[_0x28d4a3(0x139)]&&_0x32e6a8['push']('transaction:\x20'+_0x58adee[_0x28d4a3(0x1c0)]),_0x58adee[_0x28d4a3(0x233)]&&_0x32e6a8[_0x28d4a3(0x19c)](_0x28d4a3(0x227)+_0x58adee['orderId']),_0x1ab7b2(_0x32e6a8['join']('\x0a')+'\x0a');}process[_0x28d4a3(0x221)]=0x1;return;}if(_0x17ffe5[_0x28d4a3(0x178)]!==_0x28d4a3(0x14b))throw new Error('order\x20ended\x20with\x20status:\x20'+_0x17ffe5['status']+';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20'+_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x233)]+_0x28d4a3(0x146));_0x11a1cd(_0x1393f5[_0x28d4a3(0x179)]?I(_0x17ffe5[_0x28d4a3(0x1fe)]):oe(_0x17ffe5['state']),_0x1393f5);}function K(_0xca3e3e){const _0x504b59=_0x434f,_0x16fc7f=_0x85a4a1(_0xca3e3e),_0x5637d5=['parent:\x20\x20\x20\x20'+_0x16fc7f['id'],'state:\x20\x20\x20\x20\x20'+(_0x16fc7f[_0x504b59(0x1fe)]??''),'template:\x20\x20'+(_0x16fc7f[_0x504b59(0x1cc)]??''),_0x504b59(0x173)+b(_0x16fc7f[_0x504b59(0x210)],0x1f4),_0x504b59(0x168)+(_0x16fc7f[_0x504b59(0x22c)]??'')];return _0x16fc7f[_0x504b59(0x1f2)]&&_0x5637d5[_0x504b59(0x19c)](_0x504b59(0x150)+_0x16fc7f[_0x504b59(0x1f2)]['id']+_0x504b59(0x176)+(_0x16fc7f[_0x504b59(0x1f2)][_0x504b59(0x184)]??'')+_0x504b59(0x1ed)+_0x16fc7f[_0x504b59(0x1f2)][_0x504b59(0x20e)]['length']),_0x5637d5[_0x504b59(0x144)]('\x0a');}function ie(_0x1a90ee){const _0x31e505=_0x434f;return _0x1a90ee?_0x1a90ee[_0x31e505(0x1b7)]?'project:\x20\x20\x20'+b(_0x1a90ee['summary'],0x1f4):_0x1a90ee['id']?_0x31e505(0x150)+_0x1a90ee['id']:null:null;}function J(_0xa685b4,_0x29055e,_0x29495a,_0x529ca8){const _0x4f3833=_0x434f,_0x12e04a=[];_0x529ca8&&_0x12e04a[_0x4f3833(0x19c)](K(_0x529ca8)),_0x12e04a[_0x4f3833(0x19c)](_0x4f3833(0x1ef)+_0xa685b4),_0x12e04a[_0x4f3833(0x19c)]('input:'),_0x12e04a[_0x4f3833(0x19c)](JSON[_0x4f3833(0x1a5)](_0x29055e,null,0x2)),_0x12e04a['push'](C(_0x29495a));const _0x2296ce=ie(_0x29495a[_0x4f3833(0x1f2)]);return _0x2296ce&&_0x12e04a[_0x4f3833(0x19c)](_0x2296ce),_0x12e04a[_0x4f3833(0x144)]('\x0a');}function O(_0x2a80bc){const _0xda3409=_0x434f;return _0x2a80bc['file']!==void 0x0||_0x2a80bc[_0xda3409(0x1a4)]!==void 0x0||_0x2a80bc['skill']!==void 0x0||_0x2a80bc['template']!==void 0x0||Array[_0xda3409(0x20b)](_0x2a80bc[_0xda3409(0x211)])&&_0x2a80bc[_0xda3409(0x211)][_0xda3409(0x1ae)]>0x0;}function N(_0x36cfdb){const _0x390b0c=_0x434f;return _0x36cfdb[_0x390b0c(0x226)]!==void 0x0||_0x36cfdb[_0x390b0c(0x208)]!==void 0x0||_0x36cfdb[_0x390b0c(0x1cc)]!==void 0x0||Array[_0x390b0c(0x20b)](_0x36cfdb[_0x390b0c(0x211)])&&_0x36cfdb[_0x390b0c(0x211)][_0x390b0c(0x1ae)]>0x0;}function re(_0x19b5ad,_0x272539){const _0x52e6d5=_0x434f;return typeof _0x19b5ad==_0x52e6d5(0x1d4)&&_0x19b5ad[_0x52e6d5(0x18f)]()!==''&&!O(_0x272539);}function se(_0x4325ae,_0x4f99c9){const _0x4f5139=_0x434f;return typeof _0x4325ae==_0x4f5139(0x1d4)&&_0x4325ae['trim']()!==''&&!N(_0x4f99c9);}function $(_0x5ca62c){const _0x3dfd9b=_0x434f,_0x5b2dd3=[_0x3dfd9b(0x174)+_0x5ca62c[_0x3dfd9b(0x1b7)],_0x3dfd9b(0x1d0)];_0x5ca62c[_0x3dfd9b(0x224)][_0x3dfd9b(0x1ae)]===0x0&&_0x5b2dd3[_0x3dfd9b(0x19c)](_0x3dfd9b(0x138));for(const _0x39536d of _0x5ca62c[_0x3dfd9b(0x224)])_0x5b2dd3[_0x3dfd9b(0x19c)]('\x20\x20-\x20'+_0x39536d);return _0x5b2dd3['join']('\x0a');}function U(_0x198a8a,_0x31a6d1){const _0xca620f=_0x434f,_0x58d911=[$(_0x198a8a),_0xca620f(0x1ca)+_0x31a6d1[_0xca620f(0x16e)][_0xca620f(0x1ae)]+_0xca620f(0x1ba)];for(const _0x43104f of _0x31a6d1[_0xca620f(0x16e)])_0x58d911['push'](_0xca620f(0x14c)+_0x43104f[_0xca620f(0x18d)]+':\x20'+_0x43104f[_0xca620f(0x1c3)]);return _0x58d911[_0xca620f(0x144)]('\x0a');}function W(_0x4189c7,_0x3b1015,_0x1492c0){const _0x57c8d7=_0x434f;if(_0x1492c0[_0x57c8d7(0x179)])_0x11a1cd({'action':_0x3b1015,'summary':_0x4189c7[_0x57c8d7(0x1b7)],'deliverables':_0x4189c7['deliverables'],'questions':_0x4189c7['questions'],'input':null},_0x1492c0);else{const _0x458402=_0x4189c7[_0x57c8d7(0x14a)]['map'](_0x32cef3=>_0x57c8d7(0x14c)+_0x32cef3)[_0x57c8d7(0x144)]('\x0a');_0x11a1cd($(_0x4189c7)+_0x57c8d7(0x1bf)+_0x458402,_0x1492c0);}process['exitCode']=0x1;}function ae(_0x1e452d){const _0x26b3c9=_0x434f;return _0x1e452d[_0x26b3c9(0x177)]===void 0x0&&_0x1e452d['commit']===void 0x0?null:{'repoUrl':_0x1e452d[_0x26b3c9(0x177)],'baseCommit':_0x1e452d['commit']};}async function P({api:_0x5c34ea,home:_0x3dca9c,objective:_0x14384e,answers:_0x12503e,parent:_0x954370=null,source:_0xf0485a=null,github:_0x2a03e7=!0x1,opts:_0xa6bf23,loadPlanner:_0x4805a9}){const _0x32f992=_0x434f;return _0x776995({'api':_0x5c34ea,'home':_0x3dca9c,'loadPlanner':_0x4805a9,'objective':_0x14384e,'answers':_0x12503e,'parent':_0x954370,'source':_0xf0485a,'github':_0x2a03e7,'ask':!_0xa6bf23[_0x32f992(0x179)]&&process[_0x32f992(0x190)][_0x32f992(0x1e6)]?_0x24b365:null});}function R(_0x2a8835,_0x2ce51c,{api:_0x579718,action:_0x9d70cc}){const _0x124c2f=_0x434f;if(!_0x2a8835)throw new Error('unknown\x20request\x20key:\x20'+_0x2ce51c);if(_0x2a8835[_0x124c2f(0x137)]!==_0x579718)throw new Error('order\x20'+_0x2a8835[_0x124c2f(0x1e9)]+_0x124c2f(0x16f)+_0x2a8835['api']+_0x124c2f(0x1f4)+_0x2a8835['api']);if(_0x2a8835[_0x124c2f(0x1a8)]!==_0x9d70cc)throw new Error('request\x20key\x20'+_0x2a8835[_0x124c2f(0x1e9)]+_0x124c2f(0x1d1)+_0x2a8835[_0x124c2f(0x1a8)]+_0x124c2f(0x200)+_0x9d70cc);if(!_0x2a8835['input']||typeof _0x2a8835[_0x124c2f(0x1b5)]!=_0x124c2f(0x17c)||Array[_0x124c2f(0x20b)](_0x2a8835['input']))throw new Error('request\x20key\x20'+_0x2a8835[_0x124c2f(0x1e9)]+_0x124c2f(0x236));return _0x2a8835[_0x124c2f(0x1b5)];}function pe(_0x5b368c,_0x12d4f4){const _0x3e6ed9=_0x434f;return _0x3e6ed9(0x20c)+_0x5b368c[_0x3e6ed9(0x137)]+_0x3e6ed9(0x1e3)+_0x12d4f4['home']+'\x20task\x20create\x20--request-key\x20'+_0x5b368c['requestKey'];}function ue(_0x2b67a8,_0x8024c0){const _0x49ec69=_0x434f;return _0x49ec69(0x20c)+_0x2b67a8[_0x49ec69(0x137)]+_0x49ec69(0x1e3)+_0x8024c0[_0x49ec69(0x175)]+_0x49ec69(0x1e2)+_0x2b67a8[_0x49ec69(0x1b5)][_0x49ec69(0x15f)]+_0x49ec69(0x19d)+_0x2b67a8[_0x49ec69(0x1e9)];}function ke(_0xbebcb8,{loadPlanner:_0x2a7079=_0x4dd879}={}){const _0x4a90f4=_0x434f,_0x855834=_0xbebcb8[_0x4a90f4(0x1ee)](_0x4a90f4(0x206))['description'](_0x4a90f4(0x140));_0x2bcb6c(_0x855834),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x209))[_0x4a90f4(0x193)]('list\x20jobs')[_0x4a90f4(0x1d2)]('--q\x20<text>',_0x4a90f4(0x21a))[_0x4a90f4(0x1d2)](_0x4a90f4(0x163),_0x4a90f4(0x1e5))[_0x4a90f4(0x1d2)](_0x4a90f4(0x1ab),_0x4a90f4(0x1bc))[_0x4a90f4(0x1d2)](_0x4a90f4(0x14e),_0x4a90f4(0x1c9))[_0x4a90f4(0x1d2)](_0x4a90f4(0x16c),_0x4a90f4(0x197))[_0x4a90f4(0x1a8)](async(_0x24ff45,_0x28bd58)=>{const _0x535151=_0x4a90f4,_0x103e5=_0x28bd58[_0x535151(0x149)](),_0x6314d7=await _0x11f4e2(_0x103e5[_0x535151(0x137)],Z(_0x103e5));_0x11a1cd(_0x103e5['json']?_0x6314d7[_0x535151(0x1cd)]:ee(_0x6314d7[_0x535151(0x1cd)]),_0x103e5);}),_0x855834[_0x4a90f4(0x1ee)]('show\x20<id>')[_0x4a90f4(0x193)](_0x4a90f4(0x160))[_0x4a90f4(0x1a8)](async(_0x44cedc,_0xc74e67,_0x3260fa)=>{const _0x543eef=_0x4a90f4,_0xaf3cd4=_0x3260fa[_0x543eef(0x149)](),_0x501457=await _0x11f4e2(_0xaf3cd4['api'],'/jobs/'+encodeURIComponent(_0x44cedc));_0x11a1cd(_0xaf3cd4[_0x543eef(0x179)]?_0x501457[_0x543eef(0x1cd)]:te(_0x501457[_0x543eef(0x1cd)]),_0xaf3cd4);}),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x1ad))[_0x4a90f4(0x193)](_0x4a90f4(0x1ac))[_0x4a90f4(0x1a8)](async(_0x39a9b5,_0x2a2ddd,_0x1f72be)=>{const _0x479221=_0x4a90f4,_0x540ab6=_0x1f72be[_0x479221(0x149)](),_0x49c881=await _0x11f4e2(_0x540ab6[_0x479221(0x137)],_0x479221(0x1a2)+encodeURIComponent(_0x39a9b5)+_0x479221(0x17f));_0x11a1cd(_0x540ab6[_0x479221(0x179)]?_0x49c881['data']:A(_0x49c881[_0x479221(0x1cd)]),_0x540ab6);}),_0x855834[_0x4a90f4(0x1ee)]('wait\x20<id>')['description']('poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out')[_0x4a90f4(0x1d2)](_0x4a90f4(0x217),_0x4a90f4(0x1f6),String(_0x502ffb))[_0x4a90f4(0x1d2)](_0x4a90f4(0x167),_0x4a90f4(0x22e),String(_0x4a4dfa))[_0x4a90f4(0x1a8)](async(_0x3426e3,_0x4b652f,_0x19f783)=>{const _0x58fa4b=_0x4a90f4,_0x1639dc=_0x19f783['optsWithGlobals'](),_0x4724b7=await _0xe1778({'api':_0x1639dc[_0x58fa4b(0x137)],'id':_0x3426e3,'interval':_0x1639dc['interval'],'timeout':_0x1639dc[_0x58fa4b(0x143)],'onProgress':_0x3629c0=>{const _0x4838f8=_0x58fa4b;_0x3629c0[_0x4838f8(0x1c2)]===_0x4838f8(0x15c)?_0x1ab7b2(_0x4838f8(0x1e4)+_0x3629c0[_0x4838f8(0x1fe)]+_0x4838f8(0x225)+_0x3629c0['complete']+'\x20(poll\x20'+_0x3629c0[_0x4838f8(0x1df)]+',\x20'+(_0x3629c0[_0x4838f8(0x159)]/0x3e8)[_0x4838f8(0x214)](0x1)+_0x4838f8(0x16b)):_0x3629c0[_0x4838f8(0x1c2)]===_0x4838f8(0x218)&&_0x1ab7b2(_0x4838f8(0x1e4)+(_0x3629c0[_0x4838f8(0x178)]?_0x4838f8(0x19f)+_0x3629c0[_0x4838f8(0x178)]:_0x4838f8(0x186))+_0x4838f8(0x21d)+(_0x3629c0['delayMs']/0x3e8)['toFixed'](0x1)+_0x4838f8(0x181)+_0x3629c0['retries']+')\x0a');}});if(_0x4724b7[_0x58fa4b(0x1d6)]===_0x58fa4b(0x1a0)){_0x1ab7b2(_0x58fa4b(0x1fa)),process[_0x58fa4b(0x221)]=0x82;return;}_0x4724b7[_0x58fa4b(0x222)]&&_0x11a1cd(_0x1639dc['json']?_0x4724b7[_0x58fa4b(0x222)]:A(_0x4724b7[_0x58fa4b(0x222)]),_0x1639dc),_0x4724b7[_0x58fa4b(0x1d6)]!==_0x58fa4b(0x187)&&(_0x1ab7b2(_0x58fa4b(0x1e4)+_0x4724b7[_0x58fa4b(0x157)]+'\x0a'),process['exitCode']=0x1);}),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x20f))[_0x4a90f4(0x193)](_0x4a90f4(0x1d3))['requiredOption'](_0x4a90f4(0x20d),_0x4a90f4(0x1a1))['action'](async(_0x4cdd0d,_0x4e79cd,_0x369910)=>{const _0x37295d=_0x4a90f4,_0x786d80=_0x369910[_0x37295d(0x149)](),_0xae27e0=await _0x33c8ee({'api':_0x786d80['api'],'id':_0x4cdd0d,'out':_0x786d80[_0x37295d(0x1f9)],'onProgress':_0xc48bbc=>{const _0x3c1424=_0x37295d;_0xc48bbc['type']===_0x3c1424(0x234)&&_0x1ab7b2(_0x3c1424(0x141)+_0xc48bbc[_0x3c1424(0x211)]+_0x3c1424(0x1ea)+_0xc48bbc[_0x3c1424(0x226)]+'\x0a');}});_0x11a1cd(_0x786d80[_0x37295d(0x179)]?_0xae27e0:ne(_0xae27e0),_0x786d80);}),_0x855834['command'](_0x4a90f4(0x14d))['description'](_0x4a90f4(0x17a))[_0x4a90f4(0x17d)](_0x4a90f4(0x16d),_0x4a90f4(0x1ec))[_0x4a90f4(0x1d2)](_0x4a90f4(0x1e7),'action\x20to\x20check\x20(defaults\x20from\x20parentJobId)')['action'](async(_0x143b99,_0x597373)=>{const _0x3e26f3=_0x4a90f4,_0x2fc997=_0x597373[_0x3e26f3(0x149)](),_0x509d20=await _0x39c26e(_0x2fc997[_0x3e26f3(0x226)]),_0x3354f5=_0x2fc997[_0x3e26f3(0x1a8)]??_0x4a2a86(_0x509d20),_0x22eb50=await _0x281c72(_0x2fc997[_0x3e26f3(0x137)],_0x509d20,_0x3354f5);_0x11a1cd(_0x2fc997[_0x3e26f3(0x179)]?_0x22eb50:C(_0x22eb50),_0x2fc997);}),_0x855834['command'](_0x4a90f4(0x13b))[_0x4a90f4(0x193)]('check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file')[_0x4a90f4(0x17d)](_0x4a90f4(0x16d),_0x4a90f4(0x1ec))[_0x4a90f4(0x1d2)]('--request-key\x20<uuid>',_0x4a90f4(0x13d))[_0x4a90f4(0x1a8)](async(_0x4574bb,_0x2ec930)=>{const _0x10ed47=_0x4a90f4,_0x2b42d1=_0x2ec930[_0x10ed47(0x149)](),_0x4fa3da=_0x2b42d1[_0x10ed47(0x1e9)]?null:await x(_0x2b42d1,_0x10ed47(0x203)),_0x253a11=await _0x17effd({'api':_0x2b42d1['api'],'home':_0x2b42d1['home'],'file':_0x2b42d1[_0x10ed47(0x226)],'action':'job.open','requestKey':_0x2b42d1[_0x10ed47(0x1e9)],'yes':_0x2b42d1[_0x10ed47(0x1f5)],'keyEnv':_0x2b42d1['keyEnv'],'rpc':_0x2b42d1[_0x10ed47(0x21b)],'paymentChain':_0x2b42d1[_0x10ed47(0x1dd)]??_0x4fa3da?.[_0x10ed47(0x1dd)],'payWith':_0x2b42d1[_0x10ed47(0x219)]??_0x4fa3da?.[_0x10ed47(0x219)],'onProgress':_0x39d34c(_0x2b42d1)});T(_0x253a11,_0x2b42d1);}),_0x855834[_0x4a90f4(0x1ee)]('create\x20[objective]')[_0x4a90f4(0x193)](_0x4a90f4(0x20a))[_0x4a90f4(0x1d2)](_0x4a90f4(0x16d),_0x4a90f4(0x1b6))[_0x4a90f4(0x1d2)]('--preset\x20<name>',_0x4a90f4(0x153))[_0x4a90f4(0x1d2)]('--skill\x20<id>','runnable\x20skill\x20id')[_0x4a90f4(0x1d2)]('--template\x20<name>',_0x4a90f4(0x238))['option'](_0x4a90f4(0x13a),_0x4a90f4(0x1a6),(_0xae00d,_0x26f4d6)=>[..._0x26f4d6,_0xae00d],[])[_0x4a90f4(0x1d2)]('--repo\x20<url>',_0x4a90f4(0x1ff))[_0x4a90f4(0x1d2)]('--commit\x20<sha>',_0x4a90f4(0x188))[_0x4a90f4(0x1d2)](_0x4a90f4(0x151),_0x4a90f4(0x1f0))[_0x4a90f4(0x1d2)](_0x4a90f4(0x156),_0x4a90f4(0x230),(_0xc434b0,_0x4a5aaa)=>[..._0x4a5aaa,_0xc434b0],[])['option'](_0x4a90f4(0x15e),_0x4a90f4(0x1fb))[_0x4a90f4(0x1d2)](_0x4a90f4(0x23a),_0x4a90f4(0x22a))[_0x4a90f4(0x1d2)](_0x4a90f4(0x15b),_0x4a90f4(0x13d))[_0x4a90f4(0x1a8)](async(_0x20dcc3,_0x549e57,_0x142b6c)=>{const _0x369a37=_0x4a90f4,_0x2285da=_0x142b6c[_0x369a37(0x149)](),_0xcc65ad=_0x2285da[_0x369a37(0x1b0)]||_0x2285da[_0x369a37(0x1e9)]?null:await x(_0x2285da,_0x369a37(0x203)),_0x4fbffa=re(_0x20dcc3,_0x2285da);let _0x3d7f5c,_0x39468c=null;if(_0x2285da[_0x369a37(0x1e9)]&&!O(_0x2285da)&&(_0x20dcc3===void 0x0||_0x4fbffa)){const _0x45109e=await _0x35669f(_0x2285da[_0x369a37(0x175)],_0x2285da[_0x369a37(0x1e9)]);if(_0x3d7f5c=R(_0x45109e,_0x2285da[_0x369a37(0x1e9)],{'api':_0x2285da['api'],'action':_0x369a37(0x203)}),_0x20dcc3!==void 0x0&&_0x20dcc3!==_0x3d7f5c[_0x369a37(0x210)])throw new Error('request\x20key\x20'+_0x2285da[_0x369a37(0x1e9)]+_0x369a37(0x237));}else{if(_0x4fbffa){if(_0x39468c=await P({'api':_0x2285da[_0x369a37(0x137)],'home':_0x2285da[_0x369a37(0x175)],'objective':_0x20dcc3,'answers':_0x2285da[_0x369a37(0x198)],'source':ae(_0x2285da),'github':_0x2285da[_0x369a37(0x1cf)]===!0x0,'opts':_0x2285da,'loadPlanner':_0x2a7079}),_0x39468c['input']===null){W(_0x39468c,_0x369a37(0x203),_0x2285da);return;}_0x3d7f5c=_0x39468c[_0x369a37(0x1b5)];}else{const _0x223e38=_0x2285da['file']?await _0x39c26e(_0x2285da[_0x369a37(0x226)]):void 0x0;_0x3d7f5c=await _0x2616f0({'fileInput':_0x223e38,'objective':_0x20dcc3,'preset':_0x2285da[_0x369a37(0x1a4)],'skill':_0x2285da['skill'],'template':_0x2285da[_0x369a37(0x1cc)],'paths':_0x2285da[_0x369a37(0x211)],'repo':_0x2285da[_0x369a37(0x177)],'commit':_0x2285da[_0x369a37(0x223)],'github':_0x2285da[_0x369a37(0x1cf)]});}}if(_0x2285da[_0x369a37(0x162)]&&(await _0xff79a7(_0x2285da[_0x369a37(0x162)],_0x3d7f5c),_0x2285da[_0x369a37(0x179)]||_0x1ab7b2(_0x369a37(0x22f)+_0x2285da[_0x369a37(0x162)]+'\x0a')),_0x2285da['dryRun']){const _0x50581f=await _0x281c72(_0x2285da['api'],_0x3d7f5c,_0x369a37(0x203));_0x2285da[_0x369a37(0x179)]?_0x11a1cd({'action':'job.open',..._0x39468c?{'summary':_0x39468c[_0x369a37(0x1b7)],'deliverables':_0x39468c[_0x369a37(0x224)]}:{},'input':_0x3d7f5c,'check':_0x50581f},_0x2285da):_0x11a1cd(_0x39468c?U(_0x39468c,_0x50581f):J(_0x369a37(0x203),_0x3d7f5c,_0x50581f),_0x2285da),_0x50581f[_0x369a37(0x16e)][_0x369a37(0x1ae)]>0x0&&(process[_0x369a37(0x221)]=0x1);return;}_0x39468c&&!_0x2285da['json']&&_0x1ab7b2($(_0x39468c)+'\x0a');const _0x2f9111=await _0x17effd({'api':_0x2285da['api'],'home':_0x2285da[_0x369a37(0x175)],'input':_0x3d7f5c,'action':_0x369a37(0x203),'requestKey':_0x2285da[_0x369a37(0x1e9)],'plan':_0x39468c?{'summary':_0x39468c[_0x369a37(0x1b7)],'deliverables':_0x39468c['deliverables']}:void 0x0,'yes':_0x2285da['yes'],'keyEnv':_0x2285da['keyEnv'],'rpc':_0x2285da[_0x369a37(0x21b)],'paymentChain':_0x2285da['paymentChain']??_0xcc65ad?.[_0x369a37(0x1dd)],'payWith':_0x2285da[_0x369a37(0x219)]??_0xcc65ad?.[_0x369a37(0x219)],'onProgress':_0x39d34c(_0x2285da),'retryCommand':_0x40d933=>pe(_0x40d933,_0x2285da)});T(_0x2f9111,_0x2285da);}),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x161))[_0x4a90f4(0x193)](_0x4a90f4(0x1da))['option'](_0x4a90f4(0x16d),_0x4a90f4(0x14f))[_0x4a90f4(0x1d2)](_0x4a90f4(0x1a3),'runnable\x20skill\x20id')['option'](_0x4a90f4(0x170),'job\x20template')['option'](_0x4a90f4(0x13a),_0x4a90f4(0x1a6),(_0x473e16,_0x3fdf50)=>[..._0x3fdf50,_0x473e16],[])[_0x4a90f4(0x1d2)](_0x4a90f4(0x156),_0x4a90f4(0x230),(_0xb21fad,_0x1cc5fb)=>[..._0x1cc5fb,_0xb21fad],[])[_0x4a90f4(0x1d2)](_0x4a90f4(0x15e),_0x4a90f4(0x1fb))[_0x4a90f4(0x1d2)]('--save\x20<path>','save\x20the\x20input\x20JSON\x20without\x20overwriting')[_0x4a90f4(0x1d2)]('--request-key\x20<uuid>',_0x4a90f4(0x13d))[_0x4a90f4(0x1a8)](async(_0x367ae3,_0x3e5e59,_0x244be6,_0x5d9e82)=>{const _0x3c7acc=_0x4a90f4,_0x26e595=_0x5d9e82[_0x3c7acc(0x149)](),_0x236cbe=_0x26e595[_0x3c7acc(0x1b0)]||_0x26e595['requestKey']?null:await x(_0x26e595,_0x3c7acc(0x1bd)),_0x22b1c3=se(_0x3e5e59,_0x26e595);let _0x3f9c25,_0x39d9d1,_0x3df553=null;if(_0x26e595[_0x3c7acc(0x1e9)]&&!N(_0x26e595)&&(_0x3e5e59===void 0x0||_0x22b1c3)){const _0x21e4d2=await _0x35669f(_0x26e595[_0x3c7acc(0x175)],_0x26e595[_0x3c7acc(0x1e9)]);if(_0x3f9c25=R(_0x21e4d2,_0x26e595[_0x3c7acc(0x1e9)],{'api':_0x26e595[_0x3c7acc(0x137)],'action':_0x3c7acc(0x1bd)}),_0x3f9c25[_0x3c7acc(0x15f)]!==_0x367ae3)throw new Error(_0x3c7acc(0x213)+_0x26e595[_0x3c7acc(0x1e9)]+_0x3c7acc(0x1c1)+(_0x3f9c25[_0x3c7acc(0x15f)]??'<none>')+',\x20not\x20'+_0x367ae3);if(_0x3e5e59!==void 0x0&&_0x3e5e59!==_0x3f9c25[_0x3c7acc(0x210)])throw new Error(_0x3c7acc(0x213)+_0x26e595['requestKey']+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x39d9d1=(await _0x11f4e2(_0x26e595[_0x3c7acc(0x137)],_0x3c7acc(0x1a2)+encodeURIComponent(_0x367ae3)))[_0x3c7acc(0x1cd)];}else{if(_0x22b1c3){if(_0x39d9d1=(await _0x11f4e2(_0x26e595[_0x3c7acc(0x137)],'/jobs/'+encodeURIComponent(_0x367ae3)))[_0x3c7acc(0x1cd)],_0x3df553=await P({'api':_0x26e595[_0x3c7acc(0x137)],'home':_0x26e595['home'],'objective':_0x3e5e59,'answers':_0x26e595['answer'],'parent':_0x39d9d1,'opts':_0x26e595,'loadPlanner':_0x2a7079}),_0x3df553[_0x3c7acc(0x1b5)]===null){W(_0x3df553,'job.continue',_0x26e595);return;}_0x3f9c25=_0x3df553['input'],_0x3f9c25[_0x3c7acc(0x15f)]!==_0x367ae3&&(_0x3f9c25={..._0x3f9c25,'parentJobId':_0x367ae3});}else{const _0x12f01d=_0x26e595[_0x3c7acc(0x226)]?await _0x39c26e(_0x26e595[_0x3c7acc(0x226)]):void 0x0;_0x3f9c25=await _0x14b6ea({'id':_0x367ae3,'fileInput':_0x12f01d,'objective':_0x3e5e59,'skill':_0x26e595[_0x3c7acc(0x208)],'template':_0x26e595[_0x3c7acc(0x1cc)],'paths':_0x26e595[_0x3c7acc(0x211)]}),_0x39d9d1=(await _0x11f4e2(_0x26e595[_0x3c7acc(0x137)],_0x3c7acc(0x1a2)+encodeURIComponent(_0x367ae3)))[_0x3c7acc(0x1cd)];}}if(_0x26e595[_0x3c7acc(0x162)]&&(await _0xff79a7(_0x26e595[_0x3c7acc(0x162)],_0x3f9c25),_0x26e595[_0x3c7acc(0x179)]||_0x1ab7b2('saved\x20input:\x20'+_0x26e595[_0x3c7acc(0x162)]+'\x0a')),_0x26e595['dryRun']){const _0x49aab5=await _0x281c72(_0x26e595['api'],_0x3f9c25,_0x3c7acc(0x1bd));_0x26e595['json']?_0x11a1cd({'action':_0x3c7acc(0x1bd),..._0x3df553?{'summary':_0x3df553[_0x3c7acc(0x1b7)],'deliverables':_0x3df553[_0x3c7acc(0x224)]}:{},'parent':_0x85a4a1(_0x39d9d1),'input':_0x3f9c25,'check':_0x49aab5},_0x26e595):_0x11a1cd(_0x3df553?U(_0x3df553,_0x49aab5):J(_0x3c7acc(0x1bd),_0x3f9c25,_0x49aab5,_0x39d9d1),_0x26e595),_0x49aab5[_0x3c7acc(0x16e)][_0x3c7acc(0x1ae)]>0x0&&(process[_0x3c7acc(0x221)]=0x1);return;}_0x3df553&&!_0x26e595[_0x3c7acc(0x179)]&&_0x1ab7b2($(_0x3df553)+'\x0a');const _0x4b9409=await _0x17effd({'api':_0x26e595[_0x3c7acc(0x137)],'home':_0x26e595[_0x3c7acc(0x175)],'input':_0x3f9c25,'action':_0x3c7acc(0x1bd),'requestKey':_0x26e595[_0x3c7acc(0x1e9)],'plan':_0x3df553?{'summary':_0x3df553['summary'],'deliverables':_0x3df553['deliverables']}:void 0x0,'yes':_0x26e595[_0x3c7acc(0x1f5)],'keyEnv':_0x26e595[_0x3c7acc(0x155)],'rpc':_0x26e595[_0x3c7acc(0x21b)],'paymentChain':_0x26e595[_0x3c7acc(0x1dd)]??_0x236cbe?.[_0x3c7acc(0x1dd)],'payWith':_0x26e595[_0x3c7acc(0x219)]??_0x236cbe?.['payWith'],'onProgress':_0x39d34c(_0x26e595),'retryCommand':_0x54ca91=>ue(_0x54ca91,_0x26e595)});_0x4b9409[_0x3c7acc(0x1fe)]&&(_0x4b9409['state'][_0x3c7acc(0x232)]=_0x85a4a1(_0x39d9d1)),T(_0x4b9409,_0x26e595);});}export{ke as registerTaskCommands};
1
+ import{writeDiagnostic as _0x253e14}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x2aaf95}from'../lib/payment-progress.mjs';import{request as _0x6e1b30,print as _0x40216c}from'../shared.mjs';import{checkJob as _0x347c7b,publishJob as _0x3706aa,readJobFile as _0x41f5a5}from'../lib/publish.mjs';import{loadOrder as _0x96fca9,orderActions as _0x58da2f}from'../lib/orders.mjs';import{buildContinueInput as _0x274855,buildCreateInput as _0x5d1a0d,parentSummary as _0x3bbc3b,resolveAction as _0x53f80f,saveInputFile as _0x2e7447}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x4e7f2d,DEFAULT_TIMEOUT_SECONDS as _0x2f6fa0,downloadTaskFiles as _0x59c773,waitForResult as _0x36a815}from'../lib/task-result.mjs';import{askQuestions as _0x5da7a4,loadLocalPlanner as _0x43d523,planTask as _0x1ddb5f}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x287884}from'./my-tasks.mjs';import{orderPayment as _0x4e5577}from'../lib/payments.mjs';import{checkTaskWallet as _0x1a2fa6}from'../lib/task-wallet.mjs';async function x(_0x21fc22,_0x4b8caf){const _0x26d468=_0x5aee;let _0x22e01d;if(_0x21fc22[_0x26d468(0x1fe)]){const _0x4980bb=await _0x96fca9(_0x21fc22[_0x26d468(0x189)],_0x21fc22[_0x26d468(0x1fe)]);if(_0x4980bb&&!_0x58da2f(_0x4980bb)[_0x26d468(0x1f7)])return null;_0x4980bb&&(_0x22e01d={'paymentChain':_0x4980bb['paymentChain']??_0x26d468(0x247),'payWith':_0x4980bb[_0x26d468(0x262)]??_0x26d468(0x20f)});}const _0x38a4cf=await _0x1a2fa6({..._0x21fc22,'action':_0x4b8caf,'prefer':_0x22e01d});return _0x21fc22[_0x26d468(0x1f4)]||_0x253e14(_0x26d468(0x1bd)+_0x38a4cf[_0x26d468(0x262)]+'\x20on\x20'+_0x38a4cf[_0x26d468(0x179)]+_0x26d468(0x232)),_0x38a4cf;}function _0x5aee(_0x579e19,_0x4864f7){_0x579e19=_0x579e19-0x171;const _0x5aeef3=_0x4864();let _0x548a82=_0x5aeef3[_0x579e19];return _0x548a82;}function _0x4864(){const _0x4ec2e7=['paymentChain','/jobs?','none','detail',',\x20not\x20','continue\x20<id>\x20[objective]','blocked','publish','chainName','exclude\x20oracle\x20panel\x20jobs','padEnd','payment_failed','delivery','\x20\x20\x20\x20hash:\x20','--action\x20<action>','updated:\x20\x20\x20','\x20head=','github','replace','attempt','save','type','\x20verdict=','job\x20template','home','quote','<none>','task','complete\x20continuation\x20body\x20JSON\x20file','transactionHash','before','interval','input','base\x20commit\x20for\x20--repo','submissionHash','\x20belongs\x20to\x20parent\x20job\x20','code','expiresAt','job:\x20\x20\x20\x20\x20\x20\x20','\x20job(s)','trim','\x20version(s))','Network\x20error','state','orderId','--before\x20<time>','order\x20','optsWithGlobals','delayMs','source','check:\x20\x20\x20\x20\x20','reuse\x20a\x20saved\x20order\x20request\x20key','/jobs/','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file','rpc','statusUrl','explorerUrl','plan','url','retry','--answer\x20<text>','yes','saved','reviews','\x20blocker(s)','elapsedMs','complete:\x20\x20','--file\x20<path>','includes','push','blockers','wait:\x20','file','template:\x20\x20','Payment\x20needs\x20review.','exitCode','Paying\x20with\x20','nodes','poll\x20interval\x20in\x20seconds','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','delivery:\x20\x20','pendingTransaction','--request-key\x20<uuid>','job\x20response\x20is\x20missing\x20id','tx:\x20\x20\x20\x20\x20\x20\x20\x20','retries','set','kind','data','string','poll','\x0aquestions:\x0a','refusalProblems','result\x20<id>','\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a','answer\x20a\x20business\x20clarification\x20(repeatable)','--dry-run','verdict','--interval\x20<seconds>','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','short','admitted','statusUrl:\x20','map','files:\x20\x20\x20\x20\x20','state:\x20\x20\x20\x20\x20','stdin','--skill\x20<id>','refused','createdAt','launch','workflow','path','isArray','page\x20size\x20(1-500)','job.open','colony\x20--api\x20','action','\x20(poll\x20','objective','requiredOption','\x20has\x20no\x20saved\x20input','key','browse\x20and\x20publish\x20IMD\x20tasks','--out\x20<dir>','paymentStatus','length','challenge','source:\x20\x20\x20\x20','download\x20<id>','json','completed','named\x20input\x20preset\x20(report)','canCancel','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','check','message','\x20complete=','transaction:\x20','mediaType','requestKey','/result','parentJobId','show\x20one\x20job','\x20versions=','--template\x20<name>','publish\x20the\x20result\x20to\x20GitHub','interrupted','versions','\x20\x20-\x20','/jobs','resultUrl','request\x20key\x20','s\x20(retry\x20','wait:\x20interrupted\x0a','--limit\x20<n>','join','IMD','\x20bytes)','list','runnable\x20skill\x20id','launch:\x20\x20\x20\x20','project\x20ready','result','isTTY','oracle','--save\x20<path>','deliverables','\x20belongs\x20to\x20','\x20->\x20','\x20tx\x20','prepared\x20input:','parent:\x20\x20\x20\x20','dryRun','commit','stringify','limit','job.continue','create\x20[objective]','exclude','asset','result\x20response\x20is\x20missing\x20jobId','summary','continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for','HTTP\x20','complete\x20job\x20body\x20JSON\x20file','slice','toFixed','paidBy','payment:\x20','list\x20jobs','saved\x20input:\x20','\x20(enough\x20balance\x20found).\x0a','command','\x20--home\x20','show\x20<id>','objective:\x20','jobs\x20response\x20is\x20missing\x20jobs','--repo\x20<url>','outcome','files','repo','template','complete','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','reason','since','bytes','order:\x20\x20\x20\x20\x20',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','option','keyEnv','title','ethereum','plan:\x20','status','project','timeout','unknown','answer','api','unknown\x20request\x20key:\x20',';\x20rerun\x20with\x20--api\x20','--timeout\x20<seconds>','\x20--refresh','job\x20body\x20JSON\x20file','description','--preset\x20<name>','input:','order\x20ended\x20with\x20status:\x20','action:\x20\x20\x20\x20','preset','hash','public\x20GitHub\x20repository\x20URL','excludeOracle','skill','project:\x20\x20\x20','nodes:\x20\x20\x20\x20\x20','--path\x20<path>','jobs','payWith','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','payTo','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','questions','\x20attempt=','created:\x20\x20\x20','updatedAt','--github','payment_reconciling','transaction','save\x20the\x20input\x20JSON\x20without\x20overwriting','out','toString','jobId','--commit\x20<sha>','parent','head'];_0x4864=function(){return _0x4ec2e7;};return _0x4864();}function ee(_0x4439e9){const _0x54318b=_0x5aee,_0x42b841=new URLSearchParams();if(_0x4439e9['q']!==void 0x0&&_0x42b841['set']('q',_0x4439e9['q']),_0x4439e9['before']!==void 0x0&&_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x18f),_0x4439e9[_0x54318b(0x18f)]),_0x4439e9[_0x54318b(0x240)]!==void 0x0&&_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x240),_0x4439e9['since']),_0x4439e9[_0x54318b(0x222)]!==void 0x0){const _0x1d2df3=Number(_0x4439e9['limit']);if(!Number['isInteger'](_0x1d2df3)||_0x1d2df3<0x1||_0x1d2df3>0x1f4)throw new Error(_0x54318b(0x1d5));_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x222),String(_0x1d2df3));}_0x4439e9[_0x54318b(0x25c)]&&_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x225),_0x54318b(0x217));const _0x164e13=_0x42b841[_0x54318b(0x26f)]();return _0x164e13?_0x54318b(0x172)+_0x164e13:_0x54318b(0x208);}function b(_0x76b1ba,_0x28df34=0x5a){const _0x5737c2=_0x5aee,_0x818f2a=String(_0x76b1ba??'')[_0x5737c2(0x183)](/\s+/g,'\x20')[_0x5737c2(0x199)]();return _0x818f2a[_0x5737c2(0x1f0)]>_0x28df34?_0x818f2a[_0x5737c2(0x22c)](0x0,_0x28df34-0x1)+'…':_0x818f2a;}function te(_0x3a13c4){const _0x3af718=_0x5aee;if(!Array[_0x3af718(0x1e3)](_0x3a13c4?.[_0x3af718(0x261)]))throw new Error(_0x3af718(0x237));const _0x2b9585=[_0x3a13c4['count']+_0x3af718(0x198)];for(const _0x6cf962 of _0x3a13c4[_0x3af718(0x261)])_0x2b9585[_0x3af718(0x1b6)](_0x6cf962['id']+'\x20\x20'+_0x6cf962[_0x3af718(0x19c)][_0x3af718(0x17b)](0xa)+'\x20\x20'+String(_0x6cf962['template']??'')[_0x3af718(0x17b)](0x16)+'\x20\x20'+(_0x6cf962[_0x3af718(0x269)]??'')+'\x20\x20'+b(_0x6cf962[_0x3af718(0x1e9)]));return _0x2b9585[_0x3af718(0x20e)]('\x0a');}function ne(_0x4f13ff){const _0x1d42b5=_0x5aee;if(!_0x4f13ff?.['id'])throw new Error(_0x1d42b5(0x1c5));const _0x3d8391=[_0x1d42b5(0x197)+_0x4f13ff['id'],'state:\x20\x20\x20\x20\x20'+_0x4f13ff['state'],_0x1d42b5(0x1ba)+(_0x4f13ff[_0x1d42b5(0x23c)]??''),_0x1d42b5(0x236)+b(_0x4f13ff[_0x1d42b5(0x1e9)],0x1f4),_0x1d42b5(0x268)+(_0x4f13ff[_0x1d42b5(0x1df)]??''),_0x1d42b5(0x180)+(_0x4f13ff['updatedAt']??''),'paid\x20by:\x20\x20\x20'+(_0x4f13ff[_0x1d42b5(0x22e)]??''),'project:\x20\x20\x20'+(_0x4f13ff[_0x1d42b5(0x24a)]?_0x4f13ff[_0x1d42b5(0x24a)]['id']+'\x20('+(_0x4f13ff[_0x1d42b5(0x24a)][_0x1d42b5(0x206)]?.['length']??0x0)+_0x1d42b5(0x19a):_0x1d42b5(0x173)),_0x1d42b5(0x1c2)+(_0x4f13ff['delivery']?JSON[_0x1d42b5(0x221)](_0x4f13ff[_0x1d42b5(0x17d)]):_0x1d42b5(0x173)),_0x1d42b5(0x213)+(_0x4f13ff[_0x1d42b5(0x1e0)]?JSON['stringify'](_0x4f13ff[_0x1d42b5(0x1e0)]):_0x1d42b5(0x173))];if(Array[_0x1d42b5(0x1e3)](_0x4f13ff[_0x1d42b5(0x1be)])){_0x3d8391[_0x1d42b5(0x1b6)](_0x1d42b5(0x25f)+_0x4f13ff[_0x1d42b5(0x1be)]['length']);for(const _0x105038 of _0x4f13ff[_0x1d42b5(0x1be)])_0x3d8391[_0x1d42b5(0x1b6)]('\x20\x20-\x20'+_0x105038[_0x1d42b5(0x1ec)]+':\x20'+_0x105038[_0x1d42b5(0x19c)]+_0x1d42b5(0x267)+_0x105038[_0x1d42b5(0x184)]+_0x1d42b5(0x187)+(_0x105038[_0x1d42b5(0x1d3)]?.[_0x1d42b5(0x249)]??_0x1d42b5(0x173)));}return Array[_0x1d42b5(0x1e3)](_0x4f13ff[_0x1d42b5(0x1b0)])&&_0x3d8391[_0x1d42b5(0x1b6)]('reviews:\x20\x20\x20'+_0x4f13ff[_0x1d42b5(0x1b0)][_0x1d42b5(0x1f0)]),_0x4f13ff[_0x1d42b5(0x1e1)]?.['id']&&_0x3d8391[_0x1d42b5(0x1b6)](('workflow:\x20\x20'+_0x4f13ff[_0x1d42b5(0x1e1)]['id']+'\x20'+(_0x4f13ff[_0x1d42b5(0x1e1)]['status']??''))[_0x1d42b5(0x199)]()),_0x3d8391['join']('\x0a');}function S(_0x6a9b30){const _0x37af4a=_0x5aee;if(!_0x6a9b30?.[_0x37af4a(0x270)])throw new Error(_0x37af4a(0x227));const _0x169312=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x6a9b30[_0x37af4a(0x270)],_0x37af4a(0x1db)+_0x6a9b30['state'],_0x37af4a(0x1b3)+_0x6a9b30['complete']],_0x8bd074=Array['isArray'](_0x6a9b30[_0x37af4a(0x23a)])?_0x6a9b30[_0x37af4a(0x23a)]:[];_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x1da)+_0x8bd074[_0x37af4a(0x1f0)]);for(const _0x5e5521 of _0x8bd074)_0x169312[_0x37af4a(0x1b6)]('\x20\x20-\x20'+_0x5e5521['path']+'\x20('+_0x5e5521[_0x37af4a(0x241)]+'\x20bytes,\x20'+_0x5e5521[_0x37af4a(0x1fd)]+')'),_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x17e)+_0x5e5521['hash']),_0x169312[_0x37af4a(0x1b6)]('\x20\x20\x20\x20url:\x20\x20'+_0x5e5521[_0x37af4a(0x1ab)]);const _0xf01a86=Array[_0x37af4a(0x1e3)](_0x6a9b30['source'])?_0x6a9b30[_0x37af4a(0x1a2)]:[];_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x1f2)+_0xf01a86['length']);for(const _0x53b436 of _0xf01a86)_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x207)+(_0x53b436['node']??_0x53b436[_0x37af4a(0x193)])+':\x20'+_0x53b436[_0x37af4a(0x1ab)]);return _0x6a9b30[_0x37af4a(0x17d)]&&_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x1c2)+JSON[_0x37af4a(0x221)](_0x6a9b30[_0x37af4a(0x17d)])),_0x6a9b30['launch']&&_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x213)+JSON[_0x37af4a(0x221)](_0x6a9b30[_0x37af4a(0x1e0)])),_0x169312[_0x37af4a(0x20e)]('\x0a');}function oe(_0xcf6f58){const _0x3495fb=_0x5aee,_0x174584=[_0x3495fb(0x197)+_0xcf6f58[_0x3495fb(0x270)],'state:\x20\x20\x20\x20\x20'+_0xcf6f58[_0x3495fb(0x19c)],_0x3495fb(0x1da)+_0xcf6f58[_0x3495fb(0x23a)][_0x3495fb(0x1f0)]];for(const _0x806c4b of _0xcf6f58[_0x3495fb(0x23a)])_0x174584[_0x3495fb(0x1b6)](_0x3495fb(0x207)+_0x806c4b[_0x3495fb(0x1e2)]+_0x3495fb(0x21b)+_0x806c4b[_0x3495fb(0x1b9)]+'\x20('+_0x806c4b[_0x3495fb(0x241)]+_0x3495fb(0x210)),_0x174584[_0x3495fb(0x1b6)](_0x3495fb(0x17e)+_0x806c4b[_0x3495fb(0x25a)]);return _0x174584['join']('\x0a');}function I(_0x4a292a){const _0x3f4cd6=_0x5aee,_0x1c00c5=['blockers:\x20'+_0x4a292a[_0x3f4cd6(0x1b7)]['length']];for(const _0x9eab4d of _0x4a292a[_0x3f4cd6(0x1b7)])_0x1c00c5[_0x3f4cd6(0x1b6)]('\x20\x20-\x20'+_0x9eab4d[_0x3f4cd6(0x195)]+':\x20'+_0x9eab4d['detail']);const _0x4cc5c5=Array['isArray'](_0x4a292a[_0x3f4cd6(0x1aa)])?_0x4a292a[_0x3f4cd6(0x1aa)]:[];_0x1c00c5['push'](_0x3f4cd6(0x248)+_0x4cc5c5[_0x3f4cd6(0x1f0)]);for(const _0x2b93ba of _0x4cc5c5)_0x1c00c5['push']('\x20\x20-\x20'+(_0x2b93ba[_0x3f4cd6(0x246)]??_0x2b93ba[_0x3f4cd6(0x1d6)]??_0x2b93ba[_0x3f4cd6(0x25d)])+(_0x2b93ba[_0x3f4cd6(0x25d)]?'\x20('+_0x2b93ba[_0x3f4cd6(0x25d)]+')':''));return _0x1c00c5[_0x3f4cd6(0x20e)]('\x0a');}function T(_0x3c9d23){const _0x51d6eb=_0x5aee,_0x3de66a=_0x3c9d23[_0x51d6eb(0x18a)]?_0x4e5577(_0x3c9d23):null;return{'status':_0x3c9d23[_0x51d6eb(0x249)],'action':_0x3c9d23[_0x51d6eb(0x1e7)],'requestKey':_0x3c9d23['requestKey'],'orderId':_0x3c9d23['orderId'],'jobId':_0x3c9d23['jobId']??null,'statusUrl':_0x3c9d23[_0x51d6eb(0x1a8)]??null,'resultUrl':_0x3c9d23[_0x51d6eb(0x209)]??null,'transactionHash':_0x3c9d23['transactionHash']??null,'problems':_0x3c9d23[_0x51d6eb(0x1ce)]??null,'parentJobId':_0x3c9d23[_0x51d6eb(0x191)]?.['parentJobId']??null,'parent':_0x3c9d23['parent']??null,'project':_0x3c9d23[_0x51d6eb(0x1f9)]?.['project']??null,'payer':_0x3c9d23['payer']??null,'paymentChain':_0x3c9d23[_0x51d6eb(0x171)]??'ethereum','payWith':_0x3c9d23[_0x51d6eb(0x262)]??_0x51d6eb(0x20f),'prepared':_0x3c9d23[_0x51d6eb(0x1f1)]?.['input']??null,'quote':_0x3c9d23[_0x51d6eb(0x18a)]?{'amount':_0x3de66a['amount'],'asset':_0x3de66a[_0x51d6eb(0x226)],'payTo':_0x3de66a[_0x51d6eb(0x264)],'expiresAt':_0x3c9d23['quote'][_0x51d6eb(0x196)]}:null};}function ie(_0x3e6c3a){const _0x35ff0a=_0x5aee,_0x2e4549=['status:\x20\x20\x20\x20'+_0x3e6c3a[_0x35ff0a(0x249)],_0x35ff0a(0x258)+_0x3e6c3a['action'],_0x35ff0a(0x242)+_0x3e6c3a[_0x35ff0a(0x19d)],_0x35ff0a(0x197)+(_0x3e6c3a['jobId']??'')];if(_0x3e6c3a[_0x35ff0a(0x1a8)]&&_0x2e4549['push'](_0x35ff0a(0x1d8)+_0x3e6c3a[_0x35ff0a(0x1a8)]),_0x3e6c3a[_0x35ff0a(0x209)]&&_0x2e4549[_0x35ff0a(0x1b6)]('resultUrl:\x20'+_0x3e6c3a['resultUrl']),_0x3e6c3a[_0x35ff0a(0x18e)]&&_0x2e4549['push'](_0x35ff0a(0x1c6)+_0x3e6c3a['transactionHash']),_0x3e6c3a[_0x35ff0a(0x272)]&&(_0x2e4549[_0x35ff0a(0x1b6)](_0x35ff0a(0x21e)+_0x3e6c3a[_0x35ff0a(0x272)]['id']+'\x20('+(_0x3e6c3a[_0x35ff0a(0x272)][_0x35ff0a(0x19c)]??'unknown')+')'),_0x3e6c3a[_0x35ff0a(0x272)][_0x35ff0a(0x24a)]&&_0x2e4549['push'](_0x35ff0a(0x25e)+_0x3e6c3a[_0x35ff0a(0x272)]['project']['id']+_0x35ff0a(0x181)+(_0x3e6c3a[_0x35ff0a(0x272)][_0x35ff0a(0x24a)]['head']??''))),_0x3e6c3a[_0x35ff0a(0x1f9)]?.[_0x35ff0a(0x24a)]){const _0xe19e7=_0x3e6c3a[_0x35ff0a(0x1f9)][_0x35ff0a(0x24a)];_0x2e4549[_0x35ff0a(0x1b6)](_0x35ff0a(0x1a3)+(_0xe19e7['summary']??_0xe19e7['id']??_0x35ff0a(0x214)));}return!_0x3e6c3a[_0x35ff0a(0x1aa)]&&_0x3e6c3a[_0x35ff0a(0x1e7)]===_0x35ff0a(0x223)&&_0x3e6c3a[_0x35ff0a(0x1f1)]?.[_0x35ff0a(0x191)]&&(_0x2e4549[_0x35ff0a(0x1b6)](_0x35ff0a(0x21d)),_0x2e4549[_0x35ff0a(0x1b6)](JSON[_0x35ff0a(0x221)](_0x3e6c3a[_0x35ff0a(0x1f1)]['input'],null,0x2))),_0x2e4549['join']('\x0a');}function A(_0xffe040,_0xdd1a7b){const _0x1fd6ea=_0x5aee;if(_0xffe040[_0x1fd6ea(0x249)]===_0x1fd6ea(0x177)){_0xdd1a7b['json']?_0x40216c({'status':'blocked','action':_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x1e7)],'requestKey':_0xffe040[_0x1fd6ea(0x19c)]['requestKey'],'parent':_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x272)]??null,'check':_0xffe040[_0x1fd6ea(0x1f9)]},_0xdd1a7b):(_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x272)]&&_0x253e14(K(_0xffe040[_0x1fd6ea(0x19c)]['parent'])+'\x0a'),_0x253e14(I(_0xffe040['check'])+_0x1fd6ea(0x1d0))),process[_0x1fd6ea(0x1bc)]=0x1;return;}if(_0xffe040[_0x1fd6ea(0x249)]==='refused'){const _0xec4e79=T(_0xffe040['state']);if(_0xdd1a7b[_0x1fd6ea(0x1f4)])_0x40216c({..._0xec4e79,'status':_0x1fd6ea(0x1de)},_0xdd1a7b);else{const _0x2cbd1e=[_0x1fd6ea(0x19f)+_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x19d)]+_0x1fd6ea(0x1f8),_0x1fd6ea(0x22f)+(_0xffe040['state'][_0x1fd6ea(0x1ef)]??_0x1fd6ea(0x24c))+(_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x18e)]?_0x1fd6ea(0x21c)+_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x18e)]:'')];for(const _0x5f5b9d of _0xffe040[_0x1fd6ea(0x19c)]['refusalProblems']??[])_0x2cbd1e[_0x1fd6ea(0x1b6)]('\x20\x20-\x20'+(_0x5f5b9d[_0x1fd6ea(0x195)]??_0x1fd6ea(0x1de))+':\x20'+(_0x5f5b9d[_0x1fd6ea(0x174)]??JSON[_0x1fd6ea(0x221)](_0x5f5b9d)));_0x2cbd1e[_0x1fd6ea(0x1b6)]('inspect:\x20colony\x20order\x20show\x20'+_0xffe040[_0x1fd6ea(0x19c)]['orderId']+_0x1fd6ea(0x252)),_0x253e14(_0x2cbd1e['join']('\x0a')+'\x0a');}process['exitCode']=0x1;return;}if(['expired',_0x1fd6ea(0x17c),'transaction_pending',_0x1fd6ea(0x26b)][_0x1fd6ea(0x1b5)](_0xffe040[_0x1fd6ea(0x249)])){const _0x654ff8=_0xffe040[_0x1fd6ea(0x19c)];if(_0xdd1a7b[_0x1fd6ea(0x1f4)])_0x40216c({...T(_0x654ff8),'status':_0xffe040[_0x1fd6ea(0x249)]},_0xdd1a7b);else{const _0x3a749e=_0x654ff8[_0x1fd6ea(0x1c3)]??_0x654ff8[_0x1fd6ea(0x26c)],_0x24cc26=[_0x1fd6ea(0x1bb),'Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.'];_0x3a749e?.[_0x1fd6ea(0x25a)]&&_0x24cc26[_0x1fd6ea(0x1b6)](_0x1fd6ea(0x1fc)+_0x3a749e['hash']+(_0x3a749e['kind']?'\x20('+_0x3a749e[_0x1fd6ea(0x1c9)]+')':'')),_0x3a749e?.[_0x1fd6ea(0x23f)]&&_0x24cc26[_0x1fd6ea(0x1b6)]('reason:\x20\x20\x20\x20\x20\x20'+_0x3a749e[_0x1fd6ea(0x23f)]),_0x3a749e?.[_0x1fd6ea(0x1a9)]&&_0x24cc26[_0x1fd6ea(0x1b6)]('explorer:\x20\x20\x20\x20'+_0x3a749e[_0x1fd6ea(0x1a9)]),_0x654ff8[_0x1fd6ea(0x18e)]&&_0x654ff8[_0x1fd6ea(0x18e)]!==_0x3a749e?.[_0x1fd6ea(0x25a)]&&_0x24cc26['push'](_0x1fd6ea(0x1fc)+_0x654ff8['transactionHash']),_0x654ff8[_0x1fd6ea(0x19d)]&&_0x24cc26[_0x1fd6ea(0x1b6)]('continue:\x20\x20\x20\x20colony\x20order\x20submit\x20'+_0x654ff8['orderId']),_0x253e14(_0x24cc26['join']('\x0a')+'\x0a');}process['exitCode']=0x1;return;}if(_0xffe040['status']!==_0x1fd6ea(0x1d7))throw new Error(_0x1fd6ea(0x257)+_0xffe040[_0x1fd6ea(0x249)]+_0x1fd6ea(0x243)+_0xffe040[_0x1fd6ea(0x19c)]['orderId']+_0x1fd6ea(0x252));_0x40216c(_0xdd1a7b[_0x1fd6ea(0x1f4)]?T(_0xffe040[_0x1fd6ea(0x19c)]):ie(_0xffe040[_0x1fd6ea(0x19c)]),_0xdd1a7b);}function K(_0x349076){const _0x2147b8=_0x5aee,_0x3bf134=_0x3bbc3b(_0x349076),_0x2e1db8=[_0x2147b8(0x21e)+_0x3bf134['id'],_0x2147b8(0x1db)+(_0x3bf134[_0x2147b8(0x19c)]??''),_0x2147b8(0x1ba)+(_0x3bf134[_0x2147b8(0x23c)]??''),_0x2147b8(0x236)+b(_0x3bf134[_0x2147b8(0x1e9)],0x1f4),'paid\x20by:\x20\x20\x20'+(_0x3bf134[_0x2147b8(0x22e)]??'')];return _0x3bf134[_0x2147b8(0x24a)]&&_0x2e1db8[_0x2147b8(0x1b6)](_0x2147b8(0x25e)+_0x3bf134['project']['id']+_0x2147b8(0x181)+(_0x3bf134[_0x2147b8(0x24a)][_0x2147b8(0x273)]??'')+_0x2147b8(0x202)+_0x3bf134['project'][_0x2147b8(0x206)]['length']),_0x2e1db8[_0x2147b8(0x20e)]('\x0a');}function re(_0x4f633d){const _0x55ca7c=_0x5aee;return _0x4f633d?_0x4f633d['summary']?_0x55ca7c(0x25e)+b(_0x4f633d['summary'],0x1f4):_0x4f633d['id']?_0x55ca7c(0x25e)+_0x4f633d['id']:null:null;}function J(_0x344026,_0x4077fb,_0x4c7138,_0x51cb0e){const _0x1a9130=_0x5aee,_0x3c548a=[];_0x51cb0e&&_0x3c548a[_0x1a9130(0x1b6)](K(_0x51cb0e)),_0x3c548a[_0x1a9130(0x1b6)](_0x1a9130(0x258)+_0x344026),_0x3c548a[_0x1a9130(0x1b6)](_0x1a9130(0x256)),_0x3c548a['push'](JSON[_0x1a9130(0x221)](_0x4077fb,null,0x2)),_0x3c548a[_0x1a9130(0x1b6)](I(_0x4c7138));const _0x4647e1=re(_0x4c7138[_0x1a9130(0x24a)]);return _0x4647e1&&_0x3c548a[_0x1a9130(0x1b6)](_0x4647e1),_0x3c548a[_0x1a9130(0x20e)]('\x0a');}function O(_0x1aaa4e){const _0x5187b9=_0x5aee;return _0x1aaa4e[_0x5187b9(0x1b9)]!==void 0x0||_0x1aaa4e[_0x5187b9(0x259)]!==void 0x0||_0x1aaa4e[_0x5187b9(0x25d)]!==void 0x0||_0x1aaa4e[_0x5187b9(0x23c)]!==void 0x0||Array[_0x5187b9(0x1e3)](_0x1aaa4e[_0x5187b9(0x1e2)])&&_0x1aaa4e[_0x5187b9(0x1e2)][_0x5187b9(0x1f0)]>0x0;}function N(_0xc6c2dc){const _0xc78133=_0x5aee;return _0xc6c2dc[_0xc78133(0x1b9)]!==void 0x0||_0xc6c2dc[_0xc78133(0x25d)]!==void 0x0||_0xc6c2dc['template']!==void 0x0||Array[_0xc78133(0x1e3)](_0xc6c2dc['path'])&&_0xc6c2dc[_0xc78133(0x1e2)]['length']>0x0;}function se(_0x23b9fd,_0x219a69){const _0x2c0014=_0x5aee;return typeof _0x23b9fd==_0x2c0014(0x1cb)&&_0x23b9fd[_0x2c0014(0x199)]()!==''&&!O(_0x219a69);}function ae(_0x57dfb8,_0xdcbd9e){const _0x2baf0b=_0x5aee;return typeof _0x57dfb8==_0x2baf0b(0x1cb)&&_0x57dfb8[_0x2baf0b(0x199)]()!==''&&!N(_0xdcbd9e);}function $(_0x232002){const _0x55fbb9=_0x5aee,_0x526b42=['summary:\x20'+_0x232002[_0x55fbb9(0x228)],'deliverables:'];_0x232002[_0x55fbb9(0x219)]['length']===0x0&&_0x526b42[_0x55fbb9(0x1b6)]('\x20\x20-\x20none');for(const _0x157825 of _0x232002[_0x55fbb9(0x219)])_0x526b42[_0x55fbb9(0x1b6)]('\x20\x20-\x20'+_0x157825);return _0x526b42[_0x55fbb9(0x20e)]('\x0a');}function U(_0x393614,_0x125a77){const _0x2fbbb6=_0x5aee,_0x15eac2=[$(_0x393614),'check:\x20'+_0x125a77[_0x2fbbb6(0x1b7)][_0x2fbbb6(0x1f0)]+_0x2fbbb6(0x1b1)];for(const _0x38fd39 of _0x125a77[_0x2fbbb6(0x1b7)])_0x15eac2[_0x2fbbb6(0x1b6)](_0x2fbbb6(0x207)+_0x38fd39['code']+':\x20'+_0x38fd39[_0x2fbbb6(0x174)]);return _0x15eac2['join']('\x0a');}function W(_0x27597f,_0x511e90,_0x5180f8){const _0xcf4b45=_0x5aee;if(_0x5180f8[_0xcf4b45(0x1f4)])_0x40216c({'action':_0x511e90,'summary':_0x27597f[_0xcf4b45(0x228)],'deliverables':_0x27597f[_0xcf4b45(0x219)],'questions':_0x27597f[_0xcf4b45(0x266)],'input':null},_0x5180f8);else{const _0x343e50=_0x27597f[_0xcf4b45(0x266)][_0xcf4b45(0x1d9)](_0x153de5=>_0xcf4b45(0x207)+_0x153de5)['join']('\x0a');_0x40216c($(_0x27597f)+_0xcf4b45(0x1cd)+_0x343e50,_0x5180f8);}process[_0xcf4b45(0x1bc)]=0x1;}function pe(_0x1b4bad){const _0x16ab31=_0x5aee;return _0x1b4bad[_0x16ab31(0x23b)]===void 0x0&&_0x1b4bad[_0x16ab31(0x220)]===void 0x0?null:{'repoUrl':_0x1b4bad[_0x16ab31(0x23b)],'baseCommit':_0x1b4bad[_0x16ab31(0x220)]};}async function P({api:_0x396cfc,home:_0x6ab66b,objective:_0x23e6d9,answers:_0xc02b90,parent:_0x3cd4e0=null,source:_0x3c9993=null,github:_0x33d3bb=!0x1,opts:_0x28c93f,loadPlanner:_0x25b3ad}){const _0x1f0521=_0x5aee;return _0x1ddb5f({'api':_0x396cfc,'home':_0x6ab66b,'loadPlanner':_0x25b3ad,'objective':_0x23e6d9,'answers':_0xc02b90,'parent':_0x3cd4e0,'source':_0x3c9993,'github':_0x33d3bb,'ask':!_0x28c93f[_0x1f0521(0x1f4)]&&process[_0x1f0521(0x1dc)][_0x1f0521(0x216)]?_0x5da7a4:null});}function R(_0x28d2d7,_0x50cb13,{api:_0x3c7f0d,action:_0x28c8c4}){const _0x1149d2=_0x5aee;if(!_0x28d2d7)throw new Error(_0x1149d2(0x24f)+_0x50cb13);if(_0x28d2d7[_0x1149d2(0x24e)]!==_0x3c7f0d)throw new Error(_0x1149d2(0x19f)+_0x28d2d7[_0x1149d2(0x1fe)]+_0x1149d2(0x21a)+_0x28d2d7['api']+_0x1149d2(0x250)+_0x28d2d7[_0x1149d2(0x24e)]);if(_0x28d2d7['action']!==_0x28c8c4)throw new Error(_0x1149d2(0x20a)+_0x28d2d7[_0x1149d2(0x1fe)]+'\x20was\x20created\x20for\x20action\x20'+_0x28d2d7[_0x1149d2(0x1e7)]+_0x1149d2(0x175)+_0x28c8c4);if(!_0x28d2d7[_0x1149d2(0x191)]||typeof _0x28d2d7[_0x1149d2(0x191)]!='object'||Array[_0x1149d2(0x1e3)](_0x28d2d7[_0x1149d2(0x191)]))throw new Error(_0x1149d2(0x20a)+_0x28d2d7[_0x1149d2(0x1fe)]+_0x1149d2(0x1eb));return _0x28d2d7['input'];}function ue(_0x25a842,_0x561660){const _0x465abe=_0x5aee;return _0x465abe(0x1e6)+_0x25a842[_0x465abe(0x24e)]+_0x465abe(0x234)+_0x561660[_0x465abe(0x189)]+'\x20task\x20create\x20--request-key\x20'+_0x25a842[_0x465abe(0x1fe)];}function le(_0xf583fd,_0x2271aa){const _0x2e12d0=_0x5aee;return _0x2e12d0(0x1e6)+_0xf583fd[_0x2e12d0(0x24e)]+_0x2e12d0(0x234)+_0x2271aa[_0x2e12d0(0x189)]+'\x20task\x20continue\x20'+_0xf583fd['input']['parentJobId']+'\x20--request-key\x20'+_0xf583fd[_0x2e12d0(0x1fe)];}function ge(_0x511387,{loadPlanner:_0x154f0a=_0x43d523}={}){const _0x561359=_0x5aee,_0x3c66da=_0x511387['command'](_0x561359(0x18c))[_0x561359(0x254)](_0x561359(0x1ed));_0x287884(_0x3c66da),_0x3c66da[_0x561359(0x233)](_0x561359(0x211))[_0x561359(0x254)](_0x561359(0x230))[_0x561359(0x244)]('--q\x20<text>','objective\x20or\x20job\x20id\x20prefix')[_0x561359(0x244)](_0x561359(0x19e),'creation-time\x20cursor\x20(exclusive)')['option']('--since\x20<time>','jobs\x20that\x20moved\x20after\x20this\x20time')[_0x561359(0x244)](_0x561359(0x20d),_0x561359(0x1e4))['option']('--exclude-oracle',_0x561359(0x17a))['action'](async(_0x585187,_0x4732d1)=>{const _0x12c648=_0x561359,_0x42c827=_0x4732d1[_0x12c648(0x1a0)](),_0x1817d2=await _0x6e1b30(_0x42c827['api'],ee(_0x42c827));_0x40216c(_0x42c827[_0x12c648(0x1f4)]?_0x1817d2['data']:te(_0x1817d2[_0x12c648(0x1ca)]),_0x42c827);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x235))['description'](_0x561359(0x201))[_0x561359(0x1e7)](async(_0x2e606f,_0x2d9166,_0x4890c7)=>{const _0x2a1fd2=_0x561359,_0x410f0b=_0x4890c7[_0x2a1fd2(0x1a0)](),_0x4248eb=await _0x6e1b30(_0x410f0b[_0x2a1fd2(0x24e)],_0x2a1fd2(0x1a5)+encodeURIComponent(_0x2e606f));_0x40216c(_0x410f0b[_0x2a1fd2(0x1f4)]?_0x4248eb[_0x2a1fd2(0x1ca)]:ne(_0x4248eb[_0x2a1fd2(0x1ca)]),_0x410f0b);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x1cf))[_0x561359(0x254)]('show\x20a\x20job\x20result\x20and\x20artifact\x20URLs')[_0x561359(0x1e7)](async(_0x3aa943,_0x243e4e,_0x2afdac)=>{const _0x8b8efc=_0x561359,_0x1452af=_0x2afdac[_0x8b8efc(0x1a0)](),_0x576925=await _0x6e1b30(_0x1452af[_0x8b8efc(0x24e)],_0x8b8efc(0x1a5)+encodeURIComponent(_0x3aa943)+_0x8b8efc(0x1ff));_0x40216c(_0x1452af[_0x8b8efc(0x1f4)]?_0x576925[_0x8b8efc(0x1ca)]:S(_0x576925[_0x8b8efc(0x1ca)]),_0x1452af);}),_0x3c66da[_0x561359(0x233)]('wait\x20<id>')[_0x561359(0x254)](_0x561359(0x1c0))[_0x561359(0x244)](_0x561359(0x1d4),_0x561359(0x1bf),String(_0x4e7f2d))[_0x561359(0x244)](_0x561359(0x251),'total\x20timeout\x20in\x20seconds',String(_0x2f6fa0))[_0x561359(0x1e7)](async(_0x123623,_0x50036b,_0x24f059)=>{const _0x44546d=_0x561359,_0x38b69d=_0x24f059['optsWithGlobals'](),_0x156b64=await _0x36a815({'api':_0x38b69d['api'],'id':_0x123623,'interval':_0x38b69d[_0x44546d(0x190)],'timeout':_0x38b69d[_0x44546d(0x24b)],'onProgress':_0x4aea78=>{const _0x309747=_0x44546d;_0x4aea78[_0x309747(0x186)]===_0x309747(0x1cc)?_0x253e14('wait:\x20'+_0x4aea78[_0x309747(0x19c)]+_0x309747(0x1fb)+_0x4aea78[_0x309747(0x23d)]+_0x309747(0x1e8)+_0x4aea78[_0x309747(0x184)]+',\x20'+(_0x4aea78[_0x309747(0x1b2)]/0x3e8)[_0x309747(0x22d)](0x1)+'s)\x0a'):_0x4aea78[_0x309747(0x186)]===_0x309747(0x1ac)&&_0x253e14('wait:\x20'+(_0x4aea78[_0x309747(0x249)]?_0x309747(0x22a)+_0x4aea78[_0x309747(0x249)]:_0x309747(0x19b))+';\x20retrying\x20in\x20'+(_0x4aea78[_0x309747(0x1a1)]/0x3e8)[_0x309747(0x22d)](0x1)+_0x309747(0x20b)+_0x4aea78[_0x309747(0x1c7)]+')\x0a');}});if(_0x156b64[_0x44546d(0x239)]===_0x44546d(0x205)){_0x253e14(_0x44546d(0x20c)),process['exitCode']=0x82;return;}_0x156b64[_0x44546d(0x215)]&&_0x40216c(_0x38b69d[_0x44546d(0x1f4)]?_0x156b64[_0x44546d(0x215)]:S(_0x156b64[_0x44546d(0x215)]),_0x38b69d),_0x156b64['outcome']!==_0x44546d(0x1f5)&&(_0x253e14(_0x44546d(0x1b8)+_0x156b64[_0x44546d(0x1fa)]+'\x0a'),process['exitCode']=0x1);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x1f3))['description'](_0x561359(0x265))[_0x561359(0x1ea)](_0x561359(0x1ee),'destination\x20directory')[_0x561359(0x1e7)](async(_0x3e45b4,_0x134ada,_0x8b85a0)=>{const _0x376b7d=_0x561359,_0x39680e=_0x8b85a0['optsWithGlobals'](),_0x100458=await _0x59c773({'api':_0x39680e[_0x376b7d(0x24e)],'id':_0x3e45b4,'out':_0x39680e[_0x376b7d(0x26e)],'onProgress':_0x1bd4cb=>{const _0x31ba0a=_0x376b7d;_0x1bd4cb[_0x31ba0a(0x186)]===_0x31ba0a(0x1af)&&_0x253e14('download:\x20'+_0x1bd4cb[_0x31ba0a(0x1e2)]+_0x31ba0a(0x21b)+_0x1bd4cb[_0x31ba0a(0x1b9)]+'\x0a');}});_0x40216c(_0x39680e[_0x376b7d(0x1f4)]?_0x100458:oe(_0x100458),_0x39680e);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x1f9))['description']('validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order')['requiredOption'](_0x561359(0x1b4),'job\x20body\x20JSON\x20file')['option'](_0x561359(0x17f),_0x561359(0x23e))['action'](async(_0x5a98ac,_0x35f706)=>{const _0xd24d48=_0x561359,_0x4455a2=_0x35f706[_0xd24d48(0x1a0)](),_0x309f15=await _0x41f5a5(_0x4455a2[_0xd24d48(0x1b9)]),_0x1292cd=_0x4455a2[_0xd24d48(0x1e7)]??_0x53f80f(_0x309f15),_0x1a601a=await _0x347c7b(_0x4455a2[_0xd24d48(0x24e)],_0x309f15,_0x1292cd);_0x40216c(_0x4455a2[_0xd24d48(0x1f4)]?_0x1a601a:I(_0x1a601a),_0x4455a2);}),_0x3c66da['command'](_0x561359(0x178))[_0x561359(0x254)](_0x561359(0x1a6))[_0x561359(0x1ea)](_0x561359(0x1b4),_0x561359(0x253))['option'](_0x561359(0x1c4),_0x561359(0x1a4))[_0x561359(0x1e7)](async(_0x486ab6,_0x278182)=>{const _0x57f371=_0x561359,_0x2f8741=_0x278182[_0x57f371(0x1a0)](),_0x42815b=await x(_0x2f8741,'job.open'),_0x5b699f=await _0x3706aa({'api':_0x2f8741[_0x57f371(0x24e)],'home':_0x2f8741[_0x57f371(0x189)],'file':_0x2f8741[_0x57f371(0x1b9)],'action':_0x57f371(0x1e5),'requestKey':_0x2f8741['requestKey'],'yes':_0x2f8741[_0x57f371(0x1ae)],'keyEnv':_0x2f8741[_0x57f371(0x245)],'rpc':_0x2f8741[_0x57f371(0x1a7)],'paymentChain':_0x2f8741[_0x57f371(0x171)]??_0x42815b?.[_0x57f371(0x171)],'payWith':_0x2f8741['payWith']??_0x42815b?.[_0x57f371(0x262)],'onProgress':_0x2aaf95(_0x2f8741)});A(_0x5b699f,_0x2f8741);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x224))['description']('create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file')[_0x561359(0x244)]('--file\x20<path>',_0x561359(0x22b))['option'](_0x561359(0x255),_0x561359(0x1f6))[_0x561359(0x244)](_0x561359(0x1dd),_0x561359(0x212))[_0x561359(0x244)]('--template\x20<name>','job\x20template')[_0x561359(0x244)](_0x561359(0x260),_0x561359(0x1c1),(_0x1f1c1a,_0x58f51f)=>[..._0x58f51f,_0x1f1c1a],[])[_0x561359(0x244)](_0x561359(0x238),_0x561359(0x25b))[_0x561359(0x244)](_0x561359(0x271),_0x561359(0x192))[_0x561359(0x244)](_0x561359(0x26a),_0x561359(0x204))[_0x561359(0x244)](_0x561359(0x1ad),_0x561359(0x1d1),(_0x2e439a,_0x18f6a5)=>[..._0x18f6a5,_0x2e439a],[])['option'](_0x561359(0x1d2),_0x561359(0x263))[_0x561359(0x244)](_0x561359(0x218),_0x561359(0x26d))[_0x561359(0x244)](_0x561359(0x1c4),_0x561359(0x1a4))[_0x561359(0x1e7)](async(_0x205a24,_0x2028f7,_0x3ac265)=>{const _0x48146a=_0x561359,_0x279a24=_0x3ac265[_0x48146a(0x1a0)](),_0x47fced=_0x279a24['dryRun']?null:await x(_0x279a24,_0x48146a(0x1e5)),_0x5fae7a=se(_0x205a24,_0x279a24);let _0x96574f,_0x32ddaf=null;if(_0x279a24[_0x48146a(0x1fe)]&&!O(_0x279a24)&&(_0x205a24===void 0x0||_0x5fae7a)){const _0x2bdf89=await _0x96fca9(_0x279a24['home'],_0x279a24[_0x48146a(0x1fe)]);if(_0x96574f=R(_0x2bdf89,_0x279a24[_0x48146a(0x1fe)],{'api':_0x279a24[_0x48146a(0x24e)],'action':_0x48146a(0x1e5)}),_0x205a24!==void 0x0&&_0x205a24!==_0x96574f[_0x48146a(0x1e9)])throw new Error(_0x48146a(0x20a)+_0x279a24['requestKey']+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');}else{if(_0x5fae7a){if(_0x32ddaf=await P({'api':_0x279a24[_0x48146a(0x24e)],'home':_0x279a24['home'],'objective':_0x205a24,'answers':_0x279a24[_0x48146a(0x24d)],'source':pe(_0x279a24),'github':_0x279a24[_0x48146a(0x182)]===!0x0,'opts':_0x279a24,'loadPlanner':_0x154f0a}),_0x32ddaf[_0x48146a(0x191)]===null){W(_0x32ddaf,_0x48146a(0x1e5),_0x279a24);return;}_0x96574f=_0x32ddaf[_0x48146a(0x191)];}else{const _0x1120b3=_0x279a24[_0x48146a(0x1b9)]?await _0x41f5a5(_0x279a24[_0x48146a(0x1b9)]):void 0x0;_0x96574f=await _0x5d1a0d({'fileInput':_0x1120b3,'objective':_0x205a24,'preset':_0x279a24[_0x48146a(0x259)],'skill':_0x279a24[_0x48146a(0x25d)],'template':_0x279a24['template'],'paths':_0x279a24[_0x48146a(0x1e2)],'repo':_0x279a24[_0x48146a(0x23b)],'commit':_0x279a24[_0x48146a(0x220)],'github':_0x279a24[_0x48146a(0x182)]});}}if(_0x279a24[_0x48146a(0x185)]&&(await _0x2e7447(_0x279a24[_0x48146a(0x185)],_0x96574f),_0x279a24[_0x48146a(0x1f4)]||_0x253e14('saved\x20input:\x20'+_0x279a24['save']+'\x0a')),_0x279a24[_0x48146a(0x21f)]){const _0x372af5=await _0x347c7b(_0x279a24['api'],_0x96574f,_0x48146a(0x1e5));_0x279a24[_0x48146a(0x1f4)]?_0x40216c({'action':_0x48146a(0x1e5),..._0x32ddaf?{'summary':_0x32ddaf[_0x48146a(0x228)],'deliverables':_0x32ddaf['deliverables']}:{},'input':_0x96574f,'check':_0x372af5},_0x279a24):_0x40216c(_0x32ddaf?U(_0x32ddaf,_0x372af5):J(_0x48146a(0x1e5),_0x96574f,_0x372af5),_0x279a24),_0x372af5[_0x48146a(0x1b7)]['length']>0x0&&(process[_0x48146a(0x1bc)]=0x1);return;}_0x32ddaf&&!_0x279a24[_0x48146a(0x1f4)]&&_0x253e14($(_0x32ddaf)+'\x0a');const _0x10489b=await _0x3706aa({'api':_0x279a24[_0x48146a(0x24e)],'home':_0x279a24[_0x48146a(0x189)],'input':_0x96574f,'action':_0x48146a(0x1e5),'requestKey':_0x279a24[_0x48146a(0x1fe)],'plan':_0x32ddaf?{'summary':_0x32ddaf['summary'],'deliverables':_0x32ddaf['deliverables']}:void 0x0,'yes':_0x279a24['yes'],'keyEnv':_0x279a24[_0x48146a(0x245)],'rpc':_0x279a24[_0x48146a(0x1a7)],'paymentChain':_0x279a24[_0x48146a(0x171)]??_0x47fced?.[_0x48146a(0x171)],'payWith':_0x279a24['payWith']??_0x47fced?.[_0x48146a(0x262)],'onProgress':_0x2aaf95(_0x279a24),'retryCommand':_0x40a75c=>ue(_0x40a75c,_0x279a24)});A(_0x10489b,_0x279a24);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x176))['description'](_0x561359(0x229))[_0x561359(0x244)]('--file\x20<path>',_0x561359(0x18d))[_0x561359(0x244)]('--skill\x20<id>','runnable\x20skill\x20id')[_0x561359(0x244)](_0x561359(0x203),_0x561359(0x188))[_0x561359(0x244)](_0x561359(0x260),_0x561359(0x1c1),(_0x17d858,_0x2ef27d)=>[..._0x2ef27d,_0x17d858],[])[_0x561359(0x244)](_0x561359(0x1ad),_0x561359(0x1d1),(_0x3517f2,_0x58f436)=>[..._0x58f436,_0x3517f2],[])[_0x561359(0x244)](_0x561359(0x1d2),'only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input')[_0x561359(0x244)](_0x561359(0x218),_0x561359(0x26d))[_0x561359(0x244)]('--request-key\x20<uuid>',_0x561359(0x1a4))['action'](async(_0x308516,_0x4da877,_0x3cd0f5,_0x5dc8eb)=>{const _0x215cdd=_0x561359,_0x120030=_0x5dc8eb[_0x215cdd(0x1a0)](),_0x1a34e1=_0x120030['dryRun']?null:await x(_0x120030,_0x215cdd(0x223)),_0x526d11=ae(_0x4da877,_0x120030);let _0x33c19a,_0x364b12,_0x4eb4df=null;if(_0x120030[_0x215cdd(0x1fe)]&&!N(_0x120030)&&(_0x4da877===void 0x0||_0x526d11)){const _0x51fd92=await _0x96fca9(_0x120030[_0x215cdd(0x189)],_0x120030[_0x215cdd(0x1fe)]);if(_0x33c19a=R(_0x51fd92,_0x120030[_0x215cdd(0x1fe)],{'api':_0x120030[_0x215cdd(0x24e)],'action':'job.continue'}),_0x33c19a[_0x215cdd(0x200)]!==_0x308516)throw new Error(_0x215cdd(0x20a)+_0x120030[_0x215cdd(0x1fe)]+_0x215cdd(0x194)+(_0x33c19a[_0x215cdd(0x200)]??_0x215cdd(0x18b))+_0x215cdd(0x175)+_0x308516);if(_0x4da877!==void 0x0&&_0x4da877!==_0x33c19a[_0x215cdd(0x1e9)])throw new Error(_0x215cdd(0x20a)+_0x120030[_0x215cdd(0x1fe)]+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x364b12=(await _0x6e1b30(_0x120030[_0x215cdd(0x24e)],_0x215cdd(0x1a5)+encodeURIComponent(_0x308516)))[_0x215cdd(0x1ca)];}else{if(_0x526d11){if(_0x364b12=(await _0x6e1b30(_0x120030[_0x215cdd(0x24e)],_0x215cdd(0x1a5)+encodeURIComponent(_0x308516)))[_0x215cdd(0x1ca)],_0x4eb4df=await P({'api':_0x120030[_0x215cdd(0x24e)],'home':_0x120030[_0x215cdd(0x189)],'objective':_0x4da877,'answers':_0x120030[_0x215cdd(0x24d)],'parent':_0x364b12,'opts':_0x120030,'loadPlanner':_0x154f0a}),_0x4eb4df[_0x215cdd(0x191)]===null){W(_0x4eb4df,'job.continue',_0x120030);return;}_0x33c19a=_0x4eb4df[_0x215cdd(0x191)],_0x33c19a['parentJobId']!==_0x308516&&(_0x33c19a={..._0x33c19a,'parentJobId':_0x308516});}else{const _0x4a9f6b=_0x120030[_0x215cdd(0x1b9)]?await _0x41f5a5(_0x120030['file']):void 0x0;_0x33c19a=await _0x274855({'id':_0x308516,'fileInput':_0x4a9f6b,'objective':_0x4da877,'skill':_0x120030[_0x215cdd(0x25d)],'template':_0x120030[_0x215cdd(0x23c)],'paths':_0x120030['path']}),_0x364b12=(await _0x6e1b30(_0x120030['api'],_0x215cdd(0x1a5)+encodeURIComponent(_0x308516)))['data'];}}if(_0x120030[_0x215cdd(0x185)]&&(await _0x2e7447(_0x120030[_0x215cdd(0x185)],_0x33c19a),_0x120030[_0x215cdd(0x1f4)]||_0x253e14(_0x215cdd(0x231)+_0x120030[_0x215cdd(0x185)]+'\x0a')),_0x120030[_0x215cdd(0x21f)]){const _0xd1bcde=await _0x347c7b(_0x120030[_0x215cdd(0x24e)],_0x33c19a,_0x215cdd(0x223));_0x120030[_0x215cdd(0x1f4)]?_0x40216c({'action':'job.continue',..._0x4eb4df?{'summary':_0x4eb4df[_0x215cdd(0x228)],'deliverables':_0x4eb4df[_0x215cdd(0x219)]}:{},'parent':_0x3bbc3b(_0x364b12),'input':_0x33c19a,'check':_0xd1bcde},_0x120030):_0x40216c(_0x4eb4df?U(_0x4eb4df,_0xd1bcde):J(_0x215cdd(0x223),_0x33c19a,_0xd1bcde,_0x364b12),_0x120030),_0xd1bcde[_0x215cdd(0x1b7)]['length']>0x0&&(process['exitCode']=0x1);return;}_0x4eb4df&&!_0x120030[_0x215cdd(0x1f4)]&&_0x253e14($(_0x4eb4df)+'\x0a');const _0x2ff870=await _0x3706aa({'api':_0x120030[_0x215cdd(0x24e)],'home':_0x120030[_0x215cdd(0x189)],'input':_0x33c19a,'action':_0x215cdd(0x223),'requestKey':_0x120030[_0x215cdd(0x1fe)],'plan':_0x4eb4df?{'summary':_0x4eb4df['summary'],'deliverables':_0x4eb4df[_0x215cdd(0x219)]}:void 0x0,'yes':_0x120030[_0x215cdd(0x1ae)],'keyEnv':_0x120030[_0x215cdd(0x245)],'rpc':_0x120030['rpc'],'paymentChain':_0x120030[_0x215cdd(0x171)]??_0x1a34e1?.[_0x215cdd(0x171)],'payWith':_0x120030[_0x215cdd(0x262)]??_0x1a34e1?.[_0x215cdd(0x262)],'onProgress':_0x2aaf95(_0x120030),'retryCommand':_0x8b24e2=>le(_0x8b24e2,_0x120030)});_0x2ff870[_0x215cdd(0x19c)]&&(_0x2ff870[_0x215cdd(0x19c)]['parent']=_0x3bbc3b(_0x364b12)),A(_0x2ff870,_0x120030);});}export{ge as registerTaskCommands};
@@ -1 +1 @@
1
- const _0x2e2b80=_0x36ab;import{coinAmount as _0x2a0efc,friendlyAmount as _0x328495}from'./payment-coins.mjs';import{PAYMENT_NETWORKS as _0x105c4d,paymentNetwork as _0x4d136d}from'./payment-networks.mjs';const l=_0xb372a=>Object[_0x2e2b80(0x139)](new Error(v(_0xb372a)[_0x2e2b80(0x15a)]('\x0a')),{'code':'funding_required','funding':_0xb372a});function I(_0x52e08c,_0x57217d,_0x16d887,_0x3d6e51){const _0x22751a=_0x2e2b80,_0x49ed5e=_0x4d136d(_0x57217d)['chain'][_0x22751a(0x132)],_0x4edce7={'key':_0x57217d,'chainName':_0x49ed5e,'price':_0x3d6e51?.[_0x22751a(0x14b)],'nativeBalance':_0x3d6e51?.[_0x22751a(0x153)],'options':_0x3d6e51?[{..._0x3d6e51,'funded':!0x1,'shortages':_0x16d887}]:[],'shortages':_0x16d887};return l({'address':_0x52e08c,'network':_0x57217d,'chainName':_0x49ed5e,'shortages':_0x16d887,'networks':[_0x4edce7]});}function w(_0x34173e,_0xa34be5){return l({'address':_0x34173e,'networks':_0xa34be5});}function E(_0x4d30e8){const _0x2f9055=_0x2e2b80;return _0x4d30e8[_0x2f9055(0x142)]??[{'key':_0x4d30e8[_0x2f9055(0x131)],'chainName':_0x4d30e8[_0x2f9055(0x136)],'options':[],'shortages':_0x4d30e8[_0x2f9055(0x13c)]??[]}];}const c=_0x3e683f=>BigInt(_0x3e683f[_0x2e2b80(0x156)])-BigInt(_0x3e683f[_0x2e2b80(0x15b)]),f=_0x5cf106=>(_0x5cf106*0xbn+0x9n)/0xan,u=_0x525854=>(_0x525854[_0x2e2b80(0x152)]??[])['filter'](_0x353b4e=>!_0x353b4e[_0x2e2b80(0x168)]&&_0x353b4e[_0x2e2b80(0x15c)]!==void 0x0);function d(_0x380cc8){const _0x5a6d2b=_0x2e2b80,_0x2b35cf=u(_0x380cc8)[_0x5a6d2b(0x147)](_0x28cfa6=>BigInt(_0x28cfa6[_0x5a6d2b(0x16b)]));if(!_0x2b35cf[_0x5a6d2b(0x138)])return null;const _0x3490cc=_0x2b35cf['reduce']((_0x374987,_0xff59b1)=>_0x374987<_0xff59b1?_0x374987:_0xff59b1),_0x17865b=_0x2b35cf[_0x5a6d2b(0x162)]((_0x2b1b04,_0x32554d)=>_0x2b1b04>_0x32554d?_0x2b1b04:_0x32554d),_0x2c4031=_0x328495(_0x3490cc,_0x5a6d2b(0x12f),{'up':!0x0});return{'low':_0x3490cc,'high':_0x17865b,'text':_0x3490cc===_0x17865b?_0x2c4031:_0x2c4031['replace'](/ ETH$/,'')+_0x5a6d2b(0x14a)+_0x328495(_0x17865b,_0x5a6d2b(0x12f),{'up':!0x0})};}function g(_0xff8099){const _0x97c15e=_0x2e2b80;return(_0xff8099[_0x97c15e(0x133)]===_0x97c15e(0x151)?'':'\u2248\x20')+_0x328495(_0xff8099['payment'],_0xff8099[_0x97c15e(0x133)],{'up':!0x0});}function H(_0x1dad71){const _0xc111d0=_0x2e2b80;if(_0x1dad71['error'])return'\x20\x20'+_0x1dad71[_0xc111d0(0x133)]+_0xc111d0(0x167);const _0x3c9313=_0x1dad71[_0xc111d0(0x13c)]?.[_0xc111d0(0x13f)](_0x1945eb=>_0x1945eb[_0xc111d0(0x133)]===_0x1dad71[_0xc111d0(0x133)]);let _0x44babb='';_0x1dad71[_0xc111d0(0x169)]?_0x44babb=_0xc111d0(0x149):_0x3c9313&&BigInt(_0x3c9313[_0xc111d0(0x15b)])>0x0n?_0x44babb=_0xc111d0(0x161)+_0x328495(c(_0x3c9313),_0x1dad71['coin'],{'up':!0x0})+_0xc111d0(0x159)+(_0x1dad71[_0xc111d0(0x133)]===_0xc111d0(0x12f)?_0xc111d0(0x154):''):_0x1dad71[_0xc111d0(0x133)]!==_0xc111d0(0x12f)&&_0x1dad71['balance']!==null&&_0x1dad71['balance']!==void 0x0&&(_0x44babb='\x20\xB7\x20enough');const _0x2f4d82=_0x1dad71[_0xc111d0(0x15b)]===null||_0x1dad71['balance']===void 0x0?'':'\x20\xB7\x20you\x20have\x20'+_0x328495(_0x1dad71['balance'],_0x1dad71[_0xc111d0(0x133)]);return'\x20\x20'+g(_0x1dad71)+(_0x1dad71[_0xc111d0(0x133)]===_0xc111d0(0x12f)?_0xc111d0(0x144):'')+_0x2f4d82+_0x44babb;}function _0x36ab(_0x3af9a7,_0x47d6e5){_0x3af9a7=_0x3af9a7-0x12f;const _0x36ab51=_0x47d6();let _0xd4d39e=_0x36ab51[_0x3af9a7];return _0xd4d39e;}function m(_0x2c8c52){const _0x3bb3fe=_0x2e2b80,_0x51adbf=u(_0x2c8c52)[_0x3bb3fe(0x14f)](_0x19b038=>_0x19b038[_0x3bb3fe(0x13c)]?.['length']),_0x365347=_0x51adbf[_0x3bb3fe(0x14f)](_0x1f37b2=>_0x1f37b2[_0x3bb3fe(0x133)]!==_0x3bb3fe(0x12f)&&_0x1f37b2[_0x3bb3fe(0x13c)]['every'](_0x4ff268=>_0x4ff268['coin']===_0x3bb3fe(0x12f)))['map'](_0x43f4b4=>({'option':_0x43f4b4,'amount':c(_0x43f4b4[_0x3bb3fe(0x13c)][0x0])}))[_0x3bb3fe(0x13a)]((_0x2b0b1f,_0x43d421)=>_0x2b0b1f[_0x3bb3fe(0x155)]<_0x43d421[_0x3bb3fe(0x155)]?-0x1:_0x2b0b1f[_0x3bb3fe(0x155)]>_0x43d421[_0x3bb3fe(0x155)]?0x1:0x0);if(_0x365347[_0x3bb3fe(0x138)])return _0x3bb3fe(0x14e)+_0x328495(f(_0x365347[0x0][_0x3bb3fe(0x155)]),'ETH',{'up':!0x0})+'\x20for\x20gas,\x20then\x20pay\x20with\x20your\x20'+_0x365347[0x0]['option'][_0x3bb3fe(0x133)]+'.';const _0x8f73fd=_0x51adbf[_0x3bb3fe(0x13f)](_0x3dc7de=>_0x3dc7de[_0x3bb3fe(0x133)]===_0x3bb3fe(0x12f))?.[_0x3bb3fe(0x13c)][_0x3bb3fe(0x13f)](_0x5d34ca=>_0x5d34ca['coin']===_0x3bb3fe(0x12f));return _0x8f73fd?_0x3bb3fe(0x134)+_0x328495(f(c(_0x8f73fd)),_0x3bb3fe(0x12f),{'up':!0x0})+'.\x20ETH\x20covers\x20both\x20the\x20payment\x20and\x20gas.':null;}function _0x47d6(){const _0x9dca93=['ETH','toUpperCase','network','name','coin','Simplest:\x20send\x20about\x20','\x20or\x20','chainName','\x20·\x20not\x20available\x20right\x20now','length','assign','sort','Not\x20enough\x20funds\x20on\x20','shortages','some','\x20\x20Not\x20available\x20right\x20now:\x20','find','\x20and\x20','ETH\x20for\x20gas','networks','unavailable','\x20(+\x20gas\x20from\x20the\x20same\x20ETH)','flatMap','slice','map',':\x20you\x20have\x20','\x20·\x20ready\x20to\x20pay','\x20to\x20','imd','\x20yet.\x20Add\x20funds,\x20then\x20check\x20again.','\x20·\x20gas\x20≈\x20','Quickest:\x20add\x20about\x20','filter','Not\x20enough\x20funds\x20yet.\x20Add\x20funds\x20on\x20either\x20network,\x20then\x20check\x20again.','IMD','options','nativeBalance','\x20incl.\x20gas','amount','required','Payment:','address','\x20more','join','balance','payment','text','Gas,\x20always\x20ETH:\x20≈\x20','chain','Gas\x20·\x20network\x20fee,\x20always\x20paid\x20in\x20ETH:','\x20·\x20need\x20','reduce','Send\x20to\x20your\x20wallet:','The\x20same\x20address\x20works\x20on\x20','\x20·\x20you\x20have\x20','Payment,\x20any\x20one\x20of:\x20','\x20·\x20no\x20exchange\x20route\x20right\x20now','error','funded','\x20·\x20pay\x20with\x20','gas','price'];_0x47d6=function(){return _0x9dca93;};return _0x47d6();}function x(_0x3bcc97){const _0x14e9c1=_0x2e2b80,_0x38c17c=_0x3bcc97[_0x14e9c1(0x13c)][_0x14e9c1(0x13d)](_0x318a30=>_0x318a30['coin']!==_0x14e9c1(0x12f));return _0x3bcc97[_0x14e9c1(0x13c)][_0x14e9c1(0x147)](_0x47d8ae=>'\x20\x20'+(_0x47d8ae[_0x14e9c1(0x133)]==='ETH'&&_0x38c17c?_0x14e9c1(0x141):_0x47d8ae[_0x14e9c1(0x133)])+_0x14e9c1(0x148)+_0x2a0efc(_0x47d8ae['balance'],_0x47d8ae[_0x14e9c1(0x133)])+_0x14e9c1(0x161)+_0x2a0efc(_0x47d8ae[_0x14e9c1(0x156)],_0x47d8ae['coin']));}function b(_0x1f39b5){const _0x47f636=_0x2e2b80,_0x1d2176=_0x1f39b5[_0x47f636(0x136)][_0x47f636(0x130)]()+(_0x1f39b5['price']?'\x20\xB7\x20task\x20price\x20'+_0x328495(_0x1f39b5[_0x47f636(0x16c)],'IMD',{'up':!0x0}):'');if(_0x1f39b5[_0x47f636(0x168)])return[_0x1d2176,_0x47f636(0x13e)+_0x1f39b5['error']];const _0x5244d6=_0x1f39b5['options']??[];if(!_0x5244d6[_0x47f636(0x138)])return[_0x1d2176,...x(_0x1f39b5)];const _0x2e716f=d(_0x1f39b5),_0x15a35f=_0x1f39b5[_0x47f636(0x153)]??_0x5244d6[_0x47f636(0x13f)](_0x16af5c=>_0x16af5c['nativeBalance']!==void 0x0)?.[_0x47f636(0x153)],_0x137802=_0x15a35f===void 0x0?'':_0x47f636(0x165)+_0x328495(_0x15a35f,_0x47f636(0x12f))+(_0x2e716f&&BigInt(_0x15a35f)>=_0x2e716f['high']?'\x20\xB7\x20enough':''),_0x4e8942=m(_0x1f39b5);return[_0x1d2176,_0x5244d6[_0x47f636(0x138)]>0x1?'Payment\x20\xB7\x20pick\x20any\x20one\x20coin:':_0x47f636(0x157),..._0x5244d6['map'](H),_0x47f636(0x160),'\x20\x20'+(_0x2e716f?'\u2248\x20'+_0x2e716f[_0x47f636(0x15d)]:_0x47f636(0x143))+_0x137802,..._0x4e8942?[_0x4e8942]:[]];}function j(_0xc38c4e){const _0x35dbaf=_0x2e2b80,_0x361bd3=u(_0xc38c4e);if(!_0x361bd3[_0x35dbaf(0x138)])return[];const _0x39b2ac=d(_0xc38c4e),_0x37e34d=m(_0xc38c4e);return[_0x35dbaf(0x166)+_0x361bd3[_0x35dbaf(0x147)](g)[_0x35dbaf(0x15a)](_0x35dbaf(0x135)),_0x35dbaf(0x15e)+_0x39b2ac['text'],..._0x37e34d?[_0x37e34d]:[]];}function A(_0x4b6fa9){const _0x20103d=_0x2e2b80;if(_0x4b6fa9[_0x20103d(0x168)])return _0x4b6fa9['chainName']+_0x20103d(0x137);const _0x2f1ff7=(_0x4b6fa9[_0x20103d(0x152)]??[])[_0x20103d(0x14f)](_0x4c584e=>!_0x4c584e['error'])[_0x20103d(0x147)](_0x29bbb3=>_0x29bbb3[_0x20103d(0x133)]),_0x568238=d(_0x4b6fa9),_0x17a18d=_0x2f1ff7[_0x20103d(0x138)]>0x1?_0x2f1ff7[_0x20103d(0x146)](0x0,-0x1)[_0x20103d(0x15a)](',\x20')+_0x20103d(0x135)+_0x2f1ff7['at'](-0x1):_0x2f1ff7[0x0];return _0x4b6fa9['chainName']+(_0x17a18d?_0x20103d(0x16a)+_0x17a18d:'')+(_0x568238?_0x20103d(0x14d)+_0x568238[_0x20103d(0x15d)]:'');}function v(_0x29b9c6){const _0x129fc7=_0x2e2b80,_0x1f86c7=E(_0x29b9c6),_0x3a2fc5=_0x105c4d[_0x129fc7(0x147)](_0x336bb3=>_0x336bb3[_0x129fc7(0x15f)][_0x129fc7(0x132)])[_0x129fc7(0x15a)](_0x129fc7(0x140));return[_0x1f86c7[_0x129fc7(0x138)]>0x1?_0x129fc7(0x150):_0x129fc7(0x13b)+_0x1f86c7[0x0]['chainName']+_0x129fc7(0x14c),'',_0x129fc7(0x163),_0x29b9c6[_0x129fc7(0x158)],_0x129fc7(0x164)+_0x3a2fc5+'.\x20Funds\x20stay\x20on\x20the\x20network\x20they\x20are\x20sent\x20on.','',..._0x1f86c7[_0x129fc7(0x145)](_0x4b3158=>[...b(_0x4b3158),'']),'Prices\x20and\x20fees\x20are\x20estimates.\x20They\x20are\x20checked\x20again\x20before\x20you\x20pay.'];}export{v as fundingInstructions,E as fundingNetworks,I as fundingRequired,w as fundingRequiredOptions,A as networkChoiceLabel,b as networkLines,j as networkTargets,m as quickestFix};
1
+ const _0x32fc2b=_0x4a81;function _0xb990(){const _0x44c03f=['Your\x20wallet:\x20',':\x20you\x20have\x20','balance','join','no\x20coin\x20available\x20right\x20now','\x20(enough)','error','required','map','\x20yet.\x20Add\x20funds,\x20then\x20check\x20again.','slice','Same\x20address\x20on\x20','\x20\x20You\x20have:\x20','Not\x20enough\x20funds\x20on\x20','IMD','Not\x20enough\x20funds\x20yet.\x20Add\x20funds\x20on\x20either\x20network,\x20then\x20check\x20again.','\x20·\x20','\x20(enough\x20for\x20gas)','\x20optional\x20support','replace','\x20and\x20','some','\x20\x20Plus\x20gas\x20(network\x20fee,\x20always\x20ETH):\x20','ETH\x20for\x20gas','\x20Amounts\x20are\x20estimates.','\x20or\x20','imd','support','\x20·\x20pay\x20with\x20','\x20·\x20task\x20price\x20','network','length','assign','\x20\x20Not\x20available\x20right\x20now:\x20','flatMap','\x20·\x20not\x20available\x20right\x20now','find','options','networks','nativeBalance','text','chain','funding_required','name','Pay\x20with\x20any\x20one:\x20','coin','shortages',':\x20no\x20exchange\x20route\x20now)','Payment,\x20any\x20one\x20of:\x20','ETH','reduce','chainName','filter','\x20for\x20gas,\x20then\x20pay\x20with\x20your\x20','sort','payment','option','gas','\x20·\x20gas\x20≈\x20','unavailable','.\x20Funds\x20stay\x20on\x20the\x20network\x20you\x20send\x20them\x20on.','amount','\x20·\x20need\x20','Quickest:\x20add\x20about\x20','\x20to\x20','high','price'];_0xb990=function(){return _0x44c03f;};return _0xb990();}import{coinAmount as _0x43312a,friendlyAmount as _0x17addf}from'./payment-coins.mjs';function _0x4a81(_0x313e8b,_0xb990bf){_0x313e8b=_0x313e8b-0x14b;const _0x4a81aa=_0xb990();let _0x2c418d=_0x4a81aa[_0x313e8b];return _0x2c418d;}import{PAYMENT_NETWORKS as _0x13d4d8,paymentNetwork as _0x53843f}from'./payment-networks.mjs';const d=_0x334ee6=>Object[_0x32fc2b(0x16b)](new Error(A(_0x334ee6)[_0x32fc2b(0x14e)]('\x0a')),{'code':_0x32fc2b(0x175),'funding':_0x334ee6});function O(_0x1ba345,_0x2f4292,_0x1b343a,_0x3f7f2a){const _0x4b1f83=_0x32fc2b,_0x58fc74=_0x53843f(_0x2f4292)[_0x4b1f83(0x174)][_0x4b1f83(0x176)],_0xcecfc7={'key':_0x2f4292,'chainName':_0x58fc74,'price':_0x3f7f2a?.[_0x4b1f83(0x18d)]??_0x3f7f2a?.[_0x4b1f83(0x165)],'support':_0x3f7f2a?.['support'],'nativeBalance':_0x3f7f2a?.['nativeBalance'],'options':_0x3f7f2a?[{..._0x3f7f2a,'funded':!0x1,'shortages':_0x1b343a}]:[],'shortages':_0x1b343a};return d({'address':_0x1ba345,'network':_0x2f4292,'chainName':_0x58fc74,'shortages':_0x1b343a,'networks':[_0xcecfc7]});}function w(_0x44cf50,_0xfe2f69){return d({'address':_0x44cf50,'networks':_0xfe2f69});}function b(_0x511b8f){const _0x5ba1ff=_0x32fc2b;return _0x511b8f[_0x5ba1ff(0x171)]??[{'key':_0x511b8f[_0x5ba1ff(0x169)],'chainName':_0x511b8f['chainName'],'options':[],'shortages':_0x511b8f[_0x5ba1ff(0x179)]??[]}];}const m=_0x407fc4=>BigInt(_0x407fc4[_0x32fc2b(0x152)])-BigInt(_0x407fc4['balance']),y=_0x4f6904=>(_0x4f6904*0xbn+0x9n)/0xan,u=_0x286ae1=>(_0x286ae1['options']??[])['filter'](_0x25853e=>!_0x25853e[_0x32fc2b(0x151)]&&_0x25853e[_0x32fc2b(0x182)]!==void 0x0);function p(_0x6dc605){const _0x228307=_0x32fc2b,_0x21add0=u(_0x6dc605)['map'](_0x29580f=>BigInt(_0x29580f[_0x228307(0x184)]));if(!_0x21add0['length'])return null;const _0x267d8e=_0x21add0['reduce']((_0x5eab13,_0x234796)=>_0x5eab13<_0x234796?_0x5eab13:_0x234796),_0x5c8531=_0x21add0[_0x228307(0x17d)]((_0x3946a3,_0x32182a)=>_0x3946a3>_0x32182a?_0x3946a3:_0x32182a),_0xd49d68=_0x17addf(_0x267d8e,'ETH',{'up':!0x0});return{'low':_0x267d8e,'high':_0x5c8531,'text':_0x267d8e===_0x5c8531?_0xd49d68:_0xd49d68[_0x228307(0x15e)](/ ETH$/,'')+_0x228307(0x18b)+_0x17addf(_0x5c8531,'ETH',{'up':!0x0})};}function E(_0x52d82d){const _0x1941f8=_0x32fc2b;return(_0x52d82d['coin']==='IMD'?'':'\u2248\x20')+_0x17addf(_0x52d82d[_0x1941f8(0x182)],_0x52d82d[_0x1941f8(0x178)],{'up':!0x0});}const l=_0x35e701=>_0x35e701!=null,T=_0x5975f2=>_0x5975f2['funded']||!_0x5975f2[_0x32fc2b(0x179)]?.[_0x32fc2b(0x160)](_0x1ca2ca=>_0x1ca2ca[_0x32fc2b(0x178)]===_0x5975f2['coin']);function B(_0x170346,_0x1dc314){const _0x4bc296=_0x32fc2b,_0x5063c2=u(_0x170346),_0x1323ea=_0x5063c2[_0x4bc296(0x17f)](_0x15fe5b=>_0x15fe5b[_0x4bc296(0x178)]!==_0x4bc296(0x17c)&&l(_0x15fe5b[_0x4bc296(0x14d)]))['map'](_0x208cc2=>_0x17addf(_0x208cc2[_0x4bc296(0x14d)],_0x208cc2[_0x4bc296(0x178)])+(T(_0x208cc2)?_0x4bc296(0x150):'')),_0x5d0e34=_0x5063c2[_0x4bc296(0x16f)](_0x50be9f=>_0x50be9f[_0x4bc296(0x178)]===_0x4bc296(0x17c)),_0x2fda6c=_0x170346[_0x4bc296(0x172)]??_0x5063c2[_0x4bc296(0x16f)](_0x229951=>l(_0x229951[_0x4bc296(0x172)]))?.[_0x4bc296(0x172)];if(l(_0x2fda6c)){let _0x2931ab='';_0x5d0e34&&T(_0x5d0e34)?_0x2931ab=_0x4bc296(0x150):_0x1dc314&&BigInt(_0x2fda6c)>=_0x1dc314[_0x4bc296(0x18c)]&&(_0x2931ab=_0x4bc296(0x15c)),_0x1323ea['push'](_0x17addf(_0x2fda6c,_0x4bc296(0x17c))+_0x2931ab);}return _0x1323ea[_0x4bc296(0x16a)]?_0x4bc296(0x157)+_0x1323ea[_0x4bc296(0x14e)](_0x4bc296(0x15b)):null;}function H(_0x4c7eb9){const _0x5b1d2c=_0x32fc2b,_0x3ce8fe=u(_0x4c7eb9)[_0x5b1d2c(0x17f)](_0x50dda5=>_0x50dda5[_0x5b1d2c(0x179)]?.[_0x5b1d2c(0x16a)]),_0x42b14f=_0x3ce8fe[_0x5b1d2c(0x17f)](_0x5626ef=>_0x5626ef[_0x5b1d2c(0x178)]!==_0x5b1d2c(0x17c)&&_0x5626ef[_0x5b1d2c(0x179)]['every'](_0x5f1fc2=>_0x5f1fc2[_0x5b1d2c(0x178)]===_0x5b1d2c(0x17c)))[_0x5b1d2c(0x153)](_0x5b88c4=>({'option':_0x5b88c4,'amount':m(_0x5b88c4['shortages'][0x0])}))[_0x5b1d2c(0x181)]((_0x22158e,_0x553c7c)=>_0x22158e[_0x5b1d2c(0x188)]<_0x553c7c[_0x5b1d2c(0x188)]?-0x1:_0x22158e[_0x5b1d2c(0x188)]>_0x553c7c['amount']?0x1:0x0);if(_0x42b14f[_0x5b1d2c(0x16a)])return _0x5b1d2c(0x18a)+_0x17addf(y(_0x42b14f[0x0]['amount']),_0x5b1d2c(0x17c),{'up':!0x0})+_0x5b1d2c(0x180)+_0x42b14f[0x0][_0x5b1d2c(0x183)][_0x5b1d2c(0x178)]+'.';const _0x5bb63e=_0x3ce8fe['find'](_0x492a9b=>_0x492a9b[_0x5b1d2c(0x178)]===_0x5b1d2c(0x17c))?.[_0x5b1d2c(0x179)][_0x5b1d2c(0x16f)](_0x204547=>_0x204547[_0x5b1d2c(0x178)]==='ETH');return _0x5bb63e?'Simplest:\x20send\x20about\x20'+_0x17addf(y(m(_0x5bb63e)),_0x5b1d2c(0x17c),{'up':!0x0})+',\x20which\x20covers\x20both\x20the\x20payment\x20and\x20gas.':null;}function I(_0x5a196f){const _0x16042f=_0x32fc2b,_0x779d=_0x5a196f['shortages'][_0x16042f(0x160)](_0x1aeee4=>_0x1aeee4[_0x16042f(0x178)]!=='ETH');return _0x5a196f[_0x16042f(0x179)][_0x16042f(0x153)](_0x2df836=>'\x20\x20'+(_0x2df836[_0x16042f(0x178)]==='ETH'&&_0x779d?_0x16042f(0x162):_0x2df836[_0x16042f(0x178)])+_0x16042f(0x14c)+_0x43312a(_0x2df836[_0x16042f(0x14d)],_0x2df836[_0x16042f(0x178)])+_0x16042f(0x189)+_0x43312a(_0x2df836[_0x16042f(0x152)],_0x2df836[_0x16042f(0x178)]));}function j(_0x4b3652){const _0x3821c7=_0x32fc2b,_0x367fa9=_0x4b3652[_0x3821c7(0x166)]&&BigInt(_0x4b3652['support'])>0x0n?'\x20+\x20'+_0x17addf(_0x4b3652[_0x3821c7(0x166)],_0x3821c7(0x159),{'up':!0x0})+_0x3821c7(0x15d):'',_0x2e0e25=_0x4b3652['chainName']['toUpperCase']()+(_0x4b3652[_0x3821c7(0x18d)]?_0x3821c7(0x168)+_0x17addf(_0x4b3652[_0x3821c7(0x18d)],_0x3821c7(0x159),{'up':!0x0})+_0x367fa9:'');if(_0x4b3652[_0x3821c7(0x151)])return[_0x2e0e25,_0x3821c7(0x16c)+_0x4b3652[_0x3821c7(0x151)]];const _0x1370b2=_0x4b3652[_0x3821c7(0x170)]??[];if(!_0x1370b2[_0x3821c7(0x16a)])return[_0x2e0e25,...I(_0x4b3652)];const _0x243724=u(_0x4b3652)[_0x3821c7(0x181)]((_0x4f27cc,_0xc22302)=>(_0x4f27cc['coin']===_0x3821c7(0x17c))-(_0xc22302[_0x3821c7(0x178)]===_0x3821c7(0x17c))),_0x4b5666=p(_0x4b3652),_0x5b645a=_0x1370b2[_0x3821c7(0x17f)](_0xce4bda=>_0xce4bda[_0x3821c7(0x151)])['map'](_0x54c86b=>_0x54c86b[_0x3821c7(0x178)]),_0x45b016=H(_0x4b3652),_0x1d61ec=B(_0x4b3652,_0x4b5666);return[_0x2e0e25,'\x20\x20'+(_0x243724[_0x3821c7(0x16a)]>0x1?_0x3821c7(0x177):'Pay:\x20')+(_0x243724[_0x3821c7(0x153)](E)[_0x3821c7(0x14e)](_0x3821c7(0x164))||_0x3821c7(0x14f))+(_0x5b645a[_0x3821c7(0x16a)]?'\x20('+_0x5b645a[_0x3821c7(0x14e)](',\x20')+_0x3821c7(0x17a):''),_0x3821c7(0x161)+(_0x4b5666?'\u2248\x20'+_0x4b5666[_0x3821c7(0x173)]:_0x3821c7(0x186)),..._0x1d61ec?[_0x1d61ec]:[],..._0x45b016?['\x20\x20'+_0x45b016]:[]];}function L(_0x5e8bb3){const _0x264e33=_0x32fc2b,_0x35c18f=u(_0x5e8bb3)['sort']((_0x553b97,_0x432f4f)=>(_0x553b97[_0x264e33(0x178)]==='ETH')-(_0x432f4f[_0x264e33(0x178)]==='ETH'));if(!_0x35c18f[_0x264e33(0x16a)])return[];const _0x776477=p(_0x5e8bb3),_0x11bd30=H(_0x5e8bb3);return[_0x264e33(0x17b)+_0x35c18f[_0x264e33(0x153)](E)[_0x264e33(0x14e)]('\x20or\x20'),'Gas,\x20always\x20ETH:\x20\u2248\x20'+_0x776477[_0x264e33(0x173)],..._0x11bd30?[_0x11bd30]:[]];}function R(_0x5b4138){const _0x4a9133=_0x32fc2b;if(_0x5b4138['error'])return _0x5b4138['chainName']+_0x4a9133(0x16e);const _0x16b0aa=(_0x5b4138[_0x4a9133(0x170)]??[])[_0x4a9133(0x17f)](_0x589cd3=>!_0x589cd3[_0x4a9133(0x151)])[_0x4a9133(0x153)](_0x4906cf=>_0x4906cf['coin']),_0x44a975=p(_0x5b4138),_0x51d090=_0x16b0aa['length']>0x1?_0x16b0aa[_0x4a9133(0x155)](0x0,-0x1)['join'](',\x20')+_0x4a9133(0x164)+_0x16b0aa['at'](-0x1):_0x16b0aa[0x0];return _0x5b4138[_0x4a9133(0x17e)]+(_0x51d090?_0x4a9133(0x167)+_0x51d090:'')+(_0x44a975?_0x4a9133(0x185)+_0x44a975[_0x4a9133(0x173)]:'');}function A(_0xf5429f){const _0x1f65ff=_0x32fc2b,_0x4a89a0=b(_0xf5429f),_0x4fc5d8=_0x13d4d8[_0x1f65ff(0x153)](_0xb0cd20=>_0xb0cd20[_0x1f65ff(0x174)][_0x1f65ff(0x176)])[_0x1f65ff(0x14e)](_0x1f65ff(0x15f));return[(_0x4a89a0[_0x1f65ff(0x16a)]>0x1?_0x1f65ff(0x15a):_0x1f65ff(0x158)+_0x4a89a0[0x0]['chainName']+_0x1f65ff(0x154))+_0x1f65ff(0x163),_0x1f65ff(0x14b)+_0xf5429f['address'],_0x1f65ff(0x156)+_0x4fc5d8+_0x1f65ff(0x187),..._0x4a89a0[_0x1f65ff(0x16d)](_0x430f80=>['',...j(_0x430f80)]),..._0x4a89a0[_0x1f65ff(0x160)](_0x38b9de=>_0x38b9de[_0x1f65ff(0x166)]&&BigInt(_0x38b9de[_0x1f65ff(0x166)])>0x0n)?['','Includes\x20the\x20optional\x2010%\x20support.\x20Choose\x20Original\x20price\x20when\x20asked\x20to\x20pay\x20only\x20the\x20task\x20price.']:[]];}export{A as fundingInstructions,b as fundingNetworks,O as fundingRequired,w as fundingRequiredOptions,R as networkChoiceLabel,j as networkLines,L as networkTargets,H as quickestFix};
@@ -1 +1 @@
1
- const _0x4b176e=_0x48a1;import{decodeFunctionData as _0x3c1a99,encodeFunctionData as _0x313d52,erc20Abi as _0x390069,EstimateGasExecutionError as _0x4aee4f,formatEther as _0x416856,keccak256 as _0x17dfd9}from'viem';import{getPublicRpcClient as _0x545f70,getRpcClients as _0x1e6a7d,getSigner as _0x222eba}from'../shared.mjs';import{paymentCoin as _0xa4fe3}from'./payment-coins.mjs';function _0x4035(){const _0x556cf1=['chain','min','quotedInput','payment','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.','home','approve_source','spender','transactionHash','push','ETH','requestKey','swap','now','maxPriorityFeePerGas','optional\x20support\x20transfer','expectedWallet','throwIfAborted','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','amountIn','maxFeePerGas','configured','token\x20authorization','length','paymentChain','status','toLowerCase','...','asset','ethereum','.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','The\x20support\x20transfer','checking_funds','floor','replacementNonce','amount','pendingTransaction','payment_review_expired','confirmedHash','symbol','robinhood','transfer','address','data','assign','allowance','reverted','gas','args','account','kind','expiresAt','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','approve','support','value','The\x20','rawTransaction','estimateGas','steps','reduce','IMD','all','feeCap','filter','signTransaction','readContract','Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.','\x20transaction\x20reverted:\x20','reset_source_allowance','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','The\x20swap\x20quote','funding','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.','success','quote','.\x20Your\x20order\x20was\x20not\x20paid.','USDT','confirmed','signal','action','Preparing\x20','hash','payWith','Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.'];_0x4035=function(){return _0x556cf1;};return _0x4035();}import{paymentNetwork as _0x4afc43}from'./payment-networks.mjs';import{assertQuotePayment as _0x28eebc,orderPayment as _0x797c50,loadPaymentConfig as _0x8d0dd3}from'./payments.mjs';import{assertOrderNotCancelled as _0x5c1a13,findOrder as _0x284bd5,saveOrder as _0x54e44e}from'./orders.mjs';import{quoteSwap as _0x288317,buildSwap as _0x3dc24b,UNISWAP as _0x241032,APPROVAL_GAS as _0x3f9dd6,SWAP_ABI as _0x4e1a3c}from'./swaps.mjs';function _0x48a1(_0x10fa52,_0x4035e1){_0x10fa52=_0x10fa52-0xeb;const _0x48a185=_0x4035();let _0x321b80=_0x48a185[_0x10fa52];return _0x321b80;}import{submitTransaction as _0x37456e}from'./transactions.mjs';import{fundingRequired as _0x32f6bf}from'./funding-error.mjs';import{walletInfo as _0x16f475}from'./local-wallet.mjs';import{transactionFees as _0x1312f8,reviewedFees as _0x33b47f}from'./transaction-fees.mjs';import{resumeTransaction as _0x320913,recoveryNonce as _0x56f787,retireExpiredSwap as _0x33c04b}from'./transaction-recovery.mjs';const be=0x7a120n,N=(_0x408d1a,_0x6e0522,_0x518096)=>_0x408d1a[_0x4b176e(0x12d)]({'address':_0x6e0522,'abi':_0x390069,'functionName':'balanceOf','args':[_0x518096]}),Q=(_0x1edb38,_0x4f08d6,_0x682ab1,_0x48a4ce)=>_0x1edb38[_0x4b176e(0x12d)]({'address':_0x4f08d6,'abi':_0x390069,'functionName':_0x4b176e(0x118),'args':[_0x682ab1,_0x48a4ce]}),H=(_0x30b1b5,_0x30cfa1,_0x430c72,_0x272e2b)=>({'kind':_0x30b1b5,'to':_0x30cfa1,'value':'0','gas':String(_0x3f9dd6),'data':_0x313d52({'abi':_0x390069,'functionName':_0x4b176e(0x120),'args':[_0x430c72,_0x272e2b]})});async function ye(_0x291e17,_0x4455f7,_0x29d79c,_0x4939f7,_0x550a4a){const _0x1af096=_0x4b176e,{funding:_0x2a1514,shortages:_0x2231f5,requirement:_0x139b79}=await ve(_0x291e17,_0x4455f7,_0x29d79c,_0x4939f7,_0x550a4a);if(_0x2231f5[_0x1af096(0x102)])throw _0x32f6bf(_0x4939f7[_0x1af096(0x115)],_0x291e17[_0x1af096(0x103)]??_0x1af096(0x108),_0x2231f5,_0x139b79);return _0x2a1514;}async function ve(_0x299972,_0x22320a,_0x164d9f,_0x350421,_0x75593){const _0x4d614b=_0x4b176e,_0x3786f7=_0x299972['paymentChain']??_0x4d614b(0x108),_0x38d735=_0xa4fe3(_0x3786f7,_0x299972[_0x4d614b(0x13e)]),_0x4e7aae=_0x75593??await _0x8d0dd3(_0x22320a['api'],_0x299972[_0x4d614b(0x13b)],_0x3786f7,_0x22320a),_0x524dae=_0x75593?_0x75593[_0x4d614b(0xee)]:_0x797c50(_0x299972);if(_0x28eebc(_0x524dae),_0x524dae['asset'][_0x4d614b(0x105)]()!==_0x4e7aae[_0x4d614b(0xee)][_0x4d614b(0x107)][_0x4d614b(0x105)]())throw new Error(_0x4d614b(0x134));const _0xc37538=BigInt(_0x524dae[_0x4d614b(0x10e)]),[_0xbffac3,_0x2c8f39,_0x48a4e9]=await Promise[_0x4d614b(0x129)]([Q(_0x164d9f,_0x524dae['asset'],_0x350421['address'],_0x4e7aae[_0x4d614b(0xf2)]),_0x164d9f['getBalance']({'address':_0x350421[_0x4d614b(0x115)]}),_0x1312f8(_0x164d9f,_0x4afc43(_0x3786f7)[_0x4d614b(0xeb)]['id'])]),_0x578627=(_0x299972[_0x4d614b(0x133)]?.[_0x4d614b(0x126)]??[])[_0x4d614b(0x12b)](_0x309921=>_0x309921[_0x4d614b(0x104)]==='confirmed');let _0x5f00e2=0x0n,_0x5654f2=0x0n;for(const _0x4295a2 of _0x578627)if(_0x4295a2[_0x4d614b(0x11d)]===_0x4d614b(0xf7)){const _0x50b503=_0x3c1a99({'abi':_0x4e1a3c,'data':_0x4295a2[_0x4d614b(0x116)]});_0x5f00e2+=_0x3c1a99({'abi':_0x4e1a3c,'data':_0x50b503[_0x4d614b(0x11b)][0x1][0x0]})[_0x4d614b(0x11b)][0x0]['amountOut'];}else _0x4295a2['kind']===_0x4d614b(0x121)&&(_0x5654f2+=_0x3c1a99({'abi':_0x390069,'data':_0x4295a2[_0x4d614b(0x116)]})[_0x4d614b(0x11b)][0x1]);const _0x4c18fc=BigInt(_0x299972['support']?.[_0x4d614b(0x10e)]??0x0)-_0x5654f2,_0x334810=_0xc37538+_0x4c18fc,_0xea92db=_0x241032[_0x3786f7]['router'],_0x1f1316=_0x3786f7===_0x4d614b(0x113)?be:0x0n,_0x5793a9=_0x4c18fc>0x0n?0x186a0n:0x0n,_0x3bca4a=_0x1f1316+_0x5793a9+(_0xbffac3<_0xc37538?_0x3f9dd6:0x0n),_0x433d65=[],_0x29477c=[];let _0x2af11b;const _0x38f18c=Math[_0x4d614b(0xec)](Number(_0x299972[_0x4d614b(0x136)][_0x4d614b(0x11e)]),Math[_0x4d614b(0x10c)](Date[_0x4d614b(0xf8)]()/0x3e8)+0x12c);let _0x4fc833=_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0xf5)?_0x2c8f39:null;if(_0x38d735['symbol']===_0x4d614b(0x128)){const _0x1f2d08=await N(_0x164d9f,_0x524dae[_0x4d614b(0x107)],_0x350421[_0x4d614b(0x115)]);_0x4fc833=_0x1f2d08,_0x1f2d08<_0x334810&&_0x29477c[_0x4d614b(0xf4)]({'coin':_0x4d614b(0x128),'balance':String(_0x1f2d08),'required':String(_0x334810)});}const _0x57e00a=_0x5f00e2>_0x5654f2?_0x5f00e2-_0x5654f2:0x0n,_0x18737b=_0x334810>_0x57e00a?_0x334810-_0x57e00a:0x0n;if(_0x57e00a>0x0n){const _0x2b7ee5=await N(_0x164d9f,_0x524dae[_0x4d614b(0x107)],_0x350421[_0x4d614b(0x115)]),_0x5ceb8b=_0x334810<_0x57e00a?_0x334810:_0x57e00a;_0x2b7ee5<_0x5ceb8b&&_0x29477c[_0x4d614b(0xf4)]({'coin':'IMD','balance':String(_0x2b7ee5),'required':String(_0x5ceb8b)});}if(_0x38d735[_0x4d614b(0x112)]!==_0x4d614b(0x128)&&_0x18737b>0x0n){const _0x39c1ec=_0x38d735['symbol']===_0x4d614b(0xf5)?0x0n:await Q(_0x164d9f,_0x38d735[_0x4d614b(0x115)],_0x350421[_0x4d614b(0x115)],_0xea92db);_0x2af11b=await _0x288317(_0x3786f7,_0x38d735,_0x18737b,{'client':_0x164d9f,'maxFeePerGas':_0x48a4e9['maxFeePerGas'],'sourceAllowance':_0x39c1ec,'fixedGas':_0x3bca4a,'signal':_0x22320a[_0x4d614b(0x13a)]});const _0x208cb9=BigInt(_0x2af11b[_0x4d614b(0xfe)]);if(_0x38d735[_0x4d614b(0x112)]!==_0x4d614b(0xf5)){const _0x272b98=await N(_0x164d9f,_0x38d735[_0x4d614b(0x115)],_0x350421[_0x4d614b(0x115)]);_0x4fc833=_0x272b98;const _0x5dd064=_0x39c1ec;_0x272b98<_0x208cb9&&_0x29477c[_0x4d614b(0xf4)]({'coin':_0x38d735[_0x4d614b(0x112)],'balance':String(_0x272b98),'required':String(_0x208cb9)}),_0x5dd064<_0x208cb9&&(_0x38d735['symbol']===_0x4d614b(0x138)&&_0x5dd064>0x0n&&_0x433d65['push'](H(_0x4d614b(0x130),_0x38d735[_0x4d614b(0x115)],_0xea92db,0x0n)),_0x433d65[_0x4d614b(0xf4)](H(_0x4d614b(0xf1),_0x38d735['address'],_0xea92db,_0x208cb9)));}const _0x24f6a1=_0x3dc24b(_0x3786f7,_0x38d735,_0x2af11b,_0x18737b,_0x350421[_0x4d614b(0x115)],_0x38f18c);_0x433d65['push']({'kind':_0x4d614b(0xf7),..._0x24f6a1,'gas':String(_0x2af11b[_0x4d614b(0x11a)]),'expiresAt':_0x38f18c});}_0xbffac3<_0xc37538&&_0x433d65[_0x4d614b(0xf4)](H('approve_imd',_0x524dae['asset'],_0x4e7aae[_0x4d614b(0xf2)],_0xc37538)),_0x4c18fc>0x0n&&_0x433d65['push']({'kind':'support','to':_0x524dae[_0x4d614b(0x107)],'value':'0','gas':String(_0x5793a9),'data':_0x313d52({'abi':_0x390069,'functionName':_0x4d614b(0x114),'args':[_0x299972[_0x4d614b(0x121)]['recipient'],_0x4c18fc]})});const _0x253f1a=_0x433d65[_0x4d614b(0x127)]((_0x144f0c,_0x5cbea6)=>_0x144f0c+BigInt(_0x5cbea6[_0x4d614b(0x11a)]),_0x1f1316)*_0x48a4e9['maxFeePerGas'],_0x127ced=_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0x128)?_0x334810:BigInt(_0x2af11b?.['amountIn']??0x0),_0x116863=_0x127ced+(_0x38d735['symbol']===_0x4d614b(0xf5)?_0x253f1a:0x0n),_0x36b322=_0x253f1a+(_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0xf5)?_0x127ced:0x0n);_0x2c8f39<_0x36b322&&_0x29477c['push']({'coin':_0x4d614b(0xf5),'balance':String(_0x2c8f39),'required':String(_0x36b322)});const _0x136796={'coin':_0x38d735[_0x4d614b(0x112)],'imd':String(_0x334810),'payment':String(_0x127ced),'estimate':String(_0x38d735[_0x4d614b(0x112)]==='IMD'?_0x334810:_0x2af11b?.[_0x4d614b(0xed)]??0x0),'gas':String(_0x253f1a),'balance':_0x4fc833===null?null:String(_0x4fc833),'nativeBalance':String(_0x2c8f39)};return{'shortages':_0x29477c,'requirement':_0x136796,'funding':{'chainId':_0x4afc43(_0x3786f7)[_0x4d614b(0xeb)]['id'],'account':_0x350421['address'],'coin':_0x38d735[_0x4d614b(0x112)],'amountIn':String(_0x127ced),'minimumOut':String(_0x334810),'maximumDebit':String(_0x116863),'quotedInput':String(_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0x128)?_0x334810:_0x2af11b?.[_0x4d614b(0xed)]??0x0),..._0x2af11b?{'slippageBps':_0x2af11b['slippageBps']}:{},'feeCap':String(_0x253f1a),'maxFeePerGas':String(_0x48a4e9[_0x4d614b(0xff)]),'maxPriorityFeePerGas':String(_0x48a4e9[_0x4d614b(0xf9)]),'paymentGas':String(_0x1f1316),'expiresAt':_0x38f18c,'steps':[..._0x578627,..._0x433d65]}};}async function Be(_0x43fc06,_0x4d18e1,_0x5161e1){const _0x2729bf=_0x4b176e,_0x4f10c6=_0x4afc43(_0x43fc06['paymentChain']??'ethereum')['chain']['id'],_0x3f3d17=_0x16f475(_0x4d18e1);if(!_0x3f3d17[_0x2729bf(0x100)])throw new Error(_0x2729bf(0x12e));if(_0x4d18e1[_0x2729bf(0xfb)]&&_0x4d18e1[_0x2729bf(0xfb)]['toLowerCase']()!==_0x3f3d17['address'][_0x2729bf(0x105)]())throw new Error('Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.');const _0x567664=await _0x545f70(_0x4d18e1,_0x4f10c6);if(_0x43fc06['funding']&&_0x43fc06[_0x2729bf(0x133)][_0x2729bf(0x11c)][_0x2729bf(0x105)]()!==_0x3f3d17[_0x2729bf(0x115)][_0x2729bf(0x105)]())throw new Error(_0x2729bf(0x13f));for(const _0x2b209a of _0x43fc06[_0x2729bf(0x133)]?.[_0x2729bf(0x126)]??[]){if(_0x2b209a[_0x2729bf(0x124)]&&_0x2b209a[_0x2729bf(0x104)]!==_0x2729bf(0x139)&&await _0x33c04b(_0x43fc06,_0x2b209a,_0x567664,_0x4d18e1))continue;if(_0x2b209a[_0x2729bf(0x104)]==='reverted')throw new Error(_0x2729bf(0x123)+_0x2b209a[_0x2729bf(0x11d)]+'\x20transaction\x20reverted:\x20'+_0x2b209a[_0x2729bf(0x13d)]+_0x2729bf(0x109));if(!_0x2b209a[_0x2729bf(0x124)]||_0x2b209a[_0x2729bf(0x104)]===_0x2729bf(0x139))continue;const _0x4fce07=await _0x320913(_0x43fc06,_0x2b209a,_0x567664,_0x4d18e1);if(_0x2b209a[_0x2729bf(0x104)]=_0x4fce07[_0x2729bf(0x104)]===_0x2729bf(0x135)?_0x2729bf(0x139):_0x2729bf(0x119),_0x2b209a[_0x2729bf(0x111)]=_0x4fce07['transactionHash'],delete _0x43fc06[_0x2729bf(0x10f)],await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06),_0x2b209a[_0x2729bf(0x104)]===_0x2729bf(0x119))throw new Error(_0x2729bf(0x123)+_0x2b209a[_0x2729bf(0x11d)]+'\x20transaction\x20reverted:\x20'+_0x2b209a['hash']+_0x2729bf(0x109));}_0x4d18e1['onProgress']?.({'phase':_0x2729bf(0x10b),'message':_0x2729bf(0x11f)}),_0x43fc06[_0x2729bf(0x133)]=await ye(_0x43fc06,_0x4d18e1,_0x567664,_0x3f3d17);const _0x5c3d8a=_0x43fc06[_0x2729bf(0x133)];_0x43fc06['paymentReview']={'networkFeeCap':_0x416856(BigInt(_0x5c3d8a[_0x2729bf(0x12a)]))},await _0x5161e1(_0x43fc06),_0x4d18e1[_0x2729bf(0x13a)]?.[_0x2729bf(0xfc)](),_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06);const {walletClient:_0x4b8cd3,account:_0x8ebd3f}=await _0x1e6a7d({..._0x4d18e1,'expectedWallet':_0x3f3d17[_0x2729bf(0x115)]},_0x4f10c6);if(_0x4d18e1[_0x2729bf(0x13a)]?.[_0x2729bf(0xfc)](),_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),_0x5c3d8a[_0x2729bf(0x11e)]*0x3e8<=Date[_0x2729bf(0xf8)]())throw Object[_0x2729bf(0x117)](new Error(_0x2729bf(0xfd)),{'code':'payment_review_expired'});for(const _0x2c3375 of _0x5c3d8a[_0x2729bf(0x126)]){if(_0x2c3375['status']===_0x2729bf(0x139))continue;if(_0x2c3375[_0x2729bf(0x104)]==='reverted')throw new Error(_0x2729bf(0x123)+_0x2c3375['kind']+_0x2729bf(0x12f)+_0x2c3375[_0x2729bf(0x13d)]+_0x2729bf(0x109));if(!_0x2c3375[_0x2729bf(0x124)]){if(_0x5c3d8a['expiresAt']*0x3e8<=Date[_0x2729bf(0xf8)]())throw Object[_0x2729bf(0x117)](new Error(_0x2729bf(0xfd)),{'code':_0x2729bf(0x110)});const _0x4d2668=_0x33b47f(await _0x1312f8(_0x567664,_0x4f10c6),_0x5c3d8a);_0x4d18e1['onProgress']?.({'phase':'signing','message':_0x2729bf(0x13c)+(_0x2c3375[_0x2729bf(0x11d)]==='swap'?'coin\x20conversion':_0x2c3375[_0x2729bf(0x11d)]===_0x2729bf(0x121)?_0x2729bf(0xfa):_0x2729bf(0x101))+_0x2729bf(0x106)});const _0x1846a7={'account':_0x8ebd3f,'to':_0x2c3375['to'],'data':_0x2c3375[_0x2729bf(0x116)],'value':BigInt(_0x2c3375[_0x2729bf(0x122)]),..._0x4d2668};let _0x1ccbaf;try{_0x1ccbaf=await _0x567664[_0x2729bf(0x125)](_0x1846a7);}catch(_0x4cf859){throw _0x4cf859 instanceof _0x4aee4f?new Error((_0x2c3375[_0x2729bf(0x11d)]===_0x2729bf(0xf7)?_0x2729bf(0x132):_0x2c3375[_0x2729bf(0x11d)]===_0x2729bf(0x121)?_0x2729bf(0x10a):'The\x20token\x20authorization')+_0x2729bf(0xef),{'cause':_0x4cf859}):_0x4cf859;}if(_0x1ccbaf>BigInt(_0x2c3375[_0x2729bf(0x11a)]))throw new Error(_0x2729bf(0x140));const _0x3ba486=await _0x4b8cd3['prepareTransactionRequest']({..._0x1846a7,'gas':BigInt(_0x2c3375['gas']),'nonce':await _0x56f787(_0x43fc06,_0x567664,_0x8ebd3f[_0x2729bf(0x115)])});if(await _0x222eba({..._0x4d18e1,'expectedWallet':_0x8ebd3f[_0x2729bf(0x115)]}),_0x4d18e1[_0x2729bf(0x13a)]?.[_0x2729bf(0xfc)](),_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),_0x5c3d8a[_0x2729bf(0x11e)]*0x3e8<=Date[_0x2729bf(0xf8)]())throw Object[_0x2729bf(0x117)](new Error(_0x2729bf(0xfd)),{'code':_0x2729bf(0x110)});Object['assign'](_0x3ba486,_0x33b47f(await _0x1312f8(_0x567664,_0x4f10c6),_0x5c3d8a)),_0x2c3375[_0x2729bf(0x124)]=await _0x4b8cd3[_0x2729bf(0x12c)](_0x3ba486),_0x2c3375[_0x2729bf(0x13d)]=_0x17dfd9(_0x2c3375['rawTransaction']),_0x2c3375[_0x2729bf(0x104)]='signed',delete _0x43fc06[_0x2729bf(0x10d)],_0x43fc06[_0x2729bf(0x104)]=_0x2729bf(0x133),await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06);}const _0x738eff=await _0x37456e(_0x567664,_0x2c3375,_0x4d18e1);if(_0x2c3375[_0x2729bf(0x104)]=_0x738eff[_0x2729bf(0x104)]===_0x2729bf(0x135)?_0x2729bf(0x139):_0x2729bf(0x119),_0x2c3375['confirmedHash']=_0x738eff[_0x2729bf(0xf3)],delete _0x43fc06[_0x2729bf(0x10f)],await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06),_0x2c3375[_0x2729bf(0x104)]===_0x2729bf(0x119))throw new Error(_0x2729bf(0x123)+_0x2c3375[_0x2729bf(0x11d)]+_0x2729bf(0x12f)+_0x2c3375['hash']+_0x2729bf(0x137));}const _0x57c0b0=_0x797c50(_0x43fc06);if(await N(_0x567664,_0x57c0b0[_0x2729bf(0x107)],_0x8ebd3f[_0x2729bf(0x115)])<BigInt(_0x57c0b0['amount']))throw new Error(_0x2729bf(0x131));_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),_0x5c3d8a[_0x2729bf(0x104)]='ready',await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06);}export{Be as fundOrder,ve as planFunding,ye as prepareFunding};
1
+ const _0x35fbd5=_0x4783;function _0x14da(){const _0x4d5746=['pendingTransaction','payment_review_expired','hash','onProgress','feeCap','chain','robinhood','spender','prepareTransactionRequest','.\x20Your\x20order\x20was\x20not\x20paid.','ready','The\x20support\x20transfer','status','gas','coin\x20conversion','min','...','paymentChain','signTransaction','maxPriorityFeePerGas','value','transfer','assign','payment','amountOut','slippageBps','quotedInput','signed','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.','The\x20','\x20transaction\x20reverted:\x20','confirmedHash','args','The\x20token\x20authorization','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','length','throwIfAborted','optional\x20support\x20transfer','Preparing\x20','approve_imd','home','ETH','signal','approve','action','all','Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.','quote','expiresAt','success','push','configured','maxFeePerGas','expectedWallet','now','symbol','ethereum','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','IMD','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','reverted','getBalance','.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','USDT','rawTransaction','requestKey','swap','approve_source','transactionHash','funding','confirmed','asset','toLowerCase','floor','router','filter','amount','support','kind','reset_source_allowance','amountIn','The\x20swap\x20quote','replacementNonce','signing','address','data','api','steps','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.'];_0x14da=function(){return _0x4d5746;};return _0x14da();}import{decodeFunctionData as _0xea4bc7,encodeFunctionData as _0x147fc7,erc20Abi as _0x1c44ef,EstimateGasExecutionError as _0x1ae311,formatEther as _0x6f11b2,keccak256 as _0x2007a7}from'viem';import{getPublicRpcClient as _0x581e7d,getRpcClients as _0x24e488,getSigner as _0xa34bba}from'../shared.mjs';import{paymentCoin as _0x1b1ff1}from'./payment-coins.mjs';import{paymentNetwork as _0x2de524}from'./payment-networks.mjs';import{assertQuotePayment as _0x1a9fc8,orderPayment as _0x11416a,loadPaymentConfig as _0x2dfc5d}from'./payments.mjs';import{assertOrderNotCancelled as _0x212344,findOrder as _0x2cfba5,saveOrder as _0x25ac23}from'./orders.mjs';import{quoteSwap as _0x1c9820,buildSwap as _0x9ab358,UNISWAP as _0x1bd057,APPROVAL_GAS as _0x8abe36,SWAP_ABI as _0x16cc0b}from'./swaps.mjs';import{submitTransaction as _0x5adafa}from'./transactions.mjs';import{fundingRequired as _0x5004bb}from'./funding-error.mjs';import{walletInfo as _0x36db5d}from'./local-wallet.mjs';function _0x4783(_0x29a36d,_0x14da17){_0x29a36d=_0x29a36d-0x1dd;const _0x4783bd=_0x14da();let _0x31bdac=_0x4783bd[_0x29a36d];return _0x31bdac;}import{transactionFees as _0x40b947,reviewedFees as _0x1f5a96}from'./transaction-fees.mjs';import{resumeTransaction as _0x44ee7a,recoveryNonce as _0x49601d,retireExpiredSwap as _0x93fbd1}from'./transaction-recovery.mjs';const be=0x7a120n,N=(_0x58b6e5,_0x223f0b,_0x554232)=>_0x58b6e5['readContract']({'address':_0x223f0b,'abi':_0x1c44ef,'functionName':'balanceOf','args':[_0x554232]}),Q=(_0x2ff612,_0x51a8f6,_0xa84523,_0x506ef5)=>_0x2ff612['readContract']({'address':_0x51a8f6,'abi':_0x1c44ef,'functionName':'allowance','args':[_0xa84523,_0x506ef5]}),H=(_0x453eaf,_0x4571e0,_0x234baa,_0x236c88)=>({'kind':_0x453eaf,'to':_0x4571e0,'value':'0','gas':String(_0x8abe36),'data':_0x147fc7({'abi':_0x1c44ef,'functionName':_0x35fbd5(0x209),'args':[_0x234baa,_0x236c88]})});async function ye(_0x46c55d,_0xd29db5,_0x1b96ab,_0x354c5d,_0x271c65){const _0x3ab721=_0x35fbd5,{funding:_0x3c1f7a,shortages:_0x147e53,requirement:_0x185f01}=await ve(_0x46c55d,_0xd29db5,_0x1b96ab,_0x354c5d,_0x271c65);if(_0x147e53[_0x3ab721(0x201)])throw _0x5004bb(_0x354c5d[_0x3ab721(0x232)],_0x46c55d[_0x3ab721(0x1ee)]??_0x3ab721(0x216),_0x147e53,_0x185f01);return _0x3c1f7a;}async function ve(_0x1935ba,_0x100148,_0x2b4c13,_0x1ed18d,_0x334b96){const _0x597332=_0x35fbd5,_0x12d299=_0x1935ba[_0x597332(0x1ee)]??'ethereum',_0x15a54f=_0x1b1ff1(_0x12d299,_0x1935ba['payWith']),_0x4e9ca7=_0x334b96??await _0x2dfc5d(_0x100148[_0x597332(0x234)],_0x1935ba[_0x597332(0x20a)],_0x12d299,_0x100148),_0x242874=_0x334b96?_0x334b96[_0x597332(0x1f4)]:_0x11416a(_0x1935ba);if(_0x1a9fc8(_0x242874),_0x242874['asset'][_0x597332(0x226)]()!==_0x4e9ca7['payment'][_0x597332(0x225)][_0x597332(0x226)]())throw new Error(_0x597332(0x1ff));const _0x2ee3cf=BigInt(_0x242874['amount']),[_0x22aa99,_0xd84fda,_0x250c70]=await Promise[_0x597332(0x20b)]([Q(_0x2b4c13,_0x242874[_0x597332(0x225)],_0x1ed18d[_0x597332(0x232)],_0x4e9ca7[_0x597332(0x1e4)]),_0x2b4c13[_0x597332(0x21b)]({'address':_0x1ed18d[_0x597332(0x232)]}),_0x40b947(_0x2b4c13,_0x2de524(_0x12d299)['chain']['id'])]),_0x2c1394=(_0x1935ba['funding']?.[_0x597332(0x235)]??[])[_0x597332(0x229)](_0x48b253=>_0x48b253[_0x597332(0x1e9)]==='confirmed');let _0x9cabe6=0x0n,_0x2219d1=0x0n;for(const _0x5d50bf of _0x2c1394)if(_0x5d50bf['kind']==='swap'){const _0x2caed9=_0xea4bc7({'abi':_0x16cc0b,'data':_0x5d50bf['data']});_0x9cabe6+=_0xea4bc7({'abi':_0x16cc0b,'data':_0x2caed9[_0x597332(0x1fd)][0x1][0x0]})['args'][0x0][_0x597332(0x1f5)];}else _0x5d50bf['kind']==='support'&&(_0x2219d1+=_0xea4bc7({'abi':_0x1c44ef,'data':_0x5d50bf[_0x597332(0x233)]})[_0x597332(0x1fd)][0x1]);const _0x468eee=BigInt(_0x1935ba['support']?.[_0x597332(0x22a)]??0x0)-_0x2219d1,_0x19537c=_0x2ee3cf+_0x468eee,_0x36456a=_0x1bd057[_0x12d299][_0x597332(0x228)],_0x8588e8=_0x12d299===_0x597332(0x1e3)?be:0x0n,_0x28de61=_0x468eee>0x0n?0x186a0n:0x0n,_0x281e66=_0x8588e8+_0x28de61+(_0x22aa99<_0x2ee3cf?_0x8abe36:0x0n),_0x4c9ffb=[],_0x17430d=[];let _0x9930ee;const _0x589fc1=Math[_0x597332(0x1ec)](Number(_0x1935ba[_0x597332(0x20d)]['expiresAt']),Math[_0x597332(0x227)](Date[_0x597332(0x214)]()/0x3e8)+0x12c);let _0x181c8b=_0x15a54f[_0x597332(0x215)]===_0x597332(0x207)?_0xd84fda:null;if(_0x15a54f['symbol']===_0x597332(0x218)){const _0x1d59c0=await N(_0x2b4c13,_0x242874[_0x597332(0x225)],_0x1ed18d['address']);_0x181c8b=_0x1d59c0,_0x1d59c0<_0x19537c&&_0x17430d[_0x597332(0x210)]({'coin':_0x597332(0x218),'balance':String(_0x1d59c0),'required':String(_0x19537c)});}const _0x4dcbc2=_0x9cabe6>_0x2219d1?_0x9cabe6-_0x2219d1:0x0n,_0x4dfce4=_0x19537c>_0x4dcbc2?_0x19537c-_0x4dcbc2:0x0n;if(_0x4dcbc2>0x0n){const _0x57d1ac=await N(_0x2b4c13,_0x242874[_0x597332(0x225)],_0x1ed18d[_0x597332(0x232)]),_0x2d1438=_0x19537c<_0x4dcbc2?_0x19537c:_0x4dcbc2;_0x57d1ac<_0x2d1438&&_0x17430d[_0x597332(0x210)]({'coin':'IMD','balance':String(_0x57d1ac),'required':String(_0x2d1438)});}if(_0x15a54f['symbol']!==_0x597332(0x218)&&_0x4dfce4>0x0n){const _0x358634=_0x15a54f['symbol']===_0x597332(0x207)?0x0n:await Q(_0x2b4c13,_0x15a54f[_0x597332(0x232)],_0x1ed18d[_0x597332(0x232)],_0x36456a);_0x9930ee=await _0x1c9820(_0x12d299,_0x15a54f,_0x4dfce4,{'client':_0x2b4c13,'maxFeePerGas':_0x250c70[_0x597332(0x212)],'sourceAllowance':_0x358634,'fixedGas':_0x281e66,'signal':_0x100148[_0x597332(0x208)]});const _0x430dea=BigInt(_0x9930ee[_0x597332(0x22e)]);if(_0x15a54f['symbol']!==_0x597332(0x207)){const _0x531a43=await N(_0x2b4c13,_0x15a54f['address'],_0x1ed18d[_0x597332(0x232)]);_0x181c8b=_0x531a43;const _0x4b00df=_0x358634;_0x531a43<_0x430dea&&_0x17430d[_0x597332(0x210)]({'coin':_0x15a54f[_0x597332(0x215)],'balance':String(_0x531a43),'required':String(_0x430dea)}),_0x4b00df<_0x430dea&&(_0x15a54f[_0x597332(0x215)]===_0x597332(0x21d)&&_0x4b00df>0x0n&&_0x4c9ffb[_0x597332(0x210)](H(_0x597332(0x22d),_0x15a54f[_0x597332(0x232)],_0x36456a,0x0n)),_0x4c9ffb[_0x597332(0x210)](H(_0x597332(0x221),_0x15a54f[_0x597332(0x232)],_0x36456a,_0x430dea)));}const _0x59f784=_0x9ab358(_0x12d299,_0x15a54f,_0x9930ee,_0x4dfce4,_0x1ed18d[_0x597332(0x232)],_0x589fc1);_0x4c9ffb[_0x597332(0x210)]({'kind':_0x597332(0x220),..._0x59f784,'gas':String(_0x9930ee['gas']),'expiresAt':_0x589fc1});}_0x22aa99<_0x2ee3cf&&_0x4c9ffb['push'](H(_0x597332(0x205),_0x242874['asset'],_0x4e9ca7[_0x597332(0x1e4)],_0x2ee3cf)),_0x468eee>0x0n&&_0x4c9ffb['push']({'kind':_0x597332(0x22b),'to':_0x242874['asset'],'value':'0','gas':String(_0x28de61),'data':_0x147fc7({'abi':_0x1c44ef,'functionName':_0x597332(0x1f2),'args':[_0x1935ba[_0x597332(0x22b)]['recipient'],_0x468eee]})});const _0x56cb0d=_0x4c9ffb['reduce']((_0x56e19d,_0x3a4c03)=>_0x56e19d+BigInt(_0x3a4c03[_0x597332(0x1ea)]),_0x8588e8)*_0x250c70[_0x597332(0x212)],_0x5221d1=_0x15a54f[_0x597332(0x215)]===_0x597332(0x218)?_0x19537c:BigInt(_0x9930ee?.[_0x597332(0x22e)]??0x0),_0x3c666c=_0x5221d1+(_0x15a54f[_0x597332(0x215)]===_0x597332(0x207)?_0x56cb0d:0x0n),_0x24877a=_0x56cb0d+(_0x15a54f[_0x597332(0x215)]===_0x597332(0x207)?_0x5221d1:0x0n);_0xd84fda<_0x24877a&&_0x17430d[_0x597332(0x210)]({'coin':'ETH','balance':String(_0xd84fda),'required':String(_0x24877a)});const _0x522c02={'coin':_0x15a54f[_0x597332(0x215)],'imd':String(_0x19537c),'price':String(_0x2ee3cf),'support':String(_0x468eee>0x0n?_0x468eee:0x0n),'payment':String(_0x5221d1),'estimate':String(_0x15a54f[_0x597332(0x215)]==='IMD'?_0x19537c:_0x9930ee?.[_0x597332(0x1f7)]??0x0),'gas':String(_0x56cb0d),'balance':_0x181c8b===null?null:String(_0x181c8b),'nativeBalance':String(_0xd84fda)};return{'shortages':_0x17430d,'requirement':_0x522c02,'funding':{'chainId':_0x2de524(_0x12d299)[_0x597332(0x1e2)]['id'],'account':_0x1ed18d[_0x597332(0x232)],'coin':_0x15a54f[_0x597332(0x215)],'amountIn':String(_0x5221d1),'minimumOut':String(_0x19537c),'maximumDebit':String(_0x3c666c),'quotedInput':String(_0x15a54f['symbol']===_0x597332(0x218)?_0x19537c:_0x9930ee?.[_0x597332(0x1f7)]??0x0),..._0x9930ee?{'slippageBps':_0x9930ee[_0x597332(0x1f6)]}:{},'feeCap':String(_0x56cb0d),'maxFeePerGas':String(_0x250c70[_0x597332(0x212)]),'maxPriorityFeePerGas':String(_0x250c70[_0x597332(0x1f0)]),'paymentGas':String(_0x8588e8),'expiresAt':_0x589fc1,'steps':[..._0x2c1394,..._0x4c9ffb]}};}async function Be(_0x4af445,_0x327e69,_0x34baa0){const _0x1bbfc4=_0x35fbd5,_0x3a0b85=_0x2de524(_0x4af445[_0x1bbfc4(0x1ee)]??_0x1bbfc4(0x216))['chain']['id'],_0x1c088d=_0x36db5d(_0x327e69);if(!_0x1c088d[_0x1bbfc4(0x211)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.');if(_0x327e69[_0x1bbfc4(0x213)]&&_0x327e69[_0x1bbfc4(0x213)][_0x1bbfc4(0x226)]()!==_0x1c088d['address'][_0x1bbfc4(0x226)]())throw new Error(_0x1bbfc4(0x20c));const _0x16b6e6=await _0x581e7d(_0x327e69,_0x3a0b85);if(_0x4af445[_0x1bbfc4(0x223)]&&_0x4af445['funding']['account'][_0x1bbfc4(0x226)]()!==_0x1c088d['address'][_0x1bbfc4(0x226)]())throw new Error('Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.');for(const _0xeefee8 of _0x4af445['funding']?.[_0x1bbfc4(0x235)]??[]){if(_0xeefee8[_0x1bbfc4(0x21e)]&&_0xeefee8['status']!==_0x1bbfc4(0x224)&&await _0x93fbd1(_0x4af445,_0xeefee8,_0x16b6e6,_0x327e69))continue;if(_0xeefee8[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error(_0x1bbfc4(0x1fa)+_0xeefee8[_0x1bbfc4(0x22c)]+_0x1bbfc4(0x1fb)+_0xeefee8[_0x1bbfc4(0x1df)]+'.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.');if(!_0xeefee8[_0x1bbfc4(0x21e)]||_0xeefee8[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x224))continue;const _0x5be3ef=await _0x44ee7a(_0x4af445,_0xeefee8,_0x16b6e6,_0x327e69);if(_0xeefee8[_0x1bbfc4(0x1e9)]=_0x5be3ef[_0x1bbfc4(0x1e9)]==='success'?_0x1bbfc4(0x224):_0x1bbfc4(0x21a),_0xeefee8[_0x1bbfc4(0x1fc)]=_0x5be3ef['transactionHash'],delete _0x4af445[_0x1bbfc4(0x1dd)],await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445),_0xeefee8[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error(_0x1bbfc4(0x1fa)+_0xeefee8[_0x1bbfc4(0x22c)]+_0x1bbfc4(0x1fb)+_0xeefee8[_0x1bbfc4(0x1df)]+'.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.');}_0x327e69[_0x1bbfc4(0x1e0)]?.({'phase':'checking_funds','message':_0x1bbfc4(0x217)}),_0x4af445['funding']=await ye(_0x4af445,_0x327e69,_0x16b6e6,_0x1c088d);const _0x371056=_0x4af445[_0x1bbfc4(0x223)];_0x4af445['paymentReview']={'networkFeeCap':_0x6f11b2(BigInt(_0x371056[_0x1bbfc4(0x1e1)]))},await _0x34baa0(_0x4af445),_0x327e69[_0x1bbfc4(0x208)]?.[_0x1bbfc4(0x202)](),_0x212344(await _0x2cfba5(_0x327e69[_0x1bbfc4(0x206)],_0x4af445[_0x1bbfc4(0x21f)])),await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445);const {walletClient:_0x7bcdb9,account:_0x3d42af}=await _0x24e488({..._0x327e69,'expectedWallet':_0x1c088d[_0x1bbfc4(0x232)]},_0x3a0b85);if(_0x327e69[_0x1bbfc4(0x208)]?.[_0x1bbfc4(0x202)](),_0x212344(await _0x2cfba5(_0x327e69['home'],_0x4af445['requestKey'])),_0x371056[_0x1bbfc4(0x20e)]*0x3e8<=Date[_0x1bbfc4(0x214)]())throw Object['assign'](new Error(_0x1bbfc4(0x200)),{'code':_0x1bbfc4(0x1de)});for(const _0x1ed7f1 of _0x371056[_0x1bbfc4(0x235)]){if(_0x1ed7f1[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x224))continue;if(_0x1ed7f1[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error('The\x20'+_0x1ed7f1['kind']+_0x1bbfc4(0x1fb)+_0x1ed7f1[_0x1bbfc4(0x1df)]+_0x1bbfc4(0x21c));if(!_0x1ed7f1[_0x1bbfc4(0x21e)]){if(_0x371056[_0x1bbfc4(0x20e)]*0x3e8<=Date[_0x1bbfc4(0x214)]())throw Object[_0x1bbfc4(0x1f3)](new Error(_0x1bbfc4(0x200)),{'code':'payment_review_expired'});const _0x1da29e=_0x1f5a96(await _0x40b947(_0x16b6e6,_0x3a0b85),_0x371056);_0x327e69[_0x1bbfc4(0x1e0)]?.({'phase':_0x1bbfc4(0x231),'message':_0x1bbfc4(0x204)+(_0x1ed7f1[_0x1bbfc4(0x22c)]===_0x1bbfc4(0x220)?_0x1bbfc4(0x1eb):_0x1ed7f1[_0x1bbfc4(0x22c)]==='support'?_0x1bbfc4(0x203):'token\x20authorization')+_0x1bbfc4(0x1ed)});const _0x5131e4={'account':_0x3d42af,'to':_0x1ed7f1['to'],'data':_0x1ed7f1['data'],'value':BigInt(_0x1ed7f1[_0x1bbfc4(0x1f1)]),..._0x1da29e};let _0x53e348;try{_0x53e348=await _0x16b6e6['estimateGas'](_0x5131e4);}catch(_0x103d24){throw _0x103d24 instanceof _0x1ae311?new Error((_0x1ed7f1[_0x1bbfc4(0x22c)]===_0x1bbfc4(0x220)?_0x1bbfc4(0x22f):_0x1ed7f1[_0x1bbfc4(0x22c)]===_0x1bbfc4(0x22b)?_0x1bbfc4(0x1e8):_0x1bbfc4(0x1fe))+_0x1bbfc4(0x236),{'cause':_0x103d24}):_0x103d24;}if(_0x53e348>BigInt(_0x1ed7f1[_0x1bbfc4(0x1ea)]))throw new Error(_0x1bbfc4(0x1f9));const _0x3aa57a=await _0x7bcdb9[_0x1bbfc4(0x1e5)]({..._0x5131e4,'gas':BigInt(_0x1ed7f1['gas']),'nonce':await _0x49601d(_0x4af445,_0x16b6e6,_0x3d42af['address'])});if(await _0xa34bba({..._0x327e69,'expectedWallet':_0x3d42af[_0x1bbfc4(0x232)]}),_0x327e69[_0x1bbfc4(0x208)]?.[_0x1bbfc4(0x202)](),_0x212344(await _0x2cfba5(_0x327e69[_0x1bbfc4(0x206)],_0x4af445['requestKey'])),_0x371056[_0x1bbfc4(0x20e)]*0x3e8<=Date['now']())throw Object[_0x1bbfc4(0x1f3)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':'payment_review_expired'});Object[_0x1bbfc4(0x1f3)](_0x3aa57a,_0x1f5a96(await _0x40b947(_0x16b6e6,_0x3a0b85),_0x371056)),_0x1ed7f1['rawTransaction']=await _0x7bcdb9[_0x1bbfc4(0x1ef)](_0x3aa57a),_0x1ed7f1[_0x1bbfc4(0x1df)]=_0x2007a7(_0x1ed7f1['rawTransaction']),_0x1ed7f1[_0x1bbfc4(0x1e9)]=_0x1bbfc4(0x1f8),delete _0x4af445[_0x1bbfc4(0x230)],_0x4af445[_0x1bbfc4(0x1e9)]=_0x1bbfc4(0x223),await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445);}const _0x14755a=await _0x5adafa(_0x16b6e6,_0x1ed7f1,_0x327e69);if(_0x1ed7f1[_0x1bbfc4(0x1e9)]=_0x14755a['status']===_0x1bbfc4(0x20f)?_0x1bbfc4(0x224):_0x1bbfc4(0x21a),_0x1ed7f1['confirmedHash']=_0x14755a[_0x1bbfc4(0x222)],delete _0x4af445[_0x1bbfc4(0x1dd)],await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445),_0x1ed7f1[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error(_0x1bbfc4(0x1fa)+_0x1ed7f1[_0x1bbfc4(0x22c)]+'\x20transaction\x20reverted:\x20'+_0x1ed7f1['hash']+_0x1bbfc4(0x1e6));}const _0x15cff1=_0x11416a(_0x4af445);if(await N(_0x16b6e6,_0x15cff1[_0x1bbfc4(0x225)],_0x3d42af['address'])<BigInt(_0x15cff1[_0x1bbfc4(0x22a)]))throw new Error(_0x1bbfc4(0x219));_0x212344(await _0x2cfba5(_0x327e69[_0x1bbfc4(0x206)],_0x4af445[_0x1bbfc4(0x21f)])),_0x371056[_0x1bbfc4(0x1e9)]=_0x1bbfc4(0x1e7),await _0x25ac23(_0x327e69['home'],_0x4af445);}export{Be as fundOrder,ve as planFunding,ye as prepareFunding};