@e-llm-studio/instant-learning 1.3.0-alpha.25 → 1.3.0-alpha.27

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 (24) hide show
  1. package/dist/cjs/features/LearningManagement/AuditLog/AuditLog.js +1 -1
  2. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
  3. package/dist/cjs/features/LearningManagement/RBAC/AccessManagementPanel.js +1 -1
  4. package/dist/cjs/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  5. package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
  6. package/dist/cjs/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
  7. package/dist/cjs/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
  8. package/dist/features/LearningManagement/AuditLog/AuditLog.js +1 -1
  9. package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
  10. package/dist/features/LearningManagement/RBAC/AccessManagementPanel.js +1 -1
  11. package/dist/features/LearningManagement/components/CreateLearningSetModal.js +1 -1
  12. package/dist/features/LearningManagement/components/StationOnboarding/StationOnboardModal.js +1 -1
  13. package/dist/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
  14. package/dist/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
  15. package/dist/types/src/features/LearningManagement/AuditLog/AuditLog.d.ts.map +1 -1
  16. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
  17. package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts +1 -0
  18. package/dist/types/src/features/LearningManagement/RBAC/AccessManagementPanel.d.ts.map +1 -1
  19. package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.d.ts.map +1 -1
  20. package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts +2 -0
  21. package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts.map +1 -1
  22. package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts +2 -0
  23. package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts.map +1 -1
  24. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),o=require("@e-llm-studio/audit-log");require("@e-llm-studio/audit-log/dist/styles.css");var n=require("lucide-react"),r=require("./ChangeLogDiff.js"),a=require("../store/useLMSConfigStore.js");exports.default=function(l){var s=l.configId,d=l.ruleData,c=l.scopeId,g=l.scopeName,h=(null==g?void 0:g.trim())||"Selected",u=i.useMemo(function(){var e=[];return c&&e.push(c),e},[d,c]);return i.useEffect(function(){console.log("Flattened External Resource IDs:",u)},[u]),t.jsxs("div",e.__assign({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[t.jsx("h1",e.__assign({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:a.dt("history.title","".concat(h," - Audit Log"),{scope_name:h})})),t.jsx("p",e.__assign({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:a.dt("history.subtitle","Track all learning updates and modifications with the ".concat(h," scope."),{scope_name:h})}))]})),t.jsx(o.AuditLog,{configId:s,getData:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/distinct-values"},query:{externalResourceId:u.length>0?u:[""],paginationLimit:10},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(i){return t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t.jsx(n.User,{size:16,color:"#64748b",style:{flexShrink:0}}),t.jsx("span",e.__assign({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(i){var o,n,r=(o=i.changeTitle,(n=(o||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),a=i.changeTitle?i.changeTitle.replace(/_/g," "):"—";return t.jsx("span",e.__assign({style:{color:r.color,backgroundColor:r.backgroundColor,border:"1px solid ".concat(r.borderColor),boxShadow:r.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:a}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var i;return t.jsx(r.default,{change:null!==(i=e.actionText)&&void 0!==i?i:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var o,r=(null===(o=i.metadata)||void 0===o?void 0:o.redirect_url)||i.redirect_url;return r?t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t.jsxs("a",e.__assign({href:r,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",t.jsx(n.ExternalLink,{size:14})]}))})):t.jsx("span",e.__assign({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(i){if(!i.actionDate)return t.jsx("span",e.__assign({style:{color:"#94a3b8"}},{children:"—"}));var o=new Date(i.actionDate),n=o.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),r=o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[t.jsx("span",e.__assign({style:{fontWeight:500}},{children:n})),t.jsx("span",{children:r})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),o=require("@e-llm-studio/audit-log");require("@e-llm-studio/audit-log/dist/styles.css");var n=require("lucide-react"),a=require("./ChangeLogDiff.js"),s=require("../store/useLMSConfigStore.js"),r=require("../RBAC/AccessPanel.module.css.js");exports.default=function(l){var c=l.configId,d=l.ruleData,g=l.scopeId,u=l.scopeName,p=(null==u?void 0:u.trim())||"Selected",h=i.useState("scope"),x=h[0],f=h[1],b=i.useMemo(function(){var e=[];return g&&e.push(g),e},[d,g]);i.useEffect(function(){console.log("Flattened External Resource IDs:",b)},[b]);var m={configId:c,getData:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/distinct-values"},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(i){return t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t.jsx(n.User,{size:16,color:"#64748b",style:{flexShrink:0}}),t.jsx("span",e.__assign({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(i){var o,n,a=(o=i.changeTitle,(n=(o||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),s=i.changeTitle?i.changeTitle.replace(/_/g," "):"—";return t.jsx("span",e.__assign({style:{color:a.color,backgroundColor:a.backgroundColor,border:"1px solid ".concat(a.borderColor),boxShadow:a.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:s}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var i;return t.jsx(a.default,{change:null!==(i=e.actionText)&&void 0!==i?i:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var o,a=(null===(o=i.metadata)||void 0===o?void 0:o.redirect_url)||i.redirect_url;return a?t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t.jsxs("a",e.__assign({href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",t.jsx(n.ExternalLink,{size:14})]}))})):t.jsx("span",e.__assign({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(i){if(!i.actionDate)return t.jsx("span",e.__assign({style:{color:"#94a3b8"}},{children:"—"}));var o=new Date(i.actionDate),n=o.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),a=o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[t.jsx("span",e.__assign({style:{fontWeight:500}},{children:n})),t.jsx("span",{children:a})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}};return t.jsxs("div",e.__assign({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[t.jsx("h1",e.__assign({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:s.dt("history.title","".concat(p," - Audit Log"),{scope_name:p})})),t.jsx("p",e.__assign({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:s.dt("history.subtitle","Track all learning updates and modifications with the ".concat(p," scope."),{scope_name:p})}))]})),t.jsxs("div",e.__assign({className:r.default.accessTabs,role:"tablist","aria-label":"Audit log level"},{children:[t.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"scope"===x,className:"".concat(r.default.accessTab," ").concat("scope"===x?r.default.accessTabActive:""),onClick:function(){return f("scope")}},{children:s.dt("history.scopeLevel","Scope Level")})),t.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"application"===x,className:"".concat(r.default.accessTab," ").concat("application"===x?r.default.accessTabActive:""),onClick:function(){return f("application")}},{children:s.dt("history.applicationLevel","Application Level")}))]})),"scope"===x?t.jsx(o.AuditLog,e.__assign({},m,{query:{externalResourceId:b.length>0?b:[""],paginationLimit:10}}),"scope-audit-log"):t.jsx(o.AuditLog,e.__assign({},m,{query:{externalResourceId:[],paginationLimit:10}}),"application-audit-log")]}))};
2
2
  //# sourceMappingURL=AuditLog.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("./RuleContent/RuleContent.js"),o=require("./StationsContent/StationsContent.js"),i=require("./RBAC/AccessManagementPanel.js");require("appsec-ui"),require("./store/useAuthStore.js"),require("./store/usePermissionsStore.js");var a=require("./store/useEnvStore.js"),r=require("./styles/LearningTemplateLayout.module.css.js"),s=require("./utils/treeUtils.js"),l=require("./SidebarWrapper.js"),u=require("./store/useLearningTemplateStore.js"),d=require("./components/StationOnboarding/StationOnboardModal.js"),c=require("./AuditLog/AuditLog.js");exports.default=function(p){var S,f,g=p.onOpenCreateModal,v=p.onRefreshRuleSets,C=p.scopeTreeData,j=p.onAddChild,m=p.onRenameChild,q=p.onDeleteChild,h=p.canDeleteScope,R=p.canEditScope,x=p.canCreateScope,_=p.onSectionSelect,L=p.onViewStation,T=p.activeSectionId,A=void 0===T?"learnings":T,I=p.sectionsConfig,D=p.nodeTypesConfig,y=p.app_integration_id,M=p.token,O=u.useLearningTemplateStore(function(e){return e.isStationModalOpen}),w=u.useLearningTemplateStore(function(e){return e.setStationModalOpen}),b=u.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),k=u.useLearningTemplateStore(function(e){return e.rawAuditRuleData}),N=a.default(function(e){return e.auditLogConfig});u.useLearningTemplateStore(function(e){return e.ruleData});var B=b?s.findNodeById((null==C?void 0:C.data)||null,b):null;return Boolean((null===(S=null==C?void 0:C.data)||void 0===S?void 0:S.id)&&b===C.data.id),n.jsxs("div",e.__assign({className:r.default.container},{children:[n.jsx(l.default,{onOpenCreateModal:g,onRefreshRuleSets:v,scopeTreeData:C,onAddChild:j,onRenameChild:m,onDeleteChild:q,canDeleteScope:h,canEditScope:R,canCreateScope:x,onSectionSelect:_,activeSectionId:A,sectionsConfig:I,nodeTypesConfig:D}),n.jsx("div",e.__assign({id:"rule-template-layout-content",className:"".concat(r.default.content," relative flex-1 overflow-hidden")},{children:"stations"===A?n.jsx(o.default,{scopeId:b||"",scopeName:(null==B?void 0:B.name)||"Unknown Scope",stationsCount:null===(f=null==B?void 0:B.metrics)||void 0===f?void 0:f.stationsCount,onViewStation:L}):"access"===A?n.jsx(i.default,{selectedRuleSetId:b,useApplicationModuleForScopeAccess:!1}):"history"===A?(null==N?void 0:N.configId)?n.jsx(c.default,{configId:N.configId,scopeId:b||void 0,scopeName:(null==B?void 0:B.name)||"Unknown Scope",ruleData:k}):null:n.jsx(t.default,{onRefreshRuleSets:v,app_integration_id:y,token:M})})),n.jsx(d.default,{isOpen:O,onClose:function(){w(!1)},onBoardStation:function(e){v(!0,e)},app_integration_id:y,token:M})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),o=require("./RuleContent/RuleContent.js"),i=require("./StationsContent/StationsContent.js"),a=require("./RBAC/AccessManagementPanel.js");require("appsec-ui"),require("./store/useAuthStore.js"),require("./store/usePermissionsStore.js");var r=require("./store/useEnvStore.js"),s=require("./styles/LearningTemplateLayout.module.css.js"),u=require("./utils/treeUtils.js"),l=require("./SidebarWrapper.js"),d=require("./store/useLearningTemplateStore.js"),c=require("./components/StationOnboarding/StationOnboardModal.js"),p=require("./AuditLog/AuditLog.js");exports.default=function(S){var f,g,m=S.onOpenCreateModal,v=S.onRefreshRuleSets,C=S.scopeTreeData,j=S.onAddChild,q=S.onRenameChild,T=S.onDeleteChild,h=S.canDeleteScope,R=S.canEditScope,L=S.canCreateScope,x=S.onSectionSelect,_=S.onViewStation,I=S.activeSectionId,A=void 0===I?"learnings":I,M=S.sectionsConfig,O=S.nodeTypesConfig,D=S.app_integration_id,y=S.token,b=d.useLearningTemplateStore(function(e){return e.isStationModalOpen}),w=d.useLearningTemplateStore(function(e){return e.setStationModalOpen}),k=d.useLearningTemplateStore(function(e){return e.isStationOnboardModalTriggered}),N=d.useLearningTemplateStore(function(e){return e.setIsStationOnboardModalTriggered}),B=d.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),E=d.useLearningTemplateStore(function(e){return e.rawAuditRuleData}),U=r.default(function(e){return e.auditLogConfig});d.useLearningTemplateStore(function(e){return e.ruleData});var P=B?u.findNodeById((null==C?void 0:C.data)||null,B):null;return Boolean((null===(f=null==C?void 0:C.data)||void 0===f?void 0:f.id)&&B===C.data.id),t.useEffect(function(){k&&w(!0)},[k,w,N]),n.jsxs("div",e.__assign({className:s.default.container},{children:[n.jsx(l.default,{onOpenCreateModal:m,onRefreshRuleSets:v,scopeTreeData:C,onAddChild:j,onRenameChild:q,onDeleteChild:T,canDeleteScope:h,canEditScope:R,canCreateScope:L,onSectionSelect:x,activeSectionId:A,sectionsConfig:M,nodeTypesConfig:O}),n.jsx("div",e.__assign({id:"rule-template-layout-content",className:"".concat(s.default.content," relative flex-1 overflow-hidden")},{children:"stations"===A?n.jsx(i.default,{scopeId:B||"",scopeName:(null==P?void 0:P.name)||"Unknown Scope",stationsCount:null===(g=null==P?void 0:P.metrics)||void 0===g?void 0:g.stationsCount,onViewStation:_}):"access"===A?n.jsx(a.default,{selectedRuleSetId:B,scopeName:(null==P?void 0:P.name)||"Unknown Scope",useApplicationModuleForScopeAccess:!1}):"history"===A?(null==U?void 0:U.configId)?n.jsx(p.default,{configId:U.configId,scopeId:B||void 0,scopeName:(null==P?void 0:P.name)||"Unknown Scope",ruleData:E}):null:n.jsx(o.default,{onRefreshRuleSets:v,app_integration_id:D,token:y})})),n.jsx(c.default,{isOpen:b,onClose:function(){w(!1),N(!1)},onBoardStation:function(e){v(!0,e)},app_integration_id:D,token:y})]}))};
2
2
  //# sourceMappingURL=LearningTemplateLayout.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),c=require("react"),a=require("./AccessPanel.js"),t=require("../store/useEnvStore.js"),i=require("../store/usePermissionsStore.js"),l=require("./AccessPanel.module.css.js"),o=require("../store/useLMSConfigStore.js");exports.default=function(n){var r=n.selectedRuleSetId,u=n.useApplicationModuleForScopeAccess,d=void 0!==u&&u,p=c.useState("scope"),v=p[0],b=p[1],f=t.default(function(e){return e.rbacConfig}),m=i.usePermissionsStore(function(e){return e.hasPermission}),j=null==f?void 0:f.applicationResourceId,A=(null==f?void 0:f.applicationModuleId)||(null==f?void 0:f.moduleId),_=d?A:null==f?void 0:f.moduleId,x=Boolean(j&&m("ilotj.scope.access.application.view",j));return s.jsxs("div",e.__assign({className:l.default.accessManagement},{children:[s.jsxs("div",e.__assign({className:l.default.accessTabs,role:"tablist","aria-label":"Access level"},{children:[s.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"scope"===v,className:"".concat(l.default.accessTab," ").concat("scope"===v?l.default.accessTabActive:""),onClick:function(){return b("scope")}},{children:o.dt("access.scopeLevelAccess","Scope Level Access")})),s.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"application"===v,className:"".concat(l.default.accessTab," ").concat("application"===v?l.default.accessTabActive:""),onClick:function(){return b("application")},disabled:!x,title:x?"":"You don't have permission to view application access"},{children:o.dt("access.appLevelAccess","Application Level Access")}))]})),s.jsx("div",e.__assign({className:l.default.accessTabPanel,role:"tabpanel"},{children:"application"===v?s.jsx(a.default,{resourceId:j,moduleId:A,accessLevel:"application"}):s.jsx(a.default,{ruleSetId:r,moduleId:_,accessLevel:"scope"})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),c=require("./AccessPanel.js"),t=require("../store/useEnvStore.js"),i=require("../store/usePermissionsStore.js"),l=require("./AccessPanel.module.css.js"),n=require("../store/useLMSConfigStore.js");exports.default=function(o){var r=o.selectedRuleSetId,d=o.useApplicationModuleForScopeAccess,u=void 0!==d&&d,p=o.scopeName,m=(null==p?void 0:p.trim())||"Selected",v=a.useState("scope"),f=v[0],g=v[1],_=t.default(function(e){return e.rbacConfig}),x=i.usePermissionsStore(function(e){return e.hasPermission}),b=null==_?void 0:_.applicationResourceId,j=(null==_?void 0:_.applicationModuleId)||(null==_?void 0:_.moduleId),h=u?j:null==_?void 0:_.moduleId,A=Boolean(b&&x("ilotj.scope.access.application.view",b));return s.jsxs("div",e.__assign({className:l.default.accessManagement},{children:[s.jsx("div",e.__assign({style:{padding:"24px 24px 0",fontFamily:"Arial, sans-serif"}},{children:s.jsxs("div",e.__assign({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[s.jsx("h1",e.__assign({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:n.dt("access.title","".concat(m," - Access Management"),{scope_name:m})})),s.jsx("p",e.__assign({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:n.dt("access.subtitle","Manage users and groups within the ".concat(m," scope."),{scope_name:m})}))]}))})),s.jsxs("div",e.__assign({className:l.default.accessTabs,role:"tablist","aria-label":"Access level"},{children:[s.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"scope"===f,className:"".concat(l.default.accessTab," ").concat("scope"===f?l.default.accessTabActive:""),onClick:function(){return g("scope")}},{children:n.dt("access.scopeLevelAccess","Scope Level Access")})),s.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"application"===f,className:"".concat(l.default.accessTab," ").concat("application"===f?l.default.accessTabActive:""),onClick:function(){return g("application")},disabled:!A,title:A?"":"You don't have permission to view application access"},{children:n.dt("access.appLevelAccess","Application Level Access")}))]})),s.jsx("div",e.__assign({className:l.default.accessTabPanel,role:"tabpanel"},{children:"application"===f?s.jsx(c.default,{resourceId:b,moduleId:j,accessLevel:"application"}):s.jsx(c.default,{ruleSetId:r,moduleId:h,accessLevel:"scope"})}))]}))};
2
2
  //# sourceMappingURL=AccessManagementPanel.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),l=require("lucide-react"),i=require("../styles/CreateLearningSetModal.module.css.js");exports.default=function(n){var t=n.isOpen,r=n.onClose,c=n.onSubmit,d=n.title,u=n.description,o=n.inputLabel,_=n.submitLabel,f=n.placeholder,m=void 0===f?"":f,g=n.initialValue,h=void 0===g?"":g,v=n.isLoading,x=void 0!==v&&v,j=a.useState(""),p=j[0],b=j[1],N=a.useState(null),C=N[0],q=N[1];if(a.useEffect(function(){t&&(b(h),q(null))},[t,h]),!t)return null;return s.jsx("div",e.__assign({className:i.default.overlay},{children:s.jsxs("div",e.__assign({className:i.default.modal},{children:[s.jsxs("div",e.__assign({className:i.default.header},{children:[s.jsxs("div",e.__assign({className:i.default.headerContent},{children:[s.jsx("h2",e.__assign({className:i.default.title},{children:d})),u&&s.jsx("p",e.__assign({className:i.default.description},{children:u}))]})),s.jsx("button",e.__assign({onClick:r,className:i.default.closeBtn,disabled:x},{children:s.jsx(l.X,{size:24})}))]})),s.jsx("div",e.__assign({className:i.default.form},{children:s.jsxs("div",e.__assign({className:i.default.formGroup},{children:[s.jsxs("label",e.__assign({className:i.default.label},{children:[s.jsx("span",e.__assign({className:i.default.asterisk},{children:"*"})),o]})),s.jsx("input",{type:"text",value:p,onChange:function(e){b(e.target.value),C&&q(null)},className:"".concat(i.default.inputField," ").concat(C?i.default.inputError:""),placeholder:m,disabled:x}),C&&s.jsx("p",e.__assign({className:i.default.errorMessage},{children:C}))]}))})),s.jsxs("div",e.__assign({className:i.default.footer},{children:[s.jsx("button",e.__assign({onClick:r,className:i.default.cancelBtn,disabled:x},{children:"Cancel"})),s.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var s;return e.__generator(this,function(e){switch(e.label){case 0:if(!(p.trim()?(q(null),1):(q("".concat(o.replace("*","").trim()," is required")),0)))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c(p)];case 2:return e.sent(),r(),[3,4];case 3:return s=e.sent(),q((null==s?void 0:s.message)||"An error occurred. Please try again."),[3,4];case 4:return[2]}})})},className:i.default.confirmBtn,disabled:x},{children:x?s.jsxs(s.Fragment,{children:[s.jsx(l.Loader2,{className:i.default.spinner}),"Save"===_?"Saving...":"Creating..."]}):_}))]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("react"),l=require("lucide-react"),i=require("../styles/CreateLearningSetModal.module.css.js");exports.default=function(n){var r=n.isOpen,t=n.onClose,d=n.onSubmit,c=n.title,u=n.description,o=n.inputLabel,_=n.submitLabel,f=n.placeholder,m=void 0===f?"":f,v=n.initialValue,g=void 0===v?"":v,h=n.isLoading,x=void 0!==h&&h,j=a.useState(""),p=j[0],b=j[1],N=a.useState(null),C=N[0],q=N[1];if(a.useEffect(function(){r&&(b(g),q(null))},[r,g]),!r)return null;return s.jsx("div",e.__assign({className:i.default.overlay},{children:s.jsxs("div",e.__assign({className:i.default.modal},{children:[s.jsxs("div",e.__assign({className:i.default.header},{children:[s.jsxs("div",e.__assign({className:i.default.headerContent},{children:[s.jsx("h2",e.__assign({className:i.default.title},{children:c})),u&&s.jsx("p",e.__assign({className:i.default.description},{children:u}))]})),s.jsx("button",e.__assign({onClick:t,className:i.default.closeBtn,disabled:x},{children:s.jsx(l.X,{size:24})}))]})),s.jsx("div",e.__assign({className:i.default.form},{children:s.jsxs("div",e.__assign({className:i.default.formGroup},{children:[s.jsxs("label",e.__assign({className:i.default.label},{children:[s.jsx("span",e.__assign({className:i.default.asterisk},{children:"*"})),o]})),s.jsx("input",{type:"text",value:p,onChange:function(e){var s=e.target.value;if(s.length>50)return b(s.slice(0,50)),void q("Maximum 50 characters allowed");b(s),C&&q(null)},className:"".concat(i.default.inputField," ").concat(C?i.default.inputError:""),placeholder:m,disabled:x}),C&&s.jsx("p",e.__assign({className:i.default.errorMessage},{children:C}))]}))})),s.jsxs("div",e.__assign({className:i.default.footer},{children:[s.jsx("button",e.__assign({onClick:t,className:i.default.cancelBtn,disabled:x},{children:"Cancel"})),s.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var s,a,l;return e.__generator(this,function(e){switch(e.label){case 0:if(!(p.trim()?(q(null),1):(q("".concat(o.replace("*","").trim()," is required")),0)))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,d(p)];case 2:return e.sent(),t(),[3,4];case 3:return s=e.sent(),console.error("Error in submission",s),409===(null==s?void 0:s.status)?(q(null===(l=null===(a=null==s?void 0:s.response)||void 0===a?void 0:a.data)||void 0===l?void 0:l.message),[2]):(q((null==s?void 0:s.message)||"An error occurred. Please try again."),[3,4]);case 4:return[2]}})})},className:i.default.confirmBtn,disabled:x},{children:x?s.jsxs(s.Fragment,{children:[s.jsx(l.Loader2,{className:i.default.spinner}),"Save"===_?"Saving...":"Creating..."]}):_}))]}))]}))}))};
2
2
  //# sourceMappingURL=CreateLearningSetModal.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material"),o=require("lucide-react"),t=require("primereact/toast"),s=require("uuid"),l=require("../../apis/scopeApis.js"),a=require("./StationAutocomplete.js"),u=require("../CardSkeleton.js"),c=require("./OnboardingLoader.js"),p=require("./TemplateCard.js"),d=require("../../styles/StationOnboardModal.module.css.js"),x=require("./InputField.js"),g=require("../../store/useAuthStore.js"),f=require("../../store/useConfigStore.js"),h=require("../../store/useLearningTemplateStore.js"),_=require("../../config.js"),m=require("../../store/useAppSecRolesStore.js"),v=require("../../store/useEnvStore.js"),y=require("../../RuleContent/AddScopeApprovalSearchComponent.js"),S=[{label:"PT - Pacific Time",value:"Pacific Time"},{label:"MT - Mountain Time",value:"Mountain Time"},{label:"CT - Central Time",value:"Central Time"},{label:"ET - Eastern Time",value:"Eastern Time"}],b=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],j=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],C=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(w){var T,B=w.isOpen,F=w.onClose,E=w.onBoardStation,k=w.app_integration_id,q=w.token,D=r.useState(null),z=D[0],O=D[1],A=r.useState([]),R=A[0],I=A[1],L=r.useState(0),N=L[0],M=L[1],W=r.useState(!0),P=W[0],G=W[1],U=r.useState(!1),H=U[0],K=U[1],Y=r.useState([]),X=Y[0],Z=Y[1],V=r.useState(""),J=V[0],Q=V[1],$=r.useState(""),ee=$[0],ne=$[1],re=r.useState(!1),ie=re[0],oe=re[1],te=r.useState(!1),se=te[0],le=te[1],ae=r.useState(null),ue=ae[0],ce=ae[1],pe=r.useState(null);pe[0],pe[1];var de=r.useState(!1),xe=de[0],ge=de[1],fe=r.useState(0),he=fe[0],_e=fe[1],me=r.useState(""),ve=me[0],ye=me[1],Se=g.default().user,be=r.useRef(null),je=r.useRef(null),Ce=r.useRef(null),we=r.useRef(null);f.useConfigStore().configuration;var Te=r.useRef(null),Be=m.useAppSecRolesStore(function(e){return e.roles}),Fe=v.default(function(e){return e.rbacConfig}),Ee=r.useState("approval_required"),ke=Ee[0],qe=Ee[1],De=r.useState([]),ze=De[0],Oe=De[1],Ae=r.useState([]),Re=Ae[0],Ie=Ae[1],Le=r.useState(""),Ne=Le[0],Me=Le[1],We=r.useState({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Pe=We[0],Ge=We[1],Ue=function(e,n){return e.find(function(e){return e.value===n})||null},He=r.useMemo(function(){return R.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[R]),Ke=r.useMemo(function(){var e,n,r;if(!Pe.genre)return null;var i=R.find(function(e){return e.scope_name===Pe.genre});return i?{id:i.id,title:i.scope_name||"Unnamed Template",description:(null===(e=i.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=i.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:i.rules_count||0,tiersCount:i.tier_count||0,isCopy:null!==(r=i.is_copy)&&void 0!==r&&r}:null},[Pe.genre,R]);r.useEffect(function(){return function(){Ce.current&&clearTimeout(Ce.current)}},[]);var Ye=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var r,i,o;return e.__generator(this,function(t){switch(t.label){case 0:if(H)return[2];K(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,l.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(r=t.sent())?void 0:r.status)&&Array.isArray(null==r?void 0:r.data)?(i=r.data,I(function(r){if(0===n)return i;var o=new Set(r.map(function(e){return e.id})),t=i.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],r,!0),t,!0)}),i.length<20?G(!1):G(!0),M(n+20)):G(!1),[3,5];case 3:return o=t.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),G(!1),[3,5];case 4:return K(!1),[7];case 5:return[2]}})})};r.useEffect(function(){B&&(I([]),M(0),G(!0),Ye(0))},[B]);r.useEffect(function(){Ge(z?function(n){var r;return e.__assign(e.__assign({},n),{region:null!==(r=z.market)&&void 0!==r?r:""})}:{region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""})},[z]),r.useEffect(function(){var e=setTimeout(function(){ne(J)},500);return function(){return clearTimeout(e)}},[J]),r.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o;return e.__generator(this,function(e){switch(e.label){case 0:if(!ee.trim())return Z([]),[2];oe(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,l.searchScopes({search_string:ee.trim()})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(r=n.data.filter(function(e){var n,r=null!==(n=e.inheritance)&&void 0!==n?n:[],i=r.indexOf(e.scope_name);return!(i<=0)&&r[i-1]===Pe.genre}),i=r.map(function(e){var n,r,i;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(i=e.is_copy)&&void 0!==i&&i}}),Z(i)):Z([]),[3,5];case 3:return o=e.sent(),console.error("[StationOnboard] Error searching scopes:",o),Z([]),[3,5];case 4:return oe(!1),[7];case 5:return[2]}})})},[ee,Pe.genre]),r.useEffect(function(){!ee.trim()&&Ke&&ce(Ke.id)},[ee,Ke]);var Xe=function(){setTimeout(function(){we.current&&we.current.scrollTo({top:we.current.scrollHeight,behavior:"smooth"})},100)},Ze=function(){ye(""),O(null),Ge({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),Z([]),Q(""),ce(null),qe("approval_required"),Oe([]),Ie([]),Me(""),F()},Ve=function(n,r){var i;if("primeTime"!==n){var o=null!==(i=null==r?void 0:r.value)&&void 0!==i?i:"";Ge(function(r){var i;return e.__assign(e.__assign({},r),((i={})[n]=String(o),i))}),"genre"===n&&(le(!0),Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(function(){var e=R.find(function(e){return e.scope_name===o});ce(e?e.id:null),le(!1)},800))}else{var t=(null==r?void 0:r.value)?String(r.value):"";Ge(function(n){return e.__assign(e.__assign({},n),{primeTime:t?[t]:[]})})}},Je=Boolean(z&&Pe.region&&Pe.timezone&&Pe.primeTime.length>0&&Pe.genre);return n.jsxs(i.Dialog,e.__assign({open:B,onClose:Ze,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[n.jsx(t.Toast,{ref:be}),n.jsxs(i.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(i.IconButton,e.__assign({onClick:Ze,disabled:xe,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(i.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(c.default,{isLoading:xe,currentStep:he,onComplete:function(){ge(!1);var e=je.current;Ze(),E(e||void 0),je.current=null}}),n.jsx(i.Box,e.__assign({sx:{display:"flex",flex:1,flexDirection:"column",paddingY:"14px",paddingX:"20px",gap:2,overflowY:"auto"}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"flex",gap:3}},{children:[n.jsxs(i.Box,e.__assign({ref:we,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(i.Box,e.__assign({className:d.default.formGroup},{children:[n.jsxs("label",e.__assign({className:d.default.label},{children:[n.jsx("span",e.__assign({className:d.default.asterisk},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(a.default,{value:ve,onChange:ye,onStationSelect:function(e){return O(e)}})]})),n.jsx(x.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:Pe.region||void 0,isSearchable:!1}),n.jsx(x.default,{required:!0,label:"TimeZone",placeholder:"Select TimeZone",options:S,value:Ue(S,Pe.timezone),onOptionChange:function(e){return Ve("timezone",e)},isSearchable:!1}),n.jsx(x.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:b,value:Ue(b,(null===(T=Pe.primeTime)||void 0===T?void 0:T[0])||""),onOptionChange:function(e){return Ve("primeTime",e)},isSearchable:!1}),n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Station Type",placeholder:"None",options:j,value:Ue(j,Pe.type),onOptionChange:function(n){Ve("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&Ge(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===Pe.type&&n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:C,value:Ue(C,Pe.lowSelloutConfig),onOptionChange:function(e){return Ve("lowSelloutConfig",e)},isSearchable:!1})})),h.useLearningTemplateStore.getState().backwardCompatibility&&n.jsxs("div",e.__assign({ref:Te,style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Approval Settings"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Configure who can approve learnings before they get published."})),n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"16px"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"12px"}},{children:[n.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===ke,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"},onClick:function(){return qe("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||qe("approval_required")}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===ke?"#2563EB":"#CBD5E1")}},{children:"approval_required"===ke&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),n.jsxs("div",e.__assign({style:{gap:"16px"}},{children:["approval_required"===ke&&n.jsx(y.default,{selectedApprovers:ze,selectedGroupOfApprovers:Re,onApproversChange:function(e){Oe(e),Me("")},onGroupsChange:function(e){Ie(e),Me("")}}),Ne&&n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:Ne}))]}))]})),n.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===ke,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){qe("publish_without"),Me("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(qe("publish_without"),Me(""))}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===ke?"#2563EB":"#CBD5E1")}},{children:"publish_without"===ke&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}))]}))]})),n.jsxs(i.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column"}},{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),n.jsx(i.Box,e.__assign({sx:{mb:2}},{children:n.jsx(x.default,{required:!0,label:"",placeholder:"Select Genre",options:He,value:Ue(He,Pe.genre),onOptionChange:function(e){return Ve("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!H&&P&&Ye(N)},isLoadingOptions:H,hasMoreOptions:P})})),n.jsx(i.Box,e.__assign({sx:{mb:3}},{children:se?n.jsx(u.default,{}):Ke?n.jsxs(i.Box,e.__assign({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[n.jsx(i.Box,e.__assign({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("circle",{cx:"12",cy:"12",r:"2"}),n.jsx("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),n.jsxs(i.Box,e.__assign({sx:{flex:1,minWidth:0}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:Ke.title})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:Ke.description})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[Ke.inheritedText&&n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("svg",e.__assign({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("polyline",{points:"15 3 21 3 21 9"}),n.jsx("path",{d:"M21 3L9 15"}),n.jsx("path",{d:"M3 21l6-6"})]})),Ke.inheritedText]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Ke.rulesCount," rules"]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[Ke.tiersCount," Tiers"]}))]}))]}))]})):Pe.genre?null:n.jsx(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))}))})),Pe.genre&&n.jsxs(n.Fragment,{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",Pe.genre,"” Scope"," ",n.jsx(i.Typography,e.__assign({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",Pe.genre,"” category to copy its learnings."]})),n.jsxs("div",e.__assign({className:d.default.searchWrapper,style:{marginBottom:"12px"}},{children:[n.jsx("input",{type:"text",value:J,onChange:function(e){return Q(e.target.value)},placeholder:"Search for station...",className:d.default.searchInput}),n.jsx(o.Search,{className:d.default.searchIcon,size:16})]})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[ie&&n.jsx(u.default,{}),!ie&&0===X.length&&ee.trim()&&n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',ee,'".']})),!ie&&X.map(function(r){return n.jsx(p.default,e.__assign({},r,{isSelected:ue===r.id,onSelect:function(e){var n;ce(ue===e?null!==(n=null==Ke?void 0:Ke.id)&&void 0!==n?n:null:e)}}),r.id)})]}))]})]}))]}))}))]})),n.jsxs(i.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Ze,disabled:xe,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,t,a,u,c,p,d,x,g,f,m,v,y,S,b,j;return e.__generator(this,function(C){switch(C.label){case 0:if(!z||!ue)return console.error("[StationOnboard] Missing required data for onboarding"),[2];if(h.useLearningTemplateStore.getState().backwardCompatibility&&"approval_required"===ke&&0===ze.length&&0===Re.length)return Me("Please select at least one approver or approver group."),setTimeout(function(){var e;null===(e=Te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50),[2];Me(""),n=Ke?e.__spreadArray([Ke],X,!0):X,r=n.find(function(e){return e.id===ue}),null==r?void 0:r.isCopy,ge(!0),_e(0),i=null,C.label=1;case 1:return C.trys.push([1,3,,4]),o=h.useLearningTemplateStore.getState().backwardCompatibility,t=o?{topic:"customRuleSet",customScopeGroupName:_.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:z.station_name||"New Station",parentScopeId:null!==(x=null==Ke?void 0:Ke.id)&&void 0!==x?x:null,customScopeName:z.station_name||"New Station",customScopeId:s.v4(),createByName:(null==Se?void 0:Se.firstname)||"System",createdBy:(null==Se?void 0:Se.email)||"system@audacy.com",scopeType:"Station",approvalRequired:"approval_required"===ke,audacyStationMetadata:{genre:Pe.genre,low_sellout_configurations:"Low Sellout"===Pe.type?Pe.lowSelloutConfig:null,market:z.market,primetime_windows:Pe.primeTime,region:z.region,station_guid:z.station_guid,station_type:""===Pe.type?null:Pe.type},appsecData:{application:null==Fe?void 0:Fe.applicationId,module:null==Fe?void 0:Fe.moduleId,roles:e.__spreadArray(e.__spreadArray([],"approval_required"===ke?[{users:ze.map(function(e){return e.email}),groups:Re.map(function(e){return e._id}),role:null!==(f=null===(g=Be.find(function(e){return"Learning Manager"===e.name}))||void 0===g?void 0:g._id)&&void 0!==f?f:""}]:[],!0),[{users:[null==Se?void 0:Se.email],groups:[],role:null!==(v=null===(m=Be.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===m?void 0:m._id)&&void 0!==v?v:""}],!1)}}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:z.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:k},console.log("[StationOnboard] Step 1: Creating rule set with payload:",t),[4,l.createRuleSet(t,q)];case 2:if(a=C.sent(),!(i=null===(y=null==a?void 0:a.data)||void 0===y?void 0:y.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",i),_e(1),[3,4];case 3:return u=C.sent(),console.error("[StationOnboard] Error creating rule set:",u),null===(S=be.current)||void 0===S||S.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),ge(!1),_e(0),[2];case 4:return C.trys.push([4,6,,7]),c=null!==ue&&ue!==(null==Ke?void 0:Ke.id),p={source_scope_id:c?ue:null!==(b=null==Ke?void 0:Ke.id)&&void 0!==b?b:ue,target_scope_id:i,is_copy_parent_variant_id:c},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",p),[4,l.inheritScopeBackwardCompatible(p)];case 5:return C.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),_e(3),[3,7];case 6:return d=C.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",d),null===(j=be.current)||void 0===j||j.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),ge(!1),_e(0),[2];case 7:return je.current=i,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!Je||xe,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Je?"#2563EB":"#BFDBFE",color:"#fff",cursor:Je&&!xe?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:xe?n.jsxs(n.Fragment,{children:[n.jsx(i.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material"),o=require("lucide-react"),t=require("primereact/toast"),s=require("uuid"),a=require("../../apis/scopeApis.js"),l=require("./StationAutocomplete.js"),u=require("../CardSkeleton.js"),c=require("./OnboardingLoader.js"),d=require("./TemplateCard.js"),p=require("../../styles/StationOnboardModal.module.css.js"),x=require("./InputField.js"),g=require("../../store/useAuthStore.js"),f=require("../../store/useConfigStore.js"),h=require("../../store/useLearningTemplateStore.js"),_=require("../../config.js"),m=require("../../store/useAppSecRolesStore.js"),v=require("../../store/useEnvStore.js"),y=require("../../RuleContent/AddScopeApprovalSearchComponent.js"),S=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],b=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],j=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}];exports.default=function(C){var w,B=C.isOpen,T=C.onClose,F=C.onBoardStation,E=C.app_integration_id,k=C.token,q=r.useState(null),A=q[0],D=q[1],O=r.useState([]),R=O[0],I=O[1],z=r.useState(0),L=z[0],M=z[1],N=r.useState(!0),P=N[0],W=N[1],G=r.useState(!1),K=G[0],U=G[1],H=r.useState([]),Y=H[0],X=H[1],V=r.useState(""),J=V[0],Q=V[1],Z=r.useState(""),$=Z[0],ee=Z[1],ne=r.useState(!1),re=ne[0],ie=ne[1],oe=r.useState(!1),te=oe[0],se=oe[1],ae=r.useState(null),le=ae[0],ue=ae[1],ce=r.useState(null);ce[0],ce[1];var de=r.useState(!1),pe=de[0],xe=de[1],ge=r.useState(0),fe=ge[0],he=ge[1],_e=r.useState(""),me=_e[0],ve=_e[1],ye=g.default().user,Se=r.useRef(null),be=r.useRef(null),je=r.useRef(null),Ce=r.useRef(null);f.useConfigStore().configuration;var we=r.useRef(null),Be=m.useAppSecRolesStore(function(e){return e.roles}),Te=v.default(function(e){return e.rbacConfig}),Fe=r.useState("approval_required"),Ee=Fe[0],ke=Fe[1],qe=r.useState([]),Ae=qe[0],De=qe[1],Oe=r.useState([]),Re=Oe[0],Ie=Oe[1],ze=r.useState(""),Le=ze[0],Me=ze[1],Ne=h.useLearningTemplateStore(function(e){return e.stationNameParam}),Pe=r.useState({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),We=Pe[0],Ge=Pe[1],Ke=function(e,n){return e.find(function(e){return e.value===n})||null},Ue=r.useMemo(function(){return R.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[R]),He=r.useMemo(function(){var e,n,r;if(!We.genre)return null;var i=R.find(function(e){return e.scope_name===We.genre});return i?{id:i.id,title:i.scope_name||"Unnamed Template",description:(null===(e=i.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=i.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:i.rules_count||0,tiersCount:i.tier_count||0,isCopy:null!==(r=i.is_copy)&&void 0!==r&&r}:null},[We.genre,R]);r.useEffect(function(){return function(){je.current&&clearTimeout(je.current)}},[]);var Ye=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var r,i,o;return e.__generator(this,function(t){switch(t.label){case 0:if(K)return[2];U(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,a.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(r=t.sent())?void 0:r.status)&&Array.isArray(null==r?void 0:r.data)?(i=r.data,I(function(r){if(0===n)return i;var o=new Set(r.map(function(e){return e.id})),t=i.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],r,!0),t,!0)}),i.length<20?W(!1):W(!0),M(n+20)):W(!1),[3,5];case 3:return o=t.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),W(!1),[3,5];case 4:return U(!1),[7];case 5:return[2]}})})};r.useEffect(function(){if(B&&(I([]),M(0),W(!0),Ye(0),Ne)){ve(Ne);e.__awaiter(void 0,void 0,void 0,function(){var n,r,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.fetchStationsByKeyword(Ne,!0)];case 1:return!0===(null==(n=e.sent())?void 0:n.success)&&Array.isArray(null==n?void 0:n.data)&&(r=n.data.find(function(e){var n;return(null===(n=e.station_name)||void 0===n?void 0:n.toLowerCase())===Ne.toLowerCase()&&!e.ruleset_id}),r&&D(r)),[3,3];case 2:return i=e.sent(),console.error("[StationOnboard] Error auto-selecting station:",i),[3,3];case 3:return[2]}})})}},[B,Ne]);r.useEffect(function(){Ge(A?function(n){var r;return e.__assign(e.__assign({},n),{region:null!==(r=A.market)&&void 0!==r?r:""})}:{region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""})},[A]),r.useEffect(function(){var e=setTimeout(function(){ee(J)},500);return function(){return clearTimeout(e)}},[J]),r.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o;return e.__generator(this,function(e){switch(e.label){case 0:if(!$.trim())return X([]),[2];ie(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.searchScopes({search_string:$.trim()})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(r=n.data.filter(function(e){var n,r=null!==(n=e.inheritance)&&void 0!==n?n:[],i=r.indexOf(e.scope_name);return!(i<=0)&&r[i-1]===We.genre}),i=r.map(function(e){var n,r,i;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(n=e.description)||void 0===n?void 0:n.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(i=e.is_copy)&&void 0!==i&&i}}),X(i)):X([]),[3,5];case 3:return o=e.sent(),console.error("[StationOnboard] Error searching scopes:",o),X([]),[3,5];case 4:return ie(!1),[7];case 5:return[2]}})})},[$,We.genre]),r.useEffect(function(){!$.trim()&&He&&ue(He.id)},[$,He]);var Xe=function(){setTimeout(function(){Ce.current&&Ce.current.scrollTo({top:Ce.current.scrollHeight,behavior:"smooth"})},100)},Ve=function(){ve(""),D(null),Ge({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),X([]),Q(""),ue(null),ke("approval_required"),De([]),Ie([]),Me(""),T()},Je=function(n,r){var i;if("primeTime"!==n){var o=null!==(i=null==r?void 0:r.value)&&void 0!==i?i:"";Ge(function(r){var i;return e.__assign(e.__assign({},r),((i={})[n]=String(o),i))}),"genre"===n&&(se(!0),je.current&&clearTimeout(je.current),je.current=setTimeout(function(){var e=R.find(function(e){return e.scope_name===o});ue(e?e.id:null),se(!1)},800))}else{var t=(null==r?void 0:r.value)?String(r.value):"";Ge(function(n){return e.__assign(e.__assign({},n),{primeTime:t?[t]:[]})})}},Qe=Boolean(A&&We.region&&We.primeTime.length>0&&We.genre);return n.jsxs(i.Dialog,e.__assign({open:B,onClose:Ve,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[n.jsx(t.Toast,{ref:Se}),n.jsxs(i.Box,e.__assign({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(i.IconButton,e.__assign({onClick:Ve,disabled:pe,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(i.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(c.default,{isLoading:pe,currentStep:fe,onComplete:function(){xe(!1);var e=be.current;Ve(),F(e||void 0),be.current=null}}),n.jsx(i.Box,e.__assign({sx:{display:"flex",flex:1,flexDirection:"column",paddingY:"14px",paddingX:"20px",gap:2,overflowY:"auto"}},{children:n.jsxs(i.Box,e.__assign({sx:{display:"flex",gap:3}},{children:[n.jsxs(i.Box,e.__assign({ref:Ce,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(i.Box,e.__assign({className:p.default.formGroup},{children:[n.jsxs("label",e.__assign({className:p.default.label},{children:[n.jsx("span",e.__assign({className:p.default.asterisk},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(l.default,{value:me,onChange:ve,onStationSelect:function(e){return D(e)}})]})),n.jsx(x.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:We.region||void 0,isSearchable:!1}),n.jsx(x.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:S,value:Ke(S,(null===(w=We.primeTime)||void 0===w?void 0:w[0])||""),onOptionChange:function(e){return Je("primeTime",e)},isSearchable:!1}),n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Station Sellout Type",placeholder:"None",options:b,value:Ke(b,We.type),onOptionChange:function(n){Je("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&Ge(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===We.type&&n.jsx(i.Box,e.__assign({onClick:Xe,sx:{width:"100%"}},{children:n.jsx(x.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:j,value:Ke(j,We.lowSelloutConfig),onOptionChange:function(e){return Je("lowSelloutConfig",e)},isSearchable:!1})})),h.useLearningTemplateStore.getState().backwardCompatibility&&n.jsxs("div",e.__assign({ref:we,style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Approval Settings"})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Configure who can approve learnings before they get published."})),n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"16px"}},{children:[n.jsxs("div",e.__assign({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"12px"}},{children:[n.jsxs("div",e.__assign({role:"radio","aria-checked":"approval_required"===Ee,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"},onClick:function(){return ke("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||ke("approval_required")}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===Ee?"#2563EB":"#CBD5E1")}},{children:"approval_required"===Ee&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),n.jsxs("div",e.__assign({style:{gap:"16px"}},{children:["approval_required"===Ee&&n.jsx(y.default,{selectedApprovers:Ae,selectedGroupOfApprovers:Re,onApproversChange:function(e){De(e),Me("")},onGroupsChange:function(e){Ie(e),Me("")}}),Le&&n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:Le}))]}))]})),n.jsxs("div",e.__assign({role:"radio","aria-checked":"publish_without"===Ee,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){ke("publish_without"),Me("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(ke("publish_without"),Me(""))}},{children:[n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[n.jsx("div",e.__assign({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===Ee?"#2563EB":"#CBD5E1")}},{children:"publish_without"===Ee&&n.jsx("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),n.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),n.jsx("p",e.__assign({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}))]}))]})),n.jsxs(i.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column"}},{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[n.jsx("span",e.__assign({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),n.jsx(i.Box,e.__assign({sx:{mb:2}},{children:n.jsx(x.default,{required:!0,label:"",placeholder:"Select Genre",options:Ue,value:Ke(Ue,We.genre),onOptionChange:function(e){return Je("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!K&&P&&Ye(L)},isLoadingOptions:K,hasMoreOptions:P})})),n.jsx(i.Box,e.__assign({sx:{mb:3}},{children:te?n.jsx(u.default,{}):He?n.jsxs(i.Box,e.__assign({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[n.jsx(i.Box,e.__assign({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:n.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("circle",{cx:"12",cy:"12",r:"2"}),n.jsx("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),n.jsxs(i.Box,e.__assign({sx:{flex:1,minWidth:0}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:He.title})),n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:He.description})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[He.inheritedText&&n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[n.jsxs("svg",e.__assign({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("polyline",{points:"15 3 21 3 21 9"}),n.jsx("path",{d:"M21 3L9 15"}),n.jsx("path",{d:"M3 21l6-6"})]})),He.inheritedText]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[He.rulesCount," rules"]})),n.jsxs(i.Box,e.__assign({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[He.tiersCount," Tiers"]}))]}))]}))]})):We.genre?null:n.jsx(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:n.jsx(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))}))})),We.genre&&n.jsxs(n.Fragment,{children:[n.jsxs(i.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",We.genre,"” Scope"," ",n.jsx(i.Typography,e.__assign({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",We.genre,"” category to copy its learnings."]})),n.jsxs("div",e.__assign({className:p.default.searchWrapper,style:{marginBottom:"12px"}},{children:[n.jsx("input",{type:"text",value:J,onChange:function(e){return Q(e.target.value)},placeholder:"Search for station...",className:p.default.searchInput}),n.jsx(o.Search,{className:p.default.searchIcon,size:16})]})),n.jsxs(i.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[re&&n.jsx(u.default,{}),!re&&0===Y.length&&$.trim()&&n.jsxs(i.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',$,'".']})),!re&&Y.map(function(r){return n.jsx(d.default,e.__assign({},r,{isSelected:le===r.id,onSelect:function(e){var n;ue(le===e?null!==(n=null==He?void 0:He.id)&&void 0!==n?n:null:e)}}),r.id)})]}))]})]}))]}))}))]})),n.jsxs(i.Box,e.__assign({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[n.jsx("button",e.__assign({onClick:Ve,disabled:pe,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),n.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n,r,i,o,t,l,u,c,d,p,x,g,f,m,v,y,S,b,j;return e.__generator(this,function(C){switch(C.label){case 0:if(!A||!le)return console.error("[StationOnboard] Missing required data for onboarding"),[2];if(h.useLearningTemplateStore.getState().backwardCompatibility&&"approval_required"===Ee&&0===Ae.length&&0===Re.length)return Me("Please select at least one approver or approver group."),setTimeout(function(){var e;null===(e=we.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50),[2];Me(""),n=He?e.__spreadArray([He],Y,!0):Y,r=n.find(function(e){return e.id===le}),null==r?void 0:r.isCopy,xe(!0),he(0),i=null,C.label=1;case 1:return C.trys.push([1,3,,4]),o=h.useLearningTemplateStore.getState().backwardCompatibility,t=o?{topic:"customRuleSet",customScopeGroupName:_.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:A.station_name||"New Station",parentScopeId:null!==(x=null==He?void 0:He.id)&&void 0!==x?x:null,customScopeName:A.station_name||"New Station",customScopeId:s.v4(),createByName:(null==ye?void 0:ye.firstname)||"System",createdBy:(null==ye?void 0:ye.email)||"system@audacy.com",scopeType:"Station",approvalRequired:"approval_required"===Ee,audacyStationMetadata:{genre:We.genre,low_sellout_configurations:"Low Sellout"===We.type?We.lowSelloutConfig:null,market:A.market,primetime_windows:We.primeTime,region:A.region,station_guid:A.station_guid,station_type:""===We.type?null:We.type},appsecData:{application:null==Te?void 0:Te.applicationId,module:null==Te?void 0:Te.moduleId,roles:e.__spreadArray(e.__spreadArray([],"approval_required"===Ee?[{users:Ae.map(function(e){return e.email}),groups:Re.map(function(e){return e._id}),role:null!==(f=null===(g=Be.find(function(e){return"Learning Manager"===e.name}))||void 0===g?void 0:g._id)&&void 0!==f?f:""}]:[],!0),[{users:[null==ye?void 0:ye.email],groups:[],role:null!==(v=null===(m=Be.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===m?void 0:m._id)&&void 0!==v?v:""}],!1)}}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:A.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:E},console.log("[StationOnboard] Step 1: Creating rule set with payload:",t),[4,a.createRuleSet(t,k)];case 2:if(l=C.sent(),!(i=null===(y=null==l?void 0:l.data)||void 0===y?void 0:y.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",i),he(1),[3,4];case 3:return u=C.sent(),console.error("[StationOnboard] Error creating rule set:",u),null===(S=Se.current)||void 0===S||S.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),xe(!1),he(0),[2];case 4:return C.trys.push([4,6,,7]),c=null!==le&&le!==(null==He?void 0:He.id),d={source_scope_id:c?le:null!==(b=null==He?void 0:He.id)&&void 0!==b?b:le,target_scope_id:i,is_copy_parent_variant_id:c},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",d),[4,a.inheritScopeBackwardCompatible(d)];case 5:return C.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),he(3),[3,7];case 6:return p=C.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",p),null===(j=Se.current)||void 0===j||j.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),xe(!1),he(0),[2];case 7:return be.current=i,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!Qe||pe,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Qe?"#2563EB":"#BFDBFE",color:"#fff",cursor:Qe&&!pe?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:pe?n.jsxs(n.Fragment,{children:[n.jsx(i.CircularProgress,{size:16,color:"inherit"}),n.jsx("span",{children:"Onboarding..."})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Onboard Station"}),n.jsx(o.ArrowRight,{size:16})]})}))]}))]}))};
2
2
  //# sourceMappingURL=StationOnboardModal.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.QUERY_PARAM_KEYS={TAB:"tab",RULESET_ID:"rulesetid",SECTION:"section",OPEN_IL:"openil",ONBOARD_STATION:"onboardstation",VARIANT_ID:"variantid",APPROVAL_ACTION:"approval"},exports.getQueryParam=function(e){return new URLSearchParams(window.location.search).get(e)},exports.setQueryParams=function(e){var t=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var a=e[0],r=e[1];null==r||""===r?t.delete(a):t.set(a,r)});var a=t.toString(),r="".concat(window.location.pathname).concat(a?"?".concat(a):"");window.history.replaceState({},"",r)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.QUERY_PARAM_KEYS={TAB:"tab",RULESET_ID:"rulesetid",SECTION:"section",OPEN_IL:"openil",ONBOARD_STATION:"onboardstation",STATION_NAME:"stationname",VARIANT_ID:"variantid",APPROVAL_ACTION:"approval"},exports.getQueryParam=function(e){return new URLSearchParams(window.location.search).get(e)},exports.setQueryParams=function(e){var t=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var a=e[0],r=e[1];null==r||""===r?t.delete(a):t.set(a,r)});var a=t.toString(),r="".concat(window.location.pathname).concat(a?"?".concat(a):"");window.history.replaceState({},"",r)};
2
2
  //# sourceMappingURL=useLearningTemplateQueryParams.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},a=t.create(function(t){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:n,isStationModalOpen:!1,isILModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.OPEN_IL),isStationOnboardModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.ONBOARD_STATION),scopeTreeData:null,urlVariantId:r.getQueryParam(r.QUERY_PARAM_KEYS.VARIANT_ID),urlApprovalAction:(a=r.getQueryParam(r.QUERY_PARAM_KEYS.APPROVAL_ACTION),"approve"===a||"reject"===a?a:null),stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(r,n){return t(function(t){var a;return{templateMap:e.__assign(e.__assign({},t.templateMap),(a={},a[r]=n,a))}})},setRuleSets:function(e){return t({ruleSets:e})},setScopeTreeData:function(e){return t({scopeTreeData:e})},setStationModalOpen:function(e){return t({isStationModalOpen:e})},setIsILModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.OPEN_IL]=e?"true":null,n)),t({isILModalTriggered:e})},setIsStationOnboardModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.ONBOARD_STATION]=e?"true":null,n)),t({isStationOnboardModalTriggered:e})},setInitialRules:function(e){return t({currentRules:e})},setCreatedVariantInfo:function(e){return t({createdVariantInfo:e})},resetCreatedVariantInfo:function(){return t({createdVariantInfo:null})},clearUrlApprovalParams:function(){var e;r.setQueryParams(((e={})[r.QUERY_PARAM_KEYS.VARIANT_ID]=null,e[r.QUERY_PARAM_KEYS.APPROVAL_ACTION]=null,e)),t({urlVariantId:null,urlApprovalAction:null})},rawAuditRuleData:null,setRawAuditRuleData:function(e){return t({rawAuditRuleData:e})},setSelectedRuleSetId:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),t({selectedRuleSetId:e})},toggleRuleTier:function(r){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{isOpen:!t.isOpen}):t})}})},deleteRule:function(r,n){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{rules:t.rules.filter(function(e){return e.id!==n}),ruleCount:t.ruleCount-1}):t})}})},setStations:function(e){return t({stations:e})},addStation:function(r){return t(function(t){return{stations:e.__spreadArray(e.__spreadArray([],t.stations,!0),[r],!1)}})},deleteStation:function(e){return t(function(t){return{stations:t.stations.filter(function(t){return t.stationId!==e}),selectedStationId:t.selectedStationId===e?null:t.selectedStationId}})},error:null,setError:function(e){return t({error:e})},tiers:[],setTiers:function(e){return t({tiers:e})},backwardCompatibility:!1,setBackwardCompatibility:function(e){return t({backwardCompatibility:e})},app_integration_id:null,setAppIntegrationId:function(e){return t({app_integration_id:e})},token:"",setToken:function(e){return t({token:e})}};var a});exports.INITIAL_RULE_SETS=n,exports.useLearningTemplateStore=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},a=t.create(function(t){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:n,isStationModalOpen:!1,isILModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.OPEN_IL),isStationOnboardModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.ONBOARD_STATION),scopeTreeData:null,urlVariantId:r.getQueryParam(r.QUERY_PARAM_KEYS.VARIANT_ID),urlApprovalAction:(a=r.getQueryParam(r.QUERY_PARAM_KEYS.APPROVAL_ACTION),"approve"===a||"reject"===a?a:null),stationNameParam:r.getQueryParam(r.QUERY_PARAM_KEYS.STATION_NAME),stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(r,n){return t(function(t){var a;return{templateMap:e.__assign(e.__assign({},t.templateMap),(a={},a[r]=n,a))}})},setRuleSets:function(e){return t({ruleSets:e})},setScopeTreeData:function(e){return t({scopeTreeData:e})},setStationModalOpen:function(e){return t({isStationModalOpen:e})},setIsILModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.OPEN_IL]=e?"true":null,n)),t({isILModalTriggered:e})},setIsStationOnboardModalTriggered:function(n){var a,u;r.setQueryParams(e.__assign(((a={})[r.QUERY_PARAM_KEYS.ONBOARD_STATION]=n?"true":null,a),n?{}:((u={})[r.QUERY_PARAM_KEYS.STATION_NAME]=null,u))),t(e.__assign({isStationOnboardModalTriggered:n},n?{}:{stationNameParam:null}))},setStationNameParam:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.STATION_NAME]=e,n)),t({stationNameParam:e})},setInitialRules:function(e){return t({currentRules:e})},setCreatedVariantInfo:function(e){return t({createdVariantInfo:e})},resetCreatedVariantInfo:function(){return t({createdVariantInfo:null})},clearUrlApprovalParams:function(){var e;r.setQueryParams(((e={})[r.QUERY_PARAM_KEYS.VARIANT_ID]=null,e[r.QUERY_PARAM_KEYS.APPROVAL_ACTION]=null,e)),t({urlVariantId:null,urlApprovalAction:null})},rawAuditRuleData:null,setRawAuditRuleData:function(e){return t({rawAuditRuleData:e})},setSelectedRuleSetId:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),t({selectedRuleSetId:e})},toggleRuleTier:function(r){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{isOpen:!t.isOpen}):t})}})},deleteRule:function(r,n){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{rules:t.rules.filter(function(e){return e.id!==n}),ruleCount:t.ruleCount-1}):t})}})},setStations:function(e){return t({stations:e})},addStation:function(r){return t(function(t){return{stations:e.__spreadArray(e.__spreadArray([],t.stations,!0),[r],!1)}})},deleteStation:function(e){return t(function(t){return{stations:t.stations.filter(function(t){return t.stationId!==e}),selectedStationId:t.selectedStationId===e?null:t.selectedStationId}})},error:null,setError:function(e){return t({error:e})},tiers:[],setTiers:function(e){return t({tiers:e})},backwardCompatibility:!1,setBackwardCompatibility:function(e){return t({backwardCompatibility:e})},app_integration_id:null,setAppIntegrationId:function(e){return t({app_integration_id:e})},token:"",setToken:function(e){return t({token:e})}};var a});exports.INITIAL_RULE_SETS=n,exports.useLearningTemplateStore=a;
2
2
  //# sourceMappingURL=useLearningTemplateStore.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useMemo as i,useEffect as n}from"react";import{AuditLog as r}from"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import{User as l,ExternalLink as a}from"lucide-react";import d from"./ChangeLogDiff.js";import{dt as c}from"../store/useLMSConfigStore.js";var s=function(s){var h=s.configId,p=s.ruleData,g=s.scopeId,m=s.scopeName,u=(null==m?void 0:m.trim())||"Selected",f=i(function(){var e=[];return g&&e.push(g),e},[p,g]);return n(function(){console.log("Flattened External Resource IDs:",f)},[f]),t("div",e({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[t("div",e({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[o("h1",e({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:c("history.title","".concat(u," - Audit Log"),{scope_name:u})})),o("p",e({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:c("history.subtitle","Track all learning updates and modifications with the ".concat(u," scope."),{scope_name:u})}))]})),o(r,{configId:h,getData:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/distinct-values"},query:{externalResourceId:f.length>0?f:[""],paginationLimit:10},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(i){return t("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[o(l,{size:16,color:"#64748b",style:{flexShrink:0}}),o("span",e({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(t){var i,n,r=(i=t.changeTitle,(n=(i||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),l=t.changeTitle?t.changeTitle.replace(/_/g," "):"—";return o("span",e({style:{color:r.color,backgroundColor:r.backgroundColor,border:"1px solid ".concat(r.borderColor),boxShadow:r.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:l}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var t;return o(d,{change:null!==(t=e.actionText)&&void 0!==t?t:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var n,r=(null===(n=i.metadata)||void 0===n?void 0:n.redirect_url)||i.redirect_url;return r?o("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t("a",e({href:r,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",o(a,{size:14})]}))})):o("span",e({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(i){if(!i.actionDate)return o("span",e({style:{color:"#94a3b8"}},{children:"—"}));var n=new Date(i.actionDate),r=n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),l=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return t("div",e({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[o("span",e({style:{fontWeight:500}},{children:r})),o("span",{children:l})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}})]}))};export{s as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as i,useMemo as n,useEffect as a}from"react";import{AuditLog as r}from"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import{User as l,ExternalLink as c}from"lucide-react";import s from"./ChangeLogDiff.js";import{dt as d}from"../store/useLMSConfigStore.js";import p from"../RBAC/AccessPanel.module.css.js";var h=function(h){var g=h.configId,u=h.ruleData,m=h.scopeId,f=h.scopeName,b=(null==f?void 0:f.trim())||"Selected",y=i("scope"),x=y[0],C=y[1],v=n(function(){var e=[];return m&&e.push(m),e},[u,m]);a(function(){console.log("Flattened External Resource IDs:",v)},[v]);var w={configId:g,getData:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/distinct-values"},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(i){return t("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[o(l,{size:16,color:"#64748b",style:{flexShrink:0}}),o("span",e({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(t){var i,n,a=(i=t.changeTitle,(n=(i||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),r=t.changeTitle?t.changeTitle.replace(/_/g," "):"—";return o("span",e({style:{color:a.color,backgroundColor:a.backgroundColor,border:"1px solid ".concat(a.borderColor),boxShadow:a.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:r}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var t;return o(s,{change:null!==(t=e.actionText)&&void 0!==t?t:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var n,a=(null===(n=i.metadata)||void 0===n?void 0:n.redirect_url)||i.redirect_url;return a?o("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t("a",e({href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",o(c,{size:14})]}))})):o("span",e({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(i){if(!i.actionDate)return o("span",e({style:{color:"#94a3b8"}},{children:"—"}));var n=new Date(i.actionDate),a=n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),r=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return t("div",e({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[o("span",e({style:{fontWeight:500}},{children:a})),o("span",{children:r})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}};return t("div",e({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[t("div",e({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[o("h1",e({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:d("history.title","".concat(b," - Audit Log"),{scope_name:b})})),o("p",e({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:d("history.subtitle","Track all learning updates and modifications with the ".concat(b," scope."),{scope_name:b})}))]})),t("div",e({className:p.accessTabs,role:"tablist","aria-label":"Audit log level"},{children:[o("button",e({type:"button",role:"tab","aria-selected":"scope"===x,className:"".concat(p.accessTab," ").concat("scope"===x?p.accessTabActive:""),onClick:function(){return C("scope")}},{children:d("history.scopeLevel","Scope Level")})),o("button",e({type:"button",role:"tab","aria-selected":"application"===x,className:"".concat(p.accessTab," ").concat("application"===x?p.accessTabActive:""),onClick:function(){return C("application")}},{children:d("history.applicationLevel","Application Level")}))]})),"scope"===x?o(r,e({},w,{query:{externalResourceId:v.length>0?v:[""],paginationLimit:10}}),"scope-audit-log"):o(r,e({},w,{query:{externalResourceId:[],paginationLimit:10}}),"application-audit-log")]}))};export{h as default};
2
2
  //# sourceMappingURL=AuditLog.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import t from"./RuleContent/RuleContent.js";import i from"./StationsContent/StationsContent.js";import a from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import r from"./store/useEnvStore.js";import s from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as l}from"./utils/treeUtils.js";import d from"./SidebarWrapper.js";import{useLearningTemplateStore as c}from"./store/useLearningTemplateStore.js";import u from"./components/StationOnboarding/StationOnboardModal.js";import p from"./AuditLog/AuditLog.js";var m=function(m){var f,S,C=m.onOpenCreateModal,v=m.onRefreshRuleSets,g=m.scopeTreeData,h=m.onAddChild,R=m.onRenameChild,j=m.onDeleteChild,A=m.canDeleteScope,D=m.canEditScope,I=m.canCreateScope,M=m.onSectionSelect,O=m.onViewStation,w=m.activeSectionId,y=void 0===w?"learnings":w,L=m.sectionsConfig,T=m.nodeTypesConfig,_=m.app_integration_id,k=m.token,b=c(function(e){return e.isStationModalOpen}),N=c(function(e){return e.setStationModalOpen}),x=c(function(e){return e.selectedRuleSetId}),B=c(function(e){return e.rawAuditRuleData}),E=r(function(e){return e.auditLogConfig});c(function(e){return e.ruleData});var U=x?l((null==g?void 0:g.data)||null,x):null;return Boolean((null===(f=null==g?void 0:g.data)||void 0===f?void 0:f.id)&&x===g.data.id),o("div",e({className:s.container},{children:[n(d,{onOpenCreateModal:C,onRefreshRuleSets:v,scopeTreeData:g,onAddChild:h,onRenameChild:R,onDeleteChild:j,canDeleteScope:A,canEditScope:D,canCreateScope:I,onSectionSelect:M,activeSectionId:y,sectionsConfig:L,nodeTypesConfig:T}),n("div",e({id:"rule-template-layout-content",className:"".concat(s.content," relative flex-1 overflow-hidden")},{children:"stations"===y?n(i,{scopeId:x||"",scopeName:(null==U?void 0:U.name)||"Unknown Scope",stationsCount:null===(S=null==U?void 0:U.metrics)||void 0===S?void 0:S.stationsCount,onViewStation:O}):"access"===y?n(a,{selectedRuleSetId:x,useApplicationModuleForScopeAccess:!1}):"history"===y?(null==E?void 0:E.configId)?n(p,{configId:E.configId,scopeId:x||void 0,scopeName:(null==U?void 0:U.name)||"Unknown Scope",ruleData:B}):null:n(t,{onRefreshRuleSets:v,app_integration_id:_,token:k})})),n(u,{isOpen:b,onClose:function(){N(!1)},onBoardStation:function(e){v(!0,e)},app_integration_id:_,token:k})]}))};export{m as default};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useEffect as t}from"react";import i from"./RuleContent/RuleContent.js";import r from"./StationsContent/StationsContent.js";import a from"./RBAC/AccessManagementPanel.js";import"appsec-ui";import"./store/useAuthStore.js";import"./store/usePermissionsStore.js";import s from"./store/useEnvStore.js";import l from"./styles/LearningTemplateLayout.module.css.js";import{findNodeById as d}from"./utils/treeUtils.js";import c from"./SidebarWrapper.js";import{useLearningTemplateStore as u}from"./store/useLearningTemplateStore.js";import p from"./components/StationOnboarding/StationOnboardModal.js";import m from"./AuditLog/AuditLog.js";var f=function(f){var S,g,v=f.onOpenCreateModal,C=f.onRefreshRuleSets,h=f.scopeTreeData,R=f.onAddChild,j=f.onRenameChild,A=f.onDeleteChild,I=f.canDeleteScope,D=f.canEditScope,M=f.canCreateScope,O=f.onSectionSelect,T=f.onViewStation,w=f.activeSectionId,b=void 0===w?"learnings":w,k=f.sectionsConfig,y=f.nodeTypesConfig,L=f.app_integration_id,_=f.token,N=u(function(e){return e.isStationModalOpen}),U=u(function(e){return e.setStationModalOpen}),x=u(function(e){return e.isStationOnboardModalTriggered}),B=u(function(e){return e.setIsStationOnboardModalTriggered}),E=u(function(e){return e.selectedRuleSetId}),P=u(function(e){return e.rawAuditRuleData}),V=s(function(e){return e.auditLogConfig});u(function(e){return e.ruleData});var F=E?d((null==h?void 0:h.data)||null,E):null;return Boolean((null===(S=null==h?void 0:h.data)||void 0===S?void 0:S.id)&&E===h.data.id),t(function(){x&&U(!0)},[x,U,B]),o("div",e({className:l.container},{children:[n(c,{onOpenCreateModal:v,onRefreshRuleSets:C,scopeTreeData:h,onAddChild:R,onRenameChild:j,onDeleteChild:A,canDeleteScope:I,canEditScope:D,canCreateScope:M,onSectionSelect:O,activeSectionId:b,sectionsConfig:k,nodeTypesConfig:y}),n("div",e({id:"rule-template-layout-content",className:"".concat(l.content," relative flex-1 overflow-hidden")},{children:"stations"===b?n(r,{scopeId:E||"",scopeName:(null==F?void 0:F.name)||"Unknown Scope",stationsCount:null===(g=null==F?void 0:F.metrics)||void 0===g?void 0:g.stationsCount,onViewStation:T}):"access"===b?n(a,{selectedRuleSetId:E,scopeName:(null==F?void 0:F.name)||"Unknown Scope",useApplicationModuleForScopeAccess:!1}):"history"===b?(null==V?void 0:V.configId)?n(m,{configId:V.configId,scopeId:E||void 0,scopeName:(null==F?void 0:F.name)||"Unknown Scope",ruleData:P}):null:n(i,{onRefreshRuleSets:C,app_integration_id:L,token:_})})),n(p,{isOpen:N,onClose:function(){U(!1),B(!1)},onBoardStation:function(e){C(!0,e)},app_integration_id:L,token:_})]}))};export{f as default};
2
2
  //# sourceMappingURL=LearningTemplateLayout.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as c,jsx as s}from"react/jsx-runtime";import{useState as o}from"react";import a from"./AccessPanel.js";import t from"../store/useEnvStore.js";import{usePermissionsStore as i}from"../store/usePermissionsStore.js";import l from"./AccessPanel.module.css.js";import{dt as n}from"../store/useLMSConfigStore.js";var r=function(r){var p=r.selectedRuleSetId,d=r.useApplicationModuleForScopeAccess,u=void 0!==d&&d,m=o("scope"),v=m[0],b=m[1],f=t(function(e){return e.rbacConfig}),A=i(function(e){return e.hasPermission}),I=null==f?void 0:f.applicationResourceId,S=(null==f?void 0:f.applicationModuleId)||(null==f?void 0:f.moduleId),h=u?S:null==f?void 0:f.moduleId,j=Boolean(I&&A("ilotj.scope.access.application.view",I));return c("div",e({className:l.accessManagement},{children:[c("div",e({className:l.accessTabs,role:"tablist","aria-label":"Access level"},{children:[s("button",e({type:"button",role:"tab","aria-selected":"scope"===v,className:"".concat(l.accessTab," ").concat("scope"===v?l.accessTabActive:""),onClick:function(){return b("scope")}},{children:n("access.scopeLevelAccess","Scope Level Access")})),s("button",e({type:"button",role:"tab","aria-selected":"application"===v,className:"".concat(l.accessTab," ").concat("application"===v?l.accessTabActive:""),onClick:function(){return b("application")},disabled:!j,title:j?"":"You don't have permission to view application access"},{children:n("access.appLevelAccess","Application Level Access")}))]})),s("div",e({className:l.accessTabPanel,role:"tabpanel"},{children:s(a,"application"===v?{resourceId:I,moduleId:S,accessLevel:"application"}:{ruleSetId:p,moduleId:h,accessLevel:"scope"})}))]}))};export{r as default};
1
+ import{__assign as e}from"tslib";import{jsxs as c,jsx as s}from"react/jsx-runtime";import{useState as o}from"react";import a from"./AccessPanel.js";import t from"../store/useEnvStore.js";import{usePermissionsStore as i}from"../store/usePermissionsStore.js";import l from"./AccessPanel.module.css.js";import{dt as n}from"../store/useLMSConfigStore.js";var r=function(r){var p=r.selectedRuleSetId,d=r.useApplicationModuleForScopeAccess,m=void 0!==d&&d,u=r.scopeName,v=(null==u?void 0:u.trim())||"Selected",f=o("scope"),b=f[0],h=f[1],g=t(function(e){return e.rbacConfig}),A=i(function(e){return e.hasPermission}),S=null==g?void 0:g.applicationResourceId,x=(null==g?void 0:g.applicationModuleId)||(null==g?void 0:g.moduleId),I=m?x:null==g?void 0:g.moduleId,j=Boolean(S&&A("ilotj.scope.access.application.view",S));return c("div",e({className:l.accessManagement},{children:[s("div",e({style:{padding:"24px 24px 0",fontFamily:"Arial, sans-serif"}},{children:c("div",e({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[s("h1",e({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:n("access.title","".concat(v," - Access Management"),{scope_name:v})})),s("p",e({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:n("access.subtitle","Manage users and groups within the ".concat(v," scope."),{scope_name:v})}))]}))})),c("div",e({className:l.accessTabs,role:"tablist","aria-label":"Access level"},{children:[s("button",e({type:"button",role:"tab","aria-selected":"scope"===b,className:"".concat(l.accessTab," ").concat("scope"===b?l.accessTabActive:""),onClick:function(){return h("scope")}},{children:n("access.scopeLevelAccess","Scope Level Access")})),s("button",e({type:"button",role:"tab","aria-selected":"application"===b,className:"".concat(l.accessTab," ").concat("application"===b?l.accessTabActive:""),onClick:function(){return h("application")},disabled:!j,title:j?"":"You don't have permission to view application access"},{children:n("access.appLevelAccess","Application Level Access")}))]})),s("div",e({className:l.accessTabPanel,role:"tabpanel"},{children:s(a,"application"===b?{resourceId:S,moduleId:x,accessLevel:"application"}:{ruleSetId:p,moduleId:I,accessLevel:"scope"})}))]}))};export{r as default};
2
2
  //# sourceMappingURL=AccessManagementPanel.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as a,__generator as r}from"tslib";import{jsx as l,jsxs as i,Fragment as n}from"react/jsx-runtime";import{useState as s,useEffect as t}from"react";import{X as c,Loader2 as o}from"lucide-react";import d from"../styles/CreateLearningSetModal.module.css.js";var u=function(u){var m=u.isOpen,h=u.onClose,p=u.onSubmit,v=u.title,f=u.description,N=u.inputLabel,b=u.submitLabel,g=u.placeholder,C=void 0===g?"":g,y=u.initialValue,k=void 0===y?"":y,L=u.isLoading,S=void 0!==L&&L,x=s(""),B=x[0],j=x[1],M=s(null),q=M[0],w=M[1];if(t(function(){m&&(j(k),w(null))},[m,k]),!m)return null;return l("div",e({className:d.overlay},{children:i("div",e({className:d.modal},{children:[i("div",e({className:d.header},{children:[i("div",e({className:d.headerContent},{children:[l("h2",e({className:d.title},{children:v})),f&&l("p",e({className:d.description},{children:f}))]})),l("button",e({onClick:h,className:d.closeBtn,disabled:S},{children:l(c,{size:24})}))]})),l("div",e({className:d.form},{children:i("div",e({className:d.formGroup},{children:[i("label",e({className:d.label},{children:[l("span",e({className:d.asterisk},{children:"*"})),N]})),l("input",{type:"text",value:B,onChange:function(e){j(e.target.value),q&&w(null)},className:"".concat(d.inputField," ").concat(q?d.inputError:""),placeholder:C,disabled:S}),q&&l("p",e({className:d.errorMessage},{children:q}))]}))})),i("div",e({className:d.footer},{children:[l("button",e({onClick:h,className:d.cancelBtn,disabled:S},{children:"Cancel"})),l("button",e({onClick:function(){return a(void 0,void 0,void 0,function(){var e;return r(this,function(a){switch(a.label){case 0:if(!(B.trim()?(w(null),1):(w("".concat(N.replace("*","").trim()," is required")),0)))return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,p(B)];case 2:return a.sent(),h(),[3,4];case 3:return e=a.sent(),w((null==e?void 0:e.message)||"An error occurred. Please try again."),[3,4];case 4:return[2]}})})},className:d.confirmBtn,disabled:S},{children:S?i(n,{children:[l(o,{className:d.spinner}),"Save"===b?"Saving...":"Creating..."]}):b}))]}))]}))}))};export{u as default};
1
+ import{__assign as e,__awaiter as l,__generator as r}from"tslib";import{jsx as i,jsxs as a,Fragment as n}from"react/jsx-runtime";import{useState as s,useEffect as t}from"react";import{X as c,Loader2 as o}from"lucide-react";import d from"../styles/CreateLearningSetModal.module.css.js";var u=function(u){var m=u.isOpen,v=u.onClose,h=u.onSubmit,p=u.title,f=u.description,b=u.inputLabel,N=u.submitLabel,g=u.placeholder,C=void 0===g?"":g,y=u.initialValue,k=void 0===y?"":y,x=u.isLoading,L=void 0!==x&&x,S=s(""),B=S[0],M=S[1],j=s(null),w=j[0],E=j[1];if(t(function(){m&&(M(k),E(null))},[m,k]),!m)return null;return i("div",e({className:d.overlay},{children:a("div",e({className:d.modal},{children:[a("div",e({className:d.header},{children:[a("div",e({className:d.headerContent},{children:[i("h2",e({className:d.title},{children:p})),f&&i("p",e({className:d.description},{children:f}))]})),i("button",e({onClick:v,className:d.closeBtn,disabled:L},{children:i(c,{size:24})}))]})),i("div",e({className:d.form},{children:a("div",e({className:d.formGroup},{children:[a("label",e({className:d.label},{children:[i("span",e({className:d.asterisk},{children:"*"})),b]})),i("input",{type:"text",value:B,onChange:function(e){var l=e.target.value;if(l.length>50)return M(l.slice(0,50)),void E("Maximum 50 characters allowed");M(l),w&&E(null)},className:"".concat(d.inputField," ").concat(w?d.inputError:""),placeholder:C,disabled:L}),w&&i("p",e({className:d.errorMessage},{children:w}))]}))})),a("div",e({className:d.footer},{children:[i("button",e({onClick:v,className:d.cancelBtn,disabled:L},{children:"Cancel"})),i("button",e({onClick:function(){return l(void 0,void 0,void 0,function(){var e,l,i;return r(this,function(r){switch(r.label){case 0:if(!(B.trim()?(E(null),1):(E("".concat(b.replace("*","").trim()," is required")),0)))return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,h(B)];case 2:return r.sent(),v(),[3,4];case 3:return e=r.sent(),console.error("Error in submission",e),409===(null==e?void 0:e.status)?(E(null===(i=null===(l=null==e?void 0:e.response)||void 0===l?void 0:l.data)||void 0===i?void 0:i.message),[2]):(E((null==e?void 0:e.message)||"An error occurred. Please try again."),[3,4]);case 4:return[2]}})})},className:d.confirmBtn,disabled:L},{children:L?a(n,{children:[i(o,{className:d.spinner}),"Save"===N?"Saving...":"Creating..."]}):N}))]}))]}))}))};export{u as default};
2
2
  //# sourceMappingURL=CreateLearningSetModal.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__awaiter as o,__generator as r,__spreadArray as n}from"tslib";import{jsxs as i,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as s,useMemo as c,useEffect as p}from"react";import{Dialog as u,Box as d,Typography as f,IconButton as m,DialogContent as h,CircularProgress as g}from"@mui/material";import{X as x,Search as v,ArrowRight as b}from"lucide-react";import{Toast as S}from"primereact/toast";import{v4 as y}from"uuid";import{retrieveGenreScopes as C,searchScopes as w,inheritScopeBackwardCompatible as _,createRuleSet as F}from"../../apis/scopeApis.js";import T from"./StationAutocomplete.js";import k from"../CardSkeleton.js";import E from"./OnboardingLoader.js";import z from"./TemplateCard.js";import D from"../../styles/StationOnboardModal.module.css.js";import B from"./InputField.js";import O from"../../store/useAuthStore.js";import{useConfigStore as I}from"../../store/useConfigStore.js";import{useLearningTemplateStore as A}from"../../store/useLearningTemplateStore.js";import{IL_CONFIG_CONSTANTS as R}from"../../config.js";import{useAppSecRolesStore as j}from"../../store/useAppSecRolesStore.js";import L from"../../store/useEnvStore.js";import N from"../../RuleContent/AddScopeApprovalSearchComponent.js";var M=[{label:"PT - Pacific Time",value:"Pacific Time"},{label:"MT - Mountain Time",value:"Mountain Time"},{label:"CT - Central Time",value:"Central Time"},{label:"ET - Eastern Time",value:"Eastern Time"}],W=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],q=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],P=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}],G=function(G){var U,H=G.isOpen,K=G.onClose,Y=G.onBoardStation,Z=G.app_integration_id,V=G.token,X=a(null),J=X[0],Q=X[1],$=a([]),ee=$[0],oe=$[1],re=a(0),ne=re[0],ie=re[1],te=a(!0),le=te[0],ae=te[1],se=a(!1),ce=se[0],pe=se[1],ue=a([]),de=ue[0],fe=ue[1],me=a(""),he=me[0],ge=me[1],xe=a(""),ve=xe[0],be=xe[1],Se=a(!1),ye=Se[0],Ce=Se[1],we=a(!1),_e=we[0],Fe=we[1],Te=a(null),ke=Te[0],Ee=Te[1],ze=a(null);ze[0],ze[1];var De=a(!1),Be=De[0],Oe=De[1],Ie=a(0),Ae=Ie[0],Re=Ie[1],je=a(""),Le=je[0],Ne=je[1],Me=O().user,We=s(null),qe=s(null),Pe=s(null),Ge=s(null);I().configuration;var Ue=s(null),He=j(function(e){return e.roles}),Ke=L(function(e){return e.rbacConfig}),Ye=a("approval_required"),Ze=Ye[0],Ve=Ye[1],Xe=a([]),Je=Xe[0],Qe=Xe[1],$e=a([]),eo=$e[0],oo=$e[1],ro=a(""),no=ro[0],io=ro[1],to=a({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),lo=to[0],ao=to[1],so=function(e,o){return e.find(function(e){return e.value===o})||null},co=c(function(){return ee.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[ee]),po=c(function(){var e,o,r;if(!lo.genre)return null;var n=ee.find(function(e){return e.scope_name===lo.genre});return n?{id:n.id,title:n.scope_name||"Unnamed Template",description:(null===(e=n.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(o=n.inheritance)||void 0===o?void 0:o[0])||void 0,rulesCount:n.rules_count||0,tiersCount:n.tier_count||0,isCopy:null!==(r=n.is_copy)&&void 0!==r&&r}:null},[lo.genre,ee]);p(function(){return function(){Pe.current&&clearTimeout(Pe.current)}},[]);var uo=function(e){return o(void 0,void 0,void 0,function(){var o,i,t;return r(this,function(r){switch(r.label){case 0:if(ce)return[2];pe(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,C({limit:"20",offset:String(e)})];case 2:return"success"===(null==(o=r.sent())?void 0:o.status)&&Array.isArray(null==o?void 0:o.data)?(i=o.data,oe(function(o){if(0===e)return i;var r=new Set(o.map(function(e){return e.id})),t=i.filter(function(e){return!r.has(e.id)});return n(n([],o,!0),t,!0)}),i.length<20?ae(!1):ae(!0),ie(e+20)):ae(!1),[3,5];case 3:return t=r.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",t),ae(!1),[3,5];case 4:return pe(!1),[7];case 5:return[2]}})})};p(function(){H&&(oe([]),ie(0),ae(!0),uo(0))},[H]);p(function(){ao(J?function(o){var r;return e(e({},o),{region:null!==(r=J.market)&&void 0!==r?r:""})}:{region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""})},[J]),p(function(){var e=setTimeout(function(){be(he)},500);return function(){return clearTimeout(e)}},[he]),p(function(){o(void 0,void 0,void 0,function(){var e,o,n,i;return r(this,function(r){switch(r.label){case 0:if(!ve.trim())return fe([]),[2];Ce(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,w({search_string:ve.trim()})];case 2:return"success"===(null==(e=r.sent())?void 0:e.status)&&Array.isArray(null==e?void 0:e.data)?(o=e.data.filter(function(e){var o,r=null!==(o=e.inheritance)&&void 0!==o?o:[],n=r.indexOf(e.scope_name);return!(n<=0)&&r[n-1]===lo.genre}),n=o.map(function(e){var o,r,n;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(o=e.description)||void 0===o?void 0:o.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(n=e.is_copy)&&void 0!==n&&n}}),fe(n)):fe([]),[3,5];case 3:return i=r.sent(),console.error("[StationOnboard] Error searching scopes:",i),fe([]),[3,5];case 4:return Ce(!1),[7];case 5:return[2]}})})},[ve,lo.genre]),p(function(){!ve.trim()&&po&&Ee(po.id)},[ve,po]);var fo=function(){setTimeout(function(){Ge.current&&Ge.current.scrollTo({top:Ge.current.scrollHeight,behavior:"smooth"})},100)},mo=function(){Ne(""),Q(null),ao({region:"",timezone:"",primeTime:[],genre:"",type:"",lowSelloutConfig:""}),fe([]),ge(""),Ee(null),Ve("approval_required"),Qe([]),oo([]),io(""),K()},ho=function(o,r){var n;if("primeTime"!==o){var i=null!==(n=null==r?void 0:r.value)&&void 0!==n?n:"";ao(function(r){var n;return e(e({},r),((n={})[o]=String(i),n))}),"genre"===o&&(Fe(!0),Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(function(){var e=ee.find(function(e){return e.scope_name===i});Ee(e?e.id:null),Fe(!1)},800))}else{var t=(null==r?void 0:r.value)?String(r.value):"";ao(function(o){return e(e({},o),{primeTime:t?[t]:[]})})}},go=Boolean(J&&lo.region&&lo.timezone&&lo.primeTime.length>0&&lo.genre);return i(u,e({open:H,onClose:mo,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[t(S,{ref:We}),i(d,e({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[i(d,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(f,e({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),t(f,e({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),t(m,e({onClick:mo,disabled:Be,sx:{color:"#19213D"}},{children:t(x,{size:24})}))]})),i(h,e({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[t(E,{isLoading:Be,currentStep:Ae,onComplete:function(){Oe(!1);var e=qe.current;mo(),Y(e||void 0),qe.current=null}}),t(d,e({sx:{display:"flex",flex:1,flexDirection:"column",paddingY:"14px",paddingX:"20px",gap:2,overflowY:"auto"}},{children:i(d,e({sx:{display:"flex",gap:3}},{children:[i(d,e({ref:Ge,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5"}},{children:[t(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),t(f,e({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),i(d,e({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[i(d,e({className:D.formGroup},{children:[i("label",e({className:D.label},{children:[t("span",e({className:D.asterisk},{children:"*"})),"Station Name/Call Letters"]})),t(T,{value:Le,onChange:Ne,onStationSelect:function(e){return Q(e)}})]})),t(B,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:lo.region||void 0,isSearchable:!1}),t(B,{required:!0,label:"TimeZone",placeholder:"Select TimeZone",options:M,value:so(M,lo.timezone),onOptionChange:function(e){return ho("timezone",e)},isSearchable:!1}),t(B,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:W,value:so(W,(null===(U=lo.primeTime)||void 0===U?void 0:U[0])||""),onOptionChange:function(e){return ho("primeTime",e)},isSearchable:!1}),t(d,e({onClick:fo,sx:{width:"100%"}},{children:t(B,{label:"Station Type",placeholder:"None",options:q,value:so(q,lo.type),onOptionChange:function(o){ho("type",o),"Low Sellout"!==(null==o?void 0:o.value)&&ao(function(o){return e(e({},o),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===lo.type&&t(d,e({onClick:fo,sx:{width:"100%"}},{children:t(B,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:P,value:so(P,lo.lowSelloutConfig),onOptionChange:function(e){return ho("lowSelloutConfig",e)},isSearchable:!1})})),A.getState().backwardCompatibility&&i("div",e({ref:Ue,style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[t(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Approval Settings"})),t(f,e({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Configure who can approve learnings before they get published."})),i("div",e({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"16px"}},{children:[i("div",e({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"12px"}},{children:[i("div",e({role:"radio","aria-checked":"approval_required"===Ze,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"},onClick:function(){return Ve("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Ve("approval_required")}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t("div",e({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===Ze?"#2563EB":"#CBD5E1")}},{children:"approval_required"===Ze&&t("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),t("span",e({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),i("div",e({style:{gap:"16px"}},{children:["approval_required"===Ze&&t(N,{selectedApprovers:Je,selectedGroupOfApprovers:eo,onApproversChange:function(e){Qe(e),io("")},onGroupsChange:function(e){oo(e),io("")}}),no&&t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:no}))]}))]})),i("div",e({role:"radio","aria-checked":"publish_without"===Ze,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){Ve("publish_without"),io("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(Ve("publish_without"),io(""))}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t("div",e({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===Ze?"#2563EB":"#CBD5E1")}},{children:"publish_without"===Ze&&t("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),t("span",e({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}))]}))]})),i(d,e({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column"}},{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[t("span",e({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),t(f,e({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),t(d,e({sx:{mb:2}},{children:t(B,{required:!0,label:"",placeholder:"Select Genre",options:co,value:so(co,lo.genre),onOptionChange:function(e){return ho("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!ce&&le&&uo(ne)},isLoadingOptions:ce,hasMoreOptions:le})})),t(d,e({sx:{mb:3}},{children:_e?t(k,{}):po?i(d,e({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[t(d,e({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("circle",{cx:"12",cy:"12",r:"2"}),t("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),i(d,e({sx:{flex:1,minWidth:0}},{children:[t(f,e({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:po.title})),t(f,e({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:po.description})),i(d,e({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[po.inheritedText&&i(d,e({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[i("svg",e({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("polyline",{points:"15 3 21 3 21 9"}),t("path",{d:"M21 3L9 15"}),t("path",{d:"M3 21l6-6"})]})),po.inheritedText]})),i(d,e({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[po.rulesCount," rules"]})),i(d,e({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[po.tiersCount," Tiers"]}))]}))]}))]})):lo.genre?null:t(d,e({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:t(f,e({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))}))})),lo.genre&&i(l,{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",lo.genre,"” Scope"," ",t(f,e({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),i(f,e({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",lo.genre,"” category to copy its learnings."]})),i("div",e({className:D.searchWrapper,style:{marginBottom:"12px"}},{children:[t("input",{type:"text",value:he,onChange:function(e){return ge(e.target.value)},placeholder:"Search for station...",className:D.searchInput}),t(v,{className:D.searchIcon,size:16})]})),i(d,e({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[ye&&t(k,{}),!ye&&0===de.length&&ve.trim()&&i(f,e({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',ve,'".']})),!ye&&de.map(function(o){return t(z,e({},o,{isSelected:ke===o.id,onSelect:function(e){var o;Ee(ke===e?null!==(o=null==po?void 0:po.id)&&void 0!==o?o:null:e)}}),o.id)})]}))]})]}))]}))}))]})),i(d,e({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[t("button",e({onClick:mo,disabled:Be,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),t("button",e({onClick:function(){return o(void 0,void 0,void 0,function(){var e,o,i,t,l,a,s,c,p,u,d,f,m,h,g,x,v,b,S;return r(this,function(r){switch(r.label){case 0:if(!J||!ke)return console.error("[StationOnboard] Missing required data for onboarding"),[2];if(A.getState().backwardCompatibility&&"approval_required"===Ze&&0===Je.length&&0===eo.length)return io("Please select at least one approver or approver group."),setTimeout(function(){var e;null===(e=Ue.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50),[2];io(""),e=po?n([po],de,!0):de,o=e.find(function(e){return e.id===ke}),null==o?void 0:o.isCopy,Oe(!0),Re(0),i=null,r.label=1;case 1:return r.trys.push([1,3,,4]),t=A.getState().backwardCompatibility,l=t?{topic:"customRuleSet",customScopeGroupName:R.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:J.station_name||"New Station",parentScopeId:null!==(d=null==po?void 0:po.id)&&void 0!==d?d:null,customScopeName:J.station_name||"New Station",customScopeId:y(),createByName:(null==Me?void 0:Me.firstname)||"System",createdBy:(null==Me?void 0:Me.email)||"system@audacy.com",scopeType:"Station",approvalRequired:"approval_required"===Ze,audacyStationMetadata:{genre:lo.genre,low_sellout_configurations:"Low Sellout"===lo.type?lo.lowSelloutConfig:null,market:J.market,primetime_windows:lo.primeTime,region:J.region,station_guid:J.station_guid,station_type:""===lo.type?null:lo.type},appsecData:{application:null==Ke?void 0:Ke.applicationId,module:null==Ke?void 0:Ke.moduleId,roles:n(n([],"approval_required"===Ze?[{users:Je.map(function(e){return e.email}),groups:eo.map(function(e){return e._id}),role:null!==(m=null===(f=He.find(function(e){return"Learning Manager"===e.name}))||void 0===f?void 0:f._id)&&void 0!==m?m:""}]:[],!0),[{users:[null==Me?void 0:Me.email],groups:[],role:null!==(g=null===(h=He.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===h?void 0:h._id)&&void 0!==g?g:""}],!1)}}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:J.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:Z},console.log("[StationOnboard] Step 1: Creating rule set with payload:",l),[4,F(l,V)];case 2:if(a=r.sent(),!(i=null===(x=null==a?void 0:a.data)||void 0===x?void 0:x.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",i),Re(1),[3,4];case 3:return s=r.sent(),console.error("[StationOnboard] Error creating rule set:",s),null===(v=We.current)||void 0===v||v.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),Oe(!1),Re(0),[2];case 4:return r.trys.push([4,6,,7]),c=null!==ke&&ke!==(null==po?void 0:po.id),p={source_scope_id:c?ke:null!==(b=null==po?void 0:po.id)&&void 0!==b?b:ke,target_scope_id:i,is_copy_parent_variant_id:c},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",p),[4,_(p)];case 5:return r.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),Re(3),[3,7];case 6:return u=r.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",u),null===(S=We.current)||void 0===S||S.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),Oe(!1),Re(0),[2];case 7:return qe.current=i,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!go||Be,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:go?"#2563EB":"#BFDBFE",color:"#fff",cursor:go&&!Be?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:i(l,Be?{children:[t(g,{size:16,color:"inherit"}),t("span",{children:"Onboarding..."})]}:{children:[t("span",{children:"Onboard Station"}),t(b,{size:16})]})}))]}))]}))};export{G as default};
1
+ import{__assign as e,__awaiter as o,__generator as r,__spreadArray as n}from"tslib";import{jsxs as i,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as s,useMemo as c,useEffect as u}from"react";import{Dialog as d,Box as p,Typography as f,IconButton as m,DialogContent as h,CircularProgress as g}from"@mui/material";import{X as x,Search as v,ArrowRight as b}from"lucide-react";import{Toast as y}from"primereact/toast";import{v4 as S}from"uuid";import{retrieveGenreScopes as C,fetchStationsByKeyword as w,searchScopes as _,inheritScopeBackwardCompatible as F,createRuleSet as k}from"../../apis/scopeApis.js";import E from"./StationAutocomplete.js";import D from"../CardSkeleton.js";import T from"./OnboardingLoader.js";import B from"./TemplateCard.js";import O from"../../styles/StationOnboardModal.module.css.js";import z from"./InputField.js";import A from"../../store/useAuthStore.js";import{useConfigStore as I}from"../../store/useConfigStore.js";import{useLearningTemplateStore as M}from"../../store/useLearningTemplateStore.js";import{IL_CONFIG_CONSTANTS as L}from"../../config.js";import{useAppSecRolesStore as R}from"../../store/useAppSecRolesStore.js";import j from"../../store/useEnvStore.js";import N from"../../RuleContent/AddScopeApprovalSearchComponent.js";var W=[{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"},{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"}],q=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],P=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}],G=function(G){var U,H=G.isOpen,K=G.onClose,Y=G.onBoardStation,V=G.app_integration_id,X=G.token,J=a(null),Q=J[0],Z=J[1],$=a([]),ee=$[0],oe=$[1],re=a(0),ne=re[0],ie=re[1],te=a(!0),le=te[0],ae=te[1],se=a(!1),ce=se[0],ue=se[1],de=a([]),pe=de[0],fe=de[1],me=a(""),he=me[0],ge=me[1],xe=a(""),ve=xe[0],be=xe[1],ye=a(!1),Se=ye[0],Ce=ye[1],we=a(!1),_e=we[0],Fe=we[1],ke=a(null),Ee=ke[0],De=ke[1],Te=a(null);Te[0],Te[1];var Be=a(!1),Oe=Be[0],ze=Be[1],Ae=a(0),Ie=Ae[0],Me=Ae[1],Le=a(""),Re=Le[0],je=Le[1],Ne=A().user,We=s(null),qe=s(null),Pe=s(null),Ge=s(null);I().configuration;var Ue=s(null),He=R(function(e){return e.roles}),Ke=j(function(e){return e.rbacConfig}),Ye=a("approval_required"),Ve=Ye[0],Xe=Ye[1],Je=a([]),Qe=Je[0],Ze=Je[1],$e=a([]),eo=$e[0],oo=$e[1],ro=a(""),no=ro[0],io=ro[1],to=M(function(e){return e.stationNameParam}),lo=a({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),ao=lo[0],so=lo[1],co=function(e,o){return e.find(function(e){return e.value===o})||null},uo=c(function(){return ee.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[ee]),po=c(function(){var e,o,r;if(!ao.genre)return null;var n=ee.find(function(e){return e.scope_name===ao.genre});return n?{id:n.id,title:n.scope_name||"Unnamed Template",description:(null===(e=n.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(o=n.inheritance)||void 0===o?void 0:o[0])||void 0,rulesCount:n.rules_count||0,tiersCount:n.tier_count||0,isCopy:null!==(r=n.is_copy)&&void 0!==r&&r}:null},[ao.genre,ee]);u(function(){return function(){Pe.current&&clearTimeout(Pe.current)}},[]);var fo=function(e){return o(void 0,void 0,void 0,function(){var o,i,t;return r(this,function(r){switch(r.label){case 0:if(ce)return[2];ue(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,C({limit:"20",offset:String(e)})];case 2:return"success"===(null==(o=r.sent())?void 0:o.status)&&Array.isArray(null==o?void 0:o.data)?(i=o.data,oe(function(o){if(0===e)return i;var r=new Set(o.map(function(e){return e.id})),t=i.filter(function(e){return!r.has(e.id)});return n(n([],o,!0),t,!0)}),i.length<20?ae(!1):ae(!0),ie(e+20)):ae(!1),[3,5];case 3:return t=r.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",t),ae(!1),[3,5];case 4:return ue(!1),[7];case 5:return[2]}})})};u(function(){if(H&&(oe([]),ie(0),ae(!0),fo(0),to)){je(to);o(void 0,void 0,void 0,function(){var e,o,n;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,w(to,!0)];case 1:return!0===(null==(e=r.sent())?void 0:e.success)&&Array.isArray(null==e?void 0:e.data)&&(o=e.data.find(function(e){var o;return(null===(o=e.station_name)||void 0===o?void 0:o.toLowerCase())===to.toLowerCase()&&!e.ruleset_id}),o&&Z(o)),[3,3];case 2:return n=r.sent(),console.error("[StationOnboard] Error auto-selecting station:",n),[3,3];case 3:return[2]}})})}},[H,to]);u(function(){so(Q?function(o){var r;return e(e({},o),{region:null!==(r=Q.market)&&void 0!==r?r:""})}:{region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""})},[Q]),u(function(){var e=setTimeout(function(){be(he)},500);return function(){return clearTimeout(e)}},[he]),u(function(){o(void 0,void 0,void 0,function(){var e,o,n,i;return r(this,function(r){switch(r.label){case 0:if(!ve.trim())return fe([]),[2];Ce(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,_({search_string:ve.trim()})];case 2:return"success"===(null==(e=r.sent())?void 0:e.status)&&Array.isArray(null==e?void 0:e.data)?(o=e.data.filter(function(e){var o,r=null!==(o=e.inheritance)&&void 0!==o?o:[],n=r.indexOf(e.scope_name);return!(n<=0)&&r[n-1]===ao.genre}),n=o.map(function(e){var o,r,n;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(o=e.description)||void 0===o?void 0:o.trim())||"No description available.",inheritedText:(null===(r=e.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(n=e.is_copy)&&void 0!==n&&n}}),fe(n)):fe([]),[3,5];case 3:return i=r.sent(),console.error("[StationOnboard] Error searching scopes:",i),fe([]),[3,5];case 4:return Ce(!1),[7];case 5:return[2]}})})},[ve,ao.genre]),u(function(){!ve.trim()&&po&&De(po.id)},[ve,po]);var mo=function(){setTimeout(function(){Ge.current&&Ge.current.scrollTo({top:Ge.current.scrollHeight,behavior:"smooth"})},100)},ho=function(){je(""),Z(null),so({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),fe([]),ge(""),De(null),Xe("approval_required"),Ze([]),oo([]),io(""),K()},go=function(o,r){var n;if("primeTime"!==o){var i=null!==(n=null==r?void 0:r.value)&&void 0!==n?n:"";so(function(r){var n;return e(e({},r),((n={})[o]=String(i),n))}),"genre"===o&&(Fe(!0),Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(function(){var e=ee.find(function(e){return e.scope_name===i});De(e?e.id:null),Fe(!1)},800))}else{var t=(null==r?void 0:r.value)?String(r.value):"";so(function(o){return e(e({},o),{primeTime:t?[t]:[]})})}},xo=Boolean(Q&&ao.region&&ao.primeTime.length>0&&ao.genre);return i(d,e({open:H,onClose:ho,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:"sans-serif"}}},{children:[t(y,{ref:We}),i(p,e({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[i(p,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[t(f,e({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),t(f,e({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),t(m,e({onClick:ho,disabled:Oe,sx:{color:"#19213D"}},{children:t(x,{size:24})}))]})),i(h,e({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[t(T,{isLoading:Oe,currentStep:Ie,onComplete:function(){ze(!1);var e=qe.current;ho(),Y(e||void 0),qe.current=null}}),t(p,e({sx:{display:"flex",flex:1,flexDirection:"column",paddingY:"14px",paddingX:"20px",gap:2,overflowY:"auto"}},{children:i(p,e({sx:{display:"flex",gap:3}},{children:[i(p,e({ref:Ge,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5"}},{children:[t(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),t(f,e({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),i(p,e({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[i(p,e({className:O.formGroup},{children:[i("label",e({className:O.label},{children:[t("span",e({className:O.asterisk},{children:"*"})),"Station Name/Call Letters"]})),t(E,{value:Re,onChange:je,onStationSelect:function(e){return Z(e)}})]})),t(z,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:ao.region||void 0,isSearchable:!1}),t(z,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:W,value:co(W,(null===(U=ao.primeTime)||void 0===U?void 0:U[0])||""),onOptionChange:function(e){return go("primeTime",e)},isSearchable:!1}),t(p,e({onClick:mo,sx:{width:"100%"}},{children:t(z,{label:"Station Sellout Type",placeholder:"None",options:q,value:co(q,ao.type),onOptionChange:function(o){go("type",o),"Low Sellout"!==(null==o?void 0:o.value)&&so(function(o){return e(e({},o),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===ao.type&&t(p,e({onClick:mo,sx:{width:"100%"}},{children:t(z,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:P,value:co(P,ao.lowSelloutConfig),onOptionChange:function(e){return go("lowSelloutConfig",e)},isSearchable:!1})})),M.getState().backwardCompatibility&&i("div",e({ref:Ue,style:{display:"flex",flexDirection:"column",marginTop:"12px"}},{children:[t(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Approval Settings"})),t(f,e({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Configure who can approve learnings before they get published."})),i("div",e({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"16px"}},{children:[i("div",e({style:{marginBottom:"12px",fontSize:"12px",color:"#8F2C23",gap:"12px"}},{children:[i("div",e({role:"radio","aria-checked":"approval_required"===Ve,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px",marginBottom:"8px"},onClick:function(){return Xe("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Xe("approval_required")}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t("div",e({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===Ve?"#2563EB":"#CBD5E1")}},{children:"approval_required"===Ve&&t("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),t("span",e({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),i("div",e({style:{gap:"16px"}},{children:["approval_required"===Ve&&t(N,{selectedApprovers:Qe,selectedGroupOfApprovers:eo,onApproversChange:function(e){Ze(e),io("")},onGroupsChange:function(e){oo(e),io("")}}),no&&t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:no}))]}))]})),i("div",e({role:"radio","aria-checked":"publish_without"===Ve,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){Xe("publish_without"),io("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(Xe("publish_without"),io(""))}},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t("div",e({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===Ve?"#2563EB":"#CBD5E1")}},{children:"publish_without"===Ve&&t("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),t("span",e({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}))]}))]})),i(p,e({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column"}},{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:[t("span",e({style:{color:"#E53E3E",marginRight:"2px"}},{children:"*"})),"Select a scope for your station"]})),t(f,e({sx:{fontSize:"0.75rem",color:"#64748B",mb:"16px"}},{children:"Your station will inherit the rules from the selected scope."})),t(p,e({sx:{mb:2}},{children:t(z,{required:!0,label:"",placeholder:"Select Genre",options:uo,value:co(uo,ao.genre),onOptionChange:function(e){return go("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!ce&&le&&fo(ne)},isLoadingOptions:ce,hasMoreOptions:le})})),t(p,e({sx:{mb:3}},{children:_e?t(D,{}):po?i(p,e({sx:{border:"1.5px solid #2563EB",borderRadius:"10px",p:"14px 16px",bgcolor:"#EFF6FF",display:"flex",alignItems:"flex-start",gap:"12px"}},{children:[t(p,e({sx:{width:36,height:36,borderRadius:"8px",bgcolor:"#DBEAFE",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("circle",{cx:"12",cy:"12",r:"2"}),t("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]}))})),i(p,e({sx:{flex:1,minWidth:0}},{children:[t(f,e({sx:{fontSize:"0.875rem",fontWeight:600,color:"#1E3A5F",mb:"2px"}},{children:po.title})),t(f,e({sx:{fontSize:"0.75rem",color:"#2563EB",mb:"8px"}},{children:po.description})),i(p,e({sx:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[po.inheritedText&&i(p,e({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px",display:"inline-flex",alignItems:"center",gap:"4px"}},{children:[i("svg",e({width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("polyline",{points:"15 3 21 3 21 9"}),t("path",{d:"M21 3L9 15"}),t("path",{d:"M3 21l6-6"})]})),po.inheritedText]})),i(p,e({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[po.rulesCount," rules"]})),i(p,e({component:"span",sx:{fontSize:"0.7rem",color:"#475569",bgcolor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"4px",px:"6px",py:"2px"}},{children:[po.tiersCount," Tiers"]}))]}))]}))]})):ao.genre?null:t(p,e({sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.4,py:6,gap:1}},{children:t(f,e({sx:{fontSize:"0.75rem",color:"#94A3B8"}},{children:"Select a genre to load the matching scope"}))}))})),ao.genre&&i(l,{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:["Select an Existing Station from the “",ao.genre,"” Scope"," ",t(f,e({component:"span",sx:{fontSize:"1rem",fontWeight:400,color:"#64748B"}},{children:"(Optional)"}))]})),i(f,e({sx:{fontSize:"0.75rem",color:"#64748B",mb:"12px"}},{children:["Please select an existing station under the “",ao.genre,"” category to copy its learnings."]})),i("div",e({className:O.searchWrapper,style:{marginBottom:"12px"}},{children:[t("input",{type:"text",value:he,onChange:function(e){return ge(e.target.value)},placeholder:"Search for station...",className:O.searchInput}),t(v,{className:O.searchIcon,size:16})]})),i(p,e({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[Se&&t(D,{}),!Se&&0===pe.length&&ve.trim()&&i(f,e({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',ve,'".']})),!Se&&pe.map(function(o){return t(B,e({},o,{isSelected:Ee===o.id,onSelect:function(e){var o;De(Ee===e?null!==(o=null==po?void 0:po.id)&&void 0!==o?o:null:e)}}),o.id)})]}))]})]}))]}))}))]})),i(p,e({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[t("button",e({onClick:ho,disabled:Oe,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),t("button",e({onClick:function(){return o(void 0,void 0,void 0,function(){var e,o,i,t,l,a,s,c,u,d,p,f,m,h,g,x,v,b,y;return r(this,function(r){switch(r.label){case 0:if(!Q||!Ee)return console.error("[StationOnboard] Missing required data for onboarding"),[2];if(M.getState().backwardCompatibility&&"approval_required"===Ve&&0===Qe.length&&0===eo.length)return io("Please select at least one approver or approver group."),setTimeout(function(){var e;null===(e=Ue.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50),[2];io(""),e=po?n([po],pe,!0):pe,o=e.find(function(e){return e.id===Ee}),null==o?void 0:o.isCopy,ze(!0),Me(0),i=null,r.label=1;case 1:return r.trys.push([1,3,,4]),t=M.getState().backwardCompatibility,l=t?{topic:"customRuleSet",customScopeGroupName:L.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:Q.station_name||"New Station",parentScopeId:null!==(p=null==po?void 0:po.id)&&void 0!==p?p:null,customScopeName:Q.station_name||"New Station",customScopeId:S(),createByName:(null==Ne?void 0:Ne.firstname)||"System",createdBy:(null==Ne?void 0:Ne.email)||"system@audacy.com",scopeType:"Station",approvalRequired:"approval_required"===Ve,audacyStationMetadata:{genre:ao.genre,low_sellout_configurations:"Low Sellout"===ao.type?ao.lowSelloutConfig:null,market:Q.market,primetime_windows:ao.primeTime,region:Q.region,station_guid:Q.station_guid,station_type:""===ao.type?null:ao.type},appsecData:{application:null==Ke?void 0:Ke.applicationId,module:null==Ke?void 0:Ke.moduleId,roles:n(n([],"approval_required"===Ve?[{users:Qe.map(function(e){return e.email}),groups:eo.map(function(e){return e._id}),role:null!==(m=null===(f=He.find(function(e){return"Learning Manager"===e.name}))||void 0===f?void 0:f._id)&&void 0!==m?m:""}]:[],!0),[{users:[null==Ne?void 0:Ne.email],groups:[],role:null!==(g=null===(h=He.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===h?void 0:h._id)&&void 0!==g?g:""}],!1)}}:{topic:"customRuleSet",scope_reference_id:null,scopeDescription:"demo",parentScopeId:null,scopeName:Q.station_name||"New Station",scopeReferenceMetadata:{},applicationMappingId:V},console.log("[StationOnboard] Step 1: Creating rule set with payload:",l),[4,k(l,X)];case 2:if(a=r.sent(),!(i=null===(x=null==a?void 0:a.data)||void 0===x?void 0:x.scopeId))throw new Error("Failed to create scope - no scopeId returned");return console.log("[StationOnboard] Step 1 Complete: Created scope with ID:",i),Me(1),[3,4];case 3:return s=r.sent(),console.error("[StationOnboard] Error creating rule set:",s),null===(v=We.current)||void 0===v||v.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),ze(!1),Me(0),[2];case 4:return r.trys.push([4,6,,7]),c=null!==Ee&&Ee!==(null==po?void 0:po.id),u={source_scope_id:c?Ee:null!==(b=null==po?void 0:po.id)&&void 0!==b?b:Ee,target_scope_id:i,is_copy_parent_variant_id:c},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",u),[4,F(u)];case 5:return r.sent(),console.log("[StationOnboard] Step 3 Complete: Scope inherited"),Me(3),[3,7];case 6:return d=r.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",d),null===(y=We.current)||void 0===y||y.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),ze(!1),Me(0),[2];case 7:return qe.current=i,console.log("[StationOnboard] Onboarding completed successfully!"),[2]}})})},disabled:!xo||Oe,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:xo?"#2563EB":"#BFDBFE",color:"#fff",cursor:xo&&!Oe?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:i(l,Oe?{children:[t(g,{size:16,color:"inherit"}),t("span",{children:"Onboarding..."})]}:{children:[t("span",{children:"Onboard Station"}),t(b,{size:16})]})}))]}))]}))};export{G as default};
2
2
  //# sourceMappingURL=StationOnboardModal.js.map
@@ -1,2 +1,2 @@
1
- import"react";var a={TAB:"tab",RULESET_ID:"rulesetid",SECTION:"section",OPEN_IL:"openil",ONBOARD_STATION:"onboardstation",VARIANT_ID:"variantid",APPROVAL_ACTION:"approval"},t=function(a){return new URLSearchParams(window.location.search).get(a)},n=function(a){var t=new URLSearchParams(window.location.search);Object.entries(a).forEach(function(a){var n=a[0],o=a[1];null==o||""===o?t.delete(n):t.set(n,o)});var n=t.toString(),o="".concat(window.location.pathname).concat(n?"?".concat(n):"");window.history.replaceState({},"",o)};export{a as QUERY_PARAM_KEYS,t as getQueryParam,n as setQueryParams};
1
+ import"react";var a={TAB:"tab",RULESET_ID:"rulesetid",SECTION:"section",OPEN_IL:"openil",ONBOARD_STATION:"onboardstation",STATION_NAME:"stationname",VARIANT_ID:"variantid",APPROVAL_ACTION:"approval"},t=function(a){return new URLSearchParams(window.location.search).get(a)},n=function(a){var t=new URLSearchParams(window.location.search);Object.entries(a).forEach(function(a){var n=a[0],o=a[1];null==o||""===o?t.delete(n):t.set(n,o)});var n=t.toString(),o="".concat(window.location.pathname).concat(n?"?".concat(n):"");window.history.replaceState({},"",o)};export{a as QUERY_PARAM_KEYS,t as getQueryParam,n as setQueryParams};
2
2
  //# sourceMappingURL=useLearningTemplateQueryParams.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as t,__spreadArray as e}from"tslib";import{create as n}from"zustand";import{getQueryParam as r,setQueryParams as u,QUERY_PARAM_KEYS as a}from"../hooks/useLearningTemplateQueryParams.js";var i={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},o=n(function(n){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:i,isStationModalOpen:!1,isILModalTriggered:"true"===r(a.OPEN_IL),isStationOnboardModalTriggered:"true"===r(a.ONBOARD_STATION),scopeTreeData:null,urlVariantId:r(a.VARIANT_ID),urlApprovalAction:(o=r(a.APPROVAL_ACTION),"approve"===o||"reject"===o?o:null),stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(e,r){return n(function(n){var u;return{templateMap:t(t({},n.templateMap),(u={},u[e]=r,u))}})},setRuleSets:function(t){return n({ruleSets:t})},setScopeTreeData:function(t){return n({scopeTreeData:t})},setStationModalOpen:function(t){return n({isStationModalOpen:t})},setIsILModalTriggered:function(t){var e;u(((e={})[a.OPEN_IL]=t?"true":null,e)),n({isILModalTriggered:t})},setIsStationOnboardModalTriggered:function(t){var e;u(((e={})[a.ONBOARD_STATION]=t?"true":null,e)),n({isStationOnboardModalTriggered:t})},setInitialRules:function(t){return n({currentRules:t})},setCreatedVariantInfo:function(t){return n({createdVariantInfo:t})},resetCreatedVariantInfo:function(){return n({createdVariantInfo:null})},clearUrlApprovalParams:function(){var t;u(((t={})[a.VARIANT_ID]=null,t[a.APPROVAL_ACTION]=null,t)),n({urlVariantId:null,urlApprovalAction:null})},rawAuditRuleData:null,setRawAuditRuleData:function(t){return n({rawAuditRuleData:t})},setSelectedRuleSetId:function(t){var e;u(((e={})[a.RULESET_ID]=t,e)),n({selectedRuleSetId:t})},toggleRuleTier:function(e){return n(function(n){return{currentRules:n.currentRules.map(function(n){return n.id===e?t(t({},n),{isOpen:!n.isOpen}):n})}})},deleteRule:function(e,r){return n(function(n){return{currentRules:n.currentRules.map(function(n){return n.id===e?t(t({},n),{rules:n.rules.filter(function(t){return t.id!==r}),ruleCount:n.ruleCount-1}):n})}})},setStations:function(t){return n({stations:t})},addStation:function(t){return n(function(n){return{stations:e(e([],n.stations,!0),[t],!1)}})},deleteStation:function(t){return n(function(e){return{stations:e.stations.filter(function(e){return e.stationId!==t}),selectedStationId:e.selectedStationId===t?null:e.selectedStationId}})},error:null,setError:function(t){return n({error:t})},tiers:[],setTiers:function(t){return n({tiers:t})},backwardCompatibility:!1,setBackwardCompatibility:function(t){return n({backwardCompatibility:t})},app_integration_id:null,setAppIntegrationId:function(t){return n({app_integration_id:t})},token:"",setToken:function(t){return n({token:t})}};var o});export{i as INITIAL_RULE_SETS,o as useLearningTemplateStore};
1
+ import{__assign as t,__spreadArray as e}from"tslib";import{create as n}from"zustand";import{getQueryParam as r,setQueryParams as a,QUERY_PARAM_KEYS as u}from"../hooks/useLearningTemplateQueryParams.js";var i={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},o=n(function(n){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:i,isStationModalOpen:!1,isILModalTriggered:"true"===r(u.OPEN_IL),isStationOnboardModalTriggered:"true"===r(u.ONBOARD_STATION),scopeTreeData:null,urlVariantId:r(u.VARIANT_ID),urlApprovalAction:(o=r(u.APPROVAL_ACTION),"approve"===o||"reject"===o?o:null),stationNameParam:r(u.STATION_NAME),stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(e,r){return n(function(n){var a;return{templateMap:t(t({},n.templateMap),(a={},a[e]=r,a))}})},setRuleSets:function(t){return n({ruleSets:t})},setScopeTreeData:function(t){return n({scopeTreeData:t})},setStationModalOpen:function(t){return n({isStationModalOpen:t})},setIsILModalTriggered:function(t){var e;a(((e={})[u.OPEN_IL]=t?"true":null,e)),n({isILModalTriggered:t})},setIsStationOnboardModalTriggered:function(e){var r,i;a(t(((r={})[u.ONBOARD_STATION]=e?"true":null,r),e?{}:((i={})[u.STATION_NAME]=null,i))),n(t({isStationOnboardModalTriggered:e},e?{}:{stationNameParam:null}))},setStationNameParam:function(t){var e;a(((e={})[u.STATION_NAME]=t,e)),n({stationNameParam:t})},setInitialRules:function(t){return n({currentRules:t})},setCreatedVariantInfo:function(t){return n({createdVariantInfo:t})},resetCreatedVariantInfo:function(){return n({createdVariantInfo:null})},clearUrlApprovalParams:function(){var t;a(((t={})[u.VARIANT_ID]=null,t[u.APPROVAL_ACTION]=null,t)),n({urlVariantId:null,urlApprovalAction:null})},rawAuditRuleData:null,setRawAuditRuleData:function(t){return n({rawAuditRuleData:t})},setSelectedRuleSetId:function(t){var e;a(((e={})[u.RULESET_ID]=t,e)),n({selectedRuleSetId:t})},toggleRuleTier:function(e){return n(function(n){return{currentRules:n.currentRules.map(function(n){return n.id===e?t(t({},n),{isOpen:!n.isOpen}):n})}})},deleteRule:function(e,r){return n(function(n){return{currentRules:n.currentRules.map(function(n){return n.id===e?t(t({},n),{rules:n.rules.filter(function(t){return t.id!==r}),ruleCount:n.ruleCount-1}):n})}})},setStations:function(t){return n({stations:t})},addStation:function(t){return n(function(n){return{stations:e(e([],n.stations,!0),[t],!1)}})},deleteStation:function(t){return n(function(e){return{stations:e.stations.filter(function(e){return e.stationId!==t}),selectedStationId:e.selectedStationId===t?null:e.selectedStationId}})},error:null,setError:function(t){return n({error:t})},tiers:[],setTiers:function(t){return n({tiers:t})},backwardCompatibility:!1,setBackwardCompatibility:function(t){return n({backwardCompatibility:t})},app_integration_id:null,setAppIntegrationId:function(t){return n({app_integration_id:t})},token:"",setToken:function(t){return n({token:t})}};var o});export{i as INITIAL_RULE_SETS,o as useLearningTemplateStore};
2
2
  //# sourceMappingURL=useLearningTemplateStore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/AuditLog/AuditLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,yCAAyC,CAAC;AAuDjD,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkPrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/AuditLog/AuditLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,yCAAyC,CAAC;AA0DjD,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkRrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LearningTemplateLayout.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningTemplateLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK7F,UAAU,2BAA2B;IACnC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,iGAAiG;IACjG,iBAAiB,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9F,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACrF,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA6FjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"LearningTemplateLayout.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningTemplateLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAQzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK7F,UAAU,2BAA2B;IACnC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,iGAAiG;IACjG,iBAAiB,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9F,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACrF,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAwGjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface AccessManagementPanelProps {
3
3
  selectedRuleSetId?: string | null;
4
4
  useApplicationModuleForScopeAccess?: boolean;
5
+ scopeName?: string;
5
6
  }
6
7
  declare const AccessManagementPanel: React.FC<AccessManagementPanelProps>;
7
8
  export default AccessManagementPanel;
@@ -1 +1 @@
1
- {"version":3,"file":"AccessManagementPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/RBAC/AccessManagementPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,UAAU,0BAA0B;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAID,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAgE/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"AccessManagementPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/RBAC/AccessManagementPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,UAAU,0BAA0B;IAClC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA4E/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StationOnboardModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAqEpE,UAAU,wBAAwB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qEAAqE;IACrE,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA2+B3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"StationOnboardModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/LearningManagement/components/StationOnboarding/StationOnboardModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAsEpE,UAAU,wBAAwB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qEAAqE;IACrE,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAmgC3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -12,6 +12,8 @@ export declare const QUERY_PARAM_KEYS: {
12
12
  readonly OPEN_IL: "openil";
13
13
  /** Whether to open the Station Onboarding modal automatically */
14
14
  readonly ONBOARD_STATION: "onboardstation";
15
+ /** Prefilled station name for onboarding */
16
+ readonly STATION_NAME: "stationname";
15
17
  /** Variant ID to auto-open its parent rule accordion */
16
18
  readonly VARIANT_ID: "variantid";
17
19
  /** Approval action to auto-trigger on the variant: 'approve' | 'reject' */
@@ -1 +1 @@
1
- {"version":3,"file":"useLearningTemplateQueryParams.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/hooks/useLearningTemplateQueryParams.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B,mDAAmD;;IAEnD,sCAAsC;;IAEtC,uDAAuD;;IAEvD,+DAA+D;;IAE/D,iEAAiE;;IAEjE,wDAAwD;;IAExD,2EAA2E;;CAEnE,CAAC;AAEX;;GAEG;AACH,KAAK,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,MAAM,GAAG,IAGpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAAa,OAAO,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,KAAG,IAcvE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;yBAKC,UAAU,GAAG,IAAI;+BAYX,MAAM,GAAG,IAAI;mBAQvB,UAAU,KAAG,IAAI;wBAQZ,MAAM,GAAG,IAAI,KAAG,IAAI;CAU5D,CAAC"}
1
+ {"version":3,"file":"useLearningTemplateQueryParams.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/hooks/useLearningTemplateQueryParams.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B,mDAAmD;;IAEnD,sCAAsC;;IAEtC,uDAAuD;;IAEvD,+DAA+D;;IAE/D,iEAAiE;;IAEjE,4CAA4C;;IAE5C,wDAAwD;;IAExD,2EAA2E;;CAEnE,CAAC;AAEX;;GAEG;AACH,KAAK,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,MAAM,GAAG,IAGpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAAa,OAAO,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,KAAG,IAcvE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;yBAKC,UAAU,GAAG,IAAI;+BAYX,MAAM,GAAG,IAAI;mBAQvB,UAAU,KAAG,IAAI;wBAQZ,MAAM,GAAG,IAAI,KAAG,IAAI;CAU5D,CAAC"}
@@ -19,6 +19,7 @@ interface RuleTemplateState {
19
19
  scopeTreeData: ScopesTreeResponse | null;
20
20
  rawAuditRuleData: any | null;
21
21
  setRawAuditRuleData: (data: any) => void;
22
+ stationNameParam: string | null;
22
23
  stations: StationItem[];
23
24
  selectedStationId: string | null;
24
25
  currentRules: RuleTier[];
@@ -34,6 +35,7 @@ interface RuleTemplateState {
34
35
  setTemplateData: (appIntegrationId: string, templateName: string) => void;
35
36
  setRuleSets: (rules: AllRuleSetsResponse) => void;
36
37
  setScopeTreeData: (data: ScopesTreeResponse | null) => void;
38
+ setStationNameParam: (stationName: string | null) => void;
37
39
  setStationModalOpen: (open: boolean) => void;
38
40
  setIsILModalTriggered: (trigger: boolean) => void;
39
41
  setIsStationOnboardModalTriggered: (trigger: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useLearningTemplateStore.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/store/useLearningTemplateStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhG,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,GAAG,UAAU,CAAA;KAAE,EAAE,CAAC;CACxD;AACD,UAAU,iBAAiB;IAEzB,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC;IACrC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8BAA8B,EAAE,OAAO,CAAC;IACxC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,gBAAgB,EAAE,GAAG,GAAG,IAAI,CAAC;IAC7B,mBAAmB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAEzC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,YAAY,EAAE,QAAQ,EAAE,CAAC;IAGzB,gEAAgE;IAChE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;IAEhD,0EAA0E;IAC1E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+FAA+F;IAC/F,iBAAiB,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC/C,wEAAwE;IACxE,sBAAsB,EAAE,MAAM,IAAI,CAAC;IAEnC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC,eAAe,EAAE,CACf,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IAGV,WAAW,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,gBAAgB,EAAE,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5D,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,qBAAqB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,iCAAiC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9D,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,eAAe,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAE7C,iDAAiD;IACjD,qBAAqB,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACnE,mCAAmC;IACnC,uBAAuB,EAAE,MAAM,IAAI,CAAC;IAGpC,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACpC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,iBAAiB,EAAE,mBAI/B,CAAC;AAEF,eAAO,MAAM,wBAAwB,gFAqGlC,CAAC"}
1
+ {"version":3,"file":"useLearningTemplateStore.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/store/useLearningTemplateStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhG,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,GAAG,UAAU,CAAA;KAAE,EAAE,CAAC;CACxD;AACD,UAAU,iBAAiB;IAEzB,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC;IACrC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8BAA8B,EAAE,OAAO,CAAC;IACxC,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,gBAAgB,EAAE,GAAG,GAAG,IAAI,CAAC;IAC7B,mBAAmB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACzC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,YAAY,EAAE,QAAQ,EAAE,CAAC;IAGzB,gEAAgE;IAChE,kBAAkB,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;IAEhD,0EAA0E;IAC1E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+FAA+F;IAC/F,iBAAiB,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC/C,wEAAwE;IACxE,sBAAsB,EAAE,MAAM,IAAI,CAAC;IAEnC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC,eAAe,EAAE,CACf,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IAGV,WAAW,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAClD,gBAAgB,EAAE,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5D,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1D,mBAAmB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,qBAAqB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,iCAAiC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9D,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,eAAe,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAE7C,iDAAiD;IACjD,qBAAqB,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACnE,mCAAmC;IACnC,uBAAuB,EAAE,MAAM,IAAI,CAAC;IAGpC,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACpC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,iBAAiB,EAAE,mBAI/B,CAAC;AAEF,eAAO,MAAM,wBAAwB,gFAgHlC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/instant-learning",
3
- "version": "1.3.0-alpha.25",
3
+ "version": "1.3.0-alpha.27",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",