"home": "let { sharedBlockHeight, tagShared, isTest, accountId } = props;\\n\\nconst sbtWhiteList = [\\n \\\"fractal.i-am-human.near - class 1\\\",\\n \\\"community.i-am-human.near - class 1\\\",\\n \\\"community.i-am-human.near - class 2\\\",\\n \\\"community.i-am-human.near - class 3\\\",\\n \\\"elections.ndc-gwg.near - class 2\\\",\\n \\\"elections.ndc-gwg.near - class 3\\\",\\n \\\"elections.ndc-gwg.near - class 4\\\",\\n \\\"public\\\",\\n];\\n\\nfunction createSbtOptions() {\\n return sbtWhiteList.map((option, i) => {\\n const title = \\\"\\\";\\n\\n if (option === \\\"fractal.i-am-human.near - class 1\\\") {\\n title = \\\"General\\\";\\n } else if (option === \\\"community.i-am-human.near - class 1\\\") {\\n title = \\\"OG\\\";\\n } else if (option === \\\"community.i-am-human.near - class 2\\\") {\\n title = \\\"Contributor\\\";\\n } else if (option === \\\"community.i-am-human.near - class 3\\\") {\\n title = \\\"Core Contributor\\\";\\n } else if (option === \\\"elections.ndc-gwg.near - class 2\\\") {\\n title = \\\"HoM\\\";\\n } else if (option === \\\"elections.ndc-gwg.near - class 3\\\") {\\n title = \\\"CoA\\\";\\n } else if (option === \\\"elections.ndc-gwg.near - class 4\\\") {\\n title = \\\"TC\\\";\\n } else {\\n title = \\\"Public\\\";\\n }\\n\\n if (i == 0) {\\n //The first options is always the default one\\n return { title, default: true, value: option };\\n } else {\\n return { title, value: option };\\n }\\n });\\n}\\n\\n// const componentsOwner =\\n// \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb\\\";\\nconst componentsOwner = \\\"gatitos.testnet\\\";\\n\\nconst authorForWidget = \\\"gatitos.testnet\\\";\\n// const authorForWidget =\\n// \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb\\\";\\n// const authorForWidget = \\\"gatitos.testnet\\\";\\n// const authorForWidget = \\\"gatitos.testnet\\\";\\n\\nconst configWidget = \\\"home\\\";\\n\\nconst widgets = {\\n thisForum: `${authorForWidget}/widget/${configWidget}`,\\n\\n //Editable widgets\\n ndcForum: `${componentsOwner}/widget/NDC.Forum`,\\n create: `${componentsOwner}/widget/NDC.Forum.Create`,\\n header: `${componentsOwner}/widget/NDC.NavBar`,\\n showArticlesList: `${componentsOwner}/widget/NDC.Forum.AllArticlesList`,\\n showArticlesListSortedByAuthors: `${componentsOwner}/widget/NDC.AllArticlesSortByAuthors`,\\n articlesByAuthorCard: `${componentsOwner}/widget/NDC.ArticlesByAuthorCard`,\\n generalCard: `${componentsOwner}/widget/NDC.GeneralCard`,\\n articleView: `${componentsOwner}/widget/NDC.ArticleView`,\\n reactions: `${componentsOwner}/widget/NDC.Reactions`,\\n addComment: `${componentsOwner}/widget/NDC.AddComment`,\\n commentView: `${componentsOwner}/widget/NDC.CommentView`,\\n upVoteButton: `${componentsOwner}/widget/NDC.UpVoteButton`,\\n profileShortInlineBlock: `${componentsOwner}/widget/Profile.ShortInlineBlock`,\\n tagsEditor: `${componentsOwner}/widget/TagsEditor`,\\n kanbanBoard: `${componentsOwner}/widget/NDC.KanbanBoard`,\\n compactPost: `${componentsOwner}/widget/NDC.CompactPost`,\\n\\n //Libs\\n libSBT: `sayalot.near/widget/lib.SBT`,\\n libComment: `sayalot.near/widget/lib.comment`,\\n libArticle: `sayalot.near/widget/lib.article`,\\n libEmojis: `sayalot.near/widget/lib.emojis`,\\n libUpVotes: `sayalot.near/widget/lib.upVotes`,\\n\\n //Standard widgets\\n fasterTextInput: `f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb/widget/fasterTextInput`,\\n markownEditorIframe: `f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb/widget/MarkdownEditorIframe`,\\n styledComponents: \\\"rubycop.near/widget/NDC.StyledComponents\\\",\\n newStyledComponents: {\\n Element: {\\n Badge: \\\"nearui.near/widget/Element.Badge\\\",\\n User: \\\"nearui.near/widget/Element.User\\\",\\n },\\n Feedback: {\\n Spinner: \\\"nearui.near/widget/Feedback.Spinner\\\",\\n },\\n Input: {\\n Button: \\\"nearui.near/widget/Input.Button\\\",\\n Checkbox: \\\"nearui.near/widget/Input.Checkbox\\\",\\n Select: \\\"nearui.near/widget/Input.Select\\\",\\n },\\n },\\n socialMarkdown: \\\"mob.near/widget/SocialMarkdown\\\",\\n profileOverlayTrigger: \\\"mob.near/widget/Profile.OverlayTrigger\\\",\\n profileImage: \\\"mob.near/widget/ProfileImage\\\",\\n wikiOnSocialDB_TooltipProfiles: `testwiki.near/widget/WikiOnSocialDB_TooltipProfiles`,\\n};\\n\\nconst brand = {\\n brandName: \\\"Community Voice\\\",\\n logoHref:\\n \\\"https://ipfs.near.social/ipfs/bafkreifhkslni6dlocxya35vjft3fefk2am5uzkagmjjzobdjqlhrnbjz4\\\",\\n logoRemWidth: 12,\\n logoRemHeight: 4,\\n};\\n\\nconst baseActions = {\\n commentBaseAction: \\\"communityVoiceComment\\\",\\n articlesBaseAction: \\\"communityVoiceArticle\\\",\\n upVoteBaseAction: \\\"communityVoiceUpVote\\\",\\n reactionBaseAction: \\\"communityVoiceReaction\\\",\\n};\\n\\nconst kanbanColumns = [\\\"Open\\\", \\\"Claimed\\\", \\\"In Work\\\", \\\"Closed\\\"];\\n\\nconst kanbanRequiredTags = [];\\nconst kanbanExcludedTags = [];\\n\\nreturn (\\n <Widget\\n src={widgets.ndcForum}\\n props={{\\n sharedBlockHeight,\\n tagShared,\\n isTest,\\n accountId,\\n sbtWhiteList,\\n authorForWidget,\\n widgets,\\n brand,\\n baseActions,\\n createSbtOptions,\\n kanbanColumns,\\n kanbanRequiredLabels,\\n kanbanExcludedLabels,\\n }}\\n />\\n);\\n",
"SayALot": "let { sharedBlockHeight, tagShared, isTest, accountId } = props;\\n\\nconst sbtWhiteList = [\\n \\\"fractal.i-am-human.near - class 1\\\",\\n \\\"community.i-am-human.near - class 1\\\",\\n \\\"community.i-am-human.near - class 2\\\",\\n \\\"community.i-am-human.near - class 3\\\",\\n \\\"elections.ndc-gwg.near - class 2\\\",\\n \\\"elections.ndc-gwg.near - class 3\\\",\\n \\\"elections.ndc-gwg.near - class 4\\\",\\n \\\"public\\\",\\n];\\n\\nfunction createSbtOptions() {\\n return sbtWhiteList.map((option, i) => {\\n const title = \\\"\\\";\\n\\n if (option === \\\"fractal.i-am-human.near - class 1\\\") {\\n title = \\\"General\\\";\\n } else if (option === \\\"community.i-am-human.near - class 1\\\") {\\n title = \\\"OG\\\";\\n } else if (option === \\\"community.i-am-human.near - class 2\\\") {\\n title = \\\"Contributor\\\";\\n } else if (option === \\\"community.i-am-human.near - class 3\\\") {\\n title = \\\"Core Contributor\\\";\\n } else if (option === \\\"elections.ndc-gwg.near - class 2\\\") {\\n title = \\\"HoM\\\";\\n } else if (option === \\\"elections.ndc-gwg.near - class 3\\\") {\\n title = \\\"CoA\\\";\\n } else if (option === \\\"elections.ndc-gwg.near - class 4\\\") {\\n title = \\\"TC\\\";\\n } else {\\n title = \\\"Public\\\";\\n }\\n\\n if (i == 0) {\\n //The first options is always the default one\\n return { title, default: true, value: option };\\n } else {\\n return { title, value: option };\\n }\\n });\\n}\\n\\n// const componentsOwner =\\n// \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb\\\";\\nconst componentsOwner = \\\"gatitos.testnet\\\";\\n\\nconst authorForWidget = \\\"gatitos.testnet\\\";\\n// const authorForWidget =\\n// \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb\\\";\\n// const authorForWidget = \\\"gatitos.testnet\\\";\\n// const authorForWidget = \\\"gatitos.testnet\\\";\\n\\nconst configWidget = \\\"SayALot\\\";\\n\\nconst widgets = {\\n thisForum: `${authorForWidget}/widget/${configWidget}`,\\n\\n //Editable widgets\\n ndcForum: `${componentsOwner}/widget/NDC.Forum`,\\n create: `${componentsOwner}/widget/NDC.Forum.Create`,\\n header: `${componentsOwner}/widget/NDC.NavBar`,\\n showArticlesList: `${componentsOwner}/widget/NDC.Forum.AllArticlesList`,\\n showArticlesListSortedByAuthors: `${componentsOwner}/widget/NDC.AllArticlesSortByAuthors`,\\n articlesByAuthorCard: `${componentsOwner}/widget/NDC.ArticlesByAuthorCard`,\\n generalCard: `${componentsOwner}/widget/NDC.GeneralCard`,\\n articleView: `${componentsOwner}/widget/NDC.ArticleView`,\\n reactions: `${componentsOwner}/widget/NDC.Reactions`,\\n addComment: `${componentsOwner}/widget/NDC.AddComment`,\\n commentView: `${componentsOwner}/widget/NDC.CommentView`,\\n upVoteButton: `${componentsOwner}/widget/NDC.UpVoteButton`,\\n profileShortInlineBlock: `${componentsOwner}/widget/Profile.ShortInlineBlock`,\\n tagsEditor: `${componentsOwner}/widget/TagsEditor`,\\n kanbanBoard: `${componentsOwner}/widget/NDC.KanbanBoard`,\\n compactPost: `${componentsOwner}/widget/NDC.CompactPost`,\\n\\n //Libs\\n libSBT: `sayalot.near/widget/lib.SBT`,\\n libComment: `sayalot.near/widget/lib.comment`,\\n libArticle: `sayalot.near/widget/lib.article`,\\n libEmojis: `sayalot.near/widget/lib.emojis`,\\n libUpVotes: `sayalot.near/widget/lib.upVotes`,\\n\\n //Standard widgets\\n fasterTextInput: `f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb/widget/fasterTextInput`,\\n markownEditorIframe: `f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb/widget/MarkdownEditorIframe`,\\n styledComponents: \\\"rubycop.near/widget/NDC.StyledComponents\\\",\\n newStyledComponents: {\\n Element: {\\n Badge: \\\"nearui.near/widget/Element.Badge\\\",\\n User: \\\"nearui.near/widget/Element.User\\\",\\n },\\n Feedback: {\\n Spinner: \\\"nearui.near/widget/Feedback.Spinner\\\",\\n },\\n Input: {\\n Button: \\\"nearui.near/widget/Input.Button\\\",\\n Checkbox: \\\"nearui.near/widget/Input.Checkbox\\\",\\n Select: \\\"nearui.near/widget/Input.Select\\\",\\n },\\n },\\n socialMarkdown: \\\"mob.near/widget/SocialMarkdown\\\",\\n profileOverlayTrigger: \\\"mob.near/widget/Profile.OverlayTrigger\\\",\\n profileImage: \\\"mob.near/widget/ProfileImage\\\",\\n wikiOnSocialDB_TooltipProfiles: `testwiki.near/widget/WikiOnSocialDB_TooltipProfiles`,\\n};\\n\\nconst brand = {\\n brandName: \\\"Say a lot\\\",\\n logoHref:\\n \\\"https://ipfs.near.social/ipfs/bafkreiaqxa4st4vp4rtq2iyobdgqe5tpfg55mmyvfg25upd2qplcxylyfi\\\",\\n logoRemWidth: 6,\\n logoRemHeight: 6,\\n};\\n\\nconst baseActions = {\\n commentBaseAction: \\\"sayALotComment\\\",\\n articlesBaseAction: \\\"sayALotArticle\\\",\\n upVoteBaseAction: \\\"sayALotUpVote\\\",\\n reactionBaseAction: \\\"sayALotReaction\\\",\\n};\\n\\nconst kanbanColumns = [\\\"Open\\\", \\\"Claimed\\\", \\\"In Work\\\", \\\"Closed\\\"];\\n\\nconst kanbanRequiredTags = [];\\nconst kanbanExcludedTags = [];\\n\\nreturn (\\n <Widget\\n src={widgets.ndcForum}\\n props={{\\n sharedBlockHeight,\\n tagShared,\\n isTest,\\n accountId,\\n sbtWhiteList,\\n authorForWidget,\\n widgets,\\n brand,\\n baseActions,\\n createSbtOptions,\\n kanbanColumns,\\n kanbanRequiredLabels,\\n kanbanExcludedLabels,\\n }}\\n />\\n);\\n",
"lib.SBT": "const {\\r\\n isTest,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n callLibs,\\r\\n baseAction,\\r\\n callerWidget,\\r\\n widgets,\\r\\n} = props;\\r\\nconst libName = \\\"SBT\\\"; // EDIT: set lib name\\r\\nconst functionsToCall = functionsToCallByLibrary[libName];\\r\\n\\r\\nlet resultFunctionsToCallByLibrary = Object.assign(\\r\\n {},\\r\\n functionsToCallByLibrary\\r\\n);\\r\\nlet resultFunctionsToCall = [];\\r\\n\\r\\n// START LIB CALLS SECTION\\r\\n// This lib does not call any other lib\\r\\n// END LIB CALLS SECTION\\r\\n\\r\\nfunction log(message) {\\r\\n console.log(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction logError(message) {\\r\\n console.error(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction libStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\n// START LIB FUNCTIONS: EDIT set functions you need\\r\\nfunction isValidUser(props) {\\r\\n const { accountId, sbtsNames } = props;\\r\\n const userSBTs = Near.view(\\r\\n \\\"registry.i-am-human.near\\\",\\r\\n \\\"sbt_tokens_by_owner\\\",\\r\\n {\\r\\n account: accountId,\\r\\n }\\r\\n );\\r\\n const isSBTContractLoaded = userSBTs !== null;\\r\\n if (!isSBTContractLoaded) {\\r\\n return undefined;\\r\\n }\\r\\n\\r\\n const sbtsData = sbtsNames.map((sbt) => {\\r\\n const data = sbt.split(\\\" - class \\\");\\r\\n return { name: data[0], classNumber: Number(data[1]) };\\r\\n });\\r\\n const usersValidityBySBT = {};\\r\\n sbtsNames.forEach((sbtName, index) => {\\r\\n const isUserValid =\\r\\n isSBTContractLoaded &&\\r\\n userSBTs.find((userSbt) => {\\r\\n return (\\r\\n userSbt[0] === sbtsData[index].name &&\\r\\n userSbt[1].find(\\r\\n (sbtExtraData) =>\\r\\n sbtExtraData.metadata[\\\"class\\\"] === sbtsData[index].classNumber\\r\\n )\\r\\n );\\r\\n }) !== undefined;\\r\\n usersValidityBySBT[sbtName] = isUserValid || sbtName === \\\"public\\\";\\r\\n });\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"isValidUser\\\";\\r\\n });\\r\\n\\r\\n // return true;\\r\\n return { ...usersValidityBySBT };\\r\\n}\\r\\n\\r\\nfunction getLoggedUserSbts(props) {\\r\\n const { accountId } = props;\\r\\n const userSBTs = Near.view(\\r\\n \\\"registry.i-am-human.near\\\",\\r\\n \\\"sbt_tokens_by_owner\\\",\\r\\n {\\r\\n account: accountId,\\r\\n }\\r\\n );\\r\\n\\r\\n if (userSBTs) {\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"getLoggedUserSbts\\\";\\r\\n });\\r\\n }\\r\\n\\r\\n return userSBTs;\\r\\n}\\r\\n// END LIB FUNCTIONS\\r\\n\\r\\n// EDIT: set functions you want to export\\r\\nfunction callFunction(call) {\\r\\n if (call.functionName === \\\"isValidUser\\\") {\\r\\n return isValidUser(call.props);\\r\\n } else if (call.functionName === \\\"getLoggedUserSbts\\\") {\\r\\n return getLoggedUserSbts(call.props);\\r\\n }\\r\\n}\\r\\n\\r\\nif (functionsToCall && functionsToCall.length > 0) {\\r\\n const updateObj = Object.assign({}, functionsToCallByLibrary);\\r\\n resultFunctionsToCall = [...functionsToCall];\\r\\n functionsToCall.forEach((call) => {\\r\\n updateObj[call.key] = callFunction(call);\\r\\n });\\r\\n\\r\\n resultFunctionsToCallByLibrary[libName] = resultFunctionsToCall;\\r\\n updateObj.functionsToCallByLibrary = resultFunctionsToCallByLibrary;\\r\\n stateUpdate(updateObj);\\r\\n}\\r\\n\\r\\nreturn <></>;\\r\\n",
"NDC.Forum": "// NDC.Forum\\r\\n\\r\\n//===============================================INITIALIZATION=====================================================\\r\\nlet {\\r\\n sharedBlockHeight,\\r\\n tagShared,\\r\\n isTest,\\r\\n accountId,\\r\\n sbtWhiteList,\\r\\n authorForWidget,\\r\\n widgets,\\r\\n brand,\\r\\n baseActions,\\r\\n createSbtOptions,\\r\\n kanbanColumns,\\r\\n kanbanRequiredTags,\\r\\n kanbanExcludedTags,\\r\\n} = props;\\r\\nsharedBlockHeight = Number(sharedBlockHeight);\\r\\n\\r\\nconst initSbtsNames = [sbtWhiteList[0]];\\r\\n\\r\\nconst sbtsNames = state.sbt;\\r\\n\\r\\nconst initLibsCalls = {\\r\\n article: [\\r\\n {\\r\\n functionName: \\\"getArticles\\\",\\r\\n key: \\\"articles\\\",\\r\\n props: {\\r\\n env: isTest ? \\\"test\\\" : \\\"prod\\\",\\r\\n sbtsNames: sbtWhiteList,\\r\\n },\\r\\n },\\r\\n {\\r\\n functionName: \\\"canUserCreateArticle\\\",\\r\\n key: \\\"canLoggedUserCreateArticle\\\",\\r\\n props: {\\r\\n accountId: context.accountId,\\r\\n sbtsNames: sbtWhiteList,\\r\\n },\\r\\n },\\r\\n ],\\r\\n};\\r\\n\\r\\naccountId = context.accountId;\\r\\n\\r\\nconst tabs = {\\r\\n SHOW_ARTICLES_LIST: { id: 0 },\\r\\n SHOW_ARTICLE: { id: 1 },\\r\\n ARTICLE_WORKSHOP: { id: 2 },\\r\\n SHOW_ARTICLES_LIST_BY_AUTHORS: { id: 3 },\\r\\n SHOW_KANBAN_VIEW: { id: 4 },\\r\\n};\\r\\n\\r\\nfunction getInitialFilter() {\\r\\n if (sharedBlockHeight) {\\r\\n return {\\r\\n parameterName: \\\"getPost\\\",\\r\\n parameterValue: sharedBlockHeight,\\r\\n };\\r\\n } else if (tagShared) {\\r\\n return {\\r\\n parameterName: \\\"tag\\\",\\r\\n parameterValue: tagShared,\\r\\n };\\r\\n } else if (authorShared) {\\r\\n return {\\r\\n parameterName: \\\"author\\\",\\r\\n parameterValue: authorShared,\\r\\n };\\r\\n } else {\\r\\n return {\\r\\n parameterName: \\\"\\\",\\r\\n };\\r\\n }\\r\\n}\\r\\n\\r\\nfunction getInitialTabId() {\\r\\n if (sharedBlockHeight) {\\r\\n return tabs.SHOW_ARTICLE.id;\\r\\n } else {\\r\\n return tabs.SHOW_ARTICLES_LIST.id;\\r\\n }\\r\\n}\\r\\n\\r\\n// userSBTs object type\\r\\n// {\\r\\n// user: string,\\r\\n// credentials: {}\\r\\n// }\\r\\n\\r\\nState.init({\\r\\n displayedTabId: getInitialTabId(),\\r\\n articleToRenderData: {},\\r\\n filterBy: getInitialFilter(),\\r\\n authorsProfiles: [],\\r\\n functionsToCallByLibrary: initLibsCalls,\\r\\n sbtsNames: initSbtsNames,\\r\\n sbts: initSbtsNames,\\r\\n firstRender: !isNaN(sharedBlockHeight),\\r\\n usersSBTs: [],\\r\\n});\\r\\n\\r\\nconst usersSBTs = state.usersSBTs;\\r\\n\\r\\nlet newLibsCalls = state.functionsToCallByLibrary;\\r\\n\\r\\nState.update({ libsCalls: newLibsCalls });\\r\\n\\r\\n//=============================================END INITIALIZATION===================================================\\r\\n\\r\\n//==================================================CONSTS==========================================================\\r\\n\\r\\nconst libSrcArray = [widgets.libArticle];\\r\\n\\r\\nconst profile = props.profile ?? Social.getr(`${accountId}/profile`);\\r\\nif (profile === null) {\\r\\n return \\\"Loading\\\";\\r\\n}\\r\\n\\r\\nlet authorProfile = {};\\r\\nif (state.filterBy.parameterName == \\\"author\\\") {\\r\\n authorProfile = Social.getr(`${state.filterBy.parameterValue}/profile`);\\r\\n}\\r\\n\\r\\nconst navigationPills = [\\r\\n { id: tabs.SHOW_ARTICLES_LIST.id, title: \\\"Articles\\\" },\\r\\n { id: tabs.SHOW_ARTICLES_LIST_BY_AUTHORS.id, title: \\\"Authors\\\" },\\r\\n { id: tabs.SHOW_KANBAN_VIEW.id, title: \\\"Kanban view\\\" },\\r\\n];\\r\\n\\r\\nconst navigationButtons = [\\r\\n // { id: tabs.ARTICLE_WORKSHOP.id, title: \\\"+Create article\\\" },\\r\\n];\\r\\n\\r\\nconst sbts = state.sbts;\\r\\n\\r\\nconst initialBodyAtCreation = state.editArticleData.body;\\r\\nconst canLoggedUserCreateArticle = state.canLoggedUserCreateArticle[sbts[0]];\\r\\n\\r\\n//=================================================END CONSTS=======================================================\\r\\n\\r\\n//=================================================GET DATA=========================================================\\r\\nconst finalArticles = state.articles;\\r\\n\\r\\nfunction getArticlesToRender() {\\r\\n if (sharedBlockHeight && finalArticles && state.firstRender) {\\r\\n let finalArticlesSbts = Object.keys(finalArticles);\\r\\n let allArticles = [];\\r\\n\\r\\n finalArticlesSbts.forEach((sbt) => {\\r\\n allArticles = [...allArticles, ...finalArticles[sbt]];\\r\\n });\\r\\n\\r\\n return allArticles;\\r\\n } else {\\r\\n return finalArticles[sbts[0]];\\r\\n }\\r\\n}\\r\\n\\r\\nconst articlesToRender = getArticlesToRender() ?? [];\\r\\n\\r\\nfunction filterArticlesByTag(tag, articles) {\\r\\n return articles.filter((article) => {\\r\\n return article.tags.includes(tag);\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterArticlesByAuthor(author, articles) {\\r\\n return articles.filter((article) => {\\r\\n return article.author === author;\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterOnePost(blockHeight, articles) {\\r\\n if (articles) {\\r\\n return articles.filter((article) => article.blockHeight === blockHeight);\\r\\n } else {\\r\\n return [];\\r\\n }\\r\\n}\\r\\n\\r\\nif (state.filterBy.parameterName === \\\"tag\\\") {\\r\\n articlesToRender = filterArticlesByTag(\\r\\n state.filterBy.parameterValue,\\r\\n articlesToRender\\r\\n );\\r\\n} else if (state.filterBy.parameterName === \\\"author\\\") {\\r\\n articlesToRender = filterArticlesByAuthor(\\r\\n state.filterBy.parameterValue,\\r\\n articlesToRender\\r\\n );\\r\\n} else if (state.filterBy.parameterName === \\\"getPost\\\") {\\r\\n articlesToRender = filterOnePost(\\r\\n state.filterBy.parameterValue,\\r\\n articlesToRender\\r\\n );\\r\\n\\r\\n if (articlesToRender.length > 0) {\\r\\n State.update({ articleToRenderData: articlesToRender[0] });\\r\\n }\\r\\n}\\r\\n//===============================================END GET DATA=======================================================\\r\\n\\r\\n//=============================================STYLED COMPONENTS====================================================\\r\\nconst CallLibrary = styled.div`\\r\\n display: block;\\r\\n`;\\r\\n\\r\\nconst ShareInteractionGeneralContainer = styled.div`\\r\\n position: fixed;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n top: 0;\\r\\n left: 0;\\r\\n height: 100vh;\\r\\n width: 100vw;\\r\\n backdrop-filter: blur(10px);\\r\\n z-index: 1;\\r\\n`;\\r\\n\\r\\nconst ShareInteractionMainContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n background: white;\\r\\n padding: 1rem;\\r\\n border-radious: 12px;\\r\\n`;\\r\\n\\r\\nconst ClosePopUpContainer = styled.div`\\r\\n display: flex; \\r\\n flex-direction: row-reverse;\\r\\n`;\\r\\n\\r\\nconst CloseIcon = styled.div`\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst PopUpDescription = styled.p`\\r\\n color: #474D55;\\r\\n`;\\r\\n\\r\\nconst ShowLinkShared = styled.div`\\r\\n display: flex;\\r\\n justify-content: space-between;\\r\\n align-items: center;\\r\\n background-color: #F2F6FA;\\r\\n padding: 1rem 2rem;\\r\\n border-radius: 17px;\\r\\n`;\\r\\n\\r\\nconst LinkShared = styled.span`\\r\\n color: #0065FF;\\r\\n word-wrap: anywhere;\\r\\n`;\\r\\n\\r\\nconst ClipboardContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n margin-left: 0.5rem;\\r\\n min-width: 2.5rem;\\r\\n`;\\r\\n\\r\\nconst ClipboardIcon = styled.i`\\r\\n color: ${state.linkCopied ? \\\"#0065FF\\\" : \\\"black\\\"};\\r\\n transition: color 0.3s linear;\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst CopiedFeedback = styled.span`\\r\\n font-size: 0.7rem;\\r\\n color: #6c757d;\\r\\n`;\\r\\n\\r\\nconst SmallButton = styled.button`\\r\\nposition: relative;\\r\\n border: 0;\\r\\n background: transparent;\\r\\n width: 35px;\\r\\n height: 35px;\\r\\n`;\\r\\n//===========================================END STYLED COMPONENTS==================================================\\r\\n\\r\\n//================================================COMPONENTS========================================================\\r\\nconst renderShareInteraction = () => {\\r\\n return (\\r\\n <ShareInteractionGeneralContainer>\\r\\n <ShareInteractionMainContainer>\\r\\n <ClosePopUpContainer>\\r\\n <CloseIcon\\r\\n className=\\\"bi bi-x\\\"\\r\\n onClick={() =>\\r\\n State.update({ showShareModal: false, linkCopied: false })\\r\\n }\\r\\n ></CloseIcon>\\r\\n </ClosePopUpContainer>\\r\\n <h3>Share</h3>\\r\\n <PopUpDescription>Use this link to share the article</PopUpDescription>\\r\\n <ShowLinkShared>\\r\\n <LinkShared>{getLink()}</LinkShared>\\r\\n <ClipboardContainer>\\r\\n <ClipboardIcon\\r\\n className=\\\"bi-clipboard\\\"\\r\\n onClick={() => {\\r\\n clipboard.writeText(getLink());\\r\\n State.update({ linkCopied: true });\\r\\n }}\\r\\n ></ClipboardIcon>\\r\\n {state.linkCopied && <CopiedFeedback>Copied!</CopiedFeedback>}\\r\\n </ClipboardContainer>\\r\\n </ShowLinkShared>\\r\\n </ShareInteractionMainContainer>\\r\\n </ShareInteractionGeneralContainer>\\r\\n );\\r\\n};\\r\\n\\r\\nconst renderSelectorLabel = () => {\\r\\n return (\\r\\n <>\\r\\n <span>Post & Filter Topics by SBT</span>\\r\\n\\r\\n <SmallButton>\\r\\n <OverlayTrigger\\r\\n placement=\\\"top\\\"\\r\\n overlay={\\r\\n <Tooltip>\\r\\n <p className=\\\"m-0\\\">Topics for Community SBT Holders.</p>\\r\\n <p className=\\\"m-0\\\">Anyone can post to Public.</p>\\r\\n </Tooltip>\\r\\n }\\r\\n >\\r\\n <i className=\\\"bi bi-info-circle\\\"></i>\\r\\n </OverlayTrigger>\\r\\n </SmallButton>\\r\\n </>\\r\\n );\\r\\n};\\r\\n//==============================================END COMPONENTS======================================================\\r\\n\\r\\n//=================================================FUNCTIONS========================================================\\r\\n\\r\\nfunction getValidEditArticleDataTags() {\\r\\n let tags = state.editArticleData.tags;\\r\\n let newFormatTags = {};\\r\\n\\r\\n tags &&\\r\\n tags.map((tag) => {\\r\\n newFormatTags[tag] = \\\"\\\";\\r\\n });\\r\\n return newFormatTags;\\r\\n}\\r\\n\\r\\nconst initialCreateState = {\\r\\n title: state.editArticleData.title ?? \\\"\\\",\\r\\n articleBody: state.editArticleData.body ?? initialBodyAtCreation,\\r\\n tags: state.editArticleData.tags ? getValidEditArticleDataTags() : {},\\r\\n libsCalls: { comment: {}, article: {}, emojis: {}, upVotes: {} },\\r\\n sbts: [sbtWhiteList[0]],\\r\\n};\\r\\n\\r\\nfunction mainStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\nfunction handleOpenArticle(articleToRenderData) {\\r\\n State.update({\\r\\n displayedTabId: tabs.SHOW_ARTICLE.id,\\r\\n articleToRenderData,\\r\\n editArticleData: undefined,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction handleEditArticle(articleData) {\\r\\n State.update({\\r\\n displayedTabId: tabs.ARTICLE_WORKSHOP.id,\\r\\n editArticleData: articleData,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction handleFilterArticles(filter) {\\r\\n State.update({\\r\\n filterBy: {\\r\\n parameterName: filter.filterBy,\\r\\n parameterValue: filter.value,\\r\\n },\\r\\n displayedTabId: tabs.SHOW_ARTICLES_LIST.id,\\r\\n editArticleData: undefined,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction handleBackButton() {\\r\\n props.editArticleData\\r\\n ? State.update({\\r\\n displayedTabId: tabs.SHOW_ARTICLE.id,\\r\\n editArticleData: undefined,\\r\\n firstRender: false,\\r\\n filterBy: {\\r\\n parameterName: \\\"\\\",\\r\\n parameterValue: undefined,\\r\\n handleBackClicked: true,\\r\\n },\\r\\n })\\r\\n : State.update({\\r\\n displayedTabId: tabs.SHOW_ARTICLES_LIST.id,\\r\\n articleToRenderData: {},\\r\\n editArticleData: undefined,\\r\\n firstRender: false,\\r\\n filterBy: {\\r\\n parameterName: \\\"\\\",\\r\\n parameterValue: undefined,\\r\\n handleBackClicked: true,\\r\\n },\\r\\n });\\r\\n}\\r\\n\\r\\nfunction handleGoHomeButton() {\\r\\n State.update({\\r\\n displayedTabId: tabs.SHOW_ARTICLES_LIST.id,\\r\\n articleToRenderData: {},\\r\\n filterBy: { parameterName: \\\"\\\", parameterValue: {} },\\r\\n editArticleData: undefined,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction handlePillNavigation(navegateTo) {\\r\\n State.update({ displayedTabId: navegateTo, editArticleData: undefined });\\r\\n}\\r\\n\\r\\nfunction callLibs(\\r\\n src,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n extraProps,\\r\\n callerWidget\\r\\n) {\\r\\n return (\\r\\n <Widget\\r\\n src={src}\\r\\n props={{\\r\\n mainStateUpdate,\\r\\n isTest,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n callLibs,\\r\\n widgets,\\r\\n callerWidget,\\r\\n ...extraProps,\\r\\n usersSBTs,\\r\\n }}\\r\\n />\\r\\n );\\r\\n}\\r\\n\\r\\nfunction handleSbtSelection(selectedSbt) {\\r\\n State.update({\\r\\n sbts: [selectedSbt],\\r\\n });\\r\\n}\\r\\n\\r\\nfunction handleShareButton(showShareModal, sharedElement) {\\r\\n //showShareModal is a boolean\\r\\n //sharedElement is and object like the example: {\\r\\n // type: string,\\r\\n // value: number||string,\\r\\n // }\\r\\n State.update({ showShareModal, sharedElement });\\r\\n}\\r\\n\\r\\nfunction getLink() {\\r\\n return `https://near.social/${widgets.thisForum}?${isTest && \\\"isTest=t&\\\"}${\\r\\n state.sharedElement.type\\r\\n }=${state.sharedElement.value}`;\\r\\n}\\r\\n\\r\\n//===============================================END FUNCTIONS======================================================\\r\\nif (!context.accountId) {\\r\\n return (\\r\\n <>\\r\\n <Widget\\r\\n src={widgets.header}\\r\\n props={{\\r\\n isTest,\\r\\n mainStateUpdate,\\r\\n handleGoHomeButton,\\r\\n handlePillNavigation,\\r\\n brand,\\r\\n pills: navigationPills,\\r\\n navigationButtons,\\r\\n displayedTabId: state.displayedTabId,\\r\\n handleFilterArticles,\\r\\n filterParameter: state.filterBy.parameterName,\\r\\n handleBackButton,\\r\\n tabs,\\r\\n sbtsNames,\\r\\n }}\\r\\n />\\r\\n <h2>Log in to see the articles</h2>\\r\\n </>\\r\\n );\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n {state.showShareModal && renderShareInteraction()}\\r\\n <Widget\\r\\n src={widgets.header}\\r\\n props={{\\r\\n isTest,\\r\\n mainStateUpdate,\\r\\n handleGoHomeButton,\\r\\n handlePillNavigation,\\r\\n brand,\\r\\n pills: navigationPills,\\r\\n navigationButtons,\\r\\n displayedTabId: state.displayedTabId,\\r\\n handleFilterArticles,\\r\\n filterParameter: state.filterBy.parameterName,\\r\\n handleBackButton,\\r\\n tabs,\\r\\n sbtsNames,\\r\\n }}\\r\\n />\\r\\n {(state.displayedTabId == tabs.SHOW_ARTICLES_LIST.id ||\\r\\n state.displayedTabId == tabs.SHOW_KANBAN_VIEW.id) && (\\r\\n <div className=\\\"my-3 col-lg-8 col-md-8 col-sm-12\\\">\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Select}\\r\\n props={{\\r\\n label: renderSelectorLabel(),\\r\\n value: sbts[0],\\r\\n onChange: handleSbtSelection,\\r\\n options: createSbtOptions(),\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n )}\\r\\n {articlesToRender && state.displayedTabId == tabs.SHOW_ARTICLES_LIST.id && (\\r\\n <Widget\\r\\n src={widgets.showArticlesList}\\r\\n props={{\\r\\n isTest,\\r\\n articlesToRender,\\r\\n tabs,\\r\\n widgets,\\r\\n addressForArticles,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n authorForWidget,\\r\\n initialCreateState,\\r\\n editArticleData: state.editArticleData,\\r\\n handleEditArticle,\\r\\n showCreateArticle: canLoggedUserCreateArticle,\\r\\n sbtWhiteList,\\r\\n sbts,\\r\\n handleShareButton,\\r\\n canLoggedUserCreateArticles,\\r\\n filterBy: state.filterBy,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n {state.articleToRenderData.title &&\\r\\n state.displayedTabId == tabs.SHOW_ARTICLE.id && (\\r\\n <Widget\\r\\n src={widgets.articleView}\\r\\n props={{\\r\\n isTest,\\r\\n widgets,\\r\\n handleFilterArticles,\\r\\n articleToRenderData: state.articleToRenderData,\\r\\n authorForWidget,\\r\\n handleEditArticle,\\r\\n handleShareButton,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n\\r\\n {state.displayedTabId == tabs.SHOW_ARTICLES_LIST_BY_AUTHORS.id && (\\r\\n <Widget\\r\\n src={widgets.showArticlesListSortedByAuthors}\\r\\n props={{\\r\\n isTest,\\r\\n finalArticles,\\r\\n tabs,\\r\\n widgets,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n authorForWidget,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n\\r\\n {state.displayedTabId == tabs.ARTICLE_WORKSHOP.id && (\\r\\n <Widget\\r\\n src={widgets.create}\\r\\n props={{\\r\\n isTest,\\r\\n addressForArticles,\\r\\n authorForWidget,\\r\\n mainStateUpdate,\\r\\n widgets,\\r\\n initialBody: initialBodyAtCreation,\\r\\n initialCreateState,\\r\\n editArticleData: state.editArticleData,\\r\\n handleFilterArticles,\\r\\n handleEditArticle,\\r\\n sbtWhiteList,\\r\\n sbts,\\r\\n canLoggedUserCreateArticles,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n\\r\\n {state.displayedTabId === tabs.SHOW_KANBAN_VIEW.id && (\\r\\n <Widget\\r\\n src={widgets.kanbanBoard}\\r\\n props={{\\r\\n isTest,\\r\\n widgets,\\r\\n kanbanColumns,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n handleShareButton,\\r\\n authorForWidget,\\r\\n finalArticles,\\r\\n sbts,\\r\\n kanbanRequiredTags,\\r\\n kanbanExcludedTags,\\r\\n baseActions,\\r\\n callLibs,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n\\r\\n <CallLibrary>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n mainStateUpdate,\\r\\n state.functionsToCallByLibrary,\\r\\n { baseAction: baseActions.articlesBaseAction, kanbanColumns },\\r\\n \\\"NDC.Forum\\\"\\r\\n );\\r\\n })}\\r\\n </CallLibrary>\\r\\n </>\\r\\n);\\r\\n",
"NDC.NavBar": "// NDC.NavBar\\r\\n\\r\\nconst {\\r\\n handleGoHomeButton,\\r\\n handlePillNavigation,\\r\\n brand,\\r\\n pills,\\r\\n navigationButtons,\\r\\n isTest,\\r\\n displayedTabId,\\r\\n writersWhiteList,\\r\\n handleFilterArticles,\\r\\n filterParameter,\\r\\n handleBackButton,\\r\\n tabs,\\r\\n sbtsNames,\\r\\n} = props;\\r\\n\\r\\nfunction stateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n/*\\r\\n======================================================PILLS EXAMPLE====================================================\\r\\n *Note: the first pill allways has to be the first one displayed*\\r\\n pills: [{\\r\\n id: string,\\r\\n title: string,\\r\\n }] \\r\\n============(When modified to be web app we should delete action to replace it with a propper State.update)============\\r\\n\\r\\n======================================================BRAND EXAMPLE====================================================\\r\\n brand: {\\r\\n homePageId: string,\\r\\n brandName: string,\\r\\n logoHref: string,\\r\\n logoRemWidth: number/string,\\r\\n logoRemHeight: number/string,\\r\\n }\\r\\n \\r\\n============(When modified to be web app we should delete action to replace it with a propper State.update)============\\r\\n*/\\r\\n\\r\\nconst loggedUserAccountId = context.accountId;\\r\\n\\r\\n// const canLoggedUserCreateArticle = state.canLoggedUserCreateArticle;\\r\\n\\r\\nconst logoRemWidth = brand.logoRemWidth\\r\\n ? brand.logoRemWidth + \\\"rem\\\"\\r\\n : undefined;\\r\\nconst logoRemHeight = brand.logoRemHeight\\r\\n ? brand.logoRemHeight + \\\"rem\\\"\\r\\n : undefined;\\r\\n\\r\\nif (\\r\\n !stateUpdate ||\\r\\n !(displayedTabId + \\\"\\\") ||\\r\\n !pills ||\\r\\n (brand && (!brand.logoHref || !(brand.homePageId + \\\"\\\")))\\r\\n) {\\r\\n const crucialPropMissingMsg = \\\"The following crucial props are missing:\\\";\\r\\n return (\\r\\n <div>\\r\\n <h3 className=\\\"text-danger\\\">{crucialPropMissingMsg}</h3>\\r\\n <ul>\\r\\n {!stateUpdate && <li className=\\\"text-danger\\\">stateUpdate</li>}\\r\\n\\r\\n {!(displayedTabId + \\\"\\\") && (\\r\\n <li className=\\\"text-danger\\\">displayedTabId</li>\\r\\n )}\\r\\n\\r\\n {!pills && <li className=\\\"text-danger\\\">pills</li>}\\r\\n\\r\\n {brand && !brand.logoHref && (\\r\\n <li className=\\\"text-danger\\\">brand.logoHref</li>\\r\\n )}\\r\\n\\r\\n {brand && !(brand.homePageId + \\\"\\\") && (\\r\\n <li className=\\\"text-danger\\\">brand.homePageId</li>\\r\\n )}\\r\\n </ul>\\r\\n </div>\\r\\n );\\r\\n}\\r\\n\\r\\n//============================================Styled components==================================================\\r\\nconst BrandLogoContainer = styled.div`\\r\\n width: ${logoRemWidth ?? \\\"4rem\\\"};\\r\\n height: ${logoRemHeight ?? \\\"4rem\\\"};\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst activeColor = \\\"#9333EA\\\";\\r\\n\\r\\nconst Pill = styled.div`\\r\\n font-family: system-ui;\\r\\n font-weight: 500;\\r\\n font-size: 1.2rem;\\r\\n line-height: 24px;\\r\\n color: black;\\r\\n cursor: pointer;\\r\\n user-select: none;\\r\\n\\r\\n &:hover {\\r\\n color: ${activeColor};\\r\\n }\\r\\n`;\\r\\n\\r\\nconst StylessATag = styled.a`\\r\\n &:hover {\\r\\n text-decoration: none;\\r\\n }\\r\\n`;\\r\\n\\r\\nconst BackButton = styled.div`\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst CallLibrary = styled.div`\\r\\n display: none;\\r\\n`;\\r\\n//============================================End styled components==============================================\\r\\n\\r\\n//=================================================Components====================================================\\r\\n\\r\\nconst renderButton = (button, i) => {\\r\\n return (\\r\\n <Widget\\r\\n src=\\\"rubycop.near/widget/NDC.StyledComponents\\\"\\r\\n props={{\\r\\n Button: {\\r\\n size: \\\"big\\\",\\r\\n onClick: () => {\\r\\n handlePillNavigation(button.id);\\r\\n State.update({\\r\\n selectedButtonIndex: i,\\r\\n });\\r\\n },\\r\\n text: button.title,\\r\\n className:\\r\\n state.selectedButtonIndex == i ? \\\"primary light\\\" : \\\"primary dark\\\",\\r\\n },\\r\\n }}\\r\\n />\\r\\n );\\r\\n};\\r\\n//==============================================End components===================================================\\r\\n\\r\\n//==================================================FUNCTIONS====================================================\\r\\n\\r\\nfunction realHandleBackButton() {\\r\\n State.update({\\r\\n selectedButtonIndex: undefined,\\r\\n });\\r\\n\\r\\n handleBackButton();\\r\\n}\\r\\n\\r\\nfunction realHandleGoHome() {\\r\\n State.update({\\r\\n selectedButtonIndex: undefined,\\r\\n });\\r\\n handleGoHomeButton();\\r\\n}\\r\\n\\r\\n//================================================END FUNCTIONS===================================================\\r\\nreturn (\\r\\n <>\\r\\n <div className=\\\"navbar navbar-expand-md border-bottom mb-3\\\">\\r\\n <div className=\\\"container-fluid\\\">\\r\\n {brand && (\\r\\n <BrandLogoContainer\\r\\n className=\\\"navbar-brand text-decoration-none\\\"\\r\\n onClick={handleGoHomeButton}\\r\\n >\\r\\n <Widget\\r\\n src=\\\"mob.near/widget/Image\\\"\\r\\n props={{\\r\\n // image: metadata.image,\\r\\n className: \\\"w-100 h-100\\\",\\r\\n style: {\\r\\n objectFit: \\\"cover\\\",\\r\\n },\\r\\n thumbnail: false,\\r\\n fallbackUrl: brand.logoHref,\\r\\n alt: brand.brandName ?? \\\"\\\",\\r\\n }}\\r\\n />\\r\\n </BrandLogoContainer>\\r\\n )}\\r\\n <button\\r\\n className=\\\"navbar-toggler\\\"\\r\\n type=\\\"button\\\"\\r\\n data-bs-toggle=\\\"collapse\\\"\\r\\n data-bs-target=\\\"#navbarNav\\\"\\r\\n aria-controls=\\\"navbarNav\\\"\\r\\n aria-expanded=\\\"false\\\"\\r\\n aria-label=\\\"Toggle navigation\\\"\\r\\n >\\r\\n <span className=\\\"navbar-toggler-icon\\\"></span>\\r\\n </button>\\r\\n <div\\r\\n className=\\\"collapse navbar-collapse justify-content-center\\\"\\r\\n id=\\\"navbarNav\\\"\\r\\n >\\r\\n <ul className=\\\"navbar-nav\\\">\\r\\n {pills &&\\r\\n pills.map((pill, i) => {\\r\\n return !(pill.id + \\\"\\\") || !pill.title ? (\\r\\n <p className=\\\"text-danger border\\\">Pill passed wrong</p>\\r\\n ) : (\\r\\n <li className=\\\"nav-item\\\">\\r\\n <Pill\\r\\n style={\\r\\n pill.id === displayedTabId ? { color: activeColor } : {}\\r\\n }\\r\\n onClick={() => {\\r\\n //First one is set to be de \\\"Home\\\" one\\r\\n if (pill.id == 0) {\\r\\n const filter = { filterBy: \\\"\\\" };\\r\\n handleFilterArticles(filter);\\r\\n } else {\\r\\n handlePillNavigation(pill.id);\\r\\n }\\r\\n State.update({\\r\\n selectedButtonIndex: undefined,\\r\\n });\\r\\n }}\\r\\n className={`nav-link ${\\r\\n pill.id === displayedTabId\\r\\n ? \\\"active text-decoration-underline\\\"\\r\\n : \\\"text-decoration-none\\\"\\r\\n } `}\\r\\n >\\r\\n {pill.title}\\r\\n </Pill>\\r\\n </li>\\r\\n );\\r\\n })}\\r\\n {/*navigationButtons &&\\r\\n loggedUserAccountId &&\\r\\n canLoggedUserCreateArticle &&\\r\\n navigationButtons.map((button, i) => {\\r\\n return !(button.id + \\\"\\\") || !button.title ? (\\r\\n <p className=\\\"text-danger border\\\">Button passed wrong</p>\\r\\n ) : (\\r\\n <div className=\\\"d-block d-md-none\\\">\\r\\n {renderButton(button, i)}\\r\\n </div>\\r\\n );\\r\\n })*/}\\r\\n </ul>\\r\\n </div>\\r\\n {\\r\\n // navigationButtons &&\\r\\n // loggedUserAccountId &&\\r\\n // canLoggedUserCreateArticle &&\\r\\n // navigationButtons.map((button, i) => {\\r\\n // return !(button.id + \\\"\\\") || !button.title ? (\\r\\n // <p className=\\\"text-danger border\\\">Button passed wrong</p>\\r\\n // ) : (\\r\\n // <div className=\\\"d-none d-md-block\\\">{renderButton(button, i)}</div>\\r\\n // );\\r\\n // })\\r\\n }\\r\\n </div>\\r\\n </div>\\r\\n\\r\\n {(((filterParameter == \\\"tag\\\" || filterParameter == \\\"author\\\") &&\\r\\n displayedTabId == tabs.SHOW_ARTICLES_LIST.id) ||\\r\\n displayedTabId == tabs.SHOW_ARTICLE.id ||\\r\\n displayedTabId == tabs.ARTICLE_WORKSHOP.id ||\\r\\n displayedTabId == tabs.SHOW_ARTICLES_LIST_BY_AUTHORS.id) && (\\r\\n <BackButton\\r\\n style={{ cursor: \\\"pointer\\\" }}\\r\\n onClick={\\r\\n displayedTabId == tabs.SHOW_ARTICLE.id ||\\r\\n (editArticleData && tabs.ARTICLE_WORKSHOP.id)\\r\\n ? realHandleBackButton\\r\\n : realHandleGoHome\\r\\n }\\r\\n className=\\\"my-3\\\"\\r\\n >\\r\\n <i className=\\\"bi bi-chevron-left mr-2\\\"></i>\\r\\n Back\\r\\n </BackButton>\\r\\n )}\\r\\n </>\\r\\n);\\r\\n",
"TagsEditor": "const tagsPattern = \\\"*/profile/tags/*\\\";\\r\\nconst placeholder = props.placeholder ?? \\\"Tags\\\";\\r\\nconst initialTagsObject = props.initialTagsObject || {};\\r\\n\\r\\nconst tagsOptions = {};\\r\\n\\r\\nconst normalizeTag = (tag) =>\\r\\n tag\\r\\n .replaceAll(/[- \\\\.]/g, \\\"_\\\")\\r\\n .replaceAll(/[^\\\\w]+/g, \\\"\\\")\\r\\n .replaceAll(/_+/g, \\\"-\\\")\\r\\n .replace(/^-+/, \\\"\\\")\\r\\n .replace(/-+$/, \\\"\\\")\\r\\n .toLowerCase()\\r\\n .trim(\\\"-\\\");\\r\\n\\r\\nconst tagsCount = {};\\r\\n\\r\\nconst processTagsObject = (obj) => {\\r\\n Object.entries(obj).forEach((kv) => {\\r\\n if (typeof kv[1] === \\\"object\\\") {\\r\\n processTagsObject(kv[1]);\\r\\n } else {\\r\\n const tag = normalizeTag(kv[0]);\\r\\n tagsCount[tag] = (tagsCount[tag] || 0) + 1;\\r\\n }\\r\\n });\\r\\n};\\r\\n\\r\\nconst getTags = () => {\\r\\n processTagsObject(tagsOptions);\\r\\n const tags = Object.entries(tagsCount);\\r\\n tags.sort((a, b) => b[1] - a[1]);\\r\\n return tags.map((t) => ({\\r\\n name: t[0],\\r\\n count: t[1],\\r\\n }));\\r\\n};\\r\\n\\r\\nif (!state.allTags) {\\r\\n initState({\\r\\n allTags: getTags(),\\r\\n tags: Object.keys(initialTagsObject).map((tag) => ({\\r\\n name: normalizeTag(tag),\\r\\n })),\\r\\n originalTags: Object.fromEntries(\\r\\n Object.keys(initialTagsObject).map((tag) => [tag, null])\\r\\n ),\\r\\n id: `tags-selector-${Date.now()}`,\\r\\n });\\r\\n}\\r\\n\\r\\nconst setTags = (tags) => {\\r\\n props.forceClear && props.stateUpdate({ clearTags: false });\\r\\n tags = tags.map((o) => {\\r\\n o.name = normalizeTag(o.name);\\r\\n return o;\\r\\n });\\r\\n State.update({ tags });\\r\\n if (props.setTagsObject) {\\r\\n props.setTagsObject(\\r\\n Object.assign({}, Object.fromEntries(tags.map((tag) => [tag.name, \\\"\\\"])))\\r\\n );\\r\\n }\\r\\n};\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n <Typeahead\\r\\n id={state.id}\\r\\n multiple\\r\\n labelKey=\\\"name\\\"\\r\\n onChange={setTags}\\r\\n options={state.allTags}\\r\\n placeholder={placeholder}\\r\\n selected={props.forceClear ? [] : state.tags}\\r\\n positionFixed\\r\\n allowNew\\r\\n />\\r\\n {props.debug && (\\r\\n <div>\\r\\n Debugging tags:\\r\\n <pre>{JSON.stringify(state.tags)}</pre>\\r\\n </div>\\r\\n )}\\r\\n </>\\r\\n);\\r\\n",
"lib.emojis": "// lib.emojis\\r\\n\\r\\nconst {\\r\\n isTest,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n callLibs,\\r\\n baseAction,\\r\\n widgets,\\r\\n} = props;\\r\\n\\r\\nconst libName = \\\"emojis\\\"; // EDIT: set lib name\\r\\nconst functionsToCall = functionsToCallByLibrary[libName];\\r\\n\\r\\nlet resultFunctionsToCallByLibrary = Object.assign(\\r\\n {},\\r\\n functionsToCallByLibrary\\r\\n);\\r\\nlet resultFunctionsToCall = [];\\r\\n\\r\\nconst currentVersion = \\\"0.0.1\\\"; // EDIT: Set version\\r\\n\\r\\nconst prodAction = `${baseAction}_v${currentVersion}`;\\r\\nconst testAction = `test_${prodAction}`;\\r\\nconst versionsBaseActions = isTest ? `test_${baseAction}` : baseAction;\\r\\nconst action = isTest ? testAction : prodAction;\\r\\n\\r\\n// START LIB CALLS SECTION\\r\\n// interface FunctionCall {\\r\\n// functionName: string,\\r\\n// key: string, // The state of the caller will be updated with this string as a key\\r\\n// props: Record<string, any> // function parameters as object\\r\\n// }\\r\\n\\r\\n// type LibsCalls = Record<string, FunctionCall> // Key is lib name after lib.\\r\\n\\r\\nconst libSrcArray = [widgets.libSBT]; // string to lib widget // EDIT: set libs to call\\r\\n\\r\\nconst libsCalls = {};\\r\\nlibSrcArray.forEach((libSrc) => {\\r\\n const libName = libSrc.split(\\\"lib.\\\")[1];\\r\\n libsCalls[libName] = [];\\r\\n});\\r\\n\\r\\nState.init({\\r\\n libsCalls, // is a LibsCalls object\\r\\n});\\r\\n// END LIB CALLS SECTION\\r\\n\\r\\nfunction log(message) {\\r\\n console.log(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction logError(message) {\\r\\n console.error(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction libStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\n// START LIB FUNCTIONS: EDIT set functions you need\\r\\nfunction canUserReact(props) {\\r\\n const { env, accountId, sbtsNames } = props;\\r\\n\\r\\n setAreValidUsers([accountId], sbtsNames);\\r\\n const result = state[`isValidUser-${accountId}`];\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"canUserReact\\\" && result !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n\\r\\n return result;\\r\\n}\\r\\n\\r\\nfunction setAreValidUsers(accountIds, sbtsNames) {\\r\\n const newLibsCalls = Object.assign({}, state.libsCalls);\\r\\n if (!newLibsCalls.SBT) {\\r\\n logError(\\\"Key SBT is not set in lib.\\\", libName);\\r\\n }\\r\\n\\r\\n accountIds.forEach((accountId) => {\\r\\n const isCallPushed =\\r\\n newLibsCalls.SBT.find((libCall) => {\\r\\n return (\\r\\n libCall.functionName === \\\"isValidUser\\\" &&\\r\\n libCall.props.accountId === accountId\\r\\n );\\r\\n }) !== undefined;\\r\\n const isCallReturned = state[`isValidUser-${accountId}`] !== undefined;\\r\\n\\r\\n if (isCallPushed || isCallReturned) {\\r\\n return;\\r\\n }\\r\\n\\r\\n newLibsCalls.SBT.push({\\r\\n functionName: \\\"isValidUser\\\",\\r\\n key: `isValidUser-${accountId}`,\\r\\n props: {\\r\\n accountId,\\r\\n sbtsNames,\\r\\n },\\r\\n });\\r\\n });\\r\\n State.update({ libsCalls: newLibsCalls });\\r\\n}\\r\\n\\r\\nfunction createEmoji(props) {\\r\\n const { reaction, elementReactedId, articleSbts, onCommit, onCancel } = props;\\r\\n\\r\\n saveHandler(reaction, elementReactedId, articleSbts, onCommit, onCancel);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"createEmoji\\\";\\r\\n });\\r\\n\\r\\n return reaction;\\r\\n}\\r\\n\\r\\nconst saveHandler = (\\r\\n reaction,\\r\\n elementReactedId,\\r\\n articleSbts,\\r\\n onCommit,\\r\\n onCancel\\r\\n) => {\\r\\n if (reaction) {\\r\\n const newData = composeReactionData(\\r\\n reaction,\\r\\n elementReactedId,\\r\\n articleSbts\\r\\n );\\r\\n\\r\\n Social.set(newData, {\\r\\n force: true,\\r\\n onCommit,\\r\\n onCancel,\\r\\n });\\r\\n } else {\\r\\n logError(\\\"Reaction is missing\\\");\\r\\n }\\r\\n};\\r\\n\\r\\nfunction composeReactionData(reaction, elementReactedId, articleSbts) {\\r\\n const data = {\\r\\n index: {\\r\\n [action]: JSON.stringify({\\r\\n key: elementReactedId,\\r\\n value: {\\r\\n reactionId: `r-${context.accountId}-${Date.now()}`,\\r\\n reaction,\\r\\n sbts: articleSbts,\\r\\n },\\r\\n }),\\r\\n },\\r\\n };\\r\\n\\r\\n return data;\\r\\n}\\r\\n\\r\\nfunction getReactionBlackListByBlockHeight() {\\r\\n return [];\\r\\n}\\r\\n\\r\\nfunction getReactions(action, elementReactedId) {\\r\\n return Social.index(action, elementReactedId, {\\r\\n order: \\\"desc\\\",\\r\\n subscribe: true,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction getEmojisNormalized(env, elementReactedId) {\\r\\n const emojisByVersion = Object.keys(versions).map((version) => {\\r\\n const action = versions[version].action;\\r\\n\\r\\n const allReactions = getReactions(action, elementReactedId);\\r\\n if (!allReactions) return [];\\r\\n const validReactions = filterInvalidReactions(env, allReactions);\\r\\n\\r\\n return getLatestEdits(validReactions);\\r\\n });\\r\\n\\r\\n return normalizeLibData(emojisByVersion);\\r\\n}\\r\\n\\r\\nfunction getLatestEdits(reactions) {\\r\\n return reactions.filter((obj) => {\\r\\n const userLatestInteraction = reactions.find(\\r\\n (vote) => vote.accountId === obj.accountId\\r\\n );\\r\\n return JSON.stringify(userLatestInteraction) === JSON.stringify(obj);\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterInvalidReactions(env, reactions) {\\r\\n return reactions\\r\\n .filter((reaction) => reaction.value.reactionId) // Has id\\r\\n .filter(\\r\\n (reaction) =>\\r\\n !getReactionBlackListByBlockHeight().includes(reaction.blockHeight) // Blockheight is not in blacklist\\r\\n );\\r\\n}\\r\\n\\r\\nfunction getEmojis(props) {\\r\\n const { env, sbtsNames: articleSbts, elementReactedId } = props;\\r\\n\\r\\n // Call other libs\\r\\n const normReations = getEmojisNormalized(env, elementReactedId);\\r\\n\\r\\n // Keep last edit from every reaction\\r\\n const lastReactions = normReations.filter((reaction) => {\\r\\n return normReations.find(\\r\\n (compReaction) =>\\r\\n JSON.stringify(compReaction) === JSON.stringify(reaction)\\r\\n );\\r\\n });\\r\\n\\r\\n const lastReactionsAuthors = lastReactions.map((reaction) => {\\r\\n return reaction.accountId;\\r\\n });\\r\\n\\r\\n setAreValidUsers(lastReactionsAuthors, articleSbts);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"getEmojis\\\" &&\\r\\n state[`isValidUser-${call.props.accountId}`] !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n const finalReactions = filterValidEmojis(lastReactions, articleSbts);\\r\\n\\r\\n const finalEmojisMapped = {};\\r\\n articleSbts.forEach((sbtName) => {\\r\\n const sbtEmojis = finalReactions.filter((reaction) => {\\r\\n if (!reaction.value.sbts) return false;\\r\\n return reaction.value.sbts.indexOf(sbtName) !== -1;\\r\\n });\\r\\n finalEmojisMapped[sbtName] = sbtEmojis;\\r\\n });\\r\\n\\r\\n const groupedReactions = groupReactions(finalEmojisMapped);\\r\\n\\r\\n return groupedReactions;\\r\\n}\\r\\n\\r\\nfunction groupReactions(emojisBySBT) {\\r\\n const userReaction = undefined;\\r\\n const accountsGroupedByReaction = {};\\r\\n\\r\\n Object.keys(emojisBySBT).forEach((sbtKey) => {\\r\\n const sbtReactions = emojisBySBT[sbtKey];\\r\\n sbtReactions.forEach((reaction) => {\\r\\n if (reaction.accountId === context.accountId) {\\r\\n userReaction = reaction;\\r\\n }\\r\\n const emoji = reaction.value.reaction.split(\\\" \\\")[0];\\r\\n if (!accountsGroupedByReaction[emoji]) {\\r\\n accountsGroupedByReaction[emoji] = [];\\r\\n }\\r\\n accountsGroupedByReaction[emoji].push(reaction.accountId);\\r\\n });\\r\\n });\\r\\n\\r\\n const reactionsStatistics = Object.keys(accountsGroupedByReaction).map(\\r\\n (reaction) => {\\r\\n return {\\r\\n accounts: accountsGroupedByReaction[reaction],\\r\\n emoji: reaction,\\r\\n };\\r\\n }\\r\\n );\\r\\n\\r\\n return { reactionsStatistics, userReaction };\\r\\n}\\r\\n\\r\\nfunction filterValidator(emojis, articleSbts) {\\r\\n return emojis.filter((emoji) => {\\r\\n return (\\r\\n articleSbts.find((articleSBT) => {\\r\\n return (\\r\\n state[`isValidUser-${emoji.accountId}`][articleSBT] ||\\r\\n articleSBT === \\\"public\\\"\\r\\n );\\r\\n }) !== undefined\\r\\n );\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterValidEmojis(emojis, articleSbts) {\\r\\n let filteredEmojis = filterValidator(filteredEmojis ?? emojis, articleSbts);\\r\\n\\r\\n return filteredEmojis;\\r\\n}\\r\\n\\r\\nfunction normalizeOldToV_0_0_1(reaction) {\\r\\n reaction.value.sbts = [\\\"public\\\"];\\r\\n\\r\\n return reaction;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_1ToV0_0_2(reaction) {\\r\\n return reaction;\\r\\n}\\r\\n\\r\\n// END LIB FUNCTIONS\\r\\n// EDIT: set functions you want to export\\r\\nfunction callFunction(call) {\\r\\n if (call.functionName === \\\"canUserReact\\\") {\\r\\n return canUserReact(call.props);\\r\\n } else if (call.functionName === \\\"createEmoji\\\") {\\r\\n return createEmoji(call.props);\\r\\n } else if (call.functionName === \\\"getEmojis\\\") {\\r\\n return getEmojis(call.props);\\r\\n }\\r\\n}\\r\\n\\r\\n// EDIT: set versions you want to handle, considering their action to Social.index and the way to transform to one version to another (normalization)\\r\\nconst versions = {\\r\\n old: {\\r\\n normalizationFunction: normalizeOldToV_0_0_1,\\r\\n action: versionsBaseActions,\\r\\n },\\r\\n \\\"0.0.1\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_1ToV0_0_2,\\r\\n action: `${versionsBaseActions}_v0.0.1`,\\r\\n },\\r\\n};\\r\\n\\r\\nfunction normalizeLibData(libDataByVersion) {\\r\\n let libData;\\r\\n\\r\\n Object.keys(versions).forEach((version, index, array) => {\\r\\n const normFn = versions[version].normalizationFunction;\\r\\n const normLibData = libDataByVersion[index].map((libData, i) => {\\r\\n return normFn(libData);\\r\\n });\\r\\n\\r\\n if (index + 1 === array.length) {\\r\\n // Last index\\r\\n libData = normLibData;\\r\\n return;\\r\\n }\\r\\n libDataByVersion[index + 1] =\\r\\n libDataByVersion[index + 1].concat(normLibData);\\r\\n });\\r\\n\\r\\n return libData;\\r\\n}\\r\\n\\r\\nif (functionsToCall && functionsToCall.length > 0) {\\r\\n const updateObj = Object.assign({}, functionsToCallByLibrary);\\r\\n resultFunctionsToCall = [...functionsToCall];\\r\\n functionsToCall.forEach((call) => {\\r\\n updateObj[call.key] = callFunction(call);\\r\\n });\\r\\n\\r\\n resultFunctionsToCallByLibrary[libName] = resultFunctionsToCall;\\r\\n updateObj.functionsToCallByLibrary = resultFunctionsToCallByLibrary;\\r\\n stateUpdate(updateObj);\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n libStateUpdate,\\r\\n state.libsCalls,\\r\\n {},\\r\\n `lib.${libName}`\\r\\n );\\r\\n })}\\r\\n </>\\r\\n);\\r\\n",
"lib.article": "// lib.article\\r\\n\\r\\nconst {\\r\\n mainStateUpdate,\\r\\n isTest,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n callLibs,\\r\\n baseAction,\\r\\n kanbanColumns,\\r\\n widgets,\\r\\n usersSBTs,\\r\\n} = props;\\r\\n\\r\\nconst libName = \\\"article\\\"; // EDIT: set lib name\\r\\nconst functionsToCall = functionsToCallByLibrary[libName];\\r\\n\\r\\nlet resultFunctionsToCallByLibrary = Object.assign(\\r\\n {},\\r\\n functionsToCallByLibrary\\r\\n);\\r\\nlet resultFunctionsToCall = [];\\r\\n\\r\\nconst currentVersion = \\\"0.0.2\\\"; // EDIT: Set version\\r\\n\\r\\nconst prodAction = `${baseAction}_v${currentVersion}`;\\r\\nconst testAction = `test_${prodAction}`;\\r\\nconst versionsBaseActions = isTest ? `test_${baseAction}` : baseAction;\\r\\nconst action = isTest ? testAction : prodAction;\\r\\n// START LIB CALLS SECTION\\r\\n// interface FunctionCall {\\r\\n// functionName: string,\\r\\n// key: string, // The state of the caller will be updated with this string as a key\\r\\n// props: Record<string, any> // function parameters as object\\r\\n// }\\r\\n\\r\\n// type LibsCalls = Record<string, FunctionCall> // Key is lib name after lib.\\r\\n\\r\\nconst libSrcArray = [widgets.libSBT]; // string to lib widget // EDIT: set libs to call\\r\\n\\r\\nconst libCalls = {};\\r\\nlibSrcArray.forEach((libSrc) => {\\r\\n const libName = libSrc.split(\\\"lib.\\\")[1];\\r\\n libCalls[libName] = [];\\r\\n});\\r\\n\\r\\nState.init({\\r\\n libCalls, // is a LibsCalls object\\r\\n});\\r\\n// END LIB CALLS SECTION\\r\\n\\r\\nfunction log(message) {\\r\\n console.log(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction logError(message) {\\r\\n console.error(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction libStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\n// START LIB FUNCTIONS: EDIT set functions you need\\r\\nfunction canUserCreateArticle(props) {\\r\\n const { env, accountId, sbtsNames } = props;\\r\\n\\r\\n setAreValidUsers([accountId], sbtsNames);\\r\\n const result = state[`isValidUser-${accountId}`];\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"canUserCreateArticle\\\" && result !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n\\r\\n return result;\\r\\n}\\r\\n\\r\\nfunction setAreValidUsers(accountIds, sbtsNames) {\\r\\n const newLibsCalls = Object.assign({}, state.libCalls);\\r\\n if (!newLibsCalls.SBT) {\\r\\n logError(\\\"Key SBT is not set in lib.\\\", libName);\\r\\n }\\r\\n\\r\\n accountIds.forEach((accountId) => {\\r\\n const isCallPushed =\\r\\n newLibsCalls.SBT.find((libCall) => {\\r\\n return (\\r\\n libCall.functionName === \\\"isValidUser\\\" &&\\r\\n libCall.props.accountId === accountId\\r\\n );\\r\\n }) !== undefined;\\r\\n const isCallReturned = state[`isValidUser-${accountId}`] !== undefined;\\r\\n\\r\\n if (isCallPushed || isCallReturned) {\\r\\n return;\\r\\n }\\r\\n\\r\\n const existingUserSBTs = usersSBTs.find(\\r\\n (userSBTs) => userSBTs.user === accountId\\r\\n );\\r\\n\\r\\n if (!existingUserSBTs) {\\r\\n newLibsCalls.SBT.push({\\r\\n functionName: \\\"isValidUser\\\",\\r\\n key: `isValidUser-${accountId}`,\\r\\n props: {\\r\\n accountId,\\r\\n sbtsNames,\\r\\n },\\r\\n });\\r\\n }\\r\\n });\\r\\n State.update({ libCalls: newLibsCalls });\\r\\n}\\r\\n\\r\\nfunction createArticle(props) {\\r\\n const { article, onCommit, onCancel } = props;\\r\\n\\r\\n saveHandler(article, onCommit, onCancel);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"createArticle\\\";\\r\\n });\\r\\n\\r\\n return article;\\r\\n}\\r\\n\\r\\nconst saveHandler = (article, onCommit, onCancel) => {\\r\\n if (article.title && article.body) {\\r\\n const newData = composeData(article);\\r\\n\\r\\n Social.set(newData, {\\r\\n force: true,\\r\\n onCommit,\\r\\n onCancel,\\r\\n });\\r\\n } else {\\r\\n logError(\\\"Article is missing title or body\\\");\\r\\n }\\r\\n};\\r\\n\\r\\nfunction composeData(article) {\\r\\n let data;\\r\\n data = {\\r\\n [action]: {\\r\\n main: JSON.stringify(article),\\r\\n },\\r\\n index: {\\r\\n [action]: JSON.stringify({\\r\\n key: \\\"main\\\",\\r\\n value: {\\r\\n type: \\\"md\\\",\\r\\n id: article.id ?? `${context.accountId}-${Date.now()}`,\\r\\n },\\r\\n }),\\r\\n },\\r\\n };\\r\\n\\r\\n return data;\\r\\n}\\r\\n\\r\\nfunction getArticleBlackListByBlockHeight() {\\r\\n return [\\r\\n 91092435, 91092174, 91051228, 91092223, 91051203, 98372095, 96414482,\\r\\n 96412953, 103131250,\\r\\n ];\\r\\n}\\r\\n\\r\\nfunction getArticleBlackListByRealArticleId() {\\r\\n return [\\r\\n \\\"blaze.near-1690410074090\\\",\\r\\n \\\"blaze.near-1690409577184\\\",\\r\\n \\\"blaze.near-1690803928696\\\",\\r\\n \\\"blaze.near-1690803872147\\\",\\r\\n \\\"blaze.near-1690574978421\\\",\\r\\n \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb-1691703303485\\\",\\r\\n \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb-1691702619510\\\",\\r\\n \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb-1691702487944\\\",\\r\\n \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb-1691707918243\\\",\\r\\n \\\"f2bc8abdb8ba64fe5aac9689ded9491ff0e6fdcd7a5c680b7cf364142d1789fb-1691707889297\\\",\\r\\n \\\"blaze.near-1697211386373\\\",\\r\\n \\\"silkking.near-1696797896796\\\",\\r\\n \\\"silkking.near-1696797784589\\\",\\r\\n \\\"silkking.near-1696797350661\\\",\\r\\n \\\"silkking.near-1696797276482\\\",\\r\\n \\\"silkking.near-1696797155012\\\",\\r\\n \\\"silkking.near-1696796793605\\\",\\r\\n \\\"silkking.near-1696796543546\\\",\\r\\n \\\"silkking.near-1696795954175\\\",\\r\\n \\\"silkking.near-1696794571874\\\",\\r\\n \\\"silkking.near-1696792789177\\\",\\r\\n \\\"zarmade.near-1690578803015\\\",\\r\\n ];\\r\\n}\\r\\n\\r\\nfunction canUserEditArticle(props) {\\r\\n const { article } = props;\\r\\n\\r\\n return article.author === context.accountId;\\r\\n}\\r\\n\\r\\nfunction getArticlesIndexes(action, subscribe) {\\r\\n return Social.index(action, \\\"main\\\", {\\r\\n order: \\\"desc\\\",\\r\\n subscribe,\\r\\n // limit: 10,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction getArticlesNormalized(env) {\\r\\n const articlesByVersion = Object.keys(versions).map((version, index, arr) => {\\r\\n const action = versions[version].action;\\r\\n const subscribe = index + 1 === arr.length;\\r\\n const articlesIndexes = getArticlesIndexes(action, subscribe);\\r\\n if (!articlesIndexes) return [];\\r\\n const validArticlesIndexes = filterInvalidArticlesIndexes(\\r\\n env,\\r\\n articlesIndexes\\r\\n );\\r\\n\\r\\n const validLatestEdits = getLatestEdits(validArticlesIndexes);\\r\\n\\r\\n const articles = validLatestEdits\\r\\n .map((article) => {\\r\\n return getArticle(article, action);\\r\\n })\\r\\n .filter((article) => {\\r\\n return article !== undefined;\\r\\n });\\r\\n return articles;\\r\\n });\\r\\n\\r\\n return normalizeLibData(articlesByVersion);\\r\\n}\\r\\n\\r\\nfunction getArticle(articleIndex, action) {\\r\\n const article = Social.get(\\r\\n `${articleIndex.accountId}/${action}/main`,\\r\\n articleIndex.blockHeight\\r\\n );\\r\\n\\r\\n let articleParsed = undefined;\\r\\n if (article) {\\r\\n articleParsed = JSON.parse(article);\\r\\n articleParsed.blockHeight = articleIndex.blockHeight;\\r\\n articleParsed.id = articleIndex.value.id;\\r\\n }\\r\\n\\r\\n if (articleParsed) {\\r\\n return articleParsed;\\r\\n }\\r\\n}\\r\\n\\r\\nfunction getLatestEdits(newFormatArticlesIndexes) {\\r\\n return newFormatArticlesIndexes.filter((articleIndex) => {\\r\\n const latestEditForThisArticle = newFormatArticlesIndexes.find(\\r\\n (newArticleData) => newArticleData.value.id === articleIndex.value.id\\r\\n );\\r\\n return (\\r\\n JSON.stringify(articleIndex) === JSON.stringify(latestEditForThisArticle)\\r\\n );\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterInvalidArticlesIndexes(env, articlesIndexes) {\\r\\n return articlesIndexes\\r\\n .filter((articleIndex) => articleIndex.value.id) // Has id\\r\\n .filter(\\r\\n (articleIndex) =>\\r\\n articleIndex.value.id.split(\\\"-\\\")[0] === articleIndex.accountId\\r\\n ) // id begins with same accountId as index object\\r\\n .filter(\\r\\n (articleIndex) =>\\r\\n !getArticleBlackListByBlockHeight().includes(articleIndex.blockHeight) // Blockheight is not in blacklist\\r\\n )\\r\\n .filter(\\r\\n (articleIndex) =>\\r\\n !getArticleBlackListByRealArticleId().includes(articleIndex.value.id) // Article id is not in blacklist\\r\\n );\\r\\n}\\r\\n\\r\\nfunction getArticles(props) {\\r\\n const { env, sbtsNames } = props;\\r\\n // Call other libs\\r\\n const normArticles = getArticlesNormalized(env);\\r\\n\\r\\n // Keep last edit from every article\\r\\n const lastEditionArticles = normArticles.filter((article) => {\\r\\n return normArticles.find(\\r\\n (compArticle) => JSON.stringify(compArticle) === JSON.stringify(article)\\r\\n );\\r\\n });\\r\\n\\r\\n const lastEditionArticlesAuthors = lastEditionArticles.map((article) => {\\r\\n return article.author;\\r\\n });\\r\\n\\r\\n setAreValidUsers(lastEditionArticlesAuthors, sbtsNames);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"getArticles\\\" &&\\r\\n state[`isValidUser-${call.props.accountId}`] !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n\\r\\n const finalArticles = filterValidArticles(lastEditionArticles);\\r\\n const finalArticlesMapped = {};\\r\\n sbtsNames.forEach((sbtName) => {\\r\\n const sbtArticles = finalArticles.filter((article) => {\\r\\n if (!article.sbts) return false;\\r\\n return article.sbts.indexOf(sbtName) !== -1;\\r\\n });\\r\\n finalArticlesMapped[sbtName] = sbtArticles;\\r\\n });\\r\\n\\r\\n return finalArticlesMapped;\\r\\n}\\r\\n\\r\\nfunction filterValidator(articles) {\\r\\n return articles.filter((article) => {\\r\\n return (\\r\\n article.sbts.find((articleSbt) => {\\r\\n return (\\r\\n state[`isValidUser-${article.author}`][articleSbt] ||\\r\\n articleSbt === \\\"public\\\"\\r\\n );\\r\\n }) !== undefined\\r\\n );\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterValidArticles(articles) {\\r\\n let filteredArticles = filterValidator(filteredArticles ?? articles);\\r\\n\\r\\n return filteredArticles;\\r\\n}\\r\\n\\r\\nfunction filterMultipleKanbanTags(articleTags, kanbanTags) {\\r\\n const normalizedKanbanTag = [];\\r\\n\\r\\n kanbanTags.forEach((tag) => {\\r\\n normalizedKanbanTag.push(tag.replace(` `, \\\"-\\\"));\\r\\n });\\r\\n\\r\\n const kanbanTagsInArticleTags = articleTags.filter((tag) =>\\r\\n normalizedKanbanTag.includes(tag.toLowerCase().replace(` `, \\\"-\\\"))\\r\\n );\\r\\n\\r\\n const nonKanbanTags = articleTags.filter(\\r\\n (tag) => !normalizedKanbanTag.includes(tag.toLowerCase().replace(` `, \\\"-\\\"))\\r\\n );\\r\\n\\r\\n const result = [...nonKanbanTags, kanbanTagsInArticleTags[0]];\\r\\n\\r\\n return result;\\r\\n}\\r\\n\\r\\nfunction normalizeOldToV_0_0_1(article) {\\r\\n article.realArticleId = `${article.author}-${article.timeCreate}`;\\r\\n article.sbts = [\\\"public\\\"];\\r\\n\\r\\n return article;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_1ToV0_0_2(article) {\\r\\n article.title = article.articleId;\\r\\n article.id = article.realArticleId;\\r\\n if (article.sbts[0] !== \\\"public\\\") {\\r\\n article.sbts[0] = article.sbts[0] + \\\" - class 1\\\";\\r\\n } // There is only one article that is not public and only has class 1\\r\\n\\r\\n delete article.articleId;\\r\\n delete article.realArticleId;\\r\\n\\r\\n return article;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_2ToV0_0_3(article) {\\r\\n if (!Array.isArray(article.tags) && typeof article.tags === \\\"object\\\") {\\r\\n article.tags = Object.keys(article.tags);\\r\\n }\\r\\n\\r\\n article.tags = article.tags.filter(\\r\\n (tag) => tag !== undefined && tag !== null\\r\\n );\\r\\n\\r\\n if (kanbanColumns) {\\r\\n const lowerCaseColumns = [];\\r\\n kanbanColumns.forEach((cl) => {\\r\\n lowerCaseColumns.push(cl.toLowerCase());\\r\\n });\\r\\n\\r\\n article.tags = filterMultipleKanbanTags(article.tags, lowerCaseColumns);\\r\\n }\\r\\n\\r\\n return article;\\r\\n}\\r\\n\\r\\n// END LIB FUNCTIONS\\r\\n\\r\\n// EDIT: set functions you want to export\\r\\nfunction callFunction(call) {\\r\\n if (call.functionName === \\\"canUserCreateArticle\\\") {\\r\\n return canUserCreateArticle(call.props);\\r\\n } else if (call.functionName === \\\"createArticle\\\") {\\r\\n return createArticle(call.props);\\r\\n } else if (call.functionName === \\\"canUserEditArticle\\\") {\\r\\n return canUserEditArticle(call.props);\\r\\n } else if (call.functionName === \\\"getArticles\\\") {\\r\\n return getArticles(call.props);\\r\\n }\\r\\n}\\r\\n\\r\\n// EDIT: set versions you want to handle, considering their action to Social.index and the way to transform to one version to another (normalization)\\r\\nconst versions = {\\r\\n old: {\\r\\n normalizationFunction: normalizeOldToV_0_0_1,\\r\\n action: versionsBaseActions,\\r\\n },\\r\\n \\\"v0.0.1\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_1ToV0_0_2,\\r\\n action: `${versionsBaseActions}_v0.0.1`,\\r\\n },\\r\\n \\\"v0.0.2\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_2ToV0_0_3,\\r\\n action: `${versionsBaseActions}_v0.0.2`,\\r\\n },\\r\\n};\\r\\n\\r\\nfunction normalizeLibData(libDataByVersion) {\\r\\n let libData;\\r\\n\\r\\n Object.keys(versions).forEach((version, index, array) => {\\r\\n const normFn = versions[version].normalizationFunction;\\r\\n const normLibData = libDataByVersion[index].map((libData, i) => {\\r\\n return normFn(libData);\\r\\n });\\r\\n\\r\\n if (index + 1 === array.length) {\\r\\n // Last index\\r\\n libData = normLibData;\\r\\n return;\\r\\n }\\r\\n libDataByVersion[index + 1] =\\r\\n libDataByVersion[index + 1].concat(normLibData);\\r\\n });\\r\\n\\r\\n return libData;\\r\\n}\\r\\n\\r\\nif (functionsToCall && functionsToCall.length > 0) {\\r\\n const updateObj = Object.assign({}, functionsToCallByLibrary);\\r\\n resultFunctionsToCall = [...functionsToCall];\\r\\n functionsToCall.forEach((call) => {\\r\\n updateObj[call.key] = callFunction(call);\\r\\n });\\r\\n\\r\\n resultFunctionsToCallByLibrary[libName] = resultFunctionsToCall;\\r\\n updateObj.functionsToCallByLibrary = resultFunctionsToCallByLibrary;\\r\\n\\r\\n const oldUsersSBTs = usersSBTs;\\r\\n // {\\r\\n // user: string,\\r\\n // credentials: {},\\r\\n // }\\r\\n\\r\\n const newUsersSBTs = Object.keys(state).map((key) => {\\r\\n if (key.includes(\\\"isValidUser-\\\")) {\\r\\n if (state[key] !== undefined) {\\r\\n const user = key.split(\\\"isValidUser-\\\")[1];\\r\\n const credentials = state[key];\\r\\n\\r\\n const oldUsers = oldUsersSBTs.map((userSbts) => userSbts.user);\\r\\n\\r\\n if (!oldUsers.includes(user)) {\\r\\n return {\\r\\n user,\\r\\n credentials,\\r\\n };\\r\\n }\\r\\n }\\r\\n }\\r\\n });\\r\\n\\r\\n const finalUsersSBTs = [...oldUsersSBTs, ...newUsersSBTs].filter(\\r\\n (userSBTs) => userSBTs !== undefined\\r\\n );\\r\\n\\r\\n if (finalUsersSBTs[0]) {\\r\\n mainStateUpdate({ usersSBTs: finalUsersSBTs });\\r\\n }\\r\\n\\r\\n stateUpdate(updateObj);\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n libStateUpdate,\\r\\n state.libCalls,\\r\\n {},\\r\\n `lib.${libName}`\\r\\n );\\r\\n })}\\r\\n </>\\r\\n);\\r\\n",
"lib.comment": "// lib.comment\\r\\nconst {\\r\\n isTest,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n callLibs,\\r\\n baseAction,\\r\\n widgets,\\r\\n} = props;\\r\\nconst libName = \\\"comment\\\"; // EDIT: set lib name\\r\\nconst functionsToCall = functionsToCallByLibrary[libName];\\r\\n\\r\\nlet resultFunctionsToCallByLibrary = Object.assign(\\r\\n {},\\r\\n functionsToCallByLibrary\\r\\n);\\r\\nlet resultFunctionsToCall = [];\\r\\n\\r\\nconst currentVersion = \\\"0.0.2\\\"; // EDIT: Set version\\r\\n\\r\\nconst prodAction = `${baseAction}_v${currentVersion}`; // TODO consider versions\\r\\n// const prodAction = `${baseAction}`;\\r\\nconst testAction = `test_${prodAction}`;\\r\\nconst action = isTest ? testAction : prodAction;\\r\\n\\r\\n// START LIB CALLS SECTION\\r\\n// interface FunctionCall {\\r\\n// functionName: string,\\r\\n// key: string, // The state of the caller will be updated with this string as a key\\r\\n// props: Record<string, any> // function parameters as object\\r\\n// }\\r\\n\\r\\n// type LibsCalls = Record<string, FunctionCall> // Key is lib name after lib.\\r\\n\\r\\nconst libSrcArray = [widgets.libSBT]; // string to lib widget // EDIT: set libs to call\\r\\n\\r\\nconst libsCalls = {};\\r\\nlibSrcArray.forEach((libSrc) => {\\r\\n const libName = libSrc.split(\\\"lib.\\\")[1];\\r\\n libsCalls[libName] = [];\\r\\n});\\r\\n\\r\\nState.init({\\r\\n libsCalls, // is a LibsCalls object\\r\\n});\\r\\n// END LIB CALLS SECTION\\r\\n\\r\\nfunction log(message) {\\r\\n console.log(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction logError(message) {\\r\\n console.error(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction libStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\n// START LIB FUNCTIONS: EDIT set functions you need\\r\\n\\r\\nfunction canUserCreateComment(props) {\\r\\n const { accountId, sbtsNames } = props;\\r\\n\\r\\n setAreValidUsers([accountId], sbtsNames);\\r\\n const result =\\r\\n state[`isValidUser-${accountId}`]; /* || sbtsNames.includes(\\\"public\\\")*/\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"canUserCreateComment\\\" && result !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n\\r\\n return result;\\r\\n}\\r\\n\\r\\nfunction setAreValidUsers(accountIds, sbtsNames) {\\r\\n const newLibCalls = Object.assign({}, state.libsCalls);\\r\\n\\r\\n if (newLibsCalls && !newLibsCalls.SBT) {\\r\\n logError(\\\"Key SBT is not set in lib.\\\", libName);\\r\\n }\\r\\n\\r\\n accountIds.forEach((accountId) => {\\r\\n const isCallPushed =\\r\\n newLibCalls.SBT.find((libCall) => {\\r\\n return (\\r\\n libCall.functionName === \\\"isValidUser\\\" &&\\r\\n libCall.props.accountId === accountId\\r\\n );\\r\\n }) !== undefined;\\r\\n const isCallReturned = state[`isValidUser-${accountId}`] !== undefined;\\r\\n\\r\\n if (isCallPushed || isCallReturned) {\\r\\n return;\\r\\n }\\r\\n\\r\\n newLibCalls.SBT.push({\\r\\n functionName: \\\"isValidUser\\\",\\r\\n key: `isValidUser-${accountId}`,\\r\\n props: {\\r\\n accountId,\\r\\n sbtsNames,\\r\\n },\\r\\n });\\r\\n });\\r\\n State.update({ libCalls: newLibCalls });\\r\\n}\\r\\n\\r\\nfunction createComment(props) {\\r\\n const { comment, onClick, onCommit, onCancel } = props;\\r\\n\\r\\n onClick();\\r\\n\\r\\n saveComment(comment, onCommit, onCancel);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"createComment\\\";\\r\\n });\\r\\n\\r\\n return comment;\\r\\n}\\r\\n\\r\\nfunction composeCommentData(comment) {\\r\\n const data = {\\r\\n index: {\\r\\n [action]: JSON.stringify({\\r\\n key: comment.id,\\r\\n value: {\\r\\n type: \\\"md\\\",\\r\\n comment,\\r\\n },\\r\\n }),\\r\\n },\\r\\n };\\r\\n\\r\\n return data;\\r\\n}\\r\\n\\r\\nfunction saveComment(comment, onCommit, onCancel) {\\r\\n if (comment.text) {\\r\\n const newData = composeCommentData(comment);\\r\\n Social.set(newData, {\\r\\n force: true,\\r\\n onCommit,\\r\\n onCancel,\\r\\n });\\r\\n }\\r\\n}\\r\\n\\r\\nfunction getComments(action, id, subscribe) {\\r\\n return Social.index(action, id, {\\r\\n order: \\\"desc\\\",\\r\\n subscribe,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction getCommentBlackListByBlockHeight() {\\r\\n return [98588599];\\r\\n}\\r\\n\\r\\nfunction filterInvalidComments(comments) {\\r\\n return comments.filter(\\r\\n (comment) =>\\r\\n comment.blockHeight &&\\r\\n !getCommentBlackListByBlockHeight().includes(comment.blockHeight) // Comment is not in blacklist\\r\\n );\\r\\n}\\r\\n\\r\\nfunction getValidComments(props) {\\r\\n const { env, articleSbts, id } = props;\\r\\n // Call other libs\\r\\n const normComments = getCommentsNormalized(env, id);\\r\\n\\r\\n // const blacklistFilteredComments = commentIndexes\\r\\n // ? filterInvalidCommentsIndexes(commentIndexes)\\r\\n // : [];\\r\\n\\r\\n const commentsAuthors = normComments.map((comment) => {\\r\\n return comment.accountId;\\r\\n });\\r\\n\\r\\n setAreValidUsers(commentsAuthors, articleSbts);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"getValidComments\\\" &&\\r\\n state[`isValidUser-${call.props.accountId}`] !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n\\r\\n const finalComments = filterValidComments(normComments, articleSbts);\\r\\n\\r\\n // if (articleSbts.length > 0) {\\r\\n // We assume there will only be just one articleSbt\\r\\n // const articleSbt = articleSbts[0];\\r\\n\\r\\n // const blacklistFilteredCommentsAuthors = blacklistFilteredComments.map(\\r\\n // (comment) => {\\r\\n // return comment.accountId;\\r\\n // }\\r\\n // );\\r\\n\\r\\n // setAreValidUsers(blacklistFilteredCommentsAuthors, articleSbts);\\r\\n\\r\\n // const validAuthors = blacklistFilteredCommentsAuthors.filter((author) => {\\r\\n // return state[`isValidUser-${author}`][articleSbt];\\r\\n // });\\r\\n\\r\\n // resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n // const discardCondition =\\r\\n // call.functionName === \\\"getValidComments\\\" &&\\r\\n // state[`isValidUser-${call.props.accountId}`] !== undefined;\\r\\n // return !discardCondition;\\r\\n // });\\r\\n // finalComments = blacklistFilteredComments.filter((comment) => {\\r\\n // return validAuthors.includes(comment.accountId);\\r\\n // });\\r\\n // }\\r\\n return finalComments;\\r\\n}\\r\\n\\r\\nfunction filterValidator(comments, articleSbts) {\\r\\n return comments.filter((comment) => {\\r\\n return (\\r\\n articleSbts.find((sbt) => {\\r\\n return (\\r\\n state[`isValidUser-${comment.accountId}`][sbt] ||\\r\\n commentSbt === \\\"public\\\"\\r\\n );\\r\\n }) !== undefined\\r\\n );\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterValidComments(comments, articleSbts) {\\r\\n let filteredComments = filterValidator(\\r\\n filteredComments ?? comments,\\r\\n articleSbts\\r\\n );\\r\\n\\r\\n return filteredComments;\\r\\n}\\r\\n\\r\\nfunction getCommentsNormalized(env, id) {\\r\\n const commentsByVersion = Object.keys(versions).map((version, index, arr) => {\\r\\n const action = versions[version].action;\\r\\n const subscribe = index + 1 === arr.length;\\r\\n\\r\\n const comments = getComments(action, id, subscribe);\\r\\n if (!comments) return [];\\r\\n\\r\\n const validComments = filterInvalidComments(comments);\\r\\n\\r\\n return validComments;\\r\\n });\\r\\n\\r\\n return normalizeLibData(commentsByVersion);\\r\\n}\\r\\n\\r\\nfunction normalizeOldToV_0_0_1(comment) {\\r\\n return comment;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_1ToV0_0_2(comment) {\\r\\n return comment;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_2ToV0_0_3(comment) {\\r\\n return comment;\\r\\n}\\r\\n// END LIB FUNCTIONS\\r\\n\\r\\n// EDIT: set functions you want to export\\r\\nfunction callFunction(call) {\\r\\n if (call.functionName === \\\"createComment\\\") {\\r\\n return createComment(call.props);\\r\\n } else if (call.functionName === \\\"getValidComments\\\") {\\r\\n return getValidComments(call.props);\\r\\n } else if (call.functionName === \\\"canUserCreateComment\\\") {\\r\\n return canUserCreateComment(call.props);\\r\\n }\\r\\n}\\r\\n\\r\\n// EDIT: set versions you want to handle, considering their action to Social.index and the way to transform to one version to another (normalization)\\r\\nconst versions = {\\r\\n old: {\\r\\n normalizationFunction: normalizeOldToV_0_0_1,\\r\\n action: props.isTest ? `test_${baseAction}` : baseAction,\\r\\n },\\r\\n \\\"v1.0.1\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_1ToV0_0_2,\\r\\n action: props.isTest ? `test_${baseAction}-v1.0.1` : `${baseAction}-v1.0.1`,\\r\\n },\\r\\n \\\"v0.0.2\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_2ToV0_0_3,\\r\\n action: props.isTest ? `test_${baseAction}_v0.0.2` : `${baseAction}_v0.0.2`,\\r\\n },\\r\\n};\\r\\n\\r\\nfunction normalizeLibData(libDataByVersion) {\\r\\n let libData;\\r\\n\\r\\n Object.keys(versions).forEach((version, index, array) => {\\r\\n const normFn = versions[version].normalizationFunction;\\r\\n const normLibData = libDataByVersion[index].map((libData, i) => {\\r\\n return normFn(libData);\\r\\n });\\r\\n\\r\\n if (index + 1 === array.length) {\\r\\n // Last index\\r\\n libData = normLibData;\\r\\n return;\\r\\n }\\r\\n libDataByVersion[index + 1] =\\r\\n libDataByVersion[index + 1].concat(normLibData);\\r\\n });\\r\\n\\r\\n return libData;\\r\\n}\\r\\n\\r\\nif (functionsToCall && functionsToCall.length > 0) {\\r\\n const updateObj = Object.assign({}, functionsToCallByLibrary);\\r\\n resultFunctionsToCall = [...functionsToCall];\\r\\n functionsToCall.forEach((call) => {\\r\\n updateObj[call.key] = callFunction(call);\\r\\n });\\r\\n\\r\\n resultFunctionsToCallByLibrary[libName] = resultFunctionsToCall;\\r\\n updateObj.functionsToCallByLibrary = resultFunctionsToCallByLibrary;\\r\\n stateUpdate(updateObj);\\r\\n}\\r\\n\\r\\n// function callLibs(\\r\\n// src,\\r\\n// stateUpdate,\\r\\n// functionsToCallByLibrary,\\r\\n// extraProps,\\r\\n// callerWidget\\r\\n// ) {\\r\\n// return (\\r\\n// <Widget\\r\\n// src={src}\\r\\n// props={{\\r\\n// isTest,\\r\\n// stateUpdate,\\r\\n// functionsToCallByLibrary,\\r\\n// callLibs,\\r\\n// widgets,\\r\\n// ...extraProps,\\r\\n// }}\\r\\n// />\\r\\n// );\\r\\n// }\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n libStateUpdate,\\r\\n state.libsCalls,\\r\\n {},\\r\\n `lib.${libName}`\\r\\n );\\r\\n })}\\r\\n </>\\r\\n);\\r\\n",
"lib.upVotes": "const {\\r\\n isTest,\\r\\n stateUpdate,\\r\\n functionsToCallByLibrary,\\r\\n callLibs,\\r\\n baseAction,\\r\\n widgets,\\r\\n} = props;\\r\\n\\r\\nconst libName = \\\"upVotes\\\"; // EDIT: set lib name\\r\\nconst functionsToCall = functionsToCallByLibrary[libName];\\r\\n\\r\\nlet resultFunctionsToCallByLibrary = Object.assign(\\r\\n {},\\r\\n functionsToCallByLibrary\\r\\n);\\r\\nlet resultFunctionsToCall = [];\\r\\n\\r\\nconst currentVersion = \\\"0.0.2\\\"; // EDIT: Set version\\r\\n\\r\\nconst prodAction = `${baseAction}_v${currentVersion}`;\\r\\nconst testAction = `test_${prodAction}`;\\r\\nconst action = isTest ? testAction : prodAction;\\r\\n\\r\\n// START LIB CALLS SECTION\\r\\n// interface FunctionCall {\\r\\n// functionName: string,\\r\\n// key: string, // The state of the caller will be updated with this string as a key\\r\\n// props: Record<string, any> // function parameters as object\\r\\n// }\\r\\n\\r\\n// type LibsCalls = Record<string, FunctionCall> // Key is lib name after lib.\\r\\n\\r\\nconst libSrcArray = [widgets.libSBT]; // string to lib widget // EDIT: set libs to call\\r\\n\\r\\nconst otherFunctionsToCallByLibrary = {};\\r\\nlibSrcArray.forEach((libSrc) => {\\r\\n const libName = libSrc.split(\\\"lib.\\\")[1];\\r\\n otherFunctionsToCallByLibrary[libName] = [];\\r\\n});\\r\\n\\r\\nState.init({\\r\\n functionsToCallByLibrary: otherFunctionsToCallByLibrary, // is a LibsCalls object\\r\\n});\\r\\n// END LIB CALLS SECTION\\r\\n\\r\\nfunction log(message) {\\r\\n console.log(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction logError(message) {\\r\\n console.error(`lib.${libName}`, message);\\r\\n}\\r\\n\\r\\nfunction libStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\n// START LIB FUNCTIONS: EDIT set functions you need\\r\\nfunction canUserUpVote(props) {\\r\\n const { env, accountId, sbtsNames } = props;\\r\\n\\r\\n setAreValidUsers([accountId], sbtsNames);\\r\\n const result = state[`isValidUser-${accountId}`];\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"canUserUpVote\\\" && result !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n\\r\\n return result;\\r\\n}\\r\\n\\r\\nfunction setAreValidUsers(accountIds, sbtsNames) {\\r\\n const newLibsCalls = Object.assign({}, state.functionsToCallByLibrary);\\r\\n if (!newLibsCalls.SBT) {\\r\\n logError(\\\"Key SBT is not set in lib.\\\", libName);\\r\\n }\\r\\n\\r\\n accountIds.forEach((accountId) => {\\r\\n const isCallPushed =\\r\\n newLibsCalls.SBT.find((libCall) => {\\r\\n return (\\r\\n libCall.functionName === \\\"isValidUser\\\" &&\\r\\n libCall.props.accountId === accountId\\r\\n );\\r\\n }) !== undefined;\\r\\n const isCallReturned = state[`isValidUser-${accountId}`] !== undefined;\\r\\n\\r\\n if (isCallPushed || isCallReturned) {\\r\\n return;\\r\\n }\\r\\n\\r\\n newLibsCalls.SBT.push({\\r\\n functionName: \\\"isValidUser\\\",\\r\\n key: `isValidUser-${accountId}`,\\r\\n props: {\\r\\n accountId,\\r\\n sbtsNames,\\r\\n },\\r\\n });\\r\\n });\\r\\n State.update({ functionsToCallByLibrary: newLibsCalls });\\r\\n}\\r\\n\\r\\nfunction addVote(props) {\\r\\n const { id, articleSbts } = props;\\r\\n saveUpVote(id, articleSbts);\\r\\n\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"addVote\\\";\\r\\n });\\r\\n\\r\\n // return upVote;\\r\\n}\\r\\n\\r\\nfunction deleteVote(props) {\\r\\n const { id, upVoteId } = props;\\r\\n\\r\\n saveDeleteVote(id, upVoteId);\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n return call.functionName !== \\\"deleteVote\\\";\\r\\n });\\r\\n}\\r\\n\\r\\nconst saveDeleteVote = (id, upVoteId, onCommit, onCancel) => {\\r\\n if (id && upVoteId) {\\r\\n const newData = composeDeleteUpVoteData(id, upVoteId);\\r\\n\\r\\n Social.set(newData, {\\r\\n force: true,\\r\\n onCommit,\\r\\n onCancel,\\r\\n });\\r\\n } else {\\r\\n logError(\\\"delete upVote props are wrong\\\");\\r\\n }\\r\\n};\\r\\n\\r\\nfunction composeDeleteUpVoteData(id, upVoteId) {\\r\\n const data = {\\r\\n index: {\\r\\n [action]: JSON.stringify({\\r\\n key: id,\\r\\n value: {\\r\\n isDelete: true,\\r\\n upVoteId,\\r\\n },\\r\\n }),\\r\\n },\\r\\n };\\r\\n\\r\\n return data;\\r\\n}\\r\\n\\r\\nconst saveUpVote = (id, articleSbts, onCommit, onCancel) => {\\r\\n if (id) {\\r\\n const newData = composeUpVoteData(id, articleSbts);\\r\\n\\r\\n Social.set(newData, {\\r\\n force: true,\\r\\n onCommit,\\r\\n onCancel,\\r\\n });\\r\\n } else {\\r\\n logError(\\\"upVote id is missing\\\");\\r\\n }\\r\\n};\\r\\n\\r\\nfunction composeUpVoteData(id, articleSbts) {\\r\\n const data = {\\r\\n index: {\\r\\n [action]: JSON.stringify({\\r\\n key: id,\\r\\n value: {\\r\\n upVoteId: `uv-${context.accountId}-${Date.now()}`,\\r\\n sbts: articleSbts,\\r\\n },\\r\\n }),\\r\\n },\\r\\n };\\r\\n\\r\\n return data;\\r\\n}\\r\\n\\r\\nfunction getUpVoteBlackListByBlockHeight() {\\r\\n return [];\\r\\n}\\r\\n\\r\\nfunction getUpVotesData(action, id, subscribe) {\\r\\n return Social.index(action, id, {\\r\\n order: \\\"desc\\\",\\r\\n subscribe,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction getupVotesNormalized(id) {\\r\\n const upVotesByVersion = Object.keys(versions).map((version, index, arr) => {\\r\\n const action = versions[version].action;\\r\\n const subscribe = index + 1 === arr.length;\\r\\n const allUpVotes = getUpVotesData(action, id, subscribe);\\r\\n if (!allUpVotes) return undefined;\\r\\n\\r\\n const validUpVotes = filterInvalidUpVotes(env, allUpVotes);\\r\\n const latestEdits = getLatestEdits(validUpVotes);\\r\\n\\r\\n const nonDeletedVotes = latestEdits.filter((vote) => {\\r\\n return !vote.value.isDelete;\\r\\n });\\r\\n return nonDeletedVotes;\\r\\n });\\r\\n if (upVotesByVersion.includes(undefined)) return undefined;\\r\\n\\r\\n return normalizeLibData(upVotesByVersion);\\r\\n}\\r\\n\\r\\nfunction getLatestEdits(upVotes) {\\r\\n return upVotes.filter((obj) => {\\r\\n const userLatestInteraction = upVotes.find(\\r\\n (vote) => vote.accountId === obj.accountId\\r\\n );\\r\\n return JSON.stringify(userLatestInteraction) === JSON.stringify(obj);\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterInvalidUpVotes(env, upVotes) {\\r\\n return upVotes\\r\\n .filter((upVote) => upVote.value.upVoteId) // Has id\\r\\n .filter(\\r\\n (upVote) =>\\r\\n !getUpVoteBlackListByBlockHeight().includes(upVote.blockHeight) // Blockheight is not in blacklist\\r\\n );\\r\\n}\\r\\n\\r\\nfunction getUpVotes(props) {\\r\\n const { sbtsNames: articleSbts, id } = props;\\r\\n // Call other libs\\r\\n const normUpVotes = getupVotesNormalized(id);\\r\\n if (!normUpVotes) return undefined;\\r\\n\\r\\n const lastUpVotesAuthors = normUpVotes.map((upVote) => {\\r\\n return upVote.accountId;\\r\\n });\\r\\n setAreValidUsers(lastUpVotesAuthors, articleSbts);\\r\\n\\r\\n lastUpVotesAuthors.forEach((accountId) => {\\r\\n resultFunctionsToCall = resultFunctionsToCall.filter((call) => {\\r\\n const discardCondition =\\r\\n call.functionName === \\\"getUpVotes\\\" &&\\r\\n state[`isValidUser-${accountId}`] !== undefined;\\r\\n return !discardCondition;\\r\\n });\\r\\n });\\r\\n\\r\\n const finalUpVotes = filterValidUpVotes(normUpVotes, articleSbts);\\r\\n const finalUpVotesMapped = {};\\r\\n\\r\\n articleSbts.forEach((sbt) => {\\r\\n finalUpVotesMapped[sbt] = finalUpVotes;\\r\\n });\\r\\n\\r\\n return finalUpVotesMapped;\\r\\n}\\r\\n\\r\\nfunction filterValidator(upVotes, articleSbts) {\\r\\n return upVotes.filter((upVote) => {\\r\\n return (\\r\\n articleSbts.find((sbt) => {\\r\\n return (\\r\\n state[`isValidUser-${upVote.accountId}`][sbt] || sbt === \\\"public\\\"\\r\\n );\\r\\n }) !== undefined\\r\\n );\\r\\n });\\r\\n}\\r\\n\\r\\nfunction filterValidUpVotes(upVotes, articleSbts) {\\r\\n let filteredUpVotes = filterValidator(\\r\\n filteredUpVotes ?? upVotes,\\r\\n articleSbts\\r\\n );\\r\\n\\r\\n return filteredUpVotes;\\r\\n}\\r\\n\\r\\n// END LIB FUNCTIONS\\r\\n\\r\\n// EDIT: set functions you want to export\\r\\nfunction callFunction(call) {\\r\\n if (call.functionName === \\\"canUserUpVote\\\") {\\r\\n return canUserUpVote(call.props);\\r\\n } else if (call.functionName === \\\"addVote\\\") {\\r\\n return addVote(call.props);\\r\\n } else if (call.functionName === \\\"deleteVote\\\") {\\r\\n return deleteVote(call.props);\\r\\n } else if (call.functionName === \\\"getUpVotes\\\") {\\r\\n return getUpVotes(call.props);\\r\\n }\\r\\n}\\r\\n\\r\\n// EDIT: set versions you want to handle, considering their action to Social.index and the way to transform to one version to another (normalization)\\r\\nfunction normalizeOldToV_0_0_1(upVote) {\\r\\n return upVote;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_1ToV0_0_2(upVote) {\\r\\n upVote.sbts = [\\\"public\\\"];\\r\\n return upVote;\\r\\n}\\r\\n\\r\\nfunction normalizeFromV0_0_2ToV0_0_3(upVote) {\\r\\n return upVote;\\r\\n}\\r\\n\\r\\nconst versions = {\\r\\n old: {\\r\\n normalizationFunction: normalizeOldToV_0_0_1,\\r\\n action: props.isTest ? `test_${baseAction}` : baseAction,\\r\\n },\\r\\n \\\"v0.0.1\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_1ToV0_0_2,\\r\\n action: props.isTest ? `test_${baseAction}-v0.0.1` : `${baseAction}-v0.0.1`,\\r\\n },\\r\\n \\\"v0.0.2\\\": {\\r\\n normalizationFunction: normalizeFromV0_0_2ToV0_0_3,\\r\\n action: props.isTest ? `test_${baseAction}_v0.0.2` : `${baseAction}_v0.0.2`,\\r\\n },\\r\\n};\\r\\n\\r\\nfunction normalizeLibData(libDataByVersion) {\\r\\n let libData;\\r\\n\\r\\n Object.keys(versions).forEach((version, index, array) => {\\r\\n const normFn = versions[version].normalizationFunction;\\r\\n const normLibData = libDataByVersion[index].map((libData, i) => {\\r\\n return normFn(libData);\\r\\n });\\r\\n\\r\\n if (index + 1 === array.length) {\\r\\n // Last index\\r\\n libData = normLibData;\\r\\n return;\\r\\n }\\r\\n libDataByVersion[index + 1] =\\r\\n libDataByVersion[index + 1].concat(normLibData);\\r\\n });\\r\\n\\r\\n return libData;\\r\\n}\\r\\n\\r\\nif (functionsToCall && functionsToCall.length > 0) {\\r\\n const updateObj = Object.assign({}, functionsToCallByLibrary);\\r\\n resultFunctionsToCall = [...functionsToCall];\\r\\n functionsToCall.forEach((call) => {\\r\\n updateObj[call.key] = callFunction(call);\\r\\n });\\r\\n\\r\\n resultFunctionsToCallByLibrary[libName] = resultFunctionsToCall;\\r\\n updateObj.functionsToCallByLibrary = resultFunctionsToCallByLibrary;\\r\\n stateUpdate(updateObj);\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n libStateUpdate,\\r\\n state.functionsToCallByLibrary,\\r\\n {},\\r\\n `lib.${libName}`\\r\\n );\\r\\n })}\\r\\n </>\\r\\n);\\r\\n",
"Element.User": "const accountId = props.accountId ?? context.accountId ?? \\\"sking.near\\\";\\nconst options = props.options ?? {};\\nconst href = props.href ?? `#/mob.near/widget/ProfilePage?accountId=${accountId}`;\\n\\nconst showHumanBadge = options.showHumanBadge ?? true;\\nconst showImage = options.showImage ?? true;\\nconst showSocialName = options.showSocialName ?? true;\\nconst size = options.size ?? \\\"md\\\";\\nconst shortenLength = options.shortenLength ?? 50;\\nconst fontSize = options.fontSize;\\n\\nlet profile = Social.getr(`${accountId}/profile`);\\nif (profile) {\\n State.init({ profile: profile });\\n}\\n\\nlet isHuman = false;\\nif (showHumanBadge) {\\n const userSBTs = Near.view(\\n \\\"registry.i-am-human.near\\\",\\n \\\"sbt_tokens_by_owner\\\",\\n {\\n account: accountId,\\n },\\n );\\n if (userSBTs) {\\n userSBTs.forEach((sbt) => {\\n if (\\\"fractal.i-am-human.near\\\" === sbt[0]) {\\n isHuman = true;\\n }\\n });\\n }\\n}\\n\\nconst A = styled.a`\\n img {\\n vertical-align: baseline;\\n }\\n`;\\n\\nfunction makeAccountIdShorter(accountId) {\\n if (accountId.length > shortenLength) {\\n return accountId.slice(0, shortenLength) + \\\"...\\\";\\n }\\n return accountId;\\n}\\n\\nreturn (\\n <A\\n className=\\\"d-flex text-decoration-none align-items-center\\\"\\n href={href}\\n target=\\\"_blank\\\"\\n >\\n {showImage && (\\n <Widget\\n src=\\\"mob.near/widget/ProfileImage\\\"\\n props={{\\n profile,\\n accountId: accountId,\\n className: \\\"float-start d-inline-block me-2\\\",\\n imageClassName: \\\"rounded-circle w-100 h-100\\\",\\n style: {\\n width: size === \\\"sm\\\" ? 20 : 36,\\n height: size === \\\"sm\\\" ? 20 : 36,\\n },\\n }}\\n />\\n )}\\n <div\\n className={\\n size == \\\"sm\\\"\\n ? \\\"d-flex flex-row gap-1 align-items-center\\\"\\n : \\\"d-flex flex-column\\\"\\n }\\n >\\n <p\\n style={{\\n fontWeight: \\\"700\\\",\\n fontSize: fontSize ?? (size === \\\"sm\\\" ? 12 : 15),\\n textDecotarion: \\\"none\\\",\\n color: \\\"#000\\\",\\n }}\\n className=\\\"d-inline-flex align-items-center gap-1 m-0\\\"\\n >\\n {showSocialName\\n ? profile.name\\n ? makeAccountIdShorter(profile.name)\\n : makeAccountIdShorter(accountId)\\n : makeAccountIdShorter(accountId)}\\n\\n {showHumanBadge && isHuman && (\\n <img\\n height={size === \\\"sm\\\" ? 15 : 20}\\n width={size === \\\"sm\\\" ? 15 : 20}\\n src=\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAABDCAYAAADHyrhzAAAACXBIWXMAAC4jAAAuIwF4pT92AAAL4ElEQVR4nO1cb2wUxxX/vcPrb9vQpknI3Yc2aYkPUqKQxGcakpL6aEtVKvloIaHIB7LiXSQ7ihSkYOxI5AN/mlRERbEjdh1Z9lktkATOyHxwW59bJUDDHQkNVPgubhMJZAeogKT3cUe7/XB3Zm48t3tn7kgq5Ukj0Lw377357cx7b2ZvTY7joJY0efJnEQB+ACNLVv5puqbGbpGolmCk31u7B0AL17Ul+OTxZM0M3iL5aqmcbKWFbAVca/Ee9eVRXS2Vk62IXWGZ3Md/3RAAEAAw+cCP38rW0ic3qu3KcJQJchRwTZ2a2BTiZaYmNoXJUf5CjjJIjjI+NbEpWEuf3KimYPhsJeGzFQgtLMh0cjzVZyudtfTJ1d9aKie7fpzseggtLMioAr/5kz9rai39KkU1BeP+n5pZspWMEET9n451zG4FspWkwAfZyupa+lWKagoGAJCjxIW4AXJubhVylISE31hrv2RUezBsJeH25L/7898nyFayAl+adWpNVQPj4mh39OJo9+mLo90XLo527yj0f+cXv5smW5kRJttwcbQ7UJAhW0kJfPXiaHdVALk42l12/KkKGJeO7QySrXSRraj5ybReOrZzNoWWWB3hcvnz9enSsZ1xspXTl47tjF86tjN66dhOV2CqAobPrv+Gz66H0MIcPy7hqxx/XMIPya2V7dMSn13fkNfV4LPru3x2/fh0fHdHyTG3YrBA5CiTbkEyEOlJk6PMCPw0x8+So6QEvn/m6KvzLsACkZ44OcowOUqWL/rIUTpmjr4anzn66pxVUhUw/OtezJJdlyG7Dlzzf/bOa1wKrdtMdt0E2XUpsut6/OteTPA6yK5LCONBdl3kFv3a61/3YhPZdT15uwW9DWTXxT5757UiQKp2NiG7Pg6gS+gOA0gDwL2/fmEaQMnqkuz6hGT8vLbK5bd6o5zt+L0bXogDiOf7CzYaAMQuv9UbXbShMwtUMZuUqBekxdOVw0bkymGj48phYzajLNrQOU2OkhHGN/Ay5dCVw0aIHKWLHKWRHKWVHOXolcNG75XDhrpoQ2eMHKWH10/OzfK/amDc87QuTaFXDw4UTebqwYFespXdZCsdZCtHrx4c8KpGK8oq9zytJ8lWJgQdzWQr41cPDgTveVqPk630cLzWgo9VLbrKSZF5x2brCbKVKMeLVyPF3r2xrZNsZR3Zyohga+g/fxhW797YFhdqmw5gnmBcGz4UujZ8qOPa8KGiaO+zlbjklBoSZEry79rUmvbZyozAb7w2fKjig9tdm1rTd21q7fbZyhafrWS5U/HevB994km6YjCuDx3ZQbYyWFjm14eOzD65O1ufSUu2SvP1oSOzk5EsYf/1oSP8VnEt3yulO1ufSZKtPCf4E8z3Fw6R6vWhI8GKwSCnvoWcenAtKvCTAh/k1K/24Ec8+HO2yo3BUfXG4OieG4OjQzcGR3fcGBwtuXq+tflXSXLqR0R75NRPcn1LKgdj7qGq8fOBMf7Jz6f0nt0q39zyS9nBrVnixw7K3bE2kq20kselkBA/gvm+WN5WlmxlfD5guN4/LGxbI5tMI8efprl3HA1fvJngD25zAPvizYQYiEOCjOtl88K2NUner3xfmmxlM9nK5oVta7IVg+E4CxKOswBCCwsyKYGvft7/tzDHH3fTIRkvs5GW2HAt3x1nwWbHWTDiOAtmV9Edz4bTdzwbTgPzCKAL259KMFCWgcC1ossYBkoIfDBQ2IMf4fjjbuPzMkk3HSV8Ty9sf6p7YftT0hv4eaVWBkoJTqiX+9/lJyubzGxc+Hb7qjQDzQj8hsv976p5fpaBJiQ2gpwNV8DnQ/MCwwIlLBCENuvIovYfZS1QSuD7L/W/F/TQsZrjJyX8CGdj2gJl3GzcFjAYMM5y//ItJMgkJDLcVkBSwg97jBe2CuJeflRCPgCY6j8RmOo/sWOq/0TUawAA3Nf+ZFayVfxT/Se8lnGI0yGLPc0cf5qBMh42Ko4bnmAw0BADtTJQERiT/SdLouwVBBe3PyGbTMNk/8mAm47J/pN87Im7Abq4/Qlp7OFtVATGOfNUyHLIbzkEyyEVAM6ZpwLnzFOnLYcGz5mnpEHJciiRH8O3kCCTlMiEOX7Kgy8bH6nUj7LBYKAwh+oIADBQlIHUfJ80ID2kPS598rxMiSdbdgp9SHtc+uQ/NP8e8LAxr6zis0BBLhonAMAChbi+VKnBsojP0yPaD9MWaEaQaThtvq/m+VkLNCHw1dPm+15ZJyTYyAr85oKNisBgQKAQiZu0FUnk/t8g9smIAb0MyHCRvEciI8sKqz34EQ++mFVcbVQABvkLy+um8ptLzo1WaiuyK7UVEQZax0BNK7UVcVGmRMQPl8tfqa1ISrKOKtiQBfOKX1H6eEOVglGgVVpTepXWJC1xV2lNril0ldYkTaEJM8mn0JjAj0ls3HLc8FmgdGGvjZmpIADwlV2hz43GzJQ6ZqaGxszUhTEzdXrMTBVHfMm+HzNTYY4fd4sLYS3UZ4HWWaA+C/STsBYqes2Q1zEn9vA2ygKDAdNi9SZUh54/HmFAhAGNeXmVCVf+DEh5VJuyarQI0DVaY3qN1tjHgOBxMxU9bqaKaokScaOiFOtjxZVkNKe4aFk2j5hnXKs6Lg3P7ukR84zXwW12Mmu1RlkK9Yt2RswzexjodQbqYqCjI+aZgIeNylaGBRrnUpP/bfODcIv22LQFGuGWnOvFiSR9Fh3cWrTHZCk0K+gQt8qIxE4Lvw0srmLO25hzOHzb/KDsatS3Xns0K6yEPQfND1UG2ssFNte4Uc5TYaBe7unPMFAvz1+vPdrHQD0M1MdAv12vPbpXYkdsQYEvy0xln2Lr8kpiyO1RPwAVQKxVWx4ZNs9GASwB4Kpwo/ZIdtg8OwGAv6tUh82zoVZteTIvk4ZH7t+oPTInNfPEQBnkXgsWSARDViAGAcwJuDKqA4BWbXl2wDzbDWAw399Q6AeQzDdXsnIGxYvbsDh2wDyrAtiB3O8+k23a8r5yHM3b+K/QpXrwK6LZ+4w2bXmSOdTDHMowhyr+YSpzKMkcgtDmBDDmUC9zqIU51Mgc6jCNf5R1bZAfGxT0Z3h+m7Y8LfGh7DkUXe5o+sNxTX84oukPN5Wt4eZYafH0hvGRuJQbBZmywHjD+CgsyVrTgkxAEjPKnkNV37V6FU95GTHz+Pcb51wB2W+cUy3QDonuolhggQISmbL9ryoYJaJ5RJARS2swUNc+47wUkH3G+UB+jF8Yk2WgcUF3UKJ7plz/q/pD+m36svQrxvkZ5LJSgRpeMc4HtuvLpnMOIw4gKsgAQNcrOUDiAFLIBdhGFH+iwVNsu76sKLaVqDgny/W/6r8DLXH/MBtIt+vLshaoW7acLZDfAnVYoEELtFsosviW2a4vK8pCu4x/qhaoWSzstuvL0nO9lFPVwWDym6eiLfCS/oNkvsCSFVJeLSMLuix3OyfKllVfFKjqYLysPyg9Z7xkXIgKcnEG2iKRdWsTDBR9WX+waHu8ZFxQv5JgACWDZEeXMVl0TtilL00yUCRfgruBMsFAW3bpSzt36Uvn1EAsd3QQ0+7MLn1pRWDU5Bu1bcakilwgFINkBkB0n75EWtRty4FVaNMAsE9f4lr9bjMmIwB2S1g9+/QlruW9SDX7YO95Ix0G8LqElQEQ3a8Hb/nzq+eNdCkgUvv14OZK9dXsq4L9ejDB5r48BgM1MFCsw8jM60VPgTqMTAcD7ZbozzJQ93x01vRTTs34WAUQQ/FJs0DZPC9m6g+UvUo04+MQcgc9mU4AeM7UH6goVhSopmAAQJsx5QYIkANlBEB8QF8srQnajKkAcgVVC3KFWCnqGdAXVxQneKo5GAAQPeAJCE/inUQAcwOxjHpiW+cPBHCbwACA3xz4V+Eeo9of+s4A6Pzj1u+XXWmWotsGRoHWH/h3CMAelPe0vagPQOztrd+ryofBtx2MAkUOfBKBdwyQUSHGxOJb76/qHxr40sAo0NoDnwaQux4MIRcfxLgyg1wBlgSQOr71vpr9YYEvHYyvEtX8U87/J/oaDI6+BoOj/wGQFzml0gpKIAAAAABJRU5ErkJggg==\\\"\\n alt=\\\"Verified Human\\\"\\n />\\n )}\\n </p>\\n {showSocialName && profile.name ? (\\n <>\\n <span\\n style={{\\n margin: \\\"0\\\",\\n fontWeight: \\\"700\\\",\\n fontSize: 18,\\n textDecotarion: \\\"none\\\",\\n color: \\\"#000\\\",\\n }}\\n >\\n {size === \\\"sm\\\" ? \\\"\\u{2022}\\\" : \\\"\\\"}\\n </span>\\n <p\\n style={{\\n margin: \\\"0\\\",\\n fontWeight: \\\"500\\\",\\n textDecoration: \\\"none\\\",\\n fontSize: fontSize ?? (size === \\\"sm\\\" ? 12 : 15),\\n color: \\\"#828688\\\",\\n opacity: 0.8,\\n lineHeight: 0.85,\\n }}\\n >\\n {makeAccountIdShorter(accountId)}\\n </p>\\n </>\\n ) : null}\\n </div>\\n </A>\\n);\\n",
"Input.Button": "const children = props.children ?? \\\"Button\\\";\\nconst onClick = props.onClick ?? (() => {});\\nconst href = props.href;\\nconst disabled = props.disabled;\\nconst variant =\\n typeof props.variant === \\\"string\\\"\\n ? props.variant\\n : Array.isArray(props.variant)\\n ? props.variant.join(\\\" \\\")\\n : \\\"\\\"; // can have many, can be an array or separated by space similar to className: primary, secondary, danger, success, info, outline, rounded, disabled, icon\\nconst size = props.size ?? \\\"md\\\"; // sm, md, lg\\nconst className = props.className ?? \\\"\\\";\\nconst buttonProps = props.buttonProps ?? {};\\n\\nconst tag = href || buttonProps.href ? \\\"a\\\" : \\\"button\\\";\\n\\nconst Wrapper = styled[tag]`\\n display: flex;\\n flex-direction: row;\\n justify-content: center;\\n align-items: center;\\n gap: 0.5em;\\n white-space: nowrap;\\n text-decoration: none;\\n\\n width: max-content;\\n padding: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"4px 20px\\\" : size === \\\"lg\\\" ? \\\"8px 28px\\\" : \\\"6px 24px\\\"};\\n font-size: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"12px\\\" : size === \\\"lg\\\" ? \\\"16px\\\" : \\\"14px\\\"};\\n border-radius: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"8px\\\" : size === \\\"lg\\\" ? \\\"12px\\\" : \\\"10px\\\"};\\n font-weight: 600;\\n line-height: 24px;\\n text-align: center;\\n border: 1px solid transparent;\\n\\n &:hover,\\n &:focus {\\n text-decoration: none;\\n opacity: 0.85;\\n }\\n\\n &:disabled {\\n cursor: not-allowed;\\n }\\n\\n &.rounded {\\n border-radius: 100px !important;\\n }\\n\\n &.icon {\\n padding: 0;\\n width: 2.36em;\\n height: 2.36em;\\n font-size: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"14px\\\" : size === \\\"lg\\\" ? \\\"18px\\\" : \\\"16px\\\"};\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n }\\n\\n &.primary,\\n &.primary:hover {\\n color: #11181c;\\n background: #ffd50d;\\n border-color: #ffd50d;\\n\\n &.outline {\\n background: transparent;\\n color: #dab70f;\\n border-color: #ffd50d;\\n }\\n }\\n\\n &.secondary,\\n &.secondary:hover {\\n color: #fff;\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\n border-color: transparent;\\n\\n &.outline {\\n background: transparent;\\n color: #4f46e5;\\n border-color: #4f46e5;\\n }\\n\\n // &.outline {\\n // background: #fff;\\n // color: #4f46e5;\\n // border: 1px solid transparent;\\n // position: relative;\\n // background-clip: padding-box !important;\\n // opacity: 1 !important;\\n\\n // &::before {\\n // content: \\\"\\\";\\n // background-image: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\n // border-radius: inherit;\\n // top: 0;\\n // right: 0;\\n // bottom: 0;\\n // left: 0;\\n // position: absolute;\\n // z-index: -1;\\n // margin: -1px;\\n // }\\n // }\\n }\\n\\n &.danger,\\n &.danger:hover {\\n border-color: #e5484d;\\n background: #e5484d;\\n color: #fff;\\n\\n &.outline {\\n background: transparent;\\n color: #e5484d;\\n border-color: #e5484d;\\n }\\n }\\n\\n &.success,\\n &.success:hover {\\n background: #00ec97;\\n color: #11181c;\\n border-color: #00ec97;\\n\\n &.outline {\\n background: transparent;\\n color: #00ec97;\\n border-color: #00ec97;\\n }\\n }\\n\\n &.info,\\n &.info:hover {\\n background: #4498e0;\\n color: #fff;\\n border-color: #4498e0;\\n\\n &.outline {\\n background: transparent;\\n color: #4498e0;\\n border-color: #4498e0;\\n }\\n }\\n\\n &.disabled,\\n &:disabled {\\n background: #f0f0f0 !important;\\n color: #aaa !important;\\n border-color: #f0f0f0 !important;\\n\\n &.outline {\\n background: transparent !important;\\n color: #aaa !important;\\n border-color: #aaa !important;\\n }\\n }\\n`;\\n\\nreturn (\\n <Wrapper\\n onClick={onClick}\\n className={`${variant} ${className}`}\\n href={href ?? buttonProps.href}\\n disabled={disabled ?? buttonProps.disabled ?? false}\\n size={size}\\n {...buttonProps}\\n >\\n {children}\\n </Wrapper>\\n);\\n",
"Input.Select": "const label = props.label;\\nconst placeholder = props.placeholder ?? \\\"\\\";\\nconst value = props.value;\\nconst options = props.options ?? [\\n {\\n title: \\\"Example 1\\\",\\n value: 1,\\n },\\n {\\n title: \\\"Example 2\\\",\\n value: 2,\\n default: true,\\n },\\n {\\n title: \\\"Example 3\\\",\\n value: 3,\\n },\\n];\\nconst onChange = props.onChange ?? (() => {});\\nconst validate = props.validate ?? (() => {});\\nconst error = props.error;\\nconst selectProps = props.selectProps ?? {};\\nconst disabled = props.disabled;\\nconst size = props.size ?? \\\"md\\\"; // sm, md, lg\\nconst className = props.className ?? \\\"\\\";\\n\\nconst Container = styled.div`\\n display: flex;\\n flex-direction: column;\\n align-items: flex-start;\\n padding: 0px;\\n gap: 0.45em;\\n width: max-content;\\n flex: 1;\\n min-width: 140px;\\n width: 100%;\\n`;\\n\\nconst Label = styled.label`\\n font-style: normal;\\n font-weight: 600;\\n font-size: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"0.8em\\\" : size === \\\"lg\\\" ? \\\"1.1em\\\" : \\\"0.95em\\\"};\\n line-height: 1.25em;\\n color: #344054;\\n`;\\n\\nconst Error = styled.span`\\n display: inline-block;\\n font-style: normal;\\n font-weight: 400;\\n font-size: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"0.65em\\\" : size === \\\"lg\\\" ? \\\"0.85em\\\" : \\\"0.75em\\\"};\\n line-height: 1.25em;\\n color: #ff4d4f;\\n height: 0;\\n overflow: hidden;\\n transition: height 0.3s ease-in-out;\\n\\n &.show {\\n height: 1.25em;\\n }\\n`;\\n\\nconst InputContainer = styled.div`\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n gap: 0.5em;\\n background: #ffffff;\\n border: 1px solid #d0d5dd;\\n box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);\\n color: #101828;\\n background: #fff;\\n position: relative;\\n width: 100%;\\n\\n font-size: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"12px\\\" : size === \\\"lg\\\" ? \\\"16px\\\" : \\\"14px\\\"};\\n border-radius: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"8px\\\" : size === \\\"lg\\\" ? \\\"12px\\\" : \\\"10px\\\"};\\n\\n &.disabled {\\n background: #f5f5f5;\\n opacity: 0.7;\\n }\\n`;\\n\\nconst Select = styled.select`\\n border: none;\\n background: transparent;\\n font-size: inherit;\\n color: inherit;\\n font-family: inherit;\\n font-weight: 500;\\n width: 100%;\\n border-radius: inherit;\\n padding: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"0 15px\\\" : size === \\\"lg\\\" ? \\\"0 23px\\\" : \\\"0 18px\\\"};\\n height: ${({ size }) =>\\n size === \\\"sm\\\" ? \\\"32px\\\" : size === \\\"lg\\\" ? \\\"40px\\\" : \\\"36px\\\"};\\n\\n option {\\n font-size: inherit;\\n color: inherit;\\n font-family: inherit;\\n font-weight: 500;\\n }\\n`;\\n\\nreturn (\\n <Container>\\n {label && <Label size={size}>{label}</Label>}\\n <InputContainer\\n className={`${disabled ? \\\"disabled\\\" : \\\"\\\"} ${className}`}\\n size={size}\\n >\\n <Select\\n placeholder={placeholder}\\n value={value}\\n onChange={({ target: { value } }) => onChange(value)}\\n onBlur={() => validate()}\\n disabled={disabled}\\n size={size}\\n className={className}\\n {...selectProps}\\n >\\n {options.map((o) => (\\n <option value={o.value} default={o.default}>\\n {o.title}\\n </option>\\n ))}\\n </Select>\\n </InputContainer>\\n {error && (\\n <Error className={error ? \\\"show\\\" : \\\"\\\"} size={size}>\\n {error}\\n </Error>\\n )}\\n </Container>\\n);\\n",
"ProfileImage": "const accountId = props.accountId ?? context.accountId;\\nconst className = props.className ?? \\\"profile-image d-inline-block\\\";\\nconst style = props.style ?? { width: \\\"3em\\\", height: \\\"3em\\\" };\\nconst imageStyle = props.imageStyle ?? { objectFit: \\\"cover\\\" };\\nconst imageClassName = props.imageClassName ?? \\\"rounded-circle w-100 h-100\\\";\\nconst thumbnail = props.thumbnail ?? \\\"thumbnail\\\";\\n\\nconst profile = props.profile ?? Social.getr(`${accountId}/profile`);\\n\\nconst name = profile.name || \\\"No-name profile\\\";\\nconst image = profile.image;\\nconst title = props.title ?? `${name} @${accountId}`;\\nconst tooltip =\\n props.tooltip && (props.tooltip === true ? title : props.tooltip);\\nconst fast = props.fast || (!props.profile && !!accountId);\\nif (accountId !== state.accountId) {\\n State.update({\\n fastImageUrl: `https://i.near.social/magic/${\\n thumbnail || \\\"large\\\"\\n }/https://near.social/magic/img/account/${accountId}`,\\n accountId,\\n });\\n}\\nconst fallbackUrl =\\n \\\"https://ipfs.near.social/ipfs/bafkreibmiy4ozblcgv3fm3gc6q62s55em33vconbavfd2ekkuliznaq3zm\\\";\\n\\nconst inner = fast ? (\\n <div className={className} style={style} key={state.fastImageUrl}>\\n <img\\n className={imageClassName}\\n style={imageStyle}\\n src={state.fastImageUrl}\\n alt={title}\\n onError={() => {\\n if (state.fastImageUrl !== fallbackUrl) {\\n State.update({\\n fastImageUrl: fallbackUrl,\\n });\\n }\\n }}\\n />\\n </div>\\n) : (\\n <div className={className} style={style} key={JSON.stringify(image)}>\\n <Widget\\n loading={\\n <div\\n className={`d-inline-block ${imageClassName}`}\\n style={imgWrapperStyle}\\n />\\n }\\n src=\\\"mob.near/widget/Image\\\"\\n props={{\\n image,\\n alt: title,\\n className: imageClassName,\\n style: imageStyle,\\n thumbnail,\\n fallbackUrl,\\n }}\\n />\\n </div>\\n);\\n\\nreturn props.tooltip ? (\\n <Widget\\n loading={inner}\\n src=\\\"mob.near/widget/Profile.OverlayTrigger\\\"\\n props={{ accountId, children: inner }}\\n />\\n) : (\\n inner\\n);\\n",
"Element.Badge": "const children = props.children ?? \\\"Badge\\\";\\nconst variant = props.variant ?? \\\"\\\"; // primary, secondary, danger, success, info, outline, white, circle, round, black\\nconst size = props.size ?? \\\"md\\\"; // sm, md, lg\\nconst className = props.className ?? \\\"\\\";\\nconst otherProps = props.otherProps ?? {};\\nconst as = props.as ?? \\\"span\\\";\\n\\nconst Wrapper = styled[as]`\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n gap: 4px;\\n padding: 4px 12px;\\n font-size: 12px;\\n line-height: 16px;\\n white-space: nowrap;\\n text-align: center;\\n vertical-align: baseline;\\n border-radius: 10px;\\n font-weight: 600;\\n line-height: 1;\\n border: 1px solid transparent;\\n\\n &.circle {\\n padding: 0;\\n width: 1.7em;\\n height: 1.7em;\\n }\\n\\n &.sm {\\n padding: 3px 8px;\\n font-size: 10px;\\n border-radius: 6px;\\n }\\n\\n &.md {\\n padding: 4px 14px;\\n font-size: 12px;\\n border-radius: 8px;\\n }\\n\\n &.lg {\\n padding: 6px 20px;\\n font-size: 14px;\\n border-radius: 10px;\\n }\\n\\n &.primary {\\n color: #11181c;\\n background: #ffd50d;\\n border-color: #ffd50d;\\n\\n &.outline {\\n background: #ffd50d10;\\n color: #dab70f;\\n border-color: #ffd50d;\\n }\\n }\\n\\n &.secondary {\\n color: #fff;\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\n border-color: transparent;\\n\\n &.outline {\\n background: #9333ea10;\\n color: #9333ea;\\n border-color: #9333ea;\\n }\\n }\\n\\n &.danger {\\n border-color: #e5484d;\\n background: #e5484d;\\n color: #fff;\\n\\n &.outline {\\n background: #e5484d10;\\n color: #e5484d;\\n border-color: #e5484d;\\n }\\n }\\n\\n &.success {\\n background: #82e299;\\n color: #11181c;\\n border-color: #82e299;\\n\\n &.outline {\\n background: #82e29910;\\n color: #82e299;\\n border-color: #82e299;\\n }\\n }\\n\\n &.info {\\n background: #4498e0;\\n color: #fff;\\n border-color: #4498e0;\\n\\n &.outline {\\n background: #4498e010;\\n color: #4498e0;\\n border-color: #4498e0;\\n }\\n }\\n\\n &.white {\\n background: #fff;\\n color: #11181c;\\n border-color: #fff;\\n\\n &.outline {\\n background: transparent;\\n color: #11181c;\\n border-color: #eee;\\n }\\n }\\n\\n &.black {\\n background: #11181c;\\n color: #fff;\\n border-color: #11181c;\\n\\n &.outline {\\n background: transparent;\\n color: #11181c;\\n border-color: #11181c;\\n }\\n }\\n\\n &.disabled {\\n background: #efefef;\\n color: #11181c;\\n border-color: #efefef;\\n\\n &.outline {\\n background: transparent;\\n color: #11181c;\\n border-color: #efefef;\\n }\\n }\\n\\n &.round {\\n border-radius: 100px;\\n }\\n`;\\n\\nreturn (\\n <Wrapper className={`${variant} ${size} ${className}`} {...otherProps}>\\n {children}\\n </Wrapper>\\n);\\n",
"NDC.Reactions": "// NDC.Reactions\\n\\nconst {\\n isTest,\\n authorForWidget,\\n elementReactedId,\\n widgets,\\n disabled,\\n sbtsNames,\\n callLibs,\\n baseActions,\\n} = props;\\n// Don\\\'t forget to put space between emoji and text -> \\\"\\u{2764}\\u{fe0f} Positive\\\"\\nconst initialEmoji = \\\"\\u{1f90d} Like\\\";\\n// It is important that \\\'Heart\\\' Positive emoji is first\\nconst emojiArray = [\\n \\\"\\u{2764}\\u{fe0f} Positive\\\",\\n \\\"\\u{1f64f} Thank you\\\",\\n \\\"\\u{1f4af} Definitely\\\",\\n \\\"\\u{1f440} Thinking\\\",\\n \\\"\\u{1f525} Awesome\\\",\\n \\\"\\u{1f44d} Like\\\",\\n \\\"\\u{1f64c} Celebrate\\\",\\n \\\"\\u{1f44f} Applause\\\",\\n \\\"\\u{26a1} Lightning\\\",\\n \\\"\\u{22c8} Bowtie\\\",\\n];\\n\\nconst accountThatIsLoggedIn = context.accountId;\\n\\nconst libSrcArray = [widgets.libEmojis];\\n\\nconst initLibsCalls = {\\n emojis: [\\n {\\n functionName: \\\"getEmojis\\\",\\n key: \\\"reactionsData\\\",\\n props: {\\n elementReactedId,\\n sbtsNames,\\n },\\n },\\n ],\\n};\\n\\nState.init({\\n emoji: undefined,\\n reactionsData: { reactionsStatistics: [], userReaction: undefined },\\n // reactionsData: {},\\n show: false,\\n loading: false,\\n functionsToCallByLibrary: initLibsCalls,\\n});\\n\\n// ================= Mouse Handlers ===============\\n\\nfunction handleOnMouseEnter() {\\n if (!disabled) {\\n State.update({ show: true });\\n }\\n}\\n\\nfunction handleOnMouseLeave() {\\n State.update({ show: false });\\n}\\n\\nfunction onPushEnd() {\\n State.update({ loading: false, show: false });\\n}\\n\\nfunction reactListener(emojiToWrite) {\\n if (state.loading || disabled) {\\n return;\\n }\\n\\n // decide to put unique emoji or white heart (unreaction emoji)\\n // const emojiToWrite =\\n // emojiMessage === initialEmoji ? emojiArray[0] : emojiMessage;\\n\\n const newLibsCalls = Object.assign({}, state.functionsToCallByLibrary);\\n\\n newLibsCalls.emojis.push({\\n functionName: \\\"createEmoji\\\",\\n key: \\\"createReaction\\\",\\n props: {\\n elementReactedId,\\n reaction: emojiToWrite,\\n articleSbts: sbtsNames,\\n onCommit: onPushEnd,\\n onCancel: onPushEnd,\\n },\\n });\\n State.update({ functionsToCallByLibrary: newLibsCalls, loading: true });\\n}\\n\\nfunction reactionsStateUpdate(obj) {\\n State.update(obj);\\n}\\n\\n// =============== CSS Styles ===============\\nconst Button = styled.button`\\n min-width: fit-content;\\n background: transparent;\\n display: inline-flex;\\n align-items: center;\\n justify-content: start;\\n height: 2.5em;\\n padding: 6px 12px;\\n margin: 2px 0;\\n border: 0;\\n border-radius: .375rem;\\n ${\\n !disabled &&\\n `:hover {\\n background: #EBEBEB; \\n outline: 1px solid #C6C7C8;\\n }`\\n }\\n \\n`;\\n\\nconst SmallReactButton = styled.button`\\n background: transparent;\\n display: inline-flex;\\n align-items: center;\\n justify-content: start;\\n width: fit-content;\\n height: 2.5em;\\n padding: 6px 12px;\\n margin: 2px 0;\\n border: 0;\\n border-radius: .375rem;\\n ${\\n !disabled &&\\n `:hover {\\n background: #EBEBEB; \\n outline: 1px solid #C6C7C8;\\n }`\\n }\\n`;\\n\\nconst SmallButton = styled.button`\\nposition: relative;\\n border: 0;\\n background: transparent;\\n width: 35px;\\n height: 35px;\\n color: ${({ isHeart }) => (isHeart ? \\\"red\\\" : \\\"\\\")};\\n`;\\n\\nconst SmallButtonSpan = styled.span`\\n font-size: 19px;\\n :hover{\\n position: absolute;\\n font-size: 35px;\\n bottom: -5px;\\n width: 35px;\\n height: 40px;\\n transform: translateX(-50%) translateY(-50%);\\n }\\n \\n @media (max-width: 599px) {\\n ::before { \\n position: absolute;\\n width: 100%;\\n height: 100%;\\n background-color: rgba(255, 255, 255, .4);\\n content: \\\"\\\";}\\n :hover{\\n ::before { \\n position: absolute;\\n width: 100%;\\n height: 120%;\\n background-color: rgba(255, 255, 255, .4);\\n content: \\\"\\\";}\\n }\\n \\n }\\n`;\\n\\n// =============== NEW CSS Styles ===============!!!!!!!!\\nconst EmojiWrapper = styled.div`\\n display: inline-block;\\n position: relative;\\n overflow: visible !important;\\n padding-left: 8px;\\n`;\\n\\nconst EmojiListWrapper = styled.div`\\n display: flex;\\n flex-wrap: wrap;\\n padding: 0.5rem;\\n \\n background: white;\\n border-radius: 1rem;\\n box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;\\n position: absolute;\\n right: 0;\\n width: 370px;\\n max-width: 35vw;\\n flex-wrap: wrap;\\n display: ${({ show }) => (show ? \\\"flex\\\" : \\\"none\\\")};\\n transform: translateY(-10%);\\n zIndex: 2;\\n`;\\n\\nconst SpinnerContainer = styled.div`\\n height: 1rem;\\n width: 1rem;\\n marginTop: 2px;\\n`;\\n\\nconst CallLibrary = styled.div`\\n display: none;\\n`;\\n\\n// =============== NEW JSX ===============!!!!!!!!\\nconst Overlay = () => {\\n return (\\n <EmojiListWrapper\\n onMouseEnter={handleOnMouseEnter}\\n onMouseLeave={handleOnMouseLeave}\\n show={state.show}\\n >\\n {emojiArray &&\\n emojiArray.map((item) => {\\n return (\\n <SmallButton\\n onClick={() => reactListener(item)}\\n isHeart={index === 0}\\n >\\n <OverlayTrigger\\n placement=\\\"top\\\"\\n overlay={\\n <Tooltip>\\n <div className=\\\"text-truncate text-start\\\">\\n {item.slice(2)}\\n </div>\\n </Tooltip>\\n }\\n >\\n <SmallButtonSpan>{item.slice(0, 2)}</SmallButtonSpan>\\n </OverlayTrigger>\\n </SmallButton>\\n );\\n })}\\n </EmojiListWrapper>\\n );\\n};\\n\\nconst Spinner = () => {\\n return (\\n <SpinnerContainer className=\\\"spinner-border text-secondary\\\" role=\\\"status\\\">\\n <span className=\\\"sr-only\\\" title=\\\"Loading...\\\"></span>\\n </SpinnerContainer>\\n );\\n};\\n\\nconst renderReaction = (item, isInButton) => {\\n return (\\n ((item.accounts.includes(context.accountId) && isInButton) ||\\n (!item.accounts.includes(context.accountId) && !isInButton)) && (\\n <span>\\n <Widget\\n src={widgets.wikiOnSocialDB_TooltipProfiles}\\n className={isInButton ? \\\"ps-3\\\" : \\\"\\\"}\\n props={{ accounts: item.accounts, emoji: item.emoji }}\\n />\\n </span>\\n )\\n );\\n};\\n\\nreturn (\\n <>\\n <EmojiWrapper>\\n {!disabled && (\\n <>\\n {state.reactionsData.userReaction ? (\\n <SmallReactButton\\n onMouseEnter={handleOnMouseEnter}\\n onMouseLeave={handleOnMouseLeave}\\n >\\n {state.loading && <Spinner />}\\n {state.reactionsData.reactionsStatistics &&\\n state.reactionsData.reactionsStatistics.map((item) =>\\n renderReaction(item, true)\\n )}\\n </SmallReactButton>\\n ) : (\\n <Button\\n onMouseEnter={handleOnMouseEnter}\\n onMouseLeave={handleOnMouseLeave}\\n >\\n {state.loading && <Spinner />}\\n {initialEmoji}\\n </Button>\\n )}\\n </>\\n )}\\n <Overlay />\\n {state.reactionsData.reactionsStatistics &&\\n state.reactionsData.reactionsStatistics.map((item) =>\\n renderReaction(item, false)\\n )}\\n </EmojiWrapper>\\n\\n <CallLibrary>\\n {libSrcArray.map((src) => {\\n return callLibs(\\n src,\\n reactionsStateUpdate,\\n state.functionsToCallByLibrary,\\n { baseAction: baseActions.reactionBaseAction },\\n \\\"Reactions\\\"\\n );\\n })}\\n </CallLibrary>\\n </>\\n);\\n",
"Input.Checkbox": "const id = props.id ?? Math.random().toString(36).substring(7);\\nconst onChange = props.onChange;\\nconst checked = props.checked || false;\\nconst disabled = props.disabled;\\nconst label = props.label;\\nconst inputProps = props.inputProps;\\n\\n/**\\n * Checkbox design By Andreas Storm\\n * https://codepen.io/avstorm/full/pXgKNB\\n */\\n\\nconst Wrapper = styled.div`\\n * {\\n box-sizing: border-box;\\n }\\n .cbx {\\n appearance: none;\\n border: none;\\n background: none;\\n text-align: start;\\n\\n -webkit-user-select: none;\\n user-select: none;\\n cursor: pointer;\\n padding: 6px 8px;\\n border-radius: 6px;\\n overflow: hidden;\\n transition: all 0.2s ease;\\n display: inline-block;\\n }\\n .cbx:not(:last-child) {\\n margin-right: 6px;\\n }\\n .cbx:hover {\\n background: rgba(0, 119, 255, 0.06);\\n }\\n .cbx span {\\n float: left;\\n vertical-align: middle;\\n transform: translate3d(0, 0, 0);\\n }\\n .cbx span:first-child {\\n position: relative;\\n width: 18px;\\n height: 18px;\\n border-radius: 4px;\\n transform: scale(1);\\n border: 1px solid #cccfdb;\\n transition: all 0.2s ease;\\n box-shadow: 0 1px 1px rgba(0, 16, 75, 0.05);\\n }\\n .cbx span:first-child svg {\\n position: absolute;\\n top: 3px;\\n left: 2px;\\n fill: none;\\n stroke: #fff;\\n stroke-width: 2;\\n stroke-linecap: round;\\n stroke-linejoin: round;\\n stroke-dasharray: 16px;\\n stroke-dashoffset: 16px;\\n transition: all 0.3s ease;\\n transition-delay: 0.1s;\\n transform: translate3d(0, 0, 0);\\n }\\n .cbx span:last-child {\\n padding-left: 8px;\\n line-height: 18px;\\n }\\n .cbx:hover span:first-child {\\n border-color: #07f;\\n }\\n .checked.cbx span:first-child {\\n background: #07f;\\n border-color: #07f;\\n animation: wave-4 0.4s ease;\\n }\\n .checked.cbx span:first-child svg {\\n stroke-dashoffset: 0;\\n }\\n .inline-svg {\\n position: absolute;\\n width: 0;\\n height: 0;\\n pointer-events: none;\\n user-select: none;\\n }\\n @media screen and (max-width: 640px) {\\n .cbx {\\n width: 100%;\\n display: inline-block;\\n }\\n }\\n @-moz-keyframes wave-4 {\\n 50% {\\n transform: scale(0.9);\\n }\\n }\\n @-webkit-keyframes wave-4 {\\n 50% {\\n transform: scale(0.9);\\n }\\n }\\n @-o-keyframes wave-4 {\\n 50% {\\n transform: scale(0.9);\\n }\\n }\\n @keyframes wave-4 {\\n 50% {\\n transform: scale(0.9);\\n }\\n }\\n`;\\n\\nreturn (\\n <Wrapper>\\n <button\\n id={id}\\n type=\\\"checkbox\\\"\\n onClick={() => {\\n onChange(!checked);\\n }}\\n disabled={disabled}\\n className={`cbx ${checked ? \\\"checked\\\" : \\\"\\\"}`}\\n {...inputProps}\\n >\\n <span>\\n <svg width=\\\"12px\\\" height=\\\"10px\\\">\\n <use xlinkHref=\\\"#check-4\\\"></use>\\n </svg>\\n </span>\\n {label && <span className=\\\"label\\\">{label}</span>}\\n </button>\\n <svg className=\\\"inline-svg\\\">\\n <symbol id=\\\"check-4\\\" viewBox=\\\"0 0 12 10\\\">\\n <polyline points=\\\"1.5 6 4.5 9 10.5 1\\\"></polyline>\\n </symbol>\\n </svg>\\n </Wrapper>\\n);\\n",
"NDC.AddComment": "// NDC.AddComment\\r\\n\\r\\nconst {\\r\\n widgets,\\r\\n isTest,\\r\\n article,\\r\\n onCloseModal,\\r\\n isReplying,\\r\\n username,\\r\\n placement,\\r\\n originalComment,\\r\\n replyingTo,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nlet id;\\r\\nif (originalComment) {\\r\\n id = originalComment.originalComment.value.comment.id;\\r\\n} else {\\r\\n id = article.id ?? `${article.author}-${article.timeCreate}`;\\r\\n}\\r\\n\\r\\nconst ModalCard = styled.div`\\r\\n position: fixed;\\r\\n z-index: 1;\\r\\n left: 0;\\r\\n top: 0;\\r\\n width: 100%;\\r\\n height: 100%;\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n background: rgba(0, 0, 0, 0.7);\\r\\n`;\\r\\nconst CommentCard = styled.div`\\r\\n display: flex;\\r\\n width: 400px;\\r\\n padding: 20px;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 16px;\\r\\n border-radius: 10px;\\r\\n background: #fff;\\r\\n border: 1px solid transparent;\\r\\n margin-left: auto;\\r\\n margin-right: auto;\\r\\n margin-buttom: 50%;\\r\\n @media only screen and (max-width: 480px) {\\r\\n width: 90%;\\r\\n }\\r\\n`;\\r\\nconst H1 = styled.h1`\\r\\n color: black;\\r\\n font-size: 14px;\\r\\n font-weight: 500;\\r\\n`;\\r\\nconst Container = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-end;\\r\\n gap: 20px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst CommentBody = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 16px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst BComment = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 8px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst BCommentmessage = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 8px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst BCMHeader = styled.div`\\r\\n display: flex;\\r\\n width: 100%;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n`;\\r\\nconst BCMProfile = styled.div`\\r\\n width: 28px;\\r\\n height: 28px;\\r\\n flex-shrink: 0;\\r\\n flex-direction: row;\\r\\n border-radius: 29px;\\r\\n background: #d0d6d9;\\r\\n text-align: center;\\r\\n`;\\r\\nconst BCMProfileimg = styled.img`\\r\\n width: 28px;\\r\\n height: 28px;\\r\\n flex-shrink: 0;\\r\\n vertical-align: initial;\\r\\n`;\\r\\nconst BCMProfileUsername = styled.label`\\r\\n display: flex;\\r\\n width: 100%;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n flex-shrink: 0;\\r\\n color: #000;\\r\\n font-size: 14px;\\r\\n\\r\\n font-style: normal;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n`;\\r\\nconst BCMMessage = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-self: stretch;\\r\\n color: #686b6d;\\r\\n font-size: 14px;\\r\\n\\r\\n font-style: normal;\\r\\n font-weight: 400;\\r\\n line-height: 120%;\\r\\n`;\\r\\nconst BFooter = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n align-items: flex-start;\\r\\n gap: 4px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst BFootercont = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst BFootercontTime = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n flex: 1 0 0;\\r\\n`;\\r\\nconst BFCTimetext = styled.div`\\r\\n display: flex;\\r\\n height: 19.394px;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n flex: 1 0 0;\\r\\n color: #000;\\r\\n font-size: 14px;\\r\\n\\r\\n font-style: normal;\\r\\n font-weight: 300;\\r\\n line-height: normal;\\r\\n`;\\r\\nconst BFCButton = styled.div`\\r\\n display: flex;\\r\\n justify-content: flex-end;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n`;\\r\\nconst BFCButtonitem = styled.button`\\r\\n display: flex;\\r\\n padding: 2px 12px;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n border-radius: 4px;\\r\\n border-width: 1px;\\r\\n border: solid 1px #9333ea;\\r\\n\\r\\n background-image: linear-gradient(#fff, #fff),\\r\\n radial-gradient(circle at top left, #f0e1ce, #f0e1ce);\\r\\n background-origin: border-box;\\r\\n background-clip: padding-box, border-box;\\r\\n`;\\r\\nconst BFCBIText = styled.label`\\r\\n font-size: 12px;\\r\\n\\r\\n font-style: normal;\\r\\n font-weight: 500;\\r\\n line-height: 24px;\\r\\n color: #9333ea;\\r\\n cursor: pointer;\\r\\n`;\\r\\nconst NewComment = styled.textarea`\\r\\n width: 100%;\\r\\n display: flex;\\r\\n height: 100px;\\r\\n padding: 9px 10px 0px 10px;\\r\\n align-items: flex-start;\\r\\n\\r\\n gap: 10px;\\r\\n align-self: stretch;\\r\\n border-radius: 8px;\\r\\n border: 1px solid #d0d6d9;\\r\\n background: #fff;\\r\\n\\r\\n font-size: 12px;\\r\\n\\r\\n font-style: normal;\\r\\n font-weight: 400;\\r\\n line-height: 120%;\\r\\n`;\\r\\nconst CommentFooter = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: flex-end;\\r\\n justify-content: end;\\r\\n gap: 16px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst CFCancel = styled.button`\\r\\n display: flex;\\r\\n width: 107px;\\r\\n padding: 8px 12px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n color: #9333ea;\\r\\n border-radius: 10px;\\r\\n border-width: 1px;\\r\\n border: solid 1px #9333ea;\\r\\n\\r\\n background-image: linear-gradient(#fff, #fff),\\r\\n radial-gradient(circle at top left, #f0e1ce, #f0e1ce);\\r\\n background-origin: border-box;\\r\\n background-clip: padding-box, border-box;\\r\\n @media only screen and (max-width: 480px) {\\r\\n width: 100%;\\r\\n }\\r\\n`;\\r\\n\\r\\nconst CFSubmit = styled.button`\\r\\n display: flex;\\r\\n width: 107px;\\r\\n padding: 8px 12px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n color: #000;\\r\\n display: flex;\\r\\n width: 107px;\\r\\n padding: 8px 12px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n border-radius: 10px;\\r\\n border-width: 1px;\\r\\n border: solid 1px transparent;\\r\\n\\r\\n background-image: linear-gradient(#ffd50d, #ffd50d),\\r\\n radial-gradient(circle at top left, #f0e1ce, #f0e1ce);\\r\\n background-origin: border-box;\\r\\n background-clip: padding-box, border-box;\\r\\n @media only screen and (max-width: 480px) {\\r\\n width: 100%;\\r\\n }\\r\\n`;\\r\\n\\r\\nconst Spinner = styled.div`\\r\\n height: 1rem;\\r\\n width: 1rem;\\r\\n`;\\r\\n\\r\\nconst CallLibrary = styled.div`\\r\\n display: none;\\r\\n`;\\r\\n\\r\\nconst libSrcArray = [widgets.libComment];\\r\\n\\r\\nfunction stateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\nState.init({\\r\\n theme,\\r\\n reply: \\\"\\\",\\r\\n cancel: false,\\r\\n e_message: \\\"\\\",\\r\\n functionsToCallByLibrary: {\\r\\n comment: [],\\r\\n },\\r\\n});\\r\\n\\r\\nconst SetText = (txt) => {\\r\\n State.update({ shareText: txt });\\r\\n};\\r\\n\\r\\nconst renderSpinner = () => {\\r\\n return <Spinner className=\\\"spinner-border\\\" role=\\\"status\\\"></Spinner>;\\r\\n};\\r\\n\\r\\nfunction onCommit() {\\r\\n State.update({ showSpinner: false });\\r\\n onCloseModal();\\r\\n}\\r\\n\\r\\nfunction onCancel() {\\r\\n State.update({ showSpinner: false });\\r\\n}\\r\\n\\r\\nfunction onClickAddComment() {\\r\\n State.update({ showSpinner: true });\\r\\n}\\r\\n\\r\\nfunction addCommentListener() {\\r\\n const newLibCalls = Object.assign({}, state.functionsToCallByLibrary);\\r\\n\\r\\n const comment = {\\r\\n text: state.reply,\\r\\n id,\\r\\n timestamp: Date.now(),\\r\\n originalCommentId:\\r\\n originalComment.originalComment.value.comment.commentId ??\\r\\n article.id ??\\r\\n `${article.author}-${article.timeCreate}`,\\r\\n commentId: comment.commentId ?? `c_${context.accountId}-${Date.now()}`,\\r\\n };\\r\\n newLibCalls.comment.push({\\r\\n functionName: \\\"createComment\\\",\\r\\n key: \\\"createComment\\\",\\r\\n props: {\\r\\n comment,\\r\\n onClick: onClickAddComment,\\r\\n onCommit,\\r\\n onCancel,\\r\\n },\\r\\n });\\r\\n State.update({ functionsToCallByLibrary: newLibCalls });\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <ModalCard>\\r\\n <CommentCard>\\r\\n <H1>{isReplying ? \\\"Reply to comment\\\" : \\\"Add a Comment\\\"}</H1>\\r\\n <Container>\\r\\n {replyingTo && (\\r\\n <>\\r\\n <CommentBody>\\r\\n <BComment>\\r\\n <BCommentmessage>\\r\\n <BCMHeader>\\r\\n <BCMProfile>\\r\\n <Widget\\r\\n src={widgets.profileImage}\\r\\n props={{\\r\\n accountId: replyingTo,\\r\\n imageClassName: \\\"rounded-circle w-100 h-100\\\",\\r\\n style: { width: \\\"25px\\\", height: \\\"25px\\\" },\\r\\n }}\\r\\n />\\r\\n </BCMProfile>\\r\\n <BCMProfileUsername>\\r\\n {replyingTo ? \\\"@\\\" + replyingTo : \\\"@user.near\\\"}\\r\\n </BCMProfileUsername>\\r\\n </BCMHeader>\\r\\n <BCMMessage>\\r\\n {originalComment &&\\r\\n originalComment.originalComment.value.comment.text}\\r\\n </BCMMessage>\\r\\n </BCommentmessage>\\r\\n </BComment>\\r\\n <BFooter>\\r\\n <label>{state.e_message}</label>\\r\\n <BFootercont>\\r\\n <BFootercontTime>\\r\\n <img\\r\\n alt=\\\"schedule\\\"\\r\\n src={\\r\\n \\\"https://emerald-related-swordtail-341.mypinata.cloud/ipfs/QmP3uRUgZtqV3HAgcZoYaDA6JSPpFcpqULvgenWUs3ctSP\\\"\\r\\n }\\r\\n style={{ width: \\\"14px\\\", height: \\\"14px\\\" }}\\r\\n />\\r\\n </BFootercontTime>\\r\\n </BFootercont>\\r\\n </BFooter>\\r\\n </CommentBody>\\r\\n <hr\\r\\n styled={{\\r\\n width: \\\"100%\\\",\\r\\n height: \\\"0px\\\",\\r\\n border: \\\"1px solid rgba(130, 134, 136, 0.20)\\\",\\r\\n flex: \\\"none\\\",\\r\\n background: \\\"rgba(130, 134, 136, 0.20)\\\",\\r\\n margin: \\\"0px\\\",\\r\\n flexGrow: \\\"0\\\",\\r\\n }}\\r\\n />\\r\\n </>\\r\\n )}\\r\\n <div className=\\\"w-100 col\\\">\\r\\n <Widget\\r\\n src={widgets.styledComponents}\\r\\n props={{\\r\\n TextArea: {\\r\\n placeholder: \\\"Reply here\\\",\\r\\n maxLength: 2000,\\r\\n value: state.reply,\\r\\n handleChange: (e) =>\\r\\n State.update({\\r\\n reply: e.target.value.substring(0, 1000),\\r\\n }),\\r\\n },\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n <CommentFooter>\\r\\n <Widget\\r\\n src={widgets.styledComponents}\\r\\n props={{\\r\\n Button: {\\r\\n text: \\\"Cancel\\\",\\r\\n className: \\\"secondary dark\\\",\\r\\n onClick: onCloseModal,\\r\\n },\\r\\n }}\\r\\n />\\r\\n <Widget\\r\\n src={widgets.styledComponents}\\r\\n props={{\\r\\n Button: {\\r\\n text: state.showSpinner ? \\\"\\\" : \\\"Submit\\\",\\r\\n onClick: !state.showSpinner ? addCommentListener : () => {},\\r\\n icon: state.showSpinner ? renderSpinner() : <></>,\\r\\n },\\r\\n }}\\r\\n />\\r\\n </CommentFooter>\\r\\n </Container>\\r\\n </CommentCard>\\r\\n <CallLibrary>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n stateUpdate,\\r\\n state.functionsToCallByLibrary,\\r\\n { baseAction: baseActions.commentBaseAction },\\r\\n \\\"AddComment\\\"\\r\\n );\\r\\n })}\\r\\n </CallLibrary>\\r\\n </ModalCard>\\r\\n);\\r\\n",
"SocialMarkdown": "const renderMention =\\n props.renderMention ??\\n props.onMention ??\\n ((accountId) => (\\n <span key={accountId} className=\\\"d-inline-flex\\\" style={{ fontWeight: 500 }}>\\n <Widget\\n src=\\\"mob.near/widget/ProfileLine\\\"\\n props={{\\n accountId: accountId.toLowerCase(),\\n hideAccountId: true,\\n tooltip: true,\\n }}\\n />\\n </span>\\n ));\\n\\nconst onHashtag = props.onHashtag;\\n\\nconst Wrapper = styled.div`\\n word-break: break-word;\\n p {\\n white-space: pre-line;\\n }\\n`;\\n\\nreturn (\\n <Wrapper>\\n <Markdown\\n text={props.text}\\n onMention={renderMention}\\n onHashtag={onHashtag}\\n />\\n </Wrapper>\\n);\\n",
"NDC.ArticleView": "// NDC.ArticleView\\r\\n\\r\\nconst {\\r\\n widgets,\\r\\n isTest,\\r\\n handleFilterArticles,\\r\\n articleToRenderData,\\r\\n authorForWidget,\\r\\n handleEditArticle,\\r\\n handleShareButton,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nconst accountId = articleToRenderData.author;\\r\\nconst id =\\r\\n articleToRenderData.id ??\\r\\n `${articleToRenderData.author}-${articleToRenderData.timeCreate}`;\\r\\n\\r\\n//For the moment we\\\'ll allways have only 1 sbt in the array. If this change remember to do the propper work in lib.SBT and here.\\r\\nconst articleSbts = articleToRenderData.sbts ?? [];\\r\\n\\r\\nconst libSrcArray = [widgets.libComment];\\r\\n\\r\\nconst tabs = [\\r\\n {\\r\\n id: \\\"generalInfo\\\",\\r\\n title: \\\"Post info\\\",\\r\\n icon: \\\"bi bi-info-circle\\\",\\r\\n },\\r\\n];\\r\\n\\r\\nconst initLibsCalls = {\\r\\n comment: [\\r\\n {\\r\\n functionName: \\\"getValidComments\\\",\\r\\n key: \\\"comments\\\",\\r\\n props: { env: undefined, id, articleSbts },\\r\\n },\\r\\n {\\r\\n functionName: \\\"canUserCreateComment\\\",\\r\\n key: \\\"canLoggedUserCreateComment\\\",\\r\\n props: {\\r\\n accountId: context.accountId,\\r\\n sbtsNames: articleSbts,\\r\\n },\\r\\n },\\r\\n ],\\r\\n};\\r\\n\\r\\nState.init({\\r\\n tabSelected: tabs[0].id,\\r\\n comments: [],\\r\\n sliceContent: true,\\r\\n libsCalls: initLibsCalls,\\r\\n});\\r\\n\\r\\nconst canLoggedUserCreateComment =\\r\\n state.canLoggedUserCreateComment[articleSbts];\\r\\n\\r\\nconst timeLastEdit = new Date(articleToRenderData.timeLastEdit);\\r\\n\\r\\nconst CursorPointer = styled.div`\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst DetailContent = styled.div`\\r\\n display: inline-flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n`;\\r\\n\\r\\nconst TagContainer = styled.div`\\r\\n display: flex;\\r\\n flex-wrap: wrap;\\r\\n align-items: flex-start;\\r\\n gap: 4px;\\r\\n margin-top: 1rem;\\r\\n`;\\r\\n\\r\\nconst HouseTagDiv = styled.div`\\r\\n display: flex;\\r\\n padding: 4px 8px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n border-radius: 100px;\\r\\n background: var(\\r\\n --gradient-purple-gradient,\\r\\n linear-gradient(90deg, #9333ea 0%, #4f46e5 100%)\\r\\n );\\r\\n`;\\r\\n\\r\\nconst HouseTagText = styled.p`\\r\\n color: #fff;\\r\\n font-size: 7px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst TagDiv = styled.div`\\r\\n display: flex;\\r\\n justify-content: center;\\r\\n padding: 4px 8px;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n border-radius: 100px;\\r\\n border: solid 1px transparent;\\r\\n border-radius: 80px;\\r\\n background-image: linear-gradient(#eae5f7, #eae5f7),\\r\\n radial-gradient(circle at top left, #9333ea 0%, #4f46e5 100%);\\r\\n background-origin: border-box;\\r\\n background-clip: padding-box, border-box;\\r\\n`;\\r\\n\\r\\nconst TagDivText = styled.p`\\r\\n font-size: 8px;\\r\\n margin: 0px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\r\\n -webkit-background-clip: text;\\r\\n -webkit-text-fill-color: transparent;\\r\\n background-clip: text;\\r\\n text-fill-color: transparent;\\r\\n`;\\r\\n\\r\\nconst NominationTitleContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n`;\\r\\n\\r\\nconst NominationTitle = styled.p`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n margin: 7px 0 0 0;\\r\\n color: #000;\\r\\n font-size: 18px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n`;\\r\\nconst UserLink = styled.a`\\r\\n cursor: pointer;\\r\\n &:hover {\\r\\n text-decoration: none;\\r\\n }\\r\\n`;\\r\\nconst NominationUser = styled.p`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n color: #828688;\\r\\n margin: 0 0 7px 0;\\r\\n font-size: 14px;\\r\\n line-height: 120%;\\r\\n`;\\r\\n\\r\\nconst UpvoteButtonDisabled = styled.button`\\r\\n display: flex;\\r\\n padding: 2px 12px;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n border-radius: 4px;\\r\\n border: solid 1px transparent;\\r\\n background: var(--buttons-disable, #c3cace);\\r\\n cursor: default !important;\\r\\n`;\\r\\n\\r\\nconst UpvoteButton = styled.button`\\r\\n display: flex;\\r\\n padding: 2px 12px;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n border-radius: 4px;\\r\\n border: solid 1px transparent;\\r\\n background-image: linear-gradient(#f8f8f9, #f8f8f9),\\r\\n radial-gradient(\\r\\n circle at left top,\\r\\n rgb(147, 51, 234) 0%,\\r\\n rgb(79, 70, 229) 100%\\r\\n );\\r\\n background-origin: border-box;\\r\\n background-clip: padding-box, border-box;\\r\\n`;\\r\\n\\r\\nconst UpvoteCount = styled.p`\\r\\n font-size: 12px;\\r\\n font-weight: 500;\\r\\n line-height: 24px;\\r\\n margin: 0px;\\r\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\r\\n -webkit-background-clip: text;\\r\\n -webkit-text-fill-color: transparent;\\r\\n background-clip: text;\\r\\n text-fill-color: transparent;\\r\\n`;\\r\\n\\r\\nconst Icon = styled.img`\\r\\n width: 17px;\\r\\n height: 17px;\\r\\n`;\\r\\nconst BodyContainer = styled.div`\\r\\n border-radius: 8px;\\r\\n margin: 10px 0;\\r\\n background: #F8F8F9;\\r\\n padding: 20px;\\r\\n`;\\r\\n\\r\\nconst PlatformCard = styled.div`\\r\\n display: flex;\\r\\n border-radius: 6px;\\r\\n background: background: \\\"rgb(255 255 255 / 0%);\\r\\n`;\\r\\n\\r\\nconst PlatformContent = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n width: 100%;\\r\\n`;\\r\\n\\r\\nconst PlatformInfoDiv = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 8px;\\r\\n`;\\r\\n\\r\\nconst PlatformInfoHeader = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 2px;\\r\\n`;\\r\\n\\r\\nconst PlatInforHeadText = styled.p`\\r\\n margin: 0px;\\r\\n color: var(--000000, #000);\\r\\n font-size: 10px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n`;\\r\\n\\r\\nconst PlatInfoHeadSeparator = styled.hr`\\r\\n height: 0px;\\r\\n margin: 8px 0 0 0;\\r\\n\\r\\n border: 1px solid rgba(208, 214, 217, 1);\\r\\n`;\\r\\n\\r\\nconst KeyIssuesContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 2px;\\r\\n`;\\r\\n\\r\\nconst KeyIssueTitle = styled.p`\\r\\n font-size: 12px;\\r\\n line-height: 120%;\\r\\n margin: 0px;\\r\\n font-weight: 500;\\r\\n line-height: 18px;\\r\\n text-align: left;\\r\\n padding: 10px;\\r\\n`;\\r\\n\\r\\nconst KeyIssueDescription = styled.p`\\r\\n color: #212427;\\r\\n font-size: 12px;\\r\\n line-height: 130%;\\r\\n margin: 0px;\\r\\n padding: 10px;\\r\\n line-height: 18px;\\r\\n text-align: justify;\\r\\n`;\\r\\n\\r\\nconst CandidateCard = styled.div`\\r\\n display: flex;\\r\\n padding: 20px;\\r\\n align-items: center;\\r\\n align-self: stretch;\\r\\n border-radius: 6px;\\r\\n background: #fff;\\r\\n`;\\r\\n\\r\\nconst CandidateContent = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n`;\\r\\n\\r\\nconst ContentHeader = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 12px;\\r\\n align-self: stretch;\\r\\n`;\\r\\n\\r\\nconst ContentHeaderText = styled.p`\\r\\n font-size: 18px;\\r\\n font-weight: 500;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst CandidateInfoDiv = styled.div`\\r\\n width: 100%;\\r\\n padding: 16px;\\r\\n background: white;\\r\\n gap: 16px;\\r\\n border-radius: 8px;\\r\\n`;\\r\\n\\r\\nconst CandidateInfoHeader = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n align-self: stretch;\\r\\n`;\\r\\n\\r\\nconst CandidateImage = styled.img`\\r\\n width: 32px;\\r\\n height: 32px;\\r\\n`;\\r\\n\\r\\nconst CandidateInfoData = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 4px;\\r\\n flex: 1 0 0;\\r\\n`;\\r\\n\\r\\nconst CandidateTagDiv = styled.div`\\r\\n display: flex;\\r\\n height: 20px;\\r\\n padding: 4px 8px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 10px;\\r\\n border-radius: 100px;\\r\\n border: 1px solid var(--secondary-warning, #f19d38);\\r\\n background: #f0e1ce;\\r\\n`;\\r\\n\\r\\nconst CandidateTagText = styled.p`\\r\\n color: var(--secondary-warning, #f19d38);\\r\\n font-size: 10px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst CandidateTime = styled.h6`\\r\\n margin: 3px 0 0 0;\\r\\n font-size: 10px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n color: #828688;\\r\\n`;\\r\\n\\r\\nconst CandidateTextInfo = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 4px;\\r\\n align-self: stretch;\\r\\n`;\\r\\n\\r\\nconst SectionTitle = styled.h5`\\r\\n font-size: 12px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n margin: 16px 0 0 0;\\r\\n`;\\r\\n\\r\\nconst SectionDescription = styled.p`\\r\\n font-size: 12px;\\r\\n line-height: 18px;\\r\\n margin: 0px;\\r\\n text-align: justify;\\r\\n color: #828688;\\r\\n`;\\r\\n\\r\\nconst DescriptionSubtitle = styled.h5`\\r\\n display: inline-block;\\r\\n font-size: 12px;\\r\\n line-height: 120%;\\r\\n margin-right: 0.3rem;\\r\\n`;\\r\\n\\r\\nconst DescriptionInfoSpan = styled.span`\\r\\n font-size: 12px;\\r\\n line-height: 18px;\\r\\n margin: 0px;\\r\\n text-align: justify;\\r\\n color: #828688;\\r\\n`;\\r\\n\\r\\nconst DeclarationCard = styled.div`\\r\\n padding: 0px;\\r\\n`;\\r\\n\\r\\nconst CommentSection = styled.div`\\r\\n display: flex;\\r\\n padding: 20px;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n border-radius: 8px;\\r\\n background: #f8f8f9;\\r\\n`;\\r\\n\\r\\nconst Container = styled.div`\\r\\n display: flex;\\r\\n margin-right: 5px;\\r\\n justify-content: center;\\r\\n`;\\r\\n\\r\\nconst SecondContainer = styled.div`\\r\\n background: #F8F8F9;\\r\\n border-radius: 8px;\\r\\n padding: 20px;\\r\\n`;\\r\\n\\r\\nconst H6 = styled.h6`\\r\\n font-size: 14px;\\r\\n margin-bottom: 0;\\r\\n`;\\r\\n\\r\\nconst Tab = styled.div`\\r\\n font-weight: ${(props) => (props.active ? \\\"600\\\" : \\\"500\\\")};\\r\\n border-bottom: 2px solid;\\r\\n border-color: ${(props) => (props.active ? \\\"rgb(68, 152, 224)\\\" : \\\"#dee2e6\\\")};\\r\\n color: ${(props) => (props.active ? \\\"rgb(68, 152, 224)\\\" : \\\"#ababab\\\")};\\r\\n cursor: pointer;\\r\\n padding-bottom: 8px;\\r\\n font-size: 14px;\\r\\n\\r\\n i {\\r\\n &::before {\\r\\n color: ${(props) => (props.active ? \\\"rgb(68, 152, 224)\\\" : \\\"#ababab\\\")};\\r\\n }\\r\\n margin-right: 5px;\\r\\n }\\r\\n`;\\r\\n\\r\\nconst TH = styled.th`\\r\\n border: 1px solid rgba(208, 214, 217, 0.4) !important;\\r\\n text-align: left !important;\\r\\n padding: 15px 20px !important;\\r\\n`;\\r\\n\\r\\nconst CallLibrary = styled.div`\\r\\n display: none;\\r\\n`;\\r\\n\\r\\nconst HeaderButtonsContainer = styled.div`\\r\\n display: flex;\\r\\n gap: 0.5rem;\\r\\n`;\\r\\n\\r\\n//Get basic original comments info\\r\\nlet originalComments = state.comments.filter(\\r\\n (comment) => comment.value.comment.originalCommentId === id\\r\\n);\\r\\n\\r\\n//Append answers to original comments\\r\\noriginalComments = originalComments.map((originalComment) => {\\r\\n let answers = state.comments.filter((comment) => {\\r\\n return (\\r\\n comment.value.comment.originalCommentId ===\\r\\n originalComment.value.comment.commentId\\r\\n );\\r\\n });\\r\\n\\r\\n return {\\r\\n originalComment,\\r\\n answers,\\r\\n };\\r\\n});\\r\\n\\r\\nfunction stateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\nfunction getUserName() {\\r\\n const profile = data.authorProfile;\\r\\n\\r\\n return profile.name ?? getShortUserName();\\r\\n}\\r\\n\\r\\nconst getShortUserName = () => {\\r\\n const userId = accountId;\\r\\n\\r\\n if (userId.length === 64) return `${userId.slice(0, 4)}..${userId.slice(-4)}`;\\r\\n const name = userId.slice(0, -5); // truncate .near\\r\\n\\r\\n return name.length > 20 ? `${name.slice(0, 20)}...` : name;\\r\\n};\\r\\n\\r\\nlet displayedContent = state.sliceContent\\r\\n ? articleToRenderData.body.slice(0, 1000)\\r\\n : articleToRenderData.body;\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n <Container className=\\\"row\\\">\\r\\n <div className=\\\"col-lg-9 col-sm-12\\\">\\r\\n <div className=\\\"row\\\" style={{ \\\"margin-inline\\\": \\\"5px\\\" }}>\\r\\n <div\\r\\n className=\\\"col-12 p-0 w-100\\\"\\r\\n style={{\\r\\n background: \\\"#F8F8F9\\\",\\r\\n \\\"border-radius\\\": \\\"8px\\\",\\r\\n }}\\r\\n >\\r\\n <div className=\\\"w-100 p-3 d-flex flex-wrap justify-content-between align-items-start\\\">\\r\\n <div className=\\\"d-flex flex-column w-75\\\">\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.User}\\r\\n props={{\\r\\n accountId,\\r\\n options: {\\r\\n showHumanBadge: true,\\r\\n showImage: true,\\r\\n showSocialName: true,\\r\\n shortenLength: 20,\\r\\n size: \\\"lg\\\",\\r\\n },\\r\\n }}\\r\\n />\\r\\n <TagContainer>\\r\\n {articleToRenderData.tags.length > 0 &&\\r\\n articleToRenderData.tags.map((tag) => {\\r\\n const filter = { filterBy: \\\"tag\\\", value: tag };\\r\\n return (\\r\\n <CursorPointer\\r\\n onClick={() => handleFilterArticles(filter)}\\r\\n >\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.Badge}\\r\\n props={{\\r\\n children: tag,\\r\\n variant: \\\"round info outline\\\",\\r\\n size: \\\"lg\\\",\\r\\n }}\\r\\n />\\r\\n </CursorPointer>\\r\\n );\\r\\n })}\\r\\n </TagContainer>\\r\\n </div>\\r\\n <div className=\\\"d-flex gap-3\\\">\\r\\n <div className=\\\"d-flex flex-column\\\">\\r\\n <HeaderButtonsContainer>\\r\\n <Widget\\r\\n src={widgets.upVoteButton}\\r\\n props={{\\r\\n isTest,\\r\\n authorForWidget,\\r\\n reactedElementData: articleToRenderData,\\r\\n widgets,\\r\\n disabled:\\r\\n !context.accountId ||\\r\\n (articleSbts.length > 0 &&\\r\\n !canLoggedUserCreateComment),\\r\\n articleSbts,\\r\\n upVotes: articleToRenderData.upVotes,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"info outline icon\\\",\\r\\n children: <i className=\\\"bi bi-share\\\"></i>,\\r\\n onClick: () =>\\r\\n handleShareButton(true, {\\r\\n type: \\\"sharedBlockHeight\\\",\\r\\n value: articleToRenderData.blockHeight,\\r\\n }),\\r\\n }}\\r\\n />\\r\\n </HeaderButtonsContainer>\\r\\n <Widget\\r\\n src={widgets.reactions}\\r\\n props={{\\r\\n widgets,\\r\\n isTest,\\r\\n authorForWidget,\\r\\n elementReactedId: id,\\r\\n disabled:\\r\\n !context.accountId ||\\r\\n (articleSbts.length > 0 && !canLoggedUserCreateComment),\\r\\n sbtsNames: articleSbts,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n {context.accountId == accountId && (\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex justify-content-center align-items-center\\\">\\r\\n <span className=\\\"mx-2\\\">Edit</span>\\r\\n <i className=\\\"bi bi-pencil\\\"></i>\\r\\n </div>\\r\\n ),\\r\\n className: `info outline mt-2`,\\r\\n onClick: () => handleEditArticle(articleToRenderData),\\r\\n }}\\r\\n />\\r\\n )}\\r\\n </div>\\r\\n </div>\\r\\n </div>\\r\\n </div>\\r\\n <BodyContainer className=\\\"col-12\\\">\\r\\n <PlatformCard>\\r\\n <PlatformContent>\\r\\n <ContentHeader>\\r\\n <ContentHeaderText>\\r\\n {articleToRenderData.title}\\r\\n </ContentHeaderText>\\r\\n </ContentHeader>\\r\\n\\r\\n <Widget\\r\\n src={widgets.socialMarkdown}\\r\\n props={{\\r\\n text: displayedContent,\\r\\n onHashtag: (hashtag) => (\\r\\n <span\\r\\n key={hashtag}\\r\\n className=\\\"d-inline-flex\\\"\\r\\n style={{ fontWeight: 500 }}\\r\\n >\\r\\n <a\\r\\n href={`https://near.social/${authorForWidget}/widget/${widgets.thisForum}?tagShared=${hashtag}`}\\r\\n target=\\\"_blank\\\"\\r\\n >\\r\\n #{hashtag}\\r\\n </a>\\r\\n </span>\\r\\n ),\\r\\n }}\\r\\n />\\r\\n {state.sliceContent &&\\r\\n articleToRenderData.body.length > 1000 && (\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex justify-content-center align-items-center\\\">\\r\\n <span className=\\\"mx-2\\\">Show more</span>\\r\\n <i className=\\\"bi bi-chat-square-text-fill\\\"></i>\\r\\n </div>\\r\\n ),\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"w-100\\\",\\r\\n onClick: () => {\\r\\n State.update({ sliceContent: false });\\r\\n },\\r\\n }}\\r\\n />\\r\\n )}\\r\\n </PlatformContent>\\r\\n </PlatformCard>\\r\\n </BodyContainer>\\r\\n <CommentSection>\\r\\n <NominationTitle>\\r\\n <span>\\r\\n <i className=\\\"bi bi-chat-square-dots-fill\\\" /> Comments\\r\\n </span>\\r\\n </NominationTitle>\\r\\n\\r\\n {state.showModal && (\\r\\n <Widget\\r\\n src={widgets.addComment}\\r\\n props={{\\r\\n article: articleToRenderData,\\r\\n originalComment,\\r\\n widgets,\\r\\n isTest,\\r\\n isReplying: false,\\r\\n username: accountId,\\r\\n onCloseModal: () => State.update({ showModal: false }),\\r\\n callLibs,\\r\\n baseActions,\\r\\n // nomination_contract,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex align-items-center justify-content-cente\\\">\\r\\n <span className=\\\"mx-1\\\">Add comment</span>\\r\\n <i className=\\\"bi bi-plus-lg\\\"></i>\\r\\n </div>\\r\\n ),\\r\\n disabled:\\r\\n !context.accountId ||\\r\\n (articleSbts.length > 0 && !canLoggedUserCreateComment),\\r\\n className: \\\"info outline w-100 mt-4 mb-2\\\",\\r\\n onClick: () => {\\r\\n State.update({ showModal: true });\\r\\n },\\r\\n }}\\r\\n />\\r\\n {originalComments.map((data) => (\\r\\n <Widget\\r\\n src={widgets.commentView}\\r\\n props={{\\r\\n widgets,\\r\\n data,\\r\\n isTest,\\r\\n authorForWidget,\\r\\n isReply: false,\\r\\n canLoggedUserCreateComment: canLoggedUserCreateComment,\\r\\n articleSbts,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n ))}\\r\\n </CommentSection>\\r\\n </div>\\r\\n </div>\\r\\n <SecondContainer className=\\\"col-lg-3 col-sm-12\\\">\\r\\n <>\\r\\n <ul className=\\\"nav nav-pills nav-fill\\\">\\r\\n {tabs.map(({ id, title, icon }, i) => (\\r\\n <li className=\\\"nav-item\\\" role=\\\"presentation\\\" key={i}>\\r\\n <Tab\\r\\n active={state.tabSelected === id}\\r\\n onClick={() => State.update({ tabSelected: id })}\\r\\n >\\r\\n <i className={`${icon}`} />\\r\\n {title}\\r\\n </Tab>\\r\\n </li>\\r\\n ))}\\r\\n </ul>\\r\\n <div>\\r\\n {state.tabSelected == \\\"generalInfo\\\" && (\\r\\n <DeclarationCard>\\r\\n <SectionTitle className=\\\"mt-4 mb-3\\\"></SectionTitle>\\r\\n <div>\\r\\n <DescriptionSubtitle>Created by:</DescriptionSubtitle>\\r\\n <DescriptionInfoSpan>\\r\\n {articleToRenderData.authorProfile.name ??\\r\\n getShortUserName()}\\r\\n </DescriptionInfoSpan>\\r\\n </div>\\r\\n <div>\\r\\n <DescriptionSubtitle>Edited on:</DescriptionSubtitle>\\r\\n <DescriptionInfoSpan>{timeLastEdit + \\\"\\\"}</DescriptionInfoSpan>\\r\\n </div>\\r\\n <div>\\r\\n <DescriptionSubtitle>Edit versions:</DescriptionSubtitle>\\r\\n <DescriptionInfoSpan>\\r\\n {articleToRenderData.version}\\r\\n </DescriptionInfoSpan>\\r\\n </div>\\r\\n {articleSbts.length > 0 && (\\r\\n <div>\\r\\n <DescriptionSubtitle>\\r\\n SBT requiered to interact:\\r\\n </DescriptionSubtitle>\\r\\n {articleSbts.map((sbt) => {\\r\\n return <DescriptionInfoSpan>{sbt}</DescriptionInfoSpan>;\\r\\n })}\\r\\n </div>\\r\\n )}\\r\\n </DeclarationCard>\\r\\n )}\\r\\n </div>\\r\\n </>\\r\\n </SecondContainer>\\r\\n </Container>\\r\\n <CallLibrary>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n stateUpdate,\\r\\n state.libsCalls,\\r\\n { baseAction: baseActions.commentBaseAction },\\r\\n \\\"Article view\\\"\\r\\n );\\r\\n })}\\r\\n </CallLibrary>\\r\\n </>\\r\\n);\\r\\n",
"NDC.CommentView": "// NDC.CommentView\\r\\n\\r\\nconst {\\r\\n widgets,\\r\\n data,\\r\\n isTest,\\r\\n authorForWidget,\\r\\n isReply,\\r\\n orginalCommentData,\\r\\n canLoggedUserCreateComment,\\r\\n articleSbts,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nState.init({\\r\\n showModal: false,\\r\\n hasReply: false,\\r\\n});\\r\\n\\r\\nconst CommentCard = styled.div`\\r\\n margin-left: ${isReply ? \\\"2rem\\\" : \\\"0\\\"};\\r\\n display: flex;\\r\\n padding: 14px 16px;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n border-radius: \\\"10px\\\"};\\r\\n background: #fff;\\r\\n width: 100%;\\r\\n`;\\r\\n\\r\\nconst CommentCardHeader = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n justify-content: space-between;\\r\\n gap: 8px;\\r\\n`;\\r\\n\\r\\nconst CommentUserContent = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n`;\\r\\n\\r\\nconst ProfileImageComment = styled.img`\\r\\n width: 20px;\\r\\n height: 20px;\\r\\n flex-shrink: 0;\\r\\n border-radius: 20px;\\r\\n`;\\r\\n\\r\\nconst CommentUser = styled.p`\\r\\n color: #000;\\r\\n font-size: 12px;\\r\\n font-weight: 500;\\r\\n line-height: 120%;\\r\\n margin: 0px;\\r\\n white-space: nowrap;\\r\\n overflow: hidden;\\r\\n text-overflow: ellipsis;\\r\\n`;\\r\\n\\r\\nconst ReplyCounterDiv = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n`;\\r\\n\\r\\nconst ReplyIconPurple = styled.img`\\r\\n width: 14px;\\r\\n height: 14px;\\r\\n`;\\r\\n\\r\\nconst ReplyCounterText = styled.p`\\r\\n color: #000;\\r\\n font-size: 10px;\\r\\n font-weight: 500;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst CommentCardContent = styled.p`\\r\\n color: #585b5c;\\r\\n font-size: 12px;\\r\\n line-height: 18px;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst CommentCardLowerSection = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n justify-content: space-between;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n width: 100%;\\r\\n`;\\r\\n\\r\\nconst TimestampCommentDiv = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n flex: 1 0 0;\\r\\n`;\\r\\n\\r\\nconst TimestampIconComment = styled.img`\\r\\n width: 12px;\\r\\n height: 12px;\\r\\n`;\\r\\n\\r\\nconst TimestampTextComment = styled.p`\\r\\n color: #000;\\r\\n font-size: 10px;\\r\\n font-weight: 300;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst DeleteCommentButton = styled.button`\\r\\n display: flex;\\r\\n width: 28px;\\r\\n padding: 2px 12px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n align-self: stretch;\\r\\n border-radius: 4px;\\r\\n border: 1px solid #c23f38;\\r\\n background: #f1d6d5;\\r\\n`;\\r\\n\\r\\nconst DeleteCommentIcon = styled.img`\\r\\n width: 14px;\\r\\n height: 14px;\\r\\n flex-shrink: 0;\\r\\n`;\\r\\n\\r\\nconst ShareCommentButton = styled.button`\\r\\n display: flex;\\r\\n width: 28px;\\r\\n height: 28px;\\r\\n padding: 2px 12px;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n border-radius: 4px;\\r\\n border: solid 1px transparent;\\r\\n background-image: linear-gradient(white, white),\\r\\n radial-gradient(circle at top left, #9333ea 0%, #4f46e5 100%);\\r\\n background-origin: border-box;\\r\\n background-clip: padding-box, border-box;\\r\\n`;\\r\\n\\r\\nconst ShareCommentIcon = styled.img`\\r\\n width: 14px;\\r\\n height: 14px;\\r\\n flex-shrink: 0;\\r\\n`;\\r\\n\\r\\nconst ReplyCommentButtonDisabled = styled.div`\\r\\n display: flex;\\r\\n padding: 2px 12px;\\r\\n cursor: not-allowed;\\r\\n background: rgb(195, 202, 206);\\r\\n color: rgb(130, 134, 136);\\r\\n border: 0px;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n align-self: stretch;\\r\\n border-radius: 4px;\\r\\n`;\\r\\n\\r\\nconst ReplyCommentButtonActive = styled.div`\\r\\n cursor: pointer;\\r\\n display: flex;\\r\\n padding: 2px 12px;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n align-self: stretch;\\r\\n border-radius: 4px;\\r\\n background: var(--buttons-yellow-default, #ffd50d);\\r\\n`;\\r\\n\\r\\nconst ReplyCommentText = styled.p`\\r\\n color: var(--primary-black, #000);\\r\\n font-size: 12px;\\r\\n font-weight: 500;\\r\\n line-height: 24px;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst CommentReplySeparator = styled.hr`\\r\\n height: 0px;\\r\\n margin: 16px 0 16px 0;\\r\\n border: 1px solid rgba(208, 214, 217, 1);\\r\\n`;\\r\\n\\r\\nconst ReplyContainer = styled.div`\\r\\n display: flex;\\r\\n width: 260px;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n margin: 0 0 0 35px;\\r\\n`;\\r\\n\\r\\nconst ReplyHeader = styled.div`\\r\\n display: flex;\\r\\n align-items: center;\\r\\n gap: 8px;\\r\\n align-self: stretch;\\r\\n`;\\r\\n\\r\\nconst ReplyContent = styled.p`\\r\\n color: #828688;\\r\\n font-size: 12px;\\r\\n line-height: 120%;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst ReplyLowerSection = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n justify-content: center;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n`;\\r\\n\\r\\nconst ReplyButtonSection = styled.div`\\r\\n display: flex;\\r\\n justify-content: flex-end;\\r\\n align-items: center;\\r\\n gap: 4px;\\r\\n`;\\r\\n\\r\\nconst DeleteReplyButton = styled.button`\\r\\n display: flex;\\r\\n padding: 2px 12px;\\r\\n align-items: center;\\r\\n gap: 6px;\\r\\n align-self: stretch;\\r\\n border-radius: 4px;\\r\\n border: 1px solid #c23f38;\\r\\n background: #f1d6d5;\\r\\n`;\\r\\n\\r\\nconst DeleteReplyText = styled.p`\\r\\n color: #c23f38;\\r\\n font-size: 12px;\\r\\n font-weight: 500;\\r\\n line-height: 24px;\\r\\n margin: 0px;\\r\\n`;\\r\\n\\r\\nconst AnswerContainer = styled.div`\\r\\n width: 96%;;\\r\\n`;\\r\\n\\r\\nfunction closeModal() {\\r\\n State.update({ showModal: false });\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n <CommentCard>\\r\\n <CommentCardHeader>\\r\\n <CommentUserContent>\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.User}\\r\\n props={{\\r\\n accountId: data.originalComment.accountId,\\r\\n options: {\\r\\n showHumanBadge: true,\\r\\n showImage: true,\\r\\n showSocialName: true,\\r\\n shortenLength: 15,\\r\\n size: \\\"md\\\",\\r\\n },\\r\\n }}\\r\\n />\\r\\n </CommentUserContent>\\r\\n </CommentCardHeader>\\r\\n <CommentCardContent>\\r\\n <Widget\\r\\n src={widgets.socialMarkdown}\\r\\n props={{ text: data.originalComment.value.comment.text }}\\r\\n />\\r\\n </CommentCardContent>\\r\\n <CommentCardLowerSection>\\r\\n <TimestampCommentDiv>\\r\\n <i className=\\\"bi bi-clock\\\" />\\r\\n <TimestampTextComment>\\r\\n {new Date(\\r\\n data.originalComment.value.comment.timestamp\\r\\n ).toDateString()}\\r\\n </TimestampTextComment>\\r\\n </TimestampCommentDiv>\\r\\n <div>\\r\\n {state.showModal && (\\r\\n <Widget\\r\\n src={widgets.addComment}\\r\\n props={{\\r\\n article: articleToRenderData,\\r\\n originalComment: orginalCommentData ?? data,\\r\\n widgets,\\r\\n isTest,\\r\\n replyingTo: data.originalComment.accountId,\\r\\n placement: \\\"bottom\\\",\\r\\n onCloseModal: closeModal,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n {articleSbts.length > 0 && (\\r\\n <>\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex align-items-center justify-content-center\\\">\\r\\n <span className=\\\"mx-1\\\">Reply</span>\\r\\n <i className=\\\"bi bi bi-reply\\\"></i>\\r\\n </div>\\r\\n ),\\r\\n disabled: !canLoggedUserCreateComment[articleSbts[0]],\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"info outline\\\",\\r\\n onClick: () => {\\r\\n canLoggedUserCreateComment[articleSbts[0]] &&\\r\\n State.update({ showModal: true });\\r\\n },\\r\\n }}\\r\\n />\\r\\n </>\\r\\n )}\\r\\n </div>\\r\\n <Widget\\r\\n src={widgets.reactions}\\r\\n props={{\\r\\n widgets,\\r\\n isTest,\\r\\n authorForWidget,\\r\\n elementReactedId: data.originalComment.value.comment.commentId,\\r\\n disabled: !canLoggedUserCreateComment[articleSbts[0]],\\r\\n callLibs,\\r\\n baseActions,\\r\\n sbtsNames: articleSbts,\\r\\n }}\\r\\n />\\r\\n </CommentCardLowerSection>\\r\\n </CommentCard>\\r\\n {!isReply && (\\r\\n <>\\r\\n {data.answers.length > 0 && (\\r\\n <i className=\\\"bi bi-arrow-return-right\\\"></i>\\r\\n )}\\r\\n {data.answers.map((answer) => {\\r\\n return (\\r\\n <AnswerContainer>\\r\\n <Widget\\r\\n src={widgets.commentView}\\r\\n props={{\\r\\n widgets,\\r\\n data: { originalComment: answer },\\r\\n orginalCommentData: data,\\r\\n isTest,\\r\\n authorForWidget,\\r\\n isReply: true,\\r\\n canLoggedUserCreateComment,\\r\\n articleSbts,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n </AnswerContainer>\\r\\n );\\r\\n })}\\r\\n </>\\r\\n )}\\r\\n </>\\r\\n);\\r\\n",
"NDC.GeneralCard": "// NDC.GeneralCard\\r\\n//===============================================INITIALIZATION=====================================================\\r\\n\\r\\nconst {\\r\\n widgets,\\r\\n isTest,\\r\\n data,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n addressForArticles,\\r\\n authorForWidget,\\r\\n handleShareButton,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nconst tags = data.tags;\\r\\nconst accountId = data.author;\\r\\nconst title = data.title;\\r\\nconst content = data.body;\\r\\nconst timeLastEdit = data.timeLastEdit;\\r\\nconst id = data.id ?? `${data.author}-${data.timeCreate}`;\\r\\nconst upVotes = data.upVotes;\\r\\n\\r\\n//For the moment we\\\'ll allways have only 1 sbt in the array. If this change remember to do the propper work in lib.SBT and here.\\r\\nconst articleSbts = articleToRenderData.sbts ?? data.sbts ?? [];\\r\\n\\r\\nconst libSrcArray = [widgets.libComment];\\r\\n\\r\\nfunction stateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\nconst initLibsCalls = {\\r\\n comment: [\\r\\n {\\r\\n functionName: \\\"canUserCreateComment\\\",\\r\\n key: \\\"canLoggedUserCreateComment\\\",\\r\\n props: {\\r\\n accountId: context.accountId,\\r\\n sbtsNames: articleSbts,\\r\\n },\\r\\n },\\r\\n ],\\r\\n};\\r\\n\\r\\nState.init({\\r\\n verified: true,\\r\\n start: true,\\r\\n voted: false,\\r\\n sliceContent: true,\\r\\n libsCalls: initLibsCalls,\\r\\n});\\r\\n//=============================================END INITIALIZATION===================================================\\r\\n\\r\\n//===================================================CONSTS=========================================================\\r\\nconst canLoggedUserCreateComment =\\r\\n state.canLoggedUserCreateComment[articleSbts];\\r\\n\\r\\n//=================================================END CONSTS=======================================================\\r\\n\\r\\n//==================================================FUNCTIONS=======================================================\\r\\nfunction getPublicationDate(creationTimestamp) {\\r\\n if (creationTimestamp == 0) {\\r\\n return \\\"Creation timestamp passed wrong\\\";\\r\\n }\\r\\n return new Date(creationTimestamp).toDateString();\\r\\n}\\r\\n\\r\\nfunction getUserName() {\\r\\n const profile = data.authorProfile;\\r\\n\\r\\n return profile.name ?? getShortUserName();\\r\\n}\\r\\n\\r\\nconst getShortUserName = () => {\\r\\n const userId = accountId;\\r\\n\\r\\n if (userId.length === 64) return `${userId.slice(0, 4)}..${userId.slice(-4)}`;\\r\\n const name = userId.slice(0, -5); // truncate .near\\r\\n\\r\\n return name.length > 20 ? `${name.slice(0, 20)}...` : name;\\r\\n};\\r\\n\\r\\nfunction toggleShowModal() {\\r\\n State.update({ showModal: !state.showModal });\\r\\n}\\r\\n\\r\\n//================================================END FUNCTIONS=====================================================\\r\\n\\r\\n//==============================================STYLED COMPONENTS===================================================\\r\\n\\r\\nconst CardContainer = styled.div`\\r\\n box-shadow: rgba(140, 149, 159, 0.1) 0px 4px 28px 0px;\\r\\n`;\\r\\n\\r\\nconst Card = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n padding: 16px;\\r\\n gap: 16px;\\r\\n background: rgba(140, 149, 159, 0.1) 0px 4px 28px 0px;\\r\\n border-radius: 10px;\\r\\n`;\\r\\nconst HeaderCard = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: center;\\r\\n padding: 0px;\\r\\n gap: 12px;\\r\\n width: 100%;\\r\\n`;\\r\\n\\r\\nconst profilePictureStyles = {\\r\\n width: \\\"45px\\\",\\r\\n height: \\\"45px\\\",\\r\\n borderRadius: \\\"50%\\\",\\r\\n};\\r\\nconst HeaderContent = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n padding: 0px;\\r\\n gap: 4px;\\r\\n width: 70%;\\r\\n`;\\r\\nconst HeaderButtonsContainer = styled.div`\\r\\n display: flex;\\r\\n gap: 0.5rem;\\r\\n`;\\r\\nconst HeaderContentText = styled.div`\\r\\n display: flex;\\r\\n width: 100%;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n padding: 0px;\\r\\n cursor: pointer;\\r\\n`;\\r\\nconst NominationName = styled.p`\\r\\n font-weight: 500;\\r\\n font-size: 14px;\\r\\n margin: 0;\\r\\n align-items: center;\\r\\n color: #000000;\\r\\n white-space: nowrap;\\r\\n overflow: hidden;\\r\\n text-overflow: ellipsis;\\r\\n`;\\r\\nconst NominationUser = styled.p`\\r\\n font-style: normal;\\r\\n font-weight: 400;\\r\\n font-size: 12px;\\r\\n margin: 0px;\\r\\n line-height: 120%;\\r\\n display: flex;\\r\\n align-items: center;\\r\\n color: #828688;\\r\\n white-space: nowrap;\\r\\n overflow: hidden;\\r\\n text-overflow: ellipsis;\\r\\n`;\\r\\n\\r\\nconst KeyIssues = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: flex-start;\\r\\n padding: 12px;\\r\\n gap: 12px;\\r\\n background: #ffffff; \\r\\n border: 1px solid rgb(248, 248, 249);\\r\\n border-radius: 6px;\\r\\n width: 100%;\\r\\n`;\\r\\nconst KeyIssuesContent = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n padding: 0px;\\r\\n gap: 12px;\\r\\n width: 100%;\\r\\n`;\\r\\nconst KeyIssuesHeader = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: flex-start;\\r\\n padding: 0px;\\r\\n gap: 12px;\\r\\n`;\\r\\nconst KeyIssuesTitle = styled.p`\\r\\n font-style: normal;\\r\\n font-weight: 700;\\r\\n font-size: 14px;\\r\\n line-height: 120%;\\r\\n margin-bottom: 0;\\r\\n`;\\r\\nconst KeyIssuesContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: flex-start;\\r\\n padding: 0px;\\r\\n gap: 8px;\\r\\n overflow-y: scroll;\\r\\n max-height: 250px;\\r\\n width: 100%;\\r\\n border: 1px solid rgb(248, 248, 249);\\r\\n border-radius: var(--bs-border-radius-lg) !important;\\r\\n`;\\r\\n\\r\\nconst ArticleBodyContainer = styled.div`\\r\\n margin: 0 0.5rem 0.5rem 0.5rem;\\r\\n`;\\r\\n\\r\\nconst LowerSection = styled.div`\\r\\n display: flex;\\r\\n width: 100%;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n align-items: flex-start;\\r\\n gap: 8px;\\r\\n`;\\r\\nconst LowerSectionContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: center;\\r\\n align-items: flex-start;\\r\\n gap: 12px;\\r\\n align-self: stretch;\\r\\n`;\\r\\nconst ButtonsLowerSection = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: center;\\r\\n padding: 0px;\\r\\n width: 100%;\\r\\n`;\\r\\nconst TextLowerSectionContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: center;\\r\\n padding: 0px;\\r\\n gap: 4px;\\r\\n width: 239px;\\r\\n height: 24px;\\r\\n cursor: pointer;\\r\\n\\r\\n flex-grow: 1;\\r\\n`;\\r\\nconst TimestampText = styled.div`\\r\\n font-style: italic;\\r\\n font-weight: 300;\\r\\n font-size: 11px;\\r\\n line-height: 14px;\\r\\n margin: 0px;\\r\\n gap: 2px;\\r\\n color: #000000;\\r\\n\\r\\n b {\\r\\n font-weight: 600;\\r\\n }\\r\\n`;\\r\\nconst ButtonsContainer = styled.div`\\r\\n display: flex;\\r\\n flex-direction: row;\\r\\n align-items: center;\\r\\n padding: 0px;\\r\\n gap: 4px;\\r\\n width: 87px;\\r\\n height: 28px;\\r\\n`;\\r\\nconst TagSection = styled.div`\\r\\n display: flex;\\r\\n align-items: flex-start;\\r\\n gap: 4px;\\r\\n flex-wrap: wrap;\\r\\n overflow: hidden;\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst Element = styled.div`\\r\\n width: 150px;\\r\\n display: flex;\\r\\n justify-content: space-between;\\r\\n align-items: center;\\r\\n cursor: pointer;\\r\\n padding: 10px;\\r\\n\\r\\n &:hover {\\r\\n border-radius: 6px;\\r\\n background: #f8f8f9;\\r\\n }\\r\\n`;\\r\\n\\r\\nconst CallLibrary = styled.div`\\r\\n display: none;\\r\\n`;\\r\\n//============================================END STYLED COMPONENTS=================================================\\r\\n\\r\\n//=================================================MORE STYLES======================================================\\r\\n\\r\\nconst profileImageStyles = {\\r\\n width: profilePictureStyles.width,\\r\\n height: profilePictureStyles.height,\\r\\n borderRadius: profilePictureStyles.borderRadius,\\r\\n overflow: \\\"hidden\\\",\\r\\n};\\r\\n\\r\\n//===============================================END MORE STYLES====================================================\\r\\n\\r\\n//=================================================COMPONENTS=======================================================\\r\\n\\r\\nconst inner = (\\r\\n <div className=\\\"d-flex flex-row mx-1\\\">\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.User}\\r\\n props={{\\r\\n accountId,\\r\\n options: {\\r\\n showHumanBadge: true,\\r\\n showImage: true,\\r\\n showSocialName: true,\\r\\n shortenLength: 20,\\r\\n },\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n);\\r\\n\\r\\nconst renderTags = () => {\\r\\n return (\\r\\n <>\\r\\n {tags &&\\r\\n tags.map((tag) => {\\r\\n const filter = { filterBy: \\\"tag\\\", value: tag };\\r\\n\\r\\n return (\\r\\n <div onClick={() => handleFilterArticles(filter)}>\\r\\n {tag && (\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.Badge}\\r\\n props={{\\r\\n children: tag,\\r\\n variant: \\\"round info outline\\\",\\r\\n size: \\\"lg\\\",\\r\\n }}\\r\\n />\\r\\n )}\\r\\n </div>\\r\\n );\\r\\n })}\\r\\n </>\\r\\n );\\r\\n};\\r\\n\\r\\nconst renderArticleBody = () => {\\r\\n let displayedContent = state.sliceContent ? content.slice(0, 1000) : content;\\r\\n return (\\r\\n <ArticleBodyContainer>\\r\\n <Widget\\r\\n src={widgets.socialMarkdown}\\r\\n props={{\\r\\n text: displayedContent,\\r\\n onHashtag: (hashtag) => (\\r\\n <span\\r\\n key={hashtag}\\r\\n className=\\\"d-inline-flex\\\"\\r\\n style={{ fontWeight: 500 }}\\r\\n >\\r\\n <a\\r\\n href={`https://near.social/${authorForWidget}/widget/${widgets.thisForum}?tagShared=${hashtag}`}\\r\\n target=\\\"_blank\\\"\\r\\n >\\r\\n #{hashtag}\\r\\n </a>\\r\\n </span>\\r\\n ),\\r\\n }}\\r\\n />\\r\\n {state.sliceContent && content.length > 1000 && (\\r\\n <Widget\\r\\n src={widgets.styledComponents}\\r\\n props={{\\r\\n Button: {\\r\\n text: `Show more`,\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"w-100 justify-content-center\\\",\\r\\n onClick: () => {\\r\\n State.update({ sliceContent: false });\\r\\n },\\r\\n icon: <i className=\\\"bi bi-chat-square-text-fill\\\"></i>,\\r\\n },\\r\\n }}\\r\\n />\\r\\n )}\\r\\n </ArticleBodyContainer>\\r\\n );\\r\\n};\\r\\n\\r\\n//===============================================END COMPONENTS====================================================\\r\\n\\r\\n//===================================================RENDER========================================================\\r\\n\\r\\nreturn (\\r\\n <CardContainer className=\\\"bg-white rounded-3 p-3 m-3 col-lg-8 col-md-8 col-sm-12\\\">\\r\\n <Card>\\r\\n {state.showModal && (\\r\\n <Widget\\r\\n src={widgets.addComment}\\r\\n props={{\\r\\n widgets,\\r\\n article: data,\\r\\n isReplying: false,\\r\\n isTest,\\r\\n username: data.author,\\r\\n id,\\r\\n onCloseModal: toggleShowModal,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n )}\\r\\n <HeaderCard className=\\\"d-flex justify-content-between pb-1 border-bottom border-dark\\\">\\r\\n <div className=\\\"d-flex align-items-center gap-2\\\">\\r\\n <Widget\\r\\n src={widgets.profileOverlayTrigger}\\r\\n props={{ accountId, children: inner }}\\r\\n />\\r\\n {\\r\\n // <HeaderContent>\\r\\n // <HeaderContentText\\r\\n // onClick={() => {\\r\\n // handleOpenArticle(data);\\r\\n // }}\\r\\n // >\\r\\n // <NominationName>{getUserName()}</NominationName>\\r\\n // <NominationUser>{getShortUserName()}</NominationUser>\\r\\n // </HeaderContentText>\\r\\n // </HeaderContent>\\r\\n }\\r\\n </div>\\r\\n <HeaderButtonsContainer>\\r\\n <Widget\\r\\n src={widgets.upVoteButton}\\r\\n props={{\\r\\n isTest,\\r\\n authorForWidget,\\r\\n reactedElementData: data,\\r\\n widgets,\\r\\n disabled:\\r\\n !context.accountId ||\\r\\n (articleSbts.length > 0 && !canLoggedUserCreateComment),\\r\\n articleSbts,\\r\\n upVotes,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"info outline icon\\\",\\r\\n children: <i className=\\\"bi bi-share\\\"></i>,\\r\\n onClick: () =>\\r\\n handleShareButton(true, {\\r\\n type: \\\"sharedBlockHeight\\\",\\r\\n value: data.blockHeight,\\r\\n }),\\r\\n }}\\r\\n />\\r\\n </HeaderButtonsContainer>\\r\\n </HeaderCard>\\r\\n <KeyIssuesHeader>\\r\\n <KeyIssuesTitle\\r\\n role=\\\"button\\\"\\r\\n onClick={() => {\\r\\n handleOpenArticle(data);\\r\\n }}\\r\\n >\\r\\n {title}\\r\\n </KeyIssuesTitle>\\r\\n </KeyIssuesHeader>\\r\\n <KeyIssuesContent>\\r\\n <KeyIssuesContainer>{renderArticleBody()}</KeyIssuesContainer>\\r\\n </KeyIssuesContent>\\r\\n <LowerSection>\\r\\n <LowerSectionContainer>\\r\\n {tags.length > 0 && (\\r\\n <KeyIssues>\\r\\n <KeyIssuesContent>\\r\\n <KeyIssuesHeader>\\r\\n <KeyIssuesTitle>Tags</KeyIssuesTitle>\\r\\n </KeyIssuesHeader>\\r\\n <div className=\\\"d-flex w-100\\\">\\r\\n <TagSection>{renderTags()}</TagSection>\\r\\n </div>\\r\\n </KeyIssuesContent>\\r\\n </KeyIssues>\\r\\n )}\\r\\n <ButtonsLowerSection>\\r\\n <TextLowerSectionContainer\\r\\n className=\\\"align-items-center\\\"\\r\\n onClick={() => {\\r\\n handleOpenArticle(data);\\r\\n }}\\r\\n >\\r\\n <i className=\\\"bi bi-clock\\\"></i>\\r\\n <TimestampText>\\r\\n <span>{getPublicationDate(timeLastEdit)}</span>\\r\\n <span>by</span>\\r\\n <b>{author}</b>\\r\\n </TimestampText>\\r\\n </TextLowerSectionContainer>\\r\\n <Widget\\r\\n src={widgets.reactions}\\r\\n props={{\\r\\n widgets,\\r\\n isTest,\\r\\n authorForWidget,\\r\\n elementReactedId: id,\\r\\n disabled:\\r\\n !context.accountId ||\\r\\n (articleSbts.length > 0 && !canLoggedUserCreateComment),\\r\\n callLibs,\\r\\n baseActions,\\r\\n sbtsNames: articleSbts,\\r\\n }}\\r\\n />\\r\\n </ButtonsLowerSection>\\r\\n <div className=\\\"d-flex w-100 align-items-center\\\">\\r\\n <div className=\\\"d-flex w-100 gap-2 justify-content-start\\\">\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex align-items-center justify-content-center\\\">\\r\\n <span className=\\\"mx-1\\\">Add comment</span>\\r\\n <i className=\\\"bi bi-chat-square-text-fill\\\"></i>\\r\\n </div>\\r\\n ),\\r\\n disabled:\\r\\n !context.accountId ||\\r\\n (articleSbts.length > 0 && !canLoggedUserCreateComment),\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"info outline w-25\\\",\\r\\n onClick: toggleShowModal,\\r\\n }}\\r\\n />\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex align-items-center justify-content-center\\\">\\r\\n <span className=\\\"mx-1\\\">View</span>\\r\\n <i className=\\\"bi bi-eye fs-6\\\"></i>\\r\\n </div>\\r\\n ),\\r\\n size: \\\"sm\\\",\\r\\n className: \\\"info w-25\\\",\\r\\n onClick: () => {\\r\\n handleOpenArticle(data);\\r\\n },\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n </div>\\r\\n </LowerSectionContainer>\\r\\n </LowerSection>\\r\\n </Card>\\r\\n <CallLibrary>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n stateUpdate,\\r\\n state.libsCalls,\\r\\n { baseAction: baseActions.commentBaseAction },\\r\\n \\\"General card\\\"\\r\\n );\\r\\n })}\\r\\n </CallLibrary>\\r\\n </CardContainer>\\r\\n);\\r\\n",
"NDC.KanbanBoard": "// NDC.KanbanBoard\\r\\n\\r\\nconst {\\r\\n isTest,\\r\\n widgets,\\r\\n kanbanColumns,\\r\\n finalArticles,\\r\\n handleOpenArticle,\\r\\n handleShareButton,\\r\\n handleFilterArticles,\\r\\n authorForWidget,\\r\\n kanbanRequiredTags,\\r\\n kanbanExcludedTags,\\r\\n sbts,\\r\\n baseActions,\\r\\n callLibs,\\r\\n} = props;\\r\\n\\r\\n//Commented so you can test if needed\\r\\n\\r\\n// function callLibs(\\r\\n// src,\\r\\n// stateUpdate,\\r\\n// functionsToCallByLibrary,\\r\\n// extraProps,\\r\\n// callerWidget\\r\\n// ) {\\r\\n// return (\\r\\n// <Widget\\r\\n// src={src}\\r\\n// props={{\\r\\n// isTest,\\r\\n// stateUpdate,\\r\\n// functionsToCallByLibrary,\\r\\n// callLibs,\\r\\n// widgets,\\r\\n// callerWidget,\\r\\n// ...extraProps,\\r\\n// }}\\r\\n// />\\r\\n// );\\r\\n// }\\r\\n\\r\\n//This is here so the code dosn\\\'t brake if the functions are not passed\\r\\nif (!handleFilterArticles) {\\r\\n handleFilterArticles = () => {\\r\\n console.log(\\\"handleFilterArticles clicked\\\");\\r\\n };\\r\\n}\\r\\nif (!handleOpenArticle) {\\r\\n handleOpenArticle = () => {\\r\\n console.log(\\\"handleOpenArticle clicked\\\");\\r\\n };\\r\\n}\\r\\nif (!handleShareButton) {\\r\\n handleShareButton = () => {\\r\\n console.log(\\\"handleShareButton clicked\\\");\\r\\n };\\r\\n}\\r\\n\\r\\nconst articles = finalArticles[sbts[0]];\\r\\n\\r\\nif (!articles) {\\r\\n return (\\r\\n <h4 className=\\\"text-danger\\\">\\r\\n Prop \\\"articles\\\" passed wrongly to NDC.KanbanBoard\\r\\n </h4>\\r\\n );\\r\\n}\\r\\n\\r\\nif (!kanbanRequiredTags) {\\r\\n kanbanRequiredTags = [];\\r\\n}\\r\\n\\r\\nif (!kanbanExcludedTags) {\\r\\n kanbanExcludedTags = [];\\r\\n}\\r\\n\\r\\nif (!kanbanColumns) {\\r\\n kanbanColumns = [\\\"widget\\\", \\\"integration\\\", \\\"feature-request\\\"];\\r\\n}\\r\\n\\r\\nconst CursorPointer = styled.p`\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\nconst articlesPerLabel = kanbanColumns.map((cl) => {\\r\\n let articlesOnThisColumn = articles.filter((article) => {\\r\\n const lowerCaseCL = cl.toLocaleLowerCase().replace(` `, \\\"-\\\");\\r\\n\\r\\n return article.tags.includes(lowerCaseCL);\\r\\n });\\r\\n return { label: cl, articles: articlesOnThisColumn };\\r\\n});\\r\\n\\r\\nfunction getColumnWidth() {\\r\\n if (articlesPerLabel.length <= 3) {\\r\\n return \\\"4\\\";\\r\\n } else {\\r\\n return \\\"3\\\";\\r\\n }\\r\\n}\\r\\n\\r\\nreturn (\\r\\n <div>\\r\\n <div className=\\\"row mb-2\\\">\\r\\n {kanbanRequiredTags.length > 0 ? (\\r\\n <div className=\\\"col\\\">\\r\\n <small className=\\\"text-muted\\\">\\r\\n Required tags:\\r\\n {kanbanRequiredTags.map((label) => {\\r\\n return (\\r\\n <CursorPointer\\r\\n onClick={() =>\\r\\n handleFilterArticles({\\r\\n filterBy: \\\"tag\\\",\\r\\n value: { label },\\r\\n })\\r\\n }\\r\\n >\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.Badge}\\r\\n props={{\\r\\n children: label,\\r\\n variant: \\\"round info\\\",\\r\\n size: \\\"lg\\\",\\r\\n }}\\r\\n />\\r\\n </CursorPointer>\\r\\n );\\r\\n })}\\r\\n </small>\\r\\n </div>\\r\\n ) : null}\\r\\n {kanbanExcludedTags.length > 0 ? (\\r\\n <div className=\\\"col\\\">\\r\\n <small className=\\\"text-muted\\\">\\r\\n Excluded labels:\\r\\n {kanbanExcludedTags.map((label) => {\\r\\n return (\\r\\n <CursorPointer\\r\\n onClick={() =>\\r\\n handleFilterArticles({\\r\\n filterBy: \\\"tag\\\",\\r\\n value: { label },\\r\\n })\\r\\n }\\r\\n >\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.Badge}\\r\\n props={{\\r\\n children: label,\\r\\n variant: \\\"round info\\\",\\r\\n size: \\\"lg\\\",\\r\\n }}\\r\\n />\\r\\n </CursorPointer>\\r\\n );\\r\\n })}\\r\\n </small>\\r\\n </div>\\r\\n ) : null}\\r\\n </div>\\r\\n\\r\\n <div className=\\\"row\\\">\\r\\n {articlesPerLabel.map((col) => {\\r\\n return (\\r\\n <div className={`col-${getColumnWidth()}`}>\\r\\n <div className=\\\"card\\\">\\r\\n <div className=\\\"card-body border-secondary\\\">\\r\\n <h6 className=\\\"card-title\\\">\\r\\n {col.label.toUpperCase()}({col.articles.length})\\r\\n </h6>\\r\\n {col.articles.map((article) => {\\r\\n return (\\r\\n <Widget\\r\\n src={widgets.compactPost}\\r\\n props={{\\r\\n widgets,\\r\\n article,\\r\\n kanbanColumns,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n handleShareButton,\\r\\n colLabel: col.label,\\r\\n baseActions,\\r\\n callLibs,\\r\\n }}\\r\\n />\\r\\n );\\r\\n })}\\r\\n </div>\\r\\n </div>\\r\\n </div>\\r\\n );\\r\\n })}\\r\\n </div>\\r\\n </div>\\r\\n);\\r\\n",
"fasterTextInput": "State.init({ text: props.firstText });\\r\\n\\r\\nconst returnText = (e) => {\\r\\n return e.target.value;\\r\\n};\\r\\nconst stateUpdate = props.stateUpdate;\\r\\nconst filterText = props.filterText ?? returnText;\\r\\n\\r\\nreturn (\\r\\n <input\\r\\n className=\\\"form-control mt-2\\\"\\r\\n value={props.forceClear ? \\\"\\\" : state.text}\\r\\n readonly={props.editable ? \\\"readonly\\\" : false}\\r\\n disabled={props.editable ? \\\"disabled\\\" : false}\\r\\n onBlur={() => stateUpdate({ title: state.text })}\\r\\n placeholder={props.placeholder}\\r\\n onChange={(e) => {\\r\\n State.update({\\r\\n text: filterText(e),\\r\\n });\\r\\n props.forceClear && props.stateUpdate({ clearArticleId: false });\\r\\n }}\\r\\n />\\r\\n);\\r\\n",
"Feedback.Spinner": "const color1 = props.color1 ?? \\\"#FFD50D\\\";\\nconst color2 = props.color2 ?? \\\"#4498E0\\\";\\n\\nconst Loader = styled.div`\\n width: 48px;\\n height: 48px;\\n display: block;\\n margin: 15px auto;\\n position: relative;\\n color: ${color1};\\n box-sizing: border-box;\\n animation: rotation 1s linear infinite;\\n\\n &::after,\\n &::before {\\n content: \\\"\\\";\\n box-sizing: border-box;\\n position: absolute;\\n width: 24px;\\n height: 24px;\\n top: 50%;\\n left: 50%;\\n transform: scale(0.5) translate(0, 0);\\n background-color: ${color1};\\n border-radius: 50%;\\n animation: animloader 1s infinite ease-in-out;\\n }\\n &::before {\\n background-color: ${color2};\\n transform: scale(0.5) translate(-48px, -48px);\\n }\\n\\n @keyframes rotation {\\n 0% {\\n transform: rotate(0deg);\\n }\\n 100% {\\n transform: rotate(360deg);\\n }\\n }\\n @keyframes animloader {\\n 50% {\\n transform: scale(1) translate(-50%, -50%);\\n }\\n }\\n`;\\n\\nreturn <Loader></Loader>;\\n",
"NDC.Forum.Create": "//NDC.Forum.Create\\r\\n\\r\\nconst {\\r\\n isTest,\\r\\n addressForArticles,\\r\\n authorForWidget,\\r\\n stateUpdate,\\r\\n initialBody,\\r\\n initialCreateState,\\r\\n editArticleData,\\r\\n widgets,\\r\\n handleFilterArticles,\\r\\n handleEditArticle,\\r\\n handlerStateUpdate,\\r\\n sbtWhiteList,\\r\\n sbts,\\r\\n canLoggedUserCreateArticles,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nconst libSrcArray = [widgets.libArticle];\\r\\n\\r\\nconst errTextNoBody = \\\"ERROR: no article Body\\\",\\r\\n errTextNoId = \\\"ERROR: no article Id\\\",\\r\\n errTextDublicatedId = \\\"ERROR: there is article with such name\\\";\\r\\n\\r\\nState.init({\\r\\n ...initialCreateState,\\r\\n initialBody: props.initialBody ?? \\\"\\\",\\r\\n functionsToCallByLibrary: {\\r\\n article: [],\\r\\n },\\r\\n});\\r\\n\\r\\nfunction createStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\nconst tagsArray =\\r\\n editArticleData && !state.tagsModified ? editArticleData.tags : state.tags;\\r\\n\\r\\nconst accountId = context.accountId;\\r\\n\\r\\nfunction getRealArticleId() {\\r\\n if (editArticleData) {\\r\\n return (\\r\\n editArticleData.id ??\\r\\n `${editArticleData.author}-${editArticleData.timeCreate}`\\r\\n );\\r\\n } else {\\r\\n return `${accountId}-${Date.now()}`;\\r\\n }\\r\\n}\\r\\n\\r\\nconst getArticleData = () => {\\r\\n const args = {\\r\\n title: editArticleData.title ?? state.title,\\r\\n author: editArticleData.author ?? accountId,\\r\\n lastEditor: accountId,\\r\\n timeLastEdit: Date.now(),\\r\\n timeCreate: editArticleData.timeCreate ?? Date.now(),\\r\\n body: state.articleBody,\\r\\n version: editArticleData ? editArticleData.version + 1 : 0,\\r\\n navigation_id: null,\\r\\n tags: tagsArray,\\r\\n id: getRealArticleId(),\\r\\n sbts,\\r\\n };\\r\\n return args;\\r\\n};\\r\\n\\r\\nfunction onCommit() {\\r\\n State.update({\\r\\n title: \\\"\\\",\\r\\n clearArticleId: true,\\r\\n tags: [],\\r\\n clearTags: true,\\r\\n articleBody: \\\"\\\",\\r\\n clearArticleBody: true,\\r\\n initalBody: \\\"\\\",\\r\\n showCreatedArticle: true,\\r\\n showPreview: false,\\r\\n saving: false,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction onCancel() {\\r\\n State.update({\\r\\n createdArticle: undefined,\\r\\n saving: false,\\r\\n });\\r\\n}\\r\\n\\r\\nfunction getInitialMarkdownBody() {\\r\\n if (\\r\\n editArticleData &&\\r\\n (!state.articleBody || state.articleBody === editArticleData.body)\\r\\n ) {\\r\\n return editArticleData.body;\\r\\n } else if (state.articleBody && state.articleBody !== editArticleData.body) {\\r\\n return state.articleBody;\\r\\n } else {\\r\\n return state.initialBody == \\\"\\\" || !state.initialBody\\r\\n ? \\\"Post content (markdown supported)\\\"\\r\\n : state.initalBody;\\r\\n }\\r\\n}\\r\\n\\r\\nfunction createArticleListener() {\\r\\n //To test without commiting use the next line and comment the rest\\r\\n // onCommit();\\r\\n State.update({ saving: true });\\r\\n const article = getArticleData();\\r\\n const newLibsCalls = Object.assign({}, state.functionsToCallByLibrary);\\r\\n newLibsCalls.article.push({\\r\\n functionName: \\\"createArticle\\\",\\r\\n key: \\\"createdArticle\\\",\\r\\n props: {\\r\\n article,\\r\\n onCommit,\\r\\n onCancel,\\r\\n },\\r\\n });\\r\\n\\r\\n State.update({ functionsToCallByLibrary: newLibsCalls });\\r\\n}\\r\\n\\r\\nfunction switchShowPreview() {\\r\\n State.update({\\r\\n showPreview: !state.showPreview,\\r\\n initialBody: state.articleBody,\\r\\n });\\r\\n}\\r\\n\\r\\nconst GeneralContainer = styled.div`\\r\\n background-color: rgb(248, 248, 249);\\r\\n margin: 0;\\r\\n`;\\r\\n\\r\\nconst Button = styled.button` \\r\\n margin: 0px 1rem; \\r\\n display: inline-block; \\r\\n text-align: center; \\r\\n vertical-align: middle; \\r\\n cursor: pointer; \\r\\n user-select: none; \\r\\n transition: color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out; \\r\\n \\r\\n border: 2px solid transparent; \\r\\n font-weight: 500; \\r\\n padding: 0.3rem 0.5rem; \\r\\n background-color: #010A2D; \\r\\n border-radius: 12px; \\r\\n color: white; \\r\\n text-decoration: none; \\r\\n \\r\\n &:hover { \\r\\n color: #010A2D; \\r\\n background-color: white; \\r\\n } \\r\\n`;\\r\\n\\r\\nconst CreationContainer = styled.div`\\r\\n background-color: rgb(230, 230, 230);\\r\\n border-radius: 20px;\\r\\n padding: 1rem 0;\\r\\n position: relative;\\r\\n`;\\r\\n\\r\\nconst SecondContainer = styled.div`\\r\\n min-width: 360px;\\r\\n background-color: white;\\r\\n padding: 1rem;\\r\\n`;\\r\\n\\r\\nconst BoxShadow = styled.div`\\r\\n box-shadow: rgba(140, 149, 159, 0.1) 0px 4px 28px 0px;\\r\\n`;\\r\\n\\r\\nconst SpinnerContainer = styled.div`\\r\\n height: 1rem;\\r\\n width: 1rem;\\r\\n marginTop: 2px;\\r\\n`;\\r\\n\\r\\nconst Spinner = () => {\\r\\n return (\\r\\n <SpinnerContainer className=\\\"spinner-border text-secondary\\\" role=\\\"status\\\">\\r\\n <span className=\\\"sr-only\\\" title=\\\"Loading...\\\"></span>\\r\\n </SpinnerContainer>\\r\\n );\\r\\n};\\r\\n\\r\\nconst initialTagsObject = {};\\r\\n\\r\\nArray.isArray(tagsArray) &&\\r\\n tagsArray.forEach((tag) => {\\r\\n initialTagsObject[tag] = true;\\r\\n });\\r\\n\\r\\nreturn (\\r\\n <div>\\r\\n <GeneralContainer className=\\\"pt-2 row card-group\\\">\\r\\n <BoxShadow className=\\\"rounded-3 p-3 m-3 bg-white col-lg-8 col-md-8 col-sm-12\\\">\\r\\n {state.createdArticle && state.showCreatedArticle && editArticleData ? (\\r\\n <Widget\\r\\n src={widgets.articleView}\\r\\n props={{\\r\\n widgets,\\r\\n isTest,\\r\\n handleFilterArticles,\\r\\n articleToRenderData: state.createdArticle,\\r\\n authorForWidget,\\r\\n handleEditArticle,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n ) : (\\r\\n <div>\\r\\n {\\r\\n // <CreationContainer className=\\\"container-fluid\\\">\\r\\n }\\r\\n <SecondContainer className=\\\"rounded\\\">\\r\\n {state.showPreview ? (\\r\\n <Widget\\r\\n src={widgets.generalCard}\\r\\n props={{\\r\\n widgets,\\r\\n isTest,\\r\\n data: {\\r\\n title: state.title,\\r\\n author: accountId,\\r\\n lastEditor: accountId,\\r\\n timeLastEdit: Date.now(),\\r\\n timeCreate: Date.now(),\\r\\n body: state.articleBody,\\r\\n version: 0,\\r\\n navigation_id: null,\\r\\n tags: tagsArray,\\r\\n id: getRealArticleId(),\\r\\n sbts,\\r\\n },\\r\\n addressForArticles,\\r\\n handleOpenArticle: () => {},\\r\\n handleFilterArticles: () => {},\\r\\n authorForWidget,\\r\\n handleShareButton: () => {},\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n ) : (\\r\\n <div>\\r\\n <div className=\\\"d-flex flex-column pt-3\\\">\\r\\n <label for=\\\"inputArticleId\\\" className=\\\"small text-danger\\\">\\r\\n {state.errorId}\\r\\n </label>\\r\\n <Widget\\r\\n src={widgets.fasterTextInput}\\r\\n props={{\\r\\n firstText: state.title,\\r\\n forceClear: state.clearArticleId,\\r\\n stateUpdate: (obj) => State.update(obj),\\r\\n filterText: (e) => e.target.value,\\r\\n placeholder: \\\"Post title (case-sensitive)\\\",\\r\\n editable: editArticleData,\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n <div className=\\\"d-flex flex-column pt-3\\\">\\r\\n <label\\r\\n for=\\\"textareaArticleBody\\\"\\r\\n className=\\\"small text-danger\\\"\\r\\n >\\r\\n {state.errorBody}\\r\\n </label>\\r\\n <div className=\\\"d-flex gap-2\\\">\\r\\n <Widget\\r\\n src={widgets.markownEditorIframe}\\r\\n props={{\\r\\n initialText: getInitialMarkdownBody(),\\r\\n onChange: (articleBody) =>\\r\\n State.update({\\r\\n articleBody,\\r\\n clearArticleBody: false,\\r\\n }),\\r\\n clearArticleBody: state.clearArticleBody,\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n </div>\\r\\n <div className=\\\"d-flex flex-column pt-3\\\">\\r\\n <Widget\\r\\n src={widgets.tagsEditor}\\r\\n props={{\\r\\n forceClear: state.clearTags,\\r\\n stateUpdate: (obj) => State.update(obj),\\r\\n initialTagsObject,\\r\\n placeholder: \\\"Input tags\\\",\\r\\n setTagsObject: (tags) => {\\r\\n // state.tags = Object.keys(tags);\\r\\n State.update({\\r\\n tagsModified: true,\\r\\n tags: Object.keys(tags),\\r\\n });\\r\\n },\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n </div>\\r\\n )}\\r\\n <div className=\\\"mt-2 d-flex justify-content-end\\\">\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n className: \\\"info outline mx-2\\\",\\r\\n disabled:\\r\\n state.title.length === 0 ||\\r\\n state.articleBody.length === 0,\\r\\n onClick: switchShowPreview,\\r\\n children: (\\r\\n <i\\r\\n className={`bi ${\\r\\n state.showPreview ? \\\"bi-pencil\\\" : \\\"bi-eye-fill\\\"\\r\\n }`}\\r\\n ></i>\\r\\n ),\\r\\n }}\\r\\n />\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n className: \\\"info \\\",\\r\\n disabled:\\r\\n state.title.length === 0 ||\\r\\n state.articleBody.length === 0,\\r\\n onClick: createArticleListener,\\r\\n children: (\\r\\n <div className=\\\"d-flex justify-conten-center align-items-center\\\">\\r\\n {state.saving ? (\\r\\n <Spinner />\\r\\n ) : (\\r\\n <>\\r\\n <span>\\r\\n {editArticleData ? \\\"Save edition\\\" : \\\"Post\\\"}\\r\\n </span>\\r\\n <i className=\\\"bi bi-check2\\\"></i>\\r\\n </>\\r\\n )}\\r\\n </div>\\r\\n ),\\r\\n }}\\r\\n />\\r\\n </div>\\r\\n </SecondContainer>\\r\\n <div style={{ display: \\\"none\\\" }}>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n createStateUpdate,\\r\\n state.functionsToCallByLibrary,\\r\\n { baseAction: baseActions.articlesBaseAction },\\r\\n \\\"Create\\\"\\r\\n );\\r\\n })}\\r\\n </div>\\r\\n </div>\\r\\n )}\\r\\n </BoxShadow>\\r\\n </GeneralContainer>\\r\\n </div>\\r\\n);\\r\\n",
"NDC.UpVoteButton": "//NDC.UpVoteButton\\r\\n\\r\\nconst {\\r\\n isTest,\\r\\n authorForWidget,\\r\\n reactedElementData,\\r\\n widgets,\\r\\n disabled,\\r\\n articleSbts,\\r\\n upVotes: articleUpVotes,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nconst data = reactedElementData;\\r\\n\\r\\nconst libSrcArray = [widgets.libUpVotes];\\r\\n\\r\\nconst initLibCalls = {\\r\\n upVotes: [\\r\\n {\\r\\n functionName: \\\"getUpVotes\\\",\\r\\n key: \\\"upVotesBySBT\\\",\\r\\n props: {\\r\\n id: data.id ?? `${data.author}-${data.timeCreate}`,\\r\\n sbtsNames: articleSbts,\\r\\n },\\r\\n },\\r\\n ],\\r\\n};\\r\\nconst initUpVotesBySBT = {};\\r\\n\\r\\nif (!articleUpVotes) {\\r\\n State.init({\\r\\n functionsToCallByLibrary: initLibCalls,\\r\\n articleUpVotes: [],\\r\\n upVotesBySBT: initUpVotesBySBT,\\r\\n });\\r\\n} else {\\r\\n State.init({\\r\\n articleUpVotes,\\r\\n functionsToCallByLibrary: { upVotes: [] },\\r\\n });\\r\\n}\\r\\n\\r\\nif (state.upVotesBySBT && Object.keys(state.upVotesBySBT).length > 0) {\\r\\n const key = Object.keys(state.upVotesBySBT)[0]; // There should always be one for now\\r\\n const newUpvotes = state.upVotesBySBT[key];\\r\\n if (JSON.stringify(state.articleUpVotes) !== JSON.stringify(newUpvotes)) {\\r\\n State.update({ articleUpVotes: newUpvotes });\\r\\n }\\r\\n}\\r\\n\\r\\nlet upVotesData = state.articleUpVotes;\\r\\n\\r\\nlet userVote = upVotesData.find((vote) => vote.accountId === context.accountId);\\r\\n\\r\\nlet hasUserVoted = userVote !== undefined;\\r\\n\\r\\nfunction getUpVoteButtonClass() {\\r\\n if (hasUserVoted) {\\r\\n return \\\"info\\\";\\r\\n } else {\\r\\n return \\\"info outline\\\";\\r\\n }\\r\\n}\\r\\n\\r\\nfunction stateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\nfunction upVoteButtonListener() {\\r\\n let newLibCalls = Object.assign({}, state.functionsToCallByLibrary);\\r\\n\\r\\n if (!hasUserVoted) {\\r\\n newLibCalls.upVotes.push({\\r\\n functionName: \\\"addVote\\\",\\r\\n key: \\\"newVote\\\",\\r\\n props: {\\r\\n id: data.id ?? `${data.author}-${data.timeCreate}`,\\r\\n articleSbts: data.sbts,\\r\\n },\\r\\n });\\r\\n } else {\\r\\n newLibCalls.upVotes.push({\\r\\n functionName: \\\"deleteVote\\\",\\r\\n key: \\\"deletedVote\\\",\\r\\n props: {\\r\\n id: data.id ?? `${data.author}-${data.timeCreate}`,\\r\\n upVoteId: userVote.value.upVoteId,\\r\\n },\\r\\n });\\r\\n }\\r\\n State.update({ functionsToCallByLibrary: newLibCalls });\\r\\n}\\r\\n\\r\\nconst IconContainer = styled.div`\\r\\n transform: rotate(-90deg);\\r\\n`;\\r\\n\\r\\nconst Icon = styled.i`\\r\\n margin: 0px !important;\\r\\n`;\\r\\n\\r\\nconst CallLibrary = styled.div`\\r\\n display: none;\\r\\n`;\\r\\n\\r\\nreturn (\\r\\n <>\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Input.Button}\\r\\n props={{\\r\\n children: (\\r\\n <div className=\\\"d-flex\\\">\\r\\n <span>{`+${upVotesData.length}`}</span>\\r\\n <IconContainer>\\r\\n <Icon\\r\\n className={`bi bi-fast-forward-fill ${\\r\\n !disabled && \\\"text-success\\\"\\r\\n }`}\\r\\n ></Icon>\\r\\n </IconContainer>\\r\\n </div>\\r\\n ),\\r\\n disabled,\\r\\n className: `${getUpVoteButtonClass()}`,\\r\\n size: \\\"sm\\\",\\r\\n onClick: upVoteButtonListener,\\r\\n }}\\r\\n />\\r\\n\\r\\n <CallLibrary>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n stateUpdate,\\r\\n state.functionsToCallByLibrary,\\r\\n { baseAction: baseActions.upVoteBaseAction },\\r\\n \\\"Up vote button\\\"\\r\\n );\\r\\n })}\\r\\n </CallLibrary>\\r\\n </>\\r\\n);\\r\\n",
"MarkdownEditorIframe": "const initialText = props.initialText ?? \\\"# Hello World\\\\n\\\\n\\\";\\r\\nconst clear = props.clearArticleBody ?? false;\\r\\n\\r\\nconst embedCss = props.embedCss || \\\"\\\";\\r\\n\\r\\nconst code = `\\r\\n<script src=\\\"https://unpkg.com/react@18/umd/react.development.js\\\" crossorigin></script>\\r\\n<script src=\\\"https://unpkg.com/react-dom@18/umd/react-dom.development.js\\\" crossorigin></script>\\r\\n<script src=\\\"https://unpkg.com/[email protected]/lib/index.js\\\" crossorigin></script>\\r\\n<link rel=\\\"stylesheet\\\" href=\\\"https://unpkg.com/[email protected]/lib/index.css\\\" />\\r\\n\\r\\n<style>\\r\\n${embedCss}\\r\\n</style>\\r\\n\\r\\n<div id=\\\"react-root\\\"></div>\\r\\n\\r\\n<script>\\r\\nfunction TestReact(props) {\\r\\n const [value, setValue] = React.useState(props.initialText || \\\"\\\");\\r\\n \\r\\n React.useEffect(() => {\\r\\n if(props.clear) setValue(props.initialText)\\r\\n }, [props.initialText, props.clear])\\r\\n\\r\\n return React.createElement(ReactMarkdownEditorLite.default, {\\r\\n value,\\r\\n view: { menu: true, md: true, html: false },\\r\\n canView: { menu: true, md: false, html: false, fullScreen: false, hideMenu: true },\\r\\n onChange: ({ text }) => {\\r\\n setValue(text);\\r\\n window.top.postMessage(text, \\\"*\\\");\\r\\n },\\r\\n renderHTML: () => {},\\r\\n className: \\\"full\\\",\\r\\n }); \\r\\n}\\r\\n\\r\\nconst domContainer = document.querySelector(\\\'#react-root\\\');\\r\\nconst root = ReactDOM.createRoot(domContainer);\\r\\n\\r\\nwindow.addEventListener(\\\"message\\\", (event) => {\\r\\n root.render(React.createElement(TestReact, {\\r\\n initialText: event.data.initialText,\\r\\n clear: event.data.clear,\\r\\n }));\\r\\n});\\r\\n\\r\\n</script>\\r\\n`;\\r\\n\\r\\nreturn (\\r\\n <iframe\\r\\n className=\\\"w-100 h-100\\\"\\r\\n srcDoc={code}\\r\\n message={{ initialText, clear }}\\r\\n onMessage={props.onChange}\\r\\n />\\r\\n);\\r\\n", "NDC.StyledComponents": "const { Button, Dropdown, TextArea, Input, Link, Tag } = props;\\n\\nconst Styled = {\\n Button: styled.button`\\n width: max-content;\\n padding: ${(props) => (Button.size === \\\"sm\\\" ? \\\"4px 12px\\\" : \\\"8px 20px\\\")};\\n height: ${(props) => (Button.size === \\\"sm\\\" ? \\\"28px\\\" : \\\"\\\")};\\n font-size: ${(props) => (Button.size === \\\"sm\\\" ? \\\"12px\\\" : \\\"14px\\\")};\\n border-radius: ${(props) => (Button.size === \\\"sm\\\" ? \\\"6px\\\" : \\\"10px\\\")};\\n font-weight: 500;\\n line-height: 24px;\\n text-align: center;\\n border: 0;\\n\\n &.danger {\\n border: 1px solid #c23f38;\\n background: #f1d6d5;\\n color: #c23f38;\\n }\\n\\n &.primary {\\n background: #ffd50d;\\n\\n &:hover {\\n background: #e7c211;\\n }\\n\\n &.dark {\\n color: #fff;\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\n\\n &:hover {\\n background: linear-gradient(90deg, #792ac0 0%, #423abd 100%);\\n }\\n }\\n\\n &:disabled {\\n cursor: not-allowed;\\n background: #c3cace;\\n color: #828688;\\n border: 0;\\n\\n &:hover {\\n background: #c3cace;\\n color: #828688;\\n }\\n }\\n }\\n\\n &.secondary {\\n background: transparent;\\n border: 1px solid;\\n border-color: #ffd50d;\\n color: #ffd50d;\\n\\n &:hover {\\n border-color: #e7c211;\\n color: #e7c211;\\n }\\n\\n &.dark {\\n color: #4f46e5;\\n border-color: #4f46e5;\\n\\n &:hover {\\n border-color: #2f2a87;\\n color: #2f2a87;\\n }\\n }\\n\\n &:disabled {\\n border-color: #c3cace;\\n color: #828688;\\n cursor: not-allowed;\\n\\n &:hover {\\n border-color: #c3cace;\\n color: #828688;\\n }\\n }\\n }\\n\\n i {\\n margin: 0;\\n margin-left: ${(props) => (props.text ? \\\"5px\\\" : \\\"0\\\")};\\n }\\n `,\\n\\n Link: styled.a`\\n width: max-content;\\n padding: ${(props) => (Link.size === \\\"sm\\\" ? \\\"4px 12px\\\" : \\\"8px 20px\\\")};\\n height: ${(props) => (Link.size === \\\"sm\\\" ? \\\"28px\\\" : \\\"\\\")};\\n font-size: ${(props) => (Link.size === \\\"sm\\\" ? \\\"12px\\\" : \\\"14px\\\")};\\n border-radius: ${(props) => (Link.size === \\\"sm\\\" ? \\\"6px\\\" : \\\"10px\\\")};\\n font-weight: 500;\\n line-height: 24px;\\n text-align: center;\\n border: 0;\\n color: black;\\n\\n &:hover {\\n text-decoration: none;\\n color: black;\\n }\\n\\n &.danger {\\n border: 1px solid #c23f38;\\n background: #f1d6d5;\\n color: #c23f38;\\n }\\n\\n &.primary {\\n background: #ffd50d;\\n\\n &:hover {\\n background: #e7c211;\\n }\\n\\n &.dark {\\n color: #fff;\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\n\\n &:hover {\\n background: linear-gradient(90deg, #792ac0 0%, #423abd 100%);\\n }\\n }\\n\\n &:disabled {\\n background: #c3cace;\\n color: #828688;\\n border: 0;\\n }\\n }\\n\\n &.secondary {\\n background: transparent;\\n border: 1px solid;\\n border-color: #ffd50d;\\n color: #ffd50d;\\n\\n &:hover {\\n border-color: #e7c211;\\n color: #e7c211;\\n }\\n\\n &.dark {\\n color: #4f46e5;\\n border-color: #4f46e5;\\n\\n &:hover {\\n border-color: #2f2a87;\\n color: #2f2a87;\\n }\\n }\\n\\n &:disabled {\\n border-color: #c3cace;\\n color: #828688;\\n }\\n }\\n\\n i {\\n margin: 0 0 0 5px;\\n }\\n `,\\n\\n Select: styled.select`\\n padding: 8px 10px;\\n width: 100%;\\n height: 40px;\\n background: #ffffff;\\n border: 1px solid #d0d6d9;\\n border-radius: 8px;\\n font-size: 14px;\\n color: #828688;\\n `,\\n TextArea: styled.textarea`\\n padding: 8px 10px;\\n width: 100%;\\n background: #ffffff;\\n border: 1px solid #d0d6d9;\\n border-radius: 8px;\\n font-size: 14px;\\n color: #828688;\\n `,\\n Input: styled.input`\\n padding: 8px 10px;\\n width: 100%;\\n background: #ffffff;\\n border: 1px solid #d0d6d9;\\n border-radius: 8px;\\n font-size: 14px;\\n color: #828688;\\n `,\\n Tag: styled.div`\\n display: flex;\\n flex-direction: row;\\n justify-content: center;\\n align-items: center;\\n padding: 4px 8px;\\n border: 1px solid #9333ea;\\n color: #9333ea;\\n background: linear-gradient(\\n 90deg,\\n rgba(147, 51, 234, 0.1) 0%,\\n rgba(79, 70, 229, 0.1) 100%\\n );\\n border-radius: 100px;\\n\\n &.dark {\\n color: #fff;\\n background: linear-gradient(90deg, #9333ea 0%, #4f46e5 100%);\\n }\\n\\n p {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n max-width: 150px;\\n font-style: normal;\\n font-weight: 500;\\n font-size: 11px;\\n line-height: 120%;\\n margin-bottom: 0;\\n }\\n `,\\n};\\n\\nconst Container = styled.div`\\n h4 {\\n margin: 10px 0;\\n }\\n`;\\n\\nconst Label = styled.label`\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 500;\\n margin-bottom: 5px;\\n`;\\n\\nif (Link)\\n return (\\n <Styled.Link\\n size={Link.size}\\n className={`align-items-center d-flex ${Link.className ?? \\\"primary\\\"}`}\\n href={Link.href}\\n disabled={Link.disabled}\\n >\\n <div>{Link.text}</div>\\n {Link.icon && (\\n <div className={`${Link.size === \\\"sm\\\" ? \\\"fs-7\\\" : \\\"fs-6\\\"}`}>\\n {Link.icon}\\n </div>\\n )}\\n </Styled.Link>\\n );\\n\\nif (Button)\\n return (\\n <Styled.Button\\n size={Button.size}\\n className={`align-items-center d-flex ${Button.className ?? \\\"primary\\\"}`}\\n onClick={Button.onClick}\\n disabled={Button.disabled}\\n text={Button.text}\\n >\\n <div>{Button.text}</div>\\n {Button.icon && (\\n <div className={`${Button.size === \\\"sm\\\" ? \\\"fs-7\\\" : \\\"fs-6\\\"}`}>\\n {Button.icon}\\n </div>\\n )}\\n </Styled.Button>\\n );\\n\\nif (Tag)\\n return (\\n <Styled.Tag className={Tag.className}>\\n <p title={Tag.title}>{Tag.title}</p>\\n </Styled.Tag>\\n );\\n\\nif (Dropdown)\\n return (\\n <div>\\n <Label>{Dropdown.label}</Label>\\n <Styled.Select\\n value={Dropdown.value}\\n onChange={(e) => Dropdown.handleChange(e.target.value)}\\n >\\n {Dropdown.options.map((opt) => (\\n <>\\n {opt.default ? (\\n <option default value={opt.value}>\\n {opt.title}\\n </option>\\n ) : (\\n <option value={opt.value}>{opt.title}</option>\\n )}\\n </>\\n ))}\\n </Styled.Select>\\n </div>\\n );\\n\\nif (TextArea)\\n return (\\n <div>\\n {TextArea.label && <Label>{TextArea.label}</Label>}\\n <Styled.TextArea\\n value={TextArea.value}\\n placeholder={TextArea.placeholder}\\n onChange={TextArea.handleChange}\\n rows={5}\\n />\\n\\n {TextArea.maxLength && (\\n <div className=\\\"d-flex justify-content-end\\\">\\n <small style={{ fontSize: 12 }} className=\\\"text-secondary\\\">\\n {parseInt(TextArea.maxLength) - TextArea.value.length ?? 0} left\\n </small>\\n </div>\\n )}\\n </div>\\n );\\n\\nif (Input)\\n return (\\n <div>\\n <Label>{Input.label}</Label>\\n <Styled.Input\\n value={Input.value}\\n type={Input.type ?? \\\"text\\\"}\\n placeholder={Input.placeholder}\\n onChange={Input.handleChange}\\n maxLength={Input.maxLength}\\n min={Input.min}\\n max={Input.max}\\n />\\n\\n {Input.maxLength && (\\n <div className=\\\"d-flex justify-content-end\\\">\\n <small style={{ fontSize: 12 }} className=\\\"text-secondary\\\">\\n {parseInt(Input.maxLength) - Input.value.length ?? 0} left\\n </small>\\n </div>\\n )}\\n </div>\\n );\\n\\nconst WidgetButton = ({ type, size, className, disabled, text, icon }) => (\\n <Widget\\n src={\\\"rubycop.near/widget/NDC.StyledComponents\\\"}\\n props={{\\n [type ?? \\\"Button\\\"]: {\\n size,\\n className,\\n disabled,\\n text,\\n icon,\\n },\\n }}\\n />\\n);\\n\\nconst WidgetSelect = () => (\\n <Widget\\n src={\\\"rubycop.near/widget/NDC.StyledComponents\\\"}\\n props={{\\n Dropdown: {\\n label: \\\"Select label\\\",\\n options: [\\n { title: \\\"Select value\\\", default: true, value: 0 },\\n { title: \\\"value 1\\\", value: 1 },\\n { title: \\\"value 2\\\", value: 2 },\\n ],\\n },\\n }}\\n />\\n);\\n\\nconst WidgetInput = ({ type }) => {\\n State.init({ [type]: \\\"\\\" });\\n\\n return (\\n <Widget\\n src={\\\"rubycop.near/widget/NDC.StyledComponents\\\"}\\n props={{\\n [type]: {\\n label: \\\"Select label\\\",\\n placeholder: \\\"Placeholder text here...\\\",\\n maxLength: \\\"20\\\",\\n min: new Date(),\\n value: state[type],\\n handleChange: (e) => State.update({ [type]: e.target.value }),\\n },\\n }}\\n />\\n );\\n};\\n\\nreturn (\\n <Container>\\n <h4>Button</h4>\\n <div className=\\\"d-flex align-items-end flex-wrap gap-2 mb-2\\\">\\n <WidgetButton text=\\\"Primary\\\" />\\n <WidgetButton text=\\\"Primary\\\" icon={<i class=\\\"bi bi-check-lg\\\"></i>} />\\n <WidgetButton\\n text=\\\"Secondary\\\"\\n className=\\\"secondary\\\"\\n icon={<i class=\\\"bi bi-check-lg\\\"></i>}\\n />\\n <WidgetButton disabled text=\\\"Primary\\\" />\\n <WidgetButton disabled className=\\\"secondary\\\" text=\\\"Secondary\\\" />\\n <WidgetButton size=\\\"sm\\\" text=\\\"Primary\\\" />\\n <WidgetButton size=\\\"sm\\\" className=\\\"secondary\\\" text=\\\"Secondary\\\" />\\n </div>\\n\\n <div className=\\\"d-flex align-items-end flex-wrap gap-2 mb-2\\\">\\n <WidgetButton text=\\\"Primary Dark\\\" className=\\\"primary dark\\\" />\\n <WidgetButton\\n text=\\\"Primary Dark\\\"\\n className=\\\"primary dark\\\"\\n icon={<i class=\\\"bi bi-check-lg\\\"></i>}\\n />\\n <WidgetButton\\n text=\\\"Secondary Dark\\\"\\n className=\\\"secondary dark\\\"\\n icon={<i class=\\\"bi bi-check-lg\\\"></i>}\\n />\\n <WidgetButton disabled className=\\\"primary dark\\\" text=\\\"Primary dark\\\" />\\n <WidgetButton disabled className=\\\"secondary dark\\\" text=\\\"Secondary dark\\\" />\\n <WidgetButton size=\\\"sm\\\" className=\\\"primary dark\\\" text=\\\"Primary dark\\\" />\\n <WidgetButton\\n size=\\\"sm\\\"\\n className=\\\"secondary dark\\\"\\n text=\\\"Secondary dark\\\"\\n />\\n </div>\\n\\n <div className=\\\"d-flex align-items-end flex-wrap gap-2 mb-2\\\">\\n <WidgetButton\\n text=\\\"Danger\\\"\\n className=\\\"danger\\\"\\n icon={<i class=\\\"bi bi-trash\\\" />}\\n />\\n </div>\\n\\n <div className=\\\"d-flex align-items-end flex-wrap gap-2 mb-2\\\">\\n <WidgetButton\\n size=\\\"sm\\\"\\n className=\\\"secondary dark\\\"\\n icon={<i class=\\\"bi bi-share\\\"></i>}\\n />\\n <WidgetButton\\n disabled\\n size=\\\"sm\\\"\\n className=\\\"secondary dark\\\"\\n icon={<i class=\\\"bi bi-share\\\"></i>}\\n />\\n </div>\\n\\n <h4>Link Button</h4>\\n <div className=\\\"d-flex align-items-end flex-wrap gap-2\\\">\\n <WidgetButton type=\\\"Link\\\" text=\\\"Primary\\\" className=\\\"primary dark\\\" />\\n <WidgetButton type=\\\"Link\\\" text=\\\"Secondary\\\" className=\\\"secondary dark\\\" />\\n </div>\\n\\n <h4>Tag</h4>\\n <div className=\\\"d-flex align-items-end flex-wrap gap-2 mb-2\\\">\\n <Widget\\n src={\\\"rubycop.near/widget/NDC.StyledComponents\\\"}\\n props={{ Tag: { title: \\\"Lorem ipsum\\\", className: \\\"dark\\\" } }}\\n />\\n <Widget\\n src={\\\"rubycop.near/widget/NDC.StyledComponents\\\"}\\n props={{ Tag: { title: \\\"Lorem ipsum\\\" } }}\\n />\\n <Widget\\n src={\\\"rubycop.near/widget/NDC.StyledComponents\\\"}\\n props={{\\n Tag: {\\n title: \\\"Lorem ipsum dolor sit amet, consectetur adipiscing elit\\\",\\n },\\n }}\\n />\\n </div>\\n\\n <h4>Select</h4>\\n <WidgetSelect />\\n\\n <h4>Input</h4>\\n <WidgetInput type=\\\"Input\\\" />\\n <WidgetInput type=\\\"TextArea\\\" />\\n </Container>\\n);\\n",
"Profile.OverlayTrigger": "return (\\n <Widget\\n loading={props.children}\\n src=\\\"mob.near/widget/N.Common.OverlayTrigger\\\"\\n props={{\\n popup: (\\n <Widget\\n src=\\\"mob.near/widget/Profile.Popover\\\"\\n props={{ accountId: props.accountId }}\\n />\\n ),\\n ...props,\\n }}\\n />\\n);\\n",
"NDC.ArticlesByAuthorCard": "//NDC.ArticlesByAuthorCard\\r\\n\\r\\nconst { authorArticlesArray, filter, handleFilterArticles, widgets } = props;\\r\\n\\r\\nconst CardContainer = styled.a`\\r\\n color: black;\\r\\n font-size: 16px;\\r\\n line-height: 19.2px;\\r\\n font-family: inherit;\\r\\n box-shadow: 0px 0px 30px 0px #0000000D;\\r\\n cursor: pointer;\\r\\n with: fit-content;\\r\\n min-width: 18rem;\\r\\n display: flex;\\r\\n flex-wrap: nowrap;\\r\\n\\r\\n &:hover {\\r\\n color: white;\\r\\n text-decoration: none;\\r\\n background: linear-gradient(90deg, rgba(147,51,234,1) 0%, rgba(79,70,229,1) 100%);\\r\\n }\\r\\n`;\\r\\n\\r\\nconst ImgContainer = styled.div`\\r\\n border-radius: 20px;\\r\\n overflow: hidden;\\r\\n`;\\r\\n\\r\\nreturn (\\r\\n <div className=\\\"col-sm-12 col-lg-6 col-xl-4 gy-3\\\">\\r\\n <CardContainer\\r\\n className=\\\"card h-100 p-3\\\"\\r\\n onClick={() => handleFilterArticles(filter)}\\r\\n >\\r\\n <ImgContainer>\\r\\n <Widget\\r\\n src={widgets.profileShortInlineBlock}\\r\\n props={{\\r\\n widgets,\\r\\n accountId: authorArticlesArray[0].author,\\r\\n tooltip: true,\\r\\n maxWidth: \\\"90%\\\",\\r\\n }}\\r\\n />\\r\\n </ImgContainer>\\r\\n <span>{authorArticlesArray.length} articles</span>\\r\\n </CardContainer>\\r\\n </div>\\r\\n);\\r\\n",
"Profile.ShortInlineBlock": "const accountId = props.accountId;\\r\\n\\r\\nconst profile = props.profile ?? Social.getr(`${accountId}/profile`);\\r\\n\\r\\nconst maxNameLength = props.maxNameLength;\\r\\n\\r\\nconst widgets = props.widgets;\\r\\n\\r\\nlet name = profile.name;\\r\\n\\r\\nconst maxWidth = props.maxWidth ?? \\\"60%\\\";\\r\\n\\r\\nconst inner = (\\r\\n <div className=\\\"d-flex flex-row\\\" style={{ maxWidth: \\\"100%\\\" }}>\\r\\n <Widget\\r\\n src={widgets.profileImage}\\r\\n props={{\\r\\n metadata,\\r\\n accountId,\\r\\n widgetName,\\r\\n style: {\\r\\n height: \\\"2.5em\\\",\\r\\n width: \\\"2.5em\\\",\\r\\n minWidth: \\\"2.5em\\\",\\r\\n borderRadius: \\\"20px\\\",\\r\\n },\\r\\n className: \\\"me-2\\\",\\r\\n }}\\r\\n />\\r\\n <div className=\\\"text-truncate lh-sm\\\" style={{ maxWidth: \\\"100%\\\" }}>\\r\\n <div\\r\\n className=\\\"text-truncate fw-bold\\\"\\r\\n style={{ maxWidth: \\\"90%\\\", textAlign: \\\"start\\\" }}\\r\\n >\\r\\n {name\\r\\n ? name\\r\\n : maxNameLength\\r\\n ? accountId.slice(0, maxNameLength) + \\\"...\\\"\\r\\n : accountId}\\r\\n </div>\\r\\n <div className=\\\"text-truncate text-muted\\\" style={{ maxWidth: \\\"90%\\\" }}>\\r\\n <small>\\r\\n <span className=\\\"font-monospace\\\">@{accountId}</span>\\r\\n </small>\\r\\n </div>\\r\\n </div>\\r\\n </div>\\r\\n);\\r\\n\\r\\nreturn (\\r\\n <div\\r\\n className=\\\"short-inline-block-container\\\"\\r\\n style={{ maxWidth: `${maxWidth}` }}\\r\\n >\\r\\n {props.tooltip ? (\\r\\n <Widget\\r\\n src={widgets.profileOverlayTrigger}\\r\\n props={{ accountId, children: inner, maxWidth: `${maxWidth}` }}\\r\\n />\\r\\n ) : (\\r\\n inner\\r\\n )}\\r\\n </div>\\r\\n);\\r\\n",
"NDC.Forum.AllArticlesList": "// NDC.Forum.AllArticlesList\\r\\n\\r\\n//===============================================INITIALIZATION=====================================================\\r\\n\\r\\nlet {\\r\\n isTest,\\r\\n stateUpdate,\\r\\n articlesToRender,\\r\\n tabs,\\r\\n widgets,\\r\\n addressForArticles,\\r\\n handleFilterArticles,\\r\\n handleOpenArticle,\\r\\n authorForWidget,\\r\\n initialCreateState,\\r\\n editArticleData,\\r\\n handleEditArticle,\\r\\n showCreateArticle,\\r\\n sbtWhiteList,\\r\\n sbts,\\r\\n handleShareButton,\\r\\n canLoggedUserCreateArticles,\\r\\n filterBy,\\r\\n callLibs,\\r\\n baseActions,\\r\\n} = props;\\r\\n\\r\\nconst libSrcArray = [widgets.libUpVotes];\\r\\n\\r\\nlet initLibsCalls = { upVotes: [] };\\r\\n\\r\\n//For the moment we\\\'ll allways have only 1 sbt in the array. If this change remember to do the propper work in lib.SBT and here.\\r\\n\\r\\ninitLibsCalls.upVotes = articlesToRender.map((article) => {\\r\\n return {\\r\\n functionName: \\\"getUpVotes\\\",\\r\\n key: `upVotes-${article.id}`,\\r\\n props: {\\r\\n id: article.id ?? `${article.author}-${article.timeCreate}`,\\r\\n sbtsNames: article.sbts ?? [],\\r\\n },\\r\\n };\\r\\n});\\r\\n\\r\\nif (articlesToRender.length > 0) {\\r\\n State.update({ libsCalls: initLibsCalls });\\r\\n}\\r\\n\\r\\nState.init({\\r\\n start: Date.now(),\\r\\n libsCalls: initLibsCalls,\\r\\n});\\r\\n\\r\\nif (state.upVotesBySBT && Object.keys(state.upVotesBySBT).length > 0) {\\r\\n const key = Object.keys(state.upVotesBySBT)[0]; // There should always be one for now\\r\\n const newUpvotes = state.upVotesBySBT[key];\\r\\n if (JSON.stringify(state.upVotes) !== JSON.stringify(newUpvotes)) {\\r\\n State.update({ upVotes: newUpvotes });\\r\\n }\\r\\n}\\r\\n\\r\\nlet finalArticlesWithUpVotes = articlesToRender.map((article) => {\\r\\n if (state[`upVotes-${article.id}`]) {\\r\\n const key = Object.keys(state[`upVotes-${article.id}`])[0];\\r\\n const articleUpVotes = state[`upVotes-${article.id}`][key];\\r\\n article.upVotes = articleUpVotes;\\r\\n\\r\\n return article;\\r\\n }\\r\\n});\\r\\n\\r\\nconst fiveDaysTimeLapse = 432000000;\\r\\n\\r\\nconst newestArticlesWithUpVotes = finalArticlesWithUpVotes\\r\\n .filter((article) => article.timeLastEdit > Date.now() - fiveDaysTimeLapse)\\r\\n .sort((a, b) => b.timeLastEdit - a.timeLastEdit);\\r\\n\\r\\nconst olderArticlesWithUpVotes = finalArticlesWithUpVotes\\r\\n .filter((article) => article.timeLastEdit < Date.now() - fiveDaysTimeLapse)\\r\\n .sort((a, b) => b.upVotes.length - a.upVotes.length);\\r\\n\\r\\nconst sortedFinalArticlesWithUpVotes = [\\r\\n ...newestArticlesWithUpVotes,\\r\\n ...olderArticlesWithUpVotes,\\r\\n];\\r\\n\\r\\n//=============================================END INITIALIZATION===================================================\\r\\n\\r\\n//===================================================CONSTS=========================================================\\r\\n\\r\\nconst AcordionContainer = styled.div`--bs-accordion-border-width: 0px!important;`;\\r\\n\\r\\nconst NoMargin = styled.div`margin: 0 0.75rem;`;\\r\\n\\r\\nconst AccordionBody = styled.div`padding: 0;`;\\r\\n\\r\\nconst ArticlesListContainer = styled.div`\\r\\n background-color: rgb(248, 248, 249);\\r\\n margin: 0;\\r\\n`;\\r\\n\\r\\nconst CallLibrary = styled.div`\\r\\n display: none;\\r\\n`;\\r\\n\\r\\nconst IconCursorPointer = styled.i`\\r\\n cursor: pointer;\\r\\n`;\\r\\n\\r\\n//=================================================END CONSTS=======================================================\\r\\n\\r\\n//==================================================FUNCTIONS=======================================================\\r\\n\\r\\nfunction getDateLastEdit(timestamp) {\\r\\n const date = new Date(Number(timestamp));\\r\\n const dateString = {\\r\\n date: date.toLocaleDateString(),\\r\\n time: date.toLocaleTimeString(),\\r\\n };\\r\\n return dateString;\\r\\n}\\r\\n\\r\\nfunction allArticlesListStateUpdate(obj) {\\r\\n State.update(obj);\\r\\n}\\r\\n\\r\\n//================================================END FUNCTIONS=====================================================\\r\\nreturn (\\r\\n <>\\r\\n {showCreateArticle ? (\\r\\n <>\\r\\n <AcordionContainer className=\\\"accordion\\\" id=\\\"accordionExample\\\">\\r\\n <NoMargin className=\\\"accordion-item\\\">\\r\\n <h2 className=\\\"accordion-header\\\" id=\\\"headingOne\\\">\\r\\n <button\\r\\n className=\\\"accordion-button collapsed\\\"\\r\\n type=\\\"button\\\"\\r\\n data-bs-toggle=\\\"collapse\\\"\\r\\n data-bs-target=\\\"#collapseOne\\\"\\r\\n aria-expanded=\\\"true\\\"\\r\\n aria-controls=\\\"collapseOne\\\"\\r\\n >\\r\\n <h6 className=\\\"m-0\\\">+ Create post</h6>\\r\\n </button>\\r\\n </h2>\\r\\n <div\\r\\n id=\\\"collapseOne\\\"\\r\\n className=\\\"accordion-collapse collapse\\\"\\r\\n aria-labelledby=\\\"headingOne\\\"\\r\\n data-bs-parent=\\\"#accordionExample\\\"\\r\\n >\\r\\n <AccordionBody className=\\\"accordion-body\\\">\\r\\n <Widget\\r\\n src={widgets.create}\\r\\n props={{\\r\\n isTest,\\r\\n addressForArticles,\\r\\n authorForWidget,\\r\\n stateUpdate,\\r\\n widgets,\\r\\n initialCreateState,\\r\\n editArticleData,\\r\\n callLibs,\\r\\n handleFilterArticles,\\r\\n handleEditArticle,\\r\\n initialBody: \\\"\\\",\\r\\n canLoggedUserCreateArticles,\\r\\n sbts,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n </AccordionBody>\\r\\n </div>\\r\\n </NoMargin>\\r\\n </AcordionContainer>\\r\\n </>\\r\\n ) : (\\r\\n <h6>You can\\\'t post since you don\\\'t own this SBT</h6>\\r\\n )}\\r\\n <NoMargin>\\r\\n {filterBy.parameterName === \\\"tag\\\" && (\\r\\n <div className=\\\"mt-3\\\">\\r\\n <h6>Filter by tag:</h6>\\r\\n <div className=\\\"d-flex align-items-center \\\">\\r\\n <Widget\\r\\n src={widgets.newStyledComponents.Element.Badge}\\r\\n props={{\\r\\n children: filterBy.parameterValue,\\r\\n variant: \\\"round info\\\",\\r\\n size: \\\"lg\\\",\\r\\n }}\\r\\n />\\r\\n <IconCursorPointer\\r\\n className=\\\"bi bi-x\\\"\\r\\n onClick={() => handleFilterArticles({ filterBy: \\\"\\\", value: \\\"\\\" })}\\r\\n ></IconCursorPointer>\\r\\n </div>\\r\\n </div>\\r\\n )}\\r\\n <ArticlesListContainer className=\\\"row card-group py-3\\\">\\r\\n {sortedFinalArticlesWithUpVotes.length > 0 ? (\\r\\n sortedFinalArticlesWithUpVotes.map((article, i) => {\\r\\n const authorProfileCall = Social.getr(`${article.author}/profile`);\\r\\n\\r\\n if (authorProfileCall) {\\r\\n article.authorProfile = authorProfileCall;\\r\\n }\\r\\n\\r\\n // If some widget posts data different than an array it will be ignored\\r\\n if (!Array.isArray(article.tags)) article.tags = [];\\r\\n return (\\r\\n <Widget\\r\\n src={widgets.generalCard}\\r\\n props={{\\r\\n widgets,\\r\\n isTest,\\r\\n data: article,\\r\\n displayOverlay: true,\\r\\n renderReactions: true,\\r\\n addressForArticles,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n authorForWidget,\\r\\n handleShareButton,\\r\\n sbtWhiteList,\\r\\n callLibs,\\r\\n baseActions,\\r\\n }}\\r\\n />\\r\\n );\\r\\n })\\r\\n ) : (\\r\\n <h5>No articles uploaded using this SBT yet</h5>\\r\\n )}\\r\\n </ArticlesListContainer>\\r\\n </NoMargin>\\r\\n <CallLibrary>\\r\\n {libSrcArray.map((src) => {\\r\\n return callLibs(\\r\\n src,\\r\\n allArticlesListStateUpdate,\\r\\n state.libsCalls,\\r\\n { baseAction: baseActions.upVoteBaseAction },\\r\\n \\\"All articles list\\\"\\r\\n );\\r\\n })}\\r\\n </CallLibrary>\\r\\n </>\\r\\n);\\r\\n",
"NDC.AllArticlesSortByAuthors": "//NDC.AllArticlesSortByAuthors\\r\\n\\r\\nconst {\\r\\n finalArticles,\\r\\n tabs,\\r\\n widgets,\\r\\n handleOpenArticle,\\r\\n handleFilterArticles,\\r\\n authorForWidget,\\r\\n} = props;\\r\\n\\r\\nconst finalArticlesBySbt = finalArticles;\\r\\nconst allFinalArticles = [];\\r\\n\\r\\nObject.values(finalArticlesBySbt).forEach((sbt) => {\\r\\n const allArticlesOnSbt = sbt.map((article) => article);\\r\\n allFinalArticles = [...allFinalArticles, ...allArticlesOnSbt];\\r\\n});\\r\\n\\r\\nconst articlesAuthors =\\r\\n allFinalArticles.length &&\\r\\n Array.from(allFinalArticles, ({ author }) => author);\\r\\n\\r\\nlet authors = [...new Set(articlesAuthors)];\\r\\n\\r\\nlet articlesByAuthorsArray = [];\\r\\nauthors.map((author) => {\\r\\n let thisAuthorArtciles = allFinalArticles.filter(\\r\\n (article) => article.author == author\\r\\n );\\r\\n articlesByAuthorsArray.push(thisAuthorArtciles);\\r\\n});\\r\\n\\r\\nreturn (\\r\\n <div className=\\\"container-fluid\\\">\\r\\n <h6>Total authors: {articlesByAuthorsArray.length}</h6>\\r\\n\\r\\n <div className=\\\"row card-group py-3\\\">\\r\\n {articlesByAuthorsArray &&\\r\\n articlesByAuthorsArray.map((authorArticlesArray) => {\\r\\n const filter = {\\r\\n filterBy: \\\"author\\\",\\r\\n value: authorArticlesArray[0].author,\\r\\n };\\r\\n return (\\r\\n <Widget\\r\\n src={widgets.articlesByAuthorCard}\\r\\n props={{\\r\\n authorArticlesArray,\\r\\n filter,\\r\\n handleFilterArticles,\\r\\n widgets,\\r\\n }}\\r\\n />\\r\\n );\\r\\n })}\\r\\n </div>\\r\\n </div>\\r\\n);\\r\\n",
"WikiOnSocialDB_TooltipProfiles": "const accounts = props.accounts || [];\\nconst emoji = props.emoji || \\\"\\\";\\n\\nconst Button = styled.button`\\nborder: 0;\\nbackground: transparent;\\n`;\\n\\nreturn (\\n <>\\n {accounts && (\\n <OverlayTrigger\\n placement=\\\"auto\\\"\\n overlay={\\n <Tooltip>\\n <div\\n className=\\\"text-truncate text-start\\\"\\n style={{ maxWidth: \\\"16em\\\" }}\\n >\\n {accounts.slice(0, 10).map((accountId) => (\\n <Fragment key={accountId}>\\n <Widget\\n src=\\\"mob.near/widget/ProfileLine\\\"\\n props={{ accountId, link: false }}\\n />\\n <br />\\n </Fragment>\\n ))}\\n {accounts.length > 10 ? \\\"...\\\" : \\\"\\\"}\\n </div>\\n </Tooltip>\\n }\\n >\\n <Button type=\\\"button\\\">\\n {accounts.length} {emoji}\\n </Button>\\n <span>{accounts.length}</span>\\n </OverlayTrigger>\\n )}\\n </>\\n);\\n"