@lovrabet/rabetbase-cli 2.5.3-beta.3 → 2.5.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.
Files changed (361) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/index.js +1 -1
  26. package/lib/commands/app/list.js +1 -1
  27. package/lib/commands/app/members-list.js +1 -1
  28. package/lib/commands/app/remote-directory.js +1 -1
  29. package/lib/commands/app/shared.js +1 -1
  30. package/lib/commands/app-config/delete.js +1 -1
  31. package/lib/commands/app-config/get.js +1 -1
  32. package/lib/commands/app-config/index.js +1 -1
  33. package/lib/commands/app-config/list.js +1 -1
  34. package/lib/commands/app-config/set.js +1 -1
  35. package/lib/commands/app-config/shared.js +1 -1
  36. package/lib/commands/auth/index.js +1 -1
  37. package/lib/commands/bff/create.js +1 -1
  38. package/lib/commands/bff/delete.js +1 -1
  39. package/lib/commands/bff/detail.js +1 -1
  40. package/lib/commands/bff/index.js +1 -1
  41. package/lib/commands/bff/list.js +1 -1
  42. package/lib/commands/bff/logs.js +1 -1
  43. package/lib/commands/bff/pull.js +1 -1
  44. package/lib/commands/bff/push.js +1 -1
  45. package/lib/commands/bff/status.js +1 -1
  46. package/lib/commands/cli-skill/index.js +1 -1
  47. package/lib/commands/cli-update.js +1 -1
  48. package/lib/commands/codegen/index.js +1 -1
  49. package/lib/commands/codegen/sdk.js +1 -1
  50. package/lib/commands/codegen/sql.js +1 -1
  51. package/lib/commands/common/app-registry.js +1 -1
  52. package/lib/commands/common/app-selector.js +1 -1
  53. package/lib/commands/common/async-task.js +1 -1
  54. package/lib/commands/common/dry-run.js +1 -1
  55. package/lib/commands/common/flags.js +1 -1
  56. package/lib/commands/common/local-file.js +1 -1
  57. package/lib/commands/common/validate.js +1 -1
  58. package/lib/commands/config/delete.js +1 -1
  59. package/lib/commands/config/get.js +1 -1
  60. package/lib/commands/config/index.js +1 -1
  61. package/lib/commands/config/init.js +1 -1
  62. package/lib/commands/config/list.js +1 -1
  63. package/lib/commands/config/set.js +1 -1
  64. package/lib/commands/config/shared.js +1 -1
  65. package/lib/commands/dataset/batch-design.js +1 -1
  66. package/lib/commands/dataset/business-group-update.js +1 -1
  67. package/lib/commands/dataset/business-groups.js +1 -1
  68. package/lib/commands/dataset/capability.js +1 -1
  69. package/lib/commands/dataset/cross-relation-create.js +1 -1
  70. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  71. package/lib/commands/dataset/cross-relation-list.js +1 -1
  72. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  73. package/lib/commands/dataset/cross-relation-update.js +1 -1
  74. package/lib/commands/dataset/delete.js +1 -1
  75. package/lib/commands/dataset/detail.js +1 -1
  76. package/lib/commands/dataset/extend-update.js +1 -1
  77. package/lib/commands/dataset/field-restore.js +1 -1
  78. package/lib/commands/dataset/field-update.js +1 -1
  79. package/lib/commands/dataset/generate.js +1 -1
  80. package/lib/commands/dataset/index.js +1 -1
  81. package/lib/commands/dataset/list.js +1 -1
  82. package/lib/commands/dataset/operations.js +1 -1
  83. package/lib/commands/dataset/relation-audit.js +1 -1
  84. package/lib/commands/dataset/relation-create.js +1 -1
  85. package/lib/commands/dataset/relation-delete.js +1 -1
  86. package/lib/commands/dataset/relation-shared.js +1 -1
  87. package/lib/commands/dataset/relation-update.js +1 -1
  88. package/lib/commands/dataset/relations.js +1 -1
  89. package/lib/commands/dataset/rename.js +1 -1
  90. package/lib/commands/dataset/restore.js +1 -1
  91. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  92. package/lib/commands/db/analysis-batching.js +1 -1
  93. package/lib/commands/db/analyze-batch-plan.js +1 -1
  94. package/lib/commands/db/analyze-cancel.js +1 -1
  95. package/lib/commands/db/analyze-start.js +1 -1
  96. package/lib/commands/db/analyze-status.js +1 -1
  97. package/lib/commands/db/create.js +1 -1
  98. package/lib/commands/db/delete.js +1 -1
  99. package/lib/commands/db/detail.js +1 -1
  100. package/lib/commands/db/diff-refresh-start.js +1 -1
  101. package/lib/commands/db/diff-refresh-status.js +1 -1
  102. package/lib/commands/db/diff.js +1 -1
  103. package/lib/commands/db/index.js +1 -1
  104. package/lib/commands/db/list.js +1 -1
  105. package/lib/commands/db/shared.js +1 -1
  106. package/lib/commands/db/table-diff-shared.js +1 -1
  107. package/lib/commands/db/tables.js +1 -1
  108. package/lib/commands/db/test.js +1 -1
  109. package/lib/commands/db/update.js +1 -1
  110. package/lib/commands/deployment/index.js +1 -1
  111. package/lib/commands/deployment/sync-all.js +1 -1
  112. package/lib/commands/deployment/sync-jobs.js +1 -1
  113. package/lib/commands/deployment/sync-status.js +1 -1
  114. package/lib/commands/doctor.js +1 -1
  115. package/lib/commands/file/index.js +1 -1
  116. package/lib/commands/flow/create.js +1 -1
  117. package/lib/commands/flow/detail.js +1 -1
  118. package/lib/commands/flow/index.js +1 -1
  119. package/lib/commands/flow/list.js +1 -1
  120. package/lib/commands/flow/publish.js +1 -1
  121. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  122. package/lib/commands/flow/runtime-role-list.js +1 -1
  123. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  124. package/lib/commands/flow/runtime-user-search.js +1 -1
  125. package/lib/commands/flow/shared.js +1 -1
  126. package/lib/commands/flow/update.js +1 -1
  127. package/lib/commands/flow/validate.js +1 -1
  128. package/lib/commands/instant-api-policy/current.js +1 -1
  129. package/lib/commands/instant-api-policy/index.js +1 -1
  130. package/lib/commands/instant-api-policy/init.js +1 -1
  131. package/lib/commands/instant-api-policy/publish.js +1 -1
  132. package/lib/commands/instant-api-policy/pull.js +1 -1
  133. package/lib/commands/instant-api-policy/revision.js +1 -1
  134. package/lib/commands/instant-api-policy/revisions.js +1 -1
  135. package/lib/commands/instant-api-policy/rollback.js +1 -1
  136. package/lib/commands/instant-api-policy/shared.js +1 -1
  137. package/lib/commands/instant-api-policy/validate.js +1 -1
  138. package/lib/commands/issue/index.js +1 -1
  139. package/lib/commands/issue/nudge.js +1 -1
  140. package/lib/commands/issue/report.js +1 -1
  141. package/lib/commands/issue/shared.js +1 -1
  142. package/lib/commands/kb/create.js +1 -1
  143. package/lib/commands/kb/delete.js +1 -1
  144. package/lib/commands/kb/detail.js +1 -1
  145. package/lib/commands/kb/index.js +1 -1
  146. package/lib/commands/kb/list.js +1 -1
  147. package/lib/commands/kb/search.js +1 -1
  148. package/lib/commands/kb/shared.js +1 -1
  149. package/lib/commands/kb/update.js +1 -1
  150. package/lib/commands/logs/index.js +1 -1
  151. package/lib/commands/menu/asset-update.js +1 -1
  152. package/lib/commands/menu/delete.js +1 -1
  153. package/lib/commands/menu/external-link-create.js +1 -1
  154. package/lib/commands/menu/external-link-update.js +1 -1
  155. package/lib/commands/menu/group-create.js +1 -1
  156. package/lib/commands/menu/group-update.js +1 -1
  157. package/lib/commands/menu/index.js +1 -1
  158. package/lib/commands/menu/list.js +1 -1
  159. package/lib/commands/menu/move.js +1 -1
  160. package/lib/commands/menu/regroup-start.js +1 -1
  161. package/lib/commands/menu/rename.js +1 -1
  162. package/lib/commands/menu/shared/compare-table.js +1 -1
  163. package/lib/commands/menu/shared/delete-plan.js +1 -1
  164. package/lib/commands/menu/shared/facts.js +1 -1
  165. package/lib/commands/menu/shared/index.js +1 -1
  166. package/lib/commands/menu/shared/inquirer.js +1 -1
  167. package/lib/commands/menu/shared/local-pages.js +1 -1
  168. package/lib/commands/menu/shared/logic.js +1 -1
  169. package/lib/commands/menu/shared/mutations.js +1 -1
  170. package/lib/commands/menu/shared/service.js +1 -1
  171. package/lib/commands/menu/shared/sync-core.js +1 -1
  172. package/lib/commands/menu/shared/update-core.js +1 -1
  173. package/lib/commands/menu/shared/valid-url.js +1 -1
  174. package/lib/commands/menu/sync.js +1 -1
  175. package/lib/commands/menu/visibility-update.js +1 -1
  176. package/lib/commands/notification/config-create.js +1 -1
  177. package/lib/commands/notification/config-delete.js +1 -1
  178. package/lib/commands/notification/config-list.js +1 -1
  179. package/lib/commands/notification/config-update.js +1 -1
  180. package/lib/commands/notification/index.js +1 -1
  181. package/lib/commands/notification/shared.js +1 -1
  182. package/lib/commands/ocr/index.js +1 -1
  183. package/lib/commands/page/create.js +1 -1
  184. package/lib/commands/page/custom/detail.js +1 -1
  185. package/lib/commands/page/custom/list.js +1 -1
  186. package/lib/commands/page/custom/publish.js +1 -1
  187. package/lib/commands/page/custom/shared.js +1 -1
  188. package/lib/commands/page/custom/syntax.js +1 -1
  189. package/lib/commands/page/custom/update.js +1 -1
  190. package/lib/commands/page/data-list-status.js +1 -1
  191. package/lib/commands/page/generate-start.js +1 -1
  192. package/lib/commands/page/generate-status.js +1 -1
  193. package/lib/commands/page/index.js +1 -1
  194. package/lib/commands/page/pull.js +1 -1
  195. package/lib/commands/page/push.js +1 -1
  196. package/lib/commands/page/relation-audit.js +1 -1
  197. package/lib/commands/page/restore.js +1 -1
  198. package/lib/commands/page/shared.js +1 -1
  199. package/lib/commands/page/sync.js +1 -1
  200. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  201. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  202. package/lib/commands/project/create/format-elapsed.js +1 -1
  203. package/lib/commands/project/create/main.js +1 -1
  204. package/lib/commands/project/create/materialize-project-template.js +1 -1
  205. package/lib/commands/project/create/project-name.js +1 -1
  206. package/lib/commands/project/create/project-template-archive.js +1 -1
  207. package/lib/commands/project/create/project-template-path.js +1 -1
  208. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  209. package/lib/commands/project/create/use-format-code.js +1 -1
  210. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  211. package/lib/commands/project/domain-routing-sync.js +1 -1
  212. package/lib/commands/project/index.js +1 -1
  213. package/lib/commands/project/upgrade.js +1 -1
  214. package/lib/commands/registry.js +1 -1
  215. package/lib/commands/role/delete.js +1 -1
  216. package/lib/commands/role/detail.js +1 -1
  217. package/lib/commands/role/index.js +1 -1
  218. package/lib/commands/role/list.js +1 -1
  219. package/lib/commands/role/shared.js +1 -1
  220. package/lib/commands/role/update.js +1 -1
  221. package/lib/commands/role/user-add.js +1 -1
  222. package/lib/commands/role/user-remove.js +1 -1
  223. package/lib/commands/role/user-resolve.js +1 -1
  224. package/lib/commands/rule/get.js +1 -1
  225. package/lib/commands/rule/index.js +1 -1
  226. package/lib/commands/rule/list.js +1 -1
  227. package/lib/commands/rule/set.js +1 -1
  228. package/lib/commands/rule/shared.js +1 -1
  229. package/lib/commands/run/index.js +1 -1
  230. package/lib/commands/schema.js +1 -1
  231. package/lib/commands/sql/create.js +1 -1
  232. package/lib/commands/sql/delete.js +1 -1
  233. package/lib/commands/sql/detail.js +1 -1
  234. package/lib/commands/sql/exec.js +1 -1
  235. package/lib/commands/sql/index.js +1 -1
  236. package/lib/commands/sql/list.js +1 -1
  237. package/lib/commands/sql/pull.js +1 -1
  238. package/lib/commands/sql/push.js +1 -1
  239. package/lib/commands/sql/shared.js +1 -1
  240. package/lib/commands/sql/status.js +1 -1
  241. package/lib/commands/sql/validate.js +1 -1
  242. package/lib/commands/task/index.js +1 -1
  243. package/lib/commands/task/status.js +1 -1
  244. package/lib/commands/tenant/index.js +1 -1
  245. package/lib/commands/tenant/members-list.js +1 -1
  246. package/lib/commands/tenant/shared.js +1 -1
  247. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  248. package/lib/commands/user-account/index.js +1 -1
  249. package/lib/commands/workspace/add.js +1 -1
  250. package/lib/commands/workspace/index.js +1 -1
  251. package/lib/commands/workspace/remove.js +1 -1
  252. package/lib/config/domain-config.js +1 -1
  253. package/lib/config/project-domain-routing.js +1 -1
  254. package/lib/config/region-config.js +1 -1
  255. package/lib/config/schema.js +1 -1
  256. package/lib/constant/cdn.d.ts +5 -3
  257. package/lib/constant/cdn.js +1 -1
  258. package/lib/constant/cli.js +1 -1
  259. package/lib/constant/defaults.js +1 -1
  260. package/lib/constant/domain.js +1 -1
  261. package/lib/constant/env.js +1 -1
  262. package/lib/constant/output.js +1 -1
  263. package/lib/constant/paths.js +1 -1
  264. package/lib/constant/region.js +1 -1
  265. package/lib/constant/risk.js +1 -1
  266. package/lib/constant/routing-profile.js +1 -1
  267. package/lib/context/app-resolver.js +1 -1
  268. package/lib/context/auth-resolver.js +1 -1
  269. package/lib/context/config-loader.js +1 -1
  270. package/lib/context.js +1 -1
  271. package/lib/core/alias-resolver.js +1 -1
  272. package/lib/core/api-client.js +1 -1
  273. package/lib/core/bff/config.js +1 -1
  274. package/lib/core/bff/file-system.js +1 -1
  275. package/lib/core/bff/hash.js +1 -1
  276. package/lib/core/bff/hook-directory.js +1 -1
  277. package/lib/core/bff/lock.js +1 -1
  278. package/lib/core/bff/utils.js +1 -1
  279. package/lib/core/cross-db-relation.js +1 -1
  280. package/lib/core/db-resolver.js +1 -1
  281. package/lib/core/flow-config.js +1 -1
  282. package/lib/core/instant-api-policy/config.js +1 -1
  283. package/lib/core/kb-search-client.js +1 -1
  284. package/lib/core/page/file-system.js +1 -1
  285. package/lib/core/page/hash.js +1 -1
  286. package/lib/core/page/lock.js +1 -1
  287. package/lib/core/page/lr-smart-jsx.js +1 -1
  288. package/lib/core/sql-index-auditor.js +1 -1
  289. package/lib/core/sql-sync/config.js +1 -1
  290. package/lib/core/sql-sync/file-system.js +1 -1
  291. package/lib/core/sql-sync/hash.js +1 -1
  292. package/lib/core/sql-sync/lock.js +1 -1
  293. package/lib/core/sql-sync/utils.js +1 -1
  294. package/lib/core/sql-validator.js +1 -1
  295. package/lib/errors.js +1 -1
  296. package/lib/framework/build-all-flags.js +1 -1
  297. package/lib/framework/error-output.js +1 -1
  298. package/lib/framework/explicit-yes.js +1 -1
  299. package/lib/framework/flags.js +1 -1
  300. package/lib/framework/help.js +1 -1
  301. package/lib/framework/index.js +1 -1
  302. package/lib/framework/output.js +1 -1
  303. package/lib/framework/response.js +1 -1
  304. package/lib/framework/runner-alias.js +1 -1
  305. package/lib/framework/runner.js +1 -1
  306. package/lib/framework/schema-export.js +1 -1
  307. package/lib/framework/supported-flags.js +1 -1
  308. package/lib/framework/types.js +1 -1
  309. package/lib/generated/build-info.d.ts +4 -4
  310. package/lib/generated/build-info.js +1 -1
  311. package/lib/generated/official-routing.js +1 -1
  312. package/lib/generated/routing-contract.js +1 -1
  313. package/lib/help.js +1 -1
  314. package/lib/postinstall.js +1 -1
  315. package/lib/runtime/confirmation.js +1 -1
  316. package/lib/runtime/event.js +1 -1
  317. package/lib/runtime/index.js +1 -1
  318. package/lib/runtime/queue.js +1 -1
  319. package/lib/runtime/resolve.js +1 -1
  320. package/lib/skills/builtin-skill.js +1 -1
  321. package/lib/skills/main.js +1 -1
  322. package/lib/skills/npx-skills-add.js +1 -1
  323. package/lib/skills/skill-presence.js +1 -1
  324. package/lib/telemetry/cli-command-trace.js +1 -1
  325. package/lib/telemetry/cli-help-trace.js +1 -1
  326. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  327. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  328. package/lib/telemetry/send-cli-trace-log.js +1 -1
  329. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  330. package/lib/utils/ai_config.js +1 -1
  331. package/lib/utils/apply-jq-filter.js +1 -1
  332. package/lib/utils/cdn-config.js +1 -1
  333. package/lib/utils/check-sdk-version.js +1 -1
  334. package/lib/utils/cli-version-check.js +1 -1
  335. package/lib/utils/cli-version-policy.d.ts +7 -0
  336. package/lib/utils/cli-version-policy.js +1 -1
  337. package/lib/utils/config.js +1 -1
  338. package/lib/utils/entity-with-id.js +1 -1
  339. package/lib/utils/file-utils.js +1 -1
  340. package/lib/utils/guides-cdn.js +1 -1
  341. package/lib/utils/http-client.js +1 -1
  342. package/lib/utils/is-non-interactive.js +1 -1
  343. package/lib/utils/logger.js +1 -1
  344. package/lib/utils/params.js +1 -1
  345. package/lib/utils/platform.js +1 -1
  346. package/lib/utils/sleep.js +1 -1
  347. package/lib/utils/template-replacer.js +1 -1
  348. package/lib/utils/update-notice.js +1 -1
  349. package/lib/utils/version.js +1 -1
  350. package/lib/utils/with-active-cookie.js +1 -1
  351. package/lib/utils/write-cli-side-channel.js +1 -1
  352. package/package.json +3 -1
  353. package/skills/rabetbase/SKILL.md +7 -5
  354. package/skills/rabetbase/guides/backend-function.md +5 -1
  355. package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
  356. package/skills/rabetbase/guides/cross-database-bff.md +70 -0
  357. package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
  358. package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
  359. package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +5 -1
  360. package/skills/rabetbase.manifest.json +4 -3
  361. package/templates/README.md +41 -13
