@e-llm-studio/instant-learning 1.3.0-alpha.163 → 1.3.0-alpha.166

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 (68) hide show
  1. package/README.md +5 -3
  2. package/dist/ContinueWithTemplateModal.js +1 -1
  3. package/dist/ILMarketplaceWrapper.js +1 -1
  4. package/dist/cjs/ContinueWithTemplateModal.js +1 -1
  5. package/dist/cjs/ILMarketplaceWrapper.js +1 -1
  6. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
  7. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
  8. package/dist/cjs/features/IL-marketplace/components/GuidelineLibrary.js +1 -1
  9. package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js +1 -1
  10. package/dist/cjs/features/IL-marketplace/constants.js +1 -1
  11. package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
  12. package/dist/cjs/features/LearningManagement/RuleContent/AddScopeModal.js +1 -1
  13. package/dist/cjs/features/LearningManagement/apis/apiConfig.js +1 -1
  14. package/dist/cjs/features/LearningManagement/apis/scopeApis.js +1 -1
  15. package/dist/cjs/features/LearningManagement/components/ScopeSkeletonLoader.js +1 -1
  16. package/dist/cjs/features/LearningManagement/queries/useLMSConfigQuery.js +1 -1
  17. package/dist/cjs/features/LearningManagement/store/useLMSConfigStore.js +1 -1
  18. package/dist/cjs/index.js +1 -1
  19. package/dist/cjs/schema-driven/utils/PayloadUtils.js +1 -1
  20. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
  21. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
  22. package/dist/features/IL-marketplace/components/GuidelineLibrary.js +1 -1
  23. package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js +1 -1
  24. package/dist/features/IL-marketplace/constants.js +1 -1
  25. package/dist/features/LearningManagement/LearningManagement.js +1 -1
  26. package/dist/features/LearningManagement/RuleContent/AddScopeModal.js +1 -1
  27. package/dist/features/LearningManagement/apis/apiConfig.js +1 -1
  28. package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
  29. package/dist/features/LearningManagement/components/ScopeSkeletonLoader.js +1 -1
  30. package/dist/features/LearningManagement/queries/useLMSConfigQuery.js +1 -1
  31. package/dist/features/LearningManagement/store/useLMSConfigStore.js +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/schema-driven/utils/PayloadUtils.js +1 -1
  34. package/dist/types/src/ContinueWithTemplateModal.d.ts +8 -1
  35. package/dist/types/src/ContinueWithTemplateModal.d.ts.map +1 -1
  36. package/dist/types/src/ILMarketplaceWrapper.d.ts +7 -1
  37. package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -1
  38. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +13 -1
  39. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
  40. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +2 -1
  41. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
  42. package/dist/types/src/features/IL-marketplace/components/GuidelineLibrary.d.ts +4 -2
  43. package/dist/types/src/features/IL-marketplace/components/GuidelineLibrary.d.ts.map +1 -1
  44. package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts +4 -2
  45. package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts.map +1 -1
  46. package/dist/types/src/features/IL-marketplace/constants.d.ts +4 -0
  47. package/dist/types/src/features/IL-marketplace/constants.d.ts.map +1 -1
  48. package/dist/types/src/features/IL-marketplace/types.d.ts +13 -0
  49. package/dist/types/src/features/IL-marketplace/types.d.ts.map +1 -1
  50. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  51. package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts +0 -3
  52. package/dist/types/src/features/LearningManagement/RuleContent/AddScopeModal.d.ts.map +1 -1
  53. package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +1 -0
  54. package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
  55. package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +9 -1
  56. package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
  57. package/dist/types/src/features/LearningManagement/components/ScopeSkeletonLoader.d.ts +4 -0
  58. package/dist/types/src/features/LearningManagement/components/ScopeSkeletonLoader.d.ts.map +1 -1
  59. package/dist/types/src/features/LearningManagement/queries/useLMSConfigQuery.d.ts +6 -1
  60. package/dist/types/src/features/LearningManagement/queries/useLMSConfigQuery.d.ts.map +1 -1
  61. package/dist/types/src/features/LearningManagement/store/useExternalWorkflowStore.d.ts +5 -0
  62. package/dist/types/src/features/LearningManagement/store/useExternalWorkflowStore.d.ts.map +1 -1
  63. package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts +3 -0
  64. package/dist/types/src/features/LearningManagement/store/useLMSConfigStore.d.ts.map +1 -1
  65. package/dist/types/src/index.d.ts +2 -1
  66. package/dist/types/src/index.d.ts.map +1 -1
  67. package/dist/types/src/schema-driven/utils/PayloadUtils.d.ts.map +1 -1
  68. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("@tanstack/react-query"),t=require("lucide-react"),o=require("primereact/toast"),a=require("uuid"),s=require("../components/StationOnboarding/StationAutocomplete.js"),l=require("./AddScopeApprovalSearchComponent.js"),d=require("../components/ScopeSkeletonLoader.js"),u=require("@mui/material"),c=require("../store/useAuthStore.js"),p=require("../store/useAppSecRolesStore.js"),_=require("../store/useEnvStore.js"),g=require("../apis/scopeApis.js"),h=require("../store/useLearningTemplateStore.js"),f=require("../config.js"),m=require("../store/useLMSConfigStore.js"),v=require("../constants.js");exports.default=function(S){var y=S.isOpen,b=S.onClose,D=S.onCreate,x=S.hasGlobalRuleSet,A=S.parentId,C=S.isILMarketplace,E=void 0!==C&&C,j=S.onCreateMarketplaceDomain,R=S.childType,T=S.parentName,I=i.useState(""),P=I[0],w=I[1],L=i.useState(""),q=L[0],k=L[1],O=i.useState({}),W=O[0],M=O[1],F=i.useRef(null),N=c.default().user,B=p.useAppSecRolesStore(function(e){return e.roles}),G=_.default(function(e){return e.rbacConfig}),z=i.useState(!1),H=z[0],U=z[1],V=i.useState(null),K=V[0],X=V[1],J=i.useState("approval_required"),Q=J[0],Y=J[1],Z=i.useState([]),$=Z[0],ee=Z[1],ne=i.useState([]),ie=ne[0],re=ne[1],te=i.useState(!1);te[0];var oe=te[1],ae=E?"SUBSCOPE"===R?"Subdomain Name":"Domain Name":m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".scopeName"),"Scope Name"),se=r.useMutation({mutationFn:function(n){return e.__awaiter(void 0,void 0,void 0,function(){var i;return e.__generator(this,function(e){switch(e.label){case 0:return[4,g.createRuleSet(n,null!==(i=null==N?void 0:N.accessToken)&&void 0!==i?i:"")];case 1:return[2,e.sent()]}})})},onSuccess:function(n){return e.__awaiter(void 0,void 0,void 0,function(){var i,r;return e.__generator(this,function(e){return console.log("Rule Set Created Successfully",n),null===(i=F.current)||void 0===i||i.show({severity:"success",summary:"Scope Created",detail:(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.message)||"Scope created successfully",life:3e3}),[2]})})},onError:function(e){var n,i,r;console.error("Create scope failed",e),null===(n=F.current)||void 0===n||n.show({severity:"error",summary:"Creation Failed",detail:(null===(r=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===r?void 0:r.message)||"There was an error creating the scope. Please try again."})}});se.data;var le=se.isPending,de=se.mutateAsync;return i.useEffect(function(){y&&(w(""),k(""),M({}),X(null),Y("approval_required"),ee([]),re([]))},[y]),y?n.jsxs("div",e.__assign({style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.3)"}},{children:[n.jsx(o.Toast,{ref:F}),le||H?n.jsx(d.default,{isLoading:le||H}):n.jsxs("div",e.__assign({style:{position:"relative",width:600,borderRadius:12,backgroundColor:"white",padding:24,boxShadow:"0 25px 50px -12px rgba(0,0,0,0.25)"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:24,display:"flex",alignItems:"flex-start",justifyContent:"space-between"}},{children:[n.jsxs("div",{children:[n.jsx("h2",e.__assign({style:{margin:0,fontSize:18,fontWeight:500,color:"#19213D"}},{children:E?"SUBSCOPE"===R?"Add Subdomain":"Add Domain":x?m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".title"),"Add Scope"):m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".globalTitle"),"Create Global Scope")})),n.jsx("p",e.__assign({style:{margin:"4px 0 0 0",fontSize:14,fontWeight:400,color:"#666F8D"}},{children:E?T?"This ".concat("SUBSCOPE"===R?"subdomain":"domain"," will be created under '").concat(T,"'."):"This ".concat("SUBSCOPE"===R?"subdomain":"domain"," will be created under the selected parent domain."):x?m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".subtitle"),"This scope will be created under Global scope and will inherit its learnings by default.",{parent:"Global"}):m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".globalSubtitle"),"This will be your Global scope that defines the base learnings shared across all stations.")}))]}),n.jsx("button",e.__assign({onClick:b,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"#9CA3AF"}},{children:n.jsx(t.X,{size:24})}))]})),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:20}},{children:[n.jsxs("div",e.__assign({style:{position:"relative",display:"flex",flexDirection:"column",gap:6}},{children:[n.jsxs("label",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),ae]})),"Custom"===P?n.jsx(s.default,{value:q,onChange:function(n){if(n.length>50)return k(n.slice(0,50)),void M(function(n){return e.__assign(e.__assign({},n),{name:"".concat(ae," must be 50 characters or fewer")})});k(n),M(function(n){return e.__assign(e.__assign({},n),{name:void 0})})},onStationSelect:function(e){X(e)},style:{border:W.name?"1px solid #8F2C23":void 0}}):n.jsx(u.Input,{value:q,onChange:function(n){var i=n.target.value;if(i.length>50)return k(i.slice(0,50)),void M(function(n){return e.__assign(e.__assign({},n),{name:"".concat(ae," must be 50 characters or fewer")})});k(i),M(function(n){return e.__assign(e.__assign({},n),{name:void 0})})},style:{border:"1px solid ".concat(W.name?"#8F2C23":"#F0F2F5")},placeholder:E?"e.g. MarketPlace":"e.g. Global Learnings"}),W.name&&n.jsx("p",e.__assign({style:{margin:"4px 0 0 0",fontSize:12,color:"#8F2C23"}},{children:W.name}))]})),!E&&n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12}},{children:[n.jsxs("label",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),m.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".title"),"Learning Approval Settings")]})),n.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===Q,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){return Y("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Y("approval_required")}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===Q?"#2563EB":"#CBD5E1")}},{children:"approval_required"===Q&&n.jsx("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:m.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".approvalRequired.title"),"Approval Required Before Publishing")}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:m.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".approvalRequired.subtitle"),"Learnings require approval before publishing.")}))]})),"approval_required"===Q&&n.jsx(l.default,{selectedApprovers:$,selectedGroupOfApprovers:ie,onApproversChange:ee,onGroupsChange:re}),n.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===Q,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){Y("publish_without")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Y("publish_without")}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===Q?"#2563EB":"#CBD5E1")}},{children:"publish_without"===Q&&n.jsx("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:m.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".publishWithoutApproval.title"),"Publish Without Approval")}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:m.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".publishWithoutApproval.subtitle"),"Learnings can be published directly.")}))]}))]})),n.jsxs("div",e.__assign({style:{marginTop:32,display:"flex",justifyContent:"flex-end",gap:12}},{children:[n.jsx("button",e.__assign({onClick:b,style:{borderRadius:6,border:"1px solid #E2E8F0",padding:"8px 16px",fontSize:14,fontWeight:500,color:"#64748B",backgroundColor:"white",cursor:"pointer",opacity:le?.5:1},disabled:le},{children:m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".cancel"),"Cancel")})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,i,r,t,o,s,l,d,u,c,p,_,m,v,S,y,C,R,T,I,P,w;return e.__generator(this,function(L){switch(L.label){case 0:if(n={},q.trim()?q.length>50&&(n.name="".concat(ae," must be 50 characters or fewer")):n.name="".concat(ae," is required"),n.name)return M(n),[2];L.label=1;case 1:return L.trys.push([1,10,11,12]),U(!0),E?[4,null==j?void 0:j(q)]:[3,3];case 2:return i=L.sent(),D(null==i?void 0:i.scopeId),b(),[2];case 3:return r="approval_required"===Q,t=h.useLearningTemplateStore.getState().backwardCompatibility,o=$.length>0||ie.length>0,s=t?{topic:x?"genreRuleSet":"globalRuleSet",customScopeGroupName:f.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:q,parentScopeId:null,customScopeName:q,customScopeId:a.v4(),createByName:(null==N?void 0:N.firstname)||"System",createdBy:(null==N?void 0:N.email)||"system@audacy.com",approvalRequired:r,appsecData:{application:null==G?void 0:G.applicationId,module:null==G?void 0:G.moduleId,roles:e.__spreadArray(e.__spreadArray([],r&&o?[{users:$.map(function(e){return e.email}),groups:ie.map(function(e){return e._id}),role:null!==(_=null===(p=B.find(function(e){return"Learning Manager"===e.name}))||void 0===p?void 0:p._id)&&void 0!==_?_:""}]:[],!0),[{users:[null==N?void 0:N.email],groups:[],role:null!==(v=null===(m=B.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===m?void 0:m._id)&&void 0!==v?v:""}],!1)}}:{topic:x?"genreRuleSet":"globalRuleSet",scope_reference_id:null,scopeDescription:q,parentScopeId:null!=A?A:null,scopeName:q,scopeReferenceMetadata:{},scopeType:"Custom",applicationMappingId:h.useLearningTemplateStore.getState().app_integration_id,approvalRequired:r,appsecData:{application:null==G?void 0:G.applicationId,module:null==G?void 0:G.moduleId,roles:e.__spreadArray(e.__spreadArray([],r&&o?[{users:$.map(function(e){return e.email}),groups:ie.map(function(e){return e._id}),role:null!==(y=null===(S=B.find(function(e){return"Learning Manager"===e.name}))||void 0===S?void 0:S._id)&&void 0!==y?y:""}]:[],!0),[{users:[null==N?void 0:N.email],groups:[],role:null!==(R=null===(C=B.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===C?void 0:C._id)&&void 0!==R?R:""}],!1)}},console.log("Add Scope payload:",s),[4,de(s)];case 4:if(l=L.sent(),d=null===(T=null==l?void 0:l.data)||void 0===T?void 0:T.scopeId,t||!d||!A)return[3,9];oe(!0),L.label=5;case 5:return L.trys.push([5,7,8,9]),[4,g.inheritScope({source_scope_id:A,target_scope_id:d,application_mapping_id:h.useLearningTemplateStore.getState().app_integration_id||"",is_copy_parent_variant_id:!1})];case 6:return L.sent(),[3,9];case 7:return u=L.sent(),console.error("Failed to inherit rules for the new scope:",u),[3,9];case 8:return oe(!1),[7];case 9:return D(d),b(),[3,12];case 10:return c=L.sent(),console.error("An error occurred during scope creation.",c),null===(I=F.current)||void 0===I||I.show({severity:"error",summary:"Adding Scope Failed",detail:(null===(w=null===(P=null==c?void 0:c.response)||void 0===P?void 0:P.data)||void 0===w?void 0:w.message)||"There was an error creating the scope. Please try again."}),[3,12];case 11:return U(!1),[7];case 12:return[2]}})})},style:{display:"flex",alignItems:"center",borderRadius:6,backgroundColor:"#2563EB",padding:"8px 16px",fontSize:14,fontWeight:500,color:"white",border:"none",cursor:"pointer",opacity:le||"Custom"===P&&!K?.5:1},disabled:le||"Custom"===P&&!K},{children:le?n.jsxs(n.Fragment,{children:[n.jsx(t.Loader2,{className:"animate-spin",style:{marginRight:8,height:16,width:16,color:"white"}}),"Creating..."]}):E?"SUBSCOPE"===R?"Create Subdomain":"Create Domain":m.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".submitButton"),"Create Scope")}))]}))]}))]}))]})):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("@tanstack/react-query"),i=require("lucide-react"),o=require("primereact/toast"),a=require("uuid"),s=require("../components/StationOnboarding/StationAutocomplete.js"),l=require("./AddScopeApprovalSearchComponent.js"),c=require("../components/ScopeSkeletonLoader.js"),u=require("@mui/material"),d=require("../store/useAuthStore.js"),p=require("../store/useAppSecRolesStore.js"),_=require("../store/useEnvStore.js"),g=require("../apis/scopeApis.js"),h=require("../store/useLearningTemplateStore.js"),f=require("../config.js"),S=require("../store/useLMSConfigStore.js"),v=require("../constants.js");exports.default=function(m){var D=m.isOpen,b=m.onClose,y=m.onCreate,x=m.hasGlobalRuleSet,A=m.parentId,C=m.isILMarketplace,E=void 0!==C&&C,R=m.childType,T=m.parentName,j=n.useState(""),P=j[0],I=j[1],w=n.useState(""),L=w[0],q=w[1],O=n.useState({}),W=O[0],k=O[1],M=n.useRef(null),F=d.default().user,N=p.useAppSecRolesStore(function(e){return e.roles}),B=_.default(function(e){return e.rbacConfig}),G=n.useState(!1),z=G[0],H=G[1],U=n.useState(null),V=U[0],K=U[1],X=n.useState("approval_required"),J=X[0],Q=X[1],Y=n.useState([]),Z=Y[0],$=Y[1],ee=n.useState([]),te=ee[0],ne=ee[1],re=n.useState(!1);re[0];var ie=re[1],oe=S.dt("middleDrawer.subScope","Subscope"),ae="SUBSCOPE"===R?S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".subScopeName"),"".concat(oe," Name")):S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".scopeName"),"Scope Name"),se=r.useMutation({mutationFn:function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return[4,g.createRuleSet(t,null!==(n=null==F?void 0:F.accessToken)&&void 0!==n?n:"")];case 1:return[2,e.sent()]}})})},onSuccess:function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,r;return e.__generator(this,function(e){return console.log("Rule Set Created Successfully",t),null===(n=M.current)||void 0===n||n.show({severity:"success",summary:"Scope Created",detail:(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.message)||"Scope created successfully",life:3e3}),[2]})})},onError:function(e){var t,n,r;console.error("Create scope failed",e),null===(t=M.current)||void 0===t||t.show({severity:"error",summary:"Creation Failed",detail:(null===(r=null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.message)||"There was an error creating the scope. Please try again."})}});se.data;var le=se.isPending,ce=se.mutateAsync;if(n.useEffect(function(){D&&(I(""),q(""),k({}),K(null),Q("approval_required"),$([]),ne([]))},[D]),!D)return null;var ue="SUBSCOPE"===R?S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".subScopeTitle"),S.dt("middleDrawer.addSubScope","Add Subscope")):x?S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".title"),"Add Scope"):S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".globalTitle"),"Create Global Scope"),de="SUBSCOPE"===R?S.interpolate(S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".subScopeSubtitle"),"This ".concat(oe.toLowerCase()," will be created under {parent} and will inherit its Knowledgebases by default.")),{parent:T||S.dt("middleDrawer.scope","the selected scope")}):x?S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".subtitle"),"This scope will be created under Global scope and will inherit its learnings by default.",{parent:"Global"}):S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".globalSubtitle"),"This will be your Global scope that defines the base learnings shared across all stations."),pe="SUBSCOPE"===R?"Setting up your ".concat(oe,"…"):x?"Setting up your ".concat(S.dt("middleDrawer.scope","Scope"),"…"):"Setting up your Global Scope…";return t.jsxs("div",e.__assign({style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.3)"}},{children:[t.jsx(o.Toast,{ref:M}),le||z?t.jsx(c.default,{isLoading:le||z,title:pe,subtitle:de}):t.jsxs("div",e.__assign({style:{position:"relative",width:600,borderRadius:12,backgroundColor:"white",padding:24,boxShadow:"0 25px 50px -12px rgba(0,0,0,0.25)"}},{children:[t.jsxs("div",e.__assign({style:{marginBottom:24,display:"flex",alignItems:"flex-start",justifyContent:"space-between"}},{children:[t.jsxs("div",{children:[t.jsx("h2",e.__assign({style:{margin:0,fontSize:18,fontWeight:500,color:"#19213D"}},{children:ue})),t.jsx("p",e.__assign({style:{margin:"4px 0 0 0",fontSize:14,fontWeight:400,color:"#666F8D"}},{children:de}))]}),t.jsx("button",e.__assign({onClick:b,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"#9CA3AF"}},{children:t.jsx(i.X,{size:24})}))]})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:20}},{children:[t.jsxs("div",e.__assign({style:{position:"relative",display:"flex",flexDirection:"column",gap:6}},{children:[t.jsxs("label",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[t.jsx("span",e.__assign({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),ae]})),"Custom"===P?t.jsx(s.default,{value:L,onChange:function(t){if(t.length>50)return q(t.slice(0,50)),void k(function(t){return e.__assign(e.__assign({},t),{name:"".concat(ae," must be 50 characters or fewer")})});q(t),k(function(t){return e.__assign(e.__assign({},t),{name:void 0})})},onStationSelect:function(e){K(e)},style:{border:W.name?"1px solid #8F2C23":void 0}}):t.jsx(u.Input,{value:L,onChange:function(t){var n=t.target.value;if(n.length>50)return q(n.slice(0,50)),void k(function(t){return e.__assign(e.__assign({},t),{name:"".concat(ae," must be 50 characters or fewer")})});q(n),k(function(t){return e.__assign(e.__assign({},t),{name:void 0})})},style:{border:"1px solid ".concat(W.name?"#8F2C23":"#F0F2F5")},placeholder:E?"e.g. MarketPlace":"e.g. Global Learnings"}),W.name&&t.jsx("p",e.__assign({style:{margin:"4px 0 0 0",fontSize:12,color:"#8F2C23"}},{children:W.name}))]})),!E&&t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:12}},{children:[t.jsxs("label",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:[t.jsx("span",e.__assign({style:{marginRight:4,fontSize:16,fontWeight:600,color:"#8F2C23"}},{children:"*"})),S.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".title"),"Learning Approval Settings")]})),t.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===J,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){return Q("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Q("approval_required")}},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[t.jsx("div",e.__assign({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===J?"#2563EB":"#CBD5E1")}},{children:"approval_required"===J&&t.jsx("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:S.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".approvalRequired.title"),"Approval Required Before Publishing")}))]})),t.jsx("p",e.__assign({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:S.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".approvalRequired.subtitle"),"Learnings require approval before publishing.")}))]})),"approval_required"===J&&t.jsx(l.default,{selectedApprovers:Z,selectedGroupOfApprovers:te,onApproversChange:$,onGroupsChange:ne}),t.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===J,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:4},onClick:function(){Q("publish_without")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Q("publish_without")}},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[t.jsx("div",e.__assign({style:{display:"flex",height:16,width:16,flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===J?"#2563EB":"#CBD5E1")}},{children:"publish_without"===J&&t.jsx("div",{style:{height:8,width:8,borderRadius:"50%",backgroundColor:"#2563EB"}})})),t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:500,color:"#19213D"}},{children:S.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".publishWithoutApproval.title"),"Publish Without Approval")}))]})),t.jsx("p",e.__assign({style:{margin:0,marginLeft:24,fontSize:12,color:"#666F8D"}},{children:S.dt("".concat(v.MIDDLE_DRAWER_APPROVAL_SETTINGS_DT_PATH,".publishWithoutApproval.subtitle"),"Learnings can be published directly.")}))]}))]})),t.jsxs("div",e.__assign({style:{marginTop:32,display:"flex",justifyContent:"flex-end",gap:12}},{children:[t.jsx("button",e.__assign({onClick:b,style:{borderRadius:6,border:"1px solid #E2E8F0",padding:"8px 16px",fontSize:14,fontWeight:500,color:"#64748B",backgroundColor:"white",cursor:"pointer",opacity:le?.5:1},disabled:le},{children:S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".cancel"),"Cancel")})),t.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,i,o,s,l,c,u,d,p,_,S,v,m,D,C,E,R,T,j;return e.__generator(this,function(P){switch(P.label){case 0:if(t={},L.trim()?L.length>50&&(t.name="".concat(ae," must be 50 characters or fewer")):t.name="".concat(ae," is required"),t.name)return k(t),[2];P.label=1;case 1:return P.trys.push([1,8,9,10]),H(!0),n="approval_required"===J,r=h.useLearningTemplateStore.getState().backwardCompatibility,i=Z.length>0||te.length>0,o=r?{topic:x?"genreRuleSet":"globalRuleSet",customScopeGroupName:f.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:L,parentScopeId:null,customScopeName:L,customScopeId:a.v4(),createByName:(null==F?void 0:F.firstname)||"System",createdBy:(null==F?void 0:F.email)||"system@audacy.com",approvalRequired:n,appsecData:{application:null==B?void 0:B.applicationId,module:null==B?void 0:B.moduleId,roles:e.__spreadArray(e.__spreadArray([],n&&i?[{users:Z.map(function(e){return e.email}),groups:te.map(function(e){return e._id}),role:null!==(p=null===(d=N.find(function(e){return"Learning Manager"===e.name}))||void 0===d?void 0:d._id)&&void 0!==p?p:""}]:[],!0),[{users:[null==F?void 0:F.email],groups:[],role:null!==(S=null===(_=N.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===_?void 0:_._id)&&void 0!==S?S:""}],!1)}}:{topic:x?"genreRuleSet":"globalRuleSet",scope_reference_id:null,scopeDescription:L,parentScopeId:null!=A?A:null,scopeName:L,scopeReferenceMetadata:{},scopeType:"Custom",applicationMappingId:h.useLearningTemplateStore.getState().app_integration_id,approvalRequired:n,appsecData:{application:null==B?void 0:B.applicationId,module:null==B?void 0:B.moduleId,roles:e.__spreadArray(e.__spreadArray([],n&&i?[{users:Z.map(function(e){return e.email}),groups:te.map(function(e){return e._id}),role:null!==(m=null===(v=N.find(function(e){return"Learning Manager"===e.name}))||void 0===v?void 0:v._id)&&void 0!==m?m:""}]:[],!0),[{users:[null==F?void 0:F.email],groups:[],role:null!==(C=null===(D=N.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===D?void 0:D._id)&&void 0!==C?C:""}],!1)}},console.log("Add Scope payload:",o),[4,ce(o)];case 2:if(s=P.sent(),l=null===(E=null==s?void 0:s.data)||void 0===E?void 0:E.scopeId,r||!l||!A)return[3,7];ie(!0),P.label=3;case 3:return P.trys.push([3,5,6,7]),[4,g.inheritScope({source_scope_id:A,target_scope_id:l,application_mapping_id:h.useLearningTemplateStore.getState().app_integration_id||"",is_copy_parent_variant_id:!1})];case 4:return P.sent(),[3,7];case 5:return c=P.sent(),console.error("Failed to inherit rules for the new scope:",c),[3,7];case 6:return ie(!1),[7];case 7:return y(l),b(),[3,10];case 8:return u=P.sent(),console.error("An error occurred during scope creation.",u),null===(R=M.current)||void 0===R||R.show({severity:"error",summary:"Adding Scope Failed",detail:(null===(j=null===(T=null==u?void 0:u.response)||void 0===T?void 0:T.data)||void 0===j?void 0:j.message)||"There was an error creating the scope. Please try again."}),[3,10];case 9:return H(!1),[7];case 10:return[2]}})})},style:{display:"flex",alignItems:"center",borderRadius:6,backgroundColor:"#2563EB",padding:"8px 16px",fontSize:14,fontWeight:500,color:"white",border:"none",cursor:"pointer",opacity:le||"Custom"===P&&!V?.5:1},disabled:le||"Custom"===P&&!V},{children:le?t.jsxs(t.Fragment,{children:[t.jsx(i.Loader2,{className:"animate-spin",style:{marginRight:8,height:16,width:16,color:"white"}}),"Creating..."]}):E?"SUBSCOPE"===R?"Create Subdomain":"Create Domain":S.dt("".concat(v.MIDDLE_DRAWER_ADD_SCOPE_DT_PATH,".submitButton"),"Create Scope")}))]}))]}))]}))]}))};
2
2
  //# sourceMappingURL=AddScopeModal.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.API_ENDPOINTS={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/ilotj/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/ilotj/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/ilotj/variant/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}/{appIntegrationId}",deleteRule:"/instant_learning/ilotj/variant/{ruleId}/{appIntegrationId}",deleteQuestion:"/instant_learning/ilotj/question/{questionId}/{appIntegrationId}",deleteTier:"/instant_learning/ilotj/scope/{scopeId}/tier/{tierId}/{appIntegrationId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",exportScope:"/instant_learning/ilotj/export-scope/{scopeId}/{appIntegrationId}",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/ilotj/alter-priority",fetchRulesByQuestionId:"/instant_learning/ilotj/rules/fetch_by_rule_id/{questionId}/{scopeId}/{appIntegrationId}?include_config=False",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation",getTiers:"/instant_learning/ilotj/tier/{appIntegrationId}",requestAccess:"/instant_learning/ilotj/request-access",getILInstance:"/instant_learning/ilotj/getData/",updateVariantStatus:"/instant_learning/ilotj/variants/update_variant_status",getRBACConfig:"/instant_learning/ilotj/application/getRBACAuditConfig/{appIntegrationId}"},exports.LEGACY_API_ENDPOINTS={submitChatFeedback:"/instant_learning/feedback/teachme_otj",fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant",getTiers:"/instant_learning/retrieve_tiers",requestAccess:"/instant_learning/request-access",deleteQuestion:"/instant_learning/question/{questionId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",renameScope:"/instant_learning/scope",alterRulePriority:"/instant_learning/v2/alterPriority",updateVariantStatus:"/instant_learning/scopes/{scopeId}/variants/update_variant_status",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log"};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.API_ENDPOINTS={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/ilotj/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/ilotj/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/ilotj/variant/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}/{appIntegrationId}",deleteRule:"/instant_learning/ilotj/variant/{ruleId}/{appIntegrationId}",deleteQuestion:"/instant_learning/ilotj/question/{questionId}/{appIntegrationId}",deleteTier:"/instant_learning/ilotj/scope/{scopeId}/tier/{tierId}/{appIntegrationId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",exportScope:"/instant_learning/ilotj/export-scope/{scopeId}/{appIntegrationId}",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/ilotj/alter-priority",fetchRulesByQuestionId:"/instant_learning/ilotj/rules/fetch_by_rule_id/{questionId}/{scopeId}/{appIntegrationId}?include_config=False",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation",getTiers:"/instant_learning/ilotj/tier/{appIntegrationId}",requestAccess:"/instant_learning/ilotj/request-access",getILInstance:"/instant_learning/ilotj/getData/",updateVariantStatus:"/instant_learning/ilotj/variants/update_variant_status",getRBACConfig:"/instant_learning/ilotj/application/getRBACAuditConfig/{appIntegrationId}",getValueType:"/instant_learning/ilotj/application/getValueType/{appIntegrationId}"},exports.LEGACY_API_ENDPOINTS={submitChatFeedback:"/instant_learning/feedback/teachme_otj",fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant",getTiers:"/instant_learning/retrieve_tiers",requestAccess:"/instant_learning/request-access",deleteQuestion:"/instant_learning/question/{questionId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",renameScope:"/instant_learning/scope",alterRulePriority:"/instant_learning/v2/alterPriority",updateVariantStatus:"/instant_learning/scopes/{scopeId}/variants/update_variant_status",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log"};
2
2
  //# sourceMappingURL=apiConfig.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("../../../api/transport.js"),r=require("./apiConfig.js"),n=require("../store/useAuthStore.js"),a=require("../store/useEnvStore.js"),o=require("../store/useLearningTemplateStore.js"),i=require("../config.js"),s=!1,c=function(e){return e.interceptors.request.use(function(e){var t=n.default.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e.interceptors.response.use(function(e){return e},function(e){var t;return 401===(null===(t=e.response)||void 0===t?void 0:t.status)&&"/login"!==window.location.pathname&&function(){if(!s){s=!0,localStorage.setItem("userActionLogout","true"),n.default.getState().logout();var e=a.default.getState().appsecBaseUrl;window.location.href="".concat(e,"/cross-signout?callback_url=").concat(window.location.origin,"/login")}}(),Promise.reject(e)}),e},u=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},l=function(e){return e.interceptors.request.use(function(e){return e.headers["x-full-url"]=window.location.href,e}),e},p=u(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().audacyBackendUrl||""}),d=u(l(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}}))),function(){return a.default.getState().llmStudioUrl||""}),g=u(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().appsecRbacUrl||""}),_=u(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().appsecBaseUrl||""}),v=function(e){return u(l(c(t.createAxiosInstance({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0}))),function(){return a.default.getState().llmStudioUrl||""})};exports.ApproveOrRejectVariants=function(t){var n=t.variant_ids,i=t.status,s=t.feedback,c=t.scopeId,u=t.is_deleted,l=t.appsecData;return e.__awaiter(void 0,void 0,void 0,function(){var t,p,g,_,S,h,f;return e.__generator(this,function(I){switch(I.label){case 0:t=o.useLearningTemplateStore.getState().backwardCompatibility,p=o.useLearningTemplateStore.getState().app_integration_id,g=o.useLearningTemplateStore.getState().token,_=a.default.getState().baseModeName,I.label=1;case 1:return I.trys.push([1,6,,7]),t?(h=r.LEGACY_API_ENDPOINTS.updateVariantStatus.replace("{scopeId}",c),S=e.__assign({variant_ids:n,status:i,feedback:s||"",is_deleted:null!=u&&u},l&&{appsecData:l}),[4,v(g).patch(h,S)]):[3,3];case 2:return[2,I.sent().data];case 3:return S=e.__assign({variant_ids:n,scope_id:c,application_mapping_id:p,status:i,feedback:s||"",is_deleted:null!=u&&u},l&&{appsecData:l}),h=r.API_ENDPOINTS.updateVariantStatus,_&&(h+="?mode_name=".concat(encodeURIComponent(_))),[4,d.put(h,S)];case 4:return[2,I.sent().data];case 5:return[3,7];case 6:throw f=I.sent(),console.log(f),f;case 7:return[2]}})})},exports.GetAppsecRoles=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,g.get("/roles?appId=".concat(t))];case 1:return[2,e.sent().data];case 2:throw r=e.sent(),console.error(r),r;case 3:return[2]}})})},exports.alterQuestionPriority=function(t,n,a,i,s){return e.__awaiter(void 0,void 0,void 0,function(){var c,u,l,p,d,g;return e.__generator(this,function(e){switch(e.label){case 0:c=o.useLearningTemplateStore.getState().backwardCompatibility,u=o.useLearningTemplateStore.getState().app_integration_id,l=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,3,,4]),p=c?r.LEGACY_API_ENDPOINTS.alterRulePriority:r.API_ENDPOINTS.alterRulePriority,d=c?{scopeId:t,tierId:n,move:{movedRuleId:a,prevRuleId:i,nextRuleId:s}}:{scope_id:t,tier_id:n,move:{moved_rule_id:a,prev_rule_id:i,next_rule_id:s},application_mapping_id:u},[4,v(l).put(p,d)];case 2:return[2,e.sent().data];case 3:throw g=e.sent(),console.error("Error altering question priority:",g),g;case 4:return[2]}})})},exports.appsecApi=g,exports.appsecApigetUser=_,exports.appsecGetUserGroups=function(t){return void 0===t&&(t={}),e.__awaiter(void 0,void 0,void 0,function(){var r,n,a,o,i,s,c,u,l,p,d,_,v,S,h,f;return e.__generator(this,function(e){switch(e.label){case 0:r=t.appId,n=void 0===r?"":r,a=t.name,o=void 0===a?"":a,i=t.user,s=void 0===i?"":i,c=t.isActive,u=void 0===c||c,l=t.page,p=void 0===l?1:l,d=t.limit,_=void 0===d?10:d,v=t.pagination,S=void 0===v||v,h=new URLSearchParams({appId:n,name:o,user:s,isActive:String(u),page:String(p),limit:String(_),pagination:String(S)}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,g.get("/groups?".concat(h.toString()))];case 2:return[2,e.sent().data];case 3:throw f=e.sent(),console.error("Failed to fetch user groups",f),f;case 4:return[2]}})})},exports.appsecGetUsersByQueryLite=function(t,r){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,o,i,s,c,u,l,p,d,g,v,S,h,f,I,w;return e.__generator(this,function(e){switch(e.label){case 0:a=(n=r||{}).isPopulateRoles,o=void 0!==a&&a,i=n.isPopulatePermissions,s=void 0!==i&&i,c=n.isPopulateApps,u=void 0!==c&&c,l=n.isPopulateEnvironments,p=void 0!==l&&l,d=n.isPopulateOperations,g=void 0!==d&&d,v=n.isPopulateGroups,S=void 0!==v&&v,h=n.isPopulateOrganization,f=void 0!==h&&h,I=new URLSearchParams({search:t,isPopulateRoles:String(o),isPopulatePermissions:String(s),isPopulateApps:String(u),isPopulateEnvironments:String(p),isPopulateOperations:String(g),isPopulateGroups:String(S),isPopulateOrganization:String(f)}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,_.get("/api/user/get-by-query-v2?".concat(I.toString()))];case 2:return[2,e.sent().data];case 3:throw w=e.sent(),console.error("Failed to fetch users",w),w;case 4:return[2]}})})},exports.audacyApi=p,exports.createRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=o.useLearningTemplateStore.getState().backwardCompatibility,i=a?r.LEGACY_API_ENDPOINTS.createRuleSet:r.API_ENDPOINTS.createRuleSet,[4,v(n).post(i,t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error creating rule set:",s),s;case 3:return[2]}})})},exports.default=d,exports.deleteQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,i=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),n?(s=r.LEGACY_API_ENDPOINTS.deleteQuestion.replace("{questionId}",t),[4,d.delete(s)]):[3,3];case 2:return[2,e.sent().data];case 3:return s=r.API_ENDPOINTS.deleteQuestion.replace("{questionId}",t).replace("{appIntegrationId}",null!=a?a:""),[4,v(i).delete(s)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error deleting question:",c),c;case 7:return[2]}})})},exports.deleteRule=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,i=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),n?(s=r.LEGACY_API_ENDPOINTS.deleteRule.replace("{ruleId}",t),[4,d.delete(s)]):[3,3];case 2:return[2,e.sent().data];case 3:return s=r.API_ENDPOINTS.deleteRule.replace("{ruleId}",t).replace("{appIntegrationId}",null!=a?a:""),[4,v(i).delete(s)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error deleting rule:",c),c;case 7:return[2]}})})},exports.deleteRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,e.label=1;case 1:return e.trys.push([1,3,,4]),s=void 0,s=a?r.LEGACY_API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t):r.API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t).replace("{appIntegrationId}",null!=i?i:""),[4,v(n).delete(s)];case 2:return[2,e.sent().data];case 3:throw c=e.sent(),console.error("Error deleting rule set:",c),c;case 4:return[2]}})})},exports.deleteTier=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c,u;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?(c=r.LEGACY_API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n),[4,d.delete(c)]):[3,3];case 2:return[2,e.sent().data];case 3:return c=r.API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n).replace("{appIntegrationId}",null!=i?i:""),[4,v(s).delete(c)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error deleting tier:",u),u;case 7:return[2]}})})},exports.exportRuleSet=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)throw new Error("scopeId is required for exporting rule sets");n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,i=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),n?[4,d.post(r.API_ENDPOINTS.exportRuleSet,{scope_id:t},{responseType:"blob"})]:[3,3];case 2:return[2,e.sent().data];case 3:return s=r.API_ENDPOINTS.exportScope.replace("{scopeId}",t).replace("{appIntegrationId}",null!=a?a:""),[4,v(i).get(s,{responseType:"blob"})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error exporting rule set:",c),c;case 7:return[2]}})})},exports.fetchLMSConfig=function(r,n,a){var o,i,s,c,u;return e.__awaiter(this,void 0,void 0,function(){var l,p,d,g;return e.__generator(this,function(_){switch(_.label){case 0:return[4,t.http.get("".concat(r,"/instant_learning/ilotj/application/getValueType/").concat(n),{headers:{Authorization:"Bearer ".concat(a)}})];case 1:return l=_.sent(),!(p=l.data)||Array.isArray(p.data)&&0===p.data.length?[2,{lmsConfig:null,teachMeConfig:null,template:null}]:(d=null===(o=p.data[0])||void 0===o?void 0:o.value_type_config,[2,{lmsConfig:(g=null!==(i=null==d?void 0:d.learningManagement)&&void 0!==i?i:null)?e.__assign(e.__assign({},g),{agents:null!==(s=null==d?void 0:d.agents)&&void 0!==s?s:{}}):null,teachMeConfig:null!==(c=null==d?void 0:d.teachMe)&&void 0!==c?c:null,template:null!==(u=null==d?void 0:d.template)&&void 0!==u?u:null}])}})})},exports.fetchRBACConfig=function(t,n){var a,o;return e.__awaiter(this,void 0,void 0,function(){var i,s;return e.__generator(this,function(e){switch(e.label){case 0:return i=r.API_ENDPOINTS.getRBACConfig.replace("{appIntegrationId}",t),[4,v(n).get(i)];case 1:return s=e.sent(),[2,null!==(o=null===(a=s.data)||void 0===a?void 0:a.data)&&void 0!==o?o:null]}})})},exports.fetchRulesByQuestionId=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c,u;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?(c=r.LEGACY_API_ENDPOINTS.fetchRulesByQuestionId.replace("{questionId}",t).replace("{scopeId}",n),[4,d.get(c)]):[3,3];case 2:return[2,e.sent().data];case 3:return c=r.API_ENDPOINTS.fetchRulesByQuestionId.replace("{appIntegrationId}",null!=i?i:"").replace("{questionId}",t).replace("{scopeId}",n),[4,v(s).get(c)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error fetching rules by question id:",u),u;case 7:return[2]}})})},exports.fetchScopes=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!t&&!1===a)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return i=a?r.LEGACY_API_ENDPOINTS.fetchScopes:"".concat(r.API_ENDPOINTS.fetchScopes,"/").concat(t),[4,v(n).get(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error fetching rule sets:",s),s;case 4:return[2]}})})},exports.fetchStationsByKeyword=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a="".concat(r.API_ENDPOINTS.fetchStationsByKeyword.replace("{keyword}",t),"?allow_existing=").concat(n),[4,p.get(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error fetching station name by keyword:",o),o;case 3:return[2]}})})},exports.fetchTiers=function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,a,s,c,u,l,p;return e.__generator(this,function(e){switch(e.label){case 0:t=o.useLearningTemplateStore.getState().backwardCompatibility,n=o.useLearningTemplateStore.getState().app_integration_id,a=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),t?(s=i.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,[4,v(a).post(r.LEGACY_API_ENDPOINTS.getTiers,{tier_group_name:s})]):[3,3];case 2:return c=e.sent(),o.useLearningTemplateStore.getState().setTiers((null===(l=c.data)||void 0===l?void 0:l.response)||[]),[3,5];case 3:return[4,v(a).get(r.API_ENDPOINTS.getTiers.replace("{appIntegrationId}",null!=n?n:""))];case 4:c=e.sent(),"success"===(null===(p=c.data)||void 0===p?void 0:p.status)&&o.useLearningTemplateStore.getState().setTiers(c.data.data.map(function(e){return{tier_id:e.id,tier_name:e.tier_title,tier_priority:e.tier_priority}})),e.label=5;case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error fetching tiers:",u),u;case 7:return[2]}})})},exports.getILInstance=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,v(n).get("".concat(r.API_ENDPOINTS.getILInstance).concat(t))];case 2:return[2,e.sent().data];case 3:throw a=e.sent(),console.error("Error fetching IL instance:",a),a;case 4:return[2]}})})},exports.getRuleOverrideHistory=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,e.label=1;case 1:return e.trys.push([1,3,,4]),i=n?"".concat(r.LEGACY_API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t):"".concat(r.API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t,"/").concat(null!=a?a:""),[4,d.get(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error getting rule override history:",s),s;case 4:return[2]}})})},exports.getRulesInRuleSetById=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,e.label=1;case 1:return e.trys.push([1,3,,4]),s=a?"".concat(r.LEGACY_API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"?include_config=True&sort_variant_by=createdAt"):"".concat(r.API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"/").concat(null!=i?i:""),console.log("this is endpoint",s),[4,v(n).get(s)];case 2:return[2,e.sent().data];case 3:return c=e.sent(),console.error("Error fetching rules in rule set:",c),[3,4];case 4:return[2]}})})},exports.inheritScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==t?void 0:t.application_mapping_id)?[4,d.post(r.API_ENDPOINTS.inheritScope,t)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 5:return[2]}})})},exports.inheritScopeBackwardCompatible=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.LEGACY_API_ENDPOINTS.inheritScope,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 3:return[2]}})})},exports.llmApiWithToken=v,exports.publishFeedback=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),a=n?r.LEGACY_API_ENDPOINTS.publishFeedback:"".concat(r.API_ENDPOINTS.publishFeedback),[4,d.post(a,t)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error publishing feedback to LLM Studio:",i),i;case 4:return[2]}})})},exports.renameScope=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),i=a?r.LEGACY_API_ENDPOINTS.renameScope:r.API_ENDPOINTS.renameScope,[4,v(n).put(i,t)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error renaming scope:",s),s;case 4:return[2]}})})},exports.requestAccess=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c,u,l,p,g,_,S,h,f;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,c=o.useLearningTemplateStore.getState().ilInstanceId,e.label=1;case 1:return e.trys.push([1,6,,7]),a?(u=window.location.href,l=u.match(/\/mode\/([^/?#]+)/),p=l?l[1]:"",h=void 0,n?h={scope_id:null,access_type:"application",mode_learning_endpoint:p?"mode/".concat(p,"/settings/rules/access-management"):""}:(g=u.indexOf("/mode"),_=-1!==g?u.substring(g+1):(window.location.pathname+window.location.search).substring(1),h={scope_id:t,mode_learning_endpoint:"".concat(_,"&section=access")}),[4,d.post(r.LEGACY_API_ENDPOINTS.requestAccess,h)]):[3,3];case 2:return[2,e.sent().data];case 3:return S="mode/".concat("Instant%20Learning%20Mode","/instant-learning/").concat(c,"/learning-management/").concat(i),h=void 0,h=n?{scope_id:null,application_mapping_id:i,mode_learning_endpoint:"".concat(S,"/access-management")}:{scope_id:t,application_mapping_id:i,mode_learning_endpoint:"".concat(S,"?rulesetid=").concat(t,"&section=access")},[4,v(s).post(r.API_ENDPOINTS.requestAccess,h)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw f=e.sent(),console.error("Error requesting global scope access:",f),f;case 7:return[2]}})})},exports.retrieveGenreScopes=function(t){return void 0===t&&(t={limit:"50",offset:"0"}),e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.retrieveGenreScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error retrieving genre scopes:",n),n;case 3:return[2]}})})},exports.saveInstantLearningQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.saveInstantLearningQuestion,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error saving instant learning question:",n),n;case 3:return[2]}})})},exports.searchScopes=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.searchScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error searching scopes:",n),n;case 3:return[2]}})})},exports.submitChatFeedback=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=n?r.LEGACY_API_ENDPOINTS.submitChatFeedback:r.API_ENDPOINTS.submitChatFeedback,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,d.post(a,t)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error submitting chat feedback:",i),i;case 4:return[2]}})})},exports.toggleVariant=function(t,n,a){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?[4,v(s).patch(r.LEGACY_API_ENDPOINTS.toggleVariant,{variant_ids:t,is_enabled:n})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,v(s).patch(r.API_ENDPOINTS.toggleVariant,{variant_ids:t,application_mapping_id:i,is_enabled:n})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error toggling variant status:",c),c;case 7:return[2]}})})},exports.updateVariant=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.put(r.API_ENDPOINTS.updateVariant,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating variant:",n),n;case 3:return[2]}})})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("../../../api/transport.js"),r=require("./apiConfig.js"),n=require("../store/useAuthStore.js"),a=require("../store/useEnvStore.js"),o=require("../store/useLearningTemplateStore.js"),i=require("../config.js"),s=!1,c=function(e){return e.interceptors.request.use(function(e){var t=n.default.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e.interceptors.response.use(function(e){return e},function(e){var t;return 401===(null===(t=e.response)||void 0===t?void 0:t.status)&&"/login"!==window.location.pathname&&function(){if(!s){s=!0,localStorage.setItem("userActionLogout","true"),n.default.getState().logout();var e=a.default.getState().appsecBaseUrl;window.location.href="".concat(e,"/cross-signout?callback_url=").concat(window.location.origin,"/login")}}(),Promise.reject(e)}),e},u=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},l=function(e){return e.interceptors.request.use(function(e){return e.headers["x-full-url"]=window.location.href,e}),e},p=u(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().audacyBackendUrl||""}),d=u(l(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}}))),function(){return a.default.getState().llmStudioUrl||""}),g=u(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().appsecRbacUrl||""}),_=u(c(t.createAxiosInstance({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().appsecBaseUrl||""}),v=function(e){return u(l(c(t.createAxiosInstance({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0}))),function(){return a.default.getState().llmStudioUrl||""})};function S(e,t,n){var a=r.API_ENDPOINTS.getValueType.replace("{appIntegrationId}",t),o=n?"?config_template_id=".concat(encodeURIComponent(n)):"";return"".concat(e).concat(a).concat(o)}exports.ApproveOrRejectVariants=function(t){var n=t.variant_ids,i=t.status,s=t.feedback,c=t.scopeId,u=t.is_deleted,l=t.appsecData;return e.__awaiter(void 0,void 0,void 0,function(){var t,p,g,_,S,h,f;return e.__generator(this,function(I){switch(I.label){case 0:t=o.useLearningTemplateStore.getState().backwardCompatibility,p=o.useLearningTemplateStore.getState().app_integration_id,g=o.useLearningTemplateStore.getState().token,_=a.default.getState().baseModeName,I.label=1;case 1:return I.trys.push([1,6,,7]),t?(h=r.LEGACY_API_ENDPOINTS.updateVariantStatus.replace("{scopeId}",c),S=e.__assign({variant_ids:n,status:i,feedback:s||"",is_deleted:null!=u&&u},l&&{appsecData:l}),[4,v(g).patch(h,S)]):[3,3];case 2:return[2,I.sent().data];case 3:return S=e.__assign({variant_ids:n,scope_id:c,application_mapping_id:p,status:i,feedback:s||"",is_deleted:null!=u&&u},l&&{appsecData:l}),h=r.API_ENDPOINTS.updateVariantStatus,_&&(h+="?mode_name=".concat(encodeURIComponent(_))),[4,d.put(h,S)];case 4:return[2,I.sent().data];case 5:return[3,7];case 6:throw f=I.sent(),console.log(f),f;case 7:return[2]}})})},exports.GetAppsecRoles=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,g.get("/roles?appId=".concat(t))];case 1:return[2,e.sent().data];case 2:throw r=e.sent(),console.error(r),r;case 3:return[2]}})})},exports.alterQuestionPriority=function(t,n,a,i,s){return e.__awaiter(void 0,void 0,void 0,function(){var c,u,l,p,d,g;return e.__generator(this,function(e){switch(e.label){case 0:c=o.useLearningTemplateStore.getState().backwardCompatibility,u=o.useLearningTemplateStore.getState().app_integration_id,l=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,3,,4]),p=c?r.LEGACY_API_ENDPOINTS.alterRulePriority:r.API_ENDPOINTS.alterRulePriority,d=c?{scopeId:t,tierId:n,move:{movedRuleId:a,prevRuleId:i,nextRuleId:s}}:{scope_id:t,tier_id:n,move:{moved_rule_id:a,prev_rule_id:i,next_rule_id:s},application_mapping_id:u},[4,v(l).put(p,d)];case 2:return[2,e.sent().data];case 3:throw g=e.sent(),console.error("Error altering question priority:",g),g;case 4:return[2]}})})},exports.appsecApi=g,exports.appsecApigetUser=_,exports.appsecGetUserGroups=function(t){return void 0===t&&(t={}),e.__awaiter(void 0,void 0,void 0,function(){var r,n,a,o,i,s,c,u,l,p,d,_,v,S,h,f;return e.__generator(this,function(e){switch(e.label){case 0:r=t.appId,n=void 0===r?"":r,a=t.name,o=void 0===a?"":a,i=t.user,s=void 0===i?"":i,c=t.isActive,u=void 0===c||c,l=t.page,p=void 0===l?1:l,d=t.limit,_=void 0===d?10:d,v=t.pagination,S=void 0===v||v,h=new URLSearchParams({appId:n,name:o,user:s,isActive:String(u),page:String(p),limit:String(_),pagination:String(S)}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,g.get("/groups?".concat(h.toString()))];case 2:return[2,e.sent().data];case 3:throw f=e.sent(),console.error("Failed to fetch user groups",f),f;case 4:return[2]}})})},exports.appsecGetUsersByQueryLite=function(t,r){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,o,i,s,c,u,l,p,d,g,v,S,h,f,I,w;return e.__generator(this,function(e){switch(e.label){case 0:a=(n=r||{}).isPopulateRoles,o=void 0!==a&&a,i=n.isPopulatePermissions,s=void 0!==i&&i,c=n.isPopulateApps,u=void 0!==c&&c,l=n.isPopulateEnvironments,p=void 0!==l&&l,d=n.isPopulateOperations,g=void 0!==d&&d,v=n.isPopulateGroups,S=void 0!==v&&v,h=n.isPopulateOrganization,f=void 0!==h&&h,I=new URLSearchParams({search:t,isPopulateRoles:String(o),isPopulatePermissions:String(s),isPopulateApps:String(u),isPopulateEnvironments:String(p),isPopulateOperations:String(g),isPopulateGroups:String(S),isPopulateOrganization:String(f)}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,_.get("/api/user/get-by-query-v2?".concat(I.toString()))];case 2:return[2,e.sent().data];case 3:throw w=e.sent(),console.error("Failed to fetch users",w),w;case 4:return[2]}})})},exports.audacyApi=p,exports.buildValueTypeUrl=S,exports.createRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=o.useLearningTemplateStore.getState().backwardCompatibility,i=a?r.LEGACY_API_ENDPOINTS.createRuleSet:r.API_ENDPOINTS.createRuleSet,[4,v(n).post(i,t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error creating rule set:",s),s;case 3:return[2]}})})},exports.default=d,exports.deleteQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,i=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),n?(s=r.LEGACY_API_ENDPOINTS.deleteQuestion.replace("{questionId}",t),[4,d.delete(s)]):[3,3];case 2:return[2,e.sent().data];case 3:return s=r.API_ENDPOINTS.deleteQuestion.replace("{questionId}",t).replace("{appIntegrationId}",null!=a?a:""),[4,v(i).delete(s)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error deleting question:",c),c;case 7:return[2]}})})},exports.deleteRule=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,i=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),n?(s=r.LEGACY_API_ENDPOINTS.deleteRule.replace("{ruleId}",t),[4,d.delete(s)]):[3,3];case 2:return[2,e.sent().data];case 3:return s=r.API_ENDPOINTS.deleteRule.replace("{ruleId}",t).replace("{appIntegrationId}",null!=a?a:""),[4,v(i).delete(s)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error deleting rule:",c),c;case 7:return[2]}})})},exports.deleteRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,e.label=1;case 1:return e.trys.push([1,3,,4]),s=void 0,s=a?r.LEGACY_API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t):r.API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t).replace("{appIntegrationId}",null!=i?i:""),[4,v(n).delete(s)];case 2:return[2,e.sent().data];case 3:throw c=e.sent(),console.error("Error deleting rule set:",c),c;case 4:return[2]}})})},exports.deleteTier=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c,u;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?(c=r.LEGACY_API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n),[4,d.delete(c)]):[3,3];case 2:return[2,e.sent().data];case 3:return c=r.API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n).replace("{appIntegrationId}",null!=i?i:""),[4,v(s).delete(c)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error deleting tier:",u),u;case 7:return[2]}})})},exports.exportRuleSet=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)throw new Error("scopeId is required for exporting rule sets");n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,i=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),n?[4,d.post(r.API_ENDPOINTS.exportRuleSet,{scope_id:t},{responseType:"blob"})]:[3,3];case 2:return[2,e.sent().data];case 3:return s=r.API_ENDPOINTS.exportScope.replace("{scopeId}",t).replace("{appIntegrationId}",null!=a?a:""),[4,v(i).get(s,{responseType:"blob"})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error exporting rule set:",c),c;case 7:return[2]}})})},exports.fetchLMSConfig=function(r,n,a,o){var i,s,c,u,l;return e.__awaiter(this,void 0,void 0,function(){var p,d,g,_;return e.__generator(this,function(v){switch(v.label){case 0:return[4,t.http.get(S(r,n,o),{headers:{Authorization:"Bearer ".concat(a)}})];case 1:return p=v.sent(),!(d=p.data)||Array.isArray(d.data)&&0===d.data.length?[2,{lmsConfig:null,teachMeConfig:null,template:null}]:(g=null===(i=d.data[0])||void 0===i?void 0:i.value_type_config,[2,{lmsConfig:(_=null!==(s=null==g?void 0:g.learningManagement)&&void 0!==s?s:null)?e.__assign(e.__assign({},_),{agents:null!==(c=null==g?void 0:g.agents)&&void 0!==c?c:{}}):null,teachMeConfig:null!==(u=null==g?void 0:g.teachMe)&&void 0!==u?u:null,template:null!==(l=null==g?void 0:g.template)&&void 0!==l?l:null}])}})})},exports.fetchRBACConfig=function(t,n){var a,o;return e.__awaiter(this,void 0,void 0,function(){var i,s;return e.__generator(this,function(e){switch(e.label){case 0:return i=r.API_ENDPOINTS.getRBACConfig.replace("{appIntegrationId}",t),[4,v(n).get(i)];case 1:return s=e.sent(),[2,null!==(o=null===(a=s.data)||void 0===a?void 0:a.data)&&void 0!==o?o:null]}})})},exports.fetchRulesByQuestionId=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c,u;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?(c=r.LEGACY_API_ENDPOINTS.fetchRulesByQuestionId.replace("{questionId}",t).replace("{scopeId}",n),[4,d.get(c)]):[3,3];case 2:return[2,e.sent().data];case 3:return c=r.API_ENDPOINTS.fetchRulesByQuestionId.replace("{appIntegrationId}",null!=i?i:"").replace("{questionId}",t).replace("{scopeId}",n),[4,v(s).get(c)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error fetching rules by question id:",u),u;case 7:return[2]}})})},exports.fetchScopes=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!t&&!1===a)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return i=a?r.LEGACY_API_ENDPOINTS.fetchScopes:"".concat(r.API_ENDPOINTS.fetchScopes,"/").concat(t),[4,v(n).get(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error fetching rule sets:",s),s;case 4:return[2]}})})},exports.fetchStationsByKeyword=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a="".concat(r.API_ENDPOINTS.fetchStationsByKeyword.replace("{keyword}",t),"?allow_existing=").concat(n),[4,p.get(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error fetching station name by keyword:",o),o;case 3:return[2]}})})},exports.fetchTiers=function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,a,s,c,u,l,p;return e.__generator(this,function(e){switch(e.label){case 0:t=o.useLearningTemplateStore.getState().backwardCompatibility,n=o.useLearningTemplateStore.getState().app_integration_id,a=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),t?(s=i.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,[4,v(a).post(r.LEGACY_API_ENDPOINTS.getTiers,{tier_group_name:s})]):[3,3];case 2:return c=e.sent(),o.useLearningTemplateStore.getState().setTiers((null===(l=c.data)||void 0===l?void 0:l.response)||[]),[3,5];case 3:return[4,v(a).get(r.API_ENDPOINTS.getTiers.replace("{appIntegrationId}",null!=n?n:""))];case 4:c=e.sent(),"success"===(null===(p=c.data)||void 0===p?void 0:p.status)&&o.useLearningTemplateStore.getState().setTiers(c.data.data.map(function(e){return{tier_id:e.id,tier_name:e.tier_title,tier_priority:e.tier_priority}})),e.label=5;case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error fetching tiers:",u),u;case 7:return[2]}})})},exports.getILInstance=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,v(n).get("".concat(r.API_ENDPOINTS.getILInstance).concat(t))];case 2:return[2,e.sent().data];case 3:throw a=e.sent(),console.error("Error fetching IL instance:",a),a;case 4:return[2]}})})},exports.getRuleOverrideHistory=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=o.useLearningTemplateStore.getState().app_integration_id,e.label=1;case 1:return e.trys.push([1,3,,4]),i=n?"".concat(r.LEGACY_API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t):"".concat(r.API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t,"/").concat(null!=a?a:""),[4,d.get(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error getting rule override history:",s),s;case 4:return[2]}})})},exports.getRulesInRuleSetById=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,e.label=1;case 1:return e.trys.push([1,3,,4]),s=a?"".concat(r.LEGACY_API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"?include_config=True&sort_variant_by=createdAt"):"".concat(r.API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"/").concat(null!=i?i:""),console.log("this is endpoint",s),[4,v(n).get(s)];case 2:return[2,e.sent().data];case 3:return c=e.sent(),console.error("Error fetching rules in rule set:",c),[3,4];case 4:return[2]}})})},exports.inheritScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==t?void 0:t.application_mapping_id)?[4,d.post(r.API_ENDPOINTS.inheritScope,t)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 5:return[2]}})})},exports.inheritScopeBackwardCompatible=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.LEGACY_API_ENDPOINTS.inheritScope,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 3:return[2]}})})},exports.llmApiWithToken=v,exports.publishFeedback=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),a=n?r.LEGACY_API_ENDPOINTS.publishFeedback:"".concat(r.API_ENDPOINTS.publishFeedback),[4,d.post(a,t)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error publishing feedback to LLM Studio:",i),i;case 4:return[2]}})})},exports.renameScope=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),i=a?r.LEGACY_API_ENDPOINTS.renameScope:r.API_ENDPOINTS.renameScope,[4,v(n).put(i,t)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error renaming scope:",s),s;case 4:return[2]}})})},exports.requestAccess=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c,u,l,p,g,_,S,h,f;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,c=o.useLearningTemplateStore.getState().ilInstanceId,e.label=1;case 1:return e.trys.push([1,6,,7]),a?(u=window.location.href,l=u.match(/\/mode\/([^/?#]+)/),p=l?l[1]:"",h=void 0,n?h={scope_id:null,access_type:"application",mode_learning_endpoint:p?"mode/".concat(p,"/settings/rules/access-management"):""}:(g=u.indexOf("/mode"),_=-1!==g?u.substring(g+1):(window.location.pathname+window.location.search).substring(1),h={scope_id:t,mode_learning_endpoint:"".concat(_,"&section=access")}),[4,d.post(r.LEGACY_API_ENDPOINTS.requestAccess,h)]):[3,3];case 2:return[2,e.sent().data];case 3:return S="mode/".concat("Instant%20Learning%20Mode","/instant-learning/").concat(c,"/learning-management/").concat(i),h=void 0,h=n?{scope_id:null,application_mapping_id:i,mode_learning_endpoint:"".concat(S,"/access-management")}:{scope_id:t,application_mapping_id:i,mode_learning_endpoint:"".concat(S,"?rulesetid=").concat(t,"&section=access")},[4,v(s).post(r.API_ENDPOINTS.requestAccess,h)];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw f=e.sent(),console.error("Error requesting global scope access:",f),f;case 7:return[2]}})})},exports.retrieveGenreScopes=function(t){return void 0===t&&(t={limit:"50",offset:"0"}),e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.retrieveGenreScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error retrieving genre scopes:",n),n;case 3:return[2]}})})},exports.saveInstantLearningQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.saveInstantLearningQuestion,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error saving instant learning question:",n),n;case 3:return[2]}})})},exports.searchScopes=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.searchScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error searching scopes:",n),n;case 3:return[2]}})})},exports.submitChatFeedback=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,a=n?r.LEGACY_API_ENDPOINTS.submitChatFeedback:r.API_ENDPOINTS.submitChatFeedback,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,d.post(a,t)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error submitting chat feedback:",i),i;case 4:return[2]}})})},exports.toggleVariant=function(t,n,a){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,c;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?[4,v(s).patch(r.LEGACY_API_ENDPOINTS.toggleVariant,{variant_ids:t,is_enabled:n})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,v(s).patch(r.API_ENDPOINTS.toggleVariant,{variant_ids:t,application_mapping_id:i,is_enabled:n})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error toggling variant status:",c),c;case 7:return[2]}})})},exports.updateVariant=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.put(r.API_ENDPOINTS.updateVariant,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating variant:",n),n;case 3:return[2]}})})};
2
2
  //# sourceMappingURL=scopeApis.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("lucide-react"),n=function(t){var n=t.width,s=void 0===n?"100%":n,r=t.height,x=void 0===r?"10px":r,o=t.style;return e.jsx("div",{style:i.__assign({width:s,height:x,backgroundColor:"#E2E8F0",borderRadius:"4px",backgroundImage:"linear-gradient(90deg, #E2E8F0 0px, #F1F5F9 40px, #E2E8F0 80px)",backgroundSize:"200px 100%",animation:"shimmer 1.5s ease-in-out infinite"},o)})},s=function(){return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px",padding:"24px",backgroundColor:"#fff",borderRadius:"12px",border:"1px solid #E2E8F0",width:"100%"}},{children:[e.jsx(n,{width:"100%",height:"12px"}),e.jsx(n,{width:"85%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"60%",height:"12px"}),e.jsx(n,{width:"90%",height:"10px"}),e.jsx(n,{width:"75%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"40%",height:"12px"}),e.jsx(n,{width:"100%",height:"10px"}),e.jsx(n,{width:"80%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"55%",height:"12px"}),e.jsx(n,{width:"95%",height:"10px"}),e.jsx(n,{width:"70%",height:"10px"}),e.jsx(n,{width:"45%",height:"12px"}),e.jsx(n,{width:"88%",height:"10px"})]}))};exports.default=function(n){return n.isLoading?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes shimmer {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n }\n"}),e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:99}}),e.jsxs("div",i.__assign({style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",borderRadius:"16px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",padding:"48px",maxWidth:"1000px",width:"70%",maxHeight:"90vh",display:"flex",flexDirection:"row",gap:"48px",zIndex:100,animation:"fadeIn 0.3s ease-out"}},{children:[e.jsxs("div",i.__assign({style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[e.jsx("div",i.__assign({style:{marginBottom:"16px"}},{children:e.jsx(t.Sparkles,{size:32,color:"#7C3AED"})})),e.jsx("h2",i.__assign({style:{fontSize:"1.5rem",fontWeight:600,color:"#0F172A",margin:"0 0 8px 0"}},{children:"Setting up your scope…"})),e.jsx("p",i.__assign({style:{fontSize:"0.875rem",color:"#64748B",margin:"0",lineHeight:"1.5"}},{children:"Inheriting Learnings from Global. This will only take a moment."}))]})),e.jsx("div",i.__assign({style:{flex:1.5,display:"flex",alignItems:"center",justifyContent:"center",minWidth:"350px"}},{children:e.jsx(s,{})}))]})),e.jsx("style",{children:"\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n "})]}):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),t=require("lucide-react"),n=function(t){var n=t.width,s=void 0===n?"100%":n,r=t.height,x=void 0===r?"10px":r,o=t.style;return e.jsx("div",{style:i.__assign({width:s,height:x,backgroundColor:"#E2E8F0",borderRadius:"4px",backgroundImage:"linear-gradient(90deg, #E2E8F0 0px, #F1F5F9 40px, #E2E8F0 80px)",backgroundSize:"200px 100%",animation:"shimmer 1.5s ease-in-out infinite"},o)})},s=function(){return e.jsxs("div",i.__assign({style:{display:"flex",flexDirection:"column",gap:"12px",padding:"24px",backgroundColor:"#fff",borderRadius:"12px",border:"1px solid #E2E8F0",width:"100%"}},{children:[e.jsx(n,{width:"100%",height:"12px"}),e.jsx(n,{width:"85%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"60%",height:"12px"}),e.jsx(n,{width:"90%",height:"10px"}),e.jsx(n,{width:"75%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"40%",height:"12px"}),e.jsx(n,{width:"100%",height:"10px"}),e.jsx(n,{width:"80%",height:"10px"}),e.jsx("div",{style:{height:"8px"}}),e.jsx(n,{width:"55%",height:"12px"}),e.jsx(n,{width:"95%",height:"10px"}),e.jsx(n,{width:"70%",height:"10px"}),e.jsx(n,{width:"45%",height:"12px"}),e.jsx(n,{width:"88%",height:"10px"})]}))};exports.default=function(n){var r=n.isLoading,x=n.title,o=n.subtitle;return r?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes shimmer {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n }\n"}),e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:99}}),e.jsxs("div",i.__assign({style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",borderRadius:"16px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",padding:"48px",maxWidth:"1000px",width:"70%",maxHeight:"90vh",display:"flex",flexDirection:"row",gap:"48px",zIndex:100,animation:"fadeIn 0.3s ease-out"}},{children:[e.jsxs("div",i.__assign({style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:[e.jsx("div",i.__assign({style:{marginBottom:"16px"}},{children:e.jsx(t.Sparkles,{size:32,color:"#7C3AED"})})),e.jsx("h2",i.__assign({style:{fontSize:"1.5rem",fontWeight:600,color:"#0F172A",margin:"0 0 8px 0"}},{children:null!=x?x:"Setting up your scope…"})),e.jsx("p",i.__assign({style:{fontSize:"0.875rem",color:"#64748B",margin:"0",lineHeight:"1.5"}},{children:null!=o?o:"Inheriting Learnings from Global. This will only take a moment."}))]})),e.jsx("div",i.__assign({style:{flex:1.5,display:"flex",alignItems:"center",justifyContent:"center",minWidth:"350px"}},{children:e.jsx(s,{})}))]})),e.jsx("style",{children:"\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translate(-50%, -48%);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%);\n }\n }\n "})]}):null};
2
2
  //# sourceMappingURL=ScopeSkeletonLoader.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@tanstack/react-query"),t=require("../store/useAuthStore.js"),n=require("../store/useEnvStore.js"),o=require("../apis/scopeApis.js"),i=require("../store/useLMSConfigStore.js"),u=require("../store/useLearningTemplateStore.js");exports.useLMSConfigQuery=function(s,a,l){var c=this;void 0===l&&(l=!0);var f=t.default(function(e){var r,t;return null!==(t=null===(r=e.user)||void 0===r?void 0:r.accessToken)&&void 0!==t?t:""}),g=n.default(function(e){var r;return null!==(r=e.llmStudioUrl)&&void 0!==r?r:""}),v=i.useLMSConfigStore(function(e){return e.setLMSConfig}),d=i.useTeachMeConfigStore(function(e){return e.setTeachMeConfig}),C=u.useLearningTemplateStore(function(e){return e.setTemplateData});return r.useQuery({queryKey:["lms-config",s],queryFn:function(){return e.__awaiter(c,void 0,void 0,function(){var r,t,n,i;return e.__generator(this,function(e){switch(e.label){case 0:return[4,o.fetchLMSConfig(g,s,f)];case 1:return r=e.sent(),t=r.lmsConfig,n=r.teachMeConfig,i=r.template,console.log("Fetched LMS Config:",{lmsConfig:t,teachMeConfig:n,template:i}),t&&v(t),n&&d(n),i&&C(s,i),[2,{lmsConfig:t,teachMeConfig:n,template:i}]}})})},enabled:l&&!!s&&!!f&&!!g&&!a,staleTime:6e5})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@tanstack/react-query"),t=require("../store/useAuthStore.js"),n=require("../store/useEnvStore.js"),o=require("../apis/scopeApis.js"),u=require("../store/useLMSConfigStore.js"),i=require("../store/useLearningTemplateStore.js");exports.useLMSConfigQuery=function(s,a,l,c){var f=this;void 0===l&&(l=!0);var g=t.default(function(e){var r,t;return null!==(t=null===(r=e.user)||void 0===r?void 0:r.accessToken)&&void 0!==t?t:""}),v=n.default(function(e){var r;return null!==(r=e.llmStudioUrl)&&void 0!==r?r:""}),d=u.useLMSConfigStore(function(e){return e.setLMSConfig}),C=u.useTeachMeConfigStore(function(e){return e.setTeachMeConfig}),S=i.useLearningTemplateStore(function(e){return e.setTemplateData});return r.useQuery({queryKey:["lms-config",s,null!=c?c:null],queryFn:function(){return e.__awaiter(f,void 0,void 0,function(){var r,t,n,u;return e.__generator(this,function(e){switch(e.label){case 0:return[4,o.fetchLMSConfig(v,s,g,c)];case 1:return r=e.sent(),t=r.lmsConfig,n=r.teachMeConfig,u=r.template,console.log("Fetched LMS Config:",{lmsConfig:t,teachMeConfig:n,template:u}),t&&d(t),n&&C(n),u&&S(s,u),[2,{lmsConfig:t,teachMeConfig:n,template:u}]}})})},enabled:l&&!!s&&!!g&&!!v&&!a,staleTime:6e5})};
2
2
  //# sourceMappingURL=useLMSConfigQuery.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zustand"),t=require("./useLearningTemplateStore.js"),n={pageTitle:"",middleDrawer:{scope:"",addScope:"",addSubScope:"",addScopeDialog:{title:"",globalTitle:"",subtitle:"",globalSubtitle:"",scopeName:"",learningApprovalSettings:{title:"",approvalRequired:{title:"",subtitle:""},publishWithoutApproval:{title:"",subtitle:""}},submitButton:"",cancel:""},treeMenu:{search:"",submenu:{learnings:"",access:"",changeHistory:""},contextMenu:{addScope:"",rename:"",delete:"",addSubScope:""}},scopeDisplayLimit:{enabled:"",count:"",compactView:"false",applyToLevels:"",viewMoreText:"",title:"",description:"",searchPlaceholder:"",onboardBtn:"",viewText:""}},learnings:{header:{title:"",exportButton:"",addNewLearningButton:""},tier:{showTierHeader:!0,tierHeader:"",subtitle:"",tierHeaderNoOfLearnings:"",deleteDialog:{title:"",description:"",cancel:"",submit:""},learning:{inheritance:"",actions:{disable:"",enable:"",approve:"",reject:"",delete:""},approveDialog:{title:"",desc:"",footer:"",cancel:"",approveLearning:""},rejectDialog:{title:"",desc:"",feedbackTitle:"",feedbackPlaceholder:"",deleteCheckboxLabel:"",cancel:"",rejectLearning:""},deleteDialog:{title:"",desc:"",warningText:"",cancelText:"",deleteText:""}}}},emptyStateLearning:{title:"",desc:"",createNewLearning:"",createGlobalScope:"",noAccessTitle:"",noAccessDesc:"",requestAccessButton:"",requestSentButton:""},agents:{LearningTerm:""},externalWorkflowMetaData:{enableExternalWorkflow:!0,current_mode:"",sub_mode:"",next_mode:"",externalWorkflowModal:{heading:"",options:{saveDraft:{title:"",desc:"",footerDesc:""},configureNow:{title:"",desc:"",footerDesc:""}}}}},a={showScope:!1,showConfiguration:!1,variantFlow:!0,welcomeMessage:"Hi! 👋 I'm your Instant Learning Concierge.",welcomeMessageSubtitle:"How would you like to get started? You can select an option below or describe the rule you'd like to create.",actions:[{label:"Separation rule",value:"I would want to add a separation rule"},{label:"Max priority rule",value:"I would want to set a max priority rule"},{label:"Break code matching",value:"I would want to add a break code matching rule"},{label:"Inventory code matching",value:"I would want to add a inventory window matching rule"},{label:"Enter a rule description",value:"I want to add a rule description"},{label:"Tester Genie",value:"Loading prompt..."}],chatTitle:"Teach Me OTJ - {scope} - Add Learning",chatTitleEdit:"Teach Me OTJ - {scope} - Edit Learning",formTitle:"Rule setup",setupLabel:"Configure your IL",ruleTitle:"Main Rule Name",scopeLabel:"Define Scope",tierLabel:"Select Tiers",ruleDescriptionTitle:"Learning Explanation",whenToApplyTitle:"Trigger Events (When to Apply)",addWhenToApplyBtnLabel:"Add WTA",whenNotToApplyTitle:"Exclusion Events (When NOT to Apply)",addWhenNotToApplyBtnLabel:"Add WNTA",configTitle:"Advanced Settings",saveBtnLabel:"Save Rule",saveBtnLoadingLabel:"Saving Rule...",chatTextareaPlaceholder:"Tell me more about this learning.."},o=e.create(function(e){return{lmsConfig:n,setLMSConfig:function(t){return e({lmsConfig:t})},clearLMSConfig:function(){return e({lmsConfig:n})}}});var l=e.create(function(e){return{teachMeConfig:null,setTeachMeConfig:function(t){return e({teachMeConfig:t})},clearTeachMeConfig:function(){return e({teachMeConfig:null})}}});exports.defaultLMSConfig=n,exports.defaultTeachMeConfig=a,exports.dt=function(e,n,a){if(t.useLearningTemplateStore.getState().backwardCompatibility)return null!=n?n:"";var l=o.getState().lmsConfig,i=e.split(".").reduce(function(e,t){return null==e?void 0:e[t]},l);return"string"!=typeof i||""===i?null!=n?n:e:i.replace(/\{(\w+)\}/g,function(e,t){var n;return String(null!==(n=null==a?void 0:a[t])&&void 0!==n?n:"{".concat(t,"}"))})},exports.dtt=function(e,t,n){var a=l.getState().teachMeConfig,o=e.split(".").reduce(function(e,t){return null==e?void 0:e[t]},a);return"string"!=typeof o?null!=t?t:e:o.replace(/\{(\w+)\}/g,function(e,t){var a;return String(null!==(a=null==n?void 0:n[t])&&void 0!==a?a:"{".concat(t,"}"))})},exports.dttWelcomeMessageParts=function(){var e,t,n=null!==(e=l.getState().teachMeConfig)&&void 0!==e?e:a;return{greeting:n.welcomeMessage||a.welcomeMessage,subtitle:n.welcomeMessageSubtitle||a.welcomeMessageSubtitle,actions:(null===(t=n.actions)||void 0===t?void 0:t.length)?n.actions:a.actions}},exports.interpolate=function(e,t){return e.replace(/\{(\w+)\}/g,function(e,n){var a;return String(null!==(a=null==t?void 0:t[n])&&void 0!==a?a:"{".concat(n,"}"))})},exports.useLMSConfigStore=o,exports.useTeachMeConfigStore=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zustand"),t=require("./useLearningTemplateStore.js"),n={pageTitle:"",middleDrawer:{scope:"",addScope:"",addSubScope:"",addScopeDialog:{title:"",globalTitle:"",subScopeTitle:"",subtitle:"",globalSubtitle:"",subScopeSubtitle:"",scopeName:"",subScopeName:"",learningApprovalSettings:{title:"",approvalRequired:{title:"",subtitle:""},publishWithoutApproval:{title:"",subtitle:""}},submitButton:"",cancel:""},treeMenu:{search:"",submenu:{learnings:"",access:"",changeHistory:""},contextMenu:{addScope:"",rename:"",delete:"",addSubScope:""}},scopeDisplayLimit:{enabled:"",count:"",compactView:"false",applyToLevels:"",viewMoreText:"",title:"",description:"",searchPlaceholder:"",onboardBtn:"",viewText:""}},learnings:{header:{title:"",exportButton:"",addNewLearningButton:""},tier:{showTierHeader:!0,tierHeader:"",subtitle:"",tierHeaderNoOfLearnings:"",deleteDialog:{title:"",description:"",cancel:"",submit:""},learning:{inheritance:"",actions:{disable:"",enable:"",approve:"",reject:"",delete:""},approveDialog:{title:"",desc:"",footer:"",cancel:"",approveLearning:""},rejectDialog:{title:"",desc:"",feedbackTitle:"",feedbackPlaceholder:"",deleteCheckboxLabel:"",cancel:"",rejectLearning:""},deleteDialog:{title:"",desc:"",warningText:"",cancelText:"",deleteText:""}}}},emptyStateLearning:{title:"",desc:"",createNewLearning:"",createGlobalScope:"",noAccessTitle:"",noAccessDesc:"",requestAccessButton:"",requestSentButton:""},agents:{LearningTerm:""},externalWorkflowMetaData:{enableExternalWorkflow:!0,current_mode:"",sub_mode:"",next_mode:"",externalWorkflowModal:{heading:"",options:{saveDraft:{title:"",desc:"",footerDesc:""},configureNow:{title:"",desc:"",footerDesc:""}}}}},a={showScope:!1,showConfiguration:!1,variantFlow:!0,welcomeMessage:"Hi! 👋 I'm your Instant Learning Concierge.",welcomeMessageSubtitle:"How would you like to get started? You can select an option below or describe the rule you'd like to create.",actions:[{label:"Separation rule",value:"I would want to add a separation rule"},{label:"Max priority rule",value:"I would want to set a max priority rule"},{label:"Break code matching",value:"I would want to add a break code matching rule"},{label:"Inventory code matching",value:"I would want to add a inventory window matching rule"},{label:"Enter a rule description",value:"I want to add a rule description"},{label:"Tester Genie",value:"Loading prompt..."}],chatTitle:"Teach Me OTJ - {scope} - Add Learning",chatTitleEdit:"Teach Me OTJ - {scope} - Edit Learning",formTitle:"Rule setup",setupLabel:"Configure your IL",ruleTitle:"Main Rule Name",scopeLabel:"Define Scope",tierLabel:"Select Tiers",ruleDescriptionTitle:"Learning Explanation",whenToApplyTitle:"Trigger Events (When to Apply)",addWhenToApplyBtnLabel:"Add WTA",whenNotToApplyTitle:"Exclusion Events (When NOT to Apply)",addWhenNotToApplyBtnLabel:"Add WNTA",configTitle:"Advanced Settings",saveBtnLabel:"Save Rule",saveBtnLoadingLabel:"Saving Rule...",chatTextareaPlaceholder:"Tell me more about this learning.."},o=e.create(function(e){return{lmsConfig:n,setLMSConfig:function(t){return e({lmsConfig:t})},clearLMSConfig:function(){return e({lmsConfig:n})}}});var l=e.create(function(e){return{teachMeConfig:null,setTeachMeConfig:function(t){return e({teachMeConfig:t})},clearTeachMeConfig:function(){return e({teachMeConfig:null})}}});exports.defaultLMSConfig=n,exports.defaultTeachMeConfig=a,exports.dt=function(e,n,a){if(t.useLearningTemplateStore.getState().backwardCompatibility)return null!=n?n:"";var l=o.getState().lmsConfig,i=e.split(".").reduce(function(e,t){return null==e?void 0:e[t]},l);return"string"!=typeof i||""===i?null!=n?n:e:i.replace(/\{(\w+)\}/g,function(e,t){var n;return String(null!==(n=null==a?void 0:a[t])&&void 0!==n?n:"{".concat(t,"}"))})},exports.dtt=function(e,t,n){var a=l.getState().teachMeConfig,o=e.split(".").reduce(function(e,t){return null==e?void 0:e[t]},a);return"string"!=typeof o?null!=t?t:e:o.replace(/\{(\w+)\}/g,function(e,t){var a;return String(null!==(a=null==n?void 0:n[t])&&void 0!==a?a:"{".concat(t,"}"))})},exports.dttWelcomeMessageParts=function(){var e,t,n=null!==(e=l.getState().teachMeConfig)&&void 0!==e?e:a;return{greeting:n.welcomeMessage||a.welcomeMessage,subtitle:n.welcomeMessageSubtitle||a.welcomeMessageSubtitle,actions:(null===(t=n.actions)||void 0===t?void 0:t.length)?n.actions:a.actions}},exports.interpolate=function(e,t){return e.replace(/\{(\w+)\}/g,function(e,n){var a;return String(null!==(a=null==t?void 0:t[n])&&void 0!==a?a:"{".concat(n,"}"))})},exports.useLMSConfigStore=o,exports.useTeachMeConfigStore=l;
2
2
  //# sourceMappingURL=useLMSConfigStore.js.map
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/InstantLearning/InstantLearning.js"),t=require("./features/WtaWnta/WtaWnta.js"),r=require("./features/DocumentLearning/DocumentLearning.js"),i=require("./features/IL-OTJ/ILOTJ.js"),n=require("./features/IL-OTJ/_components/atoms/Button/Button.js"),a=require("./features/IL-OTJ/_components/atoms/Dropdown/Dropdown.js"),s=require("./features/IL-OTJ/_components/atoms/Toggle/Toggle.js"),o=require("./features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),u=require("./features/IL-OTJ/_components/molecules/Condition/ConditionList.js"),p=require("./features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js"),l=require("./features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.js"),d=require("./features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js"),c=require("./features/IL-OTJ/_components/organisms/TextSection/TextSection.js"),m=require("./features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js"),x=require("./features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js"),L=require("./features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.js"),g=require("./features/IL-OTJ/_components/templates/Testing/Testing.js"),G=require("./features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js"),I=require("./features/IL-OTJ/helpers/utils.js"),T=require("./features/IL-OTJ/store/CitationsContext.js"),f=require("./features/IL-OTJ/ILOTJTest.js"),C=require("./features/LearningManagement/LearningManagement.js"),j=require("./ILMarketplaceWrapper.js"),q=require("./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js");require("./features/LearningManagement/LearningManagementTest.js");var S=require("./api/transport.js"),k=require("./ContinueWithTemplateModal.js"),D=require("./features/IL-marketplace/components/GuidelineCart.js"),_=require("./features/IL-marketplace/components/GuidelineCartHeader.js"),A=require("./features/IL-marketplace/components/GuidelineCartItem.js"),W=require("./features/IL-marketplace/components/GuidelineEmptyState.js"),O=require("./features/IL-marketplace/components/GuidelineHeader.js"),M=require("./features/IL-marketplace/components/GuidelineIconButton.js"),E=require("./features/IL-marketplace/components/GuidelineLandingPage.js"),P=require("./features/IL-marketplace/components/GuidelineFilterPanel.js"),y=require("./features/IL-marketplace/components/GuidelineLibrary.js"),F=require("./features/IL-marketplace/components/GuidelineLibraryCard.js"),B=require("./features/IL-marketplace/components/LearningManagementWrapper.js"),J=require("./features/IL-marketplace/components/GuidelineProceedButton.js"),b=require("./features/IL-marketplace/components/GuidelineSelectButton.js"),h=require("./features/IL-marketplace/components/GuidelineCardMenu.js"),v=require("./features/IL-marketplace/components/GuidelineConfirmDialog.js"),R=require("./features/IL-marketplace/hooks/useGuidelineSelection.js"),w=require("./features/IL-marketplace/constants.js"),V=require("./features/IL-marketplace/utils.js"),H=require("./features/IL-marketplace/workspace/workspace.runtime.js"),U=require("./features/IL-marketplace/workspace/useGuidelineWorkspace.js"),N=require("./features/IL-marketplace/services/guideline.session.js"),K=require("./features/IL-marketplace/services/instant-learning.api.js"),Q=require("./features/IL-marketplace/utils/guidelineOverlay.js"),Y=require("./features/IL-marketplace/utils/guidelineFiles.js"),z=require("./features/IL-marketplace/services/guideline.cart.api.js"),X=require("./features/IL-marketplace/queryClient.js");exports.InstantLearning=e.default,exports.WtaWnta=t.default,exports.BookLearning=r.default,exports.ILOTJ=i.default,exports.Button=n.Button,exports.Dropdown=a.Dropdown,exports.Toggle=s.Toggle,exports.Textarea=o.Textarea,exports.ConditionList=u.ConditionList,exports.SectionWrapper=p.SectionWrapper,exports.SeparationRow=l.SeparationRow,exports.ConfigSection=d.ConfigSection,exports.TextSection=c.TextSection,exports.ScopeSection=m.ScopeSection,exports.ConditionSection=x.ConditionSection,exports.TrafficManagerTemplate=L.TrafficManagerTemplate,exports.Testing=g.Testing,Object.defineProperty(exports,"TemplateList",{enumerable:!0,get:function(){return G.TemplateList}}),exports.TemplateMap=G.TemplateMap,exports.extractAndParseResponse=I.extractAndParseResponse,exports.extractAndParseWithProperty=I.extractAndParseWithProperty,exports.extractTextFromChildren=I.extractTextFromChildren,exports.extractVariantIds=I.extractVariantIds,exports.parseValidationData=I.parseValidationData,exports.useHeaderObserver=I.useHeaderObserver,exports.CitationProvider=T.CitationProvider,exports.useCitations=T.useCitations,exports.dummyDat=f.dummyDat,exports.getVariantInfo=f.getVariantInfo,exports.LearningManagement=C.default,exports.ILMarketplaceWrapper=j.default,exports.IL_MARKETPLACE_TAB_ID=j.IL_MARKETPLACE_TAB_ID,exports.MY_KNOWLEDGE_BASES_TAB_ID=j.MY_KNOWLEDGE_BASES_TAB_ID,exports.SAVED_TAB_ID=j.SAVED_TAB_ID,exports.TeachMePlugin=q.default,exports.TemplateRegistry=q.TemplateRegistry,exports.setApiDebug=S.setApiDebug,exports.ContinueWithTemplateModal=k.default,exports.GuidelineCart=D.GuidelineCart,exports.GuidelineCartHeader=_.GuidelineCartHeader,exports.GuidelineCartItem=A.GuidelineCartItem,exports.GuidelineEmptyState=W.GuidelineEmptyState,exports.GuidelineHeader=O.GuidelineHeader,exports.GuidelineIconButton=M.GuidelineIconButton,exports.GuidelineLandingPage=E.GuidelineLandingPage,exports.GuidelineFilterPanel=P.GuidelineFilterPanel,exports.GuidelineLibrary=y.GuidelineLibrary,exports.GuidelineLibraryCard=F.GuidelineLibraryCard,exports.LearningManagementWrapper=B.LearningManagementWrapper,exports.GuidelineProceedButton=J.GuidelineProceedButton,exports.GuidelineSelectButton=b.GuidelineSelectButton,exports.GuidelineCardMenu=h.GuidelineCardMenu,exports.createGuidelineCardMenuItems=h.createGuidelineCardMenuItems,exports.GuidelineConfirmDialog=v.GuidelineConfirmDialog,exports.useGuidelineSelection=R.useGuidelineSelection,exports.DEFAULT_GUIDELINE_ARTIFACT_TEMPLATE=w.DEFAULT_GUIDELINE_ARTIFACT_TEMPLATE,exports.DEFAULT_GUIDELINE_LABELS=w.DEFAULT_GUIDELINE_LABELS,exports.createGuidelineId=V.createGuidelineId,exports.cx=V.cx,exports.defaultFormatAddedOnLabel=V.defaultFormatAddedOnLabel,exports.getAppIntegrationId=V.getAppIntegrationId,exports.getGuidelineDate=V.getGuidelineDate,exports.getGuidelineDescription=V.getGuidelineDescription,exports.getGuidelineDisplayDescription=V.getGuidelineDisplayDescription,exports.getGuidelineId=V.getGuidelineId,exports.getGuidelineTitle=V.getGuidelineTitle,exports.isInstantLearningGuideline=V.isInstantLearningGuideline,exports.mergeGuidelineLabels=V.mergeGuidelineLabels,exports.getGuidelineWorkspaceActions=H.getGuidelineWorkspaceActions,exports.getGuidelineWorkspaceSnapshot=H.getGuidelineWorkspaceSnapshot,exports.useGuidelineWorkspace=U.useGuidelineWorkspace,exports.useGuidelineWorkspaceActions=U.useGuidelineWorkspaceActions,exports.useOptionalGuidelineWorkspace=U.useOptionalGuidelineWorkspace,exports.useOptionalGuidelineWorkspaceActions=U.useOptionalGuidelineWorkspaceActions,exports.clearGuidelineCartClearPending=N.clearGuidelineCartClearPending,exports.clearInstantLearningGuidelineCartPresent=N.clearInstantLearningGuidelineCartPresent,exports.getGuidelineSessionId=N.getGuidelineSessionId,exports.markGuidelineCartClearPending=N.markGuidelineCartClearPending,exports.rotateGuidelineSessionId=N.rotateGuidelineSessionId,exports.removeInstantLearningGuidelinesFromCart=K.removeInstantLearningGuidelinesFromCart,exports.closeGuidelineOverlayWithSync=Q.closeGuidelineOverlayWithSync,exports.dataCartFileToGuidelineFileItem=Y.dataCartFileToGuidelineFileItem,exports.getDataCartFilesFromResponse=Y.getDataCartFilesFromResponse,exports.isGuidelineDataCartFile=Y.isGuidelineDataCartFile,exports.mergeGuidelineFiles=Y.mergeGuidelineFiles,exports.syncGuidelineCartWithMemstore=z.syncGuidelineCartWithMemstore,exports.guidelineQueryClient=X.guidelineQueryClient;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/InstantLearning/InstantLearning.js"),t=require("./features/WtaWnta/WtaWnta.js"),r=require("./features/DocumentLearning/DocumentLearning.js"),i=require("./features/IL-OTJ/ILOTJ.js"),n=require("./features/IL-OTJ/_components/atoms/Button/Button.js"),a=require("./features/IL-OTJ/_components/atoms/Dropdown/Dropdown.js"),s=require("./features/IL-OTJ/_components/atoms/Toggle/Toggle.js"),o=require("./features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),u=require("./features/IL-OTJ/_components/molecules/Condition/ConditionList.js"),p=require("./features/IL-OTJ/_components/molecules/Sections/SectionWrapper.js"),l=require("./features/IL-OTJ/_components/molecules/SeperationRow/SeparationRow.js"),d=require("./features/IL-OTJ/_components/organisms/ConfigSection/ConfigSection.js"),c=require("./features/IL-OTJ/_components/organisms/TextSection/TextSection.js"),m=require("./features/IL-OTJ/_components/organisms/ScopeSection/ScopeSection.js"),L=require("./features/IL-OTJ/_components/organisms/ConditionSection/ConditionSection.js"),x=require("./features/IL-OTJ/_components/templates/TrafficManager/TrafficManagerTemplate.js"),I=require("./features/IL-OTJ/_components/templates/Testing/Testing.js"),G=require("./features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js"),g=require("./features/IL-OTJ/helpers/utils.js"),T=require("./features/IL-OTJ/store/CitationsContext.js"),f=require("./features/IL-OTJ/ILOTJTest.js"),C=require("./features/LearningManagement/LearningManagement.js"),S=require("./ILMarketplaceWrapper.js"),j=require("./features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js");require("./features/LearningManagement/LearningManagementTest.js");var q=require("./api/transport.js"),_=require("./ContinueWithTemplateModal.js"),A=require("./features/IL-marketplace/components/GuidelineCart.js"),D=require("./features/IL-marketplace/components/GuidelineCartHeader.js"),k=require("./features/IL-marketplace/components/GuidelineCartItem.js"),E=require("./features/IL-marketplace/components/GuidelineEmptyState.js"),O=require("./features/IL-marketplace/components/GuidelineHeader.js"),M=require("./features/IL-marketplace/components/GuidelineIconButton.js"),W=require("./features/IL-marketplace/components/GuidelineLandingPage.js"),P=require("./features/IL-marketplace/components/GuidelineFilterPanel.js"),y=require("./features/IL-marketplace/components/GuidelineLibrary.js"),F=require("./features/IL-marketplace/components/GuidelineLibraryCard.js"),B=require("./features/IL-marketplace/components/LearningManagementWrapper.js"),J=require("./features/IL-marketplace/components/GuidelineProceedButton.js"),b=require("./features/IL-marketplace/components/GuidelineSelectButton.js"),h=require("./features/IL-marketplace/components/GuidelineCardMenu.js"),R=require("./features/IL-marketplace/components/GuidelineConfirmDialog.js"),U=require("./features/IL-marketplace/hooks/useGuidelineSelection.js"),v=require("./features/IL-marketplace/constants.js"),N=require("./features/IL-marketplace/utils.js"),w=require("./features/IL-marketplace/workspace/workspace.runtime.js"),V=require("./features/IL-marketplace/workspace/useGuidelineWorkspace.js"),H=require("./features/IL-marketplace/services/guideline.session.js"),K=require("./features/IL-marketplace/services/instant-learning.api.js"),Q=require("./features/IL-marketplace/utils/guidelineOverlay.js"),Y=require("./features/IL-marketplace/utils/guidelineFiles.js"),z=require("./features/IL-marketplace/services/guideline.cart.api.js"),X=require("./features/IL-marketplace/queryClient.js");exports.InstantLearning=e.default,exports.WtaWnta=t.default,exports.BookLearning=r.default,exports.ILOTJ=i.default,exports.Button=n.Button,exports.Dropdown=a.Dropdown,exports.Toggle=s.Toggle,exports.Textarea=o.Textarea,exports.ConditionList=u.ConditionList,exports.SectionWrapper=p.SectionWrapper,exports.SeparationRow=l.SeparationRow,exports.ConfigSection=d.ConfigSection,exports.TextSection=c.TextSection,exports.ScopeSection=m.ScopeSection,exports.ConditionSection=L.ConditionSection,exports.TrafficManagerTemplate=x.TrafficManagerTemplate,exports.Testing=I.Testing,Object.defineProperty(exports,"TemplateList",{enumerable:!0,get:function(){return G.TemplateList}}),exports.TemplateMap=G.TemplateMap,exports.extractAndParseResponse=g.extractAndParseResponse,exports.extractAndParseWithProperty=g.extractAndParseWithProperty,exports.extractTextFromChildren=g.extractTextFromChildren,exports.extractVariantIds=g.extractVariantIds,exports.parseValidationData=g.parseValidationData,exports.useHeaderObserver=g.useHeaderObserver,exports.CitationProvider=T.CitationProvider,exports.useCitations=T.useCitations,exports.dummyDat=f.dummyDat,exports.getVariantInfo=f.getVariantInfo,exports.LearningManagement=C.default,exports.ILMarketplaceWrapper=S.default,exports.IL_MARKETPLACE_TAB_ID=S.IL_MARKETPLACE_TAB_ID,exports.MY_KNOWLEDGE_BASES_TAB_ID=S.MY_KNOWLEDGE_BASES_TAB_ID,exports.SAVED_TAB_ID=S.SAVED_TAB_ID,exports.TeachMePlugin=j.default,exports.TemplateRegistry=j.TemplateRegistry,exports.setApiDebug=q.setApiDebug,exports.ContinueWithTemplateModal=_.default,exports.GuidelineCart=A.GuidelineCart,exports.GuidelineCartHeader=D.GuidelineCartHeader,exports.GuidelineCartItem=k.GuidelineCartItem,exports.GuidelineEmptyState=E.GuidelineEmptyState,exports.GuidelineHeader=O.GuidelineHeader,exports.GuidelineIconButton=M.GuidelineIconButton,exports.GuidelineLandingPage=W.GuidelineLandingPage,exports.GuidelineFilterPanel=P.GuidelineFilterPanel,exports.GuidelineLibrary=y.GuidelineLibrary,exports.GuidelineLibraryCard=F.GuidelineLibraryCard,exports.LearningManagementWrapper=B.LearningManagementWrapper,exports.GuidelineProceedButton=J.GuidelineProceedButton,exports.GuidelineSelectButton=b.GuidelineSelectButton,exports.GuidelineCardMenu=h.GuidelineCardMenu,exports.createGuidelineCardMenuItems=h.createGuidelineCardMenuItems,exports.GuidelineConfirmDialog=R.GuidelineConfirmDialog,exports.useGuidelineSelection=U.useGuidelineSelection,exports.CONFIGURABLE_GUIDELINE_STATUSES=v.CONFIGURABLE_GUIDELINE_STATUSES,exports.DEFAULT_GUIDELINE_ARTIFACT_TEMPLATE=v.DEFAULT_GUIDELINE_ARTIFACT_TEMPLATE,exports.DEFAULT_GUIDELINE_LABELS=v.DEFAULT_GUIDELINE_LABELS,exports.STATUS_ACTION_MODE_NAME=v.STATUS_ACTION_MODE_NAME,exports.createGuidelineId=N.createGuidelineId,exports.cx=N.cx,exports.defaultFormatAddedOnLabel=N.defaultFormatAddedOnLabel,exports.getAppIntegrationId=N.getAppIntegrationId,exports.getGuidelineDate=N.getGuidelineDate,exports.getGuidelineDescription=N.getGuidelineDescription,exports.getGuidelineDisplayDescription=N.getGuidelineDisplayDescription,exports.getGuidelineId=N.getGuidelineId,exports.getGuidelineTitle=N.getGuidelineTitle,exports.isInstantLearningGuideline=N.isInstantLearningGuideline,exports.mergeGuidelineLabels=N.mergeGuidelineLabels,exports.getGuidelineWorkspaceActions=w.getGuidelineWorkspaceActions,exports.getGuidelineWorkspaceSnapshot=w.getGuidelineWorkspaceSnapshot,exports.useGuidelineWorkspace=V.useGuidelineWorkspace,exports.useGuidelineWorkspaceActions=V.useGuidelineWorkspaceActions,exports.useOptionalGuidelineWorkspace=V.useOptionalGuidelineWorkspace,exports.useOptionalGuidelineWorkspaceActions=V.useOptionalGuidelineWorkspaceActions,exports.clearGuidelineCartClearPending=H.clearGuidelineCartClearPending,exports.clearInstantLearningGuidelineCartPresent=H.clearInstantLearningGuidelineCartPresent,exports.getGuidelineSessionId=H.getGuidelineSessionId,exports.markGuidelineCartClearPending=H.markGuidelineCartClearPending,exports.rotateGuidelineSessionId=H.rotateGuidelineSessionId,exports.removeInstantLearningGuidelinesFromCart=K.removeInstantLearningGuidelinesFromCart,exports.closeGuidelineOverlayWithSync=Q.closeGuidelineOverlayWithSync,exports.dataCartFileToGuidelineFileItem=Y.dataCartFileToGuidelineFileItem,exports.getDataCartFilesFromResponse=Y.getDataCartFilesFromResponse,exports.isGuidelineDataCartFile=Y.isGuidelineDataCartFile,exports.mergeGuidelineFiles=Y.mergeGuidelineFiles,exports.syncGuidelineCartWithMemstore=z.syncGuidelineCartWithMemstore,exports.guidelineQueryClient=X.guidelineQueryClient;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../store/useDynamicFormStore.js"),r=require("./aiReasoning.js"),t=function(e,r){return{cleanKey:e.replace("global.",""),isGlobal:e.startsWith("global.")||!r}},i=function(e){return!0===(null==e?void 0:e.is_repeatable_variant)||"VariantListWrapper"===(null==e?void 0:e.bpa_ui_component)};exports.applyResponseToStore=function(o,n,a,l,p){var s,u;if(n&&"object"==typeof n){var d=e.useDynamicFormStore.getState(),c=d.setGlobalField,y=d.setVariantField,f=d.setGlobalReasoning,v=d.setVariantReasoning,_=!!a&&void 0!==l,b=Symbol("not-found"),g=null!==(u=null===(s=n.learning_metadata)||void 0===s?void 0:s.properties)&&void 0!==u?u:n.learning_metadata,h={rule_title:["title","ruleTitle"],rule_description:["description","variant_description"],wta:["whenToApply","when_to_apply"],wnta:["whenNotToApply","when_not_to_apply"]},j=function(e,o){void 0===o&&(o=!1),e&&Object.entries(e).forEach(function(e){var s=e[0],u=e[1];if(u.ui_only){if(i(u))return;u.properties&&j(u.properties,o)}else{if(u.data_key&&!u.read_only&&(!0===u.ai_generated||(null==p?void 0:p.hydrateAll))){var d=t(u.data_key,o),m=d.cleanKey,F=d.isGlobal,O=function(e,r){var t;if(r){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];var i=null===(t=h[e])||void 0===t?void 0:t.find(function(e){return Object.prototype.hasOwnProperty.call(n,e)});return i?n[i]:b}if(g&&"object"==typeof g&&e in g){var o=g[e];return o&&"object"==typeof o&&!Array.isArray(o)&&"value"in o?o.value:o}return b}(s,!!u.core_field);if(O!==b&&("array"!==u.type&&Array.isArray(O)&&(O=O.join("\n")),void 0!==O)){var A=null;if(!("ConditionSection"===u.bpa_ui_component)&&"string"==typeof O&&O.includes("<ai_reasoning>")){var S=r.stripAiReasoning(O);O=S.clean,A=S.raw}F?(c(m,O),A&&f(m,A)):_&&(y(a,l,m,O),A&&v(a,l,m,A))}}u.properties&&!i(u)&&j(u.properties,o)}})},m=(null==o?void 0:o.properties)||{};(null==p?void 0:p.variantOnly)||j(m,!1);var F=Object.values(m).find(i);F&&F.properties&&j(F.properties,!0)}},exports.areRequiredFieldsFilled=function(r,o){var n=e.useDynamicFormStore.getState(),a=n.getGlobalField,l=n.getVariantField,p=(null==r?void 0:r.properties)||{},s=!0,u=function(e,r,o){e&&Object.entries(e).forEach(function(e){var n=e[1];if(!n.ui_only||!i(n)){if(n.data_key&&n.is_required){var p=t(n.data_key,void 0!==r),d=p.cleanKey;(function(e){return null!=e&&(Array.isArray(e)?e.length>0:"string"!=typeof e||""!==e.trim())})(p.isGlobal?a(d):l(r,o,d))||(s=!1)}n.properties&&!i(n)&&u(n.properties,r,o)}})};u(p);var d=Object.values(p).find(i);return(null==d?void 0:d.properties)&&o.forEach(function(e,r){e.forEach(function(e,t){u(d.properties,r,t)})}),s},exports.generatePayloadFromSchema=function(o,n,a){var l=e.useDynamicFormStore.getState(),p=l.getGlobalField,s=l.getVariantField,u={},d={},c=[],y=function(e,o){void 0===o&&(o=!1),e&&Object.entries(e).forEach(function(e){var l=e[0],f=e[1];if(f.ui_only){if(i(f))return;f.properties&&y(f.properties,o)}else{if(f.data_key){var v=t(f.data_key,o),_=v.cleanKey,b=v.isGlobal?p(_):s(n,a,_);void 0===b&&(b="array"===f.type?[]:"boolean"!==f.type&&("object"===f.type?{}:"")),"string"==typeof b&&b.includes("<ai_reasoning>")&&(b=r.stripAiReasoning(b).clean),f.core_field?u[l]=b:(d[l]=b,f.is_required&&!c.includes(l)&&c.push(l))}f.properties&&!i(f)&&y(f.properties,o)}})},f=(null==o?void 0:o.properties)||{};y(f,!1);var v=Object.values(f).find(i);return v&&v.properties&&y(v.properties,!0),{rootPayload:u,learningMetadata:{properties:d,required:c}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../store/useDynamicFormStore.js"),r=require("./aiReasoning.js"),t=function(e,r){return{cleanKey:e.replace("global.",""),isGlobal:e.startsWith("global.")||!r}},i=function(e){return!0===(null==e?void 0:e.is_repeatable_variant)||"VariantListWrapper"===(null==e?void 0:e.bpa_ui_component)};exports.applyResponseToStore=function(o,n,a,l,p){var s,u;if(n&&"object"==typeof n){var c=e.useDynamicFormStore.getState(),d=c.setGlobalField,y=c.setVariantField,f=c.setGlobalReasoning,v=c.setVariantReasoning,_=!!a&&void 0!==l,b=Symbol("not-found"),g=null!==(u=null===(s=n.learning_metadata)||void 0===s?void 0:s.properties)&&void 0!==u?u:n.learning_metadata,h={rule_title:["title","ruleTitle"],rule_description:["description","variant_description"],wta:["whenToApply","when_to_apply"],wnta:["whenNotToApply","when_not_to_apply"]},j=function(e,o){void 0===o&&(o=!1),e&&Object.entries(e).forEach(function(e){var s=e[0],u=e[1];if(u.ui_only){if(i(u))return;u.properties&&j(u.properties,o)}else{if(u.data_key&&(!0===u.ai_generated||(null==p?void 0:p.hydrateAll))){var c=t(u.data_key,o),m=c.cleanKey,F=c.isGlobal,O=function(e,r){var t;if(r){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];var i=null===(t=h[e])||void 0===t?void 0:t.find(function(e){return Object.prototype.hasOwnProperty.call(n,e)});return i?n[i]:b}if(g&&"object"==typeof g&&e in g){var o=g[e];return o&&"object"==typeof o&&!Array.isArray(o)&&"value"in o?o.value:o}return b}(s,!!u.core_field);if(O!==b&&("array"!==u.type&&Array.isArray(O)&&(O=O.join("\n")),void 0!==O)){var A=null;if(!("ConditionSection"===u.bpa_ui_component)&&"string"==typeof O&&O.includes("<ai_reasoning>")){var S=r.stripAiReasoning(O);O=S.clean,A=S.raw}F?(d(m,O),A&&f(m,A)):_&&(y(a,l,m,O),A&&v(a,l,m,A))}}u.properties&&!i(u)&&j(u.properties,o)}})},m=(null==o?void 0:o.properties)||{};(null==p?void 0:p.variantOnly)||j(m,!1);var F=Object.values(m).find(i);F&&F.properties&&j(F.properties,!0)}},exports.areRequiredFieldsFilled=function(r,o){var n=e.useDynamicFormStore.getState(),a=n.getGlobalField,l=n.getVariantField,p=(null==r?void 0:r.properties)||{},s=!0,u=function(e,r,o){e&&Object.entries(e).forEach(function(e){var n=e[1];if(!n.ui_only||!i(n)){if(n.data_key&&n.is_required){var p=t(n.data_key,void 0!==r),c=p.cleanKey;(function(e){return null!=e&&(Array.isArray(e)?e.length>0:"string"!=typeof e||""!==e.trim())})(p.isGlobal?a(c):l(r,o,c))||(s=!1)}n.properties&&!i(n)&&u(n.properties,r,o)}})};u(p);var c=Object.values(p).find(i);return(null==c?void 0:c.properties)&&o.forEach(function(e,r){e.forEach(function(e,t){u(c.properties,r,t)})}),s},exports.generatePayloadFromSchema=function(o,n,a){var l=e.useDynamicFormStore.getState(),p=l.getGlobalField,s=l.getVariantField,u={},c={},d=[],y=function(e,o){void 0===o&&(o=!1),e&&Object.entries(e).forEach(function(e){var l=e[0],f=e[1];if(f.ui_only){if(i(f))return;f.properties&&y(f.properties,o)}else{if(f.data_key){var v=t(f.data_key,o),_=v.cleanKey,b=v.isGlobal?p(_):s(n,a,_);void 0===b&&(b="array"===f.type?[]:"boolean"!==f.type&&("object"===f.type?{}:"")),"string"==typeof b&&b.includes("<ai_reasoning>")&&(b=r.stripAiReasoning(b).clean),f.core_field?u[l]=b:(c[l]=b,f.is_required&&!d.includes(l)&&d.push(l))}f.properties&&!i(f)&&y(f.properties,o)}})},f=(null==o?void 0:o.properties)||{};y(f,!1);var v=Object.values(f).find(i);return v&&v.properties&&y(v.properties,!0),{rootPayload:u,learningMetadata:{properties:c,required:d}}};
2
2
  //# sourceMappingURL=PayloadUtils.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as n,jsxs as t,Fragment as o}from"react/jsx-runtime";import{useEffect as a}from"react";import r from"./TeachMeWrapper.js";import i from"../../../plugins/ValueTypes/Default/DefaultTeachMeRenderer.js";import l from"../../../plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js";import u from"../../../plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js";import{useTeachMeConfigStore as s,useLMSConfigStore as c}from"../../LearningManagement/store/useLMSConfigStore.js";import{useLearningTemplateStore as d}from"../../LearningManagement/store/useLearningTemplateStore.js";import{useLMSConfigQuery as p}from"../../LearningManagement/queries/useLMSConfigQuery.js";import f from"../../LearningManagement/store/useAuthStore.js";import m from"../../LearningManagement/store/useEnvStore.js";import{QueryClient as g,QueryClientProvider as v}from"@tanstack/react-query";import{fetchTiers as M,fetchRBACConfig as S}from"../../LearningManagement/apis/scopeApis.js";import{useConfigStore as L}from"../../LearningManagement/store/useConfigStore.js";import{useExternalWorkflowStore as h}from"../../LearningManagement/store/useExternalWorkflowStore.js";import R from"../../../ContinueWithTemplateModal.js";var T={Default:i,"Radio Traffic Learning":l,Guidelines:u},_=new g,C=function(t){return n(v,e({client:_},{children:n(j,e({},t))}))},j=function(i){var l,u=i.app_integration_id,g=i.isOpen,v=i.onClose,_=i.pluginPayload,C=i.token,j=i.mode,D=i.config,k=i.useDynamicForm,U=i.externalWorkflowMetaData,x=s(function(e){return e.setTeachMeConfig});s(function(e){return e.clearTeachMeConfig});var y=c(function(e){return e.setLMSConfig});c(function(e){return e.lmsConfig});var E=L().setConfig,w=h(function(e){return e.setExternalWorkflowMetaData});h(function(e){return e.openContinueModal});var W=d(function(e){return e.tiers});a(function(){var n,t;E(D),f.getState().setUser(e(e({},f.getState().user),{accessToken:C})),m.getState().setLlmStudioUrl(null==D?void 0:D.BASE_URL),d.getState().setAppIntegrationId(null!=u?u:""),d.getState().setSelectedRuleSetId(null!==(t=null===(n=null==_?void 0:_.ruleSet)||void 0===n?void 0:n.ruleSetId)&&void 0!==t?t:null),C&&(null==D?void 0:D.BASE_URL)&&(0!==W.length||(null==_?void 0:_.tiers)||M(),u&&!m.getState().rbacConfig&&S(u,C).then(function(e){var n,t,o,a,r,i,l,u,s,c;if(e){var d=m.getState();d.setRbacConfig({applicationName:null!==(n=e.application_name)&&void 0!==n?n:"",applicationId:null!==(t=e.application_id)&&void 0!==t?t:"",moduleId:null!==(a=null===(o=e.module_data)||void 0===o?void 0:o.Scopes)&&void 0!==a?a:"",applicationModuleId:null!==(i=null===(r=e.module_data)||void 0===r?void 0:r.General)&&void 0!==i?i:"",applicationResourceId:null!==(u=null===(l=e.resource_data)||void 0===l?void 0:l["Learning Management"])&&void 0!==u?u:"",appsecRbacUrl:null!==(s=d.appsecRbacUrl)&&void 0!==s?s:"",appsecBaseUrl:null!==(c=d.appsecBaseUrl)&&void 0!==c?c:""})}}).catch(function(e){console.error("Error fetching RBAC config for TeachMePlugin:",e)}))},[u,C,null==D?void 0:D.BASE_URL]),null==_||_.teachMe;var b=p(null!=u?u:"",!1,!0);return b.isLoading,b.isError,b.refetch,b.isSuccess,a(function(){var n,t,o;if(null==_?void 0:_.teachMe){var a=_.teachMe;a.teachMe&&x(a.teachMe),a.template&&d.getState().setTemplateData(null!=u?u:"",a.template),a.learningManagement&&y(e(e({},a.learningManagement),{agents:null!==(n=a.agents)&&void 0!==n?n:{},externalWorkflowMetaData:null!==(o=null===(t=a.teachMe)||void 0===t?void 0:t.externalWorkflowMetaData)&&void 0!==o?o:{enableExternalWorkflow:!1,current_mode:"",sub_mode:"",next_mode:"",externalWorkflowModal:{heading:"",options:{saveDraft:{title:"",desc:"",footerDesc:""},configureNow:{title:"",desc:"",footerDesc:""}}}}}))}(null==_?void 0:_.tiers)&&d.getState().setTiers(_.tiers)},[_]),a(function(){U&&w(U)},[U,w]),t(o,{children:[n(r,{app_integration_id:u,isOpen:g,onClose:v,token:C,templateRegistry:T,baseURL:null==D?void 0:D.BASE_URL,initialScope:null!==(l=null==_?void 0:_.initialScope)&&void 0!==l?l:"",ruleSet:null==_?void 0:_.ruleSet,useDynamicForm:k,pluginPayload:e(e({},_),{mode:j})}),n(R,{})]})};export{T as TemplateRegistry,C as default};
