@e-llm-studio/instant-learning 1.3.0-alpha.113 → 1.3.0-alpha.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import"tslib";import"react/jsx-runtime";import"react";import"lucide-react";import"./store/useLearningTemplateStore.js";import"primereact/toast";import"./apis/scopeApis.js";import"./store/usePermissionsStore.js";import"./store/useLMSConfigStore.js";import"./components/ToolTip.js";import"./store/useAuthStore.js";import"@mui/material";import"@mui/icons-material/Check";import"@mui/icons-material/CloseRounded";import{QueryClient as t}from"@tanstack/react-query";import"./store/useEnvStore.js";import"date-fns/format";import"date-fns/isValid";import"date-fns/parseISO";import"framer-motion";import"../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"../IL-OTJ/_components/InputDataReasoningCard.js";import"../IL-OTJ/_components/TooltipComponent.js";import"../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import"../IL-OTJ/store/CitationsContext.js";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"./store/useConfigStore.js";import"appsec-ui";import"@radix-ui/react-tooltip";import"./components/StationOnboarding/InputField.js";import"./config.js";import"./store/useAppSecRolesStore.js";import"react-router-dom";new t;
1
+ import"tslib";import"react/jsx-runtime";import"react";import"lucide-react";import"./store/useLearningTemplateStore.js";import"primereact/toast";import"./apis/scopeApis.js";import"./store/usePermissionsStore.js";import"./store/useLMSConfigStore.js";import"./components/ToolTip.js";import"./store/useAuthStore.js";import"@mui/material";import"@mui/icons-material/Check";import"@mui/icons-material/CloseRounded";import{QueryClient as t}from"@tanstack/react-query";import"./store/useEnvStore.js";import"date-fns/format";import"date-fns/isValid";import"date-fns/parseISO";import"framer-motion";import"../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"../IL-OTJ/_components/InputDataReasoningCard.js";import"../IL-OTJ/_components/TooltipComponent.js";import"../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import"../IL-OTJ/store/CitationsContext.js";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import"../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import"./store/useConfigStore.js";import"appsec-ui";import"@radix-ui/react-tooltip";import"./components/StationOnboarding/InputField.js";import"./config.js";import"./store/useAppSecRolesStore.js";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"./AuditLog/ChangeLogDiff.js";import"react-router-dom";new t;
2
2
  //# sourceMappingURL=LearningManagementTest.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as n,Fragment as o}from"react/jsx-runtime";import{useEffect as s}from"react";import i from"./RuleContent/RuleContent.js";import c from"./StationsContent/StationsContent.js";import a from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import{useLearningTemplateStore as r}from"./store/useLearningTemplateStore.js";import l from"./store/useEnvStore.js";import u from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as d,mapScopeChildrenToStations as m}from"./utils/treeUtils.js";import p from"./SidebarWrapper.js";import f from"./components/StationOnboarding/StationOnboardModal.js";import S from"./components/EmptyLearningState.js";import{dt as v}from"./store/useLMSConfigStore.js";import{EMPTY_STATE_DT_PATH as C}from"./constants.js";var g=function(g){var R,A,h=g.onOpenCreateModal,j=g.onRefreshRuleSets,q=g.scopeTreeData,D=g.onAddChild,T=g.onRenameChild,I=g.onDeleteChild,M=g.canDeleteScope,O=g.canEditScope,w=g.canCreateScope,b=g.onSectionSelect,y=g.onViewStation,B=g.activeSectionId,L=void 0===B?"learnings":B,_=g.sectionsConfig,k=g.nodeTypesConfig,E=g.app_integration_id,N=g.token,x=g.modeId,U=g.onRequestAccess,P=g.isRequestingAccess,V=g.isAccessRequested,Y=r(function(e){return e.isStationModalOpen}),W=r(function(e){return e.setStationModalOpen}),z=r(function(e){return e.isStationOnboardModalTriggered}),F=r(function(e){return e.setIsStationOnboardModalTriggered}),G=r(function(e){return e.selectedRuleSetId});r(function(e){return e.rawAuditRuleData});var H=l(function(e){return e.auditLogConfig});r(function(e){return e.ruleData});var J=G?d((null==q?void 0:q.data)||null,G):null;return Boolean((null===(R=null==q?void 0:q.data)||void 0===R?void 0:R.id)&&G===q.data.id),s(function(){z&&W(!0)},[z,W,F]),t("div",e({className:u.container},{children:[n(p,{onOpenCreateModal:h,onRefreshRuleSets:j,scopeTreeData:q,onAddChild:D,onRenameChild:T,onDeleteChild:I,canDeleteScope:M,canEditScope:O,canCreateScope:w,onSectionSelect:b,activeSectionId:L,sectionsConfig:_,nodeTypesConfig:k}),n("div",e({id:"rule-template-layout-content",className:"".concat(u.content," relative flex-1 overflow-hidden")},{children:"stations"===L?n(c,{scopeId:G||"",scopeName:(null==J?void 0:J.name)||"Unknown Scope",stationsCount:null===(A=null==J?void 0:J.metrics)||void 0===A?void 0:A.stationsCount,stations:m(J),onViewStation:y}):"access"===L?n(a,{selectedRuleSetId:G,scopeName:(null==J?void 0:J.name)||"Unknown Scope"}):"history"===L?(null==H?void 0:H.configId)?n(o,{}):null:J&&!1===J.hasAccess?n(S,{onCreate:function(){},title:v("".concat(C,".noAccessTitle"),"Access Restricted"),desc:v("".concat(C,".noAccessDesc"),"You do not have access to view this ".concat(null==J?void 0:J.name," learnings.")),button:"",canCreateRule:!1,noAccessTitle:v("".concat(C,".noAccessTitle"),"Access Restricted"),noAccessDesc:v("".concat(C,".noAccessDesc"),"You do not have access to view this ".concat(null==J?void 0:J.name," learnings.")),requestAccessButton:v("".concat(C,".requestAccessButton"),"Request Access"),requestSentButton:v("".concat(C,".requestSentButton"),"Request Sent"),onRequestAccess:function(){return null==U?void 0:U(G)},isRequestingAccess:P,isAccessRequested:V}):n(i,{onRefreshRuleSets:j,app_integration_id:E,token:N,modeId:x})})),n(f,{isOpen:Y,onClose:function(){W(!1),F(!1)},onBoardStation:function(e){j(!0,e)},app_integration_id:E,token:N})]}))};export{g as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useEffect as n}from"react";import s from"./RuleContent/RuleContent.js";import i from"./StationsContent/StationsContent.js";import c from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import{useLearningTemplateStore as a}from"./store/useLearningTemplateStore.js";import r from"./store/useEnvStore.js";import l from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as u,mapScopeChildrenToStations as d}from"./utils/treeUtils.js";import m from"./SidebarWrapper.js";import p from"./components/StationOnboarding/StationOnboardModal.js";import f from"./AuditLog/AuditLog.js";import S from"./components/EmptyLearningState.js";import{dt as v}from"./store/useLMSConfigStore.js";import{EMPTY_STATE_DT_PATH as g}from"./constants.js";var A=function(A){var C,R,h=A.onOpenCreateModal,j=A.onRefreshRuleSets,q=A.scopeTreeData,D=A.onAddChild,I=A.onRenameChild,T=A.onDeleteChild,w=A.canDeleteScope,M=A.canEditScope,O=A.canCreateScope,L=A.onSectionSelect,b=A.onViewStation,y=A.activeSectionId,B=void 0===y?"learnings":y,k=A.sectionsConfig,_=A.nodeTypesConfig,N=A.app_integration_id,E=A.token,U=A.modeId,x=A.onRequestAccess,P=A.isRequestingAccess,V=A.isAccessRequested,Y=a(function(e){return e.isStationModalOpen}),W=a(function(e){return e.setStationModalOpen}),z=a(function(e){return e.isStationOnboardModalTriggered}),F=a(function(e){return e.setIsStationOnboardModalTriggered}),G=a(function(e){return e.selectedRuleSetId}),H=a(function(e){return e.rawAuditRuleData}),J=r(function(e){return e.auditLogConfig});a(function(e){return e.ruleData});var K=G?u((null==q?void 0:q.data)||null,G):null;return Boolean((null===(C=null==q?void 0:q.data)||void 0===C?void 0:C.id)&&G===q.data.id),n(function(){z&&W(!0)},[z,W,F]),t("div",e({className:l.container},{children:[o(m,{onOpenCreateModal:h,onRefreshRuleSets:j,scopeTreeData:q,onAddChild:D,onRenameChild:I,onDeleteChild:T,canDeleteScope:w,canEditScope:M,canCreateScope:O,onSectionSelect:L,activeSectionId:B,sectionsConfig:k,nodeTypesConfig:_}),o("div",e({id:"rule-template-layout-content",className:"".concat(l.content," relative flex-1 overflow-hidden")},{children:"stations"===B?o(i,{scopeId:G||"",scopeName:(null==K?void 0:K.name)||"Unknown Scope",stationsCount:null===(R=null==K?void 0:K.metrics)||void 0===R?void 0:R.stationsCount,stations:d(K),onViewStation:b}):"access"===B?o(c,{selectedRuleSetId:G,scopeName:(null==K?void 0:K.name)||"Unknown Scope"}):"history"===B?(null==J?void 0:J.configId)?o(f,{configId:J.configId,scopeId:G||void 0,scopeName:(null==K?void 0:K.name)||"Unknown Scope",ruleData:H}):null:K&&!1===K.hasAccess?o(S,{onCreate:function(){},title:v("".concat(g,".noAccessTitle"),"Access Restricted"),desc:v("".concat(g,".noAccessDesc"),"You do not have access to view this ".concat(null==K?void 0:K.name," learnings.")),button:"",canCreateRule:!1,noAccessTitle:v("".concat(g,".noAccessTitle"),"Access Restricted"),noAccessDesc:v("".concat(g,".noAccessDesc"),"You do not have access to view this ".concat(null==K?void 0:K.name," learnings.")),requestAccessButton:v("".concat(g,".requestAccessButton"),"Request Access"),requestSentButton:v("".concat(g,".requestSentButton"),"Request Sent"),onRequestAccess:function(){return null==x?void 0:x(G)},isRequestingAccess:P,isAccessRequested:V}):o(s,{onRefreshRuleSets:j,app_integration_id:N,token:E,modeId:U})})),o(p,{isOpen:Y,onClose:function(){W(!1),F(!1)},onBoardStation:function(e){j(!0,e)},app_integration_id:N,token:E})]}))};export{A as default};