@@ -1 +1 @@
1
- const a282_0x58b8a3=a282_0x5e02;(function(_0x594159,_0x24c9af){const _0xde3e9a=a282_0x5e02,_0x331b77=_0x594159();while(!![]){try{const _0x2d7b41=parseInt(_0xde3e9a(0x170))/0x1*(-parseInt(_0xde3e9a(0x156))/0x2)+parseInt(_0xde3e9a(0x182))/0x3+-parseInt(_0xde3e9a(0x18d))/0x4+-parseInt(_0xde3e9a(0x171))/0x5*(parseInt(_0xde3e9a(0x16d))/0x6)+-parseInt(_0xde3e9a(0x16e))/0x7*(-parseInt(_0xde3e9a(0x193))/0x8)+-parseInt(_0xde3e9a(0x163))/0x9*(-parseInt(_0xde3e9a(0x159))/0xa)+parseInt(_0xde3e9a(0x172))/0xb;if(_0x2d7b41===_0x24c9af)break;else _0x331b77['push'](_0x331b77['shift']());}catch(_0x40da08){_0x331b77['push'](_0x331b77['shift']());}}}(a282_0x5827,0xc6fb3));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a282_0x58b8a3(0x16b);function a282_0x5e02(_0x5664e5,_0x2c1bb6){_0x5664e5=_0x5664e5-0x155;const _0x582753=a282_0x5827();let _0x5e02e0=_0x582753[_0x5664e5];return _0x5e02e0;}export const INSTANT_API_POLICY_FILE_NAME=a282_0x58b8a3(0x179);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0xdbaa11,_0x5e9f9c,_0x3ba012){return new CliError(_0xdbaa11,0x1,_0x5e9f9c,_0x3ba012);}export function loadInstantApiPolicyLocalConfig(_0x3b61a6,_0xf24d94){assertSafeAppCode(_0x3b61a6);const _0x2420e8=resolve(_0xf24d94??findProjectRootDirectory()),_0x177fd5=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x3b61a6+'/'+INSTANT_API_POLICY_FILE_NAME,_0xf356b8=resolve(_0x2420e8,INSTANT_API_POLICY_RELATIVE_ROOT,_0x3b61a6),_0x1a5b81=resolve(_0xf356b8,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x2420e8,'appCode':_0x3b61a6,'policyRoot':_0xf356b8,'policyFilePath':_0x1a5b81,'policyRelativePath':_0x177fd5};}export function createDefaultInstantApiPolicyConfig(_0x35b8d7,_0x63269e=a282_0x58b8a3(0x180)){return assertSafeAppCode(_0x35b8d7),{'version':'2','appCode':_0x35b8d7,'defaults':{'instantApi':_0x63269e},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x13d0eb){const _0x5e06f4=a282_0x58b8a3;let _0x3c2dea;try{_0x3c2dea=await stat(_0x13d0eb[_0x5e06f4(0x173)]);}catch(_0x29f537){throw instantApiPolicyError(_0x5e06f4(0x15d),_0x5e06f4(0x189)+_0x13d0eb[_0x5e06f4(0x173)],_0x5e06f4(0x16a));}if(!_0x3c2dea['isFile']())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x5e06f4(0x177)+_0x13d0eb[_0x5e06f4(0x173)]);if(_0x3c2dea['size']>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x5e06f4(0x188),_0x5e06f4(0x157));let _0x508b89;try{_0x508b89=await readFile(_0x13d0eb[_0x5e06f4(0x173)]);}catch{throw instantApiPolicyError(_0x5e06f4(0x15f),_0x5e06f4(0x18c)+_0x13d0eb[_0x5e06f4(0x173)]);}if(_0x508b89[_0x5e06f4(0x169)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x5e06f4(0x157));let _0x365c84;try{_0x365c84=new TextDecoder(_0x5e06f4(0x166),{'fatal':!![],'ignoreBOM':!![]})[_0x5e06f4(0x178)](_0x508b89);}catch{throw instantApiPolicyError(_0x5e06f4(0x161),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x13d0eb[_0x5e06f4(0x173)]);}let _0x4f0b8d;try{_0x4f0b8d=JSON['parse'](_0x365c84);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x13d0eb[_0x5e06f4(0x173)]);}return assertLocalPolicyContract(_0x4f0b8d,_0x13d0eb[_0x5e06f4(0x167)]);}export async function writeInstantApiPolicyConfigFile(_0xb4c534,_0x26eb75,_0x430f39={}){const _0x1ccf3e=a282_0x58b8a3,_0x3007e1=assertLocalPolicyContract(_0x26eb75,_0xb4c534[_0x1ccf3e(0x167)]),_0x5c7643=JSON[_0x1ccf3e(0x15c)](_0x3007e1,null,0x2)+'\x0a';if(Buffer[_0x1ccf3e(0x169)](_0x5c7643,_0x1ccf3e(0x165))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1ccf3e(0x188),_0x1ccf3e(0x157));await mkdir(_0xb4c534[_0x1ccf3e(0x195)],{'recursive':!![]});let _0x517997;try{_0x517997=await readFile(_0xb4c534[_0x1ccf3e(0x173)],'utf8');}catch(_0x171aa6){if(!isMissingFile(_0x171aa6))throw instantApiPolicyError(_0x1ccf3e(0x15f),_0x1ccf3e(0x174)+_0xb4c534[_0x1ccf3e(0x173)]);}if(_0x517997===_0x5c7643)return{'action':_0x1ccf3e(0x17d),'filePath':_0xb4c534[_0x1ccf3e(0x173)]};if(_0x517997!==undefined&&!_0x430f39['force'])throw instantApiPolicyError(_0x1ccf3e(0x17f),_0x1ccf3e(0x18a)+_0xb4c534['policyFilePath'],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x517997===undefined)try{return await writeFile(_0xb4c534[_0x1ccf3e(0x173)],_0x5c7643,{'encoding':_0x1ccf3e(0x165),'flag':'wx'}),{'action':_0x1ccf3e(0x15a),'filePath':_0xb4c534[_0x1ccf3e(0x173)]};}catch(_0x197c2b){if(!isAlreadyExists(_0x197c2b))throw instantApiPolicyError(_0x1ccf3e(0x18f),_0x1ccf3e(0x15e)+_0xb4c534['policyFilePath']);if(!_0x430f39[_0x1ccf3e(0x18b)])throw instantApiPolicyError(_0x1ccf3e(0x17f),_0x1ccf3e(0x16f)+_0xb4c534[_0x1ccf3e(0x173)],_0x1ccf3e(0x184));}const _0x474ce6=resolve(dirname(_0xb4c534[_0x1ccf3e(0x173)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x1ccf3e(0x17a)]+'.'+randomUUID()+_0x1ccf3e(0x168));try{await writeFile(_0x474ce6,_0x5c7643,{'encoding':'utf8','flag':'wx'}),await rename(_0x474ce6,_0xb4c534['policyFilePath']);}catch{await unlink(_0x474ce6)[_0x1ccf3e(0x15b)](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x1ccf3e(0x160)+_0xb4c534['policyFilePath']);}return{'action':_0x1ccf3e(0x158),'filePath':_0xb4c534[_0x1ccf3e(0x173)]};}function assertSafeAppCode(_0x2a9a2b){const _0x307080=a282_0x58b8a3,_0x2b49f9=_0x2a9a2b[_0x307080(0x186)]();if(!_0x2b49f9||_0x2b49f9!==_0x2a9a2b||_0x2b49f9['length']>0x64||_0x2b49f9==='.'||_0x2b49f9==='..'||_0x2b49f9[_0x307080(0x175)]('/')||_0x2b49f9[_0x307080(0x175)]('\x5c')||_0x2b49f9[_0x307080(0x175)]('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0x307080(0x17c));}function assertLocalPolicyContract(_0x26be5f,_0x2336ad){const _0x46f0d7=a282_0x58b8a3;if(!isObject(_0x26be5f))throw instantApiPolicyError(_0x46f0d7(0x164),_0x46f0d7(0x16c));if(_0x26be5f[_0x46f0d7(0x183)]!=='1'&&_0x26be5f[_0x46f0d7(0x183)]!=='2')throw instantApiPolicyError(_0x46f0d7(0x176),_0x46f0d7(0x187),_0x46f0d7(0x194));if(_0x26be5f['appCode']!==_0x2336ad)throw instantApiPolicyError(_0x46f0d7(0x17e),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x2336ad+'.');if(!isObject(_0x26be5f[_0x46f0d7(0x155)])||typeof _0x26be5f[_0x46f0d7(0x155)][_0x46f0d7(0x192)]!==_0x46f0d7(0x181))throw instantApiPolicyError(_0x46f0d7(0x17b),_0x46f0d7(0x162));if(_0x26be5f[_0x46f0d7(0x190)]!==undefined&&_0x26be5f[_0x46f0d7(0x190)]!==null&&!Array['isArray'](_0x26be5f[_0x46f0d7(0x190)]))throw instantApiPolicyError(_0x46f0d7(0x185),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x26be5f;}function isObject(_0x246734){const _0x14438d=a282_0x58b8a3;return _0x246734!==null&&typeof _0x246734==='object'&&!Array[_0x14438d(0x191)](_0x246734);}function isMissingFile(_0x2ffb5c){const _0x1af9da=a282_0x58b8a3;return Boolean(_0x2ffb5c&&typeof _0x2ffb5c==='object'&&_0x2ffb5c[_0x1af9da(0x18e)]==='ENOENT');}function a282_0x5827(){const _0x210539=['policyRoot','defaults','24xvQpbo','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','overwritten','2320gZINgP','created','catch','stringify','instant_api_policy_file_missing','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_unreadable','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_invalid','Policy\x20defaults.instantApi\x20is\x20required.','16236SSVrHZ','instant_api_policy_json_invalid','utf8','utf-8','appCode','.tmp','byteLength','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','.rabetbase/instant-api-policy','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','5547480eMasCI','4713877WJTmze','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','23953YofBmJ','5bpcJtE','5306664Chalme','policyFilePath','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','includes','instant_api_policy_version_invalid','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','decode','policy.json','pid','instant_api_policy_defaults_invalid','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','unchanged','instant_api_policy_app_code_mismatch','instant_api_policy_file_exists','allow','string','2945232hjmWiB','version','Review\x20the\x20file\x20before\x20retrying.','instant_api_policy_rules_invalid','trim','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','force','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','4809900BpzWiS','code','instant_api_policy_file_unwritable','rules','isArray','instantApi','16nSQpQI','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.'];a282_0x5827=function(){return _0x210539;};return a282_0x5827();}function isAlreadyExists(_0x18a63e){const _0x3b1642=a282_0x58b8a3;return Boolean(_0x18a63e&&typeof _0x18a63e==='object'&&_0x18a63e[_0x3b1642(0x18e)]==='EEXIST');}
1
+ const a282_0x3fc5f5=a282_0x107c;(function(_0x2526a6,_0x453625){const _0x461f9d=a282_0x107c,_0x5838da=_0x2526a6();while(!![]){try{const _0x4bfef7=parseInt(_0x461f9d(0x1bd))/0x1+parseInt(_0x461f9d(0x181))/0x2+-parseInt(_0x461f9d(0x183))/0x3*(parseInt(_0x461f9d(0x1c1))/0x4)+parseInt(_0x461f9d(0x1c0))/0x5*(-parseInt(_0x461f9d(0x19f))/0x6)+-parseInt(_0x461f9d(0x1b4))/0x7*(-parseInt(_0x461f9d(0x194))/0x8)+-parseInt(_0x461f9d(0x17f))/0x9*(parseInt(_0x461f9d(0x1af))/0xa)+-parseInt(_0x461f9d(0x191))/0xb*(-parseInt(_0x461f9d(0x180))/0xc);if(_0x4bfef7===_0x453625)break;else _0x5838da['push'](_0x5838da['shift']());}catch(_0x22cd32){_0x5838da['push'](_0x5838da['shift']());}}}(a282_0x355e,0x692d6));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a282_0x3fc5f5(0x197);export const INSTANT_API_POLICY_FILE_NAME=a282_0x3fc5f5(0x1b1);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x19cad7,_0x440606,_0x2eb5a1){return new CliError(_0x19cad7,0x1,_0x440606,_0x2eb5a1);}export function loadInstantApiPolicyLocalConfig(_0x1eb480,_0x56c3bf){assertSafeAppCode(_0x1eb480);const _0x1f5175=resolve(_0x56c3bf??findProjectRootDirectory()),_0xe8cfd1=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x1eb480+'/'+INSTANT_API_POLICY_FILE_NAME,_0x289ab1=resolve(_0x1f5175,INSTANT_API_POLICY_RELATIVE_ROOT,_0x1eb480),_0x568207=resolve(_0x289ab1,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x1f5175,'appCode':_0x1eb480,'policyRoot':_0x289ab1,'policyFilePath':_0x568207,'policyRelativePath':_0xe8cfd1};}export function createDefaultInstantApiPolicyConfig(_0x114691,_0x559680=a282_0x3fc5f5(0x1ad)){return assertSafeAppCode(_0x114691),{'version':'2','appCode':_0x114691,'defaults':{'instantApi':_0x559680},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x39ed67){const _0xeca7f1=a282_0x3fc5f5;let _0x5ede91;try{_0x5ede91=await stat(_0x39ed67['policyFilePath']);}catch(_0x5c8bd2){throw instantApiPolicyError(_0xeca7f1(0x18b),_0xeca7f1(0x185)+_0x39ed67[_0xeca7f1(0x1a0)],_0xeca7f1(0x1be));}if(!_0x5ede91[_0xeca7f1(0x17e)]())throw instantApiPolicyError(_0xeca7f1(0x1b7),_0xeca7f1(0x19e)+_0x39ed67[_0xeca7f1(0x1a0)]);if(_0x5ede91[_0xeca7f1(0x1ae)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0xeca7f1(0x1a3),_0xeca7f1(0x19d));let _0x5c08de;try{_0x5c08de=await readFile(_0x39ed67[_0xeca7f1(0x1a0)]);}catch{throw instantApiPolicyError(_0xeca7f1(0x17c),_0xeca7f1(0x1b6)+_0x39ed67['policyFilePath']);}if(_0x5c08de['byteLength']>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0x2bc17c;try{_0x2bc17c=new TextDecoder(_0xeca7f1(0x1b9),{'fatal':!![],'ignoreBOM':!![]})[_0xeca7f1(0x199)](_0x5c08de);}catch{throw instantApiPolicyError(_0xeca7f1(0x1b7),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x39ed67[_0xeca7f1(0x1a0)]);}let _0x350d56;try{_0x350d56=JSON[_0xeca7f1(0x187)](_0x2bc17c);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x39ed67[_0xeca7f1(0x1a0)]);}return assertLocalPolicyContract(_0x350d56,_0x39ed67['appCode']);}export async function writeInstantApiPolicyConfigFile(_0x29f831,_0x367df3,_0x5c5ca1={}){const _0x1af419=a282_0x3fc5f5,_0x20ec59=assertLocalPolicyContract(_0x367df3,_0x29f831[_0x1af419(0x196)]),_0x37848a=JSON['stringify'](_0x20ec59,null,0x2)+'\x0a';if(Buffer[_0x1af419(0x1a9)](_0x37848a,_0x1af419(0x17d))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1af419(0x1a3),_0x1af419(0x19d));await mkdir(_0x29f831[_0x1af419(0x18c)],{'recursive':!![]});let _0x4137d0;try{_0x4137d0=await readFile(_0x29f831[_0x1af419(0x1a0)],_0x1af419(0x17d));}catch(_0x4d9b68){if(!isMissingFile(_0x4d9b68))throw instantApiPolicyError(_0x1af419(0x17c),_0x1af419(0x18d)+_0x29f831[_0x1af419(0x1a0)]);}if(_0x4137d0===_0x37848a)return{'action':_0x1af419(0x1a8),'filePath':_0x29f831[_0x1af419(0x1a0)]};if(_0x4137d0!==undefined&&!_0x5c5ca1[_0x1af419(0x1bf)])throw instantApiPolicyError(_0x1af419(0x1a6),_0x1af419(0x1c2)+_0x29f831[_0x1af419(0x1a0)],_0x1af419(0x182));if(_0x4137d0===undefined)try{return await writeFile(_0x29f831['policyFilePath'],_0x37848a,{'encoding':_0x1af419(0x17d),'flag':'wx'}),{'action':_0x1af419(0x184),'filePath':_0x29f831[_0x1af419(0x1a0)]};}catch(_0x2f58a4){if(!isAlreadyExists(_0x2f58a4))throw instantApiPolicyError(_0x1af419(0x198),_0x1af419(0x1a5)+_0x29f831[_0x1af419(0x1a0)]);if(!_0x5c5ca1[_0x1af419(0x1bf)])throw instantApiPolicyError(_0x1af419(0x1a6),_0x1af419(0x1ac)+_0x29f831[_0x1af419(0x1a0)],_0x1af419(0x193));}const _0x16913f=resolve(dirname(_0x29f831[_0x1af419(0x1a0)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x1af419(0x1ba)]+'.'+randomUUID()+_0x1af419(0x188));try{await writeFile(_0x16913f,_0x37848a,{'encoding':'utf8','flag':'wx'}),await rename(_0x16913f,_0x29f831['policyFilePath']);}catch{await unlink(_0x16913f)[_0x1af419(0x18e)](()=>undefined);throw instantApiPolicyError(_0x1af419(0x198),_0x1af419(0x1b2)+_0x29f831[_0x1af419(0x1a0)]);}return{'action':_0x1af419(0x1ab),'filePath':_0x29f831['policyFilePath']};}function a282_0x355e(){const _0x3266ac=['instant_api_policy_file_invalid','instant_api_policy_json_invalid','utf-8','pid','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','725824DlsAGF','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','force','4200230HAbAxO','296WrHdlp','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','instant_api_policy_file_unreadable','utf8','isFile','9jeahUV','622284fQpbcG','1598470OmrSbH','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','32811ZtgMiT','created','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','rules','parse','.tmp','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_app_code_invalid','instant_api_policy_file_missing','policyRoot','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','catch','length','object','66IwbREf','instant_api_policy_app_code_mismatch','Review\x20the\x20file\x20before\x20retrying.','13400vviJof','ENOENT','appCode','.rabetbase/instant-api-policy','instant_api_policy_file_unwritable','decode','instant_api_policy_rules_invalid','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','version','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','6Evdegj','policyFilePath','trim','code','instant_api_policy_file_too_large','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_exists','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','unchanged','byteLength','instant_api_policy_defaults_invalid','overwritten','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','allow','size','1797860PzBZsK','includes','policy.json','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','EEXIST','1771qyneOR','isArray','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20'];a282_0x355e=function(){return _0x3266ac;};return a282_0x355e();}function assertSafeAppCode(_0x3ff369){const _0x2a3aea=a282_0x3fc5f5,_0x4dec5e=_0x3ff369[_0x2a3aea(0x1a1)]();if(!_0x4dec5e||_0x4dec5e!==_0x3ff369||_0x4dec5e[_0x2a3aea(0x18f)]>0x64||_0x4dec5e==='.'||_0x4dec5e==='..'||_0x4dec5e[_0x2a3aea(0x1b0)]('/')||_0x4dec5e[_0x2a3aea(0x1b0)]('\x5c')||_0x4dec5e['includes']('\x00'))throw instantApiPolicyError(_0x2a3aea(0x18a),'appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.');}function assertLocalPolicyContract(_0x37a5af,_0x2c1304){const _0x416902=a282_0x3fc5f5;if(!isObject(_0x37a5af))throw instantApiPolicyError(_0x416902(0x1b8),_0x416902(0x1a7));if(_0x37a5af[_0x416902(0x19c)]!=='1'&&_0x37a5af[_0x416902(0x19c)]!=='2')throw instantApiPolicyError('instant_api_policy_version_invalid',_0x416902(0x1bc),_0x416902(0x1bb));if(_0x37a5af[_0x416902(0x196)]!==_0x2c1304)throw instantApiPolicyError(_0x416902(0x192),_0x416902(0x1a4)+_0x2c1304+'.');if(!isObject(_0x37a5af['defaults'])||typeof _0x37a5af['defaults']['instantApi']!=='string')throw instantApiPolicyError(_0x416902(0x1aa),_0x416902(0x189));if(_0x37a5af[_0x416902(0x186)]!==undefined&&_0x37a5af['rules']!==null&&!Array[_0x416902(0x1b5)](_0x37a5af[_0x416902(0x186)]))throw instantApiPolicyError(_0x416902(0x19a),_0x416902(0x19b));return _0x37a5af;}function isObject(_0x7dc7ef){const _0xa752c8=a282_0x3fc5f5;return _0x7dc7ef!==null&&typeof _0x7dc7ef===_0xa752c8(0x190)&&!Array[_0xa752c8(0x1b5)](_0x7dc7ef);}function isMissingFile(_0x4da24a){const _0x116df3=a282_0x3fc5f5;return Boolean(_0x4da24a&&typeof _0x4da24a===_0x116df3(0x190)&&_0x4da24a[_0x116df3(0x1a2)]===_0x116df3(0x195));}function a282_0x107c(_0x1df252,_0x164666){_0x1df252=_0x1df252-0x17c;const _0x355e32=a282_0x355e();let _0x107c6e=_0x355e32[_0x1df252];return _0x107c6e;}function isAlreadyExists(_0x1fd011){const _0x530da9=a282_0x3fc5f5;return Boolean(_0x1fd011&&typeof _0x1fd011==='object'&&_0x1fd011['code']===_0x530da9(0x1b3));}
@@ -1 +1 @@
1
- const a283_0x1ee16c=a283_0x219b;(function(_0x41af40,_0x1873eb){const _0x414f63=a283_0x219b,_0x16d286=_0x41af40();while(!![]){try{const _0x1b299d=parseInt(_0x414f63(0x198))/0x1*(parseInt(_0x414f63(0x194))/0x2)+parseInt(_0x414f63(0x1bc))/0x3*(-parseInt(_0x414f63(0x1b4))/0x4)+-parseInt(_0x414f63(0x1d6))/0x5*(-parseInt(_0x414f63(0x1a9))/0x6)+parseInt(_0x414f63(0x1c4))/0x7+parseInt(_0x414f63(0x19b))/0x8+-parseInt(_0x414f63(0x1bb))/0x9+-parseInt(_0x414f63(0x1a1))/0xa;if(_0x1b299d===_0x1873eb)break;else _0x16d286['push'](_0x16d286['shift']());}catch(_0x3f68db){_0x16d286['push'](_0x16d286['shift']());}}}(a283_0xa71f,0xf2381));function a283_0xa71f(){const _0x55bbda=['authRequired','name','isSafeInteger','scope','rank','134335PfTVTH','scoreKind','data','AbortError','object','Knowledge\x20search\x20query\x20is\x20required.','text','application/json','profile','total','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','apiError','/smartapi/knowledge/company-public/search','public','map','19678syCCQh','get','success','strategyFingerprint','109xbDNVY','documentId','revision','7933296JpXUCd','entries','chunkId','validation','split','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','6627450wFFkrK','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','\x20contract.','hits','isArray','signal','finalScore','POST','48FrJPZR','content-type','appCode','stringify','schemaVersion','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','topK','SmartCode\x20knowledge\x20search\x20failed.','company','no-store','cookie','3792SxUooo','cache-control','cli:rabetbase','timingsMs','networkError','headers','test','8304570maHgkK','1338bEBxgK','toLowerCase','title','sort','some','isFinite','rawScore','development','5049541HvzJtR','string','length','json','number','SmartCode\x20knowledge\x20search\x20request\x20failed.','tags','hits[','trim','includes','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','response\x20envelope','score'];a283_0xa71f=function(){return _0x55bbda;};return a283_0xa71f();}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x1ee16c(0x1ad),'profile',a283_0x1ee16c(0x18e),a283_0x1ee16c(0x1a4),'strategyFingerprint',a283_0x1ee16c(0x1b7)],HIT_KEYS=['documentId',a283_0x1ee16c(0x19a),a283_0x1ee16c(0x19d),a283_0x1ee16c(0x1d4),a283_0x1ee16c(0x1be),a283_0x1ee16c(0x18b),a283_0x1ee16c(0x1ca),a283_0x1ee16c(0x1d5),a283_0x1ee16c(0x1c2),a283_0x1ee16c(0x1a7),a283_0x1ee16c(0x186)];export async function searchDevelopmentKnowledge(_0xc6a4a){const _0x37eedc=a283_0x1ee16c,_0x5b6239=_0xc6a4a[_0x37eedc(0x1ab)][_0x37eedc(0x1cc)](),_0x59c373=_0xc6a4a['query']['trim']();if(!_0x5b6239)throw CliErrors['validation']('Knowledge\x20search\x20appCode\x20is\x20required.');if(!_0xc6a4a[_0x37eedc(0x1b3)][_0x37eedc(0x1cc)]())throw CliErrors[_0x37eedc(0x1d1)]();if(!_0x59c373)throw CliErrors['validation'](_0x37eedc(0x18a));validateTopK(_0xc6a4a[_0x37eedc(0x1af)]);const _0x44de8e=getKbDomain()+_0x37eedc(0x191);let _0x3f3c75;try{_0x3f3c75=await fetch(_0x44de8e,{'method':_0x37eedc(0x1a8),'headers':{'Content-Type':_0x37eedc(0x18c),'Cookie':_0xc6a4a['cookie'],'X-Invoke-Source':_0x37eedc(0x1b6)},'body':JSON[_0x37eedc(0x1ac)]({'appCode':_0x5b6239,'query':_0x59c373,..._0xc6a4a[_0x37eedc(0x1af)]!==undefined?{'topK':_0xc6a4a[_0x37eedc(0x1af)]}:{}}),'signal':_0xc6a4a[_0x37eedc(0x1a6)]});}catch(_0x173145){if(_0x173145 instanceof CliError)throw _0x173145;if(_0x173145 instanceof Error&&_0x173145[_0x37eedc(0x1d2)]===_0x37eedc(0x188))throw _0x173145;throw CliErrors[_0x37eedc(0x1b8)](_0x37eedc(0x1c9));}if(!hasNoStore(_0x3f3c75[_0x37eedc(0x1b9)]))throw CliErrors[_0x37eedc(0x190)](_0x37eedc(0x1ce));if(_0x3f3c75['status']===0x191)throw CliErrors['authRequired']();if(!_0x3f3c75['ok'])throw CliErrors[_0x37eedc(0x190)](_0x37eedc(0x1a2)+_0x3f3c75['status']+').');if(!(_0x3f3c75[_0x37eedc(0x1b9)]['get'](_0x37eedc(0x1aa))??'')[_0x37eedc(0x1bd)]()[_0x37eedc(0x1cd)](_0x37eedc(0x18c)))throw CliErrors[_0x37eedc(0x190)](_0x37eedc(0x1ae));let _0xe72405;try{_0xe72405=await _0x3f3c75[_0x37eedc(0x1c7)]();}catch{throw CliErrors[_0x37eedc(0x190)]('SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.');}return parseDevelopmentSearchResponse(readEnvelopeData(_0xe72405),_0xc6a4a['topK']);}function readEnvelopeData(_0x41a0f1){const _0x221e12=a283_0x1ee16c,_0x36e0da=requireRecord(_0x41a0f1,_0x221e12(0x1cf));if(_0x36e0da[_0x221e12(0x196)]===![])throw CliErrors['apiError'](_0x221e12(0x1b0));if(!(_0x221e12(0x187)in _0x36e0da))throw invalidContract(_0x221e12(0x1cf));return _0x36e0da[_0x221e12(0x187)];}function validateTopK(_0x3b1e97){const _0x38ec2e=a283_0x1ee16c;if(_0x3b1e97!==undefined&&(!Number['isSafeInteger'](_0x3b1e97)||_0x3b1e97<0x1||_0x3b1e97>0x32))throw CliErrors[_0x38ec2e(0x19e)](_0x38ec2e(0x1a0));}function hasNoStore(_0xc9b444){const _0x1e8ffd=a283_0x1ee16c;return(_0xc9b444[_0x1e8ffd(0x195)](_0x1e8ffd(0x1b5))??'')[_0x1e8ffd(0x19f)](',')[_0x1e8ffd(0x1c0)](_0x57bb48=>_0x57bb48[_0x1e8ffd(0x1cc)]()[_0x1e8ffd(0x1bd)]()===_0x1e8ffd(0x1b2));}function parseDevelopmentSearchResponse(_0xe9d42c,_0x12ab03){const _0x39736c=a283_0x1ee16c,_0x304deb=requireExactRecord(_0xe9d42c,RESPONSE_KEYS,'response');if(_0x304deb['schemaVersion']!==0x2||_0x304deb[_0x39736c(0x18d)]!==_0x39736c(0x1c3))throw invalidContract(_0x39736c(0x18d));if(!Array['isArray'](_0x304deb[_0x39736c(0x1a4)])||_0x304deb[_0x39736c(0x1a4)][_0x39736c(0x1c6)]>(_0x12ab03??0x32))throw invalidContract(_0x39736c(0x1a4));if(typeof _0x304deb['strategyFingerprint']!=='string'||!/^sha256:[0-9a-f]{64}$/['test'](_0x304deb[_0x39736c(0x197)]))throw invalidContract(_0x39736c(0x197));const _0xa2bca7=requireRecord(_0x304deb[_0x39736c(0x1b7)],_0x39736c(0x1b7)),_0x39c845={};for(const [_0x536bd7,_0x33c5f5]of Object[_0x39736c(0x19c)](_0xa2bca7)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x39736c(0x1ba)](_0x536bd7)||typeof _0x33c5f5!=='number'||!Number[_0x39736c(0x1c1)](_0x33c5f5)||_0x33c5f5<0x0)throw invalidContract(_0x39736c(0x1b7));_0x39c845[_0x536bd7]=_0x33c5f5;}const _0x172b98=_0x304deb[_0x39736c(0x1a4)][_0x39736c(0x193)]((_0x8981f3,_0x1369a0)=>parseHit(_0x8981f3,_0x1369a0));if(!Number['isSafeInteger'](_0x304deb[_0x39736c(0x18e)])||_0x304deb[_0x39736c(0x18e)]!==_0x172b98[_0x39736c(0x1c6)])throw invalidContract(_0x39736c(0x18e));return{'schemaVersion':_0x304deb[_0x39736c(0x1ad)],'profile':_0x304deb['profile'],'total':_0x304deb[_0x39736c(0x18e)],'strategyFingerprint':_0x304deb[_0x39736c(0x197)],'timingsMs':_0x39c845,'hits':_0x172b98};}function a283_0x219b(_0x283963,_0x1aa114){_0x283963=_0x283963-0x186;const _0xa71f44=a283_0xa71f();let _0x219b2c=_0xa71f44[_0x283963];return _0x219b2c;}function parseHit(_0x501e14,_0x250eb2){const _0x100d81=a283_0x1ee16c,_0x21d316=requireExactRecord(_0x501e14,HIT_KEYS,_0x100d81(0x1cb)+_0x250eb2+']'),_0x104a0a=_0x313329=>{const _0x2b9df9=_0x100d81,_0x3ca309=_0x21d316[_0x313329];if(typeof _0x3ca309!==_0x2b9df9(0x1c5)||!_0x3ca309)throw invalidContract(_0x313329);return _0x3ca309;};if(!Number[_0x100d81(0x1d3)](_0x21d316[_0x100d81(0x19a)])||_0x21d316['revision']<0x1)throw invalidContract(_0x100d81(0x19a));if(_0x21d316[_0x100d81(0x1d4)]!==_0x100d81(0x192)&&_0x21d316[_0x100d81(0x1d4)]!==_0x100d81(0x1b1))throw invalidContract(_0x100d81(0x1d4));if(typeof _0x21d316[_0x100d81(0x1be)]!==_0x100d81(0x1c5)||typeof _0x21d316['text']!==_0x100d81(0x1c5))throw invalidContract(_0x100d81(0x18b));if(!Array[_0x100d81(0x1a5)](_0x21d316['tags'])||_0x21d316[_0x100d81(0x1ca)][_0x100d81(0x1c0)](_0x13e8e7=>typeof _0x13e8e7!==_0x100d81(0x1c5)))throw invalidContract(_0x100d81(0x1ca));if(!Number[_0x100d81(0x1d3)](_0x21d316[_0x100d81(0x1d5)])||_0x21d316[_0x100d81(0x1d5)]!==_0x250eb2+0x1)throw invalidContract(_0x100d81(0x1d5));if(!isFiniteNumber(_0x21d316[_0x100d81(0x1c2)])||!isFiniteNumber(_0x21d316['finalScore']))throw invalidContract(_0x100d81(0x1d0));return{'documentId':_0x104a0a(_0x100d81(0x199)),'revision':_0x21d316[_0x100d81(0x19a)],'chunkId':_0x104a0a(_0x100d81(0x19d)),'scope':_0x21d316[_0x100d81(0x1d4)],'title':_0x21d316['title'],'text':_0x21d316['text'],'tags':[..._0x21d316[_0x100d81(0x1ca)]],'rank':_0x21d316[_0x100d81(0x1d5)],'rawScore':_0x21d316['rawScore'],'finalScore':_0x21d316[_0x100d81(0x1a7)],'scoreKind':_0x104a0a(_0x100d81(0x186))};}function requireExactRecord(_0x4e2947,_0x488db1,_0x18ca05){const _0x182f65=a283_0x1ee16c,_0x50708b=requireRecord(_0x4e2947,_0x18ca05),_0x4fe5c2=Object['keys'](_0x50708b)[_0x182f65(0x1bf)](),_0x32c8fa=[..._0x488db1]['sort']();if(_0x4fe5c2[_0x182f65(0x1c6)]!==_0x32c8fa[_0x182f65(0x1c6)]||_0x4fe5c2['some']((_0x10f161,_0x3606d8)=>_0x10f161!==_0x32c8fa[_0x3606d8]))throw invalidContract(_0x18ca05);return _0x50708b;}function requireRecord(_0x522b90,_0x563d20){const _0x40c706=a283_0x1ee16c;if(!_0x522b90||typeof _0x522b90!==_0x40c706(0x189)||Array[_0x40c706(0x1a5)](_0x522b90))throw invalidContract(_0x563d20);return _0x522b90;}function isFiniteNumber(_0x45babe){const _0x5853af=a283_0x1ee16c;return typeof _0x45babe===_0x5853af(0x1c8)&&Number[_0x5853af(0x1c1)](_0x45babe);}function invalidContract(_0x368371){const _0x194f01=a283_0x1ee16c;return CliErrors[_0x194f01(0x190)](_0x194f01(0x18f)+_0x368371+_0x194f01(0x1a3));}
1
+ const a283_0x27bc92=a283_0x59e0;(function(_0xd6d088,_0xb32c1f){const _0x11d515=a283_0x59e0,_0x13945f=_0xd6d088();while(!![]){try{const _0x444547=parseInt(_0x11d515(0x19a))/0x1+-parseInt(_0x11d515(0x1af))/0x2*(-parseInt(_0x11d515(0x1ba))/0x3)+-parseInt(_0x11d515(0x1bf))/0x4*(-parseInt(_0x11d515(0x1a5))/0x5)+parseInt(_0x11d515(0x18f))/0x6+-parseInt(_0x11d515(0x1cf))/0x7+parseInt(_0x11d515(0x1a0))/0x8*(parseInt(_0x11d515(0x1a7))/0x9)+-parseInt(_0x11d515(0x1b0))/0xa;if(_0x444547===_0xb32c1f)break;else _0x13945f['push'](_0x13945f['shift']());}catch(_0x8cfcc){_0x13945f['push'](_0x13945f['shift']());}}}(a283_0x2e4c,0xe9eb3));function a283_0x59e0(_0xa7ea39,_0x5de048){_0xa7ea39=_0xa7ea39-0x186;const _0x2e4c8f=a283_0x2e4c();let _0x59e0b0=_0x2e4c8f[_0xa7ea39];return _0x59e0b0;}function a283_0x2e4c(){const _0x9b0d87=['hits','schemaVersion','88yvAghS','some','sort','apiError','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','20tuSJaE','networkError','340344ypBWQw','isArray','revision','AbortError','isSafeInteger','object','number','score','690542UcOspc','18259600rYqjPW','timingsMs','trim','text','public','isFinite','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','split','get','documentId','9jIxTUw','query','keys','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','title','1312704pnteEi','application/json','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','company','rank','development','strategyFingerprint','string','response\x20envelope','name','content-type','chunkId','scope','authRequired','finalScore','stringify','8212673CiqyzQ','profile','validation','length','test','map','toLowerCase','no-store','total','hits[','622782EHkJmV','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','status','json','Knowledge\x20search\x20appCode\x20is\x20required.','data','rawScore','tags','topK','headers','scoreKind','1089040kJJcqu','response','cli:rabetbase','\x20contract.'];a283_0x2e4c=function(){return _0x9b0d87;};return a283_0x2e4c();}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x27bc92(0x19f),'profile',a283_0x27bc92(0x18d),a283_0x27bc92(0x19e),a283_0x27bc92(0x1c5),a283_0x27bc92(0x1b1)],HIT_KEYS=['documentId',a283_0x27bc92(0x1a9),a283_0x27bc92(0x1ca),a283_0x27bc92(0x1cb),a283_0x27bc92(0x1be),a283_0x27bc92(0x1b3),a283_0x27bc92(0x196),a283_0x27bc92(0x1c3),a283_0x27bc92(0x195),a283_0x27bc92(0x1cd),a283_0x27bc92(0x199)];export async function searchDevelopmentKnowledge(_0x3cde1f){const _0x5bd4c3=a283_0x27bc92,_0x455fcb=_0x3cde1f['appCode'][_0x5bd4c3(0x1b2)](),_0x580317=_0x3cde1f[_0x5bd4c3(0x1bb)][_0x5bd4c3(0x1b2)]();if(!_0x455fcb)throw CliErrors[_0x5bd4c3(0x187)](_0x5bd4c3(0x193));if(!_0x3cde1f['cookie'][_0x5bd4c3(0x1b2)]())throw CliErrors[_0x5bd4c3(0x1cc)]();if(!_0x580317)throw CliErrors[_0x5bd4c3(0x187)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x3cde1f[_0x5bd4c3(0x197)]);const _0x54a373=getKbDomain()+'/smartapi/knowledge/company-public/search';let _0x1181bd;try{_0x1181bd=await fetch(_0x54a373,{'method':'POST','headers':{'Content-Type':_0x5bd4c3(0x1c0),'Cookie':_0x3cde1f['cookie'],'X-Invoke-Source':_0x5bd4c3(0x19c)},'body':JSON[_0x5bd4c3(0x1ce)]({'appCode':_0x455fcb,'query':_0x580317,..._0x3cde1f[_0x5bd4c3(0x197)]!==undefined?{'topK':_0x3cde1f['topK']}:{}}),'signal':_0x3cde1f['signal']});}catch(_0x425c70){if(_0x425c70 instanceof CliError)throw _0x425c70;if(_0x425c70 instanceof Error&&_0x425c70[_0x5bd4c3(0x1c8)]===_0x5bd4c3(0x1aa))throw _0x425c70;throw CliErrors[_0x5bd4c3(0x1a6)]('SmartCode\x20knowledge\x20search\x20request\x20failed.');}if(!hasNoStore(_0x1181bd[_0x5bd4c3(0x198)]))throw CliErrors['apiError'](_0x5bd4c3(0x190));if(_0x1181bd[_0x5bd4c3(0x191)]===0x191)throw CliErrors[_0x5bd4c3(0x1cc)]();if(!_0x1181bd['ok'])throw CliErrors[_0x5bd4c3(0x1a3)](_0x5bd4c3(0x1a4)+_0x1181bd[_0x5bd4c3(0x191)]+').');if(!(_0x1181bd[_0x5bd4c3(0x198)][_0x5bd4c3(0x1b8)](_0x5bd4c3(0x1c9))??'')[_0x5bd4c3(0x18b)]()['includes']('application/json'))throw CliErrors[_0x5bd4c3(0x1a3)](_0x5bd4c3(0x1bd));let _0x56471c;try{_0x56471c=await _0x1181bd[_0x5bd4c3(0x192)]();}catch{throw CliErrors[_0x5bd4c3(0x1a3)]('SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.');}return parseDevelopmentSearchResponse(readEnvelopeData(_0x56471c),_0x3cde1f[_0x5bd4c3(0x197)]);}function readEnvelopeData(_0xb656d4){const _0x5e6e9f=a283_0x27bc92,_0x2a2b3c=requireRecord(_0xb656d4,_0x5e6e9f(0x1c7));if(_0x2a2b3c['success']===![])throw CliErrors['apiError']('SmartCode\x20knowledge\x20search\x20failed.');if(!(_0x5e6e9f(0x194)in _0x2a2b3c))throw invalidContract(_0x5e6e9f(0x1c7));return _0x2a2b3c[_0x5e6e9f(0x194)];}function validateTopK(_0xbb10af){const _0x30e9b7=a283_0x27bc92;if(_0xbb10af!==undefined&&(!Number['isSafeInteger'](_0xbb10af)||_0xbb10af<0x1||_0xbb10af>0x32))throw CliErrors[_0x30e9b7(0x187)](_0x30e9b7(0x1c1));}function hasNoStore(_0x4c6e57){const _0x29ec48=a283_0x27bc92;return(_0x4c6e57[_0x29ec48(0x1b8)]('cache-control')??'')[_0x29ec48(0x1b7)](',')[_0x29ec48(0x1a1)](_0x38849e=>_0x38849e[_0x29ec48(0x1b2)]()[_0x29ec48(0x18b)]()===_0x29ec48(0x18c));}function parseDevelopmentSearchResponse(_0x4a124d,_0x170323){const _0xb19949=a283_0x27bc92,_0x2c5a58=requireExactRecord(_0x4a124d,RESPONSE_KEYS,_0xb19949(0x19b));if(_0x2c5a58[_0xb19949(0x19f)]!==0x2||_0x2c5a58[_0xb19949(0x186)]!==_0xb19949(0x1c4))throw invalidContract(_0xb19949(0x186));if(!Array[_0xb19949(0x1a8)](_0x2c5a58[_0xb19949(0x19e)])||_0x2c5a58[_0xb19949(0x19e)][_0xb19949(0x188)]>(_0x170323??0x32))throw invalidContract(_0xb19949(0x19e));if(typeof _0x2c5a58[_0xb19949(0x1c5)]!==_0xb19949(0x1c6)||!/^sha256:[0-9a-f]{64}$/[_0xb19949(0x189)](_0x2c5a58[_0xb19949(0x1c5)]))throw invalidContract(_0xb19949(0x1c5));const _0x4390b8=requireRecord(_0x2c5a58[_0xb19949(0x1b1)],_0xb19949(0x1b1)),_0x5db3d2={};for(const [_0x20595e,_0x6a1c0e]of Object['entries'](_0x4390b8)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0xb19949(0x189)](_0x20595e)||typeof _0x6a1c0e!=='number'||!Number['isFinite'](_0x6a1c0e)||_0x6a1c0e<0x0)throw invalidContract(_0xb19949(0x1b1));_0x5db3d2[_0x20595e]=_0x6a1c0e;}const _0x43a2cc=_0x2c5a58[_0xb19949(0x19e)][_0xb19949(0x18a)]((_0xaa9382,_0x3bfd2a)=>parseHit(_0xaa9382,_0x3bfd2a));if(!Number['isSafeInteger'](_0x2c5a58[_0xb19949(0x18d)])||_0x2c5a58['total']!==_0x43a2cc[_0xb19949(0x188)])throw invalidContract(_0xb19949(0x18d));return{'schemaVersion':_0x2c5a58['schemaVersion'],'profile':_0x2c5a58[_0xb19949(0x186)],'total':_0x2c5a58[_0xb19949(0x18d)],'strategyFingerprint':_0x2c5a58[_0xb19949(0x1c5)],'timingsMs':_0x5db3d2,'hits':_0x43a2cc};}function parseHit(_0x1a6c7c,_0xb3d33e){const _0x13f4e4=a283_0x27bc92,_0x32bac8=requireExactRecord(_0x1a6c7c,HIT_KEYS,_0x13f4e4(0x18e)+_0xb3d33e+']'),_0x103045=_0x2828fd=>{const _0x3e6dcb=_0x13f4e4,_0x5c5528=_0x32bac8[_0x2828fd];if(typeof _0x5c5528!==_0x3e6dcb(0x1c6)||!_0x5c5528)throw invalidContract(_0x2828fd);return _0x5c5528;};if(!Number[_0x13f4e4(0x1ab)](_0x32bac8['revision'])||_0x32bac8[_0x13f4e4(0x1a9)]<0x1)throw invalidContract(_0x13f4e4(0x1a9));if(_0x32bac8[_0x13f4e4(0x1cb)]!==_0x13f4e4(0x1b4)&&_0x32bac8[_0x13f4e4(0x1cb)]!==_0x13f4e4(0x1c2))throw invalidContract(_0x13f4e4(0x1cb));if(typeof _0x32bac8['title']!==_0x13f4e4(0x1c6)||typeof _0x32bac8[_0x13f4e4(0x1b3)]!==_0x13f4e4(0x1c6))throw invalidContract(_0x13f4e4(0x1b3));if(!Array[_0x13f4e4(0x1a8)](_0x32bac8[_0x13f4e4(0x196)])||_0x32bac8[_0x13f4e4(0x196)]['some'](_0x32b1f0=>typeof _0x32b1f0!==_0x13f4e4(0x1c6)))throw invalidContract(_0x13f4e4(0x196));if(!Number['isSafeInteger'](_0x32bac8[_0x13f4e4(0x1c3)])||_0x32bac8[_0x13f4e4(0x1c3)]!==_0xb3d33e+0x1)throw invalidContract(_0x13f4e4(0x1c3));if(!isFiniteNumber(_0x32bac8[_0x13f4e4(0x195)])||!isFiniteNumber(_0x32bac8[_0x13f4e4(0x1cd)]))throw invalidContract(_0x13f4e4(0x1ae));return{'documentId':_0x103045(_0x13f4e4(0x1b9)),'revision':_0x32bac8[_0x13f4e4(0x1a9)],'chunkId':_0x103045(_0x13f4e4(0x1ca)),'scope':_0x32bac8[_0x13f4e4(0x1cb)],'title':_0x32bac8[_0x13f4e4(0x1be)],'text':_0x32bac8[_0x13f4e4(0x1b3)],'tags':[..._0x32bac8[_0x13f4e4(0x196)]],'rank':_0x32bac8['rank'],'rawScore':_0x32bac8[_0x13f4e4(0x195)],'finalScore':_0x32bac8[_0x13f4e4(0x1cd)],'scoreKind':_0x103045('scoreKind')};}function requireExactRecord(_0x40da8f,_0x34c337,_0x2f907a){const _0x24c1aa=a283_0x27bc92,_0x15edd8=requireRecord(_0x40da8f,_0x2f907a),_0x483997=Object[_0x24c1aa(0x1bc)](_0x15edd8)[_0x24c1aa(0x1a2)](),_0x59149a=[..._0x34c337]['sort']();if(_0x483997[_0x24c1aa(0x188)]!==_0x59149a[_0x24c1aa(0x188)]||_0x483997[_0x24c1aa(0x1a1)]((_0x525989,_0x5893e6)=>_0x525989!==_0x59149a[_0x5893e6]))throw invalidContract(_0x2f907a);return _0x15edd8;}function requireRecord(_0x3b0c7c,_0x2cff6a){const _0x8a9329=a283_0x27bc92;if(!_0x3b0c7c||typeof _0x3b0c7c!==_0x8a9329(0x1ac)||Array[_0x8a9329(0x1a8)](_0x3b0c7c))throw invalidContract(_0x2cff6a);return _0x3b0c7c;}function isFiniteNumber(_0x21dbd0){const _0x5d9f1d=a283_0x27bc92;return typeof _0x21dbd0===_0x5d9f1d(0x1ad)&&Number[_0x5d9f1d(0x1b5)](_0x21dbd0);}function invalidContract(_0x416895){const _0x9bce01=a283_0x27bc92;return CliErrors[_0x9bce01(0x1a3)](_0x9bce01(0x1b6)+_0x416895+_0x9bce01(0x19d));}
@@ -1 +1 @@
1
- const a284_0x22dd40=a284_0x3324;(function(_0x5d1407,_0x2e203c){const _0x5d51c6=a284_0x3324,_0x2ac933=_0x5d1407();while(!![]){try{const _0x44d5b7=-parseInt(_0x5d51c6(0x173))/0x1+-parseInt(_0x5d51c6(0x18b))/0x2*(parseInt(_0x5d51c6(0x17f))/0x3)+parseInt(_0x5d51c6(0x18d))/0x4+parseInt(_0x5d51c6(0x176))/0x5+parseInt(_0x5d51c6(0x16f))/0x6*(parseInt(_0x5d51c6(0x17d))/0x7)+-parseInt(_0x5d51c6(0x17c))/0x8*(-parseInt(_0x5d51c6(0x18c))/0x9)+-parseInt(_0x5d51c6(0x175))/0xa;if(_0x44d5b7===_0x2e203c)break;else _0x2ac933['push'](_0x2ac933['shift']());}catch(_0x21310d){_0x2ac933['push'](_0x2ac933['shift']());}}}(a284_0x1120,0x90bc2));function a284_0x3324(_0x430c1d,_0x168fdd){_0x430c1d=_0x430c1d-0x16f;const _0x112050=a284_0x1120();let _0x33246d=_0x112050[_0x430c1d];return _0x33246d;}import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x1f8935,_0x2c129d=process[a284_0x22dd40(0x177)]()){const _0x34051e=a284_0x22dd40,_0x495ccf=resolve(_0x2c129d),_0x53eb96=join(_0x495ccf,_0x34051e(0x189),_0x34051e(0x17b));return{'projectRoot':_0x495ccf,'pagesBaseDir':_0x53eb96,'appPagesDir':join(_0x53eb96,_0x1f8935),'lockFilePath':join(_0x495ccf,_0x34051e(0x189),_0x34051e(0x179))};}export function buildPageFileName(_0x344b54,_0x2b62dd){const _0x193dbc=a284_0x22dd40;return _0x344b54+'-'+_0x2b62dd[_0x193dbc(0x174)]()+_0x193dbc(0x181);}export function resolvePageFilePath(_0x5948cf,_0xb7e1e6,_0x574cde){const _0x4b4a72=a284_0x22dd40;return join(_0x5948cf[_0x4b4a72(0x188)],buildPageFileName(_0xb7e1e6,_0x574cde));}export async function ensureParentDirectory(_0x37d6cd){await mkdir(dirname(_0x37d6cd),{'recursive':!![]});}function a284_0x1120(){const _0x3abc5e=['9OICQTZ','4736756mYHWfY','48VZWloe','isDirectory','sort','localeCompare','25397UbjiKY','toUpperCase','21026240tJetWv','3303080FWAiPH','cwd','validation','page.lock.json','flagMissing','page','1756984rxSvnN','659554EDKMrZ','trim','21fSNwDg','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','.json','name','utf8','Page\x20directory\x20not\x20found:\x20','F_OK','split','Unsupported\x20file\x20in\x20page\x20directory:\x20','appPagesDir','.rabetbase','isFile','27814orwKVY'];a284_0x1120=function(){return _0x3abc5e;};return a284_0x1120();}export async function fileExists(_0x57b2e0){const _0x364284=a284_0x22dd40;try{return await access(_0x57b2e0,constants[_0x364284(0x185)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0xae5e5a){const _0x129603=a284_0x22dd40,_0x4e41c4=_0xae5e5a[_0x129603(0x17e)]();if(!_0x4e41c4)throw CliErrors[_0x129603(0x17a)]('page-dir');const _0x3bc4e3=resolve(_0x4e41c4);let _0x5bef15;try{_0x5bef15=await lstat(_0x3bc4e3);}catch{throw CliErrors[_0x129603(0x178)](_0x129603(0x184)+_0x4e41c4);}if(!_0x5bef15[_0x129603(0x170)]())throw CliErrors[_0x129603(0x178)](_0x129603(0x180)+_0x4e41c4);const _0x23d3c7={};return await readDirectory(_0x3bc4e3,_0x3bc4e3,_0x23d3c7),_0x23d3c7;}async function readDirectory(_0x6c0d20,_0x28721e,_0x5bd5e5){const _0xa0ec59=a284_0x22dd40,_0x417e0f=await readdir(_0x28721e,{'withFileTypes':!![]});for(const _0x37de45 of _0x417e0f[_0xa0ec59(0x171)]((_0x3bee52,_0x2e8696)=>_0x3bee52[_0xa0ec59(0x182)][_0xa0ec59(0x172)](_0x2e8696[_0xa0ec59(0x182)]))){const _0x4b3998=join(_0x28721e,_0x37de45[_0xa0ec59(0x182)]);if(_0x37de45[_0xa0ec59(0x170)]()){await readDirectory(_0x6c0d20,_0x4b3998,_0x5bd5e5);continue;}if(!_0x37de45[_0xa0ec59(0x18a)]())throw CliErrors[_0xa0ec59(0x178)](_0xa0ec59(0x187)+_0x4b3998);_0x5bd5e5[relative(_0x6c0d20,_0x4b3998)[_0xa0ec59(0x186)](sep)['join']('/')]=await readFile(_0x4b3998,_0xa0ec59(0x183));}}
1
+ const a284_0xd35399=a284_0x14ab;(function(_0x1fbf7e,_0x38d113){const _0x582fda=a284_0x14ab,_0x1c35aa=_0x1fbf7e();while(!![]){try{const _0x31214f=parseInt(_0x582fda(0x166))/0x1+parseInt(_0x582fda(0x16c))/0x2+-parseInt(_0x582fda(0x162))/0x3*(-parseInt(_0x582fda(0x176))/0x4)+parseInt(_0x582fda(0x165))/0x5+-parseInt(_0x582fda(0x174))/0x6*(-parseInt(_0x582fda(0x16f))/0x7)+-parseInt(_0x582fda(0x172))/0x8*(parseInt(_0x582fda(0x169))/0x9)+-parseInt(_0x582fda(0x16a))/0xa;if(_0x31214f===_0x38d113)break;else _0x1c35aa['push'](_0x1c35aa['shift']());}catch(_0x5b1d7c){_0x1c35aa['push'](_0x1c35aa['shift']());}}}(a284_0x4fc5,0x908ec));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x3dd889,_0x13f509=process[a284_0xd35399(0x171)]()){const _0x3ad728=a284_0xd35399,_0x4e5656=resolve(_0x13f509),_0x5aeb35=join(_0x4e5656,_0x3ad728(0x16b),_0x3ad728(0x178));return{'projectRoot':_0x4e5656,'pagesBaseDir':_0x5aeb35,'appPagesDir':join(_0x5aeb35,_0x3dd889),'lockFilePath':join(_0x4e5656,'.rabetbase',_0x3ad728(0x177))};}function a284_0x14ab(_0x4b983c,_0x1d8932){_0x4b983c=_0x4b983c-0x161;const _0x4fc521=a284_0x4fc5();let _0x14ab83=_0x4fc521[_0x4b983c];return _0x14ab83;}export function buildPageFileName(_0x54ccb9,_0x58eff3){const _0x1d2153=a284_0xd35399;return _0x54ccb9+'-'+_0x58eff3[_0x1d2153(0x161)]()+_0x1d2153(0x17b);}export function resolvePageFilePath(_0x4f5560,_0x56cebc,_0x4a2055){const _0x309d00=a284_0xd35399;return join(_0x4f5560[_0x309d00(0x163)],buildPageFileName(_0x56cebc,_0x4a2055));}export async function ensureParentDirectory(_0x2dd22a){await mkdir(dirname(_0x2dd22a),{'recursive':!![]});}export async function fileExists(_0x328d8b){const _0x32eac3=a284_0xd35399;try{return await access(_0x328d8b,constants[_0x32eac3(0x170)]),!![];}catch{return![];}}function a284_0x4fc5(){const _0x4a1be5=['name','.json','toUpperCase','2380692darMdL','appPagesDir','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','2001980RdBBrs','284417xhnTEy','validation','page-dir','18dIKhoG','8187880JZOHuw','.rabetbase','409768Ajzlut','sort','localeCompare','7CzqNpw','F_OK','cwd','3299984gQaaWc','join','3315786kSfVKG','isFile','4jHfrnr','page.lock.json','page','isDirectory'];a284_0x4fc5=function(){return _0x4a1be5;};return a284_0x4fc5();}export async function readCustomPageDirectory(_0x3de8ef){const _0x445395=a284_0xd35399,_0x3649db=_0x3de8ef['trim']();if(!_0x3649db)throw CliErrors['flagMissing'](_0x445395(0x168));const _0x25b64b=resolve(_0x3649db);let _0x44eeec;try{_0x44eeec=await lstat(_0x25b64b);}catch{throw CliErrors[_0x445395(0x167)]('Page\x20directory\x20not\x20found:\x20'+_0x3649db);}if(!_0x44eeec[_0x445395(0x179)]())throw CliErrors[_0x445395(0x167)](_0x445395(0x164)+_0x3649db);const _0x6a1e37={};return await readDirectory(_0x25b64b,_0x25b64b,_0x6a1e37),_0x6a1e37;}async function readDirectory(_0x9e96b5,_0x5e2b16,_0x1dc31e){const _0x49e5c3=a284_0xd35399,_0x2422ba=await readdir(_0x5e2b16,{'withFileTypes':!![]});for(const _0x110df1 of _0x2422ba[_0x49e5c3(0x16d)]((_0xe768dd,_0x1983d8)=>_0xe768dd[_0x49e5c3(0x17a)][_0x49e5c3(0x16e)](_0x1983d8['name']))){const _0x28a8a2=join(_0x5e2b16,_0x110df1['name']);if(_0x110df1['isDirectory']()){await readDirectory(_0x9e96b5,_0x28a8a2,_0x1dc31e);continue;}if(!_0x110df1[_0x49e5c3(0x175)]())throw CliErrors['validation']('Unsupported\x20file\x20in\x20page\x20directory:\x20'+_0x28a8a2);_0x1dc31e[relative(_0x9e96b5,_0x28a8a2)['split'](sep)[_0x49e5c3(0x173)]('/')]=await readFile(_0x28a8a2,'utf8');}}
@@ -1 +1 @@
1
- function a285_0x5e68(_0x1e0984,_0x1d092b){_0x1e0984=_0x1e0984-0x86;const _0x2e2792=a285_0x2e27();let _0x5e686d=_0x2e2792[_0x1e0984];return _0x5e686d;}(function(_0x2c4614,_0x137cba){const _0x37ed7a=a285_0x5e68,_0x1fcc3c=_0x2c4614();while(!![]){try{const _0x554703=parseInt(_0x37ed7a(0x8e))/0x1*(-parseInt(_0x37ed7a(0x8a))/0x2)+parseInt(_0x37ed7a(0x8b))/0x3+-parseInt(_0x37ed7a(0x86))/0x4*(-parseInt(_0x37ed7a(0x8f))/0x5)+-parseInt(_0x37ed7a(0x8c))/0x6+parseInt(_0x37ed7a(0x91))/0x7+parseInt(_0x37ed7a(0x90))/0x8+parseInt(_0x37ed7a(0x88))/0x9;if(_0x554703===_0x137cba)break;else _0x1fcc3c['push'](_0x1fcc3c['shift']());}catch(_0x3085f3){_0x1fcc3c['push'](_0x1fcc3c['shift']());}}}(a285_0x2e27,0x2f060));import a285_0x2581bd from'node:crypto';import{readFile}from'node:fs/promises';function a285_0x2e27(){const _0x3f30be=['2PCTNCn','468159XbsWqw','210030ugeQOI','utf8','342407etqIkD','9995pFDpLT','235352qSYlCv','1143198DsTefs','update','20khsmId','hex','1901151hwYpJh','createHash'];a285_0x2e27=function(){return _0x3f30be;};return a285_0x2e27();}export function serializePageSchemaForFile(_0x5f4059){return JSON['stringify'](JSON['parse'](_0x5f4059),null,0x2)+'\x0a';}export function computePageContentHash(_0x121c81){const _0xf9cc63=a285_0x5e68;return a285_0x2581bd[_0xf9cc63(0x89)]('md5')[_0xf9cc63(0x92)](_0x121c81)['digest'](_0xf9cc63(0x87));}export function computeSerializedSchemaHash(_0xd8c2cf){return computePageContentHash(serializePageSchemaForFile(_0xd8c2cf));}export async function computePageFileHash(_0x473a48){const _0x4e3c88=a285_0x5e68,_0x5f4f0e=await readFile(_0x473a48,_0x4e3c88(0x8d));return computePageContentHash(_0x5f4f0e);}
1
+ function a285_0x1427(_0xb37b06,_0x196ca0){_0xb37b06=_0xb37b06-0x108;const _0x2e9a98=a285_0x2e9a();let _0x14274d=_0x2e9a98[_0xb37b06];return _0x14274d;}function a285_0x2e9a(){const _0x34613d=['357564KiWZzS','2697345bfjkTk','parse','2288arJDRW','createHash','2190dxVHwM','stringify','utf8','hex','190572UfNFaN','491ASOvRV','336qloHBG','838jrSHvg','29995XWGRJr','1998822OyisOu','digest','3IzwQWJ','5gaosuc'];a285_0x2e9a=function(){return _0x34613d;};return a285_0x2e9a();}(function(_0x586722,_0x493995){const _0x49b1e9=a285_0x1427,_0x423260=_0x586722();while(!![]){try{const _0x74e336=parseInt(_0x49b1e9(0x10e))/0x1*(parseInt(_0x49b1e9(0x110))/0x2)+parseInt(_0x49b1e9(0x114))/0x3*(parseInt(_0x49b1e9(0x10d))/0x4)+parseInt(_0x49b1e9(0x115))/0x5*(parseInt(_0x49b1e9(0x112))/0x6)+parseInt(_0x49b1e9(0x111))/0x7*(-parseInt(_0x49b1e9(0x10f))/0x8)+-parseInt(_0x49b1e9(0x117))/0x9+-parseInt(_0x49b1e9(0x109))/0xa*(-parseInt(_0x49b1e9(0x119))/0xb)+parseInt(_0x49b1e9(0x116))/0xc;if(_0x74e336===_0x493995)break;else _0x423260['push'](_0x423260['shift']());}catch(_0x1b4fe7){_0x423260['push'](_0x423260['shift']());}}}(a285_0x2e9a,0x2c7a7));import a285_0x59afae from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x187983){const _0x563c4b=a285_0x1427;return JSON[_0x563c4b(0x10a)](JSON[_0x563c4b(0x118)](_0x187983),null,0x2)+'\x0a';}export function computePageContentHash(_0x5c2cf3){const _0x53cb96=a285_0x1427;return a285_0x59afae[_0x53cb96(0x108)]('md5')['update'](_0x5c2cf3)[_0x53cb96(0x113)](_0x53cb96(0x10c));}export function computeSerializedSchemaHash(_0x3da109){return computePageContentHash(serializePageSchemaForFile(_0x3da109));}export async function computePageFileHash(_0x5056f3){const _0x39d8f7=a285_0x1427,_0x39c6d9=await readFile(_0x5056f3,_0x39d8f7(0x10b));return computePageContentHash(_0x39c6d9);}
@@ -1 +1 @@
1
- function a286_0x35cc(_0x2f1dcf,_0x2f1e7e){_0x2f1dcf=_0x2f1dcf-0x143;const _0x26d615=a286_0x26d6();let _0x35cc4e=_0x26d615[_0x2f1dcf];return _0x35cc4e;}(function(_0x496d33,_0x4fbdb8){const _0x1b67b0=a286_0x35cc,_0x63c1c3=_0x496d33();while(!![]){try{const _0x17ef79=parseInt(_0x1b67b0(0x155))/0x1*(-parseInt(_0x1b67b0(0x149))/0x2)+-parseInt(_0x1b67b0(0x143))/0x3*(parseInt(_0x1b67b0(0x150))/0x4)+parseInt(_0x1b67b0(0x14c))/0x5*(-parseInt(_0x1b67b0(0x152))/0x6)+-parseInt(_0x1b67b0(0x14f))/0x7*(-parseInt(_0x1b67b0(0x14d))/0x8)+parseInt(_0x1b67b0(0x156))/0x9+parseInt(_0x1b67b0(0x14a))/0xa*(parseInt(_0x1b67b0(0x151))/0xb)+parseInt(_0x1b67b0(0x14b))/0xc*(parseInt(_0x1b67b0(0x144))/0xd);if(_0x17ef79===_0x4fbdb8)break;else _0x63c1c3['push'](_0x63c1c3['shift']());}catch(_0x2f960b){_0x63c1c3['push'](_0x63c1c3['shift']());}}}(a286_0x26d6,0x2879c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x2174c4,_0x473b58){const _0x364c71=a286_0x35cc,_0x4c6ed4={'apps':_0x2174c4['apps']&&typeof _0x2174c4['apps']==='object'?_0x2174c4['apps']:{}};let _0x2f0493=_0x4c6ed4[_0x364c71(0x145)][_0x473b58];if(!_0x2f0493)return _0x2f0493={'lastSync':'','pages':{}},_0x4c6ed4[_0x364c71(0x145)][_0x473b58]=_0x2f0493,{'lockData':_0x4c6ed4,'appLock':_0x2f0493};return!_0x2f0493[_0x364c71(0x154)]&&(_0x2f0493[_0x364c71(0x154)]=''),(!_0x2f0493['pages']||typeof _0x2f0493[_0x364c71(0x153)]!=='object')&&(_0x2f0493[_0x364c71(0x153)]={}),{'lockData':_0x4c6ed4,'appLock':_0x2f0493};}function a286_0x26d6(){const _0x46a082=['7652ziYKAi','20yGKBnO','1116FgsuyV','385100vgLbtx','7712eUgjIK','stringify','490MwhKpB','20ABXHxV','1156067SJXIHk','12hTqjit','pages','lastSync','47qHWCah','1804329IucXoq','utf8','175428YLNOaK','43875umzkPV','apps','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','parse','object'];a286_0x26d6=function(){return _0x46a082;};return a286_0x26d6();}export async function readPageLockFile(_0x51448c){const _0x457a1b=a286_0x35cc;try{const _0x4c4741=await readFile(_0x51448c,_0x457a1b(0x157)),_0x3c85b9=JSON[_0x457a1b(0x147)](_0x4c4741);return{'apps':_0x3c85b9[_0x457a1b(0x145)]&&typeof _0x3c85b9['apps']===_0x457a1b(0x148)?_0x3c85b9[_0x457a1b(0x145)]:{}};}catch(_0x27860a){if(_0x27860a['code']==='ENOENT')return null;throw new Error(_0x457a1b(0x146)+String(_0x27860a));}}export async function writePageLockFile(_0x378c57,_0x33712b){const _0x422456=a286_0x35cc;await mkdir(dirname(_0x378c57),{'recursive':!![]}),await writeFile(_0x378c57,JSON[_0x422456(0x14e)](_0x33712b,null,0x2),_0x422456(0x157));}
1
+ (function(_0x5ae512,_0x3b6b30){const _0x24e3bc=a286_0x4288,_0x2c5a07=_0x5ae512();while(!![]){try{const _0xc0e0a3=-parseInt(_0x24e3bc(0xd8))/0x1*(-parseInt(_0x24e3bc(0xca))/0x2)+-parseInt(_0x24e3bc(0xcc))/0x3*(-parseInt(_0x24e3bc(0xd2))/0x4)+-parseInt(_0x24e3bc(0xdb))/0x5+parseInt(_0x24e3bc(0xd0))/0x6*(-parseInt(_0x24e3bc(0xcb))/0x7)+parseInt(_0x24e3bc(0xce))/0x8*(-parseInt(_0x24e3bc(0xd7))/0x9)+parseInt(_0x24e3bc(0xd5))/0xa+parseInt(_0x24e3bc(0xd4))/0xb;if(_0xc0e0a3===_0x3b6b30)break;else _0x2c5a07['push'](_0x2c5a07['shift']());}catch(_0x4cd750){_0x2c5a07['push'](_0x2c5a07['shift']());}}}(a286_0x2382,0xa891b));function a286_0x4288(_0x5dd721,_0x1bec6f){_0x5dd721=_0x5dd721-0xca;const _0x23826c=a286_0x2382();let _0x4288ba=_0x23826c[_0x5dd721];return _0x4288ba;}import{mkdir,readFile,writeFile}from'node:fs/promises';function a286_0x2382(){const _0x2df1d6=['78744RZZkXB','parse','1063038zfkJYe','pages','3414896JWvNOl','object','13538712SkeljD','11529200WRxAJH','stringify','963PNNgXV','973HJzXvV','apps','utf8','6415865sRSxUM','code','ENOENT','1388Xdakjh','35IxmTry','3RxCtpo','Failed\x20to\x20read\x20page\x20lock\x20file:\x20'];a286_0x2382=function(){return _0x2df1d6;};return a286_0x2382();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0xe127bf,_0x16b88f){const _0x2c4548=a286_0x4288,_0x58693d={'apps':_0xe127bf[_0x2c4548(0xd9)]&&typeof _0xe127bf[_0x2c4548(0xd9)]==='object'?_0xe127bf[_0x2c4548(0xd9)]:{}};let _0x85a019=_0x58693d[_0x2c4548(0xd9)][_0x16b88f];if(!_0x85a019)return _0x85a019={'lastSync':'','pages':{}},_0x58693d['apps'][_0x16b88f]=_0x85a019,{'lockData':_0x58693d,'appLock':_0x85a019};return!_0x85a019['lastSync']&&(_0x85a019['lastSync']=''),(!_0x85a019[_0x2c4548(0xd1)]||typeof _0x85a019[_0x2c4548(0xd1)]!==_0x2c4548(0xd3))&&(_0x85a019['pages']={}),{'lockData':_0x58693d,'appLock':_0x85a019};}export async function readPageLockFile(_0xd59601){const _0x4b38c3=a286_0x4288;try{const _0x396745=await readFile(_0xd59601,_0x4b38c3(0xda)),_0x481e4c=JSON[_0x4b38c3(0xcf)](_0x396745);return{'apps':_0x481e4c[_0x4b38c3(0xd9)]&&typeof _0x481e4c[_0x4b38c3(0xd9)]==='object'?_0x481e4c['apps']:{}};}catch(_0x140e66){if(_0x140e66[_0x4b38c3(0xdc)]===_0x4b38c3(0xdd))return null;throw new Error(_0x4b38c3(0xcd)+String(_0x140e66));}}export async function writePageLockFile(_0x4ef385,_0x6c5f78){const _0x2c0902=a286_0x4288;await mkdir(dirname(_0x4ef385),{'recursive':!![]}),await writeFile(_0x4ef385,JSON[_0x2c0902(0xd6)](_0x6c5f78,null,0x2),_0x2c0902(0xda));}
@@ -1 +1 @@
1
- (function(_0x1c95de,_0x48324b){const _0x41249c=a287_0x67db,_0x2ceb82=_0x1c95de();while(!![]){try{const _0x19718d=parseInt(_0x41249c(0x1d4))/0x1*(parseInt(_0x41249c(0x1cd))/0x2)+parseInt(_0x41249c(0x1e5))/0x3*(-parseInt(_0x41249c(0x1e1))/0x4)+parseInt(_0x41249c(0x1d0))/0x5*(parseInt(_0x41249c(0x1d6))/0x6)+parseInt(_0x41249c(0x1ea))/0x7+parseInt(_0x41249c(0x1df))/0x8+parseInt(_0x41249c(0x1d5))/0x9*(-parseInt(_0x41249c(0x1ef))/0xa)+parseInt(_0x41249c(0x1d9))/0xb;if(_0x19718d===_0x48324b)break;else _0x2ceb82['push'](_0x2ceb82['shift']());}catch(_0x4f2aff){_0x2ceb82['push'](_0x2ceb82['shift']());}}}(a287_0x58b8,0x850d3));function a287_0x67db(_0x14d4de,_0x5e76a7){_0x14d4de=_0x14d4de-0x1c2;const _0x58b83b=a287_0x58b8();let _0x67db0a=_0x58b83b[_0x14d4de];return _0x67db0a;}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x10c152,_0x4a102a,_0x5465ca){const _0x2ff127=a287_0x67db,_0x5a39f8=parseSchema(_0x10c152,_0x2ff127(0x1cf)),_0x1289ec=parseSchema(_0x4a102a,_0x2ff127(0x1db)),_0x1738b0=collectLrSmartJsx(_0x5a39f8,!![]);if(_0x1738b0[_0x2ff127(0x1e4)]===0x0)return{'content':_0x10c152,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x223114=new Map(collectLrSmartJsx(_0x1289ec)[_0x2ff127(0x1da)](_0xefb92=>[_0xefb92[_0x2ff127(0x1d3)],_0xefb92]));let _0x416e1e=0x0,_0x440d16=0x0;for(const _0x8b7613 of _0x1738b0){const _0x56f87c=readNonEmptyString(_0x8b7613[_0x2ff127(0x1f1)][_0x2ff127(0x1cb)]),_0x191e83=readNonEmptyString(_0x8b7613['render'][_0x2ff127(0x1c2)]),_0x245686=_0x223114[_0x2ff127(0x1e7)](_0x8b7613[_0x2ff127(0x1d3)]),_0x3e50e4=readNonEmptyString(_0x245686?.[_0x2ff127(0x1f1)][_0x2ff127(0x1cb)]),_0x1156db=readNonEmptyString(_0x245686?.[_0x2ff127(0x1f1)]['value']);let _0x19f84c=![];_0x8b7613['render']['type']!==_0x2ff127(0x1e6)&&(_0x8b7613[_0x2ff127(0x1f1)][_0x2ff127(0x1ec)]='JSFunction',_0x19f84c=!![]);!isPageContextExpression(_0x8b7613[_0x2ff127(0x1d7)][_0x2ff127(0x1c8)])&&(_0x8b7613['props'][_0x2ff127(0x1c8)]={'type':'JSExpression','value':_0x2ff127(0x1ee)},_0x19f84c=!![]);if(!_0x56f87c){if(!_0x191e83)throw CliErrors[_0x2ff127(0x1d8)]('LrSmartJsx\x20node\x20\x22'+_0x8b7613['label']+_0x2ff127(0x1cc),_0x2ff127(0x1e2));if(_0x19f84c)_0x440d16+=0x1;continue;}const _0x41f970=!_0x245686||_0x56f87c!==_0x3e50e4,_0x15df52=!_0x191e83;if(!_0x41f970&&_0x191e83&&_0x1156db&&_0x191e83!==_0x1156db)throw CliErrors['validation'](_0x2ff127(0x1eb)+_0x8b7613[_0x2ff127(0x1c5)]+_0x2ff127(0x1dd),_0x2ff127(0x1e0));if(_0x41f970||_0x15df52||!_0x1156db){const _0xf16f74=readNonEmptyString(await _0x5465ca(_0x56f87c));if(!_0xf16f74)throw CliErrors[_0x2ff127(0x1d2)](_0x2ff127(0x1ed)+_0x8b7613['label']+'\x22.');_0x8b7613[_0x2ff127(0x1f1)][_0x2ff127(0x1c2)]=_0xf16f74,_0x416e1e+=0x1,_0x19f84c=!![];}if(_0x19f84c)_0x440d16+=0x1;}if(_0x440d16===0x0)return{'content':_0x10c152,'compiledNodes':_0x416e1e,'normalizedNodes':_0x440d16};return{'content':JSON['stringify'](_0x5a39f8),'compiledNodes':_0x416e1e,'normalizedNodes':_0x440d16};}function parseSchema(_0x4b5edf,_0x7297a6){const _0x1ca37b=a287_0x67db;try{return JSON['parse'](_0x4b5edf);}catch{throw CliErrors[_0x1ca37b(0x1d8)](_0x1ca37b(0x1e3)+_0x7297a6+_0x1ca37b(0x1c9));}}function a287_0x58b8(){const _0x5bd854=['string','2497656vSanwO','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','212fMhMlg','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','Invalid\x20JSON\x20in\x20','length','36474ewSddS','JSFunction','get','LrSmartJsx','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','2523549mPZlMA','LrSmartJsx\x20node\x20\x22','type','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','this','681510IezEqG','componentName','render','value','id:','\x22\x20has\x20missing\x20or\x20invalid\x20props.','label','trim','JSExpression','_context','\x20page\x20schema.','entries','source','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','1632874nMCvdK','path:','local','55155glYabn','forEach','apiError','key','1ZkCQuA','54HNKIsY','42OqhZal','props','validation','350801kpBIln','map','remote','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','\x22\x20has\x20a\x20manually\x20changed\x20render.value.'];a287_0x58b8=function(){return _0x5bd854;};return a287_0x58b8();}function collectLrSmartJsx(_0x1f55af,_0x498ac5=![]){const _0x17c95b=[],_0x3432e8=(_0x3a50e0,_0x51158f)=>{const _0x5ab547=a287_0x67db;if(Array['isArray'](_0x3a50e0)){_0x3a50e0[_0x5ab547(0x1d1)]((_0x169450,_0x3550ce)=>_0x3432e8(_0x169450,_0x51158f+'['+_0x3550ce+']'));return;}if(!isObject(_0x3a50e0))return;if(_0x3a50e0['componentName']==='LrSmartJsx'){const _0x51e603=readNonEmptyString(_0x3a50e0['id']),_0x38b569=_0x51e603||_0x51158f,_0x277958=isObject(_0x3a50e0[_0x5ab547(0x1d7)])?_0x3a50e0[_0x5ab547(0x1d7)]:undefined;if(!_0x277958){if(_0x498ac5)throw CliErrors['validation'](_0x5ab547(0x1eb)+_0x38b569+_0x5ab547(0x1c4),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x409b89=isObject(_0x277958[_0x5ab547(0x1f1)])?_0x277958['render']:undefined;if(!_0x409b89){if(_0x498ac5)throw CliErrors[_0x5ab547(0x1d8)](_0x5ab547(0x1eb)+_0x38b569+_0x5ab547(0x1dc),_0x5ab547(0x1e9));return;}_0x17c95b['push']({'key':_0x51e603?_0x5ab547(0x1c3)+_0x51e603:_0x5ab547(0x1ce)+_0x51158f,'label':_0x38b569,'props':_0x277958,'render':_0x409b89});}for(const [_0x4e0031,_0x51b8fc]of Object[_0x5ab547(0x1ca)](_0x3a50e0)){if(_0x4e0031===_0x5ab547(0x1d7)&&_0x3a50e0[_0x5ab547(0x1f0)]===_0x5ab547(0x1e8))continue;_0x3432e8(_0x51b8fc,_0x51158f+'.'+_0x4e0031);}};return _0x3432e8(_0x1f55af,'$'),_0x17c95b;}function isObject(_0x1bb4e6){return Boolean(_0x1bb4e6)&&typeof _0x1bb4e6==='object'&&!Array['isArray'](_0x1bb4e6);}function readNonEmptyString(_0x441fa9){const _0x4c32cc=a287_0x67db;return typeof _0x441fa9===_0x4c32cc(0x1de)&&_0x441fa9[_0x4c32cc(0x1c6)]()?_0x441fa9:undefined;}function isPageContextExpression(_0x2ed093){const _0x39619d=a287_0x67db;return isObject(_0x2ed093)&&_0x2ed093[_0x39619d(0x1ec)]===_0x39619d(0x1c7)&&_0x2ed093[_0x39619d(0x1c2)]===_0x39619d(0x1ee);}
1
+ (function(_0x437a0d,_0xc42569){const _0xbbd06b=a287_0x556a,_0x30fff8=_0x437a0d();while(!![]){try{const _0x17df7f=parseInt(_0xbbd06b(0x166))/0x1+parseInt(_0xbbd06b(0x144))/0x2+parseInt(_0xbbd06b(0x14f))/0x3*(-parseInt(_0xbbd06b(0x15d))/0x4)+-parseInt(_0xbbd06b(0x15e))/0x5+-parseInt(_0xbbd06b(0x147))/0x6+parseInt(_0xbbd06b(0x146))/0x7*(parseInt(_0xbbd06b(0x149))/0x8)+parseInt(_0xbbd06b(0x141))/0x9;if(_0x17df7f===_0xc42569)break;else _0x30fff8['push'](_0x30fff8['shift']());}catch(_0x4f1985){_0x30fff8['push'](_0x30fff8['shift']());}}}(a287_0x5f42,0x1ff4d));function a287_0x5f42(){const _0x36885c=['\x22\x20has\x20a\x20manually\x20changed\x20render.value.','\x22\x20has\x20missing\x20or\x20invalid\x20props.','LrSmartJsx\x20node\x20\x22','remote','props','entries','this','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','76tXpQLs','485535gmlxGV','apiError','path:','id:','render','get','source','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','88686jjUsIn','forEach','JSFunction','length','type','4020669GklXHD','label','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','42872NgEVJr','map','70nzSiga','1138092jBjIdT','componentName','90952qrwXoz','Invalid\x20JSON\x20in\x20','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','local','isArray','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','39927IDUstS','\x20page\x20schema.','value','_context','validation','JSExpression'];a287_0x5f42=function(){return _0x36885c;};return a287_0x5f42();}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x374e7e,_0x2f79de,_0x2bf331){const _0x1077fa=a287_0x556a,_0x4bf4ba=parseSchema(_0x374e7e,_0x1077fa(0x14c)),_0x451b66=parseSchema(_0x2f79de,_0x1077fa(0x158)),_0x5e5342=collectLrSmartJsx(_0x4bf4ba,!![]);if(_0x5e5342[_0x1077fa(0x13f)]===0x0)return{'content':_0x374e7e,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x253f80=new Map(collectLrSmartJsx(_0x451b66)[_0x1077fa(0x145)](_0xedc79e=>[_0xedc79e['key'],_0xedc79e]));let _0x101edc=0x0,_0x489b47=0x0;for(const _0x26a967 of _0x5e5342){const _0x553732=readNonEmptyString(_0x26a967['render']['source']),_0x90cbc5=readNonEmptyString(_0x26a967[_0x1077fa(0x162)]['value']),_0x478a26=_0x253f80[_0x1077fa(0x163)](_0x26a967['key']),_0x3b0f2d=readNonEmptyString(_0x478a26?.['render'][_0x1077fa(0x164)]),_0xf23fe6=readNonEmptyString(_0x478a26?.[_0x1077fa(0x162)][_0x1077fa(0x151)]);let _0x53ae5d=![];_0x26a967[_0x1077fa(0x162)][_0x1077fa(0x140)]!==_0x1077fa(0x168)&&(_0x26a967['render']['type']=_0x1077fa(0x168),_0x53ae5d=!![]);!isPageContextExpression(_0x26a967[_0x1077fa(0x159)][_0x1077fa(0x152)])&&(_0x26a967['props'][_0x1077fa(0x152)]={'type':_0x1077fa(0x154),'value':_0x1077fa(0x15b)},_0x53ae5d=!![]);if(!_0x553732){if(!_0x90cbc5)throw CliErrors['validation'](_0x1077fa(0x157)+_0x26a967['label']+'\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.',_0x1077fa(0x165));if(_0x53ae5d)_0x489b47+=0x1;continue;}const _0x4dd694=!_0x478a26||_0x553732!==_0x3b0f2d,_0x338fdd=!_0x90cbc5;if(!_0x4dd694&&_0x90cbc5&&_0xf23fe6&&_0x90cbc5!==_0xf23fe6)throw CliErrors[_0x1077fa(0x153)](_0x1077fa(0x157)+_0x26a967['label']+_0x1077fa(0x155),_0x1077fa(0x14b));if(_0x4dd694||_0x338fdd||!_0xf23fe6){const _0x59927d=readNonEmptyString(await _0x2bf331(_0x553732));if(!_0x59927d)throw CliErrors[_0x1077fa(0x15f)]('LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22'+_0x26a967[_0x1077fa(0x142)]+'\x22.');_0x26a967[_0x1077fa(0x162)][_0x1077fa(0x151)]=_0x59927d,_0x101edc+=0x1,_0x53ae5d=!![];}if(_0x53ae5d)_0x489b47+=0x1;}if(_0x489b47===0x0)return{'content':_0x374e7e,'compiledNodes':_0x101edc,'normalizedNodes':_0x489b47};return{'content':JSON['stringify'](_0x4bf4ba),'compiledNodes':_0x101edc,'normalizedNodes':_0x489b47};}function a287_0x556a(_0x503862,_0x4e2c95){_0x503862=_0x503862-0x13f;const _0x5f4234=a287_0x5f42();let _0x556a09=_0x5f4234[_0x503862];return _0x556a09;}function parseSchema(_0x423a52,_0xc61c52){const _0x1f5262=a287_0x556a;try{return JSON['parse'](_0x423a52);}catch{throw CliErrors[_0x1f5262(0x153)](_0x1f5262(0x14a)+_0xc61c52+_0x1f5262(0x150));}}function collectLrSmartJsx(_0x3ed054,_0x3c9b2b=![]){const _0x1eb19a=[],_0x165529=(_0xa63cd4,_0x2d467)=>{const _0x336a09=a287_0x556a;if(Array[_0x336a09(0x14d)](_0xa63cd4)){_0xa63cd4[_0x336a09(0x167)]((_0x8a5d3f,_0x20f307)=>_0x165529(_0x8a5d3f,_0x2d467+'['+_0x20f307+']'));return;}if(!isObject(_0xa63cd4))return;if(_0xa63cd4[_0x336a09(0x148)]==='LrSmartJsx'){const _0x14c2e7=readNonEmptyString(_0xa63cd4['id']),_0x52287a=_0x14c2e7||_0x2d467,_0x5aa236=isObject(_0xa63cd4[_0x336a09(0x159)])?_0xa63cd4[_0x336a09(0x159)]:undefined;if(!_0x5aa236){if(_0x3c9b2b)throw CliErrors[_0x336a09(0x153)](_0x336a09(0x157)+_0x52287a+_0x336a09(0x156),_0x336a09(0x143));return;}const _0x21b6a0=isObject(_0x5aa236['render'])?_0x5aa236['render']:undefined;if(!_0x21b6a0){if(_0x3c9b2b)throw CliErrors[_0x336a09(0x153)](_0x336a09(0x157)+_0x52287a+_0x336a09(0x14e),_0x336a09(0x15c));return;}_0x1eb19a['push']({'key':_0x14c2e7?_0x336a09(0x161)+_0x14c2e7:_0x336a09(0x160)+_0x2d467,'label':_0x52287a,'props':_0x5aa236,'render':_0x21b6a0});}for(const [_0x4f8b94,_0xff9a0f]of Object[_0x336a09(0x15a)](_0xa63cd4)){if(_0x4f8b94===_0x336a09(0x159)&&_0xa63cd4[_0x336a09(0x148)]==='LrSmartJsx')continue;_0x165529(_0xff9a0f,_0x2d467+'.'+_0x4f8b94);}};return _0x165529(_0x3ed054,'$'),_0x1eb19a;}function isObject(_0x373c00){const _0x5ef6c6=a287_0x556a;return Boolean(_0x373c00)&&typeof _0x373c00==='object'&&!Array[_0x5ef6c6(0x14d)](_0x373c00);}function readNonEmptyString(_0x574c20){return typeof _0x574c20==='string'&&_0x574c20['trim']()?_0x574c20:undefined;}function isPageContextExpression(_0x9e4a22){const _0x2e8347=a287_0x556a;return isObject(_0x9e4a22)&&_0x9e4a22[_0x2e8347(0x140)]===_0x2e8347(0x154)&&_0x9e4a22[_0x2e8347(0x151)]===_0x2e8347(0x15b);}
@@ -1 +1 @@
1
- (function(_0x3742d4,_0x4342b6){const _0x2ef31b=a289_0x3f4f,_0x36b8af=_0x3742d4();while(!![]){try{const _0xb2d56=parseInt(_0x2ef31b(0x12d))/0x1+parseInt(_0x2ef31b(0x156))/0x2*(-parseInt(_0x2ef31b(0x12c))/0x3)+parseInt(_0x2ef31b(0x151))/0x4+parseInt(_0x2ef31b(0x163))/0x5*(-parseInt(_0x2ef31b(0x140))/0x6)+-parseInt(_0x2ef31b(0x127))/0x7*(-parseInt(_0x2ef31b(0x13b))/0x8)+parseInt(_0x2ef31b(0x141))/0x9*(-parseInt(_0x2ef31b(0x14d))/0xa)+parseInt(_0x2ef31b(0x164))/0xb;if(_0xb2d56===_0x4342b6)break;else _0x36b8af['push'](_0x36b8af['shift']());}catch(_0x4c6d57){_0x36b8af['push'](_0x36b8af['shift']());}}}(a289_0x466c,0x41c1f));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x316fbd,_0x52eaa5){const _0x355592=a289_0x3f4f,_0x872873=[],_0x56bf55=normalizeSqlForStaticAnalysis(_0x316fbd),_0x52f39e=(_0x56bf55[_0x355592(0x15a)]?[]:extractJoinFacts(_0x56bf55['sql']))[_0x355592(0x139)](_0x2db1e8=>{const _0x365c0c=_0x355592;if(_0x2db1e8[_0x365c0c(0x123)]||_0x2db1e8[_0x365c0c(0x11c)][_0x365c0c(0x143)]===0x0)return _0x872873['push']({'code':_0x365c0c(0x14a),'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'reason':_0x2db1e8[_0x365c0c(0x14c)]??_0x365c0c(0x153)}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x157)};const _0x3bf8fe=resolveTableMetadata(_0x52eaa5,_0x2db1e8[_0x365c0c(0x148)]),_0x3af0dd=(_0x3bf8fe?.[_0x365c0c(0x119)]??[])[_0x365c0c(0x139)](_0x350f20=>({'index':_0x350f20,'matchedPrefix':findEqualityPrefix(_0x350f20[_0x365c0c(0x11c)],_0x2db1e8[_0x365c0c(0x11c)])}))[_0x365c0c(0x161)](_0x2dae40=>_0x2dae40['matchedPrefix'][_0x365c0c(0x143)]>0x0),_0x2e3877=_0x3af0dd['reduce']((_0x762cca,_0x3454e3)=>!_0x762cca||_0x3454e3['matchedPrefix'][_0x365c0c(0x143)]>_0x762cca[_0x365c0c(0x150)][_0x365c0c(0x143)]?_0x3454e3:_0x762cca,_0x3af0dd[0x0]);if(_0x2e3877)return{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x15f),'matchedIndex':{..._0x2e3877[_0x365c0c(0x162)],'matchedPrefix':_0x2e3877[_0x365c0c(0x150)]}};const _0x3a8a47=_0x3bf8fe?.[_0x365c0c(0x119)][_0x365c0c(0x161)](_0x583257=>_0x583257[_0x365c0c(0x11c)][_0x365c0c(0x13d)](_0x94a098=>_0x2db1e8[_0x365c0c(0x11c)][_0x365c0c(0x13d)](_0x528a76=>columnNamesMatch(_0x94a098,_0x528a76))))??[];if(_0x3a8a47['length']>0x0)return _0x872873[_0x365c0c(0x15b)]({'code':_0x365c0c(0x130),'table':_0x2db1e8['table'],'alias':_0x2db1e8['alias'],'columns':_0x2db1e8[_0x365c0c(0x11c)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x134),'candidateIndexes':_0x3a8a47};if(_0x3bf8fe&&_0x3bf8fe[_0x365c0c(0x115)]!==![]&&_0x3bf8fe[_0x365c0c(0x119)][_0x365c0c(0x143)]>0x0&&_0x2db1e8[_0x365c0c(0x11c)][_0x365c0c(0x143)]>0x0)return _0x872873[_0x365c0c(0x15b)]({'code':_0x365c0c(0x138),'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'reason':_0x365c0c(0x135)}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':'warning'};return _0x872873[_0x365c0c(0x15b)]({'code':_0x365c0c(0x14e),'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8['columns'],'reason':_0x3bf8fe?_0x365c0c(0x11b):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x157)};});return{'checked':_0x52f39e[_0x355592(0x143)]>0x0,'joins':_0x52f39e,'warnings':_0x872873};}function extractJoinFacts(_0x1ea684){const _0x3aef84=a289_0x3f4f,_0x5071d0=maskNestedQueries(stripSqlNoise(_0x1ea684)),_0x4a6327=maskQuotedIdentifiers(_0x5071d0),_0x1f06cb=[],_0x5baf47=new Set(),_0x4871fa=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x25c131 of _0x5071d0[_0x3aef84(0x125)](_0x4871fa)){const _0x57b169=_0x25c131[_0x3aef84(0x162)]??0x0,_0x18731a=_0x25c131[0x0][_0x3aef84(0x131)](/\bJOIN\b/i),_0x195dc5=_0x57b169+Math[_0x3aef84(0x133)](0x0,_0x18731a);if(!/^JOIN\b/i[_0x3aef84(0x132)](_0x4a6327['slice'](_0x195dc5)))continue;_0x5baf47[_0x3aef84(0x11a)](_0x195dc5);const _0x23dc56=normalizeIdentifier(_0x25c131[0x1]||_0x3aef84(0x12e)),_0x3e5411=normalizeIdentifier(_0x25c131[0x2]??''),_0x23f799=normalizeIdentifier(_0x25c131[0x3]||_0x3e5411[_0x3aef84(0x11d)]('.')['at'](-0x1)||_0x3e5411),_0x76438d=[],_0x301bb9=_0x3e5411==='__sq__';let _0x4089a5=_0x23dc56===_0x3aef84(0x129)||_0x23dc56==='full'||_0x301bb9,_0x3bc67f=_0x4089a5?_0x301bb9?_0x3aef84(0x149):_0x23dc56[_0x3aef84(0x114)]()+_0x3aef84(0x145):undefined;const _0x57facf=stripOuterParentheses(_0x25c131[0x4]??''),_0x35ae14=_0x57facf['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x57facf[_0x3aef84(0x12a)](MYBATIS_DYNAMIC_END_MARKER),_0x5d439e=_0x57facf[_0x3aef84(0x12a)](MYBATIS_INCLUDE_MARKER);_0x35ae14&&(_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x122));_0x5d439e&&(_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x15c));const _0x577917=_0x57facf['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x3aef84(0x136)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x577917,'OR')&&(_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x154));for(const _0x206129 of splitTopLevelAnd(_0x577917)){const _0x1c175a=stripOuterParentheses(_0x206129);if(hasTopLevelKeyword(_0x1c175a,'OR')){_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x154);continue;}const _0x4d1fe6=splitEquality(_0x1c175a);if(!_0x4d1fe6){containsColumnReference(_0x206129,_0x23f799)&&(_0x4089a5=!![]);continue;}const _0x52a50f=parseDirectColumnReference(_0x4d1fe6[0x0],_0x23f799),_0x35d265=parseDirectColumnReference(_0x4d1fe6[0x1],_0x23f799),_0x195d9f=containsColumnReference(_0x4d1fe6[0x0],_0x23f799),_0x4b6e54=containsColumnReference(_0x4d1fe6[0x1],_0x23f799),_0x922e68=_0x52a50f&&!_0x4b6e54?_0x52a50f:_0x35d265&&!_0x195d9f?_0x35d265:null;if(_0x922e68&&!_0x76438d[_0x3aef84(0x12a)](_0x922e68))_0x76438d[_0x3aef84(0x15b)](_0x922e68);else!_0x922e68&&containsColumnReference(_0x206129,_0x23f799)&&(_0x4089a5=!![]);}_0x1f06cb[_0x3aef84(0x15b)]({'table':_0x3e5411,'alias':_0x23f799,'columns':_0x76438d,'unsupportedPredicate':_0x4089a5,'unsupportedReason':_0x3bc67f,'containsUnresolvedInclude':_0x5d439e,'position':_0x195dc5});}for(const _0x2d1e62 of _0x4a6327[_0x3aef84(0x125)](/\bJOIN\b/gi)){const _0xeb9bd1=_0x2d1e62[_0x3aef84(0x162)]??0x0;if(_0x5baf47[_0x3aef84(0x15e)](_0xeb9bd1))continue;const _0x2d39d5=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x3aef84(0x11e)](_0x5071d0[_0x3aef84(0x12f)](_0xeb9bd1+_0x2d1e62[0x0]['length'])),_0x1254c3=normalizeIdentifier(_0x2d39d5?.[0x1]||_0x3aef84(0x126)),_0x291583=normalizeIdentifier(_0x2d39d5?.[0x2]||''),_0x476823=isSqlClauseKeyword(_0x291583)?_0x1254c3[_0x3aef84(0x11d)]('.')['at'](-0x1)||_0x1254c3:_0x291583||_0x1254c3[_0x3aef84(0x11d)]('.')['at'](-0x1)||_0x1254c3;_0x1f06cb[_0x3aef84(0x15b)]({'table':_0x1254c3,'alias':_0x476823,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3aef84(0x147),'position':_0xeb9bd1});}const _0xc48805=_0x4a6327[_0x3aef84(0x14b)](MYBATIS_INCLUDE_MARKER);return _0xc48805>=0x0&&!_0x1f06cb['some'](_0x34252a=>_0x34252a[_0x3aef84(0x144)])&&_0x1f06cb['push']({'table':'unknown','alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3aef84(0x15d),'containsUnresolvedInclude':!![],'position':_0xc48805}),_0x1f06cb[_0x3aef84(0x124)]((_0x2b075a,_0x4afd7b)=>_0x2b075a[_0x3aef84(0x13a)]-_0x4afd7b['position']);}function stripSqlNoise(_0x1ff871){const _0x44885a=a289_0x3f4f,_0x1b2813=Array[_0x44885a(0x121)](_0x1ff871),_0x1cf43e=(_0x36dab7,_0x374376)=>{for(let _0x1b0a2a=_0x36dab7;_0x1b0a2a<_0x374376;_0x1b0a2a+=0x1){_0x1b2813[_0x1b0a2a]!=='\x0a'&&_0x1b2813[_0x1b0a2a]!=='\x0d'&&(_0x1b2813[_0x1b0a2a]='\x20');}};for(let _0x4c7ab1=0x0;_0x4c7ab1<_0x1b2813['length'];_0x4c7ab1+=0x1){const _0x3d75c5=_0x1b2813[_0x4c7ab1],_0x47383c=_0x1b2813[_0x4c7ab1+0x1];if(_0x3d75c5==='\x27'||_0x3d75c5==='\x22'||_0x3d75c5==='`'){const _0x21b39e=_0x3d75c5,_0x2815dc=_0x4c7ab1;_0x4c7ab1+=0x1;while(_0x4c7ab1<_0x1b2813['length']){if(_0x1b2813[_0x4c7ab1]==='\x5c'&&_0x4c7ab1+0x1<_0x1b2813[_0x44885a(0x143)]){_0x4c7ab1+=0x2;continue;}if(_0x1b2813[_0x4c7ab1]!==_0x21b39e){_0x4c7ab1+=0x1;continue;}if(_0x1b2813[_0x4c7ab1+0x1]===_0x21b39e){_0x4c7ab1+=0x2;continue;}break;}if(_0x21b39e==='\x27')_0x1cf43e(_0x2815dc,Math[_0x44885a(0x137)](_0x4c7ab1+0x1,_0x1b2813[_0x44885a(0x143)]));continue;}if(_0x3d75c5==='-'&&_0x47383c==='-'){const _0x32fbeb=_0x4c7ab1;while(_0x4c7ab1<_0x1b2813[_0x44885a(0x143)]&&_0x1b2813[_0x4c7ab1]!=='\x0a')_0x4c7ab1+=0x1;_0x1cf43e(_0x32fbeb,_0x4c7ab1);continue;}if(_0x3d75c5==='/'&&_0x47383c==='*'){const _0x323430=_0x4c7ab1;_0x4c7ab1+=0x2;while(_0x4c7ab1<_0x1b2813['length']&&!(_0x1b2813[_0x4c7ab1]==='*'&&_0x1b2813[_0x4c7ab1+0x1]==='/')){_0x4c7ab1+=0x1;}_0x4c7ab1=Math['min'](_0x4c7ab1+0x1,_0x1b2813[_0x44885a(0x143)]-0x1),_0x1cf43e(_0x323430,_0x4c7ab1+0x1);continue;}if(_0x3d75c5==='#'&&_0x47383c!=='{'){const _0x1be1c5=_0x4c7ab1;while(_0x4c7ab1<_0x1b2813['length']&&_0x1b2813[_0x4c7ab1]!=='\x0a')_0x4c7ab1+=0x1;_0x1cf43e(_0x1be1c5,_0x4c7ab1);continue;}if((_0x3d75c5==='#'||_0x3d75c5==='$')&&_0x47383c==='{'){const _0x46ec8a=_0x4c7ab1;_0x4c7ab1+=0x2;while(_0x4c7ab1<_0x1b2813[_0x44885a(0x143)]&&_0x1b2813[_0x4c7ab1]!=='}')_0x4c7ab1+=0x1;_0x1cf43e(_0x46ec8a,Math[_0x44885a(0x137)](_0x4c7ab1+0x1,_0x1b2813[_0x44885a(0x143)]));}}return _0x1b2813[_0x44885a(0x120)]('');}function maskQuotedIdentifiers(_0x958663){const _0xf1e1b9=a289_0x3f4f,_0x5d9ab7=Array[_0xf1e1b9(0x121)](_0x958663);for(let _0x266ecf=0x0;_0x266ecf<_0x5d9ab7[_0xf1e1b9(0x143)];_0x266ecf+=0x1){const _0x56a621=_0x5d9ab7[_0x266ecf];if(_0x56a621!=='\x22'&&_0x56a621!=='`')continue;_0x266ecf+=0x1;while(_0x266ecf<_0x5d9ab7[_0xf1e1b9(0x143)]){if(_0x5d9ab7[_0x266ecf]===_0x56a621){if(_0x5d9ab7[_0x266ecf+0x1]===_0x56a621){_0x5d9ab7[_0x266ecf]='\x20',_0x5d9ab7[_0x266ecf+0x1]='\x20',_0x266ecf+=0x2;continue;}break;}_0x5d9ab7[_0x266ecf]='\x20',_0x266ecf+=0x1;}}return _0x5d9ab7[_0xf1e1b9(0x120)]('');}function maskNestedQueries(_0x28b34e){const _0xd44a27=a289_0x3f4f,_0x14dbbd=Array[_0xd44a27(0x121)](_0x28b34e);for(let _0x4e36c9=0x0;_0x4e36c9<_0x14dbbd['length'];_0x4e36c9+=0x1){if(_0x14dbbd[_0x4e36c9]!=='(')continue;const _0x4524b9=_0x28b34e[_0xd44a27(0x12f)](_0x4e36c9+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x4524b9))continue;let _0x3bc5be=0x1,_0x46755e=_0x4e36c9+0x1;for(;_0x46755e<_0x14dbbd[_0xd44a27(0x143)]&&_0x3bc5be>0x0;_0x46755e+=0x1){if(_0x14dbbd[_0x46755e]==='(')_0x3bc5be+=0x1;if(_0x14dbbd[_0x46755e]===')')_0x3bc5be-=0x1;}if(_0x3bc5be!==0x0)continue;for(let _0x3b5346=_0x4e36c9;_0x3b5346<_0x46755e;_0x3b5346+=0x1){_0x14dbbd[_0x3b5346]='\x20';}const _0x107c7f=_0xd44a27(0x146);for(let _0x58ccbd=0x0;_0x58ccbd<_0x107c7f[_0xd44a27(0x143)]&&_0x4e36c9+_0x58ccbd<_0x46755e;_0x58ccbd+=0x1){_0x14dbbd[_0x4e36c9+_0x58ccbd]=_0x107c7f[_0x58ccbd];}_0x4e36c9=_0x46755e-0x1;}return _0x14dbbd[_0xd44a27(0x120)]('');}function splitTopLevelAnd(_0x12a14d){const _0x728456=a289_0x3f4f,_0x23e807=[];let _0x4bd1f2=0x0,_0x41f34e=0x0;for(let _0x3e3e78=0x0;_0x3e3e78<_0x12a14d[_0x728456(0x143)];_0x3e3e78+=0x1){const _0x5824f4=_0x12a14d[_0x3e3e78];if(_0x5824f4==='(')_0x4bd1f2+=0x1;if(_0x5824f4===')')_0x4bd1f2=Math[_0x728456(0x133)](0x0,_0x4bd1f2-0x1);_0x4bd1f2===0x0&&_0x12a14d[_0x728456(0x12f)](_0x3e3e78)['match'](/^AND\b/i)&&(_0x3e3e78===0x0||/\s/[_0x728456(0x132)](_0x12a14d[_0x3e3e78-0x1]??''))&&(_0x23e807[_0x728456(0x15b)](_0x12a14d[_0x728456(0x12f)](_0x41f34e,_0x3e3e78)[_0x728456(0x13c)]()),_0x3e3e78+=0x2,_0x41f34e=_0x3e3e78+0x1);}const _0x40832b=_0x12a14d[_0x728456(0x12f)](_0x41f34e)[_0x728456(0x13c)]();if(_0x40832b)_0x23e807[_0x728456(0x15b)](_0x40832b);return _0x23e807;}function hasTopLevelKeyword(_0x3786a7,_0x5e7329){const _0x25fab7=a289_0x3f4f;let _0x19baf7=0x0;for(let _0x1144c7=0x0;_0x1144c7<_0x3786a7[_0x25fab7(0x143)];_0x1144c7+=0x1){const _0x17b67b=_0x3786a7[_0x1144c7];if(_0x17b67b==='(')_0x19baf7+=0x1;if(_0x17b67b===')')_0x19baf7=Math['max'](0x0,_0x19baf7-0x1);if(_0x19baf7!==0x0)continue;const _0x4fde68=_0x3786a7[_0x25fab7(0x12f)](_0x1144c7,_0x1144c7+_0x5e7329[_0x25fab7(0x143)]),_0x195c17=_0x3786a7[_0x1144c7-0x1]??'\x20',_0xfbe358=_0x3786a7[_0x1144c7+_0x5e7329[_0x25fab7(0x143)]]??'\x20';if(_0x4fde68[_0x25fab7(0x114)]()===_0x5e7329[_0x25fab7(0x114)]()&&!/[\w$]/[_0x25fab7(0x132)](_0x195c17)&&!/[\w$]/[_0x25fab7(0x132)](_0xfbe358))return!![];}return![];}function splitEquality(_0x24e57a){const _0x55af1b=a289_0x3f4f,_0x3f830c=stripOuterParentheses(_0x24e57a);let _0xf61ca7=0x0,_0x28a11f;for(let _0x354089=0x0;_0x354089<_0x3f830c[_0x55af1b(0x143)];_0x354089+=0x1){const _0x38be71=_0x3f830c[_0x354089];if(_0x38be71==='(')_0xf61ca7+=0x1;if(_0x38be71===')')_0xf61ca7=Math[_0x55af1b(0x133)](0x0,_0xf61ca7-0x1);const _0x4c27bd=_0x3f830c[_0x354089-0x1]??'',_0x3614b1=_0x3f830c[_0x354089+0x1]??'';if(_0x38be71==='='&&_0xf61ca7===0x0&&!/[!<>=:]/[_0x55af1b(0x132)](_0x4c27bd)&&_0x3614b1!=='='){if(_0x28a11f!==undefined)return null;_0x28a11f=_0x354089;}}return _0x28a11f===undefined?null:[_0x3f830c[_0x55af1b(0x12f)](0x0,_0x28a11f)[_0x55af1b(0x13c)](),_0x3f830c[_0x55af1b(0x12f)](_0x28a11f+0x1)['trim']()];}function parseDirectColumnReference(_0x593e9e,_0x2d1e02){const _0xe789bb=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x593e9e));if(!_0xe789bb)return null;if(normalizeIdentifier(_0xe789bb[0x1]??'')!==normalizeIdentifier(_0x2d1e02))return null;return normalizeIdentifier(_0xe789bb[0x2]??'');}function a289_0x466c(){const _0x404a0c=['unknown','28nTBrmK','where','right','includes','full','159IadPEg','166966DMmGQb','INNER','slice','JOIN_INDEX_NOT_USABLE','search','test','max','warning','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','replaceAll','min','JOIN_INDEX_MISSING','map','position','256616wlIKct','trim','some','startsWith','toLowerCase','1632iyuUrh','153JUFBpj','using','length','containsUnresolvedInclude','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','__sq__','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','table','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','JOIN_PREDICATE_UNSUPPORTED','indexOf','unsupportedReason','13690SUzwUj','INDEX_METADATA_UNAVAILABLE','tableName','matchedPrefix','416192WvruFY','cross','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','replace','4556jrVZNd','unavailable','left','natural','error','push','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','has','covered','(?:^|[^\x5cw$])','filter','index','5440EXkXHR','3409604hVOfxz','toUpperCase','metadataAvailable','inner','\x5c$&','\x5cs*\x5c.\x5cs*[\x5cw$]+','indexes','add','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','columns','split','exec','alias','join','from','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','unsupportedPredicate','sort','matchAll'];a289_0x466c=function(){return _0x404a0c;};return a289_0x466c();}function containsColumnReference(_0x9856e1,_0x198948){const _0x3164e4=a289_0x3f4f,_0x3e8405=_0x9856e1[_0x3164e4(0x155)](/[`"]/g,''),_0x732452=_0x198948[_0x3164e4(0x155)](/[.*+?^${}()|[\]\\]/g,_0x3164e4(0x117));return new RegExp(_0x3164e4(0x160)+_0x732452+_0x3164e4(0x118),'i')['test'](_0x3e8405);}function findEqualityPrefix(_0x13704b,_0x1d63a7){const _0x21baae=a289_0x3f4f,_0x2ac68d=new Set(_0x1d63a7[_0x21baae(0x139)](normalizeIdentifier)),_0x3f65a2=[];for(const _0x37b24e of _0x13704b){if(!_0x2ac68d[_0x21baae(0x15e)](normalizeIdentifier(_0x37b24e)))break;_0x3f65a2[_0x21baae(0x15b)](_0x37b24e);}return _0x3f65a2;}function resolveTableMetadata(_0xf74f5e,_0x4c6aef){const _0x42a752=a289_0x3f4f,_0xe4bfb8=normalizeIdentifier(_0x4c6aef),_0x2c0b0a=_0xf74f5e[_0x42a752(0x161)](_0x1b5baa=>normalizeIdentifier(_0x1b5baa[_0x42a752(0x14f)])===_0xe4bfb8);if(_0x2c0b0a[_0x42a752(0x143)]===0x1)return _0x2c0b0a[0x0];const _0x522a91=_0xe4bfb8[_0x42a752(0x12a)]('.'),_0x1b5cce=_0xe4bfb8[_0x42a752(0x11d)]('.')['at'](-0x1),_0x268c08=_0xf74f5e[_0x42a752(0x161)](_0x3c57f2=>{const _0x4af0c4=_0x42a752,_0xf98c1c=normalizeIdentifier(_0x3c57f2[_0x4af0c4(0x14f)]);if(_0x522a91&&_0xf98c1c[_0x4af0c4(0x12a)]('.'))return![];return _0xf98c1c['split']('.')['at'](-0x1)===_0x1b5cce;});return _0x268c08[_0x42a752(0x143)]===0x1?_0x268c08[0x0]:undefined;}function columnNamesMatch(_0x272b89,_0x3a57d9){return normalizeIdentifier(_0x272b89)===normalizeIdentifier(_0x3a57d9);}function normalizeIdentifier(_0x54d130){const _0x41e884=a289_0x3f4f;return _0x54d130[_0x41e884(0x155)](/[`"]/g,'')[_0x41e884(0x13c)]()[_0x41e884(0x13f)]();}function isSqlClauseKeyword(_0x379021){const _0x21e559=a289_0x3f4f;return new Set(['on',_0x21e559(0x142),_0x21e559(0x128),_0x21e559(0x120),_0x21e559(0x116),_0x21e559(0x158),'right',_0x21e559(0x12b),_0x21e559(0x152),_0x21e559(0x159)])[_0x21e559(0x15e)](_0x379021);}function a289_0x3f4f(_0x231681,_0x5264d4){_0x231681=_0x231681-0x114;const _0x466cf8=a289_0x466c();let _0x3f4faf=_0x466cf8[_0x231681];return _0x3f4faf;}function stripOuterParentheses(_0x5b379d){const _0x16f7c4=a289_0x3f4f;let _0x100bd8=_0x5b379d[_0x16f7c4(0x13c)]();while(_0x100bd8[_0x16f7c4(0x13e)]('(')&&_0x100bd8['endsWith'](')')){let _0x1a8378=0x0,_0x54a536=!![];for(let _0x47a840=0x0;_0x47a840<_0x100bd8['length'];_0x47a840+=0x1){if(_0x100bd8[_0x47a840]==='(')_0x1a8378+=0x1;if(_0x100bd8[_0x47a840]===')')_0x1a8378-=0x1;if(_0x1a8378===0x0&&_0x47a840<_0x100bd8[_0x16f7c4(0x143)]-0x1){_0x54a536=![];break;}}if(!_0x54a536||_0x1a8378!==0x0)break;_0x100bd8=_0x100bd8['slice'](0x1,-0x1)[_0x16f7c4(0x13c)]();}return _0x100bd8;}
1
+ (function(_0x46fcb8,_0x230bc2){const _0x3aed57=a289_0x1224,_0x209265=_0x46fcb8();while(!![]){try{const _0x1dd237=parseInt(_0x3aed57(0x1c7))/0x1+-parseInt(_0x3aed57(0x1b8))/0x2+parseInt(_0x3aed57(0x1e3))/0x3*(parseInt(_0x3aed57(0x1b3))/0x4)+-parseInt(_0x3aed57(0x1ef))/0x5*(parseInt(_0x3aed57(0x1ca))/0x6)+parseInt(_0x3aed57(0x1e0))/0x7+parseInt(_0x3aed57(0x1e6))/0x8*(-parseInt(_0x3aed57(0x1eb))/0x9)+parseInt(_0x3aed57(0x1b6))/0xa;if(_0x1dd237===_0x230bc2)break;else _0x209265['push'](_0x209265['shift']());}catch(_0x261639){_0x209265['push'](_0x209265['shift']());}}}(a289_0x4019,0x6afa2));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';function a289_0x1224(_0x41491d,_0x140de4){_0x41491d=_0x41491d-0x1ad;const _0x4019e6=a289_0x4019();let _0x12246e=_0x4019e6[_0x41491d];return _0x12246e;}export function auditSqlJoinIndexes(_0x3d2768,_0x216ffe){const _0x107de6=a289_0x1224,_0xab6b00=[],_0x16e2f3=normalizeSqlForStaticAnalysis(_0x3d2768),_0x442993=(_0x16e2f3['error']?[]:extractJoinFacts(_0x16e2f3['sql']))[_0x107de6(0x1c9)](_0x3b22a2=>{const _0x540afa=_0x107de6;if(_0x3b22a2['unsupportedPredicate']||_0x3b22a2[_0x540afa(0x1cf)][_0x540afa(0x1b5)]===0x0)return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1c6),'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2['columns'],'reason':_0x3b22a2['unsupportedReason']??_0x540afa(0x1af)}),{'table':_0x3b22a2['table'],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':'unavailable'};const _0x22df93=resolveTableMetadata(_0x216ffe,_0x3b22a2['table']),_0x30a130=(_0x22df93?.[_0x540afa(0x1bf)]??[])['map'](_0x4aa9ef=>({'index':_0x4aa9ef,'matchedPrefix':findEqualityPrefix(_0x4aa9ef[_0x540afa(0x1cf)],_0x3b22a2[_0x540afa(0x1cf)])}))[_0x540afa(0x1b2)](_0x9ce566=>_0x9ce566[_0x540afa(0x1e9)][_0x540afa(0x1b5)]>0x0),_0x38cac3=_0x30a130[_0x540afa(0x1b7)]((_0x11bfab,_0x4de3a7)=>!_0x11bfab||_0x4de3a7['matchedPrefix'][_0x540afa(0x1b5)]>_0x11bfab[_0x540afa(0x1e9)]['length']?_0x4de3a7:_0x11bfab,_0x30a130[0x0]);if(_0x38cac3)return{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':_0x540afa(0x1c1),'matchedIndex':{..._0x38cac3[_0x540afa(0x1d5)],'matchedPrefix':_0x38cac3[_0x540afa(0x1e9)]}};const _0xde8369=_0x22df93?.[_0x540afa(0x1bf)][_0x540afa(0x1b2)](_0x20fd11=>_0x20fd11[_0x540afa(0x1cf)]['some'](_0x53440b=>_0x3b22a2['columns'][_0x540afa(0x1ad)](_0x5953ea=>columnNamesMatch(_0x53440b,_0x5953ea))))??[];if(_0xde8369[_0x540afa(0x1b5)]>0x0)return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1b9),'table':_0x3b22a2['table'],'alias':_0x3b22a2['alias'],'columns':_0x3b22a2['columns'],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':_0x540afa(0x1ba),'candidateIndexes':_0xde8369};if(_0x22df93&&_0x22df93[_0x540afa(0x1ee)]!==![]&&_0x22df93[_0x540afa(0x1bf)][_0x540afa(0x1b5)]>0x0&&_0x3b22a2[_0x540afa(0x1cf)][_0x540afa(0x1b5)]>0x0)return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1d8),'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'reason':_0x540afa(0x1e7)}),{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':_0x540afa(0x1ba)};return _0xab6b00[_0x540afa(0x1e1)]({'code':_0x540afa(0x1dc),'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2[_0x540afa(0x1d4)],'columns':_0x3b22a2[_0x540afa(0x1cf)],'reason':_0x22df93?'The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.':'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x3b22a2[_0x540afa(0x1da)],'alias':_0x3b22a2['alias'],'columns':_0x3b22a2[_0x540afa(0x1cf)],'status':'unavailable'};});return{'checked':_0x442993['length']>0x0,'joins':_0x442993,'warnings':_0xab6b00};}function extractJoinFacts(_0x2b8cb5){const _0x10a119=a289_0x1224,_0xa2aa4e=maskNestedQueries(stripSqlNoise(_0x2b8cb5)),_0x4e32ce=maskQuotedIdentifiers(_0xa2aa4e),_0x1397b0=[],_0x481f78=new Set(),_0x3ceee3=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x51a5ae of _0xa2aa4e[_0x10a119(0x1cb)](_0x3ceee3)){const _0x530aee=_0x51a5ae['index']??0x0,_0x203743=_0x51a5ae[0x0]['search'](/\bJOIN\b/i),_0x3fa82b=_0x530aee+Math[_0x10a119(0x1ae)](0x0,_0x203743);if(!/^JOIN\b/i[_0x10a119(0x1dd)](_0x4e32ce['slice'](_0x3fa82b)))continue;_0x481f78[_0x10a119(0x1bd)](_0x3fa82b);const _0x4aadb2=normalizeIdentifier(_0x51a5ae[0x1]||_0x10a119(0x1c2)),_0x491a21=normalizeIdentifier(_0x51a5ae[0x2]??''),_0x3daf6e=normalizeIdentifier(_0x51a5ae[0x3]||_0x491a21['split']('.')['at'](-0x1)||_0x491a21),_0x229bf4=[],_0x35a367=_0x491a21==='__sq__';let _0x2c5ce7=_0x4aadb2==='right'||_0x4aadb2===_0x10a119(0x1ed)||_0x35a367,_0x946e21=_0x2c5ce7?_0x35a367?_0x10a119(0x1ce):_0x4aadb2[_0x10a119(0x1be)]()+_0x10a119(0x1b0):undefined;const _0x5cd7c1=stripOuterParentheses(_0x51a5ae[0x4]??''),_0x55be7c=_0x5cd7c1[_0x10a119(0x1e8)](MYBATIS_DYNAMIC_START_MARKER)||_0x5cd7c1[_0x10a119(0x1e8)](MYBATIS_DYNAMIC_END_MARKER),_0x561b25=_0x5cd7c1[_0x10a119(0x1e8)](MYBATIS_INCLUDE_MARKER);_0x55be7c&&(_0x2c5ce7=!![],_0x946e21??='MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.');_0x561b25&&(_0x2c5ce7=!![],_0x946e21??=_0x10a119(0x1bc));const _0x37ce9a=_0x5cd7c1[_0x10a119(0x1e4)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x10a119(0x1e4)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x10a119(0x1e4)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x37ce9a,'OR')&&(_0x2c5ce7=!![],_0x946e21??=_0x10a119(0x1e5));for(const _0x1540e8 of splitTopLevelAnd(_0x37ce9a)){const _0xc12a19=stripOuterParentheses(_0x1540e8);if(hasTopLevelKeyword(_0xc12a19,'OR')){_0x2c5ce7=!![],_0x946e21??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x196f19=splitEquality(_0xc12a19);if(!_0x196f19){containsColumnReference(_0x1540e8,_0x3daf6e)&&(_0x2c5ce7=!![]);continue;}const _0x3a8456=parseDirectColumnReference(_0x196f19[0x0],_0x3daf6e),_0xc9291a=parseDirectColumnReference(_0x196f19[0x1],_0x3daf6e),_0x20d720=containsColumnReference(_0x196f19[0x0],_0x3daf6e),_0x53c081=containsColumnReference(_0x196f19[0x1],_0x3daf6e),_0xb6896a=_0x3a8456&&!_0x53c081?_0x3a8456:_0xc9291a&&!_0x20d720?_0xc9291a:null;if(_0xb6896a&&!_0x229bf4[_0x10a119(0x1e8)](_0xb6896a))_0x229bf4[_0x10a119(0x1e1)](_0xb6896a);else!_0xb6896a&&containsColumnReference(_0x1540e8,_0x3daf6e)&&(_0x2c5ce7=!![]);}_0x1397b0[_0x10a119(0x1e1)]({'table':_0x491a21,'alias':_0x3daf6e,'columns':_0x229bf4,'unsupportedPredicate':_0x2c5ce7,'unsupportedReason':_0x946e21,'containsUnresolvedInclude':_0x561b25,'position':_0x3fa82b});}for(const _0x3b7cdb of _0x4e32ce[_0x10a119(0x1cb)](/\bJOIN\b/gi)){const _0x225019=_0x3b7cdb[_0x10a119(0x1d5)]??0x0;if(_0x481f78[_0x10a119(0x1b1)](_0x225019))continue;const _0xb264d5=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/['exec'](_0xa2aa4e[_0x10a119(0x1c4)](_0x225019+_0x3b7cdb[0x0][_0x10a119(0x1b5)])),_0x4aa919=normalizeIdentifier(_0xb264d5?.[0x1]||_0x10a119(0x1d9)),_0x4bffb3=normalizeIdentifier(_0xb264d5?.[0x2]||''),_0x47e268=isSqlClauseKeyword(_0x4bffb3)?_0x4aa919['split']('.')['at'](-0x1)||_0x4aa919:_0x4bffb3||_0x4aa919[_0x10a119(0x1bb)]('.')['at'](-0x1)||_0x4aa919;_0x1397b0[_0x10a119(0x1e1)]({'table':_0x4aa919,'alias':_0x47e268,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x225019});}const _0x51579f=_0x4e32ce['indexOf'](MYBATIS_INCLUDE_MARKER);return _0x51579f>=0x0&&!_0x1397b0[_0x10a119(0x1ad)](_0x1f38cc=>_0x1f38cc['containsUnresolvedInclude'])&&_0x1397b0[_0x10a119(0x1e1)]({'table':_0x10a119(0x1d9),'alias':_0x10a119(0x1d9),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x10a119(0x1e2),'containsUnresolvedInclude':!![],'position':_0x51579f}),_0x1397b0[_0x10a119(0x1cd)]((_0x308a80,_0x398e20)=>_0x308a80['position']-_0x398e20['position']);}function stripSqlNoise(_0x22ec28){const _0x1cc5b9=a289_0x1224,_0xba46a8=Array[_0x1cc5b9(0x1db)](_0x22ec28),_0x5b6a83=(_0x228756,_0x15b7fc)=>{for(let _0x2838e0=_0x228756;_0x2838e0<_0x15b7fc;_0x2838e0+=0x1){_0xba46a8[_0x2838e0]!=='\x0a'&&_0xba46a8[_0x2838e0]!=='\x0d'&&(_0xba46a8[_0x2838e0]='\x20');}};for(let _0x26e1f0=0x0;_0x26e1f0<_0xba46a8['length'];_0x26e1f0+=0x1){const _0x574681=_0xba46a8[_0x26e1f0],_0x54f89c=_0xba46a8[_0x26e1f0+0x1];if(_0x574681==='\x27'||_0x574681==='\x22'||_0x574681==='`'){const _0x17ca60=_0x574681,_0x4eac0f=_0x26e1f0;_0x26e1f0+=0x1;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]){if(_0xba46a8[_0x26e1f0]==='\x5c'&&_0x26e1f0+0x1<_0xba46a8[_0x1cc5b9(0x1b5)]){_0x26e1f0+=0x2;continue;}if(_0xba46a8[_0x26e1f0]!==_0x17ca60){_0x26e1f0+=0x1;continue;}if(_0xba46a8[_0x26e1f0+0x1]===_0x17ca60){_0x26e1f0+=0x2;continue;}break;}if(_0x17ca60==='\x27')_0x5b6a83(_0x4eac0f,Math[_0x1cc5b9(0x1de)](_0x26e1f0+0x1,_0xba46a8[_0x1cc5b9(0x1b5)]));continue;}if(_0x574681==='-'&&_0x54f89c==='-'){const _0x1bde36=_0x26e1f0;while(_0x26e1f0<_0xba46a8['length']&&_0xba46a8[_0x26e1f0]!=='\x0a')_0x26e1f0+=0x1;_0x5b6a83(_0x1bde36,_0x26e1f0);continue;}if(_0x574681==='/'&&_0x54f89c==='*'){const _0x254f2a=_0x26e1f0;_0x26e1f0+=0x2;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]&&!(_0xba46a8[_0x26e1f0]==='*'&&_0xba46a8[_0x26e1f0+0x1]==='/')){_0x26e1f0+=0x1;}_0x26e1f0=Math[_0x1cc5b9(0x1de)](_0x26e1f0+0x1,_0xba46a8[_0x1cc5b9(0x1b5)]-0x1),_0x5b6a83(_0x254f2a,_0x26e1f0+0x1);continue;}if(_0x574681==='#'&&_0x54f89c!=='{'){const _0x20a04d=_0x26e1f0;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]&&_0xba46a8[_0x26e1f0]!=='\x0a')_0x26e1f0+=0x1;_0x5b6a83(_0x20a04d,_0x26e1f0);continue;}if((_0x574681==='#'||_0x574681==='$')&&_0x54f89c==='{'){const _0x4f3ffe=_0x26e1f0;_0x26e1f0+=0x2;while(_0x26e1f0<_0xba46a8[_0x1cc5b9(0x1b5)]&&_0xba46a8[_0x26e1f0]!=='}')_0x26e1f0+=0x1;_0x5b6a83(_0x4f3ffe,Math['min'](_0x26e1f0+0x1,_0xba46a8['length']));}}return _0xba46a8[_0x1cc5b9(0x1ec)]('');}function maskQuotedIdentifiers(_0x4c0851){const _0x4fdd1f=a289_0x1224,_0x3aea56=Array[_0x4fdd1f(0x1db)](_0x4c0851);for(let _0x2f657f=0x0;_0x2f657f<_0x3aea56['length'];_0x2f657f+=0x1){const _0x2f3947=_0x3aea56[_0x2f657f];if(_0x2f3947!=='\x22'&&_0x2f3947!=='`')continue;_0x2f657f+=0x1;while(_0x2f657f<_0x3aea56[_0x4fdd1f(0x1b5)]){if(_0x3aea56[_0x2f657f]===_0x2f3947){if(_0x3aea56[_0x2f657f+0x1]===_0x2f3947){_0x3aea56[_0x2f657f]='\x20',_0x3aea56[_0x2f657f+0x1]='\x20',_0x2f657f+=0x2;continue;}break;}_0x3aea56[_0x2f657f]='\x20',_0x2f657f+=0x1;}}return _0x3aea56[_0x4fdd1f(0x1ec)]('');}function a289_0x4019(){const _0x5e2b1d=['JOIN_PREDICATE_UNSUPPORTED','586332jaCxqG','right','map','65742FmvsYI','matchAll','natural','sort','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','columns','trim','where','replace','__sq__','alias','index','\x5c$&','\x5cs*\x5c.\x5cs*[\x5cw$]+','JOIN_INDEX_MISSING','unknown','table','from','INDEX_METADATA_UNAVAILABLE','test','min','(?:^|[^\x5cw$])','4037278HOznEc','push','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','30nwEcLg','replaceAll','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','406576vZJRRy','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','includes','matchedPrefix','endsWith','144gaupOo','join','full','metadataAvailable','245uvcOFh','tableName','some','max','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','has','filter','33828HFgbDT','exec','length','5604860WTdpQB','reduce','39838lrarFz','JOIN_INDEX_NOT_USABLE','warning','split','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','add','toUpperCase','indexes','startsWith','covered','INNER','using','slice','inner'];a289_0x4019=function(){return _0x5e2b1d;};return a289_0x4019();}function maskNestedQueries(_0x2016e2){const _0x4c9e7c=a289_0x1224,_0x3f6af0=Array[_0x4c9e7c(0x1db)](_0x2016e2);for(let _0xfae532=0x0;_0xfae532<_0x3f6af0[_0x4c9e7c(0x1b5)];_0xfae532+=0x1){if(_0x3f6af0[_0xfae532]!=='(')continue;const _0x51e405=_0x2016e2['slice'](_0xfae532+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x4c9e7c(0x1dd)](_0x51e405))continue;let _0x28c30d=0x1,_0x2d8e7c=_0xfae532+0x1;for(;_0x2d8e7c<_0x3f6af0[_0x4c9e7c(0x1b5)]&&_0x28c30d>0x0;_0x2d8e7c+=0x1){if(_0x3f6af0[_0x2d8e7c]==='(')_0x28c30d+=0x1;if(_0x3f6af0[_0x2d8e7c]===')')_0x28c30d-=0x1;}if(_0x28c30d!==0x0)continue;for(let _0x40b25e=_0xfae532;_0x40b25e<_0x2d8e7c;_0x40b25e+=0x1){_0x3f6af0[_0x40b25e]='\x20';}const _0x3332a=_0x4c9e7c(0x1d3);for(let _0x91a75d=0x0;_0x91a75d<_0x3332a[_0x4c9e7c(0x1b5)]&&_0xfae532+_0x91a75d<_0x2d8e7c;_0x91a75d+=0x1){_0x3f6af0[_0xfae532+_0x91a75d]=_0x3332a[_0x91a75d];}_0xfae532=_0x2d8e7c-0x1;}return _0x3f6af0[_0x4c9e7c(0x1ec)]('');}function splitTopLevelAnd(_0x551dda){const _0x321ece=a289_0x1224,_0x329010=[];let _0x15ca71=0x0,_0x19fdcc=0x0;for(let _0x2da8ce=0x0;_0x2da8ce<_0x551dda[_0x321ece(0x1b5)];_0x2da8ce+=0x1){const _0x257df1=_0x551dda[_0x2da8ce];if(_0x257df1==='(')_0x15ca71+=0x1;if(_0x257df1===')')_0x15ca71=Math[_0x321ece(0x1ae)](0x0,_0x15ca71-0x1);_0x15ca71===0x0&&_0x551dda['slice'](_0x2da8ce)['match'](/^AND\b/i)&&(_0x2da8ce===0x0||/\s/[_0x321ece(0x1dd)](_0x551dda[_0x2da8ce-0x1]??''))&&(_0x329010[_0x321ece(0x1e1)](_0x551dda[_0x321ece(0x1c4)](_0x19fdcc,_0x2da8ce)[_0x321ece(0x1d0)]()),_0x2da8ce+=0x2,_0x19fdcc=_0x2da8ce+0x1);}const _0x2ef198=_0x551dda['slice'](_0x19fdcc)[_0x321ece(0x1d0)]();if(_0x2ef198)_0x329010[_0x321ece(0x1e1)](_0x2ef198);return _0x329010;}function hasTopLevelKeyword(_0x3e9749,_0x5b0ee8){const _0x6a51b9=a289_0x1224;let _0x241c9f=0x0;for(let _0x11cea9=0x0;_0x11cea9<_0x3e9749[_0x6a51b9(0x1b5)];_0x11cea9+=0x1){const _0x15a27b=_0x3e9749[_0x11cea9];if(_0x15a27b==='(')_0x241c9f+=0x1;if(_0x15a27b===')')_0x241c9f=Math['max'](0x0,_0x241c9f-0x1);if(_0x241c9f!==0x0)continue;const _0x1d554a=_0x3e9749[_0x6a51b9(0x1c4)](_0x11cea9,_0x11cea9+_0x5b0ee8[_0x6a51b9(0x1b5)]),_0x47ca4c=_0x3e9749[_0x11cea9-0x1]??'\x20',_0x3d797d=_0x3e9749[_0x11cea9+_0x5b0ee8[_0x6a51b9(0x1b5)]]??'\x20';if(_0x1d554a[_0x6a51b9(0x1be)]()===_0x5b0ee8[_0x6a51b9(0x1be)]()&&!/[\w$]/[_0x6a51b9(0x1dd)](_0x47ca4c)&&!/[\w$]/[_0x6a51b9(0x1dd)](_0x3d797d))return!![];}return![];}function splitEquality(_0x49436e){const _0x581ba5=a289_0x1224,_0x1b11a7=stripOuterParentheses(_0x49436e);let _0x4bcdd7=0x0,_0xab06a5;for(let _0x351863=0x0;_0x351863<_0x1b11a7['length'];_0x351863+=0x1){const _0x2922fb=_0x1b11a7[_0x351863];if(_0x2922fb==='(')_0x4bcdd7+=0x1;if(_0x2922fb===')')_0x4bcdd7=Math[_0x581ba5(0x1ae)](0x0,_0x4bcdd7-0x1);const _0x33f9de=_0x1b11a7[_0x351863-0x1]??'',_0x55b77f=_0x1b11a7[_0x351863+0x1]??'';if(_0x2922fb==='='&&_0x4bcdd7===0x0&&!/[!<>=:]/[_0x581ba5(0x1dd)](_0x33f9de)&&_0x55b77f!=='='){if(_0xab06a5!==undefined)return null;_0xab06a5=_0x351863;}}return _0xab06a5===undefined?null:[_0x1b11a7['slice'](0x0,_0xab06a5)[_0x581ba5(0x1d0)](),_0x1b11a7[_0x581ba5(0x1c4)](_0xab06a5+0x1)[_0x581ba5(0x1d0)]()];}function parseDirectColumnReference(_0x7f1fed,_0x18d5cf){const _0x34e957=a289_0x1224,_0x2337bd=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x34e957(0x1b4)](stripOuterParentheses(_0x7f1fed));if(!_0x2337bd)return null;if(normalizeIdentifier(_0x2337bd[0x1]??'')!==normalizeIdentifier(_0x18d5cf))return null;return normalizeIdentifier(_0x2337bd[0x2]??'');}function containsColumnReference(_0x3df61a,_0x3ce97e){const _0x55b60d=a289_0x1224,_0x1647c6=_0x3df61a[_0x55b60d(0x1d2)](/[`"]/g,''),_0x2f5308=_0x3ce97e[_0x55b60d(0x1d2)](/[.*+?^${}()|[\]\\]/g,_0x55b60d(0x1d6));return new RegExp(_0x55b60d(0x1df)+_0x2f5308+_0x55b60d(0x1d7),'i')['test'](_0x1647c6);}function findEqualityPrefix(_0xb32f61,_0x5116a4){const _0x3e12be=a289_0x1224,_0x34cee1=new Set(_0x5116a4[_0x3e12be(0x1c9)](normalizeIdentifier)),_0x35a1f2=[];for(const _0x34e878 of _0xb32f61){if(!_0x34cee1[_0x3e12be(0x1b1)](normalizeIdentifier(_0x34e878)))break;_0x35a1f2[_0x3e12be(0x1e1)](_0x34e878);}return _0x35a1f2;}function resolveTableMetadata(_0x5c28b2,_0x14170c){const _0x320053=a289_0x1224,_0x4f8000=normalizeIdentifier(_0x14170c),_0x37d764=_0x5c28b2['filter'](_0x236b0a=>normalizeIdentifier(_0x236b0a[_0x320053(0x1f0)])===_0x4f8000);if(_0x37d764['length']===0x1)return _0x37d764[0x0];const _0x35af31=_0x4f8000[_0x320053(0x1e8)]('.'),_0x317d13=_0x4f8000[_0x320053(0x1bb)]('.')['at'](-0x1),_0x4fa522=_0x5c28b2[_0x320053(0x1b2)](_0xda687d=>{const _0x15bf25=_0x320053,_0xc20828=normalizeIdentifier(_0xda687d[_0x15bf25(0x1f0)]);if(_0x35af31&&_0xc20828[_0x15bf25(0x1e8)]('.'))return![];return _0xc20828[_0x15bf25(0x1bb)]('.')['at'](-0x1)===_0x317d13;});return _0x4fa522[_0x320053(0x1b5)]===0x1?_0x4fa522[0x0]:undefined;}function columnNamesMatch(_0xd91390,_0x5a8a52){return normalizeIdentifier(_0xd91390)===normalizeIdentifier(_0x5a8a52);}function normalizeIdentifier(_0x5eaa9a){const _0x329742=a289_0x1224;return _0x5eaa9a[_0x329742(0x1d2)](/[`"]/g,'')['trim']()['toLowerCase']();}function isSqlClauseKeyword(_0x5e701a){const _0x15d035=a289_0x1224;return new Set(['on',_0x15d035(0x1c3),_0x15d035(0x1d1),_0x15d035(0x1ec),_0x15d035(0x1c5),'left',_0x15d035(0x1c8),'full','cross',_0x15d035(0x1cc)])[_0x15d035(0x1b1)](_0x5e701a);}function stripOuterParentheses(_0x47b4de){const _0x4ad0e8=a289_0x1224;let _0xc4c7c7=_0x47b4de[_0x4ad0e8(0x1d0)]();while(_0xc4c7c7[_0x4ad0e8(0x1c0)]('(')&&_0xc4c7c7[_0x4ad0e8(0x1ea)](')')){let _0x4f4caa=0x0,_0x22f95d=!![];for(let _0x28a57f=0x0;_0x28a57f<_0xc4c7c7[_0x4ad0e8(0x1b5)];_0x28a57f+=0x1){if(_0xc4c7c7[_0x28a57f]==='(')_0x4f4caa+=0x1;if(_0xc4c7c7[_0x28a57f]===')')_0x4f4caa-=0x1;if(_0x4f4caa===0x0&&_0x28a57f<_0xc4c7c7[_0x4ad0e8(0x1b5)]-0x1){_0x22f95d=![];break;}}if(!_0x22f95d||_0x4f4caa!==0x0)break;_0xc4c7c7=_0xc4c7c7[_0x4ad0e8(0x1c4)](0x1,-0x1)[_0x4ad0e8(0x1d0)]();}return _0xc4c7c7;}
@@ -1 +1 @@
1
- const a290_0x58bee4=a290_0x56cc;(function(_0x33d69d,_0x8442c4){const _0x1285a9=a290_0x56cc,_0x5321fa=_0x33d69d();while(!![]){try{const _0x4da9e0=-parseInt(_0x1285a9(0x154))/0x1*(-parseInt(_0x1285a9(0x157))/0x2)+-parseInt(_0x1285a9(0x152))/0x3+parseInt(_0x1285a9(0x155))/0x4+-parseInt(_0x1285a9(0x15c))/0x5*(parseInt(_0x1285a9(0x15d))/0x6)+-parseInt(_0x1285a9(0x158))/0x7+parseInt(_0x1285a9(0x153))/0x8+parseInt(_0x1285a9(0x159))/0x9*(parseInt(_0x1285a9(0x15a))/0xa);if(_0x4da9e0===_0x8442c4)break;else _0x5321fa['push'](_0x5321fa['shift']());}catch(_0x44821c){_0x5321fa['push'](_0x5321fa['shift']());}}}(a290_0x5103,0xb4591));function a290_0x56cc(_0x5bbf8d,_0x3b7be9){_0x5bbf8d=_0x5bbf8d-0x152;const _0x5103e6=a290_0x5103();let _0x56ccf7=_0x5103e6[_0x5bbf8d];return _0x56ccf7;}import{resolve}from'node:path';function a290_0x5103(){const _0x22c15f=['9222448YDLLHB','1AzaPou','4408196rVPflq','/sql','2344358EPqsTP','6787543wSnbhg','36396bcsRwa','1910KGPXiR','sql-trash','5gvRNYf','8736738yoOebu','3104883IepWBF'];a290_0x5103=function(){return _0x22c15f;};return a290_0x5103();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME=a290_0x58bee4(0x15b);export function loadSqlProjectConfig(_0x4225e9,_0xbdb3ba){const _0x40e33a=a290_0x58bee4,_0x58da43=resolve(_0xbdb3ba??findProjectRootDirectory()),_0x183dd1=DOT_DIR+_0x40e33a(0x156),_0xb9586=_0x183dd1+'/'+_0x4225e9;return{'projectRoot':_0x58da43,'appCode':_0x4225e9,'sqlWorkspaceRoot':_0x183dd1,'sqlRoot':_0xb9586,'sqlRootDir':resolve(_0x58da43,DOT_DIR,'sql',_0x4225e9),'lockFilePath':resolve(_0x58da43,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x58da43,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a290_0x26903c=a290_0x26aa;(function(_0x2500ae,_0x2aa926){const _0x451fa1=a290_0x26aa,_0x15f09b=_0x2500ae();while(!![]){try{const _0x3093fb=parseInt(_0x451fa1(0x1b0))/0x1*(parseInt(_0x451fa1(0x1b8))/0x2)+parseInt(_0x451fa1(0x1ae))/0x3*(-parseInt(_0x451fa1(0x1b7))/0x4)+parseInt(_0x451fa1(0x1b1))/0x5*(parseInt(_0x451fa1(0x1af))/0x6)+-parseInt(_0x451fa1(0x1ad))/0x7*(-parseInt(_0x451fa1(0x1b9))/0x8)+-parseInt(_0x451fa1(0x1b4))/0x9*(-parseInt(_0x451fa1(0x1b5))/0xa)+parseInt(_0x451fa1(0x1b2))/0xb+-parseInt(_0x451fa1(0x1ac))/0xc;if(_0x3093fb===_0x2aa926)break;else _0x15f09b['push'](_0x15f09b['shift']());}catch(_0x4cb017){_0x15f09b['push'](_0x15f09b['shift']());}}}(a290_0x267e,0xa6713));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a290_0x26903c(0x1b6),TRASH_DIR_NAME='sql-trash';function a290_0x26aa(_0x421880,_0x3c28b3){_0x421880=_0x421880-0x1ac;const _0x267ec4=a290_0x267e();let _0x26aa23=_0x267ec4[_0x421880];return _0x26aa23;}function a290_0x267e(){const _0x2f05b8=['sql.lock.json','6516mlhLRf','6wSaKEz','21136XSlEnJ','21973104WLBFHa','3577PFiWrc','2109QqDcDr','155646HTKgOs','86725mKpIqS','25VJyINm','6539687YPXOHf','sql','81rmcggi','1470630utgBpb'];a290_0x267e=function(){return _0x2f05b8;};return a290_0x267e();}export function loadSqlProjectConfig(_0x34a91b,_0x1328fe){const _0x579cb7=a290_0x26903c,_0x41b32b=resolve(_0x1328fe??findProjectRootDirectory()),_0x1ce9ee=DOT_DIR+'/sql',_0x1eae08=_0x1ce9ee+'/'+_0x34a91b;return{'projectRoot':_0x41b32b,'appCode':_0x34a91b,'sqlWorkspaceRoot':_0x1ce9ee,'sqlRoot':_0x1eae08,'sqlRootDir':resolve(_0x41b32b,DOT_DIR,_0x579cb7(0x1b3),_0x34a91b),'lockFilePath':resolve(_0x41b32b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x41b32b,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x4e76e4,_0x206b98){const _0x25ed4f=a291_0x36b4,_0x1dceff=_0x4e76e4();while(!![]){try{const _0x264cdf=-parseInt(_0x25ed4f(0xaa))/0x1*(parseInt(_0x25ed4f(0x8f))/0x2)+-parseInt(_0x25ed4f(0xa8))/0x3+parseInt(_0x25ed4f(0xa2))/0x4*(parseInt(_0x25ed4f(0x9c))/0x5)+-parseInt(_0x25ed4f(0xa3))/0x6*(-parseInt(_0x25ed4f(0xad))/0x7)+parseInt(_0x25ed4f(0x97))/0x8*(parseInt(_0x25ed4f(0x98))/0x9)+parseInt(_0x25ed4f(0xa5))/0xa*(parseInt(_0x25ed4f(0xae))/0xb)+parseInt(_0x25ed4f(0xab))/0xc*(parseInt(_0x25ed4f(0xb0))/0xd);if(_0x264cdf===_0x206b98)break;else _0x1dceff['push'](_0x1dceff['shift']());}catch(_0x19ba47){_0x1dceff['push'](_0x1dceff['shift']());}}}(a291_0x375f,0x3ccdb));import{readdir,stat}from'node:fs/promises';function a291_0x36b4(_0x2132cb,_0x52e55a){_0x2132cb=_0x2132cb-0x8f;const _0x375f88=a291_0x375f();let _0x36b4c8=_0x375f88[_0x2132cb];return _0x36b4c8;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x52e772){const _0x26586d=a291_0x36b4;if(_0x52e772===_0x26586d(0x99))return _0x26586d(0x9f);if(_0x52e772===_0x26586d(0xac))return _0x26586d(0x93);return undefined;}async function scanSqlFilesRecursively(_0x2a9f54,_0x723fb0){const _0x5ec383=a291_0x36b4,_0x9816b=[];try{const _0x2a2d83=await readdir(_0x2a9f54,{'withFileTypes':!![]});for(const _0x3b261c of _0x2a2d83){const _0x521626=join(_0x2a9f54,_0x3b261c[_0x5ec383(0x90)]);if(_0x3b261c['isDirectory']()){_0x9816b['push'](...await scanSqlFilesRecursively(_0x521626,_0x723fb0));continue;}if(!_0x3b261c[_0x5ec383(0xa1)]())continue;const _0x26d1a8=extname(_0x3b261c[_0x5ec383(0x90)])[_0x5ec383(0xaf)](),_0x3d010d=extensionToMode(_0x26d1a8);if(!_0x3d010d)continue;const _0x3bb764=relative(_0x723fb0,_0x521626)[_0x5ec383(0xa9)](/\\/g,'/'),_0x51ec13=_0x3bb764[_0x5ec383(0x9a)]('/')[_0x5ec383(0x92)](Boolean),_0x25cc2f=parseSqlPath(_0x51ec13,_0x3b261c[_0x5ec383(0x90)],_0x26d1a8);if(!_0x25cc2f)continue;_0x9816b[_0x5ec383(0x9b)]({'sqlCode':_0x25cc2f['sqlCode'],'sqlName':_0x25cc2f[_0x5ec383(0xa0)],'dbDirectory':_0x51ec13[0x0],'filePath':_0x521626,'relativePath':_0x3bb764,'lockKey':_0x25cc2f[_0x5ec383(0x9d)],'mode':_0x3d010d});}}catch(_0x5ac3e4){if(_0x5ac3e4[_0x5ec383(0x94)]!=='ENOENT')throw _0x5ac3e4;}return _0x9816b;}export async function scanLocalSqlQueries(_0x245688){const _0x2bd818=a291_0x36b4;return scanSqlFilesRecursively(_0x245688[_0x2bd818(0x91)],_0x245688['sqlRootDir']);}function a291_0x375f(){const _0x3c42a9=['15kSljKY','sqlCode','mode','sql','sqlName','isFile','44772evWXtU','2095278ppzxbL','length','2630qYdmUE','dbName','test','1058946PMAJoa','replace','179206KCwhCD','652332cnEwKV','.xml','7BDlUta','6941OQLzra','toLowerCase','26zGfhGB','4WnmCmX','name','sqlRootDir','filter','mybatisXml','code','slice','dbId','56368ZQxnmn','387qIPDjs','.sql','split','push'];a291_0x375f=function(){return _0x3c42a9;};return a291_0x375f();}export function resolveLocalSqlFilePath(_0x95efd1,_0x25f994,_0x257c15){const _0x5a9e45=a291_0x36b4,_0x13a14d=_0x257c15?.['path']||(_0x257c15?.[_0x5a9e45(0xa0)]||_0x257c15?.[_0x5a9e45(0xa6)]?buildSqlRelativePath(_0x25f994,_0x257c15?.[_0x5a9e45(0xa0)],_0x257c15?.[_0x5a9e45(0xa6)],_0x257c15?.[_0x5a9e45(0x9e)]||_0x5a9e45(0x9f),_0x257c15?.[_0x5a9e45(0x96)]):buildDefaultSqlFileName(_0x25f994,_0x257c15?.['mode']||'sql'));return join(_0x95efd1['sqlRootDir'],_0x13a14d);}export async function directoryExists(_0x3554be){try{const _0x464fe1=await stat(_0x3554be);return _0x464fe1['isDirectory']();}catch{return![];}}function parseSqlPath(_0x451f6b,_0x3603b8,_0x479c09){const _0x79238b=a291_0x36b4,_0x2d9461=_0x3603b8[_0x79238b(0x95)](0x0,-_0x479c09['length']);if(_0x451f6b['length']<0x2)return null;const _0xdedfbe=_0x2d9461['indexOf']('_');if(_0xdedfbe<=0x0||_0xdedfbe>=_0x2d9461[_0x79238b(0xa4)]-0x1)return null;const _0xea2bae=_0x2d9461[_0x79238b(0x95)](0x0,_0xdedfbe);if(!isLikelySqlCode(_0xea2bae))return null;return{'sqlCode':_0xea2bae,'sqlName':_0x2d9461['slice'](_0xdedfbe+0x1)};}function isLikelySqlCode(_0x157e29){const _0x2de480=a291_0x36b4;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2de480(0xa7)](_0x157e29);}
1
+ function a291_0x4379(){const _0x4dbf15=['dbName','filter','sqlRootDir','length','8wuBkiy','sql','path','isFile','isDirectory','split','sqlCode','ENOENT','dbId','101819aAXcgr','code','toLowerCase','sqlName','1470kFWgyZ','310TvgoII','309884RZiAXf','.xml','name','slice','mybatisXml','push','.sql','1075708lkPzxd','2743974DffzSU','263976MOBAYM','76034TPjuas','replace'];a291_0x4379=function(){return _0x4dbf15;};return a291_0x4379();}(function(_0x5cd627,_0x624fdc){const _0x3e374a=a291_0x5d87,_0x56e535=_0x5cd627();while(!![]){try{const _0x56cc6c=-parseInt(_0x3e374a(0x18a))/0x1+parseInt(_0x3e374a(0x190))/0x2+parseInt(_0x3e374a(0x17a))/0x3+-parseInt(_0x3e374a(0x197))/0x4+-parseInt(_0x3e374a(0x18f))/0x5*(parseInt(_0x3e374a(0x18e))/0x6)+-parseInt(_0x3e374a(0x17b))/0x7*(parseInt(_0x3e374a(0x181))/0x8)+parseInt(_0x3e374a(0x198))/0x9;if(_0x56cc6c===_0x624fdc)break;else _0x56e535['push'](_0x56e535['shift']());}catch(_0x2f2e3f){_0x56e535['push'](_0x56e535['shift']());}}}(a291_0x4379,0x24dee));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x165be5){const _0x5e4b39=a291_0x5d87;if(_0x165be5===_0x5e4b39(0x196))return _0x5e4b39(0x182);if(_0x165be5===_0x5e4b39(0x191))return _0x5e4b39(0x194);return undefined;}async function scanSqlFilesRecursively(_0x124f25,_0x5053be){const _0x2174d7=a291_0x5d87,_0x509b4e=[];try{const _0x58591e=await readdir(_0x124f25,{'withFileTypes':!![]});for(const _0x430465 of _0x58591e){const _0x25b8c9=join(_0x124f25,_0x430465[_0x2174d7(0x192)]);if(_0x430465[_0x2174d7(0x185)]()){_0x509b4e[_0x2174d7(0x195)](...await scanSqlFilesRecursively(_0x25b8c9,_0x5053be));continue;}if(!_0x430465[_0x2174d7(0x184)]())continue;const _0x2b8d4e=extname(_0x430465['name'])[_0x2174d7(0x18c)](),_0x569510=extensionToMode(_0x2b8d4e);if(!_0x569510)continue;const _0x369a4a=relative(_0x5053be,_0x25b8c9)[_0x2174d7(0x17c)](/\\/g,'/'),_0x2440dd=_0x369a4a[_0x2174d7(0x186)]('/')[_0x2174d7(0x17e)](Boolean),_0x28560c=parseSqlPath(_0x2440dd,_0x430465[_0x2174d7(0x192)],_0x2b8d4e);if(!_0x28560c)continue;_0x509b4e[_0x2174d7(0x195)]({'sqlCode':_0x28560c[_0x2174d7(0x187)],'sqlName':_0x28560c[_0x2174d7(0x18d)],'dbDirectory':_0x2440dd[0x0],'filePath':_0x25b8c9,'relativePath':_0x369a4a,'lockKey':_0x28560c['sqlCode'],'mode':_0x569510});}}catch(_0x2badd8){if(_0x2badd8[_0x2174d7(0x18b)]!==_0x2174d7(0x188))throw _0x2badd8;}return _0x509b4e;}function a291_0x5d87(_0x58b745,_0x25e330){_0x58b745=_0x58b745-0x17a;const _0x437906=a291_0x4379();let _0x5d8725=_0x437906[_0x58b745];return _0x5d8725;}export async function scanLocalSqlQueries(_0x202f3f){const _0x3cdc33=a291_0x5d87;return scanSqlFilesRecursively(_0x202f3f[_0x3cdc33(0x17f)],_0x202f3f[_0x3cdc33(0x17f)]);}export function resolveLocalSqlFilePath(_0x5b0e36,_0x273230,_0x2a81d4){const _0x2bb249=a291_0x5d87,_0x50a695=_0x2a81d4?.[_0x2bb249(0x183)]||(_0x2a81d4?.['sqlName']||_0x2a81d4?.[_0x2bb249(0x17d)]?buildSqlRelativePath(_0x273230,_0x2a81d4?.[_0x2bb249(0x18d)],_0x2a81d4?.[_0x2bb249(0x17d)],_0x2a81d4?.['mode']||_0x2bb249(0x182),_0x2a81d4?.[_0x2bb249(0x189)]):buildDefaultSqlFileName(_0x273230,_0x2a81d4?.['mode']||_0x2bb249(0x182)));return join(_0x5b0e36['sqlRootDir'],_0x50a695);}export async function directoryExists(_0x46789e){const _0xb2a149=a291_0x5d87;try{const _0x5ac072=await stat(_0x46789e);return _0x5ac072[_0xb2a149(0x185)]();}catch{return![];}}function parseSqlPath(_0xfa348c,_0x1e8429,_0x4b2393){const _0x234189=a291_0x5d87,_0x5a8deb=_0x1e8429[_0x234189(0x193)](0x0,-_0x4b2393[_0x234189(0x180)]);if(_0xfa348c['length']<0x2)return null;const _0x27e1e8=_0x5a8deb['indexOf']('_');if(_0x27e1e8<=0x0||_0x27e1e8>=_0x5a8deb[_0x234189(0x180)]-0x1)return null;const _0x568cf3=_0x5a8deb[_0x234189(0x193)](0x0,_0x27e1e8);if(!isLikelySqlCode(_0x568cf3))return null;return{'sqlCode':_0x568cf3,'sqlName':_0x5a8deb[_0x234189(0x193)](_0x27e1e8+0x1)};}function isLikelySqlCode(_0x14bd0e){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x14bd0e);}
@@ -1 +1 @@
1
- (function(_0x59cad6,_0xe05ddf){const _0xd19838=a292_0x2b37,_0x21161e=_0x59cad6();while(!![]){try{const _0xa87dc3=-parseInt(_0xd19838(0xbc))/0x1+parseInt(_0xd19838(0xc5))/0x2*(-parseInt(_0xd19838(0xc4))/0x3)+parseInt(_0xd19838(0xc3))/0x4*(parseInt(_0xd19838(0xc1))/0x5)+parseInt(_0xd19838(0xbf))/0x6*(-parseInt(_0xd19838(0xc7))/0x7)+parseInt(_0xd19838(0xc2))/0x8*(parseInt(_0xd19838(0xca))/0x9)+parseInt(_0xd19838(0xbb))/0xa+-parseInt(_0xd19838(0xc6))/0xb*(-parseInt(_0xd19838(0xbe))/0xc);if(_0xa87dc3===_0xe05ddf)break;else _0x21161e['push'](_0x21161e['shift']());}catch(_0x2b3caa){_0x21161e['push'](_0x21161e['shift']());}}}(a292_0x1cf5,0x6c350));function a292_0x1cf5(){const _0x164dfa=['md5','4199139SQRzGS','3171440EdPYmT','534428wyaItC','createHash','7498128YsDEIl','218628giTWFa','update','33795lyOrWx','8VxHHoX','48DzTTMS','7077HEZFjb','346TbdWqb','22mLqpQE','140ZgFGbt','hex'];a292_0x1cf5=function(){return _0x164dfa;};return a292_0x1cf5();}function a292_0x2b37(_0x4b05e1,_0x34e323){_0x4b05e1=_0x4b05e1-0xbb;const _0x1cf59a=a292_0x1cf5();let _0x2b37a8=_0x1cf59a[_0x4b05e1];return _0x2b37a8;}import{readFile}from'node:fs/promises';import a292_0x57d021 from'node:crypto';export function computeSqlContentHash(_0xc316c2){const _0xba0f50=a292_0x2b37;return a292_0x57d021[_0xba0f50(0xbd)](_0xba0f50(0xc9))[_0xba0f50(0xc0)](_0xc316c2)['digest'](_0xba0f50(0xc8));}export async function computeSqlFileHash(_0x155c3d){const _0x58c95b=await readFile(_0x155c3d,'utf8');return computeSqlContentHash(_0x58c95b);}
1
+ (function(_0x274d3d,_0x22ce4a){const _0x2f3f2b=a292_0x4e9a,_0xb4c52b=_0x274d3d();while(!![]){try{const _0x30e10e=-parseInt(_0x2f3f2b(0x1c5))/0x1*(-parseInt(_0x2f3f2b(0x1cd))/0x2)+parseInt(_0x2f3f2b(0x1cf))/0x3+parseInt(_0x2f3f2b(0x1c3))/0x4+-parseInt(_0x2f3f2b(0x1cc))/0x5*(-parseInt(_0x2f3f2b(0x1ca))/0x6)+-parseInt(_0x2f3f2b(0x1c9))/0x7*(-parseInt(_0x2f3f2b(0x1d0))/0x8)+-parseInt(_0x2f3f2b(0x1c8))/0x9*(parseInt(_0x2f3f2b(0x1c6))/0xa)+-parseInt(_0x2f3f2b(0x1d2))/0xb*(parseInt(_0x2f3f2b(0x1d1))/0xc);if(_0x30e10e===_0x22ce4a)break;else _0xb4c52b['push'](_0xb4c52b['shift']());}catch(_0x4fb1f6){_0xb4c52b['push'](_0xb4c52b['shift']());}}}(a292_0x3c94,0x4d7cc));function a292_0x3c94(){const _0x506a9c=['2916640pattCj','md5','9rPiZXh','1407uMtKtq','6MXgrjr','utf8','2742665hwVpUF','2pdJLAw','update','428160jZlACc','16664qicKgj','36oTOhQF','3407866TavQmv','42124RkHAou','digest','418003areonH'];a292_0x3c94=function(){return _0x506a9c;};return a292_0x3c94();}function a292_0x4e9a(_0x33842c,_0x269623){_0x33842c=_0x33842c-0x1c3;const _0x3c94e3=a292_0x3c94();let _0x4e9ac8=_0x3c94e3[_0x33842c];return _0x4e9ac8;}import{readFile}from'node:fs/promises';import a292_0x4bf968 from'node:crypto';export function computeSqlContentHash(_0x259ae9){const _0x10ef10=a292_0x4e9a;return a292_0x4bf968['createHash'](_0x10ef10(0x1c7))[_0x10ef10(0x1ce)](_0x259ae9)[_0x10ef10(0x1c4)]('hex');}export async function computeSqlFileHash(_0x56383a){const _0x1a5be1=a292_0x4e9a,_0x7fafe2=await readFile(_0x56383a,_0x1a5be1(0x1cb));return computeSqlContentHash(_0x7fafe2);}
@@ -1 +1 @@
1
- (function(_0x27802d,_0x5ee995){const _0x1d8cfa=a293_0x4419,_0x2d45a9=_0x27802d();while(!![]){try{const _0x14c1fb=parseInt(_0x1d8cfa(0x153))/0x1*(-parseInt(_0x1d8cfa(0x148))/0x2)+parseInt(_0x1d8cfa(0x158))/0x3+-parseInt(_0x1d8cfa(0x150))/0x4+parseInt(_0x1d8cfa(0x14a))/0x5*(-parseInt(_0x1d8cfa(0x145))/0x6)+parseInt(_0x1d8cfa(0x146))/0x7*(parseInt(_0x1d8cfa(0x152))/0x8)+-parseInt(_0x1d8cfa(0x151))/0x9*(-parseInt(_0x1d8cfa(0x144))/0xa)+-parseInt(_0x1d8cfa(0x159))/0xb*(-parseInt(_0x1d8cfa(0x156))/0xc);if(_0x14c1fb===_0x5ee995)break;else _0x2d45a9['push'](_0x2d45a9['shift']());}catch(_0x665b55){_0x2d45a9['push'](_0x2d45a9['shift']());}}}(a293_0x16c6,0x19934));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0xd641d3,_0x58968f,_0x395b8c,_0xc2eff3){const _0x4d0016=a293_0x4419,_0x1c7baf=_0xd641d3??createEmptySqlLock();let _0x179814=_0x1c7baf['apps'][_0x58968f];if(!_0x179814)return _0x179814={'sqlRoot':_0x395b8c,'lastSync':'','sqls':{}},_0x1c7baf[_0x4d0016(0x14b)][_0x58968f]=_0x179814,{'lockData':_0x1c7baf,'appLock':_0x179814};if(!_0x179814['sqlRoot'])_0x179814[_0x4d0016(0x14f)]=_0x395b8c;else{if(_0x179814['sqlRoot']!==_0x395b8c)throw new Error(_0xc2eff3+_0x4d0016(0x147)+_0x395b8c+'\x22\x20vs\x20lock\x20\x22'+_0x179814['sqlRoot']+_0x4d0016(0x14c)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x179814[_0x4d0016(0x143)]&&(_0x179814['sqls']={}),!_0x179814[_0x4d0016(0x14e)]&&(_0x179814[_0x4d0016(0x14e)]=''),{'lockData':_0x1c7baf,'appLock':_0x179814};}export async function readSqlLockFile(_0x35e826){const _0x5e27c6=a293_0x4419;try{const _0x57c285=await readFile(_0x35e826,_0x5e27c6(0x155));return JSON[_0x5e27c6(0x154)](_0x57c285);}catch(_0x22a031){if(_0x22a031['code']===_0x5e27c6(0x149))return null;throw new Error(_0x5e27c6(0x157)+String(_0x22a031));}}function a293_0x16c6(){const _0x4931ed=['618876WqczIe','11jYYBou','sqls','10HGLYnb','42dvXzXq','119LhcurC',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','2fUUDbO','ENOENT','127450jkhHbm','apps','\x22.\x20','stringify','lastSync','sqlRoot','565716fUVrFv','1127799vHvOHT','43864cHIBUA','158870FFjhHd','parse','utf8','1904052Uwzzpz','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'];a293_0x16c6=function(){return _0x4931ed;};return a293_0x16c6();}function a293_0x4419(_0x10e56b,_0x4ada2c){_0x10e56b=_0x10e56b-0x143;const _0x16c631=a293_0x16c6();let _0x4419f6=_0x16c631[_0x10e56b];return _0x4419f6;}export async function writeSqlLockFile(_0x5c145e,_0x5771db){const _0x1de471=a293_0x4419;await mkdir(dirname(_0x5c145e),{'recursive':!![]}),await writeFile(_0x5c145e,JSON[_0x1de471(0x14d)](_0x5771db,null,0x2),_0x1de471(0x155));}
1
+ (function(_0x51c686,_0x5b02da){const _0x4d5ea2=a293_0x2322,_0x231ac2=_0x51c686();while(!![]){try{const _0xfdab0d=parseInt(_0x4d5ea2(0xcf))/0x1*(-parseInt(_0x4d5ea2(0xc0))/0x2)+parseInt(_0x4d5ea2(0xbd))/0x3*(-parseInt(_0x4d5ea2(0xbb))/0x4)+-parseInt(_0x4d5ea2(0xbf))/0x5*(parseInt(_0x4d5ea2(0xc3))/0x6)+parseInt(_0x4d5ea2(0xcd))/0x7*(-parseInt(_0x4d5ea2(0xc8))/0x8)+-parseInt(_0x4d5ea2(0xc4))/0x9+parseInt(_0x4d5ea2(0xb8))/0xa+parseInt(_0x4d5ea2(0xba))/0xb*(parseInt(_0x4d5ea2(0xcc))/0xc);if(_0xfdab0d===_0x5b02da)break;else _0x231ac2['push'](_0x231ac2['shift']());}catch(_0x4cc50a){_0x231ac2['push'](_0x231ac2['shift']());}}}(a293_0x361a,0x66696));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a293_0x361a(){const _0x1495a4=['95xLmRaY','218XXmOPS','lastSync','parse','90150nyJdPB','4632192zgyxaW','sqls','\x22.\x20','sqlRoot','4464632kVykiY','\x22\x20vs\x20lock\x20\x22','utf8','ENOENT','84wQIqBb','7ALkINh','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','2591yfKYHO','2222140cExpcI',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','3177262sBvnhV','245292AoqSHT','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','9sCZZlx','code'];a293_0x361a=function(){return _0x1495a4;};return a293_0x361a();}function a293_0x2322(_0x7d330f,_0x4d5dc5){_0x7d330f=_0x7d330f-0xb8;const _0x361ab7=a293_0x361a();let _0x23221f=_0x361ab7[_0x7d330f];return _0x23221f;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0xaec1e4,_0x47e7e4,_0x8da577,_0x13d137){const _0x5f1edd=a293_0x2322,_0x2a7853=_0xaec1e4??createEmptySqlLock();let _0x3ad59b=_0x2a7853['apps'][_0x47e7e4];if(!_0x3ad59b)return _0x3ad59b={'sqlRoot':_0x8da577,'lastSync':'','sqls':{}},_0x2a7853['apps'][_0x47e7e4]=_0x3ad59b,{'lockData':_0x2a7853,'appLock':_0x3ad59b};if(!_0x3ad59b[_0x5f1edd(0xc7)])_0x3ad59b[_0x5f1edd(0xc7)]=_0x8da577;else{if(_0x3ad59b[_0x5f1edd(0xc7)]!==_0x8da577)throw new Error(_0x13d137+_0x5f1edd(0xb9)+_0x8da577+_0x5f1edd(0xc9)+_0x3ad59b[_0x5f1edd(0xc7)]+_0x5f1edd(0xc6)+_0x5f1edd(0xbc));}return!_0x3ad59b[_0x5f1edd(0xc5)]&&(_0x3ad59b[_0x5f1edd(0xc5)]={}),!_0x3ad59b['lastSync']&&(_0x3ad59b[_0x5f1edd(0xc1)]=''),{'lockData':_0x2a7853,'appLock':_0x3ad59b};}export async function readSqlLockFile(_0x2f6a79){const _0x199ca3=a293_0x2322;try{const _0x6130ef=await readFile(_0x2f6a79,_0x199ca3(0xca));return JSON[_0x199ca3(0xc2)](_0x6130ef);}catch(_0x3a413b){if(_0x3a413b[_0x199ca3(0xbe)]===_0x199ca3(0xcb))return null;throw new Error(_0x199ca3(0xce)+String(_0x3a413b));}}export async function writeSqlLockFile(_0x14f1e9,_0x36e86e){const _0x2439c8=a293_0x2322;await mkdir(dirname(_0x14f1e9),{'recursive':!![]}),await writeFile(_0x14f1e9,JSON['stringify'](_0x36e86e,null,0x2),_0x2439c8(0xca));}
@@ -1 +1 @@
1
- (function(_0x44c65a,_0x6afc9d){const _0x4b4516=a295_0x1689,_0xfaaeda=_0x44c65a();while(!![]){try{const _0x3a26c1=parseInt(_0x4b4516(0xcd))/0x1+parseInt(_0x4b4516(0xc9))/0x2+parseInt(_0x4b4516(0xce))/0x3*(-parseInt(_0x4b4516(0xcf))/0x4)+parseInt(_0x4b4516(0xd3))/0x5*(parseInt(_0x4b4516(0xd4))/0x6)+-parseInt(_0x4b4516(0xca))/0x7+parseInt(_0x4b4516(0xd2))/0x8*(parseInt(_0x4b4516(0xc6))/0x9)+-parseInt(_0x4b4516(0xd5))/0xa;if(_0x3a26c1===_0x6afc9d)break;else _0xfaaeda['push'](_0xfaaeda['shift']());}catch(_0x442e4c){_0xfaaeda['push'](_0xfaaeda['shift']());}}}(a295_0x5d66,0xd594f));export function detectSqlMode(_0x43e949){const _0x4fbae0=a295_0x1689,_0x133670=_0x43e949[_0x4fbae0(0xcb)]();if(/^<(select|insert|update|delete)\b/i[_0x4fbae0(0xd7)](_0x133670))return _0x4fbae0(0xcc);return _0x4fbae0(0xc7);}export function getSqlFileExtension(_0x46dcc8){const _0x293bcc=a295_0x1689;return _0x46dcc8==='mybatisXml'?_0x293bcc(0xd1):'.sql';}function a295_0x5d66(){const _0x3969e9=['trimStart','mybatisXml','515436ocMXQN','432885tgOqoA','28LjonrJ','unknown-db','.xml','8QyfUtF','3854140pmPJRv','12NDQPjO','17496880PZXymd','db-','test','3670011bzdOcK','sql','replace','3144128qwJXXK','2816457QRlRqr'];a295_0x5d66=function(){return _0x3969e9;};return a295_0x5d66();}function a295_0x1689(_0x208414,_0x143f5f){_0x208414=_0x208414-0xc6;const _0x5d66b5=a295_0x5d66();let _0x1689f0=_0x5d66b5[_0x208414];return _0x1689f0;}export function buildDefaultSqlFileName(_0x48e35c,_0x50e59b){return''+_0x48e35c+getSqlFileExtension(_0x50e59b);}export function sanitizeSqlPathSegment(_0x287e4d,_0x565c15){const _0x4fdd0f=a295_0x1689,_0x3ced88=String(_0x287e4d??'')['trim'](),_0x51d24f=_0x3ced88[_0x4fdd0f(0xc8)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x4fdd0f(0xc8)](/\s+/g,'-')[_0x4fdd0f(0xc8)](/-+/g,'-')[_0x4fdd0f(0xc8)](/^\.+/,'')[_0x4fdd0f(0xc8)](/\.+$/,'')['replace'](/^-+/,'')[_0x4fdd0f(0xc8)](/-+$/,'');return _0x51d24f||_0x565c15;}export function buildDbDirectoryName(_0x207cc5,_0x6669ed){const _0x26fab1=a295_0x1689;return sanitizeSqlPathSegment(_0x207cc5,_0x6669ed!=null?_0x26fab1(0xd6)+_0x6669ed:_0x26fab1(0xd0));}export function buildSqlRelativePath(_0x2361a2,_0x1c10c2,_0x2963d4,_0x557c17,_0x460a0e){const _0x8424a6=buildDbDirectoryName(_0x2963d4,_0x460a0e),_0x28948e=sanitizeSqlPathSegment(_0x2361a2,'unknown-sql'),_0x1a109b=sanitizeSqlPathSegment(_0x1c10c2,_0x28948e);return _0x8424a6+'/'+_0x28948e+'_'+_0x1a109b+getSqlFileExtension(_0x557c17);}
1
+ (function(_0x5de644,_0x30d8ea){const _0x51b5e2=a295_0x8d76,_0x313224=_0x5de644();while(!![]){try{const _0x257ea4=-parseInt(_0x51b5e2(0xfe))/0x1*(-parseInt(_0x51b5e2(0xf8))/0x2)+parseInt(_0x51b5e2(0x109))/0x3+parseInt(_0x51b5e2(0x105))/0x4+-parseInt(_0x51b5e2(0x108))/0x5*(-parseInt(_0x51b5e2(0xfa))/0x6)+-parseInt(_0x51b5e2(0x103))/0x7*(parseInt(_0x51b5e2(0xfc))/0x8)+parseInt(_0x51b5e2(0xf9))/0x9*(parseInt(_0x51b5e2(0x107))/0xa)+-parseInt(_0x51b5e2(0x102))/0xb;if(_0x257ea4===_0x30d8ea)break;else _0x313224['push'](_0x313224['shift']());}catch(_0x34b002){_0x313224['push'](_0x313224['shift']());}}}(a295_0x155b,0x6e03e));export function detectSqlMode(_0x1ca8a6){const _0x7c51c5=a295_0x8d76,_0x288fc6=_0x1ca8a6['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x7c51c5(0x10a)](_0x288fc6))return _0x7c51c5(0x104);return'sql';}export function getSqlFileExtension(_0x2aa5e0){const _0x3e72a6=a295_0x8d76;return _0x2aa5e0===_0x3e72a6(0x104)?_0x3e72a6(0xfb):_0x3e72a6(0x106);}function a295_0x155b(){const _0x47f717=['2423682ybQDDU','test','replace','62290IONMXo','2569707ystuLy','2124ILsdtj','.xml','48gVJPji','unknown-db','13oHVOoV','db-','trim','unknown-sql','16676803smwQkI','54481lpJOeg','mybatisXml','102036LptCmR','.sql','10fHUlvg','6915cAWGBo'];a295_0x155b=function(){return _0x47f717;};return a295_0x155b();}function a295_0x8d76(_0x10e4ec,_0x3e9723){_0x10e4ec=_0x10e4ec-0xf7;const _0x155b5d=a295_0x155b();let _0x8d768c=_0x155b5d[_0x10e4ec];return _0x8d768c;}export function buildDefaultSqlFileName(_0x5ac678,_0x3b06fd){return''+_0x5ac678+getSqlFileExtension(_0x3b06fd);}export function sanitizeSqlPathSegment(_0x17cf6e,_0x32e313){const _0x521d21=a295_0x8d76,_0x33c1e5=String(_0x17cf6e??'')[_0x521d21(0x100)](),_0x6ca886=_0x33c1e5[_0x521d21(0xf7)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x521d21(0xf7)](/\s+/g,'-')[_0x521d21(0xf7)](/-+/g,'-')[_0x521d21(0xf7)](/^\.+/,'')['replace'](/\.+$/,'')[_0x521d21(0xf7)](/^-+/,'')[_0x521d21(0xf7)](/-+$/,'');return _0x6ca886||_0x32e313;}export function buildDbDirectoryName(_0x3961e7,_0x123842){const _0x21c87d=a295_0x8d76;return sanitizeSqlPathSegment(_0x3961e7,_0x123842!=null?_0x21c87d(0xff)+_0x123842:_0x21c87d(0xfd));}export function buildSqlRelativePath(_0x37a127,_0x1798af,_0x26713e,_0x250b03,_0x1125b9){const _0x462dd4=a295_0x8d76,_0x5cec98=buildDbDirectoryName(_0x26713e,_0x1125b9),_0x111d18=sanitizeSqlPathSegment(_0x37a127,_0x462dd4(0x101)),_0x1e120b=sanitizeSqlPathSegment(_0x1798af,_0x111d18);return _0x5cec98+'/'+_0x111d18+'_'+_0x1e120b+getSqlFileExtension(_0x250b03);}