1
+ import{__assign as e}from"tslib";import{jsx as n,jsxs as t,Fragment as o}from"react/jsx-runtime";import{useEffect as a}from"react";import r from"./TeachMeWrapper.js";import i from"../../../plugins/ValueTypes/Default/DefaultTeachMeRenderer.js";import l from"../../../plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js";import u from"../../../plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js";import{useTeachMeConfigStore as s,useLMSConfigStore as c}from"../../LearningManagement/store/useLMSConfigStore.js";import{useLearningTemplateStore as d}from"../../LearningManagement/store/useLearningTemplateStore.js";import{useLMSConfigQuery as p}from"../../LearningManagement/queries/useLMSConfigQuery.js";import f from"../../LearningManagement/store/useAuthStore.js";import m from"../../LearningManagement/store/useEnvStore.js";import{QueryClient as g,QueryClientProvider as v}from"@tanstack/react-query";import{fetchTiers as M,fetchRBACConfig as S}from"../../LearningManagement/apis/scopeApis.js";import{useConfigStore as L}from"../../LearningManagement/store/useConfigStore.js";import{useExternalWorkflowStore as h}from"../../LearningManagement/store/useExternalWorkflowStore.js";import _ from"../../../ContinueWithTemplateModal.js";var R={Default:i,"Radio Traffic Learning":l,Guidelines:u},T=new g,C=function(t){return n(v,e({client:T},{children:n(j,e({},t))}))},j=function(i){var l,u=i.app_integration_id,g=i.content_type_id,v=i.isOpen,T=i.onClose,C=i.pluginPayload,j=i.token,D=i.mode,y=i.config,k=i.useDynamicForm,U=i.externalWorkflowMetaData,x=s(function(e){return e.setTeachMeConfig});s(function(e){return e.clearTeachMeConfig});var E=c(function(e){return e.setLMSConfig});c(function(e){return e.lmsConfig});var w=L().setConfig,W=h(function(e){return e.setExternalWorkflowMetaData});h(function(e){return e.openContinueModal});var b=d(function(e){return e.tiers});a(function(){var n,t;w(y),f.getState().setUser(e(e({},f.getState().user),{accessToken:j})),m.getState().setLlmStudioUrl(null==y?void 0:y.BASE_URL),d.getState().setAppIntegrationId(null!=u?u:""),d.getState().setSelectedRuleSetId(null!==(t=null===(n=null==C?void 0:C.ruleSet)||void 0===n?void 0:n.ruleSetId)&&void 0!==t?t:null),j&&(null==y?void 0:y.BASE_URL)&&(0!==b.length||(null==C?void 0:C.tiers)||M(),u&&!m.getState().rbacConfig&&S(u,j).then(function(e){var n,t,o,a,r,i,l,u,s,c;if(e){var d=m.getState();d.setRbacConfig({applicationName:null!==(n=e.application_name)&&void 0!==n?n:"",applicationId:null!==(t=e.application_id)&&void 0!==t?t:"",moduleId:null!==(a=null===(o=e.module_data)||void 0===o?void 0:o.Scopes)&&void 0!==a?a:"",applicationModuleId:null!==(i=null===(r=e.module_data)||void 0===r?void 0:r.General)&&void 0!==i?i:"",applicationResourceId:null!==(u=null===(l=e.resource_data)||void 0===l?void 0:l["Learning Management"])&&void 0!==u?u:"",appsecRbacUrl:null!==(s=d.appsecRbacUrl)&&void 0!==s?s:"",appsecBaseUrl:null!==(c=d.appsecBaseUrl)&&void 0!==c?c:""})}}).catch(function(e){console.error("Error fetching RBAC config for TeachMePlugin:",e)}))},[u,j,null==y?void 0:y.BASE_URL]),null==C||C.teachMe;var A=p(null!=u?u:"",!1,!0,g);return A.isLoading,A.isError,A.refetch,A.isSuccess,a(function(){var n,t,o;if(null==C?void 0:C.teachMe){var a=C.teachMe;a.teachMe&&x(a.teachMe),a.template&&d.getState().setTemplateData(null!=u?u:"",a.template),a.learningManagement&&E(e(e({},a.learningManagement),{agents:null!==(n=a.agents)&&void 0!==n?n:{},externalWorkflowMetaData:null!==(o=null===(t=a.teachMe)||void 0===t?void 0:t.externalWorkflowMetaData)&&void 0!==o?o:{enableExternalWorkflow:!1,current_mode:"",sub_mode:"",next_mode:"",externalWorkflowModal:{heading:"",options:{saveDraft:{title:"",desc:"",footerDesc:""},configureNow:{title:"",desc:"",footerDesc:""}}}}}))}(null==C?void 0:C.tiers)&&d.getState().setTiers(C.tiers)},[C]),a(function(){U&&W(U)},[U,W]),t(o,{children:[n(r,{app_integration_id:u,content_type_id:g,isOpen:v,onClose:T,token:j,templateRegistry:R,baseURL:null==y?void 0:y.BASE_URL,initialScope:null!==(l=null==C?void 0:C.initialScope)&&void 0!==l?l:"",ruleSet:null==C?void 0:C.ruleSet,useDynamicForm:k,pluginPayload:e(e({},C),{mode:D})}),n(_,{})]})};export{R as TemplateRegistry,C as default};
2
2
  //# sourceMappingURL=TeachMePlugin.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as i,__generator as t}from"tslib";import{jsx as a,jsxs as n}from"react/jsx-runtime";import{useEffect as r,useState as o}from"react";import{Box as l,CircularProgress as d,Dialog as p,DialogTitle as c,Typography as s,IconButton as u,DialogContent as f}from"@mui/material";import m from"@mui/icons-material/Close";import{useLearningTemplateStore as v}from"../../LearningManagement/store/useLearningTemplateStore.js";import{http as g}from"../../../api/transport.js";var h=function(){var i=o(!0),t=i[0],r=i[1];return n(p,e({open:t,onClose:function(){return r(!1)},fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{borderRadius:"16px",minHeight:"70vh",overflow:"hidden"}}},{children:[n(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",px:3,py:2}},{children:[a(s,e({variant:"h6",fontWeight:600},{children:"Teach Me"})),a(u,e({onClick:function(){return r(!1)}},{children:a(m,{})}))]})),a(f,e({dividers:!0,sx:{p:3,backgroundColor:"#fafafa"}},{children:"There is some issue with the selected template. Kindly check steps to resolve."}))]}))},y=function(n){var p=n.templateRegistry,c=void 0===p?{}:p,s=v(function(e){return e.backwardCompatibility}),u=v(function(e){return e.setBackwardCompatibility});r(function(){var e,i,t;(null===(e=n.pluginPayload)||void 0===e?void 0:e.backwardCompatibility)&&u(null!==(t=null===(i=n.pluginPayload)||void 0===i?void 0:i.backwardCompatibility)&&void 0!==t&&t)},[]);var f=v(function(e){return n.app_integration_id?e.templateMap[n.app_integration_id]:void 0}),m=v(function(e){return e.setTemplateData}),y=s?"Radio Traffic Learning":f,_=o(!y),b=_[0],w=_[1],x=o(!1),k=x[0],C=x[1];if(r(function(){var e,a,r;if(n.isOpen){if(null===(e=n.pluginPayload)||void 0===e?void 0:e.backwardCompatibility)return m("","Radio Traffic Learning"),void w(!1);if(!s&&!n.app_integration_id)return console.error("TeachMeWrapper requires an app_integration_id when backward compatibility is disabled."),C(!0),void w(!1);if(null===(r=null===(a=n.pluginPayload)||void 0===a?void 0:a.teachMe)||void 0===r?void 0:r.template)return m(n.app_integration_id,n.pluginPayload.teachMe.template),void w(!1);if(y)w(!1);else{i(void 0,void 0,void 0,function(){var e,a;return t(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,3,4]),w(!0),C(!1),[4,(o=n.app_integration_id,l=n.token,i(void 0,void 0,void 0,function(){var e,i;return t(this,function(t){switch(t.label){case 0:return s?[2,"Radio Traffic Learning"]:[4,g.get("".concat(n.baseURL,"/instant_learning/ilotj/application/getValueType/").concat(o),{headers:{Authorization:"Bearer ".concat(l)}})];case 1:return e=t.sent(),i=e.data,console.log("Fetched value type data:",i),!i||Array.isArray(i.data)&&0===i.data.length?[2,null]:[2,i.data[0].value_type_name||i.valueTypeName||i.templateName]}})}))];case 1:return e=r.sent(),m(n.app_integration_id,e),[3,4];case 2:return a=r.sent(),console.error(a),C(!0),n.app_integration_id&&m(n.app_integration_id,"ERROR"),[3,4];case 3:return w(!1),[7];case 4:return[2]}var o,l})})}}},[n.isOpen,n.app_integration_id,y,n.token,m,s]),b)return a(l,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:a(d,{size:32})}));if(k||!y)return a(h,{});var T=c[y&&c[y]?y:"Default"];return T?a(T,e({},n)):(console.warn("No renderer found for template: ".concat(y)),a(h,{}))};export{y as default};