2
2
  //# sourceMappingURL=LearningTemplateLayout.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as t,__spreadArray as n,__assign as r}from"tslib";import{jsx as o,jsxs as i,Fragment as l}from"react/jsx-runtime";import{useRef as a,useState as s,useEffect as u}from"react";import{useLearningTemplateStore as c}from"../store/useLearningTemplateStore.js";import d from"../components/EmptyLearningState.js";import{getRulesInRuleSetById as p,exportRuleSet as m,deleteRule as f,deleteQuestion as v,alterQuestionPriority as g}from"../apis/scopeApis.js";import h from"../components/RuleContentSkeleton.js";import{Toast as T}from"primereact/toast";import y from"./ContentLogic.js";import w from"../components/ErrorStateDisplay.js";import S from"../shared/SuccessToastContent.js";import C from"../shared/ErrorToastContent.js";import{findNodeById as j}from"../utils/treeUtils.js";import R from"../styles/LearningContent.module.css.js";import b from"../components/ConfirmationModal.js";import{dt as I}from"../store/useLMSConfigStore.js";import"../../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"lucide-react";import"../../IL-OTJ/_components/InputDataReasoningCard.js";import"../../IL-OTJ/_components/TooltipComponent.js";import"../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import{CitationProvider as x}from"../../IL-OTJ/store/CitationsContext.js";import"@mui/material";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import D from"../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import{LEARNING_DT_PATH as _,VARIANT_DT_PATH as k,TIER_DT_PATH as L}from"../constants.js";import{useConfigStore as O}from"../store/useConfigStore.js";import"../store/usePermissionsStore.js";import"appsec-ui";import"../store/useAuthStore.js";import"../store/useEnvStore.js";import"@radix-ui/react-tooltip";import"../components/StationOnboarding/InputField.js";import"../config.js";import"../store/useAppSecRolesStore.js";import"@tanstack/react-query";import"../components/ToolTip.js";import"react-router-dom";import"../LearningManagementTest.js";var M=function(M){var A,N=M.noRulesTitle,E=void 0===N?"No rules have been added !":N,V=M.noRulesDesc,F=void 0===V?"Start by adding rules that should apply across all stations.":V,P=M.noRulesButtonText,B=void 0===P?"Create New Rule":P,J=M.deleteRuleSuccessMessage,U=void 0===J?"Rule deleted successfully!":J,W=M.deleteVariantSuccessMessage,q=void 0===W?"Variant deleted successfully!":W,G=M.deleteRuleErrorMessage,H=void 0===G?"Failed to delete rule. Please try again.":G,$=M.deleteVariantErrorMessage,z=void 0===$?"Failed to delete variant. Please try again.":$,K=M.deleteModalTitle,Q=void 0===K?"Delete":K,X=M.deleteRuleModalWarning,Y=void 0===X?"This will permanently delete the rule configuration.":X,Z=M.deleteVariantModalWarning,ee=void 0===Z?"This will permanently delete the variant configuration.":Z,te=M.deleteConfirmText,ne=void 0===te?"Delete":te,re=M.onRefreshRuleSets,oe=M.app_integration_id,ie=M.token,le=M.modeId,ae=c(function(e){return e.selectedRuleSetId}),se=c(function(e){return e.scopeTreeData}),ue=c(function(e){return e.sidebarTab}),ce=c(function(e){return e.setInitialRules}),de=c(function(e){return e.currentRules}),pe=c(function(e){return e.setRawAuditRuleData});c(function(e){return e.createdVariantInfo});var me=c(function(e){return e.resetCreatedVariantInfo}),fe=c(function(e){return e.isILModalTriggered}),ve=c(function(e){return e.setIsILModalTriggered}),ge=a(null),he=O.getState().configuration,Te=s(!1),ye=Te[0],we=Te[1],Se=s(null),Ce=Se[0],je=Se[1],Re=s(null),be=Re[0],Ie=Re[1],xe=s(null),De=xe[0],_e=xe[1],ke=s(null),Le=ke[0],Oe=ke[1],Me=s(!1),Ae=Me[0],Ne=Me[1],Ee=s(null),Ve=Ee[0],Fe=Ee[1],Pe=s(!1),Be=Pe[0],Je=Pe[1],Ue=s(""),We=Ue[0],qe=Ue[1],Ge=s(null),He=Ge[0],$e=Ge[1],ze=s(!1),Ke=ze[0],Qe=ze[1],Xe=s(!1),Ye=Xe[0],Ze=Xe[1],et=s("ruleDeletion"),tt=et[0],nt=et[1],rt=s(null),ot=rt[0],it=rt[1],lt=s(!1),at=lt[0],st=lt[1],ut=s(!1),ct=ut[0],dt=ut[1],pt=c.getState().tiers,mt=s(null),ft=mt[0],vt=mt[1],gt=s(null),ht=gt[0],Tt=gt[1],yt=s(null),wt=yt[0],St=yt[1],Ct=function(){je(null),Ie(null),we(!0),Oe(0)},jt=function(){we(!1),ve(!1),je(null),Ie(null),_e(null),Oe(null),Ze(!1),dt(!1),Rt(),vt(null),Tt(null),St(null),re&&re(!1,ae||void 0)};u(function(){Rt()},[ae,ce]),u(function(){fe&&we(!0)},[fe]);var Rt=function(o){return void 0===o&&(o=!1),e(void 0,void 0,void 0,function(){var e,i,l,a,s,u,d,m,f,v,g,h,T,y,w,S,C,j,R;return t(this,function(t){switch(t.label){case 0:if(!ae)return ce([]),[2];o||Ne(!0),Fe(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p(ae,ie)];case 2:return e=t.sent(),console.log("response==",e),(null==e?void 0:e.data)&&0!==Object.keys(e.data).length?(pe(e),i=e.data,console.log("rulesData==",i),l=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),a=Array.isArray(i.tiers)?n([],i.tiers,!0).sort(function(e,t){var n,r;return(null!==(n=e.tier_priority)&&void 0!==n?n:0)-(null!==(r=t.tier_priority)&&void 0!==r?r:0)}).map(function(e){return[e.name,e.value]}):Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!l.has(t)&&Array.isArray(n)}),s=a.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),u=s.flatMap(function(e){return Array.from(e)}),d=u.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),m=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(e){return e.map(function(e){var t;return r(r({},e),{variants:null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return r(r({},e),{isLinked:!!e.link_id&&m.has(e.link_id)})})})})},v=a.map(function(e,t){var n,r=e[0],o=e[1],i=pt.find(function(e){return e.tier_name===r}),l=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==i?void 0:i.tier_id)&&void 0!==n?n:String(t+1),name:l.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:o.length,description:0===t?"".concat(I("tier.subtitle","These are the system-wide learnings applied across all stations.")):"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:f(o)}}),(g=c.getState().createdVariantInfo)&&g.length>0?(h=Object.fromEntries(a.map(function(e,t){return[e[0],String(t+1)]})),T=new Set(g.map(function(e){return h[e.tierName]}).filter(Boolean)),y=v.map(function(e){return r(r({},e),{isOpen:e.isOpen||T.has(e.id)})}),ce(y),(w=null===(R=null===(j=null===(C=g[0])||void 0===C?void 0:C.variants)||void 0===j?void 0:j[0])||void 0===R?void 0:R.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(w,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return me()},1e4)},500):me()):ce(v),[3,5]):(ce([]),[2]);case 3:return S=t.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Fe((null==S?void 0:S.message)||"Failed to load rules. Please try again."),ce([]),[3,5];case 4:return o||Ne(!1),[7];case 5:return[2]}})})},bt=ae?j((null==se?void 0:se.data)||null,ae):null,It=bt?{ruleSetId:bt.id,ruleSetName:bt.name,ruleSetDesc:"",ruleCount:null===(A=null==bt?void 0:bt.metrics)||void 0===A?void 0:A.learningsCount}:void 0,xt=Boolean(null==se?void 0:se.data),Dt=Boolean(ae&&!bt&&xt),_t=function(){if("stations"===ue)return"custom";if(!bt)return"global";switch(bt.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},kt=function(e){var t;if(!e)return o("p",{children:I("".concat(L,".deleteDialog.description"),"Are you sure you want to delete this rule? This action cannot be undone.")});var n=null==de?void 0:de.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(t){return t.ruleId===e});return o("p",{children:I("".concat(L,".deleteDialog.description"),"Are you sure you want to delete ".concat(null==n?void 0:n.ruleTitle," rule? This action cannot be undone."),{rule_title:null!==(t=null==n?void 0:n.ruleTitle)&&void 0!==t?t:""})})},Lt={editingRule:Ce,editingTier:be,editingVariants:De,focusedVariantIndex:Le,setFocusedVariantIndex:Oe,triggerAddVariant:Ye,triggerFixGaps:ct,copiedRule:ft,copiedSourceTier:ht,copiedTargetTier:wt,initialDraftMessage:We,app_integration_id:oe,modeId:le};return It?i(l,{children:[o(T,{ref:ge}),o("div",r({className:R.container},{children:Ae?o(h,{}):Ve?o(w,{errorMessage:Ve,onRetry:Rt}):o(y,{onAddRule:Ct,onDeleteRule:function(e){$e(e)},onEditRule:function(e,t){je(e),Ie(t||null),_e(e.variants||null),Oe(null),Ze(!0),we(!0)},onEditVariant:function(e,t,n,r){var o,i,l,a,s=null!==(l=null===(i=null===(o=null==de?void 0:de.find(function(e){return e.name===n}))||void 0===o?void 0:o.rules)||void 0===i?void 0:i.find(function(e){return e.ruleId===t}))&&void 0!==l?l:null==de?void 0:de.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(a=s.variants)||void 0===a?void 0:a.findIndex(function(t){return t.variantId===e.variantId}),c=void 0!==u&&-1!==u?u:0;je(s),Ie(n||null),_e(s.variants||null),Oe(c),we(!0),"resolve_gaps"===r&&dt(!0)}},onDeleteVariant:function(e,t){it({variantId:e,ruleId:t})},onExportRule:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l,a,s;return t(this,function(t){switch(t.label){case 0:if(!ae)return[2];Je(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,m(ae)];case 2:return e=t.sent(),n=window.URL.createObjectURL(e),(r=document.createElement("a")).href=n,i=(null==It?void 0:It.ruleSetName)?"".concat(It.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(ae,".csv"),r.download=i,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),null===(a=ge.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=t.sent(),console.error("Export error:",l),null===(s=ge.current)||void 0===s||s.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return Je(!1),[7];case 5:return[2]}})})},isExporting:Be,onToggleSuccess:function(){return Rt(!0)},onReorderRules:function(n,r,i,l,a){return e(void 0,void 0,void 0,function(){var e,s,u;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,g(n,r,i,l,a)];case 1:return t.sent(),Rt(!0),null===(s=ge.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return e=t.sent(),console.error("Failed to reorder rules:",e),Rt(!0),null===(u=ge.current)||void 0===u||u.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:re,setDeleteConfirmationUsedFor:nt,onCopyToTier:function(e,t,n,r,o){var i,l,a=null===(l=null===(i=null==de?void 0:de.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===l?void 0:l.find(function(e){return e.ruleId===t});if(a){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(o)].join("\n");qe(s),vt(a),Tt(r),St(o),je(null),Ie(null),_e(null),Oe(null),we(!0)}}})})),ye&&o(x,{children:o(D,{isOpen:ye,onClose:jt,app_integration_id:oe,token:ie,mode:"ADD",config:he,pluginPayload:r(r({},Lt),{initialScope:_t(),ruleSet:It})})}),o(b,{isOpen:!!He,title:I("".concat(_,".deleteDialog.title"),Q),description:kt(He),warning:I("".concat(_,".deleteDialog.warningText"),Y),confirmText:I("".concat(_,".deleteDialog.deleteText"),ne),cancelText:I("".concat(_,".deleteDialog.cancelText"),"Cancel"),loadingText:I("".concat(_,".deleteDialog.loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!He)return[2];Qe(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,f(He)];case 2:return t.sent(),$e(null),null===(n=ge.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:U})}),Rt(),re&&re(!1,ae||void 0),[3,5];case 3:return e=t.sent(),console.error("Failed to delete rule",e),null===(r=ge.current)||void 0===r||r.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||H})}),[3,5];case 4:return Qe(!1),[7];case 5:return[2]}})})},onCancel:function(){return $e(null)},isLoading:Ke}),o(b,{isOpen:!!ot,title:I("".concat(k,".deleteVariant.title"),Q),description:"variantDeletion"===tt?o("span",{children:I("".concat(k,".deleteVariant.desc"),"Are you sure you want to delete this variant? This action cannot be undone.")}):kt((null==ot?void 0:ot.ruleId)||null),warning:I("".concat(k,".deleteVariant.warningText"),"ruleDeletion"===tt?Y:ee),confirmText:I("".concat(k,".deleteDialog.deleteText"),ne),cancelText:I("".concat(k,".cancelText"),"Cancel"),loadingText:I("".concat(k,".loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!ot)return[2];st(!0),t.label=1;case 1:return t.trys.push([1,6,7,8]),"ruleDeletion"!==tt?[3,3]:[4,v(ot.ruleId)];case 2:return t.sent(),[3,5];case 3:return[4,f(ot.variantId)];case 4:t.sent(),t.label=5;case 5:return it(null),null===(n=ge.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:"ruleDeletion"===tt?U:q})}),Rt(),re&&re(!1,ae||void 0),[3,8];case 6:return e=t.sent(),console.error("Failed to delete variant",e),null===(r=ge.current)||void 0===r||r.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===tt?H:z)})}),[3,8];case 7:return st(!1),[7];case 8:return[2]}})})},onCancel:function(){return it(null)},isLoading:at})]}):Dt?o(w,{title:"Scope Not Found",errorMessage:"The selected scope does not exist. Please refresh the page or choose a valid scope.",onRetry:function(){return null==re?void 0:re(!0)},retryButtonText:"Refresh"}):i(l,{children:[o(d,{onCreate:Ct,title:E,desc:F,button:B}),ye&&o(x,{children:o(D,{isOpen:ye,onClose:jt,app_integration_id:oe,token:ie,mode:"ADD",config:he,pluginPayload:r(r({},Lt),{initialScope:_t(),ruleSet:It})})})]})};export{M as default};
