@canonry/canonry 7.125.6 → 7.127.0

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 (153) hide show
  1. package/README.md +3 -3
  2. package/assets/agent-workspace/skills/aero/references/getting-started.md +2 -3
  3. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +7 -2
  4. package/assets/agent-workspace/skills/canonry/references/getting-started.md +2 -3
  5. package/assets/agent-workspace/skills/canonry/references/indexing.md +4 -1
  6. package/assets/assets/{AccessControls-CUwUDBp8.js → AccessControls-2bimiIhw.js} +2 -2
  7. package/assets/assets/{AgentSetupPage-vbEPb6yX.js → AgentSetupPage-BGAU8xzj.js} +4 -4
  8. package/assets/assets/{AuditHistoryPanel-CutYGRGi.js → AuditHistoryPanel-Br4LNvcM.js} +1 -1
  9. package/assets/assets/{BacklinksPage-Cjs8Pzjw.js → BacklinksPage-BBh43gcY.js} +1 -1
  10. package/assets/assets/{ChartPrimitives-Bb1-9BLv.js → ChartPrimitives-ChO_4pZz.js} +1 -1
  11. package/assets/assets/{HistoryPage-CMBlL0Ms.js → HistoryPage-okXPylcp.js} +1 -1
  12. package/assets/assets/{MeasurementPropertyPage-C9cLyWJo.js → MeasurementPropertyPage-C2otbn5d.js} +3 -3
  13. package/assets/assets/ProjectPage-DGrfKxfG.js +15 -0
  14. package/assets/assets/{RunsPage-QN5bBEe4.js → RunsPage-4u1VBVOW.js} +1 -1
  15. package/assets/assets/{ServerTrafficSection-BU9Kj9MT.js → ServerTrafficSection-Bl0HTTwh.js} +3 -3
  16. package/assets/assets/{SettingsPage-C2wYKFF9.js → SettingsPage-C05qxsby.js} +1 -1
  17. package/assets/assets/ToneBadge-BE2H103M.js +60 -0
  18. package/assets/assets/{TrafficPage-DEQ6eJUy.js → TrafficPage-Bd3ey_0C.js} +1 -1
  19. package/assets/assets/{TrafficSourceDetailPage-B7sygHig.js → TrafficSourceDetailPage-B6Gi-qBP.js} +1 -1
  20. package/assets/assets/{account-context-BlFU3aZm.js → account-context-y7mzU3Ko.js} +1 -1
  21. package/assets/assets/{agent-trust-copy-Dmj9Xp7o.js → agent-trust-copy-CHQ9IAa3.js} +1 -1
  22. package/assets/assets/{card-B6QRK3vg.js → card-BmJz19vt.js} +1 -1
  23. package/assets/assets/index-s7MwkxGB.js +43 -0
  24. package/assets/assets/{preload-helper-okiXXeW4.js → preload-helper-BLaGg0Jn.js} +1 -1
  25. package/assets/assets/{query-client-Dn5u8o4X.js → query-client-DmQlVZMA.js} +1 -1
  26. package/assets/assets/{react-query-CZrEo0vf.js → react-query-BnTbVX2a.js} +1 -1
  27. package/assets/assets/{react-sigma_core.esm.min-D5s2grLh.js → react-sigma_core.esm.min-DNPGgfTG.js} +1 -1
  28. package/assets/assets/{server-traffic-Coma9CV_.js → server-traffic-ALYWW6k0.js} +1 -1
  29. package/assets/assets/{service-LmTWkeKI.js → service-BKTlKu2x.js} +1 -1
  30. package/assets/index.html +9 -9
  31. package/dist/activity-2KFFWLYN.js +13 -0
  32. package/dist/{ads-6ZCVMSJ2.js → ads-PB3VFUPV.js} +4 -4
  33. package/dist/{agent-ZZJO7ET6.js → agent-VOL7SOEQ.js} +8 -8
  34. package/dist/{agent-ask-CPRHVULM.js → agent-ask-F46ERE3W.js} +4 -4
  35. package/dist/{agent-conversations-NIWKSUC2.js → agent-conversations-T5Q43627.js} +4 -4
  36. package/dist/{agent-journeys-SHNRNV5E.js → agent-journeys-GVEVJ5J2.js} +4 -4
  37. package/dist/{agent-memory-4IGCNFR5.js → agent-memory-XXN7QXNM.js} +4 -4
  38. package/dist/{agent-providers-3Q7NQS7Y.js → agent-providers-U6XIM5JI.js} +4 -4
  39. package/dist/{agent-transcript-M3NYHNNV.js → agent-transcript-ONEA6JBO.js} +4 -4
  40. package/dist/{analytics-UHBUOG4T.js → analytics-XWVTM57N.js} +4 -4
  41. package/dist/{answerability-IRXQDOBX.js → answerability-GNYSELX5.js} +4 -4
  42. package/dist/{apply-3HP75CA2.js → apply-WXW4KWUK.js} +4 -4
  43. package/dist/{backfill-TQWXGQPQ.js → backfill-SWDR5M4O.js} +11 -11
  44. package/dist/{backlinks-O5IYHDAY.js → backlinks-5LIBLUEG.js} +4 -4
  45. package/dist/{bing-2MTKNQB2.js → bing-4U4ODKGV.js} +4 -4
  46. package/dist/{bootstrap-O7FRHURI.js → bootstrap-FY72AHVW.js} +11 -11
  47. package/dist/{cdp-BTXUJFAN.js → cdp-H5WMBYIF.js} +10 -9
  48. package/dist/{chunk-46YT33GB.js → chunk-2IU7GJCX.js} +4 -4
  49. package/dist/{chunk-KIO37ZVB.js → chunk-2PLJ4QG5.js} +4 -4
  50. package/dist/{chunk-QQFTJVHT.js → chunk-2T4OGJWP.js} +1 -1
  51. package/dist/{chunk-BY2RGFQH.js → chunk-2VDYFOKB.js} +8 -8
  52. package/dist/{chunk-B3F5BMXL.js → chunk-3GE4Z4J3.js} +5 -5
  53. package/dist/{chunk-SYRMAQVM.js → chunk-3ZNDJ4OM.js} +5 -5
  54. package/dist/{chunk-YYBYRAMI.js → chunk-425BZPKK.js} +5 -5
  55. package/dist/{chunk-VTOST3CL.js → chunk-5WDU7ZML.js} +7 -7
  56. package/dist/{chunk-OL6HAMWW.js → chunk-A36PZKKS.js} +2 -2
  57. package/dist/{chunk-ML7G6NS3.js → chunk-BAO3PHQP.js} +2 -2
  58. package/dist/{chunk-XQUGLXAN.js → chunk-DY2Q3VIM.js} +2 -2
  59. package/dist/{chunk-VD6Q7ZUX.js → chunk-FIF4N7DP.js} +1 -1
  60. package/dist/{chunk-VP3F4BOG.js → chunk-FMS7CIEK.js} +2 -2
  61. package/dist/{chunk-DI5EEYDP.js → chunk-G2NIO2J3.js} +2 -2
  62. package/dist/{chunk-U2LYHQHF.js → chunk-GCBFSIKI.js} +1 -1
  63. package/dist/{chunk-3OZ5WKRH.js → chunk-GKQ4CYUM.js} +3384 -3286
  64. package/dist/{chunk-OH3HQENA.js → chunk-GPPTW3HU.js} +4 -4
  65. package/dist/{chunk-3FQMXAES.js → chunk-GRX2DION.js} +4 -4
  66. package/dist/{chunk-AVKRYSYT.js → chunk-GTX7C5Y5.js} +11 -9
  67. package/dist/{chunk-RSZ3L5FJ.js → chunk-HQEH4YRO.js} +1 -1
  68. package/dist/{chunk-PAP62URW.js → chunk-HS2HYFPX.js} +81 -6
  69. package/dist/{chunk-VUL3BACZ.js → chunk-IIL4NKRU.js} +4 -4
  70. package/dist/{chunk-TOKRH24Q.js → chunk-JRWHQVA6.js} +191 -66
  71. package/dist/{chunk-QCEXADUT.js → chunk-K3YHPTKL.js} +2 -2
  72. package/dist/{chunk-A75GIIWP.js → chunk-LWRPSAVC.js} +1 -1
  73. package/dist/{chunk-JTIFRAGE.js → chunk-M4IAXLBT.js} +3 -3
  74. package/dist/{chunk-F2TGOWIW.js → chunk-MG4COK23.js} +2 -2
  75. package/dist/{chunk-3G5FQLF7.js → chunk-NEJEHRPT.js} +2 -2
  76. package/dist/{chunk-PDSB34VB.js → chunk-OKIAF573.js} +1 -1
  77. package/dist/{chunk-SFJCLIKB.js → chunk-PUEARV37.js} +425 -372
  78. package/dist/{chunk-C5EK4TJ5.js → chunk-PWXLKW2F.js} +3 -3
  79. package/dist/{chunk-CD3XPOHP.js → chunk-QWD3ABAW.js} +1 -1
  80. package/dist/{chunk-WAVN2EIK.js → chunk-QXRI6DRE.js} +216 -72
  81. package/dist/{chunk-K7BROEPL.js → chunk-RDCEFEXP.js} +3 -3
  82. package/dist/{chunk-WVNVKP4F.js → chunk-RMLGMB5B.js} +1 -1
  83. package/dist/{chunk-QRA6GFXX.js → chunk-RPAWPX7B.js} +1 -1
  84. package/dist/{chunk-35NITZHC.js → chunk-X6DD3OIR.js} +3 -2
  85. package/dist/{chunk-2MDEKCDU.js → chunk-XONND7NT.js} +3 -3
  86. package/dist/{chunk-MB7VQPWX.js → chunk-ZKIEOEUZ.js} +2 -2
  87. package/dist/{citations-5JSLIPNI.js → citations-622BWQTR.js} +5 -5
  88. package/dist/{cli-catalog-U3DKCQC5.js → cli-catalog-ACK3FVAX.js} +4 -4
  89. package/dist/cli-commands-UH3DRBPC.js +18 -0
  90. package/dist/cli.js +14 -14
  91. package/dist/{competitor-AMA7WPH4.js → competitor-QYZIWXGC.js} +4 -4
  92. package/dist/{content-7HZ23UXM.js → content-PJASAMIV.js} +4 -4
  93. package/dist/{dashboard-XFLFU4JL.js → dashboard-FQOS3J4B.js} +7 -7
  94. package/dist/{demo-CPO4IUJL.js → demo-ZGGVSKN4.js} +3 -3
  95. package/dist/{demo-server-KBU3NECG.js → demo-server-TLXLEPOI.js} +13 -13
  96. package/dist/{discover-TJXKEHVP.js → discover-ZLDSXDRI.js} +5 -5
  97. package/dist/{discover-eval-MUS46MSL.js → discover-eval-7F5Q3RXS.js} +4 -4
  98. package/dist/{doctor-5CIMYYUA.js → doctor-3KSQZDZ3.js} +4 -4
  99. package/dist/{evidence-MY4Z6VNC.js → evidence-BJZIRJ4U.js} +4 -4
  100. package/dist/{export-cmd-VBULRDSJ.js → export-cmd-BYPGV4IU.js} +4 -4
  101. package/dist/{ga-ORQCNNJ6.js → ga-A3BAZCYH.js} +4 -4
  102. package/dist/{gbp-LWVNCHMT.js → gbp-U6VCRAFN.js} +4 -4
  103. package/dist/{google-U6LQOAQ3.js → google-UNQZBUGS.js} +5 -5
  104. package/dist/{google-marketing-6RA4AOMN.js → google-marketing-QSIRQAVH.js} +2 -2
  105. package/dist/{health-cmd-LQGRFFT3.js → health-cmd-Z5KTTJQU.js} +5 -5
  106. package/dist/{history-LYJAA6QI.js → history-IIGUZMOM.js} +4 -4
  107. package/dist/index.d.ts +44 -24
  108. package/dist/index.js +27 -27
  109. package/dist/{init-RWJPBYTI.js → init-HZANRCMW.js} +13 -13
  110. package/dist/{insights-OP7ZJLC5.js → insights-UQ234W6T.js} +4 -4
  111. package/dist/intelligence-service-S3GTOTGQ.js +15 -0
  112. package/dist/{journeys-ENN25PA5.js → journeys-2EZIRL7K.js} +4 -4
  113. package/dist/{keys-FVPHQIOM.js → keys-NIAANGXE.js} +4 -4
  114. package/dist/{keyword-ELCUWNQC.js → keyword-LHHNG3GL.js} +4 -4
  115. package/dist/{logs-SVKY3HXZ.js → logs-UFOOIKTC.js} +4 -4
  116. package/dist/{mcp-W7AMWAST.js → mcp-AZYUFL5V.js} +5 -5
  117. package/dist/mcp.js +22 -16
  118. package/dist/{measurement-plan-F3ZZ4MCG.js → measurement-plan-H2HIHJ3D.js} +6 -6
  119. package/dist/{notify-U253YRTY.js → notify-TIE2ZJ26.js} +4 -4
  120. package/dist/{organic-evidence-4GI6HG56.js → organic-evidence-BX5MGZTK.js} +4 -4
  121. package/dist/{overview-TPZI3OKL.js → overview-MGQE43GU.js} +7 -7
  122. package/dist/{project-BZPMAZAH.js → project-2JL4ZW52.js} +4 -4
  123. package/dist/{project-setup-2NSUAFXD.js → project-setup-CXOVBRLZ.js} +9 -6
  124. package/dist/{query-4AL5P6DI.js → query-Q5BF63QF.js} +4 -4
  125. package/dist/{research-3WAJ6RWX.js → research-RQBZ57W5.js} +4 -4
  126. package/dist/{results-export-VHA6BPC2.js → results-export-TVCBJNJN.js} +4 -4
  127. package/dist/{run-3EEHYWIA.js → run-L6WG5WP2.js} +6 -6
  128. package/dist/{schedule-7CXVWV75.js → schedule-3HQMG3AM.js} +4 -4
  129. package/dist/{search-EPPXH2TK.js → search-ZLQE4J66.js} +4 -4
  130. package/dist/{serve-LGXPVEMJ.js → serve-E4N2XMIC.js} +28 -28
  131. package/dist/{session-IGKCPAMH.js → session-IJLUYO4T.js} +15 -15
  132. package/dist/{settings-UKIPQVIX.js → settings-T3U7TQOF.js} +4 -4
  133. package/dist/{sitemaps-L2OOCCHX.js → sitemaps-UZPLGN4W.js} +4 -4
  134. package/dist/{skills-VJSJNLWC.js → skills-P4WSSFPF.js} +3 -3
  135. package/dist/{snapshot-SYVUVM7F.js → snapshot-ROJPISJE.js} +4 -4
  136. package/dist/{src-VYDX5USM.js → src-ZYWTGILQ.js} +2 -2
  137. package/dist/{status-ALZWCQ7W.js → status-43XNR3NS.js} +6 -6
  138. package/dist/{support-XRKYBNND.js → support-I7E4I3GG.js} +2 -2
  139. package/dist/{technical-aeo-JNYI6Q7L.js → technical-aeo-D4F2R6M3.js} +88 -31
  140. package/dist/{telemetry-ZENJ5BDE.js → telemetry-5DMVDDZI.js} +5 -5
  141. package/dist/{tools-LMDXNPS7.js → tools-M534GJMS.js} +12 -12
  142. package/dist/{traffic-JXNISEMN.js → traffic-R2UA27AZ.js} +6 -6
  143. package/dist/{trends-3755UQT3.js → trends-BXOZIWIE.js} +4 -4
  144. package/dist/{users-7XCGU7BU.js → users-X6WJV7VJ.js} +4 -4
  145. package/dist/{visibility-stats-QJBO7HFN.js → visibility-stats-MCNUXUCL.js} +5 -5
  146. package/dist/{wordpress-VC6UN5UK.js → wordpress-AMGUJUZX.js} +4 -4
  147. package/package.json +1 -1
  148. package/assets/assets/ProjectPage-CP1-aTy-.js +0 -15
  149. package/assets/assets/ToneBadge-DXhSJm1L.js +0 -60
  150. package/assets/assets/index-MwrSHGLh.js +0 -43
  151. package/dist/activity-KCUWSNHF.js +0 -13
  152. package/dist/cli-commands-6OR7VA33.js +0 -18
  153. package/dist/intelligence-service-74VHHBUU.js +0 -15
package/README.md CHANGED
@@ -175,9 +175,9 @@ Pick one path and stay on it. Use connected Canonry tools (plugin or MCP) only i
175
175
  1. Ask for my public domain, country, and language. Do not create or scan anything yet. Country and language are only applied when a project is created, so if you reuse an existing project, report its country and language instead of changing them.
176
176
  2. Shell path only: confirm `cnry` is on PATH, then run `cnry --version`. If Canonry is missing, propose `npm install -g @canonry/canonry` and wait for approval. Then run `cnry doctor --format json`, which is the command that says whether config, database, and server are in place. `cnry --version` does not read config and succeeds on a completely unconfigured install, so it cannot answer this. If config is missing, run `cnry bootstrap` yourself: it is not interactive, takes about a second, and is safe to rerun. Do not hand it to me and wait. The interactive command is `cnry init`, which is optional provider and OAuth setup that Agent Readiness does not need. Bootstrap prints an API key, so do not repeat its output back to me, and never ask me to paste passwords, API keys, OAuth credentials, or command output.
177
177
  3. Confirm the API is reachable. `cnry doctor --format json` reports it, and any project read exits non-zero with `CONNECTION_ERROR` when it is not. If it is unreachable, propose `cnry start` and wait for approval. Use `cnry start`, which is the background daemon, and not `cnry serve`, which runs in the foreground and will block you until I stop it, even though some error messages suggest it. Stop anything you started with `cnry stop`.
178
- 4. List projects with the connected project tool or `cnry project list --format json`, and reuse one whose domain matches. Confirm the proposed name is not already assigned to a different domain. To find out whether a project has already been scanned, run `cnry agent-readiness score <project> --format json` with no `--run-id`, which reports the latest run. Read the `hasData` field, not the score: this command exits 0 and reports `aggregateScore: 0` for a project that has never been scanned, so reading the score alone would have you tell me my site scored zero. If `hasData` is true and `runStatus` is `completed` or `partial`, read that scan instead of starting a new one. If no project matches, show the exact create operation and wait for approval.
179
- 5. Propose a bounded Agent Readiness audit scan: `--max-pages 100` for a first look, plus whether dead-link checking is on (it is off unless you pass `--check-dead-links`). Show the connected operation or the exact `cnry agent-readiness run <project> --max-pages 100 --wait --format json` command with the project name filled in, and wait for separate approval before scanning. `--wait` polls for up to 15 minutes and returns only the run id and status. If the status it returns is still `queued` or `running`, the scan has not finished: do not rerun it or report results, poll `cnry agent-readiness progress <project> --run-id <run-id> --format json` until it is terminal. If `--wait` outruns your own tool timeout first, recover the run id with `cnry runs <project> --kind site-audit --limit 1 --format json`, which returns the newest scan whatever its status, and poll the same way.
180
- 6. When the run is `completed` or `partial`, read `cnry agent-readiness overview <project> --run-id <run-id> --format json` first. It is the only one of these commands that carries `termination` and `complete`; the score and page-scores commands do not. Then read `cnry agent-readiness score <project> --run-id <run-id> --format json` and `cnry agent-readiness page-scores <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl`. Tell me the termination reason in plain words and whether the scan covered the whole site or stopped at a page, link, depth, or time limit. A `partial` run scored the pages it reached and not my site, so never present it as a full-site result. If it stopped early, the fix depends on the reason, so say which: a page or depth limit needs a larger budget, a time limit needs a smaller scan (a lower `--max-pages` or `--max-depth`). If the run failed or was cancelled, inspect the run error and stop.
178
+ 4. List projects with the connected project tool or `cnry project list --format json`, and reuse one whose domain matches. Confirm the proposed name is not already assigned to a different domain. If no project matches, show the exact create operation and wait for approval. For the selected project, look up its newest scan with `cnry runs <project> --kind site-audit --limit 1 --format json`. Use that run id for progress, score and findings. For a queued or running scan, follow its progress until it finishes. For a completed or partial scan, check `hasData` and `pagesAudited` in its scorecard. If it scored pages, use its results in step 6. If the scan failed, was cancelled, or finished without scoring a page, report its status and any recorded reason, then propose a fresh scan in step 5. If no scan exists, go straight to step 5.
179
+ 5. Propose a bounded Agent Readiness audit scan: `--max-pages 100` for a first look, plus whether dead-link checking is on (it is off unless you pass `--check-dead-links`). Show the connected operation or the exact `cnry agent-readiness run <project> --max-pages 100 --wait --format json` command with the project name filled in, and wait for separate approval before scanning. `--wait` polls for up to 15 minutes and returns the run id, status and any recorded diagnostic. If the status it returns is still `queued` or `running`, the scan has not finished: do not rerun it or report results, poll `cnry agent-readiness progress <project> --run-id <run-id> --format json` until it is terminal. If `--wait` outruns your own tool timeout first, recover the run id with `cnry runs <project> --kind site-audit --limit 1 --format json`, which returns the newest scan whatever its status, and poll the same way.
180
+ 6. When the run is `completed` or `partial`, read `cnry agent-readiness overview <project> --run-id <run-id> --format json` first. Read `termination` and `complete` from that overview. Then read `cnry agent-readiness score <project> --run-id <run-id> --format json` and `cnry agent-readiness page-scores <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl`. Read `cnry agent-readiness issues <project> --run-id <run-id> --limit 3 --format json` and summarize the findings, affected pages and any recorded fix. Mention any sites that the scan could not reach. Tell me the termination reason in plain words and whether the scan covered the whole site or stopped at a page, link, depth, or time limit. A `partial` run may have scored fewer pages or none. Report how many were scored and never present it as a full-site result. If it stopped early, the fix depends on the reason, so say which: a page or depth limit needs a larger budget, a time limit needs a smaller scan (a lower `--max-pages` or `--max-depth`). If the scan failed or scored no pages, tell me the recorded reason and next step from `cnry agent-readiness progress <project> --run-id <run-id> --format json`. If there is no recorded cause, say so. Report cancellations separately.
181
181
  7. Summarize only completed evidence, then propose AI Visibility setup. Ask before you add queries, connect providers, start a provider-backed or quota-consuming run, edit files, or publish.
