@e-llm-studio/instant-learning 0.1.1-alpha.62 → 0.1.1-alpha.63

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.
Files changed (30) hide show
  1. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  2. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  3. package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
  4. package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
  5. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  6. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
  7. package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
  8. package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
  9. package/dist/cjs/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
  10. package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
  11. package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
  12. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  13. package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
  14. package/dist/features/LearningManagement/assets/Search-result(add new).svg.js +2 -0
  15. package/dist/features/LearningManagement/assets/Search-result(add new).svg.js.map +1 -0
  16. package/dist/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  17. package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
  18. package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +2 -0
  19. package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +1 -0
  20. package/dist/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
  21. package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
  22. package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
  23. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  24. package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts +12 -0
  25. package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts.map +1 -0
  26. package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts +2 -0
  27. package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts.map +1 -1
  28. package/dist/types/src/routes/Routes.d.ts +1 -1
  29. package/dist/types/src/routes/Routes.d.ts.map +1 -1
  30. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("./store/useLearningTemplateStore.js"),a=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./components/ConfirmationModal.js"),p=require("./components/LearningTemplateManagementSkeleton.js"),f=require("./utils/treeUtils.js"),g=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),v=require("./components/ToolTip.js"),S=require("./components/CreateRuleSetLegacyModal.js"),h=require("./store/usePermissionsStore.js"),_=require("./store/useAppSecRolesStore.js"),y=require("./queries/useApprovalQueries.js"),T=require("./RuleContent/AddScopeModal.js"),b=require("react-router-dom"),C=require("./shared/SuccessToastContent.js"),L=require("./shared/ErrorToastContent.js"),j=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:r.Users}],w=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope",addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"},{type:"SUBSCOPE",label:"Subscope"}];exports.default=function(r){var A,E=this,R=r.userDetails,I=r.llmStudioUrl,O=r.audacyBackendUrl,q=r.ilLabels,k=r.config,D=r.rbacConfig,P=r.app_integration_id,x=r.backwardCompatibility,N=void 0!==x&&x,B=s.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),G=s.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),U=s.useLearningTemplateStore(function(e){return e.error}),M=s.useLearningTemplateStore(function(e){return e.setError}),F=s.useLearningTemplateStore(function(e){return e.setStations}),Q=s.useLearningTemplateStore(function(e){return e.scopeTreeData}),H=s.useLearningTemplateStore(function(e){return e.setScopeTreeData}),K=n.useState({isOpen:!1,type:"GLOBAL"}),V=K[0],W=K[1],Y=n.useState(!1),z=Y[0],J=Y[1],X=n.useState(!1),Z=X[0],$=X[1],ee=n.useState("learnings"),te=ee[0],ne=ee[1],re=n.useState(null),se=re[0],ae=re[1],ie=n.useState(null),oe=ie[0],le=ie[1],ue=n.useRef(null),ce=n.useRef(null),de=n.useRef(null),pe=u.default();pe.user;var fe=pe.setUser,ge=m.useConfigStore(),me=ge.setConfig,ve=ge.setIlLabels,Se=function(){try{return b.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(window.location.search).get("rulesetid");(null==e?void 0:e.length)&&G&&ne&&(G(e),ne("learnings"))},[null==Se?void 0:Se.search,ne,G]);var he=h.usePermissionsStore(function(e){return e.fetchPermissions}),_e=h.usePermissionsStore(function(e){return e.hasPermission}),ye=_.useAppSecRolesStore(function(e){return e.setRoles}),Te=g.default(function(e){return e.appsecRbacUrl})===D.appsecRbacUrl,be=y.useGetAppSecRolesQuery(D.applicationId,Te).data;n.useEffect(function(){be&&ye(be.map(function(e){return{_id:e._id,name:e.name}}))},[be,ye]),n.useEffect(function(){var e;console.log("userDetails",R),fe(R),console.log("llmStudioUrl",I),console.log("audacyBackendUrl",O),g.default.getState().setLlmStudioUrl(I),g.default.getState().setAudacyBackendUrl(O),g.default.getState().setRbacConfig(D),me(k),ve(q),s.useLearningTemplateStore.getState().setAppIntegrationId(null!=P?P:null),s.useLearningTemplateStore.getState().setBackwardCompatibility(N),s.useLearningTemplateStore.getState().setToken(null!==(e=R.accessToken)&&void 0!==e?e:null)},[R,fe,I,O,D,k,me,q,ve,P,N]),n.useEffect(function(){(null==R?void 0:R.accessToken)&&I&&c.fetchTiers()},[P,null==R?void 0:R.accessToken,I]);var Ce=function(t){return void 0===t&&(t=!0),e.__awaiter(E,void 0,void 0,function(){var n,r,a,i,o,l;return e.__generator(this,function(u){switch(u.label){case 0:t&&J(!0),M(null),u.label=1;case 1:return u.trys.push([1,4,5,6]),[4,he(D.applicationId)];case 2:return u.sent(),n=function(t){if(!h.usePermissionsStore.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e.__assign(e.__assign({},t),{children:r})},[4,c.fetchScopes(P,R.accessToken)];case 3:return(r=u.sent())&&r.data&&r.data.data&&(a=r.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=n(a))?(ae(null),H({data:i}),ce.current?(G(ce.current),ne("learnings"),ce.current=null):s.useLearningTemplateStore.getState().selectedRuleSetId||G(i.id)):(ae(null!==(l=a.id)&&void 0!==l?l:null),H(null)):(ae(null),H(null))),[3,6];case 4:return o=u.sent(),console.error("Failed to fetch rule sets or permissions",o),M("Failed to load data. Please try again later."),[3,6];case 5:return J(!1),[7];case 6:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==R?void 0:R.accessToken)||void 0===e?void 0:e.length)&&Te?Ce(!0):console.warn("Error: Trying to fetch rules without access token",R)},[null==R?void 0:R.accessToken,M,F,D.applicationId,Te]);var Le=function(t,n,r){return e.__awaiter(E,void 0,void 0,function(){var a,i,o,l,u,d,p,g,m;return e.__generator(this,function(v){switch(v.label){case 0:$(!0),v.label=1;case 1:return v.trys.push([1,8,9,10]),[4,c.deleteRuleSet(t,R.accessToken)];case 2:if(v.sent(),s.useLearningTemplateStore.getState().selectedRuleSetId===t&&(a=s.useLearningTemplateStore.getState().scopeTreeData,(i=f.findNodePathById((null==a?void 0:a.data)||null,t))&&i.length>1&&(o=i[i.length-2],G(o),ne("learnings"))),!r||!n)return[3,6];v.label=3;case 3:return v.trys.push([3,5,,6]),[4,c.updateStation({station_name:n,ruleset_id:""})];case 4:return v.sent(),[3,6];case 5:return l=v.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,Ce(!0)];case 7:return v.sent(),W(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(d=de.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return u=v.sent(),console.error("An error occurred during scope deletion.",u),null===(p=de.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(m=null===(g=null==u?void 0:u.response)||void 0===g?void 0:g.data)||void 0===m?void 0:m.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return $(!1),[7];case 10:return[2]}})})},je=Q,we=oe?{data:{id:oe.stationId,name:oe.stationName,type:"STATION",metrics:{learningsCount:oe.learningsCount,stationsCount:0},children:[]}}:je,Ae=!!(null==we?void 0:we.data);null===(A=null==we?void 0:we.data)||void 0===A||A.type;var Ee=h.usePermissionsStore(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",D.applicationResourceId||""),Re=(oe?j.filter(function(e){return"stations"!==e.id}):j).filter(function(e){return!(!N&&"access"===e.id)});return t.jsx(v.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:z?t.jsx(p.default,{}):U?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:U})),t.jsx("button",e.__assign({onClick:function(){return Ce(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Ae?t.jsx(o.default,{onOpenCreateModal:function(){return W({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return W({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return W({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(E,void 0,void 0,function(){var a,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return a=s.useLearningTemplateStore.getState().scopeTreeData,i=f.findNodePathById((null==a?void 0:a.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,Le(t,n,o)];case 1:return e.sent(),[3,3];case 2:W({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return _e("ilotj.scope.delete",e)},canEditScope:function(e){return _e("ilotj.scope.edit",e)},canCreateScope:function(e){return _e("ilotj.scope.create",e)},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),ne(t),G(e)},activeSectionId:te,scopeTreeData:we,sectionsConfig:Re,onViewStation:function(e){ue.current=B,le(e),ne("learnings"),G(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(ce.current=t),Ce(e)},nodeTypesConfig:w,app_integration_id:P,token:R.accessToken}):t.jsx(l.default,{onCreate:function(){return W({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope",canCreateRule:Ee,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return e.__awaiter(E,void 0,void 0,function(){var n,r,a,o,l,u,d,p,f;return e.__generator(this,function(e){switch(e.label){case 0:if(!(n=(null===(o=null===(a=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===o?void 0:o.id)||se))return null===(l=de.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(L.default,{message:"Unable to identify the global scope for this access request."})}),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.requestAccess(n)];case 2:return e.sent(),null===(u=de.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:i.default.successToast,content:t.jsx(C.default,{message:"Access request submitted successfully!"})}),[3,4];case 3:return r=e.sent(),null===(d=de.current)||void 0===d||d.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(L.default,{message:(null===(f=null===(p=null==r?void 0:r.response)||void 0===p?void 0:p.data)||void 0===f?void 0:f.detail)||"Failed to request access. Please try again."})}),[3,4];case 4:return[2]}})})}})})),t.jsx(a.Toast,{ref:de}),N&&V.isOpen&&"DELETE"!==V.type&&"RENAME"!==V.type?t.jsx(S.default,{isOpen:!0,onClose:function(){return W(e.__assign(e.__assign({},V),{isOpen:!1}))},onSubmit:function(t){return e.__awaiter(E,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,f,g,m,v,S,h,_,y,T,b,C;return e.__generator(this,function(L){switch(L.label){case 0:$(!0),n=s.useLearningTemplateStore.getState().backwardCompatibility,L.label=1;case 1:return L.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(a=t,i="SCOPE"===V.type&&V.parentId,o=i?"genreRuleSet":V.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:V.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:P}),[4,c.createRuleSet(r,R.accessToken)];case 2:if(l=L.sent(),!(u=null===(S=null==l?void 0:l.data)||void 0===S?void 0:S.scopeId))return[3,10];if(ce.current=u,d=n&&(null===(h=r.topic)||void 0===h?void 0:h.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==V.type&&V.parentId,!d&&!p)return[3,10];if(!(f=n?null===(y=null===(_=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===_?void 0:_.data)||void 0===y?void 0:y.id:V.parentId))return[3,10];if(!N)return[3,7];L.label=3;case 3:return L.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:f,target_scope_id:u})];case 4:return L.sent(),[3,6];case 5:return g=L.sent(),console.error("Failed to inherit rules for the new scope:",g),[3,6];case 6:return[3,10];case 7:return L.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:f,target_scope_id:u,application_mapping_id:P||"",is_copy_parent_variant_id:!1})];case 8:return L.sent(),[3,10];case 9:return m=L.sent(),console.error("Failed to inherit rules for the new scope:",m),[3,10];case 10:return[4,Ce(!0)];case 11:return L.sent(),W(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw v=L.sent(),console.error("An error occurred during scope creation.",v),null===(T=de.current)||void 0===T||T.show({severity:"error",summary:"Creation Failed",detail:(null===(C=null===(b=null==v?void 0:v.response)||void 0===b?void 0:b.data)||void 0===C?void 0:C.message)||"There was an error creating the scope. Please try again."}),v;case 13:return $(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Ae,canCreateGlobal:Ee}):t.jsx(T.default,{isOpen:V.isOpen&&"DELETE"!==V.type,onClose:function(){return W(e.__assign(e.__assign({},V),{isOpen:!1}))},onCreate:function(t){return n=null!=t?t:"",e.__awaiter(E,void 0,void 0,function(){var t,r,s,a;return e.__generator(this,function(i){switch(i.label){case 0:$(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),V.scopeId?[4,c.renameScope({scope_id:V.scopeId,scope_name:n})]:[2];case 2:return i.sent(),[4,Ce(!0)];case 3:return i.sent(),W(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw t=i.sent(),console.error("An error occurred during scope rename.",t),null===(r=de.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(a=null===(s=null==t?void 0:t.response)||void 0===s?void 0:s.data)||void 0===a?void 0:a.message)||"There was an error renaming the scope. Please try again."}),t;case 5:return $(!1),[7];case 6:return[2]}})});var n},hasGlobalRuleSet:Ae}),t.jsx(d.default,{isOpen:V.isOpen&&"DELETE"===V.type,onCancel:function(){return W(e.__assign(e.__assign({},V),{isOpen:!1}))},onConfirm:function(){return Le(V.scopeId,V.initialName,V.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:V.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:Z})]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("./store/useLearningTemplateStore.js"),a=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./hooks/useLearningTemplateQueryParams.js"),p=require("./components/ConfirmationModal.js"),f=require("./components/LearningTemplateManagementSkeleton.js"),g=require("./utils/treeUtils.js"),S=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),v=require("./components/ToolTip.js"),h=require("./components/CreateRuleSetLegacyModal.js"),_=require("./store/usePermissionsStore.js"),y=require("./store/useAppSecRolesStore.js"),T=require("./queries/useApprovalQueries.js"),b=require("./RuleContent/AddScopeModal.js"),C=require("react-router-dom"),L=require("./shared/SuccessToastContent.js"),j=require("./shared/ErrorToastContent.js"),E=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"},{id:"access",label:"Access",icon:r.Users}],w=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope",addChildLabel:"Add Subscope",addChildType:"SUBSCOPE"},{type:"SUBSCOPE",label:"Subscope"}],A=new Set(E.map(function(e){return e.id}));exports.default=function(r){var R,I=this,O=r.userDetails,q=r.llmStudioUrl,P=r.audacyBackendUrl,k=r.ilLabels,D=r.config,N=r.rbacConfig,x=r.app_integration_id,U=r.backwardCompatibility,B=void 0!==U&&U,G=s.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),M=s.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),F=s.useLearningTemplateStore(function(e){return e.error}),Q=s.useLearningTemplateStore(function(e){return e.setError}),Y=s.useLearningTemplateStore(function(e){return e.setStations}),K=s.useLearningTemplateStore(function(e){return e.scopeTreeData}),H=s.useLearningTemplateStore(function(e){return e.setScopeTreeData}),V=n.useState({isOpen:!1,type:"GLOBAL"}),W=V[0],z=V[1],J=n.useState(!1),X=J[0],Z=J[1],$=n.useState(!1),ee=$[0],te=$[1],ne=n.useState("learnings"),re=ne[0],se=ne[1],ae=n.useState(null),ie=ae[0],oe=ae[1],le=n.useState(null),ue=le[0],ce=le[1],de=n.useRef(null),pe=n.useRef(null),fe=n.useRef(null),ge=u.default();ge.user;var Se=ge.setUser,me=m.useConfigStore(),ve=me.setConfig,he=me.setIlLabels,_e=function(){try{return C.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(window.location.search),t=e.get(d.QUERY_PARAM_KEYS.RULESET_ID),n=e.get(d.QUERY_PARAM_KEYS.SECTION),r=n&&A.has(n)?n:"learnings";(null==t?void 0:t.length)&&M&&se&&(M(t),se(r))},[null==_e?void 0:_e.search,se,M]);var ye=_.usePermissionsStore(function(e){return e.fetchPermissions}),Te=_.usePermissionsStore(function(e){return e.hasPermission}),be=y.useAppSecRolesStore(function(e){return e.setRoles}),Ce=S.default(function(e){return e.appsecRbacUrl})===N.appsecRbacUrl,Le=T.useGetAppSecRolesQuery(N.applicationId,Ce).data;n.useEffect(function(){Le&&be(Le.map(function(e){return{_id:e._id,name:e.name}}))},[Le,be]),n.useEffect(function(){var e;console.log("userDetails",O),Se(O),console.log("llmStudioUrl",q),console.log("audacyBackendUrl",P),S.default.getState().setLlmStudioUrl(q),S.default.getState().setAudacyBackendUrl(P),S.default.getState().setRbacConfig(N),ve(D),he(k),s.useLearningTemplateStore.getState().setAppIntegrationId(null!=x?x:null),s.useLearningTemplateStore.getState().setBackwardCompatibility(B),s.useLearningTemplateStore.getState().setToken(null!==(e=O.accessToken)&&void 0!==e?e:null)},[O,Se,q,P,N,D,ve,k,he,x,B]),n.useEffect(function(){(null==O?void 0:O.accessToken)&&q&&c.fetchTiers()},[x,null==O?void 0:O.accessToken,q]);var je=function(t){return void 0===t&&(t=!0),e.__awaiter(I,void 0,void 0,function(){var n,r,a,i,o,l;return e.__generator(this,function(u){switch(u.label){case 0:t&&Z(!0),Q(null),u.label=1;case 1:return u.trys.push([1,4,5,6]),[4,ye(N.applicationId)];case 2:return u.sent(),n=function(t){if(!_.usePermissionsStore.getState().hasPermission("ilotj.scope.view",t.id))return null;var r=t.children?t.children.map(function(e){return n(e)}).filter(function(e){return null!==e}):[];return e.__assign(e.__assign({},t),{children:r})},[4,c.fetchScopes(x,O.accessToken)];case 3:return(r=u.sent())&&r.data&&r.data.data&&(a=r.data.data,Array.isArray(a)&&(a=a.length>0?a[0]:null),a?(i=n(a))?(oe(null),H({data:i}),pe.current?(M(pe.current),se("learnings"),pe.current=null):s.useLearningTemplateStore.getState().selectedRuleSetId||M(i.id)):(oe(null!==(l=a.id)&&void 0!==l?l:null),H(null)):(oe(null),H(null))),[3,6];case 4:return o=u.sent(),console.error("Failed to fetch rule sets or permissions",o),Q("Failed to load data. Please try again later."),[3,6];case 5:return Z(!1),[7];case 6:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==O?void 0:O.accessToken)||void 0===e?void 0:e.length)&&Ce?je(!0):console.warn("Error: Trying to fetch rules without access token",O)},[null==O?void 0:O.accessToken,Q,Y,N.applicationId,Ce]);var Ee=function(t,n,r){return e.__awaiter(I,void 0,void 0,function(){var a,i,o,l,u,d,p,f,S;return e.__generator(this,function(m){switch(m.label){case 0:te(!0),m.label=1;case 1:return m.trys.push([1,8,9,10]),[4,c.deleteRuleSet(t,O.accessToken)];case 2:if(m.sent(),s.useLearningTemplateStore.getState().selectedRuleSetId===t&&(a=s.useLearningTemplateStore.getState().scopeTreeData,(i=g.findNodePathById((null==a?void 0:a.data)||null,t))&&i.length>1&&(o=i[i.length-2],M(o),se("learnings"))),!r||!n)return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),[4,c.updateStation({station_name:n,ruleset_id:""})];case 4:return m.sent(),[3,6];case 5:return l=m.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,je(!0)];case 7:return m.sent(),z(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(d=fe.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return u=m.sent(),console.error("An error occurred during scope deletion.",u),null===(p=fe.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(S=null===(f=null==u?void 0:u.response)||void 0===f?void 0:f.data)||void 0===S?void 0:S.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return te(!1),[7];case 10:return[2]}})})},we=K,Ae=ue?{data:{id:ue.stationId,name:ue.stationName,type:"STATION",metrics:{learningsCount:ue.learningsCount,stationsCount:0},children:[]}}:we,Re=!!(null==Ae?void 0:Ae.data);null===(R=null==Ae?void 0:Ae.data)||void 0===R||R.type;var Ie=_.usePermissionsStore(function(e){return e.hasGlobalPermission})("ilotj.scope.global.create",N.applicationResourceId||""),Oe=(ue?E.filter(function(e){return"stations"!==e.id}):E).filter(function(e){return!(!B&&"access"===e.id)});return t.jsx(v.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:X?t.jsx(f.default,{}):F?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:F})),t.jsx("button",e.__assign({onClick:function(){return je(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Re?t.jsx(o.default,{onOpenCreateModal:function(){return z({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return z({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return z({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(I,void 0,void 0,function(){var a,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return a=s.useLearningTemplateStore.getState().scopeTreeData,i=g.findNodePathById((null==a?void 0:a.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,Ee(t,n,o)];case 1:return e.sent(),[3,3];case 2:z({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},canDeleteScope:function(e){return Te("ilotj.scope.delete",e)},canEditScope:function(e){return Te("ilotj.scope.edit",e)},canCreateScope:function(e){return Te("ilotj.scope.create",e)},onSectionSelect:function(e,t){var n;console.log("Section Selected:",{scopeId:e,sectionId:t}),d.setQueryParams(((n={})[d.QUERY_PARAM_KEYS.SECTION]="learnings"===t?null:t,n)),se(t),M(e)},activeSectionId:re,scopeTreeData:Ae,sectionsConfig:Oe,onViewStation:function(e){de.current=G,ce(e),se("learnings"),M(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(pe.current=t),je(e)},nodeTypesConfig:w,app_integration_id:x,token:O.accessToken}):t.jsx(l.default,{onCreate:function(){return z({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope",canCreateRule:Ie,noAccessTitle:"Access Restricted",noAccessDesc:"You do not have access to create a Global scope for this application.",onRequestAccess:function(){return e.__awaiter(I,void 0,void 0,function(){var n,r,a,o,l,u,d,p,f;return e.__generator(this,function(e){switch(e.label){case 0:if(!(n=(null===(o=null===(a=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===a?void 0:a.data)||void 0===o?void 0:o.id)||ie))return null===(l=fe.current)||void 0===l||l.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(j.default,{message:"Unable to identify the global scope for this access request."})}),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.requestAccess(n)];case 2:return e.sent(),null===(u=fe.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:i.default.successToast,content:t.jsx(L.default,{message:"Access request submitted successfully!"})}),[3,4];case 3:return r=e.sent(),null===(d=fe.current)||void 0===d||d.show({severity:"error",sticky:!1,className:i.default.errorToast,content:t.jsx(j.default,{message:(null===(f=null===(p=null==r?void 0:r.response)||void 0===p?void 0:p.data)||void 0===f?void 0:f.detail)||"Failed to request access. Please try again."})}),[3,4];case 4:return[2]}})})}})})),t.jsx(a.Toast,{ref:fe}),B&&W.isOpen&&"DELETE"!==W.type&&"RENAME"!==W.type?t.jsx(h.default,{isOpen:!0,onClose:function(){return z(e.__assign(e.__assign({},W),{isOpen:!1}))},onSubmit:function(t){return e.__awaiter(I,void 0,void 0,function(){var n,r,a,i,o,l,u,d,p,f,g,S,m,v,h,_,y,T,b,C;return e.__generator(this,function(L){switch(L.label){case 0:te(!0),n=s.useLearningTemplateStore.getState().backwardCompatibility,L.label=1;case 1:return L.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(a=t,i="SCOPE"===W.type&&W.parentId,o=i?"genreRuleSet":W.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:W.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:x}),[4,c.createRuleSet(r,O.accessToken)];case 2:if(l=L.sent(),!(u=null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.scopeId))return[3,10];if(pe.current=u,d=n&&(null===(h=r.topic)||void 0===h?void 0:h.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==W.type&&W.parentId,!d&&!p)return[3,10];if(!(f=n?null===(y=null===(_=s.useLearningTemplateStore.getState().scopeTreeData)||void 0===_?void 0:_.data)||void 0===y?void 0:y.id:W.parentId))return[3,10];if(!B)return[3,7];L.label=3;case 3:return L.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:f,target_scope_id:u})];case 4:return L.sent(),[3,6];case 5:return g=L.sent(),console.error("Failed to inherit rules for the new scope:",g),[3,6];case 6:return[3,10];case 7:return L.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:f,target_scope_id:u,application_mapping_id:x||"",is_copy_parent_variant_id:!1})];case 8:return L.sent(),[3,10];case 9:return S=L.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,10];case 10:return[4,je(!0)];case 11:return L.sent(),z(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=L.sent(),console.error("An error occurred during scope creation.",m),null===(T=fe.current)||void 0===T||T.show({severity:"error",summary:"Creation Failed",detail:(null===(C=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===C?void 0:C.message)||"There was an error creating the scope. Please try again."}),m;case 13:return te(!1),[7];case 14:return[2]}})})},hasGlobalRuleSet:Re,canCreateGlobal:Ie}):t.jsx(b.default,{isOpen:W.isOpen&&"DELETE"!==W.type,onClose:function(){return z(e.__assign(e.__assign({},W),{isOpen:!1}))},onCreate:function(t){return n=null!=t?t:"",e.__awaiter(I,void 0,void 0,function(){var t,r,s,a;return e.__generator(this,function(i){switch(i.label){case 0:te(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),W.scopeId?[4,c.renameScope({scope_id:W.scopeId,scope_name:n})]:[2];case 2:return i.sent(),[4,je(!0)];case 3:return i.sent(),z(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw t=i.sent(),console.error("An error occurred during scope rename.",t),null===(r=fe.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(a=null===(s=null==t?void 0:t.response)||void 0===s?void 0:s.data)||void 0===a?void 0:a.message)||"There was an error renaming the scope. Please try again."}),t;case 5:return te(!1),[7];case 6:return[2]}})});var n},hasGlobalRuleSet:Re}),t.jsx(p.default,{isOpen:W.isOpen&&"DELETE"===W.type,onCancel:function(){return z(e.__assign(e.__assign({},W),{isOpen:!1}))},onConfirm:function(){return Ee(W.scopeId,W.initialName,W.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:W.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ee})]}))})};
2
2
  //# sourceMappingURL=LearningManagement.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),n=require("../store/useLearningTemplateStore.js"),i=require("../components/EmptyLearningState.js"),a=require("../apis/scopeApis.js"),o=require("../components/RuleContentSkeleton.js"),s=require("primereact/toast"),u=require("./ContentLogic.js"),l=require("../components/ErrorStateDisplay.js"),d=require("../shared/SuccessToastContent.js"),c=require("../shared/ErrorToastContent.js"),f=require("../utils/treeUtils.js"),v=require("../styles/LearningContent.module.css.js"),p=require("../components/ConfirmationModal.js");require("../../IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("lucide-react"),require("../../IL-OTJ/_components/InputDataReasoningCard.js"),require("../../IL-OTJ/_components/TooltipComponent.js"),require("../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");var m=require("../../IL-OTJ/store/CitationsContext.js");require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation");var g=require("../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js");require("../store/usePermissionsStore.js"),require("appsec-ui"),require("../store/useAuthStore.js"),require("../store/useEnvStore.js"),require("@radix-ui/react-tooltip"),require("../components/StationOnboarding/InputField.js"),require("../store/useConfigStore.js"),require("../config.js"),require("../components/ToolTip.js"),require("@tanstack/react-query"),require("../store/useAppSecRolesStore.js"),require("react-router-dom");exports.default=function(h){var _,S=h.noRulesTitle,T=void 0===S?"No rules have been added !":S,y=h.noRulesDesc,j=void 0===y?"Start by adding rules that should apply across all stations.":y,w=h.noRulesButtonText,q=void 0===w?"Create New Rule":w,x=h.deleteRuleSuccessMessage,C=void 0===x?"Rule deleted successfully!":x,b=h.deleteVariantSuccessMessage,R=void 0===b?"Variant deleted successfully!":b,I=h.deleteRuleErrorMessage,L=void 0===I?"Failed to delete rule. Please try again.":I,O=h.deleteVariantErrorMessage,k=void 0===O?"Failed to delete variant. Please try again.":O,D=h.deleteModalTitle,M=void 0===D?"Delete":D,E=h.deleteRuleModalWarning,N=void 0===E?"This will permanently delete the rule configuration.":E,F=h.deleteVariantModalWarning,A=void 0===F?"This will permanently delete the variant configuration.":F,P=h.deleteConfirmText,V=void 0===P?"Delete":P,B=h.onRefreshRuleSets,J=h.app_integration_id,U=h.token,W=n.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),G=n.useLearningTemplateStore(function(e){return e.scopeTreeData}),Q=n.useLearningTemplateStore(function(e){return e.sidebarTab}),H=n.useLearningTemplateStore(function(e){return e.setInitialRules}),$=n.useLearningTemplateStore(function(e){return e.currentRules});n.useLearningTemplateStore(function(e){return e.createdVariantInfo});var z=n.useLearningTemplateStore(function(e){return e.resetCreatedVariantInfo}),K=n.useLearningTemplateStore(function(e){return e.isILModalTriggered}),X=n.useLearningTemplateStore(function(e){return e.setIsILModalTriggered}),Y=r.useRef(null),Z=r.useState(!1),ee=Z[0],te=Z[1],re=r.useState(null),ne=re[0],ie=re[1],ae=r.useState(null),oe=ae[0],se=ae[1],ue=r.useState(null),le=ue[0],de=ue[1],ce=r.useState(null),fe=ce[0],ve=ce[1],pe=r.useState(!1),me=pe[0],ge=pe[1],he=r.useState(null),_e=he[0],Se=he[1],Te=r.useState(!1),ye=Te[0],je=Te[1],we=r.useState(""),qe=we[0],xe=we[1],Ce=r.useState(null),be=Ce[0],Re=Ce[1],Ie=r.useState(!1),Le=Ie[0],Oe=Ie[1],ke=r.useState(!1),De=ke[0],Me=ke[1],Ee=r.useState("ruleDeletion"),Ne=Ee[0],Fe=Ee[1],Ae=r.useState(null),Pe=Ae[0],Ve=Ae[1],Be=r.useState(!1),Je=Be[0],Ue=Be[1],We=r.useState(!1),Ge=We[0],Qe=We[1],He=n.useLearningTemplateStore.getState().tiers,$e=r.useState(null),ze=$e[0],Ke=$e[1],Xe=r.useState(null),Ye=Xe[0],Ze=Xe[1],et=r.useState(null),tt=et[0],rt=et[1],nt=function(){ie(null),se(null),te(!0),ve(0)},it=function(){te(!1),X(!1),ie(null),se(null),de(null),ve(null),Me(!1),Qe(!1),at(),Ke(null),Ze(null),rt(null),B&&B(!1,W||void 0)};r.useEffect(function(){at()},[W,H]),r.useEffect(function(){K&&te(!0)},[K]);var at=function(t){return void 0===t&&(t=!1),e.__awaiter(void 0,void 0,void 0,function(){var r,i,o,s,u,l,d,c,f,v,p,m,g,h,_,S,T,y,j;return e.__generator(this,function(w){switch(w.label){case 0:if(!W)return H([]),[2];t||ge(!0),Se(null),w.label=1;case 1:return w.trys.push([1,3,4,5]),[4,a.getRulesInRuleSetById(W,U)];case 2:return r=w.sent(),console.log("response==",r),(null==r?void 0:r.data)&&0!==Object.keys(r.data).length?(i=r.data,console.log("rulesData==",i),o=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),s=Object.entries(i).filter(function(e){var t=e[0],r=e[1];return!o.has(t)&&Array.isArray(r)}),u=s.map(function(e){var t=e[1];return new Set(t.flatMap(function(e){var t,r;return null!==(r=null===(t=e.variants)||void 0===t?void 0:t.map(function(e){return e.link_id}).filter(Boolean))&&void 0!==r?r:[]}))}),l=u.flatMap(function(e){return Array.from(e)}),d=l.reduce(function(e,t){var r;return e[t]=(null!==(r=e[t])&&void 0!==r?r:0)+1,e},{}),c=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(t){return t.map(function(t){var r;return e.__assign(e.__assign({},t),{variants:null===(r=t.variants)||void 0===r?void 0:r.map(function(t){return e.__assign(e.__assign({},t),{isLinked:!!t.link_id&&c.has(t.link_id)})})})})},v=s.map(function(e,t){var r,n=e[0],i=e[1],a=He.find(function(e){return e.tier_name===n}),o=n.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(r=null==a?void 0:a.tier_id)&&void 0!==r?r:String(t+1),name:o.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:i.length,description:0===t?"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(i)}}),(p=n.useLearningTemplateStore.getState().createdVariantInfo)&&p.length>0?(m=Object.fromEntries(s.map(function(e,t){return[e[0],String(t+1)]})),g=new Set(p.map(function(e){return m[e.tierName]}).filter(Boolean)),h=v.map(function(t){return e.__assign(e.__assign({},t),{isOpen:t.isOpen||g.has(t.id)})}),H(h),(_=null===(j=null===(y=null===(T=p[0])||void 0===T?void 0:T.variants)||void 0===y?void 0:y[0])||void 0===j?void 0:j.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(_,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return z()},1e4)},500):z()):H(v),[3,5]):(H([]),[2]);case 3:return S=w.sent(),console.error("Failed to fetch rule details",S),404!==(null==S?void 0:S.status)&&Se((null==S?void 0:S.message)||"Failed to load rules. Please try again."),H([]),[3,5];case 4:return t||ge(!1),[7];case 5:return[2]}})})},ot=W?f.findNodeById((null==G?void 0:G.data)||null,W):null,st=ot?{ruleSetId:ot.id,ruleSetName:ot.name,ruleSetDesc:"",ruleCount:null===(_=null==ot?void 0:ot.metrics)||void 0===_?void 0:_.learningsCount}:void 0,ut=function(){if("stations"===Q)return"custom";if(!ot)return"global";switch(ot.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},lt=function(r){if(!r)return t.jsx("p",{children:"Are you sure you want to delete this rule? This action cannot be undone."});var n=null==$?void 0:$.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(e){return e.ruleId===r});return t.jsxs("p",{children:["Are you sure you want to delete"," ",t.jsx("span",e.__assign({className:v.default.semibold},{children:null==n?void 0:n.ruleTitle}))," rule? This action cannot be undone."]})},dt={editingRule:ne,editingTier:oe,editingVariants:le,focusedVariantIndex:fe,setFocusedVariantIndex:ve,triggerAddVariant:De,triggerFixGaps:Ge,copiedRule:ze,copiedSourceTier:Ye,copiedTargetTier:tt,initialDraftMessage:qe,app_integration_id:J,modeId:"019dde79-0494-78d7-ba5b-54a35d20f0fc"};return st?t.jsxs(t.Fragment,{children:[t.jsx(s.Toast,{ref:Y}),t.jsx("div",e.__assign({className:v.default.container},{children:me?t.jsx(o.default,{}):_e?t.jsx(l.default,{errorMessage:_e,onRetry:at}):t.jsx(u.default,{onAddRule:nt,onDeleteRule:function(e){Re(e)},onEditRule:function(e,t){ie(e),se(t||null),de(e.variants||null),ve(null),Me(!0),te(!0)},onEditVariant:function(e,t,r,n){var i,a,o,s,u=null!==(o=null===(a=null===(i=null==$?void 0:$.find(function(e){return e.name===r}))||void 0===i?void 0:i.rules)||void 0===a?void 0:a.find(function(e){return e.ruleId===t}))&&void 0!==o?o:null==$?void 0:$.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(u){var l=null===(s=u.variants)||void 0===s?void 0:s.findIndex(function(t){return t.variantId===e.variantId}),d=void 0!==l&&-1!==l?l:0;ie(u),se(r||null),de(u.variants||null),ve(d),te(!0),"resolve_gaps"===n&&Qe(!0)}},onDeleteVariant:function(e,t){Ve({variantId:e,ruleId:t})},onExportRule:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,n,i,o,s,u,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!W)return[2];je(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.exportRuleSet(W)];case 2:return r=e.sent(),n=window.URL.createObjectURL(r),(i=document.createElement("a")).href=n,o=(null==st?void 0:st.ruleSetName)?"".concat(st.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(W,".csv"),i.download=o,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n),null===(u=Y.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return s=e.sent(),console.error("Export error:",s),null===(l=Y.current)||void 0===l||l.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:s.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return je(!1),[7];case 5:return[2]}})})},isExporting:ye,onToggleSuccess:function(){return at(!0)},onReorderRules:function(r,n,i,o,s){return e.__awaiter(void 0,void 0,void 0,function(){var u,l,f;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.alterQuestionPriority(r,n,i,o,s)];case 1:return e.sent(),at(!0),null===(l=Y.current)||void 0===l||l.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return u=e.sent(),console.error("Failed to reorder rules:",u),at(!0),null===(f=Y.current)||void 0===f||f.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:B,setDeleteConfirmationUsedFor:Fe,onCopyToTier:function(e,t,r,n,i){var a,o,s=null===(o=null===(a=null==$?void 0:$.find(function(e){return e.name===n}))||void 0===a?void 0:a.rules)||void 0===o?void 0:o.find(function(e){return e.ruleId===t});if(s){var u=["Add a new learning with the following details:","- Rule Title: ".concat(r),"- Description: ".concat(e.description),"- When to apply: ".concat(e.whenToApply),"- When NOT to apply: ".concat(e.whenNotToApply),"- Tier information: ".concat(i)].join("\n");xe(u),Ke(s),Ze(n),rt(i),ie(null),se(null),de(null),ve(null),te(!0)}}})})),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,app_integration_id:J,token:U,mode:"ADD",pluginPayload:e.__assign(e.__assign({},dt),{initialScope:ut(),ruleSet:st})})}),t.jsx(p.default,{isOpen:!!be,title:M,description:lt(be),warning:N,confirmText:V,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,n,i,o,s;return e.__generator(this,function(e){switch(e.label){case 0:if(!be)return[2];Oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.deleteRule(be)];case 2:return e.sent(),Re(null),null===(n=Y.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:C})}),at(),B&&B(!1,W||void 0),[3,5];case 3:return r=e.sent(),console.error("Failed to delete rule",r),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:(null===(s=null===(o=null==r?void 0:r.response)||void 0===o?void 0:o.data)||void 0===s?void 0:s.detail)||L})}),[3,5];case 4:return Oe(!1),[7];case 5:return[2]}})})},onCancel:function(){return Re(null)},isLoading:Le}),t.jsx(p.default,{isOpen:!!Pe,title:M,description:"variantDeletion"===Ne?t.jsx("span",{children:"Are you sure you want to delete this variant? This action cannot be undone."}):lt((null==Pe?void 0:Pe.ruleId)||null),warning:"ruleDeletion"===Ne?N:A,confirmText:V,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,n,i,o,s;return e.__generator(this,function(e){switch(e.label){case 0:if(!Pe)return[2];Ue(!0),e.label=1;case 1:return e.trys.push([1,6,7,8]),"ruleDeletion"!==Ne?[3,3]:[4,a.deleteQuestion(Pe.ruleId)];case 2:return e.sent(),[3,5];case 3:return[4,a.deleteRule(Pe.variantId)];case 4:e.sent(),e.label=5;case 5:return Ve(null),null===(n=Y.current)||void 0===n||n.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"ruleDeletion"===Ne?C:R})}),at(),B&&B(!1,W||void 0),[3,8];case 6:return r=e.sent(),console.error("Failed to delete variant",r),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:(null===(s=null===(o=null==r?void 0:r.response)||void 0===o?void 0:o.data)||void 0===s?void 0:s.detail)||("ruleDeletion"===Ne?L:k)})}),[3,8];case 7:return Ue(!1),[7];case 8:return[2]}})})},onCancel:function(){return Ve(null)},isLoading:Je})]}):t.jsxs(t.Fragment,{children:[t.jsx(i.default,{onCreate:nt,title:T,desc:j,button:q}),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,app_integration_id:J,token:U,mode:"ADD",pluginPayload:e.__assign(e.__assign({},dt),{initialScope:ut(),ruleSet:st})})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("../store/useLearningTemplateStore.js"),i=require("../components/EmptyLearningState.js"),a=require("../apis/scopeApis.js"),o=require("../components/RuleContentSkeleton.js"),l=require("primereact/toast"),s=require("./ContentLogic.js"),u=require("../components/ErrorStateDisplay.js"),d=require("../shared/SuccessToastContent.js"),c=require("../shared/ErrorToastContent.js"),f=require("../utils/treeUtils.js"),v=require("../styles/LearningContent.module.css.js"),p=require("../components/ConfirmationModal.js");require("../../IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("lucide-react"),require("../../IL-OTJ/_components/InputDataReasoningCard.js"),require("../../IL-OTJ/_components/TooltipComponent.js"),require("../../IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");var m=require("../../IL-OTJ/store/CitationsContext.js");require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation"),require("../LearningManagement.js");var g=require("../../IL-OTJ/ValueTypeWrappers/TeachMePlugin.js");exports.default=function(h){var _,y=h.noRulesTitle,T=void 0===y?"No rules have been added !":y,S=h.noRulesDesc,j=void 0===S?"Start by adding rules that should apply across all stations.":S,w=h.noRulesButtonText,x=void 0===w?"Create New Rule":w,C=h.deleteRuleSuccessMessage,b=void 0===C?"Rule deleted successfully!":C,R=h.deleteVariantSuccessMessage,q=void 0===R?"Variant deleted successfully!":R,I=h.deleteRuleErrorMessage,L=void 0===I?"Failed to delete rule. Please try again.":I,O=h.deleteVariantErrorMessage,k=void 0===O?"Failed to delete variant. Please try again.":O,D=h.deleteModalTitle,M=void 0===D?"Delete":D,N=h.deleteRuleModalWarning,E=void 0===N?"This will permanently delete the rule configuration.":N,F=h.deleteVariantModalWarning,A=void 0===F?"This will permanently delete the variant configuration.":F,V=h.deleteConfirmText,P=void 0===V?"Delete":V,B=h.onRefreshRuleSets,J=h.app_integration_id,U=h.token,W=r.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),G=r.useLearningTemplateStore(function(e){return e.scopeTreeData}),Q=r.useLearningTemplateStore(function(e){return e.sidebarTab}),H=r.useLearningTemplateStore(function(e){return e.setInitialRules}),$=r.useLearningTemplateStore(function(e){return e.currentRules});r.useLearningTemplateStore(function(e){return e.createdVariantInfo});var z=r.useLearningTemplateStore(function(e){return e.resetCreatedVariantInfo}),K=r.useLearningTemplateStore(function(e){return e.isILModalTriggered}),X=r.useLearningTemplateStore(function(e){return e.setIsILModalTriggered}),Y=n.useRef(null),Z=n.useState(!1),ee=Z[0],te=Z[1],ne=n.useState(null),re=ne[0],ie=ne[1],ae=n.useState(null),oe=ae[0],le=ae[1],se=n.useState(null),ue=se[0],de=se[1],ce=n.useState(null),fe=ce[0],ve=ce[1],pe=n.useState(!1),me=pe[0],ge=pe[1],he=n.useState(null),_e=he[0],ye=he[1],Te=n.useState(!1),Se=Te[0],je=Te[1],we=n.useState(""),xe=we[0],Ce=we[1],be=n.useState(null),Re=be[0],qe=be[1],Ie=n.useState(!1),Le=Ie[0],Oe=Ie[1],ke=n.useState(!1),De=ke[0],Me=ke[1],Ne=n.useState("ruleDeletion"),Ee=Ne[0],Fe=Ne[1],Ae=n.useState(null),Ve=Ae[0],Pe=Ae[1],Be=n.useState(!1),Je=Be[0],Ue=Be[1],We=n.useState(!1),Ge=We[0],Qe=We[1],He=r.useLearningTemplateStore.getState().tiers,$e=n.useState(null),ze=$e[0],Ke=$e[1],Xe=n.useState(null),Ye=Xe[0],Ze=Xe[1],et=n.useState(null),tt=et[0],nt=et[1],rt=function(){ie(null),le(null),te(!0),ve(0)},it=function(){te(!1),X(!1),ie(null),le(null),de(null),ve(null),Me(!1),Qe(!1),at(),Ke(null),Ze(null),nt(null),B&&B(!1,W||void 0)};n.useEffect(function(){at()},[W,H]),n.useEffect(function(){K&&te(!0)},[K]);var at=function(t){return void 0===t&&(t=!1),e.__awaiter(void 0,void 0,void 0,function(){var n,i,o,l,s,u,d,c,f,v,p,m,g,h,_,y,T,S,j;return e.__generator(this,function(w){switch(w.label){case 0:if(!W)return H([]),[2];t||ge(!0),ye(null),w.label=1;case 1:return w.trys.push([1,3,4,5]),[4,a.getRulesInRuleSetById(W,U)];case 2:return n=w.sent(),console.log("response==",n),(null==n?void 0:n.data)&&0!==Object.keys(n.data).length?(i=n.data,console.log("rulesData==",i),o=new Set(["ruleSetName","ruleSetDesc","created_at","updated_at","created_by","updated_by"]),l=Object.entries(i).filter(function(e){var t=e[0],n=e[1];return!o.has(t)&&Array.isArray(n)}),s=l.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},{}),c=new Set(Object.entries(d).filter(function(e){return e[1]>1}).map(function(e){return e[0]})),f=function(t){return t.map(function(t){var n;return e.__assign(e.__assign({},t),{variants:null===(n=t.variants)||void 0===n?void 0:n.map(function(t){return e.__assign(e.__assign({},t),{isLinked:!!t.link_id&&c.has(t.link_id)})})})})},v=l.map(function(e,t){var n,r=e[0],i=e[1],a=He.find(function(e){return e.tier_name===r}),o=r.replace(/tier(\d+)/i,"tier_$1");return{id:null!==(n=null==a?void 0:a.tier_id)&&void 0!==n?n:String(t+1),name:o.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),ruleCount:i.length,description:0===t?"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(i)}}),(p=r.useLearningTemplateStore.getState().createdVariantInfo)&&p.length>0?(m=Object.fromEntries(l.map(function(e,t){return[e[0],String(t+1)]})),g=new Set(p.map(function(e){return m[e.tierName]}).filter(Boolean)),h=v.map(function(t){return e.__assign(e.__assign({},t),{isOpen:t.isOpen||g.has(t.id)})}),H(h),(_=null===(j=null===(S=null===(T=p[0])||void 0===T?void 0:T.variants)||void 0===S?void 0:S[0])||void 0===j?void 0:j.id)?setTimeout(function(){var e=document.querySelector('[data-variant-id="'.concat(_,'"]'));e&&e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){return z()},1e4)},500):z()):H(v),[3,5]):(H([]),[2]);case 3:return y=w.sent(),console.error("Failed to fetch rule details",y),404!==(null==y?void 0:y.status)&&ye((null==y?void 0:y.message)||"Failed to load rules. Please try again."),H([]),[3,5];case 4:return t||ge(!1),[7];case 5:return[2]}})})},ot=W?f.findNodeById((null==G?void 0:G.data)||null,W):null,lt=ot?{ruleSetId:ot.id,ruleSetName:ot.name,ruleSetDesc:"",ruleCount:null===(_=null==ot?void 0:ot.metrics)||void 0===_?void 0:_.learningsCount}:void 0,st=function(){if("stations"===Q)return"custom";if(!ot)return"global";switch(ot.type){case"GLOBAL":default:return"global";case"SCOPE":return"genre";case"SUBSCOPE":case"Custom":return"custom"}},ut=function(n){if(!n)return t.jsx("p",{children:"Are you sure you want to delete this rule? This action cannot be undone."});var r=null==$?void 0:$.flatMap(function(e){var t;return null!==(t=e.rules)&&void 0!==t?t:[]}).find(function(e){return e.ruleId===n});return t.jsxs("p",{children:["Are you sure you want to delete"," ",t.jsx("span",e.__assign({className:v.default.semibold},{children:null==r?void 0:r.ruleTitle}))," rule? This action cannot be undone."]})},dt={editingRule:re,editingTier:oe,editingVariants:ue,focusedVariantIndex:fe,setFocusedVariantIndex:ve,triggerAddVariant:De,triggerFixGaps:Ge,copiedRule:ze,copiedSourceTier:Ye,copiedTargetTier:tt,initialDraftMessage:xe,app_integration_id:J,modeId:"019dde79-0494-78d7-ba5b-54a35d20f0fc"};return lt?t.jsxs(t.Fragment,{children:[t.jsx(l.Toast,{ref:Y}),t.jsx("div",e.__assign({className:v.default.container},{children:me?t.jsx(o.default,{}):_e?t.jsx(u.default,{errorMessage:_e,onRetry:at}):t.jsx(s.default,{onAddRule:rt,onDeleteRule:function(e){qe(e)},onEditRule:function(e,t){ie(e),le(t||null),de(e.variants||null),ve(null),Me(!0),te(!0)},onEditVariant:function(e,t,n,r){var i,a,o,l,s=null!==(o=null===(a=null===(i=null==$?void 0:$.find(function(e){return e.name===n}))||void 0===i?void 0:i.rules)||void 0===a?void 0:a.find(function(e){return e.ruleId===t}))&&void 0!==o?o:null==$?void 0:$.flatMap(function(e){return e.rules}).find(function(e){return e.ruleId===t});if(s){var u=null===(l=s.variants)||void 0===l?void 0:l.findIndex(function(t){return t.variantId===e.variantId}),d=void 0!==u&&-1!==u?u:0;ie(s),le(n||null),de(s.variants||null),ve(d),te(!0),"resolve_gaps"===r&&Qe(!0)}},onDeleteVariant:function(e,t){Pe({variantId:e,ruleId:t})},onExportRule:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,l,s,u;return e.__generator(this,function(e){switch(e.label){case 0:if(!W)return[2];je(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.exportRuleSet(W)];case 2:return n=e.sent(),r=window.URL.createObjectURL(n),(i=document.createElement("a")).href=r,o=(null==lt?void 0:lt.ruleSetName)?"".concat(lt.ruleSetName.replace(/\s+/g,"_"),"_rules.csv"):"ruleset_".concat(W,".csv"),i.download=o,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r),null===(s=Y.current)||void 0===s||s.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"Ruleset exported successfully!"})}),[3,5];case 3:return l=e.sent(),console.error("Export error:",l),null===(u=Y.current)||void 0===u||u.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:l.message||"Failed to export ruleset. Please try again."})}),[3,5];case 4:return je(!1),[7];case 5:return[2]}})})},isExporting:Se,onToggleSuccess:function(){return at(!0)},onReorderRules:function(n,r,i,o,l){return e.__awaiter(void 0,void 0,void 0,function(){var s,u,f;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.alterQuestionPriority(n,r,i,o,l)];case 1:return e.sent(),at(!0),null===(u=Y.current)||void 0===u||u.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"Rule order changed successfully. Future rule applications will follow the updated order."})}),[3,3];case 2:return s=e.sent(),console.error("Failed to reorder rules:",s),at(!0),null===(f=Y.current)||void 0===f||f.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:"Failed to update rule order. Please try again."})}),[3,3];case 3:return[2]}})})},onRefreshRuleSets:B,setDeleteConfirmationUsedFor:Fe,onCopyToTier:function(e,t,n,r,i){var a,o,l=null===(o=null===(a=null==$?void 0:$.find(function(e){return e.name===r}))||void 0===a?void 0:a.rules)||void 0===o?void 0:o.find(function(e){return e.ruleId===t});if(l){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(i)].join("\n");Ce(s),Ke(l),Ze(r),nt(i),ie(null),le(null),de(null),ve(null),te(!0)}}})})),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,app_integration_id:J,token:U,mode:"ADD",pluginPayload:e.__assign(e.__assign({},dt),{initialScope:st(),ruleSet:lt})})}),t.jsx(p.default,{isOpen:!!Re,title:M,description:ut(Re),warning:E,confirmText:P,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!Re)return[2];Oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.deleteRule(Re)];case 2:return e.sent(),qe(null),null===(r=Y.current)||void 0===r||r.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:b})}),at(),B&&B(!1,W||void 0),[3,5];case 3:return n=e.sent(),console.error("Failed to delete rule",n),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:(null===(l=null===(o=null==n?void 0:n.response)||void 0===o?void 0:o.data)||void 0===l?void 0:l.detail)||L})}),[3,5];case 4:return Oe(!1),[7];case 5:return[2]}})})},onCancel:function(){return qe(null)},isLoading:Le}),t.jsx(p.default,{isOpen:!!Ve,title:M,description:"variantDeletion"===Ee?t.jsx("span",{children:"Are you sure you want to delete this variant? This action cannot be undone."}):ut((null==Ve?void 0:Ve.ruleId)||null),warning:"ruleDeletion"===Ee?E:A,confirmText:P,confirmBgColor:"#EF4444",onConfirm:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!Ve)return[2];Ue(!0),e.label=1;case 1:return e.trys.push([1,6,7,8]),"ruleDeletion"!==Ee?[3,3]:[4,a.deleteQuestion(Ve.ruleId)];case 2:return e.sent(),[3,5];case 3:return[4,a.deleteRule(Ve.variantId)];case 4:e.sent(),e.label=5;case 5:return Pe(null),null===(r=Y.current)||void 0===r||r.show({severity:"success",sticky:!1,life:3e3,className:v.default.successToast,content:t.jsx(d.default,{message:"ruleDeletion"===Ee?b:q})}),at(),B&&B(!1,W||void 0),[3,8];case 6:return n=e.sent(),console.error("Failed to delete variant",n),null===(i=Y.current)||void 0===i||i.show({severity:"error",sticky:!1,className:v.default.errorToast,content:t.jsx(c.default,{message:(null===(l=null===(o=null==n?void 0:n.response)||void 0===o?void 0:o.data)||void 0===l?void 0:l.detail)||("ruleDeletion"===Ee?L:k)})}),[3,8];case 7:return Ue(!1),[7];case 8:return[2]}})})},onCancel:function(){return Pe(null)},isLoading:Je})]}):t.jsxs(t.Fragment,{children:[t.jsx(i.default,{onCreate:rt,title:T,desc:j,button:x}),ee&&t.jsx(m.CitationProvider,{children:t.jsx(g.default,{isOpen:ee,onClose:it,app_integration_id:J,token:U,mode:"ADD",pluginPayload:e.__assign(e.__assign({},dt),{initialScope:st(),ruleSet:lt})})})]})};
2
2
  //# sourceMappingURL=RuleContent.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.default="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";
2
+ //# sourceMappingURL=Search-result(add new).svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":[],"mappings":"qGA0Ke"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),l=require("lucide-react"),i=require("../styles/CreateLearningSetModal.module.css.js");exports.default=function(n){var r=n.isOpen,t=n.onClose,c=n.onSubmit,d=n.title,u=n.description,o=n.inputLabel,_=n.submitLabel,f=n.placeholder,m=void 0===f?"":f,g=n.initialValue,h=void 0===g?"":g,v=n.isLoading,x=void 0!==v&&v,j=a.useState(""),p=j[0],b=j[1],N=a.useState(null),C=N[0],q=N[1];if(a.useEffect(function(){r&&(b(h),q(null))},[r,h]),!r)return null;return s.jsx("div",e.__assign({className:i.default.overlay},{children:s.jsxs("div",e.__assign({className:i.default.modal},{children:[s.jsxs("div",e.__assign({className:i.default.header},{children:[s.jsxs("div",e.__assign({className:i.default.headerContent},{children:[s.jsx("h2",e.__assign({className:i.default.title},{children:d})),u&&s.jsx("p",e.__assign({className:i.default.description},{children:u}))]})),s.jsx("button",e.__assign({onClick:t,className:i.default.closeBtn,disabled:x},{children:s.jsx(l.X,{size:24})}))]})),s.jsx("div",e.__assign({className:i.default.form},{children:s.jsxs("div",e.__assign({className:i.default.formGroup},{children:[s.jsxs("label",e.__assign({className:i.default.label},{children:[s.jsx("span",e.__assign({className:i.default.asterisk},{children:"*"})),o]})),s.jsx("input",{type:"text",value:p,onChange:function(e){var s=e.target.value;if(s.length>50)return b(s.slice(0,50)),void q("Maximum 50 characters allowed");b(s),C&&q(null)},className:"".concat(i.default.inputField," ").concat(C?i.default.inputError:""),placeholder:m,disabled:x}),C&&s.jsx("p",e.__assign({className:i.default.errorMessage},{children:C}))]}))})),s.jsxs("div",e.__assign({className:i.default.footer},{children:[s.jsx("button",e.__assign({onClick:t,className:i.default.cancelBtn,disabled:x},{children:"Cancel"})),s.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var s;return e.__generator(this,function(e){switch(e.label){case 0:if(!(p.trim()?(q(null),1):(q("".concat(o.replace("*","").trim()," is required")),0)))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c(p)];case 2:return e.sent(),t(),[3,4];case 3:return s=e.sent(),q((null==s?void 0:s.message)||"An error occurred. Please try again."),[3,4];case 4:return[2]}})})},className:i.default.confirmBtn,disabled:x},{children:x?s.jsxs(s.Fragment,{children:[s.jsx(l.Loader2,{className:i.default.spinner}),"Save"===_?"Saving...":"Creating..."]}):_}))]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),l=require("lucide-react"),i=require("../styles/CreateLearningSetModal.module.css.js");exports.default=function(n){var t=n.isOpen,r=n.onClose,c=n.onSubmit,d=n.title,u=n.description,o=n.inputLabel,_=n.submitLabel,f=n.placeholder,m=void 0===f?"":f,g=n.initialValue,h=void 0===g?"":g,v=n.isLoading,x=void 0!==v&&v,j=a.useState(""),p=j[0],b=j[1],N=a.useState(null),C=N[0],q=N[1];if(a.useEffect(function(){t&&(b(h),q(null))},[t,h]),!t)return null;return s.jsx("div",e.__assign({className:i.default.overlay},{children:s.jsxs("div",e.__assign({className:i.default.modal},{children:[s.jsxs("div",e.__assign({className:i.default.header},{children:[s.jsxs("div",e.__assign({className:i.default.headerContent},{children:[s.jsx("h2",e.__assign({className:i.default.title},{children:d})),u&&s.jsx("p",e.__assign({className:i.default.description},{children:u}))]})),s.jsx("button",e.__assign({onClick:r,className:i.default.closeBtn,disabled:x},{children:s.jsx(l.X,{size:24})}))]})),s.jsx("div",e.__assign({className:i.default.form},{children:s.jsxs("div",e.__assign({className:i.default.formGroup},{children:[s.jsxs("label",e.__assign({className:i.default.label},{children:[s.jsx("span",e.__assign({className:i.default.asterisk},{children:"*"})),o]})),s.jsx("input",{type:"text",value:p,onChange:function(e){b(e.target.value),C&&q(null)},className:"".concat(i.default.inputField," ").concat(C?i.default.inputError:""),placeholder:m,disabled:x}),C&&s.jsx("p",e.__assign({className:i.default.errorMessage},{children:C}))]}))})),s.jsxs("div",e.__assign({className:i.default.footer},{children:[s.jsx("button",e.__assign({onClick:r,className:i.default.cancelBtn,disabled:x},{children:"Cancel"})),s.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var s;return e.__generator(this,function(e){switch(e.label){case 0:if(!(p.trim()?(q(null),1):(q("".concat(o.replace("*","").trim()," is required")),0)))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c(p)];case 2:return e.sent(),r(),[3,4];case 3:return s=e.sent(),q((null==s?void 0:s.message)||"An error occurred. Please try again."),[3,4];case 4:return[2]}})})},className:i.default.confirmBtn,disabled:x},{children:x?s.jsxs(s.Fragment,{children:[s.jsx(l.Loader2,{className:i.default.spinner}),"Save"===_?"Saving...":"Creating..."]}):_}))]}))]}))}))};
2
2
  //# sourceMappingURL=CreateLearningSetModal.js.map