1
+ import{__awaiter as e,__generator as t,__spreadArray as n,__assign as r}from"tslib";import{jsx as o,jsxs as i,Fragment as l}from"react/jsx-runtime";import{useRef as a,useState as s,useEffect as u}from"react";import{useLearningTemplateStore as c}from"../store/useLearningTemplateStore.js";import d from"../components/EmptyLearningState.js";import{getRulesInRuleSetById as p,exportRuleSet as m,deleteRule as f,deleteQuestion as v,alterQuestionPriority as g}from"../apis/scopeApis.js";import h from"../components/RuleContentSkeleton.js";import{Toast as T}from"primereact/toast";import y from"./ContentLogic.js";import w from"../components/ErrorStateDisplay.js";import S from"../shared/SuccessToastContent.js";import C from"../shared/ErrorToastContent.js";import{findNodeById as j}from"../utils/treeUtils.js";import R from"../styles/LearningContent.module.css.js";import b from"../components/ConfirmationModal.js";import{dt as I}from"../store/useLMSConfigStore.js";import"../../IL-OTJ/_components/atoms/Textarea/Textarea.js";import"lucide-react";import"../../IL-OTJ/_components/InputDataReasoningCard.js";import"../../IL-OTJ/_components/TooltipComponent.js";import"../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js";import{CitationProvider as D}from"../../IL-OTJ/store/CitationsContext.js";import"@mui/material";import"uuid";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"../../IL-OTJ/_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js";import"../../IL-OTJ/_components/CitationLink.js";import"@e-llm-studio/citation";import x from"../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js";import{LEARNING_DT_PATH as _,VARIANT_DT_PATH as L,TIER_DT_PATH as k}from"../constants.js";import{useConfigStore as O}from"../store/useConfigStore.js";import"../store/usePermissionsStore.js";import"appsec-ui";import"../store/useAuthStore.js";import"../store/useEnvStore.js";import"@radix-ui/react-tooltip";import"../components/StationOnboarding/InputField.js";import"../config.js";import"../store/useAppSecRolesStore.js";import"@tanstack/react-query";import"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import"../AuditLog/ChangeLogDiff.js";import"../components/ToolTip.js";import"react-router-dom";import"../LearningManagementTest.js";var M=function(M){var A,N=M.noRulesTitle,E=void 0===N?"No rules have been added !":N,V=M.noRulesDesc,F=void 0===V?"Start by adding rules that should apply across all stations.":V,P=M.noRulesButtonText,B=void 0===P?"Create New Rule":P,J=M.deleteRuleSuccessMessage,U=void 0===J?"Rule deleted successfully!":J,W=M.deleteVariantSuccessMessage,q=void 0===W?"Variant deleted successfully!":W,G=M.deleteRuleErrorMessage,H=void 0===G?"Failed to delete rule. Please try again.":G,$=M.deleteVariantErrorMessage,z=void 0===$?"Failed to delete variant. Please try again.":$,K=M.deleteModalTitle,Q=void 0===K?"Delete":K,X=M.deleteRuleModalWarning,Y=void 0===X?"This will permanently delete the rule configuration.":X,Z=M.deleteVariantModalWarning,ee=void 0===Z?"This will permanently delete the variant configuration.":Z,te=M.deleteConfirmText,ne=void 0===te?"Delete":te,re=M.onRefreshRuleSets,oe=M.app_integration_id,ie=M.token,le=M.modeId,ae=c(function(e){return e.selectedRuleSetId}),se=c(function(e){return e.scopeTreeData}),ue=c(function(e){return e.sidebarTab}),ce=c(function(e){return e.setInitialRules}),de=c(function(e){return e.currentRules}),pe=c(function(e){return e.setRawAuditRuleData});c(function(e){return e.createdVariantInfo});var me=c(function(e){return e.resetCreatedVariantInfo}),fe=c(function(e){return e.isILModalTriggered}),ve=c(function(e){return e.setIsILModalTriggered}),ge=a(null),he=O.getState().configuration,Te=s(!1),ye=Te[0],we=Te[1],Se=s(null),Ce=Se[0],je=Se[1],Re=s(null),be=Re[0],Ie=Re[1],De=s(null),xe=De[0],_e=De[1],Le=s(null),ke=Le[0],Oe=Le[1],Me=s(!1),Ae=Me[0],Ne=Me[1],Ee=s(null),Ve=Ee[0],Fe=Ee[1],Pe=s(!1),Be=Pe[0],Je=Pe[1],Ue=s(""),We=Ue[0],qe=Ue[1],Ge=s(null),He=Ge[0],$e=Ge[1],ze=s(!1),Ke=ze[0],Qe=ze[1],Xe=s(!1),Ye=Xe[0],Ze=Xe[1],et=s("ruleDeletion"),tt=et[0],nt=et[1],rt=s(null),ot=rt[0],it=rt[1],lt=s(!1),at=lt[0],st=lt[1],ut=s(!1),ct=ut[0],dt=ut[1],pt=c.getState().tiers,mt=s(null),ft=mt[0],vt=mt[1],gt=s(null),ht=gt[0],Tt=gt[1],yt=s(null),wt=yt[0],St=yt[1],Ct=function(){je(null),Ie(null),we(!0),Oe(0)},jt=function(){we(!1),ve(!1),je(null),Ie(null),_e(null),Oe(null),Ze(!1),dt(!1),Rt(),vt(null),Tt(null),St(null),re&&re(!1,ae||void 0)};u(function(){Rt()},[ae,ce]),u(function(){fe&&we(!0)},[fe]);var Rt=function(o){return void 0===o&&(o=!1),e(void 0,void 0,void 0,function(){var e,i,l,a,s,u,d,m,f,v,g,h,T,y,w,S,C,j,R;return t(this,function(t){switch(t.label){case 0:if(!ae)return ce([]),[2];o||Ne(!0),Fe(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p(ae,ie)];case 2:return e=t.sent(),console.log("response==",e),(null==e?void 0:e.data)&&0!==Object.keys(e.data).length?(pe(e),i=e.data,console.log("rulesData==",i),l=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),a=Array.isArray(i.tiers)?n([],i.tiers,!0).sort(function(e,t){var n,r;return(null!==(n=e.tier_priority)&&void 0!==n?n:0)-(null!==(r=t.tier_priority)&&void 0!==r?r:0)}).map(function(e){return[e.name,e.value]}):Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!l.has(t)&&Array.isArray(n)}),s=a.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,n;return null!==(n=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==n?n:[]}))}),u=s.flatMap(function(e){return Array.from(e)}),d=u.reduce(function(e,t){var n;return e[t]=(null!==(n=e[t])&&void 0!==n?n:0)+1,e},{}),m=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(e){return e.map(function(e){var t;return r(r({},e),{variants:null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return r(r({},e),{isLinked:!!e.link_id&&m.has(e.link_id)})})})})},v=a.map(function(e,t){var n,r=e[0],o=e[1],i=pt.find(function(e){return e.tier_name===r}),l=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==i?void 0:i.tier_id)&&void 0!==n?n:String(t+1),name:l.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:o.length,description:0===t?"".concat(I("tier.subtitle","These are the system-wide learnings applied across all stations.")):"These learnings apply after higher-priority tiers and may refine or relax default behavior.",isOpen:0===t,rules:f(o)}}),(g=c.getState().createdVariantInfo)&&g.length>0?(h=Object.fromEntries(a.map(function(e,t){return[e[0],String(t+1)]})),T=new Set(g.map(function(e){return h[e.tierName]}).filter(Boolean)),y=v.map(function(e){return r(r({},e),{isOpen:e.isOpen||T.has(e.id)})}),ce(y),(w=null===(R=null===(j=null===(C=g[0])||void 0===C?void 0:C.variants)||void 0===j?void 0:j[0])||void 0===R?void 0:R.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(w,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return me()},1e4)},500):me()):ce(v),[3,5]):(ce([]),[2]);case 3:return S=t.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Fe((null==S?void 0:S.message)||"Failed to load rules. Please try again."),ce([]),[3,5];case 4:return o||Ne(!1),[7];case 5:return[2]}})})},bt=ae?j((null==se?void 0:se.data)||null,ae):null,It=bt?{ruleSetId:bt.id,ruleSetName:bt.name,ruleSetDesc:"",ruleCount:null===(A=null==bt?void 0:bt.metrics)||void 0===A?void 0:A.learningsCount}:void 0,Dt=Boolean(null==se?void 0:se.data),xt=Boolean(ae&&!bt&&Dt),_t=function(){if("stations"===ue)return"custom";if(!bt)return"global";switch(bt.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},Lt=function(e){var t;if(!e)return o("p",{children:I("".concat(k,".deleteDialog.description"),"Are you sure you want to delete this rule? This action cannot be undone.")});var n=null==de?void 0:de.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(t){return t.ruleId===e});return o("p",{children:I("".concat(k,".deleteDialog.description"),"Are you sure you want to delete ".concat(null==n?void 0:n.ruleTitle," rule? This action cannot be undone."),{rule_title:null!==(t=null==n?void 0:n.ruleTitle)&&void 0!==t?t:""})})},kt={editingRule:Ce,editingTier:be,editingVariants:xe,focusedVariantIndex:ke,setFocusedVariantIndex:Oe,triggerAddVariant:Ye,triggerFixGaps:ct,copiedRule:ft,copiedSourceTier:ht,copiedTargetTier:wt,initialDraftMessage:We,app_integration_id:oe,modeId:le};return It?i(l,{children:[o(T,{ref:ge}),o("div",r({className:R.container},{children:Ae?o(h,{}):Ve?o(w,{errorMessage:Ve,onRetry:Rt}):o(y,{onAddRule:Ct,onDeleteRule:function(e){$e(e)},onEditRule:function(e,t){je(e),Ie(t||null),_e(e.variants||null),Oe(null),Ze(!0),we(!0)},onEditVariant:function(e,t,n,r){var o,i,l,a,s=null!==(l=null===(i=null===(o=null==de?void 0:de.find(function(e){return e.name===n}))||void 0===o?void 0:o.rules)||void 0===i?void 0:i.find(function(e){return e.ruleId===t}))&&void 0!==l?l:null==de?void 0:de.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(a=s.variants)||void 0===a?void 0:a.findIndex(function(t){return t.variantId===e.variantId}),c=void 0!==u&&-1!==u?u:0;je(s),Ie(n||null),_e(s.variants||null),Oe(c),we(!0),"resolve_gaps"===r&&dt(!0)}},onDeleteVariant:function(e,t){it({variantId:e,ruleId:t})},onExportRule:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l,a,s;return t(this,function(t){switch(t.label){case 0:if(!ae)return[2];Je(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,m(ae)];case 2:return e=t.sent(),n=window.URL.createObjectURL(e),(r=document.createElement("a")).href=n,i=(null==It?void 0:It.ruleSetName)?"".concat(It.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(ae,".csv"),r.download=i,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),null===(a=ge.current)||void 0===a||a.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=t.sent(),console.error("Export error:",l),null===(s=ge.current)||void 0===s||s.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return Je(!1),[7];case 5:return[2]}})})},isExporting:Be,onToggleSuccess:function(){return Rt(!0)},onReorderRules:function(n,r,i,l,a){return e(void 0,void 0,void 0,function(){var e,s,u;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,g(n,r,i,l,a)];case 1:return t.sent(),Rt(!0),null===(s=ge.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return e=t.sent(),console.error("Failed to reorder rules:",e),Rt(!0),null===(u=ge.current)||void 0===u||u.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:re,setDeleteConfirmationUsedFor:nt,onCopyToTier:function(e,t,n,r,o){var i,l,a=null===(l=null===(i=null==de?void 0:de.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===l?void 0:l.find(function(e){return e.ruleId===t});if(a){var s=["Add a new learning with the following details:","- Rule Title: ".concat(n),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(o)].join("\n");qe(s),vt(a),Tt(r),St(o),je(null),Ie(null),_e(null),Oe(null),we(!0)}}})})),ye&&o(D,{children:o(x,{isOpen:ye,onClose:jt,app_integration_id:oe,token:ie,mode:"ADD",config:he,pluginPayload:r(r({},kt),{initialScope:_t(),ruleSet:It})})}),o(b,{isOpen:!!He,title:I("".concat(_,".deleteDialog.title"),Q),description:Lt(He),warning:I("".concat(_,".deleteDialog.warningText"),Y),confirmText:I("".concat(_,".deleteDialog.deleteText"),ne),cancelText:I("".concat(_,".deleteDialog.cancelText"),"Cancel"),loadingText:I("".concat(_,".deleteDialog.loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!He)return[2];Qe(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,f(He)];case 2:return t.sent(),$e(null),null===(n=ge.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:U})}),Rt(),re&&re(!1,ae||void 0),[3,5];case 3:return e=t.sent(),console.error("Failed to delete rule",e),null===(r=ge.current)||void 0===r||r.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||H})}),[3,5];case 4:return Qe(!1),[7];case 5:return[2]}})})},onCancel:function(){return $e(null)},isLoading:Ke}),o(b,{isOpen:!!ot,title:I("".concat(L,".deleteVariant.title"),Q),description:"variantDeletion"===tt?o("span",{children:I("".concat(L,".deleteVariant.desc"),"Are you sure you want to delete this variant? This action cannot be undone.")}):Lt((null==ot?void 0:ot.ruleId)||null),warning:I("".concat(L,".deleteVariant.warningText"),"ruleDeletion"===tt?Y:ee),confirmText:I("".concat(L,".deleteDialog.deleteText"),ne),cancelText:I("".concat(L,".cancelText"),"Cancel"),loadingText:I("".concat(L,".loadingText"),"Deleting..."),confirmBgColor:"#EF4444",onConfirm:function(){return e(void 0,void 0,void 0,function(){var e,n,r,i,l;return t(this,function(t){switch(t.label){case 0:if(!ot)return[2];st(!0),t.label=1;case 1:return t.trys.push([1,6,7,8]),"ruleDeletion"!==tt?[3,3]:[4,v(ot.ruleId)];case 2:return t.sent(),[3,5];case 3:return[4,f(ot.variantId)];case 4:t.sent(),t.label=5;case 5:return it(null),null===(n=ge.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:R.successToast,content:o(S,{message:"ruleDeletion"===tt?U:q})}),Rt(),re&&re(!1,ae||void 0),[3,8];case 6:return e=t.sent(),console.error("Failed to delete variant",e),null===(r=ge.current)||void 0===r||r.show({severity:"error",sticky:!1,className:R.errorToast,content:o(C,{message:(null===(l=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===tt?H:z)})}),[3,8];case 7:return st(!1),[7];case 8:return[2]}})})},onCancel:function(){return it(null)},isLoading:at})]}):xt?o(w,{title:"Scope Not Found",errorMessage:"The selected scope does not exist. Please refresh the page or choose a valid scope.",onRetry:function(){return null==re?void 0:re(!0)},retryButtonText:"Refresh"}):i(l,{children:[o(d,{onCreate:Ct,title:E,desc:F,button:B}),ye&&o(D,{children:o(x,{isOpen:ye,onClose:jt,app_integration_id:oe,token:ie,mode:"ADD",config:he,pluginPayload:r(r({},kt),{initialScope:_t(),ruleSet:It})})})]})};export{M as default};
2
2
  //# sourceMappingURL=RuleContent.js.map