182
182
  ```
183
183
 
@@ -110,9 +110,8 @@ to the project dashboard.
110
110
  - Connect Search Console for every project. Skipping it should be the user's
111
111
  stated choice, since the plan then cannot see real searches.
112
112
  - A short first Search Console sync can start on an unusual week. Before
113
- reading any trend, propose a longer backfill, which the operator or a CLI
114
- host runs: `cnry google sync <project> --days 180 --wait`. No MCP tool does
115
- this.
113
+ reading any trend, propose a longer backfill: `canonry_gsc_sync` with
114
+ `days: 180` (CLI: `cnry google sync <project> --days 180 --wait`).
116
115
  - Check what each source measures. Search Console should list the sitemap
117
116
  index, not one sub-sitemap (`canonry_sitemaps`). A GA4 sync can complete
118
117
  with zero rows when the tag is missing, so confirm recent days hold visits.
@@ -1008,8 +1008,13 @@ cnry google submit-sitemap <project> --all # prefer sitemap indexes
1008
1008
  cnry google submit-sitemap <project> --all-files # include top-level files and index children (batched by 50)
1009
1009
  cnry google discover-sitemaps <project> --wait # auto-discover and inspect
1010
1010
 
1011
- cnry google sync <project> # sync GSC data
1011
+ cnry google sync <project> # sync GSC data; MCP: canonry_gsc_sync (gsc toolkit)
1012
1012
  cnry google sync <project> --days 30 --full --wait # full sync with wait
1013
+ # `canonry_gsc_sync` takes `days` (1-180) or `full: true` and waits like --wait.
1014
+ # It returns the finished run; `syncSummary` holds what the sync stored:
1015
+ # startDate, endDate, days, searchRows, dailyTotals, queryTotals, sitemaps
1016
+ # (null when the list could not be read), dataThroughDate. The same summary is
1017
+ # on the run (`cnry run show <id> --format json`).
1013
1018
  # `--full` re-fetches 480 days (GSC's 16-month retention ceiling) and is also the
1014
1019
  # BACKFILL path: it repopulates the accurate per-query totals (`dimensions:
1015
1020
  # ['date','query']`, no `page` fan-out) and the property daily totals for the
@@ -1890,7 +1895,7 @@ cnry cdp targets # list supported browser targets
1890
1895
  cnry cdp screenshot <query> --targets chatgpt # screenshot a query result
1891
1896
  ```
1892
1897
 
1893
- Start Chrome with `--remote-debugging-port=9222` and sign in to ChatGPT before you run browser queries.
1898
+ Start Chrome with `--remote-debugging-port=9222` and `--user-data-dir` set to a separate profile folder, then sign in to ChatGPT in that window before you run browser queries. Chrome 136 and later ignore the debugging port on your everyday profile.
1894
1899
 
1895
1900
  ## Telemetry
1896
1901
 
@@ -112,9 +112,8 @@ to the project dashboard.
112
112
  - Connect Search Console for every project. Skipping it should be the user's
113
113
  stated choice, since the plan then cannot see real searches.
114
114
  - A short first Search Console sync can start on an unusual week. Before
115
- reading any trend, propose a longer backfill, which the operator or a CLI
116
- host runs: `cnry google sync <project> --days 180 --wait`. No MCP tool does
117
- this.
115
+ reading any trend, propose a longer backfill: `canonry_gsc_sync` with
116
+ `days: 180` (CLI: `cnry google sync <project> --days 180 --wait`).
118
117
  - Check what each source measures. Search Console should list the sitemap
119
118
  index, not one sub-sitemap (`canonry_sitemaps`). A GA4 sync can complete
120
119
  with zero rows when the tag is missing, so confirm recent days hold visits.
@@ -30,6 +30,9 @@ cnry google sync <project> # incremental sync
30
30
  cnry google sync <project> --full --wait # full re-sync
31
31
  ```
32
32
 
33
+ MCP: `canonry_gsc_sync` (gsc toolkit) runs the same sync and waits for it:
34
+ `days` (1 to 180) or `full: true`. It returns what the sync stored.
35
+
33
36
  ### Check search performance
