bazilion 0.17.0 → 0.18.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.
- package/dist/cli.js +336 -67
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1770 -151
- package/dist/daemon.js.map +1 -1
- package/dist/migrations/0001_init.sql +107 -0
- package/dist/web/client/assets/{ChatPane-BI3QVX2A.js → ChatPane-CAYS_fIQ.js} +1 -1
- package/dist/web/client/assets/ConfirmDialog-BzIiABOP.js +1 -0
- package/dist/web/client/assets/{FieldRow-swJ5qn2h.js → FieldRow-W_54rw5c.js} +1 -1
- package/dist/web/client/assets/{ProductionTeamPolicyEditor-LGw1UuF-.js → ProductionTeamPolicyEditor-DNXVX8Lz.js} +2 -2
- package/dist/web/client/assets/{ProfileCommunicationEditor-raoau_YB.js → ProfileCommunicationEditor-DN0fOzqn.js} +1 -1
- package/dist/web/client/assets/{ResultSourceConversation-BEwkhFog.js → ResultSourceConversation-DoU4tOWc.js} +1 -1
- package/dist/web/client/assets/TeamTabs-BmTZRI4T.js +1 -0
- package/dist/web/client/assets/{TemplatesTabs-BX5hhEJ7.js → TemplatesTabs-Bs_OXKwx.js} +1 -1
- package/dist/web/client/assets/{UnsavedChangesGuard-CVJtmR1D.js → UnsavedChangesGuard-CPRtFReU.js} +1 -1
- package/dist/web/client/assets/{_id-DmEVZIlx.js → _id-CxAB4TDr.js} +1 -1
- package/dist/web/client/assets/{_id-DHqq2W34.js → _id-DL4tJFQB.js} +1 -1
- package/dist/web/client/assets/{_id-BQPOE3gj.js → _id-DR9eFC17.js} +1 -1
- package/dist/web/client/assets/{_id-BkYrUP0R.js → _id-Dbmei5tg.js} +1 -1
- package/dist/web/client/assets/{_id-CriixlZD.js → _id-ybF-pqmr.js} +1 -1
- package/dist/web/client/assets/{activity-Bzr8R18n.js → activity-oUyy77jD.js} +1 -1
- package/dist/web/client/assets/{agents-13oafeOA.js → agents-D_TrEqAg.js} +1 -1
- package/dist/web/client/assets/{agents-DF4NALmJ.js → agents-DkjJp7JP.js} +1 -1
- package/dist/web/client/assets/{approvals-DsG0Ijls.js → approvals-DhOerWdt.js} +1 -1
- package/dist/web/client/assets/{attention-DG7K25mz.js → attention-DGwiF-Jy.js} +1 -1
- package/dist/web/client/assets/chevron-right-DSa4xPTs.js +1 -0
- package/dist/web/client/assets/{config-DAaDbFhS.js → config-BJ2ZzHPR.js} +1 -1
- package/dist/web/client/assets/{inbox-C9e7QjsX.js → inbox-BUElnGep.js} +1 -1
- package/dist/web/client/assets/{index-Dsstm2hf.js → index-Bi-HxcPG.js} +2 -2
- package/dist/web/client/assets/{learning-23arTd21.js → learning-BiTHNwB3.js} +1 -1
- package/dist/web/client/assets/login-BmcZvAH2.js +1 -0
- package/dist/web/client/assets/{mcp-Cdx9qAl8.js → mcp-Cwk9V82W.js} +1 -1
- package/dist/web/client/assets/{members-fotOz4rR.js → members-CHDNabFh.js} +1 -1
- package/dist/web/client/assets/{memory-C7UznVot.js → memory-Cx_Fpd4e.js} +1 -1
- package/dist/web/client/assets/{policy-CactLW1X.js → policy-C0nMdwcG.js} +1 -1
- package/dist/web/client/assets/{results-DqEuYnQH.js → results-Bz3jASs-.js} +1 -1
- package/dist/web/client/assets/{review-CnBSYclb.js → review-AK9WGmpv.js} +1 -1
- package/dist/web/client/assets/routes-DsMY_6oy.js +1 -0
- package/dist/web/client/assets/{services-xEANwZAu.js → services-DItA6fJ7.js} +1 -1
- package/dist/web/client/assets/{skills-CamV6wYM.js → skills-DbNV2vgL.js} +1 -1
- package/dist/web/client/assets/{teams-B12dMSjW.js → teams-D83scDxw.js} +1 -1
- package/dist/web/client/assets/{teams-CbH43zSG.js → teams-DAny1ypN.js} +1 -1
- package/dist/web/client/assets/{telegram-muIql4u-.js → telegram-BOmf9vUh.js} +1 -1
- package/dist/web/client/assets/{tokens-DGFmApdF.js → tokens-DBGH6Bw5.js} +1 -1
- package/dist/web/client/assets/{triggers-D8n3sCBW.js → triggers-D1_pseI3.js} +1 -1
- package/dist/web/client/assets/verifications-CBTo-FyV.js +2 -0
- package/dist/web/client/assets/{welcome-CMHWRZhs.js → welcome-DAfPOm15.js} +1 -1
- package/dist/web/client/assets/{x-BGCHwZOH.js → x-CWY-gUaM.js} +1 -1
- package/dist/web/server/assets/{TeamTabs-DQXh-3ij.js → TeamTabs-Dg4v6x0-.js} +4 -0
- package/dist/web/server/assets/{_id-DDyA9CGX.js → _id--onriuvj.js} +1 -1
- package/dist/web/server/assets/{_id-XkxlX036.js → _id--zoh1vv7.js} +1 -1
- package/dist/web/server/assets/{_id-Dw3gKOGv.js → _id-6p-mDmI8.js} +1 -1
- package/dist/web/server/assets/{_id-CPfILjMa.js → _id-DptBl3X8.js} +1 -1
- package/dist/web/server/assets/{_id-DtJn-yzu.js → _id-EAjRXNbD.js} +2 -2
- package/dist/web/server/assets/{_id-DSPFJMzf.js → _id-dUnXL-My2.js} +1 -1
- package/dist/web/server/assets/{_tanstack-start-manifest_v-vOXRfKJD.js → _tanstack-start-manifest_v-B3M-dfRO.js} +90 -79
- package/dist/web/server/assets/{activity-pYQPT3QT.js → activity-C5jpoEQI.js} +1 -1
- package/dist/web/server/assets/{activity-BX1jZBPQ.js → activity-Cu7zKPGD.js} +1 -1
- package/dist/web/server/assets/{activity-bozPMU2v.js → activity-Dn50vkQP.js} +2 -2
- package/dist/web/server/assets/{agents-BKBfW700.js → agents-RE6aYOb-.js} +1 -1
- package/dist/web/server/assets/{agents-CVCfxnE2.js → agents-nAOx_H7s.js} +1 -1
- package/dist/web/server/assets/{approvals-C3ya6B6U.js → approvals-DhHxIDrL.js} +1 -1
- package/dist/web/server/assets/{attention-l28hGCHS.js → attention-CBWzWRni.js} +1 -1
- package/dist/web/server/assets/{auth-AvDFNeOv.js → auth-tB3i6cFd.js} +1 -1
- package/dist/web/server/assets/{config-BWKn4XII.js → config-D1k_tTAw.js} +1 -1
- package/dist/web/server/assets/{daemon-client-Cgx-YW4l.js → daemon-client-C7qjQ2iO.js} +15 -0
- package/dist/web/server/assets/{git-review-f_uta4Mx.js → git-review-Bf5ABFJg.js} +1 -1
- package/dist/web/server/assets/{inbox-BBZiOOQs.js → inbox-Dw4pTevh.js} +1 -1
- package/dist/web/server/assets/{learning-CheVay1i.js → learning-CF8ZzFVD.js} +1 -1
- package/dist/web/server/assets/{mcp-DCBDmNtQ.js → mcp-D5dmBT82.js} +1 -1
- package/dist/web/server/assets/{members-C5FQruRZ.js → members-Bd0OtiTr.js} +1 -1
- package/dist/web/server/assets/{members-C2He8mrU.js → members-CvwEN9pm.js} +1 -1
- package/dist/web/server/assets/{members-C_2xB9pr.js → members-xSXoYUOd.js} +2 -2
- package/dist/web/server/assets/{memory-rmiFNj7T.js → memory-CcPK7um7.js} +1 -1
- package/dist/web/server/assets/{memory-BTcmf0sD.js → memory-UP6AsRkO.js} +2 -2
- package/dist/web/server/assets/{memory-4tI-UbOf.js → memory-lo2vHRNw.js} +1 -1
- package/dist/web/server/assets/{policy-C3D2Q1EA.js → policy-B62WXIFo.js} +1 -1
- package/dist/web/server/assets/{policy-BGILKGHz.js → policy-Bze9Krhg.js} +2 -2
- package/dist/web/server/assets/{policy-DS7LGe--.js → policy-Dh6wd2wN.js} +1 -1
- package/dist/web/server/assets/{results-_6K_zXQS.js → results-BFqs2iOu.js} +1 -1
- package/dist/web/server/assets/{results-C6H42tjq.js → results-BWnu3gXP.js} +1 -1
- package/dist/web/server/assets/{results-Cgx7SrFt.js → results-CzZk50Fu.js} +2 -2
- package/dist/web/server/assets/{review-DHhiL-JQ.js → review-DUe3vHPU.js} +2 -2
- package/dist/web/server/assets/{review-DSTMCwP4.js → review-c_-cFi7H.js} +1 -1
- package/dist/web/server/assets/{router-ElARvZzI.js → router-Deq94UJQ.js} +33 -26
- package/dist/web/server/assets/{routes-BgMvLvS-.js → routes-CVKkvFVv.js} +1 -1
- package/dist/web/server/assets/{services-yHZroxsi.js → services-CEr61xb5.js} +1 -1
- package/dist/web/server/assets/{skills--bIKID1Q.js → skills-BImC3LTO.js} +1 -1
- package/dist/web/server/assets/{teams-BbRfuVXY.js → teams-8zEIo08E.js} +1 -1
- package/dist/web/server/assets/{teams--a956vWL.js → teams-D-yaAWLV.js} +1 -1
- package/dist/web/server/assets/{telegram-4kMxRtVZ.js → telegram-CGl_LFtJ.js} +1 -1
- package/dist/web/server/assets/{tokens-BYwTN9JZ.js → tokens-cB-uf7qm.js} +1 -1
- package/dist/web/server/assets/{triggers-BM6mzLuH.js → triggers-CtSj79L0.js} +1 -1
- package/dist/web/server/assets/verification-B5QjcpIo.js +97 -0
- package/dist/web/server/assets/verifications-BfQsfwSE.js +268 -0
- package/dist/web/server/assets/verifications-CUq_6ZqL.js +26 -0
- package/dist/web/server/server.js +51 -35
- package/dist/worker.js +178 -4
- package/dist/worker.js.map +1 -1
- package/package.json +3 -3
- package/dist/web/client/assets/ConfirmDialog-Qam6Ut08.js +0 -1
- package/dist/web/client/assets/TeamTabs-BDdTLGIf.js +0 -1
- package/dist/web/client/assets/chevron-right-DFqFHtLy.js +0 -1
- package/dist/web/client/assets/login-BIXnBsuj.js +0 -1
- package/dist/web/client/assets/routes-COxMuwVz.js +0 -1
|
@@ -806,3 +806,110 @@ CREATE TABLE source_snapshots (
|
|
|
806
806
|
);
|
|
807
807
|
CREATE INDEX source_snapshots_retention ON source_snapshots(expires_at, snapshot_id);
|
|
808
808
|
CREATE INDEX source_snapshots_team_time ON source_snapshots(team_id, created_at, snapshot_id);
|
|
809
|
+
|
|
810
|
+
-- BAZ-044: specialist verification of a captured code change.
|
|
811
|
+
--
|
|
812
|
+
-- One typed request binds exactly one immutable change (a BAZ-042 snapshot) to a finite set of
|
|
813
|
+
-- captured commands and the BAZ-040 admitted environment, and one selected same-Team specialist.
|
|
814
|
+
-- This is a bounded dispatch-and-evidence record, not a workflow engine: there are no stages,
|
|
815
|
+
-- transformations, approver assignments, automatic retries or check substitution.
|
|
816
|
+
CREATE TABLE verification_requests (
|
|
817
|
+
id TEXT PRIMARY KEY,
|
|
818
|
+
team_id TEXT NOT NULL REFERENCES teams(id) ON DELETE CASCADE,
|
|
819
|
+
requester_kind TEXT NOT NULL CHECK (requester_kind IN ('agent', 'operator')),
|
|
820
|
+
requester_agent_id TEXT,
|
|
821
|
+
recipient_agent_id TEXT NOT NULL REFERENCES agents(id) ON DELETE CASCADE,
|
|
822
|
+
-- Canonical messaging identity when the request rides the existing peer message path.
|
|
823
|
+
message_id TEXT REFERENCES messages(id) ON DELETE SET NULL,
|
|
824
|
+
-- BAZ-035 conversation identity of the source task, when there is one.
|
|
825
|
+
source_session_id TEXT,
|
|
826
|
+
-- BAZ-042 evidence identity. Deliberately not a foreign key: a snapshot has its own seven-day
|
|
827
|
+
-- window, and a request whose evidence is gone must report that rather than resolve to a
|
|
828
|
+
-- different tree.
|
|
829
|
+
snapshot_id TEXT NOT NULL,
|
|
830
|
+
snapshot_complete INTEGER NOT NULL CHECK (snapshot_complete IN (0, 1)),
|
|
831
|
+
head TEXT,
|
|
832
|
+
base_oid TEXT NOT NULL,
|
|
833
|
+
-- BAZ-040 admitted environment facts resolved at admission and frozen with the request.
|
|
834
|
+
environment_json TEXT NOT NULL CHECK (json_valid(environment_json)),
|
|
835
|
+
summary TEXT CHECK (summary IS NULL OR length(CAST(summary AS BLOB)) <= 2000),
|
|
836
|
+
state TEXT NOT NULL CHECK (state IN (
|
|
837
|
+
'pending', 'awaiting_approval', 'blocked', 'running',
|
|
838
|
+
'completed', 'failed', 'cancelled', 'uncertain'
|
|
839
|
+
)),
|
|
840
|
+
created_at INTEGER NOT NULL,
|
|
841
|
+
expires_at INTEGER NOT NULL,
|
|
842
|
+
CHECK (expires_at > created_at),
|
|
843
|
+
-- An operator request has no Agent requester; an Agent request must name one.
|
|
844
|
+
CHECK ((requester_kind = 'agent') = (requester_agent_id IS NOT NULL)),
|
|
845
|
+
-- A specialist never verifies its own request.
|
|
846
|
+
CHECK (requester_agent_id IS NULL OR requester_agent_id != recipient_agent_id)
|
|
847
|
+
);
|
|
848
|
+
CREATE INDEX verification_requests_team_time
|
|
849
|
+
ON verification_requests(team_id, created_at DESC, id);
|
|
850
|
+
CREATE INDEX verification_requests_recipient_dispatch
|
|
851
|
+
ON verification_requests(recipient_agent_id, state, created_at);
|
|
852
|
+
CREATE INDEX verification_requests_retention ON verification_requests(expires_at, id);
|
|
853
|
+
|
|
854
|
+
-- The captured contract: at most eight checks, each with an exact command, cwd, purpose and
|
|
855
|
+
-- timeout. Immutable once written, so a later attempt cannot reinterpret what was agreed.
|
|
856
|
+
CREATE TABLE verification_checks (
|
|
857
|
+
request_id TEXT NOT NULL REFERENCES verification_requests(id) ON DELETE CASCADE,
|
|
858
|
+
ordinal INTEGER NOT NULL CHECK (ordinal BETWEEN 0 AND 7),
|
|
859
|
+
command TEXT NOT NULL CHECK (length(CAST(command AS BLOB)) BETWEEN 1 AND 2000),
|
|
860
|
+
cwd TEXT NOT NULL CHECK (length(CAST(cwd AS BLOB)) <= 1000),
|
|
861
|
+
purpose TEXT NOT NULL CHECK (length(CAST(purpose AS BLOB)) BETWEEN 1 AND 500),
|
|
862
|
+
timeout_ms INTEGER NOT NULL CHECK (timeout_ms BETWEEN 1000 AND 300000),
|
|
863
|
+
PRIMARY KEY (request_id, ordinal)
|
|
864
|
+
);
|
|
865
|
+
|
|
866
|
+
-- Execution attempts. Claiming is transactional and leased so exactly one owner dispatches a
|
|
867
|
+
-- request; a claim left by an interrupted process becomes uncertain and is never automatically
|
|
868
|
+
-- replayed. An explicit rerun is a new attempt that links to the result it supersedes.
|
|
869
|
+
CREATE TABLE verification_attempts (
|
|
870
|
+
id TEXT PRIMARY KEY,
|
|
871
|
+
request_id TEXT NOT NULL REFERENCES verification_requests(id) ON DELETE CASCADE,
|
|
872
|
+
attempt_number INTEGER NOT NULL CHECK (attempt_number >= 1),
|
|
873
|
+
supersedes_attempt_id TEXT REFERENCES verification_attempts(id) ON DELETE SET NULL,
|
|
874
|
+
state TEXT NOT NULL CHECK (state IN (
|
|
875
|
+
'claimed', 'running', 'completed', 'failed', 'cancelled', 'uncertain'
|
|
876
|
+
)),
|
|
877
|
+
lease_owner TEXT,
|
|
878
|
+
lease_expires_at INTEGER,
|
|
879
|
+
started_at INTEGER,
|
|
880
|
+
finished_at INTEGER,
|
|
881
|
+
error TEXT CHECK (error IS NULL OR length(CAST(error AS BLOB)) <= 2000),
|
|
882
|
+
created_at INTEGER NOT NULL,
|
|
883
|
+
CHECK ((state IN ('claimed', 'running')) = (finished_at IS NULL)),
|
|
884
|
+
CHECK ((state IN ('claimed', 'running')) = (lease_owner IS NOT NULL)),
|
|
885
|
+
CHECK (state != 'claimed' OR started_at IS NULL),
|
|
886
|
+
UNIQUE (request_id, attempt_number)
|
|
887
|
+
);
|
|
888
|
+
CREATE UNIQUE INDEX verification_attempts_one_open_per_request
|
|
889
|
+
ON verification_attempts(request_id) WHERE finished_at IS NULL;
|
|
890
|
+
CREATE INDEX verification_attempts_lease ON verification_attempts(state, lease_expires_at);
|
|
891
|
+
|
|
892
|
+
-- Executor-owned outcomes, one row set per attempt. History is never rewritten: a rerun records
|
|
893
|
+
-- its own outcomes beside the previous attempt's, so the earlier receipt stays readable.
|
|
894
|
+
CREATE TABLE verification_check_outcomes (
|
|
895
|
+
attempt_id TEXT NOT NULL REFERENCES verification_attempts(id) ON DELETE CASCADE,
|
|
896
|
+
ordinal INTEGER NOT NULL CHECK (ordinal BETWEEN 0 AND 7),
|
|
897
|
+
state TEXT NOT NULL CHECK (state IN (
|
|
898
|
+
'not_executed', 'succeeded', 'failed', 'skipped', 'blocked',
|
|
899
|
+
'timed_out', 'cancelled', 'unknown'
|
|
900
|
+
)),
|
|
901
|
+
command_id TEXT REFERENCES coding_commands(id) ON DELETE SET NULL,
|
|
902
|
+
exit_code INTEGER,
|
|
903
|
+
started_at INTEGER,
|
|
904
|
+
finished_at INTEGER,
|
|
905
|
+
PRIMARY KEY (attempt_id, ordinal),
|
|
906
|
+
CHECK ((state = 'not_executed') = (finished_at IS NULL)),
|
|
907
|
+
-- A skipped, blocked or interrupted check must not borrow a receipt from another run. Stated
|
|
908
|
+
-- one-directionally on purpose: `command_id` is ON DELETE SET NULL, so a required-non-null rule here
|
|
909
|
+
-- would make a referenced receipt impossible to prune — and pruning runs on every command save, so
|
|
910
|
+
-- the failure would spread to every later receipt in the Team. An executed outcome whose receipt was
|
|
911
|
+
-- pruned therefore keeps its state and exit code with no receipt pointer.
|
|
912
|
+
CHECK (command_id IS NULL OR state IN ('succeeded', 'failed', 'timed_out', 'cancelled')),
|
|
913
|
+
CHECK (exit_code IS NULL OR state IN ('succeeded', 'failed'))
|
|
914
|
+
);
|
|
915
|
+
CREATE INDEX verification_check_outcomes_command ON verification_check_outcomes(command_id);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{h as r}from"./index-
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{h as r}from"./index-Bi-HxcPG.js";import{t as i}from"./Button-ByiV6fpd.js";import{n as a,t as o}from"./git-review-presentation-CzHQulDk.js";import{t as s}from"./ResultCard-Cps_lXVN.js";function c(e){let t=e.split(`
|
|
2
2
|
`).map(e=>e.trim()).find(e=>/^(?:[A-Za-z]*Error(?: \[[A-Z_]+\])?:|ERR_[A-Z_]+\b)/.test(e));return t?t.length>240?`${t.slice(0,237)}…`:t:null}function l(e){let t=e.split(`
|
|
3
3
|
`).find(e=>e.startsWith(`--- from `));if(!t)return`Teammate update received`;let n=/^--- from (.+?) \(message [0-9a-f-]+(?:, reply to [0-9a-f-]+)?\) ---$/.exec(t);if(!n)return`Teammate update received`;let r=n[1]?.replace(/ \([0-9a-f-]{36}\)$/,``).trim();return!r||/^[0-9a-f-]{36}$/.test(r)?`Teammate update received`:`Update from ${r.slice(0,100)}`}var u=e(n(),1),d=65536;async function f(e,t=fetch){let n=`/api/teams/${encodeURIComponent(e.teamId)}/coding-commands/${encodeURIComponent(e.commandId)}/log`;try{let e=await t(`${n}?limit=${d}`,{headers:{accept:`application/json`}});if(e.status===403)return{status:`not-shared`};if(e.status===404)return{status:`missing`};if(!e.ok)return{status:`unavailable`,message:`Request failed (${e.status}).`};let r=await e.json(),i=p(r);if(!i)return{status:`unavailable`,message:`Unexpected response from the daemon.`};if(h(r,`page`)===null)return{status:`not-shared`};let a=m(h(r,`page`));return a?{status:`available`,page:a,view:i}:{status:`unavailable`,message:`Unexpected response from the daemon.`}}catch{return{status:`unavailable`,message:`The daemon could not be reached.`}}}function p(e){let t=h(e,`view`);return!g(t)||typeof t.commandId!=`string`||typeof t.availability!=`string`||typeof t.byteLength!=`number`?null:t}function m(e){return!g(e)||typeof e.text!=`string`||typeof e.availability!=`string`||typeof e.offset!=`number`||typeof e.hasMore!=`boolean`||typeof e.byteLength!=`number`?null:e}function h(e,t){return g(e)?e[t]:void 0}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _=t();function v({name:e,body:t,pending:n=!1,log:r}){if(!n&&t===`Coding context or command evidence retained privately. Captured transport output follows its communication approval; ask the Agent for the relevant result.`)return(0,_.jsxs)(`details`,{className:`py-1 text-xs font-sans`,"aria-label":`Private command details`,children:[(0,_.jsx)(`summary`,{className:`cursor-pointer`,children:`Detailed output isn’t included in this history view`}),(0,_.jsx)(`p`,{className:`mt-1`,children:`The Agent’s summary is shown in the conversation. Ask the Agent to summarize its retained command result if you need more detail.`}),r&&(0,_.jsx)(b,{reference:r})]});let i;try{i=JSON.parse(t)}catch{return(0,_.jsx)(`span`,{children:t})}if(!i||typeof i!=`object`)return(0,_.jsx)(`span`,{children:t});if(n){let t=i;return(0,_.jsxs)(`p`,{className:`py-1 break-words`,children:[e===`coding_command`?`Running`:`Inspecting`,`:`,` `,typeof t.command==`string`?t.command:typeof t.target==`string`?t.target:`command evidence`]})}if(e===`repository_context`){let e=i;return Array.isArray(e.instructions?.files)?(0,_.jsxs)(`details`,{className:`py-1`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Repository: `,e.target,` ·`,` `,e.instructions.state===`complete`?`${e.instructions.files.length} instruction files`:`instructions unavailable`]}),e.instructions.files.map(e=>(0,_.jsx)(`p`,{children:e.path},e.path)),(0,_.jsxs)(`p`,{children:[e.commands?.candidates?.length??0,` suggested commands ·`,` `,e.git?.state===`available`?e.git.branch:`Git unavailable`]}),(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:t})]}):(0,_.jsx)(`span`,{children:t})}if(e===`coding_log`){let e=i;return typeof e.text!=`string`||typeof e.availability!=`string`?(0,_.jsx)(`span`,{children:t}):(0,_.jsxs)(`details`,{className:`py-1`,"aria-label":`Retained command output`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Retained output: `,e.availability,e.hasMore?` · more available`:``]}),(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:e.text}),(0,_.jsxs)(`p`,{className:`text-xs`,children:[`bytes `,typeof e.offset==`number`?e.offset:0,`–`,(typeof e.offset==`number`?e.offset:0)+e.text.length,` of`,` `,typeof e.byteLength==`number`?e.byteLength:0]})]})}if(e===`coding_environment`){let e=i;return typeof e.posture==`string`?(0,_.jsxs)(`details`,{className:`py-1`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Environment: `,e.posture,` · `,e.cwd]}),(0,_.jsx)(`p`,{className:`break-all`,children:e.imageId??`Host runtime`}),Array.isArray(e.restrictions)&&e.restrictions.filter(e=>typeof e==`string`).map(e=>(0,_.jsx)(`p`,{children:e},e))]}):(0,_.jsx)(`span`,{children:t})}let a=i,o=e===`coding_receipt`?a.receipt:i;if(!o||typeof o.state!=`string`||typeof o.input?.command!=`string`||typeof o.input?.cwd!=`string`)return(0,_.jsx)(`span`,{children:t});let s=o.state===`failed`&&typeof o.diagnostic==`string`?c(o.diagnostic):null;return(0,_.jsxs)(`div`,{className:`py-2`,"aria-label":`Coding command result`,children:[(0,_.jsxs)(`p`,{className:`font-sans`,children:[(0,_.jsx)(`strong`,{className:o.state===`succeeded`?`text-sapphire-deep`:`text-mocha`,children:o.state.replaceAll(`_`,` `)}),` `,`· `,o.input.purpose,typeof o.exitCode==`number`?` · exit ${o.exitCode}`:``,e===`coding_receipt`?` · ${a.applicability}`:``]}),(0,_.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:o.input.command}),(0,_.jsxs)(`p`,{className:`text-xs`,children:[o.input.cwd,` · `,o.environment?.posture,` · result at execution time`]}),s&&(0,_.jsx)(`p`,{className:`mt-1 font-sans text-rose-baziu`,"aria-label":`Command failure summary`,children:s}),typeof o.reason==`string`&&(0,_.jsx)(`p`,{children:o.reason}),(0,_.jsxs)(`details`,{children:[(0,_.jsx)(`summary`,{className:`cursor-pointer`,children:`Output and evidence`}),(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:o.diagnostic}),o.truncated&&(0,_.jsx)(`p`,{children:`Output truncated.`}),(0,_.jsxs)(`p`,{className:`break-all`,children:[`coding-receipt:`,o.id]}),(0,_.jsx)(y,{teamId:o.teamId,after:o.sourceAfter??null,before:o.sourceBefore??null}),o.environment?.imageId&&(0,_.jsx)(`p`,{className:`break-all`,children:o.environment.imageId})]})]})}function y({teamId:e,after:t,before:n}){let[s,c]=(0,u.useState)(null),[l,d]=(0,u.useState)(!1);async function f(){if(t){d(!0);try{c(await r({data:{teamId:e,snapshotId:t.id}}))}finally{d(!1)}}}let p=s?.status===`ok`?s:null,m=o(p);return(0,_.jsxs)(`p`,{className:a(p)?`text-rose-baziu`:void 0,children:[m,t?(0,_.jsxs)(_.Fragment,{children:[` · tested version `,(0,_.jsx)(`span`,{className:`break-all font-mono`,children:t.id.slice(0,12)}),t.complete?``:` (incomplete)`,p===null&&(0,_.jsxs)(_.Fragment,{children:[` `,(0,_.jsx)(i,{variant:`ghost`,disabled:l,onClick:()=>void f(),children:l?`Checking…`:`Check applicability`})]}),s?.status===`unavailable`&&(0,_.jsxs)(`span`,{children:[` · `,s.message]})]}):` · no source snapshot was captured for this result`,n&&(0,_.jsxs)(_.Fragment,{children:[` · started from `,(0,_.jsx)(`span`,{className:`break-all font-mono`,children:n.id.slice(0,12)})]})]})}function b({reference:e}){let[t,n]=(0,u.useState)(null),[r,a]=(0,u.useState)(!1);async function o(){a(!0);try{n(await f(e))}finally{a(!1)}}return t===null?(0,_.jsx)(`p`,{className:`mt-2`,children:(0,_.jsx)(i,{variant:`ghost`,disabled:r,onClick:()=>void o(),children:r?`Loading…`:`Show retained output`})}):t.status===`not-shared`?(0,_.jsx)(`p`,{className:`mt-2`,children:`This command’s output hasn’t been shared with the conversation yet.`}):t.status===`missing`?(0,_.jsx)(`p`,{className:`mt-2`,children:`This retained output is no longer available.`}):t.status===`unavailable`?(0,_.jsx)(`p`,{className:`mt-2`,role:`alert`,children:t.message}):(0,_.jsxs)(`div`,{className:`mt-2`,children:[(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-sm bg-[rgba(42,31,22,0.04)] p-2`,children:t.page.text}),(0,_.jsxs)(`p`,{children:[`Retained output: `,t.page.availability,t.page.hasMore?` · earlier output omitted`:``,` · bytes `,t.page.offset,`–`,t.page.offset+t.page.text.length,` of `,t.page.byteLength]})]})}function x(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e){if(Array.isArray(e))return e}function C(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function w(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(e,t){return S(e)||C(e,t)||E(e,t)||w()}function E(e,t){if(e){if(typeof e==`string`)return x(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}var D=Object.entries,O=Object.setPrototypeOf,k=Object.isFrozen,ee=Object.getPrototypeOf,te=Object.getOwnPropertyDescriptor,A=Object.freeze,j=Object.seal,M=Object.create,N=typeof Reflect<`u`&&Reflect,ne=N.apply,re=N.construct;A||=function(e){return e},j||=function(e){return e},ne||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},re||=function(e){return new e(...[...arguments].slice(1))};var ie=z(Array.prototype.forEach),ae=z(Array.prototype.lastIndexOf),oe=z(Array.prototype.pop),se=z(Array.prototype.push),ce=z(Array.prototype.splice),P=Array.isArray,le=z(String.prototype.toLowerCase),ue=z(String.prototype.toString),de=z(String.prototype.match),fe=z(String.prototype.replace),pe=z(String.prototype.indexOf),me=z(String.prototype.trim),F=z(Number.prototype.toString),he=z(Boolean.prototype.toString),I=typeof BigInt>`u`?null:z(BigInt.prototype.toString),ge=typeof Symbol>`u`?null:z(Symbol.prototype.toString),L=z(Object.prototype.hasOwnProperty),_e=z(Object.prototype.toString),R=z(RegExp.prototype.test),ve=ye(TypeError);function z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ne(e,t,n)}}function ye(e){return function(){return re(e,[...arguments])}}function B(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:le;if(O&&O(e,null),!P(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(k(t)||(t[r]=e),i=e)}e[i]=!0}return e}function V(e){for(let t=0;t<e.length;t++)L(e,t)||(e[t]=null);return e}function H(e){let t=M(null);for(let r of D(e)){var n=T(r,2);let i=n[0],a=n[1];L(e,i)&&(P(a)?t[i]=V(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=H(a):t[i]=a)}return t}function be(e){switch(typeof e){case`string`:return e;case`number`:return F(e);case`boolean`:return he(e);case`bigint`:return I?I(e):`0`;case`symbol`:return ge?ge(e):`Symbol()`;case`undefined`:return _e(e);case`function`:case`object`:{if(e===null)return _e(e);let t=e,n=U(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:_e(e)}return _e(e)}default:return _e(e)}}function U(e,t){for(;e!==null;){let n=te(e,t);if(n){if(n.get)return z(n.get);if(typeof n.value==`function`)return z(n.value)}e=ee(e)}function n(){return null}return n}function xe(e){try{return R(e,``),!0}catch{return!1}}var Se=A(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ce=A(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),we=A([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Te=A([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ee=A(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),De=A([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Oe=A([`#text`]),ke=A(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ae=A(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),je=A(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Me=A([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ne=j(/{{[\w\W]*|^[\w\W]*}}/g),Pe=j(/<%[\w\W]*|^[\w\W]*%>/g),Fe=j(/\${[\w\W]*/g),Ie=j(/^data-[\-\w.\u00B7-\uFFFF]+$/),Le=j(/^aria-[\-\w]+$/),Re=j(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ze=j(/^(?:\w+script|data):/i),Be=j(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ve=j(/^html$/i),He=j(/^[a-z][.\w]*(-[.\w]+)+$/i),Ue=j(/<[/\w!]/g),We=j(/<[/\w]/g),Ge=j(/<\/no(script|embed|frames)/i),Ke=j(/\/>/i),qe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Je=function(){return typeof window>`u`?null:window},Ye=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Xe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ze=function(e,t,n,r){return L(e,t)&&P(e[t])?B(r.base?H(r.base):{},e[t],r.transform):n};function Qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Je(),t=e=>Qe(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==qe.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=U(d,`cloneNode`),p=U(d,`remove`),m=U(d,`nextSibling`),h=U(d,`childNodes`),g=U(d,`parentNode`),_=U(d,`shadowRoot`),v=U(d,`attributes`),y=o&&o.prototype?U(o.prototype,`nodeType`):null,b=o&&o.prototype?U(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw ve(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},O=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},k=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},ee=function(){return w||=(C=Ye(u,i),!0),C},te=n,N=te.implementation,ne=te.createNodeIterator,re=te.createDocumentFragment,F=te.getElementsByTagName,he=r.importNode,I=Xe();t.isSupported=typeof D==`function`&&typeof g==`function`&&N&&N.createHTMLDocument!==void 0;let ge=Ne,_e=Pe,z=Fe,ye=Ie,V=Le,$e=ze,et=Be,tt=He,nt=Re,W=null,rt=B({},[...Se,...Ce,...we,...Ee,...Oe]),G=null,it=B({},[...ke,...Ae,...je,...Me]),K=Object.seal(M(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),at=null,ot=null,st=Object.seal(M(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ct=!0,lt=!0,ut=!1,dt=!0,ft=!1,pt=!0,mt=!1,ht=!1,gt=null,_t=null,vt=!1,yt=!1,bt=!1,xt=!1,St=!0,Ct=!1,wt=`user-content-`,Tt=!0,Et=!1,Dt={},q=null,Ot=B({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),kt=null,At=B({},[`audio`,`video`,`img`,`source`,`image`,`track`]),jt=null,Mt=B({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Nt=`http://www.w3.org/1998/Math/MathML`,Pt=`http://www.w3.org/2000/svg`,Ft=`http://www.w3.org/1999/xhtml`,It=Ft,Lt=!1,Rt=null,zt=B({},[Nt,Pt,Ft],ue),Bt=A([`mi`,`mo`,`mn`,`ms`,`mtext`]),Vt=B({},Bt),Ht=A([`annotation-xml`]),Ut=B({},Ht),Wt=B({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],J=null,qt=null,Jt=n.createElement(`form`),Yt=function(e){return e instanceof RegExp||e instanceof Function},Xt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qt&&qt===e)return;(!e||typeof e!=`object`)&&(e={}),e=H(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Gt===`application/xhtml+xml`?ue:le,W=Ze(e,`ALLOWED_TAGS`,rt,{transform:J}),G=Ze(e,`ALLOWED_ATTR`,it,{transform:J}),Rt=Ze(e,`ALLOWED_NAMESPACES`,zt,{transform:ue}),jt=Ze(e,`ADD_URI_SAFE_ATTR`,Mt,{transform:J,base:Mt}),kt=Ze(e,`ADD_DATA_URI_TAGS`,At,{transform:J,base:At}),q=Ze(e,`FORBID_CONTENTS`,Ot,{transform:J}),at=Ze(e,`FORBID_TAGS`,H({}),{transform:J}),ot=Ze(e,`FORBID_ATTR`,H({}),{transform:J}),Dt=L(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?H(e.USE_PROFILES):e.USE_PROFILES:!1,ct=e.ALLOW_ARIA_ATTR!==!1,lt=e.ALLOW_DATA_ATTR!==!1,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,dt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=e.SAFE_FOR_TEMPLATES||!1,pt=e.SAFE_FOR_XML!==!1,mt=e.WHOLE_DOCUMENT||!1,yt=e.RETURN_DOM||!1,bt=e.RETURN_DOM_FRAGMENT||!1,xt=e.RETURN_TRUSTED_TYPE||!1,vt=e.FORCE_BODY||!1,St=e.SANITIZE_DOM!==!1,Ct=e.SANITIZE_NAMED_PROPS||!1,Tt=e.KEEP_CONTENT!==!1,Et=e.IN_PLACE||!1,nt=xe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Re,It=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ft,Vt=L(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?H(e.MATHML_TEXT_INTEGRATION_POINTS):B({},Bt),Ut=L(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?H(e.HTML_INTEGRATION_POINTS):B({},Ht);let t=L(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?H(e.CUSTOM_ELEMENT_HANDLING):M(null);if(K=M(null),L(t,`tagNameCheck`)&&Yt(t.tagNameCheck)&&(K.tagNameCheck=t.tagNameCheck),L(t,`attributeNameCheck`)&&Yt(t.attributeNameCheck)&&(K.attributeNameCheck=t.attributeNameCheck),L(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(K.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),j(K),ft&&(lt=!1),bt&&(yt=!0),Dt&&(W=B({},Oe),G=M(null),Dt.html===!0&&(B(W,Se),B(G,ke)),Dt.svg===!0&&(B(W,Ce),B(G,Ae),B(G,Me)),Dt.svgFilters===!0&&(B(W,we),B(G,Ae),B(G,Me)),Dt.mathMl===!0&&(B(W,Ee),B(G,je),B(G,Me))),st.tagCheck=null,st.attributeCheck=null,L(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?st.tagCheck=e.ADD_TAGS:P(e.ADD_TAGS)&&(W===rt&&(W=H(W)),B(W,e.ADD_TAGS,J))),L(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?st.attributeCheck=e.ADD_ATTR:P(e.ADD_ATTR)&&(G===it&&(G=H(G)),B(G,e.ADD_ATTR,J))),L(e,`ADD_URI_SAFE_ATTR`)&&P(e.ADD_URI_SAFE_ATTR)&&B(jt,e.ADD_URI_SAFE_ATTR,J),L(e,`FORBID_CONTENTS`)&&P(e.FORBID_CONTENTS)&&(q===Ot&&(q=H(q)),B(q,e.FORBID_CONTENTS,J)),L(e,`ADD_FORBID_CONTENTS`)&&P(e.ADD_FORBID_CONTENTS)&&(q===Ot&&(q=H(q)),B(q,e.ADD_FORBID_CONTENTS,J)),Tt&&(W[`#text`]=!0),mt&&B(W,[`html`,`head`,`body`]),W.table&&(B(W,[`tbody`]),delete at.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ve(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ve(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=O(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=ee()),x&&typeof S==`string`&&(S=O(``)));A&&A(e),qt=e},Zt=B({},[...Ce,...we,...Te]),Qt=B({},[...Ee,...De]),$t=function(e,t,n){return t.namespaceURI===Ft?e===`svg`:t.namespaceURI===Nt?e===`svg`&&(n===`annotation-xml`||Vt[n]):!!Zt[e]},en=function(e,t,n){return t.namespaceURI===Ft?e===`math`:t.namespaceURI===Pt?e===`math`&&Ut[n]:!!Qt[e]},tn=function(e,t,n){return t.namespaceURI===Pt&&!Ut[n]||t.namespaceURI===Nt&&!Vt[n]?!1:!Qt[e]&&(Wt[e]||!Zt[e])},nn=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:It,tagName:`template`});let n=le(e.tagName),r=le(t.tagName);return Rt[e.namespaceURI]?e.namespaceURI===Pt?$t(n,t,r):e.namespaceURI===Nt?en(n,t,r):e.namespaceURI===Ft?tn(n,t,r):!!(Gt===`application/xhtml+xml`&&Rt[e.namespaceURI]):!1},rn=function(e){se(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw ve(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},an=function(e){let t=h(e);if(t){let e=[];ie(t,t=>{se(e,t)}),ie(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},on=function(e,n){try{se(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{se(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(yt||bt)try{rn(n)}catch{}else try{n.setAttribute(e,``)}catch{}},sn=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||G[J(i)]))try{e.removeAttribute(i)}catch{}}},cn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===qe.element&&sn(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},ln=function(e){let t=null,r=null;if(vt)e=`<remove></remove>`+e;else{let t=de(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&It===Ft&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?O(e):e;if(It===Ft)try{t=new l().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=N.createDocument(It,`template`,null);try{t.documentElement.innerHTML=Lt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),It===Ft?F.call(t,mt?`html`:`body`)[0]:mt?t.documentElement:a},un=function(e){return ne.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Y=function(e){return e=fe(e,ge,` `),e=fe(e,_e,` `),e=fe(e,z,` `),e},dn=function(e){e.normalize();let t=ne.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=Y(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&ie(r,e=>{X(e.content)&&dn(e.content)})},fn=function(e){let t=b?b(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},X=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===qe.documentFragment}catch{return!1}},pn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function mn(e,n,r){e.length!==0&&ie(e,e=>{e.call(t,n,r,qt)})}let hn=function(e,t){return!!(pt&&e.hasChildNodes()&&!pn(e.firstElementChild)&&R(Ue,e.textContent)&&R(Ue,e.innerHTML)||pt&&e.namespaceURI===Ft&&t===`style`&&pn(e.firstElementChild)||e.nodeType===qe.processingInstruction||pt&&e.nodeType===qe.comment&&R(We,e.data))},gn=function(e,t){if(!at[t]&&yn(t)&&(K.tagNameCheck instanceof RegExp&&R(K.tagNameCheck,t)||K.tagNameCheck instanceof Function&&K.tagNameCheck(t)))return!1;if(Tt&&!q[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Et?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return rn(e),!0},_n=function(e){if(mn(I.beforeSanitizeElements,e,null),fn(e))return rn(e),!0;let n=J(b?b(e):e.nodeName);if(mn(I.uponSanitizeElement,e,{tagName:n,allowedTags:W}),hn(e,n))return rn(e),!0;if(at[n]||!(st.tagCheck instanceof Function&&st.tagCheck(n))&&!W[n])return gn(e,n);if((y?y(e):e.nodeType)===qe.element&&!nn(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&R(Ge,e.innerHTML))return rn(e),!0;if(ft&&e.nodeType===qe.text){let n=Y(e.textContent);e.textContent!==n&&(se(t.removed,{element:e.cloneNode()}),e.textContent=n)}return mn(I.afterSanitizeElements,e,null),!1},vn=function(e,t,r){if(ot[t]||St&&(t===`id`||t===`name`)&&(r in n||r in Jt))return!1;let i=G[t]||st.attributeCheck instanceof Function&&st.attributeCheck(t,e);if(!(lt&&R(ye,t))&&!(ct&&R(V,t))){if(!i){if(!(yn(e)&&(K.tagNameCheck instanceof RegExp&&R(K.tagNameCheck,e)||K.tagNameCheck instanceof Function&&K.tagNameCheck(e))&&(K.attributeNameCheck instanceof RegExp&&R(K.attributeNameCheck,t)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(t,e))||t===`is`&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&R(K.tagNameCheck,r)||K.tagNameCheck instanceof Function&&K.tagNameCheck(r))))return!1}else if(!jt[t]&&!R(nt,fe(r,et,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&pe(r,`data:`)===0&&kt[e])&&!(ut&&!R($e,fe(r,et,``)))&&r)return!1}return!0},Z=B({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),yn=function(e){return!Z[le(e)]&&R(tt,e)},bn=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return O(r);case`TrustedScriptURL`:return k(r)}return r},Q=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),fn(e)?rn(e):oe(t.removed)}catch{on(n,e)}},xn=function(e){mn(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||fn(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0},r=t.length,i=J(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=J(o),u=c,d=o===`value`?u:me(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,mn(I.uponSanitizeAttribute,e,n),d=n.attrValue,Ct&&(l===`id`||l===`name`)&&pe(d,wt)!==0&&(on(o,e),d=wt+d),pt&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){on(o,e);continue}if(l===`attributename`&&de(d,`href`)){on(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){on(o,e);continue}if(!dt&&R(Ke,d)){on(o,e);continue}if(ft&&(d=Y(d)),!vn(i,l,d)){on(o,e);continue}d=bn(i,l,s,d),d!==u&&Q(e,o,s,d)}}mn(I.afterSanitizeAttributes,e,null)},Sn=function(e){let t=null,n=un(e);for(mn(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(mn(I.uponSanitizeShadowNode,t,null),_n(t),xn(t),X(t.content)&&Sn(t.content),(y?y(t):t.nodeType)===qe.element){let e=_(t);X(e)&&($(e),Sn(e))}mn(I.afterSanitizeShadowDOM,e,null)},$=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Sn(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===qe.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&J(e)===`template`){let e=n.content;X(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);X(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Lt=!e,Lt&&(e=`<!-->`),typeof e!=`string`&&!pn(e)&&(e=be(e),typeof e!=`string`))throw ve(`dirty is not a string, aborting`);if(!t.isSupported)return e;ht?(W=gt,G=_t):Xt(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(W=H(W)),I.uponSanitizeAttribute.length>0&&(G=H(G)),t.removed=[];let c=Et&&typeof e!=`string`&&pn(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=J(t);if(!W[e]||at[e])throw ve(`root node is forbidden and cannot be sanitized in-place`)}if(fn(e))throw ve(`root node is clobbered and cannot be sanitized in-place`);try{$(e)}catch(t){throw an(e),t}}else if(pn(e))i=ln(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===qe.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),$(a);else{if(!yt&&!ft&&!mt&&e.indexOf(`<`)===-1)return x&&xt?O(e):e;if(i=ln(e),!i)return yt?null:xt?S:``}i&&vt&&rn(i.firstChild);let l=un(c?e:i);try{for(;o=l.nextNode();)_n(o),xn(o),X(o.content)&&Sn(o.content)}catch(t){throw c&&an(e),t}if(c)return ie(t.removed,e=>{e.element&&cn(e.element)}),ft&&dn(e),e;if(yt){if(ft&&dn(i),bt)for(s=re.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(G.shadowroot||G.shadowrootmode)&&(s=he.call(r,s,!0)),s}let u=mt?i.outerHTML:i.innerHTML;return mt&&W[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&R(Ve,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{$ as r,G as i,H as a,J as o,K as s,Q as c,U as l,W as u,X as d,Y as f,Z as p,et as m,nt as h,q as g,rt as _}from"./index-Bi-HxcPG.js";import{t as v}from"./Button-ByiV6fpd.js";var y=e(n(),1),b=t(),x=`Dialog`,[S,C]=r(x),[w,T]=S(x),E=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l,u]=p({prop:r,defaultProp:i??!1,onChange:a,caller:x});return(0,b.jsx)(w,{scope:t,triggerRef:s,contentRef:c,contentId:f(),titleId:f(),descriptionId:f(),open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};E.displayName=x;var D=`DialogTrigger`,O=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(D,n),a=_(t,i.triggerRef);return(0,b.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":J(i.open),...r,ref:a,onClick:c(e.onClick,i.onOpenToggle)})});O.displayName=D;var k=`DialogPortal`,[A,j]=S(k,{forceMount:void 0}),M=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=T(k,t);return(0,b.jsx)(A,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,b.jsx)(d,{present:n||o.open,children:(0,b.jsx)(i,{asChild:!0,container:a,children:e})}))})};M.displayName=k;var N=`DialogOverlay`,P=y.forwardRef((e,t)=>{let n=j(N,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=T(N,e.__scopeDialog);return a.modal?(0,b.jsx)(d,{present:r||a.open,children:(0,b.jsx)(I,{...i,ref:t})}):null});P.displayName=N;var F=h(`DialogOverlay.RemoveScroll`),I=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(N,n),a=_(t,o());return(0,b.jsx)(l,{as:F,allowPinchZoom:!0,shards:[i.contentRef],children:(0,b.jsx)(m.div,{"data-state":J(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),L=`DialogContent`,R=y.forwardRef((e,t)=>{let n=j(L,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=T(L,e.__scopeDialog);return(0,b.jsx)(d,{present:r||a.open,children:a.modal?(0,b.jsx)(z,{...i,ref:t}):(0,b.jsx)(B,{...i,ref:t})})});R.displayName=L;var z=y.forwardRef((e,t)=>{let n=T(L,e.__scopeDialog),r=y.useRef(null),i=_(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,b.jsx)(V,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:c(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:c(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:c(e.onFocusOutside,e=>e.preventDefault())})}),B=y.forwardRef((e,t)=>{let n=T(L,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,b.jsx)(V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),V=y.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=T(L,n);return u(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,b.jsx)(g,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":J(c.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),H=`DialogTitle`,U=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(H,n);return(0,b.jsx)(m.h2,{id:i.titleId,...r,ref:t})});U.displayName=H;var W=`DialogDescription`,G=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(W,n);return(0,b.jsx)(m.p,{id:i.descriptionId,...r,ref:t})});G.displayName=W;var K=`DialogClose`,q=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(K,n);return(0,b.jsx)(m.button,{type:`button`,...r,ref:t,onClick:c(e.onClick,()=>i.onOpenChange(!1))})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=typeof document>`u`?y.useEffect:y.useLayoutEffect;function X(e){let t=e.activeElement;return!t||t===e.body||t===e.documentElement||!(`focus`in t)||typeof t.focus!=`function`?null:t}function Z(e,t){!e||!e.isConnected||e.ownerDocument!==t||e.focus({preventScroll:!0})}function Q({open:e,title:t,description:n,confirmLabel:r,confirmVariant:i=`danger`,onConfirm:a,onOpenChange:o}){let[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=(0,y.useRef)(null),f=(0,y.useRef)(!1);Y(()=>{e&&!f.current&&(d.current=X(document)),f.current=e},[e]),(0,y.useEffect)(()=>{e||(c(!1),u(null))},[e]);async function p(){c(!0),u(null);try{await a(),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}return(0,b.jsx)(E,{open:e,onOpenChange:e=>{!e&&!s&&o(!1)},children:(0,b.jsxs)(M,{children:[(0,b.jsx)(P,{className:`fixed inset-0 z-50 bg-chocolate/35 backdrop-blur-[2px] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,b.jsxs)(R,{className:`fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-[16px] border border-frost bg-snow p-5 text-chocolate shadow-baziu-lg outline-none data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,onCloseAutoFocus:e=>{e.preventDefault();let t=d.current;d.current=null,Z(t,document)},onEscapeKeyDown:e=>{s&&e.preventDefault()},onPointerDownOutside:e=>{s&&e.preventDefault()},children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(U,{className:`font-serif text-xl text-chocolate`,children:t}),(0,b.jsx)(G,{asChild:!0,children:(0,b.jsx)(`div`,{className:`text-sm leading-6 text-mocha`,children:n})})]}),l&&(0,b.jsx)(`p`,{role:`alert`,className:`rounded-md bg-danger/10 px-3 py-2 text-sm text-danger`,children:l}),(0,b.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 border-t border-frost pt-4 sm:flex-row sm:justify-end`,children:[(0,b.jsx)(v,{variant:`ghost`,disabled:s,onClick:()=>o(!1),children:`cancel`}),(0,b.jsx)(v,{variant:i,disabled:s,onClick:()=>void p(),children:s?`working…`:r})]})]})]})})}export{G as a,U as c,R as i,E as n,P as o,q as r,M as s,Q as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-BzIiABOP.js";import{t as a}from"./Button-ByiV6fpd.js";var o=e(n(),1),s=t();function c({field:e}){let t=r(),n=(0,o.useId)(),c=`${n}-description`,[l,u]=(0,o.useState)(e.kind===`config`?e.value??``:``),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(null),[h,g]=(0,o.useState)(null),[_,v]=(0,o.useState)(!1),y=e.kind===`secret`&&l.trim().length===0;async function b(n){if(n.preventDefault(),y){m(e.set?`Paste a replacement value, or use remove credential to explicitly clear the stored secret.`:`A secret value is required.`);return}f(!0),m(null);try{let n=await fetch(`/api/config/fields/${encodeURIComponent(e.envVar)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({value:l})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}g(Date.now()),e.kind===`secret`&&u(``),await t.invalidate()}catch(e){m(e.message)}finally{f(!1)}}async function x(){let n=await fetch(`/api/config/fields/${encodeURIComponent(e.envVar)}`,{method:`DELETE`});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??`${n.status} ${n.statusText}`)}u(``),m(null),g(Date.now()),await t.invalidate()}return(0,s.jsxs)(`form`,{onSubmit:b,className:`grid grid-cols-1 gap-2 border-b py-3 last:border-0 md:grid-cols-[12rem_minmax(0,1fr)_auto_auto] md:items-center`,children:[(0,s.jsxs)(`div`,{className:`min-w-0`,children:[(0,s.jsx)(`label`,{htmlFor:n,className:`text-sm font-medium text-foreground`,children:e.label}),e.description&&(0,s.jsx)(`div`,{id:c,className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),(0,s.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,s.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced identifier`}),(0,s.jsx)(`code`,{className:`mt-1 inline-block break-all font-mono`,children:e.envVar})]})]}),(0,s.jsx)(`div`,{className:`min-w-0`,children:e.kind===`config`?(0,s.jsx)(`input`,{id:n,type:`text`,"aria-describedby":e.description?c:void 0,value:l,onChange:e=>u(e.target.value),placeholder:e.placeholder??``,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`input`,{id:n,type:`password`,"aria-describedby":e.description?c:void 0,value:l,onChange:e=>u(e.target.value),placeholder:e.set?`(paste to replace stored value)`:e.placeholder??`paste key…`,autoComplete:`off`,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}),e.set&&(0,s.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Blank keeps the current credential. Removal is a separate explicit action.`})]})}),(0,s.jsxs)(`span`,{className:`text-xs`,children:[e.kind===`secret`&&e.set&&(0,s.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-1.5 py-0.5`,title:`preview: ${e.preview??``}`,children:`set`}),h&&Date.now()-h<2e3&&(0,s.jsx)(`span`,{role:`status`,className:`text-success ml-2`,children:`saved ✓`})]}),(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-self-end`,children:[(0,s.jsx)(a,{variant:`ghost`,type:`submit`,disabled:d||y,className:`text-xs`,children:`save`}),e.kind===`secret`&&e.set&&(0,s.jsx)(a,{variant:`danger`,className:`text-xs`,onClick:()=>v(!0),children:`remove`})]}),p&&(0,s.jsx)(`p`,{role:`alert`,className:`text-xs text-danger md:col-span-4`,children:p}),(0,s.jsx)(i,{open:_,title:`Remove ${e.label}?`,description:(0,s.jsxs)(`p`,{children:[`This permanently deletes the stored `,(0,s.jsx)(`code`,{className:`font-mono`,children:e.envVar}),` `,`credential. Features that use it will fail until you save a replacement.`]}),confirmLabel:`remove stored credential`,onConfirm:x,onOpenChange:v})]})}export{c as t};
|