1
+ import{__assign as e,__awaiter as i,__generator as t}from"tslib";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{useEffect as a,useState as o}from"react";import{Box as l,CircularProgress as d,Dialog as p,DialogTitle as s,Typography as u,IconButton as c,DialogContent as f}from"@mui/material";import m from"@mui/icons-material/Close";import{useLearningTemplateStore as v}from"../../LearningManagement/store/useLearningTemplateStore.js";import{http as g}from"../../../api/transport.js";import{buildValueTypeUrl as h}from"../../LearningManagement/apis/scopeApis.js";var y=function(){var i=o(!0),t=i[0],a=i[1];return r(p,e({open:t,onClose:function(){return a(!1)},fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{borderRadius:"16px",minHeight:"70vh",overflow:"hidden"}}},{children:[r(s,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",px:3,py:2}},{children:[n(u,e({variant:"h6",fontWeight:600},{children:"Teach Me"})),n(c,e({onClick:function(){return a(!1)}},{children:n(m,{})}))]})),n(f,e({dividers:!0,sx:{p:3,backgroundColor:"#fafafa"}},{children:"There is some issue with the selected template. Kindly check steps to resolve."}))]}))},_=function(r){var p=r.templateRegistry,s=void 0===p?{}:p,u=v(function(e){return e.backwardCompatibility}),c=v(function(e){return e.setBackwardCompatibility});a(function(){var e,i,t;(null===(e=r.pluginPayload)||void 0===e?void 0:e.backwardCompatibility)&&c(null!==(t=null===(i=r.pluginPayload)||void 0===i?void 0:i.backwardCompatibility)&&void 0!==t&&t)},[]);var f=v(function(e){return r.app_integration_id?e.templateMap[r.app_integration_id]:void 0}),m=v(function(e){return e.setTemplateData}),_=u?"Radio Traffic Learning":f,b=o(!_),w=b[0],x=b[1],k=o(!1),C=k[0],R=k[1];if(a(function(){var e,n,a;if(r.isOpen){if(null===(e=r.pluginPayload)||void 0===e?void 0:e.backwardCompatibility)return m("","Radio Traffic Learning"),void x(!1);if(!u&&!r.app_integration_id)return console.error("TeachMeWrapper requires an app_integration_id when backward compatibility is disabled."),R(!0),void x(!1);if(null===(a=null===(n=r.pluginPayload)||void 0===n?void 0:n.teachMe)||void 0===a?void 0:a.template)return m(r.app_integration_id,r.pluginPayload.teachMe.template),void x(!1);if(_)x(!1);else{i(void 0,void 0,void 0,function(){var e,n;return t(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),x(!0),R(!1),[4,(o=r.app_integration_id,l=r.token,i(void 0,void 0,void 0,function(){var e,i;return t(this,function(t){switch(t.label){case 0:return u?[2,"Radio Traffic Learning"]:[4,g.get(h(r.baseURL,o,r.content_type_id),{headers:{Authorization:"Bearer ".concat(l)}})];case 1:return e=t.sent(),i=e.data,console.log("Fetched value type data:",i),!i||Array.isArray(i.data)&&0===i.data.length?[2,null]:[2,i.data[0].value_type_name||i.valueTypeName||i.templateName]}})}))];case 1:return e=a.sent(),m(r.app_integration_id,e),[3,4];case 2:return n=a.sent(),console.error(n),R(!0),r.app_integration_id&&m(r.app_integration_id,"ERROR"),[3,4];case 3:return x(!1),[7];case 4:return[2]}var o,l})})}}},[r.isOpen,r.app_integration_id,r.content_type_id,_,r.token,m,u]),!r.isOpen)return null;if(w)return n(l,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:n(d,{size:32})}));if(C||!_)return n(y,{});var T=s[_&&s[_]?_:"Default"];return T?n(T,e({},r)):(console.warn("No renderer found for template: ".concat(_)),n(y,{}))};export{_ as default};
2
2
  //# sourceMappingURL=TeachMeWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as i,jsx as l}from"react/jsx-runtime";import{useState as a,Fragment as r}from"react";import{ChevronRight as t,ChevronLeft as o}from"lucide-react";import{cx as n}from"../utils.js";import d from"./GuidelineLibrary.module.css.js";import{GuidelineLibraryTab as s}from"./GuidelineLibraryTab.js";import{GuidelineLibraryContent as c}from"./GuidelineLibraryContent.js";import{TreeSidebar as u}from"@e-llm-studio/creative-workspace-ui-component";var b=[0,1,1,2,0,1,2,1];function p(){return l("div",e({className:d.treeSidebarSkeleton},{children:b.map(function(a,r){return i("div",e({className:d.treeSidebarSkeletonRow,style:{paddingLeft:"".concat(1.25*a,"rem")}},{children:[l("div",{className:d.treeSidebarSkeletonIcon}),l("div",{className:d.treeSidebarSkeletonLine,style:{width:"".concat(65-10*a,"%")}})]}),r)})}))}function m(b){var m=b.guidelines,h=b.guidelineSections,v=b.cartGuidelineIds,L=b.emptyTitle,S=b.emptyDescription,y=b.addToCartLabel,C=b.addedToCartLabel,g=b.selectLabel,T=b.selectedLabel,f=b.exploreLabel,G=b.showMoreLabel,w=b.showLessLabel,N=b.initialVisibleCount,k=void 0===N?4:N;b.showRecentlyUsedTab;var D=b.onToggleGuideline,x=b.onPreviewGuideline,I=b.onExploreILGuideline,P=b.classNames,W=b.styles,B=b.customIcons,E=b.subTitleLayout,O=b.formatAddedOnLabel,H=b.onEditGuideline,V=b.onDuplicateGuideline,j=b.onDeleteGuideline,A=b.hideEditOption,M=b.hideDuplicateOption,R=b.hideDeleteOption,U=b.onTabSelection,q=b.searchProps;b.treeSearchProps;var z=b.filterProps,F=b.showDashboardButton,J=void 0!==F&&F,K=b.onDashboardClick,Q=b.isLoading,X=b.instantLearning,Y=b.fetchWishlistStatus,Z=b.onWishlistToggle,$=b.onVersionSelect,_=b.treeSidebarProps,ee=b.isTreeSidebarLoading,ie=b.cartAction,le=b.isILMarketplace,ae=void 0!==le&&le,re=b.handleViewButtonCallback,te=b.handlePreviewButtonCallback,oe=b.scopeLabel,ne=void 0===oe?"Scope":oe,de=a(!1),se=de[0],ce=de[1];return i("section",e({className:n(d.library,null==P?void 0:P.library),style:null==W?void 0:W.library},{children:[i("div",e({className:n(d.libraryTabsContainer,null==P?void 0:P.libraryTabs),style:null==W?void 0:W.libraryTabs},{children:[l("div",e({className:d.libraryTabsScrollArea},{children:null==h?void 0:h.map(function(e){return l(r,{children:l(s,{section:e,classNames:P,styles:W,onTabSelection:U})},e.id)})})),ie]})),i("div",e({className:n(d.guidelineLibraryContent,null==P?void 0:P.guideLineLibraryContent),style:null==W?void 0:W.guideLineLibraryContent},{children:[_&&i("div",e({className:n(d.treeSidebarWrapper,se?d.treeSidebarCollapsed:d.treeSidebarExpanded,null==P?void 0:P.treeSidebarWrapper,se&&(null==P?void 0:P.treeSidebarCollapsedWrapper)),style:e(e({},null==W?void 0:W.treeSidebarWrapper),se&&(null==W?void 0:W.treeSidebarCollapsedWrapper))},{children:[i("div",e({className:n(d.treeSidebarHeading,se&&d.treeSidebarHeadingCollapsed,null==P?void 0:P.treeSidebarHeading),style:null==W?void 0:W.treeSidebarHeading},{children:[!se&&l("p",e({className:n(d.treeSidebarHeadingText,null==P?void 0:P.treeSidebarHeadingText),style:null==W?void 0:W.treeSidebarHeadingText},{children:ne})),l("button",e({type:"button",onClick:function(){return ce(function(e){return!e})},"aria-label":se?"Expand scope sidebar":"Collapse scope sidebar","aria-expanded":!se,title:se?"Expand scope sidebar":"Collapse scope sidebar",className:n(d.treeSidebarCollapseButton,null==P?void 0:P.treeSidebarCollapseButton),style:null==W?void 0:W.treeSidebarCollapseButton},{children:l(se?t:o,{strokeWidth:2,className:n(d.treeSidebarCollapseIcon,null==P?void 0:P.treeSidebarCollapseIcon),style:null==W?void 0:W.treeSidebarCollapseIcon})}))]})),!se&&(ee?l(p,{}):l(u,e({},_)))]})),l(c,{guidelines:m,cartGuidelineIds:v,addToCartLabel:y,addedToCartLabel:C,selectLabel:g,selectedLabel:T,exploreLabel:f,showMoreLabel:G,showLessLabel:w,initialVisibleCount:k,onToggleGuideline:D,onPreviewGuideline:x,onExploreILGuideline:I,classNames:P,styles:W,customIcons:B,subTitleLayout:E,formatAddedOnLabel:O,onEditGuideline:H,onDuplicateGuideline:V,onDeleteGuideline:j,hideEditOption:A,hideDuplicateOption:M,hideDeleteOption:R,searchProps:q,filterProps:z,showDashboardButton:J,onDashboardClick:K,isLoading:Q,emptyTitle:L,emptyDescription:S,instantLearning:X,fetchWishlistStatus:Y,onWishlistToggle:Z,onVersionSelect:$,isILMarketplace:ae,handleViewButtonCallback:re,handlePreviewButtonCallback:te})]}))]}))}export{m as GuidelineLibrary};
1
+ import{__assign as e}from"tslib";import{jsxs as i,jsx as l}from"react/jsx-runtime";import{useState as a,Fragment as t}from"react";import{ChevronRight as r,ChevronLeft as o}from"lucide-react";import{cx as n}from"../utils.js";import d from"./GuidelineLibrary.module.css.js";import{GuidelineLibraryTab as s}from"./GuidelineLibraryTab.js";import{GuidelineLibraryContent as c}from"./GuidelineLibraryContent.js";import{TreeSidebar as u}from"@e-llm-studio/creative-workspace-ui-component";var b=[0,1,1,2,0,1,2,1];function p(){return l("div",e({className:d.treeSidebarSkeleton},{children:b.map(function(a,t){return i("div",e({className:d.treeSidebarSkeletonRow,style:{paddingLeft:"".concat(1.25*a,"rem")}},{children:[l("div",{className:d.treeSidebarSkeletonIcon}),l("div",{className:d.treeSidebarSkeletonLine,style:{width:"".concat(65-10*a,"%")}})]}),t)})}))}function m(b){var m=b.guidelines,h=b.guidelineSections,v=b.cartGuidelineIds,L=b.emptyTitle,S=b.emptyDescription,y=b.addToCartLabel,C=b.addedToCartLabel,g=b.selectLabel,T=b.selectedLabel,f=b.exploreLabel,G=b.showMoreLabel,w=b.showLessLabel,N=b.initialVisibleCount,k=void 0===N?4:N;b.showRecentlyUsedTab;var D=b.onToggleGuideline,x=b.onPreviewGuideline,I=b.onExploreILGuideline,P=b.classNames,W=b.styles,B=b.customIcons,E=b.subTitleLayout,O=b.formatAddedOnLabel,H=b.onEditGuideline,V=b.onDuplicateGuideline,j=b.onDeleteGuideline,A=b.hideEditOption,M=b.hideDuplicateOption,R=b.hideDeleteOption,U=b.onTabSelection,q=b.searchProps;b.treeSearchProps;var z=b.filterProps,F=b.showDashboardButton,J=void 0!==F&&F,K=b.onDashboardClick,Q=b.isLoading,X=b.instantLearning,Y=b.fetchWishlistStatus,Z=b.onWishlistToggle,$=b.onVersionSelect,_=b.treeSidebarProps,ee=b.isTreeSidebarLoading,ie=b.cartAction,le=b.isILMarketplace,ae=void 0!==le&&le,te=b.handleViewButtonCallback,re=b.handlePreviewButtonCallback;b.statusActions;var oe=b.scopeLabel,ne=void 0===oe?"Scope":oe,de=a(!1),se=de[0],ce=de[1];return i("section",e({className:n(d.library,null==P?void 0:P.library),style:null==W?void 0:W.library},{children:[i("div",e({className:n(d.libraryTabsContainer,null==P?void 0:P.libraryTabs),style:null==W?void 0:W.libraryTabs},{children:[l("div",e({className:d.libraryTabsScrollArea},{children:null==h?void 0:h.map(function(e){return l(t,{children:l(s,{section:e,classNames:P,styles:W,onTabSelection:U})},e.id)})})),ie]})),i("div",e({className:n(d.guidelineLibraryContent,null==P?void 0:P.guideLineLibraryContent),style:null==W?void 0:W.guideLineLibraryContent},{children:[_&&i("div",e({className:n(d.treeSidebarWrapper,se?d.treeSidebarCollapsed:d.treeSidebarExpanded,null==P?void 0:P.treeSidebarWrapper,se&&(null==P?void 0:P.treeSidebarCollapsedWrapper)),style:e(e({},null==W?void 0:W.treeSidebarWrapper),se&&(null==W?void 0:W.treeSidebarCollapsedWrapper))},{children:[i("div",e({className:n(d.treeSidebarHeading,se&&d.treeSidebarHeadingCollapsed,null==P?void 0:P.treeSidebarHeading),style:null==W?void 0:W.treeSidebarHeading},{children:[!se&&l("p",e({className:n(d.treeSidebarHeadingText,null==P?void 0:P.treeSidebarHeadingText),style:null==W?void 0:W.treeSidebarHeadingText},{children:ne})),l("button",e({type:"button",onClick:function(){return ce(function(e){return!e})},"aria-label":se?"Expand scope sidebar":"Collapse scope sidebar","aria-expanded":!se,title:se?"Expand scope sidebar":"Collapse scope sidebar",className:n(d.treeSidebarCollapseButton,null==P?void 0:P.treeSidebarCollapseButton),style:null==W?void 0:W.treeSidebarCollapseButton},{children:l(se?r:o,{strokeWidth:2,className:n(d.treeSidebarCollapseIcon,null==P?void 0:P.treeSidebarCollapseIcon),style:null==W?void 0:W.treeSidebarCollapseIcon})}))]})),!se&&(ee?l(p,{}):l(u,e({},_)))]})),l(c,{guidelines:m,cartGuidelineIds:v,addToCartLabel:y,addedToCartLabel:C,selectLabel:g,selectedLabel:T,exploreLabel:f,showMoreLabel:G,showLessLabel:w,initialVisibleCount:k,onToggleGuideline:D,onPreviewGuideline:x,onExploreILGuideline:I,classNames:P,styles:W,customIcons:B,subTitleLayout:E,formatAddedOnLabel:O,onEditGuideline:H,onDuplicateGuideline:V,onDeleteGuideline:j,hideEditOption:A,hideDuplicateOption:M,hideDeleteOption:R,searchProps:q,filterProps:z,showDashboardButton:J,onDashboardClick:K,isLoading:Q,emptyTitle:L,emptyDescription:S,instantLearning:X,fetchWishlistStatus:Y,onWishlistToggle:Z,onVersionSelect:$,isILMarketplace:ae,handleViewButtonCallback:te,handlePreviewButtonCallback:re})]}))]}))}export{m as GuidelineLibrary};
2
2
  //# sourceMappingURL=GuidelineLibrary.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as t,__awaiter as i,__generator as l}from"tslib";import{jsx as r,jsxs as n,Fragment as a}from"react/jsx-runtime";import{useRef as o,useState as s,useEffect as c}from"react";import{Check as d,Plus as u,Share as h,Share2 as p,ChevronDown as m,EllipsisVertical as v,Heart as b,Eye as y}from"lucide-react";import f from"./GuidelineLibraryCard.module.css.js";import{getGuidelineId as C,getGuidelineTitle as N,getGuidelineDisplayDescription as w,getGuidelineDate as g,isInstantLearningGuideline as B,cx as k}from"../utils.js";import{GuidelineIconButton as D}from"./GuidelineIconButton.js";import{createGuidelineCardMenuItems as S,GuidelineCardMenu as L}from"./GuidelineCardMenu.js";import{GuidelineConfirmDialog as T}from"./GuidelineConfirmDialog.js";import{GuidelineStatusChip as W}from"./GuidelineStatusChip.js";function I(I){var P,A,_,j,G,x,O,F,M=this,H=I.guideline,V=I.isSelected,E=I.addToCartLabel,R=I.addedToCartLabel,U=I.selectLabel,q=void 0===U?"Select":U,z=I.selectedLabel,J=void 0===z?"Selected":z,K=I.onToggle,Q=I.onPreview,X=I.onExplore;I.onEdit;var Y=I.onDuplicate,Z=I.onDelete;I.hideEditOption,I.hideDuplicateOption;var $=I.hideDeleteOption,ee=void 0!==$&&$;I.editOptionLabel,I.duplicateOptionLabel;var te=I.deleteOptionLabel,ie=void 0===te?"Delete":te,le=I.duplicateConfirmTitle,re=void 0===le?"Duplicate Guideline":le,ne=I.duplicateConfirmDescription,ae=I.duplicateConfirmLabel,oe=void 0===ae?"Duplicate":ae,se=I.deleteConfirmTitle,ce=void 0===se?"Delete Guideline":se,de=I.deleteConfirmDescription,ue=I.deleteConfirmLabel,he=void 0===ue?"Delete":ue,pe=I.classNames,me=I.styles,ve=I.customIcons,be=I.subTitleLayout,ye=I.instantLearning,fe=I.formatAddedOnLabel;I.fetchWishlistStatus;var Ce=I.onWishlistToggle,Ne=I.onVersionSelect,we=I.isILMarketplace,ge=void 0!==we&&we,Be=I.handleViewButtonCallback,ke=I.handlePreviewButtonCallback,De=C(H),Se=N(H),Le=w(H),Te=fe(g(H)),We=null===(P=H.created_by)||void 0===P?void 0:P.trim(),Ie=[We?"Created by ".concat(We):"",Te].filter(Boolean).join(" • "),Pe=new Date(g(H)||Date.now()),Ae="template"===be,_e=Pe.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),je=Pe.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),Ge="".concat(_e," at ").concat(je),xe=[We?"Created by ".concat(We):"",Ge].filter(Boolean).join(" • "),Oe=null!==(_=null!==(A=H.content_type_title)&&void 0!==A?A:H.category)&&void 0!==_?_:"Requirement AI Template",Fe=B(H),Me=!0===H.is_legacy,He=H.status,Ve=V?null!==(j=null==ve?void 0:ve.selectedIcon)&&void 0!==j?j:r(d,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2.6}):null!==(G=null==ve?void 0:ve.unselectedIcon)&&void 0!==G?G:r(u,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2.6}),Ee=null!==(x=null==ve?void 0:ve.shareIcon)&&void 0!==x?x:r(h,{className:"h-5 w-5",strokeWidth:2.2}),Re=Fe?q:E,Ue=Fe?J:R,qe=Fe?H.topic_name:void 0,ze=null===(O=H.application_mapping_ids)||void 0===O?void 0:O[0],Je=null!==(F=H.version_list)&&void 0!==F?F:[],Ke=H.version,Qe=ge&&Je.length>0,Xe=o(null),Ye=s(!1),Ze=Ye[0],$e=Ye[1],et=s(!1),tt=et[0],it=et[1],lt=s(!1),rt=lt[0],nt=lt[1],at=s(!1),ot=at[0],st=at[1],ct=s(!1),dt=ct[0],ut=ct[1],ht=s(!1);ht[0];var pt=ht[1],mt=s(!!H.is_wishlisted),vt=mt[0],bt=mt[1],yt=s(!1),ft=yt[0],Ct=yt[1],Nt=null!=ne?ne:'Are you sure you want to duplicate "'.concat(Se,'"? A copy will be created with "(1)" appended to the title.'),wt=null!=de?de:'Are you sure you want to delete "'.concat(Se,'"? This action cannot be undone.');c(function(){bt(!!H.is_wishlisted)},[H.is_wishlisted]);var gt=function(){ge&&ke?ke(H):Fe&&X?X(H):Q(H)},Bt=function(e){ge&&Be?Be(H):K(e)},kt=S({onDelete:function(){return st(!0)},deleteLabel:ie,hideDelete:ee||!Z}),Dt=kt.some(function(e){return!e.hidden});return n(a,{children:[n("article",e({onClick:function(e){e.target.closest('button, a, input, select, textarea, [role="button"]')||gt()},className:k(f.libraryCard,null==pe?void 0:pe.libraryCard),style:null==me?void 0:me.libraryCard},{children:[n("div",e({className:k(f.libraryCardHeader,null==pe?void 0:pe.libraryCardHeader),style:null==me?void 0:me.libraryCardHeader},{children:[n("div",e({className:f.libraryCardHeaderContent},{children:[n("div",e({className:f.libraryCardTitleWrapper},{children:[Me&&r("span",e({className:f.legacyBadge},{children:"Legacy"})),r("h3",e({className:k(f.libraryCardTitle,null==pe?void 0:pe.libraryCardTitle),style:null==me?void 0:me.libraryCardTitle,title:Se},{children:Se})),Fe&&r(W,{status:He})]})),"template"===be?r("p",e({className:k(f.libraryCardDate,null==pe?void 0:pe.libraryCardDate),style:null==me?void 0:me.libraryCardDate,title:xe},{children:xe})):Ie?r("p",e({className:k(f.libraryCardDate,null==pe?void 0:pe.libraryCardDate),style:null==me?void 0:me.libraryCardDate,title:Ie},{children:Ie})):null]})),n("div",e({className:k(f.libraryCardActions,null==pe?void 0:pe.libraryCardActions),style:null==me?void 0:me.libraryCardActions},{children:[Fe&&!Ae&&!ge&&r(D,e({slot:"shareGuideline",label:"Share ".concat(Se),title:"Share",onClick:function(){return pt(!0)},classNames:pe,styles:me},{children:r(p,{className:f.shareIcon,strokeWidth:2.2})})),Qe&&n("div",e({className:f.versionSelectWrapper},{children:[r("select",e({value:Ke,disabled:tt,onClick:function(e){return e.stopPropagation()},onChange:function(e){var t;e.stopPropagation(),t=Number(e.target.value),i(M,void 0,void 0,function(){var e;return l(this,function(i){switch(i.label){case 0:if(!Ne||t===Ke)return[2];it(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,Ne(H,t)];case 2:return i.sent(),[3,5];case 3:return e=i.sent(),console.error("Version switch failed:",e),[3,5];case 4:return it(!1),[7];case 5:return[2]}})})},className:f.versionSelect,"aria-label":"Select version for ".concat(Se),title:"Select version"},{children:t([],Je,!0).sort(function(e,t){return t-e}).map(function(t){return n("option",e({value:t},{children:["v",t]}),t)})})),r(m,{className:f.versionSelectChevron,strokeWidth:2.2})]})),n("div",e({className:"relative"},{children:[r(D,e({slot:"libraryCardMoreButton",label:"More options for ".concat(Se),title:"More options",onClick:function(){return Dt?$e(function(e){return!e}):void 0},classNames:pe,styles:me,ref:Xe},{children:r(v,{className:f.moreIcon,strokeWidth:2.2})})),Dt&&r(L,{open:Ze,onClose:function(){return $e(!1)},anchorRef:Xe,items:kt,classNames:pe,styles:me})]}))]}))]})),r("p",e({className:k(f.libraryCardDescription,null==pe?void 0:pe.libraryCardDescription),style:null==me?void 0:me.libraryCardDescription,title:Le},{children:Le})),Ae&&n("p",e({className:f.contentTypeLabel},{children:["Content Type :"," ",r("span",e({className:f.contentTypeLabelValue},{children:Oe}))]})),qe&&n("p",e({className:f.topicLabel},{children:[r("span",e({className:"flex-shrink-0"},{children:"Topic:"})),r("span",e({className:f.topicLabelBadge},{children:qe}))]})),n("div",e({className:k(f.libraryCardFooter,null==pe?void 0:pe.libraryCardFooter),style:null==me?void 0:me.libraryCardFooter},Fe?{children:[n("div",e({className:f.libraryCardFooterActions},{children:[!Me&&r("button",e({type:"button",onClick:function(e){return i(M,void 0,void 0,function(){var t,i;return l(this,function(l){switch(l.label){case 0:if(e.stopPropagation(),!Ce||!(null==ye?void 0:ye.token)||!ze)return[2];t=!vt,Ct(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,Ce(ze,t,ye.token)];case 2:return l.sent(),bt(t),[3,5];case 3:return i=l.sent(),console.error("Wishlist operation failed:",i),[3,5];case 4:return Ct(!1),[7];case 5:return[2]}})})},disabled:ft,className:k(f.wishlistButton,vt?f.wishlistButtonWishlisted:f.wishlistButtonNotWishlisted,ft&&f.wishlistButtonDisabled),"aria-label":vt?"Remove ".concat(Se," from wishlist"):"Add ".concat(Se," to wishlist")},{children:r(b,{className:f.wishlistIcon,fill:vt?"currentColor":"none",strokeWidth:2.2})})),r("button",e({type:"button",onClick:gt,className:f.previewButton,"aria-label":"Preview ".concat(Se),title:"Preview"},{children:r(y,{className:f.previewIcon,strokeWidth:2.2})})),Ae&&!ge&&r("button",e({type:"button",onClick:function(e){e.stopPropagation(),pt(!0)},className:f.previewButton,"aria-label":"Share ".concat(Se),title:"Share"},{children:Ee}))]})),n("button",e({type:"button",onClick:function(){return Bt(De)},"aria-pressed":V,className:k(f.selectButton,V?f.selectButtonSelected:f.selectButtonNotSelected,null==pe?void 0:pe.libraryCardSelectButton),style:null==me?void 0:me.libraryCardSelectButton},{children:[Ve,r("span",e({className:f.selectButtonLabel},{children:V?Ue:Re}))]}))]}:{children:[r("div",e({className:f.libraryCardFooterActions},{children:r("button",e({type:"button",onClick:gt,className:f.previewButton,"aria-label":"Preview ".concat(Se),title:"Preview"},{children:r(y,{className:f.previewIcon,strokeWidth:2.2})}))})),n("button",e({type:"button",onClick:function(){return Bt(De)},"aria-pressed":V,className:k(f.selectButton,f.selectButtonFullWidth,V?f.selectButtonSelected:f.selectButtonNotSelected,null==pe?void 0:pe.libraryCardSelectButton),style:null==me?void 0:me.libraryCardSelectButton},{children:[Ve,r("span",e({className:f.selectButtonLabel},{children:V?Ue:Re}))]}))]}))]})),r(T,{open:rt,onClose:function(){return nt(!1)},onConfirm:function(){return i(M,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:if(!Y)return[2];ut(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,Promise.resolve(Y(H))];case 2:return e.sent(),[3,4];case 3:return ut(!1),nt(!1),[7];case 4:return[2]}})})},title:re,description:Nt,confirmLabel:oe,loading:dt,classNames:pe,styles:me}),r(T,{open:ot,onClose:function(){return st(!1)},onConfirm:function(){return i(M,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:if(!Z)return[2];ut(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,Promise.resolve(Z(H))];case 2:return e.sent(),[3,4];case 3:return ut(!1),st(!1),[7];case 4:return[2]}})})},title:ce,description:wt,confirmLabel:he,variant:"danger",loading:dt,classNames:pe,styles:me})]})}export{I as GuidelineLibraryCard};
1
+ import{__assign as e,__spreadArray as t,__awaiter as l,__generator as i}from"tslib";import{jsx as n,jsxs as r,Fragment as a}from"react/jsx-runtime";import{useRef as o,useState as s,useEffect as c}from"react";import{Check as d,Plus as u,Share as v,Share2 as m,ChevronDown as h,EllipsisVertical as p,Heart as b,Eye as y}from"lucide-react";import f from"./GuidelineLibraryCard.module.css.js";import{STATUS_ACTION_MODE_NAME as C,CONFIGURABLE_GUIDELINE_STATUSES as N}from"../constants.js";import{getGuidelineId as w,getGuidelineTitle as g,getGuidelineDisplayDescription as L,getGuidelineDate as B,isInstantLearningGuideline as k,cx as D}from"../utils.js";import{GuidelineIconButton as S}from"./GuidelineIconButton.js";import{createGuidelineCardMenuItems as T,GuidelineCardMenu as W}from"./GuidelineCardMenu.js";import{GuidelineConfirmDialog as A}from"./GuidelineConfirmDialog.js";import{GuidelineStatusChip as I}from"./GuidelineStatusChip.js";function P(P){var _,j,G,x,O,F,M,H,V,E,R=this,U=P.guideline,q=P.isSelected,z=P.addToCartLabel,J=P.addedToCartLabel,K=P.selectLabel,Q=void 0===K?"Select":K,X=P.selectedLabel,Y=void 0===X?"Selected":X,Z=P.onToggle,$=P.onPreview,ee=P.onExplore;P.onEdit;var te=P.onDuplicate,le=P.onDelete;P.hideEditOption,P.hideDuplicateOption;var ie=P.hideDeleteOption,ne=void 0!==ie&&ie;P.editOptionLabel,P.duplicateOptionLabel;var re=P.deleteOptionLabel,ae=void 0===re?"Delete":re,oe=P.duplicateConfirmTitle,se=void 0===oe?"Duplicate Guideline":oe,ce=P.duplicateConfirmDescription,de=P.duplicateConfirmLabel,ue=void 0===de?"Duplicate":de,ve=P.deleteConfirmTitle,me=void 0===ve?"Delete Guideline":ve,he=P.deleteConfirmDescription,pe=P.deleteConfirmLabel,be=void 0===pe?"Delete":pe,ye=P.classNames,fe=P.styles,Ce=P.customIcons,Ne=P.subTitleLayout,we=P.instantLearning,ge=P.formatAddedOnLabel;P.fetchWishlistStatus;var Le=P.onWishlistToggle,Be=P.onVersionSelect,ke=P.isILMarketplace,De=void 0!==ke&&ke,Se=P.handleViewButtonCallback,Te=P.handlePreviewButtonCallback,We=P.statusActions,Ae=w(U),Ie=g(U),Pe=L(U),_e=ge(B(U)),je=null===(_=U.created_by)||void 0===_?void 0:_.trim(),Ge=[je?"Created by ".concat(je):"",_e].filter(Boolean).join(" • "),xe=new Date(B(U)||Date.now()),Oe="template"===Ne,Fe=xe.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),Me=xe.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),He="".concat(Fe," at ").concat(Me),Ve=[je?"Created by ".concat(je):"",He].filter(Boolean).join(" • "),Ee=null!==(G=null!==(j=U.content_type_title)&&void 0!==j?j:U.category)&&void 0!==G?G:"Requirement AI Template",Re=k(U),Ue=!0===U.is_legacy,qe=U.status,ze=q?null!==(x=null==Ce?void 0:Ce.selectedIcon)&&void 0!==x?x:n(d,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2.6}):null!==(O=null==Ce?void 0:Ce.unselectedIcon)&&void 0!==O?O:n(u,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2.6}),Je=null!==(F=null==Ce?void 0:Ce.shareIcon)&&void 0!==F?F:n(v,{className:"h-5 w-5",strokeWidth:2.2}),Ke=Re?Q:z,Qe=Re?Y:J,Xe=(null==We?void 0:We.modeName)===C,Ye=N.includes((null!=qe?qe:"").trim().toLowerCase()),Ze=Xe?Ye?null!==(M=null==We?void 0:We.configureLabel)&&void 0!==M?M:"Configure":null!==(H=null==We?void 0:We.testLabel)&&void 0!==H?H:"Test Template":q?Qe:Ke,$e=Re?U.topic_name:void 0,et=null===(V=U.application_mapping_ids)||void 0===V?void 0:V[0],tt=null!==(E=U.version_list)&&void 0!==E?E:[],lt=U.version,it=De&&tt.length>0,nt=o(null),rt=s(!1),at=rt[0],ot=rt[1],st=s(!1),ct=st[0],dt=st[1],ut=s(!1),vt=ut[0],mt=ut[1],ht=s(!1),pt=ht[0],bt=ht[1],yt=s(!1),ft=yt[0],Ct=yt[1],Nt=s(!1);Nt[0];var wt=Nt[1],gt=s(!!U.is_wishlisted),Lt=gt[0],Bt=gt[1],kt=s(!1),Dt=kt[0],St=kt[1],Tt=null!=ce?ce:'Are you sure you want to duplicate "'.concat(Ie,'"? A copy will be created with "(1)" appended to the title.'),Wt=null!=he?he:'Are you sure you want to delete "'.concat(Ie,'"? This action cannot be undone.');c(function(){Bt(!!U.is_wishlisted)},[U.is_wishlisted]);var At=function(){De&&Te?Te(U):Re&&ee?ee(U):$(U)},It=function(e){var t,l;Xe?Ye?null===(t=null==We?void 0:We.onConfigure)||void 0===t||t.call(We,U):null===(l=null==We?void 0:We.onTest)||void 0===l||l.call(We,U):De&&Se?Se(U):Z(e)},Pt=T({onDelete:function(){return bt(!0)},deleteLabel:ae,hideDelete:ne||!le}),_t=Pt.some(function(e){return!e.hidden});return r(a,{children:[r("article",e({onClick:function(e){e.target.closest('button, a, input, select, textarea, [role="button"]')||At()},className:D(f.libraryCard,null==ye?void 0:ye.libraryCard),style:null==fe?void 0:fe.libraryCard},{children:[r("div",e({className:D(f.libraryCardHeader,null==ye?void 0:ye.libraryCardHeader),style:null==fe?void 0:fe.libraryCardHeader},{children:[r("div",e({className:f.libraryCardHeaderContent},{children:[r("div",e({className:f.libraryCardTitleWrapper},{children:[Ue&&n("span",e({className:f.legacyBadge},{children:"Legacy"})),n("h3",e({className:D(f.libraryCardTitle,null==ye?void 0:ye.libraryCardTitle),style:null==fe?void 0:fe.libraryCardTitle,title:Ie},{children:Ie})),Re&&n(I,{status:qe})]})),"template"===Ne?n("p",e({className:D(f.libraryCardDate,null==ye?void 0:ye.libraryCardDate),style:null==fe?void 0:fe.libraryCardDate,title:Ve},{children:Ve})):Ge?n("p",e({className:D(f.libraryCardDate,null==ye?void 0:ye.libraryCardDate),style:null==fe?void 0:fe.libraryCardDate,title:Ge},{children:Ge})):null]})),r("div",e({className:D(f.libraryCardActions,null==ye?void 0:ye.libraryCardActions),style:null==fe?void 0:fe.libraryCardActions},{children:[Re&&!Oe&&!De&&n(S,e({slot:"shareGuideline",label:"Share ".concat(Ie),title:"Share",onClick:function(){return wt(!0)},classNames:ye,styles:fe},{children:n(m,{className:f.shareIcon,strokeWidth:2.2})})),it&&r("div",e({className:f.versionSelectWrapper},{children:[n("select",e({value:lt,disabled:ct,onClick:function(e){return e.stopPropagation()},onChange:function(e){var t;e.stopPropagation(),t=Number(e.target.value),l(R,void 0,void 0,function(){var e;return i(this,function(l){switch(l.label){case 0:if(!Be||t===lt)return[2];dt(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,Be(U,t)];case 2:return l.sent(),[3,5];case 3:return e=l.sent(),console.error("Version switch failed:",e),[3,5];case 4:return dt(!1),[7];case 5:return[2]}})})},className:f.versionSelect,"aria-label":"Select version for ".concat(Ie),title:"Select version"},{children:t([],tt,!0).sort(function(e,t){return t-e}).map(function(t){return r("option",e({value:t},{children:["v",t]}),t)})})),n(h,{className:f.versionSelectChevron,strokeWidth:2.2})]})),r("div",e({className:"relative"},{children:[n(S,e({slot:"libraryCardMoreButton",label:"More options for ".concat(Ie),title:"More options",onClick:function(){return _t?ot(function(e){return!e}):void 0},classNames:ye,styles:fe,ref:nt},{children:n(p,{className:f.moreIcon,strokeWidth:2.2})})),_t&&n(W,{open:at,onClose:function(){return ot(!1)},anchorRef:nt,items:Pt,classNames:ye,styles:fe})]}))]}))]})),n("p",e({className:D(f.libraryCardDescription,null==ye?void 0:ye.libraryCardDescription),style:null==fe?void 0:fe.libraryCardDescription,title:Pe},{children:Pe})),Oe&&r("p",e({className:f.contentTypeLabel},{children:["Content Type :"," ",n("span",e({className:f.contentTypeLabelValue},{children:Ee}))]})),$e&&r("p",e({className:f.topicLabel},{children:[n("span",e({className:"flex-shrink-0"},{children:"Topic:"})),n("span",e({className:f.topicLabelBadge},{children:$e}))]})),r("div",e({className:D(f.libraryCardFooter,null==ye?void 0:ye.libraryCardFooter),style:null==fe?void 0:fe.libraryCardFooter},Re?{children:[r("div",e({className:f.libraryCardFooterActions},{children:[!Ue&&n("button",e({type:"button",onClick:function(e){return l(R,void 0,void 0,function(){var t,l;return i(this,function(i){switch(i.label){case 0:if(e.stopPropagation(),!Le||!(null==we?void 0:we.token)||!et)return[2];t=!Lt,St(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,Le(et,t,we.token)];case 2:return i.sent(),Bt(t),[3,5];case 3:return l=i.sent(),console.error("Wishlist operation failed:",l),[3,5];case 4:return St(!1),[7];case 5:return[2]}})})},disabled:Dt,className:D(f.wishlistButton,Lt?f.wishlistButtonWishlisted:f.wishlistButtonNotWishlisted,Dt&&f.wishlistButtonDisabled),"aria-label":Lt?"Remove ".concat(Ie," from wishlist"):"Add ".concat(Ie," to wishlist")},{children:n(b,{className:f.wishlistIcon,fill:Lt?"currentColor":"none",strokeWidth:2.2})})),n("button",e({type:"button",onClick:At,className:f.previewButton,"aria-label":"Preview ".concat(Ie),title:"Preview"},{children:n(y,{className:f.previewIcon,strokeWidth:2.2})})),Oe&&!De&&n("button",e({type:"button",onClick:function(e){e.stopPropagation(),wt(!0)},className:f.previewButton,"aria-label":"Share ".concat(Ie),title:"Share"},{children:Je}))]})),r("button",e({type:"button",onClick:function(){return It(Ae)},"aria-pressed":q,className:D(f.selectButton,q?f.selectButtonSelected:f.selectButtonNotSelected,null==ye?void 0:ye.libraryCardSelectButton),style:null==fe?void 0:fe.libraryCardSelectButton},{children:[ze,n("span",e({className:f.selectButtonLabel},{children:Ze}))]}))]}:{children:[n("div",e({className:f.libraryCardFooterActions},{children:n("button",e({type:"button",onClick:At,className:f.previewButton,"aria-label":"Preview ".concat(Ie),title:"Preview"},{children:n(y,{className:f.previewIcon,strokeWidth:2.2})}))})),r("button",e({type:"button",onClick:function(){return It(Ae)},"aria-pressed":q,className:D(f.selectButton,f.selectButtonFullWidth,q?f.selectButtonSelected:f.selectButtonNotSelected,null==ye?void 0:ye.libraryCardSelectButton),style:null==fe?void 0:fe.libraryCardSelectButton},{children:[ze,n("span",e({className:f.selectButtonLabel},{children:Ze}))]}))]}))]})),n(A,{open:vt,onClose:function(){return mt(!1)},onConfirm:function(){return l(R,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:if(!te)return[2];Ct(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,Promise.resolve(te(U))];case 2:return e.sent(),[3,4];case 3:return Ct(!1),mt(!1),[7];case 4:return[2]}})})},title:se,description:Tt,confirmLabel:ue,loading:ft,classNames:ye,styles:fe}),n(A,{open:pt,onClose:function(){return bt(!1)},onConfirm:function(){return l(R,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:if(!le)return[2];Ct(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,Promise.resolve(le(U))];case 2:return e.sent(),[3,4];case 3:return Ct(!1),bt(!1),[7];case 4:return[2]}})})},title:me,description:Wt,confirmLabel:be,variant:"danger",loading:ft,classNames:ye,styles:fe})]})}export{P as GuidelineLibraryCard};
2
2
  //# sourceMappingURL=GuidelineLibraryCard.js.map
