@e-llm-studio/instant-learning 0.1.1-alpha.45 → 0.1.1-alpha.47
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.
- package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/cjs/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/cjs/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js +0 -2
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.js.map +0 -1
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.module.css.js +0 -2
- package/dist/cjs/features/LearningManagement/RBAC/AccessPanel.module.css.js.map +0 -1
- package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js +0 -2
- package/dist/cjs/features/LearningManagement/assets/Search-result(add new).svg.js.map +0 -1
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +0 -2
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +0 -1
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js +0 -2
- package/dist/cjs/features/LearningManagement/store/usePermissionsStore.js.map +0 -1
- package/dist/features/LearningManagement/RBAC/AccessPanel.js +0 -2
- package/dist/features/LearningManagement/RBAC/AccessPanel.js.map +0 -1
- package/dist/features/LearningManagement/RBAC/AccessPanel.module.css.js +0 -2
- package/dist/features/LearningManagement/RBAC/AccessPanel.module.css.js.map +0 -1
- package/dist/features/LearningManagement/assets/Search-result(add new).svg.js +0 -2
- package/dist/features/LearningManagement/assets/Search-result(add new).svg.js.map +0 -1
- package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js +0 -2
- package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js.map +0 -1
- package/dist/features/LearningManagement/store/usePermissionsStore.js +0 -2
- package/dist/features/LearningManagement/store/usePermissionsStore.js.map +0 -1
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts +0 -10
- package/dist/types/src/features/LearningManagement/RBAC/AccessPanel.d.ts.map +0 -1
- package/dist/types/src/features/LearningManagement/RBAC/index.d.ts +0 -3
- package/dist/types/src/features/LearningManagement/RBAC/index.d.ts.map +0 -1
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts +0 -12
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.d.ts.map +0 -1
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts +0 -32
- package/dist/types/src/features/LearningManagement/store/usePermissionsStore.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),a=require("./store/useLearningTemplateStore.js"),s=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./components/ConfirmationModal.js"),p=require("./components/LearningTemplateManagementSkeleton.js"),g=require("./utils/treeUtils.js"),S=require("./components/CreateLearningSetModal.js"),f=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),h=require("./components/ToolTip.js"),_=require("./components/CreateRuleSetLegacyModal.js"),v=require("react-router-dom"),y=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"}],L=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope"}];exports.default=function(r){var b,T=this,C=r.userDetails,E=r.llmStudioUrl,O=r.audacyBackendUrl,w=r.ilLabels,j=r.config,A=r.app_integration_id,N=r.backwardCompatibility,I=void 0!==N&&N,B=a.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),k=a.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),R=a.useLearningTemplateStore(function(e){return e.error}),P=a.useLearningTemplateStore(function(e){return e.setError}),D=a.useLearningTemplateStore(function(e){return e.setStations}),q=a.useLearningTemplateStore(function(e){return e.scopeTreeData}),x=a.useLearningTemplateStore(function(e){return e.setScopeTreeData}),G=n.useState({isOpen:!1,type:"GLOBAL"}),M=G[0],U=G[1],F=n.useState(!1),V=F[0],z=F[1],H=n.useState(!1),K=H[0],W=H[1],J=n.useState("learnings"),Q=J[0],X=J[1],Y=n.useState(null),Z=Y[0],$=Y[1],ee=n.useRef(null),te=n.useRef(null),ne=n.useRef(null),re=u.default();re.user;var ae=re.setUser,se=m.useConfigStore(),ie=se.setConfig,oe=se.setIlLabels,le=function(){try{return v.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(le.search).get("rulesetid");(null==e?void 0:e.length)&&k&&X&&(k(e),X("learnings"))},[null==le?void 0:le.search,X,k]),n.useEffect(function(){var e;console.log("userDetails",C),ae(C),console.log("llmStudioUrl",E),console.log("audacyBackendUrl",O),f.default.getState().setLlmStudioUrl(E),f.default.getState().setAudacyBackendUrl(O),ie(j),oe(w),a.useLearningTemplateStore.getState().setAppIntegrationId(null!=A?A:null),a.useLearningTemplateStore.getState().setBackwardCompatibility(I),a.useLearningTemplateStore.getState().setToken(null!==(e=C.accessToken)&&void 0!==e?e:null)},[C,ae,E,O,j,ie,w,oe]),n.useEffect(function(){if(A&&(null==C?void 0:C.accessToken)&&E){e.__awaiter(T,void 0,void 0,function(){var t,n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,fetch("".concat(E,"/instant_learning/ilotj/tier/").concat(A),{headers:{Authorization:"Bearer ".concat(C.accessToken)}})];case 1:return[4,e.sent().json()];case 2:return"success"===(t=e.sent()).status&&a.useLearningTemplateStore.getState().setTiers(t.data.map(function(e){return{tier_id:e.id,tier_name:e.name,tier_priority:e.tier_priority}})),[3,4];case 3:return n=e.sent(),console.error("Failed to fetch tiers:",n),[3,4];case 4:return[2]}})})}},[A,null==C?void 0:C.accessToken,E]);var ue=function(t){return void 0===t&&(t=!0),e.__awaiter(T,void 0,void 0,function(){var n,r,s;return e.__generator(this,function(e){switch(e.label){case 0:t&&z(!0),P(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.fetchScopes(A,C.accessToken)];case 2:return(n=e.sent())&&n.data&&n.data.data&&(r=n.data.data,Array.isArray(r)&&(r=r.length>0?r[0]:null),r?(x({data:r}),te.current?(k(te.current),X("learnings"),te.current=null):a.useLearningTemplateStore.getState().selectedRuleSetId||k(r.id)):x(null)),[3,5];case 3:return s=e.sent(),console.error("Failed to fetch rule sets",s),P("Failed to load rule sets. Please try again later."),[3,5];case 4:return z(!1),[7];case 5:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==C?void 0:C.accessToken)||void 0===e?void 0:e.length)?ue(!0):console.warn("Error: Trying to fetch rules without access token",C)},[null==C?void 0:C.accessToken,P,D]);var ce=function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,s,i,o,l,u,d,p,g,S,f,m,h,_,v,y,L,b,T;return e.__generator(this,function(E){switch(E.label){case 0:W(!0),n=a.useLearningTemplateStore.getState().backwardCompatibility,E.label=1;case 1:return E.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(s=t,i="SCOPE"===M.type&&M.parentId,o=i?"genreRuleSet":M.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:M.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:A}),[4,c.createRuleSet(r,C.accessToken)];case 2:if(l=E.sent(),!(u=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(te.current=u,d=n&&(null===(_=r.topic)||void 0===_?void 0:_.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==M.type&&M.parentId,!d&&!p)return[3,10];if(!(g=n?null===(y=null===(v=a.useLearningTemplateStore.getState().scopeTreeData)||void 0===v?void 0:v.data)||void 0===y?void 0:y.id:M.parentId))return[3,10];if(!I)return[3,7];E.label=3;case 3:return E.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return E.sent(),[3,6];case 5:return S=E.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,6];case 6:return[3,10];case 7:return E.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:A||"",is_copy_parent_variant_id:!1})];case 8:return E.sent(),[3,10];case 9:return f=E.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,10];case 10:return[4,ue(!0)];case 11:return E.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=E.sent(),console.error("An error occurred during scope creation.",m),null===(L=ne.current)||void 0===L||L.show({severity:"error",summary:"Creation Failed",detail:(null===(T=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===T?void 0:T.message)||"There was an error creating the scope. Please try again."}),m;case 13:return W(!1),[7];case 14:return[2]}})})},de=function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o,l,u,d,p,S,f;return e.__generator(this,function(m){switch(m.label){case 0:W(!0),m.label=1;case 1:return m.trys.push([1,8,9,10]),[4,c.deleteRuleSet(t,C.accessToken)];case 2:if(m.sent(),a.useLearningTemplateStore.getState().selectedRuleSetId===t&&(s=a.useLearningTemplateStore.getState().scopeTreeData,(i=g.findNodePathById((null==s?void 0:s.data)||null,t))&&i.length>1&&(o=i[i.length-2],k(o),X("learnings"))),!r||!n)return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),[4,c.updateStation({station_name:n,ruleset_id:""})];case 4:return m.sent(),[3,6];case 5:return l=m.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,ue(!0)];case 7:return m.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(d=ne.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return u=m.sent(),console.error("An error occurred during scope deletion.",u),null===(p=ne.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(S=null==u?void 0:u.response)||void 0===S?void 0:S.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return W(!1),[7];case 10:return[2]}})})},pe=q,ge=Z?{data:{id:Z.stationId,name:Z.stationName,type:"STATION",metrics:{learningsCount:Z.learningsCount,stationsCount:0},children:[]}}:pe,Se=!!(null==ge?void 0:ge.data);null===(b=null==ge?void 0:ge.data)||void 0===b||b.type;var fe=Z?y.filter(function(e){return"stations"!==e.id}):y;return t.jsx(h.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:V?t.jsx(p.default,{}):R?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:R})),t.jsx("button",e.__assign({onClick:function(){return ue(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Se?t.jsx(o.default,{onOpenCreateModal:function(){return U({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return U({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return U({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return s=a.useLearningTemplateStore.getState().scopeTreeData,i=g.findNodePathById((null==s?void 0:s.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,de(t,n,o)];case 1:return e.sent(),[3,3];case 2:U({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),X(t),k(e)},activeSectionId:Q,scopeTreeData:ge,sectionsConfig:fe,onViewStation:function(e){ee.current=B,$(e),X("learnings"),k(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(te.current=t),ue(e)},nodeTypesConfig:L,app_integration_id:A,token:C.accessToken}):t.jsx(l.default,{onCreate:function(){return U({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope"})})),t.jsx(s.Toast,{ref:ne}),I&&M.isOpen&&"DELETE"!==M.type&&"RENAME"!==M.type?t.jsx(_.default,{isOpen:!0,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:ce,hasGlobalRuleSet:Se}):t.jsx(S.default,{isOpen:M.isOpen&&"DELETE"!==M.type,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:"RENAME"===M.type?function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,a,s;return e.__generator(this,function(i){switch(i.label){case 0:W(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),M.scopeId?[4,c.renameScope({scope_id:M.scopeId,scope_name:t})]:[2];case 2:return i.sent(),[4,ue(!0)];case 3:return i.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw n=i.sent(),console.error("An error occurred during scope rename.",n),null===(r=ne.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(s=null===(a=null==n?void 0:n.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message)||"There was an error renaming the scope. Please try again."}),n;case 5:return W(!1),[7];case 6:return[2]}})})}:ce,isLoading:K,title:"GLOBAL"===M.type?"Create Global Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Rename Scope",description:"GLOBAL"===M.type?"Create the Global scope to define base learnings that apply across all stations.":"SCOPE"===M.type?"This scope will be created under ".concat(M.parentName||"Global"," and will inherit its Learnings by default."):"SUBSCOPE"===M.type?"This subscope will be created under ".concat(M.parentName||"Scope"," and will inherit ").concat(M.parentName||"Scope","'s Learnings and Stations by default."):"",inputLabel:"GLOBAL"===M.type||"SCOPE"===M.type?"Scope Name":"SUBSCOPE"===M.type?"Subscope Name":"Scope Name",submitLabel:"GLOBAL"===M.type?"Create Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Save",placeholder:"GLOBAL"===M.type?"Enter the global scope name":"SCOPE"===M.type?"Enter the scope name":"SUBSCOPE"===M.type?"Enter the subscope name":"Enter the new name",initialValue:"RENAME"===M.type?M.initialName:""}),t.jsx(d.default,{isOpen:M.isOpen&&"DELETE"===M.type,onCancel:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onConfirm:function(){return de(M.scopeId,M.initialName,M.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:M.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:K})]}))})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),a=require("./store/useLearningTemplateStore.js"),s=require("primereact/toast"),i=require("./styles/LearningTemplateManagement.module.css.js"),o=require("./LearningTemplateLayout.js"),l=require("./components/EmptyLearningState.js"),u=require("./store/useAuthStore.js"),c=require("./apis/scopeApis.js"),d=require("./components/ConfirmationModal.js"),p=require("./components/LearningTemplateManagementSkeleton.js"),g=require("./utils/treeUtils.js"),S=require("./components/CreateLearningSetModal.js"),f=require("./store/useEnvStore.js"),m=require("./store/useConfigStore.js"),h=require("./components/ToolTip.js"),v=require("./components/CreateRuleSetLegacyModal.js"),y=require("react-router-dom"),_=[{id:"learnings",label:"Learnings",icon:r.BookOpen,badgeKey:"learningsCount"}],L=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope"}];exports.default=function(r){var b,T=this,C=r.userDetails,E=r.llmStudioUrl,O=r.audacyBackendUrl,w=r.ilLabels,j=r.config,A=r.app_integration_id,N=r.backwardCompatibility,I=void 0!==N&&N,B=a.useLearningTemplateStore(function(e){return e.selectedRuleSetId}),k=a.useLearningTemplateStore(function(e){return e.setSelectedRuleSetId}),R=a.useLearningTemplateStore(function(e){return e.error}),P=a.useLearningTemplateStore(function(e){return e.setError}),D=a.useLearningTemplateStore(function(e){return e.setStations}),q=a.useLearningTemplateStore(function(e){return e.scopeTreeData}),x=a.useLearningTemplateStore(function(e){return e.setScopeTreeData}),G=n.useState({isOpen:!1,type:"GLOBAL"}),M=G[0],U=G[1],F=n.useState(!1),V=F[0],H=F[1],K=n.useState(!1),W=K[0],z=K[1],J=n.useState("learnings"),Q=J[0],X=J[1],Y=n.useState(null),Z=Y[0],$=Y[1],ee=n.useRef(null),te=n.useRef(null),ne=n.useRef(null),re=u.default();re.user;var ae=re.setUser,se=m.useConfigStore(),ie=se.setConfig,oe=se.setIlLabels,le=function(){try{return y.useLocation()}catch(e){return{search:""}}}();n.useEffect(function(){var e=new URLSearchParams(le.search).get("rulesetid");(null==e?void 0:e.length)&&k&&X&&(k(e),X("learnings"))},[null==le?void 0:le.search,X,k]),n.useEffect(function(){var e;console.log("userDetails",C),ae(C),console.log("llmStudioUrl",E),console.log("audacyBackendUrl",O),f.default.getState().setLlmStudioUrl(E),f.default.getState().setAudacyBackendUrl(O),ie(j),oe(w),a.useLearningTemplateStore.getState().setAppIntegrationId(null!=A?A:null),a.useLearningTemplateStore.getState().setBackwardCompatibility(I),a.useLearningTemplateStore.getState().setToken(null!==(e=C.accessToken)&&void 0!==e?e:null)},[C,ae,E,O,j,ie,w,oe]),n.useEffect(function(){(null==C?void 0:C.accessToken)&&E&&c.fetchTiers()},[A,null==C?void 0:C.accessToken,E]);var ue=function(t){return void 0===t&&(t=!0),e.__awaiter(T,void 0,void 0,function(){var n,r,s;return e.__generator(this,function(e){switch(e.label){case 0:t&&H(!0),P(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.fetchScopes(A,C.accessToken)];case 2:return(n=e.sent())&&n.data&&n.data.data&&(r=n.data.data,Array.isArray(r)&&(r=r.length>0?r[0]:null),r?(x({data:r}),te.current?(k(te.current),X("learnings"),te.current=null):a.useLearningTemplateStore.getState().selectedRuleSetId||k(r.id)):x(null)),[3,5];case 3:return s=e.sent(),console.error("Failed to fetch rule sets",s),P("Failed to load rule sets. Please try again later."),[3,5];case 4:return H(!1),[7];case 5:return[2]}})})};n.useEffect(function(){var e;(null===(e=null==C?void 0:C.accessToken)||void 0===e?void 0:e.length)?ue(!0):console.warn("Error: Trying to fetch rules without access token",C)},[null==C?void 0:C.accessToken,P,D]);var ce=function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,s,i,o,l,u,d,p,g,S,f,m,h,v,y,_,L,b,T;return e.__generator(this,function(E){switch(E.label){case 0:z(!0),n=a.useLearningTemplateStore.getState().backwardCompatibility,E.label=1;case 1:return E.trys.push([1,12,13,14]),r=void 0,n&&"object"==typeof t?r=t:(s=t,i="SCOPE"===M.type&&M.parentId,o=i?"genreRuleSet":M.type,r={topic:o,scope_reference_id:null,scopeDescription:"demo",parentScopeId:M.parentId||null,scopeName:s,scopeReferenceMetadata:{},applicationMappingId:A}),[4,c.createRuleSet(r,C.accessToken)];case 2:if(l=E.sent(),!(u=null===(h=null==l?void 0:l.data)||void 0===h?void 0:h.scopeId))return[3,10];if(te.current=u,d=n&&(null===(v=r.topic)||void 0===v?void 0:v.toLowerCase().includes("genre")),p=!n&&"GLOBAL"!==M.type&&M.parentId,!d&&!p)return[3,10];if(!(g=n?null===(_=null===(y=a.useLearningTemplateStore.getState().scopeTreeData)||void 0===y?void 0:y.data)||void 0===_?void 0:_.id:M.parentId))return[3,10];if(!I)return[3,7];E.label=3;case 3:return E.trys.push([3,5,,6]),[4,c.inheritScopeBackwardCompatible({source_scope_id:g,target_scope_id:u})];case 4:return E.sent(),[3,6];case 5:return S=E.sent(),console.error("Failed to inherit rules for the new scope:",S),[3,6];case 6:return[3,10];case 7:return E.trys.push([7,9,,10]),[4,c.inheritScope({source_scope_id:g,target_scope_id:u,application_mapping_id:A||"",is_copy_parent_variant_id:!1})];case 8:return E.sent(),[3,10];case 9:return f=E.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,10];case 10:return[4,ue(!0)];case 11:return E.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,14];case 12:throw m=E.sent(),console.error("An error occurred during scope creation.",m),null===(L=ne.current)||void 0===L||L.show({severity:"error",summary:"Creation Failed",detail:(null===(T=null===(b=null==m?void 0:m.response)||void 0===b?void 0:b.data)||void 0===T?void 0:T.message)||"There was an error creating the scope. Please try again."}),m;case 13:return z(!1),[7];case 14:return[2]}})})},de=function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o,l,u,d,p,S,f;return e.__generator(this,function(m){switch(m.label){case 0:z(!0),m.label=1;case 1:return m.trys.push([1,8,9,10]),[4,c.deleteRuleSet(t,C.accessToken)];case 2:if(m.sent(),a.useLearningTemplateStore.getState().selectedRuleSetId===t&&(s=a.useLearningTemplateStore.getState().scopeTreeData,(i=g.findNodePathById((null==s?void 0:s.data)||null,t))&&i.length>1&&(o=i[i.length-2],k(o),X("learnings"))),!r||!n)return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),[4,c.updateStation({station_name:n,ruleset_id:""})];case 4:return m.sent(),[3,6];case 5:return l=m.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,ue(!0)];case 7:return m.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),null===(d=ne.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return u=m.sent(),console.error("An error occurred during scope deletion.",u),null===(p=ne.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(S=null==u?void 0:u.response)||void 0===S?void 0:S.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return z(!1),[7];case 10:return[2]}})})},pe=q,ge=Z?{data:{id:Z.stationId,name:Z.stationName,type:"STATION",metrics:{learningsCount:Z.learningsCount,stationsCount:0},children:[]}}:pe,Se=!!(null==ge?void 0:ge.data);null===(b=null==ge?void 0:ge.data)||void 0===b||b.type;var fe=Z?_.filter(function(e){return"stations"!==e.id}):_;return t.jsx(h.TooltipProvider,{children:t.jsxs("div",e.__assign({className:i.default.learningManagementContainer},{children:[t.jsx("div",e.__assign({className:i.default.mainWrapper},{children:V?t.jsx(p.default,{}):R?t.jsxs("div",e.__assign({className:i.default.errorContainer},{children:[t.jsx("div",e.__assign({className:i.default.errorTitle},{children:"Error Loading Data"})),t.jsx("p",e.__assign({className:i.default.errorDesc},{children:R})),t.jsx("button",e.__assign({onClick:function(){return ue(!0)},className:i.default.tryAgainBtn},{children:"Try Again"}))]})):Se?t.jsx(o.default,{onOpenCreateModal:function(){return U({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return U({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return U({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(t,n,r){return e.__awaiter(T,void 0,void 0,function(){var s,i,o;return e.__generator(this,function(e){switch(e.label){case 0:return s=a.useLearningTemplateStore.getState().scopeTreeData,i=g.findNodePathById((null==s?void 0:s.data)||null,t),o=!!i&&3===i.length,0!==r?[3,2]:[4,de(t,n,o)];case 1:return e.sent(),[3,3];case 2:U({isOpen:!0,type:"DELETE",scopeId:t,initialName:n,isSubscope:o}),e.label=3;case 3:return[2]}})})},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),X(t),k(e)},activeSectionId:Q,scopeTreeData:ge,sectionsConfig:fe,onViewStation:function(e){ee.current=B,$(e),X("learnings"),k(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(te.current=t),ue(e)},nodeTypesConfig:L,app_integration_id:A,token:C.accessToken}):t.jsx(l.default,{onCreate:function(){return U({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope"})})),t.jsx(s.Toast,{ref:ne}),I&&M.isOpen&&"DELETE"!==M.type&&"RENAME"!==M.type?t.jsx(v.default,{isOpen:!0,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:ce,hasGlobalRuleSet:Se}):t.jsx(S.default,{isOpen:M.isOpen&&"DELETE"!==M.type,onClose:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onSubmit:"RENAME"===M.type?function(t){return e.__awaiter(T,void 0,void 0,function(){var n,r,a,s;return e.__generator(this,function(i){switch(i.label){case 0:z(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),M.scopeId?[4,c.renameScope({scope_id:M.scopeId,scope_name:t})]:[2];case 2:return i.sent(),[4,ue(!0)];case 3:return i.sent(),U(function(t){return e.__assign(e.__assign({},t),{isOpen:!1})}),[3,6];case 4:throw n=i.sent(),console.error("An error occurred during scope rename.",n),null===(r=ne.current)||void 0===r||r.show({severity:"error",summary:"Rename Failed",detail:(null===(s=null===(a=null==n?void 0:n.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message)||"There was an error renaming the scope. Please try again."}),n;case 5:return z(!1),[7];case 6:return[2]}})})}:ce,isLoading:W,title:"GLOBAL"===M.type?"Create Global Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Rename Scope",description:"GLOBAL"===M.type?"Create the Global scope to define base learnings that apply across all stations.":"SCOPE"===M.type?"This scope will be created under ".concat(M.parentName||"Global"," and will inherit its Learnings by default."):"SUBSCOPE"===M.type?"This subscope will be created under ".concat(M.parentName||"Scope"," and will inherit ").concat(M.parentName||"Scope","'s Learnings and Stations by default."):"",inputLabel:"GLOBAL"===M.type||"SCOPE"===M.type?"Scope Name":"SUBSCOPE"===M.type?"Subscope Name":"Scope Name",submitLabel:"GLOBAL"===M.type?"Create Scope":"SCOPE"===M.type?"Add Scope":"SUBSCOPE"===M.type?"Add Subscope":"Save",placeholder:"GLOBAL"===M.type?"Enter the global scope name":"SCOPE"===M.type?"Enter the scope name":"SUBSCOPE"===M.type?"Enter the subscope name":"Enter the new name",initialValue:"RENAME"===M.type?M.initialName:""}),t.jsx(d.default,{isOpen:M.isOpen&&"DELETE"===M.type,onCancel:function(){return U(e.__assign(e.__assign({},M),{isOpen:!1}))},onConfirm:function(){return de(M.scopeId,M.initialName,M.isSubscope)},title:"Delete Scope",description:t.jsxs(t.Fragment,{children:["Deleting ",t.jsx("span",e.__assign({className:i.default.highlight},{children:M.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:W})]}))})};
|
|
2
2
|
//# sourceMappingURL=LearningManagement.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.API_ENDPOINTS={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteQuestion:"/instant_learning/question/{questionId}",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/v2/alterPriority",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation"},exports.LEGACY_API_ENDPOINTS={fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.API_ENDPOINTS={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteQuestion:"/instant_learning/question/{questionId}",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/v2/alterPriority",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation",getTiers:"/instant_learning/ilotj/tier/{appIntegrationId}"},exports.LEGACY_API_ENDPOINTS={fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant",getTiers:"/instant_learning/retrieve_tiers"};
|
|
2
2
|
//# sourceMappingURL=apiConfig.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("axios"),r=require("./apiConfig.js"),n=require("../store/useAuthStore.js"),o=require("../store/useEnvStore.js"),a=require("../store/useLearningTemplateStore.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=s(t),c=function(e){return e.interceptors.request.use(function(e){var t=n.default.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e},u=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},l=u(c(i.default.create({headers:{"Content-Type":"application/json"}})),function(){return o.default.getState().audacyBackendUrl||""}),d=u(c(i.default.create({headers:{"Content-Type":"application/json"}})),function(){return o.default.getState().llmStudioUrl||""}),p=function(e){return u(c(i.default.create({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0})),function(){return o.default.getState().llmStudioUrl||""})};exports.alterQuestionPriority=function(t,n,o,a,s){return e.__awaiter(void 0,void 0,void 0,function(){var i,c;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),i={scopeId:t,tierId:n,move:{movedRuleId:o,prevRuleId:a,nextRuleId:s}},[4,d.put(r.API_ENDPOINTS.alterRulePriority,i)];case 1:return[2,e.sent().data];case 2:throw c=e.sent(),console.error("Error altering question priority:",c),c;case 3:return[2]}})})},exports.audacyApi=l,exports.createRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o=a.useLearningTemplateStore.getState().backwardCompatibility,s=o?r.LEGACY_API_ENDPOINTS.createRuleSet:r.API_ENDPOINTS.createRuleSet,[4,p(n).post(s,t)];case 1:return[2,e.sent().data];case 2:throw i=e.sent(),console.error("Error creating rule set:",i),i;case 3:return[2]}})})},exports.default=d,exports.deleteQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteQuestion.replace("{questionId}",t),[4,d.delete(n)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting question:",o),o;case 3:return[2]}})})},exports.deleteRule=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteRule.replace("{ruleId}",t),[4,d.delete(n)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting rule:",o),o;case 3:return[2]}})})},exports.deleteRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),s=o?r.LEGACY_API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t):r.API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t),[4,p(n).delete(s)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error deleting rule set:",i),i;case 4:return[2]}})})},exports.deleteTier=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o=r.API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n),[4,d.delete(o)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error deleting tier:",a),a;case 3:return[2]}})})},exports.exportRuleSet=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)throw new Error("scopeId is required for exporting rule sets");e.label=1;case 1:return e.trys.push([1,3,,4]),[4,d.post(r.API_ENDPOINTS.exportRuleSet,{scope_id:t},{responseType:"blob"})];case 2:return[2,e.sent().data];case 3:throw n=e.sent(),console.error("Error exporting rule set:",n),n;case 4:return[2]}})})},exports.fetchRulesByQuestionId=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o=r.API_ENDPOINTS.fetchRulesByQuestionId.replace("{questionId}",t).replace("{scopeId}",n),[4,d.get(o)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error fetching rules by question id:",a),a;case 3:return[2]}})})},exports.fetchScopes=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!t&&!1===o)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return s=o?r.LEGACY_API_ENDPOINTS.fetchScopes:"".concat(r.API_ENDPOINTS.fetchScopes,"/").concat(t),[4,p(n).get(s)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error fetching rule sets:",i),i;case 4:return[2]}})})},exports.fetchStationsByKeyword=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var o,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o="".concat(r.API_ENDPOINTS.fetchStationsByKeyword.replace("{keyword}",t),"?allow_existing=").concat(n),[4,l.get(o)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error fetching station name by keyword:",a),a;case 3:return[2]}})})},exports.getRuleOverrideHistory=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t),[4,d.get(n)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error getting rule override history:",o),o;case 3:return[2]}})})},exports.getRulesInRuleSetById=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),s=o?"".concat(r.LEGACY_API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"?include_config=True&sort_variant_by=createdAt"):"".concat(r.API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t),[4,p(n).get(s)];case 2:return[2,e.sent().data];case 3:return i=e.sent(),console.error("Error fetching rules in rule set:",i),[3,4];case 4:return[2]}})})},exports.getStationsByScopeId=function(t){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,new Promise(function(e){setTimeout(function(){e({data:[{stationId:"reetrtdfsds",stationName:"Hot 98.7",stationDesc:"Learnings that apply for Hot 98.7 Station",learningsCount:5},{stationId:"sta-102",stationName:"Smooth Jazz 102.1",stationDesc:"Learnings that apply for Smooth Jazz 102.1 Station",learningsCount:12},{stationId:"sta-103",stationName:"Rock 94",stationDesc:"Learnings that apply for Rock 94 Station",learningsCount:8}]})},500)})]})})},exports.inheritScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==t?void 0:t.application_mapping_id)?[4,d.post(r.API_ENDPOINTS.inheritScope,t)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 5:return[2]}})})},exports.inheritScopeBackwardCompatible=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.LEGACY_API_ENDPOINTS.inheritScope,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 3:return[2]}})})},exports.llmApiWithToken=p,exports.publishFeedback=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n,o,s;return e.__generator(this,function(e){switch(e.label){case 0:n=a.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),o=n?r.LEGACY_API_ENDPOINTS.publishFeedback:"".concat(r.API_ENDPOINTS.publishFeedback),[4,d.post(o,t)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error publishing feedback to LLM Studio:",s),s;case 4:return[2]}})})},exports.renameScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.renameScope),[4,d.put(n,t)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error renaming scope:",o),o;case 3:return[2]}})})},exports.retrieveGenreScopes=function(t){return void 0===t&&(t={limit:"50",offset:"0"}),e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.retrieveGenreScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error retrieving genre scopes:",n),n;case 3:return[2]}})})},exports.saveInstantLearningQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.saveInstantLearningQuestion,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error saving instant learning question:",n),n;case 3:return[2]}})})},exports.searchScopes=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.searchScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error searching scopes:",n),n;case 3:return[2]}})})},exports.submitChatFeedback=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.submitChatFeedback,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error submitting chat feedback:",n),n;case 3:return[2]}})})},exports.toggleVariant=function(t,n,o){return e.__awaiter(void 0,void 0,void 0,function(){var o,s,i,c;return e.__generator(this,function(e){switch(e.label){case 0:o=a.useLearningTemplateStore.getState().backwardCompatibility,s=a.useLearningTemplateStore.getState().app_integration_id,i=a.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),o?[4,p(i).patch(r.LEGACY_API_ENDPOINTS.toggleVariant,{variant_ids:t,is_enabled:n})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,p(i).patch(r.API_ENDPOINTS.toggleVariant,{variant_ids:t,application_mapping_id:s,is_enabled:n})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error toggling variant status:",c),c;case 7:return[2]}})})},exports.updateStation=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,l.post(r.API_ENDPOINTS.updateStation,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating station:",n),n;case 3:return[2]}})})},exports.updateVariant=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.put(r.API_ENDPOINTS.updateVariant,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating variant:",n),n;case 3:return[2]}})})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("axios"),r=require("./apiConfig.js"),n=require("../store/useAuthStore.js"),a=require("../store/useEnvStore.js"),o=require("../store/useLearningTemplateStore.js"),i=require("../config.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t),c=function(e){return e.interceptors.request.use(function(e){var t=n.default.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e},l=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},d=l(c(u.default.create({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().audacyBackendUrl||""}),p=l(c(u.default.create({headers:{"Content-Type":"application/json"}})),function(){return a.default.getState().llmStudioUrl||""}),_=function(e){return l(c(u.default.create({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0})),function(){return a.default.getState().llmStudioUrl||""})};exports.alterQuestionPriority=function(t,n,a,o,i){return e.__awaiter(void 0,void 0,void 0,function(){var s,u;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),s={scopeId:t,tierId:n,move:{movedRuleId:a,prevRuleId:o,nextRuleId:i}},[4,p.put(r.API_ENDPOINTS.alterRulePriority,s)];case 1:return[2,e.sent().data];case 2:throw u=e.sent(),console.error("Error altering question priority:",u),u;case 3:return[2]}})})},exports.audacyApi=d,exports.createRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=o.useLearningTemplateStore.getState().backwardCompatibility,i=a?r.LEGACY_API_ENDPOINTS.createRuleSet:r.API_ENDPOINTS.createRuleSet,[4,_(n).post(i,t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error creating rule set:",s),s;case 3:return[2]}})})},exports.default=p,exports.deleteQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteQuestion.replace("{questionId}",t),[4,p.delete(n)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error deleting question:",a),a;case 3:return[2]}})})},exports.deleteRule=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n=r.API_ENDPOINTS.deleteRule.replace("{ruleId}",t),[4,p.delete(n)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error deleting rule:",a),a;case 3:return[2]}})})},exports.deleteRuleSet=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),i=a?r.LEGACY_API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t):r.API_ENDPOINTS.deleteRuleSet.replace("{ruleSetId}",t),[4,_(n).delete(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error deleting rule set:",s),s;case 4:return[2]}})})},exports.deleteTier=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=r.API_ENDPOINTS.deleteTier.replace("{scopeId}",t).replace("{tierId}",n),[4,p.delete(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting tier:",o),o;case 3:return[2]}})})},exports.exportRuleSet=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:if(!t)throw new Error("scopeId is required for exporting rule sets");e.label=1;case 1:return e.trys.push([1,3,,4]),[4,p.post(r.API_ENDPOINTS.exportRuleSet,{scope_id:t},{responseType:"blob"})];case 2:return[2,e.sent().data];case 3:throw n=e.sent(),console.error("Error exporting rule set:",n),n;case 4:return[2]}})})},exports.fetchRulesByQuestionId=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a=r.API_ENDPOINTS.fetchRulesByQuestionId.replace("{questionId}",t).replace("{scopeId}",n),[4,p.get(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error fetching rules by question id:",o),o;case 3:return[2]}})})},exports.fetchScopes=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!t&&!1===a)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return i=a?r.LEGACY_API_ENDPOINTS.fetchScopes:"".concat(r.API_ENDPOINTS.fetchScopes,"/").concat(t),[4,_(n).get(i)];case 2:return[2,e.sent().data];case 3:throw s=e.sent(),console.error("Error fetching rule sets:",s),s;case 4:return[2]}})})},exports.fetchStationsByKeyword=function(t,n){return void 0===n&&(n=!1),e.__awaiter(void 0,void 0,void 0,function(){var a,o;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),a="".concat(r.API_ENDPOINTS.fetchStationsByKeyword.replace("{keyword}",t),"?allow_existing=").concat(n),[4,d.get(a)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error fetching station name by keyword:",o),o;case 3:return[2]}})})},exports.fetchTiers=function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,a,s,u,c,l,d;return e.__generator(this,function(e){switch(e.label){case 0:t=o.useLearningTemplateStore.getState().backwardCompatibility,n=o.useLearningTemplateStore.getState().app_integration_id,a=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),t?(s=i.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,[4,_(a).post(r.LEGACY_API_ENDPOINTS.getTiers,{tier_group_name:s})]):[3,3];case 2:return u=e.sent(),o.useLearningTemplateStore.getState().setTiers((null===(l=u.data)||void 0===l?void 0:l.response)||[]),[3,5];case 3:return[4,_(a).get(r.API_ENDPOINTS.getTiers.replace("{appIntegrationId}",null!=n?n:""))];case 4:u=e.sent(),"success"===(null===(d=u.data)||void 0===d?void 0:d.status)&&o.useLearningTemplateStore.getState().setTiers(u.data.data.map(function(e){return{tier_id:e.id,tier_name:e.name,tier_priority:e.tier_priority}})),e.label=5;case 5:return[3,7];case 6:throw c=e.sent(),console.error("Error fetching tiers:",c),c;case 7:return[2]}})})},exports.getRuleOverrideHistory=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.getRuleOverrideHistory,"/").concat(t),[4,p.get(n)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error getting rule override history:",a),a;case 3:return[2]}})})},exports.getRulesInRuleSetById=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),i=a?"".concat(r.LEGACY_API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t,"?include_config=True&sort_variant_by=createdAt"):"".concat(r.API_ENDPOINTS.getRulesInRuleSetById,"/").concat(t),[4,_(n).get(i)];case 2:return[2,e.sent().data];case 3:return s=e.sent(),console.error("Error fetching rules in rule set:",s),[3,4];case 4:return[2]}})})},exports.getStationsByScopeId=function(t){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,new Promise(function(e){setTimeout(function(){e({data:[{stationId:"reetrtdfsds",stationName:"Hot 98.7",stationDesc:"Learnings that apply for Hot 98.7 Station",learningsCount:5},{stationId:"sta-102",stationName:"Smooth Jazz 102.1",stationDesc:"Learnings that apply for Smooth Jazz 102.1 Station",learningsCount:12},{stationId:"sta-103",stationName:"Rock 94",stationDesc:"Learnings that apply for Rock 94 Station",learningsCount:8}]})},500)})]})})},exports.inheritScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==t?void 0:t.application_mapping_id)?[4,p.post(r.API_ENDPOINTS.inheritScope,t)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 5:return[2]}})})},exports.inheritScopeBackwardCompatible=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.LEGACY_API_ENDPOINTS.inheritScope,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error inheriting scope:",n),n;case 3:return[2]}})})},exports.llmApiWithToken=_,exports.publishFeedback=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n,a,i;return e.__generator(this,function(e){switch(e.label){case 0:n=o.useLearningTemplateStore.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),a=n?r.LEGACY_API_ENDPOINTS.publishFeedback:"".concat(r.API_ENDPOINTS.publishFeedback),[4,p.post(a,t)];case 2:return[2,e.sent().data];case 3:throw i=e.sent(),console.error("Error publishing feedback to LLM Studio:",i),i;case 4:return[2]}})})},exports.renameScope=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n,a;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),n="".concat(r.API_ENDPOINTS.renameScope),[4,p.put(n,t)];case 1:return[2,e.sent().data];case 2:throw a=e.sent(),console.error("Error renaming scope:",a),a;case 3:return[2]}})})},exports.retrieveGenreScopes=function(t){return void 0===t&&(t={limit:"50",offset:"0"}),e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.retrieveGenreScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error retrieving genre scopes:",n),n;case 3:return[2]}})})},exports.saveInstantLearningQuestion=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.saveInstantLearningQuestion,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error saving instant learning question:",n),n;case 3:return[2]}})})},exports.searchScopes=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.searchScopes,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error searching scopes:",n),n;case 3:return[2]}})})},exports.submitChatFeedback=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(r.API_ENDPOINTS.submitChatFeedback,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error submitting chat feedback:",n),n;case 3:return[2]}})})},exports.toggleVariant=function(t,n,a){return e.__awaiter(void 0,void 0,void 0,function(){var a,i,s,u;return e.__generator(this,function(e){switch(e.label){case 0:a=o.useLearningTemplateStore.getState().backwardCompatibility,i=o.useLearningTemplateStore.getState().app_integration_id,s=o.useLearningTemplateStore.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),a?[4,_(s).patch(r.LEGACY_API_ENDPOINTS.toggleVariant,{variant_ids:t,is_enabled:n})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,_(s).patch(r.API_ENDPOINTS.toggleVariant,{variant_ids:t,application_mapping_id:i,is_enabled:n})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error toggling variant status:",u),u;case 7:return[2]}})})},exports.updateStation=function(t){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(r.API_ENDPOINTS.updateStation,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating station:",n),n;case 3:return[2]}})})},exports.updateVariant=function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.put(r.API_ENDPOINTS.updateVariant,t)];case 1:return[2,e.sent().data];case 2:throw n=e.sent(),console.error("Error updating variant:",n),n;case 3:return[2]}})})};
|
|
2
2
|
//# sourceMappingURL=scopeApis.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as r,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as i,useRef as s,useEffect as l}from"react";import{BookOpen as c}from"lucide-react";import{useLearningTemplateStore as u}from"./store/useLearningTemplateStore.js";import{Toast as d}from"primereact/toast";import p from"./styles/LearningTemplateManagement.module.css.js";import m from"./LearningTemplateLayout.js";import f from"./components/EmptyLearningState.js";import h from"./store/useAuthStore.js";import{fetchScopes as g,inheritScope as v,inheritScopeBackwardCompatible as y,createRuleSet as S,renameScope as b,updateStation as C,deleteRuleSet as L}from"./apis/scopeApis.js";import E from"./components/ConfirmationModal.js";import O from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as T}from"./utils/treeUtils.js";import A from"./components/CreateLearningSetModal.js";import w from"./store/useEnvStore.js";import{useConfigStore as _}from"./store/useConfigStore.js";import{TooltipProvider as N}from"./components/ToolTip.js";import I from"./components/CreateRuleSetLegacyModal.js";import{useLocation as k}from"react-router-dom";var B=[{id:"learnings",label:"Learnings",icon:c,badgeKey:"learningsCount"}],D=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope"}];function j(c){var j,G=this,P=c.userDetails,R=c.llmStudioUrl,U=c.audacyBackendUrl,M=c.ilLabels,F=c.config,x=c.app_integration_id,V=c.backwardCompatibility,z=void 0!==V&&V,H=u(function(e){return e.selectedRuleSetId}),K=u(function(e){return e.setSelectedRuleSetId}),W=u(function(e){return e.error}),q=u(function(e){return e.setError}),J=u(function(e){return e.setStations}),Q=u(function(e){return e.scopeTreeData}),X=u(function(e){return e.setScopeTreeData}),Y=i({isOpen:!1,type:"GLOBAL"}),Z=Y[0],$=Y[1],ee=i(!1),te=ee[0],ne=ee[1],re=i(!1),oe=re[0],ae=re[1],ie=i("learnings"),se=ie[0],le=ie[1],ce=i(null),ue=ce[0],de=ce[1],pe=s(null),me=s(null),fe=s(null),he=h();he.user;var ge=he.setUser,ve=_(),ye=ve.setConfig,Se=ve.setIlLabels,be=function(){try{return k()}catch(e){return{search:""}}}();l(function(){var e=new URLSearchParams(be.search).get("rulesetid");(null==e?void 0:e.length)&&K&&le&&(K(e),le("learnings"))},[null==be?void 0:be.search,le,K]),l(function(){var e;console.log("userDetails",P),ge(P),console.log("llmStudioUrl",R),console.log("audacyBackendUrl",U),w.getState().setLlmStudioUrl(R),w.getState().setAudacyBackendUrl(U),ye(F),Se(M),u.getState().setAppIntegrationId(null!=x?x:null),u.getState().setBackwardCompatibility(z),u.getState().setToken(null!==(e=P.accessToken)&&void 0!==e?e:null)},[P,ge,R,U,F,ye,M,Se]),l(function(){if(x&&(null==P?void 0:P.accessToken)&&R){t(G,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch("".concat(R,"/instant_learning/ilotj/tier/").concat(x),{headers:{Authorization:"Bearer ".concat(P.accessToken)}})];case 1:return[4,n.sent().json()];case 2:return"success"===(e=n.sent()).status&&u.getState().setTiers(e.data.map(function(e){return{tier_id:e.id,tier_name:e.name,tier_priority:e.tier_priority}})),[3,4];case 3:return t=n.sent(),console.error("Failed to fetch tiers:",t),[3,4];case 4:return[2]}})})}},[x,null==P?void 0:P.accessToken,R]);var Ce=function(e){return void 0===e&&(e=!0),t(G,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:e&&ne(!0),q(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,g(x,P.accessToken)];case 2:return(t=n.sent())&&t.data&&t.data.data&&(r=t.data.data,Array.isArray(r)&&(r=r.length>0?r[0]:null),r?(X({data:r}),me.current?(K(me.current),le("learnings"),me.current=null):u.getState().selectedRuleSetId||K(r.id)):X(null)),[3,5];case 3:return o=n.sent(),console.error("Failed to fetch rule sets",o),q("Failed to load rule sets. Please try again later."),[3,5];case 4:return ne(!1),[7];case 5:return[2]}})})};l(function(){var e;(null===(e=null==P?void 0:P.accessToken)||void 0===e?void 0:e.length)?Ce(!0):console.warn("Error: Trying to fetch rules without access token",P)},[null==P?void 0:P.accessToken,q,J]);var Le=function(r){return t(G,void 0,void 0,function(){var t,o,a,i,s,l,c,d,p,m,f,h,g,b,C,L,E,O,T,A;return n(this,function(n){switch(n.label){case 0:ae(!0),t=u.getState().backwardCompatibility,n.label=1;case 1:return n.trys.push([1,12,13,14]),o=void 0,t&&"object"==typeof r?o=r:(a=r,i="SCOPE"===Z.type&&Z.parentId,s=i?"genreRuleSet":Z.type,o={topic:s,scope_reference_id:null,scopeDescription:"demo",parentScopeId:Z.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:x}),[4,S(o,P.accessToken)];case 2:if(l=n.sent(),!(c=null===(b=null==l?void 0:l.data)||void 0===b?void 0:b.scopeId))return[3,10];if(me.current=c,d=t&&(null===(C=o.topic)||void 0===C?void 0:C.toLowerCase().includes("genre")),p=!t&&"GLOBAL"!==Z.type&&Z.parentId,!d&&!p)return[3,10];if(!(m=t?null===(E=null===(L=u.getState().scopeTreeData)||void 0===L?void 0:L.data)||void 0===E?void 0:E.id:Z.parentId))return[3,10];if(!z)return[3,7];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,y({source_scope_id:m,target_scope_id:c})];case 4:return n.sent(),[3,6];case 5:return f=n.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return n.trys.push([7,9,,10]),[4,v({source_scope_id:m,target_scope_id:c,application_mapping_id:x||"",is_copy_parent_variant_id:!1})];case 8:return n.sent(),[3,10];case 9:return h=n.sent(),console.error("Failed to inherit rules for the new scope:",h),[3,10];case 10:return[4,Ce(!0)];case 11:return n.sent(),$(function(t){return e(e({},t),{isOpen:!1})}),[3,14];case 12:throw g=n.sent(),console.error("An error occurred during scope creation.",g),null===(O=fe.current)||void 0===O||O.show({severity:"error",summary:"Creation Failed",detail:(null===(A=null===(T=null==g?void 0:g.response)||void 0===T?void 0:T.data)||void 0===A?void 0:A.message)||"There was an error creating the scope. Please try again."}),g;case 13:return ae(!1),[7];case 14:return[2]}})})},Ee=function(r,o,a){return t(G,void 0,void 0,function(){var t,i,s,l,c,d,p,m,f;return n(this,function(n){switch(n.label){case 0:ae(!0),n.label=1;case 1:return n.trys.push([1,8,9,10]),[4,L(r,P.accessToken)];case 2:if(n.sent(),u.getState().selectedRuleSetId===r&&(t=u.getState().scopeTreeData,(i=T((null==t?void 0:t.data)||null,r))&&i.length>1&&(s=i[i.length-2],K(s),le("learnings"))),!a||!o)return[3,6];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,C({station_name:o,ruleset_id:""})];case 4:return n.sent(),[3,6];case 5:return l=n.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,Ce(!0)];case 7:return n.sent(),$(function(t){return e(e({},t),{isOpen:!1})}),null===(d=fe.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return c=n.sent(),console.error("An error occurred during scope deletion.",c),null===(p=fe.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(m=null==c?void 0:c.response)||void 0===m?void 0:m.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return ae(!1),[7];case 10:return[2]}})})},Oe=Q,Te=ue?{data:{id:ue.stationId,name:ue.stationName,type:"STATION",metrics:{learningsCount:ue.learningsCount,stationsCount:0},children:[]}}:Oe,Ae=!!(null==Te?void 0:Te.data);null===(j=null==Te?void 0:Te.data)||void 0===j||j.type;var we=ue?B.filter(function(e){return"stations"!==e.id}):B;return r(N,{children:o("div",e({className:p.learningManagementContainer},{children:[r("div",e({className:p.mainWrapper},{children:te?r(O,{}):W?o("div",e({className:p.errorContainer},{children:[r("div",e({className:p.errorTitle},{children:"Error Loading Data"})),r("p",e({className:p.errorDesc},{children:W})),r("button",e({onClick:function(){return Ce(!0)},className:p.tryAgainBtn},{children:"Try Again"}))]})):Ae?r(m,{onOpenCreateModal:function(){return $({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return $({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return $({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,r,o){return t(G,void 0,void 0,function(){var t,a,i;return n(this,function(n){switch(n.label){case 0:return t=u.getState().scopeTreeData,a=T((null==t?void 0:t.data)||null,e),i=!!a&&3===a.length,0!==o?[3,2]:[4,Ee(e,r,i)];case 1:return n.sent(),[3,3];case 2:$({isOpen:!0,type:"DELETE",scopeId:e,initialName:r,isSubscope:i}),n.label=3;case 3:return[2]}})})},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),le(t),K(e)},activeSectionId:se,scopeTreeData:Te,sectionsConfig:we,onViewStation:function(e){pe.current=H,de(e),le("learnings"),K(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(me.current=t),Ce(e)},nodeTypesConfig:D,app_integration_id:x,token:P.accessToken}):r(f,{onCreate:function(){return $({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope"})})),r(d,{ref:fe}),z&&Z.isOpen&&"DELETE"!==Z.type&&"RENAME"!==Z.type?r(I,{isOpen:!0,onClose:function(){return $(e(e({},Z),{isOpen:!1}))},onSubmit:Le,hasGlobalRuleSet:Ae}):r(A,{isOpen:Z.isOpen&&"DELETE"!==Z.type,onClose:function(){return $(e(e({},Z),{isOpen:!1}))},onSubmit:"RENAME"===Z.type?function(r){return t(G,void 0,void 0,function(){var t,o,a,i;return n(this,function(n){switch(n.label){case 0:ae(!0),n.label=1;case 1:return n.trys.push([1,4,5,6]),Z.scopeId?[4,b({scope_id:Z.scopeId,scope_name:r})]:[2];case 2:return n.sent(),[4,Ce(!0)];case 3:return n.sent(),$(function(t){return e(e({},t),{isOpen:!1})}),[3,6];case 4:throw t=n.sent(),console.error("An error occurred during scope rename.",t),null===(o=fe.current)||void 0===o||o.show({severity:"error",summary:"Rename Failed",detail:(null===(i=null===(a=null==t?void 0:t.response)||void 0===a?void 0:a.data)||void 0===i?void 0:i.message)||"There was an error renaming the scope. Please try again."}),t;case 5:return ae(!1),[7];case 6:return[2]}})})}:Le,isLoading:oe,title:"GLOBAL"===Z.type?"Create Global Scope":"SCOPE"===Z.type?"Add Scope":"SUBSCOPE"===Z.type?"Add Subscope":"Rename Scope",description:"GLOBAL"===Z.type?"Create the Global scope to define base learnings that apply across all stations.":"SCOPE"===Z.type?"This scope will be created under ".concat(Z.parentName||"Global"," and will inherit its Learnings by default."):"SUBSCOPE"===Z.type?"This subscope will be created under ".concat(Z.parentName||"Scope"," and will inherit ").concat(Z.parentName||"Scope","'s Learnings and Stations by default."):"",inputLabel:"GLOBAL"===Z.type||"SCOPE"===Z.type?"Scope Name":"SUBSCOPE"===Z.type?"Subscope Name":"Scope Name",submitLabel:"GLOBAL"===Z.type?"Create Scope":"SCOPE"===Z.type?"Add Scope":"SUBSCOPE"===Z.type?"Add Subscope":"Save",placeholder:"GLOBAL"===Z.type?"Enter the global scope name":"SCOPE"===Z.type?"Enter the scope name":"SUBSCOPE"===Z.type?"Enter the subscope name":"Enter the new name",initialValue:"RENAME"===Z.type?Z.initialName:""}),r(E,{isOpen:Z.isOpen&&"DELETE"===Z.type,onCancel:function(){return $(e(e({},Z),{isOpen:!1}))},onConfirm:function(){return Ee(Z.scopeId,Z.initialName,Z.isSubscope)},title:"Delete Scope",description:o(a,{children:["Deleting ",r("span",e({className:p.highlight},{children:Z.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:oe})]}))})}export{j as default};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as r,jsxs as o,Fragment as a}from"react/jsx-runtime";import{useState as i,useRef as s,useEffect as l}from"react";import{BookOpen as c}from"lucide-react";import{useLearningTemplateStore as u}from"./store/useLearningTemplateStore.js";import{Toast as d}from"primereact/toast";import p from"./styles/LearningTemplateManagement.module.css.js";import m from"./LearningTemplateLayout.js";import f from"./components/EmptyLearningState.js";import g from"./store/useAuthStore.js";import{fetchTiers as h,fetchScopes as v,inheritScope as S,inheritScopeBackwardCompatible as y,createRuleSet as b,renameScope as C,updateStation as L,deleteRuleSet as E}from"./apis/scopeApis.js";import O from"./components/ConfirmationModal.js";import T from"./components/LearningTemplateManagementSkeleton.js";import{findNodePathById as A}from"./utils/treeUtils.js";import w from"./components/CreateLearningSetModal.js";import N from"./store/useEnvStore.js";import{useConfigStore as I}from"./store/useConfigStore.js";import{TooltipProvider as _}from"./components/ToolTip.js";import k from"./components/CreateRuleSetLegacyModal.js";import{useLocation as B}from"react-router-dom";var D=[{id:"learnings",label:"Learnings",icon:c,badgeKey:"learningsCount"}],G=[{type:"GLOBAL",label:"Global",addChildLabel:"Add Scope",addChildType:"SCOPE"},{type:"SCOPE",label:"Scope"}];function P(c){var P,R=this,j=c.userDetails,U=c.llmStudioUrl,M=c.audacyBackendUrl,F=c.ilLabels,x=c.config,V=c.app_integration_id,H=c.backwardCompatibility,K=void 0!==H&&H,W=u(function(e){return e.selectedRuleSetId}),q=u(function(e){return e.setSelectedRuleSetId}),z=u(function(e){return e.error}),J=u(function(e){return e.setError}),Q=u(function(e){return e.setStations}),X=u(function(e){return e.scopeTreeData}),Y=u(function(e){return e.setScopeTreeData}),Z=i({isOpen:!1,type:"GLOBAL"}),$=Z[0],ee=Z[1],te=i(!1),ne=te[0],re=te[1],oe=i(!1),ae=oe[0],ie=oe[1],se=i("learnings"),le=se[0],ce=se[1],ue=i(null),de=ue[0],pe=ue[1],me=s(null),fe=s(null),ge=s(null),he=g();he.user;var ve=he.setUser,Se=I(),ye=Se.setConfig,be=Se.setIlLabels,Ce=function(){try{return B()}catch(e){return{search:""}}}();l(function(){var e=new URLSearchParams(Ce.search).get("rulesetid");(null==e?void 0:e.length)&&q&&ce&&(q(e),ce("learnings"))},[null==Ce?void 0:Ce.search,ce,q]),l(function(){var e;console.log("userDetails",j),ve(j),console.log("llmStudioUrl",U),console.log("audacyBackendUrl",M),N.getState().setLlmStudioUrl(U),N.getState().setAudacyBackendUrl(M),ye(x),be(F),u.getState().setAppIntegrationId(null!=V?V:null),u.getState().setBackwardCompatibility(K),u.getState().setToken(null!==(e=j.accessToken)&&void 0!==e?e:null)},[j,ve,U,M,x,ye,F,be]),l(function(){(null==j?void 0:j.accessToken)&&U&&h()},[V,null==j?void 0:j.accessToken,U]);var Le=function(e){return void 0===e&&(e=!0),t(R,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:e&&re(!0),J(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,v(V,j.accessToken)];case 2:return(t=n.sent())&&t.data&&t.data.data&&(r=t.data.data,Array.isArray(r)&&(r=r.length>0?r[0]:null),r?(Y({data:r}),fe.current?(q(fe.current),ce("learnings"),fe.current=null):u.getState().selectedRuleSetId||q(r.id)):Y(null)),[3,5];case 3:return o=n.sent(),console.error("Failed to fetch rule sets",o),J("Failed to load rule sets. Please try again later."),[3,5];case 4:return re(!1),[7];case 5:return[2]}})})};l(function(){var e;(null===(e=null==j?void 0:j.accessToken)||void 0===e?void 0:e.length)?Le(!0):console.warn("Error: Trying to fetch rules without access token",j)},[null==j?void 0:j.accessToken,J,Q]);var Ee=function(r){return t(R,void 0,void 0,function(){var t,o,a,i,s,l,c,d,p,m,f,g,h,v,C,L,E,O,T,A;return n(this,function(n){switch(n.label){case 0:ie(!0),t=u.getState().backwardCompatibility,n.label=1;case 1:return n.trys.push([1,12,13,14]),o=void 0,t&&"object"==typeof r?o=r:(a=r,i="SCOPE"===$.type&&$.parentId,s=i?"genreRuleSet":$.type,o={topic:s,scope_reference_id:null,scopeDescription:"demo",parentScopeId:$.parentId||null,scopeName:a,scopeReferenceMetadata:{},applicationMappingId:V}),[4,b(o,j.accessToken)];case 2:if(l=n.sent(),!(c=null===(v=null==l?void 0:l.data)||void 0===v?void 0:v.scopeId))return[3,10];if(fe.current=c,d=t&&(null===(C=o.topic)||void 0===C?void 0:C.toLowerCase().includes("genre")),p=!t&&"GLOBAL"!==$.type&&$.parentId,!d&&!p)return[3,10];if(!(m=t?null===(E=null===(L=u.getState().scopeTreeData)||void 0===L?void 0:L.data)||void 0===E?void 0:E.id:$.parentId))return[3,10];if(!K)return[3,7];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,y({source_scope_id:m,target_scope_id:c})];case 4:return n.sent(),[3,6];case 5:return f=n.sent(),console.error("Failed to inherit rules for the new scope:",f),[3,6];case 6:return[3,10];case 7:return n.trys.push([7,9,,10]),[4,S({source_scope_id:m,target_scope_id:c,application_mapping_id:V||"",is_copy_parent_variant_id:!1})];case 8:return n.sent(),[3,10];case 9:return g=n.sent(),console.error("Failed to inherit rules for the new scope:",g),[3,10];case 10:return[4,Le(!0)];case 11:return n.sent(),ee(function(t){return e(e({},t),{isOpen:!1})}),[3,14];case 12:throw h=n.sent(),console.error("An error occurred during scope creation.",h),null===(O=ge.current)||void 0===O||O.show({severity:"error",summary:"Creation Failed",detail:(null===(A=null===(T=null==h?void 0:h.response)||void 0===T?void 0:T.data)||void 0===A?void 0:A.message)||"There was an error creating the scope. Please try again."}),h;case 13:return ie(!1),[7];case 14:return[2]}})})},Oe=function(r,o,a){return t(R,void 0,void 0,function(){var t,i,s,l,c,d,p,m,f;return n(this,function(n){switch(n.label){case 0:ie(!0),n.label=1;case 1:return n.trys.push([1,8,9,10]),[4,E(r,j.accessToken)];case 2:if(n.sent(),u.getState().selectedRuleSetId===r&&(t=u.getState().scopeTreeData,(i=A((null==t?void 0:t.data)||null,r))&&i.length>1&&(s=i[i.length-2],q(s),ce("learnings"))),!a||!o)return[3,6];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,L({station_name:o,ruleset_id:""})];case 4:return n.sent(),[3,6];case 5:return l=n.sent(),console.error("Error unlinking station on subscope delete:",l),[3,6];case 6:return[4,Le(!0)];case 7:return n.sent(),ee(function(t){return e(e({},t),{isOpen:!1})}),null===(d=ge.current)||void 0===d||d.show({severity:"success",summary:"Deleted Successfully",detail:"The scope was permanently removed."}),[3,10];case 8:return c=n.sent(),console.error("An error occurred during scope deletion.",c),null===(p=ge.current)||void 0===p||p.show({severity:"error",summary:"Delete Failed",detail:(null===(f=null===(m=null==c?void 0:c.response)||void 0===m?void 0:m.data)||void 0===f?void 0:f.message)||"There was an error deleting the scope. Please try again."}),[3,10];case 9:return ie(!1),[7];case 10:return[2]}})})},Te=X,Ae=de?{data:{id:de.stationId,name:de.stationName,type:"STATION",metrics:{learningsCount:de.learningsCount,stationsCount:0},children:[]}}:Te,we=!!(null==Ae?void 0:Ae.data);null===(P=null==Ae?void 0:Ae.data)||void 0===P||P.type;var Ne=de?D.filter(function(e){return"stations"!==e.id}):D;return r(_,{children:o("div",e({className:p.learningManagementContainer},{children:[r("div",e({className:p.mainWrapper},{children:ne?r(T,{}):z?o("div",e({className:p.errorContainer},{children:[r("div",e({className:p.errorTitle},{children:"Error Loading Data"})),r("p",e({className:p.errorDesc},{children:z})),r("button",e({onClick:function(){return Le(!0)},className:p.tryAgainBtn},{children:"Try Again"}))]})):we?r(m,{onOpenCreateModal:function(){return ee({isOpen:!0,type:"GLOBAL"})},onAddChild:function(e,t,n){return ee({isOpen:!0,type:t,parentId:e,parentName:n})},onRenameChild:function(e,t){return ee({isOpen:!0,type:"RENAME",scopeId:e,initialName:t})},onDeleteChild:function(e,r,o){return t(R,void 0,void 0,function(){var t,a,i;return n(this,function(n){switch(n.label){case 0:return t=u.getState().scopeTreeData,a=A((null==t?void 0:t.data)||null,e),i=!!a&&3===a.length,0!==o?[3,2]:[4,Oe(e,r,i)];case 1:return n.sent(),[3,3];case 2:ee({isOpen:!0,type:"DELETE",scopeId:e,initialName:r,isSubscope:i}),n.label=3;case 3:return[2]}})})},onSectionSelect:function(e,t){console.log("Section Selected:",{scopeId:e,sectionId:t}),ce(t),q(e)},activeSectionId:le,scopeTreeData:Ae,sectionsConfig:Ne,onViewStation:function(e){me.current=W,pe(e),ce("learnings"),q(e.stationId)},onRefreshRuleSets:function(e,t){void 0===e&&(e=!0),t&&(fe.current=t),Le(e)},nodeTypesConfig:G,app_integration_id:V,token:j.accessToken}):r(f,{onCreate:function(){return ee({isOpen:!0,type:"GLOBAL"})},title:"No Global Scope has been added!",desc:"Start by creating a Global scope to define base learnings that apply across all stations.",button:"Create Global Scope"})})),r(d,{ref:ge}),K&&$.isOpen&&"DELETE"!==$.type&&"RENAME"!==$.type?r(k,{isOpen:!0,onClose:function(){return ee(e(e({},$),{isOpen:!1}))},onSubmit:Ee,hasGlobalRuleSet:we}):r(w,{isOpen:$.isOpen&&"DELETE"!==$.type,onClose:function(){return ee(e(e({},$),{isOpen:!1}))},onSubmit:"RENAME"===$.type?function(r){return t(R,void 0,void 0,function(){var t,o,a,i;return n(this,function(n){switch(n.label){case 0:ie(!0),n.label=1;case 1:return n.trys.push([1,4,5,6]),$.scopeId?[4,C({scope_id:$.scopeId,scope_name:r})]:[2];case 2:return n.sent(),[4,Le(!0)];case 3:return n.sent(),ee(function(t){return e(e({},t),{isOpen:!1})}),[3,6];case 4:throw t=n.sent(),console.error("An error occurred during scope rename.",t),null===(o=ge.current)||void 0===o||o.show({severity:"error",summary:"Rename Failed",detail:(null===(i=null===(a=null==t?void 0:t.response)||void 0===a?void 0:a.data)||void 0===i?void 0:i.message)||"There was an error renaming the scope. Please try again."}),t;case 5:return ie(!1),[7];case 6:return[2]}})})}:Ee,isLoading:ae,title:"GLOBAL"===$.type?"Create Global Scope":"SCOPE"===$.type?"Add Scope":"SUBSCOPE"===$.type?"Add Subscope":"Rename Scope",description:"GLOBAL"===$.type?"Create the Global scope to define base learnings that apply across all stations.":"SCOPE"===$.type?"This scope will be created under ".concat($.parentName||"Global"," and will inherit its Learnings by default."):"SUBSCOPE"===$.type?"This subscope will be created under ".concat($.parentName||"Scope"," and will inherit ").concat($.parentName||"Scope","'s Learnings and Stations by default."):"",inputLabel:"GLOBAL"===$.type||"SCOPE"===$.type?"Scope Name":"SUBSCOPE"===$.type?"Subscope Name":"Scope Name",submitLabel:"GLOBAL"===$.type?"Create Scope":"SCOPE"===$.type?"Add Scope":"SUBSCOPE"===$.type?"Add Subscope":"Save",placeholder:"GLOBAL"===$.type?"Enter the global scope name":"SCOPE"===$.type?"Enter the scope name":"SUBSCOPE"===$.type?"Enter the subscope name":"Enter the new name",initialValue:"RENAME"===$.type?$.initialName:""}),r(O,{isOpen:$.isOpen&&"DELETE"===$.type,onCancel:function(){return ee(e(e({},$),{isOpen:!1}))},onConfirm:function(){return Oe($.scopeId,$.initialName,$.isSubscope)},title:"Delete Scope",description:o(a,{children:["Deleting ",r("span",e({className:p.highlight},{children:$.initialName||"this scope"}))," will permanently remove all Learnings, Access rules, and Change History inside it. This cannot be undone."]}),confirmText:"Delete",confirmBgColor:"#EF4444",isLoading:ae})]}))})}export{P as default};
|
|
2
2
|
//# sourceMappingURL=LearningManagement.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteQuestion:"/instant_learning/question/{questionId}",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/v2/alterPriority",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation"},n={fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant"};export{e as API_ENDPOINTS,n as LEGACY_API_ENDPOINTS};
|
|
1
|
+
var e={publishFeedback:"/instant_learning/ilotj/variants",submitChatFeedback:"/instant_learning/feedback/teachme_otj",saveInstantLearningQuestion:"/instant_learning/getLearningQuestionId",fetchScopes:"/instant_learning/ilotj/scope",renameScope:"/instant_learning/scope",getRulesInRuleSetById:"/instant_learning/ilotj/rules/scope",createRuleSet:"/instant_learning/ilotj/scope",fetchStationsByKeyword:"/backend/traffic-manager/station/search/{keyword}",saveRuleSet:"/backend/traffic-manager/station/ruleset",getRuleOverrideHistory:"/instant_learning/learnings/inheritance/change_log",deleteRuleSet:"/instant_learning/ilotj/scope/{ruleSetId}",deleteRule:"/instant_learning/learning/{ruleId}/delete",deleteQuestion:"/instant_learning/question/{questionId}",deleteTier:"instant_learning/scopes/{scopeId}/tiers/{tierId}",updateVariant:"/instant_learning/v2/update/rule",inheritScope:"/instant_learning/ilotj/inherit-scope",updateStation:"/backend/traffic-manager/station/update",exportRuleSet:"/instant_learning/export-ruleset",toggleVariant:"/instant_learning/ilotj/toggle_variant",alterRulePriority:"/instant_learning/v2/alterPriority",fetchRulesByQuestionId:"/instant_learning/learnings/rules/fetch_by_rule_id/{questionId}/{scopeId}?include_config=True",retrieveGenreScopes:"/instant_learning/learnings/retrieve_genre_scopes",searchScopes:"/instant_learning/learnings/search_scopes",sessionValidation:"/instant_learning/session-validation",getTiers:"/instant_learning/ilotj/tier/{appIntegrationId}"},n={fetchScopes:"/instant_learning/learning/fetch_by_scope/v2?custom_scope_group_name=Audacy-Traffic-Manager",createRuleSet:"/instant_learning/create-scope",deleteRuleSet:"/instant_learning/scope/{ruleSetId}/delete",getRulesInRuleSetById:"/instant_learning/learnings/rules/fetch_by_scope",publishFeedback:"/instant_learning/save",inheritScope:"/instant_learning/learnings/rules/inherit-scope",toggleVariant:"/instant_learning/toggle_variant",getTiers:"/instant_learning/retrieve_tiers"};export{e as API_ENDPOINTS,n as LEGACY_API_ENDPOINTS};
|
|
2
2
|
//# sourceMappingURL=apiConfig.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from"tslib";import r from"axios";import{API_ENDPOINTS as n,LEGACY_API_ENDPOINTS as o}from"./apiConfig.js";import s from"../store/useAuthStore.js";import a from"../store/useEnvStore.js";import{useLearningTemplateStore as i}from"../store/useLearningTemplateStore.js";var c=function(e){return e.interceptors.request.use(function(e){var t=s.getState().user,r=null==t?void 0:t.accessToken;return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),e},u=function(e,t){return e.interceptors.request.use(function(e){return e.baseURL=t(),e}),e},l=u(c(r.create({headers:{"Content-Type":"application/json"}})),function(){return a.getState().audacyBackendUrl||""}),d=u(c(r.create({headers:{"Content-Type":"application/json"}})),function(){return a.getState().llmStudioUrl||""}),h=function(e){return u(c(r.create({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},withCredentials:!0})),function(){return a.getState().llmStudioUrl||""})},p=function(r,s){return e(void 0,void 0,void 0,function(){var e,s,a;return t(this,function(t){switch(t.label){case 0:e=i.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),s=e?o.publishFeedback:"".concat(n.publishFeedback),[4,d.post(s,r)];case 2:return[2,t.sent().data];case 3:throw a=t.sent(),console.error("Error publishing feedback to LLM Studio:",a),a;case 4:return[2]}})})},v=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d.post(n.submitChatFeedback,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error submitting chat feedback:",e),e;case 3:return[2]}})})},f=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d.post(n.saveInstantLearningQuestion,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error saving instant learning question:",e),e;case 3:return[2]}})})},g=function(r,s){return e(void 0,void 0,void 0,function(){var e,a,c;return t(this,function(t){switch(t.label){case 0:e=i.getState().backwardCompatibility,t.label=1;case 1:if(t.trys.push([1,3,,4]),!r&&!1===e)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return a=e?o.fetchScopes:"".concat(n.fetchScopes,"/").concat(r),[4,h(s).get(a)];case 2:return[2,t.sent().data];case 3:throw c=t.sent(),console.error("Error fetching rule sets:",c),c;case 4:return[2]}})})},w=function(r){return e(void 0,void 0,void 0,function(){var e,o;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e="".concat(n.renameScope),[4,d.put(e,r)];case 1:return[2,t.sent().data];case 2:throw o=t.sent(),console.error("Error renaming scope:",o),o;case 3:return[2]}})})},b=function(r,s){return e(void 0,void 0,void 0,function(){var e,a,c;return t(this,function(t){switch(t.label){case 0:e=i.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),a=e?"".concat(o.getRulesInRuleSetById,"/").concat(r,"?include_config=True&sort_variant_by=createdAt"):"".concat(n.getRulesInRuleSetById,"/").concat(r),[4,h(s).get(a)];case 2:return[2,t.sent().data];case 3:return c=t.sent(),console.error("Error fetching rules in rule set:",c),[3,4];case 4:return[2]}})})},y=function(r){return e(void 0,void 0,void 0,function(){var e,o;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e="".concat(n.getRuleOverrideHistory,"/").concat(r),[4,d.get(e)];case 1:return[2,t.sent().data];case 2:throw o=t.sent(),console.error("Error getting rule override history:",o),o;case 3:return[2]}})})},S=function(r,s){return e(void 0,void 0,void 0,function(){var e,a,c;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=i.getState().backwardCompatibility,a=e?o.createRuleSet:n.createRuleSet,[4,h(s).post(a,r)];case 1:return[2,t.sent().data];case 2:throw c=t.sent(),console.error("Error creating rule set:",c),c;case 3:return[2]}})})},m=function(r,o){return void 0===o&&(o=!1),e(void 0,void 0,void 0,function(){var e,s;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e="".concat(n.fetchStationsByKeyword.replace("{keyword}",r),"?allow_existing=").concat(o),[4,l.get(e)];case 1:return[2,t.sent().data];case 2:throw s=t.sent(),console.error("Error fetching station name by keyword:",s),s;case 3:return[2]}})})},E=function(r,s){return e(void 0,void 0,void 0,function(){var e,a,c;return t(this,function(t){switch(t.label){case 0:e=i.getState().backwardCompatibility,t.label=1;case 1:return t.trys.push([1,3,,4]),a=e?o.deleteRuleSet.replace("{ruleSetId}",r):n.deleteRuleSet.replace("{ruleSetId}",r),[4,h(s).delete(a)];case 2:return[2,t.sent().data];case 3:throw c=t.sent(),console.error("Error deleting rule set:",c),c;case 4:return[2]}})})},I=function(r){return e(void 0,void 0,void 0,function(){var e,o;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=n.deleteRule.replace("{ruleId}",r),[4,d.delete(e)];case 1:return[2,t.sent().data];case 2:throw o=t.sent(),console.error("Error deleting rule:",o),o;case 3:return[2]}})})},k=function(r){return e(void 0,void 0,void 0,function(){var e,o;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=n.deleteQuestion.replace("{questionId}",r),[4,d.delete(e)];case 1:return[2,t.sent().data];case 2:throw o=t.sent(),console.error("Error deleting question:",o),o;case 3:return[2]}})})},R=function(r,o){return e(void 0,void 0,void 0,function(){var e,s;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=n.deleteTier.replace("{scopeId}",r).replace("{tierId}",o),[4,d.delete(e)];case 1:return[2,t.sent().data];case 2:throw s=t.sent(),console.error("Error deleting tier:",s),s;case 3:return[2]}})})},C=function(r,o){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d.put(n.updateVariant,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error updating variant:",e),e;case 3:return[2]}})})},_=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d.post(o.inheritScope,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error inheriting scope:",e),e;case 3:return[2]}})})},T=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),(null==r?void 0:r.application_mapping_id)?[4,d.post(n.inheritScope,r)]:[3,2];case 1:return[2,t.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw e=t.sent(),console.error("Error inheriting scope:",e),e;case 5:return[2]}})})},q=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,l.post(n.updateStation,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error updating station:",e),e;case 3:return[2]}})})},L=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:if(!r)throw new Error("scopeId is required for exporting rule sets");t.label=1;case 1:return t.trys.push([1,3,,4]),[4,d.post(n.exportRuleSet,{scope_id:r},{responseType:"blob"})];case 2:return[2,t.sent().data];case 3:throw e=t.sent(),console.error("Error exporting rule set:",e),e;case 4:return[2]}})})},j=function(r,s,a){return e(void 0,void 0,void 0,function(){var e,a,c,u;return t(this,function(t){switch(t.label){case 0:e=i.getState().backwardCompatibility,a=i.getState().app_integration_id,c=i.getState().token,t.label=1;case 1:return t.trys.push([1,6,,7]),e?[4,h(c).patch(o.toggleVariant,{variant_ids:r,is_enabled:s})]:[3,3];case 2:return[2,t.sent().data];case 3:return[4,h(c).patch(n.toggleVariant,{variant_ids:r,application_mapping_id:a,is_enabled:s})];case 4:return[2,t.sent().data];case 5:return[3,7];case 6:throw u=t.sent(),console.error("Error toggling variant status:",u),u;case 7:return[2]}})})},x=function(r,o,s,a,i){return e(void 0,void 0,void 0,function(){var e,c;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e={scopeId:r,tierId:o,move:{movedRuleId:s,prevRuleId:a,nextRuleId:i}},[4,d.put(n.alterRulePriority,e)];case 1:return[2,t.sent().data];case 2:throw c=t.sent(),console.error("Error altering question priority:",c),c;case 3:return[2]}})})},B=function(r,o){return e(void 0,void 0,void 0,function(){var e,s;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=n.fetchRulesByQuestionId.replace("{questionId}",r).replace("{scopeId}",o),[4,d.get(e)];case 1:return[2,t.sent().data];case 2:throw s=t.sent(),console.error("Error fetching rules by question id:",s),s;case 3:return[2]}})})},z=function(r){return void 0===r&&(r={limit:"50",offset:"0"}),e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d.post(n.retrieveGenreScopes,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error retrieving genre scopes:",e),e;case 3:return[2]}})})},A=function(r){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d.post(n.searchScopes,r)];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error searching scopes:",e),e;case 3:return[2]}})})},D=function(r){return e(void 0,void 0,void 0,function(){return t(this,function(e){return[2,new Promise(function(e){setTimeout(function(){e({data:[{stationId:"reetrtdfsds",stationName:"Hot 98.7",stationDesc:"Learnings that apply for Hot 98.7 Station",learningsCount:5},{stationId:"sta-102",stationName:"Smooth Jazz 102.1",stationDesc:"Learnings that apply for Smooth Jazz 102.1 Station",learningsCount:12},{stationId:"sta-103",stationName:"Rock 94",stationDesc:"Learnings that apply for Rock 94 Station",learningsCount:8}]})},500)})]})})};export{x as alterQuestionPriority,l as audacyApi,S as createRuleSet,d as default,k as deleteQuestion,I as deleteRule,E as deleteRuleSet,R as deleteTier,L as exportRuleSet,B as fetchRulesByQuestionId,g as fetchScopes,m as fetchStationsByKeyword,y as getRuleOverrideHistory,b as getRulesInRuleSetById,D as getStationsByScopeId,T as inheritScope,_ as inheritScopeBackwardCompatible,h as llmApiWithToken,p as publishFeedback,w as renameScope,z as retrieveGenreScopes,f as saveInstantLearningQuestion,A as searchScopes,v as submitChatFeedback,j as toggleVariant,q as updateStation,C as updateVariant};
|
|
1
|
+
import{__awaiter as t,__generator as e}from"tslib";import r from"axios";import{API_ENDPOINTS as n,LEGACY_API_ENDPOINTS as o}from"./apiConfig.js";import s from"../store/useAuthStore.js";import a from"../store/useEnvStore.js";import{useLearningTemplateStore as i}from"../store/useLearningTemplateStore.js";import{IL_CONFIG_CONSTANTS as c}from"../config.js";var u=function(t){return t.interceptors.request.use(function(t){var e=s.getState().user,r=null==e?void 0:e.accessToken;return r&&(t.headers.Authorization="Bearer ".concat(r)),t}),t},l=function(t,e){return t.interceptors.request.use(function(t){return t.baseURL=e(),t}),t},d=l(u(r.create({headers:{"Content-Type":"application/json"}})),function(){return a.getState().audacyBackendUrl||""}),p=l(u(r.create({headers:{"Content-Type":"application/json"}})),function(){return a.getState().llmStudioUrl||""}),h=function(t){return l(u(r.create({headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},withCredentials:!0})),function(){return a.getState().llmStudioUrl||""})},v=function(r,s){return t(void 0,void 0,void 0,function(){var t,s,a;return e(this,function(e){switch(e.label){case 0:t=i.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),s=t?o.publishFeedback:"".concat(n.publishFeedback),[4,p.post(s,r)];case 2:return[2,e.sent().data];case 3:throw a=e.sent(),console.error("Error publishing feedback to LLM Studio:",a),a;case 4:return[2]}})})},f=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(n.submitChatFeedback,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error submitting chat feedback:",t),t;case 3:return[2]}})})},g=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(n.saveInstantLearningQuestion,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error saving instant learning question:",t),t;case 3:return[2]}})})},b=function(r,s){return t(void 0,void 0,void 0,function(){var t,a,c;return e(this,function(e){switch(e.label){case 0:t=i.getState().backwardCompatibility,e.label=1;case 1:if(e.trys.push([1,3,,4]),!r&&!1===t)throw new Error("App Integration ID is not provided. Falling back to legacy endpoint for fetching scopes.");return a=t?o.fetchScopes:"".concat(n.fetchScopes,"/").concat(r),[4,h(s).get(a)];case 2:return[2,e.sent().data];case 3:throw c=e.sent(),console.error("Error fetching rule sets:",c),c;case 4:return[2]}})})},w=function(r){return t(void 0,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t="".concat(n.renameScope),[4,p.put(t,r)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error renaming scope:",o),o;case 3:return[2]}})})},y=function(r,s){return t(void 0,void 0,void 0,function(){var t,a,c;return e(this,function(e){switch(e.label){case 0:t=i.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),a=t?"".concat(o.getRulesInRuleSetById,"/").concat(r,"?include_config=True&sort_variant_by=createdAt"):"".concat(n.getRulesInRuleSetById,"/").concat(r),[4,h(s).get(a)];case 2:return[2,e.sent().data];case 3:return c=e.sent(),console.error("Error fetching rules in rule set:",c),[3,4];case 4:return[2]}})})},S=function(r){return t(void 0,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t="".concat(n.getRuleOverrideHistory,"/").concat(r),[4,p.get(t)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error getting rule override history:",o),o;case 3:return[2]}})})},m=function(r,s){return t(void 0,void 0,void 0,function(){var t,a,c;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=i.getState().backwardCompatibility,a=t?o.createRuleSet:n.createRuleSet,[4,h(s).post(a,r)];case 1:return[2,e.sent().data];case 2:throw c=e.sent(),console.error("Error creating rule set:",c),c;case 3:return[2]}})})},E=function(r,o){return void 0===o&&(o=!1),t(void 0,void 0,void 0,function(){var t,s;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t="".concat(n.fetchStationsByKeyword.replace("{keyword}",r),"?allow_existing=").concat(o),[4,d.get(t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error fetching station name by keyword:",s),s;case 3:return[2]}})})},I=function(r,s){return t(void 0,void 0,void 0,function(){var t,a,c;return e(this,function(e){switch(e.label){case 0:t=i.getState().backwardCompatibility,e.label=1;case 1:return e.trys.push([1,3,,4]),a=t?o.deleteRuleSet.replace("{ruleSetId}",r):n.deleteRuleSet.replace("{ruleSetId}",r),[4,h(s).delete(a)];case 2:return[2,e.sent().data];case 3:throw c=e.sent(),console.error("Error deleting rule set:",c),c;case 4:return[2]}})})},_=function(r){return t(void 0,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=n.deleteRule.replace("{ruleId}",r),[4,p.delete(t)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting rule:",o),o;case 3:return[2]}})})},k=function(r){return t(void 0,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=n.deleteQuestion.replace("{questionId}",r),[4,p.delete(t)];case 1:return[2,e.sent().data];case 2:throw o=e.sent(),console.error("Error deleting question:",o),o;case 3:return[2]}})})},R=function(r,o){return t(void 0,void 0,void 0,function(){var t,s;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=n.deleteTier.replace("{scopeId}",r).replace("{tierId}",o),[4,p.delete(t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error deleting tier:",s),s;case 3:return[2]}})})},C=function(r,o){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.put(n.updateVariant,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error updating variant:",t),t;case 3:return[2]}})})},T=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(o.inheritScope,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error inheriting scope:",t),t;case 3:return[2]}})})},q=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),(null==r?void 0:r.application_mapping_id)?[4,p.post(n.inheritScope,r)]:[3,2];case 1:return[2,e.sent().data];case 2:throw Error("Fatal Error: Trying to call inherit API without appintegration ID");case 3:return[3,5];case 4:throw t=e.sent(),console.error("Error inheriting scope:",t),t;case 5:return[2]}})})},j=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,d.post(n.updateStation,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error updating station:",t),t;case 3:return[2]}})})},L=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:if(!r)throw new Error("scopeId is required for exporting rule sets");e.label=1;case 1:return e.trys.push([1,3,,4]),[4,p.post(n.exportRuleSet,{scope_id:r},{responseType:"blob"})];case 2:return[2,e.sent().data];case 3:throw t=e.sent(),console.error("Error exporting rule set:",t),t;case 4:return[2]}})})},x=function(r,s,a){return t(void 0,void 0,void 0,function(){var t,a,c,u;return e(this,function(e){switch(e.label){case 0:t=i.getState().backwardCompatibility,a=i.getState().app_integration_id,c=i.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),t?[4,h(c).patch(o.toggleVariant,{variant_ids:r,is_enabled:s})]:[3,3];case 2:return[2,e.sent().data];case 3:return[4,h(c).patch(n.toggleVariant,{variant_ids:r,application_mapping_id:a,is_enabled:s})];case 4:return[2,e.sent().data];case 5:return[3,7];case 6:throw u=e.sent(),console.error("Error toggling variant status:",u),u;case 7:return[2]}})})},A=function(){return t(void 0,void 0,void 0,function(){var t,r,s,a,u,l,d,p;return e(this,function(e){switch(e.label){case 0:t=i.getState().backwardCompatibility,r=i.getState().app_integration_id,s=i.getState().token,e.label=1;case 1:return e.trys.push([1,6,,7]),t?(a=c.CUSTOM_SCOPE_GROUP_NAME,[4,h(s).post(o.getTiers,{tier_group_name:a})]):[3,3];case 2:return u=e.sent(),i.getState().setTiers((null===(d=u.data)||void 0===d?void 0:d.response)||[]),[3,5];case 3:return[4,h(s).get(n.getTiers.replace("{appIntegrationId}",null!=r?r:""))];case 4:u=e.sent(),"success"===(null===(p=u.data)||void 0===p?void 0:p.status)&&i.getState().setTiers(u.data.data.map(function(t){return{tier_id:t.id,tier_name:t.name,tier_priority:t.tier_priority}})),e.label=5;case 5:return[3,7];case 6:throw l=e.sent(),console.error("Error fetching tiers:",l),l;case 7:return[2]}})})},B=function(r,o,s,a,i){return t(void 0,void 0,void 0,function(){var t,c;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t={scopeId:r,tierId:o,move:{movedRuleId:s,prevRuleId:a,nextRuleId:i}},[4,p.put(n.alterRulePriority,t)];case 1:return[2,e.sent().data];case 2:throw c=e.sent(),console.error("Error altering question priority:",c),c;case 3:return[2]}})})},z=function(r,o){return t(void 0,void 0,void 0,function(){var t,s;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=n.fetchRulesByQuestionId.replace("{questionId}",r).replace("{scopeId}",o),[4,p.get(t)];case 1:return[2,e.sent().data];case 2:throw s=e.sent(),console.error("Error fetching rules by question id:",s),s;case 3:return[2]}})})},U=function(r){return void 0===r&&(r={limit:"50",offset:"0"}),t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(n.retrieveGenreScopes,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error retrieving genre scopes:",t),t;case 3:return[2]}})})},D=function(r){return t(void 0,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.post(n.searchScopes,r)];case 1:return[2,e.sent().data];case 2:throw t=e.sent(),console.error("Error searching scopes:",t),t;case 3:return[2]}})})},F=function(r){return t(void 0,void 0,void 0,function(){return e(this,function(t){return[2,new Promise(function(t){setTimeout(function(){t({data:[{stationId:"reetrtdfsds",stationName:"Hot 98.7",stationDesc:"Learnings that apply for Hot 98.7 Station",learningsCount:5},{stationId:"sta-102",stationName:"Smooth Jazz 102.1",stationDesc:"Learnings that apply for Smooth Jazz 102.1 Station",learningsCount:12},{stationId:"sta-103",stationName:"Rock 94",stationDesc:"Learnings that apply for Rock 94 Station",learningsCount:8}]})},500)})]})})};export{B as alterQuestionPriority,d as audacyApi,m as createRuleSet,p as default,k as deleteQuestion,_ as deleteRule,I as deleteRuleSet,R as deleteTier,L as exportRuleSet,z as fetchRulesByQuestionId,b as fetchScopes,E as fetchStationsByKeyword,A as fetchTiers,S as getRuleOverrideHistory,y as getRulesInRuleSetById,F as getStationsByScopeId,q as inheritScope,T as inheritScopeBackwardCompatible,h as llmApiWithToken,v as publishFeedback,w as renameScope,U as retrieveGenreScopes,g as saveInstantLearningQuestion,D as searchScopes,f as submitChatFeedback,x as toggleVariant,j as updateStation,C as updateVariant};
|
|
2
2
|
//# sourceMappingURL=scopeApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearningManagement.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningManagement.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"LearningManagement.d.ts","sourceRoot":"","sources":["../../../../../src/features/LearningManagement/LearningManagement.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAmFrC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,uBAAuB;IAC/B,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,GAAG,CAAC;IACZ,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAA;IACD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,qBAA2B,EAAE,EAAE,uBAAuB,2CAgetK;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -23,6 +23,7 @@ export declare const API_ENDPOINTS: {
|
|
|
23
23
|
retrieveGenreScopes: string;
|
|
24
24
|
searchScopes: string;
|
|
25
25
|
sessionValidation: string;
|
|
26
|
+
getTiers: string;
|
|
26
27
|
};
|
|
27
28
|
export declare const LEGACY_API_ENDPOINTS: {
|
|
28
29
|
fetchScopes: string;
|
|
@@ -32,5 +33,6 @@ export declare const LEGACY_API_ENDPOINTS: {
|
|
|
32
33
|
publishFeedback: string;
|
|
33
34
|
inheritScope: string;
|
|
34
35
|
toggleVariant: string;
|
|
36
|
+
getTiers: string;
|
|
35
37
|
};
|
|
36
38
|
//# sourceMappingURL=apiConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/apis/apiConfig.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"apiConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/apis/apiConfig.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BzB,CAAC;AACF,eAAO,MAAM,oBAAoB;;;;;;;;;CAShC,CAAA"}
|
|
@@ -223,6 +223,7 @@ export interface UpdateStationPayload {
|
|
|
223
223
|
export declare const updateStation: (payload: UpdateStationPayload) => Promise<any>;
|
|
224
224
|
export declare const exportRuleSet: (scopeId: string) => Promise<any>;
|
|
225
225
|
export declare const toggleVariant: (variantIds: string[], isEnabled: boolean, updatedBy: string) => Promise<any>;
|
|
226
|
+
export declare const fetchTiers: () => Promise<void>;
|
|
226
227
|
export declare const alterQuestionPriority: (scopeId: string, tierId: string, movedRuleId: string, prevRuleId: string | null, nextRuleId: string | null) => Promise<any>;
|
|
227
228
|
export declare const fetchRulesByQuestionId: (questionId: string, scopeId: string) => Promise<any>;
|
|
228
229
|
export declare const retrieveGenreScopes: (payload?: RetrieveGenreScopesPayload) => Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopeApis.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/apis/scopeApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scopeApis.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/apis/scopeApis.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;IAChC,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,GAAG,EAAE,MAAM,CAAC;QACZ,aAAa,EAAE,OAAO,CAAC;QACvB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,MAAM,CAAC;YACpB,gBAAgB,CAAC,EAAE;gBACjB,iBAAiB,EAAE,GAAG,CAAC;aACxB,CAAC;YACF,WAAW,CAAC,EAAE;gBACZ,iBAAiB,EAAE,GAAG,CAAC;aACxB,CAAC;SACH,CAAC;QACF,UAAU,CAAC,EAAE;YACX,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,OAAO,EAAE;YAEP,OAAO,EAAE,MAAM,CAAC;YAChB,sBAAsB,EAAE,MAAM,CAAC;YAC/B,yBAAyB,EAAE,MAAM,CAAC;YAClC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YACnC,yBAAyB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAC1C,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM,CAAC;gBACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;gBAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;gBAC1B,KAAK,EAAE;oBACL,SAAS,EAAE,MAAM,CAAC;oBAClB,OAAO,EAAE,MAAM,CAAC;oBAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;oBAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;iBACtB,CAAC;aACH,CAAC;YACF,SAAS,EAAE,OAAO,CAAC;YACnB,SAAS,EAAE,OAAO,CAAC;YACnB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM,CAAC;gBACb,aAAa,EAAE,MAAM,CAAC;gBACtB,YAAY,EAAE,MAAM,CAAC;gBACrB,OAAO,CAAC,EAAE,MAAM,CAAC;aAClB,CAAC;YACF,KAAK,EAAE;gBACL,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;gBAClB,KAAK,EAAE,MAAM,CAAC;gBACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;aAC5B,CAAC;YACF,UAAU,EAAE,KAAK,CAAC;gBAChB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;gBAClB,KAAK,EAAE,MAAM,CAAC;gBACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;aAC5B,CAAC,CAAC;YACH,gBAAgB,EAAE,MAAM,CAAC;YACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAC7B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;YACrC,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,mBAAmB,EAAE,MAAM,CAAC;YAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;YACxB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACzC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAC3B,qEAAqE;YACrE,qBAAqB,CAAC,EAAE,OAAO,CAAC;SACjC,CAAC;QACF,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AA6BD,eAAO,MAAM,SAAS,KAOrB,CAAC;AAEF,QAAA,MAAM,MAAM,KAOX,CAAC;AAEF,eAAO,MAAM,eAAe,UAAW,MAAM,QAS1C,CAAC;AAEJ,eAAe,MAAM,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,eAAe,YAAmB,GAAG,iBAAiB,MAAM,iBAUxE,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAAmB,mBAAmB,iBAQpE,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAmB,kCAAkC,iBAQ5F,CAAC;AAEF,eAAO,MAAM,WAAW,qBAA4B,MAAM,GAAG,SAAS,SAAS,MAAM,iBAcpF,CAAC;AAEF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,YAAmB,kBAAkB,iBAS5D,CAAC;AAEF,eAAO,MAAM,qBAAqB,cAAqB,MAAM,SAAS,MAAM,iBAU3E,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAAqB,MAAM,iBAS7D,CAAC;AAEF,eAAO,MAAM,aAAa,YAAmB,GAAG,SAAS,MAAM,iBAW9D,CAAC;AAEF,eAAO,MAAM,sBAAsB,YACxB,MAAM,qBACG,OAAO,iBAU1B,CAAC;AAEF,eAAO,MAAM,WAAW,YAAmB,GAAG,iBAS7C,CAAC;AAEF,eAAO,MAAM,aAAa,cAAqB,MAAM,SAAS,MAAM,iBAWnE,CAAC;AAEF,eAAO,MAAM,UAAU,WAAkB,MAAM,iBAS9C,CAAC;AACF,eAAO,MAAM,cAAc,eAAsB,MAAM,iBAStD,CAAC;AAGF,eAAO,MAAM,UAAU,YAAmB,MAAM,UAAU,MAAM,iBAW/D,CAAC;AAGF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC1C,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,4CAA4C;IAC5C,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAmB,oBAAoB,aAAa,MAAM,iBAQnF,CAAC;AAIF;;GAEG;AACH,MAAM,WAAW,qCAAqC;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,YAAmB,qCAAqC,iBAQlG,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,YAAmB,mBAAmB,iBAY9D,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,0BAA0B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,YAAmB,oBAAoB,iBAQhE,CAAC;AAEF,eAAO,MAAM,aAAa,YAAmB,MAAM,iBAelD,CAAC;AAEF,eAAO,MAAM,aAAa,eACZ,MAAM,EAAE,aACT,OAAO,aACP,MAAM,iBAwBlB,CAAC;AACF,eAAO,MAAM,UAAU,qBA8BtB,CAAC;AACF,eAAO,MAAM,qBAAqB,YACvB,MAAM,UACP,MAAM,eACD,MAAM,cACP,MAAM,GAAG,IAAI,cACb,MAAM,GAAG,IAAI,iBAkB1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,eAAsB,MAAM,WAAW,MAAM,iBAW/E,CAAC;AAEF,eAAO,MAAM,mBAAmB,aACrB,0BAA0B,iBASpC,CAAC;AAEF,eAAO,MAAM,YAAY,YAAmB,mBAAmB,iBAQ9D,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,YAAmB,MAAM,KAAG,QAAQ,GAAG,CA2BvE,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,YAAmB,sBAAsB,KAAG,QAAQ,OAAO,CAQtF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),r=require("appsec-ui"),c=require("../store/useAuthStore.js"),a=require("../store/usePermissionsStore.js"),o=require("./AccessPanel.module.css.js");exports.default=function(t){var i=t.ruleSetId,u=t.moduleId,n=t.mode,d=void 0===n?"both":n,l=c.default(function(e){return e.user}),p=null==l?void 0:l.accessToken,m=a.usePermissionsStore(function(e){return e.hasPermission}),j=i||void 0,f=Boolean(j),h=f&&m("ilotj.scope.access.user.add",j),v=f&&m("ilotj.scope.access.user.edit",j),g=f&&m("ilotj.scope.access.user.remove",j),P=f&&m("ilotj.scope.access.group.add",j),_=f&&m("ilotj.scope.access.group.role.change",j),x=f&&m("ilotj.scope.access.group.remove",j);return j?s.jsx("div",e.__assign({className:o.default.accessPanel},{children:s.jsx(r.RbacQueryProvider,{children:s.jsx(r.AppsecProvider,e.__assign({appId:"Traffic Manager Mode",baseUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecUrl:"https://dev-cw-appsec.techo.camp",mode:"manage",getAuthToken:function(){return null!=p?p:""}},{children:s.jsx(r.AccessListPanel,{resourceId:j,moduleId:u||"6a0c337a0f031cf769642b23",mode:d,canAddUser:h,canEditUser:v,canDeleteUser:g,canAddGroup:P,canEditGroup:_,canDeleteGroup:x})}))})})):s.jsx("div",e.__assign({className:o.default.accessPanel},{children:s.jsx("p",e.__assign({className:o.default.emptyState},{children:"Waiting for Rule Set ID..."}))}))};
|
|
2
|
-
//# sourceMappingURL=AccessPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".AccessPanel-module_accessPanel__RXDzY{--appsec-bg:#fff;--appsec-surface:#f9fafb;--appsec-surface-alt:#f2f4f7;--appsec-border:#d0d5dd;--appsec-text:#101828;--appsec-text-secondary:#475467;--appsec-text-tertiary:#667085;--appsec-primary:#2563eb;--appsec-primary-light:#eff6ff;--appsec-danger:#dc2626;--appsec-danger-light:#fef2f2;--appsec-success:#16a34a;--appsec-success-light:#f0fdf4;--appsec-warning:#d97706;--appsec-warning-light:#fffbeb;box-sizing:border-box;color:#101828;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;height:100%;overflow:auto;padding:16px;width:100%}.AccessPanel-module_emptyState__EAuao{color:#667085;font-size:14px;margin:0}.AccessPanel-module_accessPanel__RXDzY *{box-sizing:border-box}.AccessPanel-module_accessPanel__RXDzY button,.AccessPanel-module_accessPanel__RXDzY input,.AccessPanel-module_accessPanel__RXDzY select{font:inherit}.AccessPanel-module_accessPanel__RXDzY button{background:#0000;border:0}.AccessPanel-module_accessPanel__RXDzY p{margin:0}.AccessPanel-module_accessPanel__RXDzY .flex{display:flex}.AccessPanel-module_accessPanel__RXDzY .inline-flex{display:inline-flex}.AccessPanel-module_accessPanel__RXDzY .flex-col{flex-direction:column}.AccessPanel-module_accessPanel__RXDzY .flex-wrap{flex-wrap:wrap}.AccessPanel-module_accessPanel__RXDzY .flex-1{flex:1 1 0%}.AccessPanel-module_accessPanel__RXDzY .shrink-0{flex-shrink:0}.AccessPanel-module_accessPanel__RXDzY .items-center{align-items:center}.AccessPanel-module_accessPanel__RXDzY .items-start{align-items:flex-start}.AccessPanel-module_accessPanel__RXDzY .justify-center{justify-content:center}.AccessPanel-module_accessPanel__RXDzY .justify-between{justify-content:space-between}.AccessPanel-module_accessPanel__RXDzY .justify-end{justify-content:flex-end}.AccessPanel-module_accessPanel__RXDzY .gap-0\\\\.5{gap:2px}.AccessPanel-module_accessPanel__RXDzY .gap-1{gap:4px}.AccessPanel-module_accessPanel__RXDzY .gap-1\\\\.5{gap:6px}.AccessPanel-module_accessPanel__RXDzY .gap-2{gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-3{gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-4{gap:16px}.AccessPanel-module_accessPanel__RXDzY .space-y-4>:not([hidden])~:not([hidden]){margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .relative{position:relative}.AccessPanel-module_accessPanel__RXDzY .absolute{position:absolute}.AccessPanel-module_accessPanel__RXDzY .left-3{left:12px}.AccessPanel-module_accessPanel__RXDzY .right-2\\\\.5{right:10px}.AccessPanel-module_accessPanel__RXDzY .pointer-events-none{pointer-events:none}.AccessPanel-module_accessPanel__RXDzY .z-50{z-index:50}.AccessPanel-module_accessPanel__RXDzY .w-full{width:100%}.AccessPanel-module_accessPanel__RXDzY .w-8{width:32px}.AccessPanel-module_accessPanel__RXDzY .w-14{width:56px}.AccessPanel-module_accessPanel__RXDzY .w-16{width:64px}.AccessPanel-module_accessPanel__RXDzY .w-24{width:96px}.AccessPanel-module_accessPanel__RXDzY .w-28{width:112px}.AccessPanel-module_accessPanel__RXDzY .h-3{height:12px}.AccessPanel-module_accessPanel__RXDzY .w-3{width:12px}.AccessPanel-module_accessPanel__RXDzY .h-3\\\\.5{height:14px}.AccessPanel-module_accessPanel__RXDzY .w-3\\\\.5{width:14px}.AccessPanel-module_accessPanel__RXDzY .h-4{height:16px}.AccessPanel-module_accessPanel__RXDzY .w-4{width:16px}.AccessPanel-module_accessPanel__RXDzY .h-6{height:24px}.AccessPanel-module_accessPanel__RXDzY .w-6{width:24px}.AccessPanel-module_accessPanel__RXDzY .h-7{height:28px}.AccessPanel-module_accessPanel__RXDzY .h-8{height:32px}.AccessPanel-module_accessPanel__RXDzY .h-9{height:36px}.AccessPanel-module_accessPanel__RXDzY .min-w-32{min-width:128px}.AccessPanel-module_accessPanel__RXDzY .min-w-40{min-width:160px}.AccessPanel-module_accessPanel__RXDzY .max-w-xs{max-width:320px}.AccessPanel-module_accessPanel__RXDzY .rounded{border-radius:4px}.AccessPanel-module_accessPanel__RXDzY .rounded-full{border-radius:9999px}.AccessPanel-module_accessPanel__RXDzY .rounded-appsec{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .border{border:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-border{border-color:var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-primary{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .divide-y>:not([hidden])~:not([hidden]){border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .overflow-hidden{overflow:hidden}.AccessPanel-module_accessPanel__RXDzY .overflow-y-auto{overflow-y:auto}.AccessPanel-module_accessPanel__RXDzY .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .appearance-none{appearance:none}.AccessPanel-module_accessPanel__RXDzY .outline-none{outline:0}.AccessPanel-module_accessPanel__RXDzY .cursor-pointer{cursor:pointer}.AccessPanel-module_accessPanel__RXDzY .cursor-not-allowed{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .select-none{user-select:none}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-bg{background-color:var(--appsec-bg)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface-alt{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary{background-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary-light{background-color:var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger{background-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger-light{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .bg-transparent{background-color:initial}.AccessPanel-module_accessPanel__RXDzY .bg-blue-500{background-color:#3b82f6}.AccessPanel-module_accessPanel__RXDzY .bg-purple-500{background-color:#a855f7}.AccessPanel-module_accessPanel__RXDzY .bg-green-600{background-color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .bg-orange-500{background-color:#f97316}.AccessPanel-module_accessPanel__RXDzY .bg-pink-500{background-color:#ec4899}.AccessPanel-module_accessPanel__RXDzY .bg-teal-500{background-color:#14b8a6}.AccessPanel-module_accessPanel__RXDzY .bg-indigo-500{background-color:#6366f1}.AccessPanel-module_accessPanel__RXDzY .bg-rose-500{background-color:#f43f5e}.AccessPanel-module_accessPanel__RXDzY .text-white{color:#fff}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-secondary{color:var(--appsec-text-secondary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-tertiary{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-primary{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-danger{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .text-gray-500{color:#667085}.AccessPanel-module_accessPanel__RXDzY .text-xs{font-size:12px;line-height:18px}.AccessPanel-module_accessPanel__RXDzY .text-sm{font-size:14px;line-height:20px}.AccessPanel-module_accessPanel__RXDzY .text-\\\\[\\31 0px\\\\]{font-size:10px;line-height:14px}.AccessPanel-module_accessPanel__RXDzY .text-\\\\[\\31 1px\\\\]{font-size:11px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .font-medium{font-weight:500}.AccessPanel-module_accessPanel__RXDzY .font-semibold{font-weight:600}.AccessPanel-module_accessPanel__RXDzY .capitalize{text-transform:capitalize}.AccessPanel-module_accessPanel__RXDzY .text-center{text-align:center}.AccessPanel-module_accessPanel__RXDzY .text-left{text-align:left}.AccessPanel-module_accessPanel__RXDzY .px-1{padding-left:4px;padding-right:4px}.AccessPanel-module_accessPanel__RXDzY .px-2{padding-left:8px;padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .px-2\\\\.5{padding-left:10px;padding-right:10px}.AccessPanel-module_accessPanel__RXDzY .px-3{padding-left:12px;padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .px-4{padding-left:16px;padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .py-0\\\\.5{padding-bottom:2px;padding-top:2px}.AccessPanel-module_accessPanel__RXDzY .py-1{padding-bottom:4px;padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .py-2{padding-bottom:8px;padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .py-2\\\\.5{padding-bottom:10px;padding-top:10px}.AccessPanel-module_accessPanel__RXDzY .py-4{padding-bottom:16px;padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .py-8{padding-bottom:32px;padding-top:32px}.AccessPanel-module_accessPanel__RXDzY .p-0\\\\.5{padding:2px}.AccessPanel-module_accessPanel__RXDzY .p-1{padding:4px}.AccessPanel-module_accessPanel__RXDzY .p-2{padding:8px}.AccessPanel-module_accessPanel__RXDzY .pl-9{padding-left:36px}.AccessPanel-module_accessPanel__RXDzY .pr-6{padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .pr-8{padding-right:32px}.AccessPanel-module_accessPanel__RXDzY .ml-auto{margin-left:auto}.AccessPanel-module_accessPanel__RXDzY .shadow-sm{box-shadow:0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .transition-all,.AccessPanel-module_accessPanel__RXDzY .transition-colors{transition:all .15s ease}.AccessPanel-module_accessPanel__RXDzY .opacity-30{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .opacity-50{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:opacity-30:disabled{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:opacity-50:disabled{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:cursor-not-allowed:disabled{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY input[type=search],.AccessPanel-module_accessPanel__RXDzY select{background-color:var(--appsec-bg);border:1px solid var(--appsec-border);border-radius:8px;color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY input[type=search]::placeholder{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY input[type=checkbox]{accent-color:var(--appsec-primary);height:16px;width:16px}.AccessPanel-module_accessPanel__RXDzY button:hover:not(:disabled){opacity:.92}.AccessPanel-module_accessPanel__RXDzY .focus\\\\:border-appsec-primary:focus{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .focus\\\\:ring-2:focus{box-shadow:0 0 0 3px var(--appsec-primary-light)}"),exports.default={accessPanel:"AccessPanel-module_accessPanel__RXDzY",emptyState:"AccessPanel-module_emptyState__EAuao"};
|
|
2
|
-
//# sourceMappingURL=AccessPanel.module.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPanel.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.default="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";
|
|
2
|
-
//# sourceMappingURL=Search-result(add new).svg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":[],"mappings":"qGA0Ke"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material"),o=require("lucide-react"),i=require("primereact/toast"),s=require("uuid"),a=require("../../assets/Search-result(add new).svg.js"),l=require("../../store/useAuthStore.js"),u=require("../../config.js"),c=require("../../apis/scopeApis.js"),d=require("./InputField.js"),p=require("./StationAutocomplete.js"),f=require("../CardSkeleton.js"),g=require("./OnboardingLoader.js"),x=require("./TemplateCard.js"),_=[{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"},{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"}],m=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],h=[{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(v){var S,y=v.isOpen,b=v.onClose,j=v.onBoardStation,w=v.app_integration_id,C=v.token,T=v.stationNameParam,O=t.useState(null),F=O[0],N=O[1],B=t.useState([]),A=B[0],E=B[1],M=t.useState(0),D=M[0],q=M[1],I=t.useState(!0),k=I[0],P=I[1],R=t.useState(!1),z=R[0],L=R[1],W=t.useState([]),G=W[0],U=W[1],Y=t.useState(""),H=Y[0],K=Y[1],X=t.useState(""),J=X[0],Q=X[1],V=t.useState(!1),Z=V[0],$=V[1],ee=t.useState(!1),ne=ee[0],te=ee[1],re=t.useState(null),oe=re[0],ie=re[1],se=t.useState(!1),ae=se[0],le=se[1],ue=t.useState(0),ce=ue[0],de=ue[1],pe=t.useState(""),fe=pe[0],ge=pe[1],xe=l.default().user,_e=t.useRef(null),me=t.useRef(null),he=t.useRef(null),ve=t.useRef(null),Se=t.useState({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),ye=Se[0],be=Se[1],je=function(e,n){return e.find(function(e){return e.value===n})||null},we=t.useMemo(function(){return A.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[A]),Ce=t.useMemo(function(){var e,n,t;if(!ye.genre)return null;var r=A.find(function(e){return e.scope_name===ye.genre});return r?{id:r.id,title:r.scope_name||"Unnamed Template",description:(null===(e=r.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(n=r.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:r.rules_count||0,tiersCount:r.tier_count||0,isCopy:null!==(t=r.is_copy)&&void 0!==t&&t}:null},[ye.genre,A]);t.useEffect(function(){return function(){he.current&&clearTimeout(he.current)}},[]);var Te=function(n){return e.__awaiter(void 0,void 0,void 0,function(){var t,r,o;return e.__generator(this,function(i){switch(i.label){case 0:if(z)return[2];L(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,c.retrieveGenreScopes({limit:"20",offset:String(n)})];case 2:return"success"===(null==(t=i.sent())?void 0:t.status)&&Array.isArray(null==t?void 0:t.data)?(r=t.data,E(function(t){if(0===n)return r;var o=new Set(t.map(function(e){return e.id})),i=r.filter(function(e){return!o.has(e.id)});return e.__spreadArray(e.__spreadArray([],t,!0),i,!0)}),r.length<20?P(!1):P(!0),q(n+20)):P(!1),[3,5];case 3:return o=i.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",o),P(!1),[3,5];case 4:return L(!1),[7];case 5:return[2]}})})};t.useEffect(function(){if(y&&(E([]),q(0),P(!0),Te(0),T)){ge(T);e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c.fetchStationsByKeyword(T,!0)];case 1:return!0===(null==(n=e.sent())?void 0:n.success)&&Array.isArray(null==n?void 0:n.data)&&(t=n.data.find(function(e){var n;return(null===(n=e.station_name)||void 0===n?void 0:n.toLowerCase())===T.toLowerCase()&&!e.ruleset_id}),t&&N(t)),[3,3];case 2:return r=e.sent(),console.error("[StationOnboard] Error auto-selecting station:",r),[3,3];case 3:return[2]}})})}},[y,T]);t.useEffect(function(){be(F?function(n){var t;return e.__assign(e.__assign({},n),{region:null!==(t=F.market)&&void 0!==t?t:""})}:{region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""})},[F]),t.useEffect(function(){var e=setTimeout(function(){Q(H)},500);return function(){return clearTimeout(e)}},[H]),t.useEffect(function(){e.__awaiter(void 0,void 0,void 0,function(){var n,t,r;return e.__generator(this,function(e){switch(e.label){case 0:if(!J.trim())return U([]),[2];$(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,c.searchScopes({search_string:J})];case 2:return"success"===(null==(n=e.sent())?void 0:n.status)&&Array.isArray(null==n?void 0:n.data)?(t=n.data.map(function(e){var n,t,r;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===(t=e.inheritance)||void 0===t?void 0:t[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(r=e.is_copy)&&void 0!==r&&r}}),U(t)):U([]),[3,5];case 3:return r=e.sent(),console.error("[StationOnboard] Error searching scopes:",r),U([]),[3,5];case 4:return $(!1),[7];case 5:return[2]}})})},[J]),t.useEffect(function(){!J.trim()&&Ce&&ie(Ce.id)},[J,Ce]);var Oe=function(){setTimeout(function(){ve.current&&ve.current.scrollTo({top:ve.current.scrollHeight,behavior:"smooth"})},100)},Fe=function(){ge(""),N(null),be({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),U([]),K(""),ie(null),b()},Ne=function(n,t){var r;if("primeTime"!==n){var o=null!==(r=null==t?void 0:t.value)&&void 0!==r?r:"";be(function(t){var r;return e.__assign(e.__assign({},t),((r={})[n]=String(o),r))}),"genre"===n&&(te(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){var e=A.find(function(e){return e.scope_name===o});ie(e?e.id:null),te(!1)},800))}else{var i=(null==t?void 0:t.value)?String(t.value):"";be(function(n){return e.__assign(e.__assign({},n),{primeTime:i?[i]:[]})})}},Be=Boolean(F&&ye.region&&ye.primeTime.length>0&&ye.genre);return n.jsxs(r.Dialog,e.__assign({open:y,onClose:Fe,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden"}}},{children:[n.jsx(i.Toast,{ref:_e}),n.jsxs(r.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(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),n.jsx(r.IconButton,e.__assign({onClick:Fe,disabled:ae,sx:{color:"#19213D"}},{children:n.jsx(o.X,{size:24})}))]})),n.jsxs(r.DialogContent,e.__assign({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[n.jsx(g.default,{isLoading:ae,currentStep:ce,onComplete:function(){le(!1);var e=me.current;Fe(),j(e||void 0),me.current=null}}),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flex:1,paddingY:"14px",paddingX:"20px",gap:3,overflowY:"hidden"}},{children:[n.jsxs(r.Box,e.__assign({ref:ve,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5",height:"100%",overflowY:"auto"}},{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[n.jsxs(r.Box,e.__assign({className:"space-y-1.5"},{children:[n.jsxs("label",e.__assign({className:"text-sm font-medium text-[#19213D]"},{children:[n.jsx("span",e.__assign({className:"mr-0.5 text-xs font-semibold text-[#8F2C23]"},{children:"*"})),"Station Name/Call Letters"]})),n.jsx(p.default,{value:fe,onChange:ge,onStationSelect:function(e){return N(e)}})]})),n.jsx(d.default,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:ye.region||void 0,isSearchable:!1}),n.jsx(d.default,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:_,value:je(_,(null===(S=ye.primeTime)||void 0===S?void 0:S[0])||""),onOptionChange:function(e){return Ne("primeTime",e)},isSearchable:!1}),n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{required:!0,label:"Genre",placeholder:"Select Genre",options:we,value:je(we,ye.genre),onOptionChange:function(e){return Ne("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!z&&k&&Te(D)},isLoadingOptions:z,hasMoreOptions:k})})),n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{label:"Station Type",placeholder:"None",options:m,value:je(m,ye.type),onOptionChange:function(n){Ne("type",n),"Low Sellout"!==(null==n?void 0:n.value)&&be(function(n){return e.__assign(e.__assign({},n),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===ye.type&&n.jsx(r.Box,e.__assign({onClick:Oe,sx:{width:"100%"}},{children:n.jsx(d.default,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:h,value:je(h,ye.lowSelloutConfig),onOptionChange:function(e){return Ne("lowSelloutConfig",e)},isSearchable:!1})}))]}))]})),n.jsx(r.Box,e.__assign({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column",height:"100%",overflowY:"auto"}},{children:ye.genre?n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Matching scope for your station"})),n.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2,mb:4}},{children:ne?n.jsx(f.default,{}):Ce?n.jsx(x.default,e.__assign({},Ce,{isSelected:oe===Ce.id,onSelect:ie}),Ce.id):null})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Other available stations"})),n.jsxs("div",e.__assign({className:"relative mb-4 w-full"},{children:[n.jsx("input",{type:"text",value:H,onChange:function(e){return K(e.target.value)},placeholder:"Search for station...",className:"w-full rounded-lg border border-[#E2E8F0] px-10 py-[7px] text-[12px] outline-none transition-all placeholder:text-[#BAC0CC] focus:border-blue-500 focus:ring-1 focus:ring-blue-500"}),n.jsx(o.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]})),n.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[Z&&n.jsx(f.default,{}),!Z&&0===G.length&&J.trim()&&n.jsxs(r.Typography,e.__assign({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',J,'".']})),!Z&&G.map(function(t){return n.jsx(x.default,e.__assign({},t,{isSelected:oe===t.id,onSelect:ie}),t.id)})]}))]}):n.jsxs(n.Fragment,{children:[n.jsx(r.Typography,e.__assign({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Fill in the station details to load AI recommended scopes"})),n.jsx(r.Typography,e.__assign({sx:{fontSize:"0.75rem",color:"#64748B",mb:3}},{children:"AI will recommend the most relevant scope for this station."})),n.jsx(r.Box,e.__assign({sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.5,py:10}},{children:n.jsx("img",{src:a.default,alt:"Empty Result"})}))]})}))]}))]})),n.jsxs(r.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:Fe,disabled:ae,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,t,r,o,i,a,l,d,p,f,g,x,_,m,h,v,S,y;return e.__generator(this,function(b){switch(b.label){case 0:if(!F||!oe)return console.error("[StationOnboard] Missing required data for onboarding"),[2];n=Ce?e.__spreadArray([Ce],G,!0):G,t=n.find(function(e){return e.id===oe}),r=null!==(_=null==t?void 0:t.isCopy)&&void 0!==_&&_,le(!0),de(0),o=null,b.label=1;case 1:return b.trys.push([1,3,,4]),i={topic:"customRuleSet",customScopeGroupName:(null===u.IL_CONFIG_CONSTANTS||void 0===u.IL_CONFIG_CONSTANTS?void 0:u.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME)||"Audacy-Traffic-Manager",scopeDescription:F.station_name||"New Station",parentScopeId:null,customScopeName:F.station_name||"New Station",customScopeId:s.v4(),createByName:(null==xe?void 0:xe.firstname)||"System",createdBy:(null==xe?void 0:xe.email)||"system@audacy.com",applicationMappingId:w},console.log("[StationOnboard] Step 1: Creating rule set with payload:",i),[4,c.createRuleSet(i,C)];case 2:if(a=b.sent(),!(o=null===(m=null==a?void 0:a.data)||void 0===m?void 0:m.scopeId))throw new Error("Failed to create scope - no scopeId returned");return de(1),[3,4];case 3:return l=b.sent(),console.error("[StationOnboard] Error creating rule set:",l),null===(h=_e.current)||void 0===h||h.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),le(!1),de(0),[2];case 4:return b.trys.push([4,6,,11]),d={market:F.market,region:F.region,primetime_windows:ye.primeTime,genre:ye.genre,station_type:""===ye.type?null:ye.type,low_sellout_configurations:"Low Sellout"===ye.type?ye.lowSelloutConfig:null,ruleset_id:o,station_guid:F.station_guid,station_name:F.station_name||"New Station"},console.log("[StationOnboard] Step 2: Updating station with payload:",d),[4,c.updateStation(d)];case 5:return b.sent(),de(2),[3,11];case 6:p=b.sent(),console.error("[StationOnboard] Error updating station, rolling back rule set:",p),409===p.status?(null===(v=_e.current)||void 0===v||v.show({severity:"error",life:2500,summary:"Error updating station",detail:"Station already Onboarded."}),N(null),ie(null),ge(""),be(function(n){return e.__assign(e.__assign({},n),{region:""})})):null===(S=_e.current)||void 0===S||S.show({severity:"error",life:2500,summary:"Error updating station",detail:"Please try again."}),b.label=7;case 7:return b.trys.push([7,9,,10]),[4,c.deleteRuleSet(o,C)];case 8:return b.sent(),[3,10];case 9:return f=b.sent(),console.error("[StationOnboard] Failed to rollback rule set deletion:",f),[3,10];case 10:return le(!1),de(0),[2];case 11:return b.trys.push([11,13,,14]),g={source_scope_id:oe,target_scope_id:o,is_copy_parent_variant_id:r},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",g),[4,c.inheritScope(g)];case 12:return b.sent(),de(3),[3,14];case 13:return x=b.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",x),null===(y=_e.current)||void 0===y||y.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),le(!1),de(0),[2];case 14:return me.current=o,[2]}})})},disabled:!Be||ae,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Be?"#2563EB":"#BFDBFE",color:"#fff",cursor:Be&&!ae?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:ae?n.jsxs(n.Fragment,{children:[n.jsx(r.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
|
-
//# sourceMappingURL=BackwardStationOnboardModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackwardStationOnboardModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("zustand"),s=require("../apis/scopeApis.js"),n=r.create(function(r,n){return{accessData:[],isLoading:!1,error:null,fetchPermissions:function(n,i){return e.__awaiter(void 0,void 0,void 0,function(){var t,o,u;return e.__generator(this,function(e){switch(e.label){case 0:if(!n)return[2];r({isLoading:!0,error:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.appsecApi.get("/users/me",{params:{appId:n,resourceId:i}})];case 2:return t=e.sent(),r({accessData:(null===(u=t.data)||void 0===u?void 0:u.data)||[],isLoading:!1}),[3,4];case 3:return o=e.sent(),console.error("Failed to fetch permissions:",o),r({error:o.message||"Failed to fetch permissions",isLoading:!1}),[3,4];case 4:return[2]}})})},hasPermission:function(e,r){var s,i,t,o=n().accessData.find(function(e){return function(e,r){return!!r&&function(e){return e?"string"==typeof e?[e]:[e._id,e.id,e.resourceId,e.resource_id].filter(function(e){return"string"==typeof e&&e.length>0}):[]}(e).includes(r)}(e.resourceId,r)});return!o||null!==(t=null===(i=null===(s=o.role)||void 0===s?void 0:s.permissions)||void 0===i?void 0:i.some(function(r){return r.name===e}))&&void 0!==t&&t},reset:function(){return r({accessData:[],isLoading:!1,error:null})}}});exports.usePermissionsStore=n;
|
|
2
|
-
//# sourceMappingURL=usePermissionsStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePermissionsStore.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as o}from"react/jsx-runtime";import{RbacQueryProvider as r,AppsecProvider as s,AccessListPanel as c}from"appsec-ui";import t from"../store/useAuthStore.js";import{usePermissionsStore as a}from"../store/usePermissionsStore.js";import i from"./AccessPanel.module.css.js";var n=function(n){var p=n.ruleSetId,d=n.moduleId,u=n.mode,l=void 0===u?"both":u,m=t(function(e){return e.user}),f=null==m?void 0:m.accessToken,h=a(function(e){return e.hasPermission}),j=p||void 0,v=Boolean(j),g=v&&h("ilotj.scope.access.user.add",j),A=v&&h("ilotj.scope.access.user.edit",j),I=v&&h("ilotj.scope.access.user.remove",j),S=v&&h("ilotj.scope.access.group.add",j),U=v&&h("ilotj.scope.access.group.role.change",j),b=v&&h("ilotj.scope.access.group.remove",j);return o("div",e({className:i.accessPanel},j?{children:o(r,{children:o(s,e({appId:"Traffic Manager Mode",baseUrl:"https://dev-cw-appsec.techo.camp/granularApi",appsecUrl:"https://dev-cw-appsec.techo.camp",mode:"manage",getAuthToken:function(){return null!=f?f:""}},{children:o(c,{resourceId:j,moduleId:d||"6a0c337a0f031cf769642b23",mode:l,canAddUser:g,canEditUser:A,canDeleteUser:I,canAddGroup:S,canEditGroup:U,canDeleteGroup:b})}))})}:{children:o("p",e({className:i.emptyState},{children:"Waiting for Rule Set ID..."}))}))};export{n as default};
|
|
2
|
-
//# sourceMappingURL=AccessPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPanel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"../../../node_modules/style-inject/dist/style-inject.es.js";var c={accessPanel:"AccessPanel-module_accessPanel__RXDzY",emptyState:"AccessPanel-module_emptyState__EAuao"};e(".AccessPanel-module_accessPanel__RXDzY{--appsec-bg:#fff;--appsec-surface:#f9fafb;--appsec-surface-alt:#f2f4f7;--appsec-border:#d0d5dd;--appsec-text:#101828;--appsec-text-secondary:#475467;--appsec-text-tertiary:#667085;--appsec-primary:#2563eb;--appsec-primary-light:#eff6ff;--appsec-danger:#dc2626;--appsec-danger-light:#fef2f2;--appsec-success:#16a34a;--appsec-success-light:#f0fdf4;--appsec-warning:#d97706;--appsec-warning-light:#fffbeb;box-sizing:border-box;color:#101828;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;height:100%;overflow:auto;padding:16px;width:100%}.AccessPanel-module_emptyState__EAuao{color:#667085;font-size:14px;margin:0}.AccessPanel-module_accessPanel__RXDzY *{box-sizing:border-box}.AccessPanel-module_accessPanel__RXDzY button,.AccessPanel-module_accessPanel__RXDzY input,.AccessPanel-module_accessPanel__RXDzY select{font:inherit}.AccessPanel-module_accessPanel__RXDzY button{background:#0000;border:0}.AccessPanel-module_accessPanel__RXDzY p{margin:0}.AccessPanel-module_accessPanel__RXDzY .flex{display:flex}.AccessPanel-module_accessPanel__RXDzY .inline-flex{display:inline-flex}.AccessPanel-module_accessPanel__RXDzY .flex-col{flex-direction:column}.AccessPanel-module_accessPanel__RXDzY .flex-wrap{flex-wrap:wrap}.AccessPanel-module_accessPanel__RXDzY .flex-1{flex:1 1 0%}.AccessPanel-module_accessPanel__RXDzY .shrink-0{flex-shrink:0}.AccessPanel-module_accessPanel__RXDzY .items-center{align-items:center}.AccessPanel-module_accessPanel__RXDzY .items-start{align-items:flex-start}.AccessPanel-module_accessPanel__RXDzY .justify-center{justify-content:center}.AccessPanel-module_accessPanel__RXDzY .justify-between{justify-content:space-between}.AccessPanel-module_accessPanel__RXDzY .justify-end{justify-content:flex-end}.AccessPanel-module_accessPanel__RXDzY .gap-0\\\\.5{gap:2px}.AccessPanel-module_accessPanel__RXDzY .gap-1{gap:4px}.AccessPanel-module_accessPanel__RXDzY .gap-1\\\\.5{gap:6px}.AccessPanel-module_accessPanel__RXDzY .gap-2{gap:8px}.AccessPanel-module_accessPanel__RXDzY .gap-3{gap:12px}.AccessPanel-module_accessPanel__RXDzY .gap-4{gap:16px}.AccessPanel-module_accessPanel__RXDzY .space-y-4>:not([hidden])~:not([hidden]){margin-top:16px}.AccessPanel-module_accessPanel__RXDzY .relative{position:relative}.AccessPanel-module_accessPanel__RXDzY .absolute{position:absolute}.AccessPanel-module_accessPanel__RXDzY .left-3{left:12px}.AccessPanel-module_accessPanel__RXDzY .right-2\\\\.5{right:10px}.AccessPanel-module_accessPanel__RXDzY .pointer-events-none{pointer-events:none}.AccessPanel-module_accessPanel__RXDzY .z-50{z-index:50}.AccessPanel-module_accessPanel__RXDzY .w-full{width:100%}.AccessPanel-module_accessPanel__RXDzY .w-8{width:32px}.AccessPanel-module_accessPanel__RXDzY .w-14{width:56px}.AccessPanel-module_accessPanel__RXDzY .w-16{width:64px}.AccessPanel-module_accessPanel__RXDzY .w-24{width:96px}.AccessPanel-module_accessPanel__RXDzY .w-28{width:112px}.AccessPanel-module_accessPanel__RXDzY .h-3{height:12px}.AccessPanel-module_accessPanel__RXDzY .w-3{width:12px}.AccessPanel-module_accessPanel__RXDzY .h-3\\\\.5{height:14px}.AccessPanel-module_accessPanel__RXDzY .w-3\\\\.5{width:14px}.AccessPanel-module_accessPanel__RXDzY .h-4{height:16px}.AccessPanel-module_accessPanel__RXDzY .w-4{width:16px}.AccessPanel-module_accessPanel__RXDzY .h-6{height:24px}.AccessPanel-module_accessPanel__RXDzY .w-6{width:24px}.AccessPanel-module_accessPanel__RXDzY .h-7{height:28px}.AccessPanel-module_accessPanel__RXDzY .h-8{height:32px}.AccessPanel-module_accessPanel__RXDzY .h-9{height:36px}.AccessPanel-module_accessPanel__RXDzY .min-w-32{min-width:128px}.AccessPanel-module_accessPanel__RXDzY .min-w-40{min-width:160px}.AccessPanel-module_accessPanel__RXDzY .max-w-xs{max-width:320px}.AccessPanel-module_accessPanel__RXDzY .rounded{border-radius:4px}.AccessPanel-module_accessPanel__RXDzY .rounded-full{border-radius:9999px}.AccessPanel-module_accessPanel__RXDzY .rounded-appsec{border-radius:8px}.AccessPanel-module_accessPanel__RXDzY .border{border:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-border{border-color:var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .border-appsec-primary{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .divide-y>:not([hidden])~:not([hidden]){border-top:1px solid var(--appsec-border)}.AccessPanel-module_accessPanel__RXDzY .overflow-hidden{overflow:hidden}.AccessPanel-module_accessPanel__RXDzY .overflow-y-auto{overflow-y:auto}.AccessPanel-module_accessPanel__RXDzY .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AccessPanel-module_accessPanel__RXDzY .appearance-none{appearance:none}.AccessPanel-module_accessPanel__RXDzY .outline-none{outline:0}.AccessPanel-module_accessPanel__RXDzY .cursor-pointer{cursor:pointer}.AccessPanel-module_accessPanel__RXDzY .cursor-not-allowed{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY .select-none{user-select:none}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-bg{background-color:var(--appsec-bg)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface{background-color:var(--appsec-surface)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-surface-alt{background-color:var(--appsec-surface-alt)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary{background-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-primary-light{background-color:var(--appsec-primary-light)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger{background-color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .bg-appsec-danger-light{background-color:var(--appsec-danger-light)}.AccessPanel-module_accessPanel__RXDzY .bg-transparent{background-color:initial}.AccessPanel-module_accessPanel__RXDzY .bg-blue-500{background-color:#3b82f6}.AccessPanel-module_accessPanel__RXDzY .bg-purple-500{background-color:#a855f7}.AccessPanel-module_accessPanel__RXDzY .bg-green-600{background-color:#16a34a}.AccessPanel-module_accessPanel__RXDzY .bg-orange-500{background-color:#f97316}.AccessPanel-module_accessPanel__RXDzY .bg-pink-500{background-color:#ec4899}.AccessPanel-module_accessPanel__RXDzY .bg-teal-500{background-color:#14b8a6}.AccessPanel-module_accessPanel__RXDzY .bg-indigo-500{background-color:#6366f1}.AccessPanel-module_accessPanel__RXDzY .bg-rose-500{background-color:#f43f5e}.AccessPanel-module_accessPanel__RXDzY .text-white{color:#fff}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text{color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-secondary{color:var(--appsec-text-secondary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-text-tertiary{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-primary{color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .text-appsec-danger{color:var(--appsec-danger)}.AccessPanel-module_accessPanel__RXDzY .text-gray-500{color:#667085}.AccessPanel-module_accessPanel__RXDzY .text-xs{font-size:12px;line-height:18px}.AccessPanel-module_accessPanel__RXDzY .text-sm{font-size:14px;line-height:20px}.AccessPanel-module_accessPanel__RXDzY .text-\\\\[\\31 0px\\\\]{font-size:10px;line-height:14px}.AccessPanel-module_accessPanel__RXDzY .text-\\\\[\\31 1px\\\\]{font-size:11px;line-height:16px}.AccessPanel-module_accessPanel__RXDzY .font-medium{font-weight:500}.AccessPanel-module_accessPanel__RXDzY .font-semibold{font-weight:600}.AccessPanel-module_accessPanel__RXDzY .capitalize{text-transform:capitalize}.AccessPanel-module_accessPanel__RXDzY .text-center{text-align:center}.AccessPanel-module_accessPanel__RXDzY .text-left{text-align:left}.AccessPanel-module_accessPanel__RXDzY .px-1{padding-left:4px;padding-right:4px}.AccessPanel-module_accessPanel__RXDzY .px-2{padding-left:8px;padding-right:8px}.AccessPanel-module_accessPanel__RXDzY .px-2\\\\.5{padding-left:10px;padding-right:10px}.AccessPanel-module_accessPanel__RXDzY .px-3{padding-left:12px;padding-right:12px}.AccessPanel-module_accessPanel__RXDzY .px-4{padding-left:16px;padding-right:16px}.AccessPanel-module_accessPanel__RXDzY .py-0\\\\.5{padding-bottom:2px;padding-top:2px}.AccessPanel-module_accessPanel__RXDzY .py-1{padding-bottom:4px;padding-top:4px}.AccessPanel-module_accessPanel__RXDzY .py-2{padding-bottom:8px;padding-top:8px}.AccessPanel-module_accessPanel__RXDzY .py-2\\\\.5{padding-bottom:10px;padding-top:10px}.AccessPanel-module_accessPanel__RXDzY .py-4{padding-bottom:16px;padding-top:16px}.AccessPanel-module_accessPanel__RXDzY .py-8{padding-bottom:32px;padding-top:32px}.AccessPanel-module_accessPanel__RXDzY .p-0\\\\.5{padding:2px}.AccessPanel-module_accessPanel__RXDzY .p-1{padding:4px}.AccessPanel-module_accessPanel__RXDzY .p-2{padding:8px}.AccessPanel-module_accessPanel__RXDzY .pl-9{padding-left:36px}.AccessPanel-module_accessPanel__RXDzY .pr-6{padding-right:24px}.AccessPanel-module_accessPanel__RXDzY .pr-8{padding-right:32px}.AccessPanel-module_accessPanel__RXDzY .ml-auto{margin-left:auto}.AccessPanel-module_accessPanel__RXDzY .shadow-sm{box-shadow:0 1px 2px #1018280f}.AccessPanel-module_accessPanel__RXDzY .transition-all,.AccessPanel-module_accessPanel__RXDzY .transition-colors{transition:all .15s ease}.AccessPanel-module_accessPanel__RXDzY .opacity-30{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .opacity-50{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:opacity-30:disabled{opacity:.3}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:opacity-50:disabled{opacity:.5}.AccessPanel-module_accessPanel__RXDzY .disabled\\\\:cursor-not-allowed:disabled{cursor:not-allowed}.AccessPanel-module_accessPanel__RXDzY input[type=search],.AccessPanel-module_accessPanel__RXDzY select{background-color:var(--appsec-bg);border:1px solid var(--appsec-border);border-radius:8px;color:var(--appsec-text)}.AccessPanel-module_accessPanel__RXDzY input[type=search]::placeholder{color:var(--appsec-text-tertiary)}.AccessPanel-module_accessPanel__RXDzY input[type=checkbox]{accent-color:var(--appsec-primary);height:16px;width:16px}.AccessPanel-module_accessPanel__RXDzY button:hover:not(:disabled){opacity:.92}.AccessPanel-module_accessPanel__RXDzY .focus\\\\:border-appsec-primary:focus{border-color:var(--appsec-primary)}.AccessPanel-module_accessPanel__RXDzY .focus\\\\:ring-2:focus{box-shadow:0 0 0 3px var(--appsec-primary-light)}");export{c as default};
|
|
2
|
-
//# sourceMappingURL=AccessPanel.module.css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPanel.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"react";var t="data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";export{t as default};
|
|
2
|
-
//# sourceMappingURL=Search-result(add new).svg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Search-result(add new).svg.js","sources":["../../../../src/features/LearningManagement/assets/Search-result(add new).svg"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%22160%22%20height%3D%22153%22%20viewBox%3D%220%200%20160%20153%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M79.2744%20143.735C116.627%20143.735%20146.909%20113.508%20146.909%2076.223C146.909%2038.9359%20116.627%208.71106%2079.2744%208.71106C41.9192%208.71106%2011.6367%2038.9359%2011.6367%2076.223C11.6367%20113.508%2041.9192%20143.735%2079.2744%20143.735Z%22%20fill%3D%22%23F8FAFC%22%2F%3E%3Cpath%20d%3D%22M116.902%2030.8984H43.3269C38.7417%2030.8984%2035.0234%2034.7993%2035.0234%2039.6097H125.205C125.205%2034.7993%20121.489%2030.8984%20116.902%2030.8984Z%22%20fill%3D%22%23D0D9E4%22%2F%3E%3Cpath%20d%3D%22M35.0234%2039.6094H125.205V109.239C125.205%20112.335%20123.994%20115.304%20121.834%20117.494C119.674%20119.684%20116.745%20120.914%20113.692%20120.914H46.5394C43.4834%20120.914%2040.555%20119.684%2038.3973%20117.494C36.2372%20115.304%2035.0234%20112.335%2035.0234%20109.239V39.6094Z%22%20fill%3D%22%23F1F5F9%22%2F%3E%3Cpath%20d%3D%22M125.155%2039.6592V109.239C125.155%20112.322%20123.949%20115.279%20121.798%20117.459C119.647%20119.639%20116.731%20120.864%20113.691%20120.864H46.5391C43.4967%20120.864%2040.5809%20119.639%2038.4326%20117.459C36.2818%20115.279%2035.0732%20112.322%2035.0732%20109.239V39.6592H125.155Z%22%20stroke%3D%22%2364748B%22%20stroke-opacity%3D%220.1%22%20stroke-width%3D%220.1%22%2F%3E%3Cpath%20d%3D%22M70.571%2048.3203H48.9307C48.4799%2048.3203%2048.1133%2049.295%2048.1133%2050.4981C48.1133%2051.7012%2048.4799%2052.6759%2048.9307%2052.6759H70.571C71.0218%2052.6759%2071.386%2051.7012%2071.386%2050.4981C71.386%2049.295%2071.0218%2048.3203%2070.571%2048.3203Z%22%20fill%3D%22url%28%23paint0_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2067.1953H48.9307C48.4799%2067.1953%2048.1133%2068.17%2048.1133%2069.3731C48.1133%2070.5762%2048.4799%2071.5509%2048.9307%2071.5509H70.571C71.0218%2071.5509%2071.386%2070.5762%2071.386%2069.3731C71.386%2068.17%2071.0218%2067.1953%2070.571%2067.1953Z%22%20fill%3D%22url%28%23paint1_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%2086.0703H48.9307C48.4799%2086.0703%2048.1133%2087.0468%2048.1133%2088.2493C48.1133%2089.4517%2048.4799%2090.4259%2048.9307%2090.4259H70.571C71.0218%2090.4259%2071.386%2089.4517%2071.386%2088.2493C71.386%2087.0468%2071.0218%2086.0703%2070.571%2086.0703Z%22%20fill%3D%22url%28%23paint2_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M70.571%20104.945H48.9307C48.4799%20104.945%2048.1133%20105.922%2048.1133%20107.124C48.1133%20108.327%2048.4799%20109.301%2048.9307%20109.301H70.571C71.0218%20109.301%2071.386%20108.327%2071.386%20107.124C71.386%20105.922%2071.0218%20104.945%2070.571%20104.945Z%22%20fill%3D%22url%28%23paint3_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2048.3203H78.6367C77.8481%2048.3203%2077.207%2049.295%2077.207%2050.4981C77.207%2051.7012%2077.8481%2052.6759%2078.6367%2052.6759H116.507C117.296%2052.6759%20117.934%2051.7012%20117.934%2050.4981C117.934%2049.295%20117.296%2048.3203%20116.507%2048.3203Z%22%20fill%3D%22url%28%23paint4_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2086.0703H78.6367C77.8481%2086.0703%2077.207%2087.045%2077.207%2088.2481C77.207%2089.4512%2077.8481%2090.4259%2078.6367%2090.4259H116.507C117.296%2090.4259%20117.934%2089.4512%20117.934%2088.2481C117.934%2087.045%20117.296%2086.0703%20116.507%2086.0703Z%22%20fill%3D%22url%28%23paint5_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%2067.1953H78.6367C77.8481%2067.1953%2077.207%2068.17%2077.207%2069.3731C77.207%2070.5762%2077.8481%2071.5509%2078.6367%2071.5509H116.507C117.296%2071.5509%20117.934%2070.5762%20117.934%2069.3731C117.934%2068.17%20117.296%2067.1953%20116.507%2067.1953Z%22%20fill%3D%22url%28%23paint6_linear_1020_82405%29%22%2F%3E%3Cpath%20d%3D%22M116.507%20104.945H78.6367C77.8481%20104.945%2077.207%20105.92%2077.207%20107.123C77.207%20108.326%2077.8481%20109.301%2078.6367%20109.301H116.507C117.296%20109.301%20117.934%20108.326%20117.934%20107.123C117.934%20105.92%20117.296%20104.945%20116.507%20104.945Z%22%20fill%3D%22url%28%23paint7_linear_1020_82405%29%22%2F%3E%3CforeignObject%20x%3D%2270.7116%22%20y%3D%2260.6843%22%20width%3D%2279.8961%22%20height%3D%2279.81%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22backdrop-filter%3Ablur%288.34px%29%3Bclip-path%3Aurl%28%23bgblur_0_1020_82405_clip_path%29%3Bheight%3A100%25%3Bwidth%3A100%25%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Cpath%20data-figma-bg-blur-radius%3D%2216.6751%22%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M110.659%2085.3419C111.63%2085.3458%20112.413%2086.1299%20112.411%2087.0961L112.395%2098.2651L123.584%2098.2817C124.555%2098.2856%20125.338%2099.0696%20125.339%20100.038C125.335%20101.007%20124.55%20101.789%20123.579%20101.79L112.39%20101.773L112.373%20112.942C112.372%20113.908%20111.586%20114.69%20110.615%20114.691C109.645%20114.687%20108.862%20113.903%20108.861%20112.935L108.877%20101.766L97.6878%20101.749C96.7198%20101.748%2095.9366%20100.964%2095.9355%2099.9948C95.9395%2099.0261%2096.725%2098.2443%2097.693%2098.2458L108.883%2098.2623L108.899%2087.0934C108.903%2086.1247%20109.689%2085.3429%20110.659%2085.3419Z%22%20fill%3D%22%23CBD5E1%22%2F%3E%3Cdefs%3E%3CclipPath%20id%3D%22bgblur_0_1020_82405_clip_path%22%20transform%3D%22translate%28-70.7116%20-60.6843%29%22%3E%3Cpath%20d%3D%22M110.659%20123.819C123.513%20123.819%20133.932%20113.419%20133.932%20100.589C133.932%2087.7597%20123.513%2077.3594%20110.659%2077.3594C97.8062%2077.3594%2087.3867%2087.7597%2087.3867%20100.589C87.3867%20113.419%2097.8062%20123.819%20110.659%20123.819Z%22%2F%3E%3C%2FclipPath%3E%3ClinearGradient%20id%3D%22paint0_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2252.497%22%20x2%3D%2272.7628%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2271.372%22%20x2%3D%2272.7628%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%2290.247%22%20x2%3D%2272.7628%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_1020_82405%22%20x1%3D%2247.1291%22%20y1%3D%22109.122%22%20x2%3D%2272.7628%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2252.497%22%20x2%3D%22120.344%22%20y2%3D%2252.497%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2290.247%22%20x2%3D%22120.344%22%20y2%3D%2290.247%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%2271.372%22%20x2%3D%22120.344%22%20y2%3D%2271.372%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint7_linear_1020_82405%22%20x1%3D%2275.4847%22%20y1%3D%22109.122%22%20x2%3D%22120.344%22%20y2%3D%22109.122%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23CBD5E1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F8F9FB%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\""],"names":["EmptyResultIconSVG"],"mappings":"cA0KA,IAAAA,EAAe"}
|
package/dist/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as r,__generator as n,__spreadArray as t}from"tslib";import{jsxs as o,jsx as i,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as s,useMemo as u,useEffect as c}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 v,Search as b,ArrowRight as x}from"lucide-react";import{Toast as S}from"primereact/toast";import{v4 as y}from"uuid";import w from"../../assets/Search-result(add new).svg.js";import C from"../../store/useAuthStore.js";import{IL_CONFIG_CONSTANTS as _}from"../../config.js";import{retrieveGenreScopes as O,fetchStationsByKeyword as F,searchScopes as T,inheritScope as A,deleteRuleSet as N,updateStation as M,createRuleSet as E}from"../../apis/scopeApis.js";import k from"./InputField.js";import D from"./StationAutocomplete.js";import z from"../CardSkeleton.js";import P from"./OnboardingLoader.js";import B from"./TemplateCard.js";var j=[{label:"5am to 7pm",value:"05:00 AM - 7:00 PM"},{label:"6am to 7pm",value:"06:00 AM - 7:00 PM"}],I=[{label:"Low Sellout",value:"Low Sellout"},{label:"High Sellout",value:"High Sellout"},{label:"None",value:""}],L=[{label:"None",value:"None"},{label:"Distribute spots evenly across all breaks in the hour",value:"Distribute spots evenly across all breaks in the hour"}],R=function(R){var W,U=R.isOpen,q=R.onClose,G=R.onBoardStation,Y=R.app_integration_id,H=R.token,K=R.stationNameParam,X=a(null),J=X[0],Q=X[1],V=a([]),Z=V[0],$=V[1],ee=a(0),re=ee[0],ne=ee[1],te=a(!0),oe=te[0],ie=te[1],le=a(!1),ae=le[0],se=le[1],ue=a([]),ce=ue[0],de=ue[1],pe=a(""),fe=pe[0],me=pe[1],he=a(""),ge=he[0],ve=he[1],be=a(!1),xe=be[0],Se=be[1],ye=a(!1),we=ye[0],Ce=ye[1],_e=a(null),Oe=_e[0],Fe=_e[1],Te=a(!1),Ae=Te[0],Ne=Te[1],Me=a(0),Ee=Me[0],ke=Me[1],De=a(""),ze=De[0],Pe=De[1],Be=C().user,je=s(null),Ie=s(null),Le=s(null),Re=s(null),We=a({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),Ue=We[0],qe=We[1],Ge=function(e,r){return e.find(function(e){return e.value===r})||null},Ye=u(function(){return Z.map(function(e){return{label:e.scope_name,value:e.scope_name}})},[Z]),He=u(function(){var e,r,n;if(!Ue.genre)return null;var t=Z.find(function(e){return e.scope_name===Ue.genre});return t?{id:t.id,title:t.scope_name||"Unnamed Template",description:(null===(e=t.description)||void 0===e?void 0:e.trim())||"No description available.",inheritedText:(null===(r=t.inheritance)||void 0===r?void 0:r[0])||void 0,rulesCount:t.rules_count||0,tiersCount:t.tier_count||0,isCopy:null!==(n=t.is_copy)&&void 0!==n&&n}:null},[Ue.genre,Z]);c(function(){return function(){Le.current&&clearTimeout(Le.current)}},[]);var Ke=function(e){return r(void 0,void 0,void 0,function(){var r,o,i;return n(this,function(n){switch(n.label){case 0:if(ae)return[2];se(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,O({limit:"20",offset:String(e)})];case 2:return"success"===(null==(r=n.sent())?void 0:r.status)&&Array.isArray(null==r?void 0:r.data)?(o=r.data,$(function(r){if(0===e)return o;var n=new Set(r.map(function(e){return e.id})),i=o.filter(function(e){return!n.has(e.id)});return t(t([],r,!0),i,!0)}),o.length<20?ie(!1):ie(!0),ne(e+20)):ie(!1),[3,5];case 3:return i=n.sent(),console.error("[StationOnboard] Failed to fetch genre scopes:",i),ie(!1),[3,5];case 4:return se(!1),[7];case 5:return[2]}})})};c(function(){if(U&&($([]),ne(0),ie(!0),Ke(0),K)){Pe(K);r(void 0,void 0,void 0,function(){var e,r,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,F(K,!0)];case 1:return!0===(null==(e=n.sent())?void 0:e.success)&&Array.isArray(null==e?void 0:e.data)&&(r=e.data.find(function(e){var r;return(null===(r=e.station_name)||void 0===r?void 0:r.toLowerCase())===K.toLowerCase()&&!e.ruleset_id}),r&&Q(r)),[3,3];case 2:return t=n.sent(),console.error("[StationOnboard] Error auto-selecting station:",t),[3,3];case 3:return[2]}})})}},[U,K]);c(function(){qe(J?function(r){var n;return e(e({},r),{region:null!==(n=J.market)&&void 0!==n?n:""})}:{region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""})},[J]),c(function(){var e=setTimeout(function(){ve(fe)},500);return function(){return clearTimeout(e)}},[fe]),c(function(){r(void 0,void 0,void 0,function(){var e,r,t;return n(this,function(n){switch(n.label){case 0:if(!ge.trim())return de([]),[2];Se(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,T({search_string:ge})];case 2:return"success"===(null==(e=n.sent())?void 0:e.status)&&Array.isArray(null==e?void 0:e.data)?(r=e.data.map(function(e){var r,n,t;return{id:e.id,title:e.scope_name||"Unnamed Template",description:(null===(r=e.description)||void 0===r?void 0:r.trim())||"No description available.",inheritedText:(null===(n=e.inheritance)||void 0===n?void 0:n[0])||void 0,rulesCount:e.rules_count||0,tiersCount:e.tier_count||0,isCopy:null!==(t=e.is_copy)&&void 0!==t&&t}}),de(r)):de([]),[3,5];case 3:return t=n.sent(),console.error("[StationOnboard] Error searching scopes:",t),de([]),[3,5];case 4:return Se(!1),[7];case 5:return[2]}})})},[ge]),c(function(){!ge.trim()&&He&&Fe(He.id)},[ge,He]);var Xe=function(){setTimeout(function(){Re.current&&Re.current.scrollTo({top:Re.current.scrollHeight,behavior:"smooth"})},100)},Je=function(){Pe(""),Q(null),qe({region:"",primeTime:["06:00 AM - 7:00 PM"],genre:"Music",type:"",lowSelloutConfig:""}),de([]),me(""),Fe(null),q()},Qe=function(r,n){var t;if("primeTime"!==r){var o=null!==(t=null==n?void 0:n.value)&&void 0!==t?t:"";qe(function(n){var t;return e(e({},n),((t={})[r]=String(o),t))}),"genre"===r&&(Ce(!0),Le.current&&clearTimeout(Le.current),Le.current=setTimeout(function(){var e=Z.find(function(e){return e.scope_name===o});Fe(e?e.id:null),Ce(!1)},800))}else{var i=(null==n?void 0:n.value)?String(n.value):"";qe(function(r){return e(e({},r),{primeTime:i?[i]:[]})})}},Ve=Boolean(J&&Ue.region&&Ue.primeTime.length>0&&Ue.genre);return o(d,e({open:U,onClose:Je,maxWidth:!1,disableEscapeKeyDown:!0,PaperProps:{sx:{width:"90vw",height:"90vh",borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden"}}},{children:[i(S,{ref:je}),o(p,e({sx:{p:"20px 20px 20px 27px",borderBottom:"1px solid #F0F2F5",display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"#fff"}},{children:[o(p,e({sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[i(f,e({sx:{fontSize:"18px",fontWeight:600,color:"#19213D"}},{children:"Onboard a Station"})),i(f,e({sx:{fontSize:"16px",fontWeight:400,color:"#666F8D"}},{children:"Onboard a station to start configuring learnings."}))]})),i(m,e({onClick:Je,disabled:Ae,sx:{color:"#19213D"}},{children:i(v,{size:24})}))]})),o(h,e({sx:{p:0,bgcolor:"#F8FAFC",display:"flex",flexDirection:"row",overflow:"hidden",position:"relative"}},{children:[i(P,{isLoading:Ae,currentStep:Ee,onComplete:function(){Ne(!1);var e=Ie.current;Je(),G(e||void 0),Ie.current=null}}),o(p,e({sx:{display:"flex",flex:1,paddingY:"14px",paddingX:"20px",gap:3,overflowY:"hidden"}},{children:[o(p,e({ref:Re,sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"16px",border:"1px solid #F0F2F5",height:"100%",overflowY:"auto"}},{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:600,mb:.5,color:"#19213D"}},{children:"Basic Details"})),i(f,e({sx:{fontSize:"0.75rem",color:"#00000080",mb:"20px"}},{children:"Set up basic station details to unlock AI recommended scopes."})),o(p,e({sx:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[o(p,e({className:"space-y-1.5"},{children:[o("label",e({className:"text-sm font-medium text-[#19213D]"},{children:[i("span",e({className:"mr-0.5 text-xs font-semibold text-[#8F2C23]"},{children:"*"})),"Station Name/Call Letters"]})),i(D,{value:ze,onChange:Pe,onStationSelect:function(e){return Q(e)}})]})),i(k,{required:!0,disabled:!0,label:"Region",placeholder:"Select Region",value:Ue.region||void 0,isSearchable:!1}),i(k,{required:!0,label:"Prime Time Window",placeholder:"Select Prime Time",options:j,value:Ge(j,(null===(W=Ue.primeTime)||void 0===W?void 0:W[0])||""),onOptionChange:function(e){return Qe("primeTime",e)},isSearchable:!1}),i(p,e({onClick:Xe,sx:{width:"100%"}},{children:i(k,{required:!0,label:"Genre",placeholder:"Select Genre",options:Ye,value:Ge(Ye,Ue.genre),onOptionChange:function(e){return Qe("genre",e)},isSearchable:!1,onMenuScrollToBottom:function(){!ae&&oe&&Ke(re)},isLoadingOptions:ae,hasMoreOptions:oe})})),i(p,e({onClick:Xe,sx:{width:"100%"}},{children:i(k,{label:"Station Type",placeholder:"None",options:I,value:Ge(I,Ue.type),onOptionChange:function(r){Qe("type",r),"Low Sellout"!==(null==r?void 0:r.value)&&qe(function(r){return e(e({},r),{lowSelloutConfig:""})})},isSearchable:!1})})),"Low Sellout"===Ue.type&&i(p,e({onClick:Xe,sx:{width:"100%"}},{children:i(k,{label:"Low Sell Out Configurations",placeholder:"Select Configuration",options:L,value:Ge(L,Ue.lowSelloutConfig),onOptionChange:function(e){return Qe("lowSelloutConfig",e)},isSearchable:!1})}))]}))]})),i(p,e({sx:{flex:1,bgcolor:"#fff",p:3,borderRadius:"12px",border:"1px solid #F0F2F5",display:"flex",flexDirection:"column",height:"100%",overflowY:"auto"}},{children:Ue.genre?o(l,{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Matching scope for your station"})),i(p,e({sx:{display:"flex",flexDirection:"column",gap:2,mb:4}},{children:we?i(z,{}):He?i(B,e({},He,{isSelected:Oe===He.id,onSelect:Fe}),He.id):null})),i(f,e({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Other available stations"})),o("div",e({className:"relative mb-4 w-full"},{children:[i("input",{type:"text",value:fe,onChange:function(e){return me(e.target.value)},placeholder:"Search for station...",className:"w-full rounded-lg border border-[#E2E8F0] px-10 py-[7px] text-[12px] outline-none transition-all placeholder:text-[#BAC0CC] focus:border-blue-500 focus:ring-1 focus:ring-blue-500"}),i(b,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:16})]})),o(p,e({sx:{display:"flex",flexDirection:"column",gap:2}},{children:[xe&&i(z,{}),!xe&&0===ce.length&&ge.trim()&&o(f,e({sx:{fontSize:"0.875rem",color:"#64748B",textAlign:"center",py:4}},{children:['No scopes found matching "',ge,'".']})),!xe&&ce.map(function(r){return i(B,e({},r,{isSelected:Oe===r.id,onSelect:Fe}),r.id)})]}))]}):o(l,{children:[i(f,e({sx:{fontSize:"1rem",fontWeight:500,mb:1.5}},{children:"Fill in the station details to load AI recommended scopes"})),i(f,e({sx:{fontSize:"0.75rem",color:"#64748B",mb:3}},{children:"AI will recommend the most relevant scope for this station."})),i(p,e({sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",opacity:.5,py:10}},{children:i("img",{src:w,alt:"Empty Result"})}))]})}))]}))]})),o(p,e({sx:{p:"12px 20px",borderTop:"1px solid #F0F2F5",display:"flex",justifyContent:"flex-end",gap:2,bgcolor:"#fff"}},{children:[i("button",e({onClick:Je,disabled:Ae,style:{padding:"7px 10px",borderRadius:"6px",color:"#64748B",border:"1px solid #E2E8F0",backgroundColor:"#fff",cursor:"pointer",fontSize:"14px",fontWeight:500}},{children:"Cancel"})),i("button",e({onClick:function(){return r(void 0,void 0,void 0,function(){var r,o,i,l,a,s,u,c,d,p,f,m,h,g,v,b,x,S;return n(this,function(n){switch(n.label){case 0:if(!J||!Oe)return console.error("[StationOnboard] Missing required data for onboarding"),[2];r=He?t([He],ce,!0):ce,o=r.find(function(e){return e.id===Oe}),i=null!==(h=null==o?void 0:o.isCopy)&&void 0!==h&&h,Ne(!0),ke(0),l=null,n.label=1;case 1:return n.trys.push([1,3,,4]),a={topic:"customRuleSet",customScopeGroupName:(null==_?void 0:_.CUSTOM_SCOPE_GROUP_NAME)||"Audacy-Traffic-Manager",scopeDescription:J.station_name||"New Station",parentScopeId:null,customScopeName:J.station_name||"New Station",customScopeId:y(),createByName:(null==Be?void 0:Be.firstname)||"System",createdBy:(null==Be?void 0:Be.email)||"system@audacy.com",applicationMappingId:Y},console.log("[StationOnboard] Step 1: Creating rule set with payload:",a),[4,E(a,H)];case 2:if(s=n.sent(),!(l=null===(g=null==s?void 0:s.data)||void 0===g?void 0:g.scopeId))throw new Error("Failed to create scope - no scopeId returned");return ke(1),[3,4];case 3:return u=n.sent(),console.error("[StationOnboard] Error creating rule set:",u),null===(v=je.current)||void 0===v||v.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to create rule set. Please try again."}),Ne(!1),ke(0),[2];case 4:return n.trys.push([4,6,,11]),c={market:J.market,region:J.region,primetime_windows:Ue.primeTime,genre:Ue.genre,station_type:""===Ue.type?null:Ue.type,low_sellout_configurations:"Low Sellout"===Ue.type?Ue.lowSelloutConfig:null,ruleset_id:l,station_guid:J.station_guid,station_name:J.station_name||"New Station"},console.log("[StationOnboard] Step 2: Updating station with payload:",c),[4,M(c)];case 5:return n.sent(),ke(2),[3,11];case 6:d=n.sent(),console.error("[StationOnboard] Error updating station, rolling back rule set:",d),409===d.status?(null===(b=je.current)||void 0===b||b.show({severity:"error",life:2500,summary:"Error updating station",detail:"Station already Onboarded."}),Q(null),Fe(null),Pe(""),qe(function(r){return e(e({},r),{region:""})})):null===(x=je.current)||void 0===x||x.show({severity:"error",life:2500,summary:"Error updating station",detail:"Please try again."}),n.label=7;case 7:return n.trys.push([7,9,,10]),[4,N(l,H)];case 8:return n.sent(),[3,10];case 9:return p=n.sent(),console.error("[StationOnboard] Failed to rollback rule set deletion:",p),[3,10];case 10:return Ne(!1),ke(0),[2];case 11:return n.trys.push([11,13,,14]),f={source_scope_id:Oe,target_scope_id:l,is_copy_parent_variant_id:i},console.log("[StationOnboard] Step 3: Inheriting scope with payload:",f),[4,A(f)];case 12:return n.sent(),ke(3),[3,14];case 13:return m=n.sent(),console.error("[StationOnboard] Error inheriting scope (no rollback):",m),null===(S=je.current)||void 0===S||S.show({severity:"error",life:3e3,summary:"Error",detail:"Failed to apply rule template. Please try again."}),Ne(!1),ke(0),[2];case 14:return Ie.current=l,[2]}})})},disabled:!Ve||Ae,style:{padding:"7px 10px",borderRadius:"6px",border:"none",backgroundColor:Ve?"#2563EB":"#BFDBFE",color:"#fff",cursor:Ve&&!Ae?"pointer":"not-allowed",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"7px"}},{children:o(l,Ae?{children:[i(g,{size:16,color:"inherit"}),i("span",{children:"Onboarding..."})]}:{children:[i("span",{children:"Onboard Station"}),i(x,{size:16})]})}))]}))]}))};export{R as default};
|
|
2
|
-
//# sourceMappingURL=BackwardStationOnboardModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackwardStationOnboardModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__awaiter as r,__generator as e}from"tslib";import{create as n}from"zustand";import{appsecApi as i}from"../apis/scopeApis.js";var s=n(function(n,s){return{accessData:[],isLoading:!1,error:null,fetchPermissions:function(s,o){return r(void 0,void 0,void 0,function(){var r,t,a;return e(this,function(e){switch(e.label){case 0:if(!s)return[2];n({isLoading:!0,error:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,i.get("/users/me",{params:{appId:s,resourceId:o}})];case 2:return r=e.sent(),n({accessData:(null===(a=r.data)||void 0===a?void 0:a.data)||[],isLoading:!1}),[3,4];case 3:return t=e.sent(),console.error("Failed to fetch permissions:",t),n({error:t.message||"Failed to fetch permissions",isLoading:!1}),[3,4];case 4:return[2]}})})},hasPermission:function(r,e){var n,i,o,t=s().accessData.find(function(r){return function(r,e){return!!e&&function(r){return r?"string"==typeof r?[r]:[r._id,r.id,r.resourceId,r.resource_id].filter(function(r){return"string"==typeof r&&r.length>0}):[]}(r).includes(e)}(r.resourceId,e)});return!t||null!==(o=null===(i=null===(n=t.role)||void 0===n?void 0:n.permissions)||void 0===i?void 0:i.some(function(e){return e.name===r}))&&void 0!==o&&o},reset:function(){return n({accessData:[],isLoading:!1,error:null})}}});export{s as usePermissionsStore};
|
|
2
|
-
//# sourceMappingURL=usePermissionsStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePermissionsStore.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type AccessPanelMode = 'users' | 'groups' | 'both';
|
|
3
|
-
interface AccessPanelProps {
|
|
4
|
-
ruleSetId?: string | null;
|
|
5
|
-
moduleId?: string | null;
|
|
6
|
-
mode?: AccessPanelMode;
|
|
7
|
-
}
|
|
8
|
-
declare const AccessPanel: React.FC<AccessPanelProps>;
|
|
9
|
-
export default AccessPanel;
|
|
10
|
-
//# sourceMappingURL=AccessPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/RBAC/AccessPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,KAAK,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnD,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAID,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoD3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/RBAC/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface StationOnboardModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
onBoardStation: (scopeId?: string) => void;
|
|
6
|
-
app_integration_id?: string;
|
|
7
|
-
token: string;
|
|
8
|
-
stationNameParam?: string;
|
|
9
|
-
}
|
|
10
|
-
declare const BackwardStationOnboardModal: React.FC<StationOnboardModalProps>;
|
|
11
|
-
export default BackwardStationOnboardModal;
|
|
12
|
-
//# sourceMappingURL=BackwardStationOnboardModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackwardStationOnboardModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/LearningManagement/components/StationOnboarding/BackwardStationOnboardModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AA+DpE,UAAU,wBAAwB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,QAAA,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAitBnE,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
interface Permission {
|
|
2
|
-
_id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
}
|
|
5
|
-
interface Role {
|
|
6
|
-
_id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
appId: string;
|
|
9
|
-
permissions: Permission[];
|
|
10
|
-
}
|
|
11
|
-
interface AccessData {
|
|
12
|
-
_id: string;
|
|
13
|
-
resourceId: any;
|
|
14
|
-
resourceType: any;
|
|
15
|
-
application: string;
|
|
16
|
-
user_email: string;
|
|
17
|
-
role: Role;
|
|
18
|
-
grantedBy: string;
|
|
19
|
-
grantedAt: string;
|
|
20
|
-
isInherited: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface PermissionsState {
|
|
23
|
-
accessData: AccessData[];
|
|
24
|
-
isLoading: boolean;
|
|
25
|
-
error: string | null;
|
|
26
|
-
fetchPermissions: (appId: string, resourceId?: string) => Promise<void>;
|
|
27
|
-
hasPermission: (permissionName: string, resourceId?: string) => boolean;
|
|
28
|
-
reset: () => void;
|
|
29
|
-
}
|
|
30
|
-
export declare const usePermissionsStore: import("zustand").UseBoundStore<import("zustand").StoreApi<PermissionsState>>;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=usePermissionsStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePermissionsStore.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/store/usePermissionsStore.ts"],"names":[],"mappings":"AAGA,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,IAAI;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,GAAG,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB;AAmBD,UAAU,gBAAgB;IACxB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,aAAa,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACxE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,+EAuC7B,CAAC"}
|