@ixo/editor 6.9.1 → 6.10.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/{chunk-3P2DGFGF.js → chunk-4ZVXFIH2.js} +563 -541
- package/dist/chunk-4ZVXFIH2.js.map +1 -0
- package/dist/core/index.d.ts +4 -4
- package/dist/{graphql-client-TT4tb5P6.d.ts → graphql-client-qoCnxfVJ.d.ts} +1 -1
- package/dist/{index-D0S6jY7O.d.ts → index-DBIxJFRG.d.ts} +2 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/mantine/index.d.ts +3 -3
- package/dist/mantine/index.js +1 -1
- package/dist/{store-BIt_Vdjw.d.ts → store-Us2PE0q8.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-3P2DGFGF.js.map +0 -1
|
@@ -30067,7 +30067,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
30067
30067
|
};
|
|
30068
30068
|
|
|
30069
30069
|
// src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
|
|
30070
|
-
import React306, { useCallback as useCallback102, useEffect as useEffect104, useMemo as
|
|
30070
|
+
import React306, { useCallback as useCallback102, useEffect as useEffect104, useMemo as useMemo109, useRef as useRef37, useState as useState156 } from "react";
|
|
30071
30071
|
import { Alert as Alert64, Loader as Loader53, Stack as Stack201, Text as Text189 } from "@mantine/core";
|
|
30072
30072
|
import { IconPlayerPlay as IconPlayerPlay5 } from "@tabler/icons-react";
|
|
30073
30073
|
import { SurveyModel as SurveyModel9 } from "@ixo/surveys";
|
|
@@ -30078,9 +30078,9 @@ import { Survey as Survey9 } from "@ixo/surveys";
|
|
|
30078
30078
|
var StableSurvey = React303.memo(Survey9, (prev, next) => prev.model === next.model);
|
|
30079
30079
|
|
|
30080
30080
|
// src/mantine/blocks/action/actionTypes/_shared/groupExecution/ActAsGroupSection.tsx
|
|
30081
|
-
import React304, { useEffect as useEffect102, useRef as useRef35, useState as useState154 } from "react";
|
|
30082
|
-
import { Alert as Alert62, Loader as Loader51, SegmentedControl as SegmentedControl13, Stack as Stack199, Text as Text187 } from "@mantine/core";
|
|
30083
|
-
import { IconUsersGroup as IconUsersGroup4 } from "@tabler/icons-react";
|
|
30081
|
+
import React304, { useEffect as useEffect102, useMemo as useMemo108, useRef as useRef35, useState as useState154 } from "react";
|
|
30082
|
+
import { Alert as Alert62, Group as Group106, Loader as Loader51, SegmentedControl as SegmentedControl13, Stack as Stack199, Text as Text187, Tooltip as Tooltip29 } from "@mantine/core";
|
|
30083
|
+
import { IconInfoCircle as IconInfoCircle8, IconUsersGroup as IconUsersGroup4 } from "@tabler/icons-react";
|
|
30084
30084
|
function emptyActAsGroupState() {
|
|
30085
30085
|
return { actAsGroup: false, groupCoreAddress: "", proposalTitle: "", proposalDescription: "" };
|
|
30086
30086
|
}
|
|
@@ -30097,6 +30097,21 @@ function actAsGroupRuntimeInputs(state) {
|
|
|
30097
30097
|
proposalDescription: state.proposalDescription.trim()
|
|
30098
30098
|
};
|
|
30099
30099
|
}
|
|
30100
|
+
var shortPodAddress = (address) => address.length > 20 ? `${address.slice(0, 10)}\u2026${address.slice(-6)}` : address;
|
|
30101
|
+
var podFilter = ({ options, search }) => {
|
|
30102
|
+
const query = search.toLowerCase().trim();
|
|
30103
|
+
if (!query) return options;
|
|
30104
|
+
return options.filter((option) => option.label.toLowerCase().includes(query) || option.value.toLowerCase().includes(query));
|
|
30105
|
+
};
|
|
30106
|
+
var buildPodOptions = (groups) => {
|
|
30107
|
+
const labelled = [...groups].map((group) => ({ group, label: group.domainName ? `${group.name} \u2014 ${group.domainName}` : group.name })).sort((a, b) => a.label.localeCompare(b.label));
|
|
30108
|
+
const labelCounts = /* @__PURE__ */ new Map();
|
|
30109
|
+
for (const { label } of labelled) labelCounts.set(label, (labelCounts.get(label) ?? 0) + 1);
|
|
30110
|
+
return labelled.map(({ group, label }) => ({
|
|
30111
|
+
value: group.coreAddress,
|
|
30112
|
+
label: (labelCounts.get(label) ?? 0) > 1 ? `${label} (${shortPodAddress(group.coreAddress)})` : label
|
|
30113
|
+
}));
|
|
30114
|
+
};
|
|
30100
30115
|
var ActAsGroupSection = ({ value, onChange, isDisabled, actionLabel }) => {
|
|
30101
30116
|
const handlers = useBlocknoteHandlers();
|
|
30102
30117
|
const handlersRef = useRef35(handlers);
|
|
@@ -30112,7 +30127,8 @@ var ActAsGroupSection = ({ value, onChange, isDisabled, actionLabel }) => {
|
|
|
30112
30127
|
try {
|
|
30113
30128
|
const res = await h.getDAOGroups();
|
|
30114
30129
|
if (!cancelled) setGroups(res || []);
|
|
30115
|
-
} catch {
|
|
30130
|
+
} catch (error) {
|
|
30131
|
+
console.warn("[act-as-group] getDAOGroups failed", error);
|
|
30116
30132
|
} finally {
|
|
30117
30133
|
if (!cancelled) setLoading(false);
|
|
30118
30134
|
}
|
|
@@ -30122,6 +30138,7 @@ var ActAsGroupSection = ({ value, onChange, isDisabled, actionLabel }) => {
|
|
|
30122
30138
|
cancelled = true;
|
|
30123
30139
|
};
|
|
30124
30140
|
}, []);
|
|
30141
|
+
const podOptions = useMemo108(() => buildPodOptions(groups), [groups]);
|
|
30125
30142
|
const available = groups.length > 0 && typeof handlers?.createGroupExecutionProposal === "function";
|
|
30126
30143
|
if (!available) return null;
|
|
30127
30144
|
const update = (patch) => onChange({ ...value, ...patch });
|
|
@@ -30133,7 +30150,7 @@ var ActAsGroupSection = ({ value, onChange, isDisabled, actionLabel }) => {
|
|
|
30133
30150
|
const asGroup = v === "group";
|
|
30134
30151
|
update({
|
|
30135
30152
|
actAsGroup: asGroup,
|
|
30136
|
-
// Auto-select the
|
|
30153
|
+
// Auto-select when the user belongs to exactly one POD.
|
|
30137
30154
|
groupCoreAddress: asGroup && !value.groupCoreAddress && groups.length === 1 ? groups[0].coreAddress : value.groupCoreAddress
|
|
30138
30155
|
});
|
|
30139
30156
|
},
|
|
@@ -30144,15 +30161,20 @@ var ActAsGroupSection = ({ value, onChange, isDisabled, actionLabel }) => {
|
|
|
30144
30161
|
disabled: isDisabled || loading,
|
|
30145
30162
|
size: "sm"
|
|
30146
30163
|
}
|
|
30147
|
-
)), value.actAsGroup && /* @__PURE__ */ React304.createElement(React304.Fragment, null,
|
|
30164
|
+
)), value.actAsGroup && /* @__PURE__ */ React304.createElement(React304.Fragment, null, /* @__PURE__ */ React304.createElement(
|
|
30148
30165
|
BaseSelect,
|
|
30149
30166
|
{
|
|
30150
|
-
label: "POD",
|
|
30151
|
-
description: "
|
|
30152
|
-
placeholder: loading ? "Loading PODs\u2026" : "
|
|
30167
|
+
label: /* @__PURE__ */ React304.createElement(Group106, { gap: 4, display: "inline-flex" }, "POD", value.groupCoreAddress && /* @__PURE__ */ React304.createElement(Tooltip29, { label: value.groupCoreAddress, withArrow: true, multiline: true, maw: 440, events: { hover: true, focus: true, touch: true } }, /* @__PURE__ */ React304.createElement(IconInfoCircle8, { size: 13, style: { opacity: 0.6, cursor: "help", verticalAlign: "middle" } }))),
|
|
30168
|
+
description: "One of your PODs \u2014 the action is performed on its behalf.",
|
|
30169
|
+
placeholder: loading ? "Loading your PODs\u2026" : "Search or select a POD",
|
|
30153
30170
|
value: value.groupCoreAddress || null,
|
|
30154
30171
|
onChange: (v) => update({ groupCoreAddress: v || "" }),
|
|
30155
|
-
data:
|
|
30172
|
+
data: podOptions,
|
|
30173
|
+
filter: podFilter,
|
|
30174
|
+
renderOption: ({ option }) => /* @__PURE__ */ React304.createElement(Stack199, { gap: 0 }, /* @__PURE__ */ React304.createElement(Text187, { size: "sm" }, option.label), /* @__PURE__ */ React304.createElement(Text187, { size: "xs", c: "dimmed" }, shortPodAddress(option.value))),
|
|
30175
|
+
nothingFoundMessage: "No POD matches your search",
|
|
30176
|
+
maxDropdownHeight: 280,
|
|
30177
|
+
allowDeselect: false,
|
|
30156
30178
|
disabled: isDisabled || loading,
|
|
30157
30179
|
rightSection: loading ? /* @__PURE__ */ React304.createElement(Loader51, { size: "xs" }) : void 0,
|
|
30158
30180
|
searchable: true,
|
|
@@ -30172,7 +30194,7 @@ var ActAsGroupSection = ({ value, onChange, isDisabled, actionLabel }) => {
|
|
|
30172
30194
|
|
|
30173
30195
|
// src/mantine/blocks/action/actionTypes/_shared/groupExecution/GroupProposalStatus.tsx
|
|
30174
30196
|
import React305, { useCallback as useCallback101, useEffect as useEffect103, useRef as useRef36, useState as useState155 } from "react";
|
|
30175
|
-
import { Alert as Alert63, Card as Card28, Group as
|
|
30197
|
+
import { Alert as Alert63, Card as Card28, Group as Group107, Loader as Loader52, Stack as Stack200, Text as Text188 } from "@mantine/core";
|
|
30176
30198
|
import { IconUsersGroup as IconUsersGroup5 } from "@tabler/icons-react";
|
|
30177
30199
|
var GROUP_PROPOSAL_READBACK_KIND = "group-proposal";
|
|
30178
30200
|
var POLL_INTERVAL_MS = 15e3;
|
|
@@ -30332,7 +30354,7 @@ var GroupProposalStatus = ({ editor, block, runtime, actorDid }) => {
|
|
|
30332
30354
|
return () => clearInterval(interval);
|
|
30333
30355
|
}, [active, reconcile]);
|
|
30334
30356
|
if (!active) return null;
|
|
30335
|
-
return /* @__PURE__ */ React305.createElement(Stack200, { gap: "sm" }, /* @__PURE__ */ React305.createElement(Card28, { padding: "md", radius: "md", withBorder: true, style: { borderColor: "var(--mantine-color-blue-6)" } }, /* @__PURE__ */ React305.createElement(
|
|
30357
|
+
return /* @__PURE__ */ React305.createElement(Stack200, { gap: "sm" }, /* @__PURE__ */ React305.createElement(Card28, { padding: "md", radius: "md", withBorder: true, style: { borderColor: "var(--mantine-color-blue-6)" } }, /* @__PURE__ */ React305.createElement(Group107, { gap: "xs", align: "center" }, /* @__PURE__ */ React305.createElement(IconUsersGroup5, { size: 16, color: "var(--mantine-color-blue-6)" }), /* @__PURE__ */ React305.createElement(Text188, { size: "sm", fw: 600 }, "Waiting for the POD to vote"), reconciling && /* @__PURE__ */ React305.createElement(Loader52, { size: "xs" })), /* @__PURE__ */ React305.createElement(Text188, { size: "sm", c: "dimmed", mt: 4 }, "Proposal #", proposalId, " was created on the POD's behalf. This step completes automatically once the proposal passes and executes \u2014 no further signature from you is needed", readBack.finalize === "bid.submit" ? ", except the bid itself which is sent once the POD approves" : "", "."), Number(readBack.collectionRefreshAttempts || 0) > 0 && /* @__PURE__ */ React305.createElement(Text188, { size: "xs", c: "dimmed", mt: 4 }, "The proposal has executed, but the collection's live state could not be refreshed yet \u2014 retrying.")), proposalContractAddress && proposalId && /* @__PURE__ */ React305.createElement(ProposalOverviewCard, { proposalContractAddress, proposalId }), lastError && /* @__PURE__ */ React305.createElement(Alert63, { color: "orange", styles: actionAlertStyles }, /* @__PURE__ */ React305.createElement(Text188, { size: "xs" }, "Status check failed (will retry): ", lastError)));
|
|
30336
30358
|
};
|
|
30337
30359
|
|
|
30338
30360
|
// src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
|
|
@@ -30354,16 +30376,16 @@ var BidFlowDetail = ({
|
|
|
30354
30376
|
useEffect104(() => {
|
|
30355
30377
|
handlersRef.current = handlers;
|
|
30356
30378
|
}, [handlers]);
|
|
30357
|
-
const actorDid =
|
|
30379
|
+
const actorDid = useMemo109(() => {
|
|
30358
30380
|
try {
|
|
30359
30381
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
30360
30382
|
} catch {
|
|
30361
30383
|
return "";
|
|
30362
30384
|
}
|
|
30363
30385
|
}, [handlers]);
|
|
30364
|
-
const parsed =
|
|
30386
|
+
const parsed = useMemo109(() => parseBidActionInputs(inputs), [inputs]);
|
|
30365
30387
|
const editorDocument = editor?.document || [];
|
|
30366
|
-
const resolveOpts =
|
|
30388
|
+
const resolveOpts = useMemo109(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
30367
30389
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
30368
30390
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
30369
30391
|
const [role, setRole] = useState156("service_agent");
|
|
@@ -30375,7 +30397,7 @@ var BidFlowDetail = ({
|
|
|
30375
30397
|
const [userBid, setUserBid] = useState156(null);
|
|
30376
30398
|
const [userRole, setUserRole] = useState156(null);
|
|
30377
30399
|
const [surveyReady, setSurveyReady] = useState156(false);
|
|
30378
|
-
const surveyModel =
|
|
30400
|
+
const surveyModel = useMemo109(() => {
|
|
30379
30401
|
if (!surveyJson) return null;
|
|
30380
30402
|
const model = new SurveyModel9(surveyJson);
|
|
30381
30403
|
model.applyTheme(surveyTheme);
|
|
@@ -30641,7 +30663,7 @@ registerActionTypeUI("qi/bid.submit", {
|
|
|
30641
30663
|
import { IconScale as IconScale3 } from "@tabler/icons-react";
|
|
30642
30664
|
|
|
30643
30665
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidConfig.tsx
|
|
30644
|
-
import React307, { useCallback as useCallback103, useEffect as useEffect105, useMemo as
|
|
30666
|
+
import React307, { useCallback as useCallback103, useEffect as useEffect105, useMemo as useMemo110, useState as useState157 } from "react";
|
|
30645
30667
|
import { Alert as Alert65, Button as Button61, Loader as Loader54, Stack as Stack202 } from "@mantine/core";
|
|
30646
30668
|
|
|
30647
30669
|
// src/mantine/blocks/action/actionTypes/evaluateBid/types.ts
|
|
@@ -30719,7 +30741,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
30719
30741
|
void fetchCollections();
|
|
30720
30742
|
}
|
|
30721
30743
|
}, [local.deedDid, local.collectionId]);
|
|
30722
|
-
const collectionOptions =
|
|
30744
|
+
const collectionOptions = useMemo110(
|
|
30723
30745
|
() => collections.map((collection) => ({
|
|
30724
30746
|
value: collection.id,
|
|
30725
30747
|
label: formatCollectionOptionLabel(collection)
|
|
@@ -30768,13 +30790,13 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
30768
30790
|
};
|
|
30769
30791
|
|
|
30770
30792
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidFlowDetail.tsx
|
|
30771
|
-
import React309, { useCallback as useCallback104, useEffect as useEffect106, useMemo as
|
|
30772
|
-
import { ActionIcon as ActionIcon43, Alert as Alert66, Badge as Badge49, Box as Box56, Button as Button62, Divider as Divider21, Group as
|
|
30793
|
+
import React309, { useCallback as useCallback104, useEffect as useEffect106, useMemo as useMemo111, useRef as useRef38, useState as useState159 } from "react";
|
|
30794
|
+
import { ActionIcon as ActionIcon43, Alert as Alert66, Badge as Badge49, Box as Box56, Button as Button62, Divider as Divider21, Group as Group109, JsonInput, Loader as Loader55, Stack as Stack203, Text as Text191, UnstyledButton as UnstyledButton3 } from "@mantine/core";
|
|
30773
30795
|
import { IconArrowLeft as IconArrowLeft8, IconCheck as IconCheck21, IconFilter } from "@tabler/icons-react";
|
|
30774
30796
|
|
|
30775
30797
|
// src/mantine/components/CollapsibleSection.tsx
|
|
30776
30798
|
import React308, { useState as useState158 } from "react";
|
|
30777
|
-
import { Box as Box55, Collapse as Collapse9, Group as
|
|
30799
|
+
import { Box as Box55, Collapse as Collapse9, Group as Group108, Text as Text190, UnstyledButton as UnstyledButton2 } from "@mantine/core";
|
|
30778
30800
|
import { IconChevronDown as IconChevronDown9, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
30779
30801
|
function CollapsibleSection({ title, defaultOpen = false, badge, children }) {
|
|
30780
30802
|
const [opened, setOpened] = useState158(defaultOpen);
|
|
@@ -30787,7 +30809,7 @@ function CollapsibleSection({ title, defaultOpen = false, badge, children }) {
|
|
|
30787
30809
|
background: "var(--mantine-color-neutralColor-4)"
|
|
30788
30810
|
}
|
|
30789
30811
|
},
|
|
30790
|
-
/* @__PURE__ */ React308.createElement(UnstyledButton2, { onClick: () => setOpened((v) => !v), style: { width: "100%" } }, /* @__PURE__ */ React308.createElement(
|
|
30812
|
+
/* @__PURE__ */ React308.createElement(UnstyledButton2, { onClick: () => setOpened((v) => !v), style: { width: "100%" } }, /* @__PURE__ */ React308.createElement(Group108, { gap: "xs", align: "center" }, opened ? icon(IconChevronDown9, 16) : icon(IconChevronRight11, 16), /* @__PURE__ */ React308.createElement(Text190, { fw: 500, size: "sm" }, title), badge)),
|
|
30791
30813
|
/* @__PURE__ */ React308.createElement(Collapse9, { in: opened }, /* @__PURE__ */ React308.createElement(Box55, { mt: "sm" }, children))
|
|
30792
30814
|
);
|
|
30793
30815
|
}
|
|
@@ -30866,9 +30888,9 @@ var EvaluateBidFlowDetail = ({
|
|
|
30866
30888
|
useEffect106(() => {
|
|
30867
30889
|
handlersRef.current = handlers;
|
|
30868
30890
|
}, [handlers]);
|
|
30869
|
-
const parsed =
|
|
30891
|
+
const parsed = useMemo111(() => parseEvaluateBidActionInputs(inputs), [inputs]);
|
|
30870
30892
|
const editorDocument = editor?.document || [];
|
|
30871
|
-
const resolveOpts =
|
|
30893
|
+
const resolveOpts = useMemo111(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
30872
30894
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
30873
30895
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
30874
30896
|
const [bids, setBids] = useState159([]);
|
|
@@ -30882,8 +30904,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
30882
30904
|
const [activeFilter, setActiveFilter] = useState159("pending");
|
|
30883
30905
|
const [paymentRows, setPaymentRows] = useState159([createPaymentRow()]);
|
|
30884
30906
|
const [profilesByDid, setProfilesByDid] = useState159({});
|
|
30885
|
-
const selectedBid =
|
|
30886
|
-
const filteredBids =
|
|
30907
|
+
const selectedBid = useMemo111(() => bids.find((bid) => bid.id === selectedBidId) || null, [bids, selectedBidId]);
|
|
30908
|
+
const filteredBids = useMemo111(() => {
|
|
30887
30909
|
if (activeFilter === "all") return bids;
|
|
30888
30910
|
return bids.filter((bid) => getBidStatus(bid, t).key === activeFilter);
|
|
30889
30911
|
}, [bids, activeFilter]);
|
|
@@ -31063,7 +31085,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
31063
31085
|
bidData = typeof selectedBid.data === "string" ? JSON.parse(selectedBid.data) : selectedBid.data;
|
|
31064
31086
|
} catch {
|
|
31065
31087
|
}
|
|
31066
|
-
return /* @__PURE__ */ React309.createElement(Stack203, { gap: "md" }, /* @__PURE__ */ React309.createElement(
|
|
31088
|
+
return /* @__PURE__ */ React309.createElement(Stack203, { gap: "md" }, /* @__PURE__ */ React309.createElement(Group109, { gap: "xs", align: "center" }, /* @__PURE__ */ React309.createElement(ActionIcon43, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedBidId("") }, /* @__PURE__ */ React309.createElement(IconArrowLeft8, { size: 16 })), /* @__PURE__ */ React309.createElement(Text191, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, t("actionTypes.evaluateBid.flow.bidNumber", { id: selectedBid.id, defaultValue: `Bid #${selectedBid.id}` }))), /* @__PURE__ */ React309.createElement(Group109, { gap: 16, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React309.createElement(
|
|
31067
31089
|
Box56,
|
|
31068
31090
|
{
|
|
31069
31091
|
style: {
|
|
@@ -31084,7 +31106,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
31084
31106
|
}
|
|
31085
31107
|
},
|
|
31086
31108
|
selectedBidProfile?.avatarUrl ? null : selectedAvatarLabel
|
|
31087
|
-
), /* @__PURE__ */ React309.createElement(Stack203, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React309.createElement(Text191, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed", truncate: true }, truncateAddress2(selectedBid.address))), /* @__PURE__ */ React309.createElement(Stack203, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React309.createElement(Text191, { fw: 500, size: "md", c: bidStatus.color === "green" ? "green" : bidStatus.color === "red" ? "red" : void 0 }, bidStatus.color === "green" && /* @__PURE__ */ React309.createElement(IconCheck21, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), bidStatus.label), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, getTimeAgo(selectedBid.created || "")))), /* @__PURE__ */ React309.createElement(CollapsibleSection, { title: t("actionTypes.evaluateBid.flow.section.details", { defaultValue: "Details" }) }, /* @__PURE__ */ React309.createElement(Stack203, { gap: "xs" }, /* @__PURE__ */ React309.createElement(
|
|
31109
|
+
), /* @__PURE__ */ React309.createElement(Stack203, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React309.createElement(Text191, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed", truncate: true }, truncateAddress2(selectedBid.address))), /* @__PURE__ */ React309.createElement(Stack203, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React309.createElement(Text191, { fw: 500, size: "md", c: bidStatus.color === "green" ? "green" : bidStatus.color === "red" ? "red" : void 0 }, bidStatus.color === "green" && /* @__PURE__ */ React309.createElement(IconCheck21, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), bidStatus.label), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, getTimeAgo(selectedBid.created || "")))), /* @__PURE__ */ React309.createElement(CollapsibleSection, { title: t("actionTypes.evaluateBid.flow.section.details", { defaultValue: "Details" }) }, /* @__PURE__ */ React309.createElement(Stack203, { gap: "xs" }, /* @__PURE__ */ React309.createElement(Group109, { justify: "space-between" }, /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, "Bid ID"), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", truncate: true }, selectedBid.id)), /* @__PURE__ */ React309.createElement(Group109, { justify: "space-between" }, /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, "Collection"), /* @__PURE__ */ React309.createElement(Text191, { size: "xs" }, selectedBid.collection || collectionId)), /* @__PURE__ */ React309.createElement(Group109, { justify: "space-between" }, /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.details.role", { defaultValue: "Role" })), /* @__PURE__ */ React309.createElement(Badge49, { size: "xs", variant: "light", color: getRoleColor2(selectedBid.role) }, getRoleLabel2(selectedBid.role, t))), /* @__PURE__ */ React309.createElement(Group109, { justify: "space-between" }, /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.details.address", { defaultValue: "Address" })), /* @__PURE__ */ React309.createElement(Text191, { size: "xs" }, selectedBid.address)))), /* @__PURE__ */ React309.createElement(CollapsibleSection, { title: t("actionTypes.evaluateBid.flow.section.inputs", { defaultValue: "Inputs" }) }, bidData && typeof bidData === "object" ? /* @__PURE__ */ React309.createElement(
|
|
31088
31110
|
JsonInput,
|
|
31089
31111
|
{
|
|
31090
31112
|
value: JSON.stringify(bidData, null, 2),
|
|
@@ -31126,7 +31148,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
31126
31148
|
minRows: 2,
|
|
31127
31149
|
disabled: isDisabled || submitting
|
|
31128
31150
|
}
|
|
31129
|
-
)), decision === "approve" && bidIsEvaluator && /* @__PURE__ */ React309.createElement(React309.Fragment, null, /* @__PURE__ */ React309.createElement(Divider21, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.paymentLabel", { defaultValue: "Payment (used as evaluator max amount)" })), paymentRows.map((row, index) => /* @__PURE__ */ React309.createElement(Stack203, { key: row.id, gap: 8 }, /* @__PURE__ */ React309.createElement(
|
|
31151
|
+
)), decision === "approve" && bidIsEvaluator && /* @__PURE__ */ React309.createElement(React309.Fragment, null, /* @__PURE__ */ React309.createElement(Divider21, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.paymentLabel", { defaultValue: "Payment (used as evaluator max amount)" })), paymentRows.map((row, index) => /* @__PURE__ */ React309.createElement(Stack203, { key: row.id, gap: 8 }, /* @__PURE__ */ React309.createElement(Group109, { justify: "space-between", align: "center" }, /* @__PURE__ */ React309.createElement(Text191, { size: "sm" }, t("actionTypes.evaluateClaim.flow.payment.token", { index: index + 1, defaultValue: `Token ${index + 1}` })), /* @__PURE__ */ React309.createElement(Group109, { gap: "xs" }, paymentRows.length > 1 && /* @__PURE__ */ React309.createElement(Button62, { variant: "subtle", size: "compact-xs", color: "red", onClick: () => removePaymentRow(row.id), disabled: isDisabled || submitting }, t("actionTypes.evaluateClaim.flow.payment.remove", { defaultValue: "Remove" })))), /* @__PURE__ */ React309.createElement(
|
|
31130
31152
|
BaseSelect,
|
|
31131
31153
|
{
|
|
31132
31154
|
value: row.denom,
|
|
@@ -31163,7 +31185,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
31163
31185
|
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
31164
31186
|
did: "DID",
|
|
31165
31187
|
claimCollection: "claim collection"
|
|
31166
|
-
})) : /* @__PURE__ */ React309.createElement(React309.Fragment, null, /* @__PURE__ */ React309.createElement(
|
|
31188
|
+
})) : /* @__PURE__ */ React309.createElement(React309.Fragment, null, /* @__PURE__ */ React309.createElement(Group109, { justify: "space-between", align: "center" }, /* @__PURE__ */ React309.createElement(Group109, { gap: 0 }, filterTabs.map((tab) => /* @__PURE__ */ React309.createElement(
|
|
31167
31189
|
UnstyledButton3,
|
|
31168
31190
|
{
|
|
31169
31191
|
key: tab.value,
|
|
@@ -31177,12 +31199,12 @@ var EvaluateBidFlowDetail = ({
|
|
|
31177
31199
|
}
|
|
31178
31200
|
},
|
|
31179
31201
|
/* @__PURE__ */ React309.createElement(Text191, { size: "sm", fw: 500, c: activeFilter === tab.value ? "var(--mantine-color-text)" : "dimmed" }, tab.label)
|
|
31180
|
-
))), /* @__PURE__ */ React309.createElement(ActionIcon43, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React309.createElement(IconFilter, { size: 16 }))), loadingBids && /* @__PURE__ */ React309.createElement(
|
|
31202
|
+
))), /* @__PURE__ */ React309.createElement(ActionIcon43, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React309.createElement(IconFilter, { size: 16 }))), loadingBids && /* @__PURE__ */ React309.createElement(Group109, { gap: "xs", justify: "center", py: "md" }, /* @__PURE__ */ React309.createElement(Loader55, { size: "xs" }), /* @__PURE__ */ React309.createElement(Text191, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.loadingBids", { defaultValue: "Loading bids..." }))), !loadingBids && filteredBids.length === 0 && /* @__PURE__ */ React309.createElement(Text191, { size: "sm", c: "dimmed", ta: "center", py: "md" }, bids.length === 0 ? t("actionTypes.evaluateBid.flow.empty.allCollections", { defaultValue: "No bids available for this collection." }) : t("actionTypes.evaluateBid.flow.empty.filtered", { filter: activeFilter, defaultValue: `No ${activeFilter} bids found.` })), filteredBids.length > 0 && /* @__PURE__ */ React309.createElement(Stack203, { gap: 12 }, filteredBids.map((bid) => {
|
|
31181
31203
|
const status = getBidStatus(bid, t);
|
|
31182
31204
|
const profile = profilesByDid[bid.did];
|
|
31183
31205
|
const displayName = profile?.displayname || bid.did || bid.address;
|
|
31184
31206
|
const avatarLabel = (profile?.displayname || bid.did || bid.address || "?")[0]?.toUpperCase();
|
|
31185
|
-
return /* @__PURE__ */ React309.createElement(ListItemContainer, { key: bid.id, isChecked: false, onClick: () => setSelectedBidId(bid.id) }, /* @__PURE__ */ React309.createElement(
|
|
31207
|
+
return /* @__PURE__ */ React309.createElement(ListItemContainer, { key: bid.id, isChecked: false, onClick: () => setSelectedBidId(bid.id) }, /* @__PURE__ */ React309.createElement(Group109, { gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React309.createElement(
|
|
31186
31208
|
Box56,
|
|
31187
31209
|
{
|
|
31188
31210
|
style: {
|
|
@@ -31221,7 +31243,7 @@ registerActionTypeUI("qi/bid.evaluate", {
|
|
|
31221
31243
|
import { IconFileText as IconFileText5 } from "@tabler/icons-react";
|
|
31222
31244
|
|
|
31223
31245
|
// src/mantine/blocks/action/actionTypes/claim/ClaimConfig.tsx
|
|
31224
|
-
import React310, { useCallback as useCallback105, useEffect as useEffect107, useMemo as
|
|
31246
|
+
import React310, { useCallback as useCallback105, useEffect as useEffect107, useMemo as useMemo112, useRef as useRef39, useState as useState160 } from "react";
|
|
31225
31247
|
import { Alert as Alert67, Button as Button63, Loader as Loader56, Stack as Stack204, Text as Text192 } from "@mantine/core";
|
|
31226
31248
|
|
|
31227
31249
|
// src/mantine/blocks/action/actionTypes/claim/types.ts
|
|
@@ -31342,7 +31364,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
31342
31364
|
void fetchCollections();
|
|
31343
31365
|
}
|
|
31344
31366
|
}, [local.deedDid, local.collectionId]);
|
|
31345
|
-
const collectionOptions =
|
|
31367
|
+
const collectionOptions = useMemo112(
|
|
31346
31368
|
() => collections.map((collection) => ({
|
|
31347
31369
|
value: collection.id,
|
|
31348
31370
|
label: formatCollectionOptionLabel(collection)
|
|
@@ -31397,8 +31419,8 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
31397
31419
|
};
|
|
31398
31420
|
|
|
31399
31421
|
// src/mantine/blocks/action/actionTypes/claim/ClaimFlowDetail.tsx
|
|
31400
|
-
import React311, { useCallback as useCallback106, useEffect as useEffect108, useMemo as
|
|
31401
|
-
import { ActionIcon as ActionIcon44, Alert as Alert68, Box as Box57, Group as
|
|
31422
|
+
import React311, { useCallback as useCallback106, useEffect as useEffect108, useMemo as useMemo113, useRef as useRef40, useState as useState161 } from "react";
|
|
31423
|
+
import { ActionIcon as ActionIcon44, Alert as Alert68, Box as Box57, Group as Group110, Loader as Loader57, Stack as Stack205, Text as Text193 } from "@mantine/core";
|
|
31402
31424
|
import { IconArrowLeft as IconArrowLeft9, IconCheck as IconCheck22, IconPlayerPlay as IconPlayerPlay6 } from "@tabler/icons-react";
|
|
31403
31425
|
import { SurveyModel as SurveyModel10 } from "@ixo/surveys";
|
|
31404
31426
|
|
|
@@ -31536,16 +31558,16 @@ var ClaimFlowDetail = ({
|
|
|
31536
31558
|
useEffect108(() => {
|
|
31537
31559
|
handlersRef.current = handlers;
|
|
31538
31560
|
}, [handlers]);
|
|
31539
|
-
const actorDid =
|
|
31561
|
+
const actorDid = useMemo113(() => {
|
|
31540
31562
|
try {
|
|
31541
31563
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
31542
31564
|
} catch {
|
|
31543
31565
|
return "";
|
|
31544
31566
|
}
|
|
31545
31567
|
}, [handlers]);
|
|
31546
|
-
const parsed =
|
|
31568
|
+
const parsed = useMemo113(() => parseClaimActionInputs(inputs), [inputs]);
|
|
31547
31569
|
const editorDocument = editor?.document || [];
|
|
31548
|
-
const resolveOpts =
|
|
31570
|
+
const resolveOpts = useMemo113(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
31549
31571
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
31550
31572
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
31551
31573
|
const [claims, setClaims] = useState161([]);
|
|
@@ -31567,15 +31589,15 @@ var ClaimFlowDetail = ({
|
|
|
31567
31589
|
const [loadingClaimDetail, setLoadingClaimDetail] = useState161(false);
|
|
31568
31590
|
const [disputeDetails, setDisputeDetails] = useState161(null);
|
|
31569
31591
|
const [loadingDispute, setLoadingDispute] = useState161(false);
|
|
31570
|
-
const selectedClaim =
|
|
31571
|
-
const selectedClaimStatus =
|
|
31592
|
+
const selectedClaim = useMemo113(() => claims.find((c) => c.claimId === selectedClaimId) || null, [claims, selectedClaimId]);
|
|
31593
|
+
const selectedClaimStatus = useMemo113(() => selectedClaim ? getClaimStatusInfo(selectedClaim) : null, [selectedClaim]);
|
|
31572
31594
|
const isSelectedDisputed = selectedClaimStatus?.key === "disputed";
|
|
31573
31595
|
const checkSurveyCompleteness = useCallback106((model) => {
|
|
31574
31596
|
const allRequired = model.getAllQuestions(true).filter((q) => q.isRequired);
|
|
31575
31597
|
const isComplete = allRequired.length === 0 || allRequired.every((q) => !q.isEmpty());
|
|
31576
31598
|
setSurveyComplete(isComplete);
|
|
31577
31599
|
}, []);
|
|
31578
|
-
const surveyModel =
|
|
31600
|
+
const surveyModel = useMemo113(() => {
|
|
31579
31601
|
if (!surveyJson) return null;
|
|
31580
31602
|
const model = new SurveyModel10(surveyJson);
|
|
31581
31603
|
model.applyTheme(surveyTheme);
|
|
@@ -31620,7 +31642,7 @@ var ClaimFlowDetail = ({
|
|
|
31620
31642
|
mediaBlobCacheRef.current.clear();
|
|
31621
31643
|
};
|
|
31622
31644
|
}, []);
|
|
31623
|
-
const detailSurveyModel =
|
|
31645
|
+
const detailSurveyModel = useMemo113(() => {
|
|
31624
31646
|
if (!surveyJson || !selectedClaimData) return null;
|
|
31625
31647
|
const model = new SurveyModel10(surveyJson);
|
|
31626
31648
|
model.applyTheme(surveyTheme);
|
|
@@ -31991,10 +32013,10 @@ var ClaimFlowDetail = ({
|
|
|
31991
32013
|
});
|
|
31992
32014
|
}, [surveyModel, handlers, editor, deedDid, collectionId, block.id, block?.props?.title]);
|
|
31993
32015
|
if (selectedClaim) {
|
|
31994
|
-
return /* @__PURE__ */ React311.createElement(Stack205, { gap: "md" }, /* @__PURE__ */ React311.createElement(
|
|
32016
|
+
return /* @__PURE__ */ React311.createElement(Stack205, { gap: "md" }, /* @__PURE__ */ React311.createElement(Group110, { gap: "xs", align: "center" }, /* @__PURE__ */ React311.createElement(ActionIcon44, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedClaimId("") }, /* @__PURE__ */ React311.createElement(IconArrowLeft9, { size: 16 })), /* @__PURE__ */ React311.createElement(Text193, { fw: 500, size: "sm", title: selectedClaim.claimId }, t("actionTypes.claim.flow.claimNumber", { id: truncateId(selectedClaim.claimId), defaultValue: `Claim #${truncateId(selectedClaim.claimId)}` }))), selectedClaimStatus && /* @__PURE__ */ React311.createElement(Group110, { gap: "xs", align: "center" }, /* @__PURE__ */ React311.createElement(Text193, { size: "sm", c: "dimmed" }, t("actionTypes.claim.flow.statusLabel", { defaultValue: "Status:" })), /* @__PURE__ */ React311.createElement(Text193, { fw: 500, size: "sm", c: selectedClaimStatus.color }, selectedClaimStatus.label), /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, "\xB7 ", getTimeAgo2(selectedClaim.submissionDate || ""))), isSelectedDisputed && /* @__PURE__ */ React311.createElement(Alert68, { color: "orange", title: t("actionTypes.claim.flow.disputed.title", { defaultValue: "Claim disputed" }), styles: actionAlertStyles }, loadingDispute ? /* @__PURE__ */ React311.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React311.createElement(Loader57, { size: "xs" }), /* @__PURE__ */ React311.createElement(Text193, { size: "xs" }, t("actionTypes.claim.flow.disputed.loadingDetails", { defaultValue: "Loading dispute details\u2026" }))) : disputeDetails ? /* @__PURE__ */ React311.createElement(Stack205, { gap: 6 }, disputeDetails.reason ? /* @__PURE__ */ React311.createElement(Text193, { size: "sm" }, disputeDetails.reason) : /* @__PURE__ */ React311.createElement(Text193, { size: "sm", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noMessage", { defaultValue: "The evaluator disputed this claim but did not provide a message." })), (disputeDetails.evaluatorDid || disputeDetails.disputedAt) && /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, disputeDetails.evaluatorDid ? t("actionTypes.claim.flow.disputed.byEvaluator", {
|
|
31995
32017
|
address: truncateAddress3(disputeDetails.evaluatorDid),
|
|
31996
32018
|
defaultValue: `By ${truncateAddress3(disputeDetails.evaluatorDid)}`
|
|
31997
|
-
}) : "", disputeDetails.evaluatorDid && disputeDetails.disputedAt ? " \xB7 " : "", disputeDetails.disputedAt ? new Date(disputeDetails.disputedAt).toLocaleString() : ""), /* @__PURE__ */ React311.createElement(BasePrimaryButton, { onClick: amendAndResubmit, disabled: isDisabled || submitting || !isServiceAgentAuthorized || !selectedClaimData }, t("actionTypes.claim.flow.disputed.amendAndResubmit", { defaultValue: "Amend & Resubmit" }))) : typeof handlers.getClaimDisputeDetails !== "function" ? /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.unavailable", { defaultValue: "Dispute details unavailable in this environment." })) : /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noRecord", { defaultValue: "No dispute record found on-chain for this claim." }))), loadingClaimDetail ? /* @__PURE__ */ React311.createElement(
|
|
32019
|
+
}) : "", disputeDetails.evaluatorDid && disputeDetails.disputedAt ? " \xB7 " : "", disputeDetails.disputedAt ? new Date(disputeDetails.disputedAt).toLocaleString() : ""), /* @__PURE__ */ React311.createElement(BasePrimaryButton, { onClick: amendAndResubmit, disabled: isDisabled || submitting || !isServiceAgentAuthorized || !selectedClaimData }, t("actionTypes.claim.flow.disputed.amendAndResubmit", { defaultValue: "Amend & Resubmit" }))) : typeof handlers.getClaimDisputeDetails !== "function" ? /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.unavailable", { defaultValue: "Dispute details unavailable in this environment." })) : /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noRecord", { defaultValue: "No dispute record found on-chain for this claim." }))), loadingClaimDetail ? /* @__PURE__ */ React311.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React311.createElement(Loader57, { size: "xs" }), /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.loadingSubmission", { defaultValue: "Loading submission\u2026" }))) : detailSurveyModel ? /* @__PURE__ */ React311.createElement(StableSurvey, { model: detailSurveyModel }) : /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.noSubmissionData", { defaultValue: "No submission data available." })), error && /* @__PURE__ */ React311.createElement(Alert68, { color: "red", styles: actionAlertStyles }, error));
|
|
31998
32020
|
}
|
|
31999
32021
|
return /* @__PURE__ */ React311.createElement(Stack205, { gap: "md" }, /* @__PURE__ */ React311.createElement(GroupProposalStatus, { editor, block, runtime }), runtime?.state !== "awaiting_readback" && /* @__PURE__ */ React311.createElement(ActAsGroupSection, { value: actAs, onChange: setActAs, isDisabled, actionLabel: "submit this claim" }), !deedDid || !collectionId ? /* @__PURE__ */ React311.createElement(Alert68, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
32000
32022
|
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
@@ -32013,7 +32035,7 @@ var ClaimFlowDetail = ({
|
|
|
32013
32035
|
const profile = profilesByDid[claim.agentDid];
|
|
32014
32036
|
const displayName = profile?.displayname || claim.agentDid || claim.agentAddress;
|
|
32015
32037
|
const avatarLabel = (profile?.displayname || claim.agentDid || claim.agentAddress || "?")[0]?.toUpperCase();
|
|
32016
|
-
return /* @__PURE__ */ React311.createElement(ListItemContainer, { key: claim.claimId, isChecked: false, onClick: () => setSelectedClaimId(claim.claimId) }, /* @__PURE__ */ React311.createElement(
|
|
32038
|
+
return /* @__PURE__ */ React311.createElement(ListItemContainer, { key: claim.claimId, isChecked: false, onClick: () => setSelectedClaimId(claim.claimId) }, /* @__PURE__ */ React311.createElement(Group110, { gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React311.createElement(
|
|
32017
32039
|
Box57,
|
|
32018
32040
|
{
|
|
32019
32041
|
style: {
|
|
@@ -32035,7 +32057,7 @@ var ClaimFlowDetail = ({
|
|
|
32035
32057
|
},
|
|
32036
32058
|
profile?.avatarUrl ? null : avatarLabel
|
|
32037
32059
|
), /* @__PURE__ */ React311.createElement(Stack205, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React311.createElement(Text193, { fw: 500, size: "md", truncate: true, style: { lineHeight: 1.5 } }, displayName), /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed", truncate: true }, truncateAddress3(claim.agentAddress)))), /* @__PURE__ */ React311.createElement(Stack205, { gap: 0, align: "flex-end", style: { flexShrink: 0, minWidth: 80 } }, /* @__PURE__ */ React311.createElement(Text193, { fw: 500, size: "md", c: status.color, style: { lineHeight: 1.5 } }, status.key === "approved" && /* @__PURE__ */ React311.createElement(IconCheck22, { size: 14, style: { verticalAlign: "middle", marginRight: 2 } }), status.label), /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, getTimeAgo2(claim.submissionDate || ""))));
|
|
32038
|
-
}))), surveyModel && !loadingSurvey && /* @__PURE__ */ React311.createElement(React311.Fragment, null, /* @__PURE__ */ React311.createElement(SurveyAiFillButton, { surveyId: openSurveyId, title: openSurveyTitle }), /* @__PURE__ */ React311.createElement(StableSurvey, { model: surveyModel })), submitting && /* @__PURE__ */ React311.createElement(
|
|
32060
|
+
}))), surveyModel && !loadingSurvey && /* @__PURE__ */ React311.createElement(React311.Fragment, null, /* @__PURE__ */ React311.createElement(SurveyAiFillButton, { surveyId: openSurveyId, title: openSurveyTitle }), /* @__PURE__ */ React311.createElement(StableSurvey, { model: surveyModel })), submitting && /* @__PURE__ */ React311.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React311.createElement(Loader57, { size: "xs" }), /* @__PURE__ */ React311.createElement(Text193, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.submittingClaim", { defaultValue: "Submitting claim..." }))), error && /* @__PURE__ */ React311.createElement(Alert68, { color: "red", styles: actionAlertStyles }, error));
|
|
32039
32061
|
};
|
|
32040
32062
|
|
|
32041
32063
|
// src/mantine/blocks/action/actionTypes/claim/index.ts
|
|
@@ -32052,9 +32074,9 @@ registerActionTypeUI("qi/claim.submit", {
|
|
|
32052
32074
|
import { IconFolders as IconFolders2 } from "@tabler/icons-react";
|
|
32053
32075
|
|
|
32054
32076
|
// src/mantine/blocks/action/actionTypes/collection/CollectionLifecycleConfig.tsx
|
|
32055
|
-
import React312, { useCallback as useCallback107, useEffect as useEffect109, useMemo as
|
|
32056
|
-
import { Alert as Alert69, Badge as Badge50, Button as Button64, Group as
|
|
32057
|
-
import { IconInfoCircle as
|
|
32077
|
+
import React312, { useCallback as useCallback107, useEffect as useEffect109, useMemo as useMemo114, useState as useState162 } from "react";
|
|
32078
|
+
import { Alert as Alert69, Badge as Badge50, Button as Button64, Group as Group111, Loader as Loader58, Stack as Stack206, Text as Text194 } from "@mantine/core";
|
|
32079
|
+
import { IconInfoCircle as IconInfoCircle9 } from "@tabler/icons-react";
|
|
32058
32080
|
var DEFAULT7 = {
|
|
32059
32081
|
entity: "",
|
|
32060
32082
|
protocol: "",
|
|
@@ -32125,7 +32147,7 @@ var CollectionLifecycleConfig = ({ inputs, onInputsChange }) => {
|
|
|
32125
32147
|
setLoadingProtocols(false);
|
|
32126
32148
|
}
|
|
32127
32149
|
}, [handlers, local.entity, local.protocol, update]);
|
|
32128
|
-
const protocolOptions =
|
|
32150
|
+
const protocolOptions = useMemo114(
|
|
32129
32151
|
() => protocols.map((p) => ({
|
|
32130
32152
|
value: p.protocolId,
|
|
32131
32153
|
label: p.hasValidClaim ? `${p.title}${p.isHeadlineMetric ? " \xB7 Headline" : ""}` : `${p.title || p.protocolId} (no claim data)`,
|
|
@@ -32134,7 +32156,7 @@ var CollectionLifecycleConfig = ({ inputs, onInputsChange }) => {
|
|
|
32134
32156
|
[protocols]
|
|
32135
32157
|
);
|
|
32136
32158
|
const isManageMode = local.collectionId.trim().length > 0;
|
|
32137
|
-
return /* @__PURE__ */ React312.createElement(Stack206, { gap: "md" }, /* @__PURE__ */ React312.createElement(
|
|
32159
|
+
return /* @__PURE__ */ React312.createElement(Stack206, { gap: "md" }, /* @__PURE__ */ React312.createElement(Group111, { justify: "space-between", align: "center" }, /* @__PURE__ */ React312.createElement(Text194, { size: "sm", fw: 600 }, "Collection Context"), /* @__PURE__ */ React312.createElement(Badge50, { color: isManageMode ? "accent" : "neutralColor", variant: "light", size: "sm" }, isManageMode ? "Manage existing" : "Create new")), /* @__PURE__ */ React312.createElement(Stack206, { gap: "xs" }, /* @__PURE__ */ React312.createElement(Text194, { size: "sm", fw: 600 }, "Entity DID"), /* @__PURE__ */ React312.createElement(Text194, { size: "xs", c: "dimmed" }, "The entity DID that owns the collection. Its linked claim protocols are fetched below."), /* @__PURE__ */ React312.createElement(
|
|
32138
32160
|
BaseTextInput,
|
|
32139
32161
|
{
|
|
32140
32162
|
placeholder: "did:ixo:entity:...",
|
|
@@ -32171,12 +32193,12 @@ var CollectionLifecycleConfig = ({ inputs, onInputsChange }) => {
|
|
|
32171
32193
|
required: true,
|
|
32172
32194
|
searchable: true
|
|
32173
32195
|
}
|
|
32174
|
-
), local.protocol && protocolOptions.length === 0 && /* @__PURE__ */ React312.createElement(Text194, { size: "xs", c: "dimmed" }, "Currently selected: ", /* @__PURE__ */ React312.createElement("code", null, local.protocol), " \u2014 press \u201CGet Protocols\u201D to change it."), local.protocol && (!local.protocol.startsWith("did:") || local.protocol.includes("#")) && /* @__PURE__ */ React312.createElement(Alert69, { color: "red", styles: actionAlertStyles }, "The saved protocol ", /* @__PURE__ */ React312.createElement("code", null, local.protocol), " is not a valid DID, so creating a collection will fail. This is usually an unresolved claim-template reference \u2014 press \u201CGet Protocols\u201D and pick the protocol again.")), /* @__PURE__ */ React312.createElement(Stack206, { gap: "xs" }, /* @__PURE__ */ React312.createElement(Text194, { size: "sm", fw: 600 }, "Collection ID (optional)"), /* @__PURE__ */ React312.createElement(Text194, { size: "xs", c: "dimmed" }, "Leave empty to make this block a create entry point. Set an existing collection id (or a ", /* @__PURE__ */ React312.createElement("code", null, "{{block.output.collectionId}}"), " reference) to manage an existing collection."), /* @__PURE__ */ React312.createElement(BaseTextInput, { placeholder: "Leave empty to create a new collection", value: local.collectionId, onChange: (e) => update({ collectionId: e.currentTarget.value }) })), /* @__PURE__ */ React312.createElement(Alert69, { color: "neutralColor", variant: "light", icon: icon(
|
|
32196
|
+
), local.protocol && protocolOptions.length === 0 && /* @__PURE__ */ React312.createElement(Text194, { size: "xs", c: "dimmed" }, "Currently selected: ", /* @__PURE__ */ React312.createElement("code", null, local.protocol), " \u2014 press \u201CGet Protocols\u201D to change it."), local.protocol && (!local.protocol.startsWith("did:") || local.protocol.includes("#")) && /* @__PURE__ */ React312.createElement(Alert69, { color: "red", styles: actionAlertStyles }, "The saved protocol ", /* @__PURE__ */ React312.createElement("code", null, local.protocol), " is not a valid DID, so creating a collection will fail. This is usually an unresolved claim-template reference \u2014 press \u201CGet Protocols\u201D and pick the protocol again.")), /* @__PURE__ */ React312.createElement(Stack206, { gap: "xs" }, /* @__PURE__ */ React312.createElement(Text194, { size: "sm", fw: 600 }, "Collection ID (optional)"), /* @__PURE__ */ React312.createElement(Text194, { size: "xs", c: "dimmed" }, "Leave empty to make this block a create entry point. Set an existing collection id (or a ", /* @__PURE__ */ React312.createElement("code", null, "{{block.output.collectionId}}"), " reference) to manage an existing collection."), /* @__PURE__ */ React312.createElement(BaseTextInput, { placeholder: "Leave empty to create a new collection", value: local.collectionId, onChange: (e) => update({ collectionId: e.currentTarget.value }) })), /* @__PURE__ */ React312.createElement(Alert69, { color: "neutralColor", variant: "light", icon: icon(IconInfoCircle9, 16) }, /* @__PURE__ */ React312.createElement(Text194, { size: "xs" }, isManageMode ? "Manage-only mode: the block loads this collection and exposes lifecycle operations (state, dates, quota, payments, intents). Entity and protocol are only used for creation." : "Create mode: the block creates a new collection from the entity and protocol above. Schedule, quota, payments, and intents are chosen at run time.")));
|
|
32175
32197
|
};
|
|
32176
32198
|
|
|
32177
32199
|
// src/mantine/blocks/action/actionTypes/collection/CollectionLifecycleFlowDetail.tsx
|
|
32178
|
-
import React313, { useCallback as useCallback108, useEffect as useEffect110, useMemo as
|
|
32179
|
-
import { Alert as Alert70, Badge as Badge51, Box as Box58, Button as Button65, Group as
|
|
32200
|
+
import React313, { useCallback as useCallback108, useEffect as useEffect110, useMemo as useMemo115, useRef as useRef41, useState as useState163 } from "react";
|
|
32201
|
+
import { Alert as Alert70, Badge as Badge51, Box as Box58, Button as Button65, Group as Group112, Loader as Loader59, Overlay, SegmentedControl as SegmentedControl14, Stack as Stack207, Text as Text195 } from "@mantine/core";
|
|
32180
32202
|
import { DateTimePicker as DateTimePicker2 } from "@mantine/dates";
|
|
32181
32203
|
import { IconAlertCircle as IconAlertCircle27, IconCheck as IconCheck23, IconRefresh as IconRefresh8 } from "@tabler/icons-react";
|
|
32182
32204
|
var LOG = "[collection.lifecycle]";
|
|
@@ -32307,10 +32329,10 @@ var CollectionLifecycleFlowDetail = ({
|
|
|
32307
32329
|
executeAction
|
|
32308
32330
|
}) => {
|
|
32309
32331
|
const [actAs, setActAs] = useState163(emptyActAsGroupState());
|
|
32310
|
-
const parsed =
|
|
32332
|
+
const parsed = useMemo115(() => parseTemplateInputs(inputs), [inputs]);
|
|
32311
32333
|
const editorDocument = editor?.document || [];
|
|
32312
|
-
const resolveOpts =
|
|
32313
|
-
const boundCollectionId =
|
|
32334
|
+
const resolveOpts = useMemo115(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
32335
|
+
const boundCollectionId = useMemo115(() => resolveReferences(parsed.collectionId || "", editorDocument, resolveOpts).trim(), [parsed.collectionId, editorDocument, resolveOpts]);
|
|
32314
32336
|
const output = runtime.output || void 0;
|
|
32315
32337
|
const outputCollectionId = output?.collectionId || "";
|
|
32316
32338
|
const effectiveCollectionId = outputCollectionId || boundCollectionId;
|
|
@@ -32412,7 +32434,7 @@ var CollectionLifecycleFlowDetail = ({
|
|
|
32412
32434
|
}
|
|
32413
32435
|
}, [boundCollectionId, outputCollectionId, parsed.collectionId, inputs, editor, block]);
|
|
32414
32436
|
const currentCount = toNumberOrUndefined(output?.count) ?? 0;
|
|
32415
|
-
const validation =
|
|
32437
|
+
const validation = useMemo115(() => {
|
|
32416
32438
|
if (operation === "refresh") return { ok: true };
|
|
32417
32439
|
if (operation === "create") {
|
|
32418
32440
|
if (!parsed.entity) return { ok: false, error: "Entity (deed) DID is required \u2014 configure it in template mode." };
|
|
@@ -32589,7 +32611,7 @@ var CollectionLifecycleFlowDetail = ({
|
|
|
32589
32611
|
}, [runRefresh]);
|
|
32590
32612
|
const title = block?.props?.title || (isCreateMode ? "Create Claim Collection" : "Manage Claim Collection");
|
|
32591
32613
|
const description = block?.props?.description || "";
|
|
32592
|
-
return /* @__PURE__ */ React313.createElement(Stack207, { gap: "md", pos: "relative" }, /* @__PURE__ */ React313.createElement(GroupProposalStatus, { editor, block, runtime }), runtime?.state !== "awaiting_readback" && /* @__PURE__ */ React313.createElement(ActAsGroupSection, { value: actAs, onChange: setActAs, isDisabled, actionLabel: "update this collection" }), /* @__PURE__ */ React313.createElement(Stack207, { gap: 2 }, /* @__PURE__ */ React313.createElement(Text195, { fw: 600 }, title), description && /* @__PURE__ */ React313.createElement(Text195, { size: "sm", c: "dimmed" }, description)), isStale && /* @__PURE__ */ React313.createElement(Alert70, { icon: /* @__PURE__ */ React313.createElement(IconAlertCircle27, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React313.createElement(Stack207, { gap: "xs" }, /* @__PURE__ */ React313.createElement(Text195, { size: "sm" }, "Block was marked completed but no collection state was recorded. This is stale state from a previous run \u2014 reset and re-run."), /* @__PURE__ */ React313.createElement(
|
|
32614
|
+
return /* @__PURE__ */ React313.createElement(Stack207, { gap: "md", pos: "relative" }, /* @__PURE__ */ React313.createElement(GroupProposalStatus, { editor, block, runtime }), runtime?.state !== "awaiting_readback" && /* @__PURE__ */ React313.createElement(ActAsGroupSection, { value: actAs, onChange: setActAs, isDisabled, actionLabel: "update this collection" }), /* @__PURE__ */ React313.createElement(Stack207, { gap: 2 }, /* @__PURE__ */ React313.createElement(Text195, { fw: 600 }, title), description && /* @__PURE__ */ React313.createElement(Text195, { size: "sm", c: "dimmed" }, description)), isStale && /* @__PURE__ */ React313.createElement(Alert70, { icon: /* @__PURE__ */ React313.createElement(IconAlertCircle27, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React313.createElement(Stack207, { gap: "xs" }, /* @__PURE__ */ React313.createElement(Text195, { size: "sm" }, "Block was marked completed but no collection state was recorded. This is stale state from a previous run \u2014 reset and re-run."), /* @__PURE__ */ React313.createElement(Group112, null, /* @__PURE__ */ React313.createElement(Button65, { variant: "outline", size: "xs", onClick: handleReset }, "Reset"), /* @__PURE__ */ React313.createElement(Button65, { variant: "filled", size: "xs", onClick: handleForceRun, disabled: !validation.ok }, "Force Run Now")))), isFailed && /* @__PURE__ */ React313.createElement(Alert70, { icon: /* @__PURE__ */ React313.createElement(IconAlertCircle27, { size: 16 }), color: "red", title: "Action Failed", styles: actionAlertStyles }, /* @__PURE__ */ React313.createElement(Stack207, { gap: "xs" }, errorMessage && /* @__PURE__ */ React313.createElement(Text195, { size: "sm" }, errorMessage), /* @__PURE__ */ React313.createElement(Group112, null, /* @__PURE__ */ React313.createElement(Button65, { variant: "outline", size: "xs", onClick: handleReset }, "Reset"), !!effectiveCollectionId && /* @__PURE__ */ React313.createElement(Button65, { variant: "filled", size: "xs", leftSection: /* @__PURE__ */ React313.createElement(IconRefresh8, { size: 14 }), onClick: handleManualRefresh }, "Refresh State")))), isManageMode && !hasSnapshot && !isRunning && !isFailed && /* @__PURE__ */ React313.createElement(Group112, { gap: "xs" }, /* @__PURE__ */ React313.createElement(Loader59, { size: 14 }), /* @__PURE__ */ React313.createElement(Text195, { size: "sm", c: "dimmed" }, "Loading collection ", effectiveCollectionId ? `(${effectiveCollectionId})` : "", "\u2026")), hasSnapshot && /* @__PURE__ */ React313.createElement(Stack207, { gap: "md" }, /* @__PURE__ */ React313.createElement(StatsStrip, { output }), isCompletedWithProof && /* @__PURE__ */ React313.createElement(Alert70, { icon: /* @__PURE__ */ React313.createElement(IconCheck23, { size: 16 }), color: "green", styles: actionAlertStyles }, "Collection ", outputCollectionId, " synced \u2014 ", stateLabel(output?.state), "."), /* @__PURE__ */ React313.createElement(
|
|
32593
32615
|
SegmentedControl14,
|
|
32594
32616
|
{
|
|
32595
32617
|
fullWidth: true,
|
|
@@ -32617,7 +32639,7 @@ var CollectionLifecycleFlowDetail = ({
|
|
|
32617
32639
|
{ label: "Closed", value: String(2 /* CLOSED */) }
|
|
32618
32640
|
]
|
|
32619
32641
|
}
|
|
32620
|
-
), operation === "updateDates" && /* @__PURE__ */ React313.createElement(
|
|
32642
|
+
), operation === "updateDates" && /* @__PURE__ */ React313.createElement(Group112, { grow: true, align: "flex-start" }, /* @__PURE__ */ React313.createElement(
|
|
32621
32643
|
DateTimePicker2,
|
|
32622
32644
|
{
|
|
32623
32645
|
label: "Start date",
|
|
@@ -32668,7 +32690,7 @@ var CollectionLifecycleFlowDetail = ({
|
|
|
32668
32690
|
onChange: (value) => setCreateQuota(value === "" || value == null ? "" : String(value)),
|
|
32669
32691
|
disabled: isDisabled || isRunning
|
|
32670
32692
|
}
|
|
32671
|
-
), /* @__PURE__ */ React313.createElement(
|
|
32693
|
+
), /* @__PURE__ */ React313.createElement(Group112, { grow: true, align: "flex-start" }, /* @__PURE__ */ React313.createElement(
|
|
32672
32694
|
DateTimePicker2,
|
|
32673
32695
|
{
|
|
32674
32696
|
label: "Start date",
|
|
@@ -32691,13 +32713,13 @@ var CollectionLifecycleFlowDetail = ({
|
|
|
32691
32713
|
onChange: (date) => setCreateEndDate(dateToIso2(date)),
|
|
32692
32714
|
disabled: isDisabled || isRunning
|
|
32693
32715
|
}
|
|
32694
|
-
)), /* @__PURE__ */ React313.createElement(PaymentsEditor, { value: createPayments, onChange: setCreatePayments, disabled: isDisabled || isRunning }), !validation.ok && validation.error && /* @__PURE__ */ React313.createElement(Alert70, { color: "yellow", styles: actionAlertStyles }, validation.error)), isDisabled && /* @__PURE__ */ React313.createElement(Text195, { size: "xs", c: "dimmed" }, "This block is currently disabled."), isRunning && /* @__PURE__ */ React313.createElement(Overlay, { color: "var(--mantine-color-body)", backgroundOpacity: 0.6, blur: 1, zIndex: 5, radius: "md" }, /* @__PURE__ */ React313.createElement(
|
|
32716
|
+
)), /* @__PURE__ */ React313.createElement(PaymentsEditor, { value: createPayments, onChange: setCreatePayments, disabled: isDisabled || isRunning }), !validation.ok && validation.error && /* @__PURE__ */ React313.createElement(Alert70, { color: "yellow", styles: actionAlertStyles }, validation.error)), isDisabled && /* @__PURE__ */ React313.createElement(Text195, { size: "xs", c: "dimmed" }, "This block is currently disabled."), isRunning && /* @__PURE__ */ React313.createElement(Overlay, { color: "var(--mantine-color-body)", backgroundOpacity: 0.6, blur: 1, zIndex: 5, radius: "md" }, /* @__PURE__ */ React313.createElement(Group112, { gap: "xs", justify: "center", h: "100%" }, /* @__PURE__ */ React313.createElement(Loader59, { size: 16 }), /* @__PURE__ */ React313.createElement(Text195, { size: "sm" }, "Syncing collection state\u2026"))));
|
|
32695
32717
|
};
|
|
32696
32718
|
var PaymentsEditor = ({ value, onChange, disabled }) => {
|
|
32697
32719
|
const setLeg = (key, patch) => {
|
|
32698
32720
|
onChange({ ...value, [key]: { ...value[key], ...patch } });
|
|
32699
32721
|
};
|
|
32700
|
-
return /* @__PURE__ */ React313.createElement(Stack207, { gap: "sm" }, /* @__PURE__ */ React313.createElement(Stack207, { gap: 2 }, /* @__PURE__ */ React313.createElement(Text195, { size: "sm", fw: 500 }, "Payouts"), /* @__PURE__ */ React313.createElement(Text195, { size: "xs", c: "dimmed" }, "Optional payout per claim stage, paid from the entity admin account. Leave blank for no payout.")), PAYMENT_LEGS.map(({ key, label, description }) => /* @__PURE__ */ React313.createElement(
|
|
32722
|
+
return /* @__PURE__ */ React313.createElement(Stack207, { gap: "sm" }, /* @__PURE__ */ React313.createElement(Stack207, { gap: 2 }, /* @__PURE__ */ React313.createElement(Text195, { size: "sm", fw: 500 }, "Payouts"), /* @__PURE__ */ React313.createElement(Text195, { size: "xs", c: "dimmed" }, "Optional payout per claim stage, paid from the entity admin account. Leave blank for no payout.")), PAYMENT_LEGS.map(({ key, label, description }) => /* @__PURE__ */ React313.createElement(Group112, { key, align: "flex-end", gap: "sm", wrap: "nowrap" }, /* @__PURE__ */ React313.createElement(
|
|
32701
32723
|
BaseNumberInput,
|
|
32702
32724
|
{
|
|
32703
32725
|
label,
|
|
@@ -32734,7 +32756,7 @@ var StatsStrip = ({ output }) => {
|
|
|
32734
32756
|
background: "var(--mantine-color-neutralColor-5)"
|
|
32735
32757
|
}
|
|
32736
32758
|
},
|
|
32737
|
-
/* @__PURE__ */ React313.createElement(
|
|
32759
|
+
/* @__PURE__ */ React313.createElement(Group112, { justify: "space-between", wrap: "wrap", gap: "md" }, /* @__PURE__ */ React313.createElement(Stat, { label: "Collection", value: output.collectionId, mono: true }), /* @__PURE__ */ React313.createElement(Stat, { label: "State", value: stateLabel(output.state), badge: true, stateValue: output.state }), /* @__PURE__ */ React313.createElement(Stat, { label: "Count", value: String(output.count ?? "0") }), /* @__PURE__ */ React313.createElement(Stat, { label: "Quota", value: formatQuota(output.quota) }), output.startDate && /* @__PURE__ */ React313.createElement(Stat, { label: "Start", value: output.startDate }), output.endDate && /* @__PURE__ */ React313.createElement(Stat, { label: "End", value: output.endDate }))
|
|
32738
32760
|
);
|
|
32739
32761
|
};
|
|
32740
32762
|
var Stat = ({ label, value, mono, badge, stateValue }) => {
|
|
@@ -32756,8 +32778,8 @@ registerActionTypeUI("qi/collection.lifecycle", {
|
|
|
32756
32778
|
import { IconUsers as IconUsers8 } from "@tabler/icons-react";
|
|
32757
32779
|
|
|
32758
32780
|
// src/mantine/blocks/action/actionTypes/collectionUsers/CollectionUsersConfig.tsx
|
|
32759
|
-
import React314, { useCallback as useCallback109, useEffect as useEffect111, useMemo as
|
|
32760
|
-
import { Alert as Alert71, Button as Button66, Group as
|
|
32781
|
+
import React314, { useCallback as useCallback109, useEffect as useEffect111, useMemo as useMemo116, useState as useState164 } from "react";
|
|
32782
|
+
import { Alert as Alert71, Button as Button66, Group as Group113, Loader as Loader60, Paper as Paper24, Select as Select9, Stack as Stack208, Text as Text196 } from "@mantine/core";
|
|
32761
32783
|
import { IconBolt as IconBolt11, IconClock as IconClock13, IconPencil } from "@tabler/icons-react";
|
|
32762
32784
|
|
|
32763
32785
|
// src/mantine/blocks/action/actionTypes/collectionUsers/types.ts
|
|
@@ -32800,7 +32822,7 @@ var ModeCard = ({ active, icon: icon2, title, description, onClick }) => /* @__P
|
|
|
32800
32822
|
transition: "border-color 120ms ease, background 120ms ease"
|
|
32801
32823
|
}
|
|
32802
32824
|
},
|
|
32803
|
-
/* @__PURE__ */ React314.createElement(Stack208, { gap: 4 }, /* @__PURE__ */ React314.createElement(
|
|
32825
|
+
/* @__PURE__ */ React314.createElement(Stack208, { gap: 4 }, /* @__PURE__ */ React314.createElement(Group113, { gap: 6, align: "center", wrap: "nowrap" }, icon2, /* @__PURE__ */ React314.createElement(Text196, { size: "sm", fw: 600 }, title)), /* @__PURE__ */ React314.createElement(Text196, { size: "xs", c: "dimmed" }, description))
|
|
32804
32826
|
);
|
|
32805
32827
|
var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
32806
32828
|
const t = useTranslate();
|
|
@@ -32818,7 +32840,7 @@ var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
32818
32840
|
setLocal(parseCollectionUsersActionInputs(inputs));
|
|
32819
32841
|
setTriggerRaw(readTriggerRaw());
|
|
32820
32842
|
}, [inputs, readTriggerRaw]);
|
|
32821
|
-
const triggerSpec =
|
|
32843
|
+
const triggerSpec = useMemo116(() => {
|
|
32822
32844
|
if (!triggerRaw) return null;
|
|
32823
32845
|
try {
|
|
32824
32846
|
return JSON.parse(triggerRaw);
|
|
@@ -32843,7 +32865,7 @@ var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
32843
32865
|
},
|
|
32844
32866
|
[local, onInputsChange]
|
|
32845
32867
|
);
|
|
32846
|
-
const sourceOptions =
|
|
32868
|
+
const sourceOptions = useMemo116(() => {
|
|
32847
32869
|
const blocks = editor?.document || [];
|
|
32848
32870
|
return blocks.filter((b) => b?.id && b.id !== blockId).map((b) => {
|
|
32849
32871
|
const action = getAction(b.props?.actionType || "");
|
|
@@ -32853,7 +32875,7 @@ var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
32853
32875
|
return { value: b.id, label: String(b.props?.title || action?.type || b.id), eventName: collectionEvent.name };
|
|
32854
32876
|
}).filter((o) => o !== null);
|
|
32855
32877
|
}, [editor, blockId, triggerRaw, inputs]);
|
|
32856
|
-
const selectedSource =
|
|
32878
|
+
const selectedSource = useMemo116(() => sourceOptions.find((o) => o.value === triggerSpec?.sourceBlockId), [sourceOptions, triggerSpec]);
|
|
32857
32879
|
const switchToTrigger = useCallback109(() => {
|
|
32858
32880
|
if (mode === "trigger") return;
|
|
32859
32881
|
const cleared = { deedDid: "", collectionId: "" };
|
|
@@ -32914,14 +32936,14 @@ var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
32914
32936
|
void fetchCollections();
|
|
32915
32937
|
}
|
|
32916
32938
|
}, [local.deedDid, local.collectionId]);
|
|
32917
|
-
const collectionOptions =
|
|
32939
|
+
const collectionOptions = useMemo116(
|
|
32918
32940
|
() => collections.map((collection) => ({
|
|
32919
32941
|
value: collection.id,
|
|
32920
32942
|
label: formatCollectionOptionLabel(collection)
|
|
32921
32943
|
})),
|
|
32922
32944
|
[collections]
|
|
32923
32945
|
);
|
|
32924
|
-
return /* @__PURE__ */ React314.createElement(Stack208, { gap: "md" }, /* @__PURE__ */ React314.createElement(Stack208, { gap: 6 }, /* @__PURE__ */ React314.createElement(Text196, { size: "sm", fw: 600 }, "How is the collection chosen?"), /* @__PURE__ */ React314.createElement(
|
|
32946
|
+
return /* @__PURE__ */ React314.createElement(Stack208, { gap: "md" }, /* @__PURE__ */ React314.createElement(Stack208, { gap: 6 }, /* @__PURE__ */ React314.createElement(Text196, { size: "sm", fw: 600 }, "How is the collection chosen?"), /* @__PURE__ */ React314.createElement(Group113, { gap: "sm", align: "stretch", grow: true }, /* @__PURE__ */ React314.createElement(
|
|
32925
32947
|
ModeCard,
|
|
32926
32948
|
{
|
|
32927
32949
|
active: mode === "trigger",
|
|
@@ -32995,8 +33017,8 @@ var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
32995
33017
|
};
|
|
32996
33018
|
|
|
32997
33019
|
// src/mantine/blocks/action/actionTypes/collectionUsers/CollectionUsersFlowDetail.tsx
|
|
32998
|
-
import React315, { useCallback as useCallback110, useEffect as useEffect112, useMemo as
|
|
32999
|
-
import { ActionIcon as ActionIcon45, Alert as Alert72, Badge as Badge52, Box as Box59, Button as Button67, Divider as Divider22, Group as
|
|
33020
|
+
import React315, { useCallback as useCallback110, useEffect as useEffect112, useMemo as useMemo117, useRef as useRef42, useState as useState165 } from "react";
|
|
33021
|
+
import { ActionIcon as ActionIcon45, Alert as Alert72, Badge as Badge52, Box as Box59, Button as Button67, Divider as Divider22, Group as Group114, JsonInput as JsonInput2, Loader as Loader61, Radio as Radio5, SegmentedControl as SegmentedControl15, Stack as Stack209, Text as Text197 } from "@mantine/core";
|
|
33000
33022
|
import { useDebouncedValue } from "@mantine/hooks";
|
|
33001
33023
|
import { IconAlertCircle as IconAlertCircle28, IconArrowLeft as IconArrowLeft10, IconCheck as IconCheck24, IconRefresh as IconRefresh9, IconTrash as IconTrash10 } from "@tabler/icons-react";
|
|
33002
33024
|
var LOG2 = "[collection.users]";
|
|
@@ -33054,7 +33076,7 @@ function formatCoin3(coin) {
|
|
|
33054
33076
|
return `${fromBaseUnits(coin.amount)} ${denom}`;
|
|
33055
33077
|
}
|
|
33056
33078
|
function MaxAmountsInput({ value, onChange, disabled }) {
|
|
33057
|
-
return /* @__PURE__ */ React315.createElement(Stack209, { gap: "xs" }, /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, "Evaluator max amounts"), /* @__PURE__ */ React315.createElement(
|
|
33079
|
+
return /* @__PURE__ */ React315.createElement(Stack209, { gap: "xs" }, /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, "Evaluator max amounts"), /* @__PURE__ */ React315.createElement(Group114, { grow: true, align: "flex-start" }, /* @__PURE__ */ React315.createElement(
|
|
33058
33080
|
BaseNumberInput,
|
|
33059
33081
|
{
|
|
33060
33082
|
label: "IXO",
|
|
@@ -33129,21 +33151,21 @@ var CollectionUsersFlowDetail = ({
|
|
|
33129
33151
|
useEffect112(() => {
|
|
33130
33152
|
handlersRef.current = handlers;
|
|
33131
33153
|
}, [handlers]);
|
|
33132
|
-
const parsed =
|
|
33154
|
+
const parsed = useMemo117(() => parseCollectionUsersActionInputs(inputs), [inputs]);
|
|
33133
33155
|
const editorDocument = editor?.document || [];
|
|
33134
|
-
const resolveOpts =
|
|
33135
|
-
const templateDeedDid =
|
|
33136
|
-
const templateCollectionId =
|
|
33156
|
+
const resolveOpts = useMemo117(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
33157
|
+
const templateDeedDid = useMemo117(() => resolveReferences(parsed.deedDid || "", editorDocument, resolveOpts).trim(), [parsed.deedDid, editorDocument, resolveOpts]);
|
|
33158
|
+
const templateCollectionId = useMemo117(() => resolveReferences(parsed.collectionId || "", editorDocument, resolveOpts).trim(), [parsed.collectionId, editorDocument, resolveOpts]);
|
|
33137
33159
|
const isListener = !!activePendingInvocation;
|
|
33138
|
-
const pendingPayload =
|
|
33160
|
+
const pendingPayload = useMemo117(() => {
|
|
33139
33161
|
if (!activePendingInvocation) return void 0;
|
|
33140
33162
|
return {
|
|
33141
33163
|
...activePendingInvocation.payload || {},
|
|
33142
33164
|
...activePendingInvocation.refSnapshots || {}
|
|
33143
33165
|
};
|
|
33144
33166
|
}, [activePendingInvocation]);
|
|
33145
|
-
const deedDid =
|
|
33146
|
-
const collectionId =
|
|
33167
|
+
const deedDid = useMemo117(() => String(pendingPayload?.entity || "").trim() || templateDeedDid, [pendingPayload, templateDeedDid]);
|
|
33168
|
+
const collectionId = useMemo117(() => String(pendingPayload?.collectionId || "").trim() || templateCollectionId, [pendingPayload, templateCollectionId]);
|
|
33147
33169
|
const [adminAddress, setAdminAddress] = useState165("");
|
|
33148
33170
|
const [adminError, setAdminError] = useState165(null);
|
|
33149
33171
|
useEffect112(() => {
|
|
@@ -33172,7 +33194,7 @@ var CollectionUsersFlowDetail = ({
|
|
|
33172
33194
|
}, [deedDid]);
|
|
33173
33195
|
const output = runtime.output || void 0;
|
|
33174
33196
|
const lastOp = String(output?.operation || "");
|
|
33175
|
-
const listGrantees =
|
|
33197
|
+
const listGrantees = useMemo117(() => {
|
|
33176
33198
|
const out = output;
|
|
33177
33199
|
return Array.isArray(out?.grantees) ? out.grantees : [];
|
|
33178
33200
|
}, [output]);
|
|
@@ -33329,7 +33351,7 @@ var CollectionUsersFlowDetail = ({
|
|
|
33329
33351
|
mounted = false;
|
|
33330
33352
|
};
|
|
33331
33353
|
}, [listGrantees, granteeProfilesByDid]);
|
|
33332
|
-
const validation =
|
|
33354
|
+
const validation = useMemo117(() => {
|
|
33333
33355
|
if (section === "bids") return { ok: false };
|
|
33334
33356
|
if (!collectionId) return { ok: false, error: "No collection configured. Set one in template mode." };
|
|
33335
33357
|
if (!adminAddress) return { ok: false, error: adminError || "Resolving entity admin account\u2026" };
|
|
@@ -33466,7 +33488,7 @@ var CollectionUsersFlowDetail = ({
|
|
|
33466
33488
|
defaultValue: "Configure the {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
33467
33489
|
did: "DID",
|
|
33468
33490
|
claimCollection: "claim collection"
|
|
33469
|
-
})), isStale && /* @__PURE__ */ React315.createElement(Alert72, { icon: /* @__PURE__ */ React315.createElement(IconAlertCircle28, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React315.createElement(Stack209, { gap: "xs" }, /* @__PURE__ */ React315.createElement(Text197, { size: "sm" }, "Block was marked completed but no result was recorded. This is stale state from a previous run \u2014 reset and re-run."), /* @__PURE__ */ React315.createElement(
|
|
33491
|
+
})), isStale && /* @__PURE__ */ React315.createElement(Alert72, { icon: /* @__PURE__ */ React315.createElement(IconAlertCircle28, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React315.createElement(Stack209, { gap: "xs" }, /* @__PURE__ */ React315.createElement(Text197, { size: "sm" }, "Block was marked completed but no result was recorded. This is stale state from a previous run \u2014 reset and re-run."), /* @__PURE__ */ React315.createElement(Group114, null, /* @__PURE__ */ React315.createElement(Button67, { variant: "outline", size: "xs", onClick: handleReset }, "Reset"), /* @__PURE__ */ React315.createElement(Button67, { variant: "filled", size: "xs", onClick: handleForceRun, disabled: !validation.ok }, "Force Run Now")))), isFailed && /* @__PURE__ */ React315.createElement(Alert72, { icon: /* @__PURE__ */ React315.createElement(IconAlertCircle28, { size: 16 }), color: "red", title: "Action Failed", styles: actionAlertStyles }, /* @__PURE__ */ React315.createElement(Stack209, { gap: "xs" }, errorMessage && /* @__PURE__ */ React315.createElement(Text197, { size: "sm" }, errorMessage), /* @__PURE__ */ React315.createElement(Group114, null, /* @__PURE__ */ React315.createElement(Button67, { variant: "outline", size: "xs", onClick: handleReset }, "Reset"), !!collectionId && !!adminAddress && /* @__PURE__ */ React315.createElement(Button67, { variant: "filled", size: "xs", leftSection: /* @__PURE__ */ React315.createElement(IconRefresh9, { size: 14 }), onClick: handleManualRefreshList }, "Refresh List")))), isCompletedWithProof && hasTxProof && (lastOp === "add" || lastOp === "revoke") && /* @__PURE__ */ React315.createElement(Alert72, { icon: /* @__PURE__ */ React315.createElement(IconCheck24, { size: 16 }), color: "green", styles: actionAlertStyles }, lastOp === "add" ? "Grant broadcast" : "Revoke broadcast", " \u2014 tx ", truncateAddress4(String(output?.transactionHash || "")), "."), !configMissing && /* @__PURE__ */ React315.createElement(
|
|
33470
33492
|
SegmentedControl15,
|
|
33471
33493
|
{
|
|
33472
33494
|
fullWidth: true,
|
|
@@ -33479,7 +33501,7 @@ var CollectionUsersFlowDetail = ({
|
|
|
33479
33501
|
{ label: "Bids", value: "bids" }
|
|
33480
33502
|
]
|
|
33481
33503
|
}
|
|
33482
|
-
), !configMissing && section === "list" && /* @__PURE__ */ React315.createElement(Stack209, { gap: "sm" }, /* @__PURE__ */ React315.createElement(
|
|
33504
|
+
), !configMissing && section === "list" && /* @__PURE__ */ React315.createElement(Stack209, { gap: "sm" }, /* @__PURE__ */ React315.createElement(Group114, { justify: "space-between", align: "center" }, /* @__PURE__ */ React315.createElement(Text197, { size: "sm", fw: 600 }, "Grantees"), /* @__PURE__ */ React315.createElement(ActionIcon45, { variant: "subtle", color: "gray", size: "sm", onClick: handleManualRefreshList, disabled: isRunning || !adminAddress }, /* @__PURE__ */ React315.createElement(IconRefresh9, { size: 16 }))), isRunning && lastOp !== "add" && lastOp !== "revoke" && /* @__PURE__ */ React315.createElement(Group114, { gap: "xs", justify: "center", py: "sm" }, /* @__PURE__ */ React315.createElement(Loader61, { size: "xs" }), /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, "Loading grantees\u2026")), !isRunning && listGrantees.length === 0 && /* @__PURE__ */ React315.createElement(Text197, { size: "sm", c: "dimmed", ta: "center", py: "sm" }, "No grantees hold a constraint for this collection yet."), listGrantees.map((grantee) => {
|
|
33483
33505
|
const isTarget = revokeTarget?.address === grantee.address && revokeTarget?.role === grantee.role;
|
|
33484
33506
|
const granteeDid = getGranteeDid(grantee);
|
|
33485
33507
|
const profile = granteeProfilesByDid[granteeDid];
|
|
@@ -33495,7 +33517,7 @@ var CollectionUsersFlowDetail = ({
|
|
|
33495
33517
|
background: "var(--mantine-color-neutralColor-5)"
|
|
33496
33518
|
}
|
|
33497
33519
|
},
|
|
33498
|
-
/* @__PURE__ */ React315.createElement(
|
|
33520
|
+
/* @__PURE__ */ React315.createElement(Group114, { justify: "space-between", align: "center", wrap: "nowrap" }, /* @__PURE__ */ React315.createElement(Stack209, { gap: 2, style: { minWidth: 0 } }, /* @__PURE__ */ React315.createElement(Text197, { size: "sm", fw: 600, truncate: true }, displayName), profile?.displayname && /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed", truncate: true }, truncateAddress4(grantee.address)), /* @__PURE__ */ React315.createElement(Group114, { gap: "xs" }, /* @__PURE__ */ React315.createElement(Badge52, { size: "xs", variant: "light", color: grantee.role === "submit" ? "blue" : "green" }, roleLabel(grantee.role)), /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, "Quota: ", formatQuota2(grantee.agentQuota)))), isTarget ? /* @__PURE__ */ React315.createElement(Button67, { size: "compact-xs", variant: "subtle", color: "gray", onClick: cancelRevoke, disabled: isDisabled || isRunning }, "Cancel") : /* @__PURE__ */ React315.createElement(
|
|
33499
33521
|
Button67,
|
|
33500
33522
|
{
|
|
33501
33523
|
size: "compact-xs",
|
|
@@ -33569,8 +33591,8 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
|
|
|
33569
33591
|
const [approveMaxAmounts, setApproveMaxAmounts] = useState165(EMPTY_MAX_AMOUNTS);
|
|
33570
33592
|
const [submitting, setSubmitting] = useState165(false);
|
|
33571
33593
|
const [profilesByDid, setProfilesByDid] = useState165({});
|
|
33572
|
-
const selectedBid =
|
|
33573
|
-
const selectedBidIsEvaluator =
|
|
33594
|
+
const selectedBid = useMemo117(() => bids.find((b) => b.id === selectedBidId) || null, [bids, selectedBidId]);
|
|
33595
|
+
const selectedBidIsEvaluator = useMemo117(() => {
|
|
33574
33596
|
const role = String(selectedBid?.role || "").toLowerCase();
|
|
33575
33597
|
return role === "evaluation_agent" || role === "ea";
|
|
33576
33598
|
}, [selectedBid]);
|
|
@@ -33710,7 +33732,7 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
|
|
|
33710
33732
|
}
|
|
33711
33733
|
] : []
|
|
33712
33734
|
];
|
|
33713
|
-
return /* @__PURE__ */ React315.createElement(Stack209, { gap: "md" }, /* @__PURE__ */ React315.createElement(
|
|
33735
|
+
return /* @__PURE__ */ React315.createElement(Stack209, { gap: "md" }, /* @__PURE__ */ React315.createElement(Group114, { gap: "xs", align: "center" }, /* @__PURE__ */ React315.createElement(ActionIcon45, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedBidId("") }, /* @__PURE__ */ React315.createElement(IconArrowLeft10, { size: 16 })), /* @__PURE__ */ React315.createElement(Text197, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, "Bid #", selectedBid.id)), /* @__PURE__ */ React315.createElement(Stack209, { gap: 4 }, /* @__PURE__ */ React315.createElement(Text197, { size: "sm", fw: 600, truncate: true }, displayName), /* @__PURE__ */ React315.createElement(Group114, { gap: "xs" }, /* @__PURE__ */ React315.createElement(Badge52, { size: "xs", variant: "light", color: getRoleColor3(selectedBid.role) }, getBidRoleLabel(selectedBid.role)), /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, truncateAddress4(selectedBid.address)))), /* @__PURE__ */ React315.createElement(CollapsibleSection, { title: "Inputs" }, bidData && typeof bidData === "object" ? /* @__PURE__ */ React315.createElement(
|
|
33714
33736
|
JsonInput2,
|
|
33715
33737
|
{
|
|
33716
33738
|
value: JSON.stringify(bidData, null, 2),
|
|
@@ -33772,7 +33794,7 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
|
|
|
33772
33794
|
decision === "reject" ? "Reject bid" : "Approve bid"
|
|
33773
33795
|
));
|
|
33774
33796
|
}
|
|
33775
|
-
return /* @__PURE__ */ React315.createElement(Stack209, { gap: "sm" }, /* @__PURE__ */ React315.createElement(
|
|
33797
|
+
return /* @__PURE__ */ React315.createElement(Stack209, { gap: "sm" }, /* @__PURE__ */ React315.createElement(Group114, { justify: "space-between", align: "center" }, /* @__PURE__ */ React315.createElement(Text197, { size: "sm", fw: 600 }, "Incoming bids"), /* @__PURE__ */ React315.createElement(ActionIcon45, { variant: "subtle", color: "gray", size: "sm", onClick: refreshBids, disabled: loading }, /* @__PURE__ */ React315.createElement(IconRefresh9, { size: 16 }))), /* @__PURE__ */ React315.createElement(Divider22, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), loading && /* @__PURE__ */ React315.createElement(Group114, { gap: "xs", justify: "center", py: "sm" }, /* @__PURE__ */ React315.createElement(Loader61, { size: "xs" }), /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, "Loading bids\u2026")), !loading && bids.length === 0 && /* @__PURE__ */ React315.createElement(Text197, { size: "sm", c: "dimmed", ta: "center", py: "sm" }, "No bids available for this collection."), bids.map((bid) => {
|
|
33776
33798
|
const profile = profilesByDid[bid.did];
|
|
33777
33799
|
const displayName = profile?.displayname || bid.did || bid.address;
|
|
33778
33800
|
return /* @__PURE__ */ React315.createElement(ListItemContainer, { key: bid.id, isChecked: false, onClick: () => setSelectedBidId(bid.id) }, /* @__PURE__ */ React315.createElement(Stack209, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React315.createElement(Text197, { fw: 500, size: "sm", truncate: true }, displayName), /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed", truncate: true }, truncateAddress4(bid.address))), /* @__PURE__ */ React315.createElement(Stack209, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React315.createElement(Badge52, { size: "xs", variant: "light", color: getRoleColor3(bid.role) }, getBidRoleLabel(bid.role)), /* @__PURE__ */ React315.createElement(Text197, { size: "xs", c: "dimmed" }, getTimeAgo3(bid.created || ""))));
|
|
@@ -33803,8 +33825,8 @@ registerActionTypeUI("qi/collection.users", {
|
|
|
33803
33825
|
import { IconChecks as IconChecks4 } from "@tabler/icons-react";
|
|
33804
33826
|
|
|
33805
33827
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimConfig.tsx
|
|
33806
|
-
import React316, { useCallback as useCallback111, useEffect as useEffect113, useMemo as
|
|
33807
|
-
import { Alert as Alert73, Button as Button68, Group as
|
|
33828
|
+
import React316, { useCallback as useCallback111, useEffect as useEffect113, useMemo as useMemo118, useRef as useRef43, useState as useState166 } from "react";
|
|
33829
|
+
import { Alert as Alert73, Button as Button68, Group as Group115, Loader as Loader62, Stack as Stack210, Switch as Switch12, Text as Text198 } from "@mantine/core";
|
|
33808
33830
|
|
|
33809
33831
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/types.ts
|
|
33810
33832
|
var EMPTY_XERO_INVOICE_DEFAULTS = {
|
|
@@ -33949,7 +33971,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
33949
33971
|
void fetchCollections();
|
|
33950
33972
|
}
|
|
33951
33973
|
}, [local.deedDid, local.collectionId]);
|
|
33952
|
-
const collectionOptions =
|
|
33974
|
+
const collectionOptions = useMemo118(
|
|
33953
33975
|
() => collections.map((collection) => ({
|
|
33954
33976
|
value: collection.id,
|
|
33955
33977
|
label: formatCollectionOptionLabel(collection)
|
|
@@ -34019,7 +34041,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
34019
34041
|
}
|
|
34020
34042
|
), local.xeroOracleInvoiceOnApprove && /* @__PURE__ */ React316.createElement(Stack210, { gap: "xs", mt: 4 }, /* @__PURE__ */ React316.createElement(Text198, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.config.xeroInvoiceDefaultsDescription", {
|
|
34021
34043
|
defaultValue: "Optional invoice defaults pinned into the oracle payload. Anything left empty is extracted from the claim material; Status defaults to Draft."
|
|
34022
|
-
})), /* @__PURE__ */ React316.createElement(
|
|
34044
|
+
})), /* @__PURE__ */ React316.createElement(Group115, { grow: true }, /* @__PURE__ */ React316.createElement(
|
|
34023
34045
|
BaseSelect,
|
|
34024
34046
|
{
|
|
34025
34047
|
label: t("actionTypes.evaluateClaim.config.xeroInvoiceType", { defaultValue: "Type" }),
|
|
@@ -34041,7 +34063,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
34041
34063
|
value: local.xeroInvoiceDefaults.Status || "DRAFT",
|
|
34042
34064
|
onChange: (value) => updateXeroDefaults({ Status: value || "DRAFT" })
|
|
34043
34065
|
}
|
|
34044
|
-
)), /* @__PURE__ */ React316.createElement(
|
|
34066
|
+
)), /* @__PURE__ */ React316.createElement(Group115, { grow: true }, /* @__PURE__ */ React316.createElement(
|
|
34045
34067
|
DataInput,
|
|
34046
34068
|
{
|
|
34047
34069
|
label: t("actionTypes.evaluateClaim.config.xeroCurrencyCode", { defaultValue: "Currency (optional)" }),
|
|
@@ -34060,7 +34082,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
34060
34082
|
editorDocument: editor?.document || [],
|
|
34061
34083
|
currentBlockId: blockId
|
|
34062
34084
|
}
|
|
34063
|
-
)), /* @__PURE__ */ React316.createElement(
|
|
34085
|
+
)), /* @__PURE__ */ React316.createElement(Group115, { grow: true }, /* @__PURE__ */ React316.createElement(
|
|
34064
34086
|
DataInput,
|
|
34065
34087
|
{
|
|
34066
34088
|
label: t("actionTypes.evaluateClaim.config.xeroContactId", { defaultValue: "Contact ID (optional)" }),
|
|
@@ -34086,14 +34108,14 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
34086
34108
|
};
|
|
34087
34109
|
|
|
34088
34110
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimFlowDetail.tsx
|
|
34089
|
-
import React320, { useCallback as useCallback113, useEffect as useEffect115, useMemo as
|
|
34090
|
-
import { ActionIcon as ActionIcon47, Alert as Alert74, Box as Box62, Button as Button69, Checkbox as Checkbox14, Divider as Divider23, Group as
|
|
34111
|
+
import React320, { useCallback as useCallback113, useEffect as useEffect115, useMemo as useMemo120, useRef as useRef45, useState as useState169 } from "react";
|
|
34112
|
+
import { ActionIcon as ActionIcon47, Alert as Alert74, Box as Box62, Button as Button69, Checkbox as Checkbox14, Divider as Divider23, Group as Group119, Loader as Loader64, ScrollArea as ScrollArea8, Stack as Stack214, Text as Text202, UnstyledButton as UnstyledButton5 } from "@mantine/core";
|
|
34091
34113
|
import { IconArrowLeft as IconArrowLeft11, IconCheck as IconCheck26, IconFilter as IconFilter2 } from "@tabler/icons-react";
|
|
34092
34114
|
import { SurveyModel as SurveyModel11 } from "@ixo/surveys";
|
|
34093
34115
|
|
|
34094
34116
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/FlowManagerAdvisorySections.tsx
|
|
34095
34117
|
import React317, { useState as useState167 } from "react";
|
|
34096
|
-
import { ActionIcon as ActionIcon46, Badge as Badge53, Group as
|
|
34118
|
+
import { ActionIcon as ActionIcon46, Badge as Badge53, Group as Group116, Stack as Stack211, Text as Text199, Tooltip as Tooltip30 } from "@mantine/core";
|
|
34097
34119
|
import { IconCheck as IconCheck25, IconLink as IconLink5, IconPencil as IconPencil2, IconSparkles as IconSparkles7, IconUser as IconUser14, IconX as IconX18 } from "@tabler/icons-react";
|
|
34098
34120
|
|
|
34099
34121
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/evaluationReportModel.ts
|
|
@@ -34188,7 +34210,7 @@ function ProvenanceHint({ provenance }) {
|
|
|
34188
34210
|
const t = useTranslate();
|
|
34189
34211
|
if (provenance !== "derived" && provenance !== "inferred" && provenance !== "human") return null;
|
|
34190
34212
|
const hint = provenance === "human" ? { Icon: IconUser14, label: t("actionTypes.evaluateClaim.flow.flowManager.provenance.human", { defaultValue: "Set by human" }) } : provenance === "derived" ? { Icon: IconLink5, label: t("actionTypes.evaluateClaim.flow.flowManager.provenance.derived", { defaultValue: "Derived from inputs" }) } : { Icon: IconSparkles7, label: t("actionTypes.evaluateClaim.flow.flowManager.provenance.inferred", { defaultValue: "Inferred by LLM" }) };
|
|
34191
|
-
return /* @__PURE__ */ React317.createElement(
|
|
34213
|
+
return /* @__PURE__ */ React317.createElement(Tooltip30, { label: hint.label, withArrow: true }, /* @__PURE__ */ React317.createElement("span", { style: { display: "inline-flex", alignItems: "center" }, "aria-label": hint.label }, icon(hint.Icon, 12, "var(--mantine-color-dimmed)")));
|
|
34192
34214
|
}
|
|
34193
34215
|
var FlowManagerContextSection = ({ record, onOverride, disabled }) => {
|
|
34194
34216
|
const t = useTranslate();
|
|
@@ -34215,7 +34237,7 @@ var FlowManagerContextSection = ({ record, onOverride, disabled }) => {
|
|
|
34215
34237
|
setEditingTheme(false);
|
|
34216
34238
|
setThemeDraft("");
|
|
34217
34239
|
};
|
|
34218
|
-
return /* @__PURE__ */ React317.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.flowManager.understanding", { defaultValue: "Flow Manager understanding" }) }, /* @__PURE__ */ React317.createElement(Stack211, { gap: "xs" }, (theme || editingTheme) && /* @__PURE__ */ React317.createElement(
|
|
34240
|
+
return /* @__PURE__ */ React317.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.flowManager.understanding", { defaultValue: "Flow Manager understanding" }) }, /* @__PURE__ */ React317.createElement(Stack211, { gap: "xs" }, (theme || editingTheme) && /* @__PURE__ */ React317.createElement(Group116, { gap: "xs", align: "center", wrap: "nowrap" }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed", style: { flexShrink: 0 } }, t("actionTypes.evaluateClaim.flow.flowManager.theme", { defaultValue: "Theme" })), editingTheme ? /* @__PURE__ */ React317.createElement(React317.Fragment, null, /* @__PURE__ */ React317.createElement("span", { ref: (node) => node?.querySelector("input")?.focus(), style: { flex: 1, display: "flex", minWidth: 0 } }, /* @__PURE__ */ React317.createElement(
|
|
34219
34241
|
BaseTextInput,
|
|
34220
34242
|
{
|
|
34221
34243
|
size: "xs",
|
|
@@ -34258,7 +34280,7 @@ var FlowManagerContextSection = ({ record, onOverride, disabled }) => {
|
|
|
34258
34280
|
"aria-label": t("actionTypes.evaluateClaim.flow.flowManager.editTheme", { defaultValue: "Edit theme" })
|
|
34259
34281
|
},
|
|
34260
34282
|
icon(IconPencil2, 14)
|
|
34261
|
-
))), topics.length > 0 && /* @__PURE__ */ React317.createElement(
|
|
34283
|
+
))), topics.length > 0 && /* @__PURE__ */ React317.createElement(Group116, { gap: "xs", align: "center" }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed", style: { flexShrink: 0 } }, t("actionTypes.evaluateClaim.flow.flowManager.topics", { defaultValue: "Topics" })), /* @__PURE__ */ React317.createElement(Group116, { gap: 4 }, topics.map((topic) => /* @__PURE__ */ React317.createElement(Badge53, { key: topic, variant: "light", color: "gray", size: "sm", style: { textTransform: "none" } }, topic))), /* @__PURE__ */ React317.createElement(ProvenanceHint, { provenance: provenance.topics })), summary && /* @__PURE__ */ React317.createElement(Group116, { gap: "xs", align: "flex-start", wrap: "nowrap" }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed", style: { flexShrink: 0 } }, t("actionTypes.evaluateClaim.flow.flowManager.summary", { defaultValue: "Summary" })), /* @__PURE__ */ React317.createElement(Text199, { size: "sm", style: { flex: 1, minWidth: 0 } }, summary), /* @__PURE__ */ React317.createElement(ProvenanceHint, { provenance: provenance.summary }))));
|
|
34262
34284
|
};
|
|
34263
34285
|
function truncateClaimId(value) {
|
|
34264
34286
|
if (value.length <= 17) return value;
|
|
@@ -34273,14 +34295,14 @@ var EvaluationReportSection = ({ runtime, selectedClaimId }) => {
|
|
|
34273
34295
|
id: truncateClaimId(model.claimId),
|
|
34274
34296
|
defaultValue: `Claim ${truncateClaimId(model.claimId)}`
|
|
34275
34297
|
})) : void 0;
|
|
34276
|
-
return /* @__PURE__ */ React317.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.flowManager.evaluationReport", { defaultValue: "Evaluation report" }), badge: headerClaimBadge }, /* @__PURE__ */ React317.createElement(Stack211, { gap: "xs" }, model.recommendation && /* @__PURE__ */ React317.createElement(
|
|
34298
|
+
return /* @__PURE__ */ React317.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.flowManager.evaluationReport", { defaultValue: "Evaluation report" }), badge: headerClaimBadge }, /* @__PURE__ */ React317.createElement(Stack211, { gap: "xs" }, model.recommendation && /* @__PURE__ */ React317.createElement(Group116, { gap: "xs", align: "center" }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.flowManager.recommendation", { defaultValue: "Recommendation" })), /* @__PURE__ */ React317.createElement(Badge53, { variant: "light", color: recommendationColor(model.recommendation), size: "sm" }, model.recommendation)), model.completeness && /* @__PURE__ */ React317.createElement(Stack211, { gap: 2 }, (model.completeness.answered !== null || model.completeness.total !== null) && /* @__PURE__ */ React317.createElement(Text199, { size: "sm" }, t("actionTypes.evaluateClaim.flow.flowManager.completeness", {
|
|
34277
34299
|
answered: model.completeness.answered ?? "?",
|
|
34278
34300
|
total: model.completeness.total ?? "?",
|
|
34279
34301
|
defaultValue: `Completeness: ${model.completeness.answered ?? "?"}/${model.completeness.total ?? "?"} answered`
|
|
34280
34302
|
})), model.completeness.missingRequired.length > 0 && /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.flowManager.missingRequired", {
|
|
34281
34303
|
fields: model.completeness.missingRequired.join(", "),
|
|
34282
34304
|
defaultValue: `Missing required: ${model.completeness.missingRequired.join(", ")}`
|
|
34283
|
-
}))), model.findings.length > 0 && /* @__PURE__ */ React317.createElement(Stack211, { gap: 4 }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.flowManager.findings", { defaultValue: "Findings" })), model.findings.map((finding, index) => /* @__PURE__ */ React317.createElement(
|
|
34305
|
+
}))), model.findings.length > 0 && /* @__PURE__ */ React317.createElement(Stack211, { gap: 4 }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.flowManager.findings", { defaultValue: "Findings" })), model.findings.map((finding, index) => /* @__PURE__ */ React317.createElement(Group116, { key: `${finding.severity}-${finding.issue}-${index}`, gap: "xs", align: "flex-start", wrap: "nowrap" }, finding.severity && /* @__PURE__ */ React317.createElement(Badge53, { variant: "light", color: findingSeverityColor(finding.severity), size: "sm", style: { flexShrink: 0 } }, finding.severity), /* @__PURE__ */ React317.createElement(Text199, { size: "sm", style: { flex: 1, minWidth: 0 } }, finding.issue)))), model.rationale && /* @__PURE__ */ React317.createElement(Group116, { gap: "xs", align: "flex-start", wrap: "nowrap" }, /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed", style: { flexShrink: 0 } }, t("actionTypes.evaluateClaim.flow.flowManager.rationale", { defaultValue: "Rationale" })), /* @__PURE__ */ React317.createElement(Text199, { size: "sm", style: { flex: 1, minWidth: 0 } }, model.rationale)), model.narrative && /* @__PURE__ */ React317.createElement(Text199, { size: "sm", c: "dimmed" }, model.narrative), /* @__PURE__ */ React317.createElement(Text199, { size: "xs", c: "dimmed", title: model.invocationId }, t("actionTypes.evaluateClaim.flow.flowManager.reportAttribution", {
|
|
34284
34306
|
oracleDid: model.oracleDid,
|
|
34285
34307
|
receivedAt: new Date(model.receivedAt).toLocaleString(),
|
|
34286
34308
|
defaultValue: `By ${model.oracleDid} \xB7 ${new Date(model.receivedAt).toLocaleString()}`
|
|
@@ -34288,13 +34310,13 @@ var EvaluationReportSection = ({ runtime, selectedClaimId }) => {
|
|
|
34288
34310
|
};
|
|
34289
34311
|
|
|
34290
34312
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/ClaimAttachments.tsx
|
|
34291
|
-
import React319, { useCallback as useCallback112, useEffect as useEffect114, useMemo as
|
|
34292
|
-
import { Box as Box61, Group as
|
|
34313
|
+
import React319, { useCallback as useCallback112, useEffect as useEffect114, useMemo as useMemo119, useRef as useRef44, useState as useState168 } from "react";
|
|
34314
|
+
import { Box as Box61, Group as Group118, Loader as Loader63, SimpleGrid as SimpleGrid4, Stack as Stack213, Text as Text201, Tooltip as Tooltip31, UnstyledButton as UnstyledButton4 } from "@mantine/core";
|
|
34293
34315
|
import { IconFile as IconFile5, IconFileText as IconFileText6, IconMusic, IconPhoto as IconPhoto5, IconVideo } from "@tabler/icons-react";
|
|
34294
34316
|
|
|
34295
34317
|
// src/mantine/components/MediaPreviewModal.tsx
|
|
34296
34318
|
import React318 from "react";
|
|
34297
|
-
import { Anchor, Box as Box60, Center as Center13, Group as
|
|
34319
|
+
import { Anchor, Box as Box60, Center as Center13, Group as Group117, Modal as Modal3, Stack as Stack212, Text as Text200 } from "@mantine/core";
|
|
34298
34320
|
import { useMediaQuery as useMediaQuery2 } from "@mantine/hooks";
|
|
34299
34321
|
import { IconDownload as IconDownload4 } from "@tabler/icons-react";
|
|
34300
34322
|
function detectKind(type, name) {
|
|
@@ -34318,7 +34340,7 @@ var MediaPreviewModal = ({ file, onClose }) => {
|
|
|
34318
34340
|
onClose,
|
|
34319
34341
|
zIndex: 1e4,
|
|
34320
34342
|
portalProps: typeof document !== "undefined" ? { target: document.body } : void 0,
|
|
34321
|
-
title: /* @__PURE__ */ React318.createElement(
|
|
34343
|
+
title: /* @__PURE__ */ React318.createElement(Group117, { gap: "sm", wrap: "nowrap", style: { width: "100%" } }, /* @__PURE__ */ React318.createElement(Text200, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, file?.name || "Preview"), file && /* @__PURE__ */ React318.createElement(Anchor, { href: file.content, target: "_blank", rel: "noopener noreferrer", download: file.name, size: "xs", c: "dimmed", style: { flexShrink: 0 } }, /* @__PURE__ */ React318.createElement(Box60, { style: { display: "inline-flex", alignItems: "center", gap: 4 } }, icon(IconDownload4, 14), "Download"))),
|
|
34322
34344
|
size: wide ? "95vw" : "xl",
|
|
34323
34345
|
centered: true,
|
|
34324
34346
|
styles: wide ? {
|
|
@@ -34438,7 +34460,7 @@ var ClaimAttachments = ({ surveyModel, credentialSubject, entityDid }) => {
|
|
|
34438
34460
|
},
|
|
34439
34461
|
[fetchClaimMedia, entityDid]
|
|
34440
34462
|
);
|
|
34441
|
-
const items =
|
|
34463
|
+
const items = useMemo119(() => {
|
|
34442
34464
|
if (!credentialSubject || typeof credentialSubject !== "object") return [];
|
|
34443
34465
|
const questionTitles = /* @__PURE__ */ new Map();
|
|
34444
34466
|
const fileQuestionNames = /* @__PURE__ */ new Set();
|
|
@@ -34504,7 +34526,7 @@ var ClaimAttachments = ({ surveyModel, credentialSubject, entityDid }) => {
|
|
|
34504
34526
|
const showImage = isImage(item);
|
|
34505
34527
|
const displayUrl = resolved[item.content] || (!fetchClaimMedia ? item.content : "");
|
|
34506
34528
|
const isFetching = !!pending[item.content] || openingKey === item.content;
|
|
34507
|
-
return /* @__PURE__ */ React319.createElement(
|
|
34529
|
+
return /* @__PURE__ */ React319.createElement(Tooltip31, { key: `${item.content}-${index}`, label: item.label, openDelay: 400, disabled: !item.label || item.label === item.name }, /* @__PURE__ */ React319.createElement(
|
|
34508
34530
|
UnstyledButton4,
|
|
34509
34531
|
{
|
|
34510
34532
|
onClick: () => handleOpen(item),
|
|
@@ -34538,7 +34560,7 @@ var ClaimAttachments = ({ surveyModel, credentialSubject, entityDid }) => {
|
|
|
34538
34560
|
}
|
|
34539
34561
|
}
|
|
34540
34562
|
) : isFetching ? /* @__PURE__ */ React319.createElement(Loader63, { size: "sm" }) : icon(IconCmp, 28)
|
|
34541
|
-
), /* @__PURE__ */ React319.createElement(
|
|
34563
|
+
), /* @__PURE__ */ React319.createElement(Group118, { gap: 6, p: 8, wrap: "nowrap" }, icon(IconCmp, 14), /* @__PURE__ */ React319.createElement(Text201, { size: "xs", truncate: true, style: { flex: 1 } }, item.name)))
|
|
34542
34564
|
));
|
|
34543
34565
|
})), /* @__PURE__ */ React319.createElement(MediaPreviewModal, { file: active, onClose: () => setActive(null) }));
|
|
34544
34566
|
};
|
|
@@ -34602,8 +34624,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
34602
34624
|
useEffect115(() => {
|
|
34603
34625
|
handlersRef.current = handlers;
|
|
34604
34626
|
}, [handlers]);
|
|
34605
|
-
const services =
|
|
34606
|
-
const actorDid =
|
|
34627
|
+
const services = useMemo120(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
34628
|
+
const actorDid = useMemo120(() => {
|
|
34607
34629
|
try {
|
|
34608
34630
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
34609
34631
|
} catch {
|
|
@@ -34611,9 +34633,9 @@ var EvaluateClaimFlowDetail = ({
|
|
|
34611
34633
|
}
|
|
34612
34634
|
}, [handlers]);
|
|
34613
34635
|
const [nodeContext, setNodeContextOverride] = useNodeContext(editor, block?.id ?? "");
|
|
34614
|
-
const parsed =
|
|
34636
|
+
const parsed = useMemo120(() => parseEvaluateClaimActionInputs(inputs), [inputs]);
|
|
34615
34637
|
const editorDocument = editor?.document || [];
|
|
34616
|
-
const resolveOpts =
|
|
34638
|
+
const resolveOpts = useMemo120(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
34617
34639
|
const deedDid = resolveReferences(parsed.deedDid, editorDocument, resolveOpts).trim();
|
|
34618
34640
|
const collectionId = resolveReferences(parsed.collectionId, editorDocument, resolveOpts).trim();
|
|
34619
34641
|
const [claims, setClaims] = useState169([]);
|
|
@@ -34645,12 +34667,12 @@ var EvaluateClaimFlowDetail = ({
|
|
|
34645
34667
|
const [loadingDispute] = useState169(false);
|
|
34646
34668
|
const [evaluationOutcomePatch] = useState169(null);
|
|
34647
34669
|
const [evaluationAmount] = useState169(null);
|
|
34648
|
-
const selectedClaim =
|
|
34649
|
-
const filteredClaims =
|
|
34670
|
+
const selectedClaim = useMemo120(() => claims.find((claim) => claim.claimId === selectedClaimId) || null, [claims, selectedClaimId]);
|
|
34671
|
+
const filteredClaims = useMemo120(() => {
|
|
34650
34672
|
if (activeFilter === "all") return claims;
|
|
34651
34673
|
return claims.filter((claim) => getClaimStatusInfo(claim).key === activeFilter);
|
|
34652
34674
|
}, [claims, activeFilter]);
|
|
34653
|
-
const resolvedCredentialSubject =
|
|
34675
|
+
const resolvedCredentialSubject = useMemo120(() => {
|
|
34654
34676
|
const cs = claimData?.credentialSubject ?? claimData;
|
|
34655
34677
|
if (!cs || typeof cs !== "object") return cs;
|
|
34656
34678
|
return resolveFilesInCredentialSubject(cs);
|
|
@@ -34693,7 +34715,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
34693
34715
|
}
|
|
34694
34716
|
};
|
|
34695
34717
|
}, [handlers.fetchClaimMedia, deedDid]);
|
|
34696
|
-
const surveyModel =
|
|
34718
|
+
const surveyModel = useMemo120(() => {
|
|
34697
34719
|
if (!surveyJson || !claimData) return null;
|
|
34698
34720
|
const model = new SurveyModel11(surveyJson);
|
|
34699
34721
|
model.applyTheme(surveyTheme);
|
|
@@ -34756,7 +34778,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
34756
34778
|
model.data = resolvedCredentialSubject;
|
|
34757
34779
|
return model;
|
|
34758
34780
|
}, [surveyJson, claimData, resolvedCredentialSubject, deedDid, handlers.fetchClaimMedia]);
|
|
34759
|
-
const outcomeSurveyModel =
|
|
34781
|
+
const outcomeSurveyModel = useMemo120(() => {
|
|
34760
34782
|
if (!outcomeTemplateJson) return null;
|
|
34761
34783
|
const model = new SurveyModel11(outcomeTemplateJson);
|
|
34762
34784
|
model.applyTheme(surveyTheme);
|
|
@@ -34967,7 +34989,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
34967
34989
|
};
|
|
34968
34990
|
}).filter((entry) => !!entry);
|
|
34969
34991
|
}, [paymentRows]);
|
|
34970
|
-
const isClaimAlreadyEvaluated =
|
|
34992
|
+
const isClaimAlreadyEvaluated = useMemo120(() => {
|
|
34971
34993
|
return selectedClaim ? isClaimEvaluated(selectedClaim) : false;
|
|
34972
34994
|
}, [selectedClaim]);
|
|
34973
34995
|
const outcomeNotReady = Boolean(outcomeTemplateJson && !outcomeComplete);
|
|
@@ -35116,7 +35138,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
35116
35138
|
const selectedClaimProfile = profilesByDid[selectedClaim.agentDid];
|
|
35117
35139
|
const selectedDisplayName = selectedClaimProfile?.displayname || selectedClaim.agentDid || selectedClaim.agentAddress;
|
|
35118
35140
|
const selectedAvatarLabel = (selectedClaimProfile?.displayname || selectedClaim.agentDid || selectedClaim.agentAddress || "?")[0]?.toUpperCase();
|
|
35119
|
-
return /* @__PURE__ */ React320.createElement(Stack214, { gap: "md" }, /* @__PURE__ */ React320.createElement(
|
|
35141
|
+
return /* @__PURE__ */ React320.createElement(Stack214, { gap: "md" }, /* @__PURE__ */ React320.createElement(Group119, { gap: "xs", align: "center" }, /* @__PURE__ */ React320.createElement(ActionIcon47, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedClaimId("") }, /* @__PURE__ */ React320.createElement(IconArrowLeft11, { size: 16 })), /* @__PURE__ */ React320.createElement(Text202, { fw: 500, size: "sm", title: selectedClaim.claimId }, t("actionTypes.claim.flow.claimNumber", { id: truncateId2(selectedClaim.claimId), defaultValue: `Claim #${truncateId2(selectedClaim.claimId)}` }))), /* @__PURE__ */ React320.createElement(Group119, { gap: 16, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React320.createElement(
|
|
35120
35142
|
Box62,
|
|
35121
35143
|
{
|
|
35122
35144
|
style: {
|
|
@@ -35137,17 +35159,17 @@ var EvaluateClaimFlowDetail = ({
|
|
|
35137
35159
|
}
|
|
35138
35160
|
},
|
|
35139
35161
|
selectedClaimProfile?.avatarUrl ? null : selectedAvatarLabel
|
|
35140
|
-
), /* @__PURE__ */ React320.createElement(Stack214, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React320.createElement(Text202, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed", truncate: true }, truncateAddress5(selectedClaim.agentAddress))), /* @__PURE__ */ React320.createElement(Stack214, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React320.createElement(Text202, { fw: 500, size: "md", c: claimStatus.color }, claimStatus.key === "approved" && /* @__PURE__ */ React320.createElement(IconCheck26, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), claimStatus.label), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, getTimeAgo4(selectedClaim.submissionDate || "")))), claimStatus.key === "disputed" && /* @__PURE__ */ React320.createElement(Alert74, { color: "orange", title: t("actionTypes.claim.flow.disputed.title", { defaultValue: "Claim disputed" }), styles: actionAlertStyles }, loadingDispute ? /* @__PURE__ */ React320.createElement(
|
|
35162
|
+
), /* @__PURE__ */ React320.createElement(Stack214, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React320.createElement(Text202, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed", truncate: true }, truncateAddress5(selectedClaim.agentAddress))), /* @__PURE__ */ React320.createElement(Stack214, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React320.createElement(Text202, { fw: 500, size: "md", c: claimStatus.color }, claimStatus.key === "approved" && /* @__PURE__ */ React320.createElement(IconCheck26, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), claimStatus.label), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, getTimeAgo4(selectedClaim.submissionDate || "")))), claimStatus.key === "disputed" && /* @__PURE__ */ React320.createElement(Alert74, { color: "orange", title: t("actionTypes.claim.flow.disputed.title", { defaultValue: "Claim disputed" }), styles: actionAlertStyles }, loadingDispute ? /* @__PURE__ */ React320.createElement(Group119, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Loader64, { size: "xs" }), /* @__PURE__ */ React320.createElement(Text202, { size: "xs" }, t("actionTypes.claim.flow.disputed.loadingDetails", { defaultValue: "Loading dispute details\u2026" }))) : disputeDetails ? /* @__PURE__ */ React320.createElement(Stack214, { gap: 6 }, disputeDetails.reason ? /* @__PURE__ */ React320.createElement(Text202, { size: "sm" }, disputeDetails.reason) : /* @__PURE__ */ React320.createElement(Text202, { size: "sm", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.disputed.noMessageAttached", { defaultValue: "A dispute was recorded but no message was attached." })), (disputeDetails.evaluatorDid || disputeDetails.disputedAt) && /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, disputeDetails.evaluatorDid ? t("actionTypes.claim.flow.disputed.byEvaluator", {
|
|
35141
35163
|
address: truncateAddress5(disputeDetails.evaluatorDid),
|
|
35142
35164
|
defaultValue: `By ${truncateAddress5(disputeDetails.evaluatorDid)}`
|
|
35143
|
-
}) : "", disputeDetails.evaluatorDid && disputeDetails.disputedAt ? " \xB7 " : "", disputeDetails.disputedAt ? new Date(disputeDetails.disputedAt).toLocaleString() : ""), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.disputed.amendNeeded", { defaultValue: "The submitter needs to amend and resubmit before this claim can be evaluated." }))) : typeof handlers.getClaimDisputeDetails !== "function" ? /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.unavailable", { defaultValue: "Dispute details unavailable in this environment." })) : /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noRecord", { defaultValue: "No dispute record found on-chain for this claim." }))), /* @__PURE__ */ React320.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.submission", { defaultValue: "Submission" }) }, surveyLoading ? /* @__PURE__ */ React320.createElement(
|
|
35165
|
+
}) : "", disputeDetails.evaluatorDid && disputeDetails.disputedAt ? " \xB7 " : "", disputeDetails.disputedAt ? new Date(disputeDetails.disputedAt).toLocaleString() : ""), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.disputed.amendNeeded", { defaultValue: "The submitter needs to amend and resubmit before this claim can be evaluated." }))) : typeof handlers.getClaimDisputeDetails !== "function" ? /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.unavailable", { defaultValue: "Dispute details unavailable in this environment." })) : /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noRecord", { defaultValue: "No dispute record found on-chain for this claim." }))), /* @__PURE__ */ React320.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.submission", { defaultValue: "Submission" }) }, surveyLoading ? /* @__PURE__ */ React320.createElement(Group119, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Loader64, { size: "xs" }), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.loadingSubmissionDetails", { defaultValue: "Loading submission details..." }))) : surveyModel ? /* @__PURE__ */ React320.createElement(ScrollArea8, { h: 280 }, /* @__PURE__ */ React320.createElement(StableSurvey, { model: surveyModel })) : /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.noSubmissionTemplate", { defaultValue: "No submission template/data available." }))), /* @__PURE__ */ React320.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.attachments", { defaultValue: "Attachments" }) }, /* @__PURE__ */ React320.createElement(ClaimAttachments, { surveyModel, credentialSubject: resolvedCredentialSubject, entityDid: deedDid })), /* @__PURE__ */ React320.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.aiEvaluation", { defaultValue: "AI Evaluation" }) }, evaluationLoading ? /* @__PURE__ */ React320.createElement(Group119, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Loader64, { size: "xs" }), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.runningRubric", { defaultValue: "Running rubric evaluation..." }))) : evaluationResult ? /* @__PURE__ */ React320.createElement(ScrollArea8, { h: 280 }, /* @__PURE__ */ React320.createElement(RubricEvaluationResults, { evaluation: evaluationResult })) : /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.noRubric", { defaultValue: "No rubric evaluation available for this claim." }))), flowManagerContext, /* @__PURE__ */ React320.createElement(EvaluationReportSection, { runtime, selectedClaimId: selectedClaim.claimId }), parsed.xeroOracleInvoiceOnApprove && /* @__PURE__ */ React320.createElement(CollapsibleSection, { title: "Xero work", defaultOpen: false }, /* @__PURE__ */ React320.createElement(Alert74, { color: "blue", variant: "light", p: "xs" }, /* @__PURE__ */ React320.createElement(Text202, { size: "xs" }, "Approving this claim queues a Xero invoice work item. The contracted Xero oracle creates a draft invoice from the claim material \u2014 no Xero side effects run in the browser."))), (outcomeTemplateLoading || outcomeTemplateJson) && /* @__PURE__ */ React320.createElement(
|
|
35144
35166
|
CollapsibleSection,
|
|
35145
35167
|
{
|
|
35146
35168
|
title: t("actionTypes.evaluateClaim.flow.section.outcome", { defaultValue: "Outcome" }),
|
|
35147
35169
|
defaultOpen: true,
|
|
35148
35170
|
badge: /* @__PURE__ */ React320.createElement(React320.Fragment, null, outcomeTemplateJson && !outcomeComplete && !isClaimAlreadyEvaluated && /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "yellow" }, t("actionTypes.evaluateClaim.flow.outcome.requiredBadge", { defaultValue: "(required)" })), (outcomeComplete || isClaimAlreadyEvaluated) && /* @__PURE__ */ React320.createElement(IconCheck26, { size: 14, color: "var(--mantine-color-green-6)" }))
|
|
35149
35171
|
},
|
|
35150
|
-
outcomeTemplateLoading ? /* @__PURE__ */ React320.createElement(
|
|
35172
|
+
outcomeTemplateLoading ? /* @__PURE__ */ React320.createElement(Group119, { gap: "xs" }, /* @__PURE__ */ React320.createElement(Loader64, { size: "xs" }), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.outcome.loading", { defaultValue: "Loading evaluation template..." }))) : outcomeSurveyModel ? /* @__PURE__ */ React320.createElement(ScrollArea8, { h: 320 }, /* @__PURE__ */ React320.createElement(StableSurvey, { model: outcomeSurveyModel })) : /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.outcome.noTemplate", { defaultValue: "No evaluation template available." }))
|
|
35151
35173
|
), !isClaimAlreadyEvaluated && /* @__PURE__ */ React320.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.evaluation", { defaultValue: "Evaluation" }), defaultOpen: true }, /* @__PURE__ */ React320.createElement(Stack214, { gap: "md" }, /* @__PURE__ */ React320.createElement(Divider23, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), decision === "dispute" ? /* @__PURE__ */ React320.createElement(Stack214, { gap: "md" }, /* @__PURE__ */ React320.createElement(
|
|
35152
35174
|
BaseTextArea,
|
|
35153
35175
|
{
|
|
@@ -35161,7 +35183,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
35161
35183
|
required: true,
|
|
35162
35184
|
disabled: isDisabled || submitting || isClaimAlreadyEvaluated
|
|
35163
35185
|
}
|
|
35164
|
-
)) : /* @__PURE__ */ React320.createElement(React320.Fragment, null, /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.payment.label", { defaultValue: "Payment (optional custom payouts)" })), paymentRows.map((row, index) => /* @__PURE__ */ React320.createElement(Stack214, { key: row.id, gap: 8 }, /* @__PURE__ */ React320.createElement(
|
|
35186
|
+
)) : /* @__PURE__ */ React320.createElement(React320.Fragment, null, /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.payment.label", { defaultValue: "Payment (optional custom payouts)" })), paymentRows.map((row, index) => /* @__PURE__ */ React320.createElement(Stack214, { key: row.id, gap: 8 }, /* @__PURE__ */ React320.createElement(Group119, { justify: "space-between", align: "center" }, /* @__PURE__ */ React320.createElement(Text202, { size: "sm" }, t("actionTypes.evaluateClaim.flow.payment.token", { index: index + 1, defaultValue: `Token ${index + 1}` })), paymentRows.length > 1 && /* @__PURE__ */ React320.createElement(Button69, { variant: "subtle", size: "compact-xs", color: "red", onClick: () => removePaymentRow(row.id), disabled: isDisabled || submitting }, t("actionTypes.evaluateClaim.flow.payment.remove", { defaultValue: "Remove" }))), /* @__PURE__ */ React320.createElement(
|
|
35165
35187
|
BaseSelect,
|
|
35166
35188
|
{
|
|
35167
35189
|
value: row.denom,
|
|
@@ -35228,7 +35250,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
35228
35250
|
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
35229
35251
|
did: "DID",
|
|
35230
35252
|
claimCollection: "claim collection"
|
|
35231
|
-
})) : /* @__PURE__ */ React320.createElement(React320.Fragment, null, flowManagerContext, /* @__PURE__ */ React320.createElement(EvaluationReportSection, { runtime }), /* @__PURE__ */ React320.createElement(
|
|
35253
|
+
})) : /* @__PURE__ */ React320.createElement(React320.Fragment, null, flowManagerContext, /* @__PURE__ */ React320.createElement(EvaluationReportSection, { runtime }), /* @__PURE__ */ React320.createElement(Group119, { justify: "space-between", align: "center" }, /* @__PURE__ */ React320.createElement(Group119, { gap: 0 }, filterTabs.map((tab) => /* @__PURE__ */ React320.createElement(
|
|
35232
35254
|
UnstyledButton5,
|
|
35233
35255
|
{
|
|
35234
35256
|
key: tab.value,
|
|
@@ -35242,12 +35264,12 @@ var EvaluateClaimFlowDetail = ({
|
|
|
35242
35264
|
}
|
|
35243
35265
|
},
|
|
35244
35266
|
/* @__PURE__ */ React320.createElement(Text202, { size: "sm", fw: 500, c: activeFilter === tab.value ? "var(--mantine-color-text)" : "dimmed" }, tab.label)
|
|
35245
|
-
))), /* @__PURE__ */ React320.createElement(ActionIcon47, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React320.createElement(IconFilter2, { size: 16 }))), loadingClaims && /* @__PURE__ */ React320.createElement(
|
|
35267
|
+
))), /* @__PURE__ */ React320.createElement(ActionIcon47, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React320.createElement(IconFilter2, { size: 16 }))), loadingClaims && /* @__PURE__ */ React320.createElement(Group119, { gap: "xs", justify: "center", py: "md" }, /* @__PURE__ */ React320.createElement(Loader64, { size: "xs" }), /* @__PURE__ */ React320.createElement(Text202, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.loadingClaims", { defaultValue: "Loading claims..." }))), !loadingClaims && filteredClaims.length === 0 && /* @__PURE__ */ React320.createElement(Text202, { size: "sm", c: "dimmed", ta: "center", py: "md" }, claims.length === 0 ? t("actionTypes.evaluateClaim.flow.empty.allCollections", { defaultValue: "No claims available for this collection." }) : t("actionTypes.evaluateClaim.flow.empty.filtered", { filter: activeFilter, defaultValue: `No ${activeFilter} claims found.` })), filteredClaims.length > 0 && /* @__PURE__ */ React320.createElement(Stack214, { gap: 12 }, filteredClaims.map((claim) => {
|
|
35246
35268
|
const status = getClaimStatusInfo(claim);
|
|
35247
35269
|
const profile = profilesByDid[claim.agentDid];
|
|
35248
35270
|
const displayName = profile?.displayname || claim.agentDid || claim.agentAddress;
|
|
35249
35271
|
const avatarLabel = (profile?.displayname || claim.agentDid || claim.agentAddress || "?")[0]?.toUpperCase();
|
|
35250
|
-
return /* @__PURE__ */ React320.createElement(ListItemContainer, { key: claim.claimId, isChecked: false, onClick: () => setSelectedClaimId(claim.claimId) }, /* @__PURE__ */ React320.createElement(
|
|
35272
|
+
return /* @__PURE__ */ React320.createElement(ListItemContainer, { key: claim.claimId, isChecked: false, onClick: () => setSelectedClaimId(claim.claimId) }, /* @__PURE__ */ React320.createElement(Group119, { gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React320.createElement(
|
|
35251
35273
|
Box62,
|
|
35252
35274
|
{
|
|
35253
35275
|
style: {
|
|
@@ -35431,16 +35453,16 @@ var ProposalCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
35431
35453
|
};
|
|
35432
35454
|
|
|
35433
35455
|
// src/mantine/blocks/action/actionTypes/proposalCreate/ProposalCreateFlowDetail.tsx
|
|
35434
|
-
import React322, { useCallback as useCallback115, useEffect as useEffect117, useMemo as
|
|
35435
|
-
import { Alert as Alert75, Badge as Badge54, Button as Button70, Card as Card29, Group as
|
|
35456
|
+
import React322, { useCallback as useCallback115, useEffect as useEffect117, useMemo as useMemo122, useState as useState171 } from "react";
|
|
35457
|
+
import { Alert as Alert75, Badge as Badge54, Button as Button70, Card as Card29, Group as Group120, Loader as Loader66, Stack as Stack216, Text as Text204 } from "@mantine/core";
|
|
35436
35458
|
import { IconPlus as IconPlus9, IconPlayerPlay as IconPlayerPlay7 } from "@tabler/icons-react";
|
|
35437
35459
|
|
|
35438
35460
|
// src/mantine/blocks/action/hooks/useResolvedInputs.ts
|
|
35439
|
-
import { useMemo as
|
|
35461
|
+
import { useMemo as useMemo121 } from "react";
|
|
35440
35462
|
function useResolvedInputs(editor, inputs, spec, blockId) {
|
|
35441
35463
|
const editorDocument = editor?.document || [];
|
|
35442
35464
|
const yRuntime = editor?._yRuntime;
|
|
35443
|
-
const parsed =
|
|
35465
|
+
const parsed = useMemo121(() => {
|
|
35444
35466
|
if (!inputs) return {};
|
|
35445
35467
|
try {
|
|
35446
35468
|
const value = JSON.parse(inputs);
|
|
@@ -35449,7 +35471,7 @@ function useResolvedInputs(editor, inputs, spec, blockId) {
|
|
|
35449
35471
|
return {};
|
|
35450
35472
|
}
|
|
35451
35473
|
}, [inputs]);
|
|
35452
|
-
return
|
|
35474
|
+
return useMemo121(() => {
|
|
35453
35475
|
const unresolved = [];
|
|
35454
35476
|
const options = { yRuntime, warnContext: blockId ? `block ${blockId}` : void 0 };
|
|
35455
35477
|
const resolveField = (raw) => {
|
|
@@ -35501,7 +35523,7 @@ var statusColor2 = {
|
|
|
35501
35523
|
};
|
|
35502
35524
|
var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
35503
35525
|
const handlers = useBlocknoteHandlers();
|
|
35504
|
-
const parsed =
|
|
35526
|
+
const parsed = useMemo122(() => parseProposalCreateInputs(inputs), [inputs]);
|
|
35505
35527
|
const { resolvedInputs } = useResolvedInputs(editor, inputs, { fields: ["coreAddress", "proposalTitle", "proposalDescription"] }, block?.id);
|
|
35506
35528
|
const coreAddress = resolvedInputs.coreAddress;
|
|
35507
35529
|
const proposalTitle = resolvedInputs.proposalTitle;
|
|
@@ -35641,7 +35663,7 @@ var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
35641
35663
|
border: `1px solid ${statusColor2[currentStatus] || "var(--mantine-color-neutralColor-5)"}`
|
|
35642
35664
|
}
|
|
35643
35665
|
},
|
|
35644
|
-
/* @__PURE__ */ React322.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React322.createElement(
|
|
35666
|
+
/* @__PURE__ */ React322.createElement(Stack216, { gap: "xs" }, /* @__PURE__ */ React322.createElement(Group120, { justify: "space-between" }, /* @__PURE__ */ React322.createElement(Text204, { size: "sm", fw: 500, style: { color: "var(--mantine-color-text)" } }, "Proposal #", proposalId), /* @__PURE__ */ React322.createElement(Badge54, { color: statusColor2[currentStatus], variant: "filled", size: "sm", radius: "sm" }, currentStatus.replace(/_/g, " ").toUpperCase())), proposalTitle && /* @__PURE__ */ React322.createElement(Text204, { size: "sm", style: { color: "var(--mantine-color-dimmed)" } }, proposalTitle))
|
|
35645
35667
|
), isProposalCreated && /* @__PURE__ */ React322.createElement(Card29, { padding: "md", radius: "md", withBorder: true, style: { borderColor: "var(--mantine-color-green-6)" } }, /* @__PURE__ */ React322.createElement(Text204, { fw: 500, size: "sm", c: "green" }, "Proposal Created Successfully"), /* @__PURE__ */ React322.createElement(Text204, { size: "sm", c: "dimmed" }, "Your proposal has been created and is now open for voting.")), currentStatus === "passed" && /* @__PURE__ */ React322.createElement(
|
|
35646
35668
|
Button70,
|
|
35647
35669
|
{
|
|
@@ -35664,7 +35686,7 @@ var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
35664
35686
|
loading: isCreating
|
|
35665
35687
|
},
|
|
35666
35688
|
"Create Proposal"
|
|
35667
|
-
)), isFetching && /* @__PURE__ */ React322.createElement(
|
|
35689
|
+
)), isFetching && /* @__PURE__ */ React322.createElement(Group120, { gap: "xs" }, /* @__PURE__ */ React322.createElement(Loader66, { size: "xs" }), /* @__PURE__ */ React322.createElement(Text204, { size: "xs", c: "dimmed" }, "Fetching proposal status...")), error && /* @__PURE__ */ React322.createElement(Alert75, { color: "red", styles: actionAlertStyles }, error), fetchError && /* @__PURE__ */ React322.createElement(Alert75, { color: "red", styles: actionAlertStyles }, typeof fetchError === "string" ? fetchError : "Failed to fetch proposal data"), runtime.error?.message && /* @__PURE__ */ React322.createElement(Alert75, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
35668
35690
|
};
|
|
35669
35691
|
|
|
35670
35692
|
// src/mantine/blocks/action/actionTypes/proposalCreate/index.ts
|
|
@@ -35818,8 +35840,8 @@ var ProposalVoteConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
35818
35840
|
};
|
|
35819
35841
|
|
|
35820
35842
|
// src/mantine/blocks/action/actionTypes/proposalVote/ProposalVoteFlowDetail.tsx
|
|
35821
|
-
import React324, { useCallback as useCallback117, useEffect as useEffect119, useMemo as
|
|
35822
|
-
import { Alert as Alert76, Box as Box63, Button as Button71, Card as Card30, Group as
|
|
35843
|
+
import React324, { useCallback as useCallback117, useEffect as useEffect119, useMemo as useMemo123, useState as useState173 } from "react";
|
|
35844
|
+
import { Alert as Alert76, Box as Box63, Button as Button71, Card as Card30, Group as Group121, Progress as Progress5, Stack as Stack218, Text as Text206, Tooltip as Tooltip32 } from "@mantine/core";
|
|
35823
35845
|
var getVoteIcon2 = (voteType) => {
|
|
35824
35846
|
switch (voteType) {
|
|
35825
35847
|
case "yes":
|
|
@@ -35834,9 +35856,9 @@ var getVoteIcon2 = (voteType) => {
|
|
|
35834
35856
|
};
|
|
35835
35857
|
var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, isDisabled, executeAction }) => {
|
|
35836
35858
|
const handlers = useBlocknoteHandlers();
|
|
35837
|
-
const parsed =
|
|
35859
|
+
const parsed = useMemo123(() => parseProposalVoteInputs(inputs), [inputs]);
|
|
35838
35860
|
const editorDocument = editor?.document || [];
|
|
35839
|
-
const resolveOpts =
|
|
35861
|
+
const resolveOpts = useMemo123(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
35840
35862
|
const proposalId = resolveReferences(parsed.proposalId, editorDocument, resolveOpts).trim();
|
|
35841
35863
|
const coreAddress = resolveReferences(parsed.coreAddress, editorDocument, resolveOpts).trim();
|
|
35842
35864
|
const inputContractAddress = resolveReferences(parsed.proposalContractAddress, editorDocument, resolveOpts).trim();
|
|
@@ -35936,7 +35958,7 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, isDisabled, exec
|
|
|
35936
35958
|
color: "var(--mantine-color-text)"
|
|
35937
35959
|
}
|
|
35938
35960
|
},
|
|
35939
|
-
/* @__PURE__ */ React324.createElement(
|
|
35961
|
+
/* @__PURE__ */ React324.createElement(Group121, { gap: "xs", align: "center" }, /* @__PURE__ */ React324.createElement(
|
|
35940
35962
|
Box63,
|
|
35941
35963
|
{
|
|
35942
35964
|
style: {
|
|
@@ -35960,7 +35982,7 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, isDisabled, exec
|
|
|
35960
35982
|
opacity: !hasSubmittedProposal ? 0.6 : 1
|
|
35961
35983
|
}
|
|
35962
35984
|
},
|
|
35963
|
-
/* @__PURE__ */ React324.createElement(Stack218, { gap: "xs" }, /* @__PURE__ */ React324.createElement(
|
|
35985
|
+
/* @__PURE__ */ React324.createElement(Stack218, { gap: "xs" }, /* @__PURE__ */ React324.createElement(Group121, { justify: "space-between" }, /* @__PURE__ */ React324.createElement(Group121, { gap: "xs" }, /* @__PURE__ */ React324.createElement(
|
|
35964
35986
|
Box63,
|
|
35965
35987
|
{
|
|
35966
35988
|
w: 8,
|
|
@@ -35970,9 +35992,9 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, isDisabled, exec
|
|
|
35970
35992
|
borderRadius: "50%"
|
|
35971
35993
|
}
|
|
35972
35994
|
}
|
|
35973
|
-
), /* @__PURE__ */ React324.createElement(Text206, { size: "sm", style: { color: "var(--mantine-color-dimmed)" } }, "Proposal ID")), /* @__PURE__ */ React324.createElement(Text206, { size: "sm", fw: 500, style: { color: "var(--mantine-color-text)" } }, hasSubmittedProposal ? `#${proposalId}` : "TBD")), /* @__PURE__ */ React324.createElement(
|
|
35995
|
+
), /* @__PURE__ */ React324.createElement(Text206, { size: "sm", style: { color: "var(--mantine-color-dimmed)" } }, "Proposal ID")), /* @__PURE__ */ React324.createElement(Text206, { size: "sm", fw: 500, style: { color: "var(--mantine-color-text)" } }, hasSubmittedProposal ? `#${proposalId}` : "TBD")), /* @__PURE__ */ React324.createElement(Group121, { justify: "space-between" }, /* @__PURE__ */ React324.createElement(Group121, { gap: "xs" }, /* @__PURE__ */ React324.createElement(Box63, { w: 8, h: 8, style: { backgroundColor: "var(--mantine-color-dimmed)", borderRadius: "50%" } }), /* @__PURE__ */ React324.createElement(Text206, { size: "sm", style: { color: "var(--mantine-color-dimmed)" } }, "My Vote")), /* @__PURE__ */ React324.createElement(Text206, { size: "sm", fw: 500, style: { color: "var(--mantine-color-text)" } }, hasSubmittedProposal ? userVote?.vote ? userVote.vote.vote : "Pending" : "N/A"))),
|
|
35974
35996
|
/* @__PURE__ */ React324.createElement(Stack218, { gap: "xs", mt: "md" }, /* @__PURE__ */ React324.createElement(Text206, { size: "sm", style: { color: "var(--mantine-color-dimmed)" } }, hasSubmittedProposal ? "Voting is open" : "Voting pending"), /* @__PURE__ */ React324.createElement(Progress5, { value: hasSubmittedProposal ? 75 : 0, size: "md" }))
|
|
35975
|
-
), hasSubmittedProposal && proposalContractAddress && /* @__PURE__ */ React324.createElement(ProposalOverviewCard, { proposalContractAddress, proposalId }), hasSubmittedProposal && !hasVoted && /* @__PURE__ */ React324.createElement(Stack218, { gap: "lg" }, /* @__PURE__ */ React324.createElement(Stack218, { gap: "md" }, ["yes", "no", "abstain"].map((voteType) => /* @__PURE__ */ React324.createElement(
|
|
35997
|
+
), hasSubmittedProposal && proposalContractAddress && /* @__PURE__ */ React324.createElement(ProposalOverviewCard, { proposalContractAddress, proposalId }), hasSubmittedProposal && !hasVoted && /* @__PURE__ */ React324.createElement(Stack218, { gap: "lg" }, /* @__PURE__ */ React324.createElement(Stack218, { gap: "md" }, ["yes", "no", "abstain"].map((voteType) => /* @__PURE__ */ React324.createElement(Tooltip32, { key: voteType, label: isDisabled ? "Action is disabled" : void 0, disabled: !isDisabled, position: "top" }, /* @__PURE__ */ React324.createElement(
|
|
35976
35998
|
Button71,
|
|
35977
35999
|
{
|
|
35978
36000
|
variant: "outline",
|
|
@@ -36002,7 +36024,7 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, isDisabled, exec
|
|
|
36002
36024
|
disabled: isDisabled,
|
|
36003
36025
|
rows: 3
|
|
36004
36026
|
}
|
|
36005
|
-
)), !hasSubmittedProposal && /* @__PURE__ */ React324.createElement(Stack218, { gap: "md" }, ["yes", "no", "abstain"].map((voteType) => /* @__PURE__ */ React324.createElement(
|
|
36027
|
+
)), !hasSubmittedProposal && /* @__PURE__ */ React324.createElement(Stack218, { gap: "md" }, ["yes", "no", "abstain"].map((voteType) => /* @__PURE__ */ React324.createElement(Tooltip32, { key: voteType, label: "The proposal must be submitted before you can vote", position: "top" }, /* @__PURE__ */ React324.createElement(
|
|
36006
36028
|
Button71,
|
|
36007
36029
|
{
|
|
36008
36030
|
variant: "outline",
|
|
@@ -36048,7 +36070,7 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, isDisabled, exec
|
|
|
36048
36070
|
color: "var(--mantine-color-text)"
|
|
36049
36071
|
}
|
|
36050
36072
|
},
|
|
36051
|
-
/* @__PURE__ */ React324.createElement(Stack218, { gap: "xs" }, /* @__PURE__ */ React324.createElement(
|
|
36073
|
+
/* @__PURE__ */ React324.createElement(Stack218, { gap: "xs" }, /* @__PURE__ */ React324.createElement(Group121, { gap: "xs", align: "center" }, /* @__PURE__ */ React324.createElement(
|
|
36052
36074
|
Box63,
|
|
36053
36075
|
{
|
|
36054
36076
|
style: {
|
|
@@ -36075,7 +36097,7 @@ registerActionTypeUI("qi/proposal.vote", {
|
|
|
36075
36097
|
import { IconBolt as IconBolt12 } from "@tabler/icons-react";
|
|
36076
36098
|
|
|
36077
36099
|
// src/mantine/blocks/action/actionTypes/protocolSelect/ProtocolSelectConfig.tsx
|
|
36078
|
-
import React325, { useMemo as
|
|
36100
|
+
import React325, { useMemo as useMemo124, useState as useState174 } from "react";
|
|
36079
36101
|
import { Box as Box64, Pill as Pill3, PillsInput as PillsInput3, Stack as Stack219, Text as Text207 } from "@mantine/core";
|
|
36080
36102
|
function parseInputs2(json) {
|
|
36081
36103
|
try {
|
|
@@ -36088,7 +36110,7 @@ function parseInputs2(json) {
|
|
|
36088
36110
|
}
|
|
36089
36111
|
}
|
|
36090
36112
|
var ProtocolSelectConfig = ({ inputs, onInputsChange }) => {
|
|
36091
|
-
const local =
|
|
36113
|
+
const local = useMemo124(() => parseInputs2(inputs), [inputs]);
|
|
36092
36114
|
const [inputValue, setInputValue] = useState174("");
|
|
36093
36115
|
const update = (dids) => {
|
|
36094
36116
|
onInputsChange(JSON.stringify({ ...local, protocolDids: dids }));
|
|
@@ -36120,8 +36142,8 @@ var ProtocolSelectConfig = ({ inputs, onInputsChange }) => {
|
|
|
36120
36142
|
};
|
|
36121
36143
|
|
|
36122
36144
|
// src/mantine/blocks/action/actionTypes/protocolSelect/ProtocolSelectFlowDetail.tsx
|
|
36123
|
-
import React326, { useCallback as useCallback118, useEffect as useEffect120, useMemo as
|
|
36124
|
-
import { Box as Box65, Group as
|
|
36145
|
+
import React326, { useCallback as useCallback118, useEffect as useEffect120, useMemo as useMemo125, useState as useState175 } from "react";
|
|
36146
|
+
import { Box as Box65, Group as Group122, Loader as Loader68, Stack as Stack220, Text as Text208 } from "@mantine/core";
|
|
36125
36147
|
function parseInputs3(json) {
|
|
36126
36148
|
try {
|
|
36127
36149
|
const parsed = typeof json === "string" ? JSON.parse(json) : json;
|
|
@@ -36134,7 +36156,7 @@ function parseInputs3(json) {
|
|
|
36134
36156
|
}
|
|
36135
36157
|
var ProtocolSelectFlowDetail = ({ inputs, block, runtime, isDisabled, executeAction }) => {
|
|
36136
36158
|
const handlers = useBlocknoteHandlers();
|
|
36137
|
-
const { protocolDids } =
|
|
36159
|
+
const { protocolDids } = useMemo125(() => parseInputs3(inputs), [inputs]);
|
|
36138
36160
|
const [protocols, setProtocols] = useState175([]);
|
|
36139
36161
|
const selectedDid = runtime.output?.selectedProtocolDid;
|
|
36140
36162
|
useEffect120(() => {
|
|
@@ -36218,7 +36240,7 @@ var ProtocolSelectFlowDetail = ({ inputs, block, runtime, isDisabled, executeAct
|
|
|
36218
36240
|
transition: "all 0.15s ease"
|
|
36219
36241
|
}
|
|
36220
36242
|
},
|
|
36221
|
-
/* @__PURE__ */ React326.createElement(
|
|
36243
|
+
/* @__PURE__ */ React326.createElement(Group122, { wrap: "nowrap", gap: "md", align: "center" }, protocol.loading ? /* @__PURE__ */ React326.createElement(Loader68, { size: "xs" }) : /* @__PURE__ */ React326.createElement(EntityAvatar_default, { size: 24 }), /* @__PURE__ */ React326.createElement(Stack220, { gap: 2, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React326.createElement(Text208, { fw: 500, size: "sm", lineClamp: 1 }, protocol.loading ? "Loading..." : protocol.type), /* @__PURE__ */ React326.createElement(Text208, { size: "xs", c: "dimmed", lineClamp: 2 }, protocol.loading ? "Fetching protocol info..." : protocol.description || protocol.did)))
|
|
36222
36244
|
);
|
|
36223
36245
|
}));
|
|
36224
36246
|
};
|
|
@@ -36291,8 +36313,8 @@ var DomainSignConfig = ({ inputs, onInputsChange }) => {
|
|
|
36291
36313
|
};
|
|
36292
36314
|
|
|
36293
36315
|
// src/mantine/blocks/action/actionTypes/domainSign/DomainSignFlowDetail.tsx
|
|
36294
|
-
import React328, { useCallback as useCallback120, useEffect as useEffect122, useMemo as
|
|
36295
|
-
import { Alert as Alert77, Button as Button72, Group as
|
|
36316
|
+
import React328, { useCallback as useCallback120, useEffect as useEffect122, useMemo as useMemo126, useState as useState177 } from "react";
|
|
36317
|
+
import { Alert as Alert77, Button as Button72, Group as Group123, Loader as Loader69, Stack as Stack222, Text as Text210 } from "@mantine/core";
|
|
36296
36318
|
import { IconCheck as IconCheck27, IconAlertCircle as IconAlertCircle29, IconExternalLink as IconExternalLink2 } from "@tabler/icons-react";
|
|
36297
36319
|
var STEP_LABELS = {
|
|
36298
36320
|
creating: "Creating domain entity...",
|
|
@@ -36316,18 +36338,18 @@ var DomainSignFlowDetail = ({
|
|
|
36316
36338
|
executeAction
|
|
36317
36339
|
}) => {
|
|
36318
36340
|
const handlers = useBlocknoteHandlers();
|
|
36319
|
-
const parsed =
|
|
36341
|
+
const parsed = useMemo126(() => parseDomainSignInputs(inputs), [inputs]);
|
|
36320
36342
|
const editorDocument = editor?.document || [];
|
|
36321
|
-
const resolveOpts =
|
|
36343
|
+
const resolveOpts = useMemo126(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
36322
36344
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim();
|
|
36323
|
-
const pendingPayload =
|
|
36345
|
+
const pendingPayload = useMemo126(() => {
|
|
36324
36346
|
if (!activePendingInvocation) return runtime.pendingPayload;
|
|
36325
36347
|
return {
|
|
36326
36348
|
...activePendingInvocation.payload || {},
|
|
36327
36349
|
...activePendingInvocation.refSnapshots || {}
|
|
36328
36350
|
};
|
|
36329
36351
|
}, [activePendingInvocation, runtime.pendingPayload]);
|
|
36330
|
-
const domainCardData =
|
|
36352
|
+
const domainCardData = useMemo126(() => {
|
|
36331
36353
|
try {
|
|
36332
36354
|
const raw = pendingPayload?.domainCardData;
|
|
36333
36355
|
if (!raw) return null;
|
|
@@ -36345,7 +36367,7 @@ var DomainSignFlowDetail = ({
|
|
|
36345
36367
|
const [activeStep, setActiveStep] = useState177("");
|
|
36346
36368
|
const [isSigning, setIsSigning] = useState177(false);
|
|
36347
36369
|
const [localError, setLocalError] = useState177(null);
|
|
36348
|
-
const domainSignCheckpoint =
|
|
36370
|
+
const domainSignCheckpoint = useMemo126(() => {
|
|
36349
36371
|
const bucket = runtime.cache?.domainSign;
|
|
36350
36372
|
if (!bucket || typeof bucket !== "object") return null;
|
|
36351
36373
|
const key = activePendingInvocation?.id || "manual";
|
|
@@ -36457,11 +36479,11 @@ var DomainSignFlowDetail = ({
|
|
|
36457
36479
|
handlers.redirectToEntityOverview(entityDid, resolvedEntityType);
|
|
36458
36480
|
}
|
|
36459
36481
|
}, [entityDid, resolvedEntityType, handlers]);
|
|
36460
|
-
return /* @__PURE__ */ React328.createElement(Stack222, { gap: "md" }, /* @__PURE__ */ React328.createElement(Stack222, { gap: 2 }, /* @__PURE__ */ React328.createElement(Text210, { fw: 600 }, block?.props?.title || "Sign Domain Card"), /* @__PURE__ */ React328.createElement(Text210, { size: "sm", c: "dimmed" }, block?.props?.description || "Sign the domain card credential and create a domain entity on-chain.")), !domainCardData ? /* @__PURE__ */ React328.createElement(Alert77, { color: "yellow", styles: actionAlertStyles }, "No domain card data available. The domain card viewer block must push data to this action before it can run.") : /* @__PURE__ */ React328.createElement(React328.Fragment, null, /* @__PURE__ */ React328.createElement(Stack222, { gap: "xs", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React328.createElement(Text210, { fw: 600, size: "sm" }, "Domain Card Summary"), /* @__PURE__ */ React328.createElement(
|
|
36482
|
+
return /* @__PURE__ */ React328.createElement(Stack222, { gap: "md" }, /* @__PURE__ */ React328.createElement(Stack222, { gap: 2 }, /* @__PURE__ */ React328.createElement(Text210, { fw: 600 }, block?.props?.title || "Sign Domain Card"), /* @__PURE__ */ React328.createElement(Text210, { size: "sm", c: "dimmed" }, block?.props?.description || "Sign the domain card credential and create a domain entity on-chain.")), !domainCardData ? /* @__PURE__ */ React328.createElement(Alert77, { color: "yellow", styles: actionAlertStyles }, "No domain card data available. The domain card viewer block must push data to this action before it can run.") : /* @__PURE__ */ React328.createElement(React328.Fragment, null, /* @__PURE__ */ React328.createElement(Stack222, { gap: "xs", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React328.createElement(Text210, { fw: 600, size: "sm" }, "Domain Card Summary"), /* @__PURE__ */ React328.createElement(Group123, { gap: "xs" }, /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { width: 80 } }, "Name:"), /* @__PURE__ */ React328.createElement(Text210, { size: "xs" }, domainName || "Not set")), /* @__PURE__ */ React328.createElement(Group123, { gap: "xs" }, /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { width: 80 } }, "Type:"), /* @__PURE__ */ React328.createElement(Text210, { size: "xs" }, resolvedEntityType)), domainDescription && /* @__PURE__ */ React328.createElement(Group123, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { width: 80 } }, "Description:"), /* @__PURE__ */ React328.createElement(Text210, { size: "xs", lineClamp: 2, style: { flex: 1 } }, domainDescription)), selectedTemplateCount > 0 && /* @__PURE__ */ React328.createElement(Group123, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { width: 80 } }, "Templates:"), /* @__PURE__ */ React328.createElement(Text210, { size: "xs" }, selectedTemplateCount, " selected across ", selectedTemplateProtocolCount, " protocol deed", selectedTemplateProtocolCount === 1 ? "" : "s"))), isRunning && /* @__PURE__ */ React328.createElement(Stack222, { gap: "xs" }, FLOW_STEPS.map((step) => {
|
|
36461
36483
|
const isActive = activeStep === step;
|
|
36462
36484
|
const isDone = FLOW_STEPS.indexOf(step) < FLOW_STEPS.indexOf(activeStep);
|
|
36463
|
-
return /* @__PURE__ */ React328.createElement(
|
|
36464
|
-
})), isCompleted && /* @__PURE__ */ React328.createElement(Alert77, { icon: /* @__PURE__ */ React328.createElement(IconCheck27, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React328.createElement(Stack222, { gap: "xs" }, /* @__PURE__ */ React328.createElement(Text210, { size: "sm" }, "The domain card has been signed and the entity has been created on-chain."), entityDid && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "POD DID: ", entityDid), governanceGroupCoreAddress && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Group core address: ", governanceGroupCoreAddress), transactionHash && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Transaction hash: ", transactionHash), linkedResourceTransactionHash && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Linked resource transaction hash: ", linkedResourceTransactionHash), protocolTemplateImports.length > 0 && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed" }, "Imported templates: ", protocolTemplateImports.reduce((count, result) => count + (Array.isArray(result.imported) ? result.imported.length : 0), 0)))), isCompleted && entityDid && handlers?.redirectToEntityOverview && /* @__PURE__ */ React328.createElement(Button72, { variant: "outline", leftSection: /* @__PURE__ */ React328.createElement(IconExternalLink2, { size: 14 }), onClick: handleVisitEntity }, "Visit Entity"), !isCompleted && /* @__PURE__ */ React328.createElement(Button72, { fullWidth: true, onClick: handleSign, disabled: isDisabled || isRunning, loading: isRunning }, isRunning ? "Processing..." : "Sign & Create Domain"), isFailed && /* @__PURE__ */ React328.createElement(
|
|
36485
|
+
return /* @__PURE__ */ React328.createElement(Group123, { key: step, gap: "xs" }, isDone ? /* @__PURE__ */ React328.createElement(IconCheck27, { size: 14, color: "var(--mantine-color-green-5)" }) : isActive ? /* @__PURE__ */ React328.createElement(Loader69, { size: 14 }) : /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { width: 14 } }, "\u2013"), /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: isActive ? void 0 : "dimmed" }, STEP_LABELS[step]));
|
|
36486
|
+
})), isCompleted && /* @__PURE__ */ React328.createElement(Alert77, { icon: /* @__PURE__ */ React328.createElement(IconCheck27, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React328.createElement(Stack222, { gap: "xs" }, /* @__PURE__ */ React328.createElement(Text210, { size: "sm" }, "The domain card has been signed and the entity has been created on-chain."), entityDid && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "POD DID: ", entityDid), governanceGroupCoreAddress && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Group core address: ", governanceGroupCoreAddress), transactionHash && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Transaction hash: ", transactionHash), linkedResourceTransactionHash && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Linked resource transaction hash: ", linkedResourceTransactionHash), protocolTemplateImports.length > 0 && /* @__PURE__ */ React328.createElement(Text210, { size: "xs", c: "dimmed" }, "Imported templates: ", protocolTemplateImports.reduce((count, result) => count + (Array.isArray(result.imported) ? result.imported.length : 0), 0)))), isCompleted && entityDid && handlers?.redirectToEntityOverview && /* @__PURE__ */ React328.createElement(Button72, { variant: "outline", leftSection: /* @__PURE__ */ React328.createElement(IconExternalLink2, { size: 14 }), onClick: handleVisitEntity }, "Visit Entity"), !isCompleted && /* @__PURE__ */ React328.createElement(Button72, { fullWidth: true, onClick: handleSign, disabled: isDisabled || isRunning, loading: isRunning }, isRunning ? "Processing..." : "Sign & Create Domain"), isFailed && /* @__PURE__ */ React328.createElement(Group123, null, /* @__PURE__ */ React328.createElement(Button72, { variant: "outline", onClick: handleRetry }, "Try Again"))), errorMessage && /* @__PURE__ */ React328.createElement(Alert77, { icon: /* @__PURE__ */ React328.createElement(IconAlertCircle29, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage));
|
|
36465
36487
|
};
|
|
36466
36488
|
|
|
36467
36489
|
// src/mantine/blocks/action/actionTypes/domainSign/index.ts
|
|
@@ -36556,8 +36578,8 @@ var DomainCardPreviewConfig = ({ inputs, onInputsChange }) => {
|
|
|
36556
36578
|
};
|
|
36557
36579
|
|
|
36558
36580
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/DomainCardPreviewFlowDetail.tsx
|
|
36559
|
-
import React330, { useCallback as useCallback122, useMemo as
|
|
36560
|
-
import { Alert as Alert78, Badge as Badge55, Box as Box66, Button as Button73, Code as Code12, Group as
|
|
36581
|
+
import React330, { useCallback as useCallback122, useMemo as useMemo127, useState as useState179 } from "react";
|
|
36582
|
+
import { Alert as Alert78, Badge as Badge55, Box as Box66, Button as Button73, Code as Code12, Group as Group124, Loader as Loader70, ScrollArea as ScrollArea9, Stack as Stack224, Text as Text212 } from "@mantine/core";
|
|
36561
36583
|
import { IconAlertCircle as IconAlertCircle30, IconCheck as IconCheck28, IconSparkles as IconSparkles8 } from "@tabler/icons-react";
|
|
36562
36584
|
var JsonViewer2 = ({ data }) => /* @__PURE__ */ React330.createElement(ScrollArea9.Autosize, { mah: 360, offsetScrollbars: true }, /* @__PURE__ */ React330.createElement(Stack224, { gap: "md" }, data.name && /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Name"), /* @__PURE__ */ React330.createElement(Text212, { size: "lg", fw: 600 }, data.name)), data.summary && /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Summary"), /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, data.summary)), data.description && /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Description"), /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, data.description)), data.entity_type && data.entity_type.length > 0 && /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Type"), /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, data.entity_type.join(", "))), data.keywords && data.keywords.length > 0 && /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Keywords"), /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, data.keywords.join(", "))), data.faq && data.faq.length > 0 && /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "FAQ"), /* @__PURE__ */ React330.createElement(Stack224, { gap: "sm" }, data.faq.map((item, index) => /* @__PURE__ */ React330.createElement(Box66, { key: index, p: "sm", style: { borderRadius: 8, backgroundColor: "var(--mantine-color-dark-6)" } }, /* @__PURE__ */ React330.createElement(Text212, { size: "sm", fw: 500, mb: 4 }, item.question), /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed" }, item.answer))))), /* @__PURE__ */ React330.createElement(Box66, null, /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "Raw Data"), /* @__PURE__ */ React330.createElement(Code12, { block: true, style: { fontSize: 11, maxHeight: 200, overflow: "auto" } }, JSON.stringify(data, null, 2)))));
|
|
36563
36585
|
var STATUS_BADGE = {
|
|
@@ -36584,21 +36606,21 @@ var DomainCardPreviewFlowDetail = ({ inputs, editor, block, runtime, isDisabled,
|
|
|
36584
36606
|
const handlers = useBlocknoteHandlers();
|
|
36585
36607
|
const [isAskingCompanion, setIsAskingCompanion] = useState179(false);
|
|
36586
36608
|
const [companionError, setCompanionError] = useState179(null);
|
|
36587
|
-
const parsed =
|
|
36609
|
+
const parsed = useMemo127(() => parseDomainCardPreviewInputs(inputs), [inputs]);
|
|
36588
36610
|
const editorDocument = editor?.document || [];
|
|
36589
|
-
const resolveOpts =
|
|
36590
|
-
const upstreamCardData =
|
|
36611
|
+
const resolveOpts = useMemo127(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
36612
|
+
const upstreamCardData = useMemo127(() => {
|
|
36591
36613
|
if (!parsed.domainCardData) return void 0;
|
|
36592
36614
|
const resolved = resolveReferences(parsed.domainCardData, editorDocument, resolveOpts);
|
|
36593
36615
|
return coerce(resolved, void 0);
|
|
36594
36616
|
}, [parsed.domainCardData, editorDocument, resolveOpts]);
|
|
36595
|
-
const inputsPreview =
|
|
36596
|
-
const inputsCardData =
|
|
36617
|
+
const inputsPreview = useMemo127(() => buildPreviewFromInputs(parsed), [parsed]);
|
|
36618
|
+
const inputsCardData = useMemo127(() => buildCardDataFromInputs(parsed), [parsed]);
|
|
36597
36619
|
const loadingMessage = runtime.output?.loadingMessage || "Agents are analyzing your domain information...";
|
|
36598
36620
|
const errorMessage = runtime.output?.errorMessage || "An error occurred while generating the domain data.";
|
|
36599
36621
|
const domainPreviewData = coerce(runtime.output?.domainPreviewData, null) || inputsPreview;
|
|
36600
36622
|
const domainCardData = coerce(runtime.output?.domainCardData, upstreamCardData) || inputsCardData;
|
|
36601
|
-
const status =
|
|
36623
|
+
const status = useMemo127(() => {
|
|
36602
36624
|
const runtimeStatus = runtime.output?.status;
|
|
36603
36625
|
if (runtimeStatus) return runtimeStatus;
|
|
36604
36626
|
if (domainPreviewData || domainCardData) return "ready";
|
|
@@ -36641,7 +36663,7 @@ var DomainCardPreviewFlowDetail = ({ inputs, editor, block, runtime, isDisabled,
|
|
|
36641
36663
|
setCompanionError(outcome.error || "Failed to approve domain card.");
|
|
36642
36664
|
}
|
|
36643
36665
|
}, [isDisabled, domainCardData, executeAction, domainPreviewData, runtime.output]);
|
|
36644
|
-
return /* @__PURE__ */ React330.createElement(Stack224, { gap: "md" }, /* @__PURE__ */ React330.createElement(Stack224, { gap: 2 }, /* @__PURE__ */ React330.createElement(
|
|
36666
|
+
return /* @__PURE__ */ React330.createElement(Stack224, { gap: "md" }, /* @__PURE__ */ React330.createElement(Stack224, { gap: 2 }, /* @__PURE__ */ React330.createElement(Group124, { gap: "xs", align: "center" }, /* @__PURE__ */ React330.createElement(Text212, { fw: 600 }, block?.props?.title || "Preview Domain Card"), /* @__PURE__ */ React330.createElement(Badge55, { size: "xs", variant: "filled", color: badge.color }, badge.text)), /* @__PURE__ */ React330.createElement(Text212, { size: "sm", c: "dimmed" }, block?.props?.description || "Review the oracle-enriched domain card before signing.")), status === "loading" && /* @__PURE__ */ React330.createElement(Stack224, { align: "center", py: "lg", gap: "md" }, /* @__PURE__ */ React330.createElement(Loader70, { size: "lg", color: "blue" }), /* @__PURE__ */ React330.createElement(Stack224, { align: "center", gap: "xs" }, /* @__PURE__ */ React330.createElement(IconSparkles8, { size: 22, color: "var(--mantine-color-blue-5)" }), /* @__PURE__ */ React330.createElement(Text212, { size: "sm", c: "dimmed", ta: "center" }, loadingMessage))), status === "error" && /* @__PURE__ */ React330.createElement(Alert78, { icon: /* @__PURE__ */ React330.createElement(IconAlertCircle30, { size: 16 }), title: "Preview error", color: "red", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React330.createElement(Stack224, { gap: "xs" }, /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, errorMessage), /* @__PURE__ */ React330.createElement(Text212, { size: "xs", c: "dimmed" }, "Ask the oracle agent to regenerate, or rebuild the card upstream."))), (status === "ready" || status === "approved") && hasPreview && domainPreviewData && /* @__PURE__ */ React330.createElement(Box66, { p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, domainCardRenderer ? domainCardRenderer(domainPreviewData) : /* @__PURE__ */ React330.createElement(JsonViewer2, { data: domainPreviewData })), (status === "ready" || status === "approved") && !hasPreview && domainCardData && /* @__PURE__ */ React330.createElement(Alert78, { color: "yellow", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, "No human-facing preview was published by the oracle. You can still approve the underlying card, but consider asking the oracle agent to publish", " ", /* @__PURE__ */ React330.createElement("code", null, "domainPreviewData"), ".")), status === "pending" && /* @__PURE__ */ React330.createElement(Stack224, { gap: "sm" }, /* @__PURE__ */ React330.createElement(Alert78, { color: "gray", variant: "light", styles: actionAlertStyles }, /* @__PURE__ */ React330.createElement(Text212, { size: "sm" }, "No preview yet. Ask companion to generate a domain card and gather the setup details.")), /* @__PURE__ */ React330.createElement(
|
|
36645
36667
|
Button73,
|
|
36646
36668
|
{
|
|
36647
36669
|
leftSection: isAskingCompanion ? /* @__PURE__ */ React330.createElement(Loader70, { size: 14 }) : /* @__PURE__ */ React330.createElement(IconSparkles8, { size: 16 }),
|
|
@@ -36717,14 +36739,14 @@ var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
36717
36739
|
};
|
|
36718
36740
|
|
|
36719
36741
|
// src/mantine/blocks/action/actionTypes/oracle/OracleFlowDetail.tsx
|
|
36720
|
-
import React332, { useCallback as useCallback124, useMemo as
|
|
36742
|
+
import React332, { useCallback as useCallback124, useMemo as useMemo128, useState as useState181 } from "react";
|
|
36721
36743
|
import { Alert as Alert79, Button as Button74, Stack as Stack226 } from "@mantine/core";
|
|
36722
36744
|
import { IconCheck as IconCheck29, IconAlertCircle as IconAlertCircle31, IconSparkles as IconSparkles9 } from "@tabler/icons-react";
|
|
36723
36745
|
var OracleFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisabled }) => {
|
|
36724
36746
|
const handlers = useBlocknoteHandlers();
|
|
36725
|
-
const parsed =
|
|
36747
|
+
const parsed = useMemo128(() => parseOracleInputs(inputs), [inputs]);
|
|
36726
36748
|
const editorDocument = editor?.document || [];
|
|
36727
|
-
const resolveOpts =
|
|
36749
|
+
const resolveOpts = useMemo128(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
36728
36750
|
const resolvedPrompt = resolveReferences(parsed.prompt, editorDocument, resolveOpts).trim();
|
|
36729
36751
|
const [isLoading, setIsLoading] = useState181(false);
|
|
36730
36752
|
const [error, setError] = useState181(null);
|
|
@@ -36821,7 +36843,7 @@ var OraclePromptConfig = ({ inputs, onInputsChange }) => {
|
|
|
36821
36843
|
};
|
|
36822
36844
|
|
|
36823
36845
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptFlowDetail.tsx
|
|
36824
|
-
import React334, { useCallback as useCallback126, useMemo as
|
|
36846
|
+
import React334, { useCallback as useCallback126, useMemo as useMemo129, useState as useState183 } from "react";
|
|
36825
36847
|
import { Alert as Alert80, Loader as Loader71, Stack as Stack228, Text as Text213 } from "@mantine/core";
|
|
36826
36848
|
import { IconSend as IconSend8 } from "@tabler/icons-react";
|
|
36827
36849
|
function parsePrimarySkill(rawSkill) {
|
|
@@ -36861,10 +36883,10 @@ function buildFinalPrompt(prompt, skill) {
|
|
|
36861
36883
|
}
|
|
36862
36884
|
var OraclePromptFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled }) => {
|
|
36863
36885
|
const handlers = useBlocknoteHandlers();
|
|
36864
|
-
const parsed =
|
|
36886
|
+
const parsed = useMemo129(() => parseOraclePromptInputs(inputs), [inputs]);
|
|
36865
36887
|
const editorDocument = editor?.document || [];
|
|
36866
|
-
const resolveOpts =
|
|
36867
|
-
const resolvedPrompt =
|
|
36888
|
+
const resolveOpts = useMemo129(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
36889
|
+
const resolvedPrompt = useMemo129(() => resolveReferences(parsed.prompt || "", editorDocument, resolveOpts).trim(), [parsed.prompt, editorDocument, resolveOpts]);
|
|
36868
36890
|
const [submitting, setSubmitting] = useState183(false);
|
|
36869
36891
|
const [error, setError] = useState183(null);
|
|
36870
36892
|
const handleExecute = useCallback126(async () => {
|
|
@@ -36985,7 +37007,7 @@ var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
|
36985
37007
|
};
|
|
36986
37008
|
|
|
36987
37009
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitFlowDetail.tsx
|
|
36988
|
-
import React336, { useCallback as useCallback128, useEffect as useEffect127, useMemo as
|
|
37010
|
+
import React336, { useCallback as useCallback128, useEffect as useEffect127, useMemo as useMemo130, useState as useState185 } from "react";
|
|
36989
37011
|
import { Alert as Alert81, Loader as Loader72, Stack as Stack230, Text as Text215 } from "@mantine/core";
|
|
36990
37012
|
import { SurveyModel as SurveyModel12 } from "@ixo/surveys";
|
|
36991
37013
|
function parsePrimarySkill2(rawSkill) {
|
|
@@ -37034,13 +37056,13 @@ ${answersJson}`
|
|
|
37034
37056
|
}
|
|
37035
37057
|
var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, isDisabled, executeAction }) => {
|
|
37036
37058
|
const handlers = useBlocknoteHandlers();
|
|
37037
|
-
const parsed =
|
|
37059
|
+
const parsed = useMemo130(() => parseFormSubmitActionInputs(inputs), [inputs]);
|
|
37038
37060
|
const editorDocument = editor?.document || [];
|
|
37039
|
-
const resolveOpts =
|
|
37040
|
-
const resolvedSchemaString =
|
|
37061
|
+
const resolveOpts = useMemo130(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
37062
|
+
const resolvedSchemaString = useMemo130(() => resolveReferences(parsed.surveySchema || "", editorDocument, resolveOpts).trim(), [parsed.surveySchema, editorDocument, resolveOpts]);
|
|
37041
37063
|
const [submitting, setSubmitting] = useState185(false);
|
|
37042
37064
|
const [error, setError] = useState185(null);
|
|
37043
|
-
const parsedSchema =
|
|
37065
|
+
const parsedSchema = useMemo130(() => {
|
|
37044
37066
|
if (!resolvedSchemaString) return null;
|
|
37045
37067
|
try {
|
|
37046
37068
|
const schema = JSON.parse(resolvedSchemaString);
|
|
@@ -37052,7 +37074,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, isDisabled, execut
|
|
|
37052
37074
|
}, [resolvedSchemaString]);
|
|
37053
37075
|
const isCompleted = runtime.state === "completed";
|
|
37054
37076
|
const savedAnswers = isCompleted && runtime.output?.answers && typeof runtime.output.answers === "object" ? runtime.output.answers : null;
|
|
37055
|
-
const surveyModel =
|
|
37077
|
+
const surveyModel = useMemo130(() => {
|
|
37056
37078
|
if (!parsedSchema) return null;
|
|
37057
37079
|
const model = new SurveyModel12(parsedSchema);
|
|
37058
37080
|
model.applyTheme(surveyTheme);
|
|
@@ -37214,7 +37236,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
37214
37236
|
};
|
|
37215
37237
|
|
|
37216
37238
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreFlowDetail.tsx
|
|
37217
|
-
import React338, { useCallback as useCallback130, useMemo as
|
|
37239
|
+
import React338, { useCallback as useCallback130, useMemo as useMemo131, useState as useState187 } from "react";
|
|
37218
37240
|
import { Alert as Alert82, Button as Button75, Code as Code13, Loader as Loader73, Stack as Stack232, Text as Text217 } from "@mantine/core";
|
|
37219
37241
|
import { IconShieldCheck as IconShieldCheck17 } from "@tabler/icons-react";
|
|
37220
37242
|
function safeParse(value) {
|
|
@@ -37230,7 +37252,7 @@ function safeParse(value) {
|
|
|
37230
37252
|
return result;
|
|
37231
37253
|
}
|
|
37232
37254
|
function CredentialPreview({ value }) {
|
|
37233
|
-
const display =
|
|
37255
|
+
const display = useMemo131(() => {
|
|
37234
37256
|
if (!value) return null;
|
|
37235
37257
|
const parsed = safeParse(value);
|
|
37236
37258
|
if (parsed && typeof parsed === "object") {
|
|
@@ -37242,15 +37264,15 @@ function CredentialPreview({ value }) {
|
|
|
37242
37264
|
return /* @__PURE__ */ React338.createElement(React338.Fragment, null, /* @__PURE__ */ React338.createElement(Text217, { size: "xs", fw: 600, c: "dimmed" }, "Credential"), /* @__PURE__ */ React338.createElement(Code13, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, display));
|
|
37243
37265
|
}
|
|
37244
37266
|
var CredentialStoreFlowDetail = ({ inputs, editor, runtime, isDisabled, executeAction }) => {
|
|
37245
|
-
const parsed =
|
|
37267
|
+
const parsed = useMemo131(() => parseCredentialStoreInputs(inputs), [inputs]);
|
|
37246
37268
|
const editorDocument = editor?.document || [];
|
|
37247
|
-
const resolveOpts =
|
|
37248
|
-
const resolvedCredentialKey =
|
|
37269
|
+
const resolveOpts = useMemo131(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
37270
|
+
const resolvedCredentialKey = useMemo131(
|
|
37249
37271
|
() => resolveReferences(parsed.credentialKey || "", editorDocument, resolveOpts).trim(),
|
|
37250
37272
|
[parsed.credentialKey, editorDocument, resolveOpts]
|
|
37251
37273
|
);
|
|
37252
|
-
const resolvedCredential =
|
|
37253
|
-
const resolvedRoomId =
|
|
37274
|
+
const resolvedCredential = useMemo131(() => resolveReferences(parsed.credential || "", editorDocument, resolveOpts).trim(), [parsed.credential, editorDocument, resolveOpts]);
|
|
37275
|
+
const resolvedRoomId = useMemo131(() => resolveReferences(parsed.roomId || "", editorDocument, resolveOpts).trim(), [parsed.roomId, editorDocument, resolveOpts]);
|
|
37254
37276
|
const [submitting, setSubmitting] = useState187(false);
|
|
37255
37277
|
const [error, setError] = useState187(null);
|
|
37256
37278
|
const hasCredential = !!resolvedCredential;
|
|
@@ -37298,7 +37320,7 @@ registerActionTypeUI("qi/credential.store", {
|
|
|
37298
37320
|
import { IconMessageCircle } from "@tabler/icons-react";
|
|
37299
37321
|
|
|
37300
37322
|
// src/mantine/blocks/action/actionTypes/matrixDm/MatrixDmConfig.tsx
|
|
37301
|
-
import React339, { useCallback as useCallback131, useEffect as useEffect129, useMemo as
|
|
37323
|
+
import React339, { useCallback as useCallback131, useEffect as useEffect129, useMemo as useMemo132, useState as useState188 } from "react";
|
|
37302
37324
|
import { Flex as Flex38, Stack as Stack233, Text as Text218 } from "@mantine/core";
|
|
37303
37325
|
|
|
37304
37326
|
// src/mantine/blocks/action/actionTypes/matrixDm/types.ts
|
|
@@ -37350,13 +37372,13 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
37350
37372
|
},
|
|
37351
37373
|
[local, onInputsChange]
|
|
37352
37374
|
);
|
|
37353
|
-
const selectData =
|
|
37375
|
+
const selectData = useMemo132(() => {
|
|
37354
37376
|
return roomMembers.map((member) => ({
|
|
37355
37377
|
value: member.did,
|
|
37356
37378
|
label: member.name || member.did
|
|
37357
37379
|
}));
|
|
37358
37380
|
}, [roomMembers]);
|
|
37359
|
-
const memberLookup =
|
|
37381
|
+
const memberLookup = useMemo132(() => {
|
|
37360
37382
|
const lookup = {};
|
|
37361
37383
|
roomMembers.forEach((member) => {
|
|
37362
37384
|
lookup[member.did] = member;
|
|
@@ -37415,14 +37437,14 @@ import React341, { useCallback as useCallback133, useEffect as useEffect131, use
|
|
|
37415
37437
|
import { Divider as Divider26, Stack as Stack235, Text as Text220 } from "@mantine/core";
|
|
37416
37438
|
|
|
37417
37439
|
// src/mantine/blocks/action/actionTypes/_shared/ConnectionSelector.tsx
|
|
37418
|
-
import React340, { useCallback as useCallback132, useEffect as useEffect130, useMemo as
|
|
37419
|
-
import { Alert as Alert83, Button as Button76, Group as
|
|
37440
|
+
import React340, { useCallback as useCallback132, useEffect as useEffect130, useMemo as useMemo133, useRef as useRef46, useState as useState189 } from "react";
|
|
37441
|
+
import { Alert as Alert83, Button as Button76, Group as Group125, Loader as Loader74, Stack as Stack234, Text as Text219 } from "@mantine/core";
|
|
37420
37442
|
import { IconPlug, IconRefresh as IconRefresh10 } from "@tabler/icons-react";
|
|
37421
37443
|
var POLL_INTERVAL_MS2 = 2e3;
|
|
37422
37444
|
var CONNECT_TIMEOUT_MS = 12e4;
|
|
37423
37445
|
var ConnectionSelector = ({ toolkit, toolkitLabel, value, onChange, disabled }) => {
|
|
37424
37446
|
const handlers = useBlocknoteHandlers();
|
|
37425
|
-
const entityDid =
|
|
37447
|
+
const entityDid = useMemo133(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
37426
37448
|
const [connections, setConnections] = useState189([]);
|
|
37427
37449
|
const [loading, setLoading] = useState189(false);
|
|
37428
37450
|
const [hasLoaded, setHasLoaded] = useState189(false);
|
|
@@ -37547,7 +37569,7 @@ var ConnectionSelector = ({ toolkit, toolkitLabel, value, onChange, disabled })
|
|
|
37547
37569
|
setError(err instanceof Error ? err.message : `Failed to start ${toolkitLabel} connection`);
|
|
37548
37570
|
}
|
|
37549
37571
|
}, [entityDid, handlers, loadConnections, onChange, toolkit, toolkitLabel]);
|
|
37550
|
-
const options =
|
|
37572
|
+
const options = useMemo133(
|
|
37551
37573
|
() => connections.map((c) => ({
|
|
37552
37574
|
value: c.connectedAccountId,
|
|
37553
37575
|
label: c.label ? `${c.label}${c.status === "ACTIVE" ? "" : ` (${c.status.toLowerCase()})`}` : `Connection ${c.connectedAccountId.slice(-6)}`
|
|
@@ -37555,7 +37577,7 @@ var ConnectionSelector = ({ toolkit, toolkitLabel, value, onChange, disabled })
|
|
|
37555
37577
|
[connections]
|
|
37556
37578
|
);
|
|
37557
37579
|
const mismatch = value && entityDid && value.entityDid && value.entityDid !== entityDid;
|
|
37558
|
-
return /* @__PURE__ */ React340.createElement(Stack234, { gap: "xs" }, /* @__PURE__ */ React340.createElement(
|
|
37580
|
+
return /* @__PURE__ */ React340.createElement(Stack234, { gap: "xs" }, /* @__PURE__ */ React340.createElement(Group125, { justify: "space-between", align: "flex-end" }, /* @__PURE__ */ React340.createElement(Text219, { size: "sm", fw: 600 }, toolkitLabel, " connection"), /* @__PURE__ */ React340.createElement(Button76, { size: "xs", variant: "subtle", leftSection: /* @__PURE__ */ React340.createElement(IconRefresh10, { size: 14 }), onClick: loadConnections, disabled: loading || disabled }, "Refresh")), mismatch && /* @__PURE__ */ React340.createElement(Alert83, { color: "yellow", styles: actionAlertStyles }, "This block was configured for a different workspace. Reconnect ", toolkitLabel, " to use it here."), /* @__PURE__ */ React340.createElement(
|
|
37559
37581
|
BaseSelect,
|
|
37560
37582
|
{
|
|
37561
37583
|
placeholder: loading ? `Loading ${toolkitLabel} connections...` : options.length ? `Select a ${toolkitLabel} connection` : hasLoaded ? `No ${toolkitLabel} connections yet` : `Refresh to load ${toolkitLabel} connections`,
|
|
@@ -37693,7 +37715,7 @@ var CalendarEventCreateConfig = ({ inputs, onInputsChange, editor, blockId }) =>
|
|
|
37693
37715
|
};
|
|
37694
37716
|
|
|
37695
37717
|
// src/mantine/blocks/action/actionTypes/calendar/eventCreate/CalendarEventCreateFlowDetail.tsx
|
|
37696
|
-
import React342, { useCallback as useCallback134, useEffect as useEffect132, useMemo as
|
|
37718
|
+
import React342, { useCallback as useCallback134, useEffect as useEffect132, useMemo as useMemo134, useState as useState191 } from "react";
|
|
37697
37719
|
import { Alert as Alert84, Anchor as Anchor2, Stack as Stack236, Text as Text221 } from "@mantine/core";
|
|
37698
37720
|
var CalendarEventCreateFlowDetail = ({
|
|
37699
37721
|
inputs,
|
|
@@ -37707,10 +37729,10 @@ var CalendarEventCreateFlowDetail = ({
|
|
|
37707
37729
|
executeAction
|
|
37708
37730
|
}) => {
|
|
37709
37731
|
const handlers = useBlocknoteHandlers();
|
|
37710
|
-
const entityDid =
|
|
37711
|
-
const parsed =
|
|
37732
|
+
const entityDid = useMemo134(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
37733
|
+
const parsed = useMemo134(() => parseCalendarEventCreateInputs(inputs), [inputs]);
|
|
37712
37734
|
const editorDocument = editor?.document || [];
|
|
37713
|
-
const resolveOpts =
|
|
37735
|
+
const resolveOpts = useMemo134(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
37714
37736
|
const resolve = useCallback134(
|
|
37715
37737
|
(field) => {
|
|
37716
37738
|
const v = parsed[field];
|
|
@@ -37980,7 +38002,7 @@ var CalendarEventUpdateConfig = ({ inputs, onInputsChange, editor, blockId }) =>
|
|
|
37980
38002
|
};
|
|
37981
38003
|
|
|
37982
38004
|
// src/mantine/blocks/action/actionTypes/calendar/eventUpdate/CalendarEventUpdateFlowDetail.tsx
|
|
37983
|
-
import React344, { useCallback as useCallback136, useEffect as useEffect134, useMemo as
|
|
38005
|
+
import React344, { useCallback as useCallback136, useEffect as useEffect134, useMemo as useMemo135, useState as useState193 } from "react";
|
|
37984
38006
|
import { Alert as Alert85, Anchor as Anchor3, Stack as Stack238, Text as Text223 } from "@mantine/core";
|
|
37985
38007
|
var CalendarEventUpdateFlowDetail = ({
|
|
37986
38008
|
inputs,
|
|
@@ -37994,10 +38016,10 @@ var CalendarEventUpdateFlowDetail = ({
|
|
|
37994
38016
|
executeAction
|
|
37995
38017
|
}) => {
|
|
37996
38018
|
const handlers = useBlocknoteHandlers();
|
|
37997
|
-
const entityDid =
|
|
37998
|
-
const parsed =
|
|
38019
|
+
const entityDid = useMemo135(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
38020
|
+
const parsed = useMemo135(() => parseCalendarEventUpdateInputs(inputs), [inputs]);
|
|
37999
38021
|
const editorDocument = editor?.document || [];
|
|
38000
|
-
const resolveOpts =
|
|
38022
|
+
const resolveOpts = useMemo135(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
38001
38023
|
const resolve = useCallback136(
|
|
38002
38024
|
(field) => {
|
|
38003
38025
|
const v = parsed[field];
|
|
@@ -38109,7 +38131,7 @@ import { IconCalendarStats } from "@tabler/icons-react";
|
|
|
38109
38131
|
|
|
38110
38132
|
// src/mantine/blocks/action/actionTypes/calendar/eventList/CalendarEventListConfig.tsx
|
|
38111
38133
|
import React345, { useCallback as useCallback137, useEffect as useEffect135, useState as useState194 } from "react";
|
|
38112
|
-
import { Divider as Divider28, Group as
|
|
38134
|
+
import { Divider as Divider28, Group as Group126, Stack as Stack239, Switch as Switch13, Text as Text224 } from "@mantine/core";
|
|
38113
38135
|
|
|
38114
38136
|
// src/core/lib/actionRegistry/actions/calendar/eventList.types.ts
|
|
38115
38137
|
var EMPTY3 = {
|
|
@@ -38202,7 +38224,7 @@ var CalendarEventListConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38202
38224
|
editorDocument,
|
|
38203
38225
|
currentBlockId: blockId
|
|
38204
38226
|
}
|
|
38205
|
-
), /* @__PURE__ */ React345.createElement(
|
|
38227
|
+
), /* @__PURE__ */ React345.createElement(Group126, { grow: true, align: "flex-end" }, /* @__PURE__ */ React345.createElement(
|
|
38206
38228
|
DataInput,
|
|
38207
38229
|
{
|
|
38208
38230
|
label: "Max results",
|
|
@@ -38227,13 +38249,13 @@ var CalendarEventListConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38227
38249
|
};
|
|
38228
38250
|
|
|
38229
38251
|
// src/mantine/blocks/action/actionTypes/calendar/eventList/CalendarEventListFlowDetail.tsx
|
|
38230
|
-
import React346, { useCallback as useCallback138, useMemo as
|
|
38252
|
+
import React346, { useCallback as useCallback138, useMemo as useMemo136, useState as useState195 } from "react";
|
|
38231
38253
|
import { Alert as Alert86, Badge as Badge56, Button as Button77, Loader as Loader75, Stack as Stack240 } from "@mantine/core";
|
|
38232
38254
|
import { IconRefresh as IconRefresh11 } from "@tabler/icons-react";
|
|
38233
38255
|
var CalendarEventListFlowDetail = ({ inputs, runtime, isDisabled, executeAction }) => {
|
|
38234
38256
|
const handlers = useBlocknoteHandlers();
|
|
38235
|
-
const entityDid =
|
|
38236
|
-
const parsed =
|
|
38257
|
+
const entityDid = useMemo136(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
38258
|
+
const parsed = useMemo136(() => parseCalendarEventListInputs(inputs), [inputs]);
|
|
38237
38259
|
const connection = parsed.connection;
|
|
38238
38260
|
const hasConnection = !!connection?.connectedAccountId;
|
|
38239
38261
|
const entityMismatch = hasConnection && entityDid && connection.entityDid && connection.entityDid !== entityDid;
|
|
@@ -38281,7 +38303,7 @@ import { IconUserPlus as IconUserPlus3 } from "@tabler/icons-react";
|
|
|
38281
38303
|
|
|
38282
38304
|
// src/mantine/blocks/action/actionTypes/xero/contactCreate/XeroContactCreateConfig.tsx
|
|
38283
38305
|
import React347, { useCallback as useCallback139, useEffect as useEffect136, useState as useState196 } from "react";
|
|
38284
|
-
import { Divider as Divider29, Group as
|
|
38306
|
+
import { Divider as Divider29, Group as Group127, Stack as Stack241, Switch as Switch14, Text as Text225 } from "@mantine/core";
|
|
38285
38307
|
|
|
38286
38308
|
// src/core/lib/actionRegistry/actions/xero/contactCreate.types.ts
|
|
38287
38309
|
var EMPTY4 = {
|
|
@@ -38367,7 +38389,7 @@ var XeroContactCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38367
38389
|
currentBlockId: blockId,
|
|
38368
38390
|
required: true
|
|
38369
38391
|
}
|
|
38370
|
-
), /* @__PURE__ */ React347.createElement(
|
|
38392
|
+
), /* @__PURE__ */ React347.createElement(Group127, { grow: true }, /* @__PURE__ */ React347.createElement(DataInput, { label: "First name", value: local.FirstName, onChange: (value) => update({ FirstName: value }), editorDocument, currentBlockId: blockId }), /* @__PURE__ */ React347.createElement(DataInput, { label: "Last name", value: local.LastName, onChange: (value) => update({ LastName: value }), editorDocument, currentBlockId: blockId })), /* @__PURE__ */ React347.createElement(DataInput, { label: "Email", value: local.EmailAddress, onChange: (value) => update({ EmailAddress: value }), editorDocument, currentBlockId: blockId }), /* @__PURE__ */ React347.createElement(Group127, { grow: true }, /* @__PURE__ */ React347.createElement(DataInput, { label: "Phone", value: local.phone_number, onChange: (value) => update({ phone_number: value }), editorDocument, currentBlockId: blockId }), /* @__PURE__ */ React347.createElement(DataInput, { label: "Mobile", value: local.mobile_number, onChange: (value) => update({ mobile_number: value }), editorDocument, currentBlockId: blockId })), /* @__PURE__ */ React347.createElement(DataInput, { label: "Website", value: local.Website, onChange: (value) => update({ Website: value }), editorDocument, currentBlockId: blockId })), /* @__PURE__ */ React347.createElement(Divider29, { variant: "dashed" }), /* @__PURE__ */ React347.createElement(Stack241, { gap: "md" }, /* @__PURE__ */ React347.createElement(Text225, { size: "sm", fw: 600 }, "Billing"), /* @__PURE__ */ React347.createElement(Group127, { grow: true }, /* @__PURE__ */ React347.createElement(DataInput, { label: "Tax number", value: local.TaxNumber, onChange: (value) => update({ TaxNumber: value }), editorDocument, currentBlockId: blockId }), /* @__PURE__ */ React347.createElement(
|
|
38371
38393
|
DataInput,
|
|
38372
38394
|
{
|
|
38373
38395
|
label: "Account number",
|
|
@@ -38395,11 +38417,11 @@ var XeroContactCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38395
38417
|
editorDocument,
|
|
38396
38418
|
currentBlockId: blockId
|
|
38397
38419
|
}
|
|
38398
|
-
), /* @__PURE__ */ React347.createElement(
|
|
38420
|
+
), /* @__PURE__ */ React347.createElement(Group127, null, /* @__PURE__ */ React347.createElement(Switch14, { label: "Customer", checked: local.IsCustomer, onChange: (e) => update({ IsCustomer: e.currentTarget.checked }) }), /* @__PURE__ */ React347.createElement(Switch14, { label: "Supplier", checked: local.IsSupplier, onChange: (e) => update({ IsSupplier: e.currentTarget.checked }) }))));
|
|
38399
38421
|
};
|
|
38400
38422
|
|
|
38401
38423
|
// src/mantine/blocks/action/actionTypes/xero/contactCreate/XeroContactCreateFlowDetail.tsx
|
|
38402
|
-
import React348, { useCallback as useCallback140, useEffect as useEffect137, useMemo as
|
|
38424
|
+
import React348, { useCallback as useCallback140, useEffect as useEffect137, useMemo as useMemo137, useState as useState197 } from "react";
|
|
38403
38425
|
import { Alert as Alert87, Stack as Stack242, Text as Text226 } from "@mantine/core";
|
|
38404
38426
|
var XeroContactCreateFlowDetail = ({
|
|
38405
38427
|
inputs,
|
|
@@ -38413,10 +38435,10 @@ var XeroContactCreateFlowDetail = ({
|
|
|
38413
38435
|
executeAction
|
|
38414
38436
|
}) => {
|
|
38415
38437
|
const handlers = useBlocknoteHandlers();
|
|
38416
|
-
const entityDid =
|
|
38417
|
-
const parsed =
|
|
38438
|
+
const entityDid = useMemo137(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
38439
|
+
const parsed = useMemo137(() => parseXeroContactCreateInputs(inputs), [inputs]);
|
|
38418
38440
|
const editorDocument = editor?.document || [];
|
|
38419
|
-
const resolveOpts =
|
|
38441
|
+
const resolveOpts = useMemo137(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
38420
38442
|
const resolve = useCallback140(
|
|
38421
38443
|
(field) => {
|
|
38422
38444
|
const v = parsed[field];
|
|
@@ -38500,7 +38522,7 @@ import { IconReceipt } from "@tabler/icons-react";
|
|
|
38500
38522
|
|
|
38501
38523
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroInvoiceCreateConfig.tsx
|
|
38502
38524
|
import React350, { useCallback as useCallback142, useEffect as useEffect138, useState as useState198 } from "react";
|
|
38503
|
-
import { Divider as Divider31, Group as
|
|
38525
|
+
import { Divider as Divider31, Group as Group129, Stack as Stack244, Text as Text228 } from "@mantine/core";
|
|
38504
38526
|
|
|
38505
38527
|
// src/core/lib/actionRegistry/actions/xero/invoiceCreate.types.ts
|
|
38506
38528
|
var LINE_ITEM_FIELD_KEYS = ["Description", "Quantity", "UnitAmount", "AccountCode", "TaxType", "ItemCode", "DiscountRate"];
|
|
@@ -38619,8 +38641,8 @@ function finaliseLineItem(cells) {
|
|
|
38619
38641
|
}
|
|
38620
38642
|
|
|
38621
38643
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroLineItemsEditor.tsx
|
|
38622
|
-
import React349, { useCallback as useCallback141, useMemo as
|
|
38623
|
-
import { ActionIcon as ActionIcon48, Alert as Alert88, Box as Box67, Button as Button78, Collapse as Collapse10, Divider as Divider30, Group as
|
|
38644
|
+
import React349, { useCallback as useCallback141, useMemo as useMemo138 } from "react";
|
|
38645
|
+
import { ActionIcon as ActionIcon48, Alert as Alert88, Box as Box67, Button as Button78, Collapse as Collapse10, Divider as Divider30, Group as Group128, SegmentedControl as SegmentedControl18, Stack as Stack243, Text as Text227, Tooltip as Tooltip33 } from "@mantine/core";
|
|
38624
38646
|
import { useDisclosure as useDisclosure6 } from "@mantine/hooks";
|
|
38625
38647
|
import { IconChevronDown as IconChevronDown10, IconChevronRight as IconChevronRight12, IconPlus as IconPlus10, IconTrash as IconTrash11 } from "@tabler/icons-react";
|
|
38626
38648
|
function getNestedField(fields, path) {
|
|
@@ -38656,7 +38678,7 @@ function XeroLineItemsEditor({ value, onChange, editorDocument, currentBlockId }
|
|
|
38656
38678
|
},
|
|
38657
38679
|
[value, onChange]
|
|
38658
38680
|
);
|
|
38659
|
-
return /* @__PURE__ */ React349.createElement(Stack243, { gap: "sm" }, /* @__PURE__ */ React349.createElement(
|
|
38681
|
+
return /* @__PURE__ */ React349.createElement(Stack243, { gap: "sm" }, /* @__PURE__ */ React349.createElement(Group128, { justify: "space-between", align: "center" }, /* @__PURE__ */ React349.createElement(Text227, { size: "sm", fw: 600 }, "Line items"), /* @__PURE__ */ React349.createElement(
|
|
38660
38682
|
SegmentedControl18,
|
|
38661
38683
|
{
|
|
38662
38684
|
size: "xs",
|
|
@@ -38727,7 +38749,7 @@ function LineItemRowCard({
|
|
|
38727
38749
|
background: "var(--mantine-color-neutralColor-2)"
|
|
38728
38750
|
}
|
|
38729
38751
|
},
|
|
38730
|
-
/* @__PURE__ */ React349.createElement(
|
|
38752
|
+
/* @__PURE__ */ React349.createElement(Group128, { justify: "space-between", align: "center", mb: "xs" }, /* @__PURE__ */ React349.createElement(Text227, { size: "xs", c: "dimmed", fw: 600 }, "Line item ", index + 1), canRemove && onRemove && /* @__PURE__ */ React349.createElement(Tooltip33, { label: "Remove", withArrow: true }, /* @__PURE__ */ React349.createElement(ActionIcon48, { size: "sm", variant: "subtle", color: "red", onClick: onRemove }, /* @__PURE__ */ React349.createElement(IconTrash11, { size: 14 })))),
|
|
38731
38753
|
/* @__PURE__ */ React349.createElement(Stack243, { gap: "xs" }, /* @__PURE__ */ React349.createElement(
|
|
38732
38754
|
DataInput,
|
|
38733
38755
|
{
|
|
@@ -38740,7 +38762,7 @@ function LineItemRowCard({
|
|
|
38740
38762
|
itemScope,
|
|
38741
38763
|
required: true
|
|
38742
38764
|
}
|
|
38743
|
-
), /* @__PURE__ */ React349.createElement(
|
|
38765
|
+
), /* @__PURE__ */ React349.createElement(Group128, { grow: true }, /* @__PURE__ */ React349.createElement(
|
|
38744
38766
|
DataInput,
|
|
38745
38767
|
{
|
|
38746
38768
|
label: "Quantity",
|
|
@@ -38826,8 +38848,8 @@ function IterativeMapEditor({
|
|
|
38826
38848
|
editorDocument,
|
|
38827
38849
|
currentBlockId
|
|
38828
38850
|
}) {
|
|
38829
|
-
const itemSchema =
|
|
38830
|
-
const itemScope =
|
|
38851
|
+
const itemSchema = useMemo138(() => resolveItemSchema(value.source, editorDocument), [value.source, editorDocument]);
|
|
38852
|
+
const itemScope = useMemo138(() => {
|
|
38831
38853
|
if (!itemSchema) return void 0;
|
|
38832
38854
|
return {
|
|
38833
38855
|
schema: itemSchema.map((f) => ({
|
|
@@ -38890,7 +38912,7 @@ var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38890
38912
|
editorDocument,
|
|
38891
38913
|
currentBlockId: blockId
|
|
38892
38914
|
}
|
|
38893
|
-
), /* @__PURE__ */ React350.createElement(Divider31, { variant: "dashed" }), /* @__PURE__ */ React350.createElement(Stack244, { gap: "md" }, /* @__PURE__ */ React350.createElement(Text228, { size: "sm", fw: 600 }, "Invoice"), /* @__PURE__ */ React350.createElement(
|
|
38915
|
+
), /* @__PURE__ */ React350.createElement(Divider31, { variant: "dashed" }), /* @__PURE__ */ React350.createElement(Stack244, { gap: "md" }, /* @__PURE__ */ React350.createElement(Text228, { size: "sm", fw: 600 }, "Invoice"), /* @__PURE__ */ React350.createElement(Group129, { grow: true }, /* @__PURE__ */ React350.createElement(
|
|
38894
38916
|
BaseSelect,
|
|
38895
38917
|
{
|
|
38896
38918
|
label: "Type",
|
|
@@ -38913,7 +38935,7 @@ var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38913
38935
|
value: local.Status || "DRAFT",
|
|
38914
38936
|
onChange: (value) => update({ Status: value || "DRAFT" })
|
|
38915
38937
|
}
|
|
38916
|
-
)), /* @__PURE__ */ React350.createElement(
|
|
38938
|
+
)), /* @__PURE__ */ React350.createElement(Group129, { grow: true }, /* @__PURE__ */ React350.createElement(
|
|
38917
38939
|
DataInput,
|
|
38918
38940
|
{
|
|
38919
38941
|
label: "Contact ID",
|
|
@@ -38932,7 +38954,7 @@ var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38932
38954
|
editorDocument,
|
|
38933
38955
|
currentBlockId: blockId
|
|
38934
38956
|
}
|
|
38935
|
-
)), /* @__PURE__ */ React350.createElement(
|
|
38957
|
+
)), /* @__PURE__ */ React350.createElement(Group129, { grow: true }, /* @__PURE__ */ React350.createElement(
|
|
38936
38958
|
DataInput,
|
|
38937
38959
|
{
|
|
38938
38960
|
label: "Issue date",
|
|
@@ -38952,7 +38974,7 @@ var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38952
38974
|
editorDocument,
|
|
38953
38975
|
currentBlockId: blockId
|
|
38954
38976
|
}
|
|
38955
|
-
)), /* @__PURE__ */ React350.createElement(
|
|
38977
|
+
)), /* @__PURE__ */ React350.createElement(Group129, { grow: true }, /* @__PURE__ */ React350.createElement(
|
|
38956
38978
|
DataInput,
|
|
38957
38979
|
{
|
|
38958
38980
|
label: "Invoice number",
|
|
@@ -38975,12 +38997,12 @@ var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
38975
38997
|
};
|
|
38976
38998
|
|
|
38977
38999
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroInvoiceCreateFlowDetail.tsx
|
|
38978
|
-
import React351, { useCallback as useCallback144, useEffect as useEffect141, useMemo as
|
|
38979
|
-
import { Alert as Alert89, Badge as Badge57, Box as Box68, Button as Button79, Group as
|
|
39000
|
+
import React351, { useCallback as useCallback144, useEffect as useEffect141, useMemo as useMemo140, useState as useState201 } from "react";
|
|
39001
|
+
import { Alert as Alert89, Badge as Badge57, Box as Box68, Button as Button79, Group as Group130, Stack as Stack245, Text as Text229 } from "@mantine/core";
|
|
38980
39002
|
import { IconX as IconX19 } from "@tabler/icons-react";
|
|
38981
39003
|
|
|
38982
39004
|
// src/mantine/hooks/useXeroWorkItems.ts
|
|
38983
|
-
import { useEffect as useEffect139, useMemo as
|
|
39005
|
+
import { useEffect as useEffect139, useMemo as useMemo139, useState as useState199 } from "react";
|
|
38984
39006
|
function useXeroWorkItems(editor, filter) {
|
|
38985
39007
|
const workItemsMap = editor?._yXeroWorkItems || null;
|
|
38986
39008
|
const [rev, setRev] = useState199(0);
|
|
@@ -38990,7 +39012,7 @@ function useXeroWorkItems(editor, filter) {
|
|
|
38990
39012
|
workItemsMap.observe(handler);
|
|
38991
39013
|
return () => workItemsMap.unobserve(handler);
|
|
38992
39014
|
}, [workItemsMap]);
|
|
38993
|
-
return
|
|
39015
|
+
return useMemo139(() => findXeroWorkItemsForEditor(editor, filter), [editor, filter.kind, filter.assignedBlockId, filter.statuses?.join("|"), rev]);
|
|
38994
39016
|
}
|
|
38995
39017
|
|
|
38996
39018
|
// src/core/lib/actionRegistry/actions/xero/paymentCreate.types.ts
|
|
@@ -39204,18 +39226,18 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39204
39226
|
executeAction
|
|
39205
39227
|
}) => {
|
|
39206
39228
|
const handlers = useBlocknoteHandlers();
|
|
39207
|
-
const flowId =
|
|
39208
|
-
const actorDid =
|
|
39229
|
+
const flowId = useMemo140(() => editor?.getFlowMetadata?.()?.doc_id || block.id, [editor, block.id]);
|
|
39230
|
+
const actorDid = useMemo140(() => {
|
|
39209
39231
|
try {
|
|
39210
39232
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
39211
39233
|
} catch {
|
|
39212
39234
|
return "";
|
|
39213
39235
|
}
|
|
39214
39236
|
}, [handlers]);
|
|
39215
|
-
const entityDid =
|
|
39216
|
-
const parsed =
|
|
39237
|
+
const entityDid = useMemo140(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
39238
|
+
const parsed = useMemo140(() => parseXeroInvoiceCreateInputs(inputs), [inputs]);
|
|
39217
39239
|
const editorDocument = editor?.document || [];
|
|
39218
|
-
const resolveOpts =
|
|
39240
|
+
const resolveOpts = useMemo140(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
39219
39241
|
const seedFromTemplate = useCallback144(
|
|
39220
39242
|
(field) => {
|
|
39221
39243
|
const v = parsed[field];
|
|
@@ -39259,7 +39281,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39259
39281
|
}, []);
|
|
39260
39282
|
const workItems = useXeroWorkItems(editor, { kind: "invoice.create", assignedBlockId: block.id, statuses: ["pending", "failed", "completed"] });
|
|
39261
39283
|
const [selectedWorkItemId, setSelectedWorkItemId] = useState201("");
|
|
39262
|
-
const selectedWorkItem =
|
|
39284
|
+
const selectedWorkItem = useMemo140(() => workItems.find((item) => item.id === selectedWorkItemId) || null, [workItems, selectedWorkItemId]);
|
|
39263
39285
|
const selectedWorkItemCompleted = selectedWorkItem?.status === "completed";
|
|
39264
39286
|
useEffect141(() => {
|
|
39265
39287
|
if (!selectedWorkItem) return;
|
|
@@ -39283,14 +39305,14 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39283
39305
|
const hasConnection = !!effectiveConnection?.connectedAccountId;
|
|
39284
39306
|
const entityMismatch = hasConnection && entityDid && effectiveConnection.entityDid && effectiveConnection.entityDid !== entityDid;
|
|
39285
39307
|
const isCompleted = runtime.state === "completed" && !selectedWorkItem;
|
|
39286
|
-
const paymentBlock =
|
|
39308
|
+
const paymentBlock = useMemo140(() => {
|
|
39287
39309
|
if (!selectedWorkItem) return null;
|
|
39288
39310
|
const evaluationBlock = editor?.document?.find((candidate) => candidate?.id === selectedWorkItem.source.evaluationBlockId);
|
|
39289
39311
|
const inputs2 = typeof evaluationBlock?.props?.inputs === "string" ? JSON.parse(evaluationBlock.props.inputs || "{}") : evaluationBlock?.props?.inputs || {};
|
|
39290
39312
|
const paymentBlockId = String(inputs2?.xeroPaymentBlockId || "").trim();
|
|
39291
39313
|
return paymentBlockId ? editor?.document?.find((candidate) => candidate?.id === paymentBlockId && candidate?.props?.actionType === "qi/xero.payment.create") || null : null;
|
|
39292
39314
|
}, [editor, selectedWorkItem]);
|
|
39293
|
-
const lineItemsValidation =
|
|
39315
|
+
const lineItemsValidation = useMemo140(() => {
|
|
39294
39316
|
try {
|
|
39295
39317
|
if (selectedWorkItem) {
|
|
39296
39318
|
const arr2 = reviewLineItems.map((item) => finaliseLineItem(item));
|
|
@@ -39431,7 +39453,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39431
39453
|
if (!provideSigningHandler) return;
|
|
39432
39454
|
provideSigningHandler(execute);
|
|
39433
39455
|
}, [provideSigningHandler, execute]);
|
|
39434
|
-
return /* @__PURE__ */ React351.createElement(Stack245, { gap: "md" }, !hasConnection && !selectedWorkItemCompleted && /* @__PURE__ */ React351.createElement(ConnectionSelector, { toolkit: "xero", toolkitLabel: "Xero", value: flowConnection, onChange: setFlowConnection }), entityMismatch && /* @__PURE__ */ React351.createElement(Alert89, { color: "yellow", styles: actionAlertStyles }, "This block was configured for a different workspace. Reconnect Xero to use it here."), workItems.length > 0 && /* @__PURE__ */ React351.createElement(Stack245, { gap: "sm" }, /* @__PURE__ */ React351.createElement(
|
|
39456
|
+
return /* @__PURE__ */ React351.createElement(Stack245, { gap: "md" }, !hasConnection && !selectedWorkItemCompleted && /* @__PURE__ */ React351.createElement(ConnectionSelector, { toolkit: "xero", toolkitLabel: "Xero", value: flowConnection, onChange: setFlowConnection }), entityMismatch && /* @__PURE__ */ React351.createElement(Alert89, { color: "yellow", styles: actionAlertStyles }, "This block was configured for a different workspace. Reconnect Xero to use it here."), workItems.length > 0 && /* @__PURE__ */ React351.createElement(Stack245, { gap: "sm" }, /* @__PURE__ */ React351.createElement(Group130, { justify: "space-between", align: "center" }, /* @__PURE__ */ React351.createElement(Text229, { size: "sm", fw: 600 }, "Invoices"), /* @__PURE__ */ React351.createElement(Badge57, { variant: "light", color: "gray" }, workItems.length)), workItems.map((item) => /* @__PURE__ */ React351.createElement(
|
|
39435
39457
|
Box68,
|
|
39436
39458
|
{
|
|
39437
39459
|
key: item.id,
|
|
@@ -39442,7 +39464,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39442
39464
|
background: selectedWorkItem?.id === item.id ? "rgba(42, 234, 179, 0.08)" : "var(--mantine-color-neutralColor-5)"
|
|
39443
39465
|
}
|
|
39444
39466
|
},
|
|
39445
|
-
/* @__PURE__ */ React351.createElement(
|
|
39467
|
+
/* @__PURE__ */ React351.createElement(Group130, { justify: "space-between", align: "flex-start", gap: "md", wrap: "nowrap" }, /* @__PURE__ */ React351.createElement(Stack245, { gap: 4, style: { minWidth: 0, flex: 1 } }, /* @__PURE__ */ React351.createElement(Group130, { gap: "xs", wrap: "wrap" }, /* @__PURE__ */ React351.createElement(Text229, { size: "sm", fw: 600 }, String(item.reviewPayload?.InvoiceNumber || item.reviewPayload?.Reference || item.reviewPayload?.ContactName || "Invoice work")), /* @__PURE__ */ React351.createElement(Badge57, { size: "xs", color: item.status === "completed" ? "green" : item.status === "failed" ? "red" : "blue", variant: "light" }, item.status), /* @__PURE__ */ React351.createElement(Badge57, { size: "xs", color: "gray", variant: "outline" }, String(item.reviewPayload?.Type || "ACCREC"))), /* @__PURE__ */ React351.createElement(Text229, { size: "xs", c: "dimmed", truncate: true }, "Claim ", shortId(item.source.claimId), " \xB7 Contact ", String(item.reviewPayload?.ContactName || item.reviewPayload?.ContactID || "missing")), /* @__PURE__ */ React351.createElement(Group130, { gap: "md", wrap: "wrap" }, /* @__PURE__ */ React351.createElement(Text229, { size: "xs" }, "Total ", formatAmount(getLineTotal(item.reviewPayload?.LineItems), item.reviewPayload?.CurrencyCode)), item.reviewPayload?.DueDate && /* @__PURE__ */ React351.createElement(Text229, { size: "xs" }, "Due ", String(item.reviewPayload.DueDate)), /* @__PURE__ */ React351.createElement(Text229, { size: "xs" }, Array.isArray(item.reviewPayload?.LineItems) ? item.reviewPayload.LineItems.length : 0, " line item(s)"))), /* @__PURE__ */ React351.createElement(
|
|
39446
39468
|
Button79,
|
|
39447
39469
|
{
|
|
39448
39470
|
size: "xs",
|
|
@@ -39452,7 +39474,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39452
39474
|
},
|
|
39453
39475
|
selectedWorkItem?.id === item.id ? "Close" : item.status === "completed" ? "Open" : "Review"
|
|
39454
39476
|
))
|
|
39455
|
-
))), canShowDetail && /* @__PURE__ */ React351.createElement(Stack245, { gap: "sm" }, selectedWorkItem && /* @__PURE__ */ React351.createElement(
|
|
39477
|
+
))), canShowDetail && /* @__PURE__ */ React351.createElement(Stack245, { gap: "sm" }, selectedWorkItem && /* @__PURE__ */ React351.createElement(Group130, { justify: "space-between", align: "center" }, /* @__PURE__ */ React351.createElement(Text229, { size: "sm", fw: 600 }, selectedWorkItemCompleted ? "Completed invoice" : "Reviewing queued invoice"), /* @__PURE__ */ React351.createElement(Button79, { size: "xs", variant: "subtle", leftSection: /* @__PURE__ */ React351.createElement(IconX19, { size: 14 }), onClick: () => setSelectedWorkItemId("") }, "Close review")), selectedWorkItem && /* @__PURE__ */ React351.createElement(
|
|
39456
39478
|
BaseSelect,
|
|
39457
39479
|
{
|
|
39458
39480
|
label: "Status",
|
|
@@ -39505,7 +39527,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39505
39527
|
currentBlockId: block.id,
|
|
39506
39528
|
disabled: selectedWorkItemCompleted
|
|
39507
39529
|
}
|
|
39508
|
-
), selectedWorkItem && /* @__PURE__ */ React351.createElement(Stack245, { gap: "xs" }, /* @__PURE__ */ React351.createElement(
|
|
39530
|
+
), selectedWorkItem && /* @__PURE__ */ React351.createElement(Stack245, { gap: "xs" }, /* @__PURE__ */ React351.createElement(Group130, { justify: "space-between", align: "center" }, /* @__PURE__ */ React351.createElement(Text229, { size: "sm", fw: 600 }, "Line items"), /* @__PURE__ */ React351.createElement(Badge57, { color: lineItemsValidation.ok ? "green" : "yellow", variant: "light" }, lineItemsValidation.count)), reviewLineItems.map((item, index) => /* @__PURE__ */ React351.createElement(
|
|
39509
39531
|
Box68,
|
|
39510
39532
|
{
|
|
39511
39533
|
key: index,
|
|
@@ -39526,7 +39548,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39526
39548
|
currentBlockId: block.id,
|
|
39527
39549
|
disabled: selectedWorkItemCompleted
|
|
39528
39550
|
}
|
|
39529
|
-
), /* @__PURE__ */ React351.createElement(
|
|
39551
|
+
), /* @__PURE__ */ React351.createElement(Group130, { grow: true }, /* @__PURE__ */ React351.createElement(
|
|
39530
39552
|
DataInput,
|
|
39531
39553
|
{
|
|
39532
39554
|
label: "Quantity",
|
|
@@ -39556,7 +39578,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
39556
39578
|
currentBlockId: block.id,
|
|
39557
39579
|
disabled: selectedWorkItemCompleted
|
|
39558
39580
|
}
|
|
39559
|
-
)), /* @__PURE__ */ React351.createElement(
|
|
39581
|
+
)), /* @__PURE__ */ React351.createElement(Group130, { grow: true }, /* @__PURE__ */ React351.createElement(
|
|
39560
39582
|
DataInput,
|
|
39561
39583
|
{
|
|
39562
39584
|
label: "Tax type",
|
|
@@ -39605,7 +39627,7 @@ import { IconListDetails as IconListDetails2 } from "@tabler/icons-react";
|
|
|
39605
39627
|
|
|
39606
39628
|
// src/mantine/blocks/action/actionTypes/xero/invoiceList/XeroInvoiceListConfig.tsx
|
|
39607
39629
|
import React352, { useCallback as useCallback145, useEffect as useEffect142, useState as useState202 } from "react";
|
|
39608
|
-
import { Divider as Divider32, Group as
|
|
39630
|
+
import { Divider as Divider32, Group as Group131, Stack as Stack246, Switch as Switch15, Text as Text230 } from "@mantine/core";
|
|
39609
39631
|
|
|
39610
39632
|
// src/core/lib/actionRegistry/actions/xero/invoiceList.types.ts
|
|
39611
39633
|
var EMPTY5 = {
|
|
@@ -39710,7 +39732,7 @@ var XeroInvoiceListConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
39710
39732
|
editorDocument,
|
|
39711
39733
|
currentBlockId: blockId
|
|
39712
39734
|
}
|
|
39713
|
-
), /* @__PURE__ */ React352.createElement(
|
|
39735
|
+
), /* @__PURE__ */ React352.createElement(Group131, { grow: true }, /* @__PURE__ */ React352.createElement(
|
|
39714
39736
|
DataInput,
|
|
39715
39737
|
{
|
|
39716
39738
|
label: "Order",
|
|
@@ -39720,17 +39742,17 @@ var XeroInvoiceListConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
39720
39742
|
editorDocument,
|
|
39721
39743
|
currentBlockId: blockId
|
|
39722
39744
|
}
|
|
39723
|
-
), /* @__PURE__ */ React352.createElement(DataInput, { label: "Page", placeholder: "1", value: local.page, onChange: (value) => update({ page: value }), editorDocument, currentBlockId: blockId })), /* @__PURE__ */ React352.createElement(
|
|
39745
|
+
), /* @__PURE__ */ React352.createElement(DataInput, { label: "Page", placeholder: "1", value: local.page, onChange: (value) => update({ page: value }), editorDocument, currentBlockId: blockId })), /* @__PURE__ */ React352.createElement(Group131, null, /* @__PURE__ */ React352.createElement(Switch15, { label: "Only invoices created by this app", checked: local.createdByMyApp, onChange: (e) => update({ createdByMyApp: e.currentTarget.checked }) }), /* @__PURE__ */ React352.createElement(Switch15, { label: "Include archived", checked: local.includeArchived, onChange: (e) => update({ includeArchived: e.currentTarget.checked }) }))));
|
|
39724
39746
|
};
|
|
39725
39747
|
|
|
39726
39748
|
// src/mantine/blocks/action/actionTypes/xero/invoiceList/XeroInvoiceListFlowDetail.tsx
|
|
39727
|
-
import React353, { useCallback as useCallback146, useMemo as
|
|
39749
|
+
import React353, { useCallback as useCallback146, useMemo as useMemo141, useState as useState203 } from "react";
|
|
39728
39750
|
import { Alert as Alert90, Badge as Badge58, Button as Button80, Loader as Loader76, Stack as Stack247 } from "@mantine/core";
|
|
39729
39751
|
import { IconRefresh as IconRefresh12 } from "@tabler/icons-react";
|
|
39730
39752
|
var XeroInvoiceListFlowDetail = ({ inputs, runtime, isDisabled, executeAction }) => {
|
|
39731
39753
|
const handlers = useBlocknoteHandlers();
|
|
39732
|
-
const entityDid =
|
|
39733
|
-
const parsed =
|
|
39754
|
+
const entityDid = useMemo141(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
39755
|
+
const parsed = useMemo141(() => parseXeroInvoiceListInputs(inputs), [inputs]);
|
|
39734
39756
|
const connection = parsed.connection;
|
|
39735
39757
|
const hasConnection = !!connection?.connectedAccountId;
|
|
39736
39758
|
const entityMismatch = hasConnection && entityDid && connection.entityDid && connection.entityDid !== entityDid;
|
|
@@ -39778,11 +39800,11 @@ import { IconReceipt as IconReceipt2 } from "@tabler/icons-react";
|
|
|
39778
39800
|
|
|
39779
39801
|
// src/mantine/blocks/action/actionTypes/xero/paymentCreate/XeroPaymentCreateConfig.tsx
|
|
39780
39802
|
import React355, { useCallback as useCallback148, useEffect as useEffect144, useState as useState205 } from "react";
|
|
39781
|
-
import { Divider as Divider33, Group as
|
|
39803
|
+
import { Divider as Divider33, Group as Group133, Stack as Stack249, Text as Text232 } from "@mantine/core";
|
|
39782
39804
|
|
|
39783
39805
|
// src/mantine/blocks/action/actionTypes/xero/_shared/XeroBankAccountPicker.tsx
|
|
39784
39806
|
import React354, { useCallback as useCallback147, useEffect as useEffect143, useRef as useRef47, useState as useState204 } from "react";
|
|
39785
|
-
import { ActionIcon as ActionIcon49, Group as
|
|
39807
|
+
import { ActionIcon as ActionIcon49, Group as Group132, Loader as Loader77, Stack as Stack248, Text as Text231 } from "@mantine/core";
|
|
39786
39808
|
import { IconRefresh as IconRefresh13 } from "@tabler/icons-react";
|
|
39787
39809
|
var XERO_LIST_ACCOUNTS_SLUG = "XERO_LIST_ACCOUNTS";
|
|
39788
39810
|
var XeroBankAccountPicker = ({
|
|
@@ -39850,7 +39872,7 @@ var XeroBankAccountPicker = ({
|
|
|
39850
39872
|
label: a.Code ? `${a.Code} \xB7 ${a.Name}` : a.Name || a.AccountID
|
|
39851
39873
|
}));
|
|
39852
39874
|
if (showPicker) {
|
|
39853
|
-
return /* @__PURE__ */ React354.createElement(Stack248, { gap: 4 }, /* @__PURE__ */ React354.createElement(
|
|
39875
|
+
return /* @__PURE__ */ React354.createElement(Stack248, { gap: 4 }, /* @__PURE__ */ React354.createElement(Group132, { gap: 4, align: "center", justify: "space-between" }, /* @__PURE__ */ React354.createElement(Text231, { size: "sm", fw: 500 }, label, required ? " *" : ""), /* @__PURE__ */ React354.createElement(ActionIcon49, { variant: "subtle", size: "sm", onClick: fetchBankAccounts, loading, "aria-label": "Refresh bank accounts" }, /* @__PURE__ */ React354.createElement(IconRefresh13, { size: 14 }))), /* @__PURE__ */ React354.createElement(
|
|
39854
39876
|
BaseSelect,
|
|
39855
39877
|
{
|
|
39856
39878
|
placeholder: loading ? "Loading\u2026" : "Select a Xero bank account",
|
|
@@ -39875,7 +39897,7 @@ var XeroBankAccountPicker = ({
|
|
|
39875
39897
|
required,
|
|
39876
39898
|
disabled
|
|
39877
39899
|
}
|
|
39878
|
-
), connectedAccountId && /* @__PURE__ */ React354.createElement(
|
|
39900
|
+
), connectedAccountId && /* @__PURE__ */ React354.createElement(Group132, { gap: "xs" }, loading && /* @__PURE__ */ React354.createElement(Loader77, { size: "xs" }), !loading && /* @__PURE__ */ React354.createElement(Text231, { size: "xs", c: "dimmed", style: { cursor: "pointer", textDecoration: "underline" }, onClick: fetchBankAccounts }, "Load bank accounts from Xero"), error && /* @__PURE__ */ React354.createElement(Text231, { size: "xs", c: "red" }, error)));
|
|
39879
39901
|
};
|
|
39880
39902
|
|
|
39881
39903
|
// src/mantine/blocks/action/actionTypes/xero/paymentCreate/XeroPaymentCreateConfig.tsx
|
|
@@ -39926,7 +39948,7 @@ var XeroPaymentCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
39926
39948
|
label: "Bank account",
|
|
39927
39949
|
required: true
|
|
39928
39950
|
}
|
|
39929
|
-
), /* @__PURE__ */ React355.createElement(
|
|
39951
|
+
), /* @__PURE__ */ React355.createElement(Group133, { grow: true }, /* @__PURE__ */ React355.createElement(
|
|
39930
39952
|
DataInput,
|
|
39931
39953
|
{
|
|
39932
39954
|
label: "Amount",
|
|
@@ -39972,8 +39994,8 @@ var XeroPaymentCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
39972
39994
|
};
|
|
39973
39995
|
|
|
39974
39996
|
// src/mantine/blocks/action/actionTypes/xero/paymentCreate/XeroPaymentCreateFlowDetail.tsx
|
|
39975
|
-
import React356, { useCallback as useCallback149, useEffect as useEffect145, useMemo as
|
|
39976
|
-
import { Alert as Alert91, Badge as Badge59, Box as Box69, Button as Button81, Group as
|
|
39997
|
+
import React356, { useCallback as useCallback149, useEffect as useEffect145, useMemo as useMemo142, useState as useState206 } from "react";
|
|
39998
|
+
import { Alert as Alert91, Badge as Badge59, Box as Box69, Button as Button81, Group as Group134, Stack as Stack250, Text as Text233 } from "@mantine/core";
|
|
39977
39999
|
import { IconX as IconX20 } from "@tabler/icons-react";
|
|
39978
40000
|
function shortId2(value, length = 10) {
|
|
39979
40001
|
const text = String(value || "");
|
|
@@ -39995,17 +40017,17 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
39995
40017
|
executeAction
|
|
39996
40018
|
}) => {
|
|
39997
40019
|
const handlers = useBlocknoteHandlers();
|
|
39998
|
-
const actorDid =
|
|
40020
|
+
const actorDid = useMemo142(() => {
|
|
39999
40021
|
try {
|
|
40000
40022
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
40001
40023
|
} catch {
|
|
40002
40024
|
return "";
|
|
40003
40025
|
}
|
|
40004
40026
|
}, [handlers]);
|
|
40005
|
-
const entityDid =
|
|
40006
|
-
const parsed =
|
|
40027
|
+
const entityDid = useMemo142(() => handlers?.getEntityDid?.() || "", [handlers]);
|
|
40028
|
+
const parsed = useMemo142(() => parseXeroPaymentCreateInputs(inputs), [inputs]);
|
|
40007
40029
|
const editorDocument = editor?.document || [];
|
|
40008
|
-
const resolveOpts =
|
|
40030
|
+
const resolveOpts = useMemo142(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
40009
40031
|
const seedFromTemplate = useCallback149(
|
|
40010
40032
|
(field) => {
|
|
40011
40033
|
const v = parsed[field];
|
|
@@ -40042,7 +40064,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
40042
40064
|
}, []);
|
|
40043
40065
|
const workItems = useXeroWorkItems(editor, { kind: "payment.create", assignedBlockId: block.id, statuses: ["pending", "failed", "completed"] });
|
|
40044
40066
|
const [selectedWorkItemId, setSelectedWorkItemId] = useState206("");
|
|
40045
|
-
const selectedWorkItem =
|
|
40067
|
+
const selectedWorkItem = useMemo142(() => workItems.find((item) => item.id === selectedWorkItemId) || null, [workItems, selectedWorkItemId]);
|
|
40046
40068
|
const selectedWorkItemCompleted = selectedWorkItem?.status === "completed";
|
|
40047
40069
|
useEffect145(() => {
|
|
40048
40070
|
if (!selectedWorkItem) return;
|
|
@@ -40062,7 +40084,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
40062
40084
|
const hasConnection = !!effectiveConnection?.connectedAccountId;
|
|
40063
40085
|
const entityMismatch = hasConnection && entityDid && effectiveConnection.entityDid && effectiveConnection.entityDid !== entityDid;
|
|
40064
40086
|
const isCompleted = runtime.state === "completed" && !selectedWorkItem;
|
|
40065
|
-
const amountNumber =
|
|
40087
|
+
const amountNumber = useMemo142(() => {
|
|
40066
40088
|
const trimmed = local.Amount.trim();
|
|
40067
40089
|
if (!trimmed) return NaN;
|
|
40068
40090
|
return Number(trimmed);
|
|
@@ -40147,7 +40169,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
40147
40169
|
if (!provideSigningHandler) return;
|
|
40148
40170
|
provideSigningHandler(execute);
|
|
40149
40171
|
}, [provideSigningHandler, execute]);
|
|
40150
|
-
return /* @__PURE__ */ React356.createElement(Stack250, { gap: "md" }, !hasConnection && !selectedWorkItemCompleted && /* @__PURE__ */ React356.createElement(ConnectionSelector, { toolkit: "xero", toolkitLabel: "Xero", value: flowConnection, onChange: setFlowConnection }), entityMismatch && /* @__PURE__ */ React356.createElement(Alert91, { color: "yellow", styles: actionAlertStyles }, "This block was configured for a different workspace. Reconnect Xero to use it here."), workItems.length > 0 && /* @__PURE__ */ React356.createElement(Stack250, { gap: "sm" }, /* @__PURE__ */ React356.createElement(
|
|
40172
|
+
return /* @__PURE__ */ React356.createElement(Stack250, { gap: "md" }, !hasConnection && !selectedWorkItemCompleted && /* @__PURE__ */ React356.createElement(ConnectionSelector, { toolkit: "xero", toolkitLabel: "Xero", value: flowConnection, onChange: setFlowConnection }), entityMismatch && /* @__PURE__ */ React356.createElement(Alert91, { color: "yellow", styles: actionAlertStyles }, "This block was configured for a different workspace. Reconnect Xero to use it here."), workItems.length > 0 && /* @__PURE__ */ React356.createElement(Stack250, { gap: "sm" }, /* @__PURE__ */ React356.createElement(Group134, { justify: "space-between", align: "center" }, /* @__PURE__ */ React356.createElement(Text233, { size: "sm", fw: 600 }, "Payments"), /* @__PURE__ */ React356.createElement(Badge59, { variant: "light", color: "gray" }, workItems.length)), workItems.map((item) => /* @__PURE__ */ React356.createElement(
|
|
40151
40173
|
Box69,
|
|
40152
40174
|
{
|
|
40153
40175
|
key: item.id,
|
|
@@ -40158,7 +40180,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
40158
40180
|
background: selectedWorkItem?.id === item.id ? "rgba(42, 234, 179, 0.08)" : "var(--mantine-color-neutralColor-5)"
|
|
40159
40181
|
}
|
|
40160
40182
|
},
|
|
40161
|
-
/* @__PURE__ */ React356.createElement(
|
|
40183
|
+
/* @__PURE__ */ React356.createElement(Group134, { justify: "space-between", align: "flex-start", gap: "md", wrap: "nowrap" }, /* @__PURE__ */ React356.createElement(Stack250, { gap: 4, style: { minWidth: 0, flex: 1 } }, /* @__PURE__ */ React356.createElement(Group134, { gap: "xs", wrap: "wrap" }, /* @__PURE__ */ React356.createElement(Text233, { size: "sm", fw: 600, truncate: true, style: { minWidth: 0, maxWidth: "100%" } }, String(item.reviewPayload?.Reference || item.reviewPayload?.InvoiceID || "Payment work")), /* @__PURE__ */ React356.createElement(Badge59, { size: "xs", color: item.status === "completed" ? "green" : item.status === "failed" ? "red" : "blue", variant: "light" }, item.status)), /* @__PURE__ */ React356.createElement(Text233, { size: "xs", c: "dimmed", truncate: true }, "Claim ", shortId2(item.source.claimId), " \xB7 Invoice ", shortId2(item.reviewPayload?.InvoiceID)), /* @__PURE__ */ React356.createElement(Group134, { gap: "md", wrap: "wrap" }, /* @__PURE__ */ React356.createElement(Text233, { size: "xs" }, "Amount ", formatAmount2(item.reviewPayload?.Amount)), item.reviewPayload?.Date && /* @__PURE__ */ React356.createElement(Text233, { size: "xs" }, "Date ", String(item.reviewPayload.Date)), item.reviewPayload?.AccountID && /* @__PURE__ */ React356.createElement(Text233, { size: "xs" }, "Account ", shortId2(item.reviewPayload.AccountID)))), /* @__PURE__ */ React356.createElement(
|
|
40162
40184
|
Button81,
|
|
40163
40185
|
{
|
|
40164
40186
|
size: "xs",
|
|
@@ -40168,7 +40190,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
40168
40190
|
},
|
|
40169
40191
|
selectedWorkItem?.id === item.id ? "Close" : item.status === "completed" ? "Open" : "Review"
|
|
40170
40192
|
))
|
|
40171
|
-
))), canShowDetail && /* @__PURE__ */ React356.createElement(Stack250, { gap: "sm" }, selectedWorkItem && /* @__PURE__ */ React356.createElement(
|
|
40193
|
+
))), canShowDetail && /* @__PURE__ */ React356.createElement(Stack250, { gap: "sm" }, selectedWorkItem && /* @__PURE__ */ React356.createElement(Group134, { justify: "space-between", align: "center" }, /* @__PURE__ */ React356.createElement(Text233, { size: "sm", fw: 600 }, selectedWorkItemCompleted ? "Completed payment" : "Reviewing queued payment"), /* @__PURE__ */ React356.createElement(Button81, { size: "xs", variant: "subtle", leftSection: /* @__PURE__ */ React356.createElement(IconX20, { size: 14 }), onClick: () => setSelectedWorkItemId("") }, "Close review")), /* @__PURE__ */ React356.createElement(
|
|
40172
40194
|
DataInput,
|
|
40173
40195
|
{
|
|
40174
40196
|
label: "Invoice ID",
|
|
@@ -40244,7 +40266,7 @@ import { Divider as Divider34, Stack as Stack253 } from "@mantine/core";
|
|
|
40244
40266
|
|
|
40245
40267
|
// src/mantine/blocks/action/actionTypes/_shared/BoundConnectionSelector.tsx
|
|
40246
40268
|
import React357, { useCallback as useCallback150, useEffect as useEffect146, useRef as useRef48, useState as useState207 } from "react";
|
|
40247
|
-
import { Alert as Alert92, Badge as Badge60, Button as Button82, Group as
|
|
40269
|
+
import { Alert as Alert92, Badge as Badge60, Button as Button82, Group as Group135, Loader as Loader78, Stack as Stack251, Text as Text234 } from "@mantine/core";
|
|
40248
40270
|
import { IconCheck as IconCheck30, IconPlug as IconPlug2, IconRefresh as IconRefresh14, IconTrash as IconTrash12 } from "@tabler/icons-react";
|
|
40249
40271
|
var POLL_INTERVAL_MS3 = 2e3;
|
|
40250
40272
|
var CONNECT_TIMEOUT_MS2 = 12e4;
|
|
@@ -40404,9 +40426,9 @@ var BoundConnectionSelector = ({ toolkit, toolkitLabel, templateId, connection,
|
|
|
40404
40426
|
const isConnected = manifest?.connection.status === "ACTIVE" && !!activeAccountId;
|
|
40405
40427
|
const label = connection?.label ?? manifest?.connection.label ?? null;
|
|
40406
40428
|
if (mode === "flow") {
|
|
40407
|
-
return /* @__PURE__ */ React357.createElement(
|
|
40429
|
+
return /* @__PURE__ */ React357.createElement(Group135, { gap: "xs" }, /* @__PURE__ */ React357.createElement(Text234, { size: "sm", fw: 600 }, toolkitLabel, ":"), isBound ? /* @__PURE__ */ React357.createElement(Badge60, { color: "teal", variant: "light", leftSection: /* @__PURE__ */ React357.createElement(IconCheck30, { size: 12 }) }, label || "Connected account") : /* @__PURE__ */ React357.createElement(Badge60, { color: "gray", variant: "light" }, "Not connected"));
|
|
40408
40430
|
}
|
|
40409
|
-
return /* @__PURE__ */ React357.createElement(Stack251, { gap: "xs" }, /* @__PURE__ */ React357.createElement(
|
|
40431
|
+
return /* @__PURE__ */ React357.createElement(Stack251, { gap: "xs" }, /* @__PURE__ */ React357.createElement(Group135, { justify: "space-between", align: "flex-end" }, /* @__PURE__ */ React357.createElement(Text234, { size: "sm", fw: 600 }, toolkitLabel, " account"), /* @__PURE__ */ React357.createElement(Button82, { size: "xs", variant: "subtle", leftSection: /* @__PURE__ */ React357.createElement(IconRefresh14, { size: 14 }), onClick: loadManifest, disabled: loading || disabled }, "Refresh")), isBound ? /* @__PURE__ */ React357.createElement(Alert92, { color: "teal", styles: actionAlertStyles }, /* @__PURE__ */ React357.createElement(Group135, { justify: "space-between", align: "center" }, /* @__PURE__ */ React357.createElement(Text234, { size: "sm" }, "Bound to ", /* @__PURE__ */ React357.createElement("strong", null, label || "connected account"), ". Anyone running this flow sends as this account.")), /* @__PURE__ */ React357.createElement(Group135, { gap: "xs", mt: "xs" }, /* @__PURE__ */ React357.createElement(Button82, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React357.createElement(IconPlug2, { size: 14 }), onClick: handleConnect, disabled: connecting || disabled }, connecting ? "Reconnecting\u2026" : "Reconnect"), /* @__PURE__ */ React357.createElement(Button82, { size: "xs", variant: "subtle", color: "red", leftSection: /* @__PURE__ */ React357.createElement(IconTrash12, { size: 14 }), onClick: handleRemove, disabled }, "Remove binding"))) : isConnected ? /* @__PURE__ */ React357.createElement(Stack251, { gap: "xs" }, /* @__PURE__ */ React357.createElement(Alert92, { color: "blue", styles: actionAlertStyles }, "Connected as ", /* @__PURE__ */ React357.createElement("strong", null, label || activeAccountId), ". Bind it so runners can send on your behalf."), /* @__PURE__ */ React357.createElement(BasePrimaryButton, { leftSection: binding ? /* @__PURE__ */ React357.createElement(Loader78, { size: 14, color: "dark" }) : /* @__PURE__ */ React357.createElement(IconCheck30, { size: 14 }), onClick: handleBind, disabled: binding || disabled }, binding ? "Binding\u2026" : `Bind to template`)) : /* @__PURE__ */ React357.createElement(
|
|
40410
40432
|
BasePrimaryButton,
|
|
40411
40433
|
{
|
|
40412
40434
|
leftSection: connecting ? /* @__PURE__ */ React357.createElement(Loader78, { size: 14, color: "dark" }) : /* @__PURE__ */ React357.createElement(IconPlug2, { size: 14 }),
|
|
@@ -40418,7 +40440,7 @@ var BoundConnectionSelector = ({ toolkit, toolkitLabel, templateId, connection,
|
|
|
40418
40440
|
};
|
|
40419
40441
|
|
|
40420
40442
|
// src/mantine/blocks/action/actionTypes/_shared/DynamicToolForm.tsx
|
|
40421
|
-
import React358, { useMemo as
|
|
40443
|
+
import React358, { useMemo as useMemo143, useState as useState208 } from "react";
|
|
40422
40444
|
import { Button as Button83, Collapse as Collapse11, Stack as Stack252 } from "@mantine/core";
|
|
40423
40445
|
import { IconChevronDown as IconChevronDown11, IconChevronRight as IconChevronRight13 } from "@tabler/icons-react";
|
|
40424
40446
|
var ALWAYS_EXCLUDE = /* @__PURE__ */ new Set(["user_id", "connected_account_id"]);
|
|
@@ -40426,8 +40448,8 @@ function prettify(name) {
|
|
|
40426
40448
|
return name.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
40427
40449
|
}
|
|
40428
40450
|
var DynamicToolForm = ({ schema, values, onChange, editorDocument, blockId, readOnly, excludeFields }) => {
|
|
40429
|
-
const exclude =
|
|
40430
|
-
const { required, optional } =
|
|
40451
|
+
const exclude = useMemo143(() => /* @__PURE__ */ new Set([...ALWAYS_EXCLUDE, ...excludeFields || []]), [excludeFields]);
|
|
40452
|
+
const { required, optional } = useMemo143(() => {
|
|
40431
40453
|
const reqSet = new Set(schema.parameters.required || []);
|
|
40432
40454
|
const req = [];
|
|
40433
40455
|
const opt = [];
|
|
@@ -40529,7 +40551,7 @@ var DelegatedActionConfig = ({ inputs, onInputsChange, editor, blockId, toolkit,
|
|
|
40529
40551
|
};
|
|
40530
40552
|
|
|
40531
40553
|
// src/mantine/blocks/action/actionTypes/_shared/DelegatedActionFlowDetail.tsx
|
|
40532
|
-
import React360, { useCallback as useCallback152, useEffect as useEffect148, useMemo as
|
|
40554
|
+
import React360, { useCallback as useCallback152, useEffect as useEffect148, useMemo as useMemo144, useRef as useRef49, useState as useState210 } from "react";
|
|
40533
40555
|
import { Alert as Alert93, Button as Button84, Loader as Loader79, Stack as Stack254, Text as Text235 } from "@mantine/core";
|
|
40534
40556
|
import { IconSend as IconSend9 } from "@tabler/icons-react";
|
|
40535
40557
|
var DelegatedActionFlowDetail = ({
|
|
@@ -40547,10 +40569,10 @@ var DelegatedActionFlowDetail = ({
|
|
|
40547
40569
|
schema,
|
|
40548
40570
|
submitLabel
|
|
40549
40571
|
}) => {
|
|
40550
|
-
const parsed =
|
|
40572
|
+
const parsed = useMemo144(() => parseDelegatedToolInputs(inputs), [inputs]);
|
|
40551
40573
|
const editorDocument = editor?.document || [];
|
|
40552
|
-
const resolveOpts =
|
|
40553
|
-
const fieldNames =
|
|
40574
|
+
const resolveOpts = useMemo144(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
40575
|
+
const fieldNames = useMemo144(() => Object.keys(schema.parameters.properties || {}), [schema]);
|
|
40554
40576
|
const resolve = useCallback152(
|
|
40555
40577
|
(name) => {
|
|
40556
40578
|
const v = parsed[name];
|
|
@@ -40581,7 +40603,7 @@ var DelegatedActionFlowDetail = ({
|
|
|
40581
40603
|
const connection = parsed.connection;
|
|
40582
40604
|
const hasBinding = !!connection?.bindingId;
|
|
40583
40605
|
const isCompleted = runtime.state === "completed";
|
|
40584
|
-
const missing =
|
|
40606
|
+
const missing = useMemo144(() => missingRequired(schema, local), [schema, local]);
|
|
40585
40607
|
const canRun = hasBinding && missing.length === 0 && !isCompleted && !isDisabled;
|
|
40586
40608
|
const [error, setError] = useState210(null);
|
|
40587
40609
|
const [submitting, setSubmitting] = useState210(false);
|
|
@@ -40721,22 +40743,22 @@ var LoadBatchesConfig = ({ inputs, onInputsChange }) => {
|
|
|
40721
40743
|
};
|
|
40722
40744
|
|
|
40723
40745
|
// src/mantine/blocks/action/actionTypes/carbon/loadBatches/LoadBatchesFlowDetail.tsx
|
|
40724
|
-
import React362, { useCallback as useCallback154, useEffect as useEffect150, useMemo as
|
|
40725
|
-
import { Alert as Alert94, Button as Button85, Group as
|
|
40746
|
+
import React362, { useCallback as useCallback154, useEffect as useEffect150, useMemo as useMemo145, useRef as useRef50 } from "react";
|
|
40747
|
+
import { Alert as Alert94, Button as Button85, Group as Group136, Loader as Loader80, Stack as Stack256, Text as Text237 } from "@mantine/core";
|
|
40726
40748
|
import { IconAlertCircle as IconAlertCircle32, IconLeaf as IconLeaf3 } from "@tabler/icons-react";
|
|
40727
40749
|
var LoadBatchesFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
40728
40750
|
const handlers = useBlocknoteHandlers();
|
|
40729
|
-
const parsed =
|
|
40751
|
+
const parsed = useMemo145(() => parseLoadBatchesInputs(inputs), [inputs]);
|
|
40730
40752
|
const editorDocument = editor?.document || [];
|
|
40731
|
-
const resolveOpts =
|
|
40732
|
-
const connectedAddress =
|
|
40753
|
+
const resolveOpts = useMemo145(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
40754
|
+
const connectedAddress = useMemo145(() => {
|
|
40733
40755
|
try {
|
|
40734
40756
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
40735
40757
|
} catch {
|
|
40736
40758
|
return "";
|
|
40737
40759
|
}
|
|
40738
40760
|
}, [handlers]);
|
|
40739
|
-
const ownerAddress =
|
|
40761
|
+
const ownerAddress = useMemo145(() => {
|
|
40740
40762
|
const configured = resolveReferences(parsed.ownerAddress || "", editorDocument, resolveOpts).trim();
|
|
40741
40763
|
return configured || connectedAddress;
|
|
40742
40764
|
}, [parsed.ownerAddress, editorDocument, resolveOpts, connectedAddress]);
|
|
@@ -40789,7 +40811,7 @@ var LoadBatchesFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, is
|
|
|
40789
40811
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
40790
40812
|
hasAutoExecutedRef.current = false;
|
|
40791
40813
|
}, [updateRuntime]);
|
|
40792
|
-
return /* @__PURE__ */ React362.createElement(Stack256, { gap: "md" }, /* @__PURE__ */ React362.createElement(Stack256, { gap: 2 }, /* @__PURE__ */ React362.createElement(
|
|
40814
|
+
return /* @__PURE__ */ React362.createElement(Stack256, { gap: "md" }, /* @__PURE__ */ React362.createElement(Stack256, { gap: 2 }, /* @__PURE__ */ React362.createElement(Group136, { gap: "xs" }, /* @__PURE__ */ React362.createElement(IconLeaf3, { size: 16 }), /* @__PURE__ */ React362.createElement(Text237, { fw: 600 }, block?.props?.title || "Load Carbon Batches")), /* @__PURE__ */ React362.createElement(Text237, { size: "sm", c: "dimmed" }, block?.props?.description || "Reconcile harvestable and retireable CARBON credits for this wallet.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React362.createElement(Group136, { gap: "xs" }, /* @__PURE__ */ React362.createElement(Loader80, { size: 14 }), /* @__PURE__ */ React362.createElement(Text237, { size: "sm", c: "dimmed" }, "Waiting for a connected wallet address...")), isRunning && /* @__PURE__ */ React362.createElement(Group136, { gap: "xs" }, /* @__PURE__ */ React362.createElement(Loader80, { size: 14 }), /* @__PURE__ */ React362.createElement(Text237, { size: "sm" }, "Loading carbon batches...")), isCompleted && /* @__PURE__ */ React362.createElement(Stack256, { gap: "xs" }, /* @__PURE__ */ React362.createElement(Group136, { gap: "lg" }, /* @__PURE__ */ React362.createElement(Stack256, { gap: 0 }, /* @__PURE__ */ React362.createElement(Text237, { size: "xs", c: "dimmed" }, "Harvestable"), /* @__PURE__ */ React362.createElement(Text237, { fw: 600 }, totalClaimable, " ", /* @__PURE__ */ React362.createElement(Text237, { span: true, size: "xs", c: "dimmed" }, `(${harvestableBatches.length} batches)`))), /* @__PURE__ */ React362.createElement(Stack256, { gap: 0 }, /* @__PURE__ */ React362.createElement(Text237, { size: "xs", c: "dimmed" }, "Available"), /* @__PURE__ */ React362.createElement(Text237, { fw: 600 }, totalAvailable, " ", /* @__PURE__ */ React362.createElement(Text237, { span: true, size: "xs", c: "dimmed" }, `(${retireableBatches.length} batches)`))), /* @__PURE__ */ React362.createElement(Stack256, { gap: 0 }, /* @__PURE__ */ React362.createElement(Text237, { size: "xs", c: "dimmed" }, "Retired"), /* @__PURE__ */ React362.createElement(Text237, { fw: 600 }, totalRetired))), /* @__PURE__ */ React362.createElement(Group136, null, /* @__PURE__ */ React362.createElement(Button85, { variant: "subtle", size: "xs", onClick: handleRetry, disabled: isDisabled }, "Refresh"))), isStale && /* @__PURE__ */ React362.createElement(Alert94, { icon: /* @__PURE__ */ React362.createElement(IconAlertCircle32, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React362.createElement(Stack256, { gap: "xs" }, /* @__PURE__ */ React362.createElement(Text237, { size: "sm" }, "Block was marked completed but no batch data was recorded. This is stale state \u2014 reset and re-run."), /* @__PURE__ */ React362.createElement(Group136, null, /* @__PURE__ */ React362.createElement(Button85, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React362.createElement(Button85, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React362.createElement(Alert94, { icon: /* @__PURE__ */ React362.createElement(IconAlertCircle32, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React362.createElement(Group136, null, /* @__PURE__ */ React362.createElement(Button85, { variant: "outline", onClick: handleRetry }, "Try Again")));
|
|
40793
40815
|
};
|
|
40794
40816
|
|
|
40795
40817
|
// src/mantine/blocks/action/actionTypes/carbon/loadBatches/index.ts
|
|
@@ -40809,7 +40831,7 @@ import React364, { useCallback as useCallback155, useEffect as useEffect151, use
|
|
|
40809
40831
|
import { Stack as Stack258, Text as Text239 } from "@mantine/core";
|
|
40810
40832
|
|
|
40811
40833
|
// src/mantine/blocks/action/actionTypes/carbon/BatchesSourceSelect.tsx
|
|
40812
|
-
import React363, { useMemo as
|
|
40834
|
+
import React363, { useMemo as useMemo146, useState as useState212 } from "react";
|
|
40813
40835
|
import { Anchor as Anchor4, Select as Select10, Stack as Stack257, Text as Text238 } from "@mantine/core";
|
|
40814
40836
|
var LOAD_BATCHES_ACTION_TYPE = "qi/carbon.loadBatches";
|
|
40815
40837
|
function refFor(blockId, field) {
|
|
@@ -40820,11 +40842,11 @@ function matchBlockId(value, field) {
|
|
|
40820
40842
|
return m?.[1] || null;
|
|
40821
40843
|
}
|
|
40822
40844
|
var BatchesSourceSelect = ({ outputField, value, onChange, editorDocument, currentBlockId, label, description }) => {
|
|
40823
|
-
const options =
|
|
40845
|
+
const options = useMemo146(() => {
|
|
40824
40846
|
const blocks = editorDocument || [];
|
|
40825
40847
|
return blocks.filter((b) => b?.id && b.id !== currentBlockId && b.props?.actionType === LOAD_BATCHES_ACTION_TYPE).map((b) => ({ value: b.id, label: String(b.props?.title || "Load Carbon Batches") }));
|
|
40826
40848
|
}, [editorDocument, currentBlockId]);
|
|
40827
|
-
const selectedBlockId =
|
|
40849
|
+
const selectedBlockId = useMemo146(() => matchBlockId(value, outputField), [value, outputField]);
|
|
40828
40850
|
const [manual, setManual] = useState212(!!value && !selectedBlockId);
|
|
40829
40851
|
if (manual || options.length === 0 && !selectedBlockId) {
|
|
40830
40852
|
return /* @__PURE__ */ React363.createElement(Stack257, { gap: 4 }, /* @__PURE__ */ React363.createElement(
|
|
@@ -40897,7 +40919,7 @@ var HarvestConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
40897
40919
|
};
|
|
40898
40920
|
|
|
40899
40921
|
// src/mantine/blocks/action/actionTypes/carbon/harvest/HarvestFlowDetail.tsx
|
|
40900
|
-
import React365, { useCallback as useCallback156, useEffect as useEffect152, useMemo as
|
|
40922
|
+
import React365, { useCallback as useCallback156, useEffect as useEffect152, useMemo as useMemo147, useState as useState214 } from "react";
|
|
40901
40923
|
import { Alert as Alert95, Checkbox as Checkbox15, Stack as Stack259, Switch as Switch16, Text as Text240 } from "@mantine/core";
|
|
40902
40924
|
import { IconAlertCircle as IconAlertCircle33, IconCheck as IconCheck31 } from "@tabler/icons-react";
|
|
40903
40925
|
function parseBatches(resolved) {
|
|
@@ -40922,21 +40944,21 @@ var HarvestFlowDetail = ({
|
|
|
40922
40944
|
executeAction
|
|
40923
40945
|
}) => {
|
|
40924
40946
|
const handlers = useBlocknoteHandlers();
|
|
40925
|
-
const ownerAddress =
|
|
40947
|
+
const ownerAddress = useMemo147(() => {
|
|
40926
40948
|
try {
|
|
40927
40949
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
40928
40950
|
} catch {
|
|
40929
40951
|
return "";
|
|
40930
40952
|
}
|
|
40931
40953
|
}, [handlers]);
|
|
40932
|
-
const parsed =
|
|
40954
|
+
const parsed = useMemo147(() => parseHarvestConfigInputs(inputs), [inputs]);
|
|
40933
40955
|
const editorDocument = editor?.document || [];
|
|
40934
|
-
const resolveOpts =
|
|
40935
|
-
const batches =
|
|
40956
|
+
const resolveOpts = useMemo147(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
40957
|
+
const batches = useMemo147(() => parseBatches(resolveReferences(parsed.batchesRef || "", editorDocument, resolveOpts)), [parsed.batchesRef, editorDocument, resolveOpts]);
|
|
40936
40958
|
const [harvestAll, setHarvestAll] = useState214(true);
|
|
40937
40959
|
const [selectedIds, setSelectedIds] = useState214(/* @__PURE__ */ new Set());
|
|
40938
40960
|
const [error, setError] = useState214(null);
|
|
40939
|
-
const effectiveBatches =
|
|
40961
|
+
const effectiveBatches = useMemo147(() => harvestAll ? batches : batches.filter((b) => selectedIds.has(b.id)), [harvestAll, batches, selectedIds]);
|
|
40940
40962
|
const effectiveCount = effectiveBatches.length;
|
|
40941
40963
|
const txHash = runtime.output?.transactionHash || "";
|
|
40942
40964
|
const harvestedAmount = runtime.output?.harvestedAmount ?? 0;
|
|
@@ -41057,8 +41079,8 @@ var RetireConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
41057
41079
|
};
|
|
41058
41080
|
|
|
41059
41081
|
// src/mantine/blocks/action/actionTypes/carbon/retire/RetireFlowDetail.tsx
|
|
41060
|
-
import React367, { useCallback as useCallback158, useEffect as useEffect154, useMemo as
|
|
41061
|
-
import { Alert as Alert96, Group as
|
|
41082
|
+
import React367, { useCallback as useCallback158, useEffect as useEffect154, useMemo as useMemo148, useState as useState216 } from "react";
|
|
41083
|
+
import { Alert as Alert96, Group as Group137, NumberInput as NumberInput14, Stack as Stack261, Switch as Switch17, Text as Text242 } from "@mantine/core";
|
|
41062
41084
|
import { IconAlertTriangle as IconAlertTriangle12, IconCheck as IconCheck32, IconAlertCircle as IconAlertCircle34 } from "@tabler/icons-react";
|
|
41063
41085
|
function parseBatches2(resolved) {
|
|
41064
41086
|
const trimmed = (resolved || "").trim();
|
|
@@ -41086,17 +41108,17 @@ var RetireFlowDetail = ({
|
|
|
41086
41108
|
executeAction
|
|
41087
41109
|
}) => {
|
|
41088
41110
|
const handlers = useBlocknoteHandlers();
|
|
41089
|
-
const owner =
|
|
41111
|
+
const owner = useMemo148(() => {
|
|
41090
41112
|
try {
|
|
41091
41113
|
return handlers?.getCurrentUser?.()?.address || "";
|
|
41092
41114
|
} catch {
|
|
41093
41115
|
return "";
|
|
41094
41116
|
}
|
|
41095
41117
|
}, [handlers]);
|
|
41096
|
-
const parsed =
|
|
41118
|
+
const parsed = useMemo148(() => parseRetireConfigInputs(inputs), [inputs]);
|
|
41097
41119
|
const editorDocument = editor?.document || [];
|
|
41098
|
-
const resolveOpts =
|
|
41099
|
-
const batches =
|
|
41120
|
+
const resolveOpts = useMemo148(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
41121
|
+
const batches = useMemo148(() => parseBatches2(resolveReferences(parsed.batchesRef || "", editorDocument, resolveOpts)), [parsed.batchesRef, editorDocument, resolveOpts]);
|
|
41100
41122
|
const [retireAll, setRetireAll] = useState216(true);
|
|
41101
41123
|
const [amounts, setAmounts] = useState216({});
|
|
41102
41124
|
const [reason, setReason] = useState216(parsed.reason || "offset");
|
|
@@ -41104,7 +41126,7 @@ var RetireFlowDetail = ({
|
|
|
41104
41126
|
const [stateRegion, setStateRegion] = useState216("");
|
|
41105
41127
|
const [postal, setPostal] = useState216("");
|
|
41106
41128
|
const [error, setError] = useState216(null);
|
|
41107
|
-
const effectiveSelections =
|
|
41129
|
+
const effectiveSelections = useMemo148(() => {
|
|
41108
41130
|
if (retireAll) return batches.map((b) => ({ id: b.id, amount: Number(b.amount) || 0 })).filter((s) => s.amount > 0);
|
|
41109
41131
|
return batches.map((b) => ({ id: b.id, amount: Number(amounts[b.id]) || 0 })).filter((s) => s.amount > 0);
|
|
41110
41132
|
}, [retireAll, batches, amounts]);
|
|
@@ -41113,7 +41135,7 @@ var RetireFlowDetail = ({
|
|
|
41113
41135
|
const retiredAmount = runtime.output?.retiredAmount ?? 0;
|
|
41114
41136
|
const isCompleted = runtime.state === "completed" && !!txHash;
|
|
41115
41137
|
const runtimeError = runtime.error?.message || null;
|
|
41116
|
-
const jurisdiction =
|
|
41138
|
+
const jurisdiction = useMemo148(() => ({ country, state: stateRegion, postal }), [country, stateRegion, postal]);
|
|
41117
41139
|
const canSign = !isDisabled && !isCompleted && effectiveSelections.length > 0 && totalRetiring > 0 && !!country.trim() && !!owner;
|
|
41118
41140
|
const setAmount = useCallback158((id, value, max) => {
|
|
41119
41141
|
const clamped = Math.max(0, Math.min(Number.isFinite(value) ? value : 0, max));
|
|
@@ -41158,7 +41180,7 @@ var RetireFlowDetail = ({
|
|
|
41158
41180
|
}
|
|
41159
41181
|
});
|
|
41160
41182
|
}, [provideSigningHandler, executeAction, owner, effectiveSelections, reason, jurisdiction]);
|
|
41161
|
-
return /* @__PURE__ */ React367.createElement(Stack261, { gap: "md" }, /* @__PURE__ */ React367.createElement(Stack261, { gap: 2 }, /* @__PURE__ */ React367.createElement(Text242, { fw: 600 }, block?.props?.title || "Retire Carbon"), /* @__PURE__ */ React367.createElement(Text242, { size: "sm", c: "dimmed" }, block?.props?.description || "Permanently retire credits to offset impact.")), isCompleted ? /* @__PURE__ */ React367.createElement(Alert96, { icon: /* @__PURE__ */ React367.createElement(IconCheck32, { size: 16 }), color: "green", title: "Retired" }, /* @__PURE__ */ React367.createElement(Stack261, { gap: "xs" }, /* @__PURE__ */ React367.createElement(Text242, { size: "sm" }, "Permanently retired ", retiredAmount, " CARBON."), /* @__PURE__ */ React367.createElement(Text242, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx: ", txHash))) : batches.length === 0 ? /* @__PURE__ */ React367.createElement(Alert96, { color: "yellow", styles: actionAlertStyles }, "No retireable batches. Configure the retireable batches reference and ensure the upstream Load Carbon Batches block has run.") : /* @__PURE__ */ React367.createElement(React367.Fragment, null, /* @__PURE__ */ React367.createElement(Alert96, { icon: /* @__PURE__ */ React367.createElement(IconAlertTriangle12, { size: 16 }), color: "orange", styles: actionAlertStyles }, "Retiring is permanent and irreversible. Retired credits are burned and cannot be recovered."), /* @__PURE__ */ React367.createElement(Switch17, { label: "Retire full amount of every batch", checked: retireAll, onChange: (event) => setRetireAll(event.currentTarget.checked), disabled: isDisabled }), !retireAll && /* @__PURE__ */ React367.createElement(Stack261, { gap: "xs" }, batches.map((b) => /* @__PURE__ */ React367.createElement(
|
|
41183
|
+
return /* @__PURE__ */ React367.createElement(Stack261, { gap: "md" }, /* @__PURE__ */ React367.createElement(Stack261, { gap: 2 }, /* @__PURE__ */ React367.createElement(Text242, { fw: 600 }, block?.props?.title || "Retire Carbon"), /* @__PURE__ */ React367.createElement(Text242, { size: "sm", c: "dimmed" }, block?.props?.description || "Permanently retire credits to offset impact.")), isCompleted ? /* @__PURE__ */ React367.createElement(Alert96, { icon: /* @__PURE__ */ React367.createElement(IconCheck32, { size: 16 }), color: "green", title: "Retired" }, /* @__PURE__ */ React367.createElement(Stack261, { gap: "xs" }, /* @__PURE__ */ React367.createElement(Text242, { size: "sm" }, "Permanently retired ", retiredAmount, " CARBON."), /* @__PURE__ */ React367.createElement(Text242, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx: ", txHash))) : batches.length === 0 ? /* @__PURE__ */ React367.createElement(Alert96, { color: "yellow", styles: actionAlertStyles }, "No retireable batches. Configure the retireable batches reference and ensure the upstream Load Carbon Batches block has run.") : /* @__PURE__ */ React367.createElement(React367.Fragment, null, /* @__PURE__ */ React367.createElement(Alert96, { icon: /* @__PURE__ */ React367.createElement(IconAlertTriangle12, { size: 16 }), color: "orange", styles: actionAlertStyles }, "Retiring is permanent and irreversible. Retired credits are burned and cannot be recovered."), /* @__PURE__ */ React367.createElement(Switch17, { label: "Retire full amount of every batch", checked: retireAll, onChange: (event) => setRetireAll(event.currentTarget.checked), disabled: isDisabled }), !retireAll && /* @__PURE__ */ React367.createElement(Stack261, { gap: "xs" }, batches.map((b) => /* @__PURE__ */ React367.createElement(Group137, { key: b.id, justify: "space-between", wrap: "nowrap" }, /* @__PURE__ */ React367.createElement(Text242, { size: "sm", style: { flex: 1, wordBreak: "break-all" } }, b.alsoKnownAs || b.id, " ", /* @__PURE__ */ React367.createElement(Text242, { span: true, size: "xs", c: "dimmed" }, "(max ", b.amount, ")")), /* @__PURE__ */ React367.createElement(
|
|
41162
41184
|
NumberInput14,
|
|
41163
41185
|
{
|
|
41164
41186
|
value: amounts[b.id] ?? 0,
|
|
@@ -41168,7 +41190,7 @@ var RetireFlowDetail = ({
|
|
|
41168
41190
|
disabled: isDisabled,
|
|
41169
41191
|
w: 120
|
|
41170
41192
|
}
|
|
41171
|
-
)))), /* @__PURE__ */ React367.createElement(
|
|
41193
|
+
)))), /* @__PURE__ */ React367.createElement(Group137, { grow: true }, /* @__PURE__ */ React367.createElement(BaseTextInput, { label: "Country", placeholder: "Required", value: country, onChange: (e) => setCountry(e.currentTarget.value) }), /* @__PURE__ */ React367.createElement(BaseTextInput, { label: "State / Region", value: stateRegion, onChange: (e) => setStateRegion(e.currentTarget.value) }), /* @__PURE__ */ React367.createElement(BaseTextInput, { label: "Postal code", value: postal, onChange: (e) => setPostal(e.currentTarget.value) })), /* @__PURE__ */ React367.createElement(BaseTextInput, { label: "Reason", placeholder: "offset", value: reason, onChange: (e) => setReason(e.currentTarget.value) }), /* @__PURE__ */ React367.createElement(Text242, { size: "xs", c: "dimmed" }, "Retiring ", totalRetiring, " CARBON across ", effectiveSelections.length, " batch", effectiveSelections.length === 1 ? "" : "es", !country.trim() ? " \xB7 enter a country to continue" : ""), !owner && /* @__PURE__ */ React367.createElement(Text242, { size: "xs", c: "red" }, "No connected wallet \u2014 connect a wallet to retire.")), (error || runtimeError) && !isCompleted && /* @__PURE__ */ React367.createElement(Alert96, { icon: /* @__PURE__ */ React367.createElement(IconAlertCircle34, { size: 16 }), color: "red", styles: actionAlertStyles }, error || runtimeError));
|
|
41172
41194
|
};
|
|
41173
41195
|
|
|
41174
41196
|
// src/mantine/blocks/action/actionTypes/carbon/retire/index.ts
|
|
@@ -41256,8 +41278,8 @@ var EntityTransferConfig = ({ inputs, onInputsChange }) => {
|
|
|
41256
41278
|
};
|
|
41257
41279
|
|
|
41258
41280
|
// src/mantine/blocks/action/actionTypes/entityTransfer/EntityTransferFlowDetail.tsx
|
|
41259
|
-
import React369, { useCallback as useCallback160, useEffect as useEffect156, useMemo as
|
|
41260
|
-
import { Alert as Alert97, Button as Button86, Group as
|
|
41281
|
+
import React369, { useCallback as useCallback160, useEffect as useEffect156, useMemo as useMemo149, useState as useState218 } from "react";
|
|
41282
|
+
import { Alert as Alert97, Button as Button86, Group as Group138, Loader as Loader81, Stack as Stack263, Text as Text244 } from "@mantine/core";
|
|
41261
41283
|
import { IconAlertTriangle as IconAlertTriangle13, IconCheck as IconCheck33, IconAlertCircle as IconAlertCircle35 } from "@tabler/icons-react";
|
|
41262
41284
|
var EntityTransferFlowDetail = ({
|
|
41263
41285
|
inputs,
|
|
@@ -41272,21 +41294,21 @@ var EntityTransferFlowDetail = ({
|
|
|
41272
41294
|
executeAction
|
|
41273
41295
|
}) => {
|
|
41274
41296
|
const handlers = useBlocknoteHandlers();
|
|
41275
|
-
const currentUser =
|
|
41297
|
+
const currentUser = useMemo149(() => {
|
|
41276
41298
|
try {
|
|
41277
41299
|
return handlers?.getCurrentUser?.() || null;
|
|
41278
41300
|
} catch {
|
|
41279
41301
|
return null;
|
|
41280
41302
|
}
|
|
41281
41303
|
}, [handlers]);
|
|
41282
|
-
const parsed =
|
|
41304
|
+
const parsed = useMemo149(() => parseEntityTransferConfigInputs(inputs), [inputs]);
|
|
41283
41305
|
const editorDocument = editor?.document || [];
|
|
41284
|
-
const resolveOpts =
|
|
41306
|
+
const resolveOpts = useMemo149(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
41285
41307
|
const resolve = useCallback160((val) => resolveReferences(val || "", editorDocument, resolveOpts).trim(), [editorDocument, resolveOpts]);
|
|
41286
|
-
const resolvedEntityDid =
|
|
41287
|
-
const templateRecipient =
|
|
41288
|
-
const resolvedOwnerDid =
|
|
41289
|
-
const resolvedOwnerAddress =
|
|
41308
|
+
const resolvedEntityDid = useMemo149(() => resolve(parsed.entityDid), [resolve, parsed.entityDid]);
|
|
41309
|
+
const templateRecipient = useMemo149(() => resolve(parsed.recipientDid), [resolve, parsed.recipientDid]);
|
|
41310
|
+
const resolvedOwnerDid = useMemo149(() => resolve(parsed.ownerDid) || currentUser?.did || "", [resolve, parsed.ownerDid, currentUser]);
|
|
41311
|
+
const resolvedOwnerAddress = useMemo149(() => resolve(parsed.ownerAddress) || currentUser?.address || "", [resolve, parsed.ownerAddress, currentUser]);
|
|
41290
41312
|
const [recipientInput, setRecipientInput] = useState218("");
|
|
41291
41313
|
const [error, setError] = useState218(null);
|
|
41292
41314
|
const effectiveRecipient = (recipientInput.trim() || templateRecipient).trim();
|
|
@@ -41343,7 +41365,7 @@ var EntityTransferFlowDetail = ({
|
|
|
41343
41365
|
console.log("[entity.transfer] reset: clearing runtime to idle");
|
|
41344
41366
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
41345
41367
|
}, [updateRuntime]);
|
|
41346
|
-
return /* @__PURE__ */ React369.createElement(Stack263, { gap: "md" }, /* @__PURE__ */ React369.createElement(Stack263, { gap: 2 }, /* @__PURE__ */ React369.createElement(Text244, { fw: 600 }, block?.props?.title || "Transfer Entity"), /* @__PURE__ */ React369.createElement(Text244, { size: "sm", c: "dimmed" }, block?.props?.description || "Transfer ownership of an entity to a new owner.")), isCompleted ? /* @__PURE__ */ React369.createElement(Alert97, { icon: /* @__PURE__ */ React369.createElement(IconCheck33, { size: 16 }), color: "green", title: "Entity Transferred" }, /* @__PURE__ */ React369.createElement(Stack263, { gap: "xs" }, /* @__PURE__ */ React369.createElement(Text244, { size: "sm" }, "Ownership transferred to ", completedRecipient || effectiveRecipient, "."), recipientResolved && recipientResolved !== completedRecipient && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Resolved recipient: ", recipientResolved), createdRecipientIid && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed" }, "Created the recipient's IID document before transferring."), /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx: ", txHash))) : isStale ? /* @__PURE__ */ React369.createElement(Alert97, { icon: /* @__PURE__ */ React369.createElement(IconAlertCircle35, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React369.createElement(Stack263, { gap: "xs" }, /* @__PURE__ */ React369.createElement(Text244, { size: "sm" }, "Block was marked completed but no transaction hash was recorded. This is stale state from a previous run \u2014 reset and re-run."), /* @__PURE__ */ React369.createElement(
|
|
41368
|
+
return /* @__PURE__ */ React369.createElement(Stack263, { gap: "md" }, /* @__PURE__ */ React369.createElement(Stack263, { gap: 2 }, /* @__PURE__ */ React369.createElement(Text244, { fw: 600 }, block?.props?.title || "Transfer Entity"), /* @__PURE__ */ React369.createElement(Text244, { size: "sm", c: "dimmed" }, block?.props?.description || "Transfer ownership of an entity to a new owner.")), isCompleted ? /* @__PURE__ */ React369.createElement(Alert97, { icon: /* @__PURE__ */ React369.createElement(IconCheck33, { size: 16 }), color: "green", title: "Entity Transferred" }, /* @__PURE__ */ React369.createElement(Stack263, { gap: "xs" }, /* @__PURE__ */ React369.createElement(Text244, { size: "sm" }, "Ownership transferred to ", completedRecipient || effectiveRecipient, "."), recipientResolved && recipientResolved !== completedRecipient && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Resolved recipient: ", recipientResolved), createdRecipientIid && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed" }, "Created the recipient's IID document before transferring."), /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx: ", txHash))) : isStale ? /* @__PURE__ */ React369.createElement(Alert97, { icon: /* @__PURE__ */ React369.createElement(IconAlertCircle35, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React369.createElement(Stack263, { gap: "xs" }, /* @__PURE__ */ React369.createElement(Text244, { size: "sm" }, "Block was marked completed but no transaction hash was recorded. This is stale state from a previous run \u2014 reset and re-run."), /* @__PURE__ */ React369.createElement(Group138, null, /* @__PURE__ */ React369.createElement(Button86, { variant: "outline", size: "xs", onClick: handleReset }, "Reset"), /* @__PURE__ */ React369.createElement(Button86, { variant: "filled", size: "xs", onClick: execute, disabled: !inputsReady }, "Force Run Now")))) : /* @__PURE__ */ React369.createElement(React369.Fragment, null, /* @__PURE__ */ React369.createElement(Alert97, { icon: /* @__PURE__ */ React369.createElement(IconAlertTriangle13, { size: 16 }), color: "orange", styles: actionAlertStyles }, "Transferring an entity is permanent \u2014 you will lose control of it once the new owner accepts ownership."), !resolvedEntityDid && /* @__PURE__ */ React369.createElement(Group138, { gap: "xs" }, /* @__PURE__ */ React369.createElement(Loader81, { size: 14 }), /* @__PURE__ */ React369.createElement(Text244, { size: "sm", c: "dimmed" }, "Waiting for upstream entity DID\u2026")), /* @__PURE__ */ React369.createElement(
|
|
41347
41369
|
BaseTextInput,
|
|
41348
41370
|
{
|
|
41349
41371
|
label: "Recipient DID",
|
|
@@ -41352,7 +41374,7 @@ var EntityTransferFlowDetail = ({
|
|
|
41352
41374
|
onChange: (event) => setRecipientInput(event.currentTarget.value),
|
|
41353
41375
|
disabled: isDisabled
|
|
41354
41376
|
}
|
|
41355
|
-
), resolvedEntityDid && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Entity: ", resolvedEntityDid), isRunning && /* @__PURE__ */ React369.createElement(
|
|
41377
|
+
), resolvedEntityDid && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Entity: ", resolvedEntityDid), isRunning && /* @__PURE__ */ React369.createElement(Group138, { gap: "xs" }, /* @__PURE__ */ React369.createElement(Loader81, { size: 14 }), /* @__PURE__ */ React369.createElement(Text244, { size: "sm" }, "Transferring entity on-chain\u2026")), !inputsReady && resolvedEntityDid && /* @__PURE__ */ React369.createElement(Text244, { size: "xs", c: "dimmed" }, "Enter a recipient DID to continue.")), (error || runtimeError) && !isCompleted && /* @__PURE__ */ React369.createElement(Alert97, { icon: /* @__PURE__ */ React369.createElement(IconAlertCircle35, { size: 16 }), color: "red", styles: actionAlertStyles }, error || runtimeError), isFailed && !isStale && /* @__PURE__ */ React369.createElement(Group138, null, /* @__PURE__ */ React369.createElement(Button86, { variant: "outline", size: "xs", onClick: handleReset }, "Try Again")));
|
|
41356
41378
|
};
|
|
41357
41379
|
|
|
41358
41380
|
// src/mantine/blocks/action/actionTypes/entityTransfer/index.ts
|
|
@@ -41449,8 +41471,8 @@ var KycVerifyConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
41449
41471
|
};
|
|
41450
41472
|
|
|
41451
41473
|
// src/mantine/blocks/action/actionTypes/kycVerify/KycVerifyFlowDetail.tsx
|
|
41452
|
-
import React371, { useCallback as useCallback162, useEffect as useEffect158, useMemo as
|
|
41453
|
-
import { Alert as Alert98, Button as Button87, Group as
|
|
41474
|
+
import React371, { useCallback as useCallback162, useEffect as useEffect158, useMemo as useMemo150, useRef as useRef51, useState as useState220 } from "react";
|
|
41475
|
+
import { Alert as Alert98, Button as Button87, Group as Group139, Loader as Loader82, Radio as Radio6, Stack as Stack265, Stepper, Text as Text246 } from "@mantine/core";
|
|
41454
41476
|
import { IconAlertCircle as IconAlertCircle36, IconCheck as IconCheck34, IconExternalLink as IconExternalLink3, IconId, IconRefresh as IconRefresh15 } from "@tabler/icons-react";
|
|
41455
41477
|
import { SurveyModel as SurveyModel13 } from "@ixo/surveys";
|
|
41456
41478
|
var POLL_INTERVAL_MS4 = 15e3;
|
|
@@ -41593,7 +41615,7 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41593
41615
|
})();
|
|
41594
41616
|
}, [busy, isDisabled, openVerification]);
|
|
41595
41617
|
const showSurvey = !!form && !form.hasExistingCredential && (!serverStatus || serverStatus === "unknown");
|
|
41596
|
-
const surveyModel =
|
|
41618
|
+
const surveyModel = useMemo150(() => {
|
|
41597
41619
|
if (!showSurvey || !form?.surveyJson) return null;
|
|
41598
41620
|
const model = new SurveyModel13(form.surveyJson);
|
|
41599
41621
|
model.applyTheme(buildSurveyTheme());
|
|
@@ -41696,9 +41718,9 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41696
41718
|
}
|
|
41697
41719
|
return /* @__PURE__ */ React371.createElement(Stack265, { gap: "md" }, /* @__PURE__ */ React371.createElement(Stack265, { gap: 2 }, /* @__PURE__ */ React371.createElement(Text246, { fw: 600 }, title), /* @__PURE__ */ React371.createElement(Text246, { size: "sm", c: "dimmed" }, description)), isStale && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "yellow", title: t("actionTypes.kycVerify.flow.staleTitle", { defaultValue: "Inconsistent State" }) }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.staleBody", {
|
|
41698
41720
|
defaultValue: "This step was marked completed but no credential CID was recorded. This is stale state from a previous run \u2014 reset and complete the save again."
|
|
41699
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41721
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(Button87, { variant: "outline", size: "xs", onClick: handleReset }, t("actionTypes.kycVerify.flow.reset", { defaultValue: "Reset" }))))), !configured && /* @__PURE__ */ React371.createElement(Alert98, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.kycVerify.flow.notConfigured", { defaultValue: "Configure the KYC Protocol DID in template mode before running this action." })), configured && !inputsReady && /* @__PURE__ */ React371.createElement(Group139, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Loader82, { size: 14 }), /* @__PURE__ */ React371.createElement(Text246, { size: "sm", c: "dimmed" }, t("actionTypes.kycVerify.flow.waitingInputs", { defaultValue: "Waiting for the KYC protocol DID from an upstream block\u2026" }))), configured && inputsReady && !kycAvailable && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", styles: actionAlertStyles }, t("actionTypes.kycVerify.flow.handlersUnavailable", {
|
|
41700
41722
|
defaultValue: "KYC verification is not available: the host app does not provide the KYC handlers (kycLoadForm \u2026 kycSaveCredential)."
|
|
41701
|
-
})), kycAvailable && inputsReady && loadingForm && /* @__PURE__ */ React371.createElement(
|
|
41723
|
+
})), kycAvailable && inputsReady && loadingForm && /* @__PURE__ */ React371.createElement(Group139, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Loader82, { size: 14 }), /* @__PURE__ */ React371.createElement(Text246, { size: "sm", c: "dimmed" }, t("actionTypes.kycVerify.flow.loadingForm", { defaultValue: "Loading your verification status\u2026" }))), kycAvailable && inputsReady && !loadingForm && loadError && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "xs" }, loadError), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(Button87, { variant: "outline", size: "xs", leftSection: /* @__PURE__ */ React371.createElement(IconRefresh15, { size: 14 }), onClick: () => setLoadRetryKey((k) => k + 1) }, t("actionTypes.kycVerify.flow.retry", { defaultValue: "Retry" }))))), kycAvailable && inputsReady && !loadingForm && !loadError && form && !isStale && /* @__PURE__ */ React371.createElement(React371.Fragment, null, form.hasExistingCredential ? (
|
|
41702
41724
|
// Already verified — the user picks which Vault credential to use
|
|
41703
41725
|
// (auto-picked when there is only one), then the formal completion
|
|
41704
41726
|
// records its proof (saveCredential is idempotent).
|
|
@@ -41713,7 +41735,7 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41713
41735
|
}
|
|
41714
41736
|
))))) : /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.alreadyVerifiedBody", {
|
|
41715
41737
|
defaultValue: "You already hold a credential for this verification. Use it to complete this step."
|
|
41716
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41738
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41717
41739
|
Button87,
|
|
41718
41740
|
{
|
|
41719
41741
|
size: "xs",
|
|
@@ -41726,12 +41748,12 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41726
41748
|
) : !serverStatus || serverStatus === "unknown" ? (
|
|
41727
41749
|
// Phase 1 — details form. The ixo-kyc-survey class normalises any
|
|
41728
41750
|
// inline colours in template-authored HTML to the site theme.
|
|
41729
|
-
/* @__PURE__ */ React371.createElement(React371.Fragment, null, surveyModel && /* @__PURE__ */ React371.createElement("div", { className: "ixo-kyc-survey" }, /* @__PURE__ */ React371.createElement(StableSurvey, { model: surveyModel })), busy === "initiate" && /* @__PURE__ */ React371.createElement(
|
|
41751
|
+
/* @__PURE__ */ React371.createElement(React371.Fragment, null, surveyModel && /* @__PURE__ */ React371.createElement("div", { className: "ixo-kyc-survey" }, /* @__PURE__ */ React371.createElement(StableSurvey, { model: surveyModel })), busy === "initiate" && /* @__PURE__ */ React371.createElement(Group139, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Loader82, { size: 14 }), /* @__PURE__ */ React371.createElement(Text246, { size: "sm", c: "dimmed" }, t("actionTypes.kycVerify.flow.initiating", { defaultValue: "Submitting your details and opening the verification page\u2026" }))))
|
|
41730
41752
|
) : serverStatus === "verify" ? (
|
|
41731
41753
|
// Phase 2 — hosted verification pending.
|
|
41732
41754
|
/* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, renderStepper(serverStatus), /* @__PURE__ */ React371.createElement(Text246, { size: "sm", c: "dimmed" }, t("actionTypes.kycVerify.flow.verifyHint", {
|
|
41733
41755
|
defaultValue: "Complete your identity verification in the secure browser tab. This step updates automatically once you finish."
|
|
41734
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41756
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41735
41757
|
Button87,
|
|
41736
41758
|
{
|
|
41737
41759
|
size: "xs",
|
|
@@ -41743,16 +41765,16 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41743
41765
|
)))
|
|
41744
41766
|
) : serverStatus === "review" || serverStatus === "clear" || serverStatus === "issuing" ? (
|
|
41745
41767
|
// Phase 3 — server-side progression; 15s polling is active.
|
|
41746
|
-
/* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, renderStepper(serverStatus), /* @__PURE__ */ React371.createElement(
|
|
41768
|
+
/* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, renderStepper(serverStatus), /* @__PURE__ */ React371.createElement(Group139, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Loader82, { size: 14 }), /* @__PURE__ */ React371.createElement(Text246, { size: "xs", c: "dimmed" }, t("actionTypes.kycVerify.flow.polling", { defaultValue: "Checking the verification status every 15 seconds\u2026" }))))
|
|
41747
41769
|
) : serverStatus === "issued" ? (
|
|
41748
41770
|
// Phase 4 — credential issued; formal save step.
|
|
41749
|
-
/* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, renderStepper(serverStatus), /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.issuedHint", { defaultValue: "Your credential has been issued. Save it to your Vault to complete this step." })), /* @__PURE__ */ React371.createElement(
|
|
41771
|
+
/* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, renderStepper(serverStatus), /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.issuedHint", { defaultValue: "Your credential has been issued. Save it to your Vault to complete this step." })), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(Button87, { leftSection: busy === "save" || isRunning ? /* @__PURE__ */ React371.createElement(Loader82, { size: 14 }) : /* @__PURE__ */ React371.createElement(IconId, { size: 14 }), onClick: handleSave, disabled: !!busy || isRunning || isDisabled }, t("actionTypes.kycVerify.flow.saveCredential", { defaultValue: "Save credential to your Vault" }))))
|
|
41750
41772
|
) : serverStatus === "complete" ? (
|
|
41751
41773
|
// Server says complete but the block has no proof yet (e.g. saved
|
|
41752
41774
|
// from another device or a re-instantiated flow) — record it here.
|
|
41753
41775
|
/* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconCheck34, { size: 16 }), color: "blue", title: t("actionTypes.kycVerify.flow.serverCompleteTitle", { defaultValue: "Verification Already Complete" }) }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.serverCompleteBody", {
|
|
41754
41776
|
defaultValue: "The KYC server reports this verification as complete. Record it on this step to continue the flow."
|
|
41755
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41777
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41756
41778
|
Button87,
|
|
41757
41779
|
{
|
|
41758
41780
|
size: "xs",
|
|
@@ -41764,7 +41786,7 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41764
41786
|
))))
|
|
41765
41787
|
) : serverStatus === "rejected" ? /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", title: t("actionTypes.kycVerify.flow.rejectedTitle", { defaultValue: "Verification Rejected" }) }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.rejectedBody", {
|
|
41766
41788
|
defaultValue: "Your identity verification was rejected by the provider. This is usually final for the submitted documents \u2014 contact the flow owner or support to resolve it."
|
|
41767
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41789
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41768
41790
|
Button87,
|
|
41769
41791
|
{
|
|
41770
41792
|
variant: "outline",
|
|
@@ -41776,9 +41798,9 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41776
41798
|
t("actionTypes.kycVerify.flow.checkStatus", { defaultValue: "Check status" })
|
|
41777
41799
|
)))) : serverStatus === "attention" ? /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, renderStepper(serverStatus), /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "yellow", title: t("actionTypes.kycVerify.flow.attentionTitle", { defaultValue: "Manual Review" }) }, /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.attentionBody", {
|
|
41778
41800
|
defaultValue: "Your verification needs manual review by the provider. No action is required \u2014 this step updates automatically when the review finishes."
|
|
41779
|
-
}))), /* @__PURE__ */ React371.createElement(
|
|
41801
|
+
}))), /* @__PURE__ */ React371.createElement(Group139, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Loader82, { size: 14 }), /* @__PURE__ */ React371.createElement(Text246, { size: "xs", c: "dimmed" }, t("actionTypes.kycVerify.flow.polling", { defaultValue: "Checking the verification status every 15 seconds\u2026" })))) : serverStatus === "error" ? /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", title: t("actionTypes.kycVerify.flow.errorTitle", { defaultValue: "Verification Error" }) }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "sm" }, t("actionTypes.kycVerify.flow.errorBody", {
|
|
41780
41802
|
defaultValue: "The verification hit a server-side error. It can usually be recovered \u2014 continue the verification to retry."
|
|
41781
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41803
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41782
41804
|
Button87,
|
|
41783
41805
|
{
|
|
41784
41806
|
size: "xs",
|
|
@@ -41799,7 +41821,7 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41799
41821
|
t("actionTypes.kycVerify.flow.checkStatus", { defaultValue: "Check status" })
|
|
41800
41822
|
)))) : (
|
|
41801
41823
|
// Unrecognised status — surface it verbatim rather than dead-ending.
|
|
41802
|
-
/* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "yellow", styles: actionAlertStyles }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "xs" }, t("actionTypes.kycVerify.flow.unknownStatus", { defaultValue: "Unrecognised verification status" }), ": ", serverStatus), /* @__PURE__ */ React371.createElement(
|
|
41824
|
+
/* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "yellow", styles: actionAlertStyles }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "xs" }, t("actionTypes.kycVerify.flow.unknownStatus", { defaultValue: "Unrecognised verification status" }), ": ", serverStatus), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41803
41825
|
Button87,
|
|
41804
41826
|
{
|
|
41805
41827
|
variant: "outline",
|
|
@@ -41812,7 +41834,7 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41812
41834
|
))))
|
|
41813
41835
|
)), fallbackUrl && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconExternalLink3, { size: 16 }), color: "yellow", styles: actionAlertStyles }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "xs" }, t("actionTypes.kycVerify.flow.popupBlocked", {
|
|
41814
41836
|
defaultValue: "Your browser blocked the verification tab. Open it with the link below, or allow pop-ups and press Continue verification again."
|
|
41815
|
-
})), /* @__PURE__ */ React371.createElement(
|
|
41837
|
+
})), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(
|
|
41816
41838
|
Button87,
|
|
41817
41839
|
{
|
|
41818
41840
|
component: "a",
|
|
@@ -41824,7 +41846,7 @@ var KycVerifyFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
41824
41846
|
onClick: () => setFallbackUrl(null)
|
|
41825
41847
|
},
|
|
41826
41848
|
t("actionTypes.kycVerify.flow.openVerification", { defaultValue: "Open verification page" })
|
|
41827
|
-
)))), actionError && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", styles: actionAlertStyles }, actionError), isFailed && runtimeError && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "xs" }, runtimeError), /* @__PURE__ */ React371.createElement(
|
|
41849
|
+
)))), actionError && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", styles: actionAlertStyles }, actionError), isFailed && runtimeError && /* @__PURE__ */ React371.createElement(Alert98, { icon: /* @__PURE__ */ React371.createElement(IconAlertCircle36, { size: 16 }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React371.createElement(Stack265, { gap: "xs" }, /* @__PURE__ */ React371.createElement(Text246, { size: "xs" }, runtimeError), /* @__PURE__ */ React371.createElement(Group139, null, /* @__PURE__ */ React371.createElement(Button87, { variant: "outline", size: "xs", onClick: handleReset }, t("actionTypes.kycVerify.flow.dismiss", { defaultValue: "Dismiss" }))))));
|
|
41828
41850
|
};
|
|
41829
41851
|
|
|
41830
41852
|
// src/mantine/blocks/action/actionTypes/kycVerify/index.ts
|
|
@@ -41849,7 +41871,7 @@ var WalletGenerateConfig = () => {
|
|
|
41849
41871
|
|
|
41850
41872
|
// src/mantine/blocks/action/actionTypes/walletGenerate/WalletGenerateFlowDetail.tsx
|
|
41851
41873
|
import React373, { useCallback as useCallback163 } from "react";
|
|
41852
|
-
import { Alert as Alert99, Button as Button88, Group as
|
|
41874
|
+
import { Alert as Alert99, Button as Button88, Group as Group140, Loader as Loader83, Stack as Stack267, Text as Text248 } from "@mantine/core";
|
|
41853
41875
|
import { IconCheck as IconCheck35, IconAlertCircle as IconAlertCircle37 } from "@tabler/icons-react";
|
|
41854
41876
|
var WalletGenerateFlowDetail = ({ block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
41855
41877
|
const generatedAddress = runtime.output?.address || "";
|
|
@@ -41884,7 +41906,7 @@ var WalletGenerateFlowDetail = ({ block, runtime, updateRuntime, isDisabled, exe
|
|
|
41884
41906
|
const handleRetry = useCallback163(() => {
|
|
41885
41907
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
41886
41908
|
}, [updateRuntime]);
|
|
41887
|
-
return /* @__PURE__ */ React373.createElement(Stack267, { gap: "md" }, /* @__PURE__ */ React373.createElement(Stack267, { gap: 2 }, /* @__PURE__ */ React373.createElement(Text248, { fw: 600 }, block?.props?.title || "Generate Wallet"), /* @__PURE__ */ React373.createElement(Text248, { size: "sm", c: "dimmed" }, block?.props?.description || "Generate a new wallet with address and DID.")), isRunning && /* @__PURE__ */ React373.createElement(
|
|
41909
|
+
return /* @__PURE__ */ React373.createElement(Stack267, { gap: "md" }, /* @__PURE__ */ React373.createElement(Stack267, { gap: 2 }, /* @__PURE__ */ React373.createElement(Text248, { fw: 600 }, block?.props?.title || "Generate Wallet"), /* @__PURE__ */ React373.createElement(Text248, { size: "sm", c: "dimmed" }, block?.props?.description || "Generate a new wallet with address and DID.")), isRunning && /* @__PURE__ */ React373.createElement(Group140, { gap: "xs" }, /* @__PURE__ */ React373.createElement(Loader83, { size: 14 }), /* @__PURE__ */ React373.createElement(Text248, { size: "sm" }, "Generating wallet...")), isCompleted && /* @__PURE__ */ React373.createElement(Alert99, { icon: /* @__PURE__ */ React373.createElement(IconCheck35, { size: 16 }), title: "Wallet Generated", color: "green" }, /* @__PURE__ */ React373.createElement(Stack267, { gap: "xs" }, generatedAddress && /* @__PURE__ */ React373.createElement(Text248, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Address: ", generatedAddress), generatedDid && /* @__PURE__ */ React373.createElement(Text248, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "DID: ", generatedDid), /* @__PURE__ */ React373.createElement(Text248, { size: "xs", c: "dimmed" }, "Mnemonic has been stored securely."))), isStale && /* @__PURE__ */ React373.createElement(Alert99, { icon: /* @__PURE__ */ React373.createElement(IconAlertCircle37, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React373.createElement(Stack267, { gap: "xs" }, /* @__PURE__ */ React373.createElement(Text248, { size: "sm" }, "Marked completed but no address recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React373.createElement(Group140, null, /* @__PURE__ */ React373.createElement(Button88, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React373.createElement(Button88, { variant: "filled", size: "xs", onClick: handleExecute }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React373.createElement(Alert99, { icon: /* @__PURE__ */ React373.createElement(IconAlertCircle37, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React373.createElement(Group140, null, /* @__PURE__ */ React373.createElement(Button88, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React373.createElement(Group140, null, /* @__PURE__ */ React373.createElement(Button88, { variant: "filled", size: "sm", onClick: handleExecute, disabled: isDisabled }, isCompleted ? "Re-generate" : "Run Now")));
|
|
41888
41910
|
};
|
|
41889
41911
|
|
|
41890
41912
|
// src/mantine/blocks/action/actionTypes/walletGenerate/index.ts
|
|
@@ -41941,8 +41963,8 @@ var WalletFundConfig = ({ inputs, onInputsChange }) => {
|
|
|
41941
41963
|
};
|
|
41942
41964
|
|
|
41943
41965
|
// src/mantine/blocks/action/actionTypes/walletFund/WalletFundFlowDetail.tsx
|
|
41944
|
-
import React375, { useCallback as useCallback165, useEffect as useEffect160, useMemo as
|
|
41945
|
-
import { Alert as Alert100, Group as
|
|
41966
|
+
import React375, { useCallback as useCallback165, useEffect as useEffect160, useMemo as useMemo151 } from "react";
|
|
41967
|
+
import { Alert as Alert100, Group as Group141, Loader as Loader84, Stack as Stack269, Text as Text250 } from "@mantine/core";
|
|
41946
41968
|
import { IconCheck as IconCheck36, IconAlertCircle as IconAlertCircle38 } from "@tabler/icons-react";
|
|
41947
41969
|
var WalletFundFlowDetail = ({
|
|
41948
41970
|
inputs,
|
|
@@ -41955,10 +41977,10 @@ var WalletFundFlowDetail = ({
|
|
|
41955
41977
|
unlockSigning,
|
|
41956
41978
|
executeAction
|
|
41957
41979
|
}) => {
|
|
41958
|
-
const parsed =
|
|
41980
|
+
const parsed = useMemo151(() => parseWalletFundInputs(inputs), [inputs]);
|
|
41959
41981
|
const editorDocument = editor?.document || [];
|
|
41960
|
-
const resolveOpts =
|
|
41961
|
-
const resolvedInputs =
|
|
41982
|
+
const resolveOpts = useMemo151(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
41983
|
+
const resolvedInputs = useMemo151(() => {
|
|
41962
41984
|
const r = (val) => resolveReferences(String(val ?? ""), editorDocument, resolveOpts).trim();
|
|
41963
41985
|
return {
|
|
41964
41986
|
address: r(parsed.address),
|
|
@@ -42009,7 +42031,7 @@ var WalletFundFlowDetail = ({
|
|
|
42009
42031
|
const handleRetry = useCallback165(() => {
|
|
42010
42032
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
42011
42033
|
}, [updateRuntime]);
|
|
42012
|
-
return /* @__PURE__ */ React375.createElement(Stack269, { gap: "md" }, /* @__PURE__ */ React375.createElement(Stack269, { gap: 2 }, /* @__PURE__ */ React375.createElement(Text250, { fw: 600 }, block?.props?.title || "Fund Wallet"), /* @__PURE__ */ React375.createElement(Text250, { size: "sm", c: "dimmed" }, block?.props?.description || "Send tokens to the target wallet address.")), /* @__PURE__ */ React375.createElement(Stack269, { gap: "xs", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React375.createElement(
|
|
42034
|
+
return /* @__PURE__ */ React375.createElement(Stack269, { gap: "md" }, /* @__PURE__ */ React375.createElement(Stack269, { gap: 2 }, /* @__PURE__ */ React375.createElement(Text250, { fw: 600 }, block?.props?.title || "Fund Wallet"), /* @__PURE__ */ React375.createElement(Text250, { size: "sm", c: "dimmed" }, block?.props?.description || "Send tokens to the target wallet address.")), /* @__PURE__ */ React375.createElement(Stack269, { gap: "xs", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React375.createElement(Group141, { gap: "xs" }, /* @__PURE__ */ React375.createElement(Text250, { size: "xs", c: "dimmed", style: { width: 80 } }, "Address:"), /* @__PURE__ */ React375.createElement(Text250, { size: "xs", style: { wordBreak: "break-all" } }, resolvedAddress || "Waiting for address...")), /* @__PURE__ */ React375.createElement(Group141, { gap: "xs" }, /* @__PURE__ */ React375.createElement(Text250, { size: "xs", c: "dimmed", style: { width: 80 } }, "Amount:"), /* @__PURE__ */ React375.createElement(Text250, { size: "xs" }, resolvedInputs.amount || parsed.amount || 25e4))), isRunning && /* @__PURE__ */ React375.createElement(Group141, { gap: "xs" }, /* @__PURE__ */ React375.createElement(Loader84, { size: 14 }), /* @__PURE__ */ React375.createElement(Text250, { size: "sm" }, "Funding wallet...")), isCompleted && /* @__PURE__ */ React375.createElement(Alert100, { icon: /* @__PURE__ */ React375.createElement(IconCheck36, { size: 16 }), title: "Wallet Funded", color: "green" }, /* @__PURE__ */ React375.createElement(Stack269, { gap: "xs" }, /* @__PURE__ */ React375.createElement(Text250, { size: "sm" }, "Tokens sent successfully."), /* @__PURE__ */ React375.createElement(Text250, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx Hash: ", txHash))), isStale && /* @__PURE__ */ React375.createElement(Alert100, { icon: /* @__PURE__ */ React375.createElement(IconAlertCircle38, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React375.createElement(Text250, { size: "sm" }, "Marked completed but no transaction hash recorded. Click Reset to clear and re-run via the slider."), /* @__PURE__ */ React375.createElement(Group141, { mt: "xs" }, /* @__PURE__ */ React375.createElement("button", { type: "button", onClick: handleRetry }, "Reset"))), isFailed && errorMessage && /* @__PURE__ */ React375.createElement(Alert100, { icon: /* @__PURE__ */ React375.createElement(IconAlertCircle38, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage));
|
|
42013
42035
|
};
|
|
42014
42036
|
|
|
42015
42037
|
// src/mantine/blocks/action/actionTypes/walletFund/index.ts
|
|
@@ -42034,7 +42056,7 @@ var WalletGenerateAndFundConfig = () => {
|
|
|
42034
42056
|
|
|
42035
42057
|
// src/mantine/blocks/action/actionTypes/walletGenerateAndFund/WalletGenerateAndFundFlowDetail.tsx
|
|
42036
42058
|
import React377, { useCallback as useCallback166 } from "react";
|
|
42037
|
-
import { Alert as Alert101, Button as Button89, Group as
|
|
42059
|
+
import { Alert as Alert101, Button as Button89, Group as Group142, Loader as Loader85, Stack as Stack271, Text as Text252 } from "@mantine/core";
|
|
42038
42060
|
import { IconCheck as IconCheck37, IconAlertCircle as IconAlertCircle39 } from "@tabler/icons-react";
|
|
42039
42061
|
var WalletGenerateAndFundFlowDetail = ({ block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
42040
42062
|
const generatedAddress = runtime.output?.address || "";
|
|
@@ -42070,7 +42092,7 @@ var WalletGenerateAndFundFlowDetail = ({ block, runtime, updateRuntime, isDisabl
|
|
|
42070
42092
|
const handleRetry = useCallback166(() => {
|
|
42071
42093
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
42072
42094
|
}, [updateRuntime]);
|
|
42073
|
-
return /* @__PURE__ */ React377.createElement(Stack271, { gap: "md" }, /* @__PURE__ */ React377.createElement(Stack271, { gap: 2 }, /* @__PURE__ */ React377.createElement(Text252, { fw: 600 }, block?.props?.title || "Generate & Fund Wallet"), /* @__PURE__ */ React377.createElement(Text252, { size: "sm", c: "dimmed" }, block?.props?.description || "Generate a new wallet and fund it with IXO tokens.")), isRunning && /* @__PURE__ */ React377.createElement(
|
|
42095
|
+
return /* @__PURE__ */ React377.createElement(Stack271, { gap: "md" }, /* @__PURE__ */ React377.createElement(Stack271, { gap: 2 }, /* @__PURE__ */ React377.createElement(Text252, { fw: 600 }, block?.props?.title || "Generate & Fund Wallet"), /* @__PURE__ */ React377.createElement(Text252, { size: "sm", c: "dimmed" }, block?.props?.description || "Generate a new wallet and fund it with IXO tokens.")), isRunning && /* @__PURE__ */ React377.createElement(Group142, { gap: "xs" }, /* @__PURE__ */ React377.createElement(Loader85, { size: 14 }), /* @__PURE__ */ React377.createElement(Text252, { size: "sm" }, "Generating wallet and funding...")), isCompleted && /* @__PURE__ */ React377.createElement(Alert101, { icon: /* @__PURE__ */ React377.createElement(IconCheck37, { size: 16 }), title: "Wallet Generated & Funded", color: "green" }, /* @__PURE__ */ React377.createElement(Stack271, { gap: "xs" }, generatedAddress && /* @__PURE__ */ React377.createElement(Text252, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Address: ", generatedAddress), generatedDid && /* @__PURE__ */ React377.createElement(Text252, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "DID: ", generatedDid), txHash && /* @__PURE__ */ React377.createElement(Text252, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx Hash: ", txHash), /* @__PURE__ */ React377.createElement(Text252, { size: "xs", c: "dimmed" }, "Mnemonic has been stored securely."))), isStale && /* @__PURE__ */ React377.createElement(Alert101, { icon: /* @__PURE__ */ React377.createElement(IconAlertCircle39, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React377.createElement(Stack271, { gap: "xs" }, /* @__PURE__ */ React377.createElement(Text252, { size: "sm" }, "Marked completed but no proof recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React377.createElement(Group142, null, /* @__PURE__ */ React377.createElement(Button89, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React377.createElement(Button89, { variant: "filled", size: "xs", onClick: handleExecute }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React377.createElement(Alert101, { icon: /* @__PURE__ */ React377.createElement(IconAlertCircle39, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React377.createElement(Group142, null, /* @__PURE__ */ React377.createElement(Button89, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React377.createElement(Group142, null, /* @__PURE__ */ React377.createElement(Button89, { variant: "filled", size: "sm", onClick: handleExecute, disabled: isDisabled }, isCompleted ? "Re-generate & Fund" : "Run Now")));
|
|
42074
42096
|
};
|
|
42075
42097
|
|
|
42076
42098
|
// src/mantine/blocks/action/actionTypes/walletGenerateAndFund/index.ts
|
|
@@ -42155,7 +42177,7 @@ var IidCreateConfig = ({ inputs, onInputsChange }) => {
|
|
|
42155
42177
|
|
|
42156
42178
|
// src/mantine/blocks/action/actionTypes/iidCreate/IidCreateFlowDetail.tsx
|
|
42157
42179
|
import React379 from "react";
|
|
42158
|
-
import { Alert as Alert102, Button as Button90, Group as
|
|
42180
|
+
import { Alert as Alert102, Button as Button90, Group as Group143, Loader as Loader86, Stack as Stack273, Text as Text254 } from "@mantine/core";
|
|
42159
42181
|
import { IconCheck as IconCheck38, IconAlertCircle as IconAlertCircle40 } from "@tabler/icons-react";
|
|
42160
42182
|
|
|
42161
42183
|
// src/mantine/blocks/action/hooks/useActionExecution.ts
|
|
@@ -42260,7 +42282,7 @@ var IidCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDi
|
|
|
42260
42282
|
logTag: "iid.create",
|
|
42261
42283
|
failureMessage: "Failed to create DID document"
|
|
42262
42284
|
});
|
|
42263
|
-
return /* @__PURE__ */ React379.createElement(Stack273, { gap: "md" }, /* @__PURE__ */ React379.createElement(Stack273, { gap: 2 }, /* @__PURE__ */ React379.createElement(Text254, { fw: 600 }, block?.props?.title || "Create DID Document"), /* @__PURE__ */ React379.createElement(Text254, { size: "sm", c: "dimmed" }, block?.props?.description || "Create a DID document on-chain.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React379.createElement(
|
|
42285
|
+
return /* @__PURE__ */ React379.createElement(Stack273, { gap: "md" }, /* @__PURE__ */ React379.createElement(Stack273, { gap: 2 }, /* @__PURE__ */ React379.createElement(Text254, { fw: 600 }, block?.props?.title || "Create DID Document"), /* @__PURE__ */ React379.createElement(Text254, { size: "sm", c: "dimmed" }, block?.props?.description || "Create a DID document on-chain.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React379.createElement(Group143, { gap: "xs" }, /* @__PURE__ */ React379.createElement(Loader86, { size: 14 }), /* @__PURE__ */ React379.createElement(Text254, { size: "sm", c: "dimmed" }, "Waiting for upstream wallet (mnemonic / DID / address / pubKey)...")), isRunning && /* @__PURE__ */ React379.createElement(Group143, { gap: "xs" }, /* @__PURE__ */ React379.createElement(Loader86, { size: 14 }), /* @__PURE__ */ React379.createElement(Text254, { size: "sm" }, "Creating DID document on-chain...")), isCompleted && /* @__PURE__ */ React379.createElement(Alert102, { icon: /* @__PURE__ */ React379.createElement(IconCheck38, { size: 16 }), title: alreadyExisted ? "DID Document Already Exists" : "DID Document Created", color: alreadyExisted ? "blue" : "green" }, /* @__PURE__ */ React379.createElement(Stack273, { gap: "xs" }, /* @__PURE__ */ React379.createElement(Text254, { size: "sm" }, alreadyExisted ? "DID document already existed on-chain." : "DID document created and verified on-chain."), createdDid && /* @__PURE__ */ React379.createElement(Text254, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "DID: ", createdDid), txHash && txHash !== "already-exists" && /* @__PURE__ */ React379.createElement(Text254, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx: ", txHash))), isStale && /* @__PURE__ */ React379.createElement(Alert102, { icon: /* @__PURE__ */ React379.createElement(IconAlertCircle40, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React379.createElement(Stack273, { gap: "xs" }, /* @__PURE__ */ React379.createElement(Text254, { size: "sm" }, "Block was marked completed but no transaction hash was recorded. This is stale state from a previous run \u2014 click below to reset and re-run."), /* @__PURE__ */ React379.createElement(Group143, null, /* @__PURE__ */ React379.createElement(Button90, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React379.createElement(Button90, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React379.createElement(Alert102, { icon: /* @__PURE__ */ React379.createElement(IconAlertCircle40, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React379.createElement(Group143, null, /* @__PURE__ */ React379.createElement(Button90, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React379.createElement(Group143, null, /* @__PURE__ */ React379.createElement(Button90, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
42264
42286
|
};
|
|
42265
42287
|
|
|
42266
42288
|
// src/mantine/blocks/action/actionTypes/iidCreate/index.ts
|
|
@@ -42356,14 +42378,14 @@ var MatrixRegisterConfig = ({ inputs, onInputsChange }) => {
|
|
|
42356
42378
|
};
|
|
42357
42379
|
|
|
42358
42380
|
// src/mantine/blocks/action/actionTypes/matrixRegister/MatrixRegisterFlowDetail.tsx
|
|
42359
|
-
import React381, { useCallback as useCallback170, useMemo as
|
|
42360
|
-
import { Alert as Alert103, Button as Button91, Group as
|
|
42381
|
+
import React381, { useCallback as useCallback170, useMemo as useMemo152 } from "react";
|
|
42382
|
+
import { Alert as Alert103, Button as Button91, Group as Group144, Loader as Loader87, Stack as Stack275, Text as Text256 } from "@mantine/core";
|
|
42361
42383
|
import { IconCheck as IconCheck39, IconAlertCircle as IconAlertCircle41 } from "@tabler/icons-react";
|
|
42362
42384
|
var MatrixRegisterFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
42363
|
-
const parsed =
|
|
42385
|
+
const parsed = useMemo152(() => parseMatrixRegisterInputs(inputs), [inputs]);
|
|
42364
42386
|
const editorDocument = editor?.document || [];
|
|
42365
|
-
const resolveOpts =
|
|
42366
|
-
const resolvedInputs =
|
|
42387
|
+
const resolveOpts = useMemo152(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
42388
|
+
const resolvedInputs = useMemo152(() => {
|
|
42367
42389
|
const r = (val) => resolveReferences(val || "", editorDocument, resolveOpts).trim();
|
|
42368
42390
|
return {
|
|
42369
42391
|
mnemonic: r(parsed.mnemonic),
|
|
@@ -42411,7 +42433,7 @@ var MatrixRegisterFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
42411
42433
|
const handleRetry = useCallback170(() => {
|
|
42412
42434
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
42413
42435
|
}, [updateRuntime]);
|
|
42414
|
-
return /* @__PURE__ */ React381.createElement(Stack275, { gap: "md" }, /* @__PURE__ */ React381.createElement(Stack275, { gap: 2 }, /* @__PURE__ */ React381.createElement(Text256, { fw: 600 }, block?.props?.title || "Register Matrix Account"), /* @__PURE__ */ React381.createElement(Text256, { size: "sm", c: "dimmed" }, block?.props?.description || "Register a Matrix account, set up encryption, and create a default room.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React381.createElement(
|
|
42436
|
+
return /* @__PURE__ */ React381.createElement(Stack275, { gap: "md" }, /* @__PURE__ */ React381.createElement(Stack275, { gap: 2 }, /* @__PURE__ */ React381.createElement(Text256, { fw: 600 }, block?.props?.title || "Register Matrix Account"), /* @__PURE__ */ React381.createElement(Text256, { size: "sm", c: "dimmed" }, block?.props?.description || "Register a Matrix account, set up encryption, and create a default room.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React381.createElement(Group144, { gap: "xs" }, /* @__PURE__ */ React381.createElement(Loader87, { size: 14 }), /* @__PURE__ */ React381.createElement(Text256, { size: "sm", c: "dimmed" }, "Waiting for upstream wallet + form inputs...")), isRunning && /* @__PURE__ */ React381.createElement(Group144, { gap: "xs" }, /* @__PURE__ */ React381.createElement(Loader87, { size: 14 }), /* @__PURE__ */ React381.createElement(Text256, { size: "sm" }, "Registering Matrix account...")), isCompleted && /* @__PURE__ */ React381.createElement(Alert103, { icon: /* @__PURE__ */ React381.createElement(IconCheck39, { size: 16 }), title: "Matrix Account Registered", color: "green" }, /* @__PURE__ */ React381.createElement(Stack275, { gap: "xs" }, /* @__PURE__ */ React381.createElement(Text256, { size: "sm" }, "Matrix account registered and configured successfully."), /* @__PURE__ */ React381.createElement(Text256, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "User ID: ", matrixUserId), matrixRoomId && /* @__PURE__ */ React381.createElement(Text256, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Room ID: ", matrixRoomId))), isStale && /* @__PURE__ */ React381.createElement(Alert103, { icon: /* @__PURE__ */ React381.createElement(IconAlertCircle41, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React381.createElement(Stack275, { gap: "xs" }, /* @__PURE__ */ React381.createElement(Text256, { size: "sm" }, "Marked completed but no matrixUserId recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React381.createElement(Group144, null, /* @__PURE__ */ React381.createElement(Button91, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React381.createElement(Button91, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React381.createElement(Alert103, { icon: /* @__PURE__ */ React381.createElement(IconAlertCircle41, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React381.createElement(Group144, null, /* @__PURE__ */ React381.createElement(Button91, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React381.createElement(Group144, null, /* @__PURE__ */ React381.createElement(Button91, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
42415
42437
|
};
|
|
42416
42438
|
|
|
42417
42439
|
// src/mantine/blocks/action/actionTypes/matrixRegister/index.ts
|
|
@@ -42514,12 +42536,12 @@ var IdentityCreateConfig = ({ inputs, onInputsChange }) => {
|
|
|
42514
42536
|
};
|
|
42515
42537
|
|
|
42516
42538
|
// src/mantine/blocks/action/actionTypes/identityCreate/IdentityCreateFlowDetail.tsx
|
|
42517
|
-
import React383, { useMemo as
|
|
42518
|
-
import { Alert as Alert104, Button as Button92, Group as
|
|
42539
|
+
import React383, { useMemo as useMemo153 } from "react";
|
|
42540
|
+
import { Alert as Alert104, Button as Button92, Group as Group145, Loader as Loader88, Stack as Stack277, Text as Text258 } from "@mantine/core";
|
|
42519
42541
|
import { IconCheck as IconCheck40, IconAlertCircle as IconAlertCircle42 } from "@tabler/icons-react";
|
|
42520
42542
|
var IdentityCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
42521
42543
|
const { resolvedInputs: base } = useResolvedInputs(editor, inputs, { fields: ["mnemonic", "did", "address", "pubKey", "pin", "oracleName", "avatarUrl", "formAnswers"], required: ["mnemonic", "did", "address", "pubKey"] }, block?.id);
|
|
42522
|
-
const resolvedInputs =
|
|
42544
|
+
const resolvedInputs = useMemo153(() => {
|
|
42523
42545
|
const form = (() => {
|
|
42524
42546
|
if (!base.formAnswers) return {};
|
|
42525
42547
|
try {
|
|
@@ -42555,7 +42577,7 @@ var IdentityCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
42555
42577
|
logTag: "identity.create",
|
|
42556
42578
|
failureMessage: "Failed to create identity"
|
|
42557
42579
|
});
|
|
42558
|
-
return /* @__PURE__ */ React383.createElement(Stack277, { gap: "md" }, /* @__PURE__ */ React383.createElement(Stack277, { gap: 2 }, /* @__PURE__ */ React383.createElement(Text258, { fw: 600 }, block?.props?.title || "Create Identity"), /* @__PURE__ */ React383.createElement(Text258, { size: "sm", c: "dimmed" }, block?.props?.description || "Create IID document on-chain and register Matrix account.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React383.createElement(
|
|
42580
|
+
return /* @__PURE__ */ React383.createElement(Stack277, { gap: "md" }, /* @__PURE__ */ React383.createElement(Stack277, { gap: 2 }, /* @__PURE__ */ React383.createElement(Text258, { fw: 600 }, block?.props?.title || "Create Identity"), /* @__PURE__ */ React383.createElement(Text258, { size: "sm", c: "dimmed" }, block?.props?.description || "Create IID document on-chain and register Matrix account.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React383.createElement(Group145, { gap: "xs" }, /* @__PURE__ */ React383.createElement(Loader88, { size: 14 }), /* @__PURE__ */ React383.createElement(Text258, { size: "sm", c: "dimmed" }, "Waiting for upstream inputs (mnemonic / DID / address / pubKey / pin / oracleName)...")), isRunning && /* @__PURE__ */ React383.createElement(Group145, { gap: "xs" }, /* @__PURE__ */ React383.createElement(Loader88, { size: 14 }), /* @__PURE__ */ React383.createElement(Text258, { size: "sm" }, "Creating identity (IID + Matrix)...")), isCompleted && /* @__PURE__ */ React383.createElement(Alert104, { icon: /* @__PURE__ */ React383.createElement(IconCheck40, { size: 16 }), title: alreadyExisted ? "Identity Created (IID Already Existed)" : "Identity Created", color: alreadyExisted ? "blue" : "green" }, /* @__PURE__ */ React383.createElement(Stack277, { gap: "xs" }, /* @__PURE__ */ React383.createElement(Text258, { size: "sm" }, alreadyExisted ? "IID document already existed on-chain. Matrix account registered successfully." : "IID document created on-chain and Matrix account registered successfully."), createdDid && /* @__PURE__ */ React383.createElement(Text258, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "DID: ", createdDid), txHash && txHash !== "already-exists" && /* @__PURE__ */ React383.createElement(Text258, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Tx: ", txHash), matrixUserId && /* @__PURE__ */ React383.createElement(Text258, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Matrix: ", matrixUserId), matrixRoomId && /* @__PURE__ */ React383.createElement(Text258, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Room: ", matrixRoomId))), isStale && /* @__PURE__ */ React383.createElement(Alert104, { icon: /* @__PURE__ */ React383.createElement(IconAlertCircle42, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React383.createElement(Stack277, { gap: "xs" }, /* @__PURE__ */ React383.createElement(Text258, { size: "sm" }, "Block was marked completed but missing proof (need both IID tx/alreadyExisted and matrixUserId). This is stale state from a previous run \u2014 click below to reset and re-run."), /* @__PURE__ */ React383.createElement(Group145, null, /* @__PURE__ */ React383.createElement(Button92, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React383.createElement(Button92, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React383.createElement(Alert104, { icon: /* @__PURE__ */ React383.createElement(IconAlertCircle42, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React383.createElement(Group145, null, /* @__PURE__ */ React383.createElement(Button92, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React383.createElement(Group145, null, /* @__PURE__ */ React383.createElement(Button92, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
42559
42581
|
};
|
|
42560
42582
|
|
|
42561
42583
|
// src/mantine/blocks/action/actionTypes/identityCreate/index.ts
|
|
@@ -42771,14 +42793,14 @@ var EntityCreateOracleConfig = ({ inputs, onInputsChange }) => {
|
|
|
42771
42793
|
};
|
|
42772
42794
|
|
|
42773
42795
|
// src/mantine/blocks/action/actionTypes/entityCreateOracle/EntityCreateOracleFlowDetail.tsx
|
|
42774
|
-
import React385, { useCallback as useCallback173, useMemo as
|
|
42775
|
-
import { ActionIcon as ActionIcon50, Alert as Alert105, Button as Button93, CopyButton as CopyButton2, Group as
|
|
42796
|
+
import React385, { useCallback as useCallback173, useMemo as useMemo154 } from "react";
|
|
42797
|
+
import { ActionIcon as ActionIcon50, Alert as Alert105, Button as Button93, CopyButton as CopyButton2, Group as Group146, Loader as Loader89, Stack as Stack279, Text as Text260, Tooltip as Tooltip34 } from "@mantine/core";
|
|
42776
42798
|
import { IconCheck as IconCheck41, IconAlertCircle as IconAlertCircle43, IconCopy as IconCopy2 } from "@tabler/icons-react";
|
|
42777
42799
|
var EntityCreateOracleFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
42778
|
-
const parsed =
|
|
42800
|
+
const parsed = useMemo154(() => parseEntityCreateOracleInputs(inputs), [inputs]);
|
|
42779
42801
|
const editorDocument = editor?.document || [];
|
|
42780
|
-
const resolveOpts =
|
|
42781
|
-
const resolvedInputs =
|
|
42802
|
+
const resolveOpts = useMemo154(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
42803
|
+
const resolvedInputs = useMemo154(() => {
|
|
42782
42804
|
const r = (val) => resolveReferences(val || "", editorDocument, resolveOpts).trim();
|
|
42783
42805
|
const formAnswersStr = r(parsed.formAnswers);
|
|
42784
42806
|
const form = (() => {
|
|
@@ -42860,7 +42882,7 @@ var EntityCreateOracleFlowDetail = ({ inputs, editor, block, runtime, updateRunt
|
|
|
42860
42882
|
const handleRetry = useCallback173(() => {
|
|
42861
42883
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
42862
42884
|
}, [updateRuntime]);
|
|
42863
|
-
return /* @__PURE__ */ React385.createElement(Stack279, { gap: "md" }, /* @__PURE__ */ React385.createElement(Stack279, { gap: 2 }, /* @__PURE__ */ React385.createElement(Text260, { fw: 600 }, block?.props?.title || "Create Oracle Entity"), /* @__PURE__ */ React385.createElement(Text260, { size: "sm", c: "dimmed" }, block?.props?.description || "Create an oracle entity on-chain.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React385.createElement(
|
|
42885
|
+
return /* @__PURE__ */ React385.createElement(Stack279, { gap: "md" }, /* @__PURE__ */ React385.createElement(Stack279, { gap: 2 }, /* @__PURE__ */ React385.createElement(Text260, { fw: 600 }, block?.props?.title || "Create Oracle Entity"), /* @__PURE__ */ React385.createElement(Text260, { size: "sm", c: "dimmed" }, block?.props?.description || "Create an oracle entity on-chain.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React385.createElement(Group146, { gap: "xs" }, /* @__PURE__ */ React385.createElement(Loader89, { size: 14 }), /* @__PURE__ */ React385.createElement(Text260, { size: "sm", c: "dimmed" }, "Waiting for upstream wallet + matrix + form inputs...")), isRunning && /* @__PURE__ */ React385.createElement(Group146, { gap: "xs" }, /* @__PURE__ */ React385.createElement(Loader89, { size: 14 }), /* @__PURE__ */ React385.createElement(Text260, { size: "sm" }, "Creating oracle entity...")), isCompleted && /* @__PURE__ */ React385.createElement(Alert105, { icon: /* @__PURE__ */ React385.createElement(IconCheck41, { size: 16 }), title: "Oracle Entity Created", color: "green" }, /* @__PURE__ */ React385.createElement(Stack279, { gap: "xs" }, /* @__PURE__ */ React385.createElement(Text260, { size: "sm" }, "Oracle entity created successfully on-chain."), /* @__PURE__ */ React385.createElement(Group146, { gap: 6, wrap: "nowrap", align: "center" }, /* @__PURE__ */ React385.createElement(Text260, { size: "xs", c: "dimmed" }, "Entity DID:"), /* @__PURE__ */ React385.createElement(Text260, { size: "xs", ff: "monospace", style: { wordBreak: "break-all" } }, entityDid), /* @__PURE__ */ React385.createElement(CopyButton2, { value: entityDid, timeout: 1500 }, ({ copied, copy }) => /* @__PURE__ */ React385.createElement(Tooltip34, { label: copied ? "Copied" : "Copy" }, /* @__PURE__ */ React385.createElement(ActionIcon50, { size: "sm", variant: "subtle", color: copied ? "teal" : "gray", onClick: copy }, copied ? /* @__PURE__ */ React385.createElement(IconCheck41, { size: 14 }) : /* @__PURE__ */ React385.createElement(IconCopy2, { size: 14 }))))))), isStale && /* @__PURE__ */ React385.createElement(Alert105, { icon: /* @__PURE__ */ React385.createElement(IconAlertCircle43, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React385.createElement(Stack279, { gap: "xs" }, /* @__PURE__ */ React385.createElement(Text260, { size: "sm" }, "Marked completed but no entityDid recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React385.createElement(Group146, null, /* @__PURE__ */ React385.createElement(Button93, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React385.createElement(Button93, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React385.createElement(Alert105, { icon: /* @__PURE__ */ React385.createElement(IconAlertCircle43, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React385.createElement(Group146, null, /* @__PURE__ */ React385.createElement(Button93, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React385.createElement(Group146, null, /* @__PURE__ */ React385.createElement(Button93, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
42864
42886
|
};
|
|
42865
42887
|
|
|
42866
42888
|
// src/mantine/blocks/action/actionTypes/entityCreateOracle/index.ts
|
|
@@ -42932,13 +42954,13 @@ var SandboxProvisionConfig = ({ inputs, onInputsChange }) => {
|
|
|
42932
42954
|
};
|
|
42933
42955
|
|
|
42934
42956
|
// src/mantine/blocks/action/actionTypes/sandboxProvision/SandboxProvisionFlowDetail.tsx
|
|
42935
|
-
import React387, { useCallback as useCallback175, useMemo as
|
|
42936
|
-
import { Alert as Alert106, Anchor as Anchor5, Button as Button94, Group as
|
|
42957
|
+
import React387, { useCallback as useCallback175, useMemo as useMemo155 } from "react";
|
|
42958
|
+
import { Alert as Alert106, Anchor as Anchor5, Button as Button94, Group as Group147, Loader as Loader90, Stack as Stack281, Text as Text262 } from "@mantine/core";
|
|
42937
42959
|
import { IconCheck as IconCheck42, IconAlertCircle as IconAlertCircle44 } from "@tabler/icons-react";
|
|
42938
42960
|
var SandboxProvisionFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
42939
|
-
const parsed =
|
|
42961
|
+
const parsed = useMemo155(() => parseSandboxProvisionInputs(inputs), [inputs]);
|
|
42940
42962
|
const editorDocument = editor?.document || [];
|
|
42941
|
-
const resolveOpts =
|
|
42963
|
+
const resolveOpts = useMemo155(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
42942
42964
|
const resolvedEntityDid = resolveReferences(parsed.entityDid || "", editorDocument, resolveOpts).trim();
|
|
42943
42965
|
const resolvedMatrixRoomId = resolveReferences(parsed.matrixRoomId || "", editorDocument, resolveOpts).trim();
|
|
42944
42966
|
const inputsReady = !!(resolvedEntityDid && resolvedMatrixRoomId);
|
|
@@ -42980,7 +43002,7 @@ var SandboxProvisionFlowDetail = ({ inputs, editor, block, runtime, updateRuntim
|
|
|
42980
43002
|
const handleRetry = useCallback175(() => {
|
|
42981
43003
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
42982
43004
|
}, [updateRuntime]);
|
|
42983
|
-
return /* @__PURE__ */ React387.createElement(Stack281, { gap: "md" }, /* @__PURE__ */ React387.createElement(Stack281, { gap: 2 }, /* @__PURE__ */ React387.createElement(Text262, { fw: 600 }, block?.props?.title || "Provision Sandbox"), /* @__PURE__ */ React387.createElement(Text262, { size: "sm", c: "dimmed" }, block?.props?.description || "Provision a sandbox environment for the oracle.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React387.createElement(
|
|
43005
|
+
return /* @__PURE__ */ React387.createElement(Stack281, { gap: "md" }, /* @__PURE__ */ React387.createElement(Stack281, { gap: 2 }, /* @__PURE__ */ React387.createElement(Text262, { fw: 600 }, block?.props?.title || "Provision Sandbox"), /* @__PURE__ */ React387.createElement(Text262, { size: "sm", c: "dimmed" }, block?.props?.description || "Provision a sandbox environment for the oracle.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React387.createElement(Group147, { gap: "xs" }, /* @__PURE__ */ React387.createElement(Loader90, { size: 14 }), /* @__PURE__ */ React387.createElement(Text262, { size: "sm", c: "dimmed" }, "Waiting for upstream entity DID + matrix room...")), isRunning && /* @__PURE__ */ React387.createElement(Group147, { gap: "xs" }, /* @__PURE__ */ React387.createElement(Loader90, { size: 14 }), /* @__PURE__ */ React387.createElement(Text262, { size: "sm" }, "Provisioning sandbox environment...")), isCompleted && /* @__PURE__ */ React387.createElement(Alert106, { icon: /* @__PURE__ */ React387.createElement(IconCheck42, { size: 16 }), title: "Sandbox Ready", color: "green" }, /* @__PURE__ */ React387.createElement(Stack281, { gap: "xs" }, /* @__PURE__ */ React387.createElement(Text262, { size: "sm" }, "Sandbox environment provisioned successfully."), sandboxUrl && /* @__PURE__ */ React387.createElement(Anchor5, { href: sandboxUrl, target: "_blank", size: "xs" }, sandboxUrl))), isStale && /* @__PURE__ */ React387.createElement(Alert106, { icon: /* @__PURE__ */ React387.createElement(IconAlertCircle44, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React387.createElement(Stack281, { gap: "xs" }, /* @__PURE__ */ React387.createElement(Text262, { size: "sm" }, "Marked completed but no status or sandboxUrl recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React387.createElement(Group147, null, /* @__PURE__ */ React387.createElement(Button94, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React387.createElement(Button94, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React387.createElement(Alert106, { icon: /* @__PURE__ */ React387.createElement(IconAlertCircle44, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React387.createElement(Group147, null, /* @__PURE__ */ React387.createElement(Button94, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React387.createElement(Group147, null, /* @__PURE__ */ React387.createElement(Button94, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
42984
43006
|
};
|
|
42985
43007
|
|
|
42986
43008
|
// src/mantine/blocks/action/actionTypes/sandboxProvision/index.ts
|
|
@@ -43042,13 +43064,13 @@ var OracleContractConfig = ({ inputs, onInputsChange }) => {
|
|
|
43042
43064
|
};
|
|
43043
43065
|
|
|
43044
43066
|
// src/mantine/blocks/action/actionTypes/oracleContract/OracleContractFlowDetail.tsx
|
|
43045
|
-
import React389, { useCallback as useCallback177, useMemo as
|
|
43046
|
-
import { Alert as Alert107, Button as Button95, Group as
|
|
43067
|
+
import React389, { useCallback as useCallback177, useMemo as useMemo156 } from "react";
|
|
43068
|
+
import { Alert as Alert107, Button as Button95, Group as Group148, Loader as Loader91, Stack as Stack283, Text as Text264 } from "@mantine/core";
|
|
43047
43069
|
import { IconCheck as IconCheck43, IconAlertCircle as IconAlertCircle45 } from "@tabler/icons-react";
|
|
43048
43070
|
var OracleContractFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
43049
|
-
const parsed =
|
|
43071
|
+
const parsed = useMemo156(() => parseOracleContractInputs(inputs), [inputs]);
|
|
43050
43072
|
const editorDocument = editor?.document || [];
|
|
43051
|
-
const resolveOpts =
|
|
43073
|
+
const resolveOpts = useMemo156(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
43052
43074
|
const resolvedOracleEntityDid = resolveReferences(parsed.oracleEntityDid || "", editorDocument, resolveOpts).trim();
|
|
43053
43075
|
const inputsReady = !!resolvedOracleEntityDid;
|
|
43054
43076
|
const userOracleRoomId = runtime.output?.userOracleRoomId || "";
|
|
@@ -43089,7 +43111,7 @@ var OracleContractFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
43089
43111
|
const handleRetry = useCallback177(() => {
|
|
43090
43112
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
43091
43113
|
}, [updateRuntime]);
|
|
43092
|
-
return /* @__PURE__ */ React389.createElement(Stack283, { gap: "md" }, /* @__PURE__ */ React389.createElement(Stack283, { gap: 2 }, /* @__PURE__ */ React389.createElement(Text264, { fw: 600 }, block?.props?.title || "Contract Oracle"), /* @__PURE__ */ React389.createElement(Text264, { size: "sm", c: "dimmed" }, block?.props?.description || "Create the user\u2194oracle Matrix DM room.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React389.createElement(
|
|
43114
|
+
return /* @__PURE__ */ React389.createElement(Stack283, { gap: "md" }, /* @__PURE__ */ React389.createElement(Stack283, { gap: 2 }, /* @__PURE__ */ React389.createElement(Text264, { fw: 600 }, block?.props?.title || "Contract Oracle"), /* @__PURE__ */ React389.createElement(Text264, { size: "sm", c: "dimmed" }, block?.props?.description || "Create the user\u2194oracle Matrix DM room.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React389.createElement(Group148, { gap: "xs" }, /* @__PURE__ */ React389.createElement(Loader91, { size: 14 }), /* @__PURE__ */ React389.createElement(Text264, { size: "sm", c: "dimmed" }, "Waiting for upstream oracle entity DID...")), isRunning && /* @__PURE__ */ React389.createElement(Group148, { gap: "xs" }, /* @__PURE__ */ React389.createElement(Loader91, { size: 14 }), /* @__PURE__ */ React389.createElement(Text264, { size: "sm" }, "Creating user\u2194oracle Matrix room...")), isCompleted && /* @__PURE__ */ React389.createElement(Alert107, { icon: /* @__PURE__ */ React389.createElement(IconCheck43, { size: 16 }), title: "Oracle Contracted", color: "green" }, /* @__PURE__ */ React389.createElement(Stack283, { gap: "xs" }, /* @__PURE__ */ React389.createElement(Text264, { size: "sm" }, "User\u2194oracle Matrix room is ready."), /* @__PURE__ */ React389.createElement(Text264, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Room ID: ", userOracleRoomId), userOracleRoomAlias && /* @__PURE__ */ React389.createElement(Text264, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Alias: ", userOracleRoomAlias))), isStale && /* @__PURE__ */ React389.createElement(Alert107, { icon: /* @__PURE__ */ React389.createElement(IconAlertCircle45, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React389.createElement(Stack283, { gap: "xs" }, /* @__PURE__ */ React389.createElement(Text264, { size: "sm" }, "Marked completed but no userOracleRoomId recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React389.createElement(Group148, null, /* @__PURE__ */ React389.createElement(Button95, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React389.createElement(Button95, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React389.createElement(Alert107, { icon: /* @__PURE__ */ React389.createElement(IconAlertCircle45, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React389.createElement(Group148, null, /* @__PURE__ */ React389.createElement(Button95, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React389.createElement(Group148, null, /* @__PURE__ */ React389.createElement(Button95, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
43093
43115
|
};
|
|
43094
43116
|
|
|
43095
43117
|
// src/mantine/blocks/action/actionTypes/oracleContract/index.ts
|
|
@@ -43289,8 +43311,8 @@ var OracleStoreSecretsConfig = ({ inputs, onInputsChange }) => {
|
|
|
43289
43311
|
};
|
|
43290
43312
|
|
|
43291
43313
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecrets/OracleStoreSecretsFlowDetail.tsx
|
|
43292
|
-
import React391, { useCallback as useCallback179, useEffect as useEffect169, useMemo as
|
|
43293
|
-
import { Alert as Alert108, Button as Button96, Collapse as Collapse12, Divider as Divider37, Group as
|
|
43314
|
+
import React391, { useCallback as useCallback179, useEffect as useEffect169, useMemo as useMemo157, useRef as useRef53, useState as useState230 } from "react";
|
|
43315
|
+
import { Alert as Alert108, Button as Button96, Collapse as Collapse12, Divider as Divider37, Group as Group149, Loader as Loader92, Stack as Stack285, Text as Text266 } from "@mantine/core";
|
|
43294
43316
|
import { IconAlertCircle as IconAlertCircle46, IconCheck as IconCheck44, IconChevronDown as IconChevronDown12, IconChevronUp as IconChevronUp5, IconLock } from "@tabler/icons-react";
|
|
43295
43317
|
|
|
43296
43318
|
// src/mantine/blocks/action/hooks/useIdempotencyCheck.ts
|
|
@@ -43345,14 +43367,14 @@ var FIELDS = [
|
|
|
43345
43367
|
var REQUIRED_FIELDS = ["matrixRoomId", "publicKeyMultibase", "verificationMethodId", "matrixHomeServerUrl", "matrixUsername", "mnemonic", "matrixPassword", "matrixRecoveryPhrase", "pin"];
|
|
43346
43368
|
var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
43347
43369
|
const handlers = useBlocknoteHandlers();
|
|
43348
|
-
const services =
|
|
43370
|
+
const services = useMemo157(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
43349
43371
|
const { resolvedInputs, inputsReady } = useResolvedInputs(editor, inputs, { fields: FIELDS, required: REQUIRED_FIELDS }, block?.id);
|
|
43350
43372
|
const missingFields = REQUIRED_FIELDS.filter((field) => !resolvedInputs[field]);
|
|
43351
43373
|
const storedSecrets = runtime.output?.storedSecrets || [];
|
|
43352
43374
|
const hasProof = Array.isArray(storedSecrets) && storedSecrets.length > 0;
|
|
43353
43375
|
const openRouterJwe = runtime.userInputs?.openRouterApiKey || "";
|
|
43354
43376
|
const hasOpenRouter = !!openRouterJwe;
|
|
43355
|
-
const runInputs =
|
|
43377
|
+
const runInputs = useMemo157(() => ({ ...resolvedInputs, openRouterApiKeyJwe: openRouterJwe }), [resolvedInputs, openRouterJwe]);
|
|
43356
43378
|
const { isRunning, isCompleted, isStale, isFailed, errorMessage, handleExecute, handleRetry } = useActionExecution({
|
|
43357
43379
|
executeAction,
|
|
43358
43380
|
runtime,
|
|
@@ -43451,7 +43473,7 @@ var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRunt
|
|
|
43451
43473
|
}, [updateRuntime]);
|
|
43452
43474
|
const lockIcon = /* @__PURE__ */ React391.createElement(IconLock, { size: 14 });
|
|
43453
43475
|
const submitDisabled = !inputsReady || !hasOpenRouter || isRunning || isCompleted || isDisabled;
|
|
43454
|
-
return /* @__PURE__ */ React391.createElement(Stack285, { gap: "md" }, /* @__PURE__ */ React391.createElement(Stack285, { gap: 2 }, /* @__PURE__ */ React391.createElement(Text266, { fw: 600 }, block?.props?.title || "Store Secrets"), /* @__PURE__ */ React391.createElement(Text266, { size: "sm", c: "dimmed" }, block?.props?.description || "Encrypt and store secrets in the oracle Matrix room.")), isChecking && /* @__PURE__ */ React391.createElement(
|
|
43476
|
+
return /* @__PURE__ */ React391.createElement(Stack285, { gap: "md" }, /* @__PURE__ */ React391.createElement(Stack285, { gap: 2 }, /* @__PURE__ */ React391.createElement(Text266, { fw: 600 }, block?.props?.title || "Store Secrets"), /* @__PURE__ */ React391.createElement(Text266, { size: "sm", c: "dimmed" }, block?.props?.description || "Encrypt and store secrets in the oracle Matrix room.")), isChecking && /* @__PURE__ */ React391.createElement(Group149, { gap: "xs" }, /* @__PURE__ */ React391.createElement(Loader92, { size: 14 }), /* @__PURE__ */ React391.createElement(Text266, { size: "sm", c: "dimmed" }, "Checking matrix room for already-stored secrets...")), !isChecking && !inputsReady && !isCompleted && !isStale && /* @__PURE__ */ React391.createElement(Group149, { gap: "xs" }, /* @__PURE__ */ React391.createElement(Loader92, { size: 14 }), /* @__PURE__ */ React391.createElement(Text266, { size: "sm", c: "dimmed" }, "Waiting for upstream blocks: ", missingFields.join(", "))), isCompleted && /* @__PURE__ */ React391.createElement(Stack285, { gap: "xs" }, /* @__PURE__ */ React391.createElement(Alert108, { icon: /* @__PURE__ */ React391.createElement(IconCheck44, { size: 16 }), title: "Secrets Stored", color: "green" }, /* @__PURE__ */ React391.createElement(Text266, { size: "sm" }, "All ", storedSecrets.length, " secrets already stored in the matrix room.")), /* @__PURE__ */ React391.createElement(Stack285, { gap: 2 }, storedSecrets.map((name) => /* @__PURE__ */ React391.createElement(Group149, { key: name, gap: "xs" }, /* @__PURE__ */ React391.createElement(IconLock, { size: 12 }), /* @__PURE__ */ React391.createElement(Text266, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, name)))), /* @__PURE__ */ React391.createElement(Group149, null, /* @__PURE__ */ React391.createElement(Button96, { variant: "outline", size: "xs", onClick: handleRestoreAll }, "Re-store all"))), isStale && /* @__PURE__ */ React391.createElement(Alert108, { icon: /* @__PURE__ */ React391.createElement(IconAlertCircle46, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React391.createElement(Stack285, { gap: "xs" }, /* @__PURE__ */ React391.createElement(Text266, { size: "sm" }, "Marked completed but no storedSecrets recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React391.createElement(Group149, null, /* @__PURE__ */ React391.createElement(Button96, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React391.createElement(Button96, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady || !hasOpenRouter }, "Force Run Now")))), !isCompleted && !isStale && !isChecking && inputsReady && /* @__PURE__ */ React391.createElement(Stack285, { gap: "sm" }, /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "SECP_MNEMONIC", readOnly: true, type: "password", value: resolvedInputs.mnemonic, style: { flex: 1 } })), /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "MATRIX_ORACLE_ADMIN_PASSWORD", readOnly: true, type: "password", value: resolvedInputs.matrixPassword, style: { flex: 1 } })), /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", align: "center", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React391.createElement(Stack285, { gap: 0, style: { flex: 1 } }, /* @__PURE__ */ React391.createElement(Text266, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN"), /* @__PURE__ */ React391.createElement(Text266, { size: "xs", c: "dimmed" }, "Generated by handler at submit time (fresh login)"))), /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "MATRIX_RECOVERY_PHRASE", readOnly: true, type: "password", value: resolvedInputs.matrixRecoveryPhrase, style: { flex: 1 } })), /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "MATRIX_VALUE_PIN", readOnly: true, type: "password", value: resolvedInputs.pin, style: { flex: 1 } })), /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, isEditingOpenRouter ? /* @__PURE__ */ React391.createElement(
|
|
43455
43477
|
BaseTextInput,
|
|
43456
43478
|
{
|
|
43457
43479
|
label: "OPEN_ROUTER_API_KEY",
|
|
@@ -43461,7 +43483,7 @@ var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRunt
|
|
|
43461
43483
|
onChange: (event) => setOpenRouterDraft(event.currentTarget.value),
|
|
43462
43484
|
style: { flex: 1 }
|
|
43463
43485
|
}
|
|
43464
|
-
) : /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "OPEN_ROUTER_API_KEY", readOnly: true, type: "password", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", style: { flex: 1 } })), /* @__PURE__ */ React391.createElement(
|
|
43486
|
+
) : /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "OPEN_ROUTER_API_KEY", readOnly: true, type: "password", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", style: { flex: 1 } })), /* @__PURE__ */ React391.createElement(Group149, { gap: "xs", justify: "flex-end" }, isEditingOpenRouter ? /* @__PURE__ */ React391.createElement(React391.Fragment, null, /* @__PURE__ */ React391.createElement(Button96, { size: "xs", onClick: handleSaveOpenRouter, loading: isEncryptingOpenRouter, disabled: !openRouterDraft || !resolvedInputs.publicKeyMultibase }, "Save"), hasOpenRouter && /* @__PURE__ */ React391.createElement(Button96, { size: "xs", variant: "subtle", onClick: handleCancelEditOpenRouter }, "Cancel")) : /* @__PURE__ */ React391.createElement(Button96, { size: "xs", variant: "outline", onClick: handleChangeOpenRouter }, "Change")), /* @__PURE__ */ React391.createElement(Divider37, { variant: "dashed" }), /* @__PURE__ */ React391.createElement(Text266, { size: "sm", fw: 600 }, "Identifiers (stored as plain config \u2014 not encrypted)"), /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "MATRIX_ORACLE_ADMIN_USER_ID", readOnly: true, value: resolvedInputs.matrixUserId }), /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "MATRIX_ACCOUNT_ROOM_ID", readOnly: true, value: resolvedInputs.matrixAccountRoomId }), /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "ORACLE_ENTITY_DID", readOnly: true, value: resolvedInputs.entityDid }), /* @__PURE__ */ React391.createElement(Divider37, { variant: "dashed" }), /* @__PURE__ */ React391.createElement(Stack285, { gap: "xs" }, /* @__PURE__ */ React391.createElement(Group149, { justify: "space-between", style: { cursor: "pointer", userSelect: "none" }, onClick: () => setShowAdditional((v) => !v) }, /* @__PURE__ */ React391.createElement(Text266, { size: "sm", fw: 500 }, "Additional Configuration"), /* @__PURE__ */ React391.createElement(Group149, { gap: 6 }, /* @__PURE__ */ React391.createElement(Text266, { size: "xs", c: "dimmed" }, "Stored as plain config \u2014 not encrypted"), showAdditional ? /* @__PURE__ */ React391.createElement(IconChevronUp5, { size: 14 }) : /* @__PURE__ */ React391.createElement(IconChevronDown12, { size: 14 }))), /* @__PURE__ */ React391.createElement(Collapse12, { in: showAdditional }, /* @__PURE__ */ React391.createElement(Stack285, { gap: "xs", pt: "xs" }, isLoadingConstants && /* @__PURE__ */ React391.createElement(Group149, { gap: 6 }, /* @__PURE__ */ React391.createElement(Loader92, { size: 12 }), /* @__PURE__ */ React391.createElement(Text266, { size: "xs", c: "dimmed" }, "Loading network constants\u2026")), /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "ORACLE_NAME", value: resolvedInputs.oracleName || "", readOnly: true }), /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "ORACLE_ADDRESS", value: resolvedInputs.oracleAddress || "", readOnly: true }), /* @__PURE__ */ React391.createElement(BaseTextInput, { label: "ORACLE_DID", value: resolvedInputs.oracleDid || "", readOnly: true }), networkConstants && Object.entries(networkConstants).map(([key, value]) => /* @__PURE__ */ React391.createElement(BaseTextInput, { key, label: key, value, readOnly: true }))))), isRunning && /* @__PURE__ */ React391.createElement(Group149, { gap: "xs" }, /* @__PURE__ */ React391.createElement(Loader92, { size: 14 }), /* @__PURE__ */ React391.createElement(Text266, { size: "sm" }, "Encrypting and storing secrets in matrix room...")), /* @__PURE__ */ React391.createElement(Group149, { justify: "flex-end" }, /* @__PURE__ */ React391.createElement(Button96, { variant: "filled", size: "sm", onClick: handleExecute, disabled: submitDisabled }, "Store Secrets"))), isFailed && errorMessage && /* @__PURE__ */ React391.createElement(Alert108, { icon: /* @__PURE__ */ React391.createElement(IconAlertCircle46, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React391.createElement(Group149, null, /* @__PURE__ */ React391.createElement(Button96, { variant: "outline", onClick: handleRetry }, "Try Again")));
|
|
43465
43487
|
};
|
|
43466
43488
|
|
|
43467
43489
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecrets/index.ts
|
|
@@ -43667,14 +43689,14 @@ var OracleStoreConfigConfig = ({ inputs, onInputsChange }) => {
|
|
|
43667
43689
|
};
|
|
43668
43690
|
|
|
43669
43691
|
// src/mantine/blocks/action/actionTypes/oracleStoreConfig/OracleStoreConfigFlowDetail.tsx
|
|
43670
|
-
import React393, { useCallback as useCallback181, useMemo as
|
|
43671
|
-
import { Alert as Alert109, Button as Button97, Group as
|
|
43692
|
+
import React393, { useCallback as useCallback181, useMemo as useMemo158 } from "react";
|
|
43693
|
+
import { Alert as Alert109, Button as Button97, Group as Group150, Loader as Loader93, Stack as Stack287, Text as Text268 } from "@mantine/core";
|
|
43672
43694
|
import { IconCheck as IconCheck45, IconAlertCircle as IconAlertCircle47 } from "@tabler/icons-react";
|
|
43673
43695
|
var OracleStoreConfigFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
43674
|
-
const parsed =
|
|
43696
|
+
const parsed = useMemo158(() => parseOracleStoreConfigInputs(inputs), [inputs]);
|
|
43675
43697
|
const editorDocument = editor?.document || [];
|
|
43676
|
-
const resolveOpts =
|
|
43677
|
-
const resolvedInputs =
|
|
43698
|
+
const resolveOpts = useMemo158(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
43699
|
+
const resolvedInputs = useMemo158(() => {
|
|
43678
43700
|
const r = (val) => resolveReferences(String(val ?? ""), editorDocument, resolveOpts).trim();
|
|
43679
43701
|
return {
|
|
43680
43702
|
matrixRoomId: r(parsed.matrixRoomId),
|
|
@@ -43735,7 +43757,7 @@ var OracleStoreConfigFlowDetail = ({ inputs, editor, block, runtime, updateRunti
|
|
|
43735
43757
|
const handleRetry = useCallback181(() => {
|
|
43736
43758
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
43737
43759
|
}, [updateRuntime]);
|
|
43738
|
-
return /* @__PURE__ */ React393.createElement(Stack287, { gap: "md" }, /* @__PURE__ */ React393.createElement(Stack287, { gap: 2 }, /* @__PURE__ */ React393.createElement(Text268, { fw: 600 }, block?.props?.title || "Store Oracle Configuration"), /* @__PURE__ */ React393.createElement(Text268, { size: "sm", c: "dimmed" }, block?.props?.description || "Stores oracle configuration as a Matrix room state event.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React393.createElement(
|
|
43760
|
+
return /* @__PURE__ */ React393.createElement(Stack287, { gap: "md" }, /* @__PURE__ */ React393.createElement(Stack287, { gap: 2 }, /* @__PURE__ */ React393.createElement(Text268, { fw: 600 }, block?.props?.title || "Store Oracle Configuration"), /* @__PURE__ */ React393.createElement(Text268, { size: "sm", c: "dimmed" }, block?.props?.description || "Stores oracle configuration as a Matrix room state event.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React393.createElement(Group150, { gap: "xs" }, /* @__PURE__ */ React393.createElement(Loader93, { size: 14 }), /* @__PURE__ */ React393.createElement(Text268, { size: "sm", c: "dimmed" }, "Waiting for upstream matrix room + entity DID + oracle name...")), isRunning && /* @__PURE__ */ React393.createElement(Group150, { gap: "xs" }, /* @__PURE__ */ React393.createElement(Loader93, { size: 14 }), /* @__PURE__ */ React393.createElement(Text268, { size: "sm" }, "Storing oracle configuration...")), isCompleted && /* @__PURE__ */ React393.createElement(Alert109, { icon: /* @__PURE__ */ React393.createElement(IconCheck45, { size: 16 }), title: "Configuration Stored", color: "green" }, /* @__PURE__ */ React393.createElement(Stack287, { gap: "xs" }, /* @__PURE__ */ React393.createElement(Text268, { size: "sm" }, "Oracle configuration stored successfully in the Matrix room."), roomId && /* @__PURE__ */ React393.createElement(Text268, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Room ID: ", roomId))), isStale && /* @__PURE__ */ React393.createElement(Alert109, { icon: /* @__PURE__ */ React393.createElement(IconAlertCircle47, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React393.createElement(Stack287, { gap: "xs" }, /* @__PURE__ */ React393.createElement(Text268, { size: "sm" }, "Marked completed but configStored not set. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React393.createElement(Group150, null, /* @__PURE__ */ React393.createElement(Button97, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React393.createElement(Button97, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React393.createElement(Alert109, { icon: /* @__PURE__ */ React393.createElement(IconAlertCircle47, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React393.createElement(Group150, null, /* @__PURE__ */ React393.createElement(Button97, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React393.createElement(Group150, null, /* @__PURE__ */ React393.createElement(Button97, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
43739
43761
|
};
|
|
43740
43762
|
|
|
43741
43763
|
// src/mantine/blocks/action/actionTypes/oracleStoreConfig/index.ts
|
|
@@ -44010,8 +44032,8 @@ var OracleStoreSecretsAndConfigConfig = ({ inputs, onInputsChange }) => {
|
|
|
44010
44032
|
};
|
|
44011
44033
|
|
|
44012
44034
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/OracleStoreSecretsAndConfigFlowDetail.tsx
|
|
44013
|
-
import React395, { useCallback as useCallback183, useEffect as useEffect172, useMemo as
|
|
44014
|
-
import { Alert as Alert110, Button as Button98, Collapse as Collapse13, Divider as Divider40, Group as
|
|
44035
|
+
import React395, { useCallback as useCallback183, useEffect as useEffect172, useMemo as useMemo159, useRef as useRef54, useState as useState233 } from "react";
|
|
44036
|
+
import { Alert as Alert110, Button as Button98, Collapse as Collapse13, Divider as Divider40, Group as Group151, Loader as Loader94, Stack as Stack289, Text as Text270 } from "@mantine/core";
|
|
44015
44037
|
import { IconAlertCircle as IconAlertCircle48, IconCheck as IconCheck46, IconChevronDown as IconChevronDown13, IconChevronUp as IconChevronUp6, IconLock as IconLock2 } from "@tabler/icons-react";
|
|
44016
44038
|
var EXPECTED_SECRETS2 = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
|
|
44017
44039
|
var FIELDS2 = [
|
|
@@ -44060,10 +44082,10 @@ var REQUIRED_FIELDS2 = [
|
|
|
44060
44082
|
];
|
|
44061
44083
|
var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
44062
44084
|
const handlers = useBlocknoteHandlers();
|
|
44063
|
-
const services =
|
|
44064
|
-
const typedParsed =
|
|
44085
|
+
const services = useMemo159(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
44086
|
+
const typedParsed = useMemo159(() => parseOracleStoreSecretsAndConfigInputs(inputs), [inputs]);
|
|
44065
44087
|
const { parsed, resolvedInputs: base, inputsReady } = useResolvedInputs(editor, inputs, { fields: FIELDS2, required: REQUIRED_FIELDS2 }, block?.id);
|
|
44066
|
-
const resolvedInputs =
|
|
44088
|
+
const resolvedInputs = useMemo159(
|
|
44067
44089
|
() => ({
|
|
44068
44090
|
...base,
|
|
44069
44091
|
// price defaults to 0 when absent from the template (typed-parser
|
|
@@ -44081,7 +44103,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
|
|
|
44081
44103
|
const hasProof = Array.isArray(storedSecrets) && storedSecrets.length > 0 && configStored;
|
|
44082
44104
|
const openRouterJwe = runtime.userInputs?.openRouterApiKey || "";
|
|
44083
44105
|
const hasOpenRouter = !!openRouterJwe;
|
|
44084
|
-
const runInputs =
|
|
44106
|
+
const runInputs = useMemo159(() => ({ ...resolvedInputs, openRouterApiKeyJwe: openRouterJwe }), [resolvedInputs, openRouterJwe]);
|
|
44085
44107
|
const { isRunning, isCompleted, isStale, isFailed, errorMessage, handleExecute, handleRetry } = useActionExecution({
|
|
44086
44108
|
executeAction,
|
|
44087
44109
|
runtime,
|
|
@@ -44170,7 +44192,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
|
|
|
44170
44192
|
}, [updateRuntime]);
|
|
44171
44193
|
const lockIcon = /* @__PURE__ */ React395.createElement(IconLock2, { size: 14 });
|
|
44172
44194
|
const submitDisabled = !inputsReady || !hasOpenRouter || isRunning || isCompleted || isDisabled;
|
|
44173
|
-
return /* @__PURE__ */ React395.createElement(Stack289, { gap: "md" }, /* @__PURE__ */ React395.createElement(Stack289, { gap: 2 }, /* @__PURE__ */ React395.createElement(Text270, { fw: 600 }, block?.props?.title || "Store Secrets & Config"), /* @__PURE__ */ React395.createElement(Text270, { size: "sm", c: "dimmed" }, block?.props?.description || "Encrypt secrets and store configuration in the oracle Matrix room.")), isChecking && /* @__PURE__ */ React395.createElement(
|
|
44195
|
+
return /* @__PURE__ */ React395.createElement(Stack289, { gap: "md" }, /* @__PURE__ */ React395.createElement(Stack289, { gap: 2 }, /* @__PURE__ */ React395.createElement(Text270, { fw: 600 }, block?.props?.title || "Store Secrets & Config"), /* @__PURE__ */ React395.createElement(Text270, { size: "sm", c: "dimmed" }, block?.props?.description || "Encrypt secrets and store configuration in the oracle Matrix room.")), isChecking && /* @__PURE__ */ React395.createElement(Group151, { gap: "xs" }, /* @__PURE__ */ React395.createElement(Loader94, { size: 14 }), /* @__PURE__ */ React395.createElement(Text270, { size: "sm", c: "dimmed" }, "Checking matrix room for already-stored secrets...")), !isChecking && !inputsReady && !isCompleted && !isStale && /* @__PURE__ */ React395.createElement(Group151, { gap: "xs" }, /* @__PURE__ */ React395.createElement(Loader94, { size: 14 }), /* @__PURE__ */ React395.createElement(Text270, { size: "sm", c: "dimmed" }, "Waiting for upstream blocks: ", missingFields.join(", "))), isCompleted && /* @__PURE__ */ React395.createElement(Stack289, { gap: "xs" }, /* @__PURE__ */ React395.createElement(Alert110, { icon: /* @__PURE__ */ React395.createElement(IconCheck46, { size: 16 }), title: "Secrets & Config Stored", color: "green" }, /* @__PURE__ */ React395.createElement(Text270, { size: "sm" }, "All ", storedSecrets.length, " secrets and oracle configuration stored in the matrix room.")), /* @__PURE__ */ React395.createElement(Stack289, { gap: 2 }, storedSecrets.map((name) => /* @__PURE__ */ React395.createElement(Group151, { key: name, gap: "xs" }, /* @__PURE__ */ React395.createElement(IconLock2, { size: 12 }), /* @__PURE__ */ React395.createElement(Text270, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, name)))), /* @__PURE__ */ React395.createElement(Group151, null, /* @__PURE__ */ React395.createElement(Button98, { variant: "outline", size: "xs", onClick: handleRestoreAll }, "Re-store all"))), isStale && /* @__PURE__ */ React395.createElement(Alert110, { icon: /* @__PURE__ */ React395.createElement(IconAlertCircle48, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React395.createElement(Stack289, { gap: "xs" }, /* @__PURE__ */ React395.createElement(Text270, { size: "sm" }, "Marked completed but missing proof. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React395.createElement(Group151, null, /* @__PURE__ */ React395.createElement(Button98, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React395.createElement(Button98, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady || !hasOpenRouter }, "Force Run Now")))), !isCompleted && !isStale && !isChecking && inputsReady && /* @__PURE__ */ React395.createElement(Stack289, { gap: "sm" }, /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "SECP_MNEMONIC", readOnly: true, type: "password", value: resolvedInputs.mnemonic, style: { flex: 1 } })), /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "MATRIX_ORACLE_ADMIN_PASSWORD", readOnly: true, type: "password", value: resolvedInputs.matrixPassword, style: { flex: 1 } })), /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", align: "center", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React395.createElement(Stack289, { gap: 0, style: { flex: 1 } }, /* @__PURE__ */ React395.createElement(Text270, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN"), /* @__PURE__ */ React395.createElement(Text270, { size: "xs", c: "dimmed" }, "Generated by handler at submit time (fresh login)"))), /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "MATRIX_RECOVERY_PHRASE", readOnly: true, type: "password", value: resolvedInputs.matrixRecoveryPhrase, style: { flex: 1 } })), /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "MATRIX_VALUE_PIN", readOnly: true, type: "password", value: resolvedInputs.pin, style: { flex: 1 } })), /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, isEditingOpenRouter ? /* @__PURE__ */ React395.createElement(
|
|
44174
44196
|
BaseTextInput,
|
|
44175
44197
|
{
|
|
44176
44198
|
label: "OPEN_ROUTER_API_KEY",
|
|
@@ -44180,7 +44202,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
|
|
|
44180
44202
|
onChange: (event) => setOpenRouterDraft(event.currentTarget.value),
|
|
44181
44203
|
style: { flex: 1 }
|
|
44182
44204
|
}
|
|
44183
|
-
) : /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "OPEN_ROUTER_API_KEY", readOnly: true, type: "password", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", style: { flex: 1 } })), /* @__PURE__ */ React395.createElement(
|
|
44205
|
+
) : /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "OPEN_ROUTER_API_KEY", readOnly: true, type: "password", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", style: { flex: 1 } })), /* @__PURE__ */ React395.createElement(Group151, { gap: "xs", justify: "flex-end" }, isEditingOpenRouter ? /* @__PURE__ */ React395.createElement(React395.Fragment, null, /* @__PURE__ */ React395.createElement(Button98, { size: "xs", onClick: handleSaveOpenRouter, loading: isEncryptingOpenRouter, disabled: !openRouterDraft || !resolvedInputs.publicKeyMultibase }, "Save"), hasOpenRouter && /* @__PURE__ */ React395.createElement(Button98, { size: "xs", variant: "subtle", onClick: handleCancelEditOpenRouter }, "Cancel")) : /* @__PURE__ */ React395.createElement(Button98, { size: "xs", variant: "outline", onClick: handleChangeOpenRouter }, "Change")), /* @__PURE__ */ React395.createElement(Divider40, { variant: "dashed" }), /* @__PURE__ */ React395.createElement(Text270, { size: "sm", fw: 600 }, "Identifiers (stored as plain config)"), /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "MATRIX_ORACLE_ADMIN_USER_ID", readOnly: true, value: resolvedInputs.matrixUserId }), /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "MATRIX_ACCOUNT_ROOM_ID", readOnly: true, value: resolvedInputs.matrixAccountRoomId }), /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "ORACLE_ENTITY_DID", readOnly: true, value: resolvedInputs.entityDid }), /* @__PURE__ */ React395.createElement(Divider40, { variant: "dashed" }), /* @__PURE__ */ React395.createElement(Stack289, { gap: "xs" }, /* @__PURE__ */ React395.createElement(Group151, { justify: "space-between", style: { cursor: "pointer", userSelect: "none" }, onClick: () => setShowAdditional((v) => !v) }, /* @__PURE__ */ React395.createElement(Text270, { size: "sm", fw: 500 }, "Additional Configuration"), /* @__PURE__ */ React395.createElement(Group151, { gap: 6 }, /* @__PURE__ */ React395.createElement(Text270, { size: "xs", c: "dimmed" }, "Stored as plain config"), showAdditional ? /* @__PURE__ */ React395.createElement(IconChevronUp6, { size: 14 }) : /* @__PURE__ */ React395.createElement(IconChevronDown13, { size: 14 }))), /* @__PURE__ */ React395.createElement(Collapse13, { in: showAdditional }, /* @__PURE__ */ React395.createElement(Stack289, { gap: "xs", pt: "xs" }, isLoadingConstants && /* @__PURE__ */ React395.createElement(Group151, { gap: 6 }, /* @__PURE__ */ React395.createElement(Loader94, { size: 12 }), /* @__PURE__ */ React395.createElement(Text270, { size: "xs", c: "dimmed" }, "Loading network constants...")), /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "ORACLE_NAME", value: resolvedInputs.oracleName || "", readOnly: true }), /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "ORACLE_ADDRESS", value: resolvedInputs.oracleAddress || "", readOnly: true }), /* @__PURE__ */ React395.createElement(BaseTextInput, { label: "ORACLE_DID", value: resolvedInputs.oracleDid || "", readOnly: true }), networkConstants && Object.entries(networkConstants).map(([key, value]) => /* @__PURE__ */ React395.createElement(BaseTextInput, { key, label: key, value, readOnly: true }))))), isRunning && /* @__PURE__ */ React395.createElement(Group151, { gap: "xs" }, /* @__PURE__ */ React395.createElement(Loader94, { size: 14 }), /* @__PURE__ */ React395.createElement(Text270, { size: "sm" }, "Storing secrets and configuration...")), /* @__PURE__ */ React395.createElement(Group151, { justify: "flex-end" }, /* @__PURE__ */ React395.createElement(Button98, { variant: "filled", size: "sm", onClick: handleExecute, disabled: submitDisabled }, "Store Secrets & Config"))), isFailed && errorMessage && /* @__PURE__ */ React395.createElement(Alert110, { icon: /* @__PURE__ */ React395.createElement(IconAlertCircle48, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React395.createElement(Group151, null, /* @__PURE__ */ React395.createElement(Button98, { variant: "outline", onClick: handleRetry }, "Try Again")));
|
|
44184
44206
|
};
|
|
44185
44207
|
|
|
44186
44208
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/index.ts
|
|
@@ -44456,8 +44478,8 @@ var OracleConfigureOracleConfig = ({ inputs, onInputsChange }) => {
|
|
|
44456
44478
|
};
|
|
44457
44479
|
|
|
44458
44480
|
// src/mantine/blocks/action/actionTypes/oracleConfigureOracle/OracleConfigureOracleFlowDetail.tsx
|
|
44459
|
-
import React397, { useCallback as useCallback185, useEffect as useEffect174, useMemo as
|
|
44460
|
-
import { Alert as Alert111, Button as Button99, Collapse as Collapse14, Divider as Divider42, Group as
|
|
44481
|
+
import React397, { useCallback as useCallback185, useEffect as useEffect174, useMemo as useMemo160, useRef as useRef55, useState as useState235 } from "react";
|
|
44482
|
+
import { Alert as Alert111, Button as Button99, Collapse as Collapse14, Divider as Divider42, Group as Group152, Loader as Loader95, Stack as Stack291, Text as Text272 } from "@mantine/core";
|
|
44461
44483
|
import { IconAlertCircle as IconAlertCircle49, IconCheck as IconCheck47, IconChevronDown as IconChevronDown14, IconChevronUp as IconChevronUp7, IconLock as IconLock4 } from "@tabler/icons-react";
|
|
44462
44484
|
var EXPECTED_SECRETS3 = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
|
|
44463
44485
|
var FIELDS3 = [
|
|
@@ -44509,10 +44531,10 @@ var REQUIRED_FIELDS3 = [
|
|
|
44509
44531
|
];
|
|
44510
44532
|
var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
44511
44533
|
const handlers = useBlocknoteHandlers();
|
|
44512
|
-
const services =
|
|
44513
|
-
const typedParsed =
|
|
44534
|
+
const services = useMemo160(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
44535
|
+
const typedParsed = useMemo160(() => parseOracleConfigureOracleInputs(inputs), [inputs]);
|
|
44514
44536
|
const { parsed, resolvedInputs: base } = useResolvedInputs(editor, inputs, { fields: FIELDS3, required: REQUIRED_FIELDS3 }, block?.id);
|
|
44515
|
-
const resolvedInputs =
|
|
44537
|
+
const resolvedInputs = useMemo160(() => {
|
|
44516
44538
|
const form = (() => {
|
|
44517
44539
|
if (!base.formAnswers) return {};
|
|
44518
44540
|
try {
|
|
@@ -44559,7 +44581,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
|
|
|
44559
44581
|
const openRouterJwe = runtime.userInputs?.openRouterApiKey || "";
|
|
44560
44582
|
const hasOpenRouter = !!openRouterJwe;
|
|
44561
44583
|
const openRouterPlaintext = runtime.userInputs?.openRouterApiKeyPlaintext || "";
|
|
44562
|
-
const runInputs =
|
|
44584
|
+
const runInputs = useMemo160(
|
|
44563
44585
|
() => ({ ...resolvedInputs, openRouterApiKeyJwe: openRouterJwe, openRouterApiKeyPlaintext: openRouterPlaintext }),
|
|
44564
44586
|
[resolvedInputs, openRouterJwe, openRouterPlaintext]
|
|
44565
44587
|
);
|
|
@@ -44651,7 +44673,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
|
|
|
44651
44673
|
}, [updateRuntime]);
|
|
44652
44674
|
const lockIcon = /* @__PURE__ */ React397.createElement(IconLock4, { size: 14 });
|
|
44653
44675
|
const submitDisabled = !inputsReady || !hasOpenRouter || isRunning || isCompleted || isDisabled;
|
|
44654
|
-
return /* @__PURE__ */ React397.createElement(Stack291, { gap: "md" }, /* @__PURE__ */ React397.createElement(Stack291, { gap: 2 }, /* @__PURE__ */ React397.createElement(Text272, { fw: 600 }, block?.props?.title || "Configure Oracle"), /* @__PURE__ */ React397.createElement(Text272, { size: "sm", c: "dimmed" }, block?.props?.description || "Contract oracle, encrypt secrets, and store configuration.")), isChecking && /* @__PURE__ */ React397.createElement(
|
|
44676
|
+
return /* @__PURE__ */ React397.createElement(Stack291, { gap: "md" }, /* @__PURE__ */ React397.createElement(Stack291, { gap: 2 }, /* @__PURE__ */ React397.createElement(Text272, { fw: 600 }, block?.props?.title || "Configure Oracle"), /* @__PURE__ */ React397.createElement(Text272, { size: "sm", c: "dimmed" }, block?.props?.description || "Contract oracle, encrypt secrets, and store configuration.")), isChecking && /* @__PURE__ */ React397.createElement(Group152, { gap: "xs" }, /* @__PURE__ */ React397.createElement(Loader95, { size: 14 }), /* @__PURE__ */ React397.createElement(Text272, { size: "sm", c: "dimmed" }, "Checking matrix room for already-stored secrets...")), !isChecking && !inputsReady && !isCompleted && !isStale && /* @__PURE__ */ React397.createElement(Group152, { gap: "xs" }, /* @__PURE__ */ React397.createElement(Loader95, { size: 14 }), /* @__PURE__ */ React397.createElement(Text272, { size: "sm", c: "dimmed" }, "Waiting for upstream blocks: ", missingFields.join(", "))), isCompleted && /* @__PURE__ */ React397.createElement(Stack291, { gap: "xs" }, /* @__PURE__ */ React397.createElement(Alert111, { icon: /* @__PURE__ */ React397.createElement(IconCheck47, { size: 16 }), title: "Oracle Configured", color: "green" }, /* @__PURE__ */ React397.createElement(Text272, { size: "sm" }, "Contract established, ", storedSecrets.length, " secrets stored, and oracle configuration saved.")), /* @__PURE__ */ React397.createElement(Stack291, { gap: 2 }, storedSecrets.map((name) => /* @__PURE__ */ React397.createElement(Group152, { key: name, gap: "xs" }, /* @__PURE__ */ React397.createElement(IconLock4, { size: 12 }), /* @__PURE__ */ React397.createElement(Text272, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, name)))), /* @__PURE__ */ React397.createElement(Group152, null, /* @__PURE__ */ React397.createElement(Button99, { variant: "outline", size: "xs", onClick: handleRestoreAll }, "Re-configure all"))), isStale && /* @__PURE__ */ React397.createElement(Alert111, { icon: /* @__PURE__ */ React397.createElement(IconAlertCircle49, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React397.createElement(Stack291, { gap: "xs" }, /* @__PURE__ */ React397.createElement(Text272, { size: "sm" }, "Marked completed but missing proof. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React397.createElement(Group152, null, /* @__PURE__ */ React397.createElement(Button99, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React397.createElement(Button99, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady || !hasOpenRouter }, "Force Run Now")))), !isCompleted && !isStale && !isChecking && inputsReady && /* @__PURE__ */ React397.createElement(Stack291, { gap: "sm" }, /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "SECP_MNEMONIC", readOnly: true, type: "password", value: resolvedInputs.mnemonic, style: { flex: 1 } })), /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "MATRIX_ORACLE_ADMIN_PASSWORD", readOnly: true, type: "password", value: resolvedInputs.matrixPassword, style: { flex: 1 } })), /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", align: "center", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React397.createElement(Stack291, { gap: 0, style: { flex: 1 } }, /* @__PURE__ */ React397.createElement(Text272, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN"), /* @__PURE__ */ React397.createElement(Text272, { size: "xs", c: "dimmed" }, "Generated by handler at submit time (fresh login)"))), /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "MATRIX_RECOVERY_PHRASE", readOnly: true, type: "password", value: resolvedInputs.matrixRecoveryPhrase, style: { flex: 1 } })), /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "MATRIX_VALUE_PIN", readOnly: true, type: "password", value: resolvedInputs.pin, style: { flex: 1 } })), /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", align: "flex-end", wrap: "nowrap" }, lockIcon, isEditingOpenRouter ? /* @__PURE__ */ React397.createElement(
|
|
44655
44677
|
BaseTextInput,
|
|
44656
44678
|
{
|
|
44657
44679
|
label: "OPEN_ROUTER_API_KEY",
|
|
@@ -44661,7 +44683,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
|
|
|
44661
44683
|
onChange: (event) => setOpenRouterDraft(event.currentTarget.value),
|
|
44662
44684
|
style: { flex: 1 }
|
|
44663
44685
|
}
|
|
44664
|
-
) : /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "OPEN_ROUTER_API_KEY", readOnly: true, type: "password", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", style: { flex: 1 } })), /* @__PURE__ */ React397.createElement(
|
|
44686
|
+
) : /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "OPEN_ROUTER_API_KEY", readOnly: true, type: "password", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", style: { flex: 1 } })), /* @__PURE__ */ React397.createElement(Group152, { gap: "xs", justify: "flex-end" }, isEditingOpenRouter ? /* @__PURE__ */ React397.createElement(React397.Fragment, null, /* @__PURE__ */ React397.createElement(Button99, { size: "xs", onClick: handleSaveOpenRouter, loading: isEncryptingOpenRouter, disabled: !openRouterDraft || !resolvedInputs.publicKeyMultibase }, "Save"), hasOpenRouter && /* @__PURE__ */ React397.createElement(Button99, { size: "xs", variant: "subtle", onClick: handleCancelEditOpenRouter }, "Cancel")) : /* @__PURE__ */ React397.createElement(Button99, { size: "xs", variant: "outline", onClick: handleChangeOpenRouter }, "Change")), /* @__PURE__ */ React397.createElement(Divider42, { variant: "dashed" }), /* @__PURE__ */ React397.createElement(Text272, { size: "sm", fw: 600 }, "Identifiers (stored as plain config)"), /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "MATRIX_ORACLE_ADMIN_USER_ID", readOnly: true, value: resolvedInputs.matrixUserId }), /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "MATRIX_ACCOUNT_ROOM_ID", readOnly: true, value: resolvedInputs.matrixAccountRoomId }), /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "ORACLE_ENTITY_DID", readOnly: true, value: resolvedInputs.entityDid }), /* @__PURE__ */ React397.createElement(Divider42, { variant: "dashed" }), /* @__PURE__ */ React397.createElement(Stack291, { gap: "xs" }, /* @__PURE__ */ React397.createElement(Group152, { justify: "space-between", style: { cursor: "pointer", userSelect: "none" }, onClick: () => setShowAdditional((v) => !v) }, /* @__PURE__ */ React397.createElement(Text272, { size: "sm", fw: 500 }, "Additional Configuration"), /* @__PURE__ */ React397.createElement(Group152, { gap: 6 }, /* @__PURE__ */ React397.createElement(Text272, { size: "xs", c: "dimmed" }, "Stored as plain config"), showAdditional ? /* @__PURE__ */ React397.createElement(IconChevronUp7, { size: 14 }) : /* @__PURE__ */ React397.createElement(IconChevronDown14, { size: 14 }))), /* @__PURE__ */ React397.createElement(Collapse14, { in: showAdditional }, /* @__PURE__ */ React397.createElement(Stack291, { gap: "xs", pt: "xs" }, isLoadingConstants && /* @__PURE__ */ React397.createElement(Group152, { gap: 6 }, /* @__PURE__ */ React397.createElement(Loader95, { size: 12 }), /* @__PURE__ */ React397.createElement(Text272, { size: "xs", c: "dimmed" }, "Loading network constants...")), /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "ORACLE_NAME", value: resolvedInputs.oracleName || "", readOnly: true }), /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "ORACLE_ADDRESS", value: resolvedInputs.oracleAddress || "", readOnly: true }), /* @__PURE__ */ React397.createElement(BaseTextInput, { label: "ORACLE_DID", value: resolvedInputs.oracleDid || "", readOnly: true }), networkConstants && Object.entries(networkConstants).map(([key, value]) => /* @__PURE__ */ React397.createElement(BaseTextInput, { key, label: key, value, readOnly: true }))))), isRunning && /* @__PURE__ */ React397.createElement(Group152, { gap: "xs" }, /* @__PURE__ */ React397.createElement(Loader95, { size: 14 }), /* @__PURE__ */ React397.createElement(Text272, { size: "sm" }, "Contracting oracle, storing secrets, and saving configuration...")), /* @__PURE__ */ React397.createElement(Group152, { justify: "flex-end" }, /* @__PURE__ */ React397.createElement(Button99, { variant: "filled", size: "sm", onClick: handleExecute, disabled: submitDisabled }, "Configure Oracle"))), isFailed && errorMessage && /* @__PURE__ */ React397.createElement(Alert111, { icon: /* @__PURE__ */ React397.createElement(IconAlertCircle49, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React397.createElement(Group152, null, /* @__PURE__ */ React397.createElement(Button99, { variant: "outline", onClick: handleRetry }, "Try Again")));
|
|
44665
44687
|
};
|
|
44666
44688
|
|
|
44667
44689
|
// src/mantine/blocks/action/actionTypes/oracleConfigureOracle/index.ts
|
|
@@ -44684,8 +44706,8 @@ var OracleDeploySetupConfig = () => {
|
|
|
44684
44706
|
};
|
|
44685
44707
|
|
|
44686
44708
|
// src/mantine/blocks/action/actionTypes/oracleDeploySetup/OracleDeploySetupFlowDetail.tsx
|
|
44687
|
-
import React399, { useCallback as useCallback186, useMemo as
|
|
44688
|
-
import { Alert as Alert112, Button as Button100, Group as
|
|
44709
|
+
import React399, { useCallback as useCallback186, useMemo as useMemo161 } from "react";
|
|
44710
|
+
import { Alert as Alert112, Button as Button100, Group as Group153, Loader as Loader96, Stack as Stack293, Text as Text274 } from "@mantine/core";
|
|
44689
44711
|
import { IconCheck as IconCheck48, IconAlertCircle as IconAlertCircle50 } from "@tabler/icons-react";
|
|
44690
44712
|
|
|
44691
44713
|
// src/mantine/blocks/action/actionTypes/oracleDeploySetup/types.ts
|
|
@@ -44727,10 +44749,10 @@ function parseOracleDeploySetupInputs(json) {
|
|
|
44727
44749
|
|
|
44728
44750
|
// src/mantine/blocks/action/actionTypes/oracleDeploySetup/OracleDeploySetupFlowDetail.tsx
|
|
44729
44751
|
var OracleDeploySetupFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
44730
|
-
const parsed =
|
|
44752
|
+
const parsed = useMemo161(() => parseOracleDeploySetupInputs(inputs), [inputs]);
|
|
44731
44753
|
const editorDocument = editor?.document || [];
|
|
44732
|
-
const resolveOpts =
|
|
44733
|
-
const resolvedInputs =
|
|
44754
|
+
const resolveOpts = useMemo161(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
44755
|
+
const resolvedInputs = useMemo161(() => {
|
|
44734
44756
|
const r = (val) => resolveReferences(String(val ?? ""), editorDocument, resolveOpts).trim();
|
|
44735
44757
|
return {
|
|
44736
44758
|
name: r(parsed.name),
|
|
@@ -44821,7 +44843,7 @@ var OracleDeploySetupFlowDetail = ({ inputs, editor, block, runtime, updateRunti
|
|
|
44821
44843
|
const handleRetry = useCallback186(() => {
|
|
44822
44844
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
44823
44845
|
}, [updateRuntime]);
|
|
44824
|
-
return /* @__PURE__ */ React399.createElement(Stack293, { gap: "md" }, /* @__PURE__ */ React399.createElement(Stack293, { gap: 2 }, /* @__PURE__ */ React399.createElement(Text274, { fw: 600 }, block?.props?.title || "Deploy Oracle \u2014 Setup"), /* @__PURE__ */ React399.createElement(Text274, { size: "sm", c: "dimmed" }, block?.props?.description || "Clones the oracle repository, writes configuration, installs dependencies, and builds.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React399.createElement(
|
|
44846
|
+
return /* @__PURE__ */ React399.createElement(Stack293, { gap: "md" }, /* @__PURE__ */ React399.createElement(Stack293, { gap: 2 }, /* @__PURE__ */ React399.createElement(Text274, { fw: 600 }, block?.props?.title || "Deploy Oracle \u2014 Setup"), /* @__PURE__ */ React399.createElement(Text274, { size: "sm", c: "dimmed" }, block?.props?.description || "Clones the oracle repository, writes configuration, installs dependencies, and builds.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React399.createElement(Group153, { gap: "xs" }, /* @__PURE__ */ React399.createElement(Loader96, { size: 14 }), /* @__PURE__ */ React399.createElement(Text274, { size: "sm", c: "dimmed" }, "Waiting for upstream secrets & config...")), isRunning && /* @__PURE__ */ React399.createElement(Group153, { gap: "xs" }, /* @__PURE__ */ React399.createElement(Loader96, { size: 14 }), /* @__PURE__ */ React399.createElement(Text274, { size: "sm" }, "Setting up oracle environment... This may take a few minutes.")), isCompleted && /* @__PURE__ */ React399.createElement(Alert112, { icon: /* @__PURE__ */ React399.createElement(IconCheck48, { size: 16 }), title: "Setup Complete", color: "green" }, /* @__PURE__ */ React399.createElement(Stack293, { gap: "xs" }, /* @__PURE__ */ React399.createElement(Text274, { size: "sm" }, "Oracle environment set up successfully."))), isStale && /* @__PURE__ */ React399.createElement(Alert112, { icon: /* @__PURE__ */ React399.createElement(IconAlertCircle50, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React399.createElement(Stack293, { gap: "xs" }, /* @__PURE__ */ React399.createElement(Text274, { size: "sm" }, "Marked completed but setupComplete not set. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React399.createElement(Group153, null, /* @__PURE__ */ React399.createElement(Button100, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React399.createElement(Button100, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React399.createElement(Alert112, { icon: /* @__PURE__ */ React399.createElement(IconAlertCircle50, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React399.createElement(Group153, null, /* @__PURE__ */ React399.createElement(Button100, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React399.createElement(Group153, null, /* @__PURE__ */ React399.createElement(Button100, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
44825
44847
|
};
|
|
44826
44848
|
|
|
44827
44849
|
// src/mantine/blocks/action/actionTypes/oracleDeploySetup/index.ts
|
|
@@ -44844,8 +44866,8 @@ var OracleDeployStartConfig = () => {
|
|
|
44844
44866
|
};
|
|
44845
44867
|
|
|
44846
44868
|
// src/mantine/blocks/action/actionTypes/oracleDeployStart/OracleDeployStartFlowDetail.tsx
|
|
44847
|
-
import React401, { useCallback as useCallback187, useMemo as
|
|
44848
|
-
import { Alert as Alert113, Button as Button101, Group as
|
|
44869
|
+
import React401, { useCallback as useCallback187, useMemo as useMemo162 } from "react";
|
|
44870
|
+
import { Alert as Alert113, Button as Button101, Group as Group154, Loader as Loader97, Stack as Stack295, Text as Text276 } from "@mantine/core";
|
|
44849
44871
|
import { IconCheck as IconCheck49, IconAlertCircle as IconAlertCircle51 } from "@tabler/icons-react";
|
|
44850
44872
|
|
|
44851
44873
|
// src/mantine/blocks/action/actionTypes/oracleDeployStart/types.ts
|
|
@@ -44860,9 +44882,9 @@ function parseOracleDeployStartInputs(json) {
|
|
|
44860
44882
|
|
|
44861
44883
|
// src/mantine/blocks/action/actionTypes/oracleDeployStart/OracleDeployStartFlowDetail.tsx
|
|
44862
44884
|
var OracleDeployStartFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
44863
|
-
const parsed =
|
|
44885
|
+
const parsed = useMemo162(() => parseOracleDeployStartInputs(inputs), [inputs]);
|
|
44864
44886
|
const editorDocument = editor?.document || [];
|
|
44865
|
-
const resolveOpts =
|
|
44887
|
+
const resolveOpts = useMemo162(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
44866
44888
|
const resolvedName = resolveReferences(parsed.name || "", editorDocument, resolveOpts).trim();
|
|
44867
44889
|
const resolvedEntityDid = resolveReferences(parsed.entityDid || "", editorDocument, resolveOpts).trim();
|
|
44868
44890
|
const resolvedRoomId = resolveReferences(parsed.roomId || "", editorDocument, resolveOpts).trim();
|
|
@@ -44905,7 +44927,7 @@ var OracleDeployStartFlowDetail = ({ inputs, editor, block, runtime, updateRunti
|
|
|
44905
44927
|
const handleRetry = useCallback187(() => {
|
|
44906
44928
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
44907
44929
|
}, [updateRuntime]);
|
|
44908
|
-
return /* @__PURE__ */ React401.createElement(Stack295, { gap: "md" }, /* @__PURE__ */ React401.createElement(Stack295, { gap: 2 }, /* @__PURE__ */ React401.createElement(Text276, { fw: 600 }, block?.props?.title || "Deploy Oracle \u2014 Start"), /* @__PURE__ */ React401.createElement(Text276, { size: "sm", c: "dimmed" }, block?.props?.description || "Starts the oracle process and waits for it to be ready.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React401.createElement(
|
|
44930
|
+
return /* @__PURE__ */ React401.createElement(Stack295, { gap: "md" }, /* @__PURE__ */ React401.createElement(Stack295, { gap: 2 }, /* @__PURE__ */ React401.createElement(Text276, { fw: 600 }, block?.props?.title || "Deploy Oracle \u2014 Start"), /* @__PURE__ */ React401.createElement(Text276, { size: "sm", c: "dimmed" }, block?.props?.description || "Starts the oracle process and waits for it to be ready.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React401.createElement(Group154, { gap: "xs" }, /* @__PURE__ */ React401.createElement(Loader97, { size: 14 }), /* @__PURE__ */ React401.createElement(Text276, { size: "sm", c: "dimmed" }, "Waiting for oracle setup to complete...")), isRunning && /* @__PURE__ */ React401.createElement(Group154, { gap: "xs" }, /* @__PURE__ */ React401.createElement(Loader97, { size: 14 }), /* @__PURE__ */ React401.createElement(Text276, { size: "sm" }, "Starting oracle...")), isCompleted && /* @__PURE__ */ React401.createElement(Alert113, { icon: /* @__PURE__ */ React401.createElement(IconCheck49, { size: 16 }), title: "Oracle Running", color: "green" }, /* @__PURE__ */ React401.createElement(Stack295, { gap: "xs" }, /* @__PURE__ */ React401.createElement(Text276, { size: "sm" }, "Oracle is running!"), processId && /* @__PURE__ */ React401.createElement(Text276, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Process ID: ", processId), status && /* @__PURE__ */ React401.createElement(Text276, { size: "xs", c: "dimmed" }, "Status: ", status))), isStale && /* @__PURE__ */ React401.createElement(Alert113, { icon: /* @__PURE__ */ React401.createElement(IconAlertCircle51, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React401.createElement(Stack295, { gap: "xs" }, /* @__PURE__ */ React401.createElement(Text276, { size: "sm" }, "Marked completed but no processId or running status recorded. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React401.createElement(Group154, null, /* @__PURE__ */ React401.createElement(Button101, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React401.createElement(Button101, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React401.createElement(Alert113, { icon: /* @__PURE__ */ React401.createElement(IconAlertCircle51, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React401.createElement(Group154, null, /* @__PURE__ */ React401.createElement(Button101, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React401.createElement(Group154, null, /* @__PURE__ */ React401.createElement(Button101, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
44909
44931
|
};
|
|
44910
44932
|
|
|
44911
44933
|
// src/mantine/blocks/action/actionTypes/oracleDeployStart/index.ts
|
|
@@ -44928,8 +44950,8 @@ var OracleDeployConfig = () => {
|
|
|
44928
44950
|
};
|
|
44929
44951
|
|
|
44930
44952
|
// src/mantine/blocks/action/actionTypes/oracleDeploy/OracleDeployFlowDetail.tsx
|
|
44931
|
-
import React403, { useCallback as useCallback188, useMemo as
|
|
44932
|
-
import { Alert as Alert114, Button as Button102, Group as
|
|
44953
|
+
import React403, { useCallback as useCallback188, useMemo as useMemo163 } from "react";
|
|
44954
|
+
import { Alert as Alert114, Button as Button102, Group as Group155, Loader as Loader98, Stack as Stack297, Text as Text278 } from "@mantine/core";
|
|
44933
44955
|
import { IconCheck as IconCheck50, IconAlertCircle as IconAlertCircle52 } from "@tabler/icons-react";
|
|
44934
44956
|
|
|
44935
44957
|
// src/mantine/blocks/action/actionTypes/oracleDeploy/types.ts
|
|
@@ -44981,10 +45003,10 @@ function parseOracleDeployInputs(json) {
|
|
|
44981
45003
|
// src/mantine/blocks/action/actionTypes/oracleDeploy/OracleDeployFlowDetail.tsx
|
|
44982
45004
|
var OracleDeployFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, executeAction }) => {
|
|
44983
45005
|
const handlers = useBlocknoteHandlers();
|
|
44984
|
-
const parsed =
|
|
45006
|
+
const parsed = useMemo163(() => parseOracleDeployInputs(inputs), [inputs]);
|
|
44985
45007
|
const editorDocument = editor?.document || [];
|
|
44986
|
-
const resolveOpts =
|
|
44987
|
-
const resolvedInputs =
|
|
45008
|
+
const resolveOpts = useMemo163(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
45009
|
+
const resolvedInputs = useMemo163(() => {
|
|
44988
45010
|
const r = (val) => resolveReferences(String(val ?? ""), editorDocument, resolveOpts).trim();
|
|
44989
45011
|
const formAnswersStr = r(parsed.formAnswers);
|
|
44990
45012
|
const form = (() => {
|
|
@@ -45129,7 +45151,7 @@ var OracleDeployFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
45129
45151
|
const handleRetry = useCallback188(() => {
|
|
45130
45152
|
updateRuntime({ state: "idle", error: void 0, output: {} });
|
|
45131
45153
|
}, [updateRuntime]);
|
|
45132
|
-
return /* @__PURE__ */ React403.createElement(Stack297, { gap: "md" }, /* @__PURE__ */ React403.createElement(Stack297, { gap: 2 }, /* @__PURE__ */ React403.createElement(Text278, { fw: 600 }, block?.props?.title || "Deploy Oracle"), /* @__PURE__ */ React403.createElement(Text278, { size: "sm", c: "dimmed" }, block?.props?.description || "Sets up the oracle environment, installs dependencies, builds, and starts the process.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React403.createElement(
|
|
45154
|
+
return /* @__PURE__ */ React403.createElement(Stack297, { gap: "md" }, /* @__PURE__ */ React403.createElement(Stack297, { gap: 2 }, /* @__PURE__ */ React403.createElement(Text278, { fw: 600 }, block?.props?.title || "Deploy Oracle"), /* @__PURE__ */ React403.createElement(Text278, { size: "sm", c: "dimmed" }, block?.props?.description || "Sets up the oracle environment, installs dependencies, builds, and starts the process.")), !isRunning && !isCompleted && !isStale && !isFailed && !inputsReady && /* @__PURE__ */ React403.createElement(Group155, { gap: "xs" }, /* @__PURE__ */ React403.createElement(Loader98, { size: 14 }), /* @__PURE__ */ React403.createElement(Text278, { size: "sm", c: "dimmed" }, "Waiting for upstream secrets & config...")), isRunning && /* @__PURE__ */ React403.createElement(Group155, { gap: "xs" }, /* @__PURE__ */ React403.createElement(Loader98, { size: 14 }), /* @__PURE__ */ React403.createElement(Text278, { size: "sm" }, "Deploying oracle... This may take a few minutes.")), isCompleted && /* @__PURE__ */ React403.createElement(Alert114, { icon: /* @__PURE__ */ React403.createElement(IconCheck50, { size: 16 }), title: "Oracle Deployed", color: "green" }, /* @__PURE__ */ React403.createElement(Stack297, { gap: "xs" }, /* @__PURE__ */ React403.createElement(Text278, { size: "sm" }, "Oracle deployed and running!"), processId && /* @__PURE__ */ React403.createElement(Text278, { size: "xs", c: "dimmed" }, "Process ID: ", processId), status && /* @__PURE__ */ React403.createElement(Text278, { size: "xs", c: "dimmed" }, "Status: ", status), deploymentUrl && /* @__PURE__ */ React403.createElement(Text278, { size: "xs", c: "dimmed" }, "Deployment URL: ", deploymentUrl), domainUpdateTxHash && /* @__PURE__ */ React403.createElement(Text278, { size: "xs", c: "dimmed" }, "Domain updated on-chain (tx: ", domainUpdateTxHash.slice(0, 16), "\u2026)"))), isStale && /* @__PURE__ */ React403.createElement(Alert114, { icon: /* @__PURE__ */ React403.createElement(IconAlertCircle52, { size: 16 }), color: "yellow", title: "Inconsistent State" }, /* @__PURE__ */ React403.createElement(Stack297, { gap: "xs" }, /* @__PURE__ */ React403.createElement(Text278, { size: "sm" }, "Marked completed but missing deploy proof. Stale state \u2014 reset and re-run."), /* @__PURE__ */ React403.createElement(Group155, null, /* @__PURE__ */ React403.createElement(Button102, { variant: "outline", size: "xs", onClick: handleRetry }, "Reset"), /* @__PURE__ */ React403.createElement(Button102, { variant: "filled", size: "xs", onClick: handleExecute, disabled: !inputsReady }, "Force Run Now")))), isFailed && errorMessage && /* @__PURE__ */ React403.createElement(Alert114, { icon: /* @__PURE__ */ React403.createElement(IconAlertCircle52, { size: 16 }), color: "red", styles: actionAlertStyles }, errorMessage), isFailed && /* @__PURE__ */ React403.createElement(Group155, null, /* @__PURE__ */ React403.createElement(Button102, { variant: "outline", onClick: handleRetry }, "Try Again")), !isRunning && !isStale && /* @__PURE__ */ React403.createElement(Group155, null, /* @__PURE__ */ React403.createElement(Button102, { variant: "filled", size: "sm", onClick: handleExecute, disabled: !inputsReady || isDisabled }, isCompleted ? "Re-run" : inputsReady ? "Run Now" : "Waiting for inputs...")));
|
|
45133
45155
|
};
|
|
45134
45156
|
|
|
45135
45157
|
// src/mantine/blocks/action/actionTypes/oracleDeploy/index.ts
|
|
@@ -45244,8 +45266,8 @@ import { createReactBlockSpec as createReactBlockSpec21 } from "@blocknote/react
|
|
|
45244
45266
|
import React413 from "react";
|
|
45245
45267
|
|
|
45246
45268
|
// src/mantine/blocks/location/template/TemplateView.tsx
|
|
45247
|
-
import React410, { useMemo as
|
|
45248
|
-
import { Group as
|
|
45269
|
+
import React410, { useMemo as useMemo164 } from "react";
|
|
45270
|
+
import { Group as Group157, Stack as Stack299, Text as Text281 } from "@mantine/core";
|
|
45249
45271
|
import { IconMapPin } from "@tabler/icons-react";
|
|
45250
45272
|
|
|
45251
45273
|
// src/mantine/blocks/location/template/TemplateConfig.tsx
|
|
@@ -45316,7 +45338,7 @@ function useUnlMap() {
|
|
|
45316
45338
|
|
|
45317
45339
|
// src/mantine/blocks/location/components/TileSelector.tsx
|
|
45318
45340
|
import React406, { useState as useState237, useCallback as useCallback189 } from "react";
|
|
45319
|
-
import { ActionIcon as ActionIcon51, Group as
|
|
45341
|
+
import { ActionIcon as ActionIcon51, Group as Group156, Tooltip as Tooltip35 } from "@mantine/core";
|
|
45320
45342
|
import { IconMap, IconMoon, IconSatellite, IconMountain } from "@tabler/icons-react";
|
|
45321
45343
|
var TILE_LAYERS = {
|
|
45322
45344
|
dark: {
|
|
@@ -45391,7 +45413,7 @@ var TileSelector = ({ mapRef }) => {
|
|
|
45391
45413
|
...OVERLAY_KEYS.map((key) => ({ type: key, label: TILE_LAYERS[key].label, icon: TILE_LAYERS[key].icon }))
|
|
45392
45414
|
];
|
|
45393
45415
|
return /* @__PURE__ */ React406.createElement(
|
|
45394
|
-
|
|
45416
|
+
Group156,
|
|
45395
45417
|
{
|
|
45396
45418
|
gap: 2,
|
|
45397
45419
|
style: {
|
|
@@ -45404,7 +45426,7 @@ var TileSelector = ({ mapRef }) => {
|
|
|
45404
45426
|
padding: 2
|
|
45405
45427
|
}
|
|
45406
45428
|
},
|
|
45407
|
-
items.map(({ type, label, icon: icon2 }) => /* @__PURE__ */ React406.createElement(
|
|
45429
|
+
items.map(({ type, label, icon: icon2 }) => /* @__PURE__ */ React406.createElement(Tooltip35, { key: type, label, withArrow: true }, /* @__PURE__ */ React406.createElement(
|
|
45408
45430
|
ActionIcon51,
|
|
45409
45431
|
{
|
|
45410
45432
|
variant: active === type ? "filled" : "subtle",
|
|
@@ -45672,15 +45694,15 @@ function LocationMap(props) {
|
|
|
45672
45694
|
var LOCATION_TEMPLATE_PANEL_ID = "location-template-panel";
|
|
45673
45695
|
var LocationTemplateView = ({ editor, block }) => {
|
|
45674
45696
|
const panelId = `${LOCATION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
45675
|
-
const panelContent =
|
|
45697
|
+
const panelContent = useMemo164(() => /* @__PURE__ */ React410.createElement(TemplateConfig17, { editor, block }), [editor, block]);
|
|
45676
45698
|
const { open } = usePanel(panelId, panelContent);
|
|
45677
45699
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
45678
|
-
return /* @__PURE__ */ React410.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React410.createElement(Stack299, { gap: "xs", justify: "center" }, /* @__PURE__ */ React410.createElement(
|
|
45700
|
+
return /* @__PURE__ */ React410.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React410.createElement(Stack299, { gap: "xs", justify: "center" }, /* @__PURE__ */ React410.createElement(Group157, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React410.createElement(IconMapPin, { color: "currentColor", size: 26, stroke: 1.5 }), /* @__PURE__ */ React410.createElement(Stack299, { gap: 2 }, /* @__PURE__ */ React410.createElement(Text281, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React410.createElement(Text281, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation && /* @__PURE__ */ React410.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-template-map-${block.id}`, zoom: 14, showMarker: true, showTilesControl: true })));
|
|
45679
45701
|
};
|
|
45680
45702
|
|
|
45681
45703
|
// src/mantine/blocks/location/flow/FlowView.tsx
|
|
45682
|
-
import React412, { useMemo as
|
|
45683
|
-
import { Center as Center14, Group as
|
|
45704
|
+
import React412, { useMemo as useMemo165 } from "react";
|
|
45705
|
+
import { Center as Center14, Group as Group158, Stack as Stack300, Text as Text282 } from "@mantine/core";
|
|
45684
45706
|
import { IconMapPin as IconMapPin2 } from "@tabler/icons-react";
|
|
45685
45707
|
|
|
45686
45708
|
// src/mantine/blocks/location/flow/FlowConfig.tsx
|
|
@@ -45695,10 +45717,10 @@ var FlowConfig3 = ({ block }) => {
|
|
|
45695
45717
|
var LOCATION_FLOW_PANEL_ID = "location-flow-panel";
|
|
45696
45718
|
var LocationFlowView = ({ editor, block }) => {
|
|
45697
45719
|
const panelId = `${LOCATION_FLOW_PANEL_ID}-${block.id}`;
|
|
45698
|
-
const panelContent =
|
|
45720
|
+
const panelContent = useMemo165(() => /* @__PURE__ */ React412.createElement(FlowConfig3, { editor, block }), [editor, block]);
|
|
45699
45721
|
const { open } = usePanel(panelId, panelContent);
|
|
45700
45722
|
const hasLocation = block.props.latitude && block.props.longitude;
|
|
45701
|
-
return /* @__PURE__ */ React412.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React412.createElement(Stack300, { gap: "xs", justify: "center" }, /* @__PURE__ */ React412.createElement(
|
|
45723
|
+
return /* @__PURE__ */ React412.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React412.createElement(Stack300, { gap: "xs", justify: "center" }, /* @__PURE__ */ React412.createElement(Group158, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React412.createElement(IconMapPin2, { color: "currentColor", size: 26, stroke: 1.5 }), /* @__PURE__ */ React412.createElement(Stack300, { gap: 2 }, /* @__PURE__ */ React412.createElement(Text282, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Location"), block.props.description && /* @__PURE__ */ React412.createElement(Text282, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), hasLocation ? /* @__PURE__ */ React412.createElement(LocationMap, { latitude: block.props.latitude, longitude: block.props.longitude, mapId: `location-flow-map-${block.id}`, zoom: 14, showMarker: true, showTilesControl: true }) : /* @__PURE__ */ React412.createElement(Center14, { py: "md" }, /* @__PURE__ */ React412.createElement(Text282, { size: "sm", c: "dimmed" }, "Location not configured"))));
|
|
45702
45724
|
};
|
|
45703
45725
|
|
|
45704
45726
|
// src/mantine/blocks/location/LocationBlock.tsx
|
|
@@ -45739,8 +45761,8 @@ import { createReactBlockSpec as createReactBlockSpec22 } from "@blocknote/react
|
|
|
45739
45761
|
import React420 from "react";
|
|
45740
45762
|
|
|
45741
45763
|
// src/mantine/blocks/embed/template/TemplateView.tsx
|
|
45742
|
-
import React417, { useMemo as
|
|
45743
|
-
import { Box as Box72, Group as
|
|
45764
|
+
import React417, { useMemo as useMemo166 } from "react";
|
|
45765
|
+
import { Box as Box72, Group as Group159, Stack as Stack302, Text as Text284 } from "@mantine/core";
|
|
45744
45766
|
|
|
45745
45767
|
// src/mantine/blocks/embed/template/TemplateConfig.tsx
|
|
45746
45768
|
import React416, { useCallback as useCallback191 } from "react";
|
|
@@ -45868,12 +45890,12 @@ function buildImageSrcdoc(url) {
|
|
|
45868
45890
|
var EMBED_TEMPLATE_PANEL_ID = "embed-template-panel";
|
|
45869
45891
|
var EmbedTemplateView = ({ editor, block }) => {
|
|
45870
45892
|
const panelId = `${EMBED_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
45871
|
-
const panelContent =
|
|
45893
|
+
const panelContent = useMemo166(() => /* @__PURE__ */ React417.createElement(TemplateConfig18, { editor, block }), [editor, block]);
|
|
45872
45894
|
const { open } = usePanel(panelId, panelContent);
|
|
45873
45895
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
45874
45896
|
const height = Number(block.props.height) || 400;
|
|
45875
45897
|
const sandbox = block.props.allowAuth === "true" ? "allow-scripts allow-same-origin allow-forms allow-popups" : "allow-scripts allow-forms allow-popups";
|
|
45876
|
-
return /* @__PURE__ */ React417.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React417.createElement(Stack302, { gap: "xs", justify: "center" }, /* @__PURE__ */ React417.createElement(
|
|
45898
|
+
return /* @__PURE__ */ React417.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React417.createElement(Stack302, { gap: "xs", justify: "center" }, /* @__PURE__ */ React417.createElement(Group159, { wrap: "nowrap", align: "center" }, getIcon("code", block.props.icon), /* @__PURE__ */ React417.createElement(Stack302, { gap: 2 }, /* @__PURE__ */ React417.createElement(Text284, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Embed"), /* @__PURE__ */ React417.createElement(Text284, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, block.props.description || safeUrl || "Click to configure"))), safeUrl && /* @__PURE__ */ React417.createElement(Box72, { style: { borderRadius: 8, overflow: "hidden" } }, /* @__PURE__ */ React417.createElement(
|
|
45877
45899
|
"iframe",
|
|
45878
45900
|
{
|
|
45879
45901
|
...isImageUrl(safeUrl) ? { srcDoc: buildImageSrcdoc(safeUrl) } : { src: safeUrl },
|
|
@@ -45889,8 +45911,8 @@ var EmbedTemplateView = ({ editor, block }) => {
|
|
|
45889
45911
|
};
|
|
45890
45912
|
|
|
45891
45913
|
// src/mantine/blocks/embed/flow/FlowView.tsx
|
|
45892
|
-
import React419, { useMemo as
|
|
45893
|
-
import { Box as Box73, Group as
|
|
45914
|
+
import React419, { useMemo as useMemo167 } from "react";
|
|
45915
|
+
import { Box as Box73, Group as Group160, Stack as Stack303, Text as Text285 } from "@mantine/core";
|
|
45894
45916
|
|
|
45895
45917
|
// src/mantine/blocks/embed/flow/FlowConfig.tsx
|
|
45896
45918
|
import React418, { useCallback as useCallback192 } from "react";
|
|
@@ -45934,12 +45956,12 @@ var FlowConfig4 = ({ editor, block }) => {
|
|
|
45934
45956
|
var EMBED_FLOW_PANEL_ID = "embed-flow-panel";
|
|
45935
45957
|
var EmbedFlowView = ({ editor, block }) => {
|
|
45936
45958
|
const panelId = `${EMBED_FLOW_PANEL_ID}-${block.id}`;
|
|
45937
|
-
const panelContent =
|
|
45959
|
+
const panelContent = useMemo167(() => /* @__PURE__ */ React419.createElement(FlowConfig4, { editor, block }), [editor, block]);
|
|
45938
45960
|
const { open } = usePanel(panelId, panelContent);
|
|
45939
45961
|
const safeUrl = sanitizeEmbedUrl(block.props.url);
|
|
45940
45962
|
const height = Number(block.props.height) || 400;
|
|
45941
45963
|
const sandbox = block.props.allowAuth === "true" ? "allow-scripts allow-same-origin allow-forms allow-popups" : "allow-scripts allow-forms allow-popups";
|
|
45942
|
-
return /* @__PURE__ */ React419.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React419.createElement(Stack303, { gap: "xs", justify: "center" }, /* @__PURE__ */ React419.createElement(
|
|
45964
|
+
return /* @__PURE__ */ React419.createElement(BaseContainer, { blockId: block.id, onClick: open, style: { minHeight: 90, justifyContent: "center" } }, /* @__PURE__ */ React419.createElement(Stack303, { gap: "xs", justify: "center" }, /* @__PURE__ */ React419.createElement(Group160, { wrap: "nowrap", align: "center" }, getIcon("code", block.props.icon), /* @__PURE__ */ React419.createElement(Stack303, { gap: 2 }, /* @__PURE__ */ React419.createElement(Text285, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Embed"), /* @__PURE__ */ React419.createElement(Text285, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, block.props.description || safeUrl || "No URL configured"))), safeUrl && /* @__PURE__ */ React419.createElement(Box73, { style: { borderRadius: 8, overflow: "hidden" } }, /* @__PURE__ */ React419.createElement(
|
|
45943
45965
|
"iframe",
|
|
45944
45966
|
{
|
|
45945
45967
|
...isImageUrl(safeUrl) ? { srcDoc: buildImageSrcdoc(safeUrl) } : { src: safeUrl },
|
|
@@ -45991,8 +46013,8 @@ import React423 from "react";
|
|
|
45991
46013
|
import { createReactBlockSpec as createReactBlockSpec23 } from "@blocknote/react";
|
|
45992
46014
|
|
|
45993
46015
|
// src/mantine/blocks/secrets/SecretsBlock.tsx
|
|
45994
|
-
import React422, { useCallback as useCallback193, useMemo as
|
|
45995
|
-
import { Anchor as Anchor6, ActionIcon as ActionIcon52, Button as Button103, Collapse as Collapse15, CopyButton as CopyButton3, Group as
|
|
46016
|
+
import React422, { useCallback as useCallback193, useMemo as useMemo168, useState as useState241 } from "react";
|
|
46017
|
+
import { Anchor as Anchor6, ActionIcon as ActionIcon52, Button as Button103, Collapse as Collapse15, CopyButton as CopyButton3, Group as Group161, Paper as Paper25, Stack as Stack304, Text as Text286, Tooltip as Tooltip36 } from "@mantine/core";
|
|
45996
46018
|
import { IconCheck as IconCheck51, IconCopy as IconCopy3, IconDownload as IconDownload5, IconEye, IconEyeOff, IconKey as IconKey5 } from "@tabler/icons-react";
|
|
45997
46019
|
var SENSITIVE_KEYS = /* @__PURE__ */ new Set(["mnemonic", "matrixPassword", "matrixRecoveryPhrase", "matrixAccessToken", "pin", "openRouterApiKeyJwe", "authToken"]);
|
|
45998
46020
|
var BLOCK_LABELS = {
|
|
@@ -46094,20 +46116,20 @@ function MaskedValue({ value, isSensitive }) {
|
|
|
46094
46116
|
if (!isSensitive) {
|
|
46095
46117
|
return /* @__PURE__ */ React422.createElement(Text286, { size: "xs", ff: "monospace", style: { wordBreak: "break-all" } }, String(value));
|
|
46096
46118
|
}
|
|
46097
|
-
return /* @__PURE__ */ React422.createElement(
|
|
46119
|
+
return /* @__PURE__ */ React422.createElement(Group161, { gap: 4, align: "center", wrap: "nowrap" }, /* @__PURE__ */ React422.createElement(Text286, { size: "xs", ff: "monospace", style: { wordBreak: "break-all" } }, visible ? String(value) : "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"), /* @__PURE__ */ React422.createElement(ActionIcon52, { variant: "subtle", size: "xs", onClick: () => setVisible((v) => !v) }, visible ? /* @__PURE__ */ React422.createElement(IconEyeOff, { size: 12 }) : /* @__PURE__ */ React422.createElement(IconEye, { size: 12 })));
|
|
46098
46120
|
}
|
|
46099
46121
|
function OutputEntry({ label, value, isSensitive }) {
|
|
46100
46122
|
const displayValue = typeof value === "object" ? JSON.stringify(value, null, 2) : String(value ?? "");
|
|
46101
46123
|
const desc = FIELD_DESCRIPTIONS[label];
|
|
46102
|
-
return /* @__PURE__ */ React422.createElement(Stack304, { gap: 0 }, /* @__PURE__ */ React422.createElement(
|
|
46124
|
+
return /* @__PURE__ */ React422.createElement(Stack304, { gap: 0 }, /* @__PURE__ */ React422.createElement(Group161, { gap: "xs", align: "flex-start", wrap: "nowrap", style: { minHeight: 24 } }, /* @__PURE__ */ React422.createElement(Text286, { size: "xs", c: "dimmed", style: { minWidth: 140, flexShrink: 0 } }, label), /* @__PURE__ */ React422.createElement(MaskedValue, { value: displayValue, isSensitive })), desc && /* @__PURE__ */ React422.createElement(Text286, { size: "xs", c: "dimmed", fs: "italic", pl: 140 }, desc));
|
|
46103
46125
|
}
|
|
46104
46126
|
function SecretsBlock({ editor, block }) {
|
|
46105
46127
|
const { docType } = useBlocknoteContext();
|
|
46106
46128
|
const [showOutput, setShowOutput] = useState241(false);
|
|
46107
|
-
const outputs =
|
|
46129
|
+
const outputs = useMemo168(() => collectOutputs(editor), [editor, showOutput]);
|
|
46108
46130
|
const editorDocument = editor?.document || [];
|
|
46109
|
-
const resolveOpts =
|
|
46110
|
-
const entityDid =
|
|
46131
|
+
const resolveOpts = useMemo168(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
46132
|
+
const entityDid = useMemo168(() => resolveReferences(block.props.entityDid || "", editorDocument, resolveOpts).trim(), [block.props.entityDid, editorDocument, resolveOpts]);
|
|
46111
46133
|
const portalUrl = typeof window !== "undefined" ? window.location.origin : "";
|
|
46112
46134
|
const connectUrl = entityDid ? `${portalUrl}/oracle/${entityDid}/connect` : "";
|
|
46113
46135
|
const handleDownload = useCallback193(() => {
|
|
@@ -46122,9 +46144,9 @@ function SecretsBlock({ editor, block }) {
|
|
|
46122
46144
|
URL.revokeObjectURL(url);
|
|
46123
46145
|
}, [outputs]);
|
|
46124
46146
|
if (docType === "template") {
|
|
46125
|
-
return /* @__PURE__ */ React422.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React422.createElement(Stack304, { gap: "xs" }, /* @__PURE__ */ React422.createElement(
|
|
46147
|
+
return /* @__PURE__ */ React422.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React422.createElement(Stack304, { gap: "xs" }, /* @__PURE__ */ React422.createElement(Group161, { gap: "xs", align: "center" }, /* @__PURE__ */ React422.createElement(IconKey5, { size: 18 }), /* @__PURE__ */ React422.createElement(Text286, { fw: 600, size: "sm" }, block.props.title || "Flow Output")), /* @__PURE__ */ React422.createElement(Text286, { size: "xs", c: "dimmed" }, "Displays all flow outputs and allows downloading them in flow mode.")));
|
|
46126
46148
|
}
|
|
46127
|
-
return /* @__PURE__ */ React422.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React422.createElement(Stack304, { gap: "md" }, /* @__PURE__ */ React422.createElement(
|
|
46149
|
+
return /* @__PURE__ */ React422.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React422.createElement(Stack304, { gap: "md" }, /* @__PURE__ */ React422.createElement(Group161, { gap: "xs", align: "center" }, /* @__PURE__ */ React422.createElement(IconKey5, { size: 18 }), /* @__PURE__ */ React422.createElement(Text286, { fw: 600, size: "sm" }, block.props.title || "Flow Output")), /* @__PURE__ */ React422.createElement(Text286, { size: "sm", c: "dimmed" }, "Everything produced by this flow. You can view it here or download as JSON."), connectUrl && /* @__PURE__ */ React422.createElement(Stack304, { gap: "xs" }, /* @__PURE__ */ React422.createElement(Text286, { size: "sm", fw: 500 }, "Oracle Connect Link"), /* @__PURE__ */ React422.createElement(Group161, { gap: "xs", align: "center" }, /* @__PURE__ */ React422.createElement(Anchor6, { href: connectUrl, target: "_blank", size: "sm", style: { wordBreak: "break-all" } }, connectUrl), /* @__PURE__ */ React422.createElement(CopyButton3, { value: connectUrl, timeout: 2e3 }, ({ copied, copy }) => /* @__PURE__ */ React422.createElement(Tooltip36, { label: copied ? "Copied" : "Copy link", withArrow: true, position: "right" }, /* @__PURE__ */ React422.createElement(ActionIcon52, { color: copied ? "teal" : "gray", variant: "subtle", onClick: copy, size: "sm" }, copied ? /* @__PURE__ */ React422.createElement(IconCheck51, { size: 14 }) : /* @__PURE__ */ React422.createElement(IconCopy3, { size: 14 })))))), /* @__PURE__ */ React422.createElement(Group161, { gap: "xs" }, /* @__PURE__ */ React422.createElement(Button103, { variant: "light", size: "xs", leftSection: /* @__PURE__ */ React422.createElement(IconEye, { size: 14 }), onClick: () => setShowOutput((v) => !v) }, showOutput ? "Hide Output" : "View Output"), /* @__PURE__ */ React422.createElement(Button103, { variant: "filled", size: "sm", leftSection: /* @__PURE__ */ React422.createElement(IconDownload5, { size: 14 }), onClick: handleDownload, disabled: outputs.length === 0 }, "Download JSON")), /* @__PURE__ */ React422.createElement(Collapse15, { in: showOutput }, /* @__PURE__ */ React422.createElement(Stack304, { gap: "sm" }, outputs.length === 0 && /* @__PURE__ */ React422.createElement(Text286, { size: "xs", c: "dimmed", fs: "italic" }, "No outputs yet."), outputs.map(({ id, label, output }) => /* @__PURE__ */ React422.createElement(Paper25, { key: id, p: "xs", withBorder: true, style: { borderColor: "var(--mantine-color-neutralColor-6)" } }, /* @__PURE__ */ React422.createElement(Stack304, { gap: 4 }, /* @__PURE__ */ React422.createElement(Text286, { size: "xs", fw: 600 }, label), Object.entries(output).map(([key, value]) => /* @__PURE__ */ React422.createElement(OutputEntry, { key, label: key, value, isSensitive: SENSITIVE_KEYS.has(key) })))))))));
|
|
46128
46150
|
}
|
|
46129
46151
|
|
|
46130
46152
|
// src/mantine/blocks/secrets/SecretsBlockSpec.tsx
|
|
@@ -46168,10 +46190,10 @@ import { createReactBlockSpec as createReactBlockSpec24 } from "@blocknote/react
|
|
|
46168
46190
|
import React428 from "react";
|
|
46169
46191
|
|
|
46170
46192
|
// src/mantine/blocks/skills/template/SkillsTemplateView.tsx
|
|
46171
|
-
import React426, { useMemo as
|
|
46172
|
-
import { Badge as Badge61, Group as
|
|
46193
|
+
import React426, { useMemo as useMemo169 } from "react";
|
|
46194
|
+
import { Badge as Badge61, Group as Group162, Stack as Stack305, Text as Text287 } from "@mantine/core";
|
|
46173
46195
|
var SkillsTemplateView = ({ editor: _editor, block }) => {
|
|
46174
|
-
const skillCount =
|
|
46196
|
+
const skillCount = useMemo169(() => {
|
|
46175
46197
|
try {
|
|
46176
46198
|
const parsed = JSON.parse(block.props.skills || "[]");
|
|
46177
46199
|
return Array.isArray(parsed) ? parsed.length : 0;
|
|
@@ -46179,7 +46201,7 @@ var SkillsTemplateView = ({ editor: _editor, block }) => {
|
|
|
46179
46201
|
return 0;
|
|
46180
46202
|
}
|
|
46181
46203
|
}, [block.props.skills]);
|
|
46182
|
-
const serverCount =
|
|
46204
|
+
const serverCount = useMemo169(() => {
|
|
46183
46205
|
try {
|
|
46184
46206
|
const parsed = JSON.parse(block.props.mcpServers || "[]");
|
|
46185
46207
|
return Array.isArray(parsed) ? parsed.length : 0;
|
|
@@ -46187,13 +46209,13 @@ var SkillsTemplateView = ({ editor: _editor, block }) => {
|
|
|
46187
46209
|
return 0;
|
|
46188
46210
|
}
|
|
46189
46211
|
}, [block.props.mcpServers]);
|
|
46190
|
-
return /* @__PURE__ */ React426.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React426.createElement(Badge61, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React426.createElement(
|
|
46212
|
+
return /* @__PURE__ */ React426.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React426.createElement(Badge61, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React426.createElement(Group162, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React426.createElement(Group162, { wrap: "nowrap", align: "center" }, getIcon("tools", block.props.icon), /* @__PURE__ */ React426.createElement(Stack305, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React426.createElement(Text287, { fw: 500, size: "sm" }, block.props.title || "Skills"), /* @__PURE__ */ React426.createElement(Text287, { size: "xs", c: "dimmed" }, skillCount > 0 || serverCount > 0 ? `${skillCount} skill(s), ${serverCount} MCP server(s) configured` : "Skills and MCP servers will be configured by the agent")))));
|
|
46191
46213
|
};
|
|
46192
46214
|
|
|
46193
46215
|
// src/mantine/blocks/skills/flow/SkillsFlowView.tsx
|
|
46194
|
-
import { ActionIcon as ActionIcon53, Badge as Badge62, Button as Button104, Collapse as Collapse16, Group as
|
|
46216
|
+
import { ActionIcon as ActionIcon53, Badge as Badge62, Button as Button104, Collapse as Collapse16, Group as Group163, Loader as Loader100, Paper as Paper26, Stack as Stack306, Text as Text288, Tooltip as Tooltip37 } from "@mantine/core";
|
|
46195
46217
|
import { IconBrain as IconBrain3, IconCheck as IconCheck52, IconPencil as IconPencil3, IconPlus as IconPlus11, IconTrash as IconTrash13, IconX as IconX21 } from "@tabler/icons-react";
|
|
46196
|
-
import React427, { useCallback as useCallback194, useEffect as useEffect179, useMemo as
|
|
46218
|
+
import React427, { useCallback as useCallback194, useEffect as useEffect179, useMemo as useMemo170, useRef as useRef58, useState as useState242 } from "react";
|
|
46197
46219
|
function parseSkills2(raw) {
|
|
46198
46220
|
try {
|
|
46199
46221
|
const parsed = JSON.parse(raw || "[]");
|
|
@@ -46214,8 +46236,8 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46214
46236
|
const handlers = useBlocknoteHandlers();
|
|
46215
46237
|
const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
|
|
46216
46238
|
const isCompleted = runtime.state === "completed" && runtime.evaluationStatus === "approved";
|
|
46217
|
-
const skills =
|
|
46218
|
-
const mcpServers =
|
|
46239
|
+
const skills = useMemo170(() => parseSkills2(block.props.skills), [block.props.skills]);
|
|
46240
|
+
const mcpServers = useMemo170(() => parseMcpServers(block.props.mcpServers), [block.props.mcpServers]);
|
|
46219
46241
|
const [showAddMcp, setShowAddMcp] = useState242(false);
|
|
46220
46242
|
const [mcpName, setMcpName] = useState242("");
|
|
46221
46243
|
const [mcpUrl, setMcpUrl] = useState242("");
|
|
@@ -46239,7 +46261,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46239
46261
|
networkFetchedRef.current = true;
|
|
46240
46262
|
handlers.getNetwork().then(setNetwork).catch(() => setNetwork("mainnet"));
|
|
46241
46263
|
}, [handlers.getNetwork]);
|
|
46242
|
-
const mcpPresets =
|
|
46264
|
+
const mcpPresets = useMemo170(() => {
|
|
46243
46265
|
const net = network || "mainnet";
|
|
46244
46266
|
const subdomain = net === "mainnet" ? "" : `.${net}`;
|
|
46245
46267
|
return [
|
|
@@ -46274,8 +46296,8 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46274
46296
|
},
|
|
46275
46297
|
[editor, getCurrentBlock]
|
|
46276
46298
|
);
|
|
46277
|
-
const selectedSkillCids =
|
|
46278
|
-
const capsuleSelectData =
|
|
46299
|
+
const selectedSkillCids = useMemo170(() => skills.map((s) => s.cid), [skills]);
|
|
46300
|
+
const capsuleSelectData = useMemo170(
|
|
46279
46301
|
() => capsules.map((c) => ({
|
|
46280
46302
|
value: c.cid,
|
|
46281
46303
|
label: c.name
|
|
@@ -46378,7 +46400,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46378
46400
|
setSavingMcp(false);
|
|
46379
46401
|
resetMcpForm();
|
|
46380
46402
|
}, [mcpName, mcpUrl, mcpDescription, editingMcpIndex, mcpServers, updateMcpServers, resetMcpForm, handleValidateMcp]);
|
|
46381
|
-
return /* @__PURE__ */ React427.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React427.createElement(Stack306, { gap: "md" }, /* @__PURE__ */ React427.createElement(
|
|
46403
|
+
return /* @__PURE__ */ React427.createElement(BaseContainer, { blockId: block.id }, /* @__PURE__ */ React427.createElement(Stack306, { gap: "md" }, /* @__PURE__ */ React427.createElement(Group163, { justify: "space-between", align: "center" }, /* @__PURE__ */ React427.createElement(Group163, { gap: "xs", align: "center" }, /* @__PURE__ */ React427.createElement(IconBrain3, { size: 20 }), /* @__PURE__ */ React427.createElement(Text288, { fw: 600, size: "sm" }, block.props.title || "Skills & MCP Servers")), isCompleted && /* @__PURE__ */ React427.createElement(Badge62, { color: "green", variant: "light", size: "sm" }, "Configured")), block.props.description && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed" }, block.props.description), /* @__PURE__ */ React427.createElement(Stack306, { gap: "xs" }, /* @__PURE__ */ React427.createElement(Text288, { size: "xs", fw: 500 }, "Skills"), loadingCapsules ? /* @__PURE__ */ React427.createElement(Group163, { gap: "xs" }, /* @__PURE__ */ React427.createElement(Loader100, { size: "xs" }), /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed" }, "Loading skills...")) : !isCompleted ? /* @__PURE__ */ React427.createElement(
|
|
46382
46404
|
BaseMultiSelect,
|
|
46383
46405
|
{
|
|
46384
46406
|
placeholder: "Search and select skills...",
|
|
@@ -46405,7 +46427,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46405
46427
|
option: { padding: "8px 12px" }
|
|
46406
46428
|
}
|
|
46407
46429
|
}
|
|
46408
|
-
) : null, skills.map((skill) => /* @__PURE__ */ React427.createElement(Paper26, { key: skill.cid, p: "xs", withBorder: true, style: { borderColor: "var(--mantine-color-neutralColor-6)" } }, /* @__PURE__ */ React427.createElement(
|
|
46430
|
+
) : null, skills.map((skill) => /* @__PURE__ */ React427.createElement(Paper26, { key: skill.cid, p: "xs", withBorder: true, style: { borderColor: "var(--mantine-color-neutralColor-6)" } }, /* @__PURE__ */ React427.createElement(Group163, { justify: "space-between", wrap: "nowrap" }, /* @__PURE__ */ React427.createElement(Stack306, { gap: 2, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React427.createElement(Group163, { gap: "xs", align: "center" }, /* @__PURE__ */ React427.createElement(Text288, { size: "xs", fw: 500 }, skill.name), /* @__PURE__ */ React427.createElement(Badge62, { size: "xs", variant: "light", color: "blue" }, "CID")), skill.description && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed", lineClamp: 2 }, skill.description), /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed", ff: "monospace", lineClamp: 1 }, skill.cid)), !isCompleted && /* @__PURE__ */ React427.createElement(ActionIcon53, { variant: "subtle", color: "red", size: "sm", onClick: () => updateSkills(skills.filter((s) => s.cid !== skill.cid)) }, /* @__PURE__ */ React427.createElement(IconX21, { size: 14 }))))), skills.length === 0 && !loadingCapsules && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed", fs: "italic" }, "No skills selected yet.")), /* @__PURE__ */ React427.createElement(Stack306, { gap: "xs" }, /* @__PURE__ */ React427.createElement(Group163, { justify: "space-between", align: "center" }, /* @__PURE__ */ React427.createElement(Text288, { size: "xs", fw: 500 }, "MCP Servers")), !isCompleted && mcpPresets.length > 0 && /* @__PURE__ */ React427.createElement(
|
|
46409
46431
|
BaseSelect,
|
|
46410
46432
|
{
|
|
46411
46433
|
placeholder: "Add from presets...",
|
|
@@ -46424,7 +46446,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46424
46446
|
), mcpServers.map((server, i) => {
|
|
46425
46447
|
const validation = validationResults[server.url];
|
|
46426
46448
|
const isValidating = validatingUrls[server.url];
|
|
46427
|
-
return /* @__PURE__ */ React427.createElement(Paper26, { key: i, p: "xs", withBorder: true, style: { borderColor: "var(--mantine-color-neutralColor-6)" } }, /* @__PURE__ */ React427.createElement(
|
|
46449
|
+
return /* @__PURE__ */ React427.createElement(Paper26, { key: i, p: "xs", withBorder: true, style: { borderColor: "var(--mantine-color-neutralColor-6)" } }, /* @__PURE__ */ React427.createElement(Group163, { justify: "space-between", wrap: "nowrap" }, /* @__PURE__ */ React427.createElement(Stack306, { gap: 2, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React427.createElement(Group163, { gap: "xs", align: "center" }, /* @__PURE__ */ React427.createElement(Text288, { size: "xs", fw: 500 }, server.name), validation && validation.success && /* @__PURE__ */ React427.createElement(Badge62, { size: "xs", variant: "light", color: "green", leftSection: /* @__PURE__ */ React427.createElement(IconCheck52, { size: 10 }) }, validation.toolCount, " tools")), server.description && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed", lineClamp: 1 }, server.description), /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "dimmed", ff: "monospace", lineClamp: 1 }, server.url), validation && !validation.success && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "red" }, validation.error)), !isCompleted && /* @__PURE__ */ React427.createElement(Group163, { gap: 4 }, !server.isPreset && /* @__PURE__ */ React427.createElement(Tooltip37, { label: "Test connection" }, /* @__PURE__ */ React427.createElement(Button104, { variant: "subtle", size: "compact-xs", onClick: () => handleValidateMcp(server.url), disabled: isValidating }, isValidating ? /* @__PURE__ */ React427.createElement(Loader100, { size: 12 }) : "Test")), /* @__PURE__ */ React427.createElement(
|
|
46428
46450
|
ActionIcon53,
|
|
46429
46451
|
{
|
|
46430
46452
|
variant: "subtle",
|
|
@@ -46448,7 +46470,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
46448
46470
|
value: mcpDescription,
|
|
46449
46471
|
onChange: (e) => setMcpDescription(e.currentTarget.value)
|
|
46450
46472
|
}
|
|
46451
|
-
), mcpSaveError && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "red" }, mcpSaveError), /* @__PURE__ */ React427.createElement(
|
|
46473
|
+
), mcpSaveError && /* @__PURE__ */ React427.createElement(Text288, { size: "xs", c: "red" }, mcpSaveError), /* @__PURE__ */ React427.createElement(Group163, { gap: "xs", justify: "flex-end" }, /* @__PURE__ */ React427.createElement(
|
|
46452
46474
|
Button104,
|
|
46453
46475
|
{
|
|
46454
46476
|
size: "xs",
|
|
@@ -46770,10 +46792,10 @@ blockRegistry.register({
|
|
|
46770
46792
|
});
|
|
46771
46793
|
|
|
46772
46794
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
46773
|
-
import { useMemo as
|
|
46795
|
+
import { useMemo as useMemo171, useEffect as useEffect180, useState as useState243, useCallback as useCallback195 } from "react";
|
|
46774
46796
|
|
|
46775
46797
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
46776
|
-
import { useMemo as
|
|
46798
|
+
import { useMemo as useMemo172 } from "react";
|
|
46777
46799
|
|
|
46778
46800
|
// src/mantine/blocks/index.ts
|
|
46779
46801
|
var blockSpecs = {
|
|
@@ -47554,7 +47576,7 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
47554
47576
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2 } from "@blocknote/core";
|
|
47555
47577
|
|
|
47556
47578
|
// src/core/hooks/useMatrixProvider.ts
|
|
47557
|
-
import { useEffect as useEffect182, useState as useState245, useRef as useRef59, useCallback as useCallback196, useMemo as
|
|
47579
|
+
import { useEffect as useEffect182, useState as useState245, useRef as useRef59, useCallback as useCallback196, useMemo as useMemo173 } from "react";
|
|
47558
47580
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
47559
47581
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
47560
47582
|
const [matrixProvider, setProvider] = useState245(null);
|
|
@@ -47562,7 +47584,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
47562
47584
|
const isMountedRef = useRef59(true);
|
|
47563
47585
|
const providerRef = useRef59(null);
|
|
47564
47586
|
const retryTimeoutRef = useRef59(null);
|
|
47565
|
-
const providerOptions =
|
|
47587
|
+
const providerOptions = useMemo173(
|
|
47566
47588
|
() => ({
|
|
47567
47589
|
translator: {
|
|
47568
47590
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -47649,17 +47671,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
47649
47671
|
}
|
|
47650
47672
|
|
|
47651
47673
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
47652
|
-
import { useMemo as
|
|
47674
|
+
import { useMemo as useMemo174 } from "react";
|
|
47653
47675
|
import * as Y from "yjs";
|
|
47654
47676
|
function useCollaborativeYDoc(_options) {
|
|
47655
|
-
return
|
|
47677
|
+
return useMemo174(() => {
|
|
47656
47678
|
const doc = new Y.Doc();
|
|
47657
47679
|
return doc;
|
|
47658
47680
|
}, []);
|
|
47659
47681
|
}
|
|
47660
47682
|
|
|
47661
47683
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
47662
|
-
import { useMemo as
|
|
47684
|
+
import { useMemo as useMemo175, useEffect as useEffect184, useState as useState246, useRef as useRef61 } from "react";
|
|
47663
47685
|
|
|
47664
47686
|
// src/core/lib/matrixMetadata.ts
|
|
47665
47687
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -48240,7 +48262,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48240
48262
|
matrixClient,
|
|
48241
48263
|
permissions = { write: false }
|
|
48242
48264
|
} = options || {};
|
|
48243
|
-
const memoizedUser =
|
|
48265
|
+
const memoizedUser = useMemo175(
|
|
48244
48266
|
() => ({
|
|
48245
48267
|
id: user?.id || "",
|
|
48246
48268
|
name: user?.name || "",
|
|
@@ -48259,13 +48281,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48259
48281
|
matrixClient,
|
|
48260
48282
|
roomId: options.roomId
|
|
48261
48283
|
});
|
|
48262
|
-
const metadataManager =
|
|
48284
|
+
const metadataManager = useMemo175(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
48263
48285
|
useEffect184(() => {
|
|
48264
48286
|
return () => {
|
|
48265
48287
|
metadataManager.dispose();
|
|
48266
48288
|
};
|
|
48267
48289
|
}, [metadataManager]);
|
|
48268
|
-
const defaultUploadFile =
|
|
48290
|
+
const defaultUploadFile = useMemo175(
|
|
48269
48291
|
() => uploadFile || (async (file) => {
|
|
48270
48292
|
return new Promise((resolve, reject) => {
|
|
48271
48293
|
const reader = new FileReader();
|
|
@@ -48278,7 +48300,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48278
48300
|
}),
|
|
48279
48301
|
[uploadFile]
|
|
48280
48302
|
);
|
|
48281
|
-
const schema =
|
|
48303
|
+
const schema = useMemo175(
|
|
48282
48304
|
() => BlockNoteSchema2.create({
|
|
48283
48305
|
blockSpecs: {
|
|
48284
48306
|
...defaultBlockSpecs2,
|
|
@@ -48292,20 +48314,20 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48292
48314
|
}),
|
|
48293
48315
|
[]
|
|
48294
48316
|
);
|
|
48295
|
-
const root =
|
|
48296
|
-
const documentFragment =
|
|
48297
|
-
const flowArray =
|
|
48298
|
-
const runtimeMap =
|
|
48299
|
-
const nodeContextMap =
|
|
48300
|
-
const nodeContextOverridesMap =
|
|
48301
|
-
const delegationsMap =
|
|
48302
|
-
const invocationsMap =
|
|
48303
|
-
const migrationMap =
|
|
48304
|
-
const agentOutboxMap =
|
|
48305
|
-
const agentLeasesMap =
|
|
48306
|
-
const xeroWorkItemsMap =
|
|
48307
|
-
const xeroConnectionMap =
|
|
48308
|
-
const ucanDelegationStore =
|
|
48317
|
+
const root = useMemo175(() => yDoc.getMap("root"), [yDoc]);
|
|
48318
|
+
const documentFragment = useMemo175(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
48319
|
+
const flowArray = useMemo175(() => yDoc.getArray("flow"), [yDoc]);
|
|
48320
|
+
const runtimeMap = useMemo175(() => yDoc.getMap("runtime"), [yDoc]);
|
|
48321
|
+
const nodeContextMap = useMemo175(() => yDoc.getMap("nodeContext"), [yDoc]);
|
|
48322
|
+
const nodeContextOverridesMap = useMemo175(() => yDoc.getMap("nodeContextOverrides"), [yDoc]);
|
|
48323
|
+
const delegationsMap = useMemo175(() => yDoc.getMap("delegations"), [yDoc]);
|
|
48324
|
+
const invocationsMap = useMemo175(() => yDoc.getMap("invocations"), [yDoc]);
|
|
48325
|
+
const migrationMap = useMemo175(() => yDoc.getMap("migration"), [yDoc]);
|
|
48326
|
+
const agentOutboxMap = useMemo175(() => yDoc.getMap("agentOutbox"), [yDoc]);
|
|
48327
|
+
const agentLeasesMap = useMemo175(() => yDoc.getMap("agentLeases"), [yDoc]);
|
|
48328
|
+
const xeroWorkItemsMap = useMemo175(() => yDoc.getMap("xeroWorkItems"), [yDoc]);
|
|
48329
|
+
const xeroConnectionMap = useMemo175(() => yDoc.getMap("xeroConnection"), [yDoc]);
|
|
48330
|
+
const ucanDelegationStore = useMemo175(() => {
|
|
48309
48331
|
const store = createUcanDelegationStore(delegationsMap);
|
|
48310
48332
|
const originalSet = store.set;
|
|
48311
48333
|
store.set = (delegation) => {
|
|
@@ -48314,7 +48336,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48314
48336
|
};
|
|
48315
48337
|
return store;
|
|
48316
48338
|
}, [delegationsMap, matrixClient, options.roomId]);
|
|
48317
|
-
const invocationStore =
|
|
48339
|
+
const invocationStore = useMemo175(() => {
|
|
48318
48340
|
const store = createInvocationStore(invocationsMap);
|
|
48319
48341
|
const originalAdd = store.add;
|
|
48320
48342
|
store.add = (invocation) => {
|
|
@@ -48323,8 +48345,8 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48323
48345
|
};
|
|
48324
48346
|
return store;
|
|
48325
48347
|
}, [invocationsMap, matrixClient, options.roomId]);
|
|
48326
|
-
const userFragment =
|
|
48327
|
-
const collaborationConfig =
|
|
48348
|
+
const userFragment = useMemo175(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
48349
|
+
const collaborationConfig = useMemo175(
|
|
48328
48350
|
() => ({
|
|
48329
48351
|
provider: matrixProvider,
|
|
48330
48352
|
fragment: documentFragment,
|
|
@@ -48336,7 +48358,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48336
48358
|
}),
|
|
48337
48359
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
48338
48360
|
);
|
|
48339
|
-
const ixoConfig =
|
|
48361
|
+
const ixoConfig = useMemo175(
|
|
48340
48362
|
() => ({
|
|
48341
48363
|
theme,
|
|
48342
48364
|
editable,
|
|
@@ -48363,7 +48385,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48363
48385
|
},
|
|
48364
48386
|
[providerReady]
|
|
48365
48387
|
);
|
|
48366
|
-
const titleText =
|
|
48388
|
+
const titleText = useMemo175(() => yDoc.getText("title"), [yDoc]);
|
|
48367
48389
|
let ixoEditor;
|
|
48368
48390
|
if (editor) {
|
|
48369
48391
|
ixoEditor = editor;
|
|
@@ -48668,14 +48690,14 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
48668
48690
|
}
|
|
48669
48691
|
|
|
48670
48692
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
48671
|
-
import React432, { useState as useState248, useMemo as
|
|
48672
|
-
import { TextInput as TextInput11, Tabs as Tabs4, Box as Box74, Stack as Stack307, UnstyledButton as UnstyledButton7, Text as Text290, Center as Center15, ScrollArea as ScrollArea10, Group as
|
|
48693
|
+
import React432, { useState as useState248, useMemo as useMemo176, useEffect as useEffect185 } from "react";
|
|
48694
|
+
import { TextInput as TextInput11, Tabs as Tabs4, Box as Box74, Stack as Stack307, UnstyledButton as UnstyledButton7, Text as Text290, Center as Center15, ScrollArea as ScrollArea10, Group as Group165, Popover as Popover5 } from "@mantine/core";
|
|
48673
48695
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
48674
48696
|
import { IconSearch as IconSearch11, IconX as IconX22, IconChevronLeft, IconChevronRight as IconChevronRight14 } from "@tabler/icons-react";
|
|
48675
48697
|
|
|
48676
48698
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
48677
48699
|
import React431, { forwardRef, useState as useState247 } from "react";
|
|
48678
|
-
import { UnstyledButton as UnstyledButton6, Group as
|
|
48700
|
+
import { UnstyledButton as UnstyledButton6, Group as Group164, Text as Text289 } from "@mantine/core";
|
|
48679
48701
|
var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false, onClick, icon: icon2, children, style }, ref) {
|
|
48680
48702
|
const [hovered, setHovered] = useState247(false);
|
|
48681
48703
|
return /* @__PURE__ */ React431.createElement(
|
|
@@ -48694,7 +48716,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
48694
48716
|
...style
|
|
48695
48717
|
}
|
|
48696
48718
|
},
|
|
48697
|
-
/* @__PURE__ */ React431.createElement(
|
|
48719
|
+
/* @__PURE__ */ React431.createElement(Group164, { gap: 4, wrap: "nowrap" }, icon2 && /* @__PURE__ */ React431.createElement(
|
|
48698
48720
|
"span",
|
|
48699
48721
|
{
|
|
48700
48722
|
style: {
|
|
@@ -48749,11 +48771,11 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
48749
48771
|
const [searchQuery, setSearchQuery] = useState248("");
|
|
48750
48772
|
const [activeTab, setActiveTab] = useState248("icons");
|
|
48751
48773
|
const [currentPage, setCurrentPage] = useState248(1);
|
|
48752
|
-
const allIcons =
|
|
48774
|
+
const allIcons = useMemo176(() => {
|
|
48753
48775
|
const iconEntries = Object.entries(TablerIcons2).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
48754
48776
|
return iconEntries;
|
|
48755
48777
|
}, []);
|
|
48756
|
-
const filteredIcons =
|
|
48778
|
+
const filteredIcons = useMemo176(() => {
|
|
48757
48779
|
if (!searchQuery) return allIcons;
|
|
48758
48780
|
const query = searchQuery.toLowerCase();
|
|
48759
48781
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
@@ -48761,13 +48783,13 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
48761
48783
|
useEffect185(() => {
|
|
48762
48784
|
setCurrentPage(1);
|
|
48763
48785
|
}, [searchQuery]);
|
|
48764
|
-
const paginatedIcons =
|
|
48786
|
+
const paginatedIcons = useMemo176(() => {
|
|
48765
48787
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
48766
48788
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
48767
48789
|
return filteredIcons.slice(startIndex, endIndex);
|
|
48768
48790
|
}, [filteredIcons, currentPage]);
|
|
48769
48791
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
48770
|
-
const recentIcons =
|
|
48792
|
+
const recentIcons = useMemo176(() => {
|
|
48771
48793
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
48772
48794
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
48773
48795
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -48854,7 +48876,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
48854
48876
|
transition: "background 0.15s ease"
|
|
48855
48877
|
}
|
|
48856
48878
|
},
|
|
48857
|
-
/* @__PURE__ */ React432.createElement(
|
|
48879
|
+
/* @__PURE__ */ React432.createElement(Group165, { gap: 4, wrap: "nowrap" }, /* @__PURE__ */ React432.createElement(IconX22, { size: 14 }), /* @__PURE__ */ React432.createElement(Text290, { fz: 12, c: "dimmed", style: { whiteSpace: "nowrap" } }, "Remove"))
|
|
48858
48880
|
),
|
|
48859
48881
|
/* @__PURE__ */ React432.createElement(Stack307, { gap: "md", p: "md" }, /* @__PURE__ */ React432.createElement(Tabs4, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React432.createElement(Tabs4.List, null, /* @__PURE__ */ React432.createElement(Tabs4.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React432.createElement(Tabs4.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React432.createElement(Tabs4.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React432.createElement(
|
|
48860
48882
|
TextInput11,
|
|
@@ -48874,7 +48896,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
48874
48896
|
}
|
|
48875
48897
|
}
|
|
48876
48898
|
}
|
|
48877
|
-
), !searchQuery && /* @__PURE__ */ React432.createElement(Box74, { mb: "md" }, /* @__PURE__ */ React432.createElement(Text290, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React432.createElement(ScrollArea10.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React432.createElement(Box74, null, /* @__PURE__ */ React432.createElement(
|
|
48899
|
+
), !searchQuery && /* @__PURE__ */ React432.createElement(Box74, { mb: "md" }, /* @__PURE__ */ React432.createElement(Text290, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React432.createElement(ScrollArea10.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React432.createElement(Box74, null, /* @__PURE__ */ React432.createElement(Group165, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React432.createElement(Text290, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React432.createElement(Group165, { gap: "xs" }, /* @__PURE__ */ React432.createElement(Text290, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React432.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React432.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React432.createElement(
|
|
48878
48900
|
BaseButton,
|
|
48879
48901
|
{
|
|
48880
48902
|
size: "xs",
|
|
@@ -48888,8 +48910,8 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
48888
48910
|
}
|
|
48889
48911
|
|
|
48890
48912
|
// src/mantine/components/CoverImage.tsx
|
|
48891
|
-
import React435, { useState as useState250, useRef as useRef62, useEffect as useEffect187, useMemo as
|
|
48892
|
-
import { Box as Box77, Group as
|
|
48913
|
+
import React435, { useState as useState250, useRef as useRef62, useEffect as useEffect187, useMemo as useMemo178 } from "react";
|
|
48914
|
+
import { Box as Box77, Group as Group167 } from "@mantine/core";
|
|
48893
48915
|
import { IconMoodSmile, IconPhoto as IconPhoto6, IconSettings as IconSettings24, IconArrowsMove, IconTrash as IconTrash15, IconRefresh as IconRefresh16 } from "@tabler/icons-react";
|
|
48894
48916
|
|
|
48895
48917
|
// src/core/lib/imageTransform.ts
|
|
@@ -49023,12 +49045,12 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
49023
49045
|
}
|
|
49024
49046
|
|
|
49025
49047
|
// src/mantine/components/Base/PageIcon.tsx
|
|
49026
|
-
import React433, { useMemo as
|
|
49048
|
+
import React433, { useMemo as useMemo177 } from "react";
|
|
49027
49049
|
import { Center as Center16, Box as Box75 } from "@mantine/core";
|
|
49028
49050
|
import * as TablerIcons3 from "@tabler/icons-react";
|
|
49029
49051
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
49030
49052
|
const isIconName = src && !src.startsWith("http");
|
|
49031
|
-
const IconComponent =
|
|
49053
|
+
const IconComponent = useMemo177(() => {
|
|
49032
49054
|
if (!isIconName || !src) return null;
|
|
49033
49055
|
const iconComponent = TablerIcons3[src];
|
|
49034
49056
|
if (iconComponent) {
|
|
@@ -49080,7 +49102,7 @@ import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
|
49080
49102
|
|
|
49081
49103
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
49082
49104
|
import React434, { useState as useState249, useEffect as useEffect186, useCallback as useCallback198 } from "react";
|
|
49083
|
-
import { Stack as Stack308, Group as
|
|
49105
|
+
import { Stack as Stack308, Group as Group166, Button as Button105, ActionIcon as ActionIcon54, Text as Text291, Box as Box76 } from "@mantine/core";
|
|
49084
49106
|
import { IconPlus as IconPlus12, IconTrash as IconTrash14 } from "@tabler/icons-react";
|
|
49085
49107
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
49086
49108
|
var FlowSettingsPanel = ({ editor }) => {
|
|
@@ -49147,7 +49169,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
49147
49169
|
[editor]
|
|
49148
49170
|
);
|
|
49149
49171
|
const subtitle = /* @__PURE__ */ React434.createElement(Box76, { px: 40, mb: "md" }, /* @__PURE__ */ React434.createElement(Text291, { size: "sm", c: "dimmed" }, "Add key-value settings for this flow. These are available to oracles and action blocks at runtime."));
|
|
49150
|
-
return /* @__PURE__ */ React434.createElement(BaseRightPanelLayout, { title: "Flow Details", onClose: closePanel, isTemplate: true, captionContent: subtitle }, /* @__PURE__ */ React434.createElement(Stack308, { gap: "lg" }, rows.map((row, index) => /* @__PURE__ */ React434.createElement(Stack308, { key: index, gap: "xs" }, /* @__PURE__ */ React434.createElement(
|
|
49172
|
+
return /* @__PURE__ */ React434.createElement(BaseRightPanelLayout, { title: "Flow Details", onClose: closePanel, isTemplate: true, captionContent: subtitle }, /* @__PURE__ */ React434.createElement(Stack308, { gap: "lg" }, rows.map((row, index) => /* @__PURE__ */ React434.createElement(Stack308, { key: index, gap: "xs" }, /* @__PURE__ */ React434.createElement(Group166, { gap: "xs", align: "center", wrap: "nowrap" }, /* @__PURE__ */ React434.createElement(BaseTextInput, { placeholder: "Key (e.g. protocolDid)", value: row.key, onChange: (e) => handleKeyChange(index, e.currentTarget.value), style: { flex: 1 } }), /* @__PURE__ */ React434.createElement(ActionIcon54, { variant: "subtle", color: "red", onClick: () => handleDelete(index), size: "lg" }, /* @__PURE__ */ React434.createElement(IconTrash14, { size: 16 }))), /* @__PURE__ */ React434.createElement(BaseTextArea, { placeholder: "Value", value: row.value, onChange: (e) => handleValueChange(index, e.currentTarget.value), minRows: 1, maxRows: 8 }))), /* @__PURE__ */ React434.createElement(Button105, { variant: "subtle", leftSection: /* @__PURE__ */ React434.createElement(IconPlus12, { size: 16 }), onClick: handleAdd, size: "sm" }, "Add detail")));
|
|
49151
49173
|
};
|
|
49152
49174
|
|
|
49153
49175
|
// src/mantine/components/CoverImage.tsx
|
|
@@ -49160,7 +49182,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
49160
49182
|
const logoFileInputRef = useRef62(null);
|
|
49161
49183
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
49162
49184
|
const [metadata, setMetadata] = useState250(() => editor?.getPageMetadata?.() || null);
|
|
49163
|
-
const settingsPanelContent =
|
|
49185
|
+
const settingsPanelContent = useMemo178(() => editor ? /* @__PURE__ */ React435.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
49164
49186
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
49165
49187
|
useEffect187(() => {
|
|
49166
49188
|
if (!editor?._metadataManager) {
|
|
@@ -49299,7 +49321,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
49299
49321
|
}
|
|
49300
49322
|
)
|
|
49301
49323
|
)
|
|
49302
|
-
), editable && (isHovering || opened) && /* @__PURE__ */ React435.createElement(
|
|
49324
|
+
), editable && (isHovering || opened) && /* @__PURE__ */ React435.createElement(Group167, { gap: 4, style: { position: "absolute", bottom: hasLogo ? -18 : 0, left: 0, zIndex: 10 } }, !logoSrc && /* @__PURE__ */ React435.createElement(
|
|
49303
49325
|
BaseIconPicker,
|
|
49304
49326
|
{
|
|
49305
49327
|
opened,
|
|
@@ -49359,7 +49381,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
49359
49381
|
}
|
|
49360
49382
|
),
|
|
49361
49383
|
editable && isHovering && /* @__PURE__ */ React435.createElement(
|
|
49362
|
-
|
|
49384
|
+
Group167,
|
|
49363
49385
|
{
|
|
49364
49386
|
gap: "xs",
|
|
49365
49387
|
style: {
|
|
@@ -49981,7 +50003,7 @@ var ExternalDropZone = ({
|
|
|
49981
50003
|
};
|
|
49982
50004
|
|
|
49983
50005
|
// src/mantine/IxoEditor.tsx
|
|
49984
|
-
import React440, { useEffect as useEffect191, useMemo as
|
|
50006
|
+
import React440, { useEffect as useEffect191, useMemo as useMemo180 } from "react";
|
|
49985
50007
|
import { GridSuggestionMenuController, SuggestionMenuController, getDefaultReactSlashMenuItems } from "@blocknote/react";
|
|
49986
50008
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
49987
50009
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
@@ -50026,7 +50048,7 @@ function sanitizeThemeForMantine7(theme) {
|
|
|
50026
50048
|
}
|
|
50027
50049
|
|
|
50028
50050
|
// src/mantine/components/CommandPalette.tsx
|
|
50029
|
-
import React438, { useEffect as useEffect190, useRef as useRef65, useState as useState253, useMemo as
|
|
50051
|
+
import React438, { useEffect as useEffect190, useRef as useRef65, useState as useState253, useMemo as useMemo179, useCallback as useCallback201 } from "react";
|
|
50030
50052
|
import { Box as Box80, Text as Text292, Stack as Stack309 } from "@mantine/core";
|
|
50031
50053
|
var GROUP_ORDER = {
|
|
50032
50054
|
Headings: 0,
|
|
@@ -50129,7 +50151,7 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
50129
50151
|
}
|
|
50130
50152
|
function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
50131
50153
|
const t = useTranslate();
|
|
50132
|
-
const groupedItems =
|
|
50154
|
+
const groupedItems = useMemo179(() => {
|
|
50133
50155
|
const groups = [];
|
|
50134
50156
|
let currentGroup;
|
|
50135
50157
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -50323,7 +50345,7 @@ var BUILTIN_TITLE_KEYS = {
|
|
|
50323
50345
|
};
|
|
50324
50346
|
function SanitizedThemeBoundary({ children }) {
|
|
50325
50347
|
const parentTheme = useMantineTheme();
|
|
50326
|
-
const sanitizedTheme =
|
|
50348
|
+
const sanitizedTheme = useMemo180(() => sanitizeThemeForMantine7(parentTheme), [parentTheme]);
|
|
50327
50349
|
return /* @__PURE__ */ React440.createElement(MantineThemeContext.Provider, { value: sanitizedTheme }, children);
|
|
50328
50350
|
}
|
|
50329
50351
|
function IxoEditorContent({
|
|
@@ -50547,8 +50569,8 @@ function IxoEditor({
|
|
|
50547
50569
|
}
|
|
50548
50570
|
|
|
50549
50571
|
// src/mantine/components/DevUcanGrantButton.tsx
|
|
50550
|
-
import React441, { useEffect as useEffect192, useMemo as
|
|
50551
|
-
import { Alert as Alert115, Badge as Badge63, Button as Button106, Checkbox as Checkbox16, Divider as Divider44, Group as
|
|
50572
|
+
import React441, { useEffect as useEffect192, useMemo as useMemo181, useState as useState254 } from "react";
|
|
50573
|
+
import { Alert as Alert115, Badge as Badge63, Button as Button106, Checkbox as Checkbox16, Divider as Divider44, Group as Group168, Loader as Loader101, Modal as Modal4, Paper as Paper27, Select as Select11, Stack as Stack310, Text as Text293 } from "@mantine/core";
|
|
50552
50574
|
import { IconKey as IconKey7, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
50553
50575
|
var FLOW_AGENT_COMMAND_TYPES = [
|
|
50554
50576
|
"diagnose_blocker",
|
|
@@ -50639,7 +50661,7 @@ function DevUcanGrantButton({ editor, handlers: propHandlers }) {
|
|
|
50639
50661
|
const rootProofCid = getProofCid(rootCapability);
|
|
50640
50662
|
const rootProofDelegation = typeof rootCapability?.delegation === "string" && rootCapability.delegation ? rootCapability.delegation : "";
|
|
50641
50663
|
const hasSigningHandler = !!(handlers?.createDelegation || handlers?.signCapability);
|
|
50642
|
-
const capabilityOptions =
|
|
50664
|
+
const capabilityOptions = useMemo181(() => buildCapabilityOptions(editor), [editor]);
|
|
50643
50665
|
const logAvailableHandlers = () => {
|
|
50644
50666
|
console.info("[ixo-editor] DevUcanGrantButton handlers", {
|
|
50645
50667
|
source: propHandlers ? "prop" : contextHandlers ? "context" : editorHandlers ? "editor" : "none",
|
|
@@ -50677,7 +50699,7 @@ function DevUcanGrantButton({ editor, handlers: propHandlers }) {
|
|
|
50677
50699
|
cancelled = true;
|
|
50678
50700
|
};
|
|
50679
50701
|
}, [opened, roomId, matrixClient, handlers, selectedMemberDid]);
|
|
50680
|
-
const selectedCapabilityDefinitions =
|
|
50702
|
+
const selectedCapabilityDefinitions = useMemo181(() => capabilityOptions.filter((option) => selectedCapabilities.includes(option.id)), [capabilityOptions, selectedCapabilities]);
|
|
50681
50703
|
const handleSign = async () => {
|
|
50682
50704
|
if (!selectedMemberDid) {
|
|
50683
50705
|
setMessage({ color: "yellow", text: "Select a Matrix room member first." });
|
|
@@ -50813,7 +50835,7 @@ function DevUcanGrantButton({ editor, handlers: propHandlers }) {
|
|
|
50813
50835
|
disabled: loadingMembers || signing,
|
|
50814
50836
|
rightSection: loadingMembers ? /* @__PURE__ */ React441.createElement(Loader101, { size: 14 }) : null
|
|
50815
50837
|
}
|
|
50816
|
-
), /* @__PURE__ */ React441.createElement(Divider44, null), /* @__PURE__ */ React441.createElement(Stack310, { gap: "xs" }, /* @__PURE__ */ React441.createElement(
|
|
50838
|
+
), /* @__PURE__ */ React441.createElement(Divider44, null), /* @__PURE__ */ React441.createElement(Stack310, { gap: "xs" }, /* @__PURE__ */ React441.createElement(Group168, { justify: "space-between" }, /* @__PURE__ */ React441.createElement(Text293, { size: "sm", fw: 600 }, "UCAN capabilities"), /* @__PURE__ */ React441.createElement(Group168, { gap: "xs" }, /* @__PURE__ */ React441.createElement(Button106, { size: "compact-xs", variant: "subtle", onClick: () => setSelectedCapabilities(capabilityOptions.map((option) => option.id)) }, "All"), /* @__PURE__ */ React441.createElement(Button106, { size: "compact-xs", variant: "subtle", onClick: () => setSelectedCapabilities([]) }, "None"))), /* @__PURE__ */ React441.createElement(Paper27, { withBorder: true, p: "sm", style: { maxHeight: 360, overflow: "auto" } }, /* @__PURE__ */ React441.createElement(Stack310, { gap: "xs" }, capabilityOptions.map((option) => /* @__PURE__ */ React441.createElement(
|
|
50817
50839
|
Checkbox16,
|
|
50818
50840
|
{
|
|
50819
50841
|
key: option.id,
|
|
@@ -50821,15 +50843,15 @@ function DevUcanGrantButton({ editor, handlers: propHandlers }) {
|
|
|
50821
50843
|
onChange: (event) => {
|
|
50822
50844
|
setSelectedCapabilities((current) => event.currentTarget.checked ? [...current, option.id] : current.filter((id) => id !== option.id));
|
|
50823
50845
|
},
|
|
50824
|
-
label: /* @__PURE__ */ React441.createElement(
|
|
50846
|
+
label: /* @__PURE__ */ React441.createElement(Group168, { gap: "xs" }, /* @__PURE__ */ React441.createElement(Text293, { size: "sm" }, option.label), /* @__PURE__ */ React441.createElement(Badge63, { size: "xs", variant: "light" }, option.capability.can)),
|
|
50825
50847
|
description: `${option.description} on ${option.capability.with}`
|
|
50826
50848
|
}
|
|
50827
|
-
))))), message && /* @__PURE__ */ React441.createElement(Alert115, { color: message.color }, message.text), /* @__PURE__ */ React441.createElement(
|
|
50849
|
+
))))), message && /* @__PURE__ */ React441.createElement(Alert115, { color: message.color }, message.text), /* @__PURE__ */ React441.createElement(Group168, { justify: "flex-end" }, /* @__PURE__ */ React441.createElement(Button106, { variant: "subtle", onClick: () => setOpened(false), disabled: signing }, "Close"), /* @__PURE__ */ React441.createElement(Button106, { variant: "light", color: "gray", onClick: logAvailableHandlers, disabled: signing }, "Log handlers"), /* @__PURE__ */ React441.createElement(Button106, { leftSection: /* @__PURE__ */ React441.createElement(IconShieldPlus4, { size: 16 }), onClick: handleSign, loading: signing, disabled: !hasSigningHandler }, "Sign UCAN")))));
|
|
50828
50850
|
}
|
|
50829
50851
|
|
|
50830
50852
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
50831
50853
|
import React442, { useState as useState255 } from "react";
|
|
50832
|
-
import { Modal as Modal5, Stack as Stack311, Text as Text294, TextInput as TextInput12, Button as Button107, Alert as Alert116, Group as
|
|
50854
|
+
import { Modal as Modal5, Stack as Stack311, Text as Text294, TextInput as TextInput12, Button as Button107, Alert as Alert116, Group as Group169 } from "@mantine/core";
|
|
50833
50855
|
import { IconAlertCircle as IconAlertCircle53, IconCheck as IconCheck54, IconKey as IconKey8 } from "@tabler/icons-react";
|
|
50834
50856
|
var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) => {
|
|
50835
50857
|
const [pin, setPin] = useState255("");
|
|
@@ -50881,7 +50903,7 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
50881
50903
|
{
|
|
50882
50904
|
opened,
|
|
50883
50905
|
onClose: handleClose,
|
|
50884
|
-
title: /* @__PURE__ */ React442.createElement(
|
|
50906
|
+
title: /* @__PURE__ */ React442.createElement(Group169, { gap: "xs" }, /* @__PURE__ */ React442.createElement(IconKey8, { size: 20 }), /* @__PURE__ */ React442.createElement(Text294, { fw: 600 }, "Entity Signing Setup")),
|
|
50885
50907
|
size: "md"
|
|
50886
50908
|
},
|
|
50887
50909
|
/* @__PURE__ */ React442.createElement(Stack311, { gap: "md" }, success ? /* @__PURE__ */ React442.createElement(Alert116, { color: "green", icon: /* @__PURE__ */ React442.createElement(IconCheck54, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React442.createElement(React442.Fragment, null, /* @__PURE__ */ React442.createElement(Text294, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React442.createElement(Text294, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React442.createElement(Alert116, { color: "blue", variant: "light" }, /* @__PURE__ */ React442.createElement(Text294, { size: "sm" }, "This is a ", /* @__PURE__ */ React442.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React442.createElement(Stack311, { gap: "xs" }, /* @__PURE__ */ React442.createElement(Text294, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React442.createElement(Text294, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React442.createElement(Text294, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React442.createElement(Text294, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React442.createElement(
|
|
@@ -50895,19 +50917,19 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
50895
50917
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
50896
50918
|
disabled: loading
|
|
50897
50919
|
}
|
|
50898
|
-
), /* @__PURE__ */ React442.createElement(TextInput12, { label: "Confirm PIN", type: "password", placeholder: "Confirm PIN", value: confirmPin, onChange: (e) => setConfirmPin(e.currentTarget.value), disabled: loading }), error && /* @__PURE__ */ React442.createElement(Alert116, { color: "red", icon: /* @__PURE__ */ React442.createElement(IconAlertCircle53, { size: 16 }) }, error), /* @__PURE__ */ React442.createElement(
|
|
50920
|
+
), /* @__PURE__ */ React442.createElement(TextInput12, { label: "Confirm PIN", type: "password", placeholder: "Confirm PIN", value: confirmPin, onChange: (e) => setConfirmPin(e.currentTarget.value), disabled: loading }), error && /* @__PURE__ */ React442.createElement(Alert116, { color: "red", icon: /* @__PURE__ */ React442.createElement(IconAlertCircle53, { size: 16 }) }, error), /* @__PURE__ */ React442.createElement(Group169, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React442.createElement(Button107, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React442.createElement(Button107, { onClick: handleSetup, loading, leftSection: /* @__PURE__ */ React442.createElement(IconKey8, { size: 16 }) }, "Setup Entity Signing"))))
|
|
50899
50921
|
);
|
|
50900
50922
|
};
|
|
50901
50923
|
|
|
50902
50924
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
50903
|
-
import React443, { useState as useState256, useEffect as useEffect193, useMemo as
|
|
50904
|
-
import { Stack as Stack312, Text as Text295, Paper as Paper28, Group as
|
|
50925
|
+
import React443, { useState as useState256, useEffect as useEffect193, useMemo as useMemo182 } from "react";
|
|
50926
|
+
import { Stack as Stack312, Text as Text295, Paper as Paper28, Group as Group170, Badge as Badge64, Button as Button108, ActionIcon as ActionIcon55, Loader as Loader102, Alert as Alert117, Divider as Divider45 } from "@mantine/core";
|
|
50905
50927
|
import { IconPlus as IconPlus13, IconTrash as IconTrash16, IconShieldCheck as IconShieldCheck19, IconUser as IconUser15, IconRobot as IconRobot5, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
50906
50928
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
50907
50929
|
const [delegations, setDelegations] = useState256([]);
|
|
50908
50930
|
const [loading, setLoading] = useState256(true);
|
|
50909
50931
|
const [revoking, setRevoking] = useState256(null);
|
|
50910
|
-
const rootDelegation =
|
|
50932
|
+
const rootDelegation = useMemo182(() => {
|
|
50911
50933
|
if (editor.getUcanService) {
|
|
50912
50934
|
return editor.getUcanService()?.getRootDelegation() || null;
|
|
50913
50935
|
}
|
|
@@ -50983,12 +51005,12 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
50983
51005
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
50984
51006
|
return date.toLocaleDateString();
|
|
50985
51007
|
};
|
|
50986
|
-
return /* @__PURE__ */ React443.createElement(Stack312, { gap: "md" }, /* @__PURE__ */ React443.createElement(Stack312, { gap: "xs" }, /* @__PURE__ */ React443.createElement(Text295, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React443.createElement(Paper28, { p: "sm", withBorder: true }, /* @__PURE__ */ React443.createElement(
|
|
51008
|
+
return /* @__PURE__ */ React443.createElement(Stack312, { gap: "md" }, /* @__PURE__ */ React443.createElement(Stack312, { gap: "xs" }, /* @__PURE__ */ React443.createElement(Text295, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React443.createElement(Paper28, { p: "sm", withBorder: true }, /* @__PURE__ */ React443.createElement(Group170, { gap: "xs" }, /* @__PURE__ */ React443.createElement(IconShieldCheck19, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React443.createElement(Stack312, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React443.createElement(Text295, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, rootDelegation ? `Granted: ${new Date(rootDelegation.createdAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React443.createElement(Badge64, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React443.createElement(Divider45, { label: "Flow Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React443.createElement(Group170, { justify: "center", py: "xl" }, /* @__PURE__ */ React443.createElement(Loader102, { size: "sm" })) : flowDelegations.length === 0 ? /* @__PURE__ */ React443.createElement(Alert117, { color: "gray", variant: "light" }, /* @__PURE__ */ React443.createElement(Text295, { size: "sm" }, "No flow permissions have been granted yet.")) : /* @__PURE__ */ React443.createElement(Stack312, { gap: "xs" }, flowDelegations.map(({ delegation, displayName, type }) => /* @__PURE__ */ React443.createElement(Paper28, { key: delegation.cid, p: "sm", withBorder: true }, /* @__PURE__ */ React443.createElement(Group170, { justify: "space-between" }, /* @__PURE__ */ React443.createElement(Group170, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React443.createElement(Stack312, { gap: 2 }, /* @__PURE__ */ React443.createElement(Text295, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, formatCapabilities(delegation.capabilities)), /* @__PURE__ */ React443.createElement(Group170, { gap: "xs" }, /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(delegation.expiration)), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, "Granted by: ", delegation.issuerDid === entityDid ? "Entity" : delegation.issuerDid.slice(-8))))), /* @__PURE__ */ React443.createElement(ActionIcon55, { color: "red", variant: "subtle", onClick: () => handleRevoke(delegation.cid), loading: revoking === delegation.cid, disabled: !!revoking }, /* @__PURE__ */ React443.createElement(IconTrash16, { size: 16 })))))), /* @__PURE__ */ React443.createElement(Divider45, { label: "Custom Capabilities", labelPosition: "center" }), !loading && customDelegations.length === 0 ? /* @__PURE__ */ React443.createElement(Alert117, { color: "gray", variant: "light" }, /* @__PURE__ */ React443.createElement(Text295, { size: "sm" }, "No custom capabilities have been created yet.")) : /* @__PURE__ */ React443.createElement(Stack312, { gap: "xs" }, customDelegations.map(({ delegation, displayName, type }) => /* @__PURE__ */ React443.createElement(Paper28, { key: delegation.cid, p: "sm", withBorder: true, style: { borderColor: "var(--mantine-color-violet-4)" } }, /* @__PURE__ */ React443.createElement(Group170, { justify: "space-between" }, /* @__PURE__ */ React443.createElement(Group170, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React443.createElement(Stack312, { gap: 2 }, /* @__PURE__ */ React443.createElement(Group170, { gap: "xs" }, /* @__PURE__ */ React443.createElement(Text295, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React443.createElement(Badge64, { size: "xs", variant: "light", color: "violet" }, "custom")), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, formatCapabilities(delegation.capabilities)), /* @__PURE__ */ React443.createElement(Group170, { gap: "xs" }, /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(delegation.expiration)), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React443.createElement(Text295, { size: "xs", c: "dimmed" }, "Issued by: ", delegation.issuerDid.slice(-12))))), /* @__PURE__ */ React443.createElement(ActionIcon55, { color: "red", variant: "subtle", onClick: () => handleRevoke(delegation.cid), loading: revoking === delegation.cid, disabled: !!revoking }, /* @__PURE__ */ React443.createElement(IconTrash16, { size: 16 })))))), /* @__PURE__ */ React443.createElement(Button108, { leftSection: /* @__PURE__ */ React443.createElement(IconPlus13, { size: 16 }), variant: "light", onClick: onGrantPermission }, "Grant Permission"));
|
|
50987
51009
|
};
|
|
50988
51010
|
|
|
50989
51011
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
50990
51012
|
import React444, { useState as useState257, useCallback as useCallback202 } from "react";
|
|
50991
|
-
import { Modal as Modal6, Stack as Stack313, Text as Text296, TextInput as TextInput13, Button as Button109, Group as
|
|
51013
|
+
import { Modal as Modal6, Stack as Stack313, Text as Text296, TextInput as TextInput13, Button as Button109, Group as Group171, Radio as Radio7, Checkbox as Checkbox17, Alert as Alert118, Paper as Paper29, Loader as Loader103, Badge as Badge65, ActionIcon as ActionIcon56, Divider as Divider46, NumberInput as NumberInput16 } from "@mantine/core";
|
|
50992
51014
|
import { IconSearch as IconSearch12, IconUser as IconUser16, IconRobot as IconRobot6, IconX as IconX23, IconShieldPlus as IconShieldPlus5 } from "@tabler/icons-react";
|
|
50993
51015
|
var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, searchUsers, getOracles, onGrant }) => {
|
|
50994
51016
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
@@ -51100,7 +51122,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
51100
51122
|
{
|
|
51101
51123
|
opened,
|
|
51102
51124
|
onClose: handleClose,
|
|
51103
|
-
title: /* @__PURE__ */ React444.createElement(
|
|
51125
|
+
title: /* @__PURE__ */ React444.createElement(Group171, { gap: "xs" }, /* @__PURE__ */ React444.createElement(IconShieldPlus5, { size: 20 }), /* @__PURE__ */ React444.createElement(Text296, { fw: 600 }, "Grant Permission")),
|
|
51104
51126
|
size: "lg"
|
|
51105
51127
|
},
|
|
51106
51128
|
/* @__PURE__ */ React444.createElement(Stack313, { gap: "md" }, /* @__PURE__ */ React444.createElement(Stack313, { gap: "xs" }, /* @__PURE__ */ React444.createElement(Text296, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React444.createElement(
|
|
@@ -51113,7 +51135,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
51113
51135
|
setSearchResults([]);
|
|
51114
51136
|
}
|
|
51115
51137
|
},
|
|
51116
|
-
/* @__PURE__ */ React444.createElement(
|
|
51138
|
+
/* @__PURE__ */ React444.createElement(Group171, null, /* @__PURE__ */ React444.createElement(Radio7, { value: "user", label: "User" }), /* @__PURE__ */ React444.createElement(Radio7, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React444.createElement(Radio7, { value: "manual", label: "Enter DID" }))
|
|
51117
51139
|
)), recipientType !== "manual" ? /* @__PURE__ */ React444.createElement(Stack313, { gap: "xs" }, /* @__PURE__ */ React444.createElement(
|
|
51118
51140
|
TextInput13,
|
|
51119
51141
|
{
|
|
@@ -51124,9 +51146,9 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
51124
51146
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
51125
51147
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
51126
51148
|
}
|
|
51127
|
-
), selectedRecipient ? /* @__PURE__ */ React444.createElement(Paper29, { p: "sm", withBorder: true }, /* @__PURE__ */ React444.createElement(
|
|
51149
|
+
), selectedRecipient ? /* @__PURE__ */ React444.createElement(Paper29, { p: "sm", withBorder: true }, /* @__PURE__ */ React444.createElement(Group171, { justify: "space-between" }, /* @__PURE__ */ React444.createElement(Group171, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React444.createElement(IconRobot6, { size: 16 }) : /* @__PURE__ */ React444.createElement(IconUser16, { size: 16 }), /* @__PURE__ */ React444.createElement(Text296, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React444.createElement(Badge65, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React444.createElement(ActionIcon56, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React444.createElement(IconX23, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React444.createElement(Paper29, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React444.createElement(Stack313, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React444.createElement(Button109, { key: result.did, variant: "subtle", size: "sm", justify: "flex-start", onClick: () => setSelectedRecipient(result) }, result.displayName)))) : null) : /* @__PURE__ */ React444.createElement(TextInput13, { label: "Recipient DID", placeholder: "did:ixo:...", value: manualDid, onChange: (e) => setManualDid(e.currentTarget.value) }), /* @__PURE__ */ React444.createElement(Divider46, null), /* @__PURE__ */ React444.createElement(Stack313, { gap: "xs" }, /* @__PURE__ */ React444.createElement(Text296, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
51128
51150
|
// Single block mode: show fixed block info
|
|
51129
|
-
/* @__PURE__ */ React444.createElement(Paper29, { p: "sm", withBorder: true }, /* @__PURE__ */ React444.createElement(
|
|
51151
|
+
/* @__PURE__ */ React444.createElement(Paper29, { p: "sm", withBorder: true }, /* @__PURE__ */ React444.createElement(Group171, { gap: "xs" }, /* @__PURE__ */ React444.createElement(Badge65, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React444.createElement(Text296, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React444.createElement(Text296, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
51130
51152
|
) : (
|
|
51131
51153
|
// Multi-block mode: show scope selection
|
|
51132
51154
|
/* @__PURE__ */ React444.createElement(React444.Fragment, null, /* @__PURE__ */ React444.createElement(Radio7.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React444.createElement(Stack313, { gap: "xs" }, /* @__PURE__ */ React444.createElement(Radio7, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React444.createElement(Radio7, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React444.createElement(Paper29, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React444.createElement(Stack313, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React444.createElement(
|
|
@@ -51152,7 +51174,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
51152
51174
|
checked: canDelegate,
|
|
51153
51175
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
51154
51176
|
}
|
|
51155
|
-
), /* @__PURE__ */ React444.createElement(Divider46, null), /* @__PURE__ */ React444.createElement(TextInput13, { label: "Enter your PIN to sign this delegation", type: "password", placeholder: "PIN", value: pin, onChange: (e) => setPin(e.currentTarget.value) }), error && /* @__PURE__ */ React444.createElement(Alert118, { color: "red" }, error), /* @__PURE__ */ React444.createElement(
|
|
51177
|
+
), /* @__PURE__ */ React444.createElement(Divider46, null), /* @__PURE__ */ React444.createElement(TextInput13, { label: "Enter your PIN to sign this delegation", type: "password", placeholder: "PIN", value: pin, onChange: (e) => setPin(e.currentTarget.value) }), error && /* @__PURE__ */ React444.createElement(Alert118, { color: "red" }, error), /* @__PURE__ */ React444.createElement(Group171, { justify: "flex-end" }, /* @__PURE__ */ React444.createElement(Button109, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React444.createElement(Button109, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
51156
51178
|
);
|
|
51157
51179
|
};
|
|
51158
51180
|
|
|
@@ -51302,4 +51324,4 @@ export {
|
|
|
51302
51324
|
ixoGraphQLClient,
|
|
51303
51325
|
getEntity
|
|
51304
51326
|
};
|
|
51305
|
-
//# sourceMappingURL=chunk-
|
|
51327
|
+
//# sourceMappingURL=chunk-4ZVXFIH2.js.map
|