@e-llm-studio/instant-learning 0.1.1-alpha.64 → 0.1.1-alpha.65
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/IL-OTJ/ILOTJ.js +1 -1
- package/dist/cjs/features/IL-OTJ/ILOTJTest.js +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
- package/dist/cjs/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/ContentLogic.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleAccordion.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleAccordionHeader.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleAccordionShell.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/RuleHeader.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/TierCard.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/VariantCard.js +1 -1
- package/dist/cjs/features/LearningManagement/RuleContent/VariantList.js +1 -1
- package/dist/cjs/features/LearningManagement/Sidebar.js +1 -1
- package/dist/cjs/features/LearningManagement/SidebarWrapper.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/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/EmptyLearningState.js +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeAddAction.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
- package/dist/cjs/features/LearningManagement/components/ScopeTree/TreeSidebar.js +1 -1
- package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationAutocomplete.js +1 -1
- package/dist/cjs/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
- package/dist/cjs/features/LearningManagement/store/useEnvStore.js +1 -1
- package/dist/cjs/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
- package/dist/cjs/features/LearningManagement/styles/EmptyRuleState.module.css.js +1 -1
- package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
- package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- package/dist/features/IL-OTJ/ILOTJ.js +1 -1
- package/dist/features/IL-OTJ/ILOTJTest.js +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/features/LearningManagement/LearningManagement.js +1 -1
- package/dist/features/LearningManagement/LearningTemplateLayout.js +1 -1
- package/dist/features/LearningManagement/RuleContent/ContentLogic.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleAccordion.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleAccordionHeader.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleAccordionShell.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleContent.js +1 -1
- package/dist/features/LearningManagement/RuleContent/RuleHeader.js +1 -1
- package/dist/features/LearningManagement/RuleContent/TierCard.js +1 -1
- package/dist/features/LearningManagement/RuleContent/VariantCard.js +1 -1
- package/dist/features/LearningManagement/RuleContent/VariantList.js +1 -1
- package/dist/features/LearningManagement/Sidebar.js +1 -1
- package/dist/features/LearningManagement/SidebarWrapper.js +1 -1
- package/dist/features/LearningManagement/apis/apiConfig.js +1 -1
- package/dist/features/LearningManagement/apis/scopeApis.js +1 -1
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/features/LearningManagement/components/EmptyLearningState.js +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeAddAction.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeNode.js +1 -1
- package/dist/features/LearningManagement/components/ScopeTree/TreeSidebar.js +1 -1
- package/dist/features/LearningManagement/components/StationOnboarding/StationAutocomplete.js +1 -1
- package/dist/features/LearningManagement/hooks/useLearningTemplateQueryParams.js +1 -1
- package/dist/features/LearningManagement/store/useEnvStore.js +1 -1
- package/dist/features/LearningManagement/store/useLearningTemplateStore.js +1 -1
- package/dist/features/LearningManagement/styles/EmptyRuleState.module.css.js +1 -1
- package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -1
- package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ILOTJTest.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +7 -0
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts +1 -1
- package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts +6 -41
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +3 -1
- package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningManagementTest.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/ContentLogic.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordion.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordion.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordionHeader.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordionHeader.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordionShell.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleAccordionShell.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/RuleHeader.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/RuleHeader.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/TierCard.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/VariantCard.d.ts +4 -0
- package/dist/types/src/features/LearningManagement/RuleContent/VariantCard.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/RuleContent/VariantList.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/RuleContent/VariantList.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/Sidebar.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/Sidebar.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/SidebarWrapper.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/SidebarWrapper.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts +6 -0
- package/dist/types/src/features/LearningManagement/apis/apiConfig.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts +70 -0
- package/dist/types/src/features/LearningManagement/apis/scopeApis.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateLearningSetModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/EmptyLearningState.d.ts +10 -0
- package/dist/types/src/features/LearningManagement/components/EmptyLearningState.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeAddAction.d.ts +2 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeAddAction.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeMenu.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeNode.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeSidebar.d.ts +3 -0
- package/dist/types/src/features/LearningManagement/components/ScopeTree/TreeSidebar.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationAutocomplete.d.ts +1 -0
- package/dist/types/src/features/LearningManagement/components/StationOnboarding/StationAutocomplete.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts +6 -0
- package/dist/types/src/features/LearningManagement/hooks/useLearningTemplateQueryParams.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts +13 -0
- package/dist/types/src/features/LearningManagement/store/useEnvStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts +6 -2
- package/dist/types/src/features/LearningManagement/store/useLearningTemplateStore.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/types.d.ts +2 -1
- package/dist/types/src/features/LearningManagement/types.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),t=require("lucide-react"),d=require("../../styles/ScopeTree.module.css.js");exports.TreeAddAction=function(i){var r=i.label,a=i.onAdd,l=i.disabled,o=void 0!==l&&l,c=i.tooltip;return s.jsxs("button",e.__assign({className:"".concat(d.default.addAction," ").concat(o?d.default.disabled:""),onClick:o?void 0:a,disabled:o,title:c,style:o?{opacity:.5,cursor:"not-allowed"}:{}},{children:[s.jsx("span",e.__assign({className:d.default.addIcon},{children:s.jsx(t.Plus,{size:16,strokeWidth:2.5})})),r]}))};
|
|
2
2
|
//# sourceMappingURL=TreeAddAction.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),d=require("../../styles/ScopeTree.module.css.js"),o=require("./TreeNodeHeader.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("lucide-react"),d=require("../../styles/ScopeTree.module.css.js"),o=require("./TreeNodeHeader.js"),t=require("./TreeSectionItem.js"),r=require("./TreeAddAction.js"),l=function(a){var c,s,u=a.node,h=a.depth,p=void 0===h?0:h,v=a.nodePath,C=void 0===v?[]:v,m=a.expandedNodeIds,g=a.activeSelection,f=a.onToggleExpand,b=a.onSectionSelect,T=a.onNodeOptionsClick,x=a.onAddChild,y=a.onRenameChild,S=a.onDeleteChild,A=a.canDeleteScope,_=a.canEditScope,j=a.canCreateScope,N=a.searchQuery,P=a.sectionsConfig,k=void 0===P?[]:P,q=a.nodeTypesConfig,E=void 0===q?[]:q,D=e.__spreadArray(e.__spreadArray([],C,!0),[u.id],!1),I=m.has(u.id),L=!!g&&g.nodePath[g.nodePath.length-1]===u.id,O=!!g&&(g.nodePath.includes(u.id)&&!L),Q=function(e,n){if(!n)return!0;var i=n.toLowerCase();return!!e.name.toLowerCase().includes(i)||!!e.children&&e.children.some(function(e){return Q(e,n)})};if(!Q(u,N||""))return null;var R=p>=E.length-1?E[E.length-1]:E[p],Y=!!(null==R?void 0:R.addChildType),w=!A||A(u.id),H=!_||_(u.id),K=!j||j(u.id),V=u.children&&u.children.length>0,W=!w||V,M=w?V?"This scope cannot be deleted because other scopes inherit learnings from it.":void 0:"You do not have permission to delete this scope.",z=K?void 0:"You do not have permission to add a scope here.";return n.jsxs("div",e.__assign({className:d.default.nodeWrapper,style:{"--tree-depth":p}},{children:[n.jsx(o.TreeNodeHeader,{name:u.name,isExpanded:I,isSelected:L,isAncestor:O,childrenCount:null===(c=u.children)||void 0===c?void 0:c.length,onToggleExpand:function(e){e.stopPropagation(),f(u.id)},onClick:function(){b(D,"learnings")},searchQuery:N,menuOptions:e.__spreadArray(e.__spreadArray([],Y?[{label:R.addChildLabel||"Add Child",icon:i.Plus,onClick:function(){return null==x?void 0:x(u.id,R.addChildType,u.name)},disabled:!K,tooltip:z}]:[],!0),[{label:"Rename",icon:i.Pencil,onClick:function(){return null==y?void 0:y(u.id,u.name)},disabled:!H,tooltip:H?void 0:"You do not have permission to rename this scope."},{label:"Delete ".concat((null==R?void 0:R.label)||"Node"),icon:i.Trash2,onClick:function(){var e;return null==S?void 0:S(u.id,u.name,(null===(e=u.metrics)||void 0===e?void 0:e.learningsCount)||0)},disabled:W,tooltip:M,className:"text-red-500 hover:text-red-600 hover:bg-red-50"}],!1)}),I&&n.jsxs("div",e.__assign({className:d.default.childrenWrapper},{children:[k.filter(function(e){return!e.isVisible||e.isVisible(u,p)}).map(function(e){var i;return n.jsx(t.TreeSectionItem,{icon:e.icon,label:e.label,badgeCount:e.badgeKey?null===(i=u.metrics)||void 0===i?void 0:i[e.badgeKey]:void 0,isActive:L&&(null==g?void 0:g.sectionId)===e.id,onClick:function(){return b(D,e.id)}},"".concat(u.id,"-").concat(e.id))}),null===(s=u.children)||void 0===s?void 0:s.map(function(e){return n.jsx(l,{node:e,depth:p+1,nodePath:D,expandedNodeIds:m,activeSelection:g,onToggleExpand:f,onSectionSelect:b,onNodeOptionsClick:T,onAddChild:x,onRenameChild:y,onDeleteChild:S,canDeleteScope:A,canEditScope:_,canCreateScope:j,searchQuery:N,sectionsConfig:k,nodeTypesConfig:E},e.id)}),Y&&n.jsx(r.TreeAddAction,{label:R.addChildLabel||"Add Child",onAdd:function(){return null==x?void 0:x(u.id,R.addChildType,u.name)},disabled:!K,tooltip:z})]}))]}))};exports.TreeNode=l;
|
|
2
2
|
//# sourceMappingURL=TreeNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),o=require("../../styles/ScopeTree.module.css.js"),i=require("../../utils/treeUtils.js"),r=require("./TreeNode.js");exports.TreeSidebar=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),o=require("../../styles/ScopeTree.module.css.js"),i=require("../../utils/treeUtils.js"),r=require("./TreeNode.js");exports.TreeSidebar=function(c){var d=c.data,a=c.defaultExpandedIds,u=void 0===a?[]:a,s=c.onSectionSelect,l=c.onNodeOptionsClick,f=c.onAddChild,h=c.onRenameChild,S=c.onDeleteChild,C=c.canDeleteScope,p=c.canEditScope,v=c.canCreateScope,E=c.searchQuery,g=void 0===E?"":E,w=c.onSearchCountChange,x=c.sectionsConfig,y=c.nodeTypesConfig,j=c.selectedRuleSetId,m=c.activeSectionId,I=t.useState(new Set(d?e.__spreadArray([d.id],u,!0):u)),N=I[0],T=I[1],q=t.useState(null),_=q[0],D=q[1];t.useEffect(function(){d&&T(function(e){if(!e.has(d.id)){var n=new Set(e);return n.add(d.id),n}return e})},[null==d?void 0:d.id]),t.useEffect(function(){if(d&&j&&m){var e=i.findNodePathById(d,j);e&&(D({nodePath:e,sectionId:m}),T(function(n){var t=new Set(n);return e.forEach(function(e){return t.add(e)}),t}))}},[d,j,m]),t.useEffect(function(){if(g&&d){var e=new Set,n=function(t){var o=g.toLowerCase(),i=t.name.toLowerCase().includes(o),r=!1;t.children&&t.children.forEach(function(e){n(e)&&(r=!0)});var c=i||r;return c&&r&&e.add(t.id),c};n(d),T(e)}},[g,d]);var L=function(e,n){if(!n)return 0;var t=0,o=n.toLowerCase();return e.name.toLowerCase().includes(o)&&t++,e.children&&e.children.forEach(function(e){t+=L(e,n)}),t};t.useEffect(function(){w&&d&&w(L(d,g))},[g,d,w]);return d?n.jsx("div",e.__assign({className:o.default.treeContainer},{children:n.jsx(r.TreeNode,{node:d,expandedNodeIds:N,activeSelection:_,onToggleExpand:function(e){T(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},onSectionSelect:function(e,n){console.log("handleSectionSelect",e,n),D({nodePath:e,sectionId:n}),s&&s(e[e.length-1],n)},onNodeOptionsClick:function(e){l&&l(e)},onAddChild:function(e,n,t){f&&f(e,n,t)},onRenameChild:function(e,n){h&&h(e,n)},onDeleteChild:function(e,n,t){S&&S(e,n,t)},canDeleteScope:C,canEditScope:p,searchQuery:g,sectionsConfig:x,nodeTypesConfig:y,canCreateScope:v})})):null};
|
|
2
2
|
//# sourceMappingURL=TreeSidebar.js.map
|
package/dist/cjs/features/LearningManagement/components/StationOnboarding/StationAutocomplete.js
CHANGED
|
@@ -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"),a=require("lucide-react"),s=require("../../apis/scopeApis.js"),r=require("../../styles/StationAutocomplete.module.css.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),a=require("lucide-react"),s=require("../../apis/scopeApis.js"),r=require("../../styles/StationAutocomplete.module.css.js");exports.default=function(i){var u=i.value,c=i.onChange,l=i.onStationSelect,o=i.className,d=i.style,f=n.useState([]),m=f[0],_=f[1],h=n.useState(!1),p=h[0],v=h[1],g=n.useState(!1),j=g[0],x=g[1],N=n.useRef(null),b=n.useRef(null),y=n.useRef(!1);return n.useEffect(function(){var e=function(e){b.current&&!b.current.contains(e.target)&&j&&(x(!1),y.current||(c(""),l(null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[j,c,l]),n.useEffect(function(){return u.trim()?(N.current&&clearTimeout(N.current),v(!0),N.current=setTimeout(function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),[4,s.fetchStationsByKeyword(u,!0)];case 1:return(t=e.sent())&&t.data?_(t.data):_([]),[3,4];case 2:return n=e.sent(),console.error("Error fetching stations:",n),_([]),[3,4];case 3:return v(!1),[7];case 4:return[2]}})})},500)):(_([]),v(!1)),function(){N.current&&clearTimeout(N.current)}},[u]),t.jsxs("div",e.__assign({className:"".concat(r.default.wrapper," ").concat(o||""),style:d,ref:b},{children:[t.jsxs("div",e.__assign({className:r.default.inputWrapper},{children:[t.jsx("input",{type:"text",value:u,onChange:function(e){c(e.target.value),x(!0),l(null),y.current=!1},onFocus:function(){(m.length>0||u.length>0)&&x(!0)},placeholder:"Search for a station...",className:r.default.input}),p&&t.jsx("div",e.__assign({className:r.default.spinnerWrapper},{children:t.jsx(a.Loader2,{className:r.default.spinner})}))]})),j&&u&&t.jsx("div",e.__assign({className:r.default.dropdown},{children:m.length>0?m.map(function(n){var s=!!n.ruleset_id;return t.jsxs("div",e.__assign({className:"".concat(r.default.item," ").concat(s?r.default.itemOnboarded:r.default.itemClickable),onClick:function(){s||(c(n.station_name),l(n),x(!1),y.current=!0)}},{children:[t.jsxs("div",e.__assign({className:r.default.itemLeft},{children:[s&&t.jsx("div",e.__assign({className:r.default.checkWrapper},{children:t.jsx(a.Check,{size:12,strokeWidth:3})})),t.jsxs("div",{children:[t.jsx("div",e.__assign({className:"".concat(r.default.stationName," ").concat(s?r.default.stationNameOnboarded:r.default.stationNameUnonboarded)},{children:n.station_name})),t.jsx("div",e.__assign({className:r.default.market},{children:n.market}))]})]})),s&&t.jsx("span",e.__assign({className:r.default.badge},{children:"Onboarded"}))]}),n.station_guid)}):!p&&t.jsx("div",e.__assign({className:r.default.noResults},{children:"No stations found"}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=StationAutocomplete.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.QUERY_PARAM_KEYS={TAB:"tab",RULESET_ID:"rulesetid",OPEN_IL:"openil",ONBOARD_STATION:"onboardstation"},exports.getQueryParam=function(e){return new URLSearchParams(window.location.search).get(e)},exports.setQueryParams=function(e){var t=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");exports.QUERY_PARAM_KEYS={TAB:"tab",RULESET_ID:"rulesetid",SECTION:"section",OPEN_IL:"openil",ONBOARD_STATION:"onboardstation",VARIANT_ID:"variantid",APPROVAL_ACTION:"approval"},exports.getQueryParam=function(e){return new URLSearchParams(window.location.search).get(e)},exports.setQueryParams=function(e){var t=new URLSearchParams(window.location.search);Object.entries(e).forEach(function(e){var a=e[0],r=e[1];null==r||""===r?t.delete(a):t.set(a,r)});var a=t.toString(),r="".concat(window.location.pathname).concat(a?"?".concat(a):"");window.history.replaceState({},"",r)};
|
|
2
2
|
//# sourceMappingURL=useLearningTemplateQueryParams.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zustand").create(function(e){return{llmStudioUrl:"https://devllmstudio.creativeworkspace.ai",audacyBackendUrl:null,setLlmStudioUrl:function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("zustand").create(function(e){return{llmStudioUrl:"https://devllmstudio.creativeworkspace.ai",audacyBackendUrl:null,appsecRbacUrl:null,appsecBaseUrl:null,rbacConfig:null,setLlmStudioUrl:function(r){return e({llmStudioUrl:r})},setAudacyBackendUrl:function(r){return e({audacyBackendUrl:r})},setRbacConfig:function(r){return e({rbacConfig:r,appsecRbacUrl:r.appsecRbacUrl,appsecBaseUrl:r.appsecBaseUrl})}}});exports.default=e;
|
|
2
2
|
//# sourceMappingURL=useEnvStore.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("zustand"),r=require("../hooks/useLearningTemplateQueryParams.js"),n={globalRuleSet:[],genreRuleSet:[],customRuleSet:[]},a=t.create(function(t){return{sidebarTab:"rule-sets",selectedRuleSetId:null,ruleSets:n,isStationModalOpen:!1,isILModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.OPEN_IL),isStationOnboardModalTriggered:"true"===r.getQueryParam(r.QUERY_PARAM_KEYS.ONBOARD_STATION),scopeTreeData:null,urlVariantId:r.getQueryParam(r.QUERY_PARAM_KEYS.VARIANT_ID),urlApprovalAction:(a=r.getQueryParam(r.QUERY_PARAM_KEYS.APPROVAL_ACTION),"approve"===a||"reject"===a?a:null),stations:[],selectedStationId:null,currentRules:[],createdVariantInfo:null,templateMap:{},setTemplateData:function(r,n){return t(function(t){var a;return{templateMap:e.__assign(e.__assign({},t.templateMap),(a={},a[r]=n,a))}})},setRuleSets:function(e){return t({ruleSets:e})},setScopeTreeData:function(e){return t({scopeTreeData:e})},setStationModalOpen:function(e){return t({isStationModalOpen:e})},setIsILModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.OPEN_IL]=e?"true":null,n)),t({isILModalTriggered:e})},setIsStationOnboardModalTriggered:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.ONBOARD_STATION]=e?"true":null,n)),t({isStationOnboardModalTriggered:e})},setInitialRules:function(e){return t({currentRules:e})},setCreatedVariantInfo:function(e){return t({createdVariantInfo:e})},resetCreatedVariantInfo:function(){return t({createdVariantInfo:null})},clearUrlApprovalParams:function(){var e;r.setQueryParams(((e={})[r.QUERY_PARAM_KEYS.VARIANT_ID]=null,e[r.QUERY_PARAM_KEYS.APPROVAL_ACTION]=null,e)),t({urlVariantId:null,urlApprovalAction:null})},setSelectedRuleSetId:function(e){var n;r.setQueryParams(((n={})[r.QUERY_PARAM_KEYS.RULESET_ID]=e,n)),t({selectedRuleSetId:e})},toggleRuleTier:function(r){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{isOpen:!t.isOpen}):t})}})},deleteRule:function(r,n){return t(function(t){return{currentRules:t.currentRules.map(function(t){return t.id===r?e.__assign(e.__assign({},t),{rules:t.rules.filter(function(e){return e.id!==n}),ruleCount:t.ruleCount-1}):t})}})},setStations:function(e){return t({stations:e})},addStation:function(r){return t(function(t){return{stations:e.__spreadArray(e.__spreadArray([],t.stations,!0),[r],!1)}})},deleteStation:function(e){return t(function(t){return{stations:t.stations.filter(function(t){return t.stationId!==e}),selectedStationId:t.selectedStationId===e?null:t.selectedStationId}})},error:null,setError:function(e){return t({error:e})},tiers:[],setTiers:function(e){return t({tiers:e})},backwardCompatibility:!1,setBackwardCompatibility:function(e){return t({backwardCompatibility:e})},app_integration_id:null,setAppIntegrationId:function(e){return t({app_integration_id:e})},token:"",setToken:function(e){return t({token:e})}};var a});exports.INITIAL_RULE_SETS=n,exports.useLearningTemplateStore=a;
|
|
2
2
|
//# sourceMappingURL=useLearningTemplateStore.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".EmptyRuleState-module_container__DD8ZC{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center;padding:2.5rem}.EmptyRuleState-module_card__2-kb8{align-items:center;background-color:#fff;border:1px solid #f3f4f6;border-radius:1rem;box-shadow:0 4px 30px #00000008;display:flex;flex-direction:column;max-width:600px;padding:4rem 2.5rem;text-align:center;width:100%}.EmptyRuleState-module_iconContainer__2Mep-{align-items:center;background-color:#f9fafb;border-radius:9999px;display:flex;height:5rem;justify-content:center;margin-bottom:1.5rem;position:relative;width:5rem}.EmptyRuleState-module_iconLines__-G9Us{display:flex;flex-direction:column;gap:.375rem;opacity:.2;transform:scale(1.1)}.EmptyRuleState-module_iconLine__v1Xs7{background-color:#60a5fa;border-radius:9999px;height:.375rem}.EmptyRuleState-module_iconLineLong__7I0wU{width:2.5rem}.EmptyRuleState-module_iconLineShort__R3ArP{width:1.75rem}.EmptyRuleState-module_iconBadge__YY28J{background-color:#fff;border:1px solid #f9fafb;border-radius:9999px;bottom:-.25rem;box-shadow:0 1px 2px 0 #0000000d;padding:.375rem;position:absolute;right:-.25rem}.EmptyRuleState-module_iconBadge__YY28J svg{color:#d1d5db}.EmptyRuleState-module_title__qk36r{color:#111827;font-size:1.125rem;font-weight:700;margin-bottom:.5rem}.EmptyRuleState-module_description__XButJ{color:#6b7280;font-size:.875rem;margin-bottom:2rem}.EmptyRuleState-module_createButton__GM3ug{align-items:center;background-color:#2563eb;border:none;border-radius:.375rem;box-shadow:0 1px 2px 0 #0000000d;color:#fff;cursor:pointer;display:flex;font-size:.875rem;font-weight:500;gap:.5rem;padding:.625rem 1.5rem;transition:background-color .2s,box-shadow .2s}.EmptyRuleState-module_createButton__GM3ug:hover{background-color:#1d4ed8;box-shadow:0 4px 6px -1px #0000001a}"),exports.default={container:"EmptyRuleState-module_container__DD8ZC",card:"EmptyRuleState-module_card__2-kb8",iconContainer:"EmptyRuleState-module_iconContainer__2Mep-",iconLines:"EmptyRuleState-module_iconLines__-G9Us",iconLine:"EmptyRuleState-module_iconLine__v1Xs7",iconLineLong:"EmptyRuleState-module_iconLineLong__7I0wU",iconLineShort:"EmptyRuleState-module_iconLineShort__R3ArP",iconBadge:"EmptyRuleState-module_iconBadge__YY28J",title:"EmptyRuleState-module_title__qk36r",description:"EmptyRuleState-module_description__XButJ",createButton:"EmptyRuleState-module_createButton__GM3ug"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});require("../../../node_modules/style-inject/dist/style-inject.es.js").default(".EmptyRuleState-module_container__DD8ZC{align-items:center;display:flex;flex:1;flex-direction:column;justify-content:center;padding:2.5rem}.EmptyRuleState-module_card__2-kb8{align-items:center;background-color:#fff;border:1px solid #f3f4f6;border-radius:1rem;box-shadow:0 4px 30px #00000008;display:flex;flex-direction:column;max-width:600px;padding:4rem 2.5rem;text-align:center;width:100%}.EmptyRuleState-module_iconContainer__2Mep-{align-items:center;background-color:#f9fafb;border-radius:9999px;display:flex;height:5rem;justify-content:center;margin-bottom:1.5rem;position:relative;width:5rem}.EmptyRuleState-module_iconLines__-G9Us{display:flex;flex-direction:column;gap:.375rem;opacity:.2;transform:scale(1.1)}.EmptyRuleState-module_iconLine__v1Xs7{background-color:#60a5fa;border-radius:9999px;height:.375rem}.EmptyRuleState-module_iconLineLong__7I0wU{width:2.5rem}.EmptyRuleState-module_iconLineShort__R3ArP{width:1.75rem}.EmptyRuleState-module_iconBadge__YY28J{background-color:#fff;border:1px solid #f9fafb;border-radius:9999px;bottom:-.25rem;box-shadow:0 1px 2px 0 #0000000d;padding:.375rem;position:absolute;right:-.25rem}.EmptyRuleState-module_iconBadge__YY28J svg{color:#d1d5db}.EmptyRuleState-module_title__qk36r{color:#111827;font-size:1.125rem;font-weight:700;margin-bottom:.5rem}.EmptyRuleState-module_description__XButJ{color:#6b7280;font-size:.875rem;margin-bottom:2rem}.EmptyRuleState-module_createButton__GM3ug{align-items:center;background-color:#2563eb;border:none;border-radius:.375rem;box-shadow:0 1px 2px 0 #0000000d;color:#fff;cursor:pointer;display:flex;font-size:.875rem;font-weight:500;gap:.5rem;padding:.625rem 1.5rem;transition:background-color .2s,box-shadow .2s}.EmptyRuleState-module_createButton__GM3ug:hover{background-color:#1d4ed8;box-shadow:0 4px 6px -1px #0000001a}.EmptyRuleState-module_createButton__GM3ug:disabled{background-color:#9ca3af;box-shadow:none;cursor:not-allowed}"),exports.default={container:"EmptyRuleState-module_container__DD8ZC",card:"EmptyRuleState-module_card__2-kb8",iconContainer:"EmptyRuleState-module_iconContainer__2Mep-",iconLines:"EmptyRuleState-module_iconLines__-G9Us",iconLine:"EmptyRuleState-module_iconLine__v1Xs7",iconLineLong:"EmptyRuleState-module_iconLineLong__7I0wU",iconLineShort:"EmptyRuleState-module_iconLineShort__R3ArP",iconBadge:"EmptyRuleState-module_iconBadge__YY28J",title:"EmptyRuleState-module_title__qk36r",description:"EmptyRuleState-module_description__XButJ",createButton:"EmptyRuleState-module_createButton__GM3ug"};
|
|
2
2
|
//# sourceMappingURL=EmptyRuleState.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),
|
|
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");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation"),require("../../../features/LearningManagement/LearningManagement.js");var o=require("../../../features/IL-OTJ/_components/AccordianSection.js"),i=require("../../../features/IL-OTJ/ILOTJ.js"),s={order_rules:{enabled:!1,global_min_separation_seconds:0},advertiser_rules:{enabled:!1,global_min_separation_seconds:0},inventory_rules:{respect_inventory_code:!1},break_code_rules:{respect_break_code:!1},is_default_enabled:!1},l=[{label:"Global Scope",value:"global"},{label:"Genre Scope",value:"genre"},{label:"Custom Scope",value:"custom"}],u=["Tier 1"];exports.default=function(){var c=n.useState(!0),d=c[0],p=c[1],_=n.useState(""),b=_[0],f=_[1],m=n.useState(""),g=m[0],v=m[1],y=n.useState({station:"",tiers:["Tier 1"]}),h=y[0],T=y[1],k=n.useState([]),q=k[0],C=k[1],L=n.useState([]),x=L[0],w=L[1],j=n.useState(s),A=j[0],S=j[1],I=n.useCallback(function(t,n){T(function(r){var a;return e.__assign(e.__assign({},r),((a={})[t]=n,a))})},[]),O=n.useCallback(function(t,n){S(function(r){var a=e.__assign({},r);switch(t){case"order_rules":case"advertiser_rules":a[t]="boolean"==typeof n?e.__assign(e.__assign({},r[t]),{enabled:n}):{enabled:n.enabled,global_min_separation_seconds:n.global_min_separation_seconds};break;case"inventory_rules":a.inventory_rules={respect_inventory_code:"boolean"==typeof n?n:n.respect_inventory_code};break;case"break_code_rules":a.break_code_rules={respect_break_code:"boolean"==typeof n?n:n.respect_break_code};break;case"is_default_enabled":a.is_default_enabled="boolean"==typeof n?n:!!n}return a})},[]),N=function(t){t(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[{id:Date.now(),text:"",reasoning:""}],!1)})},J=function(e,t){e(function(e){return e.filter(function(e){return e.id!==t})})},D=function(t,n,r){t(function(t){return t.map(function(t){return String(t.id)===String(n)?e.__assign(e.__assign({},t),{text:r}):t})})},M=[e.__assign({key:"order_rules",label:"Order"},A.order_rules),e.__assign({key:"advertiser_rules",label:"Advertiser"},A.advertiser_rules)],W=[{key:"inventory_rules",label:"Inventory code",enabled:A.inventory_rules.respect_inventory_code},{key:"break_code_rules",label:"Break Code",enabled:A.break_code_rules.respect_break_code},{key:"is_default_enabled",label:"Default Variant",enabled:A.is_default_enabled}];return t.jsx(i.default,{open:d,closeFunction:function(){return p(!1)},chatAssistantName:"defaultAssistant",organizationName:"techolution",baseUrl:"https://devllmstudio.creativeworkspace.ai",baseWebsocketUrl:"wss://devllmstudio.creativeworkspace.ai/graphql",ThinkingBulbIconComponent:t.jsx(r.Lightbulb,{}),customSections:t.jsx(t.Fragment,{}),isUseNormalChat:!0,chatTitle:"Create New Learning",formTitle:"Learning Details",initialChatMessage:"Hey! How can I assist you?",template:a.TemplateList.BaseTemplate,templateProps:{state:{title:b,description:g,scopeData:h,whenToApplyConditions:q,whenNotToApplyConditions:x,configData:A,citations:[],citation:{}},handlers:{onTitleChange:function(e){var t,n;return f(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e)},onDescriptionChange:function(e){var t,n;return v(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e)},onAddWhenToApply:function(){return N(C)},onRemoveWhenToApply:function(e){return J(C,e)},onEditWhenToApply:function(e,t){return D(C,e,t)},onAddWhenNotToApply:function(){return N(w)},onRemoveWhenNotToApply:function(e){return J(w,e)},onEditWhenNotToApply:function(e,t){return D(w,e,t)},onScopeChange:I,onConfigChange:O},uiState:{showScope:!1,showConfiguration:!0,titleLabel:"Main Rule Name",scopeLabel:"Define Scope",tierLabel:"Select Tier",descriptionLabel:"Learning Explanation",whenToApplyLabel:"Trigger Events (When to Apply)",whenNotToApplyLabel:"Exclusion Events (When NOT to Apply)",configLabel:"Advanced Settings",stationOptions:l,tierOptions:u,separationItems:M,toggles:W},customNodes:{afterDescription:t.jsx(o.default,e.__assign({title:{type:"other",label:"Extra Context Panel"}},{children:t.jsx("p",e.__assign({style:{padding:"12px",fontSize:"14px",color:"#64748b"}},{children:"Because you decoupled the template, I can inject anything I want here without touching BaseTemplate logic!"}))})),afterTitle:t.jsxs("div",e.__assign({style:{marginBottom:"12px",padding:"8px",backgroundColor:"#f0f4ff",borderRadius:"4px"}},{children:[t.jsx("strong",{children:"Tip:"})," Use a clear and descriptive title for your rule to make it easily identifiable later."]}))}}})};
|
|
2
2
|
//# sourceMappingURL=DefaultTeachMeRenderer.js.map
|
|
@@ -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");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("
|
|
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");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation"),require("../../../features/LearningManagement/LearningManagement.js");var o=require("../../../features/IL-OTJ/_components/AccordianSection.js"),i=require("../../../features/IL-OTJ/ILOTJ.js"),s={order_rules:{enabled:!1,global_min_separation_seconds:0},advertiser_rules:{enabled:!1,global_min_separation_seconds:0},inventory_rules:{respect_inventory_code:!1},break_code_rules:{respect_break_code:!1},is_default_enabled:!1},l=[{label:"Global Scope",value:"global"},{label:"Genre Scope",value:"genre"},{label:"Custom Scope",value:"custom"}],u=["Tier 1"];exports.default=function(){var d=n.useState(!0),c=d[0],p=d[1],_=n.useState(""),b=_[0],f=_[1],m=n.useState(""),g=m[0],y=m[1],h=n.useState({station:"",tiers:["Tier 1"]}),v=h[0],T=h[1],k=n.useState([]),q=k[0],w=k[1],C=n.useState([]),L=C[0],A=C[1],S=n.useState(s),x=S[0],j=S[1],I=n.useCallback(function(t,n){T(function(r){var a;return e.__assign(e.__assign({},r),((a={})[t]=n,a))})},[]),O=n.useCallback(function(t,n){j(function(r){var a=e.__assign({},r);switch(t){case"order_rules":case"advertiser_rules":a[t]="boolean"==typeof n?e.__assign(e.__assign({},r[t]),{enabled:n}):{enabled:n.enabled,global_min_separation_seconds:n.global_min_separation_seconds};break;case"inventory_rules":a.inventory_rules={respect_inventory_code:"boolean"==typeof n?n:n.respect_inventory_code};break;case"break_code_rules":a.break_code_rules={respect_break_code:"boolean"==typeof n?n:n.respect_break_code};break;case"is_default_enabled":a.is_default_enabled="boolean"==typeof n?n:!!n}return a})},[]),G=function(t){t(function(t){return e.__spreadArray(e.__spreadArray([],t,!0),[{id:Date.now(),text:"",reasoning:""}],!1)})},J=function(e,t){e(function(e){return e.filter(function(e){return e.id!==t})})},N=function(t,n,r){t(function(t){return t.map(function(t){return String(t.id)===String(n)?e.__assign(e.__assign({},t),{text:r}):t})})},W=[e.__assign({key:"order_rules",label:"Order"},x.order_rules),e.__assign({key:"advertiser_rules",label:"Advertiser"},x.advertiser_rules)],D=[{key:"inventory_rules",label:"Inventory code",enabled:x.inventory_rules.respect_inventory_code},{key:"break_code_rules",label:"Break Code",enabled:x.break_code_rules.respect_break_code},{key:"is_default_enabled",label:"Default Variant",enabled:x.is_default_enabled}],M={"Add Guideline":"I would want to add a separation rule","Search Guideline":"I would want to set a max priority rule","Type your query":"I would want to add a break code matching rule"},B="<p><span>Hi! 👋 I'm your Instant Learning Concierge.</span>\n <span>How would you like to get started? You can select an option below or describe the Guideline you’d like to create.</span>\n ".concat(["Add Guideline","Search Guideline","Type your query"].map(function(e){return'<button class="clickable-button" data-value="'.concat(M[e],'">').concat(e,"</button>")}).join(""),"</p>");return t.jsx(i.default,{open:c,closeFunction:function(){return p(!1)},chatAssistantName:"defaultAssistant",organizationName:"techolution",baseUrl:"https://devllmstudio.creativeworkspace.ai",baseWebsocketUrl:"wss://devllmstudio.creativeworkspace.ai/graphql",ThinkingBulbIconComponent:t.jsx(r.Lightbulb,{}),customSections:t.jsx(t.Fragment,{}),isUseNormalChat:!0,chatTitle:"Create New Guideline",formTitle:"Guideline Details",initialChatMessage:B,template:a.TemplateList.BaseTemplate,templateProps:{state:{title:b,description:g,scopeData:v,whenToApplyConditions:q,whenNotToApplyConditions:L,configData:x,citations:[],citation:{}},handlers:{onTitleChange:function(e){var t,n;return f(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e)},onDescriptionChange:function(e){var t,n;return y(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e)},onAddWhenToApply:function(){return G(w)},onRemoveWhenToApply:function(e){return J(w,e)},onEditWhenToApply:function(e,t){return N(w,e,t)},onAddWhenNotToApply:function(){return G(A)},onRemoveWhenNotToApply:function(e){return J(A,e)},onEditWhenNotToApply:function(e,t){return N(A,e,t)},onScopeChange:I,onConfigChange:O},uiState:{showScope:!1,showConfiguration:!1,titleLabel:"Guideline Name",scopeLabel:"Define Scope",tierLabel:"Select Tier",descriptionLabel:"Guideline Description",whenToApplyLabel:"When to apply this Guideline (When to Apply)",whenNotToApplyLabel:"When not to apply this Guideline (When NOT to Apply)",configLabel:"Advanced Settings",stationOptions:l,tierOptions:u,separationItems:W,toggles:D},customNodes:{afterTitle:t.jsx(o.default,e.__assign({title:{type:"other",label:"Guideline"}},{children:t.jsx("p",e.__assign({style:{padding:"12px",fontSize:"14px",color:"#64748b"}},{children:"HealthCare"}))})),top:t.jsxs("div",e.__assign({style:{marginBottom:"12px",padding:"8px",backgroundColor:"#f0f4ff",borderRadius:"4px"}},{children:[t.jsx("strong",{children:"Guideline Template:"})," This is an ILOTJ TeachMe customized for Guideline Value Type"]}))}}})};
|
|
2
2
|
//# sourceMappingURL=GuidelinesTeachMeRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as o}from"react/jsx-runtime";import{Dialog as t,DialogContent as i,Box as a}from"@mui/material";import s,{useState as r,useEffect as l,useCallback as d}from"react";import
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as o}from"react/jsx-runtime";import{Dialog as t,DialogContent as i,Box as a}from"@mui/material";import s,{useState as r,useEffect as l,useCallback as d}from"react";import c from"./_components/ChatComponents/ChatComponent.js";import u from"./_components/ILPopup.js";import m from"./_components/VariantLoadingOverlay.js";import h from"./_components/templates/RuleComparison/RuleComparison.js";import g from"./_components/templates/RuleComparison/AgentComposerRuleComparison.js";import p from"./_components/ChatComponents/NormalChat.js";var f=function(f){var C=f.open,v=f.chatAssistantName,S=f.organizationName,x=f.baseUrl,b=f.baseWebsocketUrl,k=f.closeFunction,w=f.ThinkingBulbIconComponent,M=f.customSections,y=f.customMetaData,I=f.chatTitle,R=void 0===I?"Instant Learning On-The-Job":I,T=f.formTitle,F=void 0===T?"Instant Learning On-The-Job Form":T,V=f.onSave,A=f.headerMessageHandlers,L=f.aiResponse,D=f.setAIResponse,W=f.width,E=void 0===W?"90vw":W,B=f.height,P=void 0===B?"90vh":B,z=f.sendMessageInChat,O=void 0===z?"":z,N=f.setSendMessageInChat,j=f.validateCustom,U=f.onResetChat,J=f.template,_=f.templateProps,q=f.initialChatMessage,H=f.setCitations,G=f.isLoading,X=void 0!==G&&G,Y=f.isLocked,K=void 0!==Y&&Y,Q=f.saveButtonConfig,Z=void 0===Q?{label:"Save Learning",loadingLabel:"Saving Learning..."}:Q,$=f.saveButtonColor,ee=f.saveWithoutValBtnConfig,ne=void 0===ee?{label:"Save Without Validation",loadingLabel:"Saving Without Validation..."}:ee,oe=f.textareaPlaceholder,te=f.setCurrentRequestId,ie=f.showSavedMessage,ae=void 0!==ie&&ie,se=f.savedMessage,re=void 0===se?"Thank you teacher for teaching me, your learning has been saved successfully.":se,le=f.isError,de=void 0!==le&&le,ce=f.errorMessage,ue=void 0===ce?"I'm sorry, I couldn't save your changes. Please try again.":ce,me=f.isSaving,he=void 0!==me&&me,ge=f.isAiStreaming,pe=f.setIsAiStreaming,fe=f.showConfirmReset,Ce=void 0!==fe&&fe,ve=f.setShowConfirmReset,Se=f.confirmReset,xe=f.isLoadingVariants,be=f.isFormDirty,ke=f.onResetRequest,we=f.mainText,Me=void 0===we?"Adding a variant":we,ye=f.subText,Ie=void 0===ye?"This may take a moment as we update the learning with the new variant.":ye,Re=f.showComparison,Te=void 0!==Re&&Re,Fe=f.setShowComparison,Ve=f.showAgentComposerRuleComparison,Ae=void 0!==Ve&&Ve,Le=f.setShowAgentComposerRuleComparison,De=f.isFetchingComparison,We=f.handleOpenComparison,Ee=f.proposedRule,Be=f.variants,Pe=f.onAddAsVariant,ze=f.isCopyEnabled,Oe=f.showSaveWithoutValidation,Ne=void 0!==Oe&&Oe,je=f.onSaveWithoutValidation,Ue=f.onComparisonLinkClick,Je=f.targetComparisonVariantId,_e=f.highlightedComparisonField,qe=f.onSubmitFeedback,He=f.isUseNormalChat,Ge=void 0!==He&&He,Xe=f.userDetails,Ye=f.handleGlobalClickCapture,Ke=f.isGlobalEditActive,Qe=f.socketTimeOutInMilliSeconds,Ze=f.initialDraftMessage,$e=f.onValidateSession,en=r(C),nn=en[0],on=en[1],tn=r(!1);tn[0];var an=tn[1],sn=r(!1),rn=sn[0],ln=sn[1],dn=r(!1),cn=dn[0];dn[1];var un=r(45),mn=un[0],hn=un[1],gn=r("right"),pn=gn[0],fn=gn[1],Cn=s.useRef(pn),vn=r(!1),Sn=vn[0],xn=vn[1],bn=r(0),kn=bn[0],wn=bn[1],Mn=r(40),yn=Mn[0],In=Mn[1];l(function(){Cn.current=pn},[pn]),l(function(){on(C)},[C]);var Rn=d(function(e){e.preventDefault(),xn(!0),wn(e.clientX),In(mn)},[mn]),Tn=d(function(e){if(Sn){var n=document.querySelector("[data-dialog-content]");if(n){var o=n.getBoundingClientRect(),t=(e.clientX-kn)/o.width*100,i=Math.max(20,Math.min(80,yn+t));hn(i),i>yn&&fn("right"),i<yn&&fn("left")}}},[Sn,kn,yn]),Fn=d(function(){xn(!1)},[]);l(function(){if(Sn)return document.addEventListener("mousemove",Tn),document.addEventListener("mouseup",Fn),function(){document.removeEventListener("mousemove",Tn),document.removeEventListener("mouseup",Fn)}},[Sn,Tn,Fn]);var Vn=function(e,n){K&&"backdropClick"===n||("escapeKeyDown"!==n&&"manualClose"!==n||!(null==be?void 0:be())?(on(!1),k()):null==ke||ke())},An=d(function(e){hn(function(n){var o;if("number"==typeof e)return e>n&&fn("right"),e<n&&fn("left"),e;var t=Cn.current,i=null!==(o={20:30,30:"left"===t?20:50,50:"left"===t?30:75,75:"left"===t?50:100,100:75}[n])&&void 0!==o?o:40;return 100===i&&fn("left"),20===i&&fn("right"),i})},[]),Ln=d(function(){We&&(An(30),We())},[An,We]);return n(t,e({open:nn,onClose:Vn,maxWidth:!1,fullWidth:!0,PaperProps:{sx:{width:E,height:P,display:"flex",flexDirection:"column",padding:0,margin:0,maxWidth:"100vw",borderRadius:"10px"}}},{children:o(i,e({"data-dialog-content":!0,onClickCapture:Ye,sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"row",gap:0,padding:0,fontFamily:'"Plus Jakarta Sans", sans-serif',"& *":{fontFamily:'"Plus Jakarta Sans", sans-serif !important'}}},{children:[n(a,e({sx:{width:"".concat(mn,"%"),maxWidth:"".concat(mn,"%"),transition:Sn?"none":"width 0.3s ease-in-out, max-width 0.3s ease-in-out",bgcolor:"#ffffff",p:0,display:0===mn?"none":"flex",flexDirection:"column"}},{children:Ge?n(p,{chatAssistantName:v,organizationName:S,baseUrl:x,baseWebsocketUrl:b,setIsNewChatClicked:an,ThinkingBulbIconComponent:w,isFormSaveClicked:rn,setIsFormSavedClicked:ln,onResetLearningData:function(){},sendMessageInChat:O,setSendMessageInChat:N,isFormValidating:cn,chatTitle:R,customMetaData:y,headerMessageHandlers:A,aiResponse:L,setAIResponse:D,onResetChat:U,initialChatMessage:q,onSave:V,chatSize:mn,movingTowards:pn,setChatSize:An,setCitations:H,textareaPlaceholder:oe,setCurrentRequestId:te,showSavedMessage:ae,savedMessage:re,isError:de,errorMessage:ue,isSaving:he,onStreamingStateChange:pe,onViewComparison:Ln,isCopyEnabled:ze,onComparisonLinkClick:Ue,onSubmitFeedback:qe}):n(c,{chatAssistantName:v,organizationName:S,baseUrl:x,baseWebsocketUrl:b,setIsNewChatClicked:an,ThinkingBulbIconComponent:w,isFormSaveClicked:rn,setIsFormSavedClicked:ln,onResetLearningData:function(){},sendMessageInChat:O,setSendMessageInChat:N,isFormValidating:cn,chatTitle:R,customMetaData:y,headerMessageHandlers:A,aiResponse:L,setAIResponse:D,onResetChat:U,initialChatMessage:q,onSave:V,chatSize:mn,movingTowards:pn,setChatSize:An,setCitations:H,textareaPlaceholder:oe,setCurrentRequestId:te,showSavedMessage:ae,savedMessage:re,isError:de,errorMessage:ue,isSaving:he,onStreamingStateChange:pe,onViewComparison:Ln,isCopyEnabled:ze,onComparisonLinkClick:Ue,onSubmitFeedback:qe,userDetails:Xe,isGlobalEditActive:Ke,socketTimeOutInMilliSeconds:Qe,initialDraftMessage:Ze,onValidateSession:$e,onCloseSessionModal:Se})})),n(a,{sx:{width:"2px",cursor:"col-resize",backgroundColor:Sn?"#1976d2":"#e0e0e0",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"#1976d2"},flexShrink:0},onMouseDown:Rn}),o(a,e({sx:{width:"".concat(100-mn,"%"),maxWidth:"".concat(100-mn,"%"),transition:Sn?"none":"width 0.3s ease-in-out, max-width 0.3s ease-in-out",display:100===mn?"none":"flex",flexDirection:"column",overflowY:"hidden",position:"relative"}},{children:[n(m,{isLoading:De||!1,mainText:"Fetching differences between rules",subText:"This may take a moment..."}),n(m,{isLoading:xe||!1,mainText:Me,subText:Ie}),Ae?n(g,{proposedRule:Ee,variants:Be,onSelectVariant:function(e){console.log("Selected Variant ID:",e.id)},onAddAsVariant:function(){null==Pe||Pe(),An(40),null==Le||Le(!1)},onSkip:function(){An(40),null==Le||Le(!1)},onBack:function(){An(40),null==Le||Le(!1)},targetVariantId:Je,highlightedField:_e}):Te?n(h,{variants:Be,onSelectVariant:function(e){console.log("Selected Variant ID:",e.id)},onAddAsVariant:function(){null==Pe||Pe(),An(40),null==Fe||Fe(!1)},onSkip:function(){An(40),null==Fe||Fe(!1)},onBack:function(){An(40),null==Fe||Fe(!1)},targetVariantId:Je}):n(u,{setIsFormSavedClicked:ln,customSections:M,onSave:V,formHeader:F,onClose:function(){return Vn(0,"manualClose")},validateCustom:j,template:J,templateProps:_,isLoading:X,isAiStreaming:ge,saveButtonConfig:Z,saveButtonColor:$,showSaveWithoutValidation:Ne,saveWithoutValBtnConfig:ne,onSaveWithoutValidation:je}),n(t,e({open:Ce,onClose:function(){return null==ve?void 0:ve(!1)},PaperProps:{sx:{borderRadius:"12px",padding:"8px",maxWidth:"400px"}}},{children:o(a,e({sx:{p:3,textAlign:"center",fontFamily:"'Plus Jakarta Sans', sans-serif"}},{children:[n("h3",e({style:{fontSize:"18px",fontWeight:600,color:"#0F172A",marginBottom:"6px"}},{children:"Exit Teach Me OTJ?"})),n("p",e({style:{fontSize:"14px",color:"#64748B",lineHeight:"1.5",marginBottom:"10px"}},{children:"Exiting will discard any unsaved changes and end your session."})),o(a,e({sx:{display:"flex",gap:2,justifyContent:"center"}},{children:[n("button",e({onClick:function(){return null==ve?void 0:ve(!1)},style:{flex:1,padding:"10px 16px",cursor:"pointer",backgroundColor:"white",border:"1px solid #E2E8F0",borderRadius:"8px",fontSize:"14px",fontWeight:500,color:"#475569",transition:"all 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="white"}},{children:"Cancel"})),n("button",e({onClick:Se,style:{flex:1,padding:"10px 16px",backgroundColor:"#EF4444",color:"white",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:500,cursor:"pointer",transition:"background-color 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#DC2626"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="#EF4444"}},{children:"Yes, Discard"}))]}))]}))}))]}))]}))}))};export{f as default};
|
|
2
2
|
//# sourceMappingURL=ILOTJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as o}from"tslib";import"react/jsx-runtime";import"@mui/material";import"lucide-react";import"react";import"uuid";import"./_components/templates/TemplatesMap/templatesMap.js";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import r from"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"./_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"./_components/MarkdownComponents/MarkdownElements.js";import"./_components/CitationLink.js";import"@e-llm-studio/citation";import"./store/CitationsContext.js";import"
|
|
1
|
+
import{__awaiter as t,__generator as o}from"tslib";import"react/jsx-runtime";import"@mui/material";import"lucide-react";import"react";import"uuid";import"./_components/templates/TemplatesMap/templatesMap.js";import"@mui/material/Tooltip";import"react-markdown";import"rehype-raw";import r from"axios";import"@e-llm-studio/streaming-response";import"@e-llm-studio/watch-me-work";import"./_components/ChatComponents/ChatHeader.js";import"remark-gfm";import"./_components/MarkdownComponents/MarkdownElements.js";import"./_components/CitationLink.js";import"@e-llm-studio/citation";import"./store/CitationsContext.js";import"@viswa-test/test-citation";var i=function(i){return t(void 0,void 0,void 0,function(){var t;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,r.post("https://devllmstudio.creativeworkspace.ai/instant_learning/give-variant-info",i)];case 1:return[2,o.sent().data];case 2:throw t=o.sent(),console.error("Error getting variant info:",t),t;case 3:return[2]}})})};export{i as getVariantInfo};
|
|
2
2
|
//# sourceMappingURL=ILOTJTest.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as r}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useState as a,useEffect as o}from"react";import{Box as s,CircularProgress as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as r}from"tslib";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{useState as a,useEffect as o}from"react";import{Box as s,CircularProgress as c,Dialog as l,DialogTitle as p,Typography as d,IconButton as u,DialogContent as f}from"@mui/material";import m from"@mui/icons-material/Close";import{useLearningTemplateStore as h}from"../../LearningManagement/store/useLearningTemplateStore.js";var v=function(){var t=a(!0),r=t[0],o=t[1];return n(l,e({open:r,onClose:function(){return o(!1)},fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{borderRadius:"16px",minHeight:"70vh",overflow:"hidden"}}},{children:[n(p,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",px:3,py:2}},{children:[i(d,e({variant:"h6",fontWeight:600},{children:"Teach Me"})),i(u,e({onClick:function(){return o(!1)}},{children:i(m,{})}))]})),i(f,e({dividers:!0,sx:{p:3,backgroundColor:"#fafafa"}},{children:"There is some issue with the selected template. Kindly check steps to resolve."}))]}))},g=function(n){var l=n.templateRegistry,p=void 0===l?{}:l,d=h(function(e){return e.backwardCompatibility}),u=h(function(e){return n.app_integration_id?e.templateMap[n.app_integration_id]:void 0}),f=h(function(e){return e.setTemplateData}),m=d?"Radio Traffic Learning":u,g=a(!m),_=g[0],y=g[1],b=a(!1),w=b[0],x=b[1];if(o(function(){if(n.isOpen){if(!d&&!n.app_integration_id)return console.error("TeachMeWrapper requires an app_integration_id when backward compatibility is disabled."),x(!0),void y(!1);if(m)y(!1);else{t(void 0,void 0,void 0,function(){var e,i;return r(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),y(!0),x(!1),[4,(o=n.app_integration_id,s=n.token,t(void 0,void 0,void 0,function(){var e,t;return r(this,function(r){switch(r.label){case 0:return[4,fetch("".concat("https://devllmstudio.creativeworkspace.ai","/instant_learning/ilotj/application/getValueType/").concat(o),{headers:{Authorization:"Bearer ".concat(s)}})];case 1:if(!(e=r.sent()).ok)throw new Error("Failed to fetch value type");return[4,e.json()];case 2:return t=r.sent(),console.log("Fetched value type data:",t),!t||Array.isArray(t.data)&&0===t.data.length?[2,null]:[2,t.data[0].value_type_name||t.valueTypeName||t.templateName]}})}))];case 1:return e=a.sent(),f(n.app_integration_id,e),[3,4];case 2:return i=a.sent(),console.error(i),x(!0),n.app_integration_id&&f(n.app_integration_id,"ERROR"),[3,4];case 3:return y(!1),[7];case 4:return[2]}var o,s})})}}},[n.isOpen,n.app_integration_id,m,n.token,f,d]),_)return i(s,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:i(c,{size:32})}));if(w||!m)return i(v,{});var k=p[m];return k?i(k,e({},n)):(console.warn("No renderer found for template: ".concat(m)),i(v,{}))};export{g as default};
|
|
2
2
|
//# sourceMappingURL=TeachMeWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as e,__spreadArray as n,__assign as t,__awaiter as o,__generator as i,__rest as r}from"tslib";import{jsx as a,jsxs as s,Fragment as l}from"react/jsx-runtime";import{useRef as c,useState as d,useMemo as u,useEffect as v,useCallback as m,useLayoutEffect as h}from"react";import{keyframes as p,Dialog as g,Box as f}from"@mui/material";import C from"@mui/material/Tooltip";import y from"react-markdown";import b from"rehype-raw";import S from"axios";import{v4 as w}from"uuid";import{stopStreaming as x,startChatStream as k}from"@e-llm-studio/streaming-response";import{WatchMeWork as _}from"@e-llm-studio/watch-me-work";import T from"./ChatHeader.js";import E from"../MessageRendering/MessageRendering.js";import{Skeleton as I}from"../atoms/SkeletonLoader/SkeletonLoader.js";import{ActionableButton as M}from"../MessageRendering/ClickableChatComponents.js";import R from"../AudioWaveform.js";import D from"./ChatComponent.module.css.js";import N from"../../InstantLearning.module.css.js";import{ScrollToBottom as F}from"../_svg/ScrollToBottom.js";import{useHeaderObserver as A,extractTextFromChildren as L}from"../../helpers/utils.js";import{SendButton as W}from"../_svg/SendButton.js";import q from"../_svg/SparkleIcon.js";import{UserIcon as z}from"../_svg/UserIcon.js";var P,j=function(e,n){return S.post("".concat(e||"https://devllmstudio.creativeworkspace.ai","/api/chat/chatResponse"),{name:"ilggcautopromptgen",organizationName:"techolution",prompt:n||"Generate a query"},{headers:{"Content-Type":"application/json"},withCredentials:!0}).then(function(e){return e.data}).catch(function(e){throw console.error("Error calling auto-generate API:",e),e})},B=function(j){var B=j.chatAssistantName,H=j.organizationName,O=j.baseUrl,U=j.baseWebsocketUrl,G=j.setIsNewChatClicked;j.ThinkingBulbIconComponent;var Z=j.isFormSaveClicked,K=j.setIsFormSavedClicked,V=j.onResetLearningData,Q=j.sendMessageInChat,J=j.setSendMessageInChat,$=j.isFormValidating,X=j.chatTitle,Y=j.customMetaData,ee=j.headerMessageHandlers;j.aiResponse;var ne=j.setAIResponse,te=j.onResetChat,oe=j.initialChatMessage,ie=void 0===oe?"":oe,re=j.onSave,ae=j.chatSize,se=j.setChatSize,le=j.movingTowards,ce=j.setCitations,de=j.textareaPlaceholder,ue=void 0===de?"Tell me more about this learning...":de,ve=j.setCurrentRequestId,me=j.showSavedMessage,he=void 0!==me&&me,pe=j.savedMessage,ge=j.isError,fe=void 0!==ge&&ge,Ce=j.errorMessage,ye=void 0===Ce?"There was an error saving your changes.":Ce;j.isSaving;var be=j.isHighlighted,Se=void 0!==be&&be,we=j.onStreamingStateChange,xe=j.onViewComparison;j.isCopyEnabled;var ke=j.onComparisonLinkClick,_e=j.onSubmitFeedback,Te=j.userDetails,Ee=j.isGlobalEditActive,Ie=j.socketTimeOutInMilliSeconds,Me=j.initialDraftMessage,Re=void 0===Me?"":Me,De=j.onValidateSession,Ne=j.onCloseSessionModal,Fe=B,Ae=c("".concat(Fe,"-").concat(H,"-").concat(w())),Le=c("".concat(w())),We=O,qe=c(null),ze=c(!0),Pe=c(null),je=c(null),Be=d(Re),He=Be[0],Oe=Be[1],Ue=d([]),Ge=Ue[0],Ze=Ue[1],Ke=d(!1),Ve=Ke[0],Qe=Ke[1],Je=d(!1);Je[0];var $e=Je[1],Xe=d(!0),Ye=Xe[0],en=Xe[1],nn=d(!0);nn[0];var tn=nn[1],on=d("");on[0];var rn=on[1],an=d(""),sn=an[0],ln=an[1],cn=d(!1),dn=cn[0],un=cn[1],vn=d(!1),mn=vn[0],hn=vn[1],pn=d(!0),gn=pn[0],fn=pn[1],Cn=d("100%");Cn[0];var yn=Cn[1],bn=d(null),Sn=bn[0],wn=bn[1],xn=d(!1);xn[0];var kn=xn[1],_n=d(!1),Tn=_n[0],En=_n[1],In=c(null),Mn=c(new Set),Rn=d(null),Dn=Rn[0],Nn=Rn[1],Fn=d(!1),An=Fn[0],Ln=Fn[1],Wn=d(!1);Wn[0],Wn[1];var qn=d(null);qn[0],qn[1],c(null),c(null);var zn=c(new Map),Pn=c(""),jn=c(new Map),Bn=c(!1),Hn=c(0),On=c(null),Un=c(null),Gn=d(!1),Zn=Gn[0],Kn=Gn[1];p(P||(P=e(["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "],["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "])));var Vn=u(function(){return""===(null==He?void 0:He.trim())||dn},[He,dn]),Qn=u(function(){return $},[$]),Jn=u(function(){var e;return Ge.length>0&&"user"===(null===(e=Ge[Ge.length-1])||void 0===e?void 0:e.role)},[Ge]),$n=u(function(){return Vn||$||!!Ee||Jn},[Vn,$,Ee,Jn]);v(function(){Re&&!He&&(Oe(Re),hn(!0),setTimeout(function(){if(je.current){je.current.focus();var e=Re.length;je.current.setSelectionRange(e,e)}},400))},[Re]),v(function(){null==we||we(dn)},[dn,we]),v(function(){return function(){On.current&&clearTimeout(On.current)}},[]),v(function(){var e=qe.current,n=function(){if(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;fn(t-n-o<=20)}};return e&&(e.addEventListener("scroll",n),n()),function(){e&&e.removeEventListener("scroll",n)}},[Ge]);var Xn=A({handlers:ee,setResult:ne}).processHeaderMessage;v(function(){he&&En(!0)},[he]),v(function(){if(An){var e=setTimeout(function(){Ln(!1)},3e3);return function(){return clearTimeout(e)}}},[An]),v(function(){Z&&!Ee&&(st(new KeyboardEvent("keydown",{key:"Enter"}),!1,"Save this Learning"),K(!1))},[Z]),v(function(){if(Q)try{if(Q.startsWith("__SKELETON__:")){var e=Q.split(":"),o=e[1],i=e.slice(2).join(":"),r={role:"user",content:"",id:o,time:new Date,isSkeleton:!0,skeletonContent:i};return Ze(function(e){return n(n([],e,!0),[r],!1)}),st(new KeyboardEvent("keydown",{key:"Enter"}),!1,i,!1,o),Nn(o),J&&J(""),void setTimeout(function(){Nn(null)},2e3)}if(Q.startsWith("__SKELETON_END__::")){var a=Q.split("::")[1]||"";return Ze(function(e){return e.map(function(e){return e.isSkeleton?t(t({},e),{isSkeleton:!1,content:e.skeletonContent||a}):e})}),void(J&&J(""))}var s=w();st(new KeyboardEvent("keydown",{key:"Enter"}),!1,Q,!1,s),Nn(s),J&&J(""),setTimeout(function(){return Nn(null)},2e3)}catch(e){console.error("Error handling sendMessageInChat signal",e)}},[Q]),v(function(){et(),nt();var e=function(){var e,n=(null===(e=null==In?void 0:In.current)||void 0===e?void 0:e.clientHeight)||0,t="calc(100% - ".concat(n,"px - 10px)");yn(t)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Yn=m(function(e){var n="string"==typeof e?e:"smooth";Pe.current&&Pe.current.scrollIntoView({behavior:n,block:"end"}),ze.current&&setTimeout(function(){Pe.current&&ze.current&&Pe.current.scrollIntoView({behavior:n,block:"end"})},100)},[]);v(function(){if(!dn){var e="";if(Tn?e=pe||"Thank you teacher for teaching me, your rule has been saved successfully.":fe&&(e=ye||"I'm sorry, I couldn't save your changes. Please try again."),e){var t={role:"assistant",content:e,id:w(),citations:[],time:new Date};Ze(function(e){return n(n([],e,!0),[t],!1)}),En(!1),setTimeout(function(){return Yn("smooth")},100)}}},[Tn,fe,dn,pe,ye,Yn]),v(function(){ze.current&&Yn("smooth")},[Yn]);var et=function(){var e={method:"get",maxBodyLength:1/0,url:"".concat(We,"/api/chatbot/getChatSettings?name=").concat(Fe,"&organizationName=").concat(H),headers:{}};S.request(e).then(function(e){var n,t,o;(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.chatSettings)&&""!==(null===(o=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.chatSettings)||void 0===o?void 0:o.chatInitialMessage)&&tn(!0)}).catch(function(e){console.error(e)})},nt=function(){return o(void 0,void 0,void 0,function(){var e,n;return i(this,function(t){e="".concat(We,"/api/chat/history?name=").concat(Fe,"&organizationName=").concat(H);try{n={method:"GET",params:{guestSessionId:Ae.current},withCredentials:!0},S.get(e,n).then(function(e){var n=e.data;n.length>0?(Ze(n),Yn()):tn(!0)}).catch(function(e){console.error(e)})}catch(e){Qe(!1),console.error(e)}return[2]})})},tt=function(){var e="".concat(We,"/api/chat/resetHistory?name=").concat(Fe,"&organizationName=").concat(H);try{var n={method:"GET",params:{guestSessionId:Ae.current},withCredentials:!0};S.get(e,n).then(function(){G(!0),rn(""),wn(null),Mn.current.clear(),jn.current.clear(),Le.current="".concat(w()),Ze([]),tn(!0),Un.current=null,null==te||te(),V&&V()}).catch(function(e){console.error(e)}).finally(function(){Ae.current="".concat(Fe,"-").concat(H,"-").concat(w())})}catch(e){Qe(!1),console.error(e)}};function ot(e){return null==e?void 0:e.replace(/<a [^>]*>.*?<\/a>/g,function(e){return null==e?void 0:e.replace(/\*/g,"*")})}var it=function(e,o,i,r,a,s,l){var c,d,u,v,m,h,p,g,f,C,y,b,S,x,k,_,T,E,I,M,R,D,N,F,A,L,W,q,z,P;if(null===(d=null===(c=null==e?void 0:e.chatStream)||void 0===c?void 0:c.continueChatResult)||void 0===d?void 0:d.header_message){var j={header_message:e.chatStream.continueChatResult.header_message,responsedata:null===(m=null===(v=null===(u=null==e?void 0:e.chatStream)||void 0===u?void 0:u.continueChatResult)||void 0===v?void 0:v.message)||void 0===m?void 0:m.content};Xn(j)}var B=null===(h=null==e?void 0:e.chatStream)||void 0===h?void 0:h.continueChatResult,H=null==B?void 0:B.isEnd,O=(null===(p=null==B?void 0:B.message)||void 0===p?void 0:p.citations)||[];H&&O.length>0&&ce&&ce(O);var U={role:"assistant",content:"",id:w()};if(null===(y=null===(C=null===(f=null===(g=null==e?void 0:e.chatStream)||void 0===g?void 0:g.continueChatResult)||void 0===f?void 0:f.message)||void 0===C?void 0:C.content)||void 0===y?void 0:y.includes("WaitMessage: "))$e(!0),U.content=function(e){var n="WaitMessage: ",t=e.indexOf(n);if(-1!==t){var o=e.substring(t+13);return null==o?void 0:o.replaceAll("WaitMessage: ","")}return""}((null===(x=null===(S=null===(b=null==e?void 0:e.chatStream)||void 0===b?void 0:b.continueChatResult)||void 0===S?void 0:S.message)||void 0===x?void 0:x.content)+"\n\n"),""!==U.content&&(Qe(!1),Ze(n(n([],Ge,!0),[{role:"user",content:a,time:r,isFirstQuestionSent:s||!1,id:l||(null===(_=null===(k=null==e?void 0:e.chatStream)||void 0===k?void 0:k.continueChatResult)||void 0===_?void 0:_.requestId)||"",reply:""},U],!1)));else{$e(!1);var G=null===(E=null===(T=null==e?void 0:e.chatStream)||void 0===T?void 0:T.continueChatResult)||void 0===E?void 0:E.requestId;"string"==typeof G&&G&&ve&&ve(G);var Z=function(e,o,i,r){var a,s,l,c,d,u,v,m={role:"assistant",content:"",id:w(),time:new Date,citations:[]},h=(null===(a=null==e?void 0:e.chatStream)||void 0===a?void 0:a.continueChatResult)||{},p=null==h?void 0:h.requestId,g=null==h?void 0:h.preserve_message,f=null==h?void 0:h.isEnd,C=(null===(s=null==h?void 0:h.message)||void 0===s?void 0:s.content)||"",y=null==h?void 0:h.is_orchestrator,b=null==h?void 0:h.thinking_break,S=(null===(l=null==h?void 0:h.message)||void 0===l?void 0:l.citations)||[];if(p&&g&&C&&!f){var x=r.current.get(p)||[];x[x.length-1]!==C&&(x.push(C),r.current.set(p,x))}var k=(p&&r.current.get(p)||[]).join("\n\n"),_="";if(f)_=k&&""!==k.trim()?k:C;else if(g)_=k;else{var T=C.replace(/<!--(?![\s\S]*-->)[\s\S]*$/,"").trimEnd(),E=!1===y||b||0!==S.length?"":T;_=k?"".concat(k,"\n\n").concat(E):E}if(m.content=ot(_),!0===(null==h?void 0:h.thinking_break)&&!0===(null==h?void 0:h.is_orchestrator)&&!1===(null==h?void 0:h.isEnd)&&o.push({responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!1}),!1===(null==h?void 0:h.thinking_break)&&!1===(null==h?void 0:h.is_orchestrator)&&!1===(null==h?void 0:h.isEnd)){if(h.explainability_id&&h.responded_by){var I=h.explainability_id,M=h.responded_by;i.has(I)||i.set(I,{responded_by:M,index:o.length})}i.has(h.explainability_id)?o[null==(R=i.get(h.explainability_id))?void 0:R.index]={responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!0,explainability_id:null!==(c=h.explainability_id)&&void 0!==c?c:"",isParallelToolResponse:!0}:o=n(n([],o,!0),[{responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!0,explainability_id:null!==(d=h.explainability_id)&&void 0!==d?d:"",isParallelToolResponse:!1}],!1)}if(!0===(null==h?void 0:h.thinking_break)&&!1===(null==h?void 0:h.is_orchestrator)&&!1===(null==h?void 0:h.isEnd)){var R;h.explainability_id&&h.responded_by&&(I=h.explainability_id,M=h.responded_by,i.has(I)||i.set(I,{responded_by:M,index:o.length})),i.has(h.explainability_id)?o[null==(R=i.get(h.explainability_id))?void 0:R.index]={responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!1,explainability_id:null!==(u=h.explainability_id)&&void 0!==u?u:"",isParallelToolResponse:!0}:o.push({responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!1,explainability_id:null!==(v=h.explainability_id)&&void 0!==v?v:"",isParallelToolResponse:!1})}return t({orchestratorAndAgentsMessages:o},m)}(e,i,o,jn);Z.time=new Date,Z.citations=O,Z.isEnd=null===(M=null===(I=null==e?void 0:e.chatStream)||void 0===I?void 0:I.continueChatResult)||void 0===M?void 0:M.isEnd,Z.requestId=null===(D=null===(R=null==e?void 0:e.chatStream)||void 0===R?void 0:R.continueChatResult)||void 0===D?void 0:D.requestId,Z.sessionId=Ae.current,null===(N=Z.orchestratorAndAgentsMessages)||void 0===N||N.forEach(function(e){e&&e.header_message&&Xn(e)}),(""!==(null==Z?void 0:Z.content)||(null==Z?void 0:Z.orchestratorAndAgentsMessages)&&(null==Z?void 0:Z.orchestratorAndAgentsMessages.length)>0)&&(Qe(!1),Ze(n(n([],Ge,!0),[{role:"user",content:a||"",time:r,isFirstQuestionSent:s||!1,id:l||(null===(A=null===(F=null==e?void 0:e.chatStream)||void 0===F?void 0:F.continueChatResult)||void 0===A?void 0:A.requestId)||"",requestId:null!==(q=null===(W=null===(L=null==e?void 0:e.chatStream)||void 0===L?void 0:L.continueChatResult)||void 0===W?void 0:W.requestId)&&void 0!==q?q:""},Z],!1))),en(null===(P=null===(z=null==e?void 0:e.chatStream)||void 0===z?void 0:z.continueChatResult)||void 0===P?void 0:P.isEnd)}},rt=m(function(e){void 0===e&&(e="inactivity"),console.error("Stream failed or timed out due to: ".concat(e)),Bn.current=!1,en(!0),un(!1),kn(!1),Qe(!1),$e(!1),Pn.current&&U&&(x(Pn.current,U,!1),jn.current.delete(Pn.current)),Ze(function(t){var o=n([],t,!0).reverse().find(function(e){return"user"===e.role}),i=((null==o?void 0:o.content)||"").replace(/"/g,"""),r=n([],t,!0),a=r[r.length-1];a&&"assistant"===a.role&&!a.isEnd&&r.pop();var s="I ran into an unexpected issue while trying to process this learning.";return"inactivity"===e?s="Something went wrong—teaching is taking longer than expected.":"websocket_error"===e&&(s="I lost connection to the server while working on that."),n(n([],r,!0),[{role:"assistant",content:"".concat(s,' Please try again.\n\n<button class="clickable-button" data-value="').concat(i,'">Retry</button>'),id:w(),time:new Date,isEnd:!0,citations:[]}],!1)})},[Ie,U]),at=m(function(){On.current&&(clearTimeout(On.current),On.current=null),Ie&&Ie>0&&(On.current=setTimeout(function(){return rt("inactivity")},Ie))},[rt,Ie]),st=function(e,r,a,s,l,c){return o(void 0,void 0,void 0,function(){var o,s,d,u,v,m,h,p,g,f,C,y,b,S,x;return i(this,function(i){switch(i.label){case 0:if(o=(void 0!==a?a:He||"").trim(),(s="Enter"===(null==e?void 0:e.key)&&!(null==e?void 0:e.shiftKey)&&!Ee)&&(null===(f=null==e?void 0:e.preventDefault)||void 0===f||f.call(e)),d="user"===(null===(C=Ge[Ge.length-1])||void 0===C?void 0:C.role),!o||dn||Bn.current||d||(null==e?void 0:e.key)&&!s)return[2];if(Un.current||(Un.current=(new Date).toISOString(),console.log("Session start time set to ".concat(Un.current))),!De)return[3,5];Qe(!0),ln("Validating session..."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,De(Un.current)];case 2:return i.sent()?[3,4]:(Kn(!0),Qe(!1),c&&c(!1),[2]);case 3:return u=i.sent(),console.error("Validation error:",u),Kn(!0),Qe(!1),c&&c(!1),[2];case 4:Qe(!1),i.label=5;case 5:return Bn.current=!0,"I want to add a rule description"===o?(en(!1),ze.current=!0,un(!0),!Sn&&o&&wn(a||"manual_entry"),v=new Date,Ze(function(e){return n(n([],e.map(function(e,n){var o;return t(t({},e),{content:null===(o=ot(e.content))||void 0===o?void 0:o.replace("WaitMessage: ","")})}),!0),[{role:"user",content:o,time:v,isFirstQuestionSent:!1,id:l||w()}],!1)}),Yn("smooth"),setTimeout(function(){Ze(function(e){return n(n([],e,!0),[{role:"assistant",content:"I'd be happy to help you set up a new rule! To get started, could you tell me what kind of behavior or logic you would like this rule to follow?",id:w(),citations:[],time:new Date}],!1)}),Yn("smooth"),setTimeout(function(){un(!1),en(!0)},500)},500),[2]):(en(!1),ze.current=!0,un(!0),!Sn&&o&&wn(a||"manual_entry"),m=new Date,Ze(function(e){var i=e.map(function(e){var n;return t(t({},e),{content:null===(n=ot(e.content))||void 0===n?void 0:n.replace("WaitMessage: ","")})});return l&&i.some(function(e){return e.id===l})?i.map(function(e){return e.id===l?t(t({},e),{content:o}):e}):n(n([],i,!0),[{role:"user",content:o,time:m,isFirstQuestionSent:!1,id:l||w()}],!1)}),Yn("smooth"),h=new Map,p=[],g={WEBSOCKET_URL:U,organizationName:H,chatAssistantName:Fe,selectedAIModel:"gpt-4",replyMessage:"",userName:null!==(y=null==Te?void 0:Te.name)&&void 0!==y?y:"Guest User",userEmailId:null!==(b=null==Te?void 0:Te.email)&&void 0!==b?b:"guestUser@example.com",userId:null!==(S=null==Te?void 0:Te.id)&&void 0!==S?S:"Guest User",query:o,requestId:"requestId-".concat(w()),customPrompt:"",enableForBackend:!1,guestSessionId:Ae.current,chatPreviewId:Le.current,customMetaData:Y,aiModel:"",enableLogs:!0,onStreamEvent:function(e){var n,t,i,a,s,c,d=null===(t=null===(n=null==e?void 0:e.chatStream)||void 0===n?void 0:n.continueChatResult)||void 0===t?void 0:t.requestId,u=null===(a=null===(i=null==e?void 0:e.chatStream)||void 0===i?void 0:i.continueChatResult)||void 0===a?void 0:a.header_message;console.log("📦 [Stream Chunk Received] With RequestID and header_message: ".concat(d,",").concat(u)),at();var v=null===(c=null===(s=null==e?void 0:e.chatStream)||void 0===s?void 0:s.continueChatResult)||void 0===c?void 0:c.error_state;if(Array.isArray(v)&&v.length>0)return console.error("Agent returned an error_state during stream:",v),void rt("agent_error");it(e,h,p,m,o,r,l)},onStreamEnd:function(e){var o,i,r=null===(i=null===(o=null==e?void 0:e.chatStream)||void 0===o?void 0:o.continueChatResult)||void 0===i?void 0:i.requestId;console.log("✅ [Stream Completed] RequestID: ".concat(r)),On.current&&clearTimeout(On.current),Bn.current=!1,en(!0),un(!1),kn(!1);var a=Date.now(),s=zn.current.get(Pn.current);if(s){var l=Math.round((a-s)/1e3).toFixed(1);Ze(function(e){var o=n([],e,!0).reverse().findIndex(function(e){return"assistant"===e.role});if(-1===o)return e;var i=e.length-1-o;return e.map(function(e,n){return n===i?t(t({},e),{finalTimeTaken:l}):e})})}},onError:function(e){On.current&&clearTimeout(On.current),console.error("Stream error:",e),rt("websocket_error")}},o&&(Qe(!0),null===(x=je.current)||void 0===x||x.blur(),Oe(""),Yn(),ln(l?"Just a moment, processing your request...":"Okay, got it. Let me take a moment to work on this and I'll get back to you shortly."),zn.current.set(g.requestId,Date.now()),Pn.current=g.requestId,at(),Hn.current+=1,console.log("🚀 [UI Action] stream started (Total UI invocations: ".concat(Hn.current,") | RequestID: ").concat(g.requestId,' | Query: "').concat(o,'"')),k(g)),c&&c(!1),[2])}})})},lt=c(null);h(function(){lt.current=st});var ct=m(function(){for(var e,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return null===(e=lt.current)||void 0===e?void 0:e.call.apply(e,n([lt],t,!1))},[]),dt=u(function(){return{p:function(e){e.node;var n=e.children;return r(e,["node","children"]),a("div",t({style:{margin:0,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",fontFamily:"inherit"}},{children:n}))},button:function(e){e.node;var n=e.className,o=e.children,i=r(e,["node","className","children"]),l=L(o),c=i["data-value"],d="Tester Genie"===l;return a(M,t({},i,{className:n,handleStream:ct,isStreamEnd:Ye,disabled:!!Sn||!!Ee,isLastMessage:!0,style:{margin:0},isTesterGenie:d,"data-selected":Sn===l||Sn===c?"true":Sn?"false":void 0},{children:s("span",t({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[o,d&&s("svg",t({width:"16",height:"20",viewBox:"0 0 16 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[a("path",{d:"M7.20368 8.94768e-06C7.48895 -0.00208639 7.69331 0.364327 7.83856 0.57465C8.14381 1.01633 8.38012 1.87909 7.71077 2.14118C8.57167 2.21011 9.70406 2.93098 10.1785 3.64699C10.5932 4.27286 10.4559 5.16037 9.80301 5.56007L9.9502 7.16593C9.97671 7.44871 10.0265 7.87092 10.0299 8.14457C10.4213 8.23046 11.0787 8.55391 11.326 8.87592C11.5979 8.75656 11.9189 8.76963 12.1688 8.93469C12.3563 8.67751 12.5598 8.41456 12.7507 8.15787C12.3283 7.45155 12.5047 6.57745 13.2143 6.13784C13.5375 5.9377 13.9264 5.87277 14.2971 5.95705C14.0961 6.30964 13.8775 6.72182 13.6593 7.05857C13.7906 7.2436 13.9184 7.44225 14.044 7.63194L14.8022 7.63198C15.0349 7.30106 15.2515 6.90827 15.4835 6.59349C15.8623 7.0712 15.8156 7.79671 15.4734 8.28241C15.1318 8.76741 14.4886 8.9899 13.9118 8.88251C13.758 9.12108 13.5577 9.39243 13.3941 9.63201C13.7143 9.9316 13.7725 10.364 13.4067 10.6594C13.5231 10.8889 13.5309 11.1613 13.447 11.402C13.1502 12.2523 12.1724 12.5645 11.3474 12.5025C11.1171 12.4852 10.939 12.4698 10.7197 12.3953C10.8724 13.1271 10.7744 14.2031 10.5132 14.9051C10.1688 15.8304 9.43632 16.5569 8.54503 16.9655C7.90465 17.2706 7.21222 17.3607 6.50472 17.4505C5.74445 17.5471 4.75801 17.4362 4.08533 17.825C3.9327 17.9132 3.86566 18.0173 3.82943 18.1792C3.94996 18.5982 4.47858 18.6063 4.78474 18.8897C5.20191 19.2758 4.90716 19.9663 4.36611 19.9908C4.31476 19.9931 4.26867 19.9867 4.23186 19.9493C4.23089 19.8303 4.47587 19.7199 4.49787 19.5262C4.55075 19.0604 3.70014 19.0078 3.37835 18.8374C3.13013 18.706 2.99537 18.6309 2.82242 18.4021C2.63795 18.1579 2.58428 17.835 2.63138 17.5392C2.74868 16.7847 3.47123 16.393 4.12184 16.1497C4.61314 15.9659 5.46304 15.7158 5.52019 15.0793C5.58589 14.348 4.97543 13.5523 4.57739 12.9807C4.44275 12.7875 4.3039 12.579 4.16309 12.3919C4.18987 12.365 4.21049 12.3463 4.23916 12.3212C4.59619 12.6218 5.21209 12.6421 5.55038 12.2979C5.70457 12.144 5.78974 11.9342 5.78642 11.7164C5.78121 11.4493 5.63382 11.2002 5.4454 11.019C5.44704 10.9932 5.44824 10.9676 5.449 10.9419C5.4566 10.6648 5.37505 10.4902 5.1892 10.2943C5.18398 10.2538 5.17776 10.2134 5.17053 10.1732C5.08123 9.69297 4.71708 9.34182 4.23415 9.27108C4.16418 9.26083 3.96108 9.26105 3.92071 9.23344C3.90485 9.1828 3.9059 9.20792 3.91904 9.15527C4.22103 8.90139 4.14407 8.78214 4.31107 8.4846C4.42301 8.28513 4.73047 8.15239 4.95452 8.10701C4.96167 7.51076 5.03684 6.88562 5.10036 6.29144C5.12451 6.0655 5.12531 5.75046 5.1511 5.55257C4.11108 4.86747 4.39091 3.75946 5.25465 3.06391C5.84978 2.58469 6.34496 2.31002 7.10143 2.14517C7.01589 2.10416 6.93842 2.04811 6.87269 1.97972C6.77021 1.87349 6.70248 1.73857 6.67853 1.59293C6.60568 1.12096 7.04104 0.914625 7.18759 0.526392C7.26428 0.323403 7.03925 0.146075 7.20368 8.94768e-06Z",fill:"#475569"}),a("path",{d:"M7.459 4.5C7.48797 4.50312 7.71949 4.61154 7.76205 4.63061C8.27062 4.85835 8.87051 5.09164 9.35658 5.3582C9.36602 6.03495 9.37016 6.56625 8.70573 6.91519C8.6633 6.80883 8.63019 6.72409 8.56332 6.63044C8.43786 6.45568 8.24656 6.33963 8.03354 6.30909C7.8434 6.28211 7.65146 6.3197 7.49586 6.43503C7.21897 6.21256 6.76265 6.28197 6.5229 6.52486C6.39308 6.65639 6.34815 6.75074 6.28902 6.92344C5.59702 6.5957 5.58761 6.04267 5.60583 5.35582C5.89882 5.23844 6.21318 5.0724 6.50153 4.941C6.82145 4.79522 7.14482 4.6574 7.459 4.5Z",fill:"#D1EDFD"}),a("path",{d:"M11.0756 10.6406C11.1037 10.6701 11.1324 10.7706 11.1535 10.8145C11.2818 11.0817 11.4922 11.1945 11.7498 11.2977C11.5607 11.63 11.4567 11.8797 11.1034 12.0466L11.0839 12.0517C10.9262 12.0927 10.7996 12.0968 10.651 12.0135C10.4755 11.915 10.3807 11.6614 10.4792 11.478C10.6388 11.1809 10.8877 10.9272 11.0756 10.6406Z",fill:"#D1EDFD"}),a("path",{d:"M11.6036 9.1377C11.6993 9.11763 11.8391 9.16378 11.9294 9.19593C11.6952 9.50644 11.4706 9.81614 11.2327 10.1261L11.1572 10.2255C10.7581 9.73539 11.0333 9.24481 11.6036 9.1377Z",fill:"#D1EDFD"}),a("path",{d:"M7.49681 0.882812C7.53691 0.925159 7.61244 1.08523 7.63598 1.14156C7.74243 1.39673 7.75769 1.76908 7.38596 1.77504C7.28236 1.75599 7.15628 1.68938 7.13517 1.5783C7.0843 1.3107 7.35609 1.09964 7.48737 0.897583L7.49681 0.882812Z",fill:"#D1EDFD"}),a("path",{d:"M1.68305 6.17249C1.71659 6.1673 1.8134 6.16478 1.84892 6.16432C2.34052 6.15616 2.81496 6.34495 3.16655 6.68866C3.50847 7.01806 3.70349 7.47119 3.70765 7.94596C3.70896 8.42345 3.54045 8.85284 3.20281 9.19025C3.34033 9.28068 3.5321 9.52219 3.6543 9.65748C4.17158 9.39073 4.91447 9.69339 4.79675 10.3444C5.08751 10.5485 5.19656 10.8288 5.0585 11.1674C5.15418 11.2375 5.25595 11.3205 5.32383 11.4186C5.40228 11.5303 5.4309 11.6695 5.40291 11.8031C5.32228 12.1857 4.90085 12.3286 4.57669 12.1236C4.51367 12.0838 4.42258 11.9595 4.35299 11.9431C4.30669 11.9557 4.28453 11.9584 4.23644 11.9644C4.22885 11.9742 4.22118 11.9841 4.21343 11.9938C3.93597 12.3413 3.49234 12.4682 3.06933 12.5157C2.85285 12.518 2.70432 12.5146 2.49066 12.4609C1.80785 12.2892 1.50808 11.6167 1.70723 10.9639C1.829 10.5648 2.11891 10.2506 2.48939 10.0518C2.54655 10.132 2.57559 10.2191 2.64066 10.303C2.73571 10.2223 2.82048 10.1482 2.92363 10.0773C2.81023 9.95313 2.66811 9.7693 2.55817 9.63584C2.38871 9.6878 2.23026 9.72879 2.05298 9.74653C1.54239 9.80228 1.03118 9.64711 0.637735 9.31695C0.269964 9.01018 0.0453493 8.54827 0.00544736 8.07322C-0.0309495 7.60988 0.116099 7.15077 0.414918 6.79478C0.742554 6.41198 1.18728 6.21393 1.68305 6.17249Z",fill:"#475569"}),a("path",{d:"M1.79616 6.5951C2.54894 6.5619 3.18687 7.14364 3.22301 7.8963C3.25915 8.64894 2.67989 9.28913 1.92739 9.3282C1.17073 9.3675 0.526231 8.78435 0.489885 8.02753C0.45354 7.27071 1.03921 6.62849 1.79616 6.5951Z",fill:"#D1EDFD"}),a("path",{d:"M4.93607 11.4844C5.12839 11.6261 5.22049 11.9085 4.91876 11.9419C4.8067 11.8805 4.78491 11.8646 4.71094 11.7561C4.81572 11.6752 4.862 11.5925 4.93607 11.4844Z",fill:"#FEFEFD"}),a("path",{d:"M12.5164 3.58594L12.5715 3.59466C12.6589 3.65863 12.6908 3.94434 12.7882 4.05193C12.8789 4.15216 12.9155 4.17816 13.0326 4.24929C13.1363 4.31224 13.3325 4.34025 13.384 4.43124C13.3643 4.56218 13.0693 4.54857 12.9127 4.69344C12.6903 4.89898 12.7114 5.06971 12.5892 5.28622C12.5669 5.28439 12.5368 5.2868 12.5261 5.27346C12.4336 5.15843 12.4072 4.9308 12.3099 4.81465C12.1627 4.63903 11.9972 4.60054 11.7981 4.51372C11.7544 4.49467 11.7266 4.47099 11.7129 4.42649C11.7867 4.31876 12.0509 4.34309 12.2376 4.14892C12.43 3.94901 12.4155 3.72208 12.5164 3.58594Z",fill:"#475569"}),a("path",{d:"M2.13644 3.72656C2.24401 3.77084 2.29712 4.1268 2.431 4.25226C2.60327 4.41371 2.7311 4.41949 2.93246 4.52449C2.96024 4.53897 2.97173 4.56042 2.97671 4.58878C2.89584 4.6981 2.61854 4.70721 2.4596 4.85659C2.26275 5.04156 2.27341 5.29132 2.17022 5.42088C2.16192 5.41849 2.11671 5.40232 2.1156 5.40043C2.01291 5.21216 1.9836 5.04909 1.84812 4.87273C1.73599 4.72675 1.36534 4.69959 1.32812 4.56939C1.3835 4.47941 1.67823 4.44211 1.82291 4.30563C2.02737 4.11274 2.0042 3.8372 2.13644 3.72656Z",fill:"#475569"})]}))]}))}))}}},[ct,Ye,Sn,Ee]),ut=u(function(){return Ge.some(function(e){return e.isSkeleton})},[Ge]),vt=function(e){return o(void 0,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return _e?[4,_e(e)]:[3,2];case 1:t.sent(),Ze(function(e){return n(n([],e,!0),[{role:"assistant",content:"Thanks for your feedback — this will help improve future suggestions.",id:w(),citations:[],time:new Date,isEnd:!0}],!1)}),setTimeout(function(){return Yn("smooth")},100),t.label=2;case 2:return[2]}})})};return s("div",t({className:"".concat(N.customFont," ").concat(D.chatContainer),style:{transition:"box-shadow 0.3s ease-in-out",boxShadow:Se&&!ut?"0 0 20px 5px rgba(37, 99, 235, 0.5)":"none"}},{children:[s("div",t({ref:qe,className:D.scrollWrapper},{children:[a("div",t({ref:In,className:D.stickyHeader},{children:a(T,{resetChatHistory:tt,isStreamEnd:Ye,chatTitle:X,onResize:se,chatSize:ae,movingTowards:le})})),s("div",t({className:D.messagesList},{children:[s("div",t({className:D.initialMessageRow},{children:[a("div",t({className:D.iconWrapper},{children:a(q,{})})),a("div",t({className:D.welcomeTextWrapper},{children:a("div",t({className:D.welcomeMarkdownWrapper},{children:a("span",{children:a(y,t({rehypePlugins:[b],components:dt},{children:ie}))})}))}))]})),Ge.length>0&&Ge.map(function(e,n){var o,i;return s("div",t({className:D.messageRow},{children:["assistant"===e.role?a("div",t({className:D.assistantIconContainer},{children:a(q,{})})):a("div",{className:D.userSpacer}),a("div",t({className:D.messageContent},{children:"assistant"===e.role?s(l,{children:[e.orchestratorAndAgentsMessages&&e.orchestratorAndAgentsMessages.length>0&&a(_,{orchestratorAndAgentsMessages:null==e?void 0:e.orchestratorAndAgentsMessages,isStreamEnd:Ye,finalTimeTaken:null==e?void 0:e.finalTimeTaken},null!==(o=null==e?void 0:e.finalTimeTaken)&&void 0!==o?o:null==e?void 0:e.id),a(E,{index:n,content:null==e?void 0:e.content,role:null==e?void 0:e.role,messages:Ge,handleStream:st,isLastMessage:n===Ge.length-1,onSave:re,citations:null==e?void 0:e.citations,setChatSize:se,chatSize:ae,isStreamEnd:Ye,messageIsEnd:null==e?void 0:e.isEnd,onViewComparison:xe,onTypeResponseClick:function(){var e;Ln(!0),null===(e=je.current)||void 0===e||e.focus()},onComparisonLinkClick:ke,baseURL:We,onFeedbackSubmit:vt,isGlobalEditActive:Ee}),e.hasOwnProperty("isEnd")&&!(null==e?void 0:e.isEnd)&&(null===(i=null==e?void 0:e.content)||void 0===i?void 0:i.length)>0&&s(l,{children:[a(I,{variant:"text",width:"50%",height:20}),a("div",{style:{marginTop:"10px"}}),a(I,{variant:"text",width:"100%",height:40})]}),a("div",t({className:D.timestamp},{children:e.time&&!isNaN(new Date(e.time).getTime())?new Date(e.time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):(new Date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}))]}):s("div",t({className:D.userMessageWrapper},{children:[s("div",t({className:D.userMessageBubble,style:{transition:"box-shadow 0.3s ease-in-out",boxShadow:e.isSkeleton||ut||e.id!==Dn?"none":"0 0 15px 3px rgba(37, 99, 235, 0.6)"}},{children:[e.isSkeleton?s("div",t({style:{display:"flex",flexDirection:"column",gap:"12px",minWidth:"280px",padding:"8px 0"}},{children:[a(I,{variant:"text",width:"100%",height:16}),a(I,{variant:"text",width:"80%",height:16})]})):a(E,{index:n,content:null==e?void 0:e.content,role:null==e?void 0:e.role,messages:Ge,handleStream:st,isLastMessage:n===Ge.length-1,onSave:re,citations:null==e?void 0:e.citations,isStreamEnd:Ye,isGlobalEditActive:Ee,messageIsEnd:null==e?void 0:e.isEnd,onViewComparison:xe,onComparisonLinkClick:ke,baseURL:We,onFeedbackSubmit:vt}),a("div",t({style:{marginTop:"0.5rem"}},{children:a(z,{})}))]})),a("div",t({className:D.userTimestamp},{children:new Date(e.time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}))]}))}))]}),e.id)}),Ve&&s("div",t({className:D.loadingRow},{children:[a("div",t({className:D.iconWrapper,style:{marginTop:"0.2rem"}},{children:a(q,{})})),a("div",t({className:D.loadingTextWrapper},{children:a("span",{children:sn})}))]})),a("div",{ref:Pe,style:{float:"left",clear:"both"}})]}))]})),a("div",t({className:D.inputAreaWrapper},{children:a(C,t({title:$?"Please wait for the validation to be completed.":""},{children:s("div",t({className:"".concat(D.inputBoxContainer," ").concat(Qn?D.disabled:""),style:An?{boxShadow:"0 0 15px 3px rgba(37, 99, 235, 0.5)",borderColor:"#2563eb",transition:"box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out"}:{transition:"box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out"}},{children:[Ge.length>0&&!gn&&a("div",t({onMouseDown:function(e){e.preventDefault(),Yn("smooth")},className:D.scrollToBottomBtn},{children:a(F,{})})),s("div",t({style:{width:"100%",display:"flex"}},{children:[a("textarea",{ref:je,placeholder:ue,value:He||"",onChange:function(e){Oe(e.target.value)},onFocus:function(){return hn(!0)},onBlur:function(){return hn(!1)},onKeyDown:function(e){return st(e)},disabled:Qn,className:"no-scrollbar ".concat(D.chatTextarea),style:{minHeight:mn||He&&He.length>40?"120px":"50px",height:mn||He&&He.length>40?"120px":"50px",maxHeight:"120px"}}),a("span",t({className:D.sendButtonWrapper},{children:a("button",t({onClick:function(e){$n||st(new KeyboardEvent("keydown",{key:"Enter"}))},disabled:$n,className:"".concat(D.sendButton," ").concat($n?D.disabled:D.active)},{children:a(W,{})}))}))]}))]}))}))})),s("div",t({className:D.footerTools},{children:[a(C,t({title:"Coming soon",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:a("span",t({className:D.footerToolItem},{children:a(R,{amplitude:1,variant:"speaker",isActive:!1,onClick:function(){return null},disabled:!1})}))})),a(C,t({title:"Coming soon",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:a("span",t({className:D.footerToolItem},{children:a(R,{amplitude:1,variant:"microphone",isActive:!1,onClick:function(){return null},disabled:!1})}))}))]})),a(g,t({open:Zn,onClose:function(){},PaperProps:{sx:{borderRadius:"12px",padding:"8px",maxWidth:"400px"}}},{children:s(f,t({sx:{p:3,textAlign:"center",fontFamily:"'Plus Jakarta Sans', sans-serif"}},{children:[a("h3",t({style:{fontSize:"18px",fontWeight:600,color:"#0F172A",marginBottom:"10px"}},{children:"Session Expired"})),a("p",t({style:{fontSize:"14px",color:"#64748B",lineHeight:"1.5",marginBottom:"20px"}},{children:"Changes were made to the learnings in this scope while you were editing. To avoid conflicts, concurrent edits aren’t allowed."})),s(f,t({sx:{display:"flex",gap:2,justifyContent:"center"}},{children:[a("button",t({onClick:function(){Kn(!1),tt()},style:{flex:1,padding:"10px 16px",cursor:"pointer",backgroundColor:"white",border:"1px solid #E2E8F0",borderRadius:"8px",fontSize:"14px",fontWeight:500,color:"#475569",transition:"all 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="white"}},{children:"Reset Session"})),a("button",t({onClick:function(){Kn(!1),null==Ne||Ne()},style:{flex:1,padding:"10px 16px",backgroundColor:"#EF4444",color:"white",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:500,cursor:"pointer",transition:"background-color 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#DC2626"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="#EF4444"}},{children:"Discard & Close"}))]}))]}))}))]}))};export{j as autoGeneratePrompt,B as default};
|
|
1
|
+
import{__makeTemplateObject as e,__spreadArray as n,__assign as t,__awaiter as o,__generator as i,__rest as r}from"tslib";import{jsx as a,jsxs as s,Fragment as l}from"react/jsx-runtime";import{useRef as c,useState as u,useMemo as d,useEffect as v,useCallback as m,useLayoutEffect as h}from"react";import{keyframes as p,Dialog as g,Box as f}from"@mui/material";import C from"@mui/material/Tooltip";import y from"react-markdown";import b from"rehype-raw";import S from"axios";import{v4 as w}from"uuid";import{stopStreaming as x,startChatStream as k}from"@e-llm-studio/streaming-response";import{WatchMeWork as _}from"@e-llm-studio/watch-me-work";import T from"./ChatHeader.js";import E from"../MessageRendering/MessageRendering.js";import{Skeleton as I}from"../atoms/SkeletonLoader/SkeletonLoader.js";import{ActionableButton as M}from"../MessageRendering/ClickableChatComponents.js";import R from"../AudioWaveform.js";import D from"./ChatComponent.module.css.js";import N from"../../InstantLearning.module.css.js";import{ScrollToBottom as F}from"../_svg/ScrollToBottom.js";import{useHeaderObserver as A,extractTextFromChildren as L}from"../../helpers/utils.js";import{SendButton as W}from"../_svg/SendButton.js";import q from"../_svg/SparkleIcon.js";import{UserIcon as z}from"../_svg/UserIcon.js";var P,j=function(e,n){return S.post("".concat(e||"https://devllmstudio.creativeworkspace.ai","/api/chat/chatResponse"),{name:"ilggcautopromptgen",organizationName:"techolution",prompt:n||"Generate a query"},{headers:{"Content-Type":"application/json"},withCredentials:!0}).then(function(e){return e.data}).catch(function(e){throw console.error("Error calling auto-generate API:",e),e})},B=function(j){var B=j.chatAssistantName,H=j.organizationName,O=j.baseUrl,U=j.baseWebsocketUrl,G=j.setIsNewChatClicked;j.ThinkingBulbIconComponent;var Z=j.isFormSaveClicked,K=j.setIsFormSavedClicked,V=j.onResetLearningData,Q=j.sendMessageInChat,J=j.setSendMessageInChat,$=j.isFormValidating,X=j.chatTitle,Y=j.customMetaData,ee=j.headerMessageHandlers;j.aiResponse;var ne=j.setAIResponse,te=j.onResetChat,oe=j.initialChatMessage,ie=void 0===oe?"":oe,re=j.onSave,ae=j.chatSize,se=j.setChatSize,le=j.movingTowards,ce=j.setCitations,ue=j.textareaPlaceholder,de=void 0===ue?"Tell me more about this learning...":ue,ve=j.setCurrentRequestId,me=j.showSavedMessage,he=void 0!==me&&me,pe=j.savedMessage,ge=j.isError,fe=void 0!==ge&&ge,Ce=j.errorMessage,ye=void 0===Ce?"There was an error saving your changes.":Ce;j.isSaving;var be=j.isHighlighted,Se=void 0!==be&&be,we=j.onStreamingStateChange,xe=j.onViewComparison;j.isCopyEnabled;var ke=j.onComparisonLinkClick,_e=j.onSubmitFeedback,Te=j.userDetails,Ee=j.isGlobalEditActive,Ie=j.socketTimeOutInMilliSeconds,Me=j.initialDraftMessage,Re=void 0===Me?"":Me,De=j.onValidateSession,Ne=j.onCloseSessionModal,Fe=B,Ae=c("".concat(Fe,"-").concat(H,"-").concat(w())),Le=c("".concat(w())),We=O,qe=c(null),ze=c(!0),Pe=c(null),je=c(null),Be=u(Re),He=Be[0],Oe=Be[1],Ue=u([]),Ge=Ue[0],Ze=Ue[1],Ke=u(!1),Ve=Ke[0],Qe=Ke[1],Je=u(!1);Je[0];var $e=Je[1],Xe=u(!0),Ye=Xe[0],en=Xe[1],nn=u(!0);nn[0];var tn=nn[1],on=u("");on[0];var rn=on[1],an=u(""),sn=an[0],ln=an[1],cn=u(!1),un=cn[0],dn=cn[1],vn=u(!1),mn=vn[0],hn=vn[1],pn=u(!0),gn=pn[0],fn=pn[1],Cn=u("100%");Cn[0];var yn=Cn[1],bn=u(null),Sn=bn[0],wn=bn[1],xn=u(!1);xn[0];var kn=xn[1],_n=u(!1),Tn=_n[0],En=_n[1],In=c(null),Mn=c(new Set),Rn=u(null),Dn=Rn[0],Nn=Rn[1],Fn=u(!1),An=Fn[0],Ln=Fn[1],Wn=u(!1);Wn[0],Wn[1];var qn=u(null);qn[0],qn[1],c(null),c(null);var zn=c(new Map),Pn=c(""),jn=c(new Map),Bn=c(!1),Hn=c(0),On=c(null),Un=c(null),Gn=u(!1),Zn=Gn[0],Kn=Gn[1];p(P||(P=e(["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "],["\n 0%, 80%, 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1.0);\n }\n "])));var Vn=d(function(){return""===(null==He?void 0:He.trim())||un},[He,un]),Qn=d(function(){return $},[$]),Jn=d(function(){var e;return Ge.length>0&&"user"===(null===(e=Ge[Ge.length-1])||void 0===e?void 0:e.role)},[Ge]),$n=d(function(){return Vn||$||!!Ee||Jn},[Vn,$,Ee,Jn]);v(function(){Re&&!He&&(Oe(Re),hn(!0),setTimeout(function(){if(je.current){je.current.focus();var e=Re.length;je.current.setSelectionRange(e,e)}},400))},[Re]),v(function(){null==we||we(un)},[un,we]),v(function(){return function(){On.current&&clearTimeout(On.current)}},[]),v(function(){var e=qe.current,n=function(){if(e){var n=e.scrollTop,t=e.scrollHeight,o=e.clientHeight;fn(t-n-o<=20)}};return e&&(e.addEventListener("scroll",n),n()),function(){e&&e.removeEventListener("scroll",n)}},[Ge]);var Xn=A({handlers:ee,setResult:ne}).processHeaderMessage;v(function(){he&&En(!0)},[he]),v(function(){if(An){var e=setTimeout(function(){Ln(!1)},3e3);return function(){return clearTimeout(e)}}},[An]),v(function(){Z&&!Ee&&(st(new KeyboardEvent("keydown",{key:"Enter"}),!1,"Save this Learning"),K(!1))},[Z]),v(function(){if(Q)try{if(Q.startsWith("__SKELETON__:")){var e=Q.split(":"),o=e[1],i=e.slice(2).join(":"),r={role:"user",content:"",id:o,time:new Date,isSkeleton:!0,skeletonContent:i};return Ze(function(e){return n(n([],e,!0),[r],!1)}),st(new KeyboardEvent("keydown",{key:"Enter"}),!1,i,!1,o),Nn(o),J&&J(""),void setTimeout(function(){Nn(null)},2e3)}if(Q.startsWith("__SKELETON_END__::")){var a=Q.split("::")[1]||"";return Ze(function(e){return e.map(function(e){return e.isSkeleton?t(t({},e),{isSkeleton:!1,content:e.skeletonContent||a}):e})}),void(J&&J(""))}var s=w();st(new KeyboardEvent("keydown",{key:"Enter"}),!1,Q,!1,s),Nn(s),J&&J(""),setTimeout(function(){return Nn(null)},2e3)}catch(e){console.error("Error handling sendMessageInChat signal",e)}},[Q]),v(function(){et(),nt();var e=function(){var e,n=(null===(e=null==In?void 0:In.current)||void 0===e?void 0:e.clientHeight)||0,t="calc(100% - ".concat(n,"px - 10px)");yn(t)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Yn=m(function(e){var n="string"==typeof e?e:"smooth";Pe.current&&Pe.current.scrollIntoView({behavior:n,block:"end"}),ze.current&&setTimeout(function(){Pe.current&&ze.current&&Pe.current.scrollIntoView({behavior:n,block:"end"})},100)},[]);v(function(){if(!un){var e="";if(Tn?e=pe||"Thank you teacher for teaching me, your rule has been saved successfully.":fe&&(e=ye||"I'm sorry, I couldn't save your changes. Please try again."),e){var t={role:"assistant",content:e,id:w(),citations:[],time:new Date};Ze(function(e){return n(n([],e,!0),[t],!1)}),En(!1),setTimeout(function(){return Yn("smooth")},100)}}},[Tn,fe,un,pe,ye,Yn]),v(function(){ze.current&&Yn("smooth")},[Yn]);var et=function(){var e={method:"get",maxBodyLength:1/0,url:"".concat(We,"/api/chatbot/getChatSettings?name=").concat(Fe,"&organizationName=").concat(H),headers:{}};S.request(e).then(function(e){var n,t,o;(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.chatSettings)&&""!==(null===(o=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.chatSettings)||void 0===o?void 0:o.chatInitialMessage)&&tn(!0)}).catch(function(e){console.error(e)})},nt=function(){return o(void 0,void 0,void 0,function(){var e,n;return i(this,function(t){e="".concat(We,"/api/chat/history?name=").concat(Fe,"&organizationName=").concat(H);try{n={method:"GET",params:{guestSessionId:Ae.current},withCredentials:!0},S.get(e,n).then(function(e){var n=e.data;n.length>0?(Ze(n),Yn()):tn(!0)}).catch(function(e){console.error(e)})}catch(e){Qe(!1),console.error(e)}return[2]})})},tt=function(){var e="".concat(We,"/api/chat/resetHistory?name=").concat(Fe,"&organizationName=").concat(H);try{var n={method:"GET",params:{guestSessionId:Ae.current},withCredentials:!0};S.get(e,n).then(function(){G(!0),rn(""),wn(null),Mn.current.clear(),jn.current.clear(),Le.current="".concat(w()),Ze([]),tn(!0),Un.current=null,null==te||te(),V&&V()}).catch(function(e){console.error(e)}).finally(function(){Ae.current="".concat(Fe,"-").concat(H,"-").concat(w())})}catch(e){Qe(!1),console.error(e)}};function ot(e){return null==e?void 0:e.replace(/<a [^>]*>.*?<\/a>/g,function(e){return null==e?void 0:e.replace(/\*/g,"*")})}var it=function(e,o,i,r,a,s,l){var c,u,d,v,m,h,p,g,f,C,y,b,S,x,k,_,T,E,I,M,R,D,N,F,A,L,W,q,z,P;if(null===(u=null===(c=null==e?void 0:e.chatStream)||void 0===c?void 0:c.continueChatResult)||void 0===u?void 0:u.header_message){var j={header_message:e.chatStream.continueChatResult.header_message,responsedata:null===(m=null===(v=null===(d=null==e?void 0:e.chatStream)||void 0===d?void 0:d.continueChatResult)||void 0===v?void 0:v.message)||void 0===m?void 0:m.content};Xn(j)}var B=null===(h=null==e?void 0:e.chatStream)||void 0===h?void 0:h.continueChatResult,H=null==B?void 0:B.isEnd,O=(null===(p=null==B?void 0:B.message)||void 0===p?void 0:p.citations)||[];H&&O.length>0&&ce&&ce(O);var U={role:"assistant",content:"",id:w()};if(null===(y=null===(C=null===(f=null===(g=null==e?void 0:e.chatStream)||void 0===g?void 0:g.continueChatResult)||void 0===f?void 0:f.message)||void 0===C?void 0:C.content)||void 0===y?void 0:y.includes("WaitMessage: "))$e(!0),U.content=function(e){var n="WaitMessage: ",t=e.indexOf(n);if(-1!==t){var o=e.substring(t+13);return null==o?void 0:o.replaceAll("WaitMessage: ","")}return""}((null===(x=null===(S=null===(b=null==e?void 0:e.chatStream)||void 0===b?void 0:b.continueChatResult)||void 0===S?void 0:S.message)||void 0===x?void 0:x.content)+"\n\n"),""!==U.content&&(Qe(!1),Ze(n(n([],Ge,!0),[{role:"user",content:a,time:r,isFirstQuestionSent:s||!1,id:l||(null===(_=null===(k=null==e?void 0:e.chatStream)||void 0===k?void 0:k.continueChatResult)||void 0===_?void 0:_.requestId)||"",reply:""},U],!1)));else{$e(!1);var G=null===(E=null===(T=null==e?void 0:e.chatStream)||void 0===T?void 0:T.continueChatResult)||void 0===E?void 0:E.requestId;"string"==typeof G&&G&&ve&&ve(G);var Z=function(e,o,i,r){var a,s,l,c,u,d,v,m={role:"assistant",content:"",id:w(),time:new Date,citations:[]},h=(null===(a=null==e?void 0:e.chatStream)||void 0===a?void 0:a.continueChatResult)||{},p=null==h?void 0:h.requestId,g=null==h?void 0:h.preserve_message,f=null==h?void 0:h.isEnd,C=(null===(s=null==h?void 0:h.message)||void 0===s?void 0:s.content)||"",y=null==h?void 0:h.is_orchestrator,b=null==h?void 0:h.thinking_break,S=(null===(l=null==h?void 0:h.message)||void 0===l?void 0:l.citations)||[];if(p&&g&&C&&!f){var x=r.current.get(p)||[];x[x.length-1]!==C&&(x.push(C),r.current.set(p,x))}var k=(p&&r.current.get(p)||[]).join("\n\n"),_="";if(f)_=k&&""!==k.trim()?k:C;else if(g)_=k;else{var T=C.replace(/<!--(?![\s\S]*-->)[\s\S]*$/,"").trimEnd(),E=!1===y||b||0!==S.length?"":T;_=k?"".concat(k,"\n\n").concat(E):E}if(m.content=ot(_),!0===(null==h?void 0:h.thinking_break)&&!0===(null==h?void 0:h.is_orchestrator)&&!1===(null==h?void 0:h.isEnd)&&o.push({responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!1}),!1===(null==h?void 0:h.thinking_break)&&!1===(null==h?void 0:h.is_orchestrator)&&!1===(null==h?void 0:h.isEnd)){if(h.explainability_id&&h.responded_by){var I=h.explainability_id,M=h.responded_by;i.has(I)||i.set(I,{responded_by:M,index:o.length})}i.has(h.explainability_id)?o[null==(R=i.get(h.explainability_id))?void 0:R.index]={responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!0,explainability_id:null!==(c=h.explainability_id)&&void 0!==c?c:"",isParallelToolResponse:!0}:o=n(n([],o,!0),[{responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!0,explainability_id:null!==(u=h.explainability_id)&&void 0!==u?u:"",isParallelToolResponse:!1}],!1)}if(!0===(null==h?void 0:h.thinking_break)&&!1===(null==h?void 0:h.is_orchestrator)&&!1===(null==h?void 0:h.isEnd)){var R;h.explainability_id&&h.responded_by&&(I=h.explainability_id,M=h.responded_by,i.has(I)||i.set(I,{responded_by:M,index:o.length})),i.has(h.explainability_id)?o[null==(R=i.get(h.explainability_id))?void 0:R.index]={responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!1,explainability_id:null!==(d=h.explainability_id)&&void 0!==d?d:"",isParallelToolResponse:!0}:o.push({responsedata:C,responseFrom:h.responded_by,header_message:h.header_message,finalResponseStatus:!1,explainability_id:null!==(v=h.explainability_id)&&void 0!==v?v:"",isParallelToolResponse:!1})}return t({orchestratorAndAgentsMessages:o},m)}(e,i,o,jn);Z.time=new Date,Z.citations=O,Z.isEnd=null===(M=null===(I=null==e?void 0:e.chatStream)||void 0===I?void 0:I.continueChatResult)||void 0===M?void 0:M.isEnd,Z.requestId=null===(D=null===(R=null==e?void 0:e.chatStream)||void 0===R?void 0:R.continueChatResult)||void 0===D?void 0:D.requestId,Z.sessionId=Ae.current,null===(N=Z.orchestratorAndAgentsMessages)||void 0===N||N.forEach(function(e){e&&e.header_message&&Xn(e)}),(""!==(null==Z?void 0:Z.content)||(null==Z?void 0:Z.orchestratorAndAgentsMessages)&&(null==Z?void 0:Z.orchestratorAndAgentsMessages.length)>0)&&(Qe(!1),Ze(n(n([],Ge,!0),[{role:"user",content:a||"",time:r,isFirstQuestionSent:s||!1,id:l||(null===(A=null===(F=null==e?void 0:e.chatStream)||void 0===F?void 0:F.continueChatResult)||void 0===A?void 0:A.requestId)||"",requestId:null!==(q=null===(W=null===(L=null==e?void 0:e.chatStream)||void 0===L?void 0:L.continueChatResult)||void 0===W?void 0:W.requestId)&&void 0!==q?q:""},Z],!1))),en(null===(P=null===(z=null==e?void 0:e.chatStream)||void 0===z?void 0:z.continueChatResult)||void 0===P?void 0:P.isEnd)}},rt=m(function(e){void 0===e&&(e="inactivity"),console.error("Stream failed or timed out due to: ".concat(e)),Bn.current=!1,en(!0),dn(!1),kn(!1),Qe(!1),$e(!1),Pn.current&&U&&(x(Pn.current,U,!1),jn.current.delete(Pn.current)),Ze(function(t){var o=n([],t,!0).reverse().find(function(e){return"user"===e.role}),i=((null==o?void 0:o.content)||"").replace(/"/g,"""),r=n([],t,!0),a=r[r.length-1];a&&"assistant"===a.role&&!a.isEnd&&r.pop();var s="I ran into an unexpected issue while trying to process this learning.";return"inactivity"===e?s="Something went wrong—teaching is taking longer than expected.":"websocket_error"===e&&(s="I lost connection to the server while working on that."),n(n([],r,!0),[{role:"assistant",content:"".concat(s,' Please try again.\n\n<button class="clickable-button" data-value="').concat(i,'">Retry</button>'),id:w(),time:new Date,isEnd:!0,citations:[]}],!1)})},[Ie,U]),at=m(function(){On.current&&(clearTimeout(On.current),On.current=null),Ie&&Ie>0&&(On.current=setTimeout(function(){return rt("inactivity")},Ie))},[rt,Ie]),st=function(e,r,a,s,l,c){return o(void 0,void 0,void 0,function(){var o,s,u,d,v,m,h,p,g,f,C,y,b,S,x,_;return i(this,function(i){switch(i.label){case 0:if(o=(void 0!==a?a:He||"").trim(),(s="Enter"===(null==e?void 0:e.key)&&!(null==e?void 0:e.shiftKey)&&!Ee)&&(null===(C=null==e?void 0:e.preventDefault)||void 0===C||C.call(e)),u="user"===(null===(y=Ge[Ge.length-1])||void 0===y?void 0:y.role),!o||un||Bn.current||u||(null==e?void 0:e.key)&&!s)return[2];if(Un.current||(Un.current=(new Date).toISOString(),console.log("Session start time set to ".concat(Un.current))),!De)return[3,5];Qe(!0),ln("Validating session..."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,De(Un.current)];case 2:return i.sent()?[3,4]:(Kn(!0),Qe(!1),c&&c(!1),[2]);case 3:return d=i.sent(),console.error("Validation error:",d),Kn(!0),Qe(!1),c&&c(!1),[2];case 4:Qe(!1),i.label=5;case 5:return Bn.current=!0,"I want to add a rule description"===o?(en(!1),ze.current=!0,dn(!0),!Sn&&o&&wn(a||"manual_entry"),v=new Date,Ze(function(e){return n(n([],e.map(function(e,n){var o;return t(t({},e),{content:null===(o=ot(e.content))||void 0===o?void 0:o.replace("WaitMessage: ","")})}),!0),[{role:"user",content:o,time:v,isFirstQuestionSent:!1,id:l||w()}],!1)}),Yn("smooth"),setTimeout(function(){Ze(function(e){return n(n([],e,!0),[{role:"assistant",content:"I'd be happy to help you set up a new rule! To get started, could you tell me what kind of behavior or logic you would like this rule to follow?",id:w(),citations:[],time:new Date}],!1)}),Yn("smooth"),setTimeout(function(){dn(!1),en(!0)},500)},500),[2]):(en(!1),ze.current=!0,dn(!0),!Sn&&o&&wn(a||"manual_entry"),m=new Date,Ze(function(e){var i=e.map(function(e){var n;return t(t({},e),{content:null===(n=ot(e.content))||void 0===n?void 0:n.replace("WaitMessage: ","")})});return l&&i.some(function(e){return e.id===l})?i.map(function(e){return e.id===l?t(t({},e),{content:o}):e}):n(n([],i,!0),[{role:"user",content:o,time:m,isFirstQuestionSent:!1,id:l||w()}],!1)}),Yn("smooth"),h=new Map,p=[],g=function(e){var n;if(!e)return{};var t=Object.keys(e);return 1===t.length&&"current"===t[0]?null!==(n=e.current)&&void 0!==n?n:{}:e},f={WEBSOCKET_URL:U,organizationName:H,chatAssistantName:Fe,selectedAIModel:"gpt-4",replyMessage:"",userName:null!==(b=null==Te?void 0:Te.name)&&void 0!==b?b:"Guest User",userEmailId:null!==(S=null==Te?void 0:Te.email)&&void 0!==S?S:"guestUser@example.com",userId:null!==(x=null==Te?void 0:Te.id)&&void 0!==x?x:"Guest User",query:o,requestId:"requestId-".concat(w()),customPrompt:"",enableForBackend:!1,guestSessionId:Ae.current,chatPreviewId:Le.current,customMetaData:g(Y),aiModel:"",enableLogs:!0,onStreamEvent:function(e){var n,t,i,a,s,c,u=null===(t=null===(n=null==e?void 0:e.chatStream)||void 0===n?void 0:n.continueChatResult)||void 0===t?void 0:t.requestId,d=null===(a=null===(i=null==e?void 0:e.chatStream)||void 0===i?void 0:i.continueChatResult)||void 0===a?void 0:a.header_message;console.log("📦 [Stream Chunk Received] With RequestID and header_message: ".concat(u,",").concat(d)),at();var v=null===(c=null===(s=null==e?void 0:e.chatStream)||void 0===s?void 0:s.continueChatResult)||void 0===c?void 0:c.error_state;if(Array.isArray(v)&&v.length>0)return console.error("Agent returned an error_state during stream:",v),void rt("agent_error");it(e,h,p,m,o,r,l)},onStreamEnd:function(e){var o,i,r=null===(i=null===(o=null==e?void 0:e.chatStream)||void 0===o?void 0:o.continueChatResult)||void 0===i?void 0:i.requestId;console.log("✅ [Stream Completed] RequestID: ".concat(r)),On.current&&clearTimeout(On.current),Bn.current=!1,en(!0),dn(!1),kn(!1);var a=Date.now(),s=zn.current.get(Pn.current);if(s){var l=Math.round((a-s)/1e3).toFixed(1);Ze(function(e){var o=n([],e,!0).reverse().findIndex(function(e){return"assistant"===e.role});if(-1===o)return e;var i=e.length-1-o;return e.map(function(e,n){return n===i?t(t({},e),{finalTimeTaken:l}):e})})}},onError:function(e){On.current&&clearTimeout(On.current),console.error("Stream error:",e),rt("websocket_error")}},o&&(Qe(!0),null===(_=je.current)||void 0===_||_.blur(),Oe(""),Yn(),ln(l?"Just a moment, processing your request...":"Okay, got it. Let me take a moment to work on this and I'll get back to you shortly."),zn.current.set(f.requestId,Date.now()),Pn.current=f.requestId,at(),Hn.current+=1,console.log("🚀 [UI Action] stream started (Total UI invocations: ".concat(Hn.current,") | RequestID: ").concat(f.requestId,' | Query: "').concat(o,'"')),k(f)),c&&c(!1),[2])}})})},lt=c(null);h(function(){lt.current=st});var ct=m(function(){for(var e,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return null===(e=lt.current)||void 0===e?void 0:e.call.apply(e,n([lt],t,!1))},[]),ut=d(function(){return{p:function(e){e.node;var n=e.children;return r(e,["node","children"]),a("div",t({style:{margin:0,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",fontFamily:"inherit"}},{children:n}))},button:function(e){e.node;var n=e.className,o=e.children,i=r(e,["node","className","children"]),l=L(o),c=i["data-value"],u="Tester Genie"===l;return a(M,t({},i,{className:n,handleStream:ct,isStreamEnd:Ye,disabled:!!Sn||!!Ee,isLastMessage:!0,style:{margin:0},isTesterGenie:u,"data-selected":Sn===l||Sn===c?"true":Sn?"false":void 0},{children:s("span",t({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[o,u&&s("svg",t({width:"16",height:"20",viewBox:"0 0 16 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[a("path",{d:"M7.20368 8.94768e-06C7.48895 -0.00208639 7.69331 0.364327 7.83856 0.57465C8.14381 1.01633 8.38012 1.87909 7.71077 2.14118C8.57167 2.21011 9.70406 2.93098 10.1785 3.64699C10.5932 4.27286 10.4559 5.16037 9.80301 5.56007L9.9502 7.16593C9.97671 7.44871 10.0265 7.87092 10.0299 8.14457C10.4213 8.23046 11.0787 8.55391 11.326 8.87592C11.5979 8.75656 11.9189 8.76963 12.1688 8.93469C12.3563 8.67751 12.5598 8.41456 12.7507 8.15787C12.3283 7.45155 12.5047 6.57745 13.2143 6.13784C13.5375 5.9377 13.9264 5.87277 14.2971 5.95705C14.0961 6.30964 13.8775 6.72182 13.6593 7.05857C13.7906 7.2436 13.9184 7.44225 14.044 7.63194L14.8022 7.63198C15.0349 7.30106 15.2515 6.90827 15.4835 6.59349C15.8623 7.0712 15.8156 7.79671 15.4734 8.28241C15.1318 8.76741 14.4886 8.9899 13.9118 8.88251C13.758 9.12108 13.5577 9.39243 13.3941 9.63201C13.7143 9.9316 13.7725 10.364 13.4067 10.6594C13.5231 10.8889 13.5309 11.1613 13.447 11.402C13.1502 12.2523 12.1724 12.5645 11.3474 12.5025C11.1171 12.4852 10.939 12.4698 10.7197 12.3953C10.8724 13.1271 10.7744 14.2031 10.5132 14.9051C10.1688 15.8304 9.43632 16.5569 8.54503 16.9655C7.90465 17.2706 7.21222 17.3607 6.50472 17.4505C5.74445 17.5471 4.75801 17.4362 4.08533 17.825C3.9327 17.9132 3.86566 18.0173 3.82943 18.1792C3.94996 18.5982 4.47858 18.6063 4.78474 18.8897C5.20191 19.2758 4.90716 19.9663 4.36611 19.9908C4.31476 19.9931 4.26867 19.9867 4.23186 19.9493C4.23089 19.8303 4.47587 19.7199 4.49787 19.5262C4.55075 19.0604 3.70014 19.0078 3.37835 18.8374C3.13013 18.706 2.99537 18.6309 2.82242 18.4021C2.63795 18.1579 2.58428 17.835 2.63138 17.5392C2.74868 16.7847 3.47123 16.393 4.12184 16.1497C4.61314 15.9659 5.46304 15.7158 5.52019 15.0793C5.58589 14.348 4.97543 13.5523 4.57739 12.9807C4.44275 12.7875 4.3039 12.579 4.16309 12.3919C4.18987 12.365 4.21049 12.3463 4.23916 12.3212C4.59619 12.6218 5.21209 12.6421 5.55038 12.2979C5.70457 12.144 5.78974 11.9342 5.78642 11.7164C5.78121 11.4493 5.63382 11.2002 5.4454 11.019C5.44704 10.9932 5.44824 10.9676 5.449 10.9419C5.4566 10.6648 5.37505 10.4902 5.1892 10.2943C5.18398 10.2538 5.17776 10.2134 5.17053 10.1732C5.08123 9.69297 4.71708 9.34182 4.23415 9.27108C4.16418 9.26083 3.96108 9.26105 3.92071 9.23344C3.90485 9.1828 3.9059 9.20792 3.91904 9.15527C4.22103 8.90139 4.14407 8.78214 4.31107 8.4846C4.42301 8.28513 4.73047 8.15239 4.95452 8.10701C4.96167 7.51076 5.03684 6.88562 5.10036 6.29144C5.12451 6.0655 5.12531 5.75046 5.1511 5.55257C4.11108 4.86747 4.39091 3.75946 5.25465 3.06391C5.84978 2.58469 6.34496 2.31002 7.10143 2.14517C7.01589 2.10416 6.93842 2.04811 6.87269 1.97972C6.77021 1.87349 6.70248 1.73857 6.67853 1.59293C6.60568 1.12096 7.04104 0.914625 7.18759 0.526392C7.26428 0.323403 7.03925 0.146075 7.20368 8.94768e-06Z",fill:"#475569"}),a("path",{d:"M7.459 4.5C7.48797 4.50312 7.71949 4.61154 7.76205 4.63061C8.27062 4.85835 8.87051 5.09164 9.35658 5.3582C9.36602 6.03495 9.37016 6.56625 8.70573 6.91519C8.6633 6.80883 8.63019 6.72409 8.56332 6.63044C8.43786 6.45568 8.24656 6.33963 8.03354 6.30909C7.8434 6.28211 7.65146 6.3197 7.49586 6.43503C7.21897 6.21256 6.76265 6.28197 6.5229 6.52486C6.39308 6.65639 6.34815 6.75074 6.28902 6.92344C5.59702 6.5957 5.58761 6.04267 5.60583 5.35582C5.89882 5.23844 6.21318 5.0724 6.50153 4.941C6.82145 4.79522 7.14482 4.6574 7.459 4.5Z",fill:"#D1EDFD"}),a("path",{d:"M11.0756 10.6406C11.1037 10.6701 11.1324 10.7706 11.1535 10.8145C11.2818 11.0817 11.4922 11.1945 11.7498 11.2977C11.5607 11.63 11.4567 11.8797 11.1034 12.0466L11.0839 12.0517C10.9262 12.0927 10.7996 12.0968 10.651 12.0135C10.4755 11.915 10.3807 11.6614 10.4792 11.478C10.6388 11.1809 10.8877 10.9272 11.0756 10.6406Z",fill:"#D1EDFD"}),a("path",{d:"M11.6036 9.1377C11.6993 9.11763 11.8391 9.16378 11.9294 9.19593C11.6952 9.50644 11.4706 9.81614 11.2327 10.1261L11.1572 10.2255C10.7581 9.73539 11.0333 9.24481 11.6036 9.1377Z",fill:"#D1EDFD"}),a("path",{d:"M7.49681 0.882812C7.53691 0.925159 7.61244 1.08523 7.63598 1.14156C7.74243 1.39673 7.75769 1.76908 7.38596 1.77504C7.28236 1.75599 7.15628 1.68938 7.13517 1.5783C7.0843 1.3107 7.35609 1.09964 7.48737 0.897583L7.49681 0.882812Z",fill:"#D1EDFD"}),a("path",{d:"M1.68305 6.17249C1.71659 6.1673 1.8134 6.16478 1.84892 6.16432C2.34052 6.15616 2.81496 6.34495 3.16655 6.68866C3.50847 7.01806 3.70349 7.47119 3.70765 7.94596C3.70896 8.42345 3.54045 8.85284 3.20281 9.19025C3.34033 9.28068 3.5321 9.52219 3.6543 9.65748C4.17158 9.39073 4.91447 9.69339 4.79675 10.3444C5.08751 10.5485 5.19656 10.8288 5.0585 11.1674C5.15418 11.2375 5.25595 11.3205 5.32383 11.4186C5.40228 11.5303 5.4309 11.6695 5.40291 11.8031C5.32228 12.1857 4.90085 12.3286 4.57669 12.1236C4.51367 12.0838 4.42258 11.9595 4.35299 11.9431C4.30669 11.9557 4.28453 11.9584 4.23644 11.9644C4.22885 11.9742 4.22118 11.9841 4.21343 11.9938C3.93597 12.3413 3.49234 12.4682 3.06933 12.5157C2.85285 12.518 2.70432 12.5146 2.49066 12.4609C1.80785 12.2892 1.50808 11.6167 1.70723 10.9639C1.829 10.5648 2.11891 10.2506 2.48939 10.0518C2.54655 10.132 2.57559 10.2191 2.64066 10.303C2.73571 10.2223 2.82048 10.1482 2.92363 10.0773C2.81023 9.95313 2.66811 9.7693 2.55817 9.63584C2.38871 9.6878 2.23026 9.72879 2.05298 9.74653C1.54239 9.80228 1.03118 9.64711 0.637735 9.31695C0.269964 9.01018 0.0453493 8.54827 0.00544736 8.07322C-0.0309495 7.60988 0.116099 7.15077 0.414918 6.79478C0.742554 6.41198 1.18728 6.21393 1.68305 6.17249Z",fill:"#475569"}),a("path",{d:"M1.79616 6.5951C2.54894 6.5619 3.18687 7.14364 3.22301 7.8963C3.25915 8.64894 2.67989 9.28913 1.92739 9.3282C1.17073 9.3675 0.526231 8.78435 0.489885 8.02753C0.45354 7.27071 1.03921 6.62849 1.79616 6.5951Z",fill:"#D1EDFD"}),a("path",{d:"M4.93607 11.4844C5.12839 11.6261 5.22049 11.9085 4.91876 11.9419C4.8067 11.8805 4.78491 11.8646 4.71094 11.7561C4.81572 11.6752 4.862 11.5925 4.93607 11.4844Z",fill:"#FEFEFD"}),a("path",{d:"M12.5164 3.58594L12.5715 3.59466C12.6589 3.65863 12.6908 3.94434 12.7882 4.05193C12.8789 4.15216 12.9155 4.17816 13.0326 4.24929C13.1363 4.31224 13.3325 4.34025 13.384 4.43124C13.3643 4.56218 13.0693 4.54857 12.9127 4.69344C12.6903 4.89898 12.7114 5.06971 12.5892 5.28622C12.5669 5.28439 12.5368 5.2868 12.5261 5.27346C12.4336 5.15843 12.4072 4.9308 12.3099 4.81465C12.1627 4.63903 11.9972 4.60054 11.7981 4.51372C11.7544 4.49467 11.7266 4.47099 11.7129 4.42649C11.7867 4.31876 12.0509 4.34309 12.2376 4.14892C12.43 3.94901 12.4155 3.72208 12.5164 3.58594Z",fill:"#475569"}),a("path",{d:"M2.13644 3.72656C2.24401 3.77084 2.29712 4.1268 2.431 4.25226C2.60327 4.41371 2.7311 4.41949 2.93246 4.52449C2.96024 4.53897 2.97173 4.56042 2.97671 4.58878C2.89584 4.6981 2.61854 4.70721 2.4596 4.85659C2.26275 5.04156 2.27341 5.29132 2.17022 5.42088C2.16192 5.41849 2.11671 5.40232 2.1156 5.40043C2.01291 5.21216 1.9836 5.04909 1.84812 4.87273C1.73599 4.72675 1.36534 4.69959 1.32812 4.56939C1.3835 4.47941 1.67823 4.44211 1.82291 4.30563C2.02737 4.11274 2.0042 3.8372 2.13644 3.72656Z",fill:"#475569"})]}))]}))}))}}},[ct,Ye,Sn,Ee]),dt=d(function(){return Ge.some(function(e){return e.isSkeleton})},[Ge]),vt=function(e){return o(void 0,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return _e?[4,_e(e)]:[3,2];case 1:t.sent(),Ze(function(e){return n(n([],e,!0),[{role:"assistant",content:"Thanks for your feedback — this will help improve future suggestions.",id:w(),citations:[],time:new Date,isEnd:!0}],!1)}),setTimeout(function(){return Yn("smooth")},100),t.label=2;case 2:return[2]}})})};return s("div",t({className:"".concat(N.customFont," ").concat(D.chatContainer),style:{transition:"box-shadow 0.3s ease-in-out",boxShadow:Se&&!dt?"0 0 20px 5px rgba(37, 99, 235, 0.5)":"none"}},{children:[s("div",t({ref:qe,className:D.scrollWrapper},{children:[a("div",t({ref:In,className:D.stickyHeader},{children:a(T,{resetChatHistory:tt,isStreamEnd:Ye,chatTitle:X,onResize:se,chatSize:ae,movingTowards:le})})),s("div",t({className:D.messagesList},{children:[s("div",t({className:D.initialMessageRow},{children:[a("div",t({className:D.iconWrapper},{children:a(q,{})})),a("div",t({className:D.welcomeTextWrapper},{children:a("div",t({className:D.welcomeMarkdownWrapper},{children:a("span",{children:a(y,t({rehypePlugins:[b],components:ut},{children:ie}))})}))}))]})),Ge.length>0&&Ge.map(function(e,n){var o,i;return s("div",t({className:D.messageRow},{children:["assistant"===e.role?a("div",t({className:D.assistantIconContainer},{children:a(q,{})})):a("div",{className:D.userSpacer}),a("div",t({className:D.messageContent},{children:"assistant"===e.role?s(l,{children:[e.orchestratorAndAgentsMessages&&e.orchestratorAndAgentsMessages.length>0&&a(_,{orchestratorAndAgentsMessages:null==e?void 0:e.orchestratorAndAgentsMessages,isStreamEnd:Ye,finalTimeTaken:null==e?void 0:e.finalTimeTaken},null!==(o=null==e?void 0:e.finalTimeTaken)&&void 0!==o?o:null==e?void 0:e.id),a(E,{index:n,content:null==e?void 0:e.content,role:null==e?void 0:e.role,messages:Ge,handleStream:st,isLastMessage:n===Ge.length-1,onSave:re,citations:null==e?void 0:e.citations,setChatSize:se,chatSize:ae,isStreamEnd:Ye,messageIsEnd:null==e?void 0:e.isEnd,onViewComparison:xe,onTypeResponseClick:function(){var e;Ln(!0),null===(e=je.current)||void 0===e||e.focus()},onComparisonLinkClick:ke,baseURL:We,onFeedbackSubmit:vt,isGlobalEditActive:Ee}),e.hasOwnProperty("isEnd")&&!(null==e?void 0:e.isEnd)&&(null===(i=null==e?void 0:e.content)||void 0===i?void 0:i.length)>0&&s(l,{children:[a(I,{variant:"text",width:"50%",height:20}),a("div",{style:{marginTop:"10px"}}),a(I,{variant:"text",width:"100%",height:40})]}),a("div",t({className:D.timestamp},{children:e.time&&!isNaN(new Date(e.time).getTime())?new Date(e.time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):(new Date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}))]}):s("div",t({className:D.userMessageWrapper},{children:[s("div",t({className:D.userMessageBubble,style:{transition:"box-shadow 0.3s ease-in-out",boxShadow:e.isSkeleton||dt||e.id!==Dn?"none":"0 0 15px 3px rgba(37, 99, 235, 0.6)"}},{children:[e.isSkeleton?s("div",t({style:{display:"flex",flexDirection:"column",gap:"12px",minWidth:"280px",padding:"8px 0"}},{children:[a(I,{variant:"text",width:"100%",height:16}),a(I,{variant:"text",width:"80%",height:16})]})):a(E,{index:n,content:null==e?void 0:e.content,role:null==e?void 0:e.role,messages:Ge,handleStream:st,isLastMessage:n===Ge.length-1,onSave:re,citations:null==e?void 0:e.citations,isStreamEnd:Ye,isGlobalEditActive:Ee,messageIsEnd:null==e?void 0:e.isEnd,onViewComparison:xe,onComparisonLinkClick:ke,baseURL:We,onFeedbackSubmit:vt}),a("div",t({style:{marginTop:"0.5rem"}},{children:a(z,{})}))]})),a("div",t({className:D.userTimestamp},{children:new Date(e.time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}))]}))}))]}),e.id)}),Ve&&s("div",t({className:D.loadingRow},{children:[a("div",t({className:D.iconWrapper,style:{marginTop:"0.2rem"}},{children:a(q,{})})),a("div",t({className:D.loadingTextWrapper},{children:a("span",{children:sn})}))]})),a("div",{ref:Pe,style:{float:"left",clear:"both"}})]}))]})),a("div",t({className:D.inputAreaWrapper},{children:a(C,t({title:$?"Please wait for the validation to be completed.":""},{children:s("div",t({className:"".concat(D.inputBoxContainer," ").concat(Qn?D.disabled:""),style:An?{boxShadow:"0 0 15px 3px rgba(37, 99, 235, 0.5)",borderColor:"#2563eb",transition:"box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out"}:{transition:"box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out"}},{children:[Ge.length>0&&!gn&&a("div",t({onMouseDown:function(e){e.preventDefault(),Yn("smooth")},className:D.scrollToBottomBtn},{children:a(F,{})})),s("div",t({style:{width:"100%",display:"flex"}},{children:[a("textarea",{ref:je,placeholder:de,value:He||"",onChange:function(e){Oe(e.target.value)},onFocus:function(){return hn(!0)},onBlur:function(){return hn(!1)},onKeyDown:function(e){return st(e)},disabled:Qn,className:"no-scrollbar ".concat(D.chatTextarea),style:{minHeight:mn||He&&He.length>40?"120px":"50px",height:mn||He&&He.length>40?"120px":"50px",maxHeight:"120px"}}),a("span",t({className:D.sendButtonWrapper},{children:a("button",t({onClick:function(e){$n||st(new KeyboardEvent("keydown",{key:"Enter"}))},disabled:$n,className:"".concat(D.sendButton," ").concat($n?D.disabled:D.active)},{children:a(W,{})}))}))]}))]}))}))})),s("div",t({className:D.footerTools},{children:[a(C,t({title:"Coming soon",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:a("span",t({className:D.footerToolItem},{children:a(R,{amplitude:1,variant:"speaker",isActive:!1,onClick:function(){return null},disabled:!1})}))})),a(C,t({title:"Coming soon",placement:"top",arrow:!0,componentsProps:{tooltip:{sx:{fontSize:"0.875rem",padding:"0.5rem",fontFamily:"Plus Jakarta Sans, sans-serif"}}}},{children:a("span",t({className:D.footerToolItem},{children:a(R,{amplitude:1,variant:"microphone",isActive:!1,onClick:function(){return null},disabled:!1})}))}))]})),a(g,t({open:Zn,onClose:function(){},PaperProps:{sx:{borderRadius:"12px",padding:"8px",maxWidth:"400px"}}},{children:s(f,t({sx:{p:3,textAlign:"center",fontFamily:"'Plus Jakarta Sans', sans-serif"}},{children:[a("h3",t({style:{fontSize:"18px",fontWeight:600,color:"#0F172A",marginBottom:"10px"}},{children:"Session Expired"})),a("p",t({style:{fontSize:"14px",color:"#64748B",lineHeight:"1.5",marginBottom:"20px"}},{children:"Changes were made to the learnings in this scope while you were editing. To avoid conflicts, concurrent edits aren’t allowed."})),s(f,t({sx:{display:"flex",gap:2,justifyContent:"center"}},{children:[a("button",t({onClick:function(){Kn(!1),tt()},style:{flex:1,padding:"10px 16px",cursor:"pointer",backgroundColor:"white",border:"1px solid #E2E8F0",borderRadius:"8px",fontSize:"14px",fontWeight:500,color:"#475569",transition:"all 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="white"}},{children:"Reset Session"})),a("button",t({onClick:function(){Kn(!1),null==Ne||Ne()},style:{flex:1,padding:"10px 16px",backgroundColor:"#EF4444",color:"white",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:500,cursor:"pointer",transition:"background-color 0.2s"},onMouseOver:function(e){return e.currentTarget.style.backgroundColor="#DC2626"},onMouseOut:function(e){return e.currentTarget.style.backgroundColor="#EF4444"}},{children:"Discard & Close"}))]}))]}))}))]}))};export{j as autoGeneratePrompt,B as default};
|
|
2
2
|
//# sourceMappingURL=ChatComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as n,__rest as t}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import o,{useState as l,useRef as a,useEffect as s,useMemo as d}from"react";import{Box as c,Typography as p,IconButton as h,Skeleton as g}from"@mui/material";import{ArrowLeft as u,ArrowRight as x}from"lucide-react";import f from"../../_svg/SparkleIcon.js";import{CognitiveDecisioningCard as m}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as b}from"../../_svg/ButtonCognitiveIcon.js";var v=function(e,n){if(!n)return null;var t=new RegExp("<".concat(e,"[^>]*>([\\s\\S]*?)<\\/").concat(e,">"),"i"),i=n.match(t);return i?i[1].replace(/\\n/g,"\n"):null},y=function(e,n,t){var i=100*e;if(!t)return{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:"Not Defined"};var r=function(e){return e.split("_").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(" ")}(n);return i>=70?{bg:"#FEF2F2",border:"#FEE2E2",badgeBg:"#FEF2F2",badgeBorder:"#FECACA",badgeText:"#B91C1C",highlightBg:"#FECACA",label:r}:i>=40?{bg:"#FFFCF6",border:"#FFDD80",badgeBg:"#FEF9C3",badgeBorder:"#FEF08A",badgeText:"#A16207",highlightBg:"#FDDEB3",label:r}:{bg:"#FFFFFF",border:"#E2E8F0",badgeBg:"#F1F5F9",badgeBorder:"#CBD5E1",badgeText:"#64748B",highlightBg:"transparent",label:r}},w=o.forwardRef(function(n,t){var o=n.label,l=n.content,a=n.highlights,s=void 0===a?[]:a,d=n.styleVariant,h=n.isHighlighted,g=void 0!==h&&h,u=Array.isArray(l)?l.join("\n"):l||"",x="#B91C1C"===d.badgeText?{borderColor:"#EF4444",shadow:"rgba(239, 68, 68, 0.25)"}:"#A16207"===d.badgeText?{borderColor:"#F59E0B",shadow:"rgba(245, 158, 11, 0.25)"}:{borderColor:"#6366F1",shadow:"rgba(99, 102, 241, 0.25)"};return i(c,e({sx:{mb:1.5}},{children:[r(p,e({sx:{fontSize:"12px",color:"#19213D",mb:.5,fontWeight:500,lineHeight:"130%"}},{children:o})),r(c,e({ref:t,sx:{p:"4px 12px",borderRadius:"6px",border:g?"1.5px solid ".concat(x.borderColor):"1px solid ".concat(d.border),boxShadow:g?"0px 0px 0px 2px ".concat(x.shadow):"none",bgcolor:d.bg,fontSize:"13px",color:"#0B0E1A",lineHeight:1.4,minHeight:"24px",display:"flex",alignItems:"center",whiteSpace:"pre-line",wordBreak:"break-word"}},{children:r(c,{children:function(){if(!u)return r(p,e({sx:{color:"#94A3B8",fontSize:"12px",fontStyle:"italic"}},{children:"Not Defined"}));if(!s||0===s.length)return u;var n=s.filter(function(e){return e&&e.length>0}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(0===n.length)return u;var t=new RegExp("(".concat(n.join("|"),")"),"gi");return u.split(t).map(function(n,t){return s.some(function(e){return e&&e.toLowerCase()===n.toLowerCase()})?r(c,e({component:"span",sx:{bgcolor:d.highlightBg,borderRadius:"2px",px:"2px"}},{children:n}),t):n})}()})}))]}))}),F=function(n){var t=n.data,o=n.isSelected,l=n.isCognitiveOpen,a=n.onToggleCognitive,s=n.onClick,d=t.summaryText||t.description||"",h=d.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),u=h?d.replace(h[0],"").trim():d,x=!!h;return i(c,e({id:"variant-card-".concat(t.id),onClick:s,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":null,boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[r(c,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?r(g,{variant:"rounded",width:80,height:20}):i(c,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1"}},{children:[void 0!==t.similarity?t.similarity:0,"% Similarity"]}))})),i(c,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[r(p,e({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&r(c,e({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]})),t.isLoading?i(c,{children:[r(g,{width:"90%"}),r(g,{width:"60%"})]}):i(c,e({title:u,sx:{display:"flex",flexDirection:"column",gap:.5}},{children:[r(p,e({sx:{fontWeight:400,fontSize:"13px",color:"#666F8D",lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"}},{children:u})),x&&i(c,e({onClick:function(e){e.stopPropagation(),o||s(),a()},sx:{display:"inline-flex",alignItems:"center",alignSelf:"flex-start",gap:"4px",padding:"2px 6px",borderRadius:"4px",cursor:"pointer",transition:"all 0.2s ease",marginLeft:"-4px","&:hover":{backgroundColor:"#F1F5F9"}}},{children:[r("div",e({style:{width:"13px",height:"13px",display:"flex",alignItems:"center"}},{children:r(b,{})})),r("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:o&&l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:r("path",{d:"M6 9l6 6 6-6"})}))]}))]}))]}))]}))},_=function(o){var g,_,C=o.proposedRule,B=o.variants,E=void 0===B?[]:B,k=o.onSelectVariant;o.onAddAsVariant;var S=o.onSkip,A=o.onBack,L=o.targetVariantId,D=o.highlightedField,W=l(L||null),z=W[0],T=W[1],I=l(!1),R=I[0],j=I[1],H=l(null),O=H[0],M=H[1],V=a(null),N=a(null);s(function(){if(L&&T(L),M(null!=D?D:null),D){var e=setTimeout(function(){return M(null)},6e3);return function(){return clearTimeout(e)}}},[L,D]);var U=function(e){V.current&&V.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},P=d(function(){return n([],E,!0).sort(function(e,n){return(n.similarity||0)-(e.similarity||0)})},[E]),Y=d(function(){if(z){var e=String(z).trim();return E.find(function(n){return n.id&&String(n.id).trim()===e})||P[0]}return P.length>0?P[0]:null},[z,E,P]);s(function(){if(z&&V.current){var e=z.trim();setTimeout(function(){var n=document.getElementById("variant-card-".concat(e)),t=V.current;if(n&&t){var i=n.offsetLeft-t.offsetLeft-t.clientWidth/2+n.clientWidth/2;t.scrollTo({left:i,behavior:"smooth"})}},150)}},[z,P]);var $=Y||{title:"",scope:"",description:"",wta:"",wnta:"",variantType:"Default"},q=null==Y?void 0:Y.analysis,J=(null===(_=null===(g=null==q?void 0:q.rule_difference_comparison)||void 0===g?void 0:g.summary)||void 0===_?void 0:_.overall_summary)||"",X=J.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),G=!!X,K=X?X[1]:"",Q=v("reason",K)||"",Z=v("gap",K)||"",ee=v("relevance_score",K)||"",ne=d(function(){return{ul:function(n){n.node;var i=t(n,["node"]);return r("ol",e({},i,{style:{paddingLeft:"1.25rem",listStyleType:"decimal",margin:0}}))},li:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},ol:function(n){n.node;var i=t(n,["node"]);return r("li",e({},i,{style:{marginBottom:"4px",listStyleType:"decimal"}},{children:i.children}))},a:function(n){var o=n.href,l=n.children,a=t(n,["href","children"]);if(!o)return r("a",e({},a,{children:l}));var s=o||"";try{s=decodeURIComponent(o)}catch(e){console.error("Error decoding href",e)}if(s.includes("variant_id=")){var d="",c="",p=s.match(/variant_id=([^?&]+)/);p&&(d=p[1]);var h=s.match(/field_name=([^&]+)/);return h&&(c=h[1]),i("button",e({type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),T(d),M(c),setTimeout(function(){return M(null)},6e3)},style:{background:"none",border:"none",outline:"none",borderRadius:"6px",padding:"1px 4px",color:"#0F172A",cursor:"pointer",fontSize:"13px",fontWeight:500,display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 1px",verticalAlign:"baseline",textDecoration:"none",boxShadow:"none",WebkitAppearance:"none",MozAppearance:"none"},title:"View Comparison"},{children:[l,r("svg",e({width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M10.2082 8.67708H2.0415M2.0415 8.67708L4.08317 6.63542M2.0415 8.67708L4.08317 10.7188M2.0415 3.57292H10.2082M10.2082 3.57292L8.1665 1.53125M10.2082 3.57292L8.1665 5.61458",stroke:"#0F172A",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}))]}))}return r("a",e({href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"#7C3AED"}},a,{children:l}))}}},[]);s(function(){!z&&!L&&P.length>0&&!P[0].isLoading&&T(P[0].id)},[P,z,L]);var te=a(null),ie=l([]),re=ie[0],oe=ie[1],le=l(!1),ae=le[0],se=le[1],de=l(!1),ce=de[0],pe=de[1];s(function(){var e=V.current;if(e){var n=function(){se(e.scrollLeft>0),pe(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return n(),e.addEventListener("scroll",n),window.addEventListener("resize",n),function(){e.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}},[P]);var he={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)},ge={title:a(null),scope:a(null),description:a(null),wta:a(null),wnta:a(null)};s(function(){if(O){var e="when_to_apply"===O?"wta":"when_not_to_apply"===O?"wnta":O,n=he[e]||ge[e];n&&n.current&&setTimeout(function(){n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}},[O]);var ue=function(e){var n,t,i,r,o,l=null===(n=null==q?void 0:q.rule_difference_comparison)||void 0===n?void 0:n.fields,a="when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e,s=!(!C[a]&&!$[a]);if(!l||!l[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=l[e];if(d.mappings){var c=d.mappings[0]||{};return{score:d.score,relation:c.relation||"",highlightsA:(null===(t=c.highlights)||void 0===t?void 0:t.ruleA_spans)||[],highlightsB:(null===(i=c.highlights)||void 0===i?void 0:i.ruleB_spans)||[],hasContent:s}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(r=d.highlights)||void 0===r?void 0:r.ruleA_spans)||[],highlightsB:(null===(o=d.highlights)||void 0===o?void 0:o.ruleB_spans)||[],hasContent:s}},xe=["title","scope","description","when_to_apply","when_not_to_apply"],fe=function(){if(te.current){var e=te.current.getBoundingClientRect(),n=[];xe.forEach(function(t){var i="when_to_apply"===t?he.wta:"when_not_to_apply"===t?he.wnta:he[t],r="when_to_apply"===t?ge.wta:"when_not_to_apply"===t?ge.wnta:ge[t];if(i.current&&r.current){i.current.style.height="auto",r.current.style.height="auto";var o=i.current.getBoundingClientRect(),l=r.current.getBoundingClientRect(),a=Math.max(o.height,l.height);i.current.style.height="".concat(a,"px"),r.current.style.height="".concat(a,"px");var s=i.current.getBoundingClientRect(),d=r.current.getBoundingClientRect(),c=ue(t),p=y(c.score,c.relation,c.hasContent),h=s.top+s.height/2-e.top;n.push({x1:s.right-e.left,y1:h,x2:d.left-e.left,y2:h,style:p})}}),oe(n)}};return s(function(){var e=setTimeout(fe,250);window.addEventListener("resize",fe);var n=null;return te.current&&(n=new ResizeObserver(function(){window.requestAnimationFrame(function(){fe()})})).observe(te.current),function(){clearTimeout(e),window.removeEventListener("resize",fe),n&&n.disconnect()}},[C,$,q,R]),i(c,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(c,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4"}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[r(h,e({onClick:A,size:"small"},{children:r(u,{})})),r(p,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),r(h,e({onClick:S,size:"small"},{children:r(c,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),P.length>1&&i(c,e({sx:{px:3,pb:.25}},{children:[i(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[r(p,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i(c,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[r(h,e({onClick:function(){return U("left")},size:"small",disabled:!ae},{children:r(u,{size:18})})),r(h,e({onClick:function(){return U("right")},size:"small",disabled:!ce},{children:r(x,{size:18})}))]}))]})),r(c,e({ref:V,sx:{display:"flex",gap:1,overflowX:"auto",pb:.05,"&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"transparent",borderRadius:"10px"},"&::-webkit-scrollbar-thumb:hover":{background:"transparent"}}},{children:P.map(function(e){return r(F,{data:e,isSelected:(null==Y?void 0:Y.id)===e.id,isCognitiveOpen:R,onToggleCognitive:function(){j(function(e){var n=!e;return n&&N.current&&N.current.scrollTo({top:0,behavior:"smooth"}),n})},onClick:function(){return T((n=e).id),k(n),void j(!1);var n}},e.id)})}))]})),r(c,e({ref:N,sx:{flex:1,overflowY:"auto",py:1.5,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",borderTop:J&&G&&R?"none":"1.5px solid #EEF0F4"}},{children:i(c,e({sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"}},{children:[J&&G&&R&&r(c,e({sx:{width:"100%",pb:1,animation:"fadeIn 0.2s ease-out","& > div > button":{display:"none !important"},"& > div > div":{marginTop:"0px"}}},{children:r(m,{headerIcon:r(b,{}),reasoning:Q,gap:Z,score:ee,mdComponents:ne,isOpen:!0,onToggle:function(){return j(!1)}})})),i(c,e({ref:te,sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative"}},{children:[r("svg",e({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}},{children:re.map(function(n,t){var o=(n.x1+n.x2)/2,l=n.y1;return i("g",{children:[r("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,stroke:n.style.badgeBorder,strokeWidth:"1"}),r("foreignObject",e({x:o-125,y:l-16,width:"250",height:"32"},{children:r(c,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(c,e({sx:{fontSize:"11px",bgcolor:n.style.badgeBg,color:n.style.badgeText,border:"1px solid ".concat(n.style.badgeBorder),borderRadius:"12px",px:1.5,py:.25,fontWeight:500,textAlign:"center",whiteSpace:"nowrap"}},{children:n.style.label}))}))}))]},t)})})),i(c,e({sx:{border:"1px dashed #B0B0B0",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px dashed #B0B0B0",borderRadius:"8px 8px 0 0",display:"flex",minHeight:"24px",alignItems:"center"}},{children:r(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#19213D"}},{children:"Learning You’re Creating"}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:xe.map(function(e){var n=ue(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?he.wta:"when_not_to_apply"===e?he.wnta:he[e],o=C["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsA,styleVariant:t,isHighlighted:O===e},"left-".concat(e))})}))]})),r(c,{sx:{width:"1px"}}),i(c,e({sx:{border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0}},{children:[r(c,e({sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"24px",display:"flex",alignItems:"center"}},{children:i(p,e({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",display:"flex",alignItems:"center",gap:1}},{children:[r("div",e({style:{width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r(f,{})})),"Existing Learning"]}))})),r(c,e({sx:{p:"12px",display:"flex",flexDirection:"column"}},{children:xe.map(function(e){var n=ue(e),t=y(n.score,n.relation,n.hasContent),i="when_to_apply"===e?ge.wta:"when_not_to_apply"===e?ge.wnta:ge[e],o=$["when_to_apply"===e?"wta":"when_not_to_apply"===e?"wnta":e];return r(w,{ref:i,label:"when_to_apply"===e?"When to apply":"when_not_to_apply"===e?"When NOT to Apply":e.charAt(0).toUpperCase()+e.slice(1).replace("_"," "),content:o,highlights:n.highlightsB,styleVariant:t,isHighlighted:O===e},"right-".concat(e))})}))]}))]}))]}))}))]}))};export{_ as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import{useState as r,useRef as t,useEffect as o,useMemo as l}from"react";import{Box as a,IconButton as s,Typography as c,Skeleton as d}from"@mui/material";import{ArrowLeft as p,ArrowRight as x}from"lucide-react";import{CognitiveCompare as f}from"@viswa-test/test-citation";var h=function(r){var t=r.data,o=r.isSelected,l=r.onClick;return i(a,e({id:"variant-card-".concat(t.id),onClick:l,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[n(a,e({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?n(d,{variant:"rounded",width:80,height:20}):n(a,e({sx:{bgcolor:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid #FFE1E1",textTransform:"capitalize"}},{children:t.similarityScoreText||"0% Similarity"}))})),n(a,e({sx:{display:"flex",flexDirection:"column",gap:1}},{children:i(a,e({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[t.isLoading?n(d,{width:"90%"}):n(c,e({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&n(a,e({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]}))}))]}))},g=function(d){var g=d.variants,u=void 0===g?[]:g,m=d.onSelectVariant,b=d.onSkip,F=d.onBack,v=d.targetVariantId,y=r(v||null),w=y[0],S=y[1],k=t(null);o(function(){v&&S(v)},[v]);var E=function(e){k.current&&k.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})},C=l(function(){if(w){var e=String(w).trim();return u.find(function(i){return i.id&&String(i.id).trim()===e})||u[0]}return u.length>0?u[0]:null},[w,u]);o(function(){if(w&&k.current){var e=w.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),n=k.current;if(i&&n){var r=i.offsetLeft-n.offsetLeft-n.clientWidth/2+i.clientWidth/2;n.scrollTo({left:r,behavior:"smooth"})}},150)}},[w,u]);o(function(){!w&&!v&&u.length>0&&!u[0].isLoading&&S(u[0].id)},[u,w,v]);var z=r(!1),D=z[0],L=z[1],B=r(!1),W=B[0],I=B[1];o(function(){var e=k.current;if(e){var i=function(){L(e.scrollLeft>0),I(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return i(),e.addEventListener("scroll",i),window.addEventListener("resize",i),function(){e.removeEventListener("scroll",i),window.removeEventListener("resize",i)}}},[u]);var T=(null==C?void 0:C.intentTreeData)||null,R=(null==C?void 0:C.behaviorTreeData)||null;return i(a,e({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i(a,e({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[i(a,e({sx:{display:"flex",alignItems:"center",gap:1}},{children:[n(s,e({onClick:F,size:"small"},{children:n(p,{})})),n(c,e({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),n(s,e({onClick:b,size:"small"},{children:n(a,e({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),n(a,e({sx:{bgcolor:"#F6F7F9B2"}},{children:u.length>1&&i(a,e({sx:{pb:2}},{children:[i(a,e({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[n(c,e({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i(a,e({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[n(s,e({onClick:function(){return E("left")},size:"small",disabled:!D},{children:n(p,{size:18})})),n(s,e({onClick:function(){return E("right")},size:"small",disabled:!W},{children:n(x,{size:18})}))]}))]})),n(a,e({ref:k,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:u.map(function(e){return n(h,{data:e,isSelected:(null==C?void 0:C.id)===e.id,onClick:function(){return S((i=e).id),void m(i);var i}},e.id)})}))]}))})),i(a,e({sx:{display:"flex",flexDirection:"column",gap:3,margin:3,overflowY:"auto",backgroundColor:"#fff","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"}}},{children:[T&&i(a,e({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i(a,e({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[n(c,e({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),n(c,e({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),n(f,{treeData:T,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1}})]})),R&&i(a,e({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i(a,e({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[n(c,e({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning behavior matching?"})),n(c,e({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the variant you are trying to add is similar, overlapping or conflicting with the existing variant."}))]})),n(f,{treeData:R,componentHeaderText:"Is the learning behavior matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1}})]}))]}))]}))};export{g as default};
|
|
2
2
|
//# sourceMappingURL=RuleComparison.js.map
|