supercolony 0.1.1 → 0.1.3

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
@@ -25,6 +25,8 @@ colony --ascii
25
25
 
26
26
  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
27
 
28
+ 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 and network settings 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.
29
+
28
30
  | Key | Action |
29
31
  | --- | --- |
30
32
  | `1`–`4` | Switch workspace |
@@ -72,7 +74,9 @@ Natural-language planning uses Qwen3.5-0.8B Q4_K_M (about 533 MB) locally: CPU o
72
74
 
73
75
  Model downloads try Hugging Face first and automatically switch to [HF-Mirror](https://hf-mirror.com/) if the network request fails. Both sources use the same pinned model and SHA-256 verification. After setup, inference runs from the local cache.
74
76
 
75
- First-time preparation shows **Local LLM** with separate download, verification and loading steps. The download bar shows percentage, transferred MB and speed; switching to the backup source resets the bar. TUI and ordinary terminal commands share this progress display. A verified cache skips downloading. Redirected output uses plain milestones on stderr, and `--json` keeps stdout as one JSON document. Technical model metadata remains available with `colony model status --json`.
77
+ First-time preparation names **Qwen** (about 533 MB) and explains its purpose: understanding your request locally and selecting task settings. IMD workers execute the task. The model downloads once, is reused locally, and needs no external AI API key. Download, verification and loading have separate steps; the download bar shows percentage, transferred MB, speed and the current source website (`huggingface.co` or `hf-mirror.com`). Switching to the backup source updates the website and resets the bar. A verified cache skips downloading. Redirected output uses plain milestones on stderr, and `--json` keeps stdout as one JSON document.
78
+
79
+ Before a paid task loads the local LLM or requests an order, Colony checks the selected wallet, payment coin and ETH network fee allowance using the current IMD price and live exchange quotes. If funds are insufficient, the dashboard shows the receiving address and network with **Check balance & continue**. The entered task is kept. This read-only check needs no wallet password; the final review includes the exact quote and any optional support. `--dry-run` remains available without a wallet. Startup tips explain natural-language tasks, automatic task settings, local inference and payment review.
76
80
 
77
81
  ## 安装
78
82
 
@@ -209,7 +213,7 @@ colony task create --file examples/research-job.json
209
213
 
210
214
  流程:
211
215
 
212
- 1. `POST /requests/check`,有 blocker 立即停止;
216
+ 1. 先以公开地址检查余额和 gas;自然语言输入随后由本地模型选择任务参数。`POST /requests/check` 有 blocker 立即停止;
213
217
  2. 生成并保存 `requestToken` 和 `requestKey`,再 `POST /requests/quote`;
214
218
  3. `POST /requests/:id/submit` 取得真实 402 challenge;
215
219
  4. 在 stderr 展示 network、金额、资产、收款方、有效期,以及**服务端 prepared input**;确认后才签名;
@@ -232,11 +236,11 @@ colony task continue <jobId> --file changes.json
232
236
 
233
237
  续作产生项目的下一版任务,使用 `job.continue`,也需要支付。指定的任务必须是项目最新版本,满足服务端续作条件;CLI 不会自动换成另一个版本。付费前检查原项目所有者与当前钱包是否一致。旧版本、运行中或尚未交付等问题会在检查阶段给出原因。
234
238
 
235
- 金额、资产、收款方、网络只取自真实 quote/challenge;不会硬编码。Permit2 deadline 会被收紧到 quote 过期时间之前;quote 太接近过期时明确失败,不自动重新报价。
239
+ 金额、资产、收款方、网络只取自真实 quote/challenge;不会硬编码。Permit2 deadline 会被收紧到 quote 过期时间之前;未付款 quote 过期或接近过期时,继续原任务会获取新报价,付款前重新确认。
236
240
 
237
241
  ### 恢复订单
238
242
 
239
- 网络错误后不要重新签 payment,也不要新建订单:
243
+ 充值或网络错误后,继续已保存的任务:
240
244
 
241
245
  ```sh
242
246
  colony order list
@@ -251,7 +255,7 @@ colony order delete <orderId 或 requestKey> # 永久删除已取消
251
255
 
252
256
  `order cancel` 和 `order delete` 都默认要求确认,脚本可显式传 `--yes`。取消不调用服务端取消接口,也不承诺退款;它仅适用于从未签名、提交的本地请求。已签名或已发布的订单保留恢复信息,不能用本地删除冒充停止执行。取消标记与服务端状态分开保存,刷新服务端状态不会使请求重新变为可付款。
253
257
 
254
- `order submit` 会重发保存的同一份 `PAYMENT-SIGNATURE` 和 `quoteSignature`。如果 quote 响应丢失(本地还没有 orderId),用错误提示中的同一 `requestKey` 重试:
258
+ `order submit` 可继续未付款任务并刷新报价、兑换价格和 gas;恢复时先核对已保存交易。新报价在同一个本地任务中保存历史,用户无需重新描述需求。已确认的兑换、授权和支持付款不会重复执行。如果 quote 响应丢失(本地还没有 orderId),也可用错误提示中的同一 `requestKey` 重试:
255
259
 
256
260
  ```sh
257
261
  colony task publish --file examples/research-job.json --request-key <requestKey>
@@ -261,7 +265,9 @@ colony task continue <jobId> --request-key <requestKey>
261
265
 
262
266
  `create` / `continue` 只传 `--request-key` 时会使用已保存的输入,不需要重新填写需求;指定其他输入时仍核对其与原订单是否一致。
263
267
 
264
- 所有阶段错误都会给出已保存的 `requestKey`、`--home` 和 `--api` 恢复命令。只有**尚未签名**且明确 `quote_expired` 时才建议新订单;已经签过 payment 的 410 会先查询原订单状态,不会建议重新付款或新建订单。
268
+ 创建本地记录后的错误会给出已保存的 `requestKey`、`--home` 和 `--api` 恢复命令。已签名支付过期时先查原订单,再根据 finalized 链状态核对支付:Ethereum 检查 Permit2 deadline 和 nonce,Robinhood 检查合约到期和交易回执。只有确认旧支付未扣款且已无法再生效,才允许重新报价和确认;仍可能有效或已经扣款的支付只恢复原记录。
269
+
270
+ 支付进度分别显示授权、换币、支持费转账、任务付款与 IMD 接收。等待链上确认超时会保留任务和交易哈希,显示待确认而不是付款失败。在 My tasks 继续原任务即可检查进度;需要提高 gas 时先展示新网络费,再以相同 nonce、收款方、金额和内容更新交易,原交易与更新交易只可能执行一个。所有候选交易在广播前保存;恢复会核对每个哈希,避免原交易先确认时重复执行。Ethereum gas 参考最近五个区块的成交优先费,并为基础费波动留出余量。更新 gas 的确认不代表链上成交保证。
265
271
 
266
272
  如果服务端 `status=admitted` 但 `admission.result.kind=refused`,命令以非 0 退出,明确报告“已付费但任务被拒”,输出/保存拒绝原因和付款交易,不把它当作发布成功。用 `colony order show <id> --refresh` 查看。
267
273
 
@@ -1 +1 @@
1
- import{writeDiagnostic as _0x2bdc02}from'../lib/terminal-text.mjs';import{confirmAction as _0x574ddd,print as _0x41288f}from'../shared.mjs';function _0x281d(){const _0x3d45a6=['canCancel','job:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Local\x20record\x20deleted.','jobId','\x0aThis\x20removes\x20its\x20saved\x20details\x20permanently.','cancel\x20an\x20unsigned,\x20unsubmitted\x20request\x20locally;\x20no\x20wallet\x20or\x20network\x20needed','order\x20ended\x20with\x20status:\x20','amount','refresh','input','tx:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','submit\x20<id>','refusalProblems','unknown','server:\x20\x20\x20\x20\x20\x20','status\x20URL:\x20\x20','This\x20request\x20cannot\x20be\x20cancelled\x20locally.\x20Only\x20unsigned,\x20unsubmitted\x20requests\x20can\x20be\x20cancelled.','funding','hash','length','home','stringify','delete\x20the\x20local\x20record\x20of\x20a\x20cancelled\x20unsigned\x20request','created:\x20\x20\x20\x20\x20','payWith','job:\x20\x20\x20\x20','action:\x20\x20\x20\x20\x20\x20','result:\x20','createdAt','orderId','option','\x0aNo\x20payment\x20will\x20be\x20signed\x20or\x20submitted\x20by\x20this\x20request.','transactionHash','status:\x20\x20\x20\x20\x20\x20','tx:\x20\x20\x20\x20\x20','order:\x20\x20','conversion:\x20\x20','list\x20locally\x20saved\x20orders','read\x20GET\x20/requests/:id\x20with\x20the\x20saved\x20token\x20and\x20update\x20local\x20state','padEnd','Cancel\x20this\x20unsigned\x20request\x20first.\x20Signed\x20payment\x20recovery\x20records\x20cannot\x20be\x20deleted.','asset:\x20\x20\x20\x20\x20\x20\x20','show\x20local\x20order\x20state;\x20--refresh\x20also\x20reads\x20the\x20server','description','\x20--refresh','exitCode','\x20(locally;\x20no\x20payment\x20signed\x20or\x20submitted)','cancelledAt','resubmit\x20the\x20saved\x20payment\x20bytes\x20and\x20poll\x20the\x20order','command','kind','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','pay\x20to:\x20\x20\x20\x20\x20\x20','join','payTo','order\x20','action','optsWithGlobals','api','push','pay\x20with:\x20\x20\x20\x20','requestKey','inspect:\x20colony\x20order\x20show\x20','\x20\x20-\x20','objective','maximumDebit','order','network:\x20\x20\x20\x20\x20','Cancel\x20this\x20unpaid\x20request?\x0a','cancelled:\x20\x20\x20','lastError','Delete\x20this\x20cancelled\x20request\x20from\x20local\x20history?\x0a','statusUrl',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','delete\x20<id>','Request\x20cancelled\x20locally.\x20No\x20payment\x20was\x20signed\x20or\x20submitted.','canDelete','paymentStatus','max\x20debit:\x20\x20\x20','--refresh','detail','\x20tx\x20','order:\x20\x20\x20\x20\x20\x20\x20','resultUrl','updatedAt','not\x20started','admitted','json','payment:\x20','refused','code','status'];_0x281d=function(){return _0x3d45a6;};return _0x281d();}import{cancelOrder as _0x14b8cf,deleteOrder as _0x5a27ba,findOrder as _0x939340,listOrders as _0x2fa632,orderActions as _0x535f82,orderSummary as _0x161c5f}from'../lib/orders.mjs';import{refreshOrder as _0x4bd306,submitOrder as _0x279b02}from'../lib/publish.mjs';function w(_0x23a9ac){const _0x941254=_0x5800;if(_0x23a9ac[_0x941254(0x107)]===0x0)return'no\x20orders';const _0x2d72a7=['ORDER\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20STATUS\x20\x20\x20\x20\x20\x20\x20JOB\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ACTION'];for(const _0x12463b of _0x23a9ac)_0x2d72a7[_0x941254(0x12f)](String(_0x12463b[_0x941254(0x111)]??_0x12463b[_0x941254(0x131)])[_0x941254(0x11b)](0x24)+'\x20\x20'+String(_0x161c5f(_0x12463b)[_0x941254(0x14f)])[_0x941254(0x11b)](0xa)+'\x20\x20'+String(_0x12463b['jobId']??'')[_0x941254(0x11b)](0x24)+'\x20\x20'+_0x12463b['action']);return _0x2d72a7[_0x941254(0x129)]('\x0a');}function g(_0x48eeb9){const _0xa68975=_0x5800,_0x4fddec=_0x161c5f(_0x48eeb9),_0x46f294=['request\x20key:\x20'+_0x4fddec[_0xa68975(0x131)],_0xa68975(0x146)+(_0x4fddec[_0xa68975(0x111)]??''),_0xa68975(0x115)+_0x4fddec[_0xa68975(0x14f)],_0xa68975(0x102)+(_0x4fddec['remoteStatus']??''),_0xa68975(0x10e)+_0x4fddec['action'],_0xa68975(0x137)+_0x4fddec['paymentChain'],_0xa68975(0x130)+_0x4fddec[_0xa68975(0x10c)],_0xa68975(0x10b)+_0x4fddec[_0xa68975(0x110)],'updated:\x20\x20\x20\x20\x20'+_0x4fddec[_0xa68975(0x148)],'amount:\x20\x20\x20\x20\x20\x20'+(_0x4fddec[_0xa68975(0xfb)]??''),_0xa68975(0x11d)+(_0x4fddec['asset']??''),_0xa68975(0x128)+(_0x4fddec[_0xa68975(0x12a)]??''),'quote\x20ends:\x20\x20'+(_0x4fddec['quoteExpiresAt']?new Date(Number(_0x4fddec['quoteExpiresAt'])*0x3e8)['toISOString']():''),'signed:\x20\x20\x20\x20\x20\x20'+_0x4fddec['paymentSigned'],'payment:\x20\x20\x20\x20\x20'+(_0x4fddec[_0xa68975(0x141)]??''),_0xa68975(0xfe)+(_0x4fddec[_0xa68975(0x114)]??''),_0xa68975(0xf5)+(_0x4fddec[_0xa68975(0xf7)]??''),_0xa68975(0x103)+(_0x4fddec[_0xa68975(0x13c)]??''),'result\x20URL:\x20\x20'+(_0x4fddec['resultUrl']??'')];if(_0x4fddec[_0xa68975(0x13a)]&&_0x46f294['push']('last\x20error:\x20\x20'+_0x4fddec[_0xa68975(0x13a)]),_0x4fddec[_0xa68975(0x105)]){_0x46f294[_0xa68975(0x12f)](_0xa68975(0x118)+_0x4fddec[_0xa68975(0x105)]['amount'],_0xa68975(0x142)+_0x4fddec[_0xa68975(0x105)][_0xa68975(0x135)]);for(const _0xe96e3c of _0x4fddec[_0xa68975(0x105)]['steps'])_0x46f294[_0xa68975(0x12f)]('\x20\x20'+_0xe96e3c[_0xa68975(0x126)]+':\x20'+(_0xe96e3c[_0xa68975(0x14f)]??_0xa68975(0x149))+(_0xe96e3c[_0xa68975(0x106)]?'\x20'+_0xe96e3c[_0xa68975(0x106)]:''));}return _0x4fddec[_0xa68975(0x123)]&&_0x46f294[_0xa68975(0x12f)](_0xa68975(0x139)+_0x4fddec['cancelledAt']+_0xa68975(0x122)),_0x46f294[_0xa68975(0x129)]('\x0a');}function j(_0x473644){const _0x54ae17=_0x5800,_0x27220c=['status:\x20'+_0x473644[_0x54ae17(0x14f)],_0x54ae17(0x117)+_0x473644[_0x54ae17(0x111)]];return _0x473644[_0x54ae17(0xf7)]&&_0x27220c['push'](_0x54ae17(0x10d)+_0x473644[_0x54ae17(0xf7)]),_0x473644['statusUrl']&&_0x27220c[_0x54ae17(0x12f)]('status:\x20'+_0x473644[_0x54ae17(0x13c)]),_0x473644[_0x54ae17(0x147)]&&_0x27220c[_0x54ae17(0x12f)](_0x54ae17(0x10f)+_0x473644[_0x54ae17(0x147)]),_0x473644[_0x54ae17(0x114)]&&_0x27220c[_0x54ae17(0x12f)](_0x54ae17(0x116)+_0x473644[_0x54ae17(0x114)]),_0x27220c[_0x54ae17(0x129)]('\x0a');}function q(_0x2285b3){const _0x24171c=_0x5800,_0x108a99=[_0x24171c(0x12b)+_0x2285b3[_0x24171c(0x111)]+_0x24171c(0x127),_0x24171c(0x14c)+(_0x2285b3['paymentStatus']??_0x24171c(0x101))+(_0x2285b3[_0x24171c(0x114)]?_0x24171c(0x145)+_0x2285b3['transactionHash']:'')];for(const _0x314033 of _0x2285b3[_0x24171c(0x100)]??[])_0x108a99['push'](_0x24171c(0x133)+(_0x314033[_0x24171c(0x14e)]??_0x24171c(0x14d))+':\x20'+(_0x314033[_0x24171c(0x144)]??JSON[_0x24171c(0x109)](_0x314033)));return _0x108a99[_0x24171c(0x12f)](_0x24171c(0x132)+_0x2285b3[_0x24171c(0x111)]+_0x24171c(0x120)),_0x108a99[_0x24171c(0x129)]('\x0a')+'\x0a';}function _0x5800(_0x113a16,_0x281d4c){_0x113a16=_0x113a16-0xf4;const _0x580041=_0x281d();let _0x5b042f=_0x580041[_0x113a16];return _0x5b042f;}function O(_0xc2aef1){const _0x3afd7a=_0x5800,_0x3ece36=_0xc2aef1[_0x3afd7a(0x125)](_0x3afd7a(0x136))['description']('inspect,\x20recover\x20and\x20cancel\x20saved\x20orders');_0x3ece36[_0x3afd7a(0x125)]('list')[_0x3afd7a(0x11f)](_0x3afd7a(0x119))[_0x3afd7a(0x12c)](async(_0x43db22,_0x2aa564)=>{const _0x17088a=_0x3afd7a,_0x35faf6=_0x2aa564['optsWithGlobals'](),_0x4ce50a=await _0x2fa632(_0x35faf6[_0x17088a(0x108)]);_0x41288f(_0x35faf6[_0x17088a(0x14b)]?_0x4ce50a['map'](_0x161c5f):w(_0x4ce50a),_0x35faf6);}),_0x3ece36['command']('show\x20<id>')[_0x3afd7a(0x11f)](_0x3afd7a(0x11e))[_0x3afd7a(0x112)](_0x3afd7a(0x143),_0x3afd7a(0x11a))[_0x3afd7a(0x12c)](async(_0x5525f3,_0x2ce889,_0x610074)=>{const _0x2fd337=_0x3afd7a,_0x500471=_0x610074[_0x2fd337(0x12d)](),_0x475f4a=_0x500471[_0x2fd337(0xfc)]?await _0x4bd306({'home':_0x500471[_0x2fd337(0x108)],'id':_0x5525f3}):await _0x939340(_0x500471[_0x2fd337(0x108)],_0x5525f3);_0x41288f(_0x500471['json']?_0x161c5f(_0x475f4a):g(_0x475f4a),_0x500471);}),_0x3ece36[_0x3afd7a(0x125)]('cancel\x20<id>')[_0x3afd7a(0x11f)](_0x3afd7a(0xf9))[_0x3afd7a(0x12c)](async(_0xc426f,_0x599639,_0x5cb94b)=>{const _0x1dcd0c=_0x3afd7a,_0x8d5da6=_0x5cb94b[_0x1dcd0c(0x12d)](),_0x411a2c=await _0x939340(_0x8d5da6[_0x1dcd0c(0x108)],_0xc426f);if(!_0x535f82(_0x411a2c)[_0x1dcd0c(0xf4)])throw new Error(_0x1dcd0c(0x104));await _0x574ddd(_0x1dcd0c(0x138)+_0x411a2c['input']['objective']+_0x1dcd0c(0x113),_0x8d5da6);const _0x165cfe=await _0x14b8cf(_0x8d5da6['home'],_0xc426f);_0x41288f(_0x8d5da6[_0x1dcd0c(0x14b)]?_0x161c5f(_0x165cfe):_0x1dcd0c(0x13f),_0x8d5da6);}),_0x3ece36[_0x3afd7a(0x125)](_0x3afd7a(0x13e))[_0x3afd7a(0x11f)](_0x3afd7a(0x10a))[_0x3afd7a(0x12c)](async(_0x57c923,_0x48a5f8,_0x3df9a2)=>{const _0x329088=_0x3afd7a,_0x449664=_0x3df9a2[_0x329088(0x12d)](),_0x3f172e=await _0x939340(_0x449664[_0x329088(0x108)],_0x57c923);if(!_0x535f82(_0x3f172e)[_0x329088(0x140)])throw new Error(_0x329088(0x11c));await _0x574ddd(_0x329088(0x13b)+_0x3f172e[_0x329088(0xfd)][_0x329088(0x134)]+_0x329088(0xf8),_0x449664);const _0xfb7c80=await _0x5a27ba(_0x449664[_0x329088(0x108)],_0x57c923);_0x41288f(_0x449664[_0x329088(0x14b)]?{'deleted':!0x0,'requestKey':_0xfb7c80[_0x329088(0x131)],'orderId':_0xfb7c80['orderId']??null}:_0x329088(0xf6),_0x449664);}),_0x3ece36[_0x3afd7a(0x125)](_0x3afd7a(0xff))[_0x3afd7a(0x11f)](_0x3afd7a(0x124))[_0x3afd7a(0x12c)](async(_0x42ac4b,_0x1e5ac9,_0x4f87ac)=>{const _0x5c5e2c=_0x3afd7a,_0x35afc0=_0x4f87ac[_0x5c5e2c(0x12d)](),_0xee74af=await _0x279b02({..._0x35afc0,'api':_0x35afc0[_0x5c5e2c(0x12e)],'home':_0x35afc0['home'],'id':_0x42ac4b});if(_0xee74af[_0x5c5e2c(0x14f)]===_0x5c5e2c(0x14d)){_0x35afc0[_0x5c5e2c(0x14b)]?_0x41288f({..._0x161c5f(_0xee74af),'status':_0x5c5e2c(0x14d)},_0x35afc0):_0x2bdc02(q(_0xee74af)),process[_0x5c5e2c(0x121)]=0x1;return;}if(_0xee74af[_0x5c5e2c(0x14f)]!==_0x5c5e2c(0x14a))throw new Error(_0x5c5e2c(0xfa)+_0xee74af[_0x5c5e2c(0x14f)]+_0x5c5e2c(0x13d)+_0xee74af[_0x5c5e2c(0x111)]+_0x5c5e2c(0x120));_0x41288f(_0x35afc0[_0x5c5e2c(0x14b)]?_0x161c5f(_0xee74af):j(_0xee74af),_0x35afc0);});}export{O as registerOrderCommands};
1
+ import{writeDiagnostic as _0x53e055}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x494b3e}from'../lib/payment-progress.mjs';function _0x5575(){const _0xccc75a=['admitted','no\x20orders','transaction:\x20','transaction','quote\x20ends:\x20\x20','refused','updatedAt','code','detail','payment:\x20\x20\x20\x20\x20','unknown','status:\x20','order\x20','padEnd','lastError','canCancel','updated:\x20\x20\x20\x20\x20','order\x20ended\x20with\x20status:\x20','exitCode','json','server:\x20\x20\x20\x20\x20\x20','request\x20key:\x20','inspect,\x20recover\x20and\x20cancel\x20saved\x20orders','action','pending\x20tx:\x20\x20','job:\x20\x20\x20\x20\x20\x20\x20\x20\x20','steps','submit\x20<id>','kind','Cancel\x20this\x20unpaid\x20request?\x0a','remoteStatus','api','delete\x20the\x20local\x20record\x20of\x20a\x20cancelled\x20unsigned\x20request','Local\x20record\x20deleted.','\x20tx\x20','cancelledAt','stringify','\x0aNo\x20payment\x20will\x20be\x20signed\x20or\x20submitted\x20by\x20this\x20request.','pay\x20with:\x20\x20\x20\x20','amount','Delete\x20this\x20cancelled\x20request\x20from\x20local\x20history?\x0a','payTo','not\x20started','action:\x20\x20\x20\x20\x20\x20','pendingTransaction','pay\x20to:\x20\x20\x20\x20\x20\x20','length','jobId','Request\x20cancelled\x20locally.\x20No\x20payment\x20was\x20signed\x20or\x20submitted.','transactionHash','hash','tx:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','refresh','\x20\x20-\x20','\x20(locally;\x20no\x20payment\x20signed\x20or\x20submitted)','payment_reconciling','Payment\x20needs\x20review.','continue\x20a\x20saved\x20task,\x20refreshing\x20unpaid\x20quotes\x20when\x20needed','resultUrl','max\x20debit:\x20\x20\x20','explorerUrl','transaction_pending','orderId','\x0aThis\x20removes\x20its\x20saved\x20details\x20permanently.','description','input','show\x20<id>','cancel\x20<id>','ORDER\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20STATUS\x20\x20\x20\x20\x20\x20\x20JOB\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ACTION','payment_failed','This\x20request\x20cannot\x20be\x20cancelled\x20locally.\x20Only\x20unsigned,\x20unsubmitted\x20requests\x20can\x20be\x20cancelled.','push','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','order:\x20\x20','cancelled:\x20\x20\x20','expired','includes','signed:\x20\x20\x20\x20\x20\x20','result\x20URL:\x20\x20','canDelete','result:\x20','amount:\x20\x20\x20\x20\x20\x20','home','asset:\x20\x20\x20\x20\x20\x20\x20','delete\x20<id>','paymentChain','funding','network:\x20\x20\x20\x20\x20','reason','Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.','optsWithGlobals','command','quoteExpiresAt','toISOString','\x20--refresh','join','order:\x20\x20\x20\x20\x20\x20\x20','status:\x20\x20\x20\x20\x20\x20','requestKey','payment:\x20','status','pending\x20why:\x20','paymentStatus','tx:\x20\x20\x20\x20\x20','cancel\x20an\x20unsigned,\x20unsubmitted\x20request\x20locally;\x20no\x20wallet\x20or\x20network\x20needed','statusUrl','read\x20GET\x20/requests/:id\x20with\x20the\x20saved\x20token\x20and\x20update\x20local\x20state','explorer:\x20\x20\x20\x20'];_0x5575=function(){return _0xccc75a;};return _0x5575();}function _0x27ef(_0x4f9c07,_0x5575cb){_0x4f9c07=_0x4f9c07-0x69;const _0x27ef65=_0x5575();let _0x2bf7e1=_0x27ef65[_0x4f9c07];return _0x2bf7e1;}import{confirmAction as _0x3ebf1a,print as _0x631228}from'../shared.mjs';import{cancelOrder as _0x3087e8,deleteOrder as _0x53b394,findOrder as _0x79d59f,listOrders as _0x23f8ee,orderActions as _0x45c401,orderSummary as _0xda14e4}from'../lib/orders.mjs';import{refreshOrder as _0x19d3ac,submitOrder as _0x5ad531}from'../lib/publish.mjs';function m(_0x21d559){const _0x5251bd=_0x27ef,_0x1bc4c1=_0x21d559[_0x5251bd(0x95)]??_0x21d559[_0x5251bd(0x6c)],_0x31d02d=[_0x5251bd(0xa1),_0x5251bd(0xc2)];return _0x1bc4c1?.[_0x5251bd(0x9b)]&&_0x31d02d[_0x5251bd(0xb0)](_0x5251bd(0x6b)+_0x1bc4c1[_0x5251bd(0x9b)]+(_0x1bc4c1['kind']?'\x20('+_0x1bc4c1[_0x5251bd(0x85)]+')':'')),_0x1bc4c1?.[_0x5251bd(0xc1)]&&_0x31d02d[_0x5251bd(0xb0)]('reason:\x20\x20\x20\x20\x20\x20'+_0x1bc4c1[_0x5251bd(0xc1)]),_0x1bc4c1?.[_0x5251bd(0xa5)]&&_0x31d02d['push'](_0x5251bd(0xd4)+_0x1bc4c1[_0x5251bd(0xa5)]),_0x21d559[_0x5251bd(0x9a)]&&_0x21d559[_0x5251bd(0x9a)]!==_0x1bc4c1?.[_0x5251bd(0x9b)]&&_0x31d02d[_0x5251bd(0xb0)]('transaction:\x20'+_0x21d559[_0x5251bd(0x9a)]),_0x21d559['orderId']&&_0x31d02d['push']('continue:\x20\x20\x20\x20colony\x20order\x20submit\x20'+_0x21d559[_0x5251bd(0xa7)]),_0x31d02d[_0x5251bd(0xc8)]('\x0a')+'\x0a';}function x(_0x5ad9ec){const _0x2d569b=_0x27ef;if(_0x5ad9ec[_0x2d569b(0x97)]===0x0)return _0x2d569b(0x6a);const _0x18b030=[_0x2d569b(0xad)];for(const _0x410e54 of _0x5ad9ec)_0x18b030['push'](String(_0x410e54[_0x2d569b(0xa7)]??_0x410e54[_0x2d569b(0xcb)])['padEnd'](0x24)+'\x20\x20'+String(_0xda14e4(_0x410e54)[_0x2d569b(0xcd)])[_0x2d569b(0x76)](0xa)+'\x20\x20'+String(_0x410e54[_0x2d569b(0x98)]??'')[_0x2d569b(0x76)](0x24)+'\x20\x20'+_0x410e54[_0x2d569b(0x80)]);return _0x18b030['join']('\x0a');}function j(_0x5ef7bd){const _0x4d3fe4=_0x27ef,_0x2c6bf9=_0xda14e4(_0x5ef7bd),_0x4b65fb=[_0x4d3fe4(0x7e)+_0x2c6bf9[_0x4d3fe4(0xcb)],_0x4d3fe4(0xc9)+(_0x2c6bf9['orderId']??''),_0x4d3fe4(0xca)+_0x2c6bf9[_0x4d3fe4(0xcd)],_0x4d3fe4(0x7d)+(_0x2c6bf9[_0x4d3fe4(0x87)]??''),_0x4d3fe4(0x94)+_0x2c6bf9[_0x4d3fe4(0x80)],_0x4d3fe4(0xc0)+_0x2c6bf9[_0x4d3fe4(0xbe)],_0x4d3fe4(0x8f)+_0x2c6bf9['payWith'],'created:\x20\x20\x20\x20\x20'+_0x2c6bf9['createdAt'],_0x4d3fe4(0x79)+_0x2c6bf9[_0x4d3fe4(0x6f)],_0x4d3fe4(0xba)+(_0x2c6bf9[_0x4d3fe4(0x90)]??''),_0x4d3fe4(0xbc)+(_0x2c6bf9['asset']??''),_0x4d3fe4(0x96)+(_0x2c6bf9[_0x4d3fe4(0x92)]??''),_0x4d3fe4(0x6d)+(_0x2c6bf9[_0x4d3fe4(0xc5)]?new Date(Number(_0x2c6bf9['quoteExpiresAt'])*0x3e8)[_0x4d3fe4(0xc6)]():''),_0x4d3fe4(0xb6)+_0x2c6bf9['paymentSigned'],_0x4d3fe4(0x72)+(_0x2c6bf9[_0x4d3fe4(0xcf)]??''),_0x4d3fe4(0x9c)+(_0x2c6bf9[_0x4d3fe4(0x9a)]??''),_0x4d3fe4(0x82)+(_0x2c6bf9[_0x4d3fe4(0x98)]??''),'status\x20URL:\x20\x20'+(_0x2c6bf9[_0x4d3fe4(0xd2)]??''),_0x4d3fe4(0xb7)+(_0x2c6bf9[_0x4d3fe4(0xa3)]??'')];_0x2c6bf9[_0x4d3fe4(0x77)]&&_0x4b65fb[_0x4d3fe4(0xb0)]('last\x20error:\x20\x20'+_0x2c6bf9[_0x4d3fe4(0x77)]);const _0x11cb7d=_0x5ef7bd[_0x4d3fe4(0x95)];if(_0x11cb7d?.[_0x4d3fe4(0x9b)]&&_0x4b65fb[_0x4d3fe4(0xb0)](_0x4d3fe4(0x81)+_0x11cb7d[_0x4d3fe4(0x9b)]+(_0x11cb7d[_0x4d3fe4(0x85)]?'\x20('+_0x11cb7d[_0x4d3fe4(0x85)]+')':'')),_0x11cb7d?.[_0x4d3fe4(0xc1)]&&_0x4b65fb[_0x4d3fe4(0xb0)](_0x4d3fe4(0xce)+_0x11cb7d['reason']),_0x11cb7d?.[_0x4d3fe4(0xa5)]&&_0x4b65fb[_0x4d3fe4(0xb0)]('explorer:\x20\x20\x20\x20'+_0x11cb7d[_0x4d3fe4(0xa5)]),_0x2c6bf9[_0x4d3fe4(0xbf)]){_0x4b65fb['push']('conversion:\x20\x20'+_0x2c6bf9[_0x4d3fe4(0xbf)][_0x4d3fe4(0x90)],_0x4d3fe4(0xa4)+_0x2c6bf9[_0x4d3fe4(0xbf)]['maximumDebit']);for(const _0x572942 of _0x2c6bf9[_0x4d3fe4(0xbf)][_0x4d3fe4(0x83)])_0x4b65fb[_0x4d3fe4(0xb0)]('\x20\x20'+_0x572942[_0x4d3fe4(0x85)]+':\x20'+(_0x572942[_0x4d3fe4(0xcd)]??_0x4d3fe4(0x93))+(_0x572942[_0x4d3fe4(0x9b)]?'\x20'+_0x572942[_0x4d3fe4(0x9b)]:''));}return _0x2c6bf9[_0x4d3fe4(0x8c)]&&_0x4b65fb['push'](_0x4d3fe4(0xb3)+_0x2c6bf9['cancelledAt']+_0x4d3fe4(0x9f)),_0x4b65fb[_0x4d3fe4(0xc8)]('\x0a');}function q(_0x2468ce){const _0x2a17ca=_0x27ef,_0x43e50d=[_0x2a17ca(0x74)+_0x2468ce[_0x2a17ca(0xcd)],_0x2a17ca(0xb2)+_0x2468ce[_0x2a17ca(0xa7)]];return _0x2468ce['jobId']&&_0x43e50d[_0x2a17ca(0xb0)]('job:\x20\x20\x20\x20'+_0x2468ce[_0x2a17ca(0x98)]),_0x2468ce['statusUrl']&&_0x43e50d['push'](_0x2a17ca(0x74)+_0x2468ce[_0x2a17ca(0xd2)]),_0x2468ce[_0x2a17ca(0xa3)]&&_0x43e50d[_0x2a17ca(0xb0)](_0x2a17ca(0xb9)+_0x2468ce[_0x2a17ca(0xa3)]),_0x2468ce['transactionHash']&&_0x43e50d[_0x2a17ca(0xb0)](_0x2a17ca(0xd0)+_0x2468ce['transactionHash']),_0x43e50d[_0x2a17ca(0xc8)]('\x0a');}function I(_0x5f4699){const _0x12153f=_0x27ef,_0x9566b9=[_0x12153f(0x75)+_0x5f4699[_0x12153f(0xa7)]+_0x12153f(0xb1),_0x12153f(0xcc)+(_0x5f4699[_0x12153f(0xcf)]??_0x12153f(0x73))+(_0x5f4699['transactionHash']?_0x12153f(0x8b)+_0x5f4699[_0x12153f(0x9a)]:'')];for(const _0x1611b1 of _0x5f4699['refusalProblems']??[])_0x9566b9[_0x12153f(0xb0)](_0x12153f(0x9e)+(_0x1611b1['code']??_0x12153f(0x6e))+':\x20'+(_0x1611b1[_0x12153f(0x71)]??JSON[_0x12153f(0x8d)](_0x1611b1)));return _0x9566b9[_0x12153f(0xb0)]('inspect:\x20colony\x20order\x20show\x20'+_0x5f4699[_0x12153f(0xa7)]+_0x12153f(0xc7)),_0x9566b9[_0x12153f(0xc8)]('\x0a')+'\x0a';}function k(_0x11afbc){const _0x14f7a0=_0x27ef,_0x44210f=_0x11afbc[_0x14f7a0(0xc4)]('order')['description'](_0x14f7a0(0x7f));_0x44210f['command']('list')['description']('list\x20locally\x20saved\x20orders')[_0x14f7a0(0x80)](async(_0x23a0b5,_0x337e6c)=>{const _0x3e2928=_0x14f7a0,_0x395c12=_0x337e6c['optsWithGlobals'](),_0x1d9bb0=await _0x23f8ee(_0x395c12[_0x3e2928(0xbb)]);_0x631228(_0x395c12[_0x3e2928(0x7c)]?_0x1d9bb0['map'](_0xda14e4):x(_0x1d9bb0),_0x395c12);}),_0x44210f[_0x14f7a0(0xc4)](_0x14f7a0(0xab))[_0x14f7a0(0xa9)]('show\x20local\x20order\x20state;\x20--refresh\x20also\x20reads\x20the\x20server')['option']('--refresh',_0x14f7a0(0xd3))[_0x14f7a0(0x80)](async(_0x1d9e78,_0x41c1b4,_0x1ea58)=>{const _0x1d936f=_0x14f7a0,_0x49389a=_0x1ea58[_0x1d936f(0xc3)](),_0x87aa98=_0x49389a[_0x1d936f(0x9d)]?await _0x19d3ac({'home':_0x49389a[_0x1d936f(0xbb)],'id':_0x1d9e78}):await _0x79d59f(_0x49389a[_0x1d936f(0xbb)],_0x1d9e78);_0x631228(_0x49389a[_0x1d936f(0x7c)]?_0xda14e4(_0x87aa98):j(_0x87aa98),_0x49389a);}),_0x44210f[_0x14f7a0(0xc4)](_0x14f7a0(0xac))[_0x14f7a0(0xa9)](_0x14f7a0(0xd1))[_0x14f7a0(0x80)](async(_0x7f3f15,_0x5940c8,_0x2ad99b)=>{const _0x40be7f=_0x14f7a0,_0x4104e4=_0x2ad99b['optsWithGlobals'](),_0x222012=await _0x79d59f(_0x4104e4[_0x40be7f(0xbb)],_0x7f3f15);if(!_0x45c401(_0x222012)[_0x40be7f(0x78)])throw new Error(_0x40be7f(0xaf));await _0x3ebf1a(_0x40be7f(0x86)+_0x222012[_0x40be7f(0xaa)]['objective']+_0x40be7f(0x8e),_0x4104e4);const _0x4b1317=await _0x3087e8(_0x4104e4['home'],_0x7f3f15);_0x631228(_0x4104e4[_0x40be7f(0x7c)]?_0xda14e4(_0x4b1317):_0x40be7f(0x99),_0x4104e4);}),_0x44210f[_0x14f7a0(0xc4)](_0x14f7a0(0xbd))['description'](_0x14f7a0(0x89))[_0x14f7a0(0x80)](async(_0x543c8c,_0x5db422,_0x3ea886)=>{const _0x5075d7=_0x14f7a0,_0x3f08e6=_0x3ea886[_0x5075d7(0xc3)](),_0x36a56a=await _0x79d59f(_0x3f08e6[_0x5075d7(0xbb)],_0x543c8c);if(!_0x45c401(_0x36a56a)[_0x5075d7(0xb8)])throw new Error('Cancel\x20this\x20unsigned\x20request\x20first.\x20Signed\x20payment\x20recovery\x20records\x20cannot\x20be\x20deleted.');await _0x3ebf1a(_0x5075d7(0x91)+_0x36a56a['input']['objective']+_0x5075d7(0xa8),_0x3f08e6);const _0x3508c1=await _0x53b394(_0x3f08e6[_0x5075d7(0xbb)],_0x543c8c);_0x631228(_0x3f08e6[_0x5075d7(0x7c)]?{'deleted':!0x0,'requestKey':_0x3508c1[_0x5075d7(0xcb)],'orderId':_0x3508c1['orderId']??null}:_0x5075d7(0x8a),_0x3f08e6);}),_0x44210f['command'](_0x14f7a0(0x84))['description'](_0x14f7a0(0xa2))['action'](async(_0x10af03,_0x2a4d5d,_0x228f19)=>{const _0x5efa5f=_0x14f7a0,_0x46106a=_0x228f19['optsWithGlobals']();let _0x3e263e;try{_0x3e263e=await _0x5ad531({..._0x46106a,'api':_0x46106a[_0x5efa5f(0x88)],'home':_0x46106a[_0x5efa5f(0xbb)],'id':_0x10af03,'onProgress':_0x494b3e(_0x46106a)});}catch(_0x243ebe){if(![_0x5efa5f(0xa6),_0x5efa5f(0xa0)][_0x5efa5f(0xb5)](_0x243ebe[_0x5efa5f(0x70)]))throw _0x243ebe;_0x46106a[_0x5efa5f(0x7c)]?_0x631228({'status':_0x243ebe[_0x5efa5f(0x70)],'transaction':_0x243ebe[_0x5efa5f(0x6c)]??null,'message':_0x243ebe['message']},_0x46106a):_0x53e055(m({'orderId':_0x10af03,'transaction':_0x243ebe[_0x5efa5f(0x6c)]},_0x243ebe[_0x5efa5f(0x70)])),process['exitCode']=0x1;return;}if(_0x3e263e[_0x5efa5f(0xcd)]===_0x5efa5f(0x6e)){_0x46106a['json']?_0x631228({..._0xda14e4(_0x3e263e),'status':_0x5efa5f(0x6e)},_0x46106a):_0x53e055(I(_0x3e263e)),process['exitCode']=0x1;return;}if([_0x5efa5f(0xb4),_0x5efa5f(0xae),_0x5efa5f(0xa6),'payment_reconciling'][_0x5efa5f(0xb5)](_0x3e263e[_0x5efa5f(0xcd)])){_0x46106a[_0x5efa5f(0x7c)]?_0x631228({..._0xda14e4(_0x3e263e),'status':_0x3e263e[_0x5efa5f(0xcd)]},_0x46106a):_0x53e055(m(_0x3e263e)),process[_0x5efa5f(0x7b)]=0x1;return;}if(_0x3e263e[_0x5efa5f(0xcd)]!==_0x5efa5f(0x69))throw new Error(_0x5efa5f(0x7a)+_0x3e263e[_0x5efa5f(0xcd)]+';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20'+_0x3e263e[_0x5efa5f(0xa7)]+_0x5efa5f(0xc7));_0x631228(_0x46106a['json']?_0xda14e4(_0x3e263e):q(_0x3e263e),_0x46106a);});}export{k as registerOrderCommands};
@@ -1 +1 @@
1
- function _0x4e8c(){const _0xd6a314=['s)\x0a','padEnd','destination\x20directory','stringify','\x20\x20\x20\x20url:\x20\x20','count','option','check:\x20\x20\x20\x20\x20','job\x20response\x20is\x20missing\x20id','resultUrl','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','action:\x20\x20\x20\x20','order:\x20\x20\x20\x20\x20','\x0aquestions:\x0a','\x20complete=','launch','continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for','title','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','job.open','objective\x20or\x20job\x20id\x20prefix','detail','map','jobs\x20that\x20moved\x20after\x20this\x20time','continue\x20<id>\x20[objective]','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','project','trim','template','page\x20size\x20(1-500)','type','\x20attempt=','hash','questions','complete:\x20\x20','orderId','wait:\x20','admitted','blockers','\x20has\x20no\x20saved\x20input','--request-key\x20<uuid>','createdAt','--skill\x20<id>','api','stdin','payment:\x20','toFixed','inspect:\x20colony\x20order\x20show\x20','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file','url','creation-time\x20cursor\x20(exclusive)','\x20versions=','named\x20input\x20preset\x20(report)','\x20was\x20created\x20for\x20action\x20','transactionHash','state','wait:\x20interrupted\x0a','<none>','\x20tx\x20','jobs','retries','interval','--preset\x20<name>','requestKey','unknown',';\x20retrying\x20in\x20','exitCode','workflow:\x20\x20','length','reviews','\x20job(s)','download:\x20','interrupted','bytes','deliverables','home','rpc','description','summary','job.continue','out','json','job\x20body\x20JSON\x20file','status','payWith','paymentStatus','\x20->\x20','complete\x20continuation\x20body\x20JSON\x20file','push','submissionHash','elapsedMs','challenge','tx:\x20\x20\x20\x20\x20\x20\x20\x20','order\x20','replace','refusalProblems','repo','delayMs','base\x20commit\x20for\x20--repo','plan','check:\x20','data','--before\x20<time>','\x20--refresh','--action\x20<action>','statusUrl','exclude\x20oracle\x20panel\x20jobs','public\x20GitHub\x20repository\x20URL','template:\x20\x20','source','\x20belongs\x20to\x20','files','colony\x20--api\x20','delivery','--file\x20<path>','answer\x20a\x20business\x20clarification\x20(repeatable)','workflow','state:\x20\x20\x20\x20\x20','parent','project:\x20\x20\x20','/jobs/','\x20--home\x20','ethereum','head','--path\x20<path>','refused','wait\x20<id>','save','download\x20<id>','quote','blocked',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','IMD','\x20head=','--exclude-oracle','parentJobId','string','timeout','limit','outcome','resultUrl:\x20','--timeout\x20<seconds>','input:',',\x20not\x20','excludeOracle','reuse\x20a\x20saved\x20order\x20request\x20key','--out\x20<dir>','job:\x20\x20\x20\x20\x20\x20\x20','optsWithGlobals','path','attempt','isArray','--since\x20<time>','statusUrl:\x20','message','action','\x20\x20\x20\x20hash:\x20','--answer\x20<text>','complete\x20job\x20body\x20JSON\x20file','versions','keyEnv','payTo','answer','saved','github','complete','completed','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','exclude','requiredOption','--dry-run','prepared\x20input:','s\x20(retry\x20','nodes','result\x20<id>','input','updatedAt','\x20bytes)','set','expiresAt','\x20\x20-\x20none','updated:\x20\x20\x20','poll','object','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','order\x20ended\x20with\x20status:\x20','saved\x20input:\x20','\x20\x20-\x20','paidBy','objective','plan:\x20','isTTY','jobs\x20response\x20is\x20missing\x20jobs','source:\x20\x20\x20\x20','before','dryRun','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','list','preset','yes','save\x20the\x20input\x20JSON\x20without\x20overwriting','runnable\x20skill\x20id','code','commit','browse\x20and\x20publish\x20IMD\x20tasks','oracle','\x20belongs\x20to\x20parent\x20job\x20','key','slice','delivery:\x20\x20','total\x20timeout\x20in\x20seconds','result','since','verdict','jobId','paid\x20by:\x20\x20\x20','objective:\x20','none','--commit\x20<sha>','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','paymentChain','file','toString','--save\x20<path>','parent:\x20\x20\x20\x20','\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a','--repo\x20<url>','command','check','blockers:\x20','skill','HTTP\x20','created:\x20\x20\x20','nodes:\x20\x20\x20\x20\x20','deliverables:','project\x20ready','join','launch:\x20\x20\x20\x20','result\x20response\x20is\x20missing\x20jobId','request\x20key\x20','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file'];_0x4e8c=function(){return _0xd6a314;};return _0x4e8c();}import{writeDiagnostic as _0x5b5425}from'../lib/terminal-text.mjs';import{request as _0x441870,print as _0xeb68e2}from'../shared.mjs';import{checkJob as _0x2e2f7e,publishJob as _0x15f3b4,readJobFile as _0x580a8f}from'../lib/publish.mjs';import{loadOrder as _0x1b8dc6}from'../lib/orders.mjs';import{buildContinueInput as _0x484cea,buildCreateInput as _0x627aec,parentSummary as _0x289c69,resolveAction as _0x534e8e,saveInputFile as _0x5695ff}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x15770c,DEFAULT_TIMEOUT_SECONDS as _0x4ccd1a,downloadTaskFiles as _0x2f0a1e,waitForResult as _0x437e0d}from'../lib/task-result.mjs';import{askQuestions as _0x1eecd5,loadLocalPlanner as _0x3b31e8,planTask as _0x4a7831}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x2fb2a0}from'./my-tasks.mjs';import{orderPayment as _0x4212c4}from'../lib/payments.mjs';function z(_0x18eeac){const _0x390792=_0x3f96,_0x3c9035=new URLSearchParams();if(_0x18eeac['q']!==void 0x0&&_0x3c9035[_0x390792(0x192)]('q',_0x18eeac['q']),_0x18eeac[_0x390792(0x1a2)]!==void 0x0&&_0x3c9035[_0x390792(0x192)](_0x390792(0x1a2),_0x18eeac[_0x390792(0x1a2)]),_0x18eeac[_0x390792(0x1b4)]!==void 0x0&&_0x3c9035[_0x390792(0x192)](_0x390792(0x1b4),_0x18eeac['since']),_0x18eeac[_0x390792(0x16a)]!==void 0x0){const _0x535424=Number(_0x18eeac[_0x390792(0x16a)]);if(!Number['isInteger'](_0x535424)||_0x535424<0x1||_0x535424>0x1f4)throw new Error(_0x390792(0x187));_0x3c9035['set']('limit',String(_0x535424));}_0x18eeac[_0x390792(0x170)]&&_0x3c9035[_0x390792(0x192)](_0x390792(0x188),_0x390792(0x1ad));const _0x3e53b0=_0x3c9035[_0x390792(0x1be)]();return _0x3e53b0?'/jobs?'+_0x3e53b0:'/jobs';}function y(_0x375490,_0x32be77=0x5a){const _0x9496dc=_0x3f96,_0x235ba9=String(_0x375490??'')[_0x9496dc(0x13e)](/\s+/g,'\x20')[_0x9496dc(0xfa)]();return _0x235ba9['length']>_0x32be77?_0x235ba9[_0x9496dc(0x1b0)](0x0,_0x32be77-0x1)+'…':_0x235ba9;}function V(_0x284ee1){const _0x2329a8=_0x3f96;if(!Array['isArray'](_0x284ee1?.[_0x2329a8(0x11b)]))throw new Error(_0x2329a8(0x1a0));const _0x639bf4=[_0x284ee1[_0x2329a8(0xe4)]+_0x2329a8(0x126)];for(const _0x5d2e1b of _0x284ee1[_0x2329a8(0x11b)])_0x639bf4['push'](_0x5d2e1b['id']+'\x20\x20'+_0x5d2e1b['state'][_0x2329a8(0xe0)](0xa)+'\x20\x20'+String(_0x5d2e1b[_0x2329a8(0xfb)]??'')[_0x2329a8(0xe0)](0x16)+'\x20\x20'+(_0x5d2e1b['updatedAt']??'')+'\x20\x20'+y(_0x5d2e1b[_0x2329a8(0x19d)]));return _0x639bf4[_0x2329a8(0x1cc)]('\x0a');}function Y(_0x391e5e){const _0x2bc6b6=_0x3f96;if(!_0x391e5e?.['id'])throw new Error(_0x2bc6b6(0xe7));const _0x5678b4=[_0x2bc6b6(0x173)+_0x391e5e['id'],_0x2bc6b6(0x155)+_0x391e5e['state'],_0x2bc6b6(0x14c)+(_0x391e5e[_0x2bc6b6(0xfb)]??''),_0x2bc6b6(0x1b8)+y(_0x391e5e['objective'],0x1f4),_0x2bc6b6(0x1c8)+(_0x391e5e[_0x2bc6b6(0x108)]??''),_0x2bc6b6(0x195)+(_0x391e5e[_0x2bc6b6(0x190)]??''),'paid\x20by:\x20\x20\x20'+(_0x391e5e[_0x2bc6b6(0x19c)]??''),_0x2bc6b6(0x157)+(_0x391e5e[_0x2bc6b6(0xf9)]?_0x391e5e['project']['id']+'\x20('+(_0x391e5e[_0x2bc6b6(0xf9)][_0x2bc6b6(0x17f)]?.[_0x2bc6b6(0x124)]??0x0)+'\x20version(s))':_0x2bc6b6(0x1b9)),_0x2bc6b6(0x1b1)+(_0x391e5e[_0x2bc6b6(0x151)]?JSON[_0x2bc6b6(0xe2)](_0x391e5e[_0x2bc6b6(0x151)]):_0x2bc6b6(0x1b9)),'launch:\x20\x20\x20\x20'+(_0x391e5e[_0x2bc6b6(0xee)]?JSON['stringify'](_0x391e5e[_0x2bc6b6(0xee)]):_0x2bc6b6(0x1b9))];if(Array[_0x2bc6b6(0x177)](_0x391e5e[_0x2bc6b6(0x18d)])){_0x5678b4[_0x2bc6b6(0x138)](_0x2bc6b6(0x1c9)+_0x391e5e['nodes'][_0x2bc6b6(0x124)]);for(const _0x2d266f of _0x391e5e[_0x2bc6b6(0x18d)])_0x5678b4[_0x2bc6b6(0x138)]('\x20\x20-\x20'+_0x2d266f[_0x2bc6b6(0x1af)]+':\x20'+_0x2d266f['state']+_0x2bc6b6(0xfe)+_0x2d266f[_0x2bc6b6(0x176)]+'\x20verdict='+(_0x2d266f[_0x2bc6b6(0x1b5)]?.[_0x2bc6b6(0x133)]??_0x2bc6b6(0x1b9)));}return Array[_0x2bc6b6(0x177)](_0x391e5e[_0x2bc6b6(0x125)])&&_0x5678b4['push']('reviews:\x20\x20\x20'+_0x391e5e[_0x2bc6b6(0x125)][_0x2bc6b6(0x124)]),_0x391e5e[_0x2bc6b6(0x154)]?.['id']&&_0x5678b4['push']((_0x2bc6b6(0x123)+_0x391e5e[_0x2bc6b6(0x154)]['id']+'\x20'+(_0x391e5e[_0x2bc6b6(0x154)]['status']??''))[_0x2bc6b6(0xfa)]()),_0x5678b4[_0x2bc6b6(0x1cc)]('\x0a');}function C(_0x316ae4){const _0x4b9754=_0x3f96;if(!_0x316ae4?.[_0x4b9754(0x1b6)])throw new Error(_0x4b9754(0x1ce));const _0xfedc2a=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x316ae4['jobId'],'state:\x20\x20\x20\x20\x20'+_0x316ae4[_0x4b9754(0x117)],_0x4b9754(0x101)+_0x316ae4[_0x4b9754(0x185)]],_0x2d38ab=Array['isArray'](_0x316ae4[_0x4b9754(0x14f)])?_0x316ae4[_0x4b9754(0x14f)]:[];_0xfedc2a[_0x4b9754(0x138)]('files:\x20\x20\x20\x20\x20'+_0x2d38ab[_0x4b9754(0x124)]);for(const _0x282d0d of _0x2d38ab)_0xfedc2a['push']('\x20\x20-\x20'+_0x282d0d[_0x4b9754(0x175)]+'\x20('+_0x282d0d[_0x4b9754(0x129)]+'\x20bytes,\x20'+_0x282d0d['mediaType']+')'),_0xfedc2a['push']('\x20\x20\x20\x20hash:\x20'+_0x282d0d[_0x4b9754(0xff)]),_0xfedc2a[_0x4b9754(0x138)](_0x4b9754(0xe3)+_0x282d0d[_0x4b9754(0x111)]);const _0x15799d=Array[_0x4b9754(0x177)](_0x316ae4[_0x4b9754(0x14d)])?_0x316ae4[_0x4b9754(0x14d)]:[];_0xfedc2a[_0x4b9754(0x138)](_0x4b9754(0x1a1)+_0x15799d[_0x4b9754(0x124)]);for(const _0x5991ba of _0x15799d)_0xfedc2a[_0x4b9754(0x138)]('\x20\x20-\x20'+(_0x5991ba['node']??_0x5991ba[_0x4b9754(0x139)])+':\x20'+_0x5991ba['url']);return _0x316ae4[_0x4b9754(0x151)]&&_0xfedc2a[_0x4b9754(0x138)]('delivery:\x20\x20'+JSON['stringify'](_0x316ae4['delivery'])),_0x316ae4[_0x4b9754(0xee)]&&_0xfedc2a[_0x4b9754(0x138)](_0x4b9754(0x1cd)+JSON[_0x4b9754(0xe2)](_0x316ae4[_0x4b9754(0xee)])),_0xfedc2a['join']('\x0a');}function X(_0x445858){const _0x5e4cfe=_0x3f96,_0x4c5845=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x445858['jobId'],_0x5e4cfe(0x155)+_0x445858[_0x5e4cfe(0x117)],'files:\x20\x20\x20\x20\x20'+_0x445858[_0x5e4cfe(0x14f)][_0x5e4cfe(0x124)]];for(const _0x2e59ee of _0x445858[_0x5e4cfe(0x14f)])_0x4c5845['push']('\x20\x20-\x20'+_0x2e59ee['path']+_0x5e4cfe(0x136)+_0x2e59ee[_0x5e4cfe(0x1bd)]+'\x20('+_0x2e59ee[_0x5e4cfe(0x129)]+_0x5e4cfe(0x191)),_0x4c5845[_0x5e4cfe(0x138)](_0x5e4cfe(0x17c)+_0x2e59ee[_0x5e4cfe(0xff)]);return _0x4c5845[_0x5e4cfe(0x1cc)]('\x0a');}function v(_0x485fbf){const _0x3c5c7e=_0x3f96,_0x51c835=[_0x3c5c7e(0x1c5)+_0x485fbf[_0x3c5c7e(0x105)][_0x3c5c7e(0x124)]];for(const _0xb0f0e of _0x485fbf[_0x3c5c7e(0x105)])_0x51c835['push']('\x20\x20-\x20'+_0xb0f0e[_0x3c5c7e(0x1aa)]+':\x20'+_0xb0f0e['detail']);const _0x2cc3fd=Array[_0x3c5c7e(0x177)](_0x485fbf['plan'])?_0x485fbf[_0x3c5c7e(0x143)]:[];_0x51c835['push'](_0x3c5c7e(0x19e)+_0x2cc3fd['length']);for(const _0x2ff093 of _0x2cc3fd)_0x51c835[_0x3c5c7e(0x138)](_0x3c5c7e(0x19b)+(_0x2ff093[_0x3c5c7e(0xf0)]??_0x2ff093['short']??_0x2ff093[_0x3c5c7e(0x1c6)])+(_0x2ff093['skill']?'\x20('+_0x2ff093[_0x3c5c7e(0x1c6)]+')':''));return _0x51c835[_0x3c5c7e(0x1cc)]('\x0a');}function E(_0x3e875f){const _0x14d9d3=_0x3f96,_0x39f030=_0x3e875f[_0x14d9d3(0x161)]?_0x4212c4(_0x3e875f):null;return{'status':_0x3e875f[_0x14d9d3(0x133)],'action':_0x3e875f[_0x14d9d3(0x17b)],'requestKey':_0x3e875f[_0x14d9d3(0x11f)],'orderId':_0x3e875f['orderId'],'jobId':_0x3e875f[_0x14d9d3(0x1b6)]??null,'statusUrl':_0x3e875f[_0x14d9d3(0x149)]??null,'resultUrl':_0x3e875f[_0x14d9d3(0xe8)]??null,'transactionHash':_0x3e875f['transactionHash']??null,'problems':_0x3e875f[_0x14d9d3(0x13f)]??null,'parentJobId':_0x3e875f[_0x14d9d3(0x18f)]?.[_0x14d9d3(0x167)]??null,'parent':_0x3e875f[_0x14d9d3(0x156)]??null,'project':_0x3e875f[_0x14d9d3(0x1c4)]?.[_0x14d9d3(0xf9)]??null,'payer':_0x3e875f['payer']??null,'paymentChain':_0x3e875f[_0x14d9d3(0x1bc)]??_0x14d9d3(0x15a),'payWith':_0x3e875f[_0x14d9d3(0x134)]??_0x14d9d3(0x164),'prepared':_0x3e875f['challenge']?.['input']??null,'quote':_0x3e875f[_0x14d9d3(0x161)]?{'amount':_0x39f030['amount'],'asset':_0x39f030['asset'],'payTo':_0x39f030[_0x14d9d3(0x181)],'expiresAt':_0x3e875f[_0x14d9d3(0x161)][_0x14d9d3(0x193)]}:null};}function _0x3f96(_0x2fd783,_0x4e8c36){_0x2fd783=_0x2fd783-0xdf;const _0x3f9662=_0x4e8c();let _0x21a942=_0x3f9662[_0x2fd783];return _0x21a942;}function Z(_0xac10e5){const _0x51c021=_0x3f96,_0x3e4142=['status:\x20\x20\x20\x20'+_0xac10e5[_0x51c021(0x133)],'action:\x20\x20\x20\x20'+_0xac10e5[_0x51c021(0x17b)],_0x51c021(0xeb)+_0xac10e5[_0x51c021(0x102)],'job:\x20\x20\x20\x20\x20\x20\x20'+(_0xac10e5[_0x51c021(0x1b6)]??'')];if(_0xac10e5[_0x51c021(0x149)]&&_0x3e4142['push'](_0x51c021(0x179)+_0xac10e5[_0x51c021(0x149)]),_0xac10e5[_0x51c021(0xe8)]&&_0x3e4142[_0x51c021(0x138)](_0x51c021(0x16c)+_0xac10e5[_0x51c021(0xe8)]),_0xac10e5[_0x51c021(0x116)]&&_0x3e4142[_0x51c021(0x138)](_0x51c021(0x13c)+_0xac10e5[_0x51c021(0x116)]),_0xac10e5[_0x51c021(0x156)]&&(_0x3e4142['push'](_0x51c021(0x1c0)+_0xac10e5[_0x51c021(0x156)]['id']+'\x20('+(_0xac10e5[_0x51c021(0x156)][_0x51c021(0x117)]??_0x51c021(0x120))+')'),_0xac10e5[_0x51c021(0x156)]['project']&&_0x3e4142[_0x51c021(0x138)](_0x51c021(0x157)+_0xac10e5[_0x51c021(0x156)][_0x51c021(0xf9)]['id']+_0x51c021(0x165)+(_0xac10e5[_0x51c021(0x156)][_0x51c021(0xf9)][_0x51c021(0x15b)]??''))),_0xac10e5['check']?.[_0x51c021(0xf9)]){const _0x30cea9=_0xac10e5['check']['project'];_0x3e4142[_0x51c021(0x138)](_0x51c021(0xe6)+(_0x30cea9['summary']??_0x30cea9['id']??_0x51c021(0x1cb)));}return!_0xac10e5[_0x51c021(0x143)]&&_0xac10e5[_0x51c021(0x17b)]===_0x51c021(0x12f)&&_0xac10e5['challenge']?.['input']&&(_0x3e4142[_0x51c021(0x138)](_0x51c021(0x18b)),_0x3e4142[_0x51c021(0x138)](JSON[_0x51c021(0xe2)](_0xac10e5[_0x51c021(0x13b)][_0x51c021(0x18f)],null,0x2))),_0x3e4142[_0x51c021(0x1cc)]('\x0a');}function q(_0x570f70,_0x3e9e61){const _0xff169f=_0x3f96;if(_0x570f70[_0xff169f(0x133)]===_0xff169f(0x162)){_0x3e9e61[_0xff169f(0x131)]?_0xeb68e2({'status':_0xff169f(0x162),'action':_0x570f70['state']['action'],'requestKey':_0x570f70[_0xff169f(0x117)][_0xff169f(0x11f)],'parent':_0x570f70[_0xff169f(0x117)]['parent']??null,'check':_0x570f70['check']},_0x3e9e61):(_0x570f70['state'][_0xff169f(0x156)]&&_0x5b5425(S(_0x570f70['state'][_0xff169f(0x156)])+'\x0a'),_0x5b5425(v(_0x570f70[_0xff169f(0x1c4)])+_0xff169f(0x1c1))),process[_0xff169f(0x122)]=0x1;return;}if(_0x570f70[_0xff169f(0x133)]===_0xff169f(0x15d)){const _0x54cdd7=E(_0x570f70[_0xff169f(0x117)]);if(_0x3e9e61[_0xff169f(0x131)])_0xeb68e2({..._0x54cdd7,'status':'refused'},_0x3e9e61);else{const _0x598185=[_0xff169f(0x13d)+_0x570f70[_0xff169f(0x117)]['orderId']+'\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.',_0xff169f(0x10c)+(_0x570f70['state'][_0xff169f(0x135)]??'unknown')+(_0x570f70[_0xff169f(0x117)]['transactionHash']?_0xff169f(0x11a)+_0x570f70[_0xff169f(0x117)][_0xff169f(0x116)]:'')];for(const _0x17bf31 of _0x570f70[_0xff169f(0x117)][_0xff169f(0x13f)]??[])_0x598185[_0xff169f(0x138)](_0xff169f(0x19b)+(_0x17bf31['code']??'refused')+':\x20'+(_0x17bf31[_0xff169f(0xf4)]??JSON[_0xff169f(0xe2)](_0x17bf31)));_0x598185[_0xff169f(0x138)](_0xff169f(0x10e)+_0x570f70[_0xff169f(0x117)][_0xff169f(0x102)]+'\x20--refresh'),_0x5b5425(_0x598185['join']('\x0a')+'\x0a');}process[_0xff169f(0x122)]=0x1;return;}if(_0x570f70['status']!==_0xff169f(0x104))throw new Error(_0xff169f(0x199)+_0x570f70[_0xff169f(0x133)]+_0xff169f(0x163)+_0x570f70[_0xff169f(0x117)][_0xff169f(0x102)]+_0xff169f(0x147));_0xeb68e2(_0x3e9e61['json']?E(_0x570f70[_0xff169f(0x117)]):Z(_0x570f70['state']),_0x3e9e61);}function S(_0x126085){const _0x22a133=_0x3f96,_0x157e81=_0x289c69(_0x126085),_0xfe4c3=[_0x22a133(0x1c0)+_0x157e81['id'],'state:\x20\x20\x20\x20\x20'+(_0x157e81['state']??''),_0x22a133(0x14c)+(_0x157e81[_0x22a133(0xfb)]??''),_0x22a133(0x1b8)+y(_0x157e81[_0x22a133(0x19d)],0x1f4),_0x22a133(0x1b7)+(_0x157e81[_0x22a133(0x19c)]??'')];return _0x157e81[_0x22a133(0xf9)]&&_0xfe4c3['push']('project:\x20\x20\x20'+_0x157e81['project']['id']+_0x22a133(0x165)+(_0x157e81[_0x22a133(0xf9)]['head']??'')+_0x22a133(0x113)+_0x157e81[_0x22a133(0xf9)][_0x22a133(0x17f)][_0x22a133(0x124)]),_0xfe4c3[_0x22a133(0x1cc)]('\x0a');}function ee(_0x1d503d){const _0xab6ea9=_0x3f96;return _0x1d503d?_0x1d503d[_0xab6ea9(0x12e)]?'project:\x20\x20\x20'+y(_0x1d503d['summary'],0x1f4):_0x1d503d['id']?'project:\x20\x20\x20'+_0x1d503d['id']:null:null;}function A(_0x53522a,_0x157d6a,_0x5dd10f,_0x32f379){const _0xbc3aba=_0x3f96,_0x1fce33=[];_0x32f379&&_0x1fce33[_0xbc3aba(0x138)](S(_0x32f379)),_0x1fce33['push'](_0xbc3aba(0xea)+_0x53522a),_0x1fce33[_0xbc3aba(0x138)](_0xbc3aba(0x16e)),_0x1fce33['push'](JSON['stringify'](_0x157d6a,null,0x2)),_0x1fce33[_0xbc3aba(0x138)](v(_0x5dd10f));const _0x75a446=ee(_0x5dd10f[_0xbc3aba(0xf9)]);return _0x75a446&&_0x1fce33[_0xbc3aba(0x138)](_0x75a446),_0x1fce33[_0xbc3aba(0x1cc)]('\x0a');}function T(_0x255dde){const _0x2bbeb8=_0x3f96;return _0x255dde[_0x2bbeb8(0x1bd)]!==void 0x0||_0x255dde[_0x2bbeb8(0x1a6)]!==void 0x0||_0x255dde[_0x2bbeb8(0x1c6)]!==void 0x0||_0x255dde[_0x2bbeb8(0xfb)]!==void 0x0||Array[_0x2bbeb8(0x177)](_0x255dde[_0x2bbeb8(0x175)])&&_0x255dde[_0x2bbeb8(0x175)][_0x2bbeb8(0x124)]>0x0;}function J(_0x5024bf){const _0x13d59f=_0x3f96;return _0x5024bf[_0x13d59f(0x1bd)]!==void 0x0||_0x5024bf[_0x13d59f(0x1c6)]!==void 0x0||_0x5024bf[_0x13d59f(0xfb)]!==void 0x0||Array['isArray'](_0x5024bf[_0x13d59f(0x175)])&&_0x5024bf[_0x13d59f(0x175)][_0x13d59f(0x124)]>0x0;}function te(_0x30993e,_0x2fc497){const _0x5bc351=_0x3f96;return typeof _0x30993e==_0x5bc351(0x168)&&_0x30993e[_0x5bc351(0xfa)]()!==''&&!T(_0x2fc497);}function ne(_0x204b31,_0x52a8a4){const _0x2852d2=_0x3f96;return typeof _0x204b31=='string'&&_0x204b31[_0x2852d2(0xfa)]()!==''&&!J(_0x52a8a4);}function b(_0x48ad45){const _0x1e88ed=_0x3f96,_0x1913e4=['summary:\x20'+_0x48ad45['summary'],_0x1e88ed(0x1ca)];_0x48ad45['deliverables'][_0x1e88ed(0x124)]===0x0&&_0x1913e4[_0x1e88ed(0x138)](_0x1e88ed(0x194));for(const _0x548566 of _0x48ad45[_0x1e88ed(0x12a)])_0x1913e4[_0x1e88ed(0x138)]('\x20\x20-\x20'+_0x548566);return _0x1913e4[_0x1e88ed(0x1cc)]('\x0a');}function O(_0x292d31,_0x24b56d){const _0x12221f=_0x3f96,_0x4b65d2=[b(_0x292d31),_0x12221f(0x144)+_0x24b56d[_0x12221f(0x105)][_0x12221f(0x124)]+'\x20blocker(s)'];for(const _0x10f72a of _0x24b56d['blockers'])_0x4b65d2[_0x12221f(0x138)](_0x12221f(0x19b)+_0x10f72a[_0x12221f(0x1aa)]+':\x20'+_0x10f72a[_0x12221f(0xf4)]);return _0x4b65d2[_0x12221f(0x1cc)]('\x0a');}function K(_0x9fe5f2,_0x178ec9,_0x95b406){const _0x121bd5=_0x3f96;if(_0x95b406[_0x121bd5(0x131)])_0xeb68e2({'action':_0x178ec9,'summary':_0x9fe5f2[_0x121bd5(0x12e)],'deliverables':_0x9fe5f2['deliverables'],'questions':_0x9fe5f2[_0x121bd5(0x100)],'input':null},_0x95b406);else{const _0x21f947=_0x9fe5f2['questions'][_0x121bd5(0xf5)](_0x1fc822=>_0x121bd5(0x19b)+_0x1fc822)['join']('\x0a');_0xeb68e2(b(_0x9fe5f2)+_0x121bd5(0xec)+_0x21f947,_0x95b406);}process['exitCode']=0x1;}function oe(_0x54b700){const _0x327a5=_0x3f96;return _0x54b700[_0x327a5(0x140)]===void 0x0&&_0x54b700['commit']===void 0x0?null:{'repoUrl':_0x54b700[_0x327a5(0x140)],'baseCommit':_0x54b700[_0x327a5(0x1ab)]};}async function N({api:_0x7724a0,home:_0x50fb86,objective:_0x2ffa90,answers:_0x120a4b,parent:_0x109108=null,source:_0x585fef=null,github:_0x3045d0=!0x1,opts:_0x219337,loadPlanner:_0x2f3546}){const _0x2d3ff4=_0x3f96;return _0x4a7831({'api':_0x7724a0,'home':_0x50fb86,'loadPlanner':_0x2f3546,'objective':_0x2ffa90,'answers':_0x120a4b,'parent':_0x109108,'source':_0x585fef,'github':_0x3045d0,'ask':!_0x219337[_0x2d3ff4(0x131)]&&process[_0x2d3ff4(0x10b)][_0x2d3ff4(0x19f)]?_0x1eecd5:null});}function U(_0x2e2d19,_0x1e8bb6,{api:_0xf88f2d,action:_0x29a7b4}){const _0x3318f1=_0x3f96;if(!_0x2e2d19)throw new Error('unknown\x20request\x20key:\x20'+_0x1e8bb6);if(_0x2e2d19[_0x3318f1(0x10a)]!==_0xf88f2d)throw new Error(_0x3318f1(0x13d)+_0x2e2d19[_0x3318f1(0x11f)]+_0x3318f1(0x14e)+_0x2e2d19[_0x3318f1(0x10a)]+';\x20rerun\x20with\x20--api\x20'+_0x2e2d19['api']);if(_0x2e2d19[_0x3318f1(0x17b)]!==_0x29a7b4)throw new Error(_0x3318f1(0x1cf)+_0x2e2d19[_0x3318f1(0x11f)]+_0x3318f1(0x115)+_0x2e2d19[_0x3318f1(0x17b)]+_0x3318f1(0x16f)+_0x29a7b4);if(!_0x2e2d19[_0x3318f1(0x18f)]||typeof _0x2e2d19[_0x3318f1(0x18f)]!=_0x3318f1(0x197)||Array[_0x3318f1(0x177)](_0x2e2d19['input']))throw new Error(_0x3318f1(0x1cf)+_0x2e2d19[_0x3318f1(0x11f)]+_0x3318f1(0x106));return _0x2e2d19[_0x3318f1(0x18f)];}function ie(_0x3c258d,_0x4ad94e){const _0x2d63c2=_0x3f96;return'colony\x20--api\x20'+_0x3c258d[_0x2d63c2(0x10a)]+_0x2d63c2(0x159)+_0x4ad94e[_0x2d63c2(0x12b)]+'\x20task\x20create\x20--request-key\x20'+_0x3c258d[_0x2d63c2(0x11f)];}function re(_0x1ad90c,_0x27807b){const _0x42b0f7=_0x3f96;return _0x42b0f7(0x150)+_0x1ad90c[_0x42b0f7(0x10a)]+_0x42b0f7(0x159)+_0x27807b[_0x42b0f7(0x12b)]+'\x20task\x20continue\x20'+_0x1ad90c[_0x42b0f7(0x18f)][_0x42b0f7(0x167)]+'\x20--request-key\x20'+_0x1ad90c[_0x42b0f7(0x11f)];}function me(_0x42bafa,{loadPlanner:_0x5d4939=_0x3b31e8}={}){const _0x1054a3=_0x3f96,_0x58a91c=_0x42bafa[_0x1054a3(0x1c3)]('task')[_0x1054a3(0x12d)](_0x1054a3(0x1ac));_0x2fb2a0(_0x58a91c),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x1a5))[_0x1054a3(0x12d)]('list\x20jobs')[_0x1054a3(0xe5)]('--q\x20<text>',_0x1054a3(0xf3))['option'](_0x1054a3(0x146),_0x1054a3(0x112))[_0x1054a3(0xe5)](_0x1054a3(0x178),_0x1054a3(0xf6))['option']('--limit\x20<n>',_0x1054a3(0xfc))[_0x1054a3(0xe5)](_0x1054a3(0x166),_0x1054a3(0x14a))[_0x1054a3(0x17b)](async(_0x101dde,_0x41bca4)=>{const _0x125693=_0x1054a3,_0x351b7d=_0x41bca4[_0x125693(0x174)](),_0x4b72ee=await _0x441870(_0x351b7d[_0x125693(0x10a)],z(_0x351b7d));_0xeb68e2(_0x351b7d[_0x125693(0x131)]?_0x4b72ee[_0x125693(0x145)]:V(_0x4b72ee[_0x125693(0x145)]),_0x351b7d);}),_0x58a91c['command']('show\x20<id>')['description']('show\x20one\x20job')[_0x1054a3(0x17b)](async(_0x10fdeb,_0xee5925,_0x5d8445)=>{const _0x596ef5=_0x1054a3,_0x171be0=_0x5d8445['optsWithGlobals'](),_0x164269=await _0x441870(_0x171be0['api'],_0x596ef5(0x158)+encodeURIComponent(_0x10fdeb));_0xeb68e2(_0x171be0[_0x596ef5(0x131)]?_0x164269[_0x596ef5(0x145)]:Y(_0x164269[_0x596ef5(0x145)]),_0x171be0);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x18e))[_0x1054a3(0x12d)]('show\x20a\x20job\x20result\x20and\x20artifact\x20URLs')[_0x1054a3(0x17b)](async(_0x36eefc,_0xe1819e,_0x41bd46)=>{const _0xf3a019=_0x1054a3,_0x209885=_0x41bd46['optsWithGlobals'](),_0xdecbd=await _0x441870(_0x209885[_0xf3a019(0x10a)],_0xf3a019(0x158)+encodeURIComponent(_0x36eefc)+'/result');_0xeb68e2(_0x209885['json']?_0xdecbd['data']:C(_0xdecbd[_0xf3a019(0x145)]),_0x209885);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x15e))[_0x1054a3(0x12d)](_0x1054a3(0xe9))['option']('--interval\x20<seconds>','poll\x20interval\x20in\x20seconds',String(_0x15770c))[_0x1054a3(0xe5)](_0x1054a3(0x16d),_0x1054a3(0x1b2),String(_0x4ccd1a))['action'](async(_0x211038,_0xe908de,_0x205555)=>{const _0x5316ba=_0x1054a3,_0x2ee235=_0x205555[_0x5316ba(0x174)](),_0x1a9a3e=await _0x437e0d({'api':_0x2ee235['api'],'id':_0x211038,'interval':_0x2ee235[_0x5316ba(0x11d)],'timeout':_0x2ee235[_0x5316ba(0x169)],'onProgress':_0x284a63=>{const _0x35ee81=_0x5316ba;_0x284a63['type']===_0x35ee81(0x196)?_0x5b5425('wait:\x20'+_0x284a63[_0x35ee81(0x117)]+_0x35ee81(0xed)+_0x284a63[_0x35ee81(0x185)]+'\x20(poll\x20'+_0x284a63[_0x35ee81(0x176)]+',\x20'+(_0x284a63[_0x35ee81(0x13a)]/0x3e8)[_0x35ee81(0x10d)](0x1)+_0x35ee81(0xdf)):_0x284a63[_0x35ee81(0xfd)]==='retry'&&_0x5b5425(_0x35ee81(0x103)+(_0x284a63['status']?_0x35ee81(0x1c7)+_0x284a63[_0x35ee81(0x133)]:'Network\x20error')+_0x35ee81(0x121)+(_0x284a63[_0x35ee81(0x141)]/0x3e8)[_0x35ee81(0x10d)](0x1)+_0x35ee81(0x18c)+_0x284a63[_0x35ee81(0x11c)]+')\x0a');}});if(_0x1a9a3e[_0x5316ba(0x16b)]===_0x5316ba(0x128)){_0x5b5425(_0x5316ba(0x118)),process[_0x5316ba(0x122)]=0x82;return;}_0x1a9a3e[_0x5316ba(0x1b3)]&&_0xeb68e2(_0x2ee235[_0x5316ba(0x131)]?_0x1a9a3e[_0x5316ba(0x1b3)]:C(_0x1a9a3e[_0x5316ba(0x1b3)]),_0x2ee235),_0x1a9a3e['outcome']!==_0x5316ba(0x186)&&(_0x5b5425(_0x5316ba(0x103)+_0x1a9a3e[_0x5316ba(0x17a)]+'\x0a'),process[_0x5316ba(0x122)]=0x1);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x160))[_0x1054a3(0x12d)](_0x1054a3(0x1a4))['requiredOption'](_0x1054a3(0x172),_0x1054a3(0xe1))['action'](async(_0x11b640,_0x58a3dd,_0x5067e3)=>{const _0xb7ed44=_0x1054a3,_0xb74804=_0x5067e3[_0xb7ed44(0x174)](),_0x2bf0c7=await _0x2f0a1e({'api':_0xb74804[_0xb7ed44(0x10a)],'id':_0x11b640,'out':_0xb74804[_0xb7ed44(0x130)],'onProgress':_0x576b6a=>{const _0xf36fdf=_0xb7ed44;_0x576b6a[_0xf36fdf(0xfd)]===_0xf36fdf(0x183)&&_0x5b5425(_0xf36fdf(0x127)+_0x576b6a[_0xf36fdf(0x175)]+_0xf36fdf(0x136)+_0x576b6a[_0xf36fdf(0x1bd)]+'\x0a');}});_0xeb68e2(_0xb74804[_0xb7ed44(0x131)]?_0x2bf0c7:X(_0x2bf0c7),_0xb74804);}),_0x58a91c[_0x1054a3(0x1c3)](_0x1054a3(0x1c4))[_0x1054a3(0x12d)](_0x1054a3(0xf8))['requiredOption']('--file\x20<path>',_0x1054a3(0x132))[_0x1054a3(0xe5)](_0x1054a3(0x148),_0x1054a3(0x10f))[_0x1054a3(0x17b)](async(_0x23debc,_0x2e40e1)=>{const _0x576c21=_0x1054a3,_0x223373=_0x2e40e1[_0x576c21(0x174)](),_0x2324fd=await _0x580a8f(_0x223373[_0x576c21(0x1bd)]),_0x1f1f4f=_0x223373[_0x576c21(0x17b)]??_0x534e8e(_0x2324fd),_0x3c8376=await _0x2e2f7e(_0x223373[_0x576c21(0x10a)],_0x2324fd,_0x1f1f4f);_0xeb68e2(_0x223373[_0x576c21(0x131)]?_0x3c8376:v(_0x3c8376),_0x223373);}),_0x58a91c[_0x1054a3(0x1c3)]('publish')[_0x1054a3(0x12d)](_0x1054a3(0x1d0))[_0x1054a3(0x189)](_0x1054a3(0x152),_0x1054a3(0x132))[_0x1054a3(0xe5)](_0x1054a3(0x107),'reuse\x20a\x20saved\x20order\x20request\x20key')['action'](async(_0x214e34,_0x66e2d6)=>{const _0x727fea=_0x1054a3,_0x13a629=_0x66e2d6['optsWithGlobals'](),_0x31a981=await _0x15f3b4({'api':_0x13a629[_0x727fea(0x10a)],'home':_0x13a629[_0x727fea(0x12b)],'file':_0x13a629[_0x727fea(0x1bd)],'action':_0x727fea(0xf2),'requestKey':_0x13a629[_0x727fea(0x11f)],'yes':_0x13a629['yes'],'keyEnv':_0x13a629[_0x727fea(0x180)],'rpc':_0x13a629['rpc'],'paymentChain':_0x13a629[_0x727fea(0x1bc)],'payWith':_0x13a629[_0x727fea(0x134)]});q(_0x31a981,_0x13a629);}),_0x58a91c[_0x1054a3(0x1c3)]('create\x20[objective]')[_0x1054a3(0x12d)](_0x1054a3(0x110))[_0x1054a3(0xe5)](_0x1054a3(0x152),_0x1054a3(0x17e))[_0x1054a3(0xe5)](_0x1054a3(0x11e),_0x1054a3(0x114))[_0x1054a3(0xe5)](_0x1054a3(0x109),_0x1054a3(0x1a9))[_0x1054a3(0xe5)]('--template\x20<name>','job\x20template')[_0x1054a3(0xe5)]('--path\x20<path>',_0x1054a3(0xf1),(_0x127525,_0x494a50)=>[..._0x494a50,_0x127525],[])[_0x1054a3(0xe5)](_0x1054a3(0x1c2),_0x1054a3(0x14b))[_0x1054a3(0xe5)](_0x1054a3(0x1ba),_0x1054a3(0x142))[_0x1054a3(0xe5)]('--github','publish\x20the\x20result\x20to\x20GitHub')[_0x1054a3(0xe5)](_0x1054a3(0x17d),_0x1054a3(0x153),(_0x34f264,_0x366ed6)=>[..._0x366ed6,_0x34f264],[])[_0x1054a3(0xe5)]('--dry-run',_0x1054a3(0x1bb))['option'](_0x1054a3(0x1bf),_0x1054a3(0x1a8))[_0x1054a3(0xe5)](_0x1054a3(0x107),_0x1054a3(0x171))[_0x1054a3(0x17b)](async(_0x3ee255,_0x1acada,_0x2443f5)=>{const _0x34abc1=_0x1054a3,_0x5359b5=_0x2443f5[_0x34abc1(0x174)](),_0x175358=te(_0x3ee255,_0x5359b5);let _0x3c592b,_0xb97236=null;if(_0x5359b5[_0x34abc1(0x11f)]&&!T(_0x5359b5)&&(_0x3ee255===void 0x0||_0x175358)){const _0x2954bb=await _0x1b8dc6(_0x5359b5['home'],_0x5359b5['requestKey']);if(_0x3c592b=U(_0x2954bb,_0x5359b5[_0x34abc1(0x11f)],{'api':_0x5359b5[_0x34abc1(0x10a)],'action':'job.open'}),_0x3ee255!==void 0x0&&_0x3ee255!==_0x3c592b[_0x34abc1(0x19d)])throw new Error(_0x34abc1(0x1cf)+_0x5359b5[_0x34abc1(0x11f)]+_0x34abc1(0x198));}else{if(_0x175358){if(_0xb97236=await N({'api':_0x5359b5[_0x34abc1(0x10a)],'home':_0x5359b5[_0x34abc1(0x12b)],'objective':_0x3ee255,'answers':_0x5359b5[_0x34abc1(0x182)],'source':oe(_0x5359b5),'github':_0x5359b5['github']===!0x0,'opts':_0x5359b5,'loadPlanner':_0x5d4939}),_0xb97236[_0x34abc1(0x18f)]===null){K(_0xb97236,_0x34abc1(0xf2),_0x5359b5);return;}_0x3c592b=_0xb97236[_0x34abc1(0x18f)];}else{const _0x33e7fb=_0x5359b5['file']?await _0x580a8f(_0x5359b5['file']):void 0x0;_0x3c592b=await _0x627aec({'fileInput':_0x33e7fb,'objective':_0x3ee255,'preset':_0x5359b5[_0x34abc1(0x1a6)],'skill':_0x5359b5['skill'],'template':_0x5359b5[_0x34abc1(0xfb)],'paths':_0x5359b5[_0x34abc1(0x175)],'repo':_0x5359b5['repo'],'commit':_0x5359b5[_0x34abc1(0x1ab)],'github':_0x5359b5[_0x34abc1(0x184)]});}}if(_0x5359b5['save']&&(await _0x5695ff(_0x5359b5[_0x34abc1(0x15f)],_0x3c592b),_0x5359b5[_0x34abc1(0x131)]||_0x5b5425(_0x34abc1(0x19a)+_0x5359b5['save']+'\x0a')),_0x5359b5[_0x34abc1(0x1a3)]){const _0xb10fe6=await _0x2e2f7e(_0x5359b5[_0x34abc1(0x10a)],_0x3c592b,_0x34abc1(0xf2));_0x5359b5['json']?_0xeb68e2({'action':_0x34abc1(0xf2),..._0xb97236?{'summary':_0xb97236[_0x34abc1(0x12e)],'deliverables':_0xb97236[_0x34abc1(0x12a)]}:{},'input':_0x3c592b,'check':_0xb10fe6},_0x5359b5):_0xeb68e2(_0xb97236?O(_0xb97236,_0xb10fe6):A('job.open',_0x3c592b,_0xb10fe6),_0x5359b5),_0xb10fe6[_0x34abc1(0x105)][_0x34abc1(0x124)]>0x0&&(process[_0x34abc1(0x122)]=0x1);return;}_0xb97236&&!_0x5359b5[_0x34abc1(0x131)]&&_0x5b5425(b(_0xb97236)+'\x0a');const _0x352b50=await _0x15f3b4({'api':_0x5359b5['api'],'home':_0x5359b5['home'],'input':_0x3c592b,'action':_0x34abc1(0xf2),'requestKey':_0x5359b5[_0x34abc1(0x11f)],'plan':_0xb97236?{'summary':_0xb97236[_0x34abc1(0x12e)],'deliverables':_0xb97236[_0x34abc1(0x12a)]}:void 0x0,'yes':_0x5359b5[_0x34abc1(0x1a7)],'keyEnv':_0x5359b5[_0x34abc1(0x180)],'rpc':_0x5359b5[_0x34abc1(0x12c)],'paymentChain':_0x5359b5[_0x34abc1(0x1bc)],'payWith':_0x5359b5[_0x34abc1(0x134)],'retryCommand':_0x2e8f06=>ie(_0x2e8f06,_0x5359b5)});q(_0x352b50,_0x5359b5);}),_0x58a91c['command'](_0x1054a3(0xf7))['description'](_0x1054a3(0xef))[_0x1054a3(0xe5)](_0x1054a3(0x152),_0x1054a3(0x137))[_0x1054a3(0xe5)](_0x1054a3(0x109),_0x1054a3(0x1a9))[_0x1054a3(0xe5)]('--template\x20<name>','job\x20template')[_0x1054a3(0xe5)](_0x1054a3(0x15c),'repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)',(_0x2a32c3,_0x38050e)=>[..._0x38050e,_0x2a32c3],[])['option'](_0x1054a3(0x17d),_0x1054a3(0x153),(_0x24f892,_0x3a850c)=>[..._0x3a850c,_0x24f892],[])[_0x1054a3(0xe5)](_0x1054a3(0x18a),_0x1054a3(0x1bb))[_0x1054a3(0xe5)]('--save\x20<path>',_0x1054a3(0x1a8))[_0x1054a3(0xe5)](_0x1054a3(0x107),_0x1054a3(0x171))[_0x1054a3(0x17b)](async(_0x33211e,_0x3897de,_0x3b2b67,_0xf97c59)=>{const _0x525abd=_0x1054a3,_0x4eaf39=_0xf97c59['optsWithGlobals'](),_0x416f71=ne(_0x3897de,_0x4eaf39);let _0xe1eaa7,_0x589820,_0xec5522=null;if(_0x4eaf39[_0x525abd(0x11f)]&&!J(_0x4eaf39)&&(_0x3897de===void 0x0||_0x416f71)){const _0x2b7a26=await _0x1b8dc6(_0x4eaf39['home'],_0x4eaf39[_0x525abd(0x11f)]);if(_0xe1eaa7=U(_0x2b7a26,_0x4eaf39['requestKey'],{'api':_0x4eaf39[_0x525abd(0x10a)],'action':_0x525abd(0x12f)}),_0xe1eaa7['parentJobId']!==_0x33211e)throw new Error(_0x525abd(0x1cf)+_0x4eaf39[_0x525abd(0x11f)]+_0x525abd(0x1ae)+(_0xe1eaa7[_0x525abd(0x167)]??_0x525abd(0x119))+_0x525abd(0x16f)+_0x33211e);if(_0x3897de!==void 0x0&&_0x3897de!==_0xe1eaa7[_0x525abd(0x19d)])throw new Error(_0x525abd(0x1cf)+_0x4eaf39['requestKey']+_0x525abd(0x198));_0x589820=(await _0x441870(_0x4eaf39[_0x525abd(0x10a)],_0x525abd(0x158)+encodeURIComponent(_0x33211e)))[_0x525abd(0x145)];}else{if(_0x416f71){if(_0x589820=(await _0x441870(_0x4eaf39[_0x525abd(0x10a)],_0x525abd(0x158)+encodeURIComponent(_0x33211e)))['data'],_0xec5522=await N({'api':_0x4eaf39[_0x525abd(0x10a)],'home':_0x4eaf39[_0x525abd(0x12b)],'objective':_0x3897de,'answers':_0x4eaf39['answer'],'parent':_0x589820,'opts':_0x4eaf39,'loadPlanner':_0x5d4939}),_0xec5522[_0x525abd(0x18f)]===null){K(_0xec5522,_0x525abd(0x12f),_0x4eaf39);return;}_0xe1eaa7=_0xec5522['input'],_0xe1eaa7[_0x525abd(0x167)]!==_0x33211e&&(_0xe1eaa7={..._0xe1eaa7,'parentJobId':_0x33211e});}else{const _0x2ae2d8=_0x4eaf39[_0x525abd(0x1bd)]?await _0x580a8f(_0x4eaf39[_0x525abd(0x1bd)]):void 0x0;_0xe1eaa7=await _0x484cea({'id':_0x33211e,'fileInput':_0x2ae2d8,'objective':_0x3897de,'skill':_0x4eaf39[_0x525abd(0x1c6)],'template':_0x4eaf39['template'],'paths':_0x4eaf39[_0x525abd(0x175)]}),_0x589820=(await _0x441870(_0x4eaf39[_0x525abd(0x10a)],'/jobs/'+encodeURIComponent(_0x33211e)))[_0x525abd(0x145)];}}if(_0x4eaf39[_0x525abd(0x15f)]&&(await _0x5695ff(_0x4eaf39['save'],_0xe1eaa7),_0x4eaf39[_0x525abd(0x131)]||_0x5b5425(_0x525abd(0x19a)+_0x4eaf39[_0x525abd(0x15f)]+'\x0a')),_0x4eaf39[_0x525abd(0x1a3)]){const _0x1ff3bd=await _0x2e2f7e(_0x4eaf39[_0x525abd(0x10a)],_0xe1eaa7,_0x525abd(0x12f));_0x4eaf39[_0x525abd(0x131)]?_0xeb68e2({'action':_0x525abd(0x12f),..._0xec5522?{'summary':_0xec5522[_0x525abd(0x12e)],'deliverables':_0xec5522[_0x525abd(0x12a)]}:{},'parent':_0x289c69(_0x589820),'input':_0xe1eaa7,'check':_0x1ff3bd},_0x4eaf39):_0xeb68e2(_0xec5522?O(_0xec5522,_0x1ff3bd):A(_0x525abd(0x12f),_0xe1eaa7,_0x1ff3bd,_0x589820),_0x4eaf39),_0x1ff3bd[_0x525abd(0x105)][_0x525abd(0x124)]>0x0&&(process[_0x525abd(0x122)]=0x1);return;}_0xec5522&&!_0x4eaf39[_0x525abd(0x131)]&&_0x5b5425(b(_0xec5522)+'\x0a');const _0x38b164=await _0x15f3b4({'api':_0x4eaf39['api'],'home':_0x4eaf39[_0x525abd(0x12b)],'input':_0xe1eaa7,'action':_0x525abd(0x12f),'requestKey':_0x4eaf39['requestKey'],'plan':_0xec5522?{'summary':_0xec5522[_0x525abd(0x12e)],'deliverables':_0xec5522['deliverables']}:void 0x0,'yes':_0x4eaf39[_0x525abd(0x1a7)],'keyEnv':_0x4eaf39['keyEnv'],'rpc':_0x4eaf39[_0x525abd(0x12c)],'paymentChain':_0x4eaf39['paymentChain'],'payWith':_0x4eaf39['payWith'],'retryCommand':_0x1d1ee3=>re(_0x1d1ee3,_0x4eaf39)});_0x38b164[_0x525abd(0x117)]&&(_0x38b164[_0x525abd(0x117)][_0x525abd(0x156)]=_0x289c69(_0x589820)),q(_0x38b164,_0x4eaf39);});}export{me as registerTaskCommands};
1
+ import{writeDiagnostic as _0x21ccbf}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x47f5e4}from'../lib/payment-progress.mjs';import{request as _0x25f307,print as _0x5afad3}from'../shared.mjs';function _0x358c(){const _0x5769d0=['\x20--refresh','length','option','retry','count','stringify','paidBy','files','source:\x20\x20\x20\x20','toFixed','saved\x20input:\x20','challenge','runnable\x20skill\x20id','--limit\x20<n>','input','updated:\x20\x20\x20','--exclude-oracle','--github','before','--commit\x20<sha>','statusUrl','github','skill','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','\x20tx\x20','Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.','s\x20(retry\x20','source','reuse\x20a\x20saved\x20order\x20request\x20key','explorerUrl','payment_failed','head','blocked','kind','browse\x20and\x20publish\x20IMD\x20tasks','requestKey','--before\x20<time>','transactionHash','\x20was\x20created\x20for\x20action\x20','\x20\x20\x20\x20hash:\x20','\x20versions=','optsWithGlobals','refusalProblems','deliverables','--path\x20<path>','trim','payTo','exclude','repo','complete:\x20\x20','show\x20<id>','prepared\x20input:','paid\x20by:\x20\x20\x20','excludeOracle','payWith','json','--file\x20<path>','result','--since\x20<time>','path','list\x20jobs','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','reviews','order\x20ended\x20with\x20status:\x20','\x20head=','string','mediaType','file','submissionHash','Payment\x20needs\x20review.','launch:\x20\x20\x20\x20','show\x20one\x20job','requiredOption','list','project:\x20\x20\x20','resultUrl','request\x20key\x20','status:\x20\x20\x20\x20','delivery','exitCode','home','stdin','create\x20[objective]','rpc','result\x20response\x20is\x20missing\x20jobId','jobs','--out\x20<dir>','jobs\x20response\x20is\x20missing\x20jobs','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','payer','asset','since','template:\x20\x20','paymentChain','attempt','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file','--action\x20<action>','\x20->\x20','hash','code','named\x20input\x20preset\x20(report)','node','save','reason','limit','parent:\x20\x20\x20\x20','summary','detail','base\x20commit\x20for\x20--repo','answer','isArray','interrupted','wait\x20<id>','\x20version(s))','\x20(poll\x20','updatedAt','commit','data','elapsedMs','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','join','url','order\x20','\x20verdict=','Network\x20error','description','yes','download:\x20','job\x20template','title','template','oracle','job:\x20\x20\x20\x20\x20\x20\x20','amount','short','complete','show\x20a\x20job\x20result\x20and\x20artifact\x20URLs','/jobs/','expired','versions','status','resultUrl:\x20','summary:\x20','check:\x20\x20\x20\x20\x20','poll\x20interval\x20in\x20seconds','completed','blockers:\x20','\x20belongs\x20to\x20parent\x20job\x20','project\x20ready','transaction','questions','job.open','outcome','payment:\x20','publish',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','\x20--home\x20','unknown','\x20blocker(s)','retries','result\x20<id>','check:\x20','toString','complete\x20continuation\x20body\x20JSON\x20file','/result','complete\x20job\x20body\x20JSON\x20file','input:','page\x20size\x20(1-500)','blockers','payment_reconciling','isTTY','keyEnv',',\x20not\x20','objective','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','padEnd','objective:\x20','wait:\x20','workflow','slice',';\x20retrying\x20in\x20','--template\x20<name>','--preset\x20<name>','ethereum','jobs\x20that\x20moved\x20after\x20this\x20time','delivery:\x20\x20','save\x20the\x20input\x20JSON\x20without\x20overwriting','action','--answer\x20<text>','quote','push','task','\x20task\x20continue\x20','api','command','verdict','exclude\x20oracle\x20panel\x20jobs','dryRun','--request-key\x20<uuid>','delayMs','s)\x0a','pendingTransaction','poll','none','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','check','\x0aquestions:\x0a','\x20\x20\x20\x20url:\x20\x20','saved','launch','\x20--request-key\x20','\x20\x20-\x20','--repo\x20<url>','set','\x20\x20-\x20none','interval','plan','wait:\x20interrupted\x0a','state','colony\x20--api\x20','destination\x20directory','refused','--save\x20<path>','isInteger','--dry-run','bytes','project','paymentStatus','statusUrl:\x20','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','nodes','type','transaction:\x20','parent','files:\x20\x20\x20\x20\x20','tx:\x20\x20\x20\x20\x20\x20\x20\x20','message','state:\x20\x20\x20\x20\x20','reviews:\x20\x20\x20','job\x20response\x20is\x20missing\x20id','parentJobId','job\x20body\x20JSON\x20file','expiresAt','orderId','job.continue','objective\x20or\x20job\x20id\x20prefix','--interval\x20<seconds>','preset','workflow:\x20\x20',';\x20rerun\x20with\x20--api\x20','jobId','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file'];_0x358c=function(){return _0x5769d0;};return _0x358c();}import{checkJob as _0x51329e,publishJob as _0xe17452,readJobFile as _0xf06f7d}from'../lib/publish.mjs';import{loadOrder as _0x5e9534}from'../lib/orders.mjs';import{buildContinueInput as _0x5bd41a,buildCreateInput as _0x191f76,parentSummary as _0x180a5a,resolveAction as _0x35cbad,saveInputFile as _0x17d4ce}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x531daf,DEFAULT_TIMEOUT_SECONDS as _0x293eeb,downloadTaskFiles as _0x500ece,waitForResult as _0xc012f9}from'../lib/task-result.mjs';import{askQuestions as _0x2a6a3f,loadLocalPlanner as _0x4d9a9e,planTask as _0x1f89a4}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x59d651}from'./my-tasks.mjs';import{orderPayment as _0x228938}from'../lib/payments.mjs';import{checkTaskWallet as _0x1e393c}from'../lib/task-wallet.mjs';function V(_0x31ad26){const _0x4b2f47=_0x9bc3,_0x1cfb09=new URLSearchParams();if(_0x31ad26['q']!==void 0x0&&_0x1cfb09['set']('q',_0x31ad26['q']),_0x31ad26[_0x4b2f47(0x1d2)]!==void 0x0&&_0x1cfb09[_0x4b2f47(0x296)](_0x4b2f47(0x1d2),_0x31ad26['before']),_0x31ad26['since']!==void 0x0&&_0x1cfb09[_0x4b2f47(0x296)]('since',_0x31ad26[_0x4b2f47(0x21b)]),_0x31ad26[_0x4b2f47(0x228)]!==void 0x0){const _0x184d18=Number(_0x31ad26[_0x4b2f47(0x228)]);if(!Number[_0x4b2f47(0x2a0)](_0x184d18)||_0x184d18<0x1||_0x184d18>0x1f4)throw new Error(_0x4b2f47(0x237));_0x1cfb09['set'](_0x4b2f47(0x228),String(_0x184d18));}_0x31ad26[_0x4b2f47(0x1f5)]&&_0x1cfb09[_0x4b2f47(0x296)](_0x4b2f47(0x1ef),_0x4b2f47(0x243));const _0x3c417b=_0x1cfb09[_0x4b2f47(0x262)]();return _0x3c417b?'/jobs?'+_0x3c417b:'/jobs';}function y(_0x4e23a1,_0x32dc0e=0x5a){const _0x20d833=_0x9bc3,_0x5999cd=String(_0x4e23a1??'')['replace'](/\s+/g,'\x20')[_0x20d833(0x1ed)]();return _0x5999cd[_0x20d833(0x1c1)]>_0x32dc0e?_0x5999cd[_0x20d833(0x273)](0x0,_0x32dc0e-0x1)+'…':_0x5999cd;}function X(_0x1b8860){const _0x5e63fe=_0x9bc3;if(!Array[_0x5e63fe(0x22e)](_0x1b8860?.['jobs']))throw new Error(_0x5e63fe(0x217));const _0x19b3f2=[_0x1b8860[_0x5e63fe(0x1c4)]+'\x20job(s)'];for(const _0x4e93fd of _0x1b8860[_0x5e63fe(0x215)])_0x19b3f2['push'](_0x4e93fd['id']+'\x20\x20'+_0x4e93fd[_0x5e63fe(0x29b)][_0x5e63fe(0x26f)](0xa)+'\x20\x20'+String(_0x4e93fd[_0x5e63fe(0x242)]??'')[_0x5e63fe(0x26f)](0x16)+'\x20\x20'+(_0x4e93fd[_0x5e63fe(0x233)]??'')+'\x20\x20'+y(_0x4e93fd[_0x5e63fe(0x26d)]));return _0x19b3f2[_0x5e63fe(0x238)]('\x0a');}function Z(_0xe08137){const _0x5026a4=_0x9bc3;if(!_0xe08137?.['id'])throw new Error(_0x5026a4(0x2b0));const _0x111a0f=['job:\x20\x20\x20\x20\x20\x20\x20'+_0xe08137['id'],_0x5026a4(0x2ae)+_0xe08137[_0x5026a4(0x29b)],_0x5026a4(0x21c)+(_0xe08137[_0x5026a4(0x242)]??''),_0x5026a4(0x270)+y(_0xe08137[_0x5026a4(0x26d)],0x1f4),'created:\x20\x20\x20'+(_0xe08137['createdAt']??''),_0x5026a4(0x1cf)+(_0xe08137[_0x5026a4(0x233)]??''),_0x5026a4(0x1f4)+(_0xe08137[_0x5026a4(0x1c6)]??''),_0x5026a4(0x20a)+(_0xe08137[_0x5026a4(0x2a3)]?_0xe08137[_0x5026a4(0x2a3)]['id']+'\x20('+(_0xe08137[_0x5026a4(0x2a3)][_0x5026a4(0x24b)]?.[_0x5026a4(0x1c1)]??0x0)+_0x5026a4(0x231):_0x5026a4(0x28b)),_0x5026a4(0x279)+(_0xe08137['delivery']?JSON[_0x5026a4(0x1c5)](_0xe08137[_0x5026a4(0x20e)]):_0x5026a4(0x28b)),_0x5026a4(0x206)+(_0xe08137[_0x5026a4(0x292)]?JSON[_0x5026a4(0x1c5)](_0xe08137[_0x5026a4(0x292)]):'none')];if(Array['isArray'](_0xe08137['nodes'])){_0x111a0f[_0x5026a4(0x27e)]('nodes:\x20\x20\x20\x20\x20'+_0xe08137['nodes'][_0x5026a4(0x1c1)]);for(const _0xac8d11 of _0xe08137[_0x5026a4(0x2a7)])_0x111a0f[_0x5026a4(0x27e)](_0x5026a4(0x294)+_0xac8d11['key']+':\x20'+_0xac8d11[_0x5026a4(0x29b)]+'\x20attempt='+_0xac8d11['attempt']+_0x5026a4(0x23b)+(_0xac8d11[_0x5026a4(0x283)]?.[_0x5026a4(0x24c)]??_0x5026a4(0x28b)));}return Array[_0x5026a4(0x22e)](_0xe08137[_0x5026a4(0x1fe)])&&_0x111a0f['push'](_0x5026a4(0x2af)+_0xe08137[_0x5026a4(0x1fe)][_0x5026a4(0x1c1)]),_0xe08137[_0x5026a4(0x272)]?.['id']&&_0x111a0f[_0x5026a4(0x27e)]((_0x5026a4(0x2b9)+_0xe08137['workflow']['id']+'\x20'+(_0xe08137[_0x5026a4(0x272)][_0x5026a4(0x24c)]??''))['trim']()),_0x111a0f['join']('\x0a');}function S(_0x5e8d3f){const _0x7f955a=_0x9bc3;if(!_0x5e8d3f?.[_0x7f955a(0x2bb)])throw new Error(_0x7f955a(0x214));const _0x5454f4=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x5e8d3f['jobId'],_0x7f955a(0x2ae)+_0x5e8d3f[_0x7f955a(0x29b)],_0x7f955a(0x1f1)+_0x5e8d3f['complete']],_0x2fe17c=Array[_0x7f955a(0x22e)](_0x5e8d3f[_0x7f955a(0x1c7)])?_0x5e8d3f[_0x7f955a(0x1c7)]:[];_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x2ab)+_0x2fe17c[_0x7f955a(0x1c1)]);for(const _0x55a9de of _0x2fe17c)_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x294)+_0x55a9de[_0x7f955a(0x1fb)]+'\x20('+_0x55a9de[_0x7f955a(0x2a2)]+'\x20bytes,\x20'+_0x55a9de[_0x7f955a(0x202)]+')'),_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x1e7)+_0x55a9de[_0x7f955a(0x222)]),_0x5454f4['push'](_0x7f955a(0x290)+_0x55a9de[_0x7f955a(0x239)]);const _0x1393e1=Array[_0x7f955a(0x22e)](_0x5e8d3f[_0x7f955a(0x1db)])?_0x5e8d3f[_0x7f955a(0x1db)]:[];_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x1c8)+_0x1393e1[_0x7f955a(0x1c1)]);for(const _0x5c46c8 of _0x1393e1)_0x5454f4['push']('\x20\x20-\x20'+(_0x5c46c8[_0x7f955a(0x225)]??_0x5c46c8[_0x7f955a(0x204)])+':\x20'+_0x5c46c8[_0x7f955a(0x239)]);return _0x5e8d3f[_0x7f955a(0x20e)]&&_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x279)+JSON['stringify'](_0x5e8d3f[_0x7f955a(0x20e)])),_0x5e8d3f['launch']&&_0x5454f4['push'](_0x7f955a(0x206)+JSON[_0x7f955a(0x1c5)](_0x5e8d3f[_0x7f955a(0x292)])),_0x5454f4[_0x7f955a(0x238)]('\x0a');}function ee(_0x1bc48f){const _0x12ac00=_0x9bc3,_0x156feb=[_0x12ac00(0x244)+_0x1bc48f['jobId'],_0x12ac00(0x2ae)+_0x1bc48f[_0x12ac00(0x29b)],_0x12ac00(0x2ab)+_0x1bc48f['files']['length']];for(const _0x466e7e of _0x1bc48f[_0x12ac00(0x1c7)])_0x156feb[_0x12ac00(0x27e)](_0x12ac00(0x294)+_0x466e7e[_0x12ac00(0x1fb)]+_0x12ac00(0x221)+_0x466e7e[_0x12ac00(0x203)]+'\x20('+_0x466e7e[_0x12ac00(0x2a2)]+'\x20bytes)'),_0x156feb[_0x12ac00(0x27e)](_0x12ac00(0x1e7)+_0x466e7e[_0x12ac00(0x222)]);return _0x156feb[_0x12ac00(0x238)]('\x0a');}function x(_0x380ca6){const _0x1d21f4=_0x9bc3,_0x1b8480=[_0x1d21f4(0x252)+_0x380ca6[_0x1d21f4(0x268)][_0x1d21f4(0x1c1)]];for(const _0x313fc7 of _0x380ca6[_0x1d21f4(0x268)])_0x1b8480[_0x1d21f4(0x27e)]('\x20\x20-\x20'+_0x313fc7['code']+':\x20'+_0x313fc7['detail']);const _0x2e64f7=Array['isArray'](_0x380ca6[_0x1d21f4(0x299)])?_0x380ca6[_0x1d21f4(0x299)]:[];_0x1b8480[_0x1d21f4(0x27e)]('plan:\x20'+_0x2e64f7['length']);for(const _0x17afd2 of _0x2e64f7)_0x1b8480[_0x1d21f4(0x27e)](_0x1d21f4(0x294)+(_0x17afd2[_0x1d21f4(0x241)]??_0x17afd2[_0x1d21f4(0x246)]??_0x17afd2['skill'])+(_0x17afd2[_0x1d21f4(0x1d6)]?'\x20('+_0x17afd2[_0x1d21f4(0x1d6)]+')':''));return _0x1b8480[_0x1d21f4(0x238)]('\x0a');}function I(_0x4c647a){const _0x2e0b41=_0x9bc3,_0x3ee11b=_0x4c647a[_0x2e0b41(0x27d)]?_0x228938(_0x4c647a):null;return{'status':_0x4c647a['status'],'action':_0x4c647a[_0x2e0b41(0x27b)],'requestKey':_0x4c647a['requestKey'],'orderId':_0x4c647a['orderId'],'jobId':_0x4c647a['jobId']??null,'statusUrl':_0x4c647a['statusUrl']??null,'resultUrl':_0x4c647a[_0x2e0b41(0x20b)]??null,'transactionHash':_0x4c647a['transactionHash']??null,'problems':_0x4c647a[_0x2e0b41(0x1ea)]??null,'parentJobId':_0x4c647a[_0x2e0b41(0x1ce)]?.[_0x2e0b41(0x2b1)]??null,'parent':_0x4c647a['parent']??null,'project':_0x4c647a[_0x2e0b41(0x28e)]?.[_0x2e0b41(0x2a3)]??null,'payer':_0x4c647a[_0x2e0b41(0x219)]??null,'paymentChain':_0x4c647a[_0x2e0b41(0x21d)]??_0x2e0b41(0x277),'payWith':_0x4c647a['payWith']??'IMD','prepared':_0x4c647a['challenge']?.[_0x2e0b41(0x1ce)]??null,'quote':_0x4c647a[_0x2e0b41(0x27d)]?{'amount':_0x3ee11b[_0x2e0b41(0x245)],'asset':_0x3ee11b[_0x2e0b41(0x21a)],'payTo':_0x3ee11b[_0x2e0b41(0x1ee)],'expiresAt':_0x4c647a[_0x2e0b41(0x27d)][_0x2e0b41(0x2b3)]}:null};}function te(_0x512f17){const _0x2dde33=_0x9bc3,_0x3937dd=[_0x2dde33(0x20d)+_0x512f17[_0x2dde33(0x24c)],'action:\x20\x20\x20\x20'+_0x512f17[_0x2dde33(0x27b)],'order:\x20\x20\x20\x20\x20'+_0x512f17[_0x2dde33(0x2b4)],_0x2dde33(0x244)+(_0x512f17['jobId']??'')];if(_0x512f17[_0x2dde33(0x1d4)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x2a5)+_0x512f17[_0x2dde33(0x1d4)]),_0x512f17[_0x2dde33(0x20b)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x24d)+_0x512f17[_0x2dde33(0x20b)]),_0x512f17[_0x2dde33(0x1e5)]&&_0x3937dd['push'](_0x2dde33(0x2ac)+_0x512f17[_0x2dde33(0x1e5)]),_0x512f17[_0x2dde33(0x2aa)]&&(_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x229)+_0x512f17[_0x2dde33(0x2aa)]['id']+'\x20('+(_0x512f17[_0x2dde33(0x2aa)]['state']??_0x2dde33(0x25d))+')'),_0x512f17['parent'][_0x2dde33(0x2a3)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x20a)+_0x512f17[_0x2dde33(0x2aa)][_0x2dde33(0x2a3)]['id']+_0x2dde33(0x200)+(_0x512f17['parent'][_0x2dde33(0x2a3)][_0x2dde33(0x1df)]??''))),_0x512f17[_0x2dde33(0x28e)]?.['project']){const _0x5f9a19=_0x512f17[_0x2dde33(0x28e)][_0x2dde33(0x2a3)];_0x3937dd['push'](_0x2dde33(0x24f)+(_0x5f9a19['summary']??_0x5f9a19['id']??_0x2dde33(0x254)));}return!_0x512f17['plan']&&_0x512f17[_0x2dde33(0x27b)]===_0x2dde33(0x2b5)&&_0x512f17[_0x2dde33(0x1cb)]?.[_0x2dde33(0x1ce)]&&(_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x1f3)),_0x3937dd[_0x2dde33(0x27e)](JSON['stringify'](_0x512f17[_0x2dde33(0x1cb)][_0x2dde33(0x1ce)],null,0x2))),_0x3937dd[_0x2dde33(0x238)]('\x0a');}function C(_0x5b7ef1,_0x144c0f){const _0x947461=_0x9bc3;if(_0x5b7ef1['status']===_0x947461(0x1e0)){_0x144c0f[_0x947461(0x1f7)]?_0x5afad3({'status':_0x947461(0x1e0),'action':_0x5b7ef1[_0x947461(0x29b)]['action'],'requestKey':_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e3)],'parent':_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)]??null,'check':_0x5b7ef1[_0x947461(0x28e)]},_0x144c0f):(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)]&&_0x21ccbf(A(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)])+'\x0a'),_0x21ccbf(x(_0x5b7ef1[_0x947461(0x28e)])+'\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a')),process[_0x947461(0x20f)]=0x1;return;}if(_0x5b7ef1[_0x947461(0x24c)]==='refused'){const _0x38663c=I(_0x5b7ef1[_0x947461(0x29b)]);if(_0x144c0f[_0x947461(0x1f7)])_0x5afad3({..._0x38663c,'status':_0x947461(0x29e)},_0x144c0f);else{const _0x3d120e=[_0x947461(0x23a)+_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2b4)]+'\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.',_0x947461(0x259)+(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2a4)]??'unknown')+(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e5)]?_0x947461(0x1d8)+_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e5)]:'')];for(const _0x192211 of _0x5b7ef1['state'][_0x947461(0x1ea)]??[])_0x3d120e[_0x947461(0x27e)](_0x947461(0x294)+(_0x192211[_0x947461(0x223)]??_0x947461(0x29e))+':\x20'+(_0x192211[_0x947461(0x22b)]??JSON[_0x947461(0x1c5)](_0x192211)));_0x3d120e[_0x947461(0x27e)]('inspect:\x20colony\x20order\x20show\x20'+_0x5b7ef1['state'][_0x947461(0x2b4)]+_0x947461(0x1c0)),_0x21ccbf(_0x3d120e[_0x947461(0x238)]('\x0a')+'\x0a');}process[_0x947461(0x20f)]=0x1;return;}if([_0x947461(0x24a),_0x947461(0x1de),'transaction_pending',_0x947461(0x269)]['includes'](_0x5b7ef1[_0x947461(0x24c)])){const _0x2eed46=_0x5b7ef1[_0x947461(0x29b)];if(_0x144c0f['json'])_0x5afad3({...I(_0x2eed46),'status':_0x5b7ef1['status']},_0x144c0f);else{const _0x5a357d=_0x2eed46[_0x947461(0x289)]??_0x2eed46[_0x947461(0x255)],_0x2dec83=[_0x947461(0x205),_0x947461(0x1d9)];_0x5a357d?.[_0x947461(0x222)]&&_0x2dec83[_0x947461(0x27e)](_0x947461(0x2a9)+_0x5a357d['hash']+(_0x5a357d[_0x947461(0x1e1)]?'\x20('+_0x5a357d['kind']+')':'')),_0x5a357d?.[_0x947461(0x227)]&&_0x2dec83[_0x947461(0x27e)]('reason:\x20\x20\x20\x20\x20\x20'+_0x5a357d[_0x947461(0x227)]),_0x5a357d?.['explorerUrl']&&_0x2dec83['push']('explorer:\x20\x20\x20\x20'+_0x5a357d[_0x947461(0x1dd)]),_0x2eed46[_0x947461(0x1e5)]&&_0x2eed46[_0x947461(0x1e5)]!==_0x5a357d?.['hash']&&_0x2dec83[_0x947461(0x27e)](_0x947461(0x2a9)+_0x2eed46[_0x947461(0x1e5)]),_0x2eed46[_0x947461(0x2b4)]&&_0x2dec83['push']('continue:\x20\x20\x20\x20colony\x20order\x20submit\x20'+_0x2eed46[_0x947461(0x2b4)]),_0x21ccbf(_0x2dec83['join']('\x0a')+'\x0a');}process[_0x947461(0x20f)]=0x1;return;}if(_0x5b7ef1[_0x947461(0x24c)]!=='admitted')throw new Error(_0x947461(0x1ff)+_0x5b7ef1['status']+_0x947461(0x25b)+_0x5b7ef1[_0x947461(0x29b)]['orderId']+_0x947461(0x1c0));_0x5afad3(_0x144c0f[_0x947461(0x1f7)]?I(_0x5b7ef1[_0x947461(0x29b)]):te(_0x5b7ef1[_0x947461(0x29b)]),_0x144c0f);}function A(_0x11c2ac){const _0x118cab=_0x9bc3,_0x12169a=_0x180a5a(_0x11c2ac),_0x3f6d4f=[_0x118cab(0x229)+_0x12169a['id'],_0x118cab(0x2ae)+(_0x12169a[_0x118cab(0x29b)]??''),'template:\x20\x20'+(_0x12169a[_0x118cab(0x242)]??''),_0x118cab(0x270)+y(_0x12169a[_0x118cab(0x26d)],0x1f4),_0x118cab(0x1f4)+(_0x12169a[_0x118cab(0x1c6)]??'')];return _0x12169a[_0x118cab(0x2a3)]&&_0x3f6d4f[_0x118cab(0x27e)](_0x118cab(0x20a)+_0x12169a[_0x118cab(0x2a3)]['id']+_0x118cab(0x200)+(_0x12169a[_0x118cab(0x2a3)][_0x118cab(0x1df)]??'')+_0x118cab(0x1e8)+_0x12169a[_0x118cab(0x2a3)][_0x118cab(0x24b)][_0x118cab(0x1c1)]),_0x3f6d4f['join']('\x0a');}function ne(_0x34bcd9){const _0x1e71dd=_0x9bc3;return _0x34bcd9?_0x34bcd9[_0x1e71dd(0x22a)]?'project:\x20\x20\x20'+y(_0x34bcd9['summary'],0x1f4):_0x34bcd9['id']?_0x1e71dd(0x20a)+_0x34bcd9['id']:null:null;}function K(_0x136c7a,_0x15d1d5,_0x5a14b8,_0x412225){const _0xbb5062=_0x9bc3,_0x4c9445=[];_0x412225&&_0x4c9445[_0xbb5062(0x27e)](A(_0x412225)),_0x4c9445[_0xbb5062(0x27e)]('action:\x20\x20\x20\x20'+_0x136c7a),_0x4c9445[_0xbb5062(0x27e)](_0xbb5062(0x266)),_0x4c9445[_0xbb5062(0x27e)](JSON[_0xbb5062(0x1c5)](_0x15d1d5,null,0x2)),_0x4c9445[_0xbb5062(0x27e)](x(_0x5a14b8));const _0x39a68e=ne(_0x5a14b8[_0xbb5062(0x2a3)]);return _0x39a68e&&_0x4c9445[_0xbb5062(0x27e)](_0x39a68e),_0x4c9445[_0xbb5062(0x238)]('\x0a');}function J(_0x54d622){const _0xa4ba9c=_0x9bc3;return _0x54d622[_0xa4ba9c(0x203)]!==void 0x0||_0x54d622[_0xa4ba9c(0x2b8)]!==void 0x0||_0x54d622[_0xa4ba9c(0x1d6)]!==void 0x0||_0x54d622[_0xa4ba9c(0x242)]!==void 0x0||Array['isArray'](_0x54d622[_0xa4ba9c(0x1fb)])&&_0x54d622[_0xa4ba9c(0x1fb)]['length']>0x0;}function O(_0xdf395){const _0x36e28c=_0x9bc3;return _0xdf395[_0x36e28c(0x203)]!==void 0x0||_0xdf395['skill']!==void 0x0||_0xdf395[_0x36e28c(0x242)]!==void 0x0||Array[_0x36e28c(0x22e)](_0xdf395[_0x36e28c(0x1fb)])&&_0xdf395[_0x36e28c(0x1fb)][_0x36e28c(0x1c1)]>0x0;}function oe(_0x14e624,_0x2c55f7){const _0x5e55a5=_0x9bc3;return typeof _0x14e624==_0x5e55a5(0x201)&&_0x14e624['trim']()!==''&&!J(_0x2c55f7);}function ie(_0x3bc16f,_0x1648c4){const _0x53a78e=_0x9bc3;return typeof _0x3bc16f==_0x53a78e(0x201)&&_0x3bc16f['trim']()!==''&&!O(_0x1648c4);}function b(_0x3467ee){const _0x4d5ec3=_0x9bc3,_0x3f4865=[_0x4d5ec3(0x24e)+_0x3467ee[_0x4d5ec3(0x22a)],'deliverables:'];_0x3467ee['deliverables'][_0x4d5ec3(0x1c1)]===0x0&&_0x3f4865['push'](_0x4d5ec3(0x297));for(const _0x3eb3b9 of _0x3467ee[_0x4d5ec3(0x1eb)])_0x3f4865[_0x4d5ec3(0x27e)](_0x4d5ec3(0x294)+_0x3eb3b9);return _0x3f4865[_0x4d5ec3(0x238)]('\x0a');}function U(_0x4abce8,_0x126245){const _0x4e3c0d=_0x9bc3,_0x27be26=[b(_0x4abce8),_0x4e3c0d(0x261)+_0x126245[_0x4e3c0d(0x268)][_0x4e3c0d(0x1c1)]+_0x4e3c0d(0x25e)];for(const _0x229107 of _0x126245['blockers'])_0x27be26[_0x4e3c0d(0x27e)](_0x4e3c0d(0x294)+_0x229107[_0x4e3c0d(0x223)]+':\x20'+_0x229107['detail']);return _0x27be26[_0x4e3c0d(0x238)]('\x0a');}function _0x9bc3(_0x587028,_0x358c72){_0x587028=_0x587028-0x1c0;const _0x9bc34=_0x358c();let _0x1ff695=_0x9bc34[_0x587028];return _0x1ff695;}function N(_0x28c01e,_0x48103c,_0x310612){const _0x447733=_0x9bc3;if(_0x310612[_0x447733(0x1f7)])_0x5afad3({'action':_0x48103c,'summary':_0x28c01e['summary'],'deliverables':_0x28c01e[_0x447733(0x1eb)],'questions':_0x28c01e['questions'],'input':null},_0x310612);else{const _0x30b3af=_0x28c01e[_0x447733(0x256)]['map'](_0x3e67da=>_0x447733(0x294)+_0x3e67da)[_0x447733(0x238)]('\x0a');_0x5afad3(b(_0x28c01e)+_0x447733(0x28f)+_0x30b3af,_0x310612);}process[_0x447733(0x20f)]=0x1;}function re(_0x1e1c9f){const _0x704d8c=_0x9bc3;return _0x1e1c9f['repo']===void 0x0&&_0x1e1c9f[_0x704d8c(0x234)]===void 0x0?null:{'repoUrl':_0x1e1c9f['repo'],'baseCommit':_0x1e1c9f[_0x704d8c(0x234)]};}async function R({api:_0x36a1ca,home:_0x12bd03,objective:_0x2e1268,answers:_0x338640,parent:_0x17953f=null,source:_0x3de999=null,github:_0x2ceb33=!0x1,opts:_0x2b0dab,loadPlanner:_0x15f3d7}){const _0x3876a0=_0x9bc3;return _0x1f89a4({'api':_0x36a1ca,'home':_0x12bd03,'loadPlanner':_0x15f3d7,'objective':_0x2e1268,'answers':_0x338640,'parent':_0x17953f,'source':_0x3de999,'github':_0x2ceb33,'ask':!_0x2b0dab[_0x3876a0(0x1f7)]&&process[_0x3876a0(0x211)][_0x3876a0(0x26a)]?_0x2a6a3f:null});}function W(_0x11cb91,_0x49e163,{api:_0x852fa0,action:_0x34e973}){const _0x5b40c9=_0x9bc3;if(!_0x11cb91)throw new Error('unknown\x20request\x20key:\x20'+_0x49e163);if(_0x11cb91[_0x5b40c9(0x281)]!==_0x852fa0)throw new Error(_0x5b40c9(0x23a)+_0x11cb91[_0x5b40c9(0x1e3)]+'\x20belongs\x20to\x20'+_0x11cb91['api']+_0x5b40c9(0x2ba)+_0x11cb91[_0x5b40c9(0x281)]);if(_0x11cb91[_0x5b40c9(0x27b)]!==_0x34e973)throw new Error('request\x20key\x20'+_0x11cb91['requestKey']+_0x5b40c9(0x1e6)+_0x11cb91[_0x5b40c9(0x27b)]+_0x5b40c9(0x26c)+_0x34e973);if(!_0x11cb91['input']||typeof _0x11cb91['input']!='object'||Array[_0x5b40c9(0x22e)](_0x11cb91[_0x5b40c9(0x1ce)]))throw new Error(_0x5b40c9(0x20c)+_0x11cb91[_0x5b40c9(0x1e3)]+'\x20has\x20no\x20saved\x20input');return _0x11cb91[_0x5b40c9(0x1ce)];}function se(_0x5635ac,_0x4bd220){const _0x3bafb5=_0x9bc3;return _0x3bafb5(0x29c)+_0x5635ac['api']+'\x20--home\x20'+_0x4bd220[_0x3bafb5(0x210)]+'\x20task\x20create\x20--request-key\x20'+_0x5635ac['requestKey'];}function ae(_0x246cbf,_0x4c9894){const _0x5e518a=_0x9bc3;return _0x5e518a(0x29c)+_0x246cbf[_0x5e518a(0x281)]+_0x5e518a(0x25c)+_0x4c9894[_0x5e518a(0x210)]+_0x5e518a(0x280)+_0x246cbf[_0x5e518a(0x1ce)][_0x5e518a(0x2b1)]+_0x5e518a(0x293)+_0x246cbf[_0x5e518a(0x1e3)];}function we(_0x3db825,{loadPlanner:_0x3ffaa9=_0x4d9a9e}={}){const _0x44034a=_0x9bc3,_0x1cc173=_0x3db825[_0x44034a(0x282)](_0x44034a(0x27f))[_0x44034a(0x23d)](_0x44034a(0x1e2));_0x59d651(_0x1cc173),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x209))[_0x44034a(0x23d)](_0x44034a(0x1fc))['option']('--q\x20<text>',_0x44034a(0x2b6))[_0x44034a(0x1c2)](_0x44034a(0x1e4),'creation-time\x20cursor\x20(exclusive)')['option'](_0x44034a(0x1fa),_0x44034a(0x278))['option'](_0x44034a(0x1cd),_0x44034a(0x267))[_0x44034a(0x1c2)](_0x44034a(0x1d0),_0x44034a(0x284))[_0x44034a(0x27b)](async(_0x513872,_0x55d61)=>{const _0x467edc=_0x44034a,_0x71d0fe=_0x55d61[_0x467edc(0x1e9)](),_0x25de7e=await _0x25f307(_0x71d0fe[_0x467edc(0x281)],V(_0x71d0fe));_0x5afad3(_0x71d0fe['json']?_0x25de7e['data']:X(_0x25de7e['data']),_0x71d0fe);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x1f2))[_0x44034a(0x23d)](_0x44034a(0x207))[_0x44034a(0x27b)](async(_0x3ad70e,_0x40604a,_0xf4bffb)=>{const _0x91f868=_0x44034a,_0xa71891=_0xf4bffb['optsWithGlobals'](),_0x5f2d67=await _0x25f307(_0xa71891[_0x91f868(0x281)],_0x91f868(0x249)+encodeURIComponent(_0x3ad70e));_0x5afad3(_0xa71891['json']?_0x5f2d67[_0x91f868(0x235)]:Z(_0x5f2d67['data']),_0xa71891);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x260))[_0x44034a(0x23d)](_0x44034a(0x248))['action'](async(_0xcbd006,_0x4c5e32,_0x7fb975)=>{const _0x57e1fd=_0x44034a,_0x2a8c17=_0x7fb975['optsWithGlobals'](),_0x47dab5=await _0x25f307(_0x2a8c17['api'],'/jobs/'+encodeURIComponent(_0xcbd006)+_0x57e1fd(0x264));_0x5afad3(_0x2a8c17[_0x57e1fd(0x1f7)]?_0x47dab5[_0x57e1fd(0x235)]:S(_0x47dab5['data']),_0x2a8c17);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x230))['description'](_0x44034a(0x28c))[_0x44034a(0x1c2)](_0x44034a(0x2b7),_0x44034a(0x250),String(_0x531daf))[_0x44034a(0x1c2)]('--timeout\x20<seconds>','total\x20timeout\x20in\x20seconds',String(_0x293eeb))[_0x44034a(0x27b)](async(_0x1da800,_0x1a5ac2,_0x2edc07)=>{const _0x625d34=_0x44034a,_0x282296=_0x2edc07[_0x625d34(0x1e9)](),_0x589094=await _0xc012f9({'api':_0x282296[_0x625d34(0x281)],'id':_0x1da800,'interval':_0x282296[_0x625d34(0x298)],'timeout':_0x282296['timeout'],'onProgress':_0x4b3a57=>{const _0x4955f4=_0x625d34;_0x4b3a57['type']===_0x4955f4(0x28a)?_0x21ccbf(_0x4955f4(0x271)+_0x4b3a57[_0x4955f4(0x29b)]+'\x20complete='+_0x4b3a57[_0x4955f4(0x247)]+_0x4955f4(0x232)+_0x4b3a57[_0x4955f4(0x21e)]+',\x20'+(_0x4b3a57[_0x4955f4(0x236)]/0x3e8)[_0x4955f4(0x1c9)](0x1)+_0x4955f4(0x288)):_0x4b3a57[_0x4955f4(0x2a8)]===_0x4955f4(0x1c3)&&_0x21ccbf(_0x4955f4(0x271)+(_0x4b3a57[_0x4955f4(0x24c)]?'HTTP\x20'+_0x4b3a57[_0x4955f4(0x24c)]:_0x4955f4(0x23c))+_0x4955f4(0x274)+(_0x4b3a57[_0x4955f4(0x287)]/0x3e8)['toFixed'](0x1)+_0x4955f4(0x1da)+_0x4b3a57[_0x4955f4(0x25f)]+')\x0a');}});if(_0x589094[_0x625d34(0x258)]===_0x625d34(0x22f)){_0x21ccbf(_0x625d34(0x29a)),process[_0x625d34(0x20f)]=0x82;return;}_0x589094[_0x625d34(0x1f9)]&&_0x5afad3(_0x282296[_0x625d34(0x1f7)]?_0x589094['result']:S(_0x589094[_0x625d34(0x1f9)]),_0x282296),_0x589094['outcome']!==_0x625d34(0x251)&&(_0x21ccbf(_0x625d34(0x271)+_0x589094[_0x625d34(0x2ad)]+'\x0a'),process[_0x625d34(0x20f)]=0x1);}),_0x1cc173[_0x44034a(0x282)]('download\x20<id>')[_0x44034a(0x23d)](_0x44034a(0x26e))['requiredOption'](_0x44034a(0x216),_0x44034a(0x29d))[_0x44034a(0x27b)](async(_0x5e6ff9,_0x29b04a,_0xddbeb6)=>{const _0x4cc94d=_0x44034a,_0x4dffc6=_0xddbeb6[_0x4cc94d(0x1e9)](),_0x44ef9c=await _0x500ece({'api':_0x4dffc6[_0x4cc94d(0x281)],'id':_0x5e6ff9,'out':_0x4dffc6['out'],'onProgress':_0x2359f9=>{const _0x31d9d0=_0x4cc94d;_0x2359f9['type']===_0x31d9d0(0x291)&&_0x21ccbf(_0x31d9d0(0x23f)+_0x2359f9['path']+_0x31d9d0(0x221)+_0x2359f9['file']+'\x0a');}});_0x5afad3(_0x4dffc6[_0x4cc94d(0x1f7)]?_0x44ef9c:ee(_0x44ef9c),_0x4dffc6);}),_0x1cc173['command'](_0x44034a(0x28e))[_0x44034a(0x23d)](_0x44034a(0x1fd))['requiredOption'](_0x44034a(0x1f8),_0x44034a(0x2b2))[_0x44034a(0x1c2)](_0x44034a(0x220),_0x44034a(0x218))[_0x44034a(0x27b)](async(_0x3cc2f5,_0x14bbe4)=>{const _0xded98e=_0x44034a,_0x3d9c44=_0x14bbe4[_0xded98e(0x1e9)](),_0x47a179=await _0xf06f7d(_0x3d9c44[_0xded98e(0x203)]),_0x2400af=_0x3d9c44[_0xded98e(0x27b)]??_0x35cbad(_0x47a179),_0x827386=await _0x51329e(_0x3d9c44['api'],_0x47a179,_0x2400af);_0x5afad3(_0x3d9c44['json']?_0x827386:x(_0x827386),_0x3d9c44);}),_0x1cc173['command'](_0x44034a(0x25a))[_0x44034a(0x23d)](_0x44034a(0x21f))[_0x44034a(0x208)]('--file\x20<path>',_0x44034a(0x2b2))[_0x44034a(0x1c2)](_0x44034a(0x286),_0x44034a(0x1dc))['action'](async(_0x494402,_0x2ff54a)=>{const _0x2455f8=_0x44034a,_0x35c40e=_0x2ff54a[_0x2455f8(0x1e9)]();_0x35c40e[_0x2455f8(0x1e3)]||await _0x1e393c({..._0x35c40e,'action':_0x2455f8(0x257)});const _0x486a33=await _0xe17452({'api':_0x35c40e[_0x2455f8(0x281)],'home':_0x35c40e['home'],'file':_0x35c40e['file'],'action':_0x2455f8(0x257),'requestKey':_0x35c40e[_0x2455f8(0x1e3)],'yes':_0x35c40e[_0x2455f8(0x23e)],'keyEnv':_0x35c40e['keyEnv'],'rpc':_0x35c40e[_0x2455f8(0x213)],'paymentChain':_0x35c40e['paymentChain'],'payWith':_0x35c40e[_0x2455f8(0x1f6)],'onProgress':_0x47f5e4(_0x35c40e)});C(_0x486a33,_0x35c40e);}),_0x1cc173['command'](_0x44034a(0x212))[_0x44034a(0x23d)](_0x44034a(0x2bc))[_0x44034a(0x1c2)](_0x44034a(0x1f8),_0x44034a(0x265))[_0x44034a(0x1c2)](_0x44034a(0x276),_0x44034a(0x224))[_0x44034a(0x1c2)]('--skill\x20<id>',_0x44034a(0x1cc))['option']('--template\x20<name>',_0x44034a(0x240))['option']('--path\x20<path>',_0x44034a(0x28d),(_0x2430bb,_0x412dc2)=>[..._0x412dc2,_0x2430bb],[])['option'](_0x44034a(0x295),'public\x20GitHub\x20repository\x20URL')['option'](_0x44034a(0x1d3),_0x44034a(0x22c))[_0x44034a(0x1c2)](_0x44034a(0x1d1),'publish\x20the\x20result\x20to\x20GitHub')[_0x44034a(0x1c2)](_0x44034a(0x27c),'answer\x20a\x20business\x20clarification\x20(repeatable)',(_0x8f6c43,_0x43aacc)=>[..._0x43aacc,_0x8f6c43],[])[_0x44034a(0x1c2)](_0x44034a(0x2a1),_0x44034a(0x1d7))[_0x44034a(0x1c2)](_0x44034a(0x29f),_0x44034a(0x27a))['option'](_0x44034a(0x286),_0x44034a(0x1dc))[_0x44034a(0x27b)](async(_0x6a7a1,_0x85e042,_0x4fa8fe)=>{const _0x3cb6e6=_0x44034a,_0x2fff6c=_0x4fa8fe[_0x3cb6e6(0x1e9)]();!_0x2fff6c[_0x3cb6e6(0x285)]&&!_0x2fff6c[_0x3cb6e6(0x1e3)]&&await _0x1e393c({..._0x2fff6c,'action':_0x3cb6e6(0x257)});const _0x491593=oe(_0x6a7a1,_0x2fff6c);let _0x599a7a,_0x5956f8=null;if(_0x2fff6c[_0x3cb6e6(0x1e3)]&&!J(_0x2fff6c)&&(_0x6a7a1===void 0x0||_0x491593)){const _0x1a03ed=await _0x5e9534(_0x2fff6c[_0x3cb6e6(0x210)],_0x2fff6c[_0x3cb6e6(0x1e3)]);if(_0x599a7a=W(_0x1a03ed,_0x2fff6c[_0x3cb6e6(0x1e3)],{'api':_0x2fff6c[_0x3cb6e6(0x281)],'action':_0x3cb6e6(0x257)}),_0x6a7a1!==void 0x0&&_0x6a7a1!==_0x599a7a[_0x3cb6e6(0x26d)])throw new Error(_0x3cb6e6(0x20c)+_0x2fff6c[_0x3cb6e6(0x1e3)]+_0x3cb6e6(0x2a6));}else{if(_0x491593){if(_0x5956f8=await R({'api':_0x2fff6c[_0x3cb6e6(0x281)],'home':_0x2fff6c[_0x3cb6e6(0x210)],'objective':_0x6a7a1,'answers':_0x2fff6c[_0x3cb6e6(0x22d)],'source':re(_0x2fff6c),'github':_0x2fff6c[_0x3cb6e6(0x1d5)]===!0x0,'opts':_0x2fff6c,'loadPlanner':_0x3ffaa9}),_0x5956f8[_0x3cb6e6(0x1ce)]===null){N(_0x5956f8,_0x3cb6e6(0x257),_0x2fff6c);return;}_0x599a7a=_0x5956f8[_0x3cb6e6(0x1ce)];}else{const _0x4228d5=_0x2fff6c[_0x3cb6e6(0x203)]?await _0xf06f7d(_0x2fff6c[_0x3cb6e6(0x203)]):void 0x0;_0x599a7a=await _0x191f76({'fileInput':_0x4228d5,'objective':_0x6a7a1,'preset':_0x2fff6c[_0x3cb6e6(0x2b8)],'skill':_0x2fff6c['skill'],'template':_0x2fff6c[_0x3cb6e6(0x242)],'paths':_0x2fff6c[_0x3cb6e6(0x1fb)],'repo':_0x2fff6c[_0x3cb6e6(0x1f0)],'commit':_0x2fff6c[_0x3cb6e6(0x234)],'github':_0x2fff6c[_0x3cb6e6(0x1d5)]});}}if(_0x2fff6c['save']&&(await _0x17d4ce(_0x2fff6c[_0x3cb6e6(0x226)],_0x599a7a),_0x2fff6c[_0x3cb6e6(0x1f7)]||_0x21ccbf(_0x3cb6e6(0x1ca)+_0x2fff6c[_0x3cb6e6(0x226)]+'\x0a')),_0x2fff6c[_0x3cb6e6(0x285)]){const _0xb7f4e4=await _0x51329e(_0x2fff6c['api'],_0x599a7a,_0x3cb6e6(0x257));_0x2fff6c[_0x3cb6e6(0x1f7)]?_0x5afad3({'action':_0x3cb6e6(0x257),..._0x5956f8?{'summary':_0x5956f8['summary'],'deliverables':_0x5956f8[_0x3cb6e6(0x1eb)]}:{},'input':_0x599a7a,'check':_0xb7f4e4},_0x2fff6c):_0x5afad3(_0x5956f8?U(_0x5956f8,_0xb7f4e4):K(_0x3cb6e6(0x257),_0x599a7a,_0xb7f4e4),_0x2fff6c),_0xb7f4e4[_0x3cb6e6(0x268)][_0x3cb6e6(0x1c1)]>0x0&&(process['exitCode']=0x1);return;}_0x5956f8&&!_0x2fff6c[_0x3cb6e6(0x1f7)]&&_0x21ccbf(b(_0x5956f8)+'\x0a');const _0x2b8695=await _0xe17452({'api':_0x2fff6c[_0x3cb6e6(0x281)],'home':_0x2fff6c[_0x3cb6e6(0x210)],'input':_0x599a7a,'action':_0x3cb6e6(0x257),'requestKey':_0x2fff6c['requestKey'],'plan':_0x5956f8?{'summary':_0x5956f8[_0x3cb6e6(0x22a)],'deliverables':_0x5956f8[_0x3cb6e6(0x1eb)]}:void 0x0,'yes':_0x2fff6c[_0x3cb6e6(0x23e)],'keyEnv':_0x2fff6c['keyEnv'],'rpc':_0x2fff6c[_0x3cb6e6(0x213)],'paymentChain':_0x2fff6c[_0x3cb6e6(0x21d)],'payWith':_0x2fff6c[_0x3cb6e6(0x1f6)],'onProgress':_0x47f5e4(_0x2fff6c),'retryCommand':_0x2b6cda=>se(_0x2b6cda,_0x2fff6c)});C(_0x2b8695,_0x2fff6c);}),_0x1cc173[_0x44034a(0x282)]('continue\x20<id>\x20[objective]')['description']('continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for')[_0x44034a(0x1c2)](_0x44034a(0x1f8),_0x44034a(0x263))[_0x44034a(0x1c2)]('--skill\x20<id>',_0x44034a(0x1cc))[_0x44034a(0x1c2)](_0x44034a(0x275),_0x44034a(0x240))['option'](_0x44034a(0x1ec),_0x44034a(0x28d),(_0x36ee6f,_0xca6cd8)=>[..._0xca6cd8,_0x36ee6f],[])[_0x44034a(0x1c2)](_0x44034a(0x27c),'answer\x20a\x20business\x20clarification\x20(repeatable)',(_0x1217a3,_0x12524f)=>[..._0x12524f,_0x1217a3],[])[_0x44034a(0x1c2)]('--dry-run',_0x44034a(0x1d7))['option'](_0x44034a(0x29f),_0x44034a(0x27a))[_0x44034a(0x1c2)](_0x44034a(0x286),_0x44034a(0x1dc))[_0x44034a(0x27b)](async(_0x28de72,_0x5b923b,_0x5ec3f6,_0x4f9a83)=>{const _0x3811d0=_0x44034a,_0x3ef1db=_0x4f9a83[_0x3811d0(0x1e9)]();!_0x3ef1db[_0x3811d0(0x285)]&&!_0x3ef1db[_0x3811d0(0x1e3)]&&await _0x1e393c({..._0x3ef1db,'action':_0x3811d0(0x2b5)});const _0x816a2e=ie(_0x5b923b,_0x3ef1db);let _0x2e2648,_0x5f29a2,_0x2ec3a9=null;if(_0x3ef1db['requestKey']&&!O(_0x3ef1db)&&(_0x5b923b===void 0x0||_0x816a2e)){const _0x21e942=await _0x5e9534(_0x3ef1db['home'],_0x3ef1db[_0x3811d0(0x1e3)]);if(_0x2e2648=W(_0x21e942,_0x3ef1db[_0x3811d0(0x1e3)],{'api':_0x3ef1db[_0x3811d0(0x281)],'action':'job.continue'}),_0x2e2648['parentJobId']!==_0x28de72)throw new Error(_0x3811d0(0x20c)+_0x3ef1db['requestKey']+_0x3811d0(0x253)+(_0x2e2648[_0x3811d0(0x2b1)]??'<none>')+_0x3811d0(0x26c)+_0x28de72);if(_0x5b923b!==void 0x0&&_0x5b923b!==_0x2e2648['objective'])throw new Error(_0x3811d0(0x20c)+_0x3ef1db[_0x3811d0(0x1e3)]+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x5f29a2=(await _0x25f307(_0x3ef1db[_0x3811d0(0x281)],'/jobs/'+encodeURIComponent(_0x28de72)))['data'];}else{if(_0x816a2e){if(_0x5f29a2=(await _0x25f307(_0x3ef1db[_0x3811d0(0x281)],_0x3811d0(0x249)+encodeURIComponent(_0x28de72)))[_0x3811d0(0x235)],_0x2ec3a9=await R({'api':_0x3ef1db[_0x3811d0(0x281)],'home':_0x3ef1db[_0x3811d0(0x210)],'objective':_0x5b923b,'answers':_0x3ef1db[_0x3811d0(0x22d)],'parent':_0x5f29a2,'opts':_0x3ef1db,'loadPlanner':_0x3ffaa9}),_0x2ec3a9['input']===null){N(_0x2ec3a9,_0x3811d0(0x2b5),_0x3ef1db);return;}_0x2e2648=_0x2ec3a9['input'],_0x2e2648['parentJobId']!==_0x28de72&&(_0x2e2648={..._0x2e2648,'parentJobId':_0x28de72});}else{const _0x40d9c8=_0x3ef1db[_0x3811d0(0x203)]?await _0xf06f7d(_0x3ef1db[_0x3811d0(0x203)]):void 0x0;_0x2e2648=await _0x5bd41a({'id':_0x28de72,'fileInput':_0x40d9c8,'objective':_0x5b923b,'skill':_0x3ef1db[_0x3811d0(0x1d6)],'template':_0x3ef1db['template'],'paths':_0x3ef1db[_0x3811d0(0x1fb)]}),_0x5f29a2=(await _0x25f307(_0x3ef1db['api'],'/jobs/'+encodeURIComponent(_0x28de72)))['data'];}}if(_0x3ef1db[_0x3811d0(0x226)]&&(await _0x17d4ce(_0x3ef1db[_0x3811d0(0x226)],_0x2e2648),_0x3ef1db[_0x3811d0(0x1f7)]||_0x21ccbf(_0x3811d0(0x1ca)+_0x3ef1db[_0x3811d0(0x226)]+'\x0a')),_0x3ef1db[_0x3811d0(0x285)]){const _0x113c9f=await _0x51329e(_0x3ef1db[_0x3811d0(0x281)],_0x2e2648,'job.continue');_0x3ef1db[_0x3811d0(0x1f7)]?_0x5afad3({'action':_0x3811d0(0x2b5),..._0x2ec3a9?{'summary':_0x2ec3a9[_0x3811d0(0x22a)],'deliverables':_0x2ec3a9['deliverables']}:{},'parent':_0x180a5a(_0x5f29a2),'input':_0x2e2648,'check':_0x113c9f},_0x3ef1db):_0x5afad3(_0x2ec3a9?U(_0x2ec3a9,_0x113c9f):K(_0x3811d0(0x2b5),_0x2e2648,_0x113c9f,_0x5f29a2),_0x3ef1db),_0x113c9f[_0x3811d0(0x268)][_0x3811d0(0x1c1)]>0x0&&(process[_0x3811d0(0x20f)]=0x1);return;}_0x2ec3a9&&!_0x3ef1db[_0x3811d0(0x1f7)]&&_0x21ccbf(b(_0x2ec3a9)+'\x0a');const _0x232126=await _0xe17452({'api':_0x3ef1db[_0x3811d0(0x281)],'home':_0x3ef1db[_0x3811d0(0x210)],'input':_0x2e2648,'action':_0x3811d0(0x2b5),'requestKey':_0x3ef1db[_0x3811d0(0x1e3)],'plan':_0x2ec3a9?{'summary':_0x2ec3a9[_0x3811d0(0x22a)],'deliverables':_0x2ec3a9['deliverables']}:void 0x0,'yes':_0x3ef1db['yes'],'keyEnv':_0x3ef1db[_0x3811d0(0x26b)],'rpc':_0x3ef1db[_0x3811d0(0x213)],'paymentChain':_0x3ef1db['paymentChain'],'payWith':_0x3ef1db['payWith'],'onProgress':_0x47f5e4(_0x3ef1db),'retryCommand':_0x5b7eb1=>ae(_0x5b7eb1,_0x3ef1db)});_0x232126['state']&&(_0x232126[_0x3811d0(0x29b)][_0x3811d0(0x2aa)]=_0x180a5a(_0x5f29a2)),C(_0x232126,_0x3ef1db);});}export{we as registerTaskCommands};
@@ -0,0 +1 @@
1
+ function _0x583d(_0x546fee,_0x2a8ab5){_0x546fee=_0x546fee-0x150;const _0x583df1=_0x2a8a();let _0x8cb8ed=_0x583df1[_0x546fee];return _0x8cb8ed;}import{coinAmount as _0x53e1f4}from'./payment-coins.mjs';import{paymentNetwork as _0x59dc26}from'./payment-networks.mjs';function c(_0x5ac0a0,_0xa7f4bb,_0x45e800){const _0x3cbe5d=_0x583d,_0x21dbca={'address':_0x5ac0a0,'chainName':_0x59dc26(_0xa7f4bb)['chain'][_0x3cbe5d(0x153)],'shortages':_0x45e800};return Object[_0x3cbe5d(0x151)](new Error(s(_0x21dbca)[_0x3cbe5d(0x15b)]('\x0a')),{'code':_0x3cbe5d(0x152),'funding':_0x21dbca});}function _0x2a8a(){const _0x209304=['Add\x20funds\x20on\x20','assign','funding_required','name',':\x20have\x20','\x20in\x20the\x20sending\x20wallet.','map',';\x20need\x20','Send\x20to\x20your\x20wallet:','Choose\x20','\x20to\x20continue.','join','After\x20funding,\x20continue\x20this\x20task.\x20Prices\x20and\x20fees\x20will\x20be\x20checked\x20again.'];_0x2a8a=function(){return _0x209304;};return _0x2a8a();}function s({address:_0x909277,chainName:_0x2bb9fd,shortages:_0x1063b1}){const _0x593c40=_0x583d;return[_0x593c40(0x150)+_0x2bb9fd+_0x593c40(0x15a),..._0x1063b1[_0x593c40(0x156)](({coin:_0x2e9d89,balance:_0x5e06c8,required:_0x3d9995})=>_0x2e9d89+_0x593c40(0x154)+_0x53e1f4(_0x5e06c8,_0x2e9d89)+_0x593c40(0x157)+_0x53e1f4(_0x3d9995,_0x2e9d89)),'ETH\x20covers\x20network\x20fees\x20(gas).','',_0x593c40(0x158),_0x909277,'',_0x593c40(0x159)+_0x2bb9fd+_0x593c40(0x155),_0x593c40(0x15c)];}export{s as fundingInstructions,c as fundingRequired};
@@ -1 +1 @@
1
- import{formatEther as _0x58d07d}from'viem';import{coinAmount as _0x5e7229}from'./payment-coins.mjs';function n(_0x591f4c){var _0x2d0112=_0xd1e9;return{'coin':_0x591f4c[_0x2d0112(0x1c7)],'amount':_0x5e7229(_0x591f4c[_0x2d0112(0x1c1)],_0x591f4c[_0x2d0112(0x1c7)]),'estimatedAmount':_0x591f4c[_0x2d0112(0x1c6)]===void 0x0?void 0x0:_0x5e7229(_0x591f4c[_0x2d0112(0x1c6)],_0x591f4c[_0x2d0112(0x1c7)]),'minimumImd':_0x5e7229(_0x591f4c['minimumOut'],'IMD'),'maximumDebit':_0x5e7229(_0x591f4c[_0x2d0112(0x1c3)],_0x591f4c[_0x2d0112(0x1c7)]),'networkFeeCap':_0x58d07d(BigInt(_0x591f4c[_0x2d0112(0x1ca)])),'converted':_0x591f4c[_0x2d0112(0x1bf)][_0x2d0112(0x1c4)](_0x5f53e7=>_0x5f53e7[_0x2d0112(0x1c5)]===_0x2d0112(0x1c0)&&_0x5f53e7[_0x2d0112(0x1c8)]==='confirmed'),'steps':_0x591f4c[_0x2d0112(0x1bf)][_0x2d0112(0x1c9)](({kind:_0x3b1924,hash:_0x56f60d,status:_0x2b5b58})=>({'kind':_0x3b1924,'hash':_0x56f60d,'status':_0x2b5b58}))};}function p(_0x5afc8){var _0xc7169d=_0xd1e9;return{'maxFeePerGas':BigInt(_0x5afc8[_0xc7169d(0x1c2)]),'maxPriorityFeePerGas':BigInt(_0x5afc8[_0xc7169d(0x1cb)])};}function _0xd1e9(_0x2a4cd8,_0xf686ce){_0x2a4cd8=_0x2a4cd8-0x1bf;var _0xd1e9ab=_0xf686();var _0x1a877f=_0xd1e9ab[_0x2a4cd8];return _0x1a877f;}export{p as fundingFees,n as fundingSummary};function _0xf686(){var _0x944aee=['steps','swap','amountIn','maxFeePerGas','maximumDebit','some','kind','quotedInput','coin','status','map','feeCap','maxPriorityFeePerGas'];_0xf686=function(){return _0x944aee;};return _0xf686();}
1
+ function _0xb3c0(){var _0x59074e=['swap','IMD','kind','coin','steps','amountIn','status','minimumOut','confirmed'];_0xb3c0=function(){return _0x59074e;};return _0xb3c0();}import{formatEther as _0x574324}from'viem';import{coinAmount as _0x3191aa}from'./payment-coins.mjs';function c(_0x2426c7){var _0x5e35fa=_0x4e7f;return{'coin':_0x2426c7[_0x5e35fa(0xc8)],'amount':_0x3191aa(_0x2426c7[_0x5e35fa(0xca)],_0x2426c7[_0x5e35fa(0xc8)]),'estimatedAmount':_0x2426c7['quotedInput']===void 0x0?void 0x0:_0x3191aa(_0x2426c7['quotedInput'],_0x2426c7[_0x5e35fa(0xc8)]),'minimumImd':_0x3191aa(_0x2426c7[_0x5e35fa(0xcc)],_0x5e35fa(0xc6)),'maximumDebit':_0x3191aa(_0x2426c7['maximumDebit'],_0x2426c7[_0x5e35fa(0xc8)]),'networkFeeCap':_0x574324(BigInt(_0x2426c7['feeCap'])),'converted':_0x2426c7['steps']['some'](_0x8f8eaf=>_0x8f8eaf[_0x5e35fa(0xc7)]===_0x5e35fa(0xc5)&&_0x8f8eaf[_0x5e35fa(0xcb)]===_0x5e35fa(0xcd))&&!_0x2426c7['steps']['some'](_0x50daa7=>_0x50daa7[_0x5e35fa(0xc7)]===_0x5e35fa(0xc5)&&_0x50daa7[_0x5e35fa(0xcb)]!==_0x5e35fa(0xcd)),'steps':_0x2426c7[_0x5e35fa(0xc9)]['map'](({kind:_0x5b4820,hash:_0x402574,confirmedHash:_0x49c3a1,status:_0x3016ce})=>({'kind':_0x5b4820,'hash':_0x49c3a1??_0x402574,'status':_0x3016ce}))};}function _0x4e7f(_0xfb344d,_0xb3c08b){_0xfb344d=_0xfb344d-0xc5;var _0x4e7fa3=_0xb3c0();var _0x4959a8=_0x4e7fa3[_0xfb344d];return _0x4959a8;}export{c as fundingSummary};
@@ -1 +1 @@
1
- const _0x443fb1=_0x326d;import{encodeFunctionData as _0x234b93,erc20Abi as _0x346d03,EstimateGasExecutionError as _0x2e3a64,formatEther as _0x324956,keccak256 as _0x1cae4a}from'viem';import{getRpcClients as _0x36a8d3,getSigner as _0x3f79f9}from'../shared.mjs';import{paymentCoin as _0x31381f}from'./payment-coins.mjs';function _0x326d(_0x3ebcbb,_0x21be91){_0x3ebcbb=_0x3ebcbb-0x91;const _0x326dd2=_0x21be();let _0x55201f=_0x326dd2[_0x3ebcbb];return _0x55201f;}import{paymentNetwork as _0x3a86e3}from'./payment-networks.mjs';import{orderPayment as _0x17b88c,loadPaymentConfig as _0x2dbde4}from'./payments.mjs';import{assertOrderNotCancelled as _0x12143b,findOrder as _0x3825c0,saveOrder as _0x5dcc66}from'./orders.mjs';import{quoteSwap as _0x1a6447,buildSwap as _0x2cd2ac,UNISWAP as _0x339615,APPROVAL_GAS as _0x33ba99}from'./swaps.mjs';import{submitTransaction as _0xc86e57}from'./transactions.mjs';import{fundingFees as _0x441eef}from'./funding-state.mjs';function _0x21be(){const _0x26792f=['The\x20support\x20transfer','Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.','Insufficient\x20','value','hash','gas','kind','prepareTransactionRequest','\x20to\x20buy\x20the\x20required\x20IMD.','success','paymentReview','balanceOf','\x20transaction\x20reverted:\x20','push','quotedInput','reset_source_allowance','recipient','swap','The\x20token\x20authorization','The\x20swap\x20review\x20expired.\x20Resume\x20this\x20order\x20to\x20inspect\x20its\x20saved\x20progress.\x20No\x20new\x20transaction\x20was\x20signed.','reverted','allowance','IMD','amount','ethereum','Insufficient\x20ETH\x20for\x20the\x20swap\x20and\x20capped\x20network\x20fees.','slippageBps','signal','chain','payment','address','estimateGas','symbol','data','ready','account','.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','approve','status','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','signed','some','all','The\x20','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.','estimateFeesPerGas','amountIn','toLowerCase','readContract','maxFeePerGas','steps','funding','action','min','throwIfAborted','router','expiresAt','requestKey','paymentChain','confirmed','now','approve_source','support','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.','rawTransaction','maxPriorityFeePerGas','asset','ETH','payWith','home','reduce','spender','floor','robinhood'];_0x21be=function(){return _0x26792f;};return _0x21be();}const X=0x7a120n,x=(_0x490f16,_0x1fb306,_0xb214e6)=>_0x490f16['readContract']({'address':_0x1fb306,'abi':_0x346d03,'functionName':_0x443fb1(0x9c),'args':[_0xb214e6]}),M=(_0x5c076d,_0x39708c,_0x5da133,_0x241bed)=>_0x5c076d[_0x443fb1(0xc1)]({'address':_0x39708c,'abi':_0x346d03,'functionName':_0x443fb1(0xa6),'args':[_0x5da133,_0x241bed]}),C=(_0x1c3a5b,_0x2d2572,_0x1baefa,_0x5a0d83)=>({'kind':_0x1c3a5b,'to':_0x2d2572,'value':'0','gas':String(_0x33ba99),'data':_0x234b93({'abi':_0x346d03,'functionName':_0x443fb1(0xb6),'args':[_0x1baefa,_0x5a0d83]})});async function Z(_0x27d572,_0x41572a,_0x37c5fc,_0x115f03){const _0x3db290=_0x443fb1,_0x5000d9=_0x27d572[_0x3db290(0xcb)]??_0x3db290(0xa9),_0x223dec=_0x31381f(_0x5000d9,_0x27d572[_0x3db290(0xd5)]),_0x402ba4=_0x17b88c(_0x27d572),_0x2057eb=await _0x2dbde4(_0x41572a['api'],_0x27d572[_0x3db290(0xc5)],_0x5000d9);if(_0x402ba4[_0x3db290(0xd3)][_0x3db290(0xc0)]()!==_0x2057eb[_0x3db290(0xae)][_0x3db290(0xd3)][_0x3db290(0xc0)]())throw new Error(_0x3db290(0xd0));const _0x49a96e=BigInt(_0x402ba4[_0x3db290(0xa8)]),[_0x115fe7,_0x55fd10,_0xe15dce]=await Promise[_0x3db290(0xbb)]([M(_0x37c5fc,_0x402ba4[_0x3db290(0xd3)],_0x115f03['address'],_0x2057eb[_0x3db290(0xd8)]),_0x37c5fc['getBalance']({'address':_0x115f03[_0x3db290(0xaf)]}),_0x37c5fc[_0x3db290(0xbe)]()]),_0x1da360=BigInt(_0x27d572['support']?.['amount']??0x0),_0xa4181e=_0x49a96e+_0x1da360,_0x3c3006=_0x339615[_0x5000d9][_0x3db290(0xc8)],_0x4797d9=_0x5000d9===_0x3db290(0xda)?X:0x0n,_0x579bca=_0x1da360>0x0n?0x186a0n:0x0n,_0x2de8c6=_0x4797d9+_0x579bca+(_0x115fe7<_0x49a96e?_0x33ba99:0x0n),_0x50be1e=[];let _0x3d566a;const _0x2977d0=Math[_0x3db290(0xc6)](Number(_0x27d572['quote'][_0x3db290(0xc9)]),Math[_0x3db290(0xd9)](Date[_0x3db290(0xcd)]()/0x3e8)+0x12c);if(_0x223dec[_0x3db290(0xb1)]===_0x3db290(0xa7)&&await x(_0x37c5fc,_0x402ba4[_0x3db290(0xd3)],_0x115f03[_0x3db290(0xaf)])<_0xa4181e)throw new Error('Insufficient\x20IMD\x20for\x20the\x20task\x20and\x20support\x20payment.');if(_0x223dec[_0x3db290(0xb1)]!==_0x3db290(0xa7)&&_0xa4181e>0x0n){const _0x3b63cd=_0x223dec['symbol']===_0x3db290(0xd4)?0x0n:await M(_0x37c5fc,_0x223dec[_0x3db290(0xaf)],_0x115f03[_0x3db290(0xaf)],_0x3c3006);_0x3d566a=await _0x1a6447(_0x5000d9,_0x223dec,_0xa4181e,{'client':_0x37c5fc,'maxFeePerGas':_0xe15dce[_0x3db290(0xc2)],'sourceAllowance':_0x3b63cd,'fixedGas':_0x2de8c6,'signal':_0x41572a[_0x3db290(0xac)]});const _0xa13c5f=BigInt(_0x3d566a[_0x3db290(0xbf)]);if(_0x223dec[_0x3db290(0xb1)]!=='ETH'){const _0x58190f=await x(_0x37c5fc,_0x223dec['address'],_0x115f03[_0x3db290(0xaf)]),_0x3751f1=_0x3b63cd;if(_0x58190f<_0xa13c5f)throw new Error(_0x3db290(0x93)+_0x223dec['symbol']+_0x3db290(0x99));_0x3751f1<_0xa13c5f&&(_0x223dec['symbol']==='USDT'&&_0x3751f1>0x0n&&_0x50be1e['push'](C(_0x3db290(0xa0),_0x223dec['address'],_0x3c3006,0x0n)),_0x50be1e[_0x3db290(0x9e)](C(_0x3db290(0xce),_0x223dec[_0x3db290(0xaf)],_0x3c3006,_0xa13c5f)));}const _0x109a20=_0x2cd2ac(_0x5000d9,_0x223dec,_0x3d566a,_0xa4181e,_0x115f03['address'],_0x2977d0);_0x50be1e[_0x3db290(0x9e)]({'kind':'swap',..._0x109a20,'gas':String(_0x3d566a[_0x3db290(0x96)]),'expiresAt':_0x2977d0});}_0x115fe7<_0x49a96e&&_0x50be1e[_0x3db290(0x9e)](C('approve_imd',_0x402ba4['asset'],_0x2057eb[_0x3db290(0xd8)],_0x49a96e)),_0x1da360>0x0n&&_0x50be1e[_0x3db290(0x9e)]({'kind':_0x3db290(0xcf),'to':_0x402ba4['asset'],'value':'0','gas':String(_0x579bca),'expiresAt':_0x2977d0,'data':_0x234b93({'abi':_0x346d03,'functionName':'transfer','args':[_0x27d572[_0x3db290(0xcf)][_0x3db290(0xa1)],_0x1da360]})});const _0x54797e=_0x50be1e[_0x3db290(0xd7)]((_0x47d62b,_0x55a0fe)=>_0x47d62b+BigInt(_0x55a0fe[_0x3db290(0x96)]),_0x4797d9)*_0xe15dce[_0x3db290(0xc2)],_0x4136da=_0x223dec['symbol']===_0x3db290(0xa7)?_0xa4181e:BigInt(_0x3d566a?.['amountIn']??0x0),_0x27efbc=_0x4136da+(_0x223dec[_0x3db290(0xb1)]===_0x3db290(0xd4)?_0x54797e:0x0n);if(_0x55fd10<_0x54797e+(_0x223dec['symbol']===_0x3db290(0xd4)?_0x4136da:0x0n))throw new Error(_0x3db290(0xaa));return{'chainId':_0x3a86e3(_0x5000d9)['chain']['id'],'account':_0x115f03['address'],'coin':_0x223dec[_0x3db290(0xb1)],'amountIn':String(_0x4136da),'minimumOut':String(_0xa4181e),'maximumDebit':String(_0x27efbc),'quotedInput':String(_0x223dec[_0x3db290(0xb1)]==='IMD'?_0xa4181e:_0x3d566a?.[_0x3db290(0x9f)]??0x0),..._0x3d566a?{'slippageBps':_0x3d566a[_0x3db290(0xab)]}:{},'feeCap':String(_0x54797e),'maxFeePerGas':String(_0xe15dce[_0x3db290(0xc2)]),'maxPriorityFeePerGas':String(_0xe15dce[_0x3db290(0xd2)]),'paymentGas':String(_0x4797d9),'expiresAt':_0x2977d0,'steps':_0x50be1e};}async function me(_0x47df68,_0x16f4d3,_0x149d8d){const _0x2eb709=_0x443fb1,{publicClient:_0x454459,walletClient:_0x2ad9c4,account:_0x2794bd}=await _0x36a8d3(_0x16f4d3,_0x3a86e3(_0x47df68[_0x2eb709(0xcb)]??_0x2eb709(0xa9))[_0x2eb709(0xad)]['id']);_0x47df68[_0x2eb709(0xc4)]?.[_0x2eb709(0xc3)][_0x2eb709(0xba)](_0x1c4455=>_0x1c4455[_0x2eb709(0xd1)])||(_0x47df68['funding']=await Z(_0x47df68,_0x16f4d3,_0x454459,_0x2794bd));const _0x43ec14=_0x47df68[_0x2eb709(0xc4)];if(_0x43ec14[_0x2eb709(0xb4)][_0x2eb709(0xc0)]()!==_0x2794bd[_0x2eb709(0xaf)][_0x2eb709(0xc0)]())throw new Error(_0x2eb709(0x92));_0x47df68[_0x2eb709(0x9b)]={'networkFeeCap':_0x324956(BigInt(_0x43ec14['feeCap']))},await _0x149d8d(_0x47df68),_0x16f4d3['signal']?.['throwIfAborted'](),_0x12143b(await _0x3825c0(_0x16f4d3[_0x2eb709(0xd6)],_0x47df68[_0x2eb709(0xca)])),await _0x5dcc66(_0x16f4d3[_0x2eb709(0xd6)],_0x47df68);for(const _0x5a77bb of _0x43ec14[_0x2eb709(0xc3)]){if(_0x5a77bb[_0x2eb709(0xb7)]==='confirmed')continue;if(_0x5a77bb[_0x2eb709(0xb7)]===_0x2eb709(0xa5))throw new Error(_0x2eb709(0xbc)+_0x5a77bb[_0x2eb709(0x97)]+_0x2eb709(0x9d)+_0x5a77bb[_0x2eb709(0x95)]+_0x2eb709(0xb5));if(!_0x5a77bb['rawTransaction']){if(_0x43ec14['expiresAt']*0x3e8<=Date['now']())throw new Error(_0x2eb709(0xa4));const _0x404423={'account':_0x2794bd,'to':_0x5a77bb['to'],'data':_0x5a77bb[_0x2eb709(0xb2)],'value':BigInt(_0x5a77bb[_0x2eb709(0x94)]),..._0x441eef(_0x43ec14)};let _0x33bdf7;try{_0x33bdf7=await _0x454459[_0x2eb709(0xb0)](_0x404423);}catch(_0x3077ee){throw _0x3077ee instanceof _0x2e3a64?new Error((_0x5a77bb[_0x2eb709(0x97)]===_0x2eb709(0xa2)?'The\x20swap\x20quote':_0x5a77bb[_0x2eb709(0x97)]==='support'?_0x2eb709(0x91):_0x2eb709(0xa3))+_0x2eb709(0xbd),{'cause':_0x3077ee}):_0x3077ee;}if(_0x33bdf7>BigInt(_0x5a77bb[_0x2eb709(0x96)]))throw new Error('Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.');const _0x3be418=await _0x2ad9c4[_0x2eb709(0x98)]({..._0x404423,'gas':BigInt(_0x5a77bb[_0x2eb709(0x96)])});await _0x3f79f9({..._0x16f4d3,'expectedWallet':_0x2794bd[_0x2eb709(0xaf)]}),_0x16f4d3[_0x2eb709(0xac)]?.[_0x2eb709(0xc7)](),_0x12143b(await _0x3825c0(_0x16f4d3[_0x2eb709(0xd6)],_0x47df68[_0x2eb709(0xca)])),_0x5a77bb[_0x2eb709(0xd1)]=await _0x2ad9c4['signTransaction'](_0x3be418),_0x5a77bb[_0x2eb709(0x95)]=_0x1cae4a(_0x5a77bb[_0x2eb709(0xd1)]),_0x5a77bb['status']=_0x2eb709(0xb9),_0x47df68[_0x2eb709(0xb7)]=_0x2eb709(0xc4),await _0x5dcc66(_0x16f4d3['home'],_0x47df68);}const _0x3d3d1f=await _0xc86e57(_0x454459,_0x5a77bb,_0x16f4d3);if(_0x5a77bb[_0x2eb709(0xb7)]=_0x3d3d1f['status']===_0x2eb709(0x9a)?_0x2eb709(0xcc):_0x2eb709(0xa5),await _0x5dcc66(_0x16f4d3['home'],_0x47df68),_0x5a77bb[_0x2eb709(0xb7)]==='reverted')throw new Error(_0x2eb709(0xbc)+_0x5a77bb[_0x2eb709(0x97)]+_0x2eb709(0x9d)+_0x5a77bb[_0x2eb709(0x95)]+'.\x20Your\x20order\x20was\x20not\x20paid.');}const _0x364d92=_0x17b88c(_0x47df68);if(await x(_0x454459,_0x364d92[_0x2eb709(0xd3)],_0x2794bd[_0x2eb709(0xaf)])<BigInt(_0x364d92[_0x2eb709(0xa8)]))throw new Error(_0x2eb709(0xb8));_0x43ec14[_0x2eb709(0xb7)]=_0x2eb709(0xb3),await _0x5dcc66(_0x16f4d3[_0x2eb709(0xd6)],_0x47df68);}export{me as fundOrder};
1
+ const _0x17641c=_0x4db2;function _0x4db2(_0x5f4f9a,_0x4d859b){_0x5f4f9a=_0x5f4f9a-0x66;const _0x4db2ea=_0x4d85();let _0xf3ab6e=_0x4db2ea[_0x5f4f9a];return _0xf3ab6e;}import{decodeFunctionData as _0x21f518,encodeFunctionData as _0x4b2cc2,erc20Abi as _0x1f875f,EstimateGasExecutionError as _0xbb9c6,formatEther as _0x263337,keccak256 as _0x1396e2}from'viem';import{getPublicRpcClient as _0x5f117b,getRpcClients as _0x45e0f7,getSigner as _0x124c1c}from'../shared.mjs';import{paymentCoin as _0x4e0217}from'./payment-coins.mjs';import{paymentNetwork as _0x4b25c4}from'./payment-networks.mjs';import{assertQuotePayment as _0x2fc045,orderPayment as _0x194cc3,loadPaymentConfig as _0x16ca6e}from'./payments.mjs';import{assertOrderNotCancelled as _0x2949f8,findOrder as _0x5aa9d4,saveOrder as _0x22cdc2}from'./orders.mjs';import{quoteSwap as _0x45bbd6,buildSwap as _0x377971,UNISWAP as _0x1604fc,APPROVAL_GAS as _0x4a908b,SWAP_ABI as _0x9085fe}from'./swaps.mjs';import{submitTransaction as _0x5c5117}from'./transactions.mjs';import{fundingRequired as _0x3f65d0}from'./funding-error.mjs';import{walletInfo as _0x21ddb0}from'./local-wallet.mjs';import{transactionFees as _0x439569,reviewedFees as _0x2b0c27}from'./transaction-fees.mjs';function _0x4d85(){const _0x2ff278=['.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','The\x20token\x20authorization','coin\x20conversion','checking_funds','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','prepareTransactionRequest','gas','replacementNonce','hash','readContract','kind','paymentReview','amountIn','spender','address','success','ETH','account','signTransaction','toLowerCase','...','api','estimateGas','maxFeePerGas','router','quote','IMD','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','asset','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.','status','Preparing\x20','reset_source_allowance','requestKey','filter','swap','funding','symbol','value','signed','signal','slippageBps','amount','action','steps','payment_review_expired','expectedWallet','reverted','.\x20Your\x20order\x20was\x20not\x20paid.','recipient','optional\x20support\x20transfer','approve','signing','\x20transaction\x20reverted:\x20','support','min','ready','transactionHash','transfer','amountOut','USDT','payWith','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.','token\x20authorization','pendingTransaction','chain','floor','throwIfAborted','expiresAt','payment','feeCap','assign','The\x20','robinhood','args','confirmed','configured','confirmedHash','reduce','quotedInput','home','push','rawTransaction','ethereum','data','paymentChain','approve_source','now','all','balanceOf','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.'];_0x4d85=function(){return _0x2ff278;};return _0x4d85();}import{resumeTransaction as _0x1295f6,recoveryNonce as _0x1fedbd,retireExpiredSwap as _0x4372fa}from'./transaction-recovery.mjs';const he=0x7a120n,A=(_0x53bc5d,_0x991c64,_0x3ec0fd)=>_0x53bc5d[_0x17641c(0x70)]({'address':_0x991c64,'abi':_0x1f875f,'functionName':_0x17641c(0xc0),'args':[_0x3ec0fd]}),Y=(_0x279838,_0x246b0c,_0x119428,_0x2183c7)=>_0x279838[_0x17641c(0x70)]({'address':_0x246b0c,'abi':_0x1f875f,'functionName':'allowance','args':[_0x119428,_0x2183c7]}),R=(_0x325f5a,_0x20a950,_0x31faeb,_0x337cc1)=>({'kind':_0x325f5a,'to':_0x20a950,'value':'0','gas':String(_0x4a908b),'data':_0x4b2cc2({'abi':_0x1f875f,'functionName':_0x17641c(0x9a),'args':[_0x31faeb,_0x337cc1]})});async function ge(_0x92d27f,_0x55f477,_0x411e5e,_0x4fbc79,_0x5e0c7c){const _0x2e5c65=_0x17641c,_0x99ebc5=_0x92d27f[_0x2e5c65(0xbc)]??_0x2e5c65(0xba),_0x3498fb=_0x4e0217(_0x99ebc5,_0x92d27f[_0x2e5c65(0xa4)]),_0x277f16=_0x5e0c7c??await _0x16ca6e(_0x55f477[_0x2e5c65(0x7c)],_0x92d27f[_0x2e5c65(0x92)],_0x99ebc5,_0x55f477),_0x3838e3=_0x5e0c7c?_0x5e0c7c[_0x2e5c65(0xac)]:_0x194cc3(_0x92d27f);if(_0x2fc045(_0x3838e3),_0x3838e3[_0x2e5c65(0x83)][_0x2e5c65(0x7a)]()!==_0x277f16['payment'][_0x2e5c65(0x83)]['toLowerCase']())throw new Error(_0x2e5c65(0xc1));const _0x1528ca=BigInt(_0x3838e3[_0x2e5c65(0x91)]),[_0x5dda6f,_0x58e249,_0x1e912f]=await Promise[_0x2e5c65(0xbf)]([Y(_0x411e5e,_0x3838e3['asset'],_0x4fbc79[_0x2e5c65(0x75)],_0x277f16[_0x2e5c65(0x74)]),_0x411e5e['getBalance']({'address':_0x4fbc79[_0x2e5c65(0x75)]}),_0x439569(_0x411e5e,_0x4b25c4(_0x99ebc5)[_0x2e5c65(0xa8)]['id'])]),_0x5893f6=(_0x92d27f[_0x2e5c65(0x8b)]?.['steps']??[])[_0x2e5c65(0x89)](_0x4cab0c=>_0x4cab0c[_0x2e5c65(0x85)]===_0x2e5c65(0xb2));let _0x165f6a=0x0n,_0x1ef6bf=0x0n;for(const _0x33a10d of _0x5893f6)if(_0x33a10d[_0x2e5c65(0x71)]==='swap'){const _0x565c7f=_0x21f518({'abi':_0x9085fe,'data':_0x33a10d['data']});_0x165f6a+=_0x21f518({'abi':_0x9085fe,'data':_0x565c7f[_0x2e5c65(0xb1)][0x1][0x0]})[_0x2e5c65(0xb1)][0x0][_0x2e5c65(0xa2)];}else _0x33a10d[_0x2e5c65(0x71)]===_0x2e5c65(0x9d)&&(_0x1ef6bf+=_0x21f518({'abi':_0x1f875f,'data':_0x33a10d[_0x2e5c65(0xbb)]})[_0x2e5c65(0xb1)][0x1]);const _0x4a9915=BigInt(_0x92d27f[_0x2e5c65(0x9d)]?.[_0x2e5c65(0x91)]??0x0)-_0x1ef6bf,_0x399392=_0x1528ca+_0x4a9915,_0x524262=_0x1604fc[_0x99ebc5][_0x2e5c65(0x7f)],_0xd9e597=_0x99ebc5===_0x2e5c65(0xb0)?he:0x0n,_0x5e84bf=_0x4a9915>0x0n?0x186a0n:0x0n,_0x1d871b=_0xd9e597+_0x5e84bf+(_0x5dda6f<_0x1528ca?_0x4a908b:0x0n),_0x119ec2=[],_0x5cc99c=[];let _0x58be73;const _0x21b60e=Math[_0x2e5c65(0x9e)](Number(_0x92d27f[_0x2e5c65(0x80)]['expiresAt']),Math[_0x2e5c65(0xa9)](Date[_0x2e5c65(0xbe)]()/0x3e8)+0x12c);if(_0x3498fb['symbol']===_0x2e5c65(0x81)){const _0x5aeb87=await A(_0x411e5e,_0x3838e3[_0x2e5c65(0x83)],_0x4fbc79[_0x2e5c65(0x75)]);_0x5aeb87<_0x399392&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x2e5c65(0x81),'balance':String(_0x5aeb87),'required':String(_0x399392)});}const _0x1c583c=_0x165f6a>_0x1ef6bf?_0x165f6a-_0x1ef6bf:0x0n,_0x1712d9=_0x399392>_0x1c583c?_0x399392-_0x1c583c:0x0n;if(_0x1c583c>0x0n){const _0x536c48=await A(_0x411e5e,_0x3838e3[_0x2e5c65(0x83)],_0x4fbc79['address']),_0x2fb5b1=_0x399392<_0x1c583c?_0x399392:_0x1c583c;_0x536c48<_0x2fb5b1&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x2e5c65(0x81),'balance':String(_0x536c48),'required':String(_0x2fb5b1)});}if(_0x3498fb[_0x2e5c65(0x8c)]!==_0x2e5c65(0x81)&&_0x1712d9>0x0n){const _0x287331=_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0x77)?0x0n:await Y(_0x411e5e,_0x3498fb[_0x2e5c65(0x75)],_0x4fbc79[_0x2e5c65(0x75)],_0x524262);_0x58be73=await _0x45bbd6(_0x99ebc5,_0x3498fb,_0x1712d9,{'client':_0x411e5e,'maxFeePerGas':_0x1e912f[_0x2e5c65(0x7e)],'sourceAllowance':_0x287331,'fixedGas':_0x1d871b,'signal':_0x55f477[_0x2e5c65(0x8f)]});const _0x42c9bf=BigInt(_0x58be73[_0x2e5c65(0x73)]);if(_0x3498fb[_0x2e5c65(0x8c)]!==_0x2e5c65(0x77)){const _0x49ca33=await A(_0x411e5e,_0x3498fb[_0x2e5c65(0x75)],_0x4fbc79[_0x2e5c65(0x75)]),_0x4e3e6a=_0x287331;_0x49ca33<_0x42c9bf&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x3498fb[_0x2e5c65(0x8c)],'balance':String(_0x49ca33),'required':String(_0x42c9bf)}),_0x4e3e6a<_0x42c9bf&&(_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0xa3)&&_0x4e3e6a>0x0n&&_0x119ec2[_0x2e5c65(0xb8)](R(_0x2e5c65(0x87),_0x3498fb['address'],_0x524262,0x0n)),_0x119ec2[_0x2e5c65(0xb8)](R(_0x2e5c65(0xbd),_0x3498fb[_0x2e5c65(0x75)],_0x524262,_0x42c9bf)));}const _0x55fda1=_0x377971(_0x99ebc5,_0x3498fb,_0x58be73,_0x1712d9,_0x4fbc79[_0x2e5c65(0x75)],_0x21b60e);_0x119ec2[_0x2e5c65(0xb8)]({'kind':_0x2e5c65(0x8a),..._0x55fda1,'gas':String(_0x58be73[_0x2e5c65(0x6d)]),'expiresAt':_0x21b60e});}_0x5dda6f<_0x1528ca&&_0x119ec2['push'](R('approve_imd',_0x3838e3['asset'],_0x277f16[_0x2e5c65(0x74)],_0x1528ca)),_0x4a9915>0x0n&&_0x119ec2[_0x2e5c65(0xb8)]({'kind':_0x2e5c65(0x9d),'to':_0x3838e3[_0x2e5c65(0x83)],'value':'0','gas':String(_0x5e84bf),'data':_0x4b2cc2({'abi':_0x1f875f,'functionName':_0x2e5c65(0xa1),'args':[_0x92d27f[_0x2e5c65(0x9d)][_0x2e5c65(0x98)],_0x4a9915]})});const _0x114e25=_0x119ec2[_0x2e5c65(0xb5)]((_0x49c2dd,_0x23499c)=>_0x49c2dd+BigInt(_0x23499c[_0x2e5c65(0x6d)]),_0xd9e597)*_0x1e912f[_0x2e5c65(0x7e)],_0x3bc291=_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0x81)?_0x399392:BigInt(_0x58be73?.[_0x2e5c65(0x73)]??0x0),_0x2ad8de=_0x3bc291+(_0x3498fb[_0x2e5c65(0x8c)]==='ETH'?_0x114e25:0x0n),_0x34d8b3=_0x114e25+(_0x3498fb[_0x2e5c65(0x8c)]==='ETH'?_0x3bc291:0x0n);if(_0x58e249<_0x34d8b3&&_0x5cc99c['push']({'coin':_0x2e5c65(0x77),'balance':String(_0x58e249),'required':String(_0x34d8b3)}),_0x5cc99c['length'])throw _0x3f65d0(_0x4fbc79['address'],_0x99ebc5,_0x5cc99c);return{'chainId':_0x4b25c4(_0x99ebc5)[_0x2e5c65(0xa8)]['id'],'account':_0x4fbc79['address'],'coin':_0x3498fb[_0x2e5c65(0x8c)],'amountIn':String(_0x3bc291),'minimumOut':String(_0x399392),'maximumDebit':String(_0x2ad8de),'quotedInput':String(_0x3498fb['symbol']===_0x2e5c65(0x81)?_0x399392:_0x58be73?.[_0x2e5c65(0xb6)]??0x0),..._0x58be73?{'slippageBps':_0x58be73[_0x2e5c65(0x90)]}:{},'feeCap':String(_0x114e25),'maxFeePerGas':String(_0x1e912f[_0x2e5c65(0x7e)]),'maxPriorityFeePerGas':String(_0x1e912f['maxPriorityFeePerGas']),'paymentGas':String(_0xd9e597),'expiresAt':_0x21b60e,'steps':[..._0x5893f6,..._0x119ec2]};}async function Ne(_0x7e2039,_0x32e3bd,_0x5a8654){const _0x5bfa80=_0x17641c,_0x2a8b58=_0x4b25c4(_0x7e2039[_0x5bfa80(0xbc)]??_0x5bfa80(0xba))['chain']['id'],_0x153c72=_0x21ddb0(_0x32e3bd);if(!_0x153c72[_0x5bfa80(0xb3)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.');if(_0x32e3bd[_0x5bfa80(0x95)]&&_0x32e3bd[_0x5bfa80(0x95)][_0x5bfa80(0x7a)]()!==_0x153c72['address'][_0x5bfa80(0x7a)]())throw new Error('Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.');const _0x5c61c7=await _0x5f117b(_0x32e3bd,_0x2a8b58);if(_0x7e2039[_0x5bfa80(0x8b)]&&_0x7e2039[_0x5bfa80(0x8b)][_0x5bfa80(0x78)][_0x5bfa80(0x7a)]()!==_0x153c72[_0x5bfa80(0x75)][_0x5bfa80(0x7a)]())throw new Error('Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.');for(const _0x1bfd8f of _0x7e2039[_0x5bfa80(0x8b)]?.[_0x5bfa80(0x93)]??[]){if(_0x1bfd8f[_0x5bfa80(0xb9)]&&_0x1bfd8f[_0x5bfa80(0x85)]!==_0x5bfa80(0xb2)&&await _0x4372fa(_0x7e2039,_0x1bfd8f,_0x5c61c7,_0x32e3bd))continue;if(_0x1bfd8f[_0x5bfa80(0x85)]==='reverted')throw new Error(_0x5bfa80(0xaf)+_0x1bfd8f[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x1bfd8f[_0x5bfa80(0x6f)]+_0x5bfa80(0x66));if(!_0x1bfd8f[_0x5bfa80(0xb9)]||_0x1bfd8f[_0x5bfa80(0x85)]===_0x5bfa80(0xb2))continue;const _0xa3071b=await _0x1295f6(_0x7e2039,_0x1bfd8f,_0x5c61c7,_0x32e3bd);if(_0x1bfd8f['status']=_0xa3071b[_0x5bfa80(0x85)]===_0x5bfa80(0x76)?_0x5bfa80(0xb2):_0x5bfa80(0x96),_0x1bfd8f[_0x5bfa80(0xb4)]=_0xa3071b[_0x5bfa80(0xa0)],delete _0x7e2039['pendingTransaction'],await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039),_0x1bfd8f[_0x5bfa80(0x85)]===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x1bfd8f[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x1bfd8f['hash']+_0x5bfa80(0x66));}_0x32e3bd['onProgress']?.({'phase':_0x5bfa80(0x6a),'message':_0x5bfa80(0x82)}),_0x7e2039[_0x5bfa80(0x8b)]=await ge(_0x7e2039,_0x32e3bd,_0x5c61c7,_0x153c72);const _0x204f49=_0x7e2039[_0x5bfa80(0x8b)];_0x7e2039[_0x5bfa80(0x72)]={'networkFeeCap':_0x263337(BigInt(_0x204f49[_0x5bfa80(0xad)]))},await _0x5a8654(_0x7e2039),_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd['home'],_0x7e2039[_0x5bfa80(0x88)])),await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039);const {walletClient:_0x1584e2,account:_0x3ba84e}=await _0x45e0f7({..._0x32e3bd,'expectedWallet':_0x153c72[_0x5bfa80(0x75)]},_0x2a8b58);if(_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd['home'],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49['expiresAt']*0x3e8<=Date[_0x5bfa80(0xbe)]())throw Object[_0x5bfa80(0xae)](new Error(_0x5bfa80(0x6b)),{'code':_0x5bfa80(0x94)});for(const _0x40fd10 of _0x204f49[_0x5bfa80(0x93)]){if(_0x40fd10[_0x5bfa80(0x85)]===_0x5bfa80(0xb2))continue;if(_0x40fd10['status']===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x40fd10[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x40fd10[_0x5bfa80(0x6f)]+_0x5bfa80(0x66));if(!_0x40fd10[_0x5bfa80(0xb9)]){if(_0x204f49[_0x5bfa80(0xab)]*0x3e8<=Date[_0x5bfa80(0xbe)]())throw Object[_0x5bfa80(0xae)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':_0x5bfa80(0x94)});const _0x428bf7=_0x2b0c27(await _0x439569(_0x5c61c7,_0x2a8b58),_0x204f49);_0x32e3bd['onProgress']?.({'phase':_0x5bfa80(0x9b),'message':_0x5bfa80(0x86)+(_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x8a)?_0x5bfa80(0x69):_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x9d)?_0x5bfa80(0x99):_0x5bfa80(0xa6))+_0x5bfa80(0x7b)});const _0x51d69a={'account':_0x3ba84e,'to':_0x40fd10['to'],'data':_0x40fd10[_0x5bfa80(0xbb)],'value':BigInt(_0x40fd10[_0x5bfa80(0x8d)]),..._0x428bf7};let _0x5ee10b;try{_0x5ee10b=await _0x5c61c7[_0x5bfa80(0x7d)](_0x51d69a);}catch(_0x25c4af){throw _0x25c4af instanceof _0xbb9c6?new Error((_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x8a)?'The\x20swap\x20quote':_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x9d)?'The\x20support\x20transfer':_0x5bfa80(0x68))+_0x5bfa80(0xa5),{'cause':_0x25c4af}):_0x25c4af;}if(_0x5ee10b>BigInt(_0x40fd10[_0x5bfa80(0x6d)]))throw new Error(_0x5bfa80(0x84));const _0x1cb71f=await _0x1584e2[_0x5bfa80(0x6c)]({..._0x51d69a,'gas':BigInt(_0x40fd10['gas']),'nonce':await _0x1fedbd(_0x7e2039,_0x5c61c7,_0x3ba84e[_0x5bfa80(0x75)])});if(await _0x124c1c({..._0x32e3bd,'expectedWallet':_0x3ba84e['address']}),_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49[_0x5bfa80(0xab)]*0x3e8<=Date['now']())throw Object[_0x5bfa80(0xae)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':_0x5bfa80(0x94)});Object[_0x5bfa80(0xae)](_0x1cb71f,_0x2b0c27(await _0x439569(_0x5c61c7,_0x2a8b58),_0x204f49)),_0x40fd10[_0x5bfa80(0xb9)]=await _0x1584e2[_0x5bfa80(0x79)](_0x1cb71f),_0x40fd10[_0x5bfa80(0x6f)]=_0x1396e2(_0x40fd10[_0x5bfa80(0xb9)]),_0x40fd10[_0x5bfa80(0x85)]=_0x5bfa80(0x8e),delete _0x7e2039[_0x5bfa80(0x6e)],_0x7e2039['status']=_0x5bfa80(0x8b),await _0x22cdc2(_0x32e3bd['home'],_0x7e2039);}const _0x1d03e0=await _0x5c5117(_0x5c61c7,_0x40fd10,_0x32e3bd);if(_0x40fd10['status']=_0x1d03e0['status']===_0x5bfa80(0x76)?_0x5bfa80(0xb2):_0x5bfa80(0x96),_0x40fd10[_0x5bfa80(0xb4)]=_0x1d03e0[_0x5bfa80(0xa0)],delete _0x7e2039[_0x5bfa80(0xa7)],await _0x22cdc2(_0x32e3bd['home'],_0x7e2039),_0x40fd10['status']===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x40fd10[_0x5bfa80(0x71)]+'\x20transaction\x20reverted:\x20'+_0x40fd10['hash']+_0x5bfa80(0x97));}const _0x47d8ae=_0x194cc3(_0x7e2039);if(await A(_0x5c61c7,_0x47d8ae['asset'],_0x3ba84e[_0x5bfa80(0x75)])<BigInt(_0x47d8ae[_0x5bfa80(0x91)]))throw new Error(_0x5bfa80(0x67));_0x2949f8(await _0x5aa9d4(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49[_0x5bfa80(0x85)]=_0x5bfa80(0x9f),await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039);}export{Ne as fundOrder,ge as prepareFunding};
@@ -1 +1 @@
1
- const _0x2fcbdd=_0x2232;import{encodeFunctionData as _0x743302,erc20Abi as _0x5e852f,formatUnits as _0x36c28d,keccak256 as _0x566faa,parseAbi as _0x2f02ca,TransactionNotFoundError as _0x58ee35}from'viem';import{getPublicRpcClient as _0x1198d7,getRpcClients as _0x303ca2,getSigner as _0x32b125}from'../shared.mjs';import{assertOrderNotCancelled as _0x32378e,findOrder as _0x4bd016,saveOrder as _0x40de21}from'./orders.mjs';import{loadPaymentConfig as _0x3c6d6e,onchainTerms as _0x2f64e5}from'./payments.mjs';import{fundingFees as _0x11135a}from'./funding-state.mjs';import{waitForReceipt as _0x363781}from'./transactions.mjs';function _0x19b0(){const _0x1f311f=['sendRawTransaction','intake','Authorize\x20IMD\x20payment\x20on\x20Robinhood\x20Chain\x20first:\x20run\x20colony\x20wallet\x20approve\x20--payment-chain\x20robinhood\x20--amount\x20','decimals','The\x20Robinhood\x20quote\x20does\x20not\x20match\x20the\x20payment\x20contract\x20configured\x20by\x20IMD.','signTransaction','The\x20quote\x20expired\x20before\x20signing.\x20No\x20task\x20payment\x20was\x20signed.','The\x20signed\x20payment\x20quote\x20has\x20expired\x20and\x20this\x20node\x20has\x20not\x20seen\x20its\x20transaction.\x20Check\x20the\x20original\x20order\x20before\x20starting\x20another\x20payment.','paymentGas','toLowerCase','function\x20pay(bytes32\x20quoteHash,\x20address\x20asset,\x20uint256\x20amount,\x20uint64\x20expiresAt,\x20bytes\x20signature)','failed','signed','toISOString','hash','getTransaction','home','submitted','success','robinhood','status','signal','pay','asset','requestKey','address','submittedAt','funding','lastError','now','The\x20Robinhood\x20payment\x20transaction\x20reverted:\x20','payment','expiresAt','allowance','pending','.\x20No\x20task\x20payment\x20was\x20signed.','quoteHash','api','transactionHash','action','amount','chainId','rawTransaction','quote_expired','readContract','paymentStatus','signature','throwIfAborted'];_0x19b0=function(){return _0x1f311f;};return _0x19b0();}const q=_0x2f02ca([_0x2fcbdd(0x15a)]);async function S(_0x2583a8,_0x49a232){const _0x1d47d3=_0x2fcbdd,_0x157e0d=_0x2f64e5(_0x2583a8),{payment:_0x4ea759,spender:_0xef42da}=await _0x3c6d6e(_0x49a232[_0x1d47d3(0x175)],_0x2583a8[_0x1d47d3(0x177)],_0x1d47d3(0x163));if(_0x157e0d[_0x1d47d3(0x167)][_0x1d47d3(0x159)]()!==_0x4ea759[_0x1d47d3(0x167)]['toLowerCase']()||_0x157e0d['intake'][_0x1d47d3(0x159)]()!==_0xef42da[_0x1d47d3(0x159)]()||_0x4ea759[_0x1d47d3(0x153)]!==_0x2583a8['quote'][_0x1d47d3(0x16f)]['decimals'])throw new Error(_0x1d47d3(0x154));const {publicClient:_0x149e14,walletClient:_0x173c27,account:_0x2b9e44}=await _0x303ca2(_0x49a232,_0x157e0d[_0x1d47d3(0x179)]);if(await _0x149e14[_0x1d47d3(0x17c)]({'address':_0x157e0d[_0x1d47d3(0x167)],'abi':_0x5e852f,'functionName':_0x1d47d3(0x171),'args':[_0x2b9e44[_0x1d47d3(0x169)],_0x157e0d[_0x1d47d3(0x151)]]})<BigInt(_0x157e0d[_0x1d47d3(0x178)]))throw new Error(_0x1d47d3(0x152)+_0x36c28d(BigInt(_0x157e0d['amount']),_0x4ea759[_0x1d47d3(0x153)])+_0x1d47d3(0x173));const _0x449ef4=await _0x173c27['prepareTransactionRequest']({'account':_0x2b9e44,'to':_0x157e0d[_0x1d47d3(0x151)],'value':0x0n,'data':_0x743302({'abi':q,'functionName':_0x1d47d3(0x166),'args':[_0x157e0d[_0x1d47d3(0x174)],_0x157e0d[_0x1d47d3(0x167)],BigInt(_0x157e0d[_0x1d47d3(0x178)]),BigInt(_0x157e0d[_0x1d47d3(0x170)]),_0x157e0d[_0x1d47d3(0x17e)]]}),'gas':BigInt(_0x2583a8['funding'][_0x1d47d3(0x158)]),..._0x11135a(_0x2583a8[_0x1d47d3(0x16b)])});if(await _0x32b125({..._0x49a232,'expectedWallet':_0x2b9e44['address']}),_0x49a232[_0x1d47d3(0x165)]?.[_0x1d47d3(0x17f)](),_0x32378e(await _0x4bd016(_0x49a232['home'],_0x2583a8[_0x1d47d3(0x168)])),_0x157e0d[_0x1d47d3(0x170)]*0x3e8<=Date[_0x1d47d3(0x16d)]())throw Object['assign'](new Error(_0x1d47d3(0x156)),{'code':_0x1d47d3(0x17b)});const _0x3fc42f=await _0x173c27[_0x1d47d3(0x155)](_0x449ef4);_0x2583a8['onchainPayment']={'chainId':_0x157e0d[_0x1d47d3(0x179)],'rawTransaction':_0x3fc42f,'hash':_0x566faa(_0x3fc42f)},_0x2583a8['payer']=_0x2b9e44[_0x1d47d3(0x169)],_0x2583a8['status']=_0x1d47d3(0x15c),_0x2583a8[_0x1d47d3(0x16c)]=null,await _0x40de21(_0x49a232['home'],_0x2583a8);}async function v(_0x29e2c3,_0x43fce1){const _0x1cdd73=_0x2fcbdd,_0x52ce69=_0x29e2c3['onchainPayment'],_0x53dce1=await _0x1198d7(_0x43fce1,_0x52ce69[_0x1cdd73(0x179)]);let _0x1c6966=!0x1;try{await _0x53dce1[_0x1cdd73(0x15f)]({'hash':_0x52ce69[_0x1cdd73(0x15e)]}),_0x1c6966=!0x0;}catch(_0x49814e){if(!(_0x49814e instanceof _0x58ee35))throw _0x49814e;}if(!_0x1c6966&&_0x2f64e5(_0x29e2c3)[_0x1cdd73(0x170)]*0x3e8<=Date[_0x1cdd73(0x16d)]())throw new Error(_0x1cdd73(0x157));if(_0x29e2c3[_0x1cdd73(0x176)]=_0x52ce69[_0x1cdd73(0x15e)],_0x29e2c3[_0x1cdd73(0x17d)]=_0x1cdd73(0x172),_0x29e2c3['status']=_0x1cdd73(0x161),_0x29e2c3[_0x1cdd73(0x16a)]=new Date()[_0x1cdd73(0x15d)](),await _0x40de21(_0x43fce1[_0x1cdd73(0x160)],_0x29e2c3),_0x43fce1['signal']?.[_0x1cdd73(0x17f)](),_0x1c6966||await _0x53dce1[_0x1cdd73(0x150)]({'serializedTransaction':_0x52ce69[_0x1cdd73(0x17a)]}),(await _0x363781(_0x53dce1,_0x52ce69['hash'],_0x43fce1))[_0x1cdd73(0x164)]!==_0x1cdd73(0x162))throw _0x29e2c3[_0x1cdd73(0x164)]='payment_failed',_0x29e2c3['paymentStatus']=_0x1cdd73(0x15b),await _0x40de21(_0x43fce1[_0x1cdd73(0x160)],_0x29e2c3),new Error(_0x1cdd73(0x16e)+_0x52ce69[_0x1cdd73(0x15e)]);_0x29e2c3['paymentStatus']='confirmed',await _0x40de21(_0x43fce1[_0x1cdd73(0x160)],_0x29e2c3);}function _0x2232(_0x2cb18d,_0x19b0fd){_0x2cb18d=_0x2cb18d-0x150;const _0x223212=_0x19b0();let _0x42dd02=_0x223212[_0x2cb18d];return _0x42dd02;}export{S as signOnchainPayment,v as submitOnchainPayment};
1
+ const _0x3bf1a5=_0xc33c;import{encodeFunctionData as _0x21fa42,erc20Abi as _0x332905,formatUnits as _0x408e5f,keccak256 as _0x137a87,parseAbi as _0x5adde8}from'viem';import{getPublicRpcClient as _0xa7fcc6,getRpcClients as _0xb0ad3e,getSigner as _0x145854}from'../shared.mjs';import{assertOrderNotCancelled as _0x2ac8cb,findOrder as _0x587684,saveOrder as _0x4ace3d}from'./orders.mjs';import{loadPaymentConfig as _0x3a4f64,onchainTerms as _0x1efe75}from'./payments.mjs';function _0x491b(){const _0x699d55=['quoteHash','onProgress','signTransaction','success','confirmed','toISOString','assign','confirmedHash','chainId','signal','payer','requestKey','kind','expiresAt','home','onchainPayment','paymentStatus','address','The\x20quote\x20expired\x20before\x20signing.\x20No\x20task\x20payment\x20was\x20signed.','submittedAt','robinhood','intake','funding','status','pay','allowance','payment_failed','asset','replacementNonce','transactionHash','decimals','lastError','payment','amount','signing','throwIfAborted','action','Preparing\x20task\x20payment...','function\x20pay(bytes32\x20quoteHash,\x20address\x20asset,\x20uint256\x20amount,\x20uint64\x20expiresAt,\x20bytes\x20signature)','signed','pending','readContract','pendingTransaction','toLowerCase','The\x20Robinhood\x20payment\x20transaction\x20reverted:\x20','signature','hash','submitted','The\x20Robinhood\x20quote\x20does\x20not\x20match\x20the\x20payment\x20contract\x20configured\x20by\x20IMD.','Authorize\x20IMD\x20payment\x20on\x20Robinhood\x20Chain\x20first:\x20run\x20colony\x20wallet\x20approve\x20--payment-chain\x20robinhood\x20--amount\x20'];_0x491b=function(){return _0x699d55;};return _0x491b();}import{submitTransaction as _0x18e4dc}from'./transactions.mjs';import{resumeTransaction as _0x5f2395,recoveryNonce as _0x5409b6}from'./transaction-recovery.mjs';import{transactionFees as _0x2dd3c0,reviewedFees as _0x5cb446}from'./transaction-fees.mjs';function _0xc33c(_0x28687a,_0x491b75){_0x28687a=_0x28687a-0xd8;const _0xc33cd5=_0x491b();let _0xc7f14b=_0xc33cd5[_0x28687a];return _0xc7f14b;}const P=_0x5adde8([_0x3bf1a5(0xfe)]);async function F(_0x3d782f,_0x25ca42){const _0x43468a=_0x3bf1a5,_0x42554f=_0x1efe75(_0x3d782f),{payment:_0x4fa5d6,spender:_0x3c7aa0}=await _0x3a4f64(_0x25ca42['api'],_0x3d782f[_0x43468a(0xfc)],_0x43468a(0xec));if(_0x42554f[_0x43468a(0xf3)][_0x43468a(0x103)]()!==_0x4fa5d6[_0x43468a(0xf3)][_0x43468a(0x103)]()||_0x42554f[_0x43468a(0xed)]['toLowerCase']()!==_0x3c7aa0[_0x43468a(0x103)]()||_0x4fa5d6[_0x43468a(0xf6)]!==_0x3d782f['quote']['payment'][_0x43468a(0xf6)])throw new Error(_0x43468a(0x108));const {publicClient:_0x23ef67,walletClient:_0x4f432e,account:_0x3eb147}=await _0xb0ad3e(_0x25ca42,_0x42554f['chainId']),_0x32bc7e=_0x5cb446(await _0x2dd3c0(_0x23ef67,_0x42554f[_0x43468a(0xe0)]),_0x3d782f[_0x43468a(0xee)]);if(_0x25ca42[_0x43468a(0xd9)]?.({'phase':_0x43468a(0xfa),'message':_0x43468a(0xfd)}),await _0x23ef67[_0x43468a(0x101)]({'address':_0x42554f[_0x43468a(0xf3)],'abi':_0x332905,'functionName':_0x43468a(0xf1),'args':[_0x3eb147[_0x43468a(0xe9)],_0x42554f[_0x43468a(0xed)]]})<BigInt(_0x42554f[_0x43468a(0xf9)]))throw new Error(_0x43468a(0x109)+_0x408e5f(BigInt(_0x42554f['amount']),_0x4fa5d6[_0x43468a(0xf6)])+'.\x20No\x20task\x20payment\x20was\x20signed.');const _0x3fc820=await _0x4f432e['prepareTransactionRequest']({'account':_0x3eb147,'to':_0x42554f['intake'],'value':0x0n,'data':_0x21fa42({'abi':P,'functionName':_0x43468a(0xf0),'args':[_0x42554f[_0x43468a(0xd8)],_0x42554f['asset'],BigInt(_0x42554f[_0x43468a(0xf9)]),BigInt(_0x42554f[_0x43468a(0xe5)]),_0x42554f[_0x43468a(0x105)]]}),'gas':BigInt(_0x3d782f['funding']['paymentGas']),..._0x32bc7e,'nonce':await _0x5409b6(_0x3d782f,_0x23ef67,_0x3eb147[_0x43468a(0xe9)])});if(await _0x145854({..._0x25ca42,'expectedWallet':_0x3eb147[_0x43468a(0xe9)]}),_0x25ca42[_0x43468a(0xe1)]?.[_0x43468a(0xfb)](),_0x2ac8cb(await _0x587684(_0x25ca42['home'],_0x3d782f[_0x43468a(0xe3)])),_0x42554f[_0x43468a(0xe5)]*0x3e8<=Date['now']())throw Object[_0x43468a(0xde)](new Error(_0x43468a(0xea)),{'code':'quote_expired'});Object[_0x43468a(0xde)](_0x3fc820,_0x5cb446(await _0x2dd3c0(_0x23ef67,_0x42554f['chainId']),_0x3d782f[_0x43468a(0xee)]));const _0x34244e=await _0x4f432e[_0x43468a(0xda)](_0x3fc820);_0x3d782f[_0x43468a(0xe7)]={'chainId':_0x42554f[_0x43468a(0xe0)],'kind':_0x43468a(0xf8),'expiresAt':_0x42554f['expiresAt'],'rawTransaction':_0x34244e,'hash':_0x137a87(_0x34244e)},delete _0x3d782f[_0x43468a(0xf4)],_0x3d782f[_0x43468a(0xe2)]=_0x3eb147[_0x43468a(0xe9)],_0x3d782f[_0x43468a(0xef)]=_0x43468a(0xff),_0x3d782f[_0x43468a(0xf7)]=null,await _0x4ace3d(_0x25ca42['home'],_0x3d782f);}async function _(_0x3a6c3e,_0x55e029){const _0x4f0f71=_0x3bf1a5,_0x4803db=_0x3a6c3e[_0x4f0f71(0xe7)],_0x4cd312=await _0xa7fcc6(_0x55e029,_0x4803db[_0x4f0f71(0xe0)]),_0x31a20f=!!_0x3a6c3e[_0x4f0f71(0xeb)];_0x4803db[_0x4f0f71(0xe4)]=_0x4f0f71(0xf8),_0x4803db[_0x4f0f71(0xe5)]=_0x1efe75(_0x3a6c3e)[_0x4f0f71(0xe5)],_0x3a6c3e[_0x4f0f71(0xf5)]=_0x4803db[_0x4f0f71(0x106)],_0x3a6c3e[_0x4f0f71(0xe8)]=_0x4f0f71(0x100),_0x3a6c3e[_0x4f0f71(0xef)]=_0x4f0f71(0x107),_0x3a6c3e[_0x4f0f71(0xeb)]=new Date()[_0x4f0f71(0xdd)](),await _0x4ace3d(_0x55e029['home'],_0x3a6c3e),_0x55e029[_0x4f0f71(0xe1)]?.['throwIfAborted']();const _0x48e4a5=_0x31a20f?await _0x5f2395(_0x3a6c3e,_0x4803db,_0x4cd312,_0x55e029):await _0x18e4dc(_0x4cd312,_0x4803db,_0x55e029);if(_0x3a6c3e[_0x4f0f71(0xf5)]=_0x48e4a5[_0x4f0f71(0xf5)],_0x4803db[_0x4f0f71(0xdf)]=_0x48e4a5[_0x4f0f71(0xf5)],delete _0x3a6c3e[_0x4f0f71(0x102)],_0x48e4a5[_0x4f0f71(0xef)]!==_0x4f0f71(0xdb))throw _0x3a6c3e[_0x4f0f71(0xef)]=_0x4f0f71(0xf2),_0x3a6c3e[_0x4f0f71(0xe8)]='failed',await _0x4ace3d(_0x55e029[_0x4f0f71(0xe6)],_0x3a6c3e),new Error(_0x4f0f71(0x104)+_0x4803db['hash']);_0x3a6c3e['paymentStatus']=_0x4f0f71(0xdc),await _0x4ace3d(_0x55e029[_0x4f0f71(0xe6)],_0x3a6c3e);}export{F as signOnchainPayment,_ as submitOnchainPayment};
@@ -1 +1 @@
1
- const _0x1edc86=_0xae25;import{randomBytes as _0xef2376}from'node:crypto';import{chmod as _0x14b6c3,mkdir as _0x3432b0,readdir as _0xcbc819,readFile as _0x27f022,rename as _0x167484,unlink as _0x11a1ff,writeFile as _0x238b5e}from'node:fs/promises';function _0x2636(){const _0x55b6d5=['toISOString','quoteSignature','code','lastStatus','canDelete','ethereum','ENOENT','submittedAt','canCancel','lastError','isFile','expiresAt','funding','paymentChain','created','resultUrl','transactionHash','paymentStatus','.json','status','onchainPayment','expired','refusalProblems','jobId','order_cancelled','filter','onchainQuotes','assign','cancelledAt','updatedAt','robinhood','rawTransaction','payment','invalid\x20order\x20file\x20','challenged','cancelled','name','blocked','stringify','utf8','hex','parse','includes','statusUrl','invalid\x20request\x20key:\x20','paymentHeader','refused','toString','orderId','Cancel\x20this\x20unsigned\x20request\x20before\x20deleting\x20its\x20local\x20record.\x20Signed\x20payment\x20recovery\x20records\x20must\x20be\x20kept.','chainId','payment_failed','.tmp','test','quote','This\x20request\x20was\x20cancelled\x20locally\x20and\x20cannot\x20be\x20paid\x20or\x20resumed.\x20Create\x20a\x20new\x20task\x20to\x20start\x20again.','localeCompare','admitted','amount','find','orders','some','unknown\x20order:\x20','requestKey'];_0x2636=function(){return _0x55b6d5;};return _0x2636();}import{join as _0x538062}from'node:path';import{fundingSummary as _0x214e79}from'./funding-state.mjs';import{mapConcurrent as _0x260bbb}from'./concurrent.mjs';const b=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function i(_0x44029a){const _0x57d4ae=_0xae25;return _0x538062(_0x44029a,_0x57d4ae(0x19d));}function l(_0x497e63,_0x46a863){const _0xa35175=_0xae25;if(!b[_0xa35175(0x196)](_0x46a863))throw new Error(_0xa35175(0x18d)+_0x46a863);return _0x538062(i(_0x497e63),_0x46a863+_0xa35175(0x173));}async function E(_0x28c720,_0x31ae3e){const _0x1a5900=_0xae25,_0x39a0bc=i(_0x28c720);await _0x3432b0(_0x39a0bc,{'recursive':!0x0,'mode':0x1c0}),_0x31ae3e[_0x1a5900(0x17e)]=new Date()[_0x1a5900(0x161)]();const _0x203848=l(_0x28c720,_0x31ae3e[_0x1a5900(0x1a0)]),_0x45c81c=_0x538062(_0x39a0bc,'.'+_0x31ae3e[_0x1a5900(0x1a0)]+'.'+process['pid']+'.'+_0xef2376(0x4)[_0x1a5900(0x190)](_0x1a5900(0x189))+_0x1a5900(0x195));return await _0x238b5e(_0x45c81c,JSON[_0x1a5900(0x187)](_0x31ae3e,null,0x2)+'\x0a',{'mode':0x180}),await _0x167484(_0x45c81c,_0x203848),await _0x14b6c3(_0x203848,0x180),_0x31ae3e;}async function $(_0x445e17,_0x2b52d9){const _0x287c97=_0xae25,_0x49b591=l(_0x445e17,_0x2b52d9);try{return JSON['parse'](await _0x27f022(_0x49b591,_0x287c97(0x188)));}catch(_0x9fe3e8){if(_0x9fe3e8['code']===_0x287c97(0x167))return null;throw _0x9fe3e8 instanceof SyntaxError?new Error(_0x287c97(0x182)+_0x49b591+':\x20'+_0x9fe3e8['message']):_0x9fe3e8;}}async function x(_0x247aca){const _0x462314=_0xae25;let _0x22e064;try{_0x22e064=await _0xcbc819(i(_0x247aca),{'withFileTypes':!0x0});}catch(_0x12ecfa){if(_0x12ecfa[_0x462314(0x163)]===_0x462314(0x167))return[];throw _0x12ecfa;}const _0xf21a94=_0x22e064[_0x462314(0x17a)](_0x4b7c7b=>_0x4b7c7b[_0x462314(0x16b)]()&&_0x4b7c7b[_0x462314(0x185)]['endsWith'](_0x462314(0x173))),_0x4be994=await _0x260bbb(_0xf21a94,0x8,async _0x193fa9=>JSON[_0x462314(0x18a)](await _0x27f022(_0x538062(i(_0x247aca),_0x193fa9[_0x462314(0x185)]),'utf8')));return _0x4be994['sort']((_0x25824c,_0x372a21)=>String(_0x372a21[_0x462314(0x17e)])[_0x462314(0x199)](String(_0x25824c[_0x462314(0x17e)]))),_0x4be994;}async function c(_0x40fead,_0x28f729){const _0x4b4396=_0xae25,_0x49a751=(await x(_0x40fead))[_0x4b4396(0x19c)](_0x4de72c=>_0x4de72c[_0x4b4396(0x191)]===_0x28f729||_0x4de72c[_0x4b4396(0x1a0)]===_0x28f729);if(!_0x49a751)throw new Error(_0x4b4396(0x19f)+_0x28f729);return _0x49a751;}function _0xae25(_0x2ca254,_0x26360f){_0x2ca254=_0x2ca254-0x161;const _0xae25fd=_0x2636();let _0xb50f1f=_0xae25fd[_0x2ca254];return _0xb50f1f;}const I=new Set([_0x1edc86(0x16f),_0x1edc86(0x186),'quoted',_0x1edc86(0x183),_0x1edc86(0x176)]);function d(_0x447bdc){const _0x7329de=_0x1edc86,_0x379240=I['has'](_0x447bdc[_0x7329de(0x174)])&&!_0x447bdc[_0x7329de(0x18e)]&&!_0x447bdc[_0x7329de(0x162)]&&!_0x447bdc['payment']&&!_0x447bdc[_0x7329de(0x175)]&&!_0x447bdc[_0x7329de(0x16d)]?.['steps'][_0x7329de(0x19e)](_0x437144=>_0x437144[_0x7329de(0x180)])&&!_0x447bdc[_0x7329de(0x168)]&&!_0x447bdc[_0x7329de(0x178)]&&!_0x447bdc[_0x7329de(0x172)]&&!_0x447bdc['transactionHash'];return{'canCancel':_0x379240&&!_0x447bdc[_0x7329de(0x17d)],'canDelete':_0x379240&&!!_0x447bdc['cancelledAt'],'canResume':!_0x447bdc[_0x7329de(0x17d)]&&!_0x447bdc[_0x7329de(0x178)]&&![_0x7329de(0x19a),_0x7329de(0x18f),_0x7329de(0x194),_0x7329de(0x176)][_0x7329de(0x18b)](_0x447bdc[_0x7329de(0x174)])};}function j(_0x2811c6){const _0xd37ae2=_0x1edc86;if(_0x2811c6[_0xd37ae2(0x17d)])throw Object[_0xd37ae2(0x17c)](new Error(_0xd37ae2(0x198)),{'code':_0xd37ae2(0x179)});}async function D(_0x21ad86,_0x227dfc){const _0x1c4134=_0x1edc86,_0x52d70f=await c(_0x21ad86,_0x227dfc);if(!d(_0x52d70f)[_0x1c4134(0x169)])throw new Error('Only\x20unsigned,\x20unsubmitted\x20requests\x20can\x20be\x20cancelled\x20locally.\x20Signed\x20payments\x20and\x20published\x20tasks\x20cannot\x20be\x20cancelled\x20through\x20the\x20IMD\x20public\x20API.');return _0x52d70f[_0x1c4134(0x17d)]=new Date()[_0x1c4134(0x161)](),_0x52d70f[_0x1c4134(0x16a)]=null,await E(_0x21ad86,_0x52d70f),_0x52d70f;}async function k(_0xb459e7,_0x43f46c){const _0x1ba58f=_0x1edc86,_0xea6cec=await c(_0xb459e7,_0x43f46c);if(!d(_0xea6cec)[_0x1ba58f(0x165)])throw new Error(_0x1ba58f(0x192));return await _0x11a1ff(l(_0xb459e7,_0xea6cec[_0x1ba58f(0x1a0)])),_0xea6cec;}function P(_0x3f44d1){const _0x3db96a=_0x1edc86,_0x585948=_0x3f44d1[_0x3db96a(0x16e)]===_0x3db96a(0x17f)?_0x3f44d1[_0x3db96a(0x17b)]?.[_0x3db96a(0x19c)](_0x26c63e=>_0x26c63e[_0x3db96a(0x193)]===0x1237):_0x3f44d1['quote']?.[_0x3db96a(0x181)];return{'requestKey':_0x3f44d1[_0x3db96a(0x1a0)],'orderId':_0x3f44d1[_0x3db96a(0x191)]??null,'status':_0x3f44d1[_0x3db96a(0x17d)]&&!_0x3f44d1[_0x3db96a(0x178)]?_0x3db96a(0x184):_0x3f44d1[_0x3db96a(0x174)],'cancelledAt':_0x3f44d1['cancelledAt']??null,...d(_0x3f44d1),'remoteStatus':_0x3f44d1[_0x3db96a(0x164)]??null,'action':_0x3f44d1['action'],'paymentChain':_0x3f44d1[_0x3db96a(0x16e)]??_0x3db96a(0x166),'payWith':_0x3f44d1['payWith']??'IMD','funding':_0x3f44d1[_0x3db96a(0x16d)]?_0x214e79(_0x3f44d1[_0x3db96a(0x16d)]):null,'createdAt':_0x3f44d1['createdAt'],'updatedAt':_0x3f44d1['updatedAt'],'amount':_0x585948?.[_0x3db96a(0x19b)]??null,'asset':_0x585948?.['asset']??null,'payTo':_0x585948?.['payTo']??null,'quoteExpiresAt':_0x3f44d1[_0x3db96a(0x197)]?.[_0x3db96a(0x16c)]??null,'paymentSigned':!!(_0x3f44d1[_0x3db96a(0x18e)]||_0x3f44d1[_0x3db96a(0x162)]||_0x3f44d1['onchainPayment']),'paymentStatus':_0x3f44d1[_0x3db96a(0x172)]??null,'transactionHash':_0x3f44d1[_0x3db96a(0x171)]??null,'refusalProblems':_0x3f44d1[_0x3db96a(0x177)]??null,'jobId':_0x3f44d1[_0x3db96a(0x178)]??null,'statusUrl':_0x3f44d1[_0x3db96a(0x18c)]??null,'resultUrl':_0x3f44d1[_0x3db96a(0x170)]??null,'lastError':_0x3f44d1[_0x3db96a(0x16a)]??null};}export{j as assertOrderNotCancelled,D as cancelOrder,k as deleteOrder,c as findOrder,x as listOrders,$ as loadOrder,d as orderActions,P as orderSummary,i as ordersDir,E as saveOrder};
1
+ function _0x4432(){const _0x18c4e4=['paymentChain','sort','action','quoteSignature','includes','asset','has','status','funding','.json','toISOString','createdAt','payWith','refused','robinhood','invalid\x20order\x20file\x20','blocked','quoted','invalid\x20request\x20key:\x20','utf8','IMD','onchainPayment','chainId','orderId','submittedAt','payment','amount','ENOENT','onchainQuotes','name','lastError','cancelledAt','requestKey','order_changed','.tmp','stringify','assign','lock','paymentHeader','order_cancelled','test','lastStatus','revision','length','parse','orders','updatedAt','hex','refusalProblems','payTo','transactionHash','recoveryStatus','canCancel','code','paymentStatus','filter','unknown\x20order:\x20','localeCompare','isFile','cancelled','This\x20payment\x20has\x20already\x20started.\x20Reopen\x20the\x20task\x20to\x20inspect\x20its\x20progress.','find','transaction_pending','paymentHistory','This\x20request\x20was\x20cancelled\x20locally\x20and\x20cannot\x20be\x20paid\x20or\x20resumed.\x20Create\x20a\x20new\x20task\x20to\x20start\x20again.','pendingTransaction','Cancel\x20this\x20unsigned\x20request\x20before\x20deleting\x20its\x20local\x20record.\x20Signed\x20payment\x20recovery\x20records\x20must\x20be\x20kept.','Only\x20unsigned,\x20unsubmitted\x20requests\x20can\x20be\x20cancelled\x20locally.\x20Signed\x20payments\x20and\x20published\x20tasks\x20cannot\x20be\x20cancelled\x20through\x20the\x20IMD\x20public\x20API.','expiresAt','endsWith','some','canDelete','ethereum','payment_failed','jobId','message','pid','steps','This\x20task\x20was\x20updated\x20in\x20another\x20terminal.\x20Reopen\x20it\x20to\x20continue\x20from\x20its\x20saved\x20progress.','created'];_0x4432=function(){return _0x18c4e4;};return _0x4432();}const _0x50e392=_0x1a55;import{randomBytes as _0x2d859b}from'node:crypto';import{chmod as _0x1e82d4,mkdir as _0x3e1677,readdir as _0x5d61fc,readFile as _0xb986c2,rename as _0x23b0cc,unlink as _0x48ddc2,writeFile as _0x4b8240}from'node:fs/promises';import{join as _0x4a4d5a}from'node:path';import{fundingSummary as _0xc79ba9}from'./funding-state.mjs';import{mapConcurrent as _0x2e6371}from'./concurrent.mjs';import _0xbb8c97 from'proper-lockfile';const x=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function i(_0x1430ab){const _0x45d653=_0x1a55;return _0x4a4d5a(_0x1430ab,_0x45d653(0x157));}function u(_0x47143e,_0xb95c0f){const _0x35e1e2=_0x1a55;if(!x[_0x35e1e2(0x152)](_0xb95c0f))throw new Error(_0x35e1e2(0x13c)+_0xb95c0f);return _0x4a4d5a(i(_0x47143e),_0xb95c0f+_0x35e1e2(0x133));}async function s(_0x25aa8f,_0x37ac6a,_0x7cab24){const _0x1b0b12=_0x1a55,_0x5d28c6=i(_0x25aa8f);await _0x3e1677(_0x5d28c6,{'recursive':!0x0,'mode':0x1c0});const _0x37442f=u(_0x25aa8f,_0x37ac6a),_0x20a3d1=await _0xbb8c97[_0x1b0b12(0x14f)](_0x37442f,{'realpath':!0x1,'retries':{'retries':0x2,'minTimeout':0x64,'maxTimeout':0xc8}});try{return await _0x7cab24(_0x37442f);}finally{await _0x20a3d1();}}async function T(_0x4ff4bc,_0x45b07e){const _0x5a4e4a=_0x1a55;return s(_0x4ff4bc,_0x45b07e[_0x5a4e4a(0x14a)],async _0x57954c=>{const _0x32edc6=_0x5a4e4a,_0x10e9f2=await p(_0x4ff4bc,_0x45b07e[_0x32edc6(0x14a)]);if(_0x10e9f2&&!_0x45b07e[_0x32edc6(0x149)]&&v(_0x10e9f2),!_0x10e9f2&&_0x45b07e['revision']!==void 0x0||_0x10e9f2&&(_0x45b07e[_0x32edc6(0x154)]??0x0)!==_0x10e9f2[_0x32edc6(0x154)])throw Object[_0x32edc6(0x14e)](new Error(_0x32edc6(0x178)),{'code':_0x32edc6(0x14b)});if(_0x45b07e[_0x32edc6(0x149)]&&_0x10e9f2&&!_0x10e9f2[_0x32edc6(0x149)]&&!l(_0x10e9f2)['canCancel'])throw new Error(_0x32edc6(0x166));const _0x36e6e6={..._0x45b07e,'revision':(_0x10e9f2?.[_0x32edc6(0x154)]??0x0)+0x1,'updatedAt':new Date()[_0x32edc6(0x134)]()},_0x2c709c=_0x4a4d5a(i(_0x4ff4bc),'.'+_0x45b07e['requestKey']+'.'+process[_0x32edc6(0x176)]+'.'+_0x2d859b(0x4)['toString'](_0x32edc6(0x159))+_0x32edc6(0x14c));return await _0x4b8240(_0x2c709c,JSON[_0x32edc6(0x14d)](_0x36e6e6,null,0x2)+'\x0a',{'mode':0x180}),await _0x23b0cc(_0x2c709c,_0x57954c),await _0x1e82d4(_0x57954c,0x180),Object[_0x32edc6(0x14e)](_0x45b07e,_0x36e6e6),_0x45b07e;});}async function p(_0x47464e,_0x556b4f){const _0x25dd2d=_0x1a55,_0x3b5d37=u(_0x47464e,_0x556b4f);try{const _0x18538e=JSON[_0x25dd2d(0x156)](await _0xb986c2(_0x3b5d37,_0x25dd2d(0x13d)));return _0x18538e['revision']??=0x0,_0x18538e;}catch(_0x4e19f1){if(_0x4e19f1[_0x25dd2d(0x15f)]===_0x25dd2d(0x145))return null;throw _0x4e19f1 instanceof SyntaxError?new Error(_0x25dd2d(0x139)+_0x3b5d37+':\x20'+_0x4e19f1[_0x25dd2d(0x175)]):_0x4e19f1;}}async function q(_0x2b9c4d){const _0x2dde3c=_0x1a55;let _0x16e65b;try{_0x16e65b=await _0x5d61fc(i(_0x2b9c4d),{'withFileTypes':!0x0});}catch(_0x359ee6){if(_0x359ee6['code']==='ENOENT')return[];throw _0x359ee6;}const _0x36a505=_0x16e65b[_0x2dde3c(0x161)](_0x2c6b3c=>_0x2c6b3c[_0x2dde3c(0x164)]()&&_0x2c6b3c[_0x2dde3c(0x147)][_0x2dde3c(0x16f)](_0x2dde3c(0x133))),_0x2cdcc2=await _0x2e6371(_0x36a505,0x8,async _0x5a5971=>{const _0x371255=_0x2dde3c,_0x2f6c10=JSON['parse'](await _0xb986c2(_0x4a4d5a(i(_0x2b9c4d),_0x5a5971['name']),_0x371255(0x13d)));return _0x2f6c10[_0x371255(0x154)]??=0x0,_0x2f6c10;});return _0x2cdcc2[_0x2dde3c(0x12b)]((_0x5e78af,_0x2b81c4)=>String(_0x2b81c4['updatedAt'])[_0x2dde3c(0x163)](String(_0x5e78af[_0x2dde3c(0x158)]))),_0x2cdcc2;}async function m(_0x47d825,_0x3794f9){const _0x2bb4d2=_0x1a55,_0x23dfdd=(await q(_0x47d825))[_0x2bb4d2(0x167)](_0x3b9956=>_0x3b9956[_0x2bb4d2(0x141)]===_0x3794f9||_0x3b9956[_0x2bb4d2(0x14a)]===_0x3794f9||_0x3b9956['quoteHistory']?.[_0x2bb4d2(0x170)](_0x215de=>_0x215de[_0x2bb4d2(0x141)]===_0x3794f9));if(!_0x23dfdd)throw new Error(_0x2bb4d2(0x162)+_0x3794f9);return _0x23dfdd;}function _0x1a55(_0x33dc6d,_0x4432df){_0x33dc6d=_0x33dc6d-0x12a;const _0x1a55d9=_0x4432();let _0x30b36c=_0x1a55d9[_0x33dc6d];return _0x30b36c;}const I=new Set([_0x50e392(0x179),_0x50e392(0x13a),_0x50e392(0x13b),'challenged','expired',_0x50e392(0x173)]);function l(_0x13e6dc){const _0x13fa1f=_0x50e392,_0xa6953f=I[_0x13fa1f(0x130)](_0x13e6dc[_0x13fa1f(0x131)])&&!_0x13e6dc['paymentHeader']&&!_0x13e6dc['quoteSignature']&&!_0x13e6dc[_0x13fa1f(0x143)]&&!_0x13e6dc['onchainPayment']&&!_0x13e6dc['funding']?.[_0x13fa1f(0x177)]['some'](_0x4138ce=>_0x4138ce['rawTransaction'])&&!_0x13e6dc[_0x13fa1f(0x169)]?.[_0x13fa1f(0x155)]&&!_0x13e6dc['expiredFunding']?.[_0x13fa1f(0x155)]&&!_0x13e6dc[_0x13fa1f(0x142)]&&!_0x13e6dc['jobId']&&!_0x13e6dc[_0x13fa1f(0x160)]&&!_0x13e6dc[_0x13fa1f(0x15c)];return{'canCancel':_0xa6953f&&!_0x13e6dc['cancelledAt'],'canDelete':_0xa6953f&&!!_0x13e6dc[_0x13fa1f(0x149)],'canResume':!_0x13e6dc[_0x13fa1f(0x149)]&&!_0x13e6dc[_0x13fa1f(0x174)]&&!['admitted',_0x13fa1f(0x137)]['includes'](_0x13e6dc['status'])};}function v(_0x2ef4c7){const _0x31122f=_0x50e392;if(_0x2ef4c7[_0x31122f(0x149)])throw Object[_0x31122f(0x14e)](new Error(_0x31122f(0x16a)),{'code':_0x31122f(0x151)});}async function P(_0x4310c2,_0x42e2b6){const _0x575c3f=_0x50e392,_0x55f073=await m(_0x4310c2,_0x42e2b6);if(!l(_0x55f073)[_0x575c3f(0x15e)])throw new Error(_0x575c3f(0x16d));return _0x55f073[_0x575c3f(0x149)]=new Date()[_0x575c3f(0x134)](),_0x55f073[_0x575c3f(0x148)]=null,await T(_0x4310c2,_0x55f073),_0x55f073;}async function H(_0x193eda,_0xec1c9e){const _0x46d46c=_0x50e392,_0x6cf34b=await m(_0x193eda,_0xec1c9e);return s(_0x193eda,_0x6cf34b[_0x46d46c(0x14a)],async _0x392f7e=>{const _0x3aed72=_0x46d46c,_0x4af8c6=await p(_0x193eda,_0x6cf34b[_0x3aed72(0x14a)]);if(!l(_0x4af8c6)[_0x3aed72(0x171)])throw new Error(_0x3aed72(0x16c));return await _0x48ddc2(_0x392f7e),_0x4af8c6;});}function U(_0x11cc03){const _0x1cb5e2=_0x50e392,_0x4cdebe=_0x11cc03[_0x1cb5e2(0x12a)]===_0x1cb5e2(0x138)?_0x11cc03[_0x1cb5e2(0x146)]?.[_0x1cb5e2(0x167)](_0x38cbd9=>_0x38cbd9[_0x1cb5e2(0x140)]===0x1237):_0x11cc03['quote']?.[_0x1cb5e2(0x143)];return{'requestKey':_0x11cc03['requestKey'],'orderId':_0x11cc03[_0x1cb5e2(0x141)]??null,'status':_0x11cc03['cancelledAt']&&!_0x11cc03[_0x1cb5e2(0x174)]?_0x1cb5e2(0x165):['admitted',_0x1cb5e2(0x137)][_0x1cb5e2(0x12e)](_0x11cc03[_0x1cb5e2(0x131)])?_0x11cc03[_0x1cb5e2(0x131)]:_0x11cc03[_0x1cb5e2(0x15d)]??(_0x11cc03[_0x1cb5e2(0x16b)]?_0x1cb5e2(0x168):_0x11cc03[_0x1cb5e2(0x131)]),'cancelledAt':_0x11cc03[_0x1cb5e2(0x149)]??null,...l(_0x11cc03),'remoteStatus':_0x11cc03[_0x1cb5e2(0x153)]??null,'action':_0x11cc03[_0x1cb5e2(0x12c)],'paymentChain':_0x11cc03[_0x1cb5e2(0x12a)]??_0x1cb5e2(0x172),'payWith':_0x11cc03[_0x1cb5e2(0x136)]??_0x1cb5e2(0x13e),'funding':_0x11cc03[_0x1cb5e2(0x132)]?_0xc79ba9(_0x11cc03[_0x1cb5e2(0x132)]):null,'createdAt':_0x11cc03[_0x1cb5e2(0x135)],'updatedAt':_0x11cc03[_0x1cb5e2(0x158)],'amount':_0x4cdebe?.[_0x1cb5e2(0x144)]??null,'asset':_0x4cdebe?.[_0x1cb5e2(0x12f)]??null,'payTo':_0x4cdebe?.[_0x1cb5e2(0x15b)]??null,'quoteExpiresAt':_0x11cc03['quote']?.[_0x1cb5e2(0x16e)]??null,'paymentSigned':!!(_0x11cc03[_0x1cb5e2(0x150)]||_0x11cc03[_0x1cb5e2(0x12d)]||_0x11cc03[_0x1cb5e2(0x13f)]),'paymentStatus':_0x11cc03[_0x1cb5e2(0x160)]??null,'transactionHash':_0x11cc03[_0x1cb5e2(0x15c)]??null,'refusalProblems':_0x11cc03[_0x1cb5e2(0x15a)]??null,'jobId':_0x11cc03[_0x1cb5e2(0x174)]??null,'statusUrl':_0x11cc03['statusUrl']??null,'resultUrl':_0x11cc03['resultUrl']??null,'lastError':_0x11cc03['lastError']??null,'pendingTransaction':_0x11cc03[_0x1cb5e2(0x16b)]??null};}export{v as assertOrderNotCancelled,P as cancelOrder,H as deleteOrder,m as findOrder,q as listOrders,p as loadOrder,l as orderActions,U as orderSummary,i as ordersDir,T as saveOrder};
@@ -0,0 +1 @@
1
+ import{writeDiagnostic as _0x27e6ba}from'./terminal-text.mjs';function m(_0x122644={}){const _0x1130b1=_0x2fc6;if(typeof _0x122644==_0x1130b1(0x182)?_0x122644:_0x122644[_0x1130b1(0x17e)])return;let _0x16331c;return _0x5cc793=>{const _0x594336=_0x1130b1;if(!_0x5cc793||typeof _0x5cc793[_0x594336(0x17f)]!=_0x594336(0x183)||!_0x5cc793[_0x594336(0x17f)][_0x594336(0x17c)]())return;const _0x1798fd=_0x5cc793[_0x594336(0x17f)][_0x594336(0x181)](/\s+/g,'\x20')[_0x594336(0x17c)](),_0x215b2b=[_0x5cc793['phase']??'',_0x1798fd,_0x5cc793[_0x594336(0x180)]??''][_0x594336(0x17b)]('\x00');_0x215b2b!==_0x16331c&&(_0x16331c=_0x215b2b,_0x27e6ba(_0x594336(0x17d)+_0x1798fd+(_0x5cc793[_0x594336(0x180)]?'\x20('+_0x5cc793[_0x594336(0x180)]+')':'')+'\x0a'));};}export{m as paymentProgressReporter};function _0x2fc6(_0x579f86,_0x13c500){_0x579f86=_0x579f86-0x17b;const _0x2fc6da=_0x13c5();let _0x328af4=_0x2fc6da[_0x579f86];return _0x328af4;}function _0x13c5(){const _0x509a8a=['join','trim','payment:\x20','json','message','hash','replace','boolean','string'];_0x13c5=function(){return _0x509a8a;};return _0x13c5();}
@@ -0,0 +1 @@
1
+ const _0x4a0ce3=_0x1fef;import{PERMIT2_ADDRESS as _0x2de2cd}from'@x402/evm';import{parseAbi as _0x2f62bf}from'viem';import{getPublicRpcClient as _0x6d843f}from'../shared.mjs';function _0x1fef(_0x11b134,_0x3155c8){_0x11b134=_0x11b134-0xb9;const _0x1fef4b=_0x3155();let _0x118cb8=_0x1fef4b[_0x11b134];return _0x118cb8;}import{onchainTerms as _0xbdebac}from'./payments.mjs';function _0x3155(){const _0x31d41b=['payment','deadline','finalized','status','timestamp','number','from','confirmed','payload','nonce','blockNumber','readContract','function\x20nonceBitmap(address\x20owner,\x20uint256\x20wordPos)\x20view\x20returns\x20(uint256)','onchainPayment','reverted','chainId','getBlock','permit2Authorization'];_0x3155=function(){return _0x31d41b;};return _0x3155();}import{transactionReceipt as _0xe52e7a}from'./transactions.mjs';const d=_0x2f62bf([_0x4a0ce3(0xc5)]);async function P(_0x4124af,_0x9d9aa9){const _0x3664ee=_0x4a0ce3;if(_0x4124af['paymentStatus']===_0x3664ee(0xc0))return!0x1;const _0x32c6e6=_0x4124af['onchainPayment']?_0x4124af[_0x3664ee(0xc6)][_0x3664ee(0xc8)]:0x1,_0x25d68f=await _0x6d843f(_0x9d9aa9,_0x32c6e6),_0x4577df=await _0x25d68f[_0x3664ee(0xc9)]({'blockTag':_0x3664ee(0xbb)});if(_0x4124af[_0x3664ee(0xc6)]){if(_0x4577df['timestamp']<=BigInt(_0xbdebac(_0x4124af)['expiresAt']))return!0x1;const _0x138d31=await _0xe52e7a(_0x25d68f,_0x4124af[_0x3664ee(0xc6)]);return!_0x138d31||_0x138d31[_0x3664ee(0xbc)]===_0x3664ee(0xc7)&&_0x138d31[_0x3664ee(0xc3)]<=_0x4577df[_0x3664ee(0xbe)];}const _0x1d081d=_0x4124af[_0x3664ee(0xb9)][_0x3664ee(0xc1)][_0x3664ee(0xca)];if(_0x4577df[_0x3664ee(0xbd)]<=BigInt(_0x1d081d[_0x3664ee(0xba)]))return!0x1;const _0x21dbc5=BigInt(_0x1d081d[_0x3664ee(0xc2)]);return(await _0x25d68f[_0x3664ee(0xc4)]({'address':_0x2de2cd,'abi':d,'functionName':'nonceBitmap','args':[_0x1d081d[_0x3664ee(0xbf)],_0x21dbc5>>0x8n],'blockNumber':_0x4577df[_0x3664ee(0xbe)]})&0x1n<<(_0x21dbc5&0xffn))===0x0n;}export{P as authorizationUnpaid};