@profoundlogic/coderflow-server 0.6.3 → 0.6.4

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 (169) hide show
  1. package/dist/coder-server.js +1 -1
  2. package/dist/config.js +1 -1
  3. package/dist/lib/agent-keepalive.js +1 -1
  4. package/dist/lib/agent-models.js +1 -1
  5. package/dist/lib/api-keys.js +1 -1
  6. package/dist/lib/apiKeys.js +1 -1
  7. package/dist/lib/app-server-ports.js +1 -1
  8. package/dist/lib/auto-judge.js +1 -1
  9. package/dist/lib/automation-service.js +1 -1
  10. package/dist/lib/basic-auth.js +1 -1
  11. package/dist/lib/bindings.js +1 -1
  12. package/dist/lib/build-history.js +1 -1
  13. package/dist/lib/build-output-service.js +1 -1
  14. package/dist/lib/build-scheduler.js +1 -1
  15. package/dist/lib/build-service.js +1 -1
  16. package/dist/lib/ca-certificates.js +1 -1
  17. package/dist/lib/claude-oauth-refresh.js +1 -1
  18. package/dist/lib/cli/build.js +1 -1
  19. package/dist/lib/cli/cleanup-users.js +1 -1
  20. package/dist/lib/cli/config-command.js +1 -1
  21. package/dist/lib/cli/config.js +1 -1
  22. package/dist/lib/cli/create-user.js +1 -1
  23. package/dist/lib/cli/grant-admin.js +1 -1
  24. package/dist/lib/cli/init.js +1 -1
  25. package/dist/lib/cli/jira.js +1 -1
  26. package/dist/lib/cli/license.js +1 -1
  27. package/dist/lib/cli/list-roles.js +1 -1
  28. package/dist/lib/cli/list-users.js +1 -1
  29. package/dist/lib/cli/server-manager.js +1 -1
  30. package/dist/lib/cli/set-password.js +1 -1
  31. package/dist/lib/config-migration.js +1 -1
  32. package/dist/lib/container-credential-sync.js +1 -1
  33. package/dist/lib/container-tokens.js +1 -1
  34. package/dist/lib/data-dir.js +1 -1
  35. package/dist/lib/deployment-history.js +1 -1
  36. package/dist/lib/deployment-service.js +1 -1
  37. package/dist/lib/docker-utils.js +1 -1
  38. package/dist/lib/email.js +1 -1
  39. package/dist/lib/emailTemplates.js +1 -1
  40. package/dist/lib/entitlement.js +1 -1
  41. package/dist/lib/external-connections.js +1 -1
  42. package/dist/lib/fetch-utils.js +1 -1
  43. package/dist/lib/git-commit-details-route.js +1 -1
  44. package/dist/lib/git-history-diff-guardrails.js +1 -1
  45. package/dist/lib/git-provider-service.js +1 -1
  46. package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
  47. package/dist/lib/git-provider-setup/index.js +1 -1
  48. package/dist/lib/git-provider-setup/setup-factory.js +1 -1
  49. package/dist/lib/git-provider-setup/setup-interface.js +1 -1
  50. package/dist/lib/git-providers/azure-devops-provider.js +1 -1
  51. package/dist/lib/git-providers/github-app-provider.js +1 -1
  52. package/dist/lib/git-providers/index.js +1 -1
  53. package/dist/lib/git-providers/provider-factory.js +1 -1
  54. package/dist/lib/git-providers/provider-interface.js +1 -1
  55. package/dist/lib/github-urls.js +1 -1
  56. package/dist/lib/group-objective-linking.js +1 -1
  57. package/dist/lib/ibmi-sync.js +1 -1
  58. package/dist/lib/jira-client.js +1 -1
  59. package/dist/lib/judge-blinding.js +1 -1
  60. package/dist/lib/logger.js +1 -1
  61. package/dist/lib/migration-to-scoped-rbac.js +1 -1
  62. package/dist/lib/model-fetcher.js +1 -1
  63. package/dist/lib/notifications.js +1 -1
  64. package/dist/lib/objective-context.js +1 -1
  65. package/dist/lib/oidc-auth.js +1 -1
  66. package/dist/lib/oidc-device-flow.js +1 -1
  67. package/dist/lib/passwordTokens.js +1 -1
  68. package/dist/lib/permission-resolver.js +1 -1
  69. package/dist/lib/pin-cascade.js +1 -1
  70. package/dist/lib/provider-accounts.js +1 -1
  71. package/dist/lib/provider-oauth.js +1 -1
  72. package/dist/lib/provider-profile.js +1 -1
  73. package/dist/lib/provider-token-refresh.js +1 -1
  74. package/dist/lib/rbac-user-state.js +1 -1
  75. package/dist/lib/request-url.js +1 -1
  76. package/dist/lib/rewind.js +1 -1
  77. package/dist/lib/role-definitions.js +1 -1
  78. package/dist/lib/roles.js +1 -1
  79. package/dist/lib/secrets.js +1 -1
  80. package/dist/lib/setup-repo-git-auth.js +1 -1
  81. package/dist/lib/state-capture.js +1 -1
  82. package/dist/lib/static-files.js +1 -1
  83. package/dist/lib/task-name-format.js +1 -1
  84. package/dist/lib/task-name-generator.js +1 -1
  85. package/dist/lib/task-source-metadata.js +1 -1
  86. package/dist/lib/teams.js +1 -1
  87. package/dist/lib/user-git-oauth.js +1 -1
  88. package/dist/lib/user-git-tokens.js +1 -1
  89. package/dist/lib/users.js +1 -1
  90. package/dist/middleware/requireAuth.js +1 -1
  91. package/dist/middleware/requireInit.js +1 -1
  92. package/dist/middleware/requirePermission.js +1 -1
  93. package/dist/package.json +1 -1
  94. package/dist/playwright.config.js +1 -1
  95. package/dist/playwright.task-terminal.config.js +1 -1
  96. package/dist/routes/apiKeys.js +1 -1
  97. package/dist/routes/auth-oidc.js +1 -1
  98. package/dist/routes/auth.js +1 -1
  99. package/dist/routes/automations.js +1 -1
  100. package/dist/routes/bindings.js +1 -1
  101. package/dist/routes/build.js +1 -1
  102. package/dist/routes/containers.js +1 -1
  103. package/dist/routes/deploy-task.js +1 -1
  104. package/dist/routes/environment-management.js +1 -1
  105. package/dist/routes/environments.js +1 -1
  106. package/dist/routes/external-skills.js +1 -1
  107. package/dist/routes/git-credentials.js +1 -1
  108. package/dist/routes/git-oauth.js +1 -1
  109. package/dist/routes/git-provider-setup.js +1 -1
  110. package/dist/routes/health.js +1 -1
  111. package/dist/routes/jira.js +1 -1
  112. package/dist/routes/objective-management.js +1 -1
  113. package/dist/routes/password.js +1 -1
  114. package/dist/routes/prompt.js +1 -1
  115. package/dist/routes/provider-auth.js +1 -1
  116. package/dist/routes/qa.js +1 -1
  117. package/dist/routes/roles.js +1 -1
  118. package/dist/routes/settings.js +1 -1
  119. package/dist/routes/skill-management.js +1 -1
  120. package/dist/routes/skills.js +1 -1
  121. package/dist/routes/tasks.js +1 -1
  122. package/dist/routes/teams.js +1 -1
  123. package/dist/routes/templates.js +1 -1
  124. package/dist/routes/test-task.js +1 -1
  125. package/dist/routes/test.js +1 -1
  126. package/dist/routes/users.js +1 -1
  127. package/dist/routes/visualizations.js +1 -1
  128. package/dist/scripts/create-user.js +1 -1
  129. package/dist/scripts/migrate-config-to-data-dir.js +1 -1
  130. package/dist/start.js +1 -1
  131. package/dist/web-ui/public/activity-detail-modal.js +1 -1
  132. package/dist/web-ui/public/activity-feed.js +1 -1
  133. package/dist/web-ui/public/activity-formatters.js +1 -1
  134. package/dist/web-ui/public/agent-event-parser.js +1 -1
  135. package/dist/web-ui/public/app.js +1 -1
  136. package/dist/web-ui/public/approve-dialog.js +1 -1
  137. package/dist/web-ui/public/automation-links.js +1 -1
  138. package/dist/web-ui/public/automation-schedule.js +1 -1
  139. package/dist/web-ui/public/comments-widget.js +1 -1
  140. package/dist/web-ui/public/diff-utils.js +1 -1
  141. package/dist/web-ui/public/environments.js +1 -1
  142. package/dist/web-ui/public/feedback-widget.js +1 -1
  143. package/dist/web-ui/public/file-selection-tree.js +1 -1
  144. package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
  145. package/dist/web-ui/public/git-history.js +1 -1
  146. package/dist/web-ui/public/git-status.js +1 -1
  147. package/dist/web-ui/public/ibmi-file-filter.js +1 -1
  148. package/dist/web-ui/public/index.js +1 -1
  149. package/dist/web-ui/public/login.js +1 -1
  150. package/dist/web-ui/public/markdown-editor.js +1 -1
  151. package/dist/web-ui/public/markdown-file-editor.js +1 -1
  152. package/dist/web-ui/public/modal-maximize.js +1 -1
  153. package/dist/web-ui/public/notifications.js +1 -1
  154. package/dist/web-ui/public/permissions.js +1 -1
  155. package/dist/web-ui/public/pr-dialog.js +1 -1
  156. package/dist/web-ui/public/roles.js +1 -1
  157. package/dist/web-ui/public/server-health.js +1 -1
  158. package/dist/web-ui/public/settings.js +1 -1
  159. package/dist/web-ui/public/setup-password.js +1 -1
  160. package/dist/web-ui/public/skills.js +1 -1
  161. package/dist/web-ui/public/sse-client.js +1 -1
  162. package/dist/web-ui/public/sse-shared-worker.js +1 -1
  163. package/dist/web-ui/public/task.js +1 -1
  164. package/dist/web-ui/public/teams.js +1 -1
  165. package/dist/web-ui/public/terminal.js +1 -1
  166. package/dist/web-ui/public/theme.js +1 -1
  167. package/dist/web-ui/public/users.js +1 -1
  168. package/dist/web-ui/public/variant-grouping.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- function isLogOnlyTaskType(_0x1911ab){return _0x1911ab==='test'||_0x1911ab==='deploy';}export function createApproveDialogHTML(_0x82fc23='',_0x3bf1c3={}){const _0x2c078c=_0x82fc23,_0x40053c=_0x3bf1c3['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x1af878=_0x3bf1c3['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0xc94152=_0x3bf1c3['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'approve-modal\x22\x20class=\x22'+_0x40053c+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-overlay\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2>Approve\x20Changes</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22modal-close\x22\x20id=\x22'+_0x2c078c+'close-approve-modal\x22>&times;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'approve-warning\x22\x20class=\x22'+_0x1af878+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x2c078c+'approve-warning-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'approve-error\x22\x20class=\x22'+_0xc94152+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22error-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x2c078c+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x2c078c+'approve-repo-name\x22\x20class=\x22modal-repo\x22>Repository</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x2c078c+'approve-stats\x22\x20class=\x22modal-stats\x22>0\x20files\x20changed</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'approve-branches\x22\x20class=\x22modal-branches\x22\x20hidden></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x2c078c+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x2c078c+'commit-message-input\x22\x20class=\x22commit-message-input\x22\x20rows=\x226\x22\x20placeholder=\x22Enter\x20commit\x20message...\x22></textarea>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20id=\x22'+_0x2c078c+'multi-repo-note\x22\x20class=\x22field-hint\x22\x20hidden>This\x20commit\x20message\x20will\x20be\x20used\x20for\x20all\x20repositories\x20listed\x20above.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2c078c+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit\x20(rebase)</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2c078c+'push-after-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Push\x20to\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2c078c+'create-new-branch\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20new\x20branch</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'new-branch-input-container\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x2c078c+'new-branch-name\x22\x20class=\x22new-branch-input\x22\x20placeholder=\x22Enter\x20new\x20branch\x20name...\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>A\x20new\x20branch\x20will\x20be\x20created\x20from\x20the\x20current\x20branch\x20before\x20committing.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'pr-option-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2c078c+'create-pull-request\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20pull\x20request</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22\x20id=\x22'+_0x2c078c+'pr-hint\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20new\x20branch\x20will\x20be\x20created,\x20pushed,\x20and\x20a\x20pull\x20request\x20opened.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'ibmi-sync-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22approve-divider\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2c078c+'sync-to-ibmi\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Sync\x20to\x20IBM\x20i</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x2c078c+'ibmi-sync-library\x22>Library\x20name</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x2c078c+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x2c078c+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x2c078c+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x2c078c+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x2c078c+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2c078c+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x2c078c+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x2c078c+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x2c078c+'confirm-approve\x22>Commit\x20Changes</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20';}export class ApproveDialog{constructor(_0x2ad16a={}){this['prefix']=_0x2ad16a['prefix']||'',this['onApprove']=_0x2ad16a['onApprove'],this['onSync']=_0x2ad16a['onSync'],this['onSuccess']=_0x2ad16a['onSuccess'],this['onError']=_0x2ad16a['onError'],this['onCreatePR']=_0x2ad16a['onCreatePR'],this['showToast']=_0x2ad16a['showToast']||(()=>{}),this['container']=_0x2ad16a['container']||document['body'],this['useTaskPageStyles']=_0x2ad16a['useTaskPageStyles']||![],this['baseUrl']=_0x2ad16a['baseUrl']||'',this['coderflowAttribution']=_0x2ad16a['coderflowAttribution'],this['onSyncToIbmi']=_0x2ad16a['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x2ad16a['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x2355ed=document['createElement']('div');_0x2355ed['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x2355ed['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x3961a5){return document['getElementById'](''+this['prefix']+_0x3961a5);}['_bindEvents'](){const _0x569339=this['_el']('approve-modal'),_0x492cbf=this['_el']('close-approve-modal'),_0x51952e=this['_el']('cancel-approve'),_0x13fdf7=this['_el']('confirm-approve'),_0x4d9615=_0x569339?.['querySelector']('.modal-overlay'),_0x4971f2=this['_el']('create-new-branch'),_0x16716b=this['_el']('new-branch-input-container'),_0x4f6d57=this['_el']('new-branch-name'),_0x355172=this['_el']('push-after-commit'),_0x4d3892=this['_el']('create-pull-request'),_0x9a90e4=this['_el']('pr-hint');_0x492cbf?.['addEventListener']('click',()=>this['hide']()),_0x51952e?.['addEventListener']('click',()=>this['hide']()),_0x4d9615?.['addEventListener']('click',()=>this['hide']()),_0x13fdf7?.['addEventListener']('click',()=>this['_handleApprove']());_0x4971f2&&_0x4971f2['addEventListener']('change',()=>{_0x16716b&&(_0x16716b['hidden']=!_0x4971f2['checked']),_0x4971f2['checked']&&_0x4f6d57&&_0x4f6d57['focus']();});_0x4d3892&&_0x355172&&_0x4971f2&&(_0x4d3892['addEventListener']('change',()=>{this['_createPR']=_0x4d3892['checked'];if(_0x4d3892['checked']){_0x355172['checked']=!![],_0x355172['disabled']=!![],_0x4971f2['checked']=!![],_0x4971f2['disabled']=!![];_0x16716b&&(_0x16716b['hidden']=![]);if(_0x9a90e4)_0x9a90e4['hidden']=![];}else{_0x355172['disabled']=![],_0x4971f2['disabled']=![];if(_0x9a90e4)_0x9a90e4['hidden']=!![];}}),_0x355172['addEventListener']('change',()=>{if(!_0x355172['checked']&&_0x4d3892['checked']){_0x4d3892['checked']=![],this['_createPR']=![],_0x355172['disabled']=![],_0x4971f2['disabled']=![];if(_0x9a90e4)_0x9a90e4['hidden']=!![];}}));const _0x2db735=this['_el']('sync-to-ibmi');_0x2db735&&_0x2db735['addEventListener']('change',async _0x49c2d3=>{const _0x766f99=this['_el']('ibmi-sync-fields');if(_0x766f99)_0x766f99['hidden']=!_0x49c2d3['target']['checked'];if(_0x49c2d3['target']['checked']){const _0x355ef9=this['_el']('ibmi-sync-library'),_0x35c163=localStorage['getItem']('coderflow_ibmi_sync_library');_0x35c163&&_0x355ef9&&!_0x355ef9['value']&&(_0x355ef9['value']=_0x35c163);const _0xb07e8=this['_el']('ibmi-sync-user');if(_0xb07e8&&!_0xb07e8['value']){const _0x21aff1=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x21aff1)_0xb07e8['value']=_0x21aff1;}const _0x1d4ae4=this['_el']('ibmi-sync-password');if(_0x1d4ae4)_0x1d4ae4['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x435568=>{_0x435568['key']==='Escape'&&_0x569339&&!_0x569339['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x51486c=this['_el']('ibmi-sync-file-tree'),_0x18c2fa=this['_el']('ibmi-sync-files-summary');if(!_0x51486c)return;_0x51486c['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x18c2fa)_0x18c2fa['textContent']='';try{const {files:_0x4ec25d,absolutePaths:_0x5a6134}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x4ec25d,this['_syncAbsolutePaths']=_0x5a6134;if(_0x4ec25d['length']===0x0){_0x51486c['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x5f4839}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x1858b6,hasKnownIbmiExtension:_0x49d66f}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x5f4839({'container':_0x51486c,'files':_0x4ec25d,'isPreselected':_0x598e29=>{const {valid:_0x23734e}=_0x1858b6(_0x598e29);return _0x23734e&&_0x49d66f(_0x598e29);},'isDisabled':_0x580a39=>{const {valid:_0x26275f,reason:_0x2e5121}=_0x1858b6(_0x580a39);return{'disabled':!_0x26275f,'reason':_0x2e5121};},'isAutoCheckEligible':_0x4ec846=>{const {valid:_0x1aadd3}=_0x1858b6(_0x4ec846);return _0x1aadd3&&_0x49d66f(_0x4ec846);},'onChange':_0x3c4336=>{_0x18c2fa&&(_0x18c2fa['textContent']=_0x3c4336['length']+'\x20of\x20'+_0x4ec25d['length']+'\x20file'+(_0x4ec25d['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x593433){_0x51486c['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x1569f8){const _0x27a287=this['_el']('approve-error'),_0x1072a0=this['_el']('approve-error-text');_0x27a287&&_0x1072a0&&(_0x1072a0['textContent']=_0x1569f8,_0x27a287['hidden']=![],_0x27a287['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x721312=this['_el']('approve-error'),_0x13fd28=this['_el']('approve-error-text');_0x721312&&_0x13fd28&&(_0x721312['hidden']=!![],_0x13fd28['textContent']='');}['_displayBranchInfo'](_0x3db047,_0x5d12dc={}){const _0x45ba36=this['_el']('approve-branches');if(!_0x45ba36)return;const _0x3dbf37=[];for(const _0x214711 of _0x3db047){_0x5d12dc[_0x214711['name']]&&_0x3dbf37['push']({'repo':_0x214711['name'],'branch':_0x5d12dc[_0x214711['name']]});}if(_0x3dbf37['length']>0x0){_0x45ba36['hidden']=![];if(_0x3dbf37['length']===0x1)_0x45ba36['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x3dbf37[0x0]['branch']+'</code></div>';else{const _0x4e84be=_0x3dbf37['map'](_0x555df9=>'<div\x20class=\x22branch-item\x22><strong>'+_0x555df9['repo']+':</strong>\x20<code>'+_0x555df9['branch']+'</code></div>')['join']('');_0x45ba36['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x4e84be+'</div></div>';}}else _0x45ba36['hidden']=!![],_0x45ba36['innerHTML']='';}['showWarning'](_0x59b041){const _0x4e639c=this['_el']('approve-warning'),_0x17da91=this['_el']('approve-warning-text');_0x4e639c&&_0x17da91&&(_0x17da91['textContent']=_0x59b041,_0x4e639c['hidden']=![]);}['hideWarning'](){const _0x2dcc35=this['_el']('approve-warning'),_0x642b76=this['_el']('approve-warning-text');_0x2dcc35&&_0x642b76&&(_0x2dcc35['hidden']=!![],_0x642b76['textContent']='');}['_stripCoAuthoredByLines'](_0x2115b3){return _0x2115b3['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x50f56e){try{let _0x915075;try{const _0x5f360c=await fetch(this['baseUrl']+'/settings');if(_0x5f360c['ok']){const _0x57ae54=await _0x5f360c['json']();_0x915075=_0x57ae54['coderflow_attribution']!==![];}}catch(_0x2aaef9){}_0x915075===undefined&&(this['coderflowAttribution']!==undefined?_0x915075=this['coderflowAttribution']!==![]:_0x915075=!![]);const _0x251c0e=this['_stripCoAuthoredByLines'](_0x50f56e);if(!_0x915075)return _0x251c0e;const _0x40ef84='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x251c0e+_0x40ef84;}catch(_0x32d04f){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x32d04f),_0x50f56e;}}['show'](_0x4c1d2f){!this['initialized']&&this['init']();this['taskData']=_0x4c1d2f;const _0x43b47a=this['_el']('approve-modal'),_0xc59dba=this['_el']('commit-message-input'),_0x23bd11=this['_el']('pull-before-commit'),_0x2e888f=this['_el']('push-after-commit'),_0x32b898=this['_el']('create-new-branch'),_0x455607=this['_el']('new-branch-input-container'),_0x34b26e=this['_el']('new-branch-name'),_0x3c1e86=this['_el']('approve-repo-name'),_0x420f73=this['_el']('approve-stats'),_0x1cf2e0=this['_el']('multi-repo-note');if(!_0x43b47a)return;this['hideError'](),this['hideWarning']();_0x4c1d2f['warning']&&this['showWarning'](_0x4c1d2f['warning']);const _0x3f95f8=_0x4c1d2f['reposChanged']||[];if(_0x3f95f8['length']===0x0&&!_0x4c1d2f['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x3f95f8,_0x4c1d2f);const _0x22dd72=_0x4c1d2f['commitMessage']||'',_0x44b31c=this['_stripCoAuthoredByLines'](_0x22dd72);_0xc59dba['value']=_0x44b31c;if(_0x23bd11)_0x23bd11['checked']=!![];if(_0x2e888f)_0x2e888f['checked']=!![];_0x32b898&&(_0x32b898['checked']=![]);_0x455607&&(_0x455607['hidden']=!![]);_0x34b26e&&(_0x34b26e['value']='');if(_0x2e888f)_0x2e888f['disabled']=![];if(_0x32b898)_0x32b898['disabled']=![];this['updatePRSupport'](_0x4c1d2f['prSupported']===!![]);const _0x15aebd=this['_el']('ibmi-sync-section');if(_0x15aebd){_0x15aebd['hidden']=!_0x4c1d2f['ibmiSyncAvailable'];const _0x31d524=this['_el']('sync-to-ibmi'),_0x56ad8a=this['_el']('ibmi-sync-fields'),_0x167ea8=this['_el']('ibmi-sync-library');if(_0x31d524)_0x31d524['checked']=![];if(_0x56ad8a)_0x56ad8a['hidden']=!![];if(_0x167ea8)_0x167ea8['value']='';const _0x241dd3=this['_el']('ibmi-sync-credentials-row');_0x241dd3&&(_0x241dd3['hidden']=!(_0x4c1d2f['ibmiSyncAvailable']&&_0x4c1d2f['syncCredentials']==='prompt'));}const _0x1ee5b0=this['_el']('confirm-approve');_0x4c1d2f['syncFirst']&&this['onSync']?(_0x1ee5b0&&(_0x1ee5b0['disabled']=!![],_0x1ee5b0['textContent']='Syncing...'),this['_performSync']()):_0x1ee5b0&&(_0x1ee5b0['disabled']=![],_0x1ee5b0['textContent']='Commit\x20Changes');_0x43b47a['hidden']=![];const _0x3a765b=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x3a765b,'taskId':_0x4c1d2f['taskId'],'originalCommitMessage':_0x44b31c}),setTimeout(()=>{_0xc59dba['focus'](),_0xc59dba['setSelectionRange'](0x0,_0xc59dba['value']['length']);},0x64);}['updatePRSupport'](_0x43673e){const _0xf88e5e=this['_el']('pr-option-section'),_0x5af374=this['_el']('create-pull-request'),_0x566505=this['_el']('pr-hint'),_0x191bbb=this['_el']('push-after-commit'),_0x2bc76e=this['_el']('create-new-branch');if(!_0xf88e5e)return;if(_0x43673e){_0xf88e5e['hidden']=![];_0x5af374&&!_0x5af374['disabled']&&(_0x5af374['checked']=![]);if(_0x566505)_0x566505['hidden']=!![];this['_createPR']=![];return;}_0x5af374?.['checked']&&(_0x5af374['checked']=![]);if(_0x566505)_0x566505['hidden']=!![];if(_0x191bbb)_0x191bbb['disabled']=![];if(_0x2bc76e)_0x2bc76e['disabled']=![];this['_createPR']=![],_0xf88e5e['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x442041,taskId:_0x60ac8a,originalCommitMessage:_0x4da3a1}){const _0x435699=this['_el']('commit-message-input');if(!_0x435699)return;const _0x208810=await this['_addAttributionIfEnabled'](_0x4da3a1);if(_0x442041!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x60ac8a)return;if(!this['isVisible']())return;const _0x24c6be=_0x4aedbc=>_0x4aedbc['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x24c6be(_0x435699['value'])!==_0x24c6be(_0x4da3a1))return;_0x435699['value']=_0x208810;}['_updateDisplay'](_0x21a9c9,_0x598e89){const _0x4138d6=this['_el']('approve-repo-name'),_0x595735=this['_el']('approve-stats'),_0x20f091=this['_el']('multi-repo-note');if(_0x21a9c9['length']===0x0){if(_0x4138d6)_0x4138d6['textContent']='Syncing...';if(_0x595735)_0x595735['textContent']='';if(_0x20f091)_0x20f091['hidden']=!![];return;}const _0x15aa1f=_0x21a9c9['reduce']((_0x29e670,_0x6642ab)=>_0x29e670+(_0x6642ab['files_changed']||0x0),0x0),_0x36cc76=_0x21a9c9['reduce']((_0xf6b192,_0x33b6e9)=>_0xf6b192+(_0x33b6e9['lines_added']||0x0),0x0),_0x4f496d=_0x21a9c9['reduce']((_0x6a1b72,_0x583703)=>_0x6a1b72+(_0x583703['lines_deleted']||0x0),0x0);if(_0x21a9c9['length']===0x1){if(_0x4138d6)_0x4138d6['textContent']=_0x21a9c9[0x0]?.['name']||'repository';if(_0x20f091)_0x20f091['hidden']=!![];}else{const _0x1cadb2=_0x21a9c9['map'](_0x549b41=>_0x549b41['name'])['join'](',\x20');if(_0x4138d6)_0x4138d6['textContent']=_0x21a9c9['length']+'\x20repositories:\x20'+_0x1cadb2;if(_0x20f091)_0x20f091['hidden']=![];}_0x595735&&(_0x595735['textContent']=_0x15aa1f+'\x20file'+(_0x15aa1f===0x1?'':'s')+'\x20changed\x20(+'+_0x36cc76+'\x20-'+_0x4f496d+')'),this['_displayBranchInfo'](_0x21a9c9,_0x598e89?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x1253c9=this['_el']('confirm-approve');try{const _0x58141d=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x58141d['repos_changed']){const _0xb002d9=this['taskData']['reposChanged']?.['length']||0x0,_0x3e95ac=this['taskData']['reposChanged']?.['reduce']((_0x5f7c7c,_0x7849f9)=>_0x5f7c7c+(_0x7849f9['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x58141d['repos_changed'],this['_updateDisplay'](_0x58141d['repos_changed'],this['taskData']);const _0x322993=_0x58141d['repos_changed']['length'],_0x2acfe5=_0x58141d['repos_changed']['reduce']((_0x3fd31d,_0x2960c1)=>_0x3fd31d+(_0x2960c1['files_changed']||0x0),0x0);(_0x2acfe5>_0x3e95ac||_0x322993>_0xb002d9)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x1253c9&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x1253c9['disabled']=!![],_0x1253c9['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x1253c9['disabled']=![],_0x1253c9['textContent']='Commit\x20Changes'));}catch(_0x3c6dbf){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x3c6dbf);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x3c6dbf['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x1253c9&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x1253c9['disabled']=![],_0x1253c9['textContent']='Commit\x20Changes'):(_0x1253c9['disabled']=!![],_0x1253c9['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x4c9324=this['_el']('approve-modal');_0x4c9324&&(_0x4c9324['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x2d8259=this['_el']('commit-message-input'),_0x5348d0=this['_el']('pull-before-commit'),_0x17e3e2=this['_el']('push-after-commit'),_0x15b6dd=this['_el']('create-new-branch'),_0x3bb60c=this['_el']('new-branch-name'),_0x544c95=this['_el']('confirm-approve'),_0x38913c=_0x2d8259['value']['trim'](),_0x3a019f=_0x5348d0?.['checked']??!![],_0x3dc124=_0x17e3e2?.['checked']??!![],_0x4abc45=_0x15b6dd?.['checked']||![],_0x5070f4=_0x3bb60c?.['value']['trim']()||'';this['hideError']();if(!_0x38913c){this['showError']('Commit\x20message\x20is\x20required'),_0x2d8259['focus']();return;}if(_0x4abc45&&!_0x5070f4){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x3bb60c?.['focus']();return;}if(_0x4abc45&&_0x5070f4){const _0x2f08de=/[\s~^:?*\[\\]/;if(_0x2f08de['test'](_0x5070f4)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x3bb60c?.['focus']();return;}}const _0x4f0d92=this['_el']('sync-to-ibmi')?.['checked'];if(_0x4f0d92){const _0x597b1a=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x597b1a){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x152d1a=this['_syncFileTree']['getSelectedFiles']();if(_0x152d1a['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x16192f=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x16192f){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x363506=this['_el']('ibmi-sync-password')?.['value'];if(!_0x363506){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x3d54ed=_0x544c95?.['textContent']||'Commit\x20Changes';_0x544c95&&(_0x544c95['disabled']=!![],_0x4abc45?_0x544c95['textContent']='Creating\x20branch\x20&\x20committing...':_0x544c95['textContent']=_0x3a019f?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x4e8d46={'commit_message':_0x38913c,'pull':_0x3a019f,'push':_0x3dc124};_0x4abc45&&_0x5070f4&&(_0x4e8d46['new_branch']=_0x5070f4);let _0x263714=null;this['onApprove']&&(_0x263714=await this['onApprove'](this['taskData']['taskId'],_0x4e8d46));let _0xde8262='Changes\x20committed';if(_0x4abc45)_0xde8262='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x5070f4+'\x27',_0x3dc124&&(_0xde8262+='\x20and\x20pushed');else{if(_0x3a019f&&_0x3dc124)_0xde8262='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x3a019f)_0xde8262='Changes\x20pulled\x20and\x20committed';else _0x3dc124&&(_0xde8262='Changes\x20committed\x20and\x20pushed');}}const _0x348fa9=this['_el']('sync-to-ibmi')?.['checked'];let _0x2c6533=null,_0x45e320=null,_0x19657d=null,_0x160802=null;if(_0x348fa9&&this['onSyncToIbmi']){_0x2c6533=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x45e320=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x19657d=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x14910b=this['_syncFileTree']['getSelectedFiles']();_0x160802=_0x14910b['map'](_0x4f767c=>{const _0x414a63=this['_syncRelativeFiles']['indexOf'](_0x4f767c);return _0x414a63>=0x0?this['_syncAbsolutePaths'][_0x414a63]:_0x4f767c;});}}this['showToast'](_0xde8262,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x263714||{});}catch(_0x491871){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x491871);}if(_0x348fa9&&this['onSyncToIbmi']&&_0x2c6533){localStorage['setItem']('coderflow_ibmi_sync_library',_0x2c6533);if(_0x45e320)localStorage['setItem']('coderflow_ibmi_sync_user',_0x45e320);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x2c6533,_0x45e320,_0x19657d,_0x160802);}catch(_0x4c6c37){this['showToast']('Sync\x20failed:\x20'+_0x4c6c37['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x62aff8){console['error']('Failed\x20to\x20approve\x20changes',_0x62aff8),this['showError']('Failed\x20to\x20commit:\x20'+_0x62aff8['message']),_0x544c95&&(_0x544c95['disabled']=![],_0x544c95['textContent']=_0x3d54ed),this['onError']&&this['onError'](_0x62aff8);}}['isVisible'](){const _0xf4a0a9=this['_el']('approve-modal');return _0xf4a0a9&&!_0xf4a0a9['hidden'];}['destroy'](){const _0x49511f=this['_el']('approve-modal');_0x49511f&&_0x49511f['remove'](),this['initialized']=![];}}export function getApproveState(_0x579675,_0x3b34fe){if(!_0x579675)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x579675['taskType']))return{'canApprove':![],'reason':(_0x579675['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x346a45=_0x3b34fe?.['repos_changed']?.['length']>0x0,_0x58c764=_0x579675['status']==='completed'||_0x579675['status']==='failed'||_0x579675['status']==='interrupted',_0x2965f0=_0x579675['containerState']==='running',_0x1d9fa9=_0x579675['approvedBy']!==undefined&&_0x579675['approvedBy']!==null;if(_0x1d9fa9){const _0x4c712a=_0x579675['approvedBy']['name']||_0x579675['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x4c712a};}if(!_0x346a45)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x58c764)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x579675['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x2965f0)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
1
+ function isLogOnlyTaskType(_0x1dc152){return _0x1dc152==='test'||_0x1dc152==='deploy';}export function createApproveDialogHTML(_0x1e424c='',_0x415780={}){const _0x41f5c5=_0x1e424c,_0xe6e01b=_0x415780['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x14eec5=_0x415780['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x4861f0=_0x415780['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'approve-modal\x22\x20class=\x22'+_0xe6e01b+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-overlay\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2>Approve\x20Changes</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22modal-close\x22\x20id=\x22'+_0x41f5c5+'close-approve-modal\x22>&times;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'approve-warning\x22\x20class=\x22'+_0x14eec5+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x41f5c5+'approve-warning-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'approve-error\x22\x20class=\x22'+_0x4861f0+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22error-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x41f5c5+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x41f5c5+'approve-repo-name\x22\x20class=\x22modal-repo\x22>Repository</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x41f5c5+'approve-stats\x22\x20class=\x22modal-stats\x22>0\x20files\x20changed</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'approve-branches\x22\x20class=\x22modal-branches\x22\x20hidden></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x41f5c5+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x41f5c5+'commit-message-input\x22\x20class=\x22commit-message-input\x22\x20rows=\x226\x22\x20placeholder=\x22Enter\x20commit\x20message...\x22></textarea>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20id=\x22'+_0x41f5c5+'multi-repo-note\x22\x20class=\x22field-hint\x22\x20hidden>This\x20commit\x20message\x20will\x20be\x20used\x20for\x20all\x20repositories\x20listed\x20above.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x41f5c5+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit\x20(rebase)</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x41f5c5+'push-after-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Push\x20to\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x41f5c5+'create-new-branch\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20new\x20branch</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'new-branch-input-container\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x41f5c5+'new-branch-name\x22\x20class=\x22new-branch-input\x22\x20placeholder=\x22Enter\x20new\x20branch\x20name...\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>A\x20new\x20branch\x20will\x20be\x20created\x20from\x20the\x20current\x20branch\x20before\x20committing.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'pr-option-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x41f5c5+'create-pull-request\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20pull\x20request</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22\x20id=\x22'+_0x41f5c5+'pr-hint\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20new\x20branch\x20will\x20be\x20created,\x20pushed,\x20and\x20a\x20pull\x20request\x20opened.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'ibmi-sync-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22approve-divider\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x41f5c5+'sync-to-ibmi\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Sync\x20to\x20IBM\x20i</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x41f5c5+'ibmi-sync-library\x22>Library\x20name</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x41f5c5+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x41f5c5+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x41f5c5+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x41f5c5+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x41f5c5+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x41f5c5+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x41f5c5+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x41f5c5+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x41f5c5+'confirm-approve\x22>Commit\x20Changes</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20';}export class ApproveDialog{constructor(_0xe4d1d={}){this['prefix']=_0xe4d1d['prefix']||'',this['onApprove']=_0xe4d1d['onApprove'],this['onSync']=_0xe4d1d['onSync'],this['onSuccess']=_0xe4d1d['onSuccess'],this['onError']=_0xe4d1d['onError'],this['onCreatePR']=_0xe4d1d['onCreatePR'],this['showToast']=_0xe4d1d['showToast']||(()=>{}),this['container']=_0xe4d1d['container']||document['body'],this['useTaskPageStyles']=_0xe4d1d['useTaskPageStyles']||![],this['baseUrl']=_0xe4d1d['baseUrl']||'',this['coderflowAttribution']=_0xe4d1d['coderflowAttribution'],this['onSyncToIbmi']=_0xe4d1d['onSyncToIbmi']||null,this['onGetSyncFiles']=_0xe4d1d['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x5554f4=document['createElement']('div');_0x5554f4['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x5554f4['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x16b064){return document['getElementById'](''+this['prefix']+_0x16b064);}['_bindEvents'](){const _0x3e657d=this['_el']('approve-modal'),_0x13fa33=this['_el']('close-approve-modal'),_0x129915=this['_el']('cancel-approve'),_0x4ea1d7=this['_el']('confirm-approve'),_0x3da44d=_0x3e657d?.['querySelector']('.modal-overlay'),_0x23d022=this['_el']('create-new-branch'),_0x5e2984=this['_el']('new-branch-input-container'),_0x410802=this['_el']('new-branch-name'),_0xea031d=this['_el']('push-after-commit'),_0xe39b08=this['_el']('create-pull-request'),_0x31a893=this['_el']('pr-hint');_0x13fa33?.['addEventListener']('click',()=>this['hide']()),_0x129915?.['addEventListener']('click',()=>this['hide']()),_0x3da44d?.['addEventListener']('click',()=>this['hide']()),_0x4ea1d7?.['addEventListener']('click',()=>this['_handleApprove']());_0x23d022&&_0x23d022['addEventListener']('change',()=>{_0x5e2984&&(_0x5e2984['hidden']=!_0x23d022['checked']),_0x23d022['checked']&&_0x410802&&_0x410802['focus']();});_0xe39b08&&_0xea031d&&_0x23d022&&(_0xe39b08['addEventListener']('change',()=>{this['_createPR']=_0xe39b08['checked'];if(_0xe39b08['checked']){_0xea031d['checked']=!![],_0xea031d['disabled']=!![],_0x23d022['checked']=!![],_0x23d022['disabled']=!![];_0x5e2984&&(_0x5e2984['hidden']=![]);if(_0x31a893)_0x31a893['hidden']=![];}else{_0xea031d['disabled']=![],_0x23d022['disabled']=![];if(_0x31a893)_0x31a893['hidden']=!![];}}),_0xea031d['addEventListener']('change',()=>{if(!_0xea031d['checked']&&_0xe39b08['checked']){_0xe39b08['checked']=![],this['_createPR']=![],_0xea031d['disabled']=![],_0x23d022['disabled']=![];if(_0x31a893)_0x31a893['hidden']=!![];}}));const _0x5ee802=this['_el']('sync-to-ibmi');_0x5ee802&&_0x5ee802['addEventListener']('change',async _0x57ab48=>{const _0x509c57=this['_el']('ibmi-sync-fields');if(_0x509c57)_0x509c57['hidden']=!_0x57ab48['target']['checked'];if(_0x57ab48['target']['checked']){const _0x40f003=this['_el']('ibmi-sync-library'),_0xd3d91c=localStorage['getItem']('coderflow_ibmi_sync_library');_0xd3d91c&&_0x40f003&&!_0x40f003['value']&&(_0x40f003['value']=_0xd3d91c);const _0x47f7c5=this['_el']('ibmi-sync-user');if(_0x47f7c5&&!_0x47f7c5['value']){const _0xb74f9=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0xb74f9)_0x47f7c5['value']=_0xb74f9;}const _0x1e5ad2=this['_el']('ibmi-sync-password');if(_0x1e5ad2)_0x1e5ad2['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x460880=>{_0x460880['key']==='Escape'&&_0x3e657d&&!_0x3e657d['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x45031f=this['_el']('ibmi-sync-file-tree'),_0x4c24f6=this['_el']('ibmi-sync-files-summary');if(!_0x45031f)return;_0x45031f['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x4c24f6)_0x4c24f6['textContent']='';try{const {files:_0x405e46,absolutePaths:_0x11c98c}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x405e46,this['_syncAbsolutePaths']=_0x11c98c;if(_0x405e46['length']===0x0){_0x45031f['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x499e78}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x32c3aa,hasKnownIbmiExtension:_0x1e0ad7}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x499e78({'container':_0x45031f,'files':_0x405e46,'isPreselected':_0x5a9a9c=>{const {valid:_0x51307d}=_0x32c3aa(_0x5a9a9c);return _0x51307d&&_0x1e0ad7(_0x5a9a9c);},'isDisabled':_0x3b74d9=>{const {valid:_0x5c6034,reason:_0x2f2083}=_0x32c3aa(_0x3b74d9);return{'disabled':!_0x5c6034,'reason':_0x2f2083};},'isAutoCheckEligible':_0x26c1bb=>{const {valid:_0x44f44d}=_0x32c3aa(_0x26c1bb);return _0x44f44d&&_0x1e0ad7(_0x26c1bb);},'onChange':_0x48865b=>{_0x4c24f6&&(_0x4c24f6['textContent']=_0x48865b['length']+'\x20of\x20'+_0x405e46['length']+'\x20file'+(_0x405e46['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x1472c2){_0x45031f['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x32af3a){const _0x25285e=this['_el']('approve-error'),_0x47a20c=this['_el']('approve-error-text');_0x25285e&&_0x47a20c&&(_0x47a20c['textContent']=_0x32af3a,_0x25285e['hidden']=![],_0x25285e['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x364fc0=this['_el']('approve-error'),_0x1899a1=this['_el']('approve-error-text');_0x364fc0&&_0x1899a1&&(_0x364fc0['hidden']=!![],_0x1899a1['textContent']='');}['_displayBranchInfo'](_0x149bb4,_0x4753e9={}){const _0x1c5b87=this['_el']('approve-branches');if(!_0x1c5b87)return;const _0x1168bd=[];for(const _0x2c3942 of _0x149bb4){_0x4753e9[_0x2c3942['name']]&&_0x1168bd['push']({'repo':_0x2c3942['name'],'branch':_0x4753e9[_0x2c3942['name']]});}if(_0x1168bd['length']>0x0){_0x1c5b87['hidden']=![];if(_0x1168bd['length']===0x1)_0x1c5b87['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x1168bd[0x0]['branch']+'</code></div>';else{const _0x3b577a=_0x1168bd['map'](_0x3c8ff9=>'<div\x20class=\x22branch-item\x22><strong>'+_0x3c8ff9['repo']+':</strong>\x20<code>'+_0x3c8ff9['branch']+'</code></div>')['join']('');_0x1c5b87['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x3b577a+'</div></div>';}}else _0x1c5b87['hidden']=!![],_0x1c5b87['innerHTML']='';}['showWarning'](_0x30d036){const _0x5738ac=this['_el']('approve-warning'),_0x1eb15a=this['_el']('approve-warning-text');_0x5738ac&&_0x1eb15a&&(_0x1eb15a['textContent']=_0x30d036,_0x5738ac['hidden']=![]);}['hideWarning'](){const _0x459db3=this['_el']('approve-warning'),_0x519a15=this['_el']('approve-warning-text');_0x459db3&&_0x519a15&&(_0x459db3['hidden']=!![],_0x519a15['textContent']='');}['_stripCoAuthoredByLines'](_0x1c4aef){return _0x1c4aef['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x3fae4b){try{let _0x56cb7f;try{const _0xc482c6=await fetch(this['baseUrl']+'/settings');if(_0xc482c6['ok']){const _0x5eec9c=await _0xc482c6['json']();_0x56cb7f=_0x5eec9c['coderflow_attribution']!==![];}}catch(_0x42e282){}_0x56cb7f===undefined&&(this['coderflowAttribution']!==undefined?_0x56cb7f=this['coderflowAttribution']!==![]:_0x56cb7f=!![]);const _0x4e2fdb=this['_stripCoAuthoredByLines'](_0x3fae4b);if(!_0x56cb7f)return _0x4e2fdb;const _0x133b64='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x4e2fdb+_0x133b64;}catch(_0x1d8f90){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x1d8f90),_0x3fae4b;}}['show'](_0x4945f8){!this['initialized']&&this['init']();this['taskData']=_0x4945f8;const _0xf46d82=this['_el']('approve-modal'),_0x30c7ce=this['_el']('commit-message-input'),_0x1e427b=this['_el']('pull-before-commit'),_0x536801=this['_el']('push-after-commit'),_0x3445a3=this['_el']('create-new-branch'),_0x579378=this['_el']('new-branch-input-container'),_0x314de1=this['_el']('new-branch-name'),_0x5a6e2b=this['_el']('approve-repo-name'),_0x24906a=this['_el']('approve-stats'),_0x397984=this['_el']('multi-repo-note');if(!_0xf46d82)return;this['hideError'](),this['hideWarning']();_0x4945f8['warning']&&this['showWarning'](_0x4945f8['warning']);const _0x4bbd29=_0x4945f8['reposChanged']||[];if(_0x4bbd29['length']===0x0&&!_0x4945f8['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x4bbd29,_0x4945f8);const _0x6522ae=_0x4945f8['commitMessage']||'',_0x44d85f=this['_stripCoAuthoredByLines'](_0x6522ae);_0x30c7ce['value']=_0x44d85f;if(_0x1e427b)_0x1e427b['checked']=!![];if(_0x536801)_0x536801['checked']=!![];_0x3445a3&&(_0x3445a3['checked']=![]);_0x579378&&(_0x579378['hidden']=!![]);_0x314de1&&(_0x314de1['value']='');if(_0x536801)_0x536801['disabled']=![];if(_0x3445a3)_0x3445a3['disabled']=![];this['updatePRSupport'](_0x4945f8['prSupported']===!![]);const _0x43eee6=this['_el']('ibmi-sync-section');if(_0x43eee6){_0x43eee6['hidden']=!_0x4945f8['ibmiSyncAvailable'];const _0x466f85=this['_el']('sync-to-ibmi'),_0x3b4e07=this['_el']('ibmi-sync-fields'),_0xce3c58=this['_el']('ibmi-sync-library');if(_0x466f85)_0x466f85['checked']=![];if(_0x3b4e07)_0x3b4e07['hidden']=!![];if(_0xce3c58)_0xce3c58['value']='';const _0x4b82c7=this['_el']('ibmi-sync-credentials-row');_0x4b82c7&&(_0x4b82c7['hidden']=!(_0x4945f8['ibmiSyncAvailable']&&_0x4945f8['syncCredentials']==='prompt'));}const _0x32f8fa=this['_el']('confirm-approve');_0x4945f8['syncFirst']&&this['onSync']?(_0x32f8fa&&(_0x32f8fa['disabled']=!![],_0x32f8fa['textContent']='Syncing...'),this['_performSync']()):_0x32f8fa&&(_0x32f8fa['disabled']=![],_0x32f8fa['textContent']='Commit\x20Changes');_0xf46d82['hidden']=![];const _0x136561=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x136561,'taskId':_0x4945f8['taskId'],'originalCommitMessage':_0x44d85f}),setTimeout(()=>{_0x30c7ce['focus'](),_0x30c7ce['setSelectionRange'](0x0,_0x30c7ce['value']['length']);},0x64);}['updatePRSupport'](_0xbbbc52){const _0x2a4b8a=this['_el']('pr-option-section'),_0x3f24a7=this['_el']('create-pull-request'),_0x2d2bed=this['_el']('pr-hint'),_0x312135=this['_el']('push-after-commit'),_0xe91360=this['_el']('create-new-branch');if(!_0x2a4b8a)return;if(_0xbbbc52){_0x2a4b8a['hidden']=![];_0x3f24a7&&!_0x3f24a7['disabled']&&(_0x3f24a7['checked']=![]);if(_0x2d2bed)_0x2d2bed['hidden']=!![];this['_createPR']=![];return;}_0x3f24a7?.['checked']&&(_0x3f24a7['checked']=![]);if(_0x2d2bed)_0x2d2bed['hidden']=!![];if(_0x312135)_0x312135['disabled']=![];if(_0xe91360)_0xe91360['disabled']=![];this['_createPR']=![],_0x2a4b8a['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x3212d4,taskId:_0x31ead8,originalCommitMessage:_0x1c4a22}){const _0x2af0d6=this['_el']('commit-message-input');if(!_0x2af0d6)return;const _0x1d54d1=await this['_addAttributionIfEnabled'](_0x1c4a22);if(_0x3212d4!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x31ead8)return;if(!this['isVisible']())return;const _0x216b6e=_0x2bafc1=>_0x2bafc1['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x216b6e(_0x2af0d6['value'])!==_0x216b6e(_0x1c4a22))return;_0x2af0d6['value']=_0x1d54d1;}['_updateDisplay'](_0x3c16a9,_0x3e89f4){const _0x3893b4=this['_el']('approve-repo-name'),_0x106a1e=this['_el']('approve-stats'),_0x1b63d4=this['_el']('multi-repo-note');if(_0x3c16a9['length']===0x0){if(_0x3893b4)_0x3893b4['textContent']='Syncing...';if(_0x106a1e)_0x106a1e['textContent']='';if(_0x1b63d4)_0x1b63d4['hidden']=!![];return;}const _0x1f425e=_0x3c16a9['reduce']((_0x139b52,_0x364192)=>_0x139b52+(_0x364192['files_changed']||0x0),0x0),_0x1b4c39=_0x3c16a9['reduce']((_0x3da1e5,_0x4370d6)=>_0x3da1e5+(_0x4370d6['lines_added']||0x0),0x0),_0x2d8f43=_0x3c16a9['reduce']((_0x3dd69d,_0x1e6d41)=>_0x3dd69d+(_0x1e6d41['lines_deleted']||0x0),0x0);if(_0x3c16a9['length']===0x1){if(_0x3893b4)_0x3893b4['textContent']=_0x3c16a9[0x0]?.['name']||'repository';if(_0x1b63d4)_0x1b63d4['hidden']=!![];}else{const _0x2b41f1=_0x3c16a9['map'](_0x4eae1a=>_0x4eae1a['name'])['join'](',\x20');if(_0x3893b4)_0x3893b4['textContent']=_0x3c16a9['length']+'\x20repositories:\x20'+_0x2b41f1;if(_0x1b63d4)_0x1b63d4['hidden']=![];}_0x106a1e&&(_0x106a1e['textContent']=_0x1f425e+'\x20file'+(_0x1f425e===0x1?'':'s')+'\x20changed\x20(+'+_0x1b4c39+'\x20-'+_0x2d8f43+')'),this['_displayBranchInfo'](_0x3c16a9,_0x3e89f4?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x4bfcce=this['_el']('confirm-approve');try{const _0x1a1698=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x1a1698['repos_changed']){const _0x2a1bd4=this['taskData']['reposChanged']?.['length']||0x0,_0x3cb446=this['taskData']['reposChanged']?.['reduce']((_0x2fa689,_0x49adb1)=>_0x2fa689+(_0x49adb1['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x1a1698['repos_changed'],this['_updateDisplay'](_0x1a1698['repos_changed'],this['taskData']);const _0x95b6ee=_0x1a1698['repos_changed']['length'],_0xc6f954=_0x1a1698['repos_changed']['reduce']((_0x3f1097,_0x1ebf0f)=>_0x3f1097+(_0x1ebf0f['files_changed']||0x0),0x0);(_0xc6f954>_0x3cb446||_0x95b6ee>_0x2a1bd4)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x4bfcce&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x4bfcce['disabled']=!![],_0x4bfcce['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x4bfcce['disabled']=![],_0x4bfcce['textContent']='Commit\x20Changes'));}catch(_0x2c75f1){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x2c75f1);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x2c75f1['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x4bfcce&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x4bfcce['disabled']=![],_0x4bfcce['textContent']='Commit\x20Changes'):(_0x4bfcce['disabled']=!![],_0x4bfcce['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x1e7b7e=this['_el']('approve-modal');_0x1e7b7e&&(_0x1e7b7e['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x2dd161=this['_el']('commit-message-input'),_0x587f48=this['_el']('pull-before-commit'),_0x3caa1a=this['_el']('push-after-commit'),_0x11c915=this['_el']('create-new-branch'),_0x1fb676=this['_el']('new-branch-name'),_0x47094a=this['_el']('confirm-approve'),_0x2ea130=_0x2dd161['value']['trim'](),_0x225437=_0x587f48?.['checked']??!![],_0x2ea61b=_0x3caa1a?.['checked']??!![],_0x3e33ff=_0x11c915?.['checked']||![],_0x362e18=_0x1fb676?.['value']['trim']()||'';this['hideError']();if(!_0x2ea130){this['showError']('Commit\x20message\x20is\x20required'),_0x2dd161['focus']();return;}if(_0x3e33ff&&!_0x362e18){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x1fb676?.['focus']();return;}if(_0x3e33ff&&_0x362e18){const _0x30f4e7=/[\s~^:?*\[\\]/;if(_0x30f4e7['test'](_0x362e18)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x1fb676?.['focus']();return;}}const _0x40e06a=this['_el']('sync-to-ibmi')?.['checked'];if(_0x40e06a){const _0x5ad3a4=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x5ad3a4){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x47e076=this['_syncFileTree']['getSelectedFiles']();if(_0x47e076['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x56411b=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x56411b){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x49bac0=this['_el']('ibmi-sync-password')?.['value'];if(!_0x49bac0){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x381521=_0x47094a?.['textContent']||'Commit\x20Changes';_0x47094a&&(_0x47094a['disabled']=!![],_0x3e33ff?_0x47094a['textContent']='Creating\x20branch\x20&\x20committing...':_0x47094a['textContent']=_0x225437?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x8060f2={'commit_message':_0x2ea130,'pull':_0x225437,'push':_0x2ea61b};_0x3e33ff&&_0x362e18&&(_0x8060f2['new_branch']=_0x362e18);let _0x1d30fa=null;this['onApprove']&&(_0x1d30fa=await this['onApprove'](this['taskData']['taskId'],_0x8060f2));let _0x516f3a='Changes\x20committed';if(_0x3e33ff)_0x516f3a='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x362e18+'\x27',_0x2ea61b&&(_0x516f3a+='\x20and\x20pushed');else{if(_0x225437&&_0x2ea61b)_0x516f3a='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x225437)_0x516f3a='Changes\x20pulled\x20and\x20committed';else _0x2ea61b&&(_0x516f3a='Changes\x20committed\x20and\x20pushed');}}const _0x30403e=this['_el']('sync-to-ibmi')?.['checked'];let _0x40fff0=null,_0x4dfe19=null,_0x22f16c=null,_0x567c1a=null;if(_0x30403e&&this['onSyncToIbmi']){_0x40fff0=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x4dfe19=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x22f16c=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x211879=this['_syncFileTree']['getSelectedFiles']();_0x567c1a=_0x211879['map'](_0x2f05ff=>{const _0x1f7fc1=this['_syncRelativeFiles']['indexOf'](_0x2f05ff);return _0x1f7fc1>=0x0?this['_syncAbsolutePaths'][_0x1f7fc1]:_0x2f05ff;});}}this['showToast'](_0x516f3a,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x1d30fa||{});}catch(_0x2a03a7){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x2a03a7);}if(_0x30403e&&this['onSyncToIbmi']&&_0x40fff0){localStorage['setItem']('coderflow_ibmi_sync_library',_0x40fff0);if(_0x4dfe19)localStorage['setItem']('coderflow_ibmi_sync_user',_0x4dfe19);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x40fff0,_0x4dfe19,_0x22f16c,_0x567c1a);}catch(_0x29bcf3){this['showToast']('Sync\x20failed:\x20'+_0x29bcf3['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x334ee4){console['error']('Failed\x20to\x20approve\x20changes',_0x334ee4),this['showError']('Failed\x20to\x20commit:\x20'+_0x334ee4['message']),_0x47094a&&(_0x47094a['disabled']=![],_0x47094a['textContent']=_0x381521),this['onError']&&this['onError'](_0x334ee4);}}['isVisible'](){const _0x20bfba=this['_el']('approve-modal');return _0x20bfba&&!_0x20bfba['hidden'];}['destroy'](){const _0x26e567=this['_el']('approve-modal');_0x26e567&&_0x26e567['remove'](),this['initialized']=![];}}export function getApproveState(_0x3cede7,_0x32de48){if(!_0x3cede7)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x3cede7['taskType']))return{'canApprove':![],'reason':(_0x3cede7['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x2b6fb7=_0x32de48?.['repos_changed']?.['length']>0x0,_0x927428=_0x3cede7['status']==='completed'||_0x3cede7['status']==='failed'||_0x3cede7['status']==='interrupted',_0x5cd98b=_0x3cede7['containerState']==='running',_0x44fef1=_0x3cede7['approvedBy']!==undefined&&_0x3cede7['approvedBy']!==null;if(_0x44fef1){const _0x3b130c=_0x3cede7['approvedBy']['name']||_0x3cede7['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x3b130c};}if(!_0x2b6fb7)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x927428)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x3cede7['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x5cd98b)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
@@ -1 +1 @@
1
- export function buildAutomationEnvironmentHref(_0x3d69b2,_0x36a2f8){const _0x10fe2f=new URLSearchParams();_0x3d69b2&&_0x10fe2f['set']('env',String(_0x3d69b2));_0x10fe2f['set']('tab','automations');_0x36a2f8&&_0x10fe2f['set']('automation',String(_0x36a2f8));const _0x4cc13a=_0x10fe2f['toString']();return'environments.html'+(_0x4cc13a?'?'+_0x4cc13a:'');}export function buildAutomationTaskFilterHref(_0x5abaab){const _0xdbe1b1=new URLSearchParams();_0x5abaab&&_0xdbe1b1['set']('automation',String(_0x5abaab));const _0x2531f7=_0xdbe1b1['toString']();return'index.html'+(_0x2531f7?'?'+_0x2531f7:'');}export function parseAutomationDeepLinkParams(_0x525c92=''){const _0x180a71=new URLSearchParams(_0x525c92||'');return{'env':_0x180a71['get']('env'),'tab':_0x180a71['get']('tab'),'automation':_0x180a71['get']('automation')};}
1
+ export function buildAutomationEnvironmentHref(_0x1beecd,_0x969c93){const _0x2550d4=new URLSearchParams();_0x1beecd&&_0x2550d4['set']('env',String(_0x1beecd));_0x2550d4['set']('tab','automations');_0x969c93&&_0x2550d4['set']('automation',String(_0x969c93));const _0x145988=_0x2550d4['toString']();return'environments.html'+(_0x145988?'?'+_0x145988:'');}export function buildAutomationTaskFilterHref(_0x244ffd){const _0x2eabc0=new URLSearchParams();_0x244ffd&&_0x2eabc0['set']('automation',String(_0x244ffd));const _0x16668b=_0x2eabc0['toString']();return'index.html'+(_0x16668b?'?'+_0x16668b:'');}export function parseAutomationDeepLinkParams(_0x437fd6=''){const _0x3432e4=new URLSearchParams(_0x437fd6||'');return{'env':_0x3432e4['get']('env'),'tab':_0x3432e4['get']('tab'),'automation':_0x3432e4['get']('automation')};}
@@ -1 +1 @@
1
- export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(_0x3e8a38,_0x3cfe22,_0x578c3d){const _0x4f35c5=Number['parseInt'](_0x3e8a38,0xa);if(!Number['isInteger'](_0x4f35c5)||_0x4f35c5<_0x3cfe22||_0x4f35c5>_0x578c3d)return null;return _0x4f35c5;}function inferRecurringInterval(_0x14d317,_0x4c8d3c){if(_0x14d317==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x14d317==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x14d317!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x4c8d3c==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x4c8d3c))return'0\x20*\x20*\x20*\x20*';for(const _0x277938 of RECURRING_INTERVAL_STEPS){if(_0x4c8d3c['startsWith']('*/'+_0x277938)||_0x4c8d3c['includes']('/'+_0x277938))return'0\x20*/'+_0x277938+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0xda704a){const _0xa6a9e0=String(_0xda704a||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0xa6a9e0)return{'start':'','end':''};const _0x4ea65e=parseBoundedInteger(_0xa6a9e0[0x1],0x0,0x17),_0x27d4a4=parseBoundedInteger(_0xa6a9e0[0x2],0x0,0x17);if(_0x4ea65e===null||_0x27d4a4===null||_0x4ea65e>_0x27d4a4)return{'start':'','end':''};return{'start':String(_0x4ea65e),'end':String(_0x27d4a4)};}export function parseAutomationScheduleToFormState(_0x3203fe){const _0x15499e=String(_0x3203fe||'')['trim'](),_0x224220=createDefaultScheduleFormState(),_0x38824a=_0x15499e['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x38824a){const _0x4afd4f=parseBoundedInteger(_0x38824a[0x1],0x0,0x3b),_0x33c211=parseBoundedInteger(_0x38824a[0x2],0x0,0x17);if(_0x4afd4f!==null&&_0x33c211!==null)return _0x224220['frequency']='daily',_0x224220['dailyMinute']=String(_0x4afd4f),_0x224220['dailyHour']=String(_0x33c211),_0x224220;}const _0xb8003=_0x15499e['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0xb8003){const _0x354ad7=parseBoundedInteger(_0xb8003[0x1],0x0,0x3b),_0x4144b9=parseBoundedInteger(_0xb8003[0x2],0x0,0x17),_0x403e1c=parseBoundedInteger(_0xb8003[0x3],0x0,0x7);if(_0x354ad7!==null&&_0x4144b9!==null&&_0x403e1c!==null)return _0x224220['frequency']='weekly',_0x224220['weeklyMinute']=String(_0x354ad7),_0x224220['weeklyHour']=String(_0x4144b9),_0x224220['weeklyDay']=String(_0x403e1c===0x7?0x0:_0x403e1c),_0x224220;}const _0x45e779=_0x15499e['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x45e779){const _0x2f026a=parseBoundedInteger(_0x45e779[0x1],0x0,0x3b),_0xb4180a=parseBoundedInteger(_0x45e779[0x2],0x0,0x17),_0x49b0b8=parseBoundedInteger(_0x45e779[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x2f026a!==null&&_0xb4180a!==null&&_0x49b0b8!==null)return _0x224220['frequency']='monthly',_0x224220['monthlyMinute']=String(_0x2f026a),_0x224220['monthlyHour']=String(_0xb4180a),_0x224220['monthlyDay']=String(_0x49b0b8),_0x224220;}const _0x1f52c8=_0x15499e['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x1f52c8){const [,_0x4925d7,_0x578afc,_0x29cb3c]=_0x1f52c8;_0x224220['frequency']='recurring',_0x224220['recurringInterval']=inferRecurringInterval(_0x4925d7,_0x578afc),_0x224220['recurringDayToken']=String(_0x29cb3c||'')['trim']()||'*';const _0x283a32=parseRecurringHourRange(_0x578afc);return _0x224220['recurringStartHour']=_0x283a32['start'],_0x224220['recurringEndHour']=_0x283a32['end'],_0x224220;}return _0x224220['frequency']='custom',_0x224220['customCron']=_0x15499e,_0x224220;}export function buildAutomationCronFromFormState(_0x599ab4={}){const _0x4ab5c8=String(_0x599ab4['frequency']||'daily');if(_0x4ab5c8==='custom')return String(_0x599ab4['customCron']||'')['trim']();if(_0x4ab5c8==='daily'){const _0x561d8a=String(_0x599ab4['dailyHour']??'2'),_0x5598ec=String(_0x599ab4['dailyMinute']??'0');return _0x5598ec+'\x20'+_0x561d8a+'\x20*\x20*\x20*';}if(_0x4ab5c8==='weekly'){const _0xe539f7=String(_0x599ab4['weeklyDay']??'1'),_0x2db001=String(_0x599ab4['weeklyHour']??'9'),_0x3380bc=String(_0x599ab4['weeklyMinute']??'0');return _0x3380bc+'\x20'+_0x2db001+'\x20*\x20*\x20'+_0xe539f7;}if(_0x4ab5c8==='monthly'){const _0x13cfc9=String(_0x599ab4['monthlyDay']??'1'),_0x196b7=String(_0x599ab4['monthlyHour']??'0'),_0x1592bb=String(_0x599ab4['monthlyMinute']??'0');return _0x1592bb+'\x20'+_0x196b7+'\x20'+_0x13cfc9+'\x20*\x20*';}const _0xad3812=String(_0x599ab4['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x354053='*/30',_0x5c9492='*']=_0xad3812['split'](/\s+/);let _0x43a7a3=_0x5c9492;const _0x402dd9=String(_0x599ab4['recurringStartHour']??'')['trim'](),_0x4652f0=String(_0x599ab4['recurringEndHour']??'')['trim']();if(_0x402dd9!==''&&_0x4652f0!==''){const _0x2d1c9b=Number['parseInt'](_0x402dd9,0xa),_0x1c714a=Number['parseInt'](_0x4652f0,0xa);if(Number['isInteger'](_0x2d1c9b)&&Number['isInteger'](_0x1c714a)&&_0x2d1c9b<=_0x1c714a){const _0x1c2d0e=_0x5c9492['match'](/^\*\/(\d+)$/);_0x1c2d0e?_0x43a7a3=_0x2d1c9b+'-'+_0x1c714a+'/'+_0x1c2d0e[0x1]:_0x43a7a3=_0x2d1c9b+'-'+_0x1c714a;}}const _0x39212f=String(_0x599ab4['recurringDayToken']??'*')['trim']()||'*';return _0x354053+'\x20'+_0x43a7a3+'\x20*\x20*\x20'+_0x39212f;}
1
+ export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(_0xc5e5e0,_0x55fb0b,_0x551bb6){const _0x24c019=Number['parseInt'](_0xc5e5e0,0xa);if(!Number['isInteger'](_0x24c019)||_0x24c019<_0x55fb0b||_0x24c019>_0x551bb6)return null;return _0x24c019;}function inferRecurringInterval(_0x119470,_0x57a9e8){if(_0x119470==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x119470==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x119470!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x57a9e8==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x57a9e8))return'0\x20*\x20*\x20*\x20*';for(const _0x27f081 of RECURRING_INTERVAL_STEPS){if(_0x57a9e8['startsWith']('*/'+_0x27f081)||_0x57a9e8['includes']('/'+_0x27f081))return'0\x20*/'+_0x27f081+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x97ec08){const _0x2a91c4=String(_0x97ec08||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x2a91c4)return{'start':'','end':''};const _0x52ac5e=parseBoundedInteger(_0x2a91c4[0x1],0x0,0x17),_0x46ce23=parseBoundedInteger(_0x2a91c4[0x2],0x0,0x17);if(_0x52ac5e===null||_0x46ce23===null||_0x52ac5e>_0x46ce23)return{'start':'','end':''};return{'start':String(_0x52ac5e),'end':String(_0x46ce23)};}export function parseAutomationScheduleToFormState(_0x561368){const _0xbddda9=String(_0x561368||'')['trim'](),_0x32583d=createDefaultScheduleFormState(),_0x4a2718=_0xbddda9['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x4a2718){const _0x1a6077=parseBoundedInteger(_0x4a2718[0x1],0x0,0x3b),_0x26bb6e=parseBoundedInteger(_0x4a2718[0x2],0x0,0x17);if(_0x1a6077!==null&&_0x26bb6e!==null)return _0x32583d['frequency']='daily',_0x32583d['dailyMinute']=String(_0x1a6077),_0x32583d['dailyHour']=String(_0x26bb6e),_0x32583d;}const _0x20d49e=_0xbddda9['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x20d49e){const _0x510cf0=parseBoundedInteger(_0x20d49e[0x1],0x0,0x3b),_0x2d5350=parseBoundedInteger(_0x20d49e[0x2],0x0,0x17),_0x130b24=parseBoundedInteger(_0x20d49e[0x3],0x0,0x7);if(_0x510cf0!==null&&_0x2d5350!==null&&_0x130b24!==null)return _0x32583d['frequency']='weekly',_0x32583d['weeklyMinute']=String(_0x510cf0),_0x32583d['weeklyHour']=String(_0x2d5350),_0x32583d['weeklyDay']=String(_0x130b24===0x7?0x0:_0x130b24),_0x32583d;}const _0x47ed43=_0xbddda9['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x47ed43){const _0x4e40a2=parseBoundedInteger(_0x47ed43[0x1],0x0,0x3b),_0x10db19=parseBoundedInteger(_0x47ed43[0x2],0x0,0x17),_0x34c080=parseBoundedInteger(_0x47ed43[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x4e40a2!==null&&_0x10db19!==null&&_0x34c080!==null)return _0x32583d['frequency']='monthly',_0x32583d['monthlyMinute']=String(_0x4e40a2),_0x32583d['monthlyHour']=String(_0x10db19),_0x32583d['monthlyDay']=String(_0x34c080),_0x32583d;}const _0x53b531=_0xbddda9['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x53b531){const [,_0x2fd041,_0x4b3ed6,_0x25bd0d]=_0x53b531;_0x32583d['frequency']='recurring',_0x32583d['recurringInterval']=inferRecurringInterval(_0x2fd041,_0x4b3ed6),_0x32583d['recurringDayToken']=String(_0x25bd0d||'')['trim']()||'*';const _0x25b3ff=parseRecurringHourRange(_0x4b3ed6);return _0x32583d['recurringStartHour']=_0x25b3ff['start'],_0x32583d['recurringEndHour']=_0x25b3ff['end'],_0x32583d;}return _0x32583d['frequency']='custom',_0x32583d['customCron']=_0xbddda9,_0x32583d;}export function buildAutomationCronFromFormState(_0x5cd4f0={}){const _0x51a934=String(_0x5cd4f0['frequency']||'daily');if(_0x51a934==='custom')return String(_0x5cd4f0['customCron']||'')['trim']();if(_0x51a934==='daily'){const _0x43c69c=String(_0x5cd4f0['dailyHour']??'2'),_0x174f64=String(_0x5cd4f0['dailyMinute']??'0');return _0x174f64+'\x20'+_0x43c69c+'\x20*\x20*\x20*';}if(_0x51a934==='weekly'){const _0x23de80=String(_0x5cd4f0['weeklyDay']??'1'),_0x3876fd=String(_0x5cd4f0['weeklyHour']??'9'),_0x48a477=String(_0x5cd4f0['weeklyMinute']??'0');return _0x48a477+'\x20'+_0x3876fd+'\x20*\x20*\x20'+_0x23de80;}if(_0x51a934==='monthly'){const _0x1e2fe2=String(_0x5cd4f0['monthlyDay']??'1'),_0x19fbc7=String(_0x5cd4f0['monthlyHour']??'0'),_0x270780=String(_0x5cd4f0['monthlyMinute']??'0');return _0x270780+'\x20'+_0x19fbc7+'\x20'+_0x1e2fe2+'\x20*\x20*';}const _0xf535b8=String(_0x5cd4f0['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x48c47e='*/30',_0x59d046='*']=_0xf535b8['split'](/\s+/);let _0x3b650=_0x59d046;const _0x2c5195=String(_0x5cd4f0['recurringStartHour']??'')['trim'](),_0x39eb08=String(_0x5cd4f0['recurringEndHour']??'')['trim']();if(_0x2c5195!==''&&_0x39eb08!==''){const _0x49e00e=Number['parseInt'](_0x2c5195,0xa),_0x4c09c1=Number['parseInt'](_0x39eb08,0xa);if(Number['isInteger'](_0x49e00e)&&Number['isInteger'](_0x4c09c1)&&_0x49e00e<=_0x4c09c1){const _0x54fb66=_0x59d046['match'](/^\*\/(\d+)$/);_0x54fb66?_0x3b650=_0x49e00e+'-'+_0x4c09c1+'/'+_0x54fb66[0x1]:_0x3b650=_0x49e00e+'-'+_0x4c09c1;}}const _0x4fe4fd=String(_0x5cd4f0['recurringDayToken']??'*')['trim']()||'*';return _0x48c47e+'\x20'+_0x3b650+'\x20*\x20*\x20'+_0x4fe4fd;}
@@ -1 +1 @@
1
- export class CommentsWidget{constructor(_0x133620,_0x4e2c72={}){this['container']=_0x133620,this['options']={'taskId':_0x4e2c72['taskId']||null,'currentUserId':_0x4e2c72['currentUserId']||null,'compact':_0x4e2c72['compact']||![],'skipHeader':_0x4e2c72['skipHeader']||![],'onCommentsLoaded':_0x4e2c72['onCommentsLoaded']||null,'onCommentsChanged':_0x4e2c72['onCommentsChanged']||null,'enableAttachments':_0x4e2c72['enableAttachments']||![],'getAPI':_0x4e2c72['getAPI']||(()=>window['API'])},this['comments']=[],this['editor']=null,this['editingCommentId']=null,this['isLoading']=![],this['pendingAttachments']=[],this['existingAttachments']=[],this['init']();}['init'](){this['container']['innerHTML']='',this['container']['className']='comments-widget\x20'+(this['options']['compact']?'comments-widget-compact':''),this['createHeader'](),this['createCommentsList'](),this['createInputSection'](),this['options']['taskId']&&(this['loadComments'](),this['options']['enableAttachments']&&this['loadExistingAttachments']());}async['loadExistingAttachments'](){try{const _0x5c222d=this['options']['getAPI'](),_0xca73d5=await _0x5c222d['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0xca73d5['attachments']||[];}catch(_0x218d60){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x218d60),this['existingAttachments']=[];}}['createHeader'](){if(this['options']['skipHeader']){this['header']=null,this['isExpanded']=!![];return;}if(this['options']['compact']){this['header']=document['createElement']('div'),this['header']['className']='comments-header\x20comments-header-compact',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22comments-toggle-btn\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-toggle-icon\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-label\x22>Comments</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-badge\x22\x20id=\x22comments-count-badge\x22>0</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-chevron\x22\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']);const _0x40a695=this['header']['querySelector']('.comments-toggle-btn');_0x40a695['addEventListener']('click',()=>this['toggleExpanded']()),this['isExpanded']=![];}else this['header']=document['createElement']('div'),this['header']['className']='comments-header',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22comments-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2218\x22\x20height=\x2218\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Comments\x20<span\x20class=\x22comments-count\x22\x20id=\x22comments-count\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</h3>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']),this['isExpanded']=!![];}['createCommentsList'](){this['commentsListWrapper']=document['createElement']('div'),this['commentsListWrapper']['className']='comments-list-wrapper',this['options']['compact']&&!this['isExpanded']&&(this['commentsListWrapper']['hidden']=!![]),this['commentsList']=document['createElement']('div'),this['commentsList']['className']='comments-list',this['commentsListWrapper']['appendChild'](this['commentsList']),this['container']['appendChild'](this['commentsListWrapper']);}['createInputSection'](){this['inputSection']=document['createElement']('div'),this['inputSection']['className']='comments-input-section';this['options']['compact']&&!this['isExpanded']&&(this['inputSection']['hidden']=!![]);const _0x2a7e66=document['createElement']('div');_0x2a7e66['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x2a7e66['appendChild'](this['toolbar']);const _0x2cbbfa=document['createElement']('div');_0x2cbbfa['className']='comments-editor-placeholder',_0x2a7e66['appendChild'](_0x2cbbfa);const _0x323061=document['createElement']('div');_0x323061['className']='comments-input-actions',_0x323061['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-cancel-btn\x22\x20hidden>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-primary\x20btn-small\x20comments-submit-btn\x22\x20disabled>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-text\x22>Add\x20Comment</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-loading\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22spinner\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x223\x22\x20stroke-dasharray=\x2231.4\x2031.4\x22\x20stroke-linecap=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20',this['inputSection']['appendChild'](_0x2a7e66),this['inputSection']['appendChild'](_0x323061),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x2cbbfa),this['submitBtn']=_0x323061['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x323061['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x543c94){const _0x169d3c=document['createElement']('textarea');_0x169d3c['placeholder']='Add\x20a\x20comment...',_0x169d3c['className']='comments-textarea',_0x543c94['appendChild'](_0x169d3c);const _0x74af1d=window['MarkdownEditor'];if(!_0x74af1d){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x3677d1={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x1aa996=>{const _0xae3750=_0x1aa996&&_0x1aa996['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0xae3750;},'fetchUsers':async()=>{const _0x129c59=this['options']['getAPI']();return _0x129c59['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x3677d1['onAddAttachments']=_0x481dec=>{this['pendingAttachments']['push'](..._0x481dec),this['submitBtn']['disabled']=![];},_0x3677d1['resolveAttachmentUrl']=_0x2aa587=>{const _0x40facc=this['options']['getAPI']();return _0x40facc['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x2aa587);},_0x3677d1['isAttachmentNameTaken']=_0x2a261f=>{return this['pendingAttachments']['some'](_0x222584=>_0x222584['name']===_0x2a261f)||this['existingAttachments']['some'](_0x112a4c=>_0x112a4c['name']===_0x2a261f);});this['editor']=new _0x74af1d(_0x169d3c,_0x3677d1);const _0x29d7eb=this['editor']['editor'],_0x4c4cbb=this['editor']['toolbar'];_0x4c4cbb&&(_0x4c4cbb['classList']['add']('comments-toolbar-hidden'),_0x29d7eb['addEventListener']('focus',()=>{_0x4c4cbb['classList']['remove']('comments-toolbar-hidden');}),_0x29d7eb['addEventListener']('blur',_0x208f2b=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x4c4cbb['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x4c4cbb['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x4cb41b=this['header']['querySelector']('.comments-chevron');_0x4cb41b&&(_0x4cb41b['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x2dd267){this['options']['taskId']=_0x2dd267,this['comments']=[],this['renderComments'](),_0x2dd267&&this['loadComments']();}async['loadComments'](){if(!this['options']['taskId']||this['isLoading'])return;this['isLoading']=!![],this['commentsList']['innerHTML']='<div\x20class=\x22comments-loading\x22>Loading\x20comments...</div>';try{const _0x201e82=this['options']['getAPI'](),_0x1a7936=await _0x201e82['getComments'](this['options']['taskId']);this['comments']=_0x1a7936['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x3930dd){console['error']('Failed\x20to\x20load\x20comments:',_0x3930dd),this['commentsList']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-error\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Failed\x20to\x20load\x20comments\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x22\x20onclick=\x22this.parentElement.parentElement.closest(\x27.comments-widget\x27).__widget.loadComments()\x22>Retry</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';}finally{this['isLoading']=![];}}['renderComments'](){if(this['comments']['length']===0x0){this['commentsList']['innerHTML']='<div\x20class=\x22comments-empty\x22>No\x20comments\x20yet</div>';return;}this['commentsList']['innerHTML']='',this['comments']['forEach'](_0x2fe687=>{const _0x717c8c=this['createCommentElement'](_0x2fe687);this['commentsList']['appendChild'](_0x717c8c);});}['createCommentElement'](_0x11b3c9){const _0x25103e=document['createElement']('div');_0x25103e['className']='comment-item',_0x25103e['dataset']['commentId']=_0x11b3c9['id'];const _0x4c46d4=this['options']['currentUserId']&&_0x11b3c9['author']?.['userId']===this['options']['currentUserId'],_0x15da3b=this['formatDate'](_0x11b3c9['createdAt']),_0xed5e1d=_0x11b3c9['updatedAt']!==_0x11b3c9['createdAt'],_0x5008fa=this['resolveAttachmentUrls'](_0x11b3c9['content']);let _0x20189e=window['marked']?window['marked']['parse'](_0x5008fa):_0x5008fa;_0x20189e=this['renderMentions'](_0x20189e),_0x25103e['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-author\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-author-name\x22>'+this['escapeHtml'](_0x11b3c9['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x11b3c9['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x15da3b+(_0xed5e1d?'\x20(edited)':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x4c46d4?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-edit-btn\x22\x20title=\x22Edit\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M11\x204H4a2\x202\x200\x200\x200-2\x202v14a2\x202\x200\x200\x200\x202\x202h14a2\x202\x200\x200\x200\x202-2v-7\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M18.5\x202.5a2.121\x202.121\x200\x200\x201\x203\x203L12\x2015l-4\x201\x201-4\x209.5-9.5z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-delete-btn\x22\x20title=\x22Delete\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x223\x206\x205\x206\x2021\x206\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M19\x206v14a2\x202\x200\x200\x201-2\x202H7a2\x202\x200\x200\x201-2-2V6m3\x200V4a2\x202\x200\x200\x201\x202-2h4a2\x202\x200\x200\x201\x202\x202v2\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20':'')+'\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-content\x22>'+_0x20189e+'</div>\x0a\x20\x20\x20\x20';if(_0x4c46d4){const _0x1ea72b=_0x25103e['querySelector']('.comment-edit-btn'),_0x3ca8d6=_0x25103e['querySelector']('.comment-delete-btn');_0x1ea72b?.['addEventListener']('click',()=>this['startEdit'](_0x11b3c9)),_0x3ca8d6?.['addEventListener']('click',()=>this['deleteComment'](_0x11b3c9['id']));}return _0x25103e;}['formatDate'](_0x3c2aba){const _0x5e0571=new Date(_0x3c2aba),_0x29f22f=new Date(),_0xe3bd3f=_0x29f22f-_0x5e0571,_0x1fbaee=Math['floor'](_0xe3bd3f/0xea60),_0x512047=Math['floor'](_0xe3bd3f/0x36ee80),_0x5abcb7=Math['floor'](_0xe3bd3f/0x5265c00);if(_0x1fbaee<0x1)return'just\x20now';if(_0x1fbaee<0x3c)return _0x1fbaee+'m\x20ago';if(_0x512047<0x18)return _0x512047+'h\x20ago';if(_0x5abcb7<0x7)return _0x5abcb7+'d\x20ago';return _0x5e0571['toLocaleDateString']();}['escapeHtml'](_0x5f3cef){const _0x2a8d05=document['createElement']('div');return _0x2a8d05['textContent']=_0x5f3cef,_0x2a8d05['innerHTML'];}['resolveAttachmentUrls'](_0x8ce33d){if(!_0x8ce33d||!this['options']['taskId'])return _0x8ce33d;const _0x1e6d08=this['options']['getAPI'](),_0x11489e=_0x1e6d08['getBaseUrl']();let _0x5b2052=String(_0x8ce33d)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x34c997,_0x565987)=>{const _0xb9a713=String(_0x565987||'')['trim']();if(!_0xb9a713)return _0x34c997;let _0xe18eb9=_0xb9a713;try{_0xe18eb9=decodeURIComponent(_0xb9a713);}catch{}return']('+_0x11489e+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0xe18eb9)+')';});return _0x5b2052;}['renderMentions'](_0x3400b4){if(!_0x3400b4)return _0x3400b4;return String(_0x3400b4)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x55956f,_0x1f7c5,_0x8fc48d)=>{const _0x4fa293=this['escapeHtml'](_0x8fc48d),_0x364c7d=this['escapeHtml'](_0x1f7c5);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x364c7d+'\x22>@'+_0x4fa293+'</span>';});}['startEdit'](_0x45ef69){this['editingCommentId']=_0x45ef69['id'],this['editor']['setValue'](_0x45ef69['content']),this['editor']['focus'](),this['cancelBtn']['hidden']=![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Save',this['editor']['toolbar']&&this['editor']['toolbar']['classList']['remove']('comments-toolbar-hidden'),this['inputSection']['scrollIntoView']({'behavior':'smooth','block':'nearest'});}['cancelEdit'](){this['editingCommentId']=null,this['editor']['clear'](),this['cancelBtn']['hidden']=!![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Add\x20Comment',this['submitBtn']['disabled']=!![],this['editor']['toolbar']&&!this['editor']['getValue']()?.['trim']()&&this['editor']['toolbar']['classList']['add']('comments-toolbar-hidden');}async['handleSubmit'](){const _0x5a736e=this['editor']['getValue']()?.['trim']();if(!_0x5a736e&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x40af98=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x40af98['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x442f7b=>({'name':_0x442f7b['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x9f10ef=await _0x40af98['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x5a736e),_0x44eb80=this['comments']['findIndex'](_0x58afaa=>_0x58afaa['id']===this['editingCommentId']);_0x44eb80!==-0x1&&(this['comments'][_0x44eb80]=_0x9f10ef['comment']);}else{const _0x15a711=await _0x40af98['addComment'](this['options']['taskId'],_0x5a736e);this['comments']['push'](_0x15a711['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x266cb3){console['error']('Failed\x20to\x20save\x20comment:',_0x266cb3),alert('Failed\x20to\x20save\x20comment:\x20'+_0x266cb3['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x5cc41c){const _0x5e0d1b=await this['showDeleteConfirmModal']();if(!_0x5e0d1b)return;try{const _0x35c1b5=this['options']['getAPI']();await _0x35c1b5['deleteComment'](this['options']['taskId'],_0x5cc41c),this['comments']=this['comments']['filter'](_0x124827=>_0x124827['id']!==_0x5cc41c),this['renderComments'](),this['updateCount']();}catch(_0x11b9ef){console['error']('Failed\x20to\x20delete\x20comment:',_0x11b9ef),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x11b9ef['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x4069f7=>{const _0x57425e=document['createElement']('div');_0x57425e['className']='comments-confirm-modal',_0x57425e['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-dialog\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3>Delete\x20Comment</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon\x20comments-confirm-close\x22\x20title=\x22Close\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20this\x20comment?\x20This\x20action\x20cannot\x20be\x20undone.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-confirm-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-danger\x20btn-small\x20comments-confirm-delete\x22>Delete</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20',document['body']['appendChild'](_0x57425e);const _0x237fad=_0xe20a40=>{document['removeEventListener']('keydown',_0x5c426a),_0x57425e['remove'](),_0x4069f7(_0xe20a40);},_0x5c426a=_0x2e10e6=>{if(_0x2e10e6['key']==='Escape')_0x237fad(![]);};document['addEventListener']('keydown',_0x5c426a),_0x57425e['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x237fad(![])),_0x57425e['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x237fad(![])),_0x57425e['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x237fad(![])),_0x57425e['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x237fad(!![])),_0x57425e['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x112ae8){this['submitBtn']['disabled']=_0x112ae8,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x112ae8,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x112ae8;}['updateCount'](){const _0x3058bd=this['comments']['length'],_0xf846cc=this['container']['querySelector']('#comments-count-badge');_0xf846cc&&(_0xf846cc['textContent']=_0x3058bd,_0xf846cc['hidden']=_0x3058bd===0x0);const _0x998fcf=this['container']['querySelector']('#comments-count');_0x998fcf&&(_0x998fcf['textContent']=_0x3058bd>0x0?'('+_0x3058bd+')':''),this['options']['onCommentsChanged']&&this['options']['onCommentsChanged'](this['comments']);}['getCommentCount'](){return this['comments']['length'];}['destroy'](){this['editor']&&this['editor']['destroy'](),this['container']['innerHTML']='';}}CommentsWidget['prototype']['_attachToContainer']=function(){this['container']['__widget']=this;};typeof window!=='undefined'&&(window['CommentsWidget']=CommentsWidget);
1
+ export class CommentsWidget{constructor(_0x373f9a,_0x200fe5={}){this['container']=_0x373f9a,this['options']={'taskId':_0x200fe5['taskId']||null,'currentUserId':_0x200fe5['currentUserId']||null,'compact':_0x200fe5['compact']||![],'skipHeader':_0x200fe5['skipHeader']||![],'onCommentsLoaded':_0x200fe5['onCommentsLoaded']||null,'onCommentsChanged':_0x200fe5['onCommentsChanged']||null,'enableAttachments':_0x200fe5['enableAttachments']||![],'getAPI':_0x200fe5['getAPI']||(()=>window['API'])},this['comments']=[],this['editor']=null,this['editingCommentId']=null,this['isLoading']=![],this['pendingAttachments']=[],this['existingAttachments']=[],this['init']();}['init'](){this['container']['innerHTML']='',this['container']['className']='comments-widget\x20'+(this['options']['compact']?'comments-widget-compact':''),this['createHeader'](),this['createCommentsList'](),this['createInputSection'](),this['options']['taskId']&&(this['loadComments'](),this['options']['enableAttachments']&&this['loadExistingAttachments']());}async['loadExistingAttachments'](){try{const _0x48b3d1=this['options']['getAPI'](),_0x3b34ec=await _0x48b3d1['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x3b34ec['attachments']||[];}catch(_0x3d756c){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x3d756c),this['existingAttachments']=[];}}['createHeader'](){if(this['options']['skipHeader']){this['header']=null,this['isExpanded']=!![];return;}if(this['options']['compact']){this['header']=document['createElement']('div'),this['header']['className']='comments-header\x20comments-header-compact',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22comments-toggle-btn\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-toggle-icon\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-label\x22>Comments</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-badge\x22\x20id=\x22comments-count-badge\x22>0</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-chevron\x22\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']);const _0x55b1d9=this['header']['querySelector']('.comments-toggle-btn');_0x55b1d9['addEventListener']('click',()=>this['toggleExpanded']()),this['isExpanded']=![];}else this['header']=document['createElement']('div'),this['header']['className']='comments-header',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22comments-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2218\x22\x20height=\x2218\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Comments\x20<span\x20class=\x22comments-count\x22\x20id=\x22comments-count\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</h3>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']),this['isExpanded']=!![];}['createCommentsList'](){this['commentsListWrapper']=document['createElement']('div'),this['commentsListWrapper']['className']='comments-list-wrapper',this['options']['compact']&&!this['isExpanded']&&(this['commentsListWrapper']['hidden']=!![]),this['commentsList']=document['createElement']('div'),this['commentsList']['className']='comments-list',this['commentsListWrapper']['appendChild'](this['commentsList']),this['container']['appendChild'](this['commentsListWrapper']);}['createInputSection'](){this['inputSection']=document['createElement']('div'),this['inputSection']['className']='comments-input-section';this['options']['compact']&&!this['isExpanded']&&(this['inputSection']['hidden']=!![]);const _0x40c2cd=document['createElement']('div');_0x40c2cd['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x40c2cd['appendChild'](this['toolbar']);const _0x4e0b11=document['createElement']('div');_0x4e0b11['className']='comments-editor-placeholder',_0x40c2cd['appendChild'](_0x4e0b11);const _0x12848d=document['createElement']('div');_0x12848d['className']='comments-input-actions',_0x12848d['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-cancel-btn\x22\x20hidden>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-primary\x20btn-small\x20comments-submit-btn\x22\x20disabled>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-text\x22>Add\x20Comment</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-loading\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22spinner\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x223\x22\x20stroke-dasharray=\x2231.4\x2031.4\x22\x20stroke-linecap=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20',this['inputSection']['appendChild'](_0x40c2cd),this['inputSection']['appendChild'](_0x12848d),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x4e0b11),this['submitBtn']=_0x12848d['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x12848d['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0xdd9e1){const _0x4674c3=document['createElement']('textarea');_0x4674c3['placeholder']='Add\x20a\x20comment...',_0x4674c3['className']='comments-textarea',_0xdd9e1['appendChild'](_0x4674c3);const _0x47fa4c=window['MarkdownEditor'];if(!_0x47fa4c){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x399abd={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x322f2f=>{const _0x1e9fdf=_0x322f2f&&_0x322f2f['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x1e9fdf;},'fetchUsers':async()=>{const _0x3ea9ab=this['options']['getAPI']();return _0x3ea9ab['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x399abd['onAddAttachments']=_0x451b86=>{this['pendingAttachments']['push'](..._0x451b86),this['submitBtn']['disabled']=![];},_0x399abd['resolveAttachmentUrl']=_0x1be9d7=>{const _0x270800=this['options']['getAPI']();return _0x270800['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x1be9d7);},_0x399abd['isAttachmentNameTaken']=_0x383dec=>{return this['pendingAttachments']['some'](_0x20a02a=>_0x20a02a['name']===_0x383dec)||this['existingAttachments']['some'](_0x1384f5=>_0x1384f5['name']===_0x383dec);});this['editor']=new _0x47fa4c(_0x4674c3,_0x399abd);const _0x591fcd=this['editor']['editor'],_0x52e002=this['editor']['toolbar'];_0x52e002&&(_0x52e002['classList']['add']('comments-toolbar-hidden'),_0x591fcd['addEventListener']('focus',()=>{_0x52e002['classList']['remove']('comments-toolbar-hidden');}),_0x591fcd['addEventListener']('blur',_0x13b9fa=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x52e002['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x52e002['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x2ea7b2=this['header']['querySelector']('.comments-chevron');_0x2ea7b2&&(_0x2ea7b2['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x187db0){this['options']['taskId']=_0x187db0,this['comments']=[],this['renderComments'](),_0x187db0&&this['loadComments']();}async['loadComments'](){if(!this['options']['taskId']||this['isLoading'])return;this['isLoading']=!![],this['commentsList']['innerHTML']='<div\x20class=\x22comments-loading\x22>Loading\x20comments...</div>';try{const _0x347239=this['options']['getAPI'](),_0x3558ab=await _0x347239['getComments'](this['options']['taskId']);this['comments']=_0x3558ab['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x3a3d55){console['error']('Failed\x20to\x20load\x20comments:',_0x3a3d55),this['commentsList']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-error\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Failed\x20to\x20load\x20comments\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x22\x20onclick=\x22this.parentElement.parentElement.closest(\x27.comments-widget\x27).__widget.loadComments()\x22>Retry</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';}finally{this['isLoading']=![];}}['renderComments'](){if(this['comments']['length']===0x0){this['commentsList']['innerHTML']='<div\x20class=\x22comments-empty\x22>No\x20comments\x20yet</div>';return;}this['commentsList']['innerHTML']='',this['comments']['forEach'](_0x23d6b3=>{const _0xd8a847=this['createCommentElement'](_0x23d6b3);this['commentsList']['appendChild'](_0xd8a847);});}['createCommentElement'](_0x3c5d10){const _0x1d28e7=document['createElement']('div');_0x1d28e7['className']='comment-item',_0x1d28e7['dataset']['commentId']=_0x3c5d10['id'];const _0x32cd1b=this['options']['currentUserId']&&_0x3c5d10['author']?.['userId']===this['options']['currentUserId'],_0x192da4=this['formatDate'](_0x3c5d10['createdAt']),_0x2736e1=_0x3c5d10['updatedAt']!==_0x3c5d10['createdAt'],_0x50ae2c=this['resolveAttachmentUrls'](_0x3c5d10['content']);let _0x191f14=window['marked']?window['marked']['parse'](_0x50ae2c):_0x50ae2c;_0x191f14=this['renderMentions'](_0x191f14),_0x1d28e7['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-author\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-author-name\x22>'+this['escapeHtml'](_0x3c5d10['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x3c5d10['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x192da4+(_0x2736e1?'\x20(edited)':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x32cd1b?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-edit-btn\x22\x20title=\x22Edit\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M11\x204H4a2\x202\x200\x200\x200-2\x202v14a2\x202\x200\x200\x200\x202\x202h14a2\x202\x200\x200\x200\x202-2v-7\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M18.5\x202.5a2.121\x202.121\x200\x200\x201\x203\x203L12\x2015l-4\x201\x201-4\x209.5-9.5z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-delete-btn\x22\x20title=\x22Delete\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x223\x206\x205\x206\x2021\x206\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M19\x206v14a2\x202\x200\x200\x201-2\x202H7a2\x202\x200\x200\x201-2-2V6m3\x200V4a2\x202\x200\x200\x201\x202-2h4a2\x202\x200\x200\x201\x202\x202v2\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20':'')+'\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-content\x22>'+_0x191f14+'</div>\x0a\x20\x20\x20\x20';if(_0x32cd1b){const _0x62c906=_0x1d28e7['querySelector']('.comment-edit-btn'),_0x102b89=_0x1d28e7['querySelector']('.comment-delete-btn');_0x62c906?.['addEventListener']('click',()=>this['startEdit'](_0x3c5d10)),_0x102b89?.['addEventListener']('click',()=>this['deleteComment'](_0x3c5d10['id']));}return _0x1d28e7;}['formatDate'](_0x3254dd){const _0x98e461=new Date(_0x3254dd),_0x3da17d=new Date(),_0x36d7e4=_0x3da17d-_0x98e461,_0x33af7f=Math['floor'](_0x36d7e4/0xea60),_0x24bf4c=Math['floor'](_0x36d7e4/0x36ee80),_0x43059f=Math['floor'](_0x36d7e4/0x5265c00);if(_0x33af7f<0x1)return'just\x20now';if(_0x33af7f<0x3c)return _0x33af7f+'m\x20ago';if(_0x24bf4c<0x18)return _0x24bf4c+'h\x20ago';if(_0x43059f<0x7)return _0x43059f+'d\x20ago';return _0x98e461['toLocaleDateString']();}['escapeHtml'](_0x73f1fd){const _0x2d885e=document['createElement']('div');return _0x2d885e['textContent']=_0x73f1fd,_0x2d885e['innerHTML'];}['resolveAttachmentUrls'](_0xf3cadc){if(!_0xf3cadc||!this['options']['taskId'])return _0xf3cadc;const _0x355c2a=this['options']['getAPI'](),_0x85722f=_0x355c2a['getBaseUrl']();let _0x49ecc6=String(_0xf3cadc)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x254a6e,_0x7b6d08)=>{const _0x43ed70=String(_0x7b6d08||'')['trim']();if(!_0x43ed70)return _0x254a6e;let _0x406666=_0x43ed70;try{_0x406666=decodeURIComponent(_0x43ed70);}catch{}return']('+_0x85722f+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x406666)+')';});return _0x49ecc6;}['renderMentions'](_0x3ce880){if(!_0x3ce880)return _0x3ce880;return String(_0x3ce880)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x29119a,_0x6c9868,_0x501499)=>{const _0x33bd48=this['escapeHtml'](_0x501499),_0x10904b=this['escapeHtml'](_0x6c9868);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x10904b+'\x22>@'+_0x33bd48+'</span>';});}['startEdit'](_0x5dee88){this['editingCommentId']=_0x5dee88['id'],this['editor']['setValue'](_0x5dee88['content']),this['editor']['focus'](),this['cancelBtn']['hidden']=![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Save',this['editor']['toolbar']&&this['editor']['toolbar']['classList']['remove']('comments-toolbar-hidden'),this['inputSection']['scrollIntoView']({'behavior':'smooth','block':'nearest'});}['cancelEdit'](){this['editingCommentId']=null,this['editor']['clear'](),this['cancelBtn']['hidden']=!![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Add\x20Comment',this['submitBtn']['disabled']=!![],this['editor']['toolbar']&&!this['editor']['getValue']()?.['trim']()&&this['editor']['toolbar']['classList']['add']('comments-toolbar-hidden');}async['handleSubmit'](){const _0x26c32e=this['editor']['getValue']()?.['trim']();if(!_0x26c32e&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x5ca35=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x5ca35['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x4e0b46=>({'name':_0x4e0b46['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x1fe8f2=await _0x5ca35['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x26c32e),_0xac8ce6=this['comments']['findIndex'](_0x178c4b=>_0x178c4b['id']===this['editingCommentId']);_0xac8ce6!==-0x1&&(this['comments'][_0xac8ce6]=_0x1fe8f2['comment']);}else{const _0x48a04e=await _0x5ca35['addComment'](this['options']['taskId'],_0x26c32e);this['comments']['push'](_0x48a04e['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x2245c0){console['error']('Failed\x20to\x20save\x20comment:',_0x2245c0),alert('Failed\x20to\x20save\x20comment:\x20'+_0x2245c0['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0xe980ef){const _0x7189c2=await this['showDeleteConfirmModal']();if(!_0x7189c2)return;try{const _0x1a926d=this['options']['getAPI']();await _0x1a926d['deleteComment'](this['options']['taskId'],_0xe980ef),this['comments']=this['comments']['filter'](_0xf61a2c=>_0xf61a2c['id']!==_0xe980ef),this['renderComments'](),this['updateCount']();}catch(_0x59f827){console['error']('Failed\x20to\x20delete\x20comment:',_0x59f827),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x59f827['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x2ea71a=>{const _0x47ebaa=document['createElement']('div');_0x47ebaa['className']='comments-confirm-modal',_0x47ebaa['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-dialog\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3>Delete\x20Comment</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon\x20comments-confirm-close\x22\x20title=\x22Close\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20this\x20comment?\x20This\x20action\x20cannot\x20be\x20undone.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-confirm-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-danger\x20btn-small\x20comments-confirm-delete\x22>Delete</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20',document['body']['appendChild'](_0x47ebaa);const _0x49e217=_0x486891=>{document['removeEventListener']('keydown',_0x317eab),_0x47ebaa['remove'](),_0x2ea71a(_0x486891);},_0x317eab=_0x58ec3c=>{if(_0x58ec3c['key']==='Escape')_0x49e217(![]);};document['addEventListener']('keydown',_0x317eab),_0x47ebaa['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x49e217(![])),_0x47ebaa['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x49e217(![])),_0x47ebaa['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x49e217(![])),_0x47ebaa['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x49e217(!![])),_0x47ebaa['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x599afd){this['submitBtn']['disabled']=_0x599afd,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x599afd,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x599afd;}['updateCount'](){const _0x4fd924=this['comments']['length'],_0x381878=this['container']['querySelector']('#comments-count-badge');_0x381878&&(_0x381878['textContent']=_0x4fd924,_0x381878['hidden']=_0x4fd924===0x0);const _0x3f0535=this['container']['querySelector']('#comments-count');_0x3f0535&&(_0x3f0535['textContent']=_0x4fd924>0x0?'('+_0x4fd924+')':''),this['options']['onCommentsChanged']&&this['options']['onCommentsChanged'](this['comments']);}['getCommentCount'](){return this['comments']['length'];}['destroy'](){this['editor']&&this['editor']['destroy'](),this['container']['innerHTML']='';}}CommentsWidget['prototype']['_attachToContainer']=function(){this['container']['__widget']=this;};typeof window!=='undefined'&&(window['CommentsWidget']=CommentsWidget);
@@ -1 +1 @@
1
- import{Utils}from'./app.js';export function parsePatchContent(_0x29ffee){const _0xa7770c=[],_0x1fd58e=_0x29ffee['split']('\x0a');let _0x58d601=null,_0x3c65b9=null;for(const _0x1980a6 of _0x1fd58e){if(_0x1980a6['startsWith']('diff\x20--git')){_0x58d601&&_0x3c65b9&&_0x58d601['hunks']['push'](_0x3c65b9);_0x58d601&&_0xa7770c['push'](_0x58d601);const _0x75bb88=_0x1980a6['match'](/diff --git a\/(.+?) b\/(.+)/);_0x58d601={'oldPath':_0x75bb88?_0x75bb88[0x1]:'','newPath':_0x75bb88?_0x75bb88[0x2]:'','hunks':[],'isDeleted':![]},_0x3c65b9=null;}else{if(_0x1980a6['startsWith']('deleted\x20file\x20mode')&&_0x58d601)_0x58d601['isDeleted']=!![];else{if(_0x1980a6['startsWith']('@@'))_0x3c65b9&&_0x58d601&&_0x58d601['hunks']['push'](_0x3c65b9),_0x3c65b9={'header':_0x1980a6,'lines':[]};else _0x3c65b9&&_0x3c65b9['lines']['push'](_0x1980a6);}}}return _0x58d601&&_0x3c65b9&&_0x58d601['hunks']['push'](_0x3c65b9),_0x58d601&&_0xa7770c['push'](_0x58d601),_0xa7770c;}export function parseHunkHeader(_0x386583){const _0x3e7db7=_0x386583['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x3e7db7)return{'oldStart':parseInt(_0x3e7db7[0x1],0xa),'newStart':parseInt(_0x3e7db7[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x21800c,_0x28d80d){const _0x1f0dde=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x1f0dde&&_0x28d80d)try{const _0x91a41a=_0x1f0dde['getLanguage'](_0x28d80d)?_0x28d80d:null;if(_0x91a41a)return _0x1f0dde['highlight'](_0x21800c,{'language':_0x91a41a})['value'];}catch(_0x417704){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x417704);}return Utils['escapeHtml'](_0x21800c);}export function getFileLanguage(_0x50a7ae){const _0x549b6c=_0x50a7ae['split']('.')['pop']()['toLowerCase'](),_0x588f9e={'js':'javascript','jsx':'javascript','ts':'typescript','tsx':'typescript','py':'python','java':'java','c':'c','cpp':'cpp','cs':'csharp','go':'go','rs':'rust','php':'php','rb':'ruby','html':'xml','css':'css','json':'json','yml':'yaml','yaml':'yaml','md':'markdown','sh':'bash','bash':'bash'};return _0x588f9e[_0x549b6c]||null;}export function computeWordDiff(_0x56ebb9,_0x435e47){const _0x5848e4=_0x25c1e7=>{const _0x1aa5d6=[];let _0x112948='',_0x25d071=![];for(let _0x514257=0x0;_0x514257<_0x25c1e7['length'];_0x514257++){const _0x5e3caa=_0x25c1e7[_0x514257],_0x5677ba=/\s/['test'](_0x5e3caa);if(_0x112948==='')_0x112948=_0x5e3caa,_0x25d071=_0x5677ba;else _0x5677ba===_0x25d071?_0x112948+=_0x5e3caa:(_0x1aa5d6['push'](_0x112948),_0x112948=_0x5e3caa,_0x25d071=_0x5677ba);}return _0x112948&&_0x1aa5d6['push'](_0x112948),_0x1aa5d6;},_0x41ea15=_0x5848e4(_0x56ebb9),_0x1b3fdd=_0x5848e4(_0x435e47),_0x288867=_0x41ea15['length'],_0x40a418=_0x1b3fdd['length'],_0x58d1c4=Array(_0x288867+0x1)['fill'](null)['map'](()=>Array(_0x40a418+0x1)['fill'](0x0));for(let _0x5225fb=0x1;_0x5225fb<=_0x288867;_0x5225fb++){for(let _0x475caf=0x1;_0x475caf<=_0x40a418;_0x475caf++){_0x41ea15[_0x5225fb-0x1]===_0x1b3fdd[_0x475caf-0x1]?_0x58d1c4[_0x5225fb][_0x475caf]=_0x58d1c4[_0x5225fb-0x1][_0x475caf-0x1]+0x1:_0x58d1c4[_0x5225fb][_0x475caf]=Math['max'](_0x58d1c4[_0x5225fb-0x1][_0x475caf],_0x58d1c4[_0x5225fb][_0x475caf-0x1]);}}const _0x10c441={'old':[],'new':[]};let _0xce181e=_0x288867,_0x4c914b=_0x40a418;const _0x473889=[],_0x34eb0d=[];while(_0xce181e>0x0||_0x4c914b>0x0){if(_0xce181e>0x0&&_0x4c914b>0x0&&_0x41ea15[_0xce181e-0x1]===_0x1b3fdd[_0x4c914b-0x1])_0x473889['unshift']({'type':'equal','text':_0x41ea15[_0xce181e-0x1]}),_0x34eb0d['unshift']({'type':'equal','text':_0x1b3fdd[_0x4c914b-0x1]}),_0xce181e--,_0x4c914b--;else{if(_0x4c914b>0x0&&(_0xce181e===0x0||_0x58d1c4[_0xce181e][_0x4c914b-0x1]>=_0x58d1c4[_0xce181e-0x1][_0x4c914b]))_0x34eb0d['unshift']({'type':'insert','text':_0x1b3fdd[_0x4c914b-0x1]}),_0x4c914b--;else _0xce181e>0x0&&(_0x473889['unshift']({'type':'delete','text':_0x41ea15[_0xce181e-0x1]}),_0xce181e--);}}return _0x10c441['old']=_0x473889,_0x10c441['new']=_0x34eb0d,_0x10c441;}export function renderDiffLineWithWordHighlight(_0x12a6fe,_0x5975df,_0x27a5e8,_0x302f8e){if(!_0x5975df||_0x5975df['length']===0x0)return highlightDiffLine(_0x12a6fe,_0x302f8e);let _0x52108f='';const _0x17fd1a=_0x27a5e8==='add'?'diff-word-add':'diff-word-remove',_0xc70206=_0x27a5e8==='add'?'insert':'delete';for(const _0x1636a7 of _0x5975df){const _0x4888e3=Utils['escapeHtml'](_0x1636a7['text']);_0x1636a7['type']===_0xc70206?_0x52108f+='<span\x20class=\x22'+_0x17fd1a+'\x22>'+_0x4888e3+'</span>':_0x52108f+=_0x4888e3;}return _0x52108f;}export function calculateDiffStats(_0x414cf4){let _0xee9394=0x0,_0x3fd5d1=0x0,_0x34b24e=0x0;return _0x414cf4['forEach'](_0xbf823=>{let _0x5cc74a=0x0,_0x5ce843=0x0;_0xbf823['hunks']['forEach'](_0x3b63a2=>{_0x3b63a2['lines']['forEach'](_0x5f2f77=>{if(_0x5f2f77['startsWith']('+'))_0x5cc74a+=0x1;else{if(_0x5f2f77['startsWith']('-'))_0x5ce843+=0x1;}});}),(_0x5cc74a+_0x5ce843>0x0||_0xbf823['isDeleted'])&&(_0x34b24e+=0x1),_0xee9394+=_0x5cc74a,_0x3fd5d1+=_0x5ce843;}),{'additions':_0xee9394,'deletions':_0x3fd5d1,'files':_0x34b24e};}export function getFileStatus(_0x32fd00,_0x26b634,_0x1a45b2){if(_0x32fd00['isDeleted'])return'deleted';if(_0x26b634>0x0&&_0x1a45b2===0x0)return'added';return'modified';}export function safeBase64(_0x3e32fd){try{return btoa(unescape(encodeURIComponent(_0x3e32fd)));}catch(_0x4ac4de){return btoa(_0x3e32fd);}}export function getStorageKey(_0x229141,_0x3f9f9a){return _0x229141+'-'+safeBase64(_0x3f9f9a);}export function getCollapsedState(_0x487e1a,_0x2fb15f){const _0x94fe94=localStorage['getItem'](getStorageKey(_0x487e1a,_0x2fb15f));return _0x94fe94==='true';}export function renderUnifiedDiff(_0x2352fc,_0x52dd55){return _0x2352fc['map']((_0x96ae80,_0x567df6)=>{const _0x529a2e=_0x96ae80['newPath']||_0x96ae80['oldPath']||'unknown',_0x291573='diff-'+_0x52dd55+'-'+_0x567df6,_0x23572c=getFileLanguage(_0x529a2e),{additions:_0xb677f9,deletions:_0x232155}=calculateDiffStats([_0x96ae80]),_0x4a17f5=getCollapsedState(_0x52dd55,_0x529a2e),_0x38a65b=getFileStatus(_0x96ae80,_0xb677f9,_0x232155),_0x11afd8=_0x38a65b==='added'?'A':_0x38a65b==='deleted'?'D':'M',_0x5053b2=_0x96ae80['hunks']['map'](_0x2c6a79=>{const {oldStart:_0x208ce7,newStart:_0x57a278}=parseHunkHeader(_0x2c6a79['header']);let _0x33d15e=_0x208ce7,_0x25e3e6=_0x57a278;const _0x40bb17=_0x2c6a79['lines']['map'](_0x2ccad5=>({'line':_0x2ccad5,'type':_0x2ccad5['startsWith']('+')?'add':_0x2ccad5['startsWith']('-')?'remove':_0x2ccad5['startsWith']('\x5c')?'meta':'context'}));let _0x18af4a=0x0;while(_0x18af4a<_0x40bb17['length']){if(_0x40bb17[_0x18af4a]['type']==='remove'){let _0x4d7c97=_0x18af4a,_0x3e6b4a=_0x18af4a;while(_0x3e6b4a<_0x40bb17['length']&&_0x40bb17[_0x3e6b4a]['type']==='remove')_0x3e6b4a++;let _0x300373=_0x3e6b4a,_0x42173a=_0x300373;while(_0x42173a<_0x40bb17['length']&&_0x40bb17[_0x42173a]['type']==='add')_0x42173a++;const _0x436d1e=_0x3e6b4a-_0x4d7c97,_0x28fadf=_0x42173a-_0x300373,_0x2d9004=Math['min'](_0x436d1e,_0x28fadf);for(let _0x19f11a=0x0;_0x19f11a<_0x2d9004;_0x19f11a++){const _0x108cf4=_0x40bb17[_0x4d7c97+_0x19f11a]['line']['substring'](0x1),_0x4e396e=_0x40bb17[_0x300373+_0x19f11a]['line']['substring'](0x1),_0x211024=computeWordDiff(_0x108cf4,_0x4e396e);_0x40bb17[_0x4d7c97+_0x19f11a]['wordDiff']=_0x211024['old'],_0x40bb17[_0x300373+_0x19f11a]['wordDiff']=_0x211024['new'];}_0x18af4a=_0x42173a;}else _0x18af4a++;}const _0x55481a=_0x40bb17['map'](_0x317384=>{const _0x5b4fef=_0x317384['line'];if(_0x5b4fef['startsWith']('+')){const _0x2c9c40=_0x5b4fef['substring'](0x1),_0x5442dd=_0x317384['wordDiff']?renderDiffLineWithWordHighlight(_0x2c9c40,_0x317384['wordDiff'],'add',_0x23572c):highlightDiffLine(_0x2c9c40,_0x23572c),_0x4e4237='<div\x20class=\x22diff-line\x20diff-add\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x25e3e6+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x5442dd+'</span></div>';return _0x25e3e6+=0x1,_0x4e4237;}if(_0x5b4fef['startsWith']('-')){const _0x36b2fe=_0x5b4fef['substring'](0x1),_0x4cb37=_0x317384['wordDiff']?renderDiffLineWithWordHighlight(_0x36b2fe,_0x317384['wordDiff'],'remove',_0x23572c):highlightDiffLine(_0x36b2fe,_0x23572c),_0x1387bd='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x33d15e+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x4cb37+'</span></div>';return _0x33d15e+=0x1,_0x1387bd;}if(_0x5b4fef['startsWith']('\x5c'))return'<div\x20class=\x22diff-line\x20diff-meta\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22>'+Utils['escapeHtml'](_0x5b4fef)+'</span></div>';const _0x1f85a8=_0x5b4fef['startsWith']('\x20')?_0x5b4fef['substring'](0x1):_0x5b4fef,_0x52076c=highlightDiffLine(_0x1f85a8,_0x23572c),_0x47cd0b='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x33d15e+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x25e3e6+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x52076c+'</span></div>';return _0x33d15e+=0x1,_0x25e3e6+=0x1,_0x47cd0b;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x2c6a79['header'])+'</div>'+_0x55481a+'</div>';})['join'](''),_0x1ddef7=_0x5053b2||'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>No\x20textual\x20diff\x20available</div></div>';return'\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff\x22\x20id=\x22file-'+_0x291573+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x291573+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x529a2e)+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-status-badge\x20'+_0x38a65b+'\x22>'+_0x11afd8+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x529a2e)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-stat\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-add\x22>+'+_0xb677f9+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x232155+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22file-diff-toggle-btn\x22\x20data-diff-id=\x22'+_0x291573+'\x22\x20data-collapsed=\x22'+_0x4a17f5+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x4a17f5?'Expand':'Collapse')+'\x22></button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-content\x20'+(_0x4a17f5?'collapsed':'')+'\x22\x20id=\x22'+_0x291573+'\x22>'+_0x1ddef7+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
1
+ import{Utils}from'./app.js';export function parsePatchContent(_0x55c29c){const _0x29490f=[],_0x1b717b=_0x55c29c['split']('\x0a');let _0x5833f1=null,_0x5ac978=null;for(const _0x1a79be of _0x1b717b){if(_0x1a79be['startsWith']('diff\x20--git')){_0x5833f1&&_0x5ac978&&_0x5833f1['hunks']['push'](_0x5ac978);_0x5833f1&&_0x29490f['push'](_0x5833f1);const _0x129f09=_0x1a79be['match'](/diff --git a\/(.+?) b\/(.+)/);_0x5833f1={'oldPath':_0x129f09?_0x129f09[0x1]:'','newPath':_0x129f09?_0x129f09[0x2]:'','hunks':[],'isDeleted':![]},_0x5ac978=null;}else{if(_0x1a79be['startsWith']('deleted\x20file\x20mode')&&_0x5833f1)_0x5833f1['isDeleted']=!![];else{if(_0x1a79be['startsWith']('@@'))_0x5ac978&&_0x5833f1&&_0x5833f1['hunks']['push'](_0x5ac978),_0x5ac978={'header':_0x1a79be,'lines':[]};else _0x5ac978&&_0x5ac978['lines']['push'](_0x1a79be);}}}return _0x5833f1&&_0x5ac978&&_0x5833f1['hunks']['push'](_0x5ac978),_0x5833f1&&_0x29490f['push'](_0x5833f1),_0x29490f;}export function parseHunkHeader(_0x3eaaf3){const _0x1a7d93=_0x3eaaf3['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x1a7d93)return{'oldStart':parseInt(_0x1a7d93[0x1],0xa),'newStart':parseInt(_0x1a7d93[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0xb0d030,_0x805dd8){const _0x40005b=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x40005b&&_0x805dd8)try{const _0x5d936d=_0x40005b['getLanguage'](_0x805dd8)?_0x805dd8:null;if(_0x5d936d)return _0x40005b['highlight'](_0xb0d030,{'language':_0x5d936d})['value'];}catch(_0x4a6999){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x4a6999);}return Utils['escapeHtml'](_0xb0d030);}export function getFileLanguage(_0x1b36f9){const _0x5c50ed=_0x1b36f9['split']('.')['pop']()['toLowerCase'](),_0x36f101={'js':'javascript','jsx':'javascript','ts':'typescript','tsx':'typescript','py':'python','java':'java','c':'c','cpp':'cpp','cs':'csharp','go':'go','rs':'rust','php':'php','rb':'ruby','html':'xml','css':'css','json':'json','yml':'yaml','yaml':'yaml','md':'markdown','sh':'bash','bash':'bash'};return _0x36f101[_0x5c50ed]||null;}export function computeWordDiff(_0x11c4ef,_0x529bfe){const _0x4102ee=_0x540ea6=>{const _0x6a4523=[];let _0x1ac0ee='',_0x5e34dd=![];for(let _0x491f82=0x0;_0x491f82<_0x540ea6['length'];_0x491f82++){const _0x493c27=_0x540ea6[_0x491f82],_0x2cba5e=/\s/['test'](_0x493c27);if(_0x1ac0ee==='')_0x1ac0ee=_0x493c27,_0x5e34dd=_0x2cba5e;else _0x2cba5e===_0x5e34dd?_0x1ac0ee+=_0x493c27:(_0x6a4523['push'](_0x1ac0ee),_0x1ac0ee=_0x493c27,_0x5e34dd=_0x2cba5e);}return _0x1ac0ee&&_0x6a4523['push'](_0x1ac0ee),_0x6a4523;},_0x2c118b=_0x4102ee(_0x11c4ef),_0x541071=_0x4102ee(_0x529bfe),_0x39d66d=_0x2c118b['length'],_0x2bc026=_0x541071['length'],_0x57847f=Array(_0x39d66d+0x1)['fill'](null)['map'](()=>Array(_0x2bc026+0x1)['fill'](0x0));for(let _0x5bb093=0x1;_0x5bb093<=_0x39d66d;_0x5bb093++){for(let _0x2a895c=0x1;_0x2a895c<=_0x2bc026;_0x2a895c++){_0x2c118b[_0x5bb093-0x1]===_0x541071[_0x2a895c-0x1]?_0x57847f[_0x5bb093][_0x2a895c]=_0x57847f[_0x5bb093-0x1][_0x2a895c-0x1]+0x1:_0x57847f[_0x5bb093][_0x2a895c]=Math['max'](_0x57847f[_0x5bb093-0x1][_0x2a895c],_0x57847f[_0x5bb093][_0x2a895c-0x1]);}}const _0x33389e={'old':[],'new':[]};let _0x22e683=_0x39d66d,_0x2d72ff=_0x2bc026;const _0x5c03ae=[],_0x52ce6b=[];while(_0x22e683>0x0||_0x2d72ff>0x0){if(_0x22e683>0x0&&_0x2d72ff>0x0&&_0x2c118b[_0x22e683-0x1]===_0x541071[_0x2d72ff-0x1])_0x5c03ae['unshift']({'type':'equal','text':_0x2c118b[_0x22e683-0x1]}),_0x52ce6b['unshift']({'type':'equal','text':_0x541071[_0x2d72ff-0x1]}),_0x22e683--,_0x2d72ff--;else{if(_0x2d72ff>0x0&&(_0x22e683===0x0||_0x57847f[_0x22e683][_0x2d72ff-0x1]>=_0x57847f[_0x22e683-0x1][_0x2d72ff]))_0x52ce6b['unshift']({'type':'insert','text':_0x541071[_0x2d72ff-0x1]}),_0x2d72ff--;else _0x22e683>0x0&&(_0x5c03ae['unshift']({'type':'delete','text':_0x2c118b[_0x22e683-0x1]}),_0x22e683--);}}return _0x33389e['old']=_0x5c03ae,_0x33389e['new']=_0x52ce6b,_0x33389e;}export function renderDiffLineWithWordHighlight(_0x4e8aa8,_0x9b4fa7,_0x749c7c,_0x487f8d){if(!_0x9b4fa7||_0x9b4fa7['length']===0x0)return highlightDiffLine(_0x4e8aa8,_0x487f8d);let _0x4b6064='';const _0x23e9e4=_0x749c7c==='add'?'diff-word-add':'diff-word-remove',_0x59020a=_0x749c7c==='add'?'insert':'delete';for(const _0xf02975 of _0x9b4fa7){const _0x58f3f8=Utils['escapeHtml'](_0xf02975['text']);_0xf02975['type']===_0x59020a?_0x4b6064+='<span\x20class=\x22'+_0x23e9e4+'\x22>'+_0x58f3f8+'</span>':_0x4b6064+=_0x58f3f8;}return _0x4b6064;}export function calculateDiffStats(_0x37d04d){let _0x5b5c24=0x0,_0x26890d=0x0,_0x30740d=0x0;return _0x37d04d['forEach'](_0x206bd5=>{let _0x58b7fa=0x0,_0x1dbd3d=0x0;_0x206bd5['hunks']['forEach'](_0x894975=>{_0x894975['lines']['forEach'](_0x29a984=>{if(_0x29a984['startsWith']('+'))_0x58b7fa+=0x1;else{if(_0x29a984['startsWith']('-'))_0x1dbd3d+=0x1;}});}),(_0x58b7fa+_0x1dbd3d>0x0||_0x206bd5['isDeleted'])&&(_0x30740d+=0x1),_0x5b5c24+=_0x58b7fa,_0x26890d+=_0x1dbd3d;}),{'additions':_0x5b5c24,'deletions':_0x26890d,'files':_0x30740d};}export function getFileStatus(_0x4a292d,_0x241daa,_0x325dfe){if(_0x4a292d['isDeleted'])return'deleted';if(_0x241daa>0x0&&_0x325dfe===0x0)return'added';return'modified';}export function safeBase64(_0x421ff8){try{return btoa(unescape(encodeURIComponent(_0x421ff8)));}catch(_0x307a53){return btoa(_0x421ff8);}}export function getStorageKey(_0x4629af,_0x5c1d28){return _0x4629af+'-'+safeBase64(_0x5c1d28);}export function getCollapsedState(_0x26e8c7,_0x453c42){const _0x140619=localStorage['getItem'](getStorageKey(_0x26e8c7,_0x453c42));return _0x140619==='true';}export function renderUnifiedDiff(_0xe9b2b1,_0xfdb217){return _0xe9b2b1['map']((_0x443715,_0x2a2bc1)=>{const _0x55171e=_0x443715['newPath']||_0x443715['oldPath']||'unknown',_0x3632db='diff-'+_0xfdb217+'-'+_0x2a2bc1,_0x5c8dfa=getFileLanguage(_0x55171e),{additions:_0x27a9bd,deletions:_0x15a4f0}=calculateDiffStats([_0x443715]),_0x9b40ae=getCollapsedState(_0xfdb217,_0x55171e),_0x29a0f0=getFileStatus(_0x443715,_0x27a9bd,_0x15a4f0),_0x380e7e=_0x29a0f0==='added'?'A':_0x29a0f0==='deleted'?'D':'M',_0x2aaef0=_0x443715['hunks']['map'](_0x4d884b=>{const {oldStart:_0x11c65a,newStart:_0x252eca}=parseHunkHeader(_0x4d884b['header']);let _0x353ce9=_0x11c65a,_0x431898=_0x252eca;const _0x36f12e=_0x4d884b['lines']['map'](_0x100281=>({'line':_0x100281,'type':_0x100281['startsWith']('+')?'add':_0x100281['startsWith']('-')?'remove':_0x100281['startsWith']('\x5c')?'meta':'context'}));let _0x2e1fc8=0x0;while(_0x2e1fc8<_0x36f12e['length']){if(_0x36f12e[_0x2e1fc8]['type']==='remove'){let _0x5238c5=_0x2e1fc8,_0x4c79b3=_0x2e1fc8;while(_0x4c79b3<_0x36f12e['length']&&_0x36f12e[_0x4c79b3]['type']==='remove')_0x4c79b3++;let _0x221f32=_0x4c79b3,_0x4c786a=_0x221f32;while(_0x4c786a<_0x36f12e['length']&&_0x36f12e[_0x4c786a]['type']==='add')_0x4c786a++;const _0xeddec5=_0x4c79b3-_0x5238c5,_0x29aa4c=_0x4c786a-_0x221f32,_0x15130d=Math['min'](_0xeddec5,_0x29aa4c);for(let _0x16f40e=0x0;_0x16f40e<_0x15130d;_0x16f40e++){const _0xc61ff7=_0x36f12e[_0x5238c5+_0x16f40e]['line']['substring'](0x1),_0x5569ff=_0x36f12e[_0x221f32+_0x16f40e]['line']['substring'](0x1),_0x25e70e=computeWordDiff(_0xc61ff7,_0x5569ff);_0x36f12e[_0x5238c5+_0x16f40e]['wordDiff']=_0x25e70e['old'],_0x36f12e[_0x221f32+_0x16f40e]['wordDiff']=_0x25e70e['new'];}_0x2e1fc8=_0x4c786a;}else _0x2e1fc8++;}const _0xf6ac5d=_0x36f12e['map'](_0x5374fb=>{const _0x35ad80=_0x5374fb['line'];if(_0x35ad80['startsWith']('+')){const _0x2dff2d=_0x35ad80['substring'](0x1),_0x5533be=_0x5374fb['wordDiff']?renderDiffLineWithWordHighlight(_0x2dff2d,_0x5374fb['wordDiff'],'add',_0x5c8dfa):highlightDiffLine(_0x2dff2d,_0x5c8dfa),_0x443d99='<div\x20class=\x22diff-line\x20diff-add\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x431898+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x5533be+'</span></div>';return _0x431898+=0x1,_0x443d99;}if(_0x35ad80['startsWith']('-')){const _0x15fdb4=_0x35ad80['substring'](0x1),_0x1ab693=_0x5374fb['wordDiff']?renderDiffLineWithWordHighlight(_0x15fdb4,_0x5374fb['wordDiff'],'remove',_0x5c8dfa):highlightDiffLine(_0x15fdb4,_0x5c8dfa),_0xb7085a='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x353ce9+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x1ab693+'</span></div>';return _0x353ce9+=0x1,_0xb7085a;}if(_0x35ad80['startsWith']('\x5c'))return'<div\x20class=\x22diff-line\x20diff-meta\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22>'+Utils['escapeHtml'](_0x35ad80)+'</span></div>';const _0xd8f3da=_0x35ad80['startsWith']('\x20')?_0x35ad80['substring'](0x1):_0x35ad80,_0x438fd1=highlightDiffLine(_0xd8f3da,_0x5c8dfa),_0x2357b9='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x353ce9+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x431898+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x438fd1+'</span></div>';return _0x353ce9+=0x1,_0x431898+=0x1,_0x2357b9;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x4d884b['header'])+'</div>'+_0xf6ac5d+'</div>';})['join'](''),_0x14acda=_0x2aaef0||'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>No\x20textual\x20diff\x20available</div></div>';return'\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff\x22\x20id=\x22file-'+_0x3632db+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x3632db+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x55171e)+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-status-badge\x20'+_0x29a0f0+'\x22>'+_0x380e7e+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x55171e)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-stat\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-add\x22>+'+_0x27a9bd+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x15a4f0+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22file-diff-toggle-btn\x22\x20data-diff-id=\x22'+_0x3632db+'\x22\x20data-collapsed=\x22'+_0x9b40ae+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x9b40ae?'Expand':'Collapse')+'\x22></button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-content\x20'+(_0x9b40ae?'collapsed':'')+'\x22\x20id=\x22'+_0x3632db+'\x22>'+_0x14acda+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}