Reading from NEAR testnet…
Reading from NEAR testnet…
GDRUZiyaw5xrwPhDEE36cUixdHCJMG9i59PyXwjucdii
testhub2.akaia.testnet to v1.social08.testnet
set() with 1 yoctoNEAR
{
"data": {
"testhub2.akaia.testnet": {
"widget": {
"gigs-board.pages.community.teams": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst communityData = DevHub.get_community({ handle: props.handle });\nconst root_members = DevHub.get_root_members() ?? null;\n\nif (communityData === null || root_members === null) {\n return <div>Loading...</div>;\n}\n\nconst moderators = root_members[\"team:moderators\"].children;\nconst admins = communityData.admins;\n\nconst UserList = (name, users) => {\n return (\n <div>\n {users.map((user, i) => (\n <div className={`row ${i < users.length - 1 ? \"mb-3\" : \"\"}`}>\n <div class=\"col-3\">\n <b>{name + \" #\" + (i + 1)}</b>\n </div>\n <div class=\"col-9\">\n <span\n key={user}\n className=\"d-inline-flex\"\n style={{ fontWeight: 500 }}\n >\n <Widget\n src=\"neardevgov.near/widget/ProfileLine\"\n props={{\n accountId: user,\n hideAccountId: true,\n tooltip: true,\n }}\n />\n </span>\n </div>\n </div>\n ))}\n </div>\n );\n};\n\nconst Teams = (\n <div class=\"d-flex flex-column align-items-center gap-4\">\n {widget(\"components.molecule.tile\", {\n heading: \"Admins\",\n minHeight: 0,\n children: UserList(\"Admin\", admins),\n })}\n {widget(\"components.molecule.tile\", {\n heading: \"Community Moderators\",\n minHeight: 0,\n children: UserList(\"Moderator\", moderators),\n })}\n </div>\n);\n\nreturn widget(\"entity.community.layout\", {\n handle: props.handle,\n title: \"Teams\",\n children: Teams,\n});\n"
},
"gigs-board.feature.community.editor": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n/* INCLUDE: \"entity/viewer\" */\nconst access_control_info = DevHub.useQuery({\n name: \"access_control_info\",\n});\n\nconst Viewer = {\n can: {\n editCommunity: (communityData) =>\n Struct.typeMatch(communityData) &&\n (communityData.admins.includes(context.accountId) ||\n Viewer.role.isDevHubModerator),\n },\n\n projectPermissions: (projectId) =>\n Near.view(devHubAccountId, \"get_account_project_permissions\", {\n account_id: context.accountId,\n project_id: parseInt(projectId),\n }) ?? { can_configure: false },\n\n role: {\n isDevHubModerator:\n access_control_info.data === null || access_control_info.isLoading\n ? false\n : access_control_info.data.members_list[\n \"team:moderators\"\n ]?.children?.includes?.(context.accountId) ?? false,\n },\n};\n/* END_INCLUDE: \"entity/viewer\" */\n\nconst withoutEmptyStrings = (array) =>\n array.filter((string) => string.length > 0);\n\nconst accessControlSectionFormatter = ({ admins }) => ({\n admins: withoutEmptyStrings(admins),\n});\n\nconst CommunityDefaults = {\n handle: null,\n admins: [context.accountId],\n name: \"\",\n description: \"\",\n bio_markdown: null,\n\n logo_url:\n \"https://ipfs.near.social/ipfs/bafkreibysr2mkwhb4j36h2t7mqwhynqdy4vzjfygfkfg65kuspd2bawauu\",\n\n banner_url:\n \"https://ipfs.near.social/ipfs/bafkreic4xgorjt6ha5z4s5e3hscjqrowe5ahd7hlfc5p4hb6kdfp6prgy4\",\n\n tag: \"\",\n github_handle: null,\n telegram_handle: [],\n twitter_handle: null,\n website_url: null,\n github: null,\n sponsorship: null,\n wiki1: null,\n wiki2: null,\n};\n\nconst CommunityEditor = ({ handle: communityHandle }) => {\n State.init({\n communityData: null,\n hasUnsavedChanges: false,\n });\n\n const isCommunityNew = typeof communityHandle !== \"string\";\n\n const community = isCommunityNew\n ? { data: CommunityDefaults, error: null, isLoading: false }\n : DevHub.useQuery({\n name: \"community\",\n params: { handle: communityHandle },\n });\n\n const isSynced = Struct.isEqual(state.communityData, community.data);\n\n if (state.communityData === null) {\n State.update((lastKnownState) => ({\n ...lastKnownState,\n communityData: community.data,\n hasUnsavedChanges: false,\n }));\n } else if (\n // TODO: Remove or fix this probably redundant branch\n typeof communityHandle === \"string\" &&\n !state.hasUnsavedChanges &&\n !community.isLoading &&\n !isSynced\n ) {\n State.update((lastKnownState) => ({\n ...lastKnownState,\n communityData: community.data,\n hasUnsavedChanges: false,\n }));\n }\n\n const sectionSubmit = (sectionData) => {\n State.update((lastKnownState) => {\n const communityDataUpdate = {\n ...Object.entries(sectionData).reduce(\n (update, [propertyKey, propertyValue]) => ({\n ...update,\n\n [propertyKey]:\n typeof propertyValue !== \"string\" ||\n (propertyValue?.length ?? 0) > 0\n ? propertyValue ?? null\n : null,\n }),\n\n lastKnownState.communityData\n ),\n };\n\n return {\n ...lastKnownState,\n communityData: communityDataUpdate,\n hasUnsavedChanges: !Struct.isEqual(communityDataUpdate, community.data),\n };\n });\n };\n\n const changesSave = () =>\n Near.call(\n nearDevGovGigsContractAccountId,\n isCommunityNew ? \"add_community\" : \"edit_community\",\n\n {\n handle: isCommunityNew ? state.communityData?.handle : communityHandle,\n community: state.communityData,\n }\n );\n\n const onDelete = () =>\n Near.call(nearDevGovGigsContractAccountId, \"delete_community\", {\n handle: communityHandle,\n });\n\n return !isCommunityNew && community.isLoading ? (\n <div>Loading...</div>\n ) : (\n <div className=\"d-flex flex-column align-items-center gap-4 p-4\">\n {typeof community.data?.handle === \"string\" || isCommunityNew ? (\n <>\n {widget(\"feature.community.branding-editor\", {\n isEditingAllowed:\n isCommunityNew || Viewer.can.editCommunity(community.data),\n\n onChangesSubmit: sectionSubmit,\n values: state.communityData,\n })}\n\n {widget(\"components.organism.editor\", {\n heading: \"Basic information\",\n isEditorActive: isCommunityNew,\n\n isEditingAllowed:\n isCommunityNew || Viewer.can.editCommunity(community.data),\n\n onChangesSubmit: sectionSubmit,\n submitLabel: \"Accept\",\n data: state.communityData,\n\n schema: {\n name: {\n inputProps: {\n min: 2,\n max: 30,\n placeholder: \"Community name.\",\n required: true,\n },\n\n label: \"Name\",\n order: 1,\n },\n\n description: {\n inputProps: {\n min: 2,\n max: 60,\n\n placeholder:\n \"Describe your community in one short sentence that will appear in the discovery communities page.\",\n\n required: true,\n },\n\n label: \"Description\",\n order: 2,\n },\n\n handle: {\n inputProps: {\n min: 2,\n max: 40,\n\n placeholder:\n \"Choose unique URL handle for your community by adding letters and numbers. Example: zero-knowledge.\",\n\n required: true,\n },\n\n label: \"Handle\",\n order: 3,\n },\n\n tag: {\n inputProps: {\n min: 2,\n max: 20,\n\n placeholder:\n \"Choose one tag for your community. Any posts with this tag will show up in your community feed.\",\n\n required: true,\n },\n\n label: \"Tag\",\n order: 4,\n },\n },\n })}\n\n {widget(\"components.organism.editor\", {\n heading: \"About\",\n\n isEditingAllowed:\n isCommunityNew || Viewer.can.editCommunity(community.data),\n\n onChangesSubmit: sectionSubmit,\n submitLabel: \"Accept\",\n data: state.communityData,\n\n schema: {\n bio_markdown: {\n format: \"markdown\",\n\n inputProps: {\n min: 2,\n max: 200,\n\n placeholder:\n \"Tell more about your community. This will appear in the About section of your community’s homepage.\",\n },\n\n label: \"Bio\",\n multiline: true,\n order: 1,\n },\n\n twitter_handle: {\n inputProps: { min: 2, max: 60 },\n label: \"Twitter handle\",\n order: 2,\n },\n\n github_handle: {\n inputProps: { min: 2, max: 60 },\n label: \"Github organization handle\",\n order: 3,\n },\n\n telegram_handle: {\n format: \"comma-separated\",\n label: \"Telegram handles\",\n order: 4,\n },\n\n website_url: {\n inputProps: { min: 2, max: 60 },\n label: \"Website\",\n order: 5,\n },\n },\n })}\n\n {widget(\"components.organism.editor\", {\n formatter: accessControlSectionFormatter,\n heading: \"Access control\",\n\n isEditingAllowed:\n isCommunityNew || Viewer.can.editCommunity(community.data),\n\n onChangesSubmit: sectionSubmit,\n submitLabel: \"Accept\",\n data: state.communityData,\n\n schema: {\n admins: {\n format: \"comma-separated\",\n inputProps: { required: true },\n label: \"Admins\",\n order: 1,\n },\n },\n })}\n\n {widget(\"components.organism.editor\", {\n heading: \"Wiki page 1\",\n\n isEditingAllowed:\n isCommunityNew || Viewer.can.editCommunity(community.data),\n\n onChangesSubmit: (value) => sectionSubmit({ wiki1: value }),\n submitLabel: \"Accept\",\n data: state.communityData?.wiki1,\n\n schema: {\n name: {\n label: \"Name\",\n order: 1,\n },\n\n content_markdown: {\n format: \"markdown\",\n label: \"Content\",\n multiline: true,\n order: 2,\n },\n },\n })}\n\n {widget(\"components.organism.editor\", {\n heading: \"Wiki page 2\",\n\n isEditingAllowed:\n isCommunityNew || Viewer.can.editCommunity(community.data),\n\n onChangesSubmit: (value) => sectionSubmit({ wiki2: value }),\n submitLabel: \"Accept\",\n data: state.communityData?.wiki2,\n\n schema: {\n name: {\n label: \"Name\",\n order: 1,\n },\n\n content_markdown: {\n format: \"markdown\",\n label: \"Content\",\n multiline: true,\n order: 2,\n },\n },\n })}\n\n {!isCommunityNew && Viewer.role.isDevHubModerator ? (\n <div\n className=\"d-flex justify-content-center gap-4 p-4 w-100\"\n style={{ maxWidth: 896 }}\n >\n {widget(\"components.atom.button\", {\n classNames: {\n root: \"btn-lg btn-outline-danger border-none\",\n },\n\n label: \"Delete community\",\n onClick: onDelete,\n })}\n </div>\n ) : null}\n\n {(isCommunityNew || Viewer.can.editCommunity(community.data)) &&\n state.hasUnsavedChanges && (\n <div\n className=\"position-fixed end-0 bottom-0 bg-transparent pe-4 pb-4\"\n style={{\n borderTopLeftRadius: \"100%\",\n }}\n >\n {widget(\"components.atom.button\", {\n adornment: !isCommunityNew ? (\n <svg\n fill=\"#ffffff\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 353.073 353.073\"\n >\n <g>\n <path\n d=\"M340.969,0H12.105C5.423,0,0,5.423,0,12.105v328.863c0,6.68,5.423,12.105,12.105,12.105h328.864\n\t\t\t\t\t\t\t\t\t\tc6.679,0,12.104-5.426,12.104-12.105V12.105C353.073,5.423,347.647,0,340.969,0z M67.589,18.164h217.895v101.884H67.589V18.164z\n\t\t\t\t\t\t\t\t\t\t M296.082,327.35H57.003V176.537h239.079V327.35z M223.953,33.295h30.269v72.638h-30.269V33.295z M274.135,213.863H78.938v-12.105\n\t\t\t\t\t\t\t\t\t\th195.197V213.863z M274.135,256.231H78.938v-12.105h195.197V256.231z M274.135,297.087H78.938v-12.105h195.197V297.087z\"\n />\n </g>\n </svg>\n ) : null,\n\n classNames: {\n root: \"btn-lg btn-success\",\n\n adornment: `bi ${\n isCommunityNew ? \"bi-rocket-takeoff-fill\" : null\n }`,\n },\n\n label: isCommunityNew ? \"Launch\" : \"Save\",\n onClick: changesSave,\n })}\n </div>\n )}\n </>\n ) : (\n <div\n className=\"d-flex flex-column justify-content-center align-items-center w-100\"\n style={{ height: 384 }}\n >\n <h2 className=\"h2\">{`Community with handle \"${communityHandle}\" not found.`}</h2>\n </div>\n )}\n </div>\n );\n};\n\nreturn CommunityEditor(props);\n"
},
"gigs-board.pages.communities": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst CommunitiesPage = () =>\n widget(\"components.template.app-layout\", {\n path: [{ label: \"Communities\", pageId: \"communities\", isHidden: true }],\n\n banner: (\n <div\n className=\"d-flex justify-content-between p-4\"\n style={{ backgroundColor: \"#181818\" }}\n >\n <div className=\"d-flex flex-column gap-3\">\n <h1 className=\"m-0 fs-4\">\n <a className=\"text-white\" href={href(\"communities\")}>\n Communities\n </a>\n </h1>\n\n <p className=\"m-0 text-muted fs-6\">\n Discover developer communities on BOS\n </p>\n </div>\n\n <div className=\"d-flex flex-column justify-content-center\">\n {widget(\"components.atom.button\", {\n href: href(\"community.new\"),\n label: \"Create community\",\n type: \"link\",\n })}\n </div>\n </div>\n ),\n\n children: (\n <div className=\"d-flex flex-wrap gap-4 p-4\">\n {(DevHub.get_all_communities() ?? []).map((community) =>\n widget(\"entity.community.card\", community, community.handle)\n )}\n </div>\n ),\n });\n\nreturn CommunitiesPage(props);\n"
},
"gigs-board.entity.community.header": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/gui/navigation\" */\nconst NavUnderline = styled.ul`\n border-bottom: 1px #eceef0 solid;\n\n a {\n color: #687076;\n text-decoration: none;\n }\n\n a.active {\n font-weight: bold;\n color: #0c7283;\n border-bottom: 4px solid #0c7283;\n }\n`;\n/* END_INCLUDE: \"core/lib/gui/navigation\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n/* INCLUDE: \"entity/viewer\" */\nconst access_control_info = DevHub.useQuery({\n name: \"access_control_info\",\n});\n\nconst Viewer = {\n can: {\n editCommunity: (communityData) =>\n Struct.typeMatch(communityData) &&\n (communityData.admins.includes(context.accountId) ||\n Viewer.role.isDevHubModerator),\n },\n\n projectPermissions: (projectId) =>\n Near.view(devHubAccountId, \"get_account_project_permissions\", {\n account_id: context.accountId,\n project_id: parseInt(projectId),\n }) ?? { can_configure: false },\n\n role: {\n isDevHubModerator:\n access_control_info.data === null || access_control_info.isLoading\n ? false\n : access_control_info.data.members_list[\n \"team:moderators\"\n ]?.children?.includes?.(context.accountId) ?? false,\n },\n};\n/* END_INCLUDE: \"entity/viewer\" */\n\nconst Button = styled.button`\n height: 40px;\n font-size: 14px;\n border-color: #e3e3e0;\n background-color: #ffffff;\n`;\n\nconst Banner = styled.div`\n max-width: 100%;\n width: 1320px;\n height: 240px;\n`;\n\nconst CommunityHeader = ({ activeTabTitle, handle }) => {\n State.init({\n copiedShareUrl: false,\n });\n\n const community = DevHub.useQuery({\n name: \"community\",\n params: { handle },\n });\n\n if (community.data === null && community.isLoading) {\n return <div>Loading...</div>;\n }\n\n const tabs = [\n {\n defaultActive: true,\n iconClass: \"bi bi-house-door\",\n route: \"community.activity\",\n title: \"Activity\",\n },\n\n ...[community.data?.wiki1, community.data?.wiki2]\n .filter((maybeWikiPage) => maybeWikiPage ?? false)\n .map(({ name }, idx) => ({\n params: { id: idx + 1 },\n route: \"community.wiki\",\n title: name,\n })),\n\n {\n iconClass: \"bi bi-people-fill\",\n route: \"community.teams\",\n title: \"Teams\",\n },\n\n {\n iconClass: \"bi bi-view-list\",\n route: \"community.projects\",\n title: \"Projects\",\n },\n\n {\n iconClass: \"bi bi-coin\",\n route: \"community.sponsorship\",\n title: \"Sponsorship\",\n },\n\n {\n iconClass: \"bi bi-github\",\n route: \"community.github\",\n title: \"GitHub\",\n },\n\n ...((community.data?.telegram_handle?.length ?? 0) > 0\n ? [\n {\n iconClass: \"bi bi-telegram\",\n route: \"community.telegram\",\n title: \"Telegram\",\n },\n ]\n : []),\n ];\n\n return (\n <div className=\"d-flex flex-column gap-3 overflow-hidden bg-white\">\n <Banner\n className=\"object-fit-cover\"\n style={{\n background: `center / cover no-repeat url(${community.data.banner_url})`,\n }}\n />\n\n <div className=\"d-md-flex d-block justify-content-between container\">\n <div className=\"d-md-flex d-block align-items-end\">\n <div className=\"position-relative\">\n <div style={{ width: 150, height: 100 }}>\n <img\n alt=\"Community logo\"\n className=\"border border-3 border-white rounded-circle shadow position-absolute\"\n width=\"150\"\n height=\"150\"\n src={community.data.logo_url}\n style={{ top: -50 }}\n />\n </div>\n </div>\n\n <div>\n <div className=\"h1 pt-3 ps-3 text-nowrap\">\n {community.data.name}\n </div>\n\n <div className=\"ps-3 pb-2 text-secondary\">\n {community.data.description}\n </div>\n </div>\n </div>\n\n <div className=\"d-flex align-items-end gap-3\">\n {Viewer.can.editCommunity(community.data) ? (\n <a\n href={href(\"community.edit-info\", { handle })}\n className={[\n \"d-flex align-items-center gap-2 border border-1 rounded-pill px-3 py-2\",\n \"text-decoration-none text-dark text-nowrap font-weight-bold fs-6\",\n ].join(\" \")}\n >\n <i className=\"bi bi-gear\" />\n <span>Edit information</span>\n </a>\n ) : null}\n\n <OverlayTrigger\n placement=\"top\"\n overlay={<Tooltip>Copy URL to clipboard</Tooltip>}\n >\n <Button\n type=\"button\"\n className={[\n \"d-flex align-items-center gap-2 border border-1 rounded-pill px-3 py-2\",\n \"text-dark text-nowrap font-weight-bold fs-6\",\n ].join(\" \")}\n onMouseLeave={() => {\n State.update({ copiedShareUrl: false });\n }}\n onClick={() => {\n clipboard\n .writeText(\n \"https://near.org\" + href(\"community.activity\", { handle })\n )\n .then(() => {\n State.update({ copiedShareUrl: true });\n });\n }}\n >\n {state.copiedShareUrl ? (\n <i className=\"bi bi-16 bi-check\"></i>\n ) : (\n <i className=\"bi bi-16 bi-link-45deg\"></i>\n )}\n\n <span>Share</span>\n </Button>\n </OverlayTrigger>\n </div>\n </div>\n\n <NavUnderline className=\"nav\">\n {tabs.map(({ defaultActive, params, route, title }) =>\n title ? (\n <li className=\"nav-item\" key={title}>\n <a\n aria-current={defaultActive && \"page\"}\n className={[\n \"d-inline-flex gap-2\",\n activeTabTitle === title ? \"nav-link active\" : \"nav-link\",\n ].join(\" \")}\n href={href(route, { handle, ...(params ?? {}) })}\n >\n <span>{title}</span>\n </a>\n </li>\n ) : null\n )}\n </NavUnderline>\n </div>\n );\n};\n\nreturn CommunityHeader(props);\n"
},
"gigs-board.pages.community.sponsorship": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst communityData = DevHub.get_community({ handle: props.handle });\n\nif (communityData === null) {\n return <div>Loading...</div>;\n}\n\nconst postIdsWithTags = (tags) => {\n const ids = tags\n .map(\n (tag) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label: tag,\n }) ?? []\n )\n .map((ids) => new Set(ids))\n .reduce((previous, current) => {\n let res = new Set();\n for (let id of current) {\n if (previous.has(id)) {\n res.add(id);\n }\n }\n return res;\n });\n\n return [...ids].reverse();\n};\n\nconst sponsorshipRequiredTags = [\"funding\", communityData.tag];\nconst sponsorshipRequiredPosts = postIdsWithTags(sponsorshipRequiredTags);\n\nconst Sponsorship = (\n <div>\n <div class=\"row mb-2 justify-content-center\">\n <div class=\"col-md-auto\">\n <small class=\"text-muted\">\n Post Type: <b>Sponsorship</b>\n </small>\n </div>\n <div class=\"col-md-auto\">\n <small class=\"text-muted\">\n Required tags:\n {sponsorshipRequiredTags.map((tag) => (\n <a href={href(\"Feed\", { tag })} key={tag}>\n <span class=\"badge text-bg-primary me-1\">{tag}</span>\n </a>\n ))}\n </small>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col\">\n <div class=\"card\">\n <div class=\"card-body border-secondary\">\n <h6 class=\"card-title\">\n Sponsored Projects ({sponsorshipRequiredPosts.length})\n </h6>\n <div class=\"row\">\n {sponsorshipRequiredPosts.map((postId) => (\n <div class=\"col-3\">\n {widget(\"entity.post.CompactPost\", { id: postId }, postId)}\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n);\n\nreturn widget(\"entity.community.layout\", {\n handle: props.handle,\n title: \"Sponsorship\",\n children: Sponsorship,\n});\n"
},
"gigs-board.pages.project": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/gui/navigation\" */\nconst NavUnderline = styled.ul`\n border-bottom: 1px #eceef0 solid;\n\n a {\n color: #687076;\n text-decoration: none;\n }\n\n a.active {\n font-weight: bold;\n color: #0c7283;\n border-bottom: 4px solid #0c7283;\n }\n`;\n/* END_INCLUDE: \"core/lib/gui/navigation\" */\n/* INCLUDE: \"core/lib/uuid\" */\nconst uuid = () =>\n [Date.now().toString(16)]\n .concat(\n Array.from(\n { length: 4 },\n () => Math.floor(Math.random() * 0xffffffff) & 0xffffffff\n ).map((value) => value.toString(16))\n )\n .join(\"-\");\n\nconst withUUIDIndex = (data) => {\n const id = uuid();\n\n return Object.fromEntries([[id, { ...data, id }]]);\n};\n/* END_INCLUDE: \"core/lib/uuid\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n/* INCLUDE: \"entity/viewer\" */\nconst access_control_info = DevHub.useQuery({\n name: \"access_control_info\",\n});\n\nconst Viewer = {\n can: {\n editCommunity: (communityData) =>\n Struct.typeMatch(communityData) &&\n (communityData.admins.includes(context.accountId) ||\n Viewer.role.isDevHubModerator),\n },\n\n projectPermissions: (projectId) =>\n Near.view(devHubAccountId, \"get_account_project_permissions\", {\n account_id: context.accountId,\n project_id: parseInt(projectId),\n }) ?? { can_configure: false },\n\n role: {\n isDevHubModerator:\n access_control_info.data === null || access_control_info.isLoading\n ? false\n : access_control_info.data.members_list[\n \"team:moderators\"\n ]?.children?.includes?.(context.accountId) ?? false,\n },\n};\n/* END_INCLUDE: \"entity/viewer\" */\n\nconst ProjectPage = ({ dir, id, view: selectedViewId }) => {\n const permissions = Viewer.projectPermissions(id);\n\n const project = DevHub.useQuery({\n name: \"project\",\n params: { id: parseInt(id) },\n });\n\n const viewsMetadata = DevHub.get_project_views_metadata({\n project_id: parseInt(id),\n });\n\n return project.data === null && project.isLoading ? (\n <div>Loading...</div>\n ) : (\n widget(\"entity.project.layout\", {\n id,\n\n path: [\n {\n label: \"Projects\",\n pageId: typeof dir === \"string\" ? \"community.projects\" : \"projects\",\n params: typeof dir === \"string\" ? { handle: dir } : null,\n },\n ],\n\n configurator: widget(\"feature.project.configurator\", {\n metadata: project.data?.metadata,\n permissions,\n }),\n\n children:\n project.data === null ? (\n <div class=\"alert alert-danger\" role=\"alert\">\n {`Project with id ${id} doesn't exist`}\n </div>\n ) : (\n <div className=\"d-flex flex-column\">\n <NavUnderline className=\"nav\">\n {viewsMetadata.map((metadata) => (\n <li className=\"nav-item\" key={metadata.id}>\n <a\n aria-current={defaultActive && \"page\"}\n className={[\n \"nav-link d-inline-flex gap-2\",\n metadata.id === selectedViewId ? \"active\" : \"\",\n ].join(\" \")}\n href={href(\"project\", {\n id: project.data.metadata.id,\n view: metadata.id,\n dir,\n })}\n >\n <span>{metadata.title}</span>\n </a>\n </li>\n ))}\n\n {permissions.can_configure ? (\n <li class=\"nav-item\">\n <a\n href={href(\"project\", { id, view: \"new\", dir })}\n className={[\n \"nav-link d-flex gap-2\",\n selectedViewId === \"new\" ? \"active\" : \"\",\n ].join(\" \")}\n >\n <i class=\"bi bi-plus-lg\" />\n <span>New view</span>\n </a>\n </li>\n ) : null}\n </NavUnderline>\n\n <div class=\"tab-content\">\n {viewsMetadata.map((metadata) => (\n <div\n class={`tab-pane pt-4 fade ${\n metadata.id === selectedViewId ? \"show active\" : \"\"\n }`}\n role=\"tabpanel\"\n tabindex=\"0\"\n key={metadata.id}\n >\n {widget(\n permissions.can_configure\n ? \"feature.project.view-configurator\"\n : [\"entity.project\", metadata.kind].join(\".\"),\n {\n link: href(\"project\", { id, view: metadata.id, dir }),\n metadata,\n permissions,\n projectId: id,\n }\n )}\n </div>\n ))}\n\n {permissions.can_configure ? (\n <div\n class={`tab-pane fade ${\n selectedViewId === \"new\" ? \"show active\" : \"\"\n }`}\n role=\"tabpanel\"\n tabindex=\"0\"\n key={view.id}\n >\n {widget(\"feature.project.view-configurator\", {\n permissions,\n projectId: id,\n })}\n </div>\n ) : null}\n </div>\n </div>\n ),\n })\n );\n};\n\nreturn ProjectPage(props);\n"
},
"gigs-board.feature.project.github-view-configurator": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/gui/form\" */\nconst defaultFieldUpdate = ({\n input,\n lastKnownValue,\n params: { arrayDelimiter },\n}) => {\n switch (typeof input) {\n case \"boolean\":\n return input;\n\n case \"object\":\n return Array.isArray(input) && typeof lastKnownValue === \"string\"\n ? input.join(arrayDelimiter ?? \",\")\n : input;\n\n case \"string\":\n return Array.isArray(lastKnownValue)\n ? input.split(arrayDelimiter ?? \",\").map((string) => string.trim())\n : input;\n\n default: {\n if ((input ?? null) === null) {\n switch (typeof lastKnownValue) {\n case \"boolean\":\n return !lastKnownValue;\n\n default:\n return lastKnownValue;\n }\n } else return input;\n }\n }\n};\n\nconst useForm = ({ initialValues, stateKey: formStateKey, uninitialized }) => {\n const initialFormState = {\n hasUnsubmittedChanges: false,\n values: initialValues ?? {},\n };\n\n const formState = state[formStateKey] ?? null,\n isSynced = Struct.isEqual(formState?.values ?? {}, initialFormState.values);\n\n const formReset = () =>\n State.update((lastKnownComponentState) => ({\n ...lastKnownComponentState,\n [formStateKey]: initialFormState,\n hasUnsubmittedChanges: false,\n }));\n\n const formUpdate =\n ({ path, via: customFieldUpdate, ...params }) =>\n (fieldInput) => {\n const updatedValues = Struct.deepFieldUpdate(\n formState?.values ?? {},\n\n {\n input: fieldInput?.target?.value ?? fieldInput,\n params,\n path,\n\n via:\n typeof customFieldUpdate === \"function\"\n ? customFieldUpdate\n : defaultFieldUpdate,\n }\n );\n\n State.update((lastKnownComponentState) => ({\n ...lastKnownComponentState,\n\n [formStateKey]: {\n hasUnsubmittedChanges: !Struct.isEqual(\n updatedValues,\n initialFormState.values\n ),\n\n values: updatedValues,\n },\n }));\n };\n\n if (\n !uninitialized &&\n (formState === null ||\n (Object.keys(formState?.values ?? {}).length > 0 &&\n !formState.hasUnsubmittedChanges &&\n !isSynced))\n ) {\n formReset();\n }\n\n return {\n ...(formState ?? initialFormState),\n isSynced,\n reset: formReset,\n update: formUpdate,\n };\n};\n/* END_INCLUDE: \"core/lib/gui/form\" */\n/* INCLUDE: \"core/lib/gui/attractable\" */\nconst AttractableDiv = styled.div`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n\nconst AttractableLink = styled.a`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n\nconst AttractableImage = styled.img`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n/* END_INCLUDE: \"core/lib/gui/attractable\" */\n/* INCLUDE: \"core/lib/uuid\" */\nconst uuid = () =>\n [Date.now().toString(16)]\n .concat(\n Array.from(\n { length: 4 },\n () => Math.floor(Math.random() * 0xffffffff) & 0xffffffff\n ).map((value) => value.toString(16))\n )\n .join(\"-\");\n\nconst withUUIDIndex = (data) => {\n const id = uuid();\n\n return Object.fromEntries([[id, { ...data, id }]]);\n};\n/* END_INCLUDE: \"core/lib/uuid\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n/* INCLUDE: \"entity/viewer\" */\nconst access_control_info = DevHub.useQuery({\n name: \"access_control_info\",\n});\n\nconst Viewer = {\n can: {\n editCommunity: (communityData) =>\n Struct.typeMatch(communityData) &&\n (communityData.admins.includes(context.accountId) ||\n Viewer.role.isDevHubModerator),\n },\n\n projectPermissions: (projectId) =>\n Near.view(devHubAccountId, \"get_account_project_permissions\", {\n account_id: context.accountId,\n project_id: parseInt(projectId),\n }) ?? { can_configure: false },\n\n role: {\n isDevHubModerator:\n access_control_info.data === null || access_control_info.isLoading\n ? false\n : access_control_info.data.members_list[\n \"team:moderators\"\n ]?.children?.includes?.(context.accountId) ?? false,\n },\n};\n/* END_INCLUDE: \"entity/viewer\" */\n\nconst EditorSettings = {\n maxColumnsNumber: 20,\n};\n\nconst CompactContainer = styled.div`\n width: fit-content !important;\n max-width: 100%;\n`;\n\nconst BoardConfigDefaults = {\n id: uuid(),\n kind: \"github-view\",\n columns: {},\n dataTypesIncluded: { Issue: false, PullRequest: true },\n description: \"\",\n repoURL: \"\",\n ticketState: \"all\",\n title: \"\",\n};\n\nconst GithubKanbanViewConfigurator = ({ communityHandle, pageURL }) => {\n State.init({\n editingMode: \"form\",\n isEditorActive: false,\n });\n\n const community = DevHub.useQuery({\n name: \"community\",\n params: { handle: communityHandle },\n });\n\n const boards =\n ((community?.data?.github ?? null) === null\n ? {}\n : JSON.parse(community.data.github)\n )?.kanbanBoards ?? {};\n\n const boardId = Object.keys(boards)[0] ?? null;\n\n const errors = {\n noBoard: !Struct.typeMatch(boards[boardId]),\n noBoards: !community.isLoading && Object.keys(boards).length === 0,\n noBoardId: typeof boardId !== \"string\",\n noCommunity: !community.isLoading && community.data === null,\n };\n\n const form = useForm({\n initialValues: { kind: \"github-view\", ...boards[boardId] },\n stateKey: \"board\",\n uninitialized: errors.noBoards || errors.noBoardId,\n });\n\n const editorToggle = (forcedState) =>\n State.update((lastKnownState) => ({\n ...lastKnownState,\n isEditorActive: forcedState ?? !lastKnownState.isEditorActive,\n }));\n\n const onEditingModeChange = ({ target: { value } }) =>\n State.update((lastKnownState) => ({\n ...lastKnownState,\n editingMode: value,\n }));\n\n const boardCreate = () =>\n State.update((lastKnownState) => ({\n ...lastKnownState,\n board: { hasUnsubmittedChanges: false, values: BoardConfigDefaults },\n isEditorActive: true,\n }));\n\n const columnsCreateNew = ({ lastKnownValue }) =>\n Object.keys(lastKnownValue).length < EditorSettings.maxColumnsNumber\n ? {\n ...(lastKnownValue ?? {}),\n\n ...withUUIDIndex({\n description: \"\",\n labelSearchTerms: [],\n title: \"New column\",\n }),\n }\n : lastKnownValue;\n\n const columnsDeleteById =\n (id) =>\n ({ lastKnownValue }) =>\n Object.fromEntries(\n Object.entries(lastKnownValue).filter(([columnId]) => columnId !== id)\n );\n\n const onSubmit = () =>\n DevHub.edit_community_github({\n handle: communityHandle,\n\n github: JSON.stringify({\n kanbanBoards: {\n ...boards,\n [form.values.id]: form.values,\n },\n }),\n });\n\n const formElement =\n Object.keys(form.values).length > 0 ? (\n <>\n <div className=\"d-flex gap-3 flex-column flex-lg-row\">\n {widget(\n \"components.molecule.text-input\",\n {\n className: \"flex-shrink-0\",\n key: `${form.values.id}-title`,\n label: \"Title\",\n onChange: form.update({ path: [\"title\"] }),\n placeholder: \"NEAR Protocol NEPs\",\n value: form.values.title,\n },\n `${form.values.id}-title`\n )}\n\n {widget(\"components.molecule.text-input\", {\n className: \"w-100\",\n key: `${form.values.id}-repoURL`,\n label: \"GitHub repository URL\",\n onChange: form.update({ path: [\"repoURL\"] }),\n placeholder: \"https://github.com/example-org/example-repo\",\n value: form.values.repoURL,\n })}\n </div>\n\n <div className=\"d-flex gap-3 flex-column flex-lg-row\">\n <CompactContainer className=\"d-flex gap-3 flex-column justify-content-start p-2\">\n <span\n className=\"d-inline-flex gap-2\"\n id={`${form.values.id}-dataTypesIncluded`}\n >\n <i className=\"bi bi-ticket-fill\" />\n <span>Ticket type</span>\n </span>\n\n {Object.entries(form.values.dataTypesIncluded).map(\n ([typeName, enabled]) =>\n widget(\n \"components.atom.toggle\",\n\n {\n active: enabled,\n className: \"w-100\",\n key: typeName,\n label: typeName,\n\n onSwitch: form.update({\n path: [\"dataTypesIncluded\", typeName],\n }),\n },\n\n typeName\n )\n )}\n </CompactContainer>\n\n <CompactContainer className=\"d-flex gap-3 flex-column justify-content-start p-2\">\n <span\n className=\"d-inline-flex gap-2\"\n id={`${form.values.id}-dataTypesIncluded`}\n >\n <i class=\"bi bi-cone-striped\" />\n <span>Ticket state</span>\n </span>\n\n {widget(\"components.molecule.button-switch\", {\n currentValue: form.values.ticketState,\n key: \"ticketState\",\n onChange: form.update({ path: [\"ticketState\"] }),\n\n options: [\n { label: \"All\", value: \"all\" },\n { label: \"Open\", value: \"open\" },\n { label: \"Closed\", value: \"closed\" },\n ],\n\n title: \"Editing mode selection\",\n })}\n </CompactContainer>\n\n {widget(\"components.molecule.text-input\", {\n className: \"w-100\",\n inputProps: { className: \"h-75\" },\n key: `${form.values.id}-description`,\n label: \"Description\",\n multiline: true,\n onChange: form.update({ path: [\"description\"] }),\n placeholder: \"Latest NEAR Enhancement Proposals by status.\",\n value: form.values.description,\n })}\n </div>\n\n <div className=\"d-flex align-items-center justify-content-between\">\n <span className=\"d-inline-flex gap-2 m-0\">\n <i className=\"bi bi-list-task\" />\n <span>Columns ( max. {EditorSettings.maxColumnsNumber} )</span>\n </span>\n </div>\n\n <div className=\"d-flex flex-column align-items-center gap-3\">\n {Object.values(form.values.columns).map(\n ({ id, description, labelSearchTerms, title }) => (\n <div\n className=\"d-flex gap-3 border border-secondary rounded-4 p-3 w-100\"\n key={id}\n >\n <div className=\"d-flex flex-column gap-1 w-100\">\n {widget(\"components.molecule.text-input\", {\n className: \"flex-grow-1\",\n key: `${form.values.id}-column-${id}-title`,\n label: \"Title\",\n onChange: form.update({ path: [\"columns\", id, \"title\"] }),\n placeholder: \"👀 Review\",\n value: title,\n })}\n\n {widget(\"components.molecule.text-input\", {\n className: \"flex-grow-1\",\n key: `${form.values.id}-column-${id}-description`,\n label: \"Description\",\n\n onChange: form.update({\n path: [\"columns\", id, \"description\"],\n }),\n\n placeholder:\n \"NEPs that need a review by Subject Matter Experts.\",\n\n value: description,\n })}\n\n {widget(\"components.molecule.text-input\", {\n format: \"comma-separated\",\n key: `${form.values.id}-column-${title}-labelSearchTerms`,\n\n label: `Search terms for all the labels\n\t\t\t\t\t\t\t\t\t\t\tMUST be presented in included tickets`,\n\n onChange: form.update({\n path: [\"columns\", id, \"labelSearchTerms\"],\n }),\n\n placeholder: \"WG-, draft, review, proposal, ...\",\n value: labelSearchTerms.join(\", \"),\n })}\n </div>\n\n <div\n className=\"d-flex flex-column gap-3 border-start p-3 pe-0\"\n style={{ marginTop: -16, marginBottom: -16 }}\n >\n <button\n className=\"btn btn-outline-danger shadow\"\n onClick={form.update({\n path: [\"columns\"],\n via: columnsDeleteById(id),\n })}\n title=\"Delete column\"\n >\n <i className=\"bi bi-trash-fill\" />\n </button>\n </div>\n </div>\n )\n )}\n </div>\n </>\n ) : null;\n\n return community.data === null || (!errors.noBoards && errors.noBoardId) ? (\n <div>\n {(community.isLoading && \"Loading...\") ||\n (!errors.noBoards && errors.noBoardId\n ? \"Error: board id not found in editor props.\"\n : errors.noCommunity &&\n `Community with handle ${communityHandle} not found.`)}\n </div>\n ) : (\n <div className=\"d-flex flex-column gap-4\">\n {state.isEditorActive && Object.keys(form.values).length > 0 ? (\n <AttractableDiv className=\"d-flex flex-column gap-3 p-3 w-100 rounded-4\">\n <div className=\"d-flex align-items-center justify-content-between gap-3\">\n <h5 className=\"h5 d-inline-flex gap-2 m-0\">\n <i className=\"bi bi-wrench-adjustable-circle-fill\" />\n <span>Board configuration</span>\n </h5>\n\n {widget(\"components.molecule.button-switch\", {\n currentValue: state.editingMode,\n key: \"editingMode\",\n onChange: onEditingModeChange,\n\n options: [\n { label: \"Form\", value: \"form\" },\n { label: \"JSON\", value: \"JSON\" },\n ],\n\n title: \"Editing mode selection\",\n })}\n </div>\n\n {state.editingMode === \"form\" ? (\n formElement\n ) : (\n <div className=\"d-flex flex-column flex-grow-1 border-0 bg-transparent w-100\">\n <textarea\n className=\"form-control\"\n disabled\n rows=\"12\"\n type=\"text\"\n value={JSON.stringify(form.values ?? {}, null, \"\\t\")}\n />\n </div>\n )}\n\n <div className=\"d-flex align-items-center justify-content-end gap-3\">\n <button\n className=\"btn shadow btn-outline-secondary d-inline-flex gap-2 me-auto\"\n disabled={\n Object.keys(form.values.columns).length >=\n EditorSettings.maxColumnsNumber\n }\n onClick={form.update({\n path: [\"columns\"],\n via: columnsCreateNew,\n })}\n >\n <i className=\"bi bi-plus-lg\" />\n <span>New column</span>\n </button>\n\n <button\n className=\"btn btn-outline-danger border-0 d-inline-flex gap-2 align-items-center\"\n onClick={() => editorToggle(false)}\n style={{ width: \"fit-content\" }}\n >\n <span>Cancel</span>\n </button>\n\n <button\n disabled={false}\n className=\"btn shadow btn-success d-inline-flex gap-2 align-items-center\"\n onClick={onSubmit}\n style={{ width: \"fit-content\" }}\n >\n <i className=\"bi bi-cloud-arrow-up-fill\" />\n <span>Save</span>\n </button>\n </div>\n </AttractableDiv>\n ) : null}\n\n {Object.keys(form.values).length > 0 ? (\n widget(\"entity.project.github-view\", {\n ...form.values,\n editorTrigger: () => editorToggle(true),\n isEditable: Viewer.can.editCommunity(community.data),\n pageURL,\n })\n ) : (\n <div\n className=\"d-flex flex-column align-items-center justify-content-center gap-4\"\n style={{ height: 384 }}\n >\n <h5 className=\"h5 d-inline-flex gap-2 m-0\">\n This community doesn't have GitHub integrations\n </h5>\n\n {Viewer.can.editCommunity(community.data) ? (\n <button\n className=\"btn shadow btn-primary d-inline-flex gap-2\"\n onClick={boardCreate}\n >\n <i className=\"bi bi-kanban-fill\" />\n <span>Create board</span>\n </button>\n ) : null}\n </div>\n )}\n </div>\n );\n};\n\nreturn GithubKanbanViewConfigurator(props);\n"
},
"gigs-board.feature.project.configurator": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/lib/gui/form\" */\nconst defaultFieldUpdate = ({\n input,\n lastKnownValue,\n params: { arrayDelimiter },\n}) => {\n switch (typeof input) {\n case \"boolean\":\n return input;\n\n case \"object\":\n return Array.isArray(input) && typeof lastKnownValue === \"string\"\n ? input.join(arrayDelimiter ?? \",\")\n : input;\n\n case \"string\":\n return Array.isArray(lastKnownValue)\n ? input.split(arrayDelimiter ?? \",\").map((string) => string.trim())\n : input;\n\n default: {\n if ((input ?? null) === null) {\n switch (typeof lastKnownValue) {\n case \"boolean\":\n return !lastKnownValue;\n\n default:\n return lastKnownValue;\n }\n } else return input;\n }\n }\n};\n\nconst useForm = ({ initialValues, stateKey: formStateKey, uninitialized }) => {\n const initialFormState = {\n hasUnsubmittedChanges: false,\n values: initialValues ?? {},\n };\n\n const formState = state[formStateKey] ?? null,\n isSynced = Struct.isEqual(formState?.values ?? {}, initialFormState.values);\n\n const formReset = () =>\n State.update((lastKnownComponentState) => ({\n ...lastKnownComponentState,\n [formStateKey]: initialFormState,\n hasUnsubmittedChanges: false,\n }));\n\n const formUpdate =\n ({ path, via: customFieldUpdate, ...params }) =>\n (fieldInput) => {\n const updatedValues = Struct.deepFieldUpdate(\n formState?.values ?? {},\n\n {\n input: fieldInput?.target?.value ?? fieldInput,\n params,\n path,\n\n via:\n typeof customFieldUpdate === \"function\"\n ? customFieldUpdate\n : defaultFieldUpdate,\n }\n );\n\n State.update((lastKnownComponentState) => ({\n ...lastKnownComponentState,\n\n [formStateKey]: {\n hasUnsubmittedChanges: !Struct.isEqual(\n updatedValues,\n initialFormState.values\n ),\n\n values: updatedValues,\n },\n }));\n };\n\n if (\n !uninitialized &&\n (formState === null ||\n (Object.keys(formState?.values ?? {}).length > 0 &&\n !formState.hasUnsubmittedChanges &&\n !isSynced))\n ) {\n formReset();\n }\n\n return {\n ...(formState ?? initialFormState),\n isSynced,\n reset: formReset,\n update: formUpdate,\n };\n};\n/* END_INCLUDE: \"core/lib/gui/form\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst ProjectConfigurator = ({ metadata, permissions }) => {\n State.init({\n isConfiguratorActive: false,\n });\n\n const configuratorToggle = (forcedState) =>\n State.update((lastKnownState) => ({\n ...lastKnownState,\n isConfiguratorActive: forcedState ?? !lastKnownState.isConfiguratorActive,\n }));\n\n const form = useForm({\n initialValues: { metadata: { ...metadata, id: parseInt(metadata.id) } },\n stateKey: \"project\",\n });\n\n const onCancel = () => {\n form.reset();\n configuratorToggle(false);\n };\n\n const onSubmit = () => DevHub.update_project_metadata(form.values);\n\n return (\n <div className=\"d-flex justify-content-between gap-3 w-100\">\n <div className=\"d-flex flex-column gap-2 justify-content-end\">\n {state.isConfiguratorActive ? (\n widget(\"components.molecule.text-input\", {\n className: \"w-100 p-0 gap-0\",\n\n inputProps: {\n className: \"h-75 border-0 bg-dark text-white fs-1\",\n min: 3,\n max: 30,\n },\n\n key: `project-${form.values.metadata.id}-name`,\n multiline: false,\n onChange: form.update({ path: [\"metadata\", \"name\"] }),\n placeholder: \"Project name\",\n value: form.values.metadata.name,\n skipPaddingGap: true,\n })\n ) : (\n <h1 className=\"m-0 px-2 py-2\">{metadata.name}</h1>\n )}\n\n {state.isConfiguratorActive ? (\n widget(\"components.molecule.text-input\", {\n className: \"w-100 border-none\",\n\n inputProps: {\n className: \"h-75 border-0 bg-dark text-white\",\n min: 6,\n max: 60,\n },\n\n key: `project-${form.values.metadata.id}-description`,\n multiline: false,\n onChange: form.update({ path: [\"metadata\", \"description\"] }),\n placeholder: \"Project description\",\n value: form.values.metadata.description,\n skipPaddingGap: true,\n })\n ) : (\n <p className=\"m-0 px-2 py-2\">{metadata.description}</p>\n )}\n </div>\n\n <div className=\"d-flex flex-column gap-3 justify-content-between align-items-end h-100\">\n {state.isConfiguratorActive ? (\n widget(\"components.molecule.text-input\", {\n className: \"w-100\",\n\n inputProps: {\n className: \"h-75 text-end border-0 bg-dark text-white\",\n min: 2,\n max: 30,\n },\n\n key: `project-${form.values.metadata.id}-tag`,\n multiline: false,\n onChange: form.update({ path: [\"metadata\", \"tag\"] }),\n placeholder: \"project-tag\",\n value: form.values.metadata.tag,\n skipPaddingGap: true,\n })\n ) : (\n <span\n class=\"badge bg-primary rounded-4 text-decoration-none\"\n style={{ cursor: \"default\" }}\n title=\"DevHub tag\"\n >\n {metadata.tag}\n </span>\n )}\n\n {permissions.can_configure ? (\n <div className=\"d-flex gap-3\">\n {widget(\"components.atom.button\", {\n classNames: {\n root: [\n \"btn-danger\",\n !state.isConfiguratorActive ? \"d-none\" : \"\",\n ].join(\" \"),\n },\n label: \"Cancel\",\n onClick: onCancel,\n })}\n\n {widget(\"components.atom.button\", {\n classNames: {\n root: [\n \"btn-success\",\n !state.isConfiguratorActive ? \"d-none\" : \"\",\n ].join(\" \"),\n adornment: \"bi-check-circle-fill\",\n },\n disabled: !form.hasUnsubmittedChanges,\n label: \"Save\",\n onClick: onSubmit,\n })}\n\n {widget(\"components.atom.button\", {\n classNames: {\n root: [\n \"btn-primary\",\n state.isConfiguratorActive ? \"d-none\" : \"\",\n ].join(\" \"),\n adornment: \"bi bi-gear-fill\",\n },\n label: \"Configure project\",\n onClick: () => configuratorToggle(true),\n })}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nreturn ProjectConfigurator(props);\n"
},
"gigs-board.entity.project.kanban-view": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/gui/attractable\" */\nconst AttractableDiv = styled.div`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n\nconst AttractableLink = styled.a`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n\nconst AttractableImage = styled.img`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n/* END_INCLUDE: \"core/lib/gui/attractable\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst configToColumns = (config) =>\n config.columns.map((column) => {\n const postIds = (\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label: column.tag,\n }) ?? []\n ).reverse();\n\n return {\n ...column,\n\n postIds:\n tags.required.length > 0\n ? postIds.filter(\n (postId) =>\n postTagsToIdSet(tags.required).has(postId) &&\n !postTagsToIdSet(tags.excluded).has(postId)\n )\n : postIds,\n };\n });\n\nconst ProjectKanbanView = ({\n config,\n metadata,\n editorTrigger,\n link,\n permissions,\n}) => {\n const configuration =\n (config ?? null) !== null\n ? config\n : JSON.parse(\n DevHub.useQuery({\n name: \"project_view_config\",\n params: { id: metadata.id },\n }).data ?? JSON.stringify({})\n );\n\n const columns = configToColumns(configuration);\n\n return (\n <div className=\"d-flex flex-column gap-4 py-4\">\n <div className=\"d-flex flex-column align-items-center gap-2\">\n <h5 className=\"h5 d-inline-flex gap-2 m-0\">\n <i className=\"bi bi-kanban-fill\" />\n\n <span>\n {(metadata.title?.length ?? 0) > 0\n ? metadata.title\n : \"Untitled view\"}\n </span>\n </h5>\n\n <p className=\"m-0 py-1 text-secondary text-center\">\n {(metadata.description?.length ?? 0) > 0\n ? metadata.description\n : \"No description provided\"}\n </p>\n </div>\n\n <div className=\"d-flex justify-content-end gap-3\">\n {(link ?? null) !== null ? (\n <>\n <a\n className=\"card-link d-inline-flex me-auto\"\n href={link}\n rel=\"noreferrer\"\n role=\"button\"\n target=\"_blank\"\n title=\"Link to this view\"\n >\n <span className=\"hstack gap-2\">\n <i className=\"bi bi-share\" />\n <span>Open in new tab</span>\n </span>\n </a>\n\n <button\n className=\"btn shadow btn-sm btn-outline-secondary d-inline-flex gap-2\"\n onClick={() => clipboard.writeText(link)}\n >\n <i className=\"bi bi-clipboard-fill\" />\n <span>Copy link</span>\n </button>\n </>\n ) : null}\n\n {permissions.can_configure && typeof editorTrigger === \"function\" ? (\n <button\n className=\"btn shadow btn-sm btn-primary d-inline-flex gap-2\"\n onClick={editorTrigger}\n >\n <i className=\"bi bi-wrench-adjustable-circle-fill\" />\n <span>Configure</span>\n </button>\n ) : null}\n </div>\n\n <div className=\"d-flex gap-3\" style={{ overflowX: \"auto\" }}>\n {columns.length > 0 ? (\n columns.map((column) => (\n <div className=\"col-3\" key={column.id}>\n <div className=\"card rounded-4\">\n <div\n className={[\n \"card-body d-flex flex-column gap-3\",\n \"border border-2 border-secondary rounded-4\",\n ].join(\" \")}\n >\n <h6 className=\"card-title h6 d-flex align-items-center gap-2 m-0\">\n {column.title}\n\n <span className=\"badge rounded-pill bg-secondary\">\n {column.postIds.length}\n </span>\n </h6>\n\n <p class=\"text-secondary m-0\">{column.description}</p>\n\n <div class=\"d-flex flex-column gap-3\">\n {column.postIds.map((postId) =>\n widget(\n [\"entity.project\", configuration.ticket_kind].join(\".\"),\n { id: postId },\n postId\n )\n )}\n </div>\n </div>\n </div>\n </div>\n ))\n ) : (\n <div\n className={[\n \"d-flex align-items-center justify-content-center\",\n \"w-100 text-black-50 opacity-50\",\n ].join(\" \")}\n style={{ height: 384 }}\n >\n No columns were created so far.\n </div>\n )}\n </div>\n </div>\n );\n};\n\nreturn ProjectKanbanView(props);\n"
},
"gigs-board.pages.community.activity": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst CommunityActivityPage = ({ handle }) => {\n const communityData = DevHub.get_community({ handle });\n\n if (communityData === null) {\n return <div>Loading...</div>;\n }\n\n return widget(\"entity.community.layout\", {\n handle,\n\n path: [\n {\n label: \"Communities\",\n pageId: \"communities\",\n },\n ],\n\n title: \"Activity\",\n children:\n communityData !== null ? (\n <div class=\"row\">\n <div class=\"col-md-9\">\n <div class=\"row mb-2\">\n <div class=\"col\">\n <div class=\"d-flex align-items-center justify-content-between\">\n <small class=\"text-muted\">\n <span>Required tags:</span>\n {widget(\"components.atom.tag\", {\n label: communityData.tag,\n })}\n </small>\n {widget(\"components.layout.Controls\", {\n labels: communityData.tag,\n })}\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col\">\n {widget(\"entity.post.List\", { tag: communityData.tag })}\n </div>\n </div>\n </div>\n <div class=\"col-md-3 container-fluid\">\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.community.sidebar`}\n props={{\n label: communityData.tag,\n }}\n />\n </div>\n </div>\n ) : (\n <div>Loading ...</div>\n ),\n });\n};\n\nreturn CommunityActivityPage(props);\n"
},
"gigs-board.pages.community.wiki": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst onMention = (accountId) => (\n <span key={accountId} className=\"d-inline-flex\" style={{ fontWeight: 500 }}>\n <Widget\n src=\"neardevgov.near/widget/ProfileLine\"\n props={{\n accountId: accountId.toLowerCase(),\n hideAccountId: true,\n tooltip: true,\n }}\n />\n </span>\n);\n\nconst WikiPage = ({ handle, id }) => {\n const communityData = DevHub.get_community({ handle });\n\n const { name, content_markdown: text } = communityData?.[`wiki${id}`] ?? {\n name: \"\",\n content_markdown: \"This page doesn't exist.\",\n };\n\n return widget(\"entity.community.layout\", {\n handle,\n title: name,\n\n children:\n communityData !== null ? (\n <div>\n <Markdown className=\"card-text\" {...{ onMention, text }} />\n </div>\n ) : (\n <div className={typeof id !== \"string\" ? \"alert alert-danger\" : \"\"}>\n {typeof id === \"string\"\n ? \"Loading ...\"\n : \"Error: wiki page id not found in URL parameters\"}\n </div>\n ),\n });\n};\n\nreturn WikiPage(props);\n"
},
"gigs-board.feature.post-search.by-tag": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst selectedTags = props.tagQuery?.tag ? [{ name: props.tagQuery.tag }] : [];\n\nconst tags = DevHub.get_all_labels();\n\nif (tags === null) {\n return <div>Loading ...</div>;\n}\n\nconst onChange = (selectedTags) => props.onTagSearch?.(selectedTags[0]?.name);\n\nreturn (\n <Typeahead\n clearButton\n id=\"basic-typeahead-single\"\n labelKey=\"name\"\n options={tags.map((tag) => ({ name: tag }))}\n placeholder=\"Search by tag\"\n selected={selectedTags}\n {...{ onChange }}\n />\n);\n"
},
"gigs-board.pages.community.telegram": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst communityData = DevHub.get_community({ handle: props.handle });\n\nif (communityData === null) {\n return <div>Loading...</div>;\n}\n\nconst Telegram = (\n <div>\n {communityData.telegram_handle.map((tg) => (\n <>\n <iframe\n iframeResizer\n src={\n \"https://j96g3uepe0.execute-api.us-east-1.amazonaws.com/groups-ui/\" +\n tg\n }\n frameborder=\"0\"\n // width and minWidth required by iframeResizer\n style={{\n width: \"1px\",\n minWidth: \"100%\",\n marginTop: \"20px\",\n }}\n ></iframe>\n\n <a href={\"https://t.me/\" + tg} target=\"_blank\">\n {widget(\"components.atom.button\", {\n classNames: {\n root: \"btn-primary\",\n },\n\n label: \"View More\",\n })}\n </a>\n </>\n ))}\n </div>\n);\n\nreturn widget(\"entity.community.layout\", {\n handle: props.handle,\n title: \"Telegram\",\n children: Telegram,\n});\n"
},
"gigs-board.pages.Teams": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst access_info = DevHub.get_access_control_info() ?? null,\n root_members = DevHub.get_root_members() ?? null;\n\nif (!access_info || !root_members) {\n return <div>Loading...</div>;\n}\n\nconst pageContent = (\n <div>\n {widget(\"entity.team.LabelsPermissions\", {\n rules: access_info.rules_list,\n })}\n {Object.keys(root_members).map((member) =>\n widget(\n \"entity.team.TeamInfo\",\n { member, members_list: access_info.members_list },\n member\n )\n )}\n </div>\n);\n\nreturn widget(\"components.template.app-layout\", {\n children: pageContent,\n});\n"
},
"gigs-board.entity.team.LabelsPermissions": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst access_info = DevHub.get_access_control_info() ?? null;\n\nif (!access_info) {\n return <div>Loading...</div>;\n}\n\nconst rules_list = props.rules_list ?? access_info.rules_list;\n\nconst permissionExplainer = (permission) => {\n if (permission.startsWith(\"starts-with:\")) {\n let s = permission.substring(\"starts-with:\".length);\n if (s == \"\") {\n return \"Any label\";\n } else {\n return `Labels that start with \"${s}\"`;\n }\n } else {\n return permission;\n }\n};\n\nreturn (\n <div className=\"card border-secondary\" key=\"labelpermissions\">\n <div className=\"card-header\">\n <i class=\"bi-lock-fill\"> </i>\n <small class=\"text-muted\">Restricted Labels</small>\n </div>\n <ul class=\"list-group list-group-flush\">\n {Object.entries(rules_list).map(([pattern, metadata]) => (\n <li class=\"list-group-item\" key={pattern}>\n <span class=\"badge text-bg-primary\" key={`${pattern}-permission`}>\n {permissionExplainer(pattern)}\n </span>{\" \"}\n {metadata.description}\n </li>\n ))}\n </ul>\n </div>\n);\n"
},
"gigs-board.pages.community.projects": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n/* INCLUDE: \"entity/viewer\" */\nconst access_control_info = DevHub.useQuery({\n name: \"access_control_info\",\n});\n\nconst Viewer = {\n can: {\n editCommunity: (communityData) =>\n Struct.typeMatch(communityData) &&\n (communityData.admins.includes(context.accountId) ||\n Viewer.role.isDevHubModerator),\n },\n\n projectPermissions: (projectId) =>\n Near.view(devHubAccountId, \"get_account_project_permissions\", {\n account_id: context.accountId,\n project_id: parseInt(projectId),\n }) ?? { can_configure: false },\n\n role: {\n isDevHubModerator:\n access_control_info.data === null || access_control_info.isLoading\n ? false\n : access_control_info.data.members_list[\n \"team:moderators\"\n ]?.children?.includes?.(context.accountId) ?? false,\n },\n};\n/* END_INCLUDE: \"entity/viewer\" */\n\nconst projectSchema = {\n name: {\n inputProps: {\n min: 2,\n max: 30,\n placeholder: \"Project name\",\n required: true,\n },\n\n label: \"Name\",\n order: 1,\n },\n\n description: {\n label: \"Description\",\n order: 2,\n\n inputProps: {\n min: 2,\n max: 60,\n placeholder: \"Describe your project in one short sentence.\",\n required: true,\n },\n },\n\n tag: {\n inputProps: {\n min: 2,\n max: 30,\n placeholder: \"awesome-app\",\n required: true,\n },\n\n label: \"Tag\",\n order: 3,\n },\n};\n\nconst CommunityProjectsPage = ({ handle }) => {\n State.init({\n isNewProjectFormDisplayed: false,\n });\n\n const isToolbarHidden = state.isNewProjectFormDisplayed;\n\n const community = DevHub.useQuery({ name: \"community\", params: { handle } });\n\n const community_projects_metadata = DevHub.useQuery({\n name: \"community_projects_metadata\",\n params: { community_handle: handle },\n });\n\n const onNewProjectSubmit = ({ tag, name, description }) =>\n typeof tag === \"string\" &&\n typeof name === \"string\" &&\n typeof description === \"string\"\n ? DevHub.create_project({\n author_community_handle: handle,\n metadata: { tag, name, description },\n })\n : null;\n\n return community_projects_metadata.data === null &&\n community_projects_metadata.isLoading ? (\n <div>Loading...</div>\n ) : (\n widget(\"entity.community.layout\", {\n handle,\n path: [{ label: \"Communities\", pageId: \"communities\" }],\n title: \"Projects\",\n\n children: (\n <div className=\"d-flex flex-column gap-4\">\n {!isToolbarHidden ? (\n <div className=\"d-flex justify-content-end gap-3\">\n {Viewer.can.editCommunity(community.data)\n ? widget(\"components.atom.button\", {\n classNames: { adornment: \"bi bi-tools\" },\n label: \"New project\",\n\n onClick: () =>\n State.update({ isNewProjectFormDisplayed: true }),\n })\n : null}\n </div>\n ) : null}\n\n {state.isNewProjectFormDisplayed &&\n widget(\"components.organism.editor\", {\n fullWidth: true,\n heading: \"New project\",\n isEditorActive: true,\n isEditingAllowed: Viewer.can.editCommunity(community.data),\n\n onCancel: () =>\n State.update({ isNewProjectFormDisplayed: false }),\n\n onChangesSubmit: onNewProjectSubmit,\n submitLabel: \"Create\",\n schema: projectSchema,\n })}\n\n {community_projects_metadata.data === null ? (\n <div\n className=\"d-flex flex-column align-items-center justify-content-center gap-4\"\n style={{ height: 384 }}\n >\n <h5 className=\"h5 d-inline-flex gap-2 m-0\">\n This community doesn't own any projects\n </h5>\n </div>\n ) : (\n <div className=\"d-flex flex-wrap gap-4 w-100 h-100\">\n {community_projects_metadata.data.map((metadata) =>\n widget(\n \"entity.project.card\",\n\n {\n link: href(\"project\", { id: metadata.id, dir: handle }),\n metadata,\n },\n\n metadata.id\n )\n )}\n </div>\n )}\n </div>\n ),\n })\n );\n};\n\nreturn CommunityProjectsPage(props);\n"
},
"gigs-board.feature.post-search.by-author": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst selectedAuthors = props.authorQuery?.author\n ? [{ name: props.authorQuery.author }]\n : [];\n\nconst authors = DevHub.get_all_authors();\n\nif (authors === null) {\n return <div>Loading ...</div>;\n}\n\nconst onChange = (selectedAuthors) =>\n props.onAuthorSearch(selectedAuthors[0]?.name);\n\nreturn (\n <Typeahead\n clearButton\n id=\"basic-typeahead-single\"\n labelKey=\"name\"\n options={authors.map((author) => ({ name: author }))}\n placeholder=\"Search by author\"\n selected={selectedAuthors}\n {...{ onChange }}\n />\n);\n"
},
"gigs-board.feature.project.view-configurator": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/lib/struct\" */\nconst Struct = {\n deepFieldUpdate: (\n node,\n { input, params, path: [nextNodeKey, ...remainingPath], via: toFieldValue }\n ) => ({\n ...node,\n\n [nextNodeKey]:\n remainingPath.length > 0\n ? Struct.deepFieldUpdate(\n Struct.typeMatch(node[nextNodeKey]) ||\n Array.isArray(node[nextNodeKey])\n ? node[nextNodeKey]\n : {\n ...((node[nextNodeKey] ?? null) !== null\n ? { __archivedLeaf__: node[nextNodeKey] }\n : {}),\n },\n\n { input, path: remainingPath, via: toFieldValue }\n )\n : toFieldValue({\n input,\n lastKnownValue: node[nextNodeKey],\n params,\n }),\n }),\n\n isEqual: (input1, input2) =>\n Struct.typeMatch(input1) && Struct.typeMatch(input2)\n ? JSON.stringify(Struct.toOrdered(input1)) ===\n JSON.stringify(Struct.toOrdered(input2))\n : false,\n\n toOrdered: (input) =>\n Object.keys(input)\n .sort()\n .reduce((output, key) => ({ ...output, [key]: input[key] }), {}),\n\n pick: (object, subsetKeys) =>\n Object.fromEntries(\n Object.entries(object ?? {}).filter(([key, _]) =>\n subsetKeys.includes(key)\n )\n ),\n\n typeMatch: (input) =>\n input !== null && typeof input === \"object\" && !Array.isArray(input),\n};\n/* END_INCLUDE: \"core/lib/struct\" */\n/* INCLUDE: \"core/lib/gui/form\" */\nconst defaultFieldUpdate = ({\n input,\n lastKnownValue,\n params: { arrayDelimiter },\n}) => {\n switch (typeof input) {\n case \"boolean\":\n return input;\n\n case \"object\":\n return Array.isArray(input) && typeof lastKnownValue === \"string\"\n ? input.join(arrayDelimiter ?? \",\")\n : input;\n\n case \"string\":\n return Array.isArray(lastKnownValue)\n ? input.split(arrayDelimiter ?? \",\").map((string) => string.trim())\n : input;\n\n default: {\n if ((input ?? null) === null) {\n switch (typeof lastKnownValue) {\n case \"boolean\":\n return !lastKnownValue;\n\n default:\n return lastKnownValue;\n }\n } else return input;\n }\n }\n};\n\nconst useForm = ({ initialValues, stateKey: formStateKey, uninitialized }) => {\n const initialFormState = {\n hasUnsubmittedChanges: false,\n values: initialValues ?? {},\n };\n\n const formState = state[formStateKey] ?? null,\n isSynced = Struct.isEqual(formState?.values ?? {}, initialFormState.values);\n\n const formReset = () =>\n State.update((lastKnownComponentState) => ({\n ...lastKnownComponentState,\n [formStateKey]: initialFormState,\n hasUnsubmittedChanges: false,\n }));\n\n const formUpdate =\n ({ path, via: customFieldUpdate, ...params }) =>\n (fieldInput) => {\n const updatedValues = Struct.deepFieldUpdate(\n formState?.values ?? {},\n\n {\n input: fieldInput?.target?.value ?? fieldInput,\n params,\n path,\n\n via:\n typeof customFieldUpdate === \"function\"\n ? customFieldUpdate\n : defaultFieldUpdate,\n }\n );\n\n State.update((lastKnownComponentState) => ({\n ...lastKnownComponentState,\n\n [formStateKey]: {\n hasUnsubmittedChanges: !Struct.isEqual(\n updatedValues,\n initialFormState.values\n ),\n\n values: updatedValues,\n },\n }));\n };\n\n if (\n !uninitialized &&\n (formState === null ||\n (Object.keys(formState?.values ?? {}).length > 0 &&\n !formState.hasUnsubmittedChanges &&\n !isSynced))\n ) {\n formReset();\n }\n\n return {\n ...(formState ?? initialFormState),\n isSynced,\n reset: formReset,\n update: formUpdate,\n };\n};\n/* END_INCLUDE: \"core/lib/gui/form\" */\n/* INCLUDE: \"core/lib/gui/attractable\" */\nconst AttractableDiv = styled.div`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n\nconst AttractableLink = styled.a`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n\nconst AttractableImage = styled.img`\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n transition: box-shadow 0.6s;\n\n &:hover {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n }\n`;\n/* END_INCLUDE: \"core/lib/gui/attractable\" */\n/* INCLUDE: \"core/lib/uuid\" */\nconst uuid = () =>\n [Date.now().toString(16)]\n .concat(\n Array.from(\n { length: 4 },\n () => Math.floor(Math.random() * 0xffffffff) & 0xffffffff\n ).map((value) => value.toString(16))\n )\n .join(\"-\");\n\nconst withUUIDIndex = (data) => {\n const id = uuid();\n\n return Object.fromEntries([[id, { ...data, id }]]);\n};\n/* END_INCLUDE: \"core/lib/uuid\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n/* INCLUDE: \"entity/viewer\" */\nconst access_control_info = DevHub.useQuery({\n name: \"access_control_info\",\n});\n\nconst Viewer = {\n can: {\n editCommunity: (communityData) =>\n Struct.typeMatch(communityData) &&\n (communityData.admins.includes(context.accountId) ||\n Viewer.role.isDevHubModerator),\n },\n\n projectPermissions: (projectId) =>\n Near.view(devHubAccountId, \"get_account_project_permissions\", {\n account_id: context.accountId,\n project_id: parseInt(projectId),\n }) ?? { can_configure: false },\n\n role: {\n isDevHubModerator:\n access_control_info.data === null || access_control_info.isLoading\n ? false\n : access_control_info.data.members_list[\n \"team:moderators\"\n ]?.children?.includes?.(context.accountId) ?? false,\n },\n};\n/* END_INCLUDE: \"entity/viewer\" */\n\nconst ProjectViewConfiguratorSettings = {\n maxColumnsNumber: 20,\n};\n\nconst CompactContainer = styled.div`\n width: fit-content !important;\n max-width: 100%;\n`;\n\nconst ProjectViewMetadataDefaults = {\n kind: \"kanban-view\",\n title: \"\",\n description: \"\",\n};\n\nconst ProjectViewConfigDefaults = {\n ticket_kind: \"post-ticket\",\n tags: { excluded: [], required: [] },\n columns: [],\n};\n\nconst ProjectViewConfigurator = ({\n link,\n metadata,\n permissions,\n projectId,\n}) => {\n const isNewView = (metadata ?? null) === null;\n\n State.init({\n editingMode: \"form\",\n isEditorActive: isNewView,\n });\n\n const config = DevHub.useQuery({\n name: \"project_view_config\",\n params: { id: metadata.id },\n });\n\n const form = useForm({\n initialValues: {\n metadata: metadata ?? ProjectViewMetadataDefaults,\n config: isNewView ? ProjectViewConfigDefaults : JSON.parse(config.data),\n },\n\n stateKey: \"view\",\n });\n\n const editorToggle = (forcedState) =>\n State.update((lastKnownState) => ({\n ...lastKnownState,\n isEditorActive: forcedState ?? !lastKnownState.isEditorActive,\n }));\n\n const editingModeSwitch = ({ target: { value } }) =>\n State.update((lastKnownState) => ({\n ...lastKnownState,\n editingMode: value,\n }));\n\n const columnsCreateNew = ({ lastKnownValue }) =>\n lastKnownValue.length < ProjectViewConfiguratorSettings.maxColumnsNumber\n ? [\n ...lastKnownValue,\n { id: uuid(), tag: \"\", title: \"New column\", description: \"\" },\n ]\n : lastKnownValue;\n\n const columnsDeleteById =\n (targetId) =>\n ({ lastKnownValue }) =>\n lastKnownValue.filter(({ id }) => targetId !== id);\n\n const onCancel = () => {\n form.reset();\n editorToggle(false);\n };\n\n const onSubmit = () =>\n DevHub[isNewView ? \"create_project_view\" : \"update_project_view\"]({\n view: {\n metadata: { ...form.values.metadata, project_id: parseInt(projectId) },\n config: JSON.stringify(form.values.config),\n },\n });\n\n const formElement =\n Object.keys(form.values).length > 0 ? (\n <>\n <div className=\"d-flex gap-3 flex-column flex-lg-row\">\n {widget(\"components.molecule.text-input\", {\n className: \"flex-shrink-0\",\n key: `${form.values.metadata.id ?? \"new-view\"}-title`,\n label: \"Name\",\n onChange: form.update({ path: [\"metadata\", \"title\"] }),\n placeholder: \"NEAR Protocol NEPs\",\n value: form.values.metadata.title,\n })}\n </div>\n\n <CompactContainer>\n <div className=\"d-flex gap-3 flex-column flex-lg-row\">\n {widget(\"components.molecule.text-input\", {\n className: \"flex-shrink-0\",\n format: \"comma-separated\",\n key: `${form.values.metadata.id ?? \"new-view\"}-tags-required`,\n label: \"Search terms for all the tags MUST be presented in posts\",\n onChange: form.update({ path: [\"config\", \"tags\", \"required\"] }),\n placeholder: \"near-protocol-neps, \",\n value: form.values.config.tags.required.join(\", \"),\n })}\n </div>\n\n <div className=\"d-flex gap-3 flex-column flex-lg-row\">\n {widget(\"components.molecule.text-input\", {\n className: \"flex-shrink-0\",\n format: \"comma-separated\",\n key: `${form.values.metadata.id ?? \"new-view\"}-tags-excluded`,\n\n label:\n \"Search terms for all the tags MUST NOT be presented in posts\",\n\n onChange: form.update({ path: [\"config\", \"tags\", \"excluded\"] }),\n placeholder: \"near-protocol-neps, \",\n value: form.values.config.tags.excluded.join(\", \"),\n })}\n </div>\n </CompactContainer>\n\n {widget(\"components.molecule.text-input\", {\n className: \"w-100\",\n inputProps: { className: \"h-75\" },\n key: `${form.values.metadata.id ?? \"new-view\"}-description`,\n label: \"Description\",\n multiline: true,\n onChange: form.update({ path: [\"metadata\", \"description\"] }),\n placeholder: \"Latest NEAR Enhancement Proposals by status.\",\n value: form.values.metadata.description,\n })}\n\n <div className=\"d-flex align-items-center justify-content-between\">\n <span className=\"d-inline-flex gap-2 m-0\">\n <i className=\"bi bi-list-task\" />\n\n <span>\n {`Columns ( max. ${ProjectViewConfiguratorSettings.maxColumnsNumber} )`}\n </span>\n </span>\n </div>\n\n <div className=\"d-flex flex-column align-items-center gap-3\">\n {form.values.config.columns.map(\n ({ id, description, tag, title }, columnIdx) => (\n <div\n className=\"d-flex gap-3 border border-secondary rounded-4 p-3 w-100\"\n key={id}\n >\n <div className=\"d-flex flex-column gap-1 w-100\">\n {widget(\"components.molecule.text-input\", {\n className: \"flex-grow-1\",\n key: `column-${id}-title`,\n label: \"Title\",\n\n onChange: form.update({\n path: [\"config\", \"columns\", columnIdx, \"title\"],\n }),\n\n placeholder: \"👀 Review\",\n value: title,\n })}\n\n {widget(\"components.molecule.text-input\", {\n className: \"flex-grow-1\",\n key: `column-${id}-description`,\n label: \"Description\",\n\n onChange: form.update({\n path: [\"config\", \"columns\", columnIdx, \"description\"],\n }),\n\n placeholder:\n \"NEPs that need a review by Subject Matter Experts.\",\n\n value: description,\n })}\n\n {widget(\"components.molecule.text-input\", {\n key: `${\n form.values.metadata.id ?? \"new-view\"\n }-column-${id}-tag`,\n\n label: \"Tag\",\n\n onChange: form.update({\n path: [\"config\", \"columns\", columnIdx, \"tag\"],\n }),\n\n placeholder: \"\",\n value: tag,\n })}\n </div>\n\n <div\n className=\"d-flex flex-column gap-3 border-start p-3 pe-0\"\n style={{ marginTop: -16, marginBottom: -16 }}\n >\n <button\n className=\"btn btn-outline-danger shadow\"\n onClick={form.update({\n path: [\"config\", \"columns\"],\n via: columnsDeleteById(id),\n })}\n title=\"Delete column\"\n >\n <i className=\"bi bi-trash-fill\" />\n </button>\n </div>\n </div>\n )\n )}\n </div>\n </>\n ) : null;\n\n return !isNewView && config.data === null ? (\n <div>Loading...</div>\n ) : (\n <div className=\"d-flex flex-column gap-4 py-4\">\n {state.isEditorActive && Object.keys(form.values).length > 0 ? (\n <AttractableDiv className=\"d-flex flex-column gap-3 p-3 w-100 rounded-4\">\n <div className=\"d-flex align-items-center justify-content-between gap-3\">\n <h5 className=\"h5 d-inline-flex gap-2 m-0\">\n <i className=\"bi bi-wrench-adjustable-circle-fill\" />\n <span>View configuration</span>\n </h5>\n\n {widget(\"components.molecule.button-switch\", {\n currentValue: state.editingMode,\n key: \"editingMode\",\n onChange: editingModeSwitch,\n\n options: [\n { label: \"Form\", value: \"form\" },\n { label: \"JSON\", value: \"JSON\" },\n ],\n\n title: \"Editing mode selection\",\n })}\n </div>\n\n {state.editingMode === \"form\" ? (\n formElement\n ) : (\n <div className=\"d-flex flex-column flex-grow-1 border-0 bg-transparent w-100\">\n <textarea\n className=\"form-control\"\n disabled\n rows=\"12\"\n type=\"text\"\n value={JSON.stringify(form.values ?? {}, null, \"\\t\")}\n />\n </div>\n )}\n\n <div className=\"d-flex align-items-center justify-content-end gap-3\">\n <button\n className=\"btn shadow btn-outline-secondary d-inline-flex gap-2 me-auto\"\n disabled={\n form.values.columns.length >=\n ProjectViewConfiguratorSettings.maxColumnsNumber\n }\n onClick={form.update({\n path: [\"config\", \"columns\"],\n via: columnsCreateNew,\n })}\n >\n <i className=\"bi bi-plus-lg\" />\n <span>New column</span>\n </button>\n\n <button\n className=\"btn btn-outline-danger border-0 d-inline-flex gap-2 align-items-center\"\n onClick={onCancel}\n style={{ width: \"fit-content\" }}\n >\n <span>Cancel</span>\n </button>\n\n <button\n disabled={!form.hasUnsubmittedChanges}\n className=\"btn shadow btn-success d-inline-flex gap-2 align-items-center\"\n onClick={onSubmit}\n style={{ width: \"fit-content\" }}\n >\n <i className=\"bi bi-cloud-arrow-up-fill\" />\n <span>Save</span>\n </button>\n </div>\n </AttractableDiv>\n ) : null}\n\n {widget([\"entity.project\", form.values.metadata.kind].join(\".\"), {\n ...form.values,\n editorTrigger: () => editorToggle(true),\n link,\n permissions,\n })}\n </div>\n );\n};\n\nreturn ProjectViewConfigurator(props);\n"
},
"gigs-board.pages.community.sidebar": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nif (!props.label) {\n return (\n <div class=\"alert alert-danger\" role=\"alert\">\n Error: handle is required\n </div>\n );\n}\n\nconst CommunitySummary = (community) => {\n const socialLinks = [\n ...(community.website_url\n ? [\n {\n href: community.website_url,\n iconClass: \"bi bi-globe\",\n name: community.website_url,\n },\n ]\n : []),\n ...(community.github_handle\n ? [\n {\n href: `https://github.com/${github_handle}`,\n iconClass: \"bi bi-github\",\n name: community.github_handle,\n },\n ]\n : []),\n ...(community.twitter_handle\n ? [\n {\n href: `https://twitter.com/NearSocial_`,\n iconClass: \"bi bi-twitter\",\n name: community.twitter_handle,\n },\n ]\n : []),\n ...(community.telegram_handle\n ? [\n {\n href: `https://t.me/${community.telegram_handle}`,\n iconClass: \"bi bi-telegram\",\n name: community.telegram_handle,\n },\n ]\n : []),\n ];\n return (\n <div style={{ top: \"0\", left: \"0\" }}>\n <Markdown text={community.bio_markdown} />\n <small class=\"text-muted mb-3\">\n {widget(\"components.atom.tag\", { label: community.tag })}\n </small>\n <div className=\"mt-3\">\n {socialLinks.map((link, index) => (\n <a\n className={`mt-1 btn-outline-light text-reset border-0 d-flex align-items-center`}\n href={link.href}\n style={{ marginLeft: index !== 0 ? \"0px\" : \"0px\" }}\n key={link.href}\n >\n <i className={link.iconClass}></i>\n <span className=\"ms-1\">{link.name}</span>\n </a>\n ))}\n </div>\n </div>\n );\n};\n\nconst UserList = (users) => {\n return (\n <div>\n {users.map((user, i) => (\n <div className={`row ${i < users.length - 1 ? \"mb-3\" : \"\"}`}>\n <div class=\"col-9\">\n <span\n key={user}\n className=\"d-inline-flex\"\n style={{ fontWeight: 500 }}\n >\n {widget(\"components.molecule.profile-card\", {\n accountId: user,\n })}\n </span>\n </div>\n </div>\n ))}\n </div>\n );\n};\n\nconst Sidebar = ({ label }) => {\n const community = DevHub.get_community({ handle: label });\n const root_members = DevHub.get_root_members() ?? null;\n\n if (root_members === null || community == null) {\n return <div>Loading...</div>;\n }\n\n const moderators = root_members[\"team:moderators\"].children;\n\n return (\n <div class=\"col-md-12 d-flex flex-column align-items-end\">\n {widget(\"components.molecule.tile\", {\n heading: community.tag[0].toUpperCase() + community.tag.slice(1),\n minHeight: 0,\n children: CommunitySummary(community),\n noBorder: true,\n borderRadius: \"rounded\",\n })}\n <hr style={{ width: \"100%\", borderTop: \"1px solid #00000033\" }} />\n {widget(\"components.molecule.tile\", {\n heading: \"Group Moderators\",\n minHeight: 0,\n children: UserList(moderators),\n noBorder: true,\n borderRadius: \"rounded\",\n })}\n </div>\n );\n};\n\nreturn Sidebar(props);\n"
},
"gigs-board.pages.Feed": {
"": "/* INCLUDE: \"common.jsx\" */\nconst nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nfunction widget(widgetName, widgetProps, key) {\n widgetProps = {\n ...widgetProps,\n nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId,\n nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId,\n referral: props.referral,\n };\n\n return (\n <Widget\n src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.${widgetName}`}\n props={widgetProps}\n key={key}\n />\n );\n}\n\nfunction href(widgetName, linkProps) {\n linkProps = { ...linkProps };\n\n if (props.nearDevGovGigsContractAccountId) {\n linkProps.nearDevGovGigsContractAccountId =\n props.nearDevGovGigsContractAccountId;\n }\n\n if (props.nearDevGovGigsWidgetsAccountId) {\n linkProps.nearDevGovGigsWidgetsAccountId =\n props.nearDevGovGigsWidgetsAccountId;\n }\n\n if (props.referral) {\n linkProps.referral = props.referral;\n }\n\n const linkPropsQuery = Object.entries(linkProps)\n .filter(([_key, nullable]) => (nullable ?? null) !== null)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n\n return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${\n linkPropsQuery ? \"?\" : \"\"\n }${linkPropsQuery}`;\n}\n/* END_INCLUDE: \"common.jsx\" */\n/* INCLUDE: \"core/adapter/dev-hub\" */\nconst devHubAccountId =\n props.nearDevGovGigsContractAccountId ||\n (context.widgetSrc ?? \"devgovgigs.near\").split(\"/\", 1)[0];\n\nconst DevHub = {\n edit_community_github: ({ handle, github }) =>\n Near.call(devHubAccountId, \"edit_community_github\", { handle, github }) ??\n null,\n\n create_project: ({ author_community_handle, metadata }) =>\n Near.call(devHubAccountId, \"create_project\", {\n author_community_handle,\n metadata,\n }) ?? null,\n\n update_project_metadata: ({ metadata }) =>\n Near.call(devHubAccountId, \"update_project_metadata\", { metadata }) ?? null,\n\n get_project_views_metadata: ({ project_id }) =>\n Near.view(devHubAccountId, \"get_project_views_metadata\", { project_id }) ??\n null,\n\n create_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"create_project_view\", { view }) ?? null,\n\n update_project_view: ({ view }) =>\n Near.call(devHubAccountId, \"update_project_view\", { view }) ?? null,\n\n delete_project_view: ({ id }) =>\n Near.call(devHubAccountId, \"get_project_view\", { id }) ?? null,\n\n get_access_control_info: () =>\n Near.view(devHubAccountId, \"get_access_control_info\") ?? null,\n\n get_all_authors: () => Near.view(devHubAccountId, \"get_all_authors\") ?? null,\n\n get_all_communities: () =>\n Near.view(devHubAccountId, \"get_all_communities\") ?? null,\n\n get_all_labels: () => Near.view(devHubAccountId, \"get_all_labels\") ?? null,\n\n get_community: ({ handle }) =>\n Near.view(devHubAccountId, \"get_community\", { handle }) ?? null,\n\n get_post: ({ post_id }) =>\n Near.view(devHubAccountId, \"get_post\", { post_id }) ?? null,\n\n get_posts_by_author: ({ author }) =>\n Near.view(devHubAccountId, \"get_posts_by_author\", { author }) ?? null,\n\n get_posts_by_label: ({ label }) =>\n Near.view(nearDevGovGigsContractAccountId, \"get_posts_by_label\", {\n label,\n }) ?? null,\n\n get_root_members: () =>\n Near.view(devHubAccountId, \"get_root_members\") ?? null,\n\n useQuery: ({ name, params }) => {\n const initialState = { data: null, error: null, isLoading: true };\n\n const cacheState = useCache(\n () =>\n Near.asyncView(devHubAccountId, [\"get\", name].join(\"_\"), params ?? {})\n .then((response) => ({\n ...initialState,\n data: response ?? null,\n isLoading: false,\n }))\n .catch((error) => ({\n ...initialState,\n error: props?.error ?? error,\n isLoading: false,\n })),\n\n JSON.stringify({ name, params }),\n { subscribe: true }\n );\n\n return cacheState === null ? initialState : cacheState;\n },\n};\n/* END_INCLUDE: \"core/adapter/dev-hub\" */\n\nconst Gradient = styled.div`\n {\n height: 250px;\n text-align: center;\n background: radial-gradient(\n circle,\n rgba(29, 55, 57, 1) 30%,\n rgba(24, 24, 24, 1) 80%\n );\n\n font-family: Arial, sans-serif;\n }\n\n .text-primary-gradient {\n color: #53fdca;\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(#8e76ba, #1ed2f0);\n -webkit-background-clip: text;\n background-clip: text;\n }\n\n .subtitle-above {\n font-size: 18px;\n letter-spacing: 1px;\n font-family: Courier, monospace;\n }\n\n .subtitle-below {\n font-size: 16px;\n }\n\n .slogan {\n font-weight: 600;\n font-size: 60px;\n }\n`;\n\nconst banner = (\n <div className=\"d-flex flex-column\">\n <Gradient className=\"d-flex flex-column justify-content-center\">\n <div className=\"subtitle-above text-white opacity-75 mb-2\">\n A decentralized community of\n </div>\n\n <h1 className=\"mb-3 text-white slogan\">\n <span className=\"text-primary-gradient\">NEAR </span>Developers\n </h1>\n\n <div className=\"subtitle-below text-white opacity-75\">\n Share your ideas, match solutions, and access support and funding.\n </div>\n </Gradient>\n\n <div className=\"d-flex flex-column gap-4 py-4\">\n <div className=\"d-flex justify-content-between\">\n <h5 className=\"h5 m-0\">Featured Communities</h5>\n </div>\n\n <div className=\"d-flex gap-4 justify-content-between\">\n {(DevHub.get_all_communities() ?? [])\n .filter(({ handle }) =>\n [\n \"zero-knowledge\",\n \"protocol\",\n \"contract-standards\",\n \"education\",\n ].includes(handle)\n )\n .map((community) =>\n widget(\n \"entity.community.card\",\n { ...community, format: \"medium\" },\n community.handle\n )\n )}\n </div>\n </div>\n\n <div className=\"h5 pb-4\">Activity</div>\n </div>\n);\n\nconst FeedPage = ({ author, recency, tag }) => {\n State.init({\n initial: { author, tag },\n author,\n tag,\n });\n\n // When rerendered with different props, State will be preserved, so we need to update the state when we detect that the props have changed.\n if (tag !== state.initial.tag || author !== state.initial.author) {\n State.update((lastKnownState) => ({\n ...lastKnownState,\n initial: { author, tag },\n author,\n tag,\n }));\n }\n\n const onTagSearch = (tag) => {\n State.update((lastKnownState) => ({ ...lastKnownState, tag }));\n };\n\n const onAuthorSearch = (author) => {\n State.update((lastKnownState) => ({ ...lastKnownState, author }));\n };\n\n return widget(\"components.template.app-layout\", {\n banner,\n\n children: widget(\"feature.post-search.panel\", {\n author: state.author,\n authorQuery: { author: state.author },\n children: widget(\"components.layout.Controls\"),\n onAuthorSearch,\n onTagSearch,\n recency,\n tag: state.tag,\n tagQuery: { tag: state.tag },\n transactionHashes: props.transactionHashes,\n }),\n });\n};\n\nreturn FeedPage(props);\n"
}
}
}
}
}1 automatic refund step from the network not shown.
This page reads FastNEAR's public transaction index and stores nothing. This command asks a NEAR archival node for the same transaction and needs no keys.
curl -s https://archival-rpc.testnet.fastnear.com -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tx","params":{"tx_hash":"GDRUZiyaw5xrwPhDEE36cUixdHCJMG9i59PyXwjucdii","sender_account_id":"testhub2.akaia.testnet","wait_until":"FINAL"}}'Vouch has its own page because testnet.nearblocks.io stopped indexing on 27 Sep 2026, so it can't show newer transactions.