@@ -1,2 +1,2 @@
1
- var e={landingBreadcrumbLabel:"Agent Guidelines",landingTitle:"Set Your Agent's Guidelines",landingDescription:"Add a set of guidelines that shape how your agent behaves, responds, and interprets.",landingDebugLabel:"Know more about debug mode",landingAddGuidelineLabel:"Add New Set of Guidelines",savedTabLabel:"Saved",recentTabLabel:"Recently used",libraryEmptyTitle:"No saved guidelines",libraryEmptyDescription:"Create a new guideline to start building your session rules.",libraryAddToCart:"Add to Cart",libraryAddedToCart:"Added to Cart",librarySelect:"Select",librarySelected:"Selected",libraryExplore:"Explore",libraryShowMore:"Show more guidelines",libraryShowLess:"Show fewer guidelines",cartTitle:"Guideline Cart",cartDescription:"Guidelines added to your current session",emptyCartTitle:"No guidelines added",emptyCartDescription:"Your selected guidelines will appear here.",proceedButton:"Proceed with Selected",addGuidelineLabel:"Add guideline",selectedBadge:function(e){return"".concat(e," Selected")},landingDebugTooltipContent:"Debug Mode is a transparency and control mechanism designed to intercept prompt submissions before they are dispatched to the LLM to help users test and debug with different guidelines rapidly. It serves as an approval gate, allowing users to verify, configure, and approve the guideline payload for a specific query.",createGuidelinesTooltipContent:"Topics are used to optimize guideline ingestion and retrieval. Select the closest matching topic for the best results.",popoverDebugTooltipContent:"Debug Mode is a transparency and control mechanism designed to intercept prompt submissions before they are dispatched to the LLM to help users test and debug with different guidelines rapidly. It serves as an approval gate, allowing users to verify, configure, and approve the guideline payload for a specific query."},t={data:{_id:"",artifactId:"",artifactTitle:"",artifactTitleIDs:[],artifactData:{final_response_gs_url:"",citationsSnapshot:{image_citations:[],appmod_citations:[],audio_citations:[],file_citations:[],web_citations:[],pdf_citations:[],gpt_citations:[]},projectIdSnapshot:"",userStorySnapshot:[],breadCrumbsSnapShot:[],activePageSnapShot:"",aiReasoningsSnapshot:[],dataSources_files:{},knowledgeBaseSnapshot:[],projectAnalyserSummarySnapshot:[],chatHistorySnapshot:[],persistedDataFilesSnapshot:{},risk_gap_items_json:{},selectedCodebasesSnapshot:[],selectedUserStoryTypeSnapshot:""},dataSources_files:{},modeName:"",modeId:null,artifactSubTitle:"",isLoading:!1,widgetName:"user story",userEmail:"",optionalData:{},created_at:"",updated_at:""},counter:{ai_reasoning_id_counter:0,pdf_citation_id_counter:0,section_number:0}},a={applicationName:"Instant Learning Mode",applicationId:"6a329da7232364c90e1b6a00",moduleId:"6a329da7232364c90e1b6a42",applicationModuleId:"6a329da7232364c90e1b6a3e",applicationResourceId:"6a32a08c232364c90e1b6a56",appsecRbacUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecBaseUrl:"https://dev-cw-appsec.techo.camp"},i={IMAGES:"images",MEETING_RECORDINGS:"meeting-recordings",DOCUMENTS:"documents",STORMEE_CONVERSATIONS:"stormee-conversations",REQUIREMENT_DOCUMENTS:"requirement-documents",CODEBASE_KNOWLEDGE:"codebase-knowledge",GUIDELINES:"guidelines"},o={GUIDELINE:"guideline",CONTEXT:"context"},n={IN_PROGRESS:"In-Progress",INGESTION_COMPLETE:"Completed",INGESTION_FAILED:"Failed"},s="GUIDELINE_SESSION_ID";export{o as ADD_CONTEXT_FILE_TYPES,t as DEFAULT_GUIDELINE_ARTIFACT_TEMPLATE,e as DEFAULT_GUIDELINE_LABELS,a as FALLBACK_RBAC_CONFIG,n as FILE_INGESTION_STATUS,s as GUIDELINE_SESSION_ID,i as SOURCE_IDS};
1
+ var e="RequirementV3",t=["draft"],a={landingBreadcrumbLabel:"Agent Guidelines",landingTitle:"Set Your Agent's Guidelines",landingDescription:"Add a set of guidelines that shape how your agent behaves, responds, and interprets.",landingDebugLabel:"Know more about debug mode",landingAddGuidelineLabel:"Add New Set of Guidelines",savedTabLabel:"Saved",recentTabLabel:"Recently used",libraryEmptyTitle:"No saved guidelines",libraryEmptyDescription:"Create a new guideline to start building your session rules.",libraryAddToCart:"Add to Cart",libraryAddedToCart:"Added to Cart",librarySelect:"Select",librarySelected:"Selected",libraryExplore:"Explore",libraryShowMore:"Show more guidelines",libraryShowLess:"Show fewer guidelines",cartTitle:"Guideline Cart",cartDescription:"Guidelines added to your current session",emptyCartTitle:"No guidelines added",emptyCartDescription:"Your selected guidelines will appear here.",proceedButton:"Proceed with Selected",addGuidelineLabel:"Add guideline",selectedBadge:function(e){return"".concat(e," Selected")},landingDebugTooltipContent:"Debug Mode is a transparency and control mechanism designed to intercept prompt submissions before they are dispatched to the LLM to help users test and debug with different guidelines rapidly. It serves as an approval gate, allowing users to verify, configure, and approve the guideline payload for a specific query.",createGuidelinesTooltipContent:"Topics are used to optimize guideline ingestion and retrieval. Select the closest matching topic for the best results.",popoverDebugTooltipContent:"Debug Mode is a transparency and control mechanism designed to intercept prompt submissions before they are dispatched to the LLM to help users test and debug with different guidelines rapidly. It serves as an approval gate, allowing users to verify, configure, and approve the guideline payload for a specific query."},i={data:{_id:"",artifactId:"",artifactTitle:"",artifactTitleIDs:[],artifactData:{final_response_gs_url:"",citationsSnapshot:{image_citations:[],appmod_citations:[],audio_citations:[],file_citations:[],web_citations:[],pdf_citations:[],gpt_citations:[]},projectIdSnapshot:"",userStorySnapshot:[],breadCrumbsSnapShot:[],activePageSnapShot:"",aiReasoningsSnapshot:[],dataSources_files:{},knowledgeBaseSnapshot:[],projectAnalyserSummarySnapshot:[],chatHistorySnapshot:[],persistedDataFilesSnapshot:{},risk_gap_items_json:{},selectedCodebasesSnapshot:[],selectedUserStoryTypeSnapshot:""},dataSources_files:{},modeName:"",modeId:null,artifactSubTitle:"",isLoading:!1,widgetName:"user story",userEmail:"",optionalData:{},created_at:"",updated_at:""},counter:{ai_reasoning_id_counter:0,pdf_citation_id_counter:0,section_number:0}},o={applicationName:"Instant Learning Mode",applicationId:"6a329da7232364c90e1b6a00",moduleId:"6a329da7232364c90e1b6a42",applicationModuleId:"6a329da7232364c90e1b6a3e",applicationResourceId:"6a32a08c232364c90e1b6a56",appsecRbacUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecBaseUrl:"https://dev-cw-appsec.techo.camp"},n={IMAGES:"images",MEETING_RECORDINGS:"meeting-recordings",DOCUMENTS:"documents",STORMEE_CONVERSATIONS:"stormee-conversations",REQUIREMENT_DOCUMENTS:"requirement-documents",CODEBASE_KNOWLEDGE:"codebase-knowledge",GUIDELINES:"guidelines"},s={GUIDELINE:"guideline",CONTEXT:"context"},r={IN_PROGRESS:"In-Progress",INGESTION_COMPLETE:"Completed",INGESTION_FAILED:"Failed"},d="GUIDELINE_SESSION_ID";export{s as ADD_CONTEXT_FILE_TYPES,t as CONFIGURABLE_GUIDELINE_STATUSES,i as DEFAULT_GUIDELINE_ARTIFACT_TEMPLATE,a as DEFAULT_GUIDELINE_LABELS,o as FALLBACK_RBAC_CONFIG,r as FILE_INGESTION_STATUS,d as GUIDELINE_SESSION_ID,n as SOURCE_IDS,e as STATUS_ACTION_MODE_NAME};
2
2
  //# sourceMappingURL=constants.js.map