34
37
  ```bash
35
38
  cnry google performance <project> # top rows by clicks
@@ -168,7 +171,7 @@ HTTP `200` means the search engine received the URLs. HTTP `202` means it receiv
168
171
  | Audit what Bing currently knows | `cnry bing coverage <project>` |
169
172
  | Fast crawl of new/updated pages on Bing | IndexNow batch submit |
170
173
  | Ask Google to refetch changed sitemaps | `cnry google submit-sitemap <project> --all` |
171
- | Ongoing Google crawl health | `cnry google sync` + `cnry google performance` |
174
+ | Ongoing Google crawl health | `cnry google sync` (MCP: `canonry_gsc_sync`) + `cnry google performance` |
172
175
  | Ongoing Bing crawl health | Bing WMT sitemap + `cnry bing performance` |
173
176
  | Find deindexed pages | `cnry google deindexed <project>` |
174
177
 
@@ -1,2 +1,2 @@
1
- import{r as e}from"./vendor-markdown-DMxglFrF.js";import{Mc as t,al as n,js as r,nl as i,r as a}from"./ToneBadge-DXhSJm1L.js";import{D as o,E as s,h as c}from"./ChartPrimitives-Bb1-9BLv.js";import{n as l,r as u}from"./account-context-BlFU3aZm.js";import{a as d,i as ee,n as te,r as f,t as ne}from"./card-B6QRK3vg.js";var p=`__cited__`,m=`__mentioned__`,h=`__mentionShare__`;function g(e){let t=e,{dataStartDate:n,dataEndDate:r}=t;return typeof n!=`string`||typeof r!=`string`?null:{start:c(n),end:c(r),sweepCount:t.sweepCount??1}}function _(e,t=new Date){return o(e,t)}function v(e,t=new Date){let n=g(e);if(!n)return null;let r=_(n.start,t),i=_(n.end,t);return r===i?r:`${r} to ${i}`}function y(e,t=new Date){let n=g(e),r=v(e,t);return!n||!r?`Check date unavailable`:`${r} · ${n.sweepCount} ${n.sweepCount===1?`check`:`checks`}`}function b(e){let t=g(e);return t?s(t.start):``}function x(e){return e.trim().toLowerCase()}function S(e,t={}){return e.map(e=>{let n=e.trim().toLowerCase(),r=(t[e]??[]).map(e=>e.trim().toLowerCase()).filter(Boolean).sort();return n&&r.length>0?`${n}=${r.join(`|`)}`:n}).filter(Boolean).sort().join(`
2
- `)}function C(e,a){let o=n(e);if(o){let n=a?.find(e=>e.name===`openrouter`)?.knownModels??a?.find(t=>t.name===e)?.knownModels;return`${t(o,n)} via OpenRouter`}let s=a?.find(t=>t.name===e)?.displayName?.trim();return r(e,a)??(s||i(e))}function w(e){return Math.round(e*1e3)/10}function T(e){return e===null?null:w(e)}function E(e){return e.byProvider??{}}function re(e,t,n){let r=e.buckets.length>0,i=e.buckets.length===1;if(n===`overall`){let n=t===`cited`?p:m,a=t===`cited`?`citationRate`:`mentionRate`;return{rows:e.buckets.map(e=>({date:e.startDate,[n]:T(e[a])})),series:[n],hasData:r,singleBucket:i}}let a=t===`mentioned`?`mentionRate`:`citationRate`,o=[...new Set(e.buckets.flatMap(e=>Object.keys(E(e))))].sort();return{rows:e.buckets.map(e=>{let t={date:e.startDate},n=E(e);for(let e of o){let r=n[e];t[e]=r?T(r[a]):null}return t}),series:o,hasData:r,singleBucket:i}}function ie(e){let t=e;return Object.hasOwn(t,`modelEvidenceByProvider`)?t.modelEvidenceByProvider??{}:null}function ae(e){let t=e;return Object.hasOwn(t,`modelAttribution`)?t.modelAttribution??{}:null}function oe(e){return e.servedModelAttribution??{}}function D(e){return e.modelServiceMismatch??{}}function O(e){return e.modelPointerChanges??{}}function k(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function A(e){switch(e.status){case`known`:return e.model.includes(`/`)?t(e.model):e.model;case`unknown`:return`Unknown model`;case`mixed`:return e.models.length===0?`Unknown model`:`${e.models.map(e=>e.includes(`/`)?t(e):e).join(`, `)}${e.includesUnknown?` and an unknown model`:``}`}}function j(e){return k([...e.models.map(e=>e.includes(`/`)?t(e):e),...e.includesUnknown?[`an unknown model`]:[]])}function M(e){let t=new Map;for(let[n,r]of Object.entries(e))for(let e of r.events){let r=t.get(e.bucketStartDate)??[];r.push({provider:n,event:e}),t.set(e.bucketStartDate,r)}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({bucketStartDate:e,events:[...t].sort((e,t)=>e.provider.localeCompare(t.provider)||e.event.observedAt.localeCompare(t.event.observedAt))}))}function N(e){let t={},n=[];for(let[r,i]of Object.entries(e)){let e=i.events.filter(e=>!e.fromPreWindowAnchor);for(let e of i.events)e.fromPreWindowAnchor&&n.push({provider:r,event:e});e.length>0&&(t[r]={...i,events:e})}return{buckets:M(t),beforeWindow:n.sort((e,t)=>e.event.observedAt.localeCompare(t.event.observedAt)||e.provider.localeCompare(t.provider))}}function P(e){let t=[];for(let[n,r]of Object.entries(e)){let e=r.eventTotal??r.events.length;e>r.events.length&&t.push({provider:n,shown:r.events.length,total:e})}return t.sort((e,t)=>e.provider.localeCompare(t.provider))}function F(e){let t=e.buckets.map(e=>{let t=e.mentionShare;return{date:e.startDate,[h]:t?.rate==null?null:w(t.rate)}}),n=t.map(e=>e[h]).filter(e=>typeof e==`number`&&Number.isFinite(e));return{rows:t,series:[h],hasData:n.length>0,singleBucket:n.length===1}}function I(e,t,n){return t===`mentionShare`?F(e):re(e,t,n)}function L(e,t){if(t===`mentionShare`)return e.buckets.flatMap(e=>{let t=e.mentionShare?.rate;return typeof t==`number`&&Number.isFinite(t)?[t]:[]});let n=t===`cited`?`citationRate`:`mentionRate`;return e.buckets.flatMap(e=>{let t=e[n];return t===null?[]:[t]})}function R(e){return e.buckets.some(e=>e.citationRate!==null)}function z(e,t){let n=e.buckets.flatMap(e=>{let n=E(e)[t];return n?[n]:[]});return n.length>0&&n.every(e=>e.citationRate===null)}function B(e,t){let n=e.windowChange;if(!n)return null;switch(t){case`cited`:return n.citationRate;case`mentioned`:return n.mentionRate;case`mentionShare`:return n.mentionShare}}function V(e,t,n){let r=n===`mentioned`?`mentionRate`:`citationRate`;for(let n=e.buckets.length-1;n>=0;n--){let i=E(e.buckets[n])[t]?.[r];if(i!=null)return i}return null}function H(e){return Date.parse(e)}function U(e,t){let n=g(e);if(!n)return!1;let r=H(t);return r>=H(n.start)&&r<=H(n.end)}function W(e){return e.basketChanges??[]}function G(e,t){return t.filter(t=>U(e,t.at)).sort((e,t)=>H(e.at)-H(t.at))}function K(e,t){return x(e)===`perplexity`&&t.status===`known`&&!t.model.includes(`/`)}function se(e){return Object.entries(e).filter(([e,t])=>!K(e,t.configured)).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({provider:e,mismatch:t}))}function ce(e){return[...W(e)].sort((e,t)=>H(t.at)-H(e.at)).map(e=>({at:c(e.at),added:e.added,removed:e.removed}))}function le(e,t){let n=[...e.events].sort((e,t)=>H(e.observedAt)-H(t.observedAt)),r=n[0]?.from??e.latestObservation.state;for(let e of n)H(e.observedAt)<=H(t)&&(r=e.to);return r}function q(e,t,n,r){return{provider:e,at:c(t.observedAt),onOrBefore:t.fromPreWindowAnchor===!0,anchorAt:t.anchorObservedAt?c(t.anchorObservedAt):null,from:t.from,to:t.to,served:n,reroute:r}}function ue(e,t){let n=[];for(let[r,i]of Object.entries(e)){let e=t[r]?.events??[],a=new Set(i.events.map(e=>e.observedAt));for(let t of i.events){let i=K(r,t.to)?e.find(e=>e.observedAt===t.observedAt):void 0;n.push(q(r,t,i?{from:i.from,to:i.to}:null,!1))}for(let t of e)a.has(t.observedAt)||K(r,le(i,t.observedAt))&&n.push(q(r,t,null,!0))}return n.sort((e,t)=>H(t.at)-H(e.at)||e.provider.localeCompare(t.provider))}function de({latest:e,queryChanges:t,modelRows:n,now:r=new Date}){let i=[...t.map(e=>e.at),...n.map(e=>e.at)];if(i.length===0)return null;let a=t=>e!==void 0&&U(e,t),o=t.filter(e=>a(e.at)),s=o.reduce((e,t)=>e+t.added.length,0),c=o.reduce((e,t)=>e+t.removed.length,0),l=n.filter(e=>a(e.at)).length,u=e?v(e,r):null;if(u===null||s+c+l===0)return`No changes since ${_(i.reduce((e,t)=>H(t)>H(e)?t:e),r)}`;let d=[u];return s>0&&d.push(`${s} ${s===1?`query`:`queries`} added`),c>0&&d.push(`${c} ${c===1?`query`:`queries`} removed`),l>0&&d.push(`${l} new ${l===1?`model`:`models`}`),d.join(` · `)}function fe(e,t,n,r=null){let i=H(e);if(!Number.isFinite(i))return null;let a=t.filter(e=>H(e)<i);if(a.length>0)return c(a.reduce((e,t)=>H(t)>H(e)?t:e));let o=n.map(e=>g(e)).filter(e=>e!==null).sort((e,t)=>H(e.start)-H(t.start)),s=o.findIndex(e=>H(e.start)<=i&&i<=H(e.end));if(s===-1)return null;let l=o[s];return H(l.start)===i?s>0?o[s-1].end:r&&H(r)<i?c(r):null:l.sweepCount===2&&H(l.end)===i?l.start:null}function pe(e){let t=new Map,n=(e,n)=>{let r=t.get(e);r?r.push(n):t.set(e,[n])};for(let t of[...e].sort((e,t)=>e.revision-t.revision)){let e=H(t.at);for(let r of t.removed)n(r,{at:e,member:!1});for(let r of t.added)n(r,{at:e,member:!0})}return new Map([...t].filter(([,e])=>e.at(-1).member))}function J(e,t){let n=!e[0].member;for(let r of e)r.at<=t&&(n=r.member);return n}function me(e,t,n){return e.some(e=>e.at>t&&e.at<=n)}function Y(e,t){let n=H(t.start),r=H(t.end);return t.sweepCount>2?me(e,n,r):J(e,n)!==J(e,r)}function X(e,t,n,r){let i=H(t),a=H(n),o={added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]},s=new Set;for(let[t,n]of pe(e)){if(!r(n))continue;s.add(t);let e=J(n,i),c=J(n,a);e===c?(e?o.removedAndAddedBack:o.addedAndRemovedAgain).push(t):(c?o.added:o.removed).push(t)}if(s.size===0)return null;let c=e=>[...e.added,...e.removed].some(e=>s.has(e)),l=e.filter(e=>H(e.at)>i&&H(e.at)<=a&&c(e)).sort((e,t)=>H(e.at)-H(t.at));return{changes:l,keys:[...new Set(l.flatMap(e=>[...e.added,...e.removed]))].filter(e=>s.has(e)),moves:o}}function he(e,t){if(e.length<2)return null;let n=e[0],r=e.at(-1),i=g(n),a=g(r),o=i?.start??n.startDate,s=a?.end??r.endDate,c=X(t,o,s,e=>J(e,H(o))!==J(e,H(s))||i!==null&&Y(e,i)||a!==null&&Y(e,a));return!c&&n.queryCount===r.queryCount?null:{...c??{changes:[],keys:[],moves:{added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]}},firstCount:n.queryCount,latestCount:r.queryCount}}function Z(e,t){let n=g(e);if(!n)return null;let r=X(t,n.start,n.end,e=>Y(e,n));return r?{...r,firstCount:e.queryCount,latestCount:e.queryCount}:null}function Q(e){return`${e} ${e===1?`query`:`queries`}`}function ge(e){let t=[],n=e=>t.length===0?Q(e):String(e);return e.added.length>0&&t.push(`${n(e.added.length)} added`),e.removed.length>0&&t.push(`${n(e.removed.length)} removed`),e.removedAndAddedBack.length>0&&t.push(`${Q(e.removedAndAddedBack.length)} removed and added back`),e.addedAndRemovedAgain.length>0&&t.push(`${Q(e.addedAndRemovedAgain.length)} added and removed again`),k(t)}function _e(e,t,n,r){return e?t!==`mentionShare`||n!==`non-brand`||!r?!1:e.keys.length>0&&e.keys.every(e=>r(e)===`branded`):!0}var $=e();function ve({disabled:e,title:t,...n}){let{canWrite:r}=u();return r?(0,$.jsx)(a,{disabled:e,title:t,...n}):(0,$.jsx)(a,{...n,disabled:!0,title:l})}function ye({title:e,children:t}){let{isAdmin:n}=u();return n?(0,$.jsx)($.Fragment,{children:t}):(0,$.jsxs)(ne,{className:`surface-card mx-auto mt-8 max-w-lg`,children:[(0,$.jsxs)(ee,{children:[(0,$.jsxs)(d,{children:[e,` is for administrators`]}),(0,$.jsx)(f,{children:`Your account has view-only access. You can read everything this install has measured; changing how it is set up needs an administrator account.`})]}),(0,$.jsx)(te,{children:(0,$.jsx)(`p`,{className:`supporting-copy`,children:`If you need to make a change here, ask an administrator on this install.`})})]})}export{W as A,P as B,L as C,ce as D,C as E,D as F,oe as I,_e as L,g as M,ae as N,ge as O,O as P,se as R,N as S,z as T,de as V,k as _,h as a,ue as b,R as c,b as d,v as f,K as g,_ as h,m as i,ie as j,he as k,S as l,A as m,ve as n,G as o,j as p,p as r,I as s,ye as t,y as u,V as v,Z as w,x,B as y,fe as z};
1
+ import{r as e}from"./vendor-markdown-DMxglFrF.js";import{Fc as t,Ms as n,al as r,cl as i,r as a}from"./ToneBadge-BE2H103M.js";import{D as o,E as s,h as c}from"./ChartPrimitives-ChO_4pZz.js";import{n as l,r as u}from"./account-context-y7mzU3Ko.js";import{a as d,i as ee,n as te,r as f,t as ne}from"./card-BmJz19vt.js";var p=`__cited__`,m=`__mentioned__`,h=`__mentionShare__`;function g(e){let t=e,{dataStartDate:n,dataEndDate:r}=t;return typeof n!=`string`||typeof r!=`string`?null:{start:c(n),end:c(r),sweepCount:t.sweepCount??1}}function _(e,t=new Date){return o(e,t)}function v(e,t=new Date){let n=g(e);if(!n)return null;let r=_(n.start,t),i=_(n.end,t);return r===i?r:`${r} to ${i}`}function y(e,t=new Date){let n=g(e),r=v(e,t);return!n||!r?`Check date unavailable`:`${r} · ${n.sweepCount} ${n.sweepCount===1?`check`:`checks`}`}function b(e){let t=g(e);return t?s(t.start):``}function x(e){return e.trim().toLowerCase()}function S(e,t={}){return e.map(e=>{let n=e.trim().toLowerCase(),r=(t[e]??[]).map(e=>e.trim().toLowerCase()).filter(Boolean).sort();return n&&r.length>0?`${n}=${r.join(`|`)}`:n}).filter(Boolean).sort().join(`
2
+ `)}function C(e,a){let o=i(e);if(o){let n=a?.find(e=>e.name===`openrouter`)?.knownModels??a?.find(t=>t.name===e)?.knownModels;return`${t(o,n)} via OpenRouter`}let s=a?.find(t=>t.name===e)?.displayName?.trim();return n(e,a)??(s||r(e))}function w(e){return Math.round(e*1e3)/10}function T(e){return e===null?null:w(e)}function E(e){return e.byProvider??{}}function re(e,t,n){let r=e.buckets.length>0,i=e.buckets.length===1;if(n===`overall`){let n=t===`cited`?p:m,a=t===`cited`?`citationRate`:`mentionRate`;return{rows:e.buckets.map(e=>({date:e.startDate,[n]:T(e[a])})),series:[n],hasData:r,singleBucket:i}}let a=t===`mentioned`?`mentionRate`:`citationRate`,o=[...new Set(e.buckets.flatMap(e=>Object.keys(E(e))))].sort();return{rows:e.buckets.map(e=>{let t={date:e.startDate},n=E(e);for(let e of o){let r=n[e];t[e]=r?T(r[a]):null}return t}),series:o,hasData:r,singleBucket:i}}function ie(e){let t=e;return Object.hasOwn(t,`modelEvidenceByProvider`)?t.modelEvidenceByProvider??{}:null}function ae(e){let t=e;return Object.hasOwn(t,`modelAttribution`)?t.modelAttribution??{}:null}function oe(e){return e.servedModelAttribution??{}}function D(e){return e.modelServiceMismatch??{}}function O(e){return e.modelPointerChanges??{}}function k(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function A(e){switch(e.status){case`known`:return e.model.includes(`/`)?t(e.model):e.model;case`unknown`:return`Unknown model`;case`mixed`:return e.models.length===0?`Unknown model`:`${e.models.map(e=>e.includes(`/`)?t(e):e).join(`, `)}${e.includesUnknown?` and an unknown model`:``}`}}function j(e){return k([...e.models.map(e=>e.includes(`/`)?t(e):e),...e.includesUnknown?[`an unknown model`]:[]])}function M(e){let t=new Map;for(let[n,r]of Object.entries(e))for(let e of r.events){let r=t.get(e.bucketStartDate)??[];r.push({provider:n,event:e}),t.set(e.bucketStartDate,r)}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({bucketStartDate:e,events:[...t].sort((e,t)=>e.provider.localeCompare(t.provider)||e.event.observedAt.localeCompare(t.event.observedAt))}))}function N(e){let t={},n=[];for(let[r,i]of Object.entries(e)){let e=i.events.filter(e=>!e.fromPreWindowAnchor);for(let e of i.events)e.fromPreWindowAnchor&&n.push({provider:r,event:e});e.length>0&&(t[r]={...i,events:e})}return{buckets:M(t),beforeWindow:n.sort((e,t)=>e.event.observedAt.localeCompare(t.event.observedAt)||e.provider.localeCompare(t.provider))}}function P(e){let t=[];for(let[n,r]of Object.entries(e)){let e=r.eventTotal??r.events.length;e>r.events.length&&t.push({provider:n,shown:r.events.length,total:e})}return t.sort((e,t)=>e.provider.localeCompare(t.provider))}function F(e){let t=e.buckets.map(e=>{let t=e.mentionShare;return{date:e.startDate,[h]:t?.rate==null?null:w(t.rate)}}),n=t.map(e=>e[h]).filter(e=>typeof e==`number`&&Number.isFinite(e));return{rows:t,series:[h],hasData:n.length>0,singleBucket:n.length===1}}function I(e,t,n){return t===`mentionShare`?F(e):re(e,t,n)}function L(e,t){if(t===`mentionShare`)return e.buckets.flatMap(e=>{let t=e.mentionShare?.rate;return typeof t==`number`&&Number.isFinite(t)?[t]:[]});let n=t===`cited`?`citationRate`:`mentionRate`;return e.buckets.flatMap(e=>{let t=e[n];return t===null?[]:[t]})}function R(e){return e.buckets.some(e=>e.citationRate!==null)}function z(e,t){let n=e.buckets.flatMap(e=>{let n=E(e)[t];return n?[n]:[]});return n.length>0&&n.every(e=>e.citationRate===null)}function B(e,t){let n=e.windowChange;if(!n)return null;switch(t){case`cited`:return n.citationRate;case`mentioned`:return n.mentionRate;case`mentionShare`:return n.mentionShare}}function V(e,t,n){let r=n===`mentioned`?`mentionRate`:`citationRate`;for(let n=e.buckets.length-1;n>=0;n--){let i=E(e.buckets[n])[t]?.[r];if(i!=null)return i}return null}function H(e){return Date.parse(e)}function U(e,t){let n=g(e);if(!n)return!1;let r=H(t);return r>=H(n.start)&&r<=H(n.end)}function W(e){return e.basketChanges??[]}function G(e,t){return t.filter(t=>U(e,t.at)).sort((e,t)=>H(e.at)-H(t.at))}function K(e,t){return x(e)===`perplexity`&&t.status===`known`&&!t.model.includes(`/`)}function se(e){return Object.entries(e).filter(([e,t])=>!K(e,t.configured)).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({provider:e,mismatch:t}))}function ce(e){return[...W(e)].sort((e,t)=>H(t.at)-H(e.at)).map(e=>({at:c(e.at),added:e.added,removed:e.removed}))}function le(e,t){let n=[...e.events].sort((e,t)=>H(e.observedAt)-H(t.observedAt)),r=n[0]?.from??e.latestObservation.state;for(let e of n)H(e.observedAt)<=H(t)&&(r=e.to);return r}function q(e,t,n,r){return{provider:e,at:c(t.observedAt),onOrBefore:t.fromPreWindowAnchor===!0,anchorAt:t.anchorObservedAt?c(t.anchorObservedAt):null,from:t.from,to:t.to,served:n,reroute:r}}function ue(e,t){let n=[];for(let[r,i]of Object.entries(e)){let e=t[r]?.events??[],a=new Set(i.events.map(e=>e.observedAt));for(let t of i.events){let i=K(r,t.to)?e.find(e=>e.observedAt===t.observedAt):void 0;n.push(q(r,t,i?{from:i.from,to:i.to}:null,!1))}for(let t of e)a.has(t.observedAt)||K(r,le(i,t.observedAt))&&n.push(q(r,t,null,!0))}return n.sort((e,t)=>H(t.at)-H(e.at)||e.provider.localeCompare(t.provider))}function de({latest:e,queryChanges:t,modelRows:n,now:r=new Date}){let i=[...t.map(e=>e.at),...n.map(e=>e.at)];if(i.length===0)return null;let a=t=>e!==void 0&&U(e,t),o=t.filter(e=>a(e.at)),s=o.reduce((e,t)=>e+t.added.length,0),c=o.reduce((e,t)=>e+t.removed.length,0),l=n.filter(e=>a(e.at)).length,u=e?v(e,r):null;if(u===null||s+c+l===0)return`No changes since ${_(i.reduce((e,t)=>H(t)>H(e)?t:e),r)}`;let d=[u];return s>0&&d.push(`${s} ${s===1?`query`:`queries`} added`),c>0&&d.push(`${c} ${c===1?`query`:`queries`} removed`),l>0&&d.push(`${l} new ${l===1?`model`:`models`}`),d.join(` · `)}function fe(e,t,n,r=null){let i=H(e);if(!Number.isFinite(i))return null;let a=t.filter(e=>H(e)<i);if(a.length>0)return c(a.reduce((e,t)=>H(t)>H(e)?t:e));let o=n.map(e=>g(e)).filter(e=>e!==null).sort((e,t)=>H(e.start)-H(t.start)),s=o.findIndex(e=>H(e.start)<=i&&i<=H(e.end));if(s===-1)return null;let l=o[s];return H(l.start)===i?s>0?o[s-1].end:r&&H(r)<i?c(r):null:l.sweepCount===2&&H(l.end)===i?l.start:null}function pe(e){let t=new Map,n=(e,n)=>{let r=t.get(e);r?r.push(n):t.set(e,[n])};for(let t of[...e].sort((e,t)=>e.revision-t.revision)){let e=H(t.at);for(let r of t.removed)n(r,{at:e,member:!1});for(let r of t.added)n(r,{at:e,member:!0})}return new Map([...t].filter(([,e])=>e.at(-1).member))}function J(e,t){let n=!e[0].member;for(let r of e)r.at<=t&&(n=r.member);return n}function me(e,t,n){return e.some(e=>e.at>t&&e.at<=n)}function Y(e,t){let n=H(t.start),r=H(t.end);return t.sweepCount>2?me(e,n,r):J(e,n)!==J(e,r)}function X(e,t,n,r){let i=H(t),a=H(n),o={added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]},s=new Set;for(let[t,n]of pe(e)){if(!r(n))continue;s.add(t);let e=J(n,i),c=J(n,a);e===c?(e?o.removedAndAddedBack:o.addedAndRemovedAgain).push(t):(c?o.added:o.removed).push(t)}if(s.size===0)return null;let c=e=>[...e.added,...e.removed].some(e=>s.has(e)),l=e.filter(e=>H(e.at)>i&&H(e.at)<=a&&c(e)).sort((e,t)=>H(e.at)-H(t.at));return{changes:l,keys:[...new Set(l.flatMap(e=>[...e.added,...e.removed]))].filter(e=>s.has(e)),moves:o}}function he(e,t){if(e.length<2)return null;let n=e[0],r=e.at(-1),i=g(n),a=g(r),o=i?.start??n.startDate,s=a?.end??r.endDate,c=X(t,o,s,e=>J(e,H(o))!==J(e,H(s))||i!==null&&Y(e,i)||a!==null&&Y(e,a));return!c&&n.queryCount===r.queryCount?null:{...c??{changes:[],keys:[],moves:{added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]}},firstCount:n.queryCount,latestCount:r.queryCount}}function Z(e,t){let n=g(e);if(!n)return null;let r=X(t,n.start,n.end,e=>Y(e,n));return r?{...r,firstCount:e.queryCount,latestCount:e.queryCount}:null}function Q(e){return`${e} ${e===1?`query`:`queries`}`}function ge(e){let t=[],n=e=>t.length===0?Q(e):String(e);return e.added.length>0&&t.push(`${n(e.added.length)} added`),e.removed.length>0&&t.push(`${n(e.removed.length)} removed`),e.removedAndAddedBack.length>0&&t.push(`${Q(e.removedAndAddedBack.length)} removed and added back`),e.addedAndRemovedAgain.length>0&&t.push(`${Q(e.addedAndRemovedAgain.length)} added and removed again`),k(t)}function _e(e,t,n,r){return e?t!==`mentionShare`||n!==`non-brand`||!r?!1:e.keys.length>0&&e.keys.every(e=>r(e)===`branded`):!0}var $=e();function ve({disabled:e,title:t,...n}){let{canWrite:r}=u();return r?(0,$.jsx)(a,{disabled:e,title:t,...n}):(0,$.jsx)(a,{...n,disabled:!0,title:l})}function ye({title:e,children:t}){let{isAdmin:n}=u();return n?(0,$.jsx)($.Fragment,{children:t}):(0,$.jsxs)(ne,{className:`surface-card mx-auto mt-8 max-w-lg`,children:[(0,$.jsxs)(ee,{children:[(0,$.jsxs)(d,{children:[e,` is for administrators`]}),(0,$.jsx)(f,{children:`Your account has view-only access. You can read everything this install has measured; changing how it is set up needs an administrator account.`})]}),(0,$.jsx)(te,{children:(0,$.jsx)(`p`,{className:`supporting-copy`,children:`If you need to make a change here, ask an administrator on this install.`})})]})}export{W as A,P as B,L as C,ce as D,C as E,D as F,oe as I,_e as L,g as M,ae as N,ge as O,O as P,se as R,N as S,z as T,de as V,k as _,h as a,ue as b,R as c,b as d,v as f,K as g,_ as h,m as i,ie as j,he as k,S as l,A as m,ve as n,G as o,j as p,p as r,I as s,ye as t,y as u,V as v,Z as w,x,B as y,fe as z};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,B as n,H as r,lt as i}from"./vendor-lucide-C3F7vHjd.js";import{r as a}from"./vendor-markdown-DMxglFrF.js";import{Cs as o,Mt as s,Nt as c,Ss as l,Vn as u,ht as d,jt as f,ln as p,r as m,t as h,un as g,ws as _}from"./ToneBadge-DXhSJm1L.js";import{r as v}from"./account-context-BlFU3aZm.js";import{t as y}from"./async-handler-Bj3TnIRw.js";import{rt as b,st as x}from"./index-MwrSHGLh.js";var S=e(i(),1),C=`Use the official Canonry docs:
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,B as n,H as r,lt as i}from"./vendor-lucide-C3F7vHjd.js";import{r as a}from"./vendor-markdown-DMxglFrF.js";import{Cs as o,Mt as s,Nt as c,Ss as l,Vn as u,ht as d,jt as f,ln as p,r as m,t as h,un as g,ws as _}from"./ToneBadge-BE2H103M.js";import{r as v}from"./account-context-y7mzU3Ko.js";import{t as y}from"./async-handler-Bj3TnIRw.js";import{rt as b,st as x}from"./index-s7MwkxGB.js";var S=e(i(),1),C=`Use the official Canonry docs:
2
2
  - Agent quickstart: https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent
3
3
  - CLI reference: https://github.com/Canonry/canonry/blob/main/skills/canonry/references/canonry-cli.md
4
4
  - Plugin setup: https://github.com/Canonry/canonry/blob/main/docs/plugins.md
@@ -11,9 +11,9 @@ ${C}Pick one path and stay on it. Use connected Canonry tools (plugin or MCP) on
11
11
  1. Ask for my public domain, country, and language. Do not create or scan anything yet. Country and language are only applied when a project is created, so if you reuse an existing project, report its country and language instead of changing them.
12
12
  2. Shell path only: confirm \`cnry\` is on PATH, then run \`cnry --version\`. If Canonry is missing, propose \`npm install -g @canonry/canonry\` and wait for approval. Then run \`cnry doctor --format json\`, which is the command that says whether config, database, and server are in place. \`cnry --version\` does not read config and succeeds on a completely unconfigured install, so it cannot answer this. If config is missing, run \`cnry bootstrap\` yourself: it is not interactive, takes about a second, and is safe to rerun. Do not hand it to me and wait. The interactive command is \`cnry init\`, which is optional provider and OAuth setup that Agent Readiness does not need. Bootstrap prints an API key, so do not repeat its output back to me, and never ask me to paste passwords, API keys, OAuth credentials, or command output.
13
13
  3. Confirm the API is reachable. \`cnry doctor --format json\` reports it, and any project read exits non-zero with \`CONNECTION_ERROR\` when it is not. If it is unreachable, propose \`cnry start\` and wait for approval. Use \`cnry start\`, which is the background daemon, and not \`cnry serve\`, which runs in the foreground and will block you until I stop it, even though some error messages suggest it. Stop anything you started with \`cnry stop\`.
14
- 4. List projects with the connected project tool or \`cnry project list --format json\`, and reuse one whose domain matches. Confirm the proposed name is not already assigned to a different domain. To find out whether a project has already been scanned, run \`cnry agent-readiness score <project> --format json\` with no \`--run-id\`, which reports the latest run. Read the \`hasData\` field, not the score: this command exits 0 and reports \`aggregateScore: 0\` for a project that has never been scanned, so reading the score alone would have you tell me my site scored zero. If \`hasData\` is true and \`runStatus\` is \`completed\` or \`partial\`, read that scan instead of starting a new one. If no project matches, show the exact create operation and wait for approval.
15
- 5. Propose a bounded Agent Readiness audit scan: \`--max-pages 100\` for a first look, plus whether dead-link checking is on (it is off unless you pass \`--check-dead-links\`). Show the connected operation or the exact \`cnry agent-readiness run <project> --max-pages 100 --wait --format json\` command with the project name filled in, and wait for separate approval before scanning. \`--wait\` polls for up to 15 minutes and returns only the run id and status. If the status it returns is still \`queued\` or \`running\`, the scan has not finished: do not rerun it or report results, poll \`cnry agent-readiness progress <project> --run-id <run-id> --format json\` until it is terminal. If \`--wait\` outruns your own tool timeout first, recover the run id with \`cnry runs <project> --kind site-audit --limit 1 --format json\`, which returns the newest scan whatever its status, and poll the same way.
16
- 6. When the run is \`completed\` or \`partial\`, read \`cnry agent-readiness overview <project> --run-id <run-id> --format json\` first. It is the only one of these commands that carries \`termination\` and \`complete\`; the score and page-scores commands do not. Then read \`cnry agent-readiness score <project> --run-id <run-id> --format json\` and \`cnry agent-readiness page-scores <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl\`. Tell me the termination reason in plain words and whether the scan covered the whole site or stopped at a page, link, depth, or time limit. A \`partial\` run scored the pages it reached and not my site, so never present it as a full-site result. If it stopped early, the fix depends on the reason, so say which: a page or depth limit needs a larger budget, a time limit needs a smaller scan (a lower \`--max-pages\` or \`--max-depth\`). If the run failed or was cancelled, inspect the run error and stop.
14
+ 4. List projects with the connected project tool or \`cnry project list --format json\`, and reuse one whose domain matches. Confirm the proposed name is not already assigned to a different domain. If no project matches, show the exact create operation and wait for approval. For the selected project, look up its newest scan with \`cnry runs <project> --kind site-audit --limit 1 --format json\`. Use that run id for progress, score and findings. For a queued or running scan, follow its progress until it finishes. For a completed or partial scan, check \`hasData\` and \`pagesAudited\` in its scorecard. If it scored pages, use its results in step 6. If the scan failed, was cancelled, or finished without scoring a page, report its status and any recorded reason, then propose a fresh scan in step 5. If no scan exists, go straight to step 5.
15
+ 5. Propose a bounded Agent Readiness audit scan: \`--max-pages 100\` for a first look, plus whether dead-link checking is on (it is off unless you pass \`--check-dead-links\`). Show the connected operation or the exact \`cnry agent-readiness run <project> --max-pages 100 --wait --format json\` command with the project name filled in, and wait for separate approval before scanning. \`--wait\` polls for up to 15 minutes and returns the run id, status and any recorded diagnostic. If the status it returns is still \`queued\` or \`running\`, the scan has not finished: do not rerun it or report results, poll \`cnry agent-readiness progress <project> --run-id <run-id> --format json\` until it is terminal. If \`--wait\` outruns your own tool timeout first, recover the run id with \`cnry runs <project> --kind site-audit --limit 1 --format json\`, which returns the newest scan whatever its status, and poll the same way.
16
+ 6. When the run is \`completed\` or \`partial\`, read \`cnry agent-readiness overview <project> --run-id <run-id> --format json\` first. Read \`termination\` and \`complete\` from that overview. Then read \`cnry agent-readiness score <project> --run-id <run-id> --format json\` and \`cnry agent-readiness page-scores <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl\`. Read \`cnry agent-readiness issues <project> --run-id <run-id> --limit 3 --format json\` and summarize the findings, affected pages and any recorded fix. Mention any sites that the scan could not reach. Tell me the termination reason in plain words and whether the scan covered the whole site or stopped at a page, link, depth, or time limit. A \`partial\` run may have scored fewer pages or none. Report how many were scored and never present it as a full-site result. If it stopped early, the fix depends on the reason, so say which: a page or depth limit needs a larger budget, a time limit needs a smaller scan (a lower \`--max-pages\` or \`--max-depth\`). If the scan failed or scored no pages, tell me the recorded reason and next step from \`cnry agent-readiness progress <project> --run-id <run-id> --format json\`. If there is no recorded cause, say so. Report cancellations separately.
17
17
  7. Summarize only completed evidence, then propose AI Visibility setup. Ask before you add queries, connect providers, start a provider-backed or quota-consuming run, edit files, or publish.`;function T(e){return e?w:w.replace(C,``)}var E=a(),D=`https://github.com/Canonry/canonry/blob/main/docs/mcp.md`,O=`https://github.com/Canonry/canonry/blob/main/docs/plugins.md`,k=`https://help.openai.com/en/articles/12584461-connecting-custom-mcp-servers-in-chatgpt`,A=`https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp`,j=`codex plugin marketplace add Canonry/canonry
18
18
  codex plugin add canonry-remote@canonry`,M={[o[`public-url-required`]]:`Configure this instance’s public URL before connecting a hosted client.`,[o[`https-required`]]:`Configure an HTTPS public URL for this instance.`,[o[`public-host-required`]]:`Use a public HTTPS address that your client can reach. Localhost and private-network addresses do not work for hosted connectors.`,[o[`public-path-mismatch`]]:`Make the publicUrl path match basePath, and preserve that prefix when the proxy forwards requests for hosted OAuth.`,[o[`oauth-unavailable`]]:`The sign-in routes are unavailable. Check this instance’s OAuth configuration.`,[o[`account-required`]]:`Create a named Canonry account on this instance’s server with canonry user create. A shared dashboard password does not provide an OAuth account.`,[o[`transport-unavailable`]]:`Restore the instance’s HTTP MCP service before connecting a hosted client.`},N=[{client:`Claude Code`,command:`claude plugin marketplace add Canonry/canonry
19
19
  claude plugin install canonry@canonry`},{client:`Codex`,command:`codex plugin marketplace add Canonry/canonry
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t}from"./vendor-lucide-C3F7vHjd.js";import{r as n}from"./vendor-markdown-DMxglFrF.js";import{x as r}from"./vendor-tanstack-ZnWhYpCU.js";import{r as i,t as a,xt as o}from"./ToneBadge-DXhSJm1L.js";import{bn as s,bt as c,l}from"./react-query-CZrEo0vf.js";import{t as u}from"./card-B6QRK3vg.js";var d=e(t(),1),f=n(),p=100;function m(e){if(e===`all`)return;let t=Number.parseInt(e,10);return new Date(Date.now()-t*24*60*60*1e3).toISOString()}function h(e){let t=e.userAgent?.toLowerCase()??``;return t.includes(`canonry-mcp`)?`MCP`:t.includes(`canonry-cli`)?`CLI`:t.includes(`mozilla/`)?`Dashboard`:e.actor===`scheduler`?`Scheduler`:e.actor===`agent`?`Agent`:e.actor===`mcp`?`MCP`:e.actor===`cli`?`CLI`:e.actor}function g(e){return/delete|remove|revoke|disconnect|failed|refused/.test(e)?`negative`:/create|add|connect|completed/.test(e)?`positive`:/update|replace|sync|apply/.test(e)?`caution`:`neutral`}function _(e){return[e.action,e.actor,e.entityType,e.entityId,e.actorSession,e.userAgent,e.diff==null?``:JSON.stringify(e.diff)].filter(Boolean).join(` `).toLowerCase()}function v({projectName:e}){let[t,n]=(0,d.useState)(0),[v,y]=(0,d.useState)(`90d`),[b,x]=(0,d.useState)(``),[S,C]=(0,d.useState)(``),w=(0,d.useMemo)(()=>m(v),[v]),T={limit:p,offset:t*p,since:w,actor:b||void 0},E=r({...c({client:o,path:{name:e??``},query:T}),enabled:!!e}),D=r({...l({client:o,query:T}),enabled:!e}),O=r({...s({client:o}),enabled:!e}),k=e?E:D,A=k.data??[],j=(0,d.useMemo)(()=>new Map((O.data??[]).map(e=>[e.id,e.displayName||e.name])),[O.data]),M=S.trim().toLowerCase(),N=(0,d.useMemo)(()=>M?A.filter(e=>_(e).includes(M)):A,[A,M]),P=e=>{n(0),e()};return k.isLoading?(0,f.jsx)(`p`,{className:`supporting-copy mt-6`,role:`status`,children:`Loading change history…`}):(0,f.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`change-history-heading`,children:[(0,f.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,f.jsx)(`div`,{children:(0,f.jsx)(`h2`,{id:`change-history-heading`,className:e?void 0:`sr-only`,children:`Change history`})}),(0,f.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void k.refetch(),disabled:k.isFetching,children:k.isFetching?`Refreshing…`:`Refresh`})]}),(0,f.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,f.jsx)(`input`,{type:`search`,"aria-label":`Search change history`,value:S,onChange:e=>C(e.target.value),placeholder:`Search actions, entities, or details`,className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong placeholder-mono-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by actor`,value:b,onChange:e=>P(()=>x(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:``,children:`All actors`}),(0,f.jsx)(`option`,{value:`api`,children:`API and dashboard`}),(0,f.jsx)(`option`,{value:`cli`,children:`CLI`}),(0,f.jsx)(`option`,{value:`scheduler`,children:`Scheduler`}),(0,f.jsx)(`option`,{value:`agent`,children:`Agent`}),(0,f.jsx)(`option`,{value:`mcp`,children:`MCP`})]}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by date range`,value:v,onChange:e=>P(()=>y(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:`30d`,children:`Last 30 days`}),(0,f.jsx)(`option`,{value:`90d`,children:`Last 90 days`}),(0,f.jsx)(`option`,{value:`365d`,children:`Last year`}),(0,f.jsx)(`option`,{value:`all`,children:`All retained history`})]})]}),k.isError?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`Change history unavailable`}),(0,f.jsx)(`p`,{children:k.error instanceof Error?k.error.message:`Could not load the audit trail.`})]}):N.length===0?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`No changes match these filters`}),(0,f.jsx)(`p`,{children:`Widen the date range or clear the actor and search filters.`})]}):(0,f.jsx)(`div`,{className:`evidence-table-wrap mt-4`,children:(0,f.jsxs)(`table`,{className:`evidence-table`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`When`}),e?null:(0,f.jsx)(`th`,{children:`Scope`}),(0,f.jsx)(`th`,{children:`Action`}),(0,f.jsx)(`th`,{children:`Entity`}),(0,f.jsx)(`th`,{children:`Origin`}),(0,f.jsx)(`th`,{children:`Details`})]})}),(0,f.jsx)(`tbody`,{children:N.map(t=>(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{className:`whitespace-nowrap tabular-nums text-muted`,children:new Date(t.createdAt).toLocaleString()}),e?null:(0,f.jsx)(`td`,{className:`text-secondary`,children:t.projectId?j.get(t.projectId)??`Deleted project · ${t.projectId}`:`Instance settings`}),(0,f.jsx)(`td`,{children:(0,f.jsx)(a,{tone:g(t.action),children:t.action})}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-strong`,children:t.entityType}),t.entityId?(0,f.jsx)(`span`,{className:`mt-0.5 block max-w-48 truncate text-label-12-mono text-faint`,title:t.entityId,children:t.entityId}):null]}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-secondary`,children:h(t)}),t.actorSession?(0,f.jsxs)(`span`,{className:`mt-0.5 block max-w-40 truncate text-label-12-mono text-faint`,title:t.actorSession,children:[`Session `,t.actorSession]}):null]}),(0,f.jsx)(`td`,{children:t.diff==null?(0,f.jsx)(`span`,{className:`text-faint`,children:`No field diff`}):(0,f.jsxs)(`details`,{children:[(0,f.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary hover:text-strong`,children:`View diff`}),(0,f.jsx)(`pre`,{className:`max-h-72 max-w-xl overflow-auto whitespace-pre-wrap break-words rounded-md bg-bg-elevated p-3 text-copy-13 text-secondary`,children:JSON.stringify(t.diff,null,2)})]})})]},t.id))})]})}),!k.isError&&(t>0||A.length===p)?(0,f.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:t===0,onClick:()=>n(e=>Math.max(0,e-1)),children:`Previous`}),(0,f.jsxs)(`span`,{className:`text-label-12 tabular-nums text-muted`,children:[`Page `,t+1]}),(0,f.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:A.length<p,onClick:()=>n(e=>e+1),children:`Next`})]}):null]})}export{v as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t}from"./vendor-lucide-C3F7vHjd.js";import{r as n}from"./vendor-markdown-DMxglFrF.js";import{x as r}from"./vendor-tanstack-ZnWhYpCU.js";import{r as i,t as a,xt as o}from"./ToneBadge-BE2H103M.js";import{bn as s,bt as c,l}from"./react-query-BnTbVX2a.js";import{t as u}from"./card-BmJz19vt.js";var d=e(t(),1),f=n(),p=100;function m(e){if(e===`all`)return;let t=Number.parseInt(e,10);return new Date(Date.now()-t*24*60*60*1e3).toISOString()}function h(e){let t=e.userAgent?.toLowerCase()??``;return t.includes(`canonry-mcp`)?`MCP`:t.includes(`canonry-cli`)?`CLI`:t.includes(`mozilla/`)?`Dashboard`:e.actor===`scheduler`?`Scheduler`:e.actor===`agent`?`Agent`:e.actor===`mcp`?`MCP`:e.actor===`cli`?`CLI`:e.actor}function g(e){return/delete|remove|revoke|disconnect|failed|refused/.test(e)?`negative`:/create|add|connect|completed/.test(e)?`positive`:/update|replace|sync|apply/.test(e)?`caution`:`neutral`}function _(e){return[e.action,e.actor,e.entityType,e.entityId,e.actorSession,e.userAgent,e.diff==null?``:JSON.stringify(e.diff)].filter(Boolean).join(` `).toLowerCase()}function v({projectName:e}){let[t,n]=(0,d.useState)(0),[v,y]=(0,d.useState)(`90d`),[b,x]=(0,d.useState)(``),[S,C]=(0,d.useState)(``),w=(0,d.useMemo)(()=>m(v),[v]),T={limit:p,offset:t*p,since:w,actor:b||void 0},E=r({...c({client:o,path:{name:e??``},query:T}),enabled:!!e}),D=r({...l({client:o,query:T}),enabled:!e}),O=r({...s({client:o}),enabled:!e}),k=e?E:D,A=k.data??[],j=(0,d.useMemo)(()=>new Map((O.data??[]).map(e=>[e.id,e.displayName||e.name])),[O.data]),M=S.trim().toLowerCase(),N=(0,d.useMemo)(()=>M?A.filter(e=>_(e).includes(M)):A,[A,M]),P=e=>{n(0),e()};return k.isLoading?(0,f.jsx)(`p`,{className:`supporting-copy mt-6`,role:`status`,children:`Loading change history…`}):(0,f.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`change-history-heading`,children:[(0,f.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,f.jsx)(`div`,{children:(0,f.jsx)(`h2`,{id:`change-history-heading`,className:e?void 0:`sr-only`,children:`Change history`})}),(0,f.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void k.refetch(),disabled:k.isFetching,children:k.isFetching?`Refreshing…`:`Refresh`})]}),(0,f.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,f.jsx)(`input`,{type:`search`,"aria-label":`Search change history`,value:S,onChange:e=>C(e.target.value),placeholder:`Search actions, entities, or details`,className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong placeholder-mono-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by actor`,value:b,onChange:e=>P(()=>x(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:``,children:`All actors`}),(0,f.jsx)(`option`,{value:`api`,children:`API and dashboard`}),(0,f.jsx)(`option`,{value:`cli`,children:`CLI`}),(0,f.jsx)(`option`,{value:`scheduler`,children:`Scheduler`}),(0,f.jsx)(`option`,{value:`agent`,children:`Agent`}),(0,f.jsx)(`option`,{value:`mcp`,children:`MCP`})]}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by date range`,value:v,onChange:e=>P(()=>y(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:`30d`,children:`Last 30 days`}),(0,f.jsx)(`option`,{value:`90d`,children:`Last 90 days`}),(0,f.jsx)(`option`,{value:`365d`,children:`Last year`}),(0,f.jsx)(`option`,{value:`all`,children:`All retained history`})]})]}),k.isError?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`Change history unavailable`}),(0,f.jsx)(`p`,{children:k.error instanceof Error?k.error.message:`Could not load the audit trail.`})]}):N.length===0?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`No changes match these filters`}),(0,f.jsx)(`p`,{children:`Widen the date range or clear the actor and search filters.`})]}):(0,f.jsx)(`div`,{className:`evidence-table-wrap mt-4`,children:(0,f.jsxs)(`table`,{className:`evidence-table`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`When`}),e?null:(0,f.jsx)(`th`,{children:`Scope`}),(0,f.jsx)(`th`,{children:`Action`}),(0,f.jsx)(`th`,{children:`Entity`}),(0,f.jsx)(`th`,{children:`Origin`}),(0,f.jsx)(`th`,{children:`Details`})]})}),(0,f.jsx)(`tbody`,{children:N.map(t=>(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{className:`whitespace-nowrap tabular-nums text-muted`,children:new Date(t.createdAt).toLocaleString()}),e?null:(0,f.jsx)(`td`,{className:`text-secondary`,children:t.projectId?j.get(t.projectId)??`Deleted project · ${t.projectId}`:`Instance settings`}),(0,f.jsx)(`td`,{children:(0,f.jsx)(a,{tone:g(t.action),children:t.action})}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-strong`,children:t.entityType}),t.entityId?(0,f.jsx)(`span`,{className:`mt-0.5 block max-w-48 truncate text-label-12-mono text-faint`,title:t.entityId,children:t.entityId}):null]}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-secondary`,children:h(t)}),t.actorSession?(0,f.jsxs)(`span`,{className:`mt-0.5 block max-w-40 truncate text-label-12-mono text-faint`,title:t.actorSession,children:[`Session `,t.actorSession]}):null]}),(0,f.jsx)(`td`,{children:t.diff==null?(0,f.jsx)(`span`,{className:`text-faint`,children:`No field diff`}):(0,f.jsxs)(`details`,{children:[(0,f.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary hover:text-strong`,children:`View diff`}),(0,f.jsx)(`pre`,{className:`max-h-72 max-w-xl overflow-auto whitespace-pre-wrap break-words rounded-md bg-bg-elevated p-3 text-copy-13 text-secondary`,children:JSON.stringify(t.diff,null,2)})]})})]},t.id))})]})}),!k.isError&&(t>0||A.length===p)?(0,f.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:t===0,onClick:()=>n(e=>Math.max(0,e-1)),children:`Previous`}),(0,f.jsxs)(`span`,{className:`text-label-12 tabular-nums text-muted`,children:[`Page `,t+1]}),(0,f.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:A.length<p,onClick:()=>n(e=>e+1),children:`Next`})]}):null]})}export{v as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,V as n,c as r,lt as i,s as a,w as o}from"./vendor-lucide-C3F7vHjd.js";import{r as s}from"./vendor-markdown-DMxglFrF.js";import{Bt as c,J as l,Tt as u,U as d,W as f,Y as p,et as m,jt as h,o as g,r as _,t as v,wn as y}from"./ToneBadge-DXhSJm1L.js";import{t as b}from"./async-handler-Bj3TnIRw.js";import{t as x}from"./card-B6QRK3vg.js";import{t as S}from"./Hint-Drf3KqdJ.js";var C=e(i(),1),w=s(),T=`https://commoncrawl.org/web-graphs`;function E(e){return e==null?`—`:e>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function D(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function O(e){switch(e){case`ready`:return`positive`;case`failed`:return`negative`;case`downloading`:case`querying`:case`queued`:return`caution`}}function k(){let[e,i]=(0,C.useState)(null),[s,k]=(0,C.useState)(null),[A,j]=(0,C.useState)([]),[M,N]=(0,C.useState)([]),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(!0),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(!1),[K,q]=(0,C.useState)(null),[J,Y]=(0,C.useState)(null),X=(0,C.useCallback)(async()=>{L(!0),q(null);try{let[e,t,n,r,a]=await Promise.all([d(),p().catch(()=>null),m().catch(()=>[]),f().catch(()=>[]),l().catch(()=>null)]);i(e),k(t),j(n),N(r),F(a)}catch(e){q(e instanceof Error?e.message:`Failed to load backlinks status`)}finally{L(!1)}},[]);(0,C.useEffect)(()=>{X()},[X]);async function Z(){z(!0),q(null),Y(null);try{let e=await u();Y(e.alreadyPresent?`DuckDB already installed (${e.version}).`:`Installed DuckDB ${e.version}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to install DuckDB`)}finally{z(!1)}}async function Q(){let e=H.trim()||void 0;V(!0),q(null),Y(null);try{let t=await y(e);Y(e?`Queued sync for ${t.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${t.release}. Download + query runs in the background.`),U(``),G(!1),await X()}catch(e){e instanceof g&&e.code===`MISSING_DEPENDENCY`?q(`DuckDB is not installed. Install it first.`):q(e instanceof Error?e.message:`Failed to trigger sync`)}finally{V(!1)}}async function $(e){q(null),Y(null);try{await c(e),Y(`Pruned cached release ${e}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to prune release`)}}let ee=s?.status===`ready`&&M.every(e=>e.release!==s.release);return(0,w.jsxs)(`div`,{className:`page-container`,children:[(0,w.jsx)(`div`,{className:`page-header`,children:(0,w.jsxs)(`div`,{className:`page-header-left`,children:[(0,w.jsx)(`h1`,{className:`page-title`,children:`Backlink data`}),(0,w.jsx)(`p`,{className:`page-subtitle`,children:`Manage the shared backlink source and review its latest data.`})]})}),K&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-negative-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-negative`,children:K})}),J&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-positive-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-positive`,children:J})}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Backlink source`})}),e?.duckdbInstalled?(0,w.jsx)(v,{tone:`positive`,children:`Installed`}):(0,w.jsx)(v,{tone:`caution`,children:`Not installed`})]}),(0,w.jsx)(x,{className:`surface-card p-4`,children:I?(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Checking…`}):e?.duckdbInstalled?(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Ready to sync a Common Crawl release.`}):(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Install the local query engine to enable release syncs.`}),!h()&&(0,w.jsxs)(_,{type:`button`,size:`sm`,disabled:R,onClick:b(Z),children:[(0,w.jsx)(n,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),R?`Installing…`:`Install DuckDB`]})]})})]}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsxs)(`h2`,{className:`flex items-center gap-2`,children:[`Release sync`,(0,w.jsx)(S,{label:`What is a release sync?`,children:`A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files.`})]})}),s&&(0,w.jsx)(v,{tone:O(s.status),children:s.status})]}),(0,w.jsxs)(`div`,{className:`space-y-4`,children:[s?(0,w.jsxs)(`div`,{className:`space-y-2 text-label-14`,children:[(0,w.jsxs)(`p`,{className:`text-strong`,children:[`Release `,(0,w.jsx)(`code`,{className:`text-neutral`,children:s.release})]}),s.phaseDetail&&(0,w.jsx)(`p`,{className:`text-secondary`,children:s.phaseDetail}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-label-12 text-muted pt-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Projects`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.projectsProcessed??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-faint normal-case text-label-12 flex items-center gap-1`,children:[`Rows`,(0,w.jsx)(S,{label:`What are rows?`,children:`Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace.`})]}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.domainsDiscovered??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Started`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.downloadStartedAt??s.createdAt)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Finished`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.queryFinishedAt)})]})]}),s.error&&(0,w.jsx)(`p`,{className:`text-copy-14 text-negative-400 pt-2`,children:s.error})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`No release sync has run in this workspace yet.`}),ee&&(0,w.jsx)(`div`,{className:`mt-4 rounded border border-caution-800/60 bg-caution-950/20 p-3`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(a,{className:`h-4 w-4 text-caution-400 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`text-label-14 text-neutral`,children:[(0,w.jsx)(`p`,{className:`text-copy-14-strong text-caution-200`,children:`Cached files for this release are missing.`}),(0,w.jsx)(`p`,{className:`mt-1 text-secondary`,children:`Sync this release again, or sync the newest release, before refreshing individual projects.`})]})]})}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-label-12 normal-case text-muted`,children:`Auto-detected release`}),P?(0,w.jsxs)(`p`,{className:`text-copy-14 text-strong mt-0.5`,children:[(0,w.jsx)(`code`,{className:`text-heading`,children:P.release}),(0,w.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[`Vertex `,E(P.vertexBytes),`, edges `,E(P.edgesBytes)]})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted mt-0.5`,children:I?`Checking Common Crawl…`:`Could not find a release. Choose one below.`}),(0,w.jsxs)(`a`,{href:T,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1 text-label-12 text-secondary hover:text-strong focus:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:[`Browse all Common Crawl web-graph releases`,(0,w.jsx)(t,{className:`h-3 w-3`,"aria-hidden":!0})]})]}),!h()&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,w.jsxs)(_,{type:`button`,size:`sm`,disabled:B||!e?.duckdbInstalled||!P&&!H.trim(),onClick:b(Q),children:[(0,w.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),B?`Queuing…`:`Run sync`]}),(0,w.jsxs)(S,{label:`What does Run sync do?`,children:[(0,w.jsxs)(`span`,{className:`block`,children:[`Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to`,` `,(0,w.jsx)(`code`,{className:`text-neutral`,children:`~/.canonry/cache/commoncrawl/`}),`, then runs a single DuckDB query that extracts referring domains for every project in this workspace.`]}),(0,w.jsxs)(`span`,{className:`mt-2 block text-secondary`,children:[`First time for a release: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`~10–20 min download + ~5 min query`}),`. Re-running the same release later: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`skips download, just re-queries`}),` (~5 min).`]})]})]})]}),h()?null:W?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:`flex-1 min-w-[240px] rounded border border-strong bg-transparent px-2.5 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`cc-main-2026-jan-feb-mar`,value:H,onChange:e=>U(e.target.value),disabled:B,autoFocus:!0}),(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>{U(``),G(!1)},disabled:B,children:`Cancel`})]}):(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>G(!0),disabled:B,children:`Use a different release →`})]}),!e?.duckdbInstalled&&(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mt-2`,children:`Install DuckDB first to enable sync.`})]})]}),(0,w.jsxs)(`details`,{className:`page-section-divider group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:`Technical details and cache`}),(0,w.jsxs)(`div`,{className:`mt-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mb-3`,children:`Cached releases support project re-extracts. Pruning a release does not remove saved backlink results.`}),(0,w.jsx)(`div`,{className:`overflow-x-auto`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Sync status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Size`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Last used`}),!h()&&(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong sr-only`,children:`Actions`})]})}),(0,w.jsxs)(`tbody`,{children:[M.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.syncStatus?(0,w.jsx)(v,{tone:O(e.syncStatus),children:e.syncStatus}):(0,w.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:E(e.bytes)}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.lastUsedAt)}),!h()&&(0,w.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsxs)(_,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{$(e.release)},children:[(0,w.jsx)(r,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),`Prune`]}),(0,w.jsx)(S,{label:`What does Prune do?`,placement:`top`,children:`Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download).`})]})})]},e.release)),M.length===0&&(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{className:`px-4 py-4 text-label-14 text-muted`,colSpan:h()?4:5,children:`No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts.`})})]})]})}),(0,w.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:`Common Crawl files are stored locally. DuckDB reads them; Canonry stores results in its normal database.`})]})]}),A.length>1&&(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Past release syncs`})})}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Projects`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Rows`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Finished`})]})}),(0,w.jsx)(`tbody`,{children:A.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:(0,w.jsx)(v,{tone:O(e.status),children:e.status})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.projectsProcessed??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.domainsDiscovered??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.queryFinishedAt??e.updatedAt)})]},e.id))})]})})]})]})}export{k as BacklinksPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,V as n,c as r,lt as i,s as a,w as o}from"./vendor-lucide-C3F7vHjd.js";import{r as s}from"./vendor-markdown-DMxglFrF.js";import{Bt as c,J as l,Tt as u,U as d,W as f,Y as p,et as m,jt as h,o as g,r as _,t as v,wn as y}from"./ToneBadge-BE2H103M.js";import{t as b}from"./async-handler-Bj3TnIRw.js";import{t as x}from"./card-BmJz19vt.js";import{t as S}from"./Hint-Drf3KqdJ.js";var C=e(i(),1),w=s(),T=`https://commoncrawl.org/web-graphs`;function E(e){return e==null?`—`:e>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function D(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function O(e){switch(e){case`ready`:return`positive`;case`failed`:return`negative`;case`downloading`:case`querying`:case`queued`:return`caution`}}function k(){let[e,i]=(0,C.useState)(null),[s,k]=(0,C.useState)(null),[A,j]=(0,C.useState)([]),[M,N]=(0,C.useState)([]),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(!0),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(!1),[K,q]=(0,C.useState)(null),[J,Y]=(0,C.useState)(null),X=(0,C.useCallback)(async()=>{L(!0),q(null);try{let[e,t,n,r,a]=await Promise.all([d(),p().catch(()=>null),m().catch(()=>[]),f().catch(()=>[]),l().catch(()=>null)]);i(e),k(t),j(n),N(r),F(a)}catch(e){q(e instanceof Error?e.message:`Failed to load backlinks status`)}finally{L(!1)}},[]);(0,C.useEffect)(()=>{X()},[X]);async function Z(){z(!0),q(null),Y(null);try{let e=await u();Y(e.alreadyPresent?`DuckDB already installed (${e.version}).`:`Installed DuckDB ${e.version}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to install DuckDB`)}finally{z(!1)}}async function Q(){let e=H.trim()||void 0;V(!0),q(null),Y(null);try{let t=await y(e);Y(e?`Queued sync for ${t.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${t.release}. Download + query runs in the background.`),U(``),G(!1),await X()}catch(e){e instanceof g&&e.code===`MISSING_DEPENDENCY`?q(`DuckDB is not installed. Install it first.`):q(e instanceof Error?e.message:`Failed to trigger sync`)}finally{V(!1)}}async function $(e){q(null),Y(null);try{await c(e),Y(`Pruned cached release ${e}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to prune release`)}}let ee=s?.status===`ready`&&M.every(e=>e.release!==s.release);return(0,w.jsxs)(`div`,{className:`page-container`,children:[(0,w.jsx)(`div`,{className:`page-header`,children:(0,w.jsxs)(`div`,{className:`page-header-left`,children:[(0,w.jsx)(`h1`,{className:`page-title`,children:`Backlink data`}),(0,w.jsx)(`p`,{className:`page-subtitle`,children:`Manage the shared backlink source and review its latest data.`})]})}),K&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-negative-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-negative`,children:K})}),J&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-positive-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-positive`,children:J})}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Backlink source`})}),e?.duckdbInstalled?(0,w.jsx)(v,{tone:`positive`,children:`Installed`}):(0,w.jsx)(v,{tone:`caution`,children:`Not installed`})]}),(0,w.jsx)(x,{className:`surface-card p-4`,children:I?(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Checking…`}):e?.duckdbInstalled?(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Ready to sync a Common Crawl release.`}):(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Install the local query engine to enable release syncs.`}),!h()&&(0,w.jsxs)(_,{type:`button`,size:`sm`,disabled:R,onClick:b(Z),children:[(0,w.jsx)(n,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),R?`Installing…`:`Install DuckDB`]})]})})]}),(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsx)(`div`,{children:(0,w.jsxs)(`h2`,{className:`flex items-center gap-2`,children:[`Release sync`,(0,w.jsx)(S,{label:`What is a release sync?`,children:`A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files.`})]})}),s&&(0,w.jsx)(v,{tone:O(s.status),children:s.status})]}),(0,w.jsxs)(`div`,{className:`space-y-4`,children:[s?(0,w.jsxs)(`div`,{className:`space-y-2 text-label-14`,children:[(0,w.jsxs)(`p`,{className:`text-strong`,children:[`Release `,(0,w.jsx)(`code`,{className:`text-neutral`,children:s.release})]}),s.phaseDetail&&(0,w.jsx)(`p`,{className:`text-secondary`,children:s.phaseDetail}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-label-12 text-muted pt-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Projects`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.projectsProcessed??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-faint normal-case text-label-12 flex items-center gap-1`,children:[`Rows`,(0,w.jsx)(S,{label:`What are rows?`,children:`Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace.`})]}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.domainsDiscovered??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Started`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.downloadStartedAt??s.createdAt)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Finished`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.queryFinishedAt)})]})]}),s.error&&(0,w.jsx)(`p`,{className:`text-copy-14 text-negative-400 pt-2`,children:s.error})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`No release sync has run in this workspace yet.`}),ee&&(0,w.jsx)(`div`,{className:`mt-4 rounded border border-caution-800/60 bg-caution-950/20 p-3`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(a,{className:`h-4 w-4 text-caution-400 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`text-label-14 text-neutral`,children:[(0,w.jsx)(`p`,{className:`text-copy-14-strong text-caution-200`,children:`Cached files for this release are missing.`}),(0,w.jsx)(`p`,{className:`mt-1 text-secondary`,children:`Sync this release again, or sync the newest release, before refreshing individual projects.`})]})]})}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-label-12 normal-case text-muted`,children:`Auto-detected release`}),P?(0,w.jsxs)(`p`,{className:`text-copy-14 text-strong mt-0.5`,children:[(0,w.jsx)(`code`,{className:`text-heading`,children:P.release}),(0,w.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[`Vertex `,E(P.vertexBytes),`, edges `,E(P.edgesBytes)]})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted mt-0.5`,children:I?`Checking Common Crawl…`:`Could not find a release. Choose one below.`}),(0,w.jsxs)(`a`,{href:T,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1 text-label-12 text-secondary hover:text-strong focus:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:[`Browse all Common Crawl web-graph releases`,(0,w.jsx)(t,{className:`h-3 w-3`,"aria-hidden":!0})]})]}),!h()&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,w.jsxs)(_,{type:`button`,size:`sm`,disabled:B||!e?.duckdbInstalled||!P&&!H.trim(),onClick:b(Q),children:[(0,w.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),B?`Queuing…`:`Run sync`]}),(0,w.jsxs)(S,{label:`What does Run sync do?`,children:[(0,w.jsxs)(`span`,{className:`block`,children:[`Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to`,` `,(0,w.jsx)(`code`,{className:`text-neutral`,children:`~/.canonry/cache/commoncrawl/`}),`, then runs a single DuckDB query that extracts referring domains for every project in this workspace.`]}),(0,w.jsxs)(`span`,{className:`mt-2 block text-secondary`,children:[`First time for a release: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`~10–20 min download + ~5 min query`}),`. Re-running the same release later: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`skips download, just re-queries`}),` (~5 min).`]})]})]})]}),h()?null:W?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:`flex-1 min-w-[240px] rounded border border-strong bg-transparent px-2.5 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`cc-main-2026-jan-feb-mar`,value:H,onChange:e=>U(e.target.value),disabled:B,autoFocus:!0}),(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>{U(``),G(!1)},disabled:B,children:`Cancel`})]}):(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>G(!0),disabled:B,children:`Use a different release →`})]}),!e?.duckdbInstalled&&(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mt-2`,children:`Install DuckDB first to enable sync.`})]})]}),(0,w.jsxs)(`details`,{className:`page-section-divider group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:`Technical details and cache`}),(0,w.jsxs)(`div`,{className:`mt-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mb-3`,children:`Cached releases support project re-extracts. Pruning a release does not remove saved backlink results.`}),(0,w.jsx)(`div`,{className:`overflow-x-auto`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Sync status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Size`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Last used`}),!h()&&(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong sr-only`,children:`Actions`})]})}),(0,w.jsxs)(`tbody`,{children:[M.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.syncStatus?(0,w.jsx)(v,{tone:O(e.syncStatus),children:e.syncStatus}):(0,w.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:E(e.bytes)}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.lastUsedAt)}),!h()&&(0,w.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsxs)(_,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{$(e.release)},children:[(0,w.jsx)(r,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),`Prune`]}),(0,w.jsx)(S,{label:`What does Prune do?`,placement:`top`,children:`Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download).`})]})})]},e.release)),M.length===0&&(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{className:`px-4 py-4 text-label-14 text-muted`,colSpan:h()?4:5,children:`No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts.`})})]})]})}),(0,w.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:`Common Crawl files are stored locally. DuckDB reads them; Canonry stores results in its normal database.`})]})]}),A.length>1&&(0,w.jsxs)(`section`,{className:`page-section`,children:[(0,w.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,w.jsx)(`div`,{children:(0,w.jsx)(`h2`,{children:`Past release syncs`})})}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Projects`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Rows`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Finished`})]})}),(0,w.jsx)(`tbody`,{children:A.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:(0,w.jsx)(v,{tone:O(e.status),children:e.status})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.projectsProcessed??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.domainsDiscovered??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.queryFinishedAt??e.updatedAt)})]},e.id))})]})})]})]})}export{k as BacklinksPage};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./vendor-markdown-DMxglFrF.js";import{c as t,h as n,i as r,p as i,r as a,s as o,t as s,u as c}from"./vendor-recharts-DAGVAt0P.js";import{Sc as l,qc as u}from"./ToneBadge-DXhSJm1L.js";var d={ambiguous:`Property identity unverified`},f=`No answer could be tied to one property`;function p(e){return e.denominator===null||e.denominator===void 0||e.unattributed===void 0||e.unattributed<=0?null:`${e.unattributed} of ${e.denominator+e.unattributed} answers could not be tied to one property`}function m(e){if(e.denominator===null||e.denominator===void 0||e.unchecked===void 0||e.unchecked<=0)return null;let t=e.denominator+e.unchecked+(e.citationNotMeasured??0);return`${e.unchecked} of ${t} ${t===1?`answer`:`answers`} had sources that could not be checked`}var h=`The engine returns no sources, so whether it cites you is not measured.`;function g(e){if(e.denominator===null||e.denominator===void 0||e.citationNotMeasured===void 0||e.citationNotMeasured<=0)return null;let t=e.denominator+(e.unchecked??0)+e.citationNotMeasured;return`${e.citationNotMeasured} of ${t} ${t===1?`answer`:`answers`} came from engines that return no sources`}var _={label:`Not measured`,signal:`Citation not measured`,timeline:`citation not measured`,sources:h},v=function(e){return e.Clicks=`clicks`,e.Impressions=`impressions`,e.CTR=`ctr`,e.Position=`position`,e}({}),y={clicks:`Clicks`,impressions:`Impressions`,ctr:`CTR`,position:`Position`},b=l;function x(e){return e.endsWith(`%`)?{figure:e.slice(0,-1),sign:`%`}:{figure:e,sign:``}}function S(e,t){if(t!==`cited`)return p(e);let n=[m(e),g(e)].filter(e=>e!==null);return n.length===0?null:n.join(`; `)}function C(e,t){let n=S(e,t);if(n===null)return null;let r=t===`cited`?[...e.unchecked?[`${e.unchecked} unchecked`]:[],...e.citationNotMeasured?[`${e.citationNotMeasured} not measured`]:[]]:e.unattributed?[`${e.unattributed} unattributed`]:[],i=t===`cited`?(e.unchecked??0)+(e.citationNotMeasured??0):e.unattributed??0;if(r.length===0)return null;let a=r.join(`, `);return{label:a,text:`${a}. ${n}, so this rate leaves ${i===1?`it`:`them`} out.`}}function w(e,t){let n=u(e);switch(t){case`cited`:return`${n} cited (any page)`;case`emerging`:return`${n} newly cited (any page)`;case`lost`:return`${n} citation lost (any page)`;case`not-cited`:return`${n} not cited (any page)`;case`not-measured`:return`${n} citation not measured`;case`pending`:return`Pending`}}var T={cited:`Cited`,"not-cited":`Not cited`,"not-measured":_.label};function E(e){let t=[];if(e.message&&t.push(e.message),e.providers)for(let[n,r]of Object.entries(e.providers)){let e=`[${n}] ${r.message}`;r.raw===void 0?t.push(e):t.push(`${e}\n\n${JSON.stringify(r.raw,null,2)}`)}return t.length>0?t.join(`
1
+ import{r as e}from"./vendor-markdown-DMxglFrF.js";import{c as t,h as n,i as r,p as i,r as a,s as o,t as s,u as c}from"./vendor-recharts-DAGVAt0P.js";import{Xc as l,wc as u}from"./ToneBadge-BE2H103M.js";var d={ambiguous:`Property identity unverified`},f=`No answer could be tied to one property`;function p(e){return e.denominator===null||e.denominator===void 0||e.unattributed===void 0||e.unattributed<=0?null:`${e.unattributed} of ${e.denominator+e.unattributed} answers could not be tied to one property`}function m(e){if(e.denominator===null||e.denominator===void 0||e.unchecked===void 0||e.unchecked<=0)return null;let t=e.denominator+e.unchecked+(e.citationNotMeasured??0);return`${e.unchecked} of ${t} ${t===1?`answer`:`answers`} had sources that could not be checked`}var h=`The engine returns no sources, so whether it cites you is not measured.`;function g(e){if(e.denominator===null||e.denominator===void 0||e.citationNotMeasured===void 0||e.citationNotMeasured<=0)return null;let t=e.denominator+(e.unchecked??0)+e.citationNotMeasured;return`${e.citationNotMeasured} of ${t} ${t===1?`answer`:`answers`} came from engines that return no sources`}var _={label:`Not measured`,signal:`Citation not measured`,timeline:`citation not measured`,sources:h},v=function(e){return e.Clicks=`clicks`,e.Impressions=`impressions`,e.CTR=`ctr`,e.Position=`position`,e}({}),y={clicks:`Clicks`,impressions:`Impressions`,ctr:`CTR`,position:`Position`},b=u;function x(e){return e.endsWith(`%`)?{figure:e.slice(0,-1),sign:`%`}:{figure:e,sign:``}}function S(e,t){if(t!==`cited`)return p(e);let n=[m(e),g(e)].filter(e=>e!==null);return n.length===0?null:n.join(`; `)}function C(e,t){let n=S(e,t);if(n===null)return null;let r=t===`cited`?[...e.unchecked?[`${e.unchecked} unchecked`]:[],...e.citationNotMeasured?[`${e.citationNotMeasured} not measured`]:[]]:e.unattributed?[`${e.unattributed} unattributed`]:[],i=t===`cited`?(e.unchecked??0)+(e.citationNotMeasured??0):e.unattributed??0;if(r.length===0)return null;let a=r.join(`, `);return{label:a,text:`${a}. ${n}, so this rate leaves ${i===1?`it`:`them`} out.`}}function w(e,t){let n=l(e);switch(t){case`cited`:return`${n} cited (any page)`;case`emerging`:return`${n} newly cited (any page)`;case`lost`:return`${n} citation lost (any page)`;case`not-cited`:return`${n} not cited (any page)`;case`not-measured`:return`${n} citation not measured`;case`pending`:return`Pending`}}var T={cited:`Cited`,"not-cited":`Not cited`,"not-measured":_.label};function E(e){let t=[];if(e.message&&t.push(e.message),e.providers)for(let[n,r]of Object.entries(e.providers)){let e=`[${n}] ${r.message}`;r.raw===void 0?t.push(e):t.push(`${e}\n\n${JSON.stringify(r.raw,null,2)}`)}return t.length>0?t.join(`
2
2
 
3
3
  `):`Run failed.`}function D(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function O(e,t,n=new Date){let r=new Date(e);if(Number.isNaN(r.getTime()))return e;let i=r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`});return t&&new Date(t).toDateString()===r.toDateString()?i:`${k(e,n)}, ${i}`}function k(e,t=new Date){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.getFullYear()===t.getFullYear()?A(e):n.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}function A(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function j(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function M(e){return e===null?`Unknown`:e?`Pass`:`Fail`}function N(e){return e===0?`12:00 AM`:e<12?`${e}:00 AM`:e===12?`12:00 PM`:`${e-12}:00 PM`}function P(e,t){return e===`twice-daily`?`twice-daily`:e.startsWith(`weekly@`)?`${e}@${t}`:`daily@${t}`}function F(e,t){if(!e)return{freq:`custom`,hour:6,customCron:t};if(e===`twice-daily`)return{freq:`twice-daily`,hour:6,customCron:``};let n=e.match(/^daily(?:@(\d+))?$/);if(n)return{freq:`daily`,hour:n[1]?parseInt(n[1]):6,customCron:``};let r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:``}:{freq:`custom`,hour:6,customCron:t}}function I(e,t,n){let r=n===`UTC`?`UTC`:n.split(`/`).pop()?.replace(/_/g,` `)??n;if(!e)return`Custom: ${t} · ${r}`;if(e===`twice-daily`)return`Twice a day (6am & 6pm) · ${r}`;let i=e.match(/^daily(?:@(\d+))?$/);if(i)return`Every day at ${N(i[1]?parseInt(i[1]):6)} · ${r}`;let a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){let e={mon:`Monday`,tue:`Tuesday`,wed:`Wednesday`,thu:`Thursday`,fri:`Friday`,sat:`Saturday`,sun:`Sunday`},t=a[2]?parseInt(a[2]):6;return`Every ${e[a[1]]} at ${N(t)} · ${r}`}return`${e} · ${r}`}function L(e,t){return t&&t!==e?`${e} · ${t}`:e}function R(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=new Intl.DateTimeFormat(`en-US`,{timeZoneName:`short`}).formatToParts().find(e=>e.type===`timeZoneName`)?.value;return L(e,t)}var z=e(),B={contentStyle:{backgroundColor:`var(--chart-tooltip-bg, #0a0a0a)`,border:`none`,borderRadius:`var(--radius-material-tooltip)`,boxShadow:`var(--shadow-material-tooltip)`,fontSize:13,lineHeight:`18px`,fontWeight:400},labelStyle:{color:`var(--chart-tooltip-label, #ededed)`},itemStyle:{color:`var(--chart-tooltip-item, #a1a1a1)`}},V={fill:`var(--chart-neutral-text-dim, #a1a1a1)`,fontSize:12},H=`var(--chart-grid, #2e2e2e)`,U=`var(--chart-axis, #2e2e2e)`,W=[`var(--chart-series-1, #34d399)`,`var(--chart-series-2, #60a5fa)`,`var(--chart-series-3, #f472b6)`,`var(--chart-series-4, #facc15)`,`var(--chart-series-5, #a78bfa)`,`var(--chart-series-6, #fb923c)`,`var(--chart-series-7, #22d3ee)`,`var(--chart-series-8, #f87171)`],G={gemini:`#60a5fa`,openai:`#34d399`,claude:`#fb923c`,perplexity:`#22d3ee`,muse:`#818cf8`,local:`#a78bfa`};function K(e,t=0){return G[e]??W[t%W.length]}var q={text:`var(--chart-neutral-text, #a1a1a1)`,textDim:`var(--chart-neutral-text-dim, #a1a1a1)`,textFaint:`var(--chart-neutral-text-faint, #7d7d7d)`,surface:`var(--chart-neutral-surface, #2e2e2e)`,trackSubtle:`var(--chart-neutral-track-subtle, rgb(255 255 255 / 0.04))`,gridLine:`var(--chart-neutral-grid-line, rgb(255 255 255 / 0.06))`},J={positive:`var(--chart-tone-positive, #34d399)`,positiveDeep:`var(--chart-tone-positive-deep, #10b981)`,caution:`var(--chart-tone-caution, #fbbf24)`,negative:`var(--chart-tone-negative, #fb7185)`,neutral:`var(--chart-tone-neutral, #a1a1a1)`};function Y(e){return e}function X(e){let t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);return t?{year:Number(t[1]),month:Number(t[2]),day:Number(t[3])}:null}function Z(e){let t=String(e),n=X(t);return n?new Date(Date.UTC(n.year,n.month-1,n.day)).toLocaleDateString(void 0,{timeZone:`UTC`,month:`short`,day:`numeric`,year:`numeric`}):t}function Q(e){let t=X(String(e));return t?`${t.month}/${t.day}`:String(e)}function $(e){let t=X(String(e));return t?new Date(Date.UTC(t.year,t.month-1,t.day)).toLocaleDateString(void 0,{timeZone:`UTC`,month:`short`,day:`numeric`}):String(e)}function ee(e){return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function te(e){return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function ne(e){return new Date(e).getFullYear()}function re(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()}`}function ie({data:e,xKey:l,series:u,height:d=260,xTickFormatter:f,labelFormatter:p,onSelectX:m,selectedX:h,accessibilityLayer:g=!0,ariaLabel:_}){let v=[...new Set(u.map(e=>e.axisId))],y=new Map(u.map(e=>[e.label,e.formatValue])),b=e.map((t,n)=>{let r={...t};for(let t of u){if(!t.trend)continue;let i=t.trend.startIndex??0,a=t.trend.endIndex??e.length-1;n<i||n>a?r[`${t.dataKey}__trend`]=null:r[`${t.dataKey}__trend`]=a<=i?t.trend.start:t.trend.start+(t.trend.end-t.trend.start)*(n-i)/(a-i)}return r});return(0,z.jsx)(n,{width:`100%`,height:d,children:(0,z.jsxs)(s,{data:b,accessibilityLayer:g,"aria-label":_,margin:{top:8,right:8,bottom:4,left:0},onClick:m?e=>{e?.activeLabel!==void 0&&m(String(e.activeLabel))}:void 0,style:m?{cursor:`pointer`}:void 0,children:[(0,z.jsx)(t,{stroke:H,strokeDasharray:`3 3`,vertical:!1}),h!=null&&(0,z.jsx)(c,{x:h,yAxisId:v[0],stroke:q.text,strokeDasharray:`2 3`,strokeWidth:1}),(0,z.jsx)(r,{dataKey:l,tick:V,stroke:U,tickFormatter:f,minTickGap:24}),v.map((e,t)=>{let n=u.find(t=>t.axisId===e);return(0,z.jsx)(a,{yAxisId:e,orientation:t===1?`right`:`left`,hide:t>1,reversed:n.inverted??!1,domain:n.inverted?[1,`auto`]:[0,`auto`],tick:V,stroke:U,width:48,tickFormatter:n.formatValue},e)}),(0,z.jsx)(i,{...B,labelFormatter:e=>{let t=typeof e==`string`||typeof e==`number`?String(e):``;return p?p(t):t},formatter:(e,t)=>{let n=String(t??``);return typeof e==`number`?[y.get(n)?.(e)??e.toLocaleString(),n]:[String(e??``),n]}}),u.filter(e=>e.trend).map(e=>(0,z.jsx)(o,{yAxisId:e.axisId,dataKey:`${e.dataKey}__trend`,name:`${e.label} trend`,stroke:e.color,strokeWidth:1.5,strokeDasharray:`5 4`,strokeOpacity:.55,dot:!1,activeDot:!1,isAnimationActive:!1,legendType:`none`,tooltipType:`none`},`${e.dataKey}-trend`)),u.map(e=>(0,z.jsx)(o,{yAxisId:e.axisId,dataKey:e.dataKey,name:e.label,stroke:e.color,strokeWidth:2,dot:!1,activeDot:{r:3},connectNulls:e.connectNulls??!1,isAnimationActive:!1},e.dataKey))]})})}export{R as A,d as B,M as C,k as D,A as E,b as F,D as I,_ as L,I as M,w as N,O,x as P,h as R,C as S,N as T,K as _,W as a,v as b,ie as c,Q as d,ee as f,ne as g,Y as h,q as i,F as j,j as k,Z as l,re as m,V as n,J as o,te as p,H as r,B as s,U as t,$ as u,T as v,E as w,P as x,y,f as z};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-markdown-DMxglFrF.js";import{t}from"./AuditHistoryPanel-CutYGRGi.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`page-container`,children:[(0,n.jsx)(`div`,{className:`page-header`,children:(0,n.jsxs)(`div`,{className:`page-header-left`,children:[(0,n.jsx)(`h1`,{className:`page-title`,children:`History`}),(0,n.jsx)(`p`,{className:`page-subtitle`,children:`Changes to projects and settings.`})]})}),(0,n.jsx)(t,{})]})}export{r as HistoryPage};
1
+ import{r as e}from"./vendor-markdown-DMxglFrF.js";import{t}from"./AuditHistoryPanel-Br4LNvcM.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`page-container`,children:[(0,n.jsx)(`div`,{className:`page-header`,children:(0,n.jsxs)(`div`,{className:`page-header-left`,children:[(0,n.jsx)(`h1`,{className:`page-title`,children:`History`}),(0,n.jsx)(`p`,{className:`page-subtitle`,children:`Changes to projects and settings.`})]})}),(0,n.jsx)(t,{})]})}export{r as HistoryPage};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t,st as n}from"./vendor-lucide-C3F7vHjd.js";import{r}from"./vendor-markdown-DMxglFrF.js";import{_ as i,d as a,f as o,p as s,u as c,v as l,x as u}from"./vendor-tanstack-ZnWhYpCU.js";import{At as d,Fs as f,Is as p,Ls as ee,Mc as m,Nc as h,Xs as g,pt as te,r as _,t as v,xt as y}from"./ToneBadge-DXhSJm1L.js";import{R as b,S as x,f as S,h as C,z as w}from"./ChartPrimitives-Bb1-9BLv.js";import{r as ne}from"./account-context-BlFU3aZm.js";import{Dt as re,Et as ie,Ft as ae,Mt as T,Ot as oe,Tt as E,kt as D,yn as O}from"./react-query-CZrEo0vf.js";import{E as k,n as A}from"./AccessControls-CUwUDBp8.js";import{t as j}from"./InfoTooltip-Dm4gYO4N.js";import{Dt as se,G as ce,J as M,Q as N,Z as P,dt as F,et as le,jt as ue,kt as de,lt as I,mt as L,ut as R}from"./index-MwrSHGLh.js";import{c as z,r as B,s as fe,t as pe,u as V}from"./service-LmTWkeKI.js";var H=e(t(),1),U=r(),W={heading:`Names that count as this Property`,help:`These names identify this Property in answer text. Source titles and URLs do not count as mentions. Qualified names add distinguishing words when several Properties share a name, such as a product line, service, or location.`,names:`Names`,qualifiedNames:`Qualified names`,noNames:`No names are set, so answers can cite this Property but never mention it.`,edit:`Edit names`,save:`Save to draft`,saving:`Saving…`,cancel:`Cancel`,namesHint:`One name per line.`,qualifiedHint:`One per line. Include a name above plus words that identify this specific Property.`,qualifiedNote:`With qualified names set, an answer that uses only a plain name counts as a mention only when it also cites this Property’s own page. Otherwise it is left out as not tied to one property.`,draftOnly:`Saving changes the draft only. Nothing is measured differently until the setup is published.`,saved:`Saved to the draft. Publish the setup to start using these names.`,pending:`Name changes are saved in the draft and not published yet.`,review:`Review and publish`,noChanges:`No changes to save.`,staleDraft:`The draft is based on an older published setup. Open measurement setup to restart it before editing names.`,missingFromDraft:`This Property is not included in the current draft. Open measurement setup to review it.`,conflict:`The draft changed in another session. The latest names are loaded; review them and save again.`,failed:`Could not save these names. Try again.`};function me(e){return[...new Set(e.split(`
2
- `).map(e=>e.trim()).filter(Boolean))]}function he(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function G(e,t){return he(e.aliases,t.aliases)&&he(e.identityAliases??[],t.identityAliases??[])}function ge(e,t,n){let{identityAliases:r,...i}=e;return n.length>0?{...i,aliases:t,identityAliases:n}:{...i,aliases:t}}function _e({label:e,names:t}){return(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e}),(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,U.jsx)(`li`,{className:`text-label-14 text-secondary`,children:e},e))})]})}function K({id:e,issues:t}){return t.length===0?null:(0,U.jsx)(`ul`,{id:e,className:`mt-2 space-y-1`,"aria-label":`Name warnings`,children:t.map(e=>(0,U.jsx)(`li`,{className:`text-label-14 text-caution`,children:f(e)},`${e.field}:${e.index}`))})}function ve({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:i,service:a=pe}){let{canWrite:o}=ne(),s=(0,H.useId)(),d=u({...ie({client:y,path:{name:e}}),enabled:o}),f=u({...ae({client:y,path:{name:e}}),enabled:o}),m=d.data?.draft?.authoring.targets.find(e=>e.stableKey===t),h=n.identityAliases??[],g=m!==void 0&&d.data?.draft?.baseActiveRevision===r&&!G(m,n),te=!d.isFetching&&!f.isPending,v=f.data,b=(0,H.useMemo)(()=>v?ee(v):i,[v,i]),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(``),[re,T]=(0,H.useState)(``),[oe,E]=(0,H.useState)(n),[D,O]=(0,H.useState)(null),k=`${e}\u0000${t}`,[se,ce]=(0,H.useState)(k);se!==k&&(ce(k),S(!1),w(``),T(``),E(n),O(null));let M=(0,H.useRef)(k);M.current=k;let N=(0,H.useMemo)(()=>me(C),[C]),P=(0,H.useMemo)(()=>me(re),[re]),F=(0,H.useMemo)(()=>p({aliases:N,identityAliases:P,brandNames:b}),[N,P,b]),le=F.filter(e=>e.field===`aliases`),ue=F.filter(e=>e.field===`identityAliases`);function de(e){w(e.aliases.join(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t,st as n}from"./vendor-lucide-C3F7vHjd.js";import{r}from"./vendor-markdown-DMxglFrF.js";import{_ as i,d as a,f as o,p as s,u as c,v as l,x as u}from"./vendor-tanstack-ZnWhYpCU.js";import{At as d,Fc as f,Ic as p,Is as m,Ls as ee,Rs as h,Zs as g,pt as te,r as _,t as v,xt as y}from"./ToneBadge-BE2H103M.js";import{R as b,S as x,f as S,h as C,z as w}from"./ChartPrimitives-ChO_4pZz.js";import{r as ne}from"./account-context-y7mzU3Ko.js";import{Dt as re,Et as ie,Ft as ae,Mt as T,Ot as oe,Tt as E,kt as D,yn as O}from"./react-query-BnTbVX2a.js";import{E as k,n as A}from"./AccessControls-2bimiIhw.js";import{t as j}from"./InfoTooltip-Dm4gYO4N.js";import{Dt as se,G as ce,J as M,Q as N,Z as P,dt as F,et as le,jt as ue,kt as de,lt as I,mt as L,ut as R}from"./index-s7MwkxGB.js";import{c as z,r as B,s as fe,t as pe,u as V}from"./service-BKTlKu2x.js";var H=e(t(),1),U=r(),W={heading:`Names that count as this Property`,help:`These names identify this Property in answer text. Source titles and URLs do not count as mentions. Qualified names add distinguishing words when several Properties share a name, such as a product line, service, or location.`,names:`Names`,qualifiedNames:`Qualified names`,noNames:`No names are set, so answers can cite this Property but never mention it.`,edit:`Edit names`,save:`Save to draft`,saving:`Saving…`,cancel:`Cancel`,namesHint:`One name per line.`,qualifiedHint:`One per line. Include a name above plus words that identify this specific Property.`,qualifiedNote:`With qualified names set, an answer that uses only a plain name counts as a mention only when it also cites this Property’s own page. Otherwise it is left out as not tied to one property.`,draftOnly:`Saving changes the draft only. Nothing is measured differently until the setup is published.`,saved:`Saved to the draft. Publish the setup to start using these names.`,pending:`Name changes are saved in the draft and not published yet.`,review:`Review and publish`,noChanges:`No changes to save.`,staleDraft:`The draft is based on an older published setup. Open measurement setup to restart it before editing names.`,missingFromDraft:`This Property is not included in the current draft. Open measurement setup to review it.`,conflict:`The draft changed in another session. The latest names are loaded; review them and save again.`,failed:`Could not save these names. Try again.`};function me(e){return[...new Set(e.split(`
2
+ `).map(e=>e.trim()).filter(Boolean))]}function he(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function G(e,t){return he(e.aliases,t.aliases)&&he(e.identityAliases??[],t.identityAliases??[])}function ge(e,t,n){let{identityAliases:r,...i}=e;return n.length>0?{...i,aliases:t,identityAliases:n}:{...i,aliases:t}}function _e({label:e,names:t}){return(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e}),(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,U.jsx)(`li`,{className:`text-label-14 text-secondary`,children:e},e))})]})}function K({id:e,issues:t}){return t.length===0?null:(0,U.jsx)(`ul`,{id:e,className:`mt-2 space-y-1`,"aria-label":`Name warnings`,children:t.map(e=>(0,U.jsx)(`li`,{className:`text-label-14 text-caution`,children:m(e)},`${e.field}:${e.index}`))})}function ve({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:i,service:a=pe}){let{canWrite:o}=ne(),s=(0,H.useId)(),d=u({...ie({client:y,path:{name:e}}),enabled:o}),f=u({...ae({client:y,path:{name:e}}),enabled:o}),p=d.data?.draft?.authoring.targets.find(e=>e.stableKey===t),m=n.identityAliases??[],g=p!==void 0&&d.data?.draft?.baseActiveRevision===r&&!G(p,n),te=!d.isFetching&&!f.isPending,v=f.data,b=(0,H.useMemo)(()=>v?h(v):i,[v,i]),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(``),[re,T]=(0,H.useState)(``),[oe,E]=(0,H.useState)(n),[D,O]=(0,H.useState)(null),k=`${e}\u0000${t}`,[se,ce]=(0,H.useState)(k);se!==k&&(ce(k),S(!1),w(``),T(``),E(n),O(null));let M=(0,H.useRef)(k);M.current=k;let N=(0,H.useMemo)(()=>me(C),[C]),P=(0,H.useMemo)(()=>me(re),[re]),F=(0,H.useMemo)(()=>ee({aliases:N,identityAliases:P,brandNames:b}),[N,P,b]),le=F.filter(e=>e.field===`aliases`),ue=F.filter(e=>e.field===`identityAliases`);function de(e){w(e.aliases.join(`
3
3
  `)),T((e.identityAliases??[]).join(`
4
- `)),E({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function I(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function L(){de(g?m:n),O(null),S(!0)}function R(e){e&&de(e),O({tone:`negative`,text:W.conflict,review:!1})}let z=l({mutationFn:async i=>{let o=await a.loadDraft(e);if(!o.draft){if(G(i.names,n))return{outcome:`unchanged`};if(!G(i.base,n))return{outcome:`conflict`,latest:n};await a.createDraft(e,r),o=await a.loadDraft(e)}let s=o.draft;if(!s||!o.etag)throw Error(W.failed);if(s.baseActiveRevision!==r)return{outcome:`stale`};let c=s.authoring.targets.find(e=>e.stableKey===t);return!c||c.status!==`included`?{outcome:`missing`}:G(i.names,c)?{outcome:`unchanged`}:G(i.base,c)?(await a.upsertTarget(e,o.etag,ge(c,i.names.aliases,i.names.identityAliases)),{outcome:`saved`}):{outcome:`conflict`,latest:c}},meta:{skipGlobalErrorToast:!0},onSuccess:(e,t)=>{if(t.openFor===M.current)switch(e.outcome){case`saved`:S(!1),O({tone:`positive`,text:W.saved,review:!0});return;case`unchanged`:S(!1),O({tone:`positive`,text:W.noChanges,review:!1});return;case`stale`:O({tone:`negative`,text:W.staleDraft,review:!0});return;case`missing`:O({tone:`negative`,text:W.missingFromDraft,review:!0});return;case`conflict`:R(e.latest),d.refetch();return}},onError:(e,t)=>{t.openFor===M.current&&(B(e)?(R(null),d.refetch().then(e=>{e.isSuccess&&R(I(e.data))})):O({tone:`negative`,text:W.failed,review:!1}))}}),fe=(0,U.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:e},className:`text-link underline-offset-2 hover:underline`,children:W.review}),V=n.aliases.length+h.length;return(0,U.jsxs)(`section`,{"aria-labelledby":`property-names`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-names`,className:`text-heading-16 text-heading`,children:W.heading}),(0,U.jsx)(j,{text:W.help})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[V,` `,V===1?`name`:`names`]}),o&&!x?(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:!te,onClick:L,children:W.edit}):null]})]}),D?(0,U.jsxs)(`p`,{role:D.tone===`negative`?`alert`:`status`,className:`mb-3 text-copy-14 ${D.tone===`negative`?`text-negative`:`text-positive`}`,children:[D.text,D.review?(0,U.jsxs)(U.Fragment,{children:[` `,fe]}):null]}):g&&!x?(0,U.jsxs)(`p`,{role:`status`,className:`mb-3 text-copy-14 text-caution`,children:[W.pending,` `,fe]}):null,x?(0,U.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!z.isPending&&z.mutate({names:{aliases:N,identityAliases:P},base:oe,openFor:k})},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{htmlFor:`${s}-names`,className:`block text-label-14-strong text-heading`,children:W.names}),(0,U.jsx)(`p`,{id:`${s}-names-hint`,className:`text-copy-14 text-secondary`,children:W.namesHint}),(0,U.jsx)(`textarea`,{id:`${s}-names`,className:`mt-1 min-h-24 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-names-hint${le.length?` ${s}-names-issues`:``}`,value:C,onChange:e=>w(e.target.value)}),(0,U.jsx)(K,{id:`${s}-names-issues`,issues:le}),N.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-copy-14 text-caution`,children:W.noNames}):null]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{htmlFor:`${s}-qualified`,className:`block text-label-14-strong text-heading`,children:W.qualifiedNames}),(0,U.jsx)(`p`,{id:`${s}-qualified-hint`,className:`text-copy-14 text-secondary`,children:W.qualifiedHint}),(0,U.jsx)(`textarea`,{id:`${s}-qualified`,className:`mt-1 min-h-20 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-qualified-hint ${s}-qualified-note${ue.length?` ${s}-qualified-issues`:``}`,value:re,onChange:e=>T(e.target.value)}),(0,U.jsx)(K,{id:`${s}-qualified-issues`,issues:ue}),(0,U.jsx)(`p`,{id:`${s}-qualified-note`,className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:W.qualifiedNote})]}),(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:W.draftOnly}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(A,{type:`submit`,className:`h-11 px-4 text-label-14 md:h-11`,disabled:z.isPending,children:z.isPending?W.saving:W.save}),(0,U.jsx)(_,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:z.isPending,onClick:()=>{S(!1),O(null)},children:W.cancel})]})]}):V===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:W.noNames}):(0,U.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[n.aliases.length>0?(0,U.jsx)(_e,{label:W.names,names:n.aliases}):null,h.length>0?(0,U.jsx)(_e,{label:W.qualifiedNames,names:h}):null]})]})}var ye=50,q={branded:{technical:`Branded queries`},"non-brand":{technical:`Non-brand queries`}},J={plan_v1:`Setup update required`,no_completed_run:`No completed measurement yet`,no_population:`No queries of this type are assigned`,evidence_incomplete:`Source evidence is incomplete`,identity_ambiguous:w,not_applicable:`Not applicable for this Property`,citation_not_measured:`The engines return no sources`},be={complete:{label:`Measured`,tone:`positive`},partial:{label:`Partly measured`,tone:`caution`},running:{label:`Measuring now`,tone:`neutral`},queued:{label:`Measurement queued`,tone:`neutral`},failed:{label:`Measurement failed`,tone:`negative`},not_measured:{label:`Not measured`,tone:`neutral`}},Y={assigned:{label:`Matches this Property`,tone:`positive`},sibling:{label:`Matches another Property`,tone:`caution`},ownedUnmapped:{label:`Site URL not in a Property`,tone:`caution`},external:{label:`External URL`,tone:`neutral`},ambiguous:{label:`Matches multiple Properties`,tone:`caution`},invalid:{label:`Invalid URL`,tone:`negative`}};function X(e){return[...e].sort((e,t)=>Number(t.classification===`assigned`)-Number(e.classification===`assigned`))}function xe(e){return`${e.expectedSlotId}:${e.usageEdgeId}`}function Se({row:e}){return e.mentioned===null?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not measured`}),(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:`No mention signal for this Property`})]}):!e.mentioned&&e.mentionIdentity===`wrong-subject`?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not mentioned`}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-label-12 text-muted`,children:[L.label,(0,U.jsx)(j,{text:L.property})]})]}):(0,U.jsx)(v,{tone:e.mentioned?`positive`:`neutral`,children:e.mentioned?`Mentioned`:`Not mentioned`})}var Ce=`—`;function we({row:e}){return e.cited===null?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not measured`}),(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:e.citationMeasured===!1?`The engine returns no sources`:`Sources were not fully captured`})]}):(0,U.jsx)(v,{tone:e.cited?`positive`:`neutral`,children:e.cited?`Cited`:`Not cited`})}function Te({row:e}){return e.citationMeasured===!1?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:b}):e.cited===null&&e.sources.length===0?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`The sources for this answer were not fully captured, so none can be shown.`}):e.sources.length===0?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer returned no source URLs at all.`}):(0,U.jsxs)(`details`,{className:`mt-2`,"data-answer-sources":!0,children:[(0,U.jsxs)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[R,` (`,e.sources.length,`)`]}),(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsxs)(`caption`,{className:`sr-only`,children:[`Source URLs for `,e.queryText]}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Match`}),(0,U.jsx)(`th`,{children:`URL`})]})}),(0,U.jsx)(`tbody`,{children:X(e.sources).map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(v,{tone:Y[e.classification].tone,children:Y[e.classification].label})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(I,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function Ee({project:e,targetKey:t,resultId:n}){let r=u({...T({client:y,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`alert`,children:`Could not load this answer.`});let i=r.data?.answer;return i==null||i.trim()===``?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,U.jsx)(`div`,{className:`py-2`,children:(0,U.jsx)(F,{headingLevel:4,copyable:!0,children:i})})}function De(e){return J[e.reason]??`Not measured`}function Oe({metric:e,signal:t,queryClass:n,emphasis:r=!1,compact:i=!1}){if(e.state===`unavailable`)return(0,U.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:r?`text-label-18-strong text-secondary`:`text-label-14-strong text-secondary`,children:`Not measured`}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:De(e)})]});let a=g(e.value),o=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,s=x(e,t);return i?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-end gap-0.5`,children:[(0,U.jsxs)(`span`,{className:`engine-comparison-metric`,children:[(0,U.jsx)(`span`,{className:`text-label-14-strong text-primary`,children:a}),o?(0,U.jsxs)(`span`,{className:`text-label-13 text-secondary`,"aria-hidden":`true`,children:[e.numerator,`/`,e.denominator]}):null,(0,U.jsxs)(`span`,{className:`sr-only`,children:[o?` · ${o} answers`:``,` · `,n,` queries`]})]}),s?(0,U.jsx)(`span`,{className:`flex`,children:(0,U.jsx)(j,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]}):(0,U.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5 tabular-nums`,children:[(0,U.jsx)(`span`,{className:r?`text-label-18-strong text-heading`:`text-label-14-strong text-primary`,children:a}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),o?(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:o}):null,s?(0,U.jsx)(`span`,{className:`-ml-2 flex`,children:(0,U.jsx)(j,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]})}function ke(e,t,n){return E({client:y,path:{name:e},query:{scope:`property`,targetKey:t,queryClass:n}})}function Ae(e){return e?.properties.items.at(0)}function je({measuredAt:e,unmeasuredReason:t,queryClass:n}){let r=e===void 0?null:e===null?`No completed check yet`:`Measured ${S(C(e))}`;return r===null&&t===void 0?null:(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[[r,t].filter(Boolean).join(` · `),r!==null&&t===void 0?` · ${q[n].technical.toLocaleLowerCase()} only`:``]})}function Me({project:e,groups:t}){return t.length===0?null:(0,U.jsxs)(`section`,{"aria-labelledby":`property-market`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-market`,className:`text-heading-16 text-heading`,children:`Measured at the market level`}),(0,U.jsx)(j,{text:`Competitors are attached to groups. Share of voice and competitor pressure use the group or market that includes this Property.`})]})}),(0,U.jsx)(_,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,U.jsx)(c,{to:`/projects/$projectName`,params:{projectName:e},search:e=>N(M(e),{measurementScope:`project`}),children:`Open measurement overview`})})]}),(0,U.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`rounded-md border border-default px-3 py-1.5 text-label-14 text-strong`,children:[e.label,(0,U.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[e.competitors.length,` `,e.competitors.length===1?`competitor`:`competitors`]})]},e.stableKey))})]})}function Ne({branded:e,nonBrand:t,brandedError:n,nonBrandError:r,onRetry:i}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-brand-contrast`,children:[(0,U.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-brand-contrast`,className:`text-heading-16 text-heading`,children:`Coverage for this Property`}),(0,U.jsx)(j,{text:`Non-brand queries do not name this Property. Branded queries name it. Each rate uses only the measured answers for that query type. Mentioned means the Property was named in the answer; cited means its URL appeared in the sources. Unchecked sources are not counted as a citation miss.`})]})}),(0,U.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[560px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Mention and citation coverage for this Property, split by query class`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query type`}),(0,U.jsx)(`th`,{children:`Mentioned in the answer`}),(0,U.jsx)(`th`,{children:`Cited as a source`})]})}),(0,U.jsx)(`tbody`,{children:[{queryClass:`non-brand`,row:t,isError:r},{queryClass:`branded`,row:e,isError:n}].map(({queryClass:e,row:t,isError:n})=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:q[e].technical}),t&&n?(0,U.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-label-14 text-caution`,children:[(0,U.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,U.jsxs)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-11 px-3 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]}):null]}),t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:t.mentionCoverage,signal:`mentioned`,queryClass:e,emphasis:!0})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:t.citationCoverage,signal:`cited`,queryClass:e,emphasis:!0})})]}):n?(0,U.jsx)(`td`,{colSpan:2,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,U.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})})]})]},e))})]})})]})}function Pe({row:e,queryClass:t,isError:n}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-providers`,className:`page-section-divider`,children:[(0,U.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-providers`,className:`text-heading-16 text-heading`,children:`Which engines answer for this Property`}),(0,U.jsx)(j,{text:`Each row is measured over the queries that engine actually answered for this Property, so the rows are a split of the same population rather than parts that add up to the Property total. An engine that answered nothing for this Property is absent instead of shown at 0%.`})]})})}),e===void 0&&n?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Details for `,q[t].technical.toLocaleLowerCase(),` are unavailable. Retry that query type above.`]}):e===void 0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):e.providers.length===0?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No answer engine has measured `,q[t].technical.toLocaleLowerCase(),` for this Property.`,e.mentionCoverage.state===`unavailable`?` ${De(e.mentionCoverage)}.`:``]}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`engine-comparison`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Per-engine mention and citation coverage`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{scope:`col`,children:`Engine`}),(0,U.jsx)(`th`,{scope:`col`,children:`Mentioned`}),(0,U.jsx)(`th`,{scope:`col`,children:`Cited`})]})}),(0,U.jsx)(`tbody`,{children:e.providers.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(V,{provider:e.provider})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:e.mentionCoverage,signal:`mentioned`,queryClass:t,compact:!0})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:e.citationCoverage,signal:`cited`,queryClass:t,compact:!0})})]},e.provider))})]})})]})}function Z(e){let t=e.questions.join(` · `);return e.questionsTruncated?`${t} +${e.questionTotal-e.questions.length} more`:t}function Fe({project:e,targetKey:t,queryClass:n}){let r=u({...oe({client:y,path:{name:e},query:{targetKey:t,queryClass:n}})});if(r.isPending||r.isError)return null;let i=r.data?.competitors??[],a=r.data?.basis;return(0,U.jsxs)(`section`,{"aria-labelledby":`property-named-instead`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-named-instead`,className:`text-heading-16 text-heading`,children:`Named instead of this Property`}),(0,U.jsx)(j,{text:`Counted from the answers that did not name this Property, so a name here is one an engine recommended in its place. Occurrences count answers, not positions: an engine naming the same rival in two answers counts twice, and one naming it twice in a single answer counts once.`})]})}),i.length>0?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[r.data?.total??i.length,` named`]}):null]}),i.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No rival was named in the answers this Property missed. Nothing to compete with here yet.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Names the engines gave instead of this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Named`}),(0,U.jsx)(`th`,{children:`Answers`}),(0,U.jsx)(`th`,{children:`Engines`}),(0,U.jsx)(`th`,{children:`Queries`})]})}),(0,U.jsx)(`tbody`,{children:i.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`text-strong`,children:e.name}),(0,U.jsx)(`td`,{className:`tabular-nums text-secondary`,children:e.occurrences}),(0,U.jsxs)(`td`,{className:`text-secondary`,children:[e.providers.map(e=>k(e)).join(`, `),e.providersTruncated?` +${e.providerTotal-e.providers.length}`:``]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,U.jsx)(`span`,{className:`tabular-nums text-secondary`,children:e.questionTotal}),(0,U.jsx)(j,{text:Z(e)})]})})]},e.name))})]})}),a?.state===`available`?(0,U.jsxs)(`p`,{className:`supporting-copy mt-2`,children:[a.targetMissResults,` of `,a.answeredResults,` answers to `,q[n].technical.toLocaleLowerCase(),` did not name this Property.`]}):null]})]})}function Ie({questions:e,queryClass:t}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-questions`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`h2`,{id:`property-questions`,className:`text-heading-16 text-heading`,children:[q[t].technical,` assigned to this Property`]})}),(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` assigned`]})]}),e.length===0?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No `,q[t].technical.toLocaleLowerCase(),` are assigned. Add one in advanced measurement setup to measure this class.`]}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Queries assigned to this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`th`,{children:`Query`})})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{className:`text-secondary`,children:e})},e))})]})})]})}function Le({urls:e}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-urls`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-urls`,className:`text-heading-16 text-heading`,children:`URLs that count as this Property`}),(0,U.jsx)(j,{text:`A cited source URL is credited to this Property when it matches one of these. The most specific matcher wins, so a URL covered by two Properties at the same specificity is flagged for review instead of being credited to either.`})]})}),(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` configured`]})]}),e.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No URLs are configured for this Property.`}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`URL matchers configured for this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`th`,{children:`URL`})})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{className:`break-all text-secondary`,children:e})},e))})]})})]})}var Q={heading:`Cited on other queries`,help:`Answers to queries assigned to other properties that still cited one of this Property’s own pages. This Property was not measured on those queries, so these answers are not in its Mentioned or Cited rates.`,notCounted:`not in this Property’s rates`,empty:`No answer to a query assigned elsewhere cited this Property’s pages in the displayed measurement.`,loadError:`Citations from other queries could not be loaded.`,partlySaved:`Sources partly saved`};function Re({project:e,targetKey:t,queryClass:n,runId:r,targetLabels:a}){let[o,s]=(0,H.useState)(new Set),l={client:y,path:{name:e},query:{targetKey:t,queryClass:n,shape:h[`other-queries`],limit:ye,...r?{runId:r}:{}}},u=i({...D(l),initialPageParam:l,getNextPageParam:e=>e.otherQueries?.nextCursor?{path:l.path,query:{...l.query,cursor:e.otherQueries.nextCursor}}:void 0}),d=u.data?.pages??[];if(d[0]?.measurement.state===`not_measured`)return null;let f=d.flatMap(e=>e.otherQueries?.items??[]),p=d[0]?.otherQueries?.totalEstimate??f.length,ee=e=>`${e.expectedSlotId}:${e.queryClass}`,m=q[n].technical.toLocaleLowerCase();return(0,U.jsxs)(`section`,{"aria-labelledby":`property-other-queries`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-other-queries`,className:`text-heading-16 text-heading`,children:Q.heading}),(0,U.jsx)(j,{text:Q.help})]}),u.data?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[p,` `,p===1?`answer`:`answers`,` · `,m,` · `,Q.notCounted]}):null]}),u.isPending?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):u.isError&&f.length===0?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{u.refetch()},children:`Retry`})]}):f.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:Q.empty}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[640px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Answers to other properties’ queries that cited this Property’s pages`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query`}),(0,U.jsx)(`th`,{children:`Assigned to`}),(0,U.jsx)(`th`,{children:`Pages cited`}),(0,U.jsx)(`th`,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Answer`})})]})}),(0,U.jsx)(`tbody`,{children:f.map(t=>{let n=ee(t),r=o.has(n),i=`property-other-query-${encodeURIComponent(n)}`;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{className:`text-secondary`,children:[(0,U.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:t.queryText}),(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[k(t.provider),t.location].filter(Boolean).join(` · `)})]}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.assignedTargetKeys.map(t=>(0,U.jsx)(`li`,{children:(0,U.jsx)(c,{to:`/projects/$projectName/properties/$targetKey`,params:{projectName:e,targetKey:t},search:M,className:`text-label-14 text-link hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:a.get(t)??t})},t))})}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.sources.map(e=>(0,U.jsx)(`li`,{className:`min-w-0`,children:(0,U.jsx)(I,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,U.jsxs)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:Q.partlySaved})]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":r,"aria-label":r?`Hide the answer for ${t.queryText}`:`Read the answer for ${t.queryText}`,"aria-controls":r?i:void 0,onClick:()=>s(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t}),children:r?`Hide answer`:`Read answer`})})]}),r?(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{id:i,colSpan:4,className:`bg-surface-subtle px-4`,children:(0,U.jsx)(Ee,{project:e,targetKey:t.assignedTargetKeys[0],resultId:t.observationId})})}):null]},n)})})]})}),u.hasNextPage?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Showing `,f.length,` of `,p]}),(0,U.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:u.isFetchingNextPage,onClick:()=>{u.fetchNextPage()},children:u.isFetchingNextPage?`Loading…`:`Show ${ye} more`})]}):null]})]})}function ze(e,t){let n=[e.marketKey?t??`the selected market`:null,e.provider?`the ${k(e.provider)} answer engine`:null,e.model?`the ${m(e.model)} model`:null,e.location?`location ${e.location}`:null,e.from||e.to?`a date range`:null,e.measurementRunId?`a saved check`:null].filter(e=>e!==null);return n.length===0?null:`AI Visibility is filtered to ${n.join(`, `)}. This page shows the latest measurement for ${z.allMarkets.toLocaleLowerCase()} and answer engines.`}function Be(){let{projectName:e,targetKey:t}=s({strict:!1}),r=a(),l=o({strict:!1}),f=(0,H.useMemo)(()=>P(l),[l]),[p,ee]=(0,H.useState)(new Set),m=e??``,g=t??``,b=!!m&&!!g,x=(0,H.useMemo)(()=>de(`portfolio`,se(te())),[]),S=b&&x,{canWrite:C}=ne(),w=u({...re({client:y,path:{name:m}}),enabled:S}),ie=w.data?.active?.plan,ae=ie?.schemaVersion===2?ie:null,T=f.queryClass===`branded`||f.queryClass===`non-brand`?f.queryClass:null,oe=e=>ae?.assignments.some(t=>t.targetKey===g&&t.queryClass===e)??!1,E=T??(!oe(`non-brand`)&&oe(`branded`)?`branded`:`non-brand`);(0,H.useEffect)(()=>{ae&&!T&&r({to:`.`,replace:!0,search:e=>N(e,{queryClass:E})})},[ae,T,E,r]);let A=u({...ke(m,g,`branded`),enabled:S}),F=u({...ke(m,g,`non-brand`),enabled:S}),I=Ae(A.data),L=Ae(F.data),z=E===`branded`?A.data:F.data,B=E===`branded`?I:L,pe=(E===`branded`?A.isError:F.isError)&&B===void 0,V=z?.measurement.displayedRunId;ue(m,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:g,queryClass:E,limit:10,...V?{runId:V}:{}}});let W=B?.mentionCoverage.state===`unavailable`?De(B.mentionCoverage):void 0,me=z===void 0?void 0:z.measurement.completedAt??null,he=z!==void 0&&(z.measurement.state===`not_measured`||z.nextAction.kind===`run_measurement`),G=e=>N(M(e),{measurementScope:`property`,measurementScopeKey:g,queryClass:E,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),ge=u({...O({client:y,path:{name:m},query:le(P(G(l)))}),enabled:S&&he,retry:!1}).data,_e=ge!==void 0&&ge.selection.measurement.measuredRevision!==null&&(ge.populations.find(e=>e.queryClass===E)?.summary.queryCount??0)>0,K={client:y,path:{name:m},query:{targetKey:g,queryClass:E,shape:h.answers,limit:ye,...V?{runId:V}:{}}},J=i({...D(K),enabled:S&&z!==void 0,initialPageParam:K,getNextPageParam:e=>e.answers?.nextCursor?{path:K.path,query:{...K.query,cursor:e.answers.nextCursor}}:void 0}),Y=w.data?.active??null,X=Y?.plan.schemaVersion===2?Y.plan:null,Oe=Y!==null&&X===null,Z=X?.targets.find(e=>e.stableKey===g)??null,Q=ze(f,X?.reportingScopes?.find(e=>e.stableKey===f.marketKey)?.label),Be=(0,H.useMemo)(()=>{if(!X)return[];let e=new Map(X.querySnapshots.map(e=>[e.queryId,e.queryText]));return[...new Set(X.assignments.filter(e=>e.targetKey===g&&e.queryClass===E).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[X,g,E]),Ve=(0,H.useMemo)(()=>Z?.urlMatchers.map(fe)??[],[Z]),He=(0,H.useMemo)(()=>new Map((X?.targets??[]).map(e=>[e.stableKey,e.label])),[X]),Ue=(0,H.useMemo)(()=>X?.groups.filter(e=>e.targetKeys.includes(g))??[],[X,g]),$=(0,H.useMemo)(()=>(J.data?.pages??[]).flatMap(e=>e.answers?.items??[]),[J.data]),We=J.data?.pages[0]?.answers?.totalEstimate??$.length,Ge=(J.data?.pages??[]).length>0&&(J.data?.pages??[]).every(e=>e.answers===void 0),Ke=J.data?.pages[0]?.measurement.state,qe=(0,U.jsxs)(c,{to:`/projects/$projectName`,params:{projectName:m},search:M,className:`inline-flex items-center gap-1 text-label-12 text-muted hover:text-strong`,children:[(0,U.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!b)return(0,U.jsx)(`div`,{className:`page-container`,children:(0,U.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or Property key in URL.`})});if(!x)return(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`This view is not available here.`})]});if(w.isPending&&!w.isError)return(0,U.jsx)(`div`,{className:`page-container`,children:(0,U.jsxs)(`div`,{role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`sr-only`,children:`Loading Property`}),(0,U.jsx)(`div`,{className:`h-32 animate-pulse rounded-md bg-surface-subtle`,"aria-hidden":`true`})]})});let Je=w.isError&&w.data===void 0,Ye=A.isError&&A.data===void 0,Xe=F.isError&&F.data===void 0;return Je||Ye&&Xe?(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative`,children:`Could not load this Property.`}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{w.refetch(),A.refetch(),F.refetch()},children:`Try again`})]}):!X||!Z?(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{role:`status`,className:`text-copy-14 text-secondary`,children:X?`This Property is not in the published setup. It may have been renamed or removed.`:`A Property page needs a published advanced measurement setup. Republish setup from the project Portfolio tab.`}),(0,U.jsx)(_,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,U.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:m},children:C?Oe?`Republish setup`:`Open measurement setup`:`View measurement setup`})})]}):(0,U.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,U.jsxs)(`div`,{className:`page-header`,children:[(0,U.jsxs)(`div`,{className:`page-header-left`,children:[qe,(0,U.jsx)(`h1`,{className:`page-title mt-2`,children:Z.label}),(0,U.jsxs)(`p`,{className:`page-subtitle`,children:[`Property in `,m,Q?(0,U.jsxs)(U.Fragment,{children:[` · Filters not applied `,(0,U.jsx)(j,{text:Q})]}):null]})]}),(0,U.jsxs)(`div`,{className:`page-header-right`,children:[z?(0,U.jsx)(v,{tone:be[z.measurement.state].tone,children:be[z.measurement.state].label}):null,B&&B.flags>0?(0,U.jsxs)(v,{tone:`caution`,children:[B.flags,` flagged`]}):null]})]}),(0,U.jsx)(Ne,{branded:I,nonBrand:L,brandedError:A.isError,nonBrandError:F.isError,onRetry:e=>{e===`branded`?A.refetch():F.refetch()}}),he?(0,U.jsxs)(`section`,{className:`flex flex-wrap items-center justify-between gap-3 py-4`,"aria-label":`Measurement next step`,children:[(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?ce:C?`Run a measurement from the project overview to collect this Property’s coverage and source evidence.${_e?` AI Visibility still shows the last results.`:``}`:`This Property needs a new measurement before coverage and source evidence are available.`}),(0,U.jsx)(_,{asChild:!0,type:`button`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,U.jsx)(c,{to:`/projects/$projectName`,params:{projectName:m},search:_e?G:M,children:_e?`See the last results`:C?`Go to AI Visibility`:`View AI Visibility`})})]}):null,(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4 py-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`label`,{htmlFor:`property-query-class`,className:`block text-label-14-strong text-heading`,children:`Query type`}),(0,U.jsxs)(`select`,{id:`property-query-class`,value:E,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>N(e,{queryClass:t})})},className:`h-11 rounded-md border border-default bg-surface px-3 text-label-14 text-primary focus:outline-none focus:ring-2 focus:ring-mono-400`,children:[(0,U.jsx)(`option`,{value:`non-brand`,children:q[`non-brand`].technical}),(0,U.jsx)(`option`,{value:`branded`,children:q.branded.technical})]})]}),(0,U.jsx)(je,{measuredAt:me,unmeasuredReason:W,queryClass:E})]}),(0,U.jsx)(Pe,{row:B,queryClass:E,isError:pe}),(0,U.jsx)(Fe,{project:m,targetKey:g,queryClass:E}),(0,U.jsx)(Ie,{questions:Be,queryClass:E}),(0,U.jsx)(ve,{projectName:m,targetKey:g,published:Z,activeRevision:Y.revision,publishedBrandNames:X.identities.projectBrand.names}),(0,U.jsx)(Le,{urls:Ve}),(0,U.jsx)(Me,{project:m,groups:Ue}),(0,U.jsxs)(`section`,{"aria-labelledby":`property-evidence`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-evidence`,className:`text-heading-16 text-heading`,children:`Answers the engines gave`}),(0,U.jsx)(j,{text:`Answers for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent. Missing answer text shows Not measured. Open an answer to read its text and sources, including any other Property it named.`})]})}),$.length>0?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[$.length,` of `,We]}):null]}),pe?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Evidence for `,q[E].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):J.isPending&&$.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading evidence…`}):J.isError&&$.length===0?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{J.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?ce:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,U.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-caution`,children:`This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected.`}):$.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No answers matched this Property in the displayed measurement.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`property-answer-table-container overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table property-evidence-table`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Answers measured for this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query`}),(0,U.jsx)(`th`,{children:`Mentioned in the answer`}),(0,U.jsx)(`th`,{children:`Cited as a source`}),(0,U.jsx)(`th`,{children:`Sources`}),(0,U.jsx)(`th`,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Sources detail`})})]})}),(0,U.jsx)(`tbody`,{children:$.map(e=>{let t=xe(e),n=p.has(t),r=`property-answer-${encodeURIComponent(t)}`;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`tr`,{className:`property-answer-summary`,children:[(0,U.jsxs)(`td`,{className:`text-secondary`,children:[(0,U.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e.queryText}),(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[k(e.provider),e.location].filter(Boolean).join(` · `)}),e.historical||e.bridged?(0,U.jsx)(`span`,{className:`mt-1 flex`,children:(0,U.jsx)(v,{tone:`caution`,children:`Historical`})}):null]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Mentioned`}),(0,U.jsx)(Se,{row:e})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Cited`}),(0,U.jsx)(we,{row:e})]}),(0,U.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:R}),e.cited===null?Ce:e.sources.length]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":n,"aria-label":n?`Hide the answer for ${e.queryText}`:`Read the answer for ${e.queryText}`,"aria-controls":n?r:void 0,onClick:()=>ee(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n}),children:n?`Hide answer`:`Read answer`})})]}),n?(0,U.jsx)(`tr`,{className:`property-answer-detail`,children:(0,U.jsxs)(`td`,{id:r,colSpan:5,className:`bg-surface-subtle px-4`,children:[(0,U.jsx)(Ee,{project:m,targetKey:g,resultId:e.observationId}),(0,U.jsx)(Te,{row:e})]})}):null]},t)})})]})}),J.hasNextPage?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Showing `,$.length,` of `,We]}),J.isFetchNextPageError?(0,U.jsx)(`span`,{role:`alert`,children:`Could not load more evidence.`}):null,(0,U.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:J.isFetchingNextPage,onClick:()=>{J.fetchNextPage()},children:J.isFetchingNextPage?`Loading…`:J.isFetchNextPageError?`Retry more evidence`:`Show ${ye} more`})]}):null]})]}),z?(0,U.jsx)(Re,{project:m,targetKey:g,queryClass:E,runId:V,targetLabels:He}):null]})}export{Y as EVIDENCE_LABELS,Be as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};
4
+ `)),E({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function I(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function L(){de(g?p:n),O(null),S(!0)}function R(e){e&&de(e),O({tone:`negative`,text:W.conflict,review:!1})}let z=l({mutationFn:async i=>{let o=await a.loadDraft(e);if(!o.draft){if(G(i.names,n))return{outcome:`unchanged`};if(!G(i.base,n))return{outcome:`conflict`,latest:n};await a.createDraft(e,r),o=await a.loadDraft(e)}let s=o.draft;if(!s||!o.etag)throw Error(W.failed);if(s.baseActiveRevision!==r)return{outcome:`stale`};let c=s.authoring.targets.find(e=>e.stableKey===t);return!c||c.status!==`included`?{outcome:`missing`}:G(i.names,c)?{outcome:`unchanged`}:G(i.base,c)?(await a.upsertTarget(e,o.etag,ge(c,i.names.aliases,i.names.identityAliases)),{outcome:`saved`}):{outcome:`conflict`,latest:c}},meta:{skipGlobalErrorToast:!0},onSuccess:(e,t)=>{if(t.openFor===M.current)switch(e.outcome){case`saved`:S(!1),O({tone:`positive`,text:W.saved,review:!0});return;case`unchanged`:S(!1),O({tone:`positive`,text:W.noChanges,review:!1});return;case`stale`:O({tone:`negative`,text:W.staleDraft,review:!0});return;case`missing`:O({tone:`negative`,text:W.missingFromDraft,review:!0});return;case`conflict`:R(e.latest),d.refetch();return}},onError:(e,t)=>{t.openFor===M.current&&(B(e)?(R(null),d.refetch().then(e=>{e.isSuccess&&R(I(e.data))})):O({tone:`negative`,text:W.failed,review:!1}))}}),fe=(0,U.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:e},className:`text-link underline-offset-2 hover:underline`,children:W.review}),V=n.aliases.length+m.length;return(0,U.jsxs)(`section`,{"aria-labelledby":`property-names`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-names`,className:`text-heading-16 text-heading`,children:W.heading}),(0,U.jsx)(j,{text:W.help})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[V,` `,V===1?`name`:`names`]}),o&&!x?(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:!te,onClick:L,children:W.edit}):null]})]}),D?(0,U.jsxs)(`p`,{role:D.tone===`negative`?`alert`:`status`,className:`mb-3 text-copy-14 ${D.tone===`negative`?`text-negative`:`text-positive`}`,children:[D.text,D.review?(0,U.jsxs)(U.Fragment,{children:[` `,fe]}):null]}):g&&!x?(0,U.jsxs)(`p`,{role:`status`,className:`mb-3 text-copy-14 text-caution`,children:[W.pending,` `,fe]}):null,x?(0,U.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!z.isPending&&z.mutate({names:{aliases:N,identityAliases:P},base:oe,openFor:k})},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{htmlFor:`${s}-names`,className:`block text-label-14-strong text-heading`,children:W.names}),(0,U.jsx)(`p`,{id:`${s}-names-hint`,className:`text-copy-14 text-secondary`,children:W.namesHint}),(0,U.jsx)(`textarea`,{id:`${s}-names`,className:`mt-1 min-h-24 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-names-hint${le.length?` ${s}-names-issues`:``}`,value:C,onChange:e=>w(e.target.value)}),(0,U.jsx)(K,{id:`${s}-names-issues`,issues:le}),N.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-copy-14 text-caution`,children:W.noNames}):null]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{htmlFor:`${s}-qualified`,className:`block text-label-14-strong text-heading`,children:W.qualifiedNames}),(0,U.jsx)(`p`,{id:`${s}-qualified-hint`,className:`text-copy-14 text-secondary`,children:W.qualifiedHint}),(0,U.jsx)(`textarea`,{id:`${s}-qualified`,className:`mt-1 min-h-20 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-qualified-hint ${s}-qualified-note${ue.length?` ${s}-qualified-issues`:``}`,value:re,onChange:e=>T(e.target.value)}),(0,U.jsx)(K,{id:`${s}-qualified-issues`,issues:ue}),(0,U.jsx)(`p`,{id:`${s}-qualified-note`,className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:W.qualifiedNote})]}),(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:W.draftOnly}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(A,{type:`submit`,className:`h-11 px-4 text-label-14 md:h-11`,disabled:z.isPending,children:z.isPending?W.saving:W.save}),(0,U.jsx)(_,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:z.isPending,onClick:()=>{S(!1),O(null)},children:W.cancel})]})]}):V===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:W.noNames}):(0,U.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[n.aliases.length>0?(0,U.jsx)(_e,{label:W.names,names:n.aliases}):null,m.length>0?(0,U.jsx)(_e,{label:W.qualifiedNames,names:m}):null]})]})}var ye=50,q={branded:{technical:`Branded queries`},"non-brand":{technical:`Non-brand queries`}},J={plan_v1:`Setup update required`,no_completed_run:`No completed measurement yet`,no_population:`No queries of this type are assigned`,evidence_incomplete:`Source evidence is incomplete`,identity_ambiguous:w,not_applicable:`Not applicable for this Property`,citation_not_measured:`The engines return no sources`},be={complete:{label:`Measured`,tone:`positive`},partial:{label:`Partly measured`,tone:`caution`},running:{label:`Measuring now`,tone:`neutral`},queued:{label:`Measurement queued`,tone:`neutral`},failed:{label:`Measurement failed`,tone:`negative`},not_measured:{label:`Not measured`,tone:`neutral`}},Y={assigned:{label:`Matches this Property`,tone:`positive`},sibling:{label:`Matches another Property`,tone:`caution`},ownedUnmapped:{label:`Site URL not in a Property`,tone:`caution`},external:{label:`External URL`,tone:`neutral`},ambiguous:{label:`Matches multiple Properties`,tone:`caution`},invalid:{label:`Invalid URL`,tone:`negative`}};function X(e){return[...e].sort((e,t)=>Number(t.classification===`assigned`)-Number(e.classification===`assigned`))}function xe(e){return`${e.expectedSlotId}:${e.usageEdgeId}`}function Se({row:e}){return e.mentioned===null?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not measured`}),(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:`No mention signal for this Property`})]}):!e.mentioned&&e.mentionIdentity===`wrong-subject`?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not mentioned`}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-label-12 text-muted`,children:[L.label,(0,U.jsx)(j,{text:L.property})]})]}):(0,U.jsx)(v,{tone:e.mentioned?`positive`:`neutral`,children:e.mentioned?`Mentioned`:`Not mentioned`})}var Ce=`—`;function we({row:e}){return e.cited===null?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not measured`}),(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:e.citationMeasured===!1?`The engine returns no sources`:`Sources were not fully captured`})]}):(0,U.jsx)(v,{tone:e.cited?`positive`:`neutral`,children:e.cited?`Cited`:`Not cited`})}function Te({row:e}){return e.citationMeasured===!1?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:b}):e.cited===null&&e.sources.length===0?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`The sources for this answer were not fully captured, so none can be shown.`}):e.sources.length===0?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer returned no source URLs at all.`}):(0,U.jsxs)(`details`,{className:`mt-2`,"data-answer-sources":!0,children:[(0,U.jsxs)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[R,` (`,e.sources.length,`)`]}),(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsxs)(`caption`,{className:`sr-only`,children:[`Source URLs for `,e.queryText]}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Match`}),(0,U.jsx)(`th`,{children:`URL`})]})}),(0,U.jsx)(`tbody`,{children:X(e.sources).map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(v,{tone:Y[e.classification].tone,children:Y[e.classification].label})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(I,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function Ee({project:e,targetKey:t,resultId:n}){let r=u({...T({client:y,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`alert`,children:`Could not load this answer.`});let i=r.data?.answer;return i==null||i.trim()===``?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,U.jsx)(`div`,{className:`py-2`,children:(0,U.jsx)(F,{headingLevel:4,copyable:!0,children:i})})}function De(e){return J[e.reason]??`Not measured`}function Oe({metric:e,signal:t,queryClass:n,emphasis:r=!1,compact:i=!1}){if(e.state===`unavailable`)return(0,U.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:r?`text-label-18-strong text-secondary`:`text-label-14-strong text-secondary`,children:`Not measured`}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:De(e)})]});let a=g(e.value),o=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,s=x(e,t);return i?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-end gap-0.5`,children:[(0,U.jsxs)(`span`,{className:`engine-comparison-metric`,children:[(0,U.jsx)(`span`,{className:`text-label-14-strong text-primary`,children:a}),o?(0,U.jsxs)(`span`,{className:`text-label-13 text-secondary`,"aria-hidden":`true`,children:[e.numerator,`/`,e.denominator]}):null,(0,U.jsxs)(`span`,{className:`sr-only`,children:[o?` · ${o} answers`:``,` · `,n,` queries`]})]}),s?(0,U.jsx)(`span`,{className:`flex`,children:(0,U.jsx)(j,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]}):(0,U.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5 tabular-nums`,children:[(0,U.jsx)(`span`,{className:r?`text-label-18-strong text-heading`:`text-label-14-strong text-primary`,children:a}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),o?(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:o}):null,s?(0,U.jsx)(`span`,{className:`-ml-2 flex`,children:(0,U.jsx)(j,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]})}function ke(e,t,n){return E({client:y,path:{name:e},query:{scope:`property`,targetKey:t,queryClass:n}})}function Ae(e){return e?.properties.items.at(0)}function je({measuredAt:e,unmeasuredReason:t,queryClass:n}){let r=e===void 0?null:e===null?`No completed check yet`:`Measured ${S(C(e))}`;return r===null&&t===void 0?null:(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[[r,t].filter(Boolean).join(` · `),r!==null&&t===void 0?` · ${q[n].technical.toLocaleLowerCase()} only`:``]})}function Me({project:e,groups:t}){return t.length===0?null:(0,U.jsxs)(`section`,{"aria-labelledby":`property-market`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-market`,className:`text-heading-16 text-heading`,children:`Measured at the market level`}),(0,U.jsx)(j,{text:`Competitors are attached to groups. Share of voice and competitor pressure use the group or market that includes this Property.`})]})}),(0,U.jsx)(_,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,U.jsx)(c,{to:`/projects/$projectName`,params:{projectName:e},search:e=>N(M(e),{measurementScope:`project`}),children:`Open measurement overview`})})]}),(0,U.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`rounded-md border border-default px-3 py-1.5 text-label-14 text-strong`,children:[e.label,(0,U.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[e.competitors.length,` `,e.competitors.length===1?`competitor`:`competitors`]})]},e.stableKey))})]})}function Ne({branded:e,nonBrand:t,brandedError:n,nonBrandError:r,onRetry:i}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-brand-contrast`,children:[(0,U.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-brand-contrast`,className:`text-heading-16 text-heading`,children:`Coverage for this Property`}),(0,U.jsx)(j,{text:`Non-brand queries do not name this Property. Branded queries name it. Each rate uses only the measured answers for that query type. Mentioned means the Property was named in the answer; cited means its URL appeared in the sources. Unchecked sources are not counted as a citation miss.`})]})}),(0,U.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[560px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Mention and citation coverage for this Property, split by query class`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query type`}),(0,U.jsx)(`th`,{children:`Mentioned in the answer`}),(0,U.jsx)(`th`,{children:`Cited as a source`})]})}),(0,U.jsx)(`tbody`,{children:[{queryClass:`non-brand`,row:t,isError:r},{queryClass:`branded`,row:e,isError:n}].map(({queryClass:e,row:t,isError:n})=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:q[e].technical}),t&&n?(0,U.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-label-14 text-caution`,children:[(0,U.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,U.jsxs)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-11 px-3 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]}):null]}),t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:t.mentionCoverage,signal:`mentioned`,queryClass:e,emphasis:!0})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:t.citationCoverage,signal:`cited`,queryClass:e,emphasis:!0})})]}):n?(0,U.jsx)(`td`,{colSpan:2,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,U.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})})]})]},e))})]})})]})}function Pe({row:e,queryClass:t,isError:n}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-providers`,className:`page-section-divider`,children:[(0,U.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-providers`,className:`text-heading-16 text-heading`,children:`Which engines answer for this Property`}),(0,U.jsx)(j,{text:`Each row is measured over the queries that engine actually answered for this Property, so the rows are a split of the same population rather than parts that add up to the Property total. An engine that answered nothing for this Property is absent instead of shown at 0%.`})]})})}),e===void 0&&n?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Details for `,q[t].technical.toLocaleLowerCase(),` are unavailable. Retry that query type above.`]}):e===void 0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):e.providers.length===0?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No answer engine has measured `,q[t].technical.toLocaleLowerCase(),` for this Property.`,e.mentionCoverage.state===`unavailable`?` ${De(e.mentionCoverage)}.`:``]}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`engine-comparison`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Per-engine mention and citation coverage`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{scope:`col`,children:`Engine`}),(0,U.jsx)(`th`,{scope:`col`,children:`Mentioned`}),(0,U.jsx)(`th`,{scope:`col`,children:`Cited`})]})}),(0,U.jsx)(`tbody`,{children:e.providers.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(V,{provider:e.provider})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:e.mentionCoverage,signal:`mentioned`,queryClass:t,compact:!0})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:e.citationCoverage,signal:`cited`,queryClass:t,compact:!0})})]},e.provider))})]})})]})}function Z(e){let t=e.questions.join(` · `);return e.questionsTruncated?`${t} +${e.questionTotal-e.questions.length} more`:t}function Fe({project:e,targetKey:t,queryClass:n}){let r=u({...oe({client:y,path:{name:e},query:{targetKey:t,queryClass:n}})});if(r.isPending||r.isError)return null;let i=r.data?.competitors??[],a=r.data?.basis;return(0,U.jsxs)(`section`,{"aria-labelledby":`property-named-instead`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-named-instead`,className:`text-heading-16 text-heading`,children:`Named instead of this Property`}),(0,U.jsx)(j,{text:`Counted from the answers that did not name this Property, so a name here is one an engine recommended in its place. Occurrences count answers, not positions: an engine naming the same rival in two answers counts twice, and one naming it twice in a single answer counts once.`})]})}),i.length>0?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[r.data?.total??i.length,` named`]}):null]}),i.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No rival was named in the answers this Property missed. Nothing to compete with here yet.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Names the engines gave instead of this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Named`}),(0,U.jsx)(`th`,{children:`Answers`}),(0,U.jsx)(`th`,{children:`Engines`}),(0,U.jsx)(`th`,{children:`Queries`})]})}),(0,U.jsx)(`tbody`,{children:i.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`text-strong`,children:e.name}),(0,U.jsx)(`td`,{className:`tabular-nums text-secondary`,children:e.occurrences}),(0,U.jsxs)(`td`,{className:`text-secondary`,children:[e.providers.map(e=>k(e)).join(`, `),e.providersTruncated?` +${e.providerTotal-e.providers.length}`:``]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,U.jsx)(`span`,{className:`tabular-nums text-secondary`,children:e.questionTotal}),(0,U.jsx)(j,{text:Z(e)})]})})]},e.name))})]})}),a?.state===`available`?(0,U.jsxs)(`p`,{className:`supporting-copy mt-2`,children:[a.targetMissResults,` of `,a.answeredResults,` answers to `,q[n].technical.toLocaleLowerCase(),` did not name this Property.`]}):null]})]})}function Ie({questions:e,queryClass:t}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-questions`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`h2`,{id:`property-questions`,className:`text-heading-16 text-heading`,children:[q[t].technical,` assigned to this Property`]})}),(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` assigned`]})]}),e.length===0?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No `,q[t].technical.toLocaleLowerCase(),` are assigned. Add one in advanced measurement setup to measure this class.`]}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Queries assigned to this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`th`,{children:`Query`})})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{className:`text-secondary`,children:e})},e))})]})})]})}function Le({urls:e}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-urls`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-urls`,className:`text-heading-16 text-heading`,children:`URLs that count as this Property`}),(0,U.jsx)(j,{text:`A cited source URL is credited to this Property when it matches one of these. The most specific matcher wins, so a URL covered by two Properties at the same specificity is flagged for review instead of being credited to either.`})]})}),(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` configured`]})]}),e.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No URLs are configured for this Property.`}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`URL matchers configured for this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`th`,{children:`URL`})})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{className:`break-all text-secondary`,children:e})},e))})]})})]})}var Q={heading:`Cited on other queries`,help:`Answers to queries assigned to other properties that still cited one of this Property’s own pages. This Property was not measured on those queries, so these answers are not in its Mentioned or Cited rates.`,notCounted:`not in this Property’s rates`,empty:`No answer to a query assigned elsewhere cited this Property’s pages in the displayed measurement.`,loadError:`Citations from other queries could not be loaded.`,partlySaved:`Sources partly saved`};function Re({project:e,targetKey:t,queryClass:n,runId:r,targetLabels:a}){let[o,s]=(0,H.useState)(new Set),l={client:y,path:{name:e},query:{targetKey:t,queryClass:n,shape:p[`other-queries`],limit:ye,...r?{runId:r}:{}}},u=i({...D(l),initialPageParam:l,getNextPageParam:e=>e.otherQueries?.nextCursor?{path:l.path,query:{...l.query,cursor:e.otherQueries.nextCursor}}:void 0}),d=u.data?.pages??[];if(d[0]?.measurement.state===`not_measured`)return null;let f=d.flatMap(e=>e.otherQueries?.items??[]),m=d[0]?.otherQueries?.totalEstimate??f.length,ee=e=>`${e.expectedSlotId}:${e.queryClass}`,h=q[n].technical.toLocaleLowerCase();return(0,U.jsxs)(`section`,{"aria-labelledby":`property-other-queries`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-other-queries`,className:`text-heading-16 text-heading`,children:Q.heading}),(0,U.jsx)(j,{text:Q.help})]}),u.data?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[m,` `,m===1?`answer`:`answers`,` · `,h,` · `,Q.notCounted]}):null]}),u.isPending?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):u.isError&&f.length===0?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{u.refetch()},children:`Retry`})]}):f.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:Q.empty}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[640px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Answers to other properties’ queries that cited this Property’s pages`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query`}),(0,U.jsx)(`th`,{children:`Assigned to`}),(0,U.jsx)(`th`,{children:`Pages cited`}),(0,U.jsx)(`th`,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Answer`})})]})}),(0,U.jsx)(`tbody`,{children:f.map(t=>{let n=ee(t),r=o.has(n),i=`property-other-query-${encodeURIComponent(n)}`;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{className:`text-secondary`,children:[(0,U.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:t.queryText}),(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[k(t.provider),t.location].filter(Boolean).join(` · `)})]}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.assignedTargetKeys.map(t=>(0,U.jsx)(`li`,{children:(0,U.jsx)(c,{to:`/projects/$projectName/properties/$targetKey`,params:{projectName:e,targetKey:t},search:M,className:`text-label-14 text-link hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:a.get(t)??t})},t))})}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.sources.map(e=>(0,U.jsx)(`li`,{className:`min-w-0`,children:(0,U.jsx)(I,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,U.jsxs)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:Q.partlySaved})]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":r,"aria-label":r?`Hide the answer for ${t.queryText}`:`Read the answer for ${t.queryText}`,"aria-controls":r?i:void 0,onClick:()=>s(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t}),children:r?`Hide answer`:`Read answer`})})]}),r?(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{id:i,colSpan:4,className:`bg-surface-subtle px-4`,children:(0,U.jsx)(Ee,{project:e,targetKey:t.assignedTargetKeys[0],resultId:t.observationId})})}):null]},n)})})]})}),u.hasNextPage?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Showing `,f.length,` of `,m]}),(0,U.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:u.isFetchingNextPage,onClick:()=>{u.fetchNextPage()},children:u.isFetchingNextPage?`Loading…`:`Show ${ye} more`})]}):null]})]})}function ze(e,t){let n=[e.marketKey?t??`the selected market`:null,e.provider?`the ${k(e.provider)} answer engine`:null,e.model?`the ${f(e.model)} model`:null,e.location?`location ${e.location}`:null,e.from||e.to?`a date range`:null,e.measurementRunId?`a saved check`:null].filter(e=>e!==null);return n.length===0?null:`AI Visibility is filtered to ${n.join(`, `)}. This page shows the latest measurement for ${z.allMarkets.toLocaleLowerCase()} and answer engines.`}function Be(){let{projectName:e,targetKey:t}=s({strict:!1}),r=a(),l=o({strict:!1}),f=(0,H.useMemo)(()=>P(l),[l]),[m,ee]=(0,H.useState)(new Set),h=e??``,g=t??``,b=!!h&&!!g,x=(0,H.useMemo)(()=>de(`portfolio`,se(te())),[]),S=b&&x,{canWrite:C}=ne(),w=u({...re({client:y,path:{name:h}}),enabled:S}),ie=w.data?.active?.plan,ae=ie?.schemaVersion===2?ie:null,T=f.queryClass===`branded`||f.queryClass===`non-brand`?f.queryClass:null,oe=e=>ae?.assignments.some(t=>t.targetKey===g&&t.queryClass===e)??!1,E=T??(!oe(`non-brand`)&&oe(`branded`)?`branded`:`non-brand`);(0,H.useEffect)(()=>{ae&&!T&&r({to:`.`,replace:!0,search:e=>N(e,{queryClass:E})})},[ae,T,E,r]);let A=u({...ke(h,g,`branded`),enabled:S}),F=u({...ke(h,g,`non-brand`),enabled:S}),I=Ae(A.data),L=Ae(F.data),z=E===`branded`?A.data:F.data,B=E===`branded`?I:L,pe=(E===`branded`?A.isError:F.isError)&&B===void 0,V=z?.measurement.displayedRunId;ue(h,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:g,queryClass:E,limit:10,...V?{runId:V}:{}}});let W=B?.mentionCoverage.state===`unavailable`?De(B.mentionCoverage):void 0,me=z===void 0?void 0:z.measurement.completedAt??null,he=z!==void 0&&(z.measurement.state===`not_measured`||z.nextAction.kind===`run_measurement`),G=e=>N(M(e),{measurementScope:`property`,measurementScopeKey:g,queryClass:E,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),ge=u({...O({client:y,path:{name:h},query:le(P(G(l)))}),enabled:S&&he,retry:!1}).data,_e=ge!==void 0&&ge.selection.measurement.measuredRevision!==null&&(ge.populations.find(e=>e.queryClass===E)?.summary.queryCount??0)>0,K={client:y,path:{name:h},query:{targetKey:g,queryClass:E,shape:p.answers,limit:ye,...V?{runId:V}:{}}},J=i({...D(K),enabled:S&&z!==void 0,initialPageParam:K,getNextPageParam:e=>e.answers?.nextCursor?{path:K.path,query:{...K.query,cursor:e.answers.nextCursor}}:void 0}),Y=w.data?.active??null,X=Y?.plan.schemaVersion===2?Y.plan:null,Oe=Y!==null&&X===null,Z=X?.targets.find(e=>e.stableKey===g)??null,Q=ze(f,X?.reportingScopes?.find(e=>e.stableKey===f.marketKey)?.label),Be=(0,H.useMemo)(()=>{if(!X)return[];let e=new Map(X.querySnapshots.map(e=>[e.queryId,e.queryText]));return[...new Set(X.assignments.filter(e=>e.targetKey===g&&e.queryClass===E).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[X,g,E]),Ve=(0,H.useMemo)(()=>Z?.urlMatchers.map(fe)??[],[Z]),He=(0,H.useMemo)(()=>new Map((X?.targets??[]).map(e=>[e.stableKey,e.label])),[X]),Ue=(0,H.useMemo)(()=>X?.groups.filter(e=>e.targetKeys.includes(g))??[],[X,g]),$=(0,H.useMemo)(()=>(J.data?.pages??[]).flatMap(e=>e.answers?.items??[]),[J.data]),We=J.data?.pages[0]?.answers?.totalEstimate??$.length,Ge=(J.data?.pages??[]).length>0&&(J.data?.pages??[]).every(e=>e.answers===void 0),Ke=J.data?.pages[0]?.measurement.state,qe=(0,U.jsxs)(c,{to:`/projects/$projectName`,params:{projectName:h},search:M,className:`inline-flex items-center gap-1 text-label-12 text-muted hover:text-strong`,children:[(0,U.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!b)return(0,U.jsx)(`div`,{className:`page-container`,children:(0,U.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or Property key in URL.`})});if(!x)return(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`This view is not available here.`})]});if(w.isPending&&!w.isError)return(0,U.jsx)(`div`,{className:`page-container`,children:(0,U.jsxs)(`div`,{role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`sr-only`,children:`Loading Property`}),(0,U.jsx)(`div`,{className:`h-32 animate-pulse rounded-md bg-surface-subtle`,"aria-hidden":`true`})]})});let Je=w.isError&&w.data===void 0,Ye=A.isError&&A.data===void 0,Xe=F.isError&&F.data===void 0;return Je||Ye&&Xe?(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative`,children:`Could not load this Property.`}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{w.refetch(),A.refetch(),F.refetch()},children:`Try again`})]}):!X||!Z?(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{role:`status`,className:`text-copy-14 text-secondary`,children:X?`This Property is not in the published setup. It may have been renamed or removed.`:`A Property page needs a published advanced measurement setup. Republish setup from the project Portfolio tab.`}),(0,U.jsx)(_,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,U.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:h},children:C?Oe?`Republish setup`:`Open measurement setup`:`View measurement setup`})})]}):(0,U.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,U.jsxs)(`div`,{className:`page-header`,children:[(0,U.jsxs)(`div`,{className:`page-header-left`,children:[qe,(0,U.jsx)(`h1`,{className:`page-title mt-2`,children:Z.label}),(0,U.jsxs)(`p`,{className:`page-subtitle`,children:[`Property in `,h,Q?(0,U.jsxs)(U.Fragment,{children:[` · Filters not applied `,(0,U.jsx)(j,{text:Q})]}):null]})]}),(0,U.jsxs)(`div`,{className:`page-header-right`,children:[z?(0,U.jsx)(v,{tone:be[z.measurement.state].tone,children:be[z.measurement.state].label}):null,B&&B.flags>0?(0,U.jsxs)(v,{tone:`caution`,children:[B.flags,` flagged`]}):null]})]}),(0,U.jsx)(Ne,{branded:I,nonBrand:L,brandedError:A.isError,nonBrandError:F.isError,onRetry:e=>{e===`branded`?A.refetch():F.refetch()}}),he?(0,U.jsxs)(`section`,{className:`flex flex-wrap items-center justify-between gap-3 py-4`,"aria-label":`Measurement next step`,children:[(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?ce:C?`Run a measurement from the project overview to collect this Property’s coverage and source evidence.${_e?` AI Visibility still shows the last results.`:``}`:`This Property needs a new measurement before coverage and source evidence are available.`}),(0,U.jsx)(_,{asChild:!0,type:`button`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,U.jsx)(c,{to:`/projects/$projectName`,params:{projectName:h},search:_e?G:M,children:_e?`See the last results`:C?`Go to AI Visibility`:`View AI Visibility`})})]}):null,(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4 py-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`label`,{htmlFor:`property-query-class`,className:`block text-label-14-strong text-heading`,children:`Query type`}),(0,U.jsxs)(`select`,{id:`property-query-class`,value:E,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>N(e,{queryClass:t})})},className:`h-11 rounded-md border border-default bg-surface px-3 text-label-14 text-primary focus:outline-none focus:ring-2 focus:ring-mono-400`,children:[(0,U.jsx)(`option`,{value:`non-brand`,children:q[`non-brand`].technical}),(0,U.jsx)(`option`,{value:`branded`,children:q.branded.technical})]})]}),(0,U.jsx)(je,{measuredAt:me,unmeasuredReason:W,queryClass:E})]}),(0,U.jsx)(Pe,{row:B,queryClass:E,isError:pe}),(0,U.jsx)(Fe,{project:h,targetKey:g,queryClass:E}),(0,U.jsx)(Ie,{questions:Be,queryClass:E}),(0,U.jsx)(ve,{projectName:h,targetKey:g,published:Z,activeRevision:Y.revision,publishedBrandNames:X.identities.projectBrand.names}),(0,U.jsx)(Le,{urls:Ve}),(0,U.jsx)(Me,{project:h,groups:Ue}),(0,U.jsxs)(`section`,{"aria-labelledby":`property-evidence`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-evidence`,className:`text-heading-16 text-heading`,children:`Answers the engines gave`}),(0,U.jsx)(j,{text:`Answers for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent. Missing answer text shows Not measured. Open an answer to read its text and sources, including any other Property it named.`})]})}),$.length>0?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[$.length,` of `,We]}):null]}),pe?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Evidence for `,q[E].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):J.isPending&&$.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading evidence…`}):J.isError&&$.length===0?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{J.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?ce:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,U.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-caution`,children:`This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected.`}):$.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No answers matched this Property in the displayed measurement.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`property-answer-table-container overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table property-evidence-table`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Answers measured for this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query`}),(0,U.jsx)(`th`,{children:`Mentioned in the answer`}),(0,U.jsx)(`th`,{children:`Cited as a source`}),(0,U.jsx)(`th`,{children:`Sources`}),(0,U.jsx)(`th`,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Sources detail`})})]})}),(0,U.jsx)(`tbody`,{children:$.map(e=>{let t=xe(e),n=m.has(t),r=`property-answer-${encodeURIComponent(t)}`;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`tr`,{className:`property-answer-summary`,children:[(0,U.jsxs)(`td`,{className:`text-secondary`,children:[(0,U.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e.queryText}),(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[k(e.provider),e.location].filter(Boolean).join(` · `)}),e.historical||e.bridged?(0,U.jsx)(`span`,{className:`mt-1 flex`,children:(0,U.jsx)(v,{tone:`caution`,children:`Historical`})}):null]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Mentioned`}),(0,U.jsx)(Se,{row:e})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Cited`}),(0,U.jsx)(we,{row:e})]}),(0,U.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:R}),e.cited===null?Ce:e.sources.length]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":n,"aria-label":n?`Hide the answer for ${e.queryText}`:`Read the answer for ${e.queryText}`,"aria-controls":n?r:void 0,onClick:()=>ee(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n}),children:n?`Hide answer`:`Read answer`})})]}),n?(0,U.jsx)(`tr`,{className:`property-answer-detail`,children:(0,U.jsxs)(`td`,{id:r,colSpan:5,className:`bg-surface-subtle px-4`,children:[(0,U.jsx)(Ee,{project:h,targetKey:g,resultId:e.observationId}),(0,U.jsx)(Te,{row:e})]})}):null]},t)})})]})}),J.hasNextPage?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Showing `,$.length,` of `,We]}),J.isFetchNextPageError?(0,U.jsx)(`span`,{role:`alert`,children:`Could not load more evidence.`}):null,(0,U.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:J.isFetchingNextPage,onClick:()=>{J.fetchNextPage()},children:J.isFetchingNextPage?`Loading…`:J.isFetchNextPageError?`Retry more evidence`:`Show ${ye} more`})]}):null]})]}),z?(0,U.jsx)(Re,{project:h,targetKey:g,queryClass:E,runId:V,targetLabels:He}):null]})}export{Y as EVIDENCE_LABELS,Be as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};