@e-llm-studio/citation 0.0.163 → 0.0.165

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/README.md CHANGED
@@ -245,9 +245,9 @@ ChatDrawer is a generic, resizable drawer component for rendering collapsible pa
245
245
  ### Features
246
246
 
247
247
  - **Collapsible panel** — Header is always visible; body and drag handle only render when open
248
+ - **Notch toggle** — Small tab below the drawer with a chevron arrow; click to expand/collapse, drag to resize
248
249
  - **Drag to resize** — Grab the pill handle at the bottom to resize between `minHeight` and `maxHeight`
249
250
  - **Configurable height** — `defaultHeight`, `minHeight`, `maxHeight` all exposed as props
250
- - **Chevron toggle** — Rotates 180° when open, standard drawer UX
251
251
  - **Consumer-owned content** — Zero opinion on what goes inside, pass any React node
252
252
  - **Deep style overrides** — Every visual region customizable via the `styles` prop
253
253
  - **Inline styles only** — No Tailwind or MUI dependency, works in any consuming app
@@ -296,6 +296,8 @@ const [drawerHeight, setDrawerHeight] = useState(300);
296
296
  header: { backgroundColor: '#1a1a2e' },
297
297
  title: { color: '#fff' },
298
298
  body: { backgroundColor: '#1a1a2e' },
299
+ notch: { backgroundColor: '#1a1a2e', border: '1px solid #444' },
300
+ notchArrowColor: '#fff',
299
301
  }}
300
302
  >
301
303
  <YourComponent />
@@ -309,12 +311,12 @@ const [drawerHeight, setDrawerHeight] = useState(300);
309
311
  | `children` | `ReactNode` | ❌ | Scrollable body — fully consumer owned. Pass any React node. |
310
312
  | `uploadListTopContent` | `string` | ❌ | Header title shown in the always-visible top bar. Defaults to `"Data uploaded for your context"`. |
311
313
  | `isExpanded` | `boolean` | ❌ | Controlled open/close state. Defaults to `false`. |
312
- | `onToggle` | `() => void` | ❌ | Called when the chevron button is clicked. Wire your open/close state here. |
314
+ | `onToggle` | `() => void` | ❌ | Called when the notch is clicked. Wire your open/close state here. |
313
315
  | `defaultHeight` | `number` | ❌ | Initial height of the panel in px when expanded. Defaults to `300`. |
314
316
  | `minHeight` | `number` | ❌ | Minimum height in px when drag-resizing. Defaults to `150`. |
315
317
  | `maxHeight` | `number \| string` | ❌ | Maximum height when drag-resizing. Accepts a px number or a CSS string like `"70vh"`. Defaults to `40vh`. |
316
318
  | `onHeightChange` | `(height: number) => void` | ❌ | Fired on every drag tick with the current height in px. Useful when a sibling layout needs to react to height changes. |
317
- | `styles` | `ChatDrawerStyles` | ❌ | Style overrides for each visual region. Keys: `container`, `header`, `title`, `body`, `dragPill`. Each accepts any valid `CSSProperties`. |
319
+ | `styles` | `ChatDrawerStyles` | ❌ | Style overrides for each visual region. Keys: `container`, `header`, `title`, `body`, `dragPill`, `notch`, `notchArrowColor`. Each accepts any valid `CSSProperties` except `notchArrowColor` which is a `string`. |
318
320
 
319
321
  ---
320
322
 
@@ -436,6 +438,11 @@ const customSections = [
436
438
  | `reasoningIcon` | `ReactNode` | Replaces the icon for the reasoning section |
437
439
  | `gapIcon` | `ReactNode` | Replaces the icon for the gap section |
438
440
  | `scoreIcon` | `ReactNode` | Replaces the sparkle icon in the score badge |
441
+ | `reasoningTitle` | `string` | Title for the reasoning section. Default: "Decision Making Factors" |
442
+ | `reasoningSubtitle` | `string` | Subtitle for the reasoning section. Default: "Why this was picked" |
443
+ | `gapTitle` | `string` | Title for the gap section. Default: "Gaps in Decision" |
444
+ | `gapSubtitle` | `string` | Subtitle for the gap section. Default: "What's missing or unclear" |
445
+ | `scoreLabel` | `string` | Label prefix shown before the score percentage. Default: "Decision Strength: " |
439
446
 
440
447
  ---
441
448
 
@@ -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"),i=require("lucide-react");exports.default=function(r){var o=r.children,s=r.uploadListTopContent,a=r.defaultHeight,d=void 0===a?300:a,l=r.minHeight,u=void 0===l?150:l,c=r.maxHeight,g=r.isExpanded,p=void 0!==g&&g,x=r.onToggle,f=r.onHeightChange,h=r.styles,m=void 0===h?{}:h,v=t.useState(!1),_=v[0],y=v[1],b=t.useState(d),w=b[0],j=b[1],H=t.useRef(0),S=t.useRef(d),k="string"==typeof c?parseFloat(c)/100*window.innerHeight:null!=c?c:.4*window.innerHeight;return t.useEffect(function(){if(_){var e=function(e){e.preventDefault();var n=e.clientY-H.current,t=Math.max(u,Math.min(k,S.current+n));j(t),null==f||f(t)},n=function(){y(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n)}}},[_]),n.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:p?"".concat(w,"px"):"auto",minHeight:p?"".concat(u,"px"):"auto",maxHeight:p?"".concat(w,"px"):"auto",overflow:"hidden",width:"100%"},m.container)},{children:[n.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},m.header)},{children:n.jsxs("button",e.__assign({onClick:x,style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n.jsx("span",e.__assign({style:e.__assign({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},m.title)},{children:(null==s?void 0:s.trim())?s:"Data uploaded for your context"})),n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",width:16,height:16,transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}},{children:n.jsx(i.ChevronDown,{})}))]}))})),p&&n.jsx("div",e.__assign({style:e.__assign({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},m.body)},{children:o})),p&&n.jsx("div",e.__assign({onMouseDown:function(e){e.preventDefault(),y(!0),H.current=e.clientY,S.current=w,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:n.jsx("div",{style:e.__assign({width:48,height:4,borderRadius:4,background:_?"#a78bfa":"#d1d5db"},m.dragPill)})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react");exports.default=function(o){var r,s=o.children,a=o.uploadListTopContent,d=o.defaultHeight,l=void 0===d?300:d,u=o.minHeight,c=void 0===u?150:u,p=o.maxHeight,f=o.isExpanded,g=void 0!==f&&f,x=o.onToggle,h=o.onHeightChange,v=o.styles,m=void 0===v?{}:v,_=n.useState(!1),y=_[0],b=_[1],w=n.useState(l),j=w[0],C=w[1],H=n.useRef(0),R=n.useRef(l),S=n.useRef(null),E=n.useRef(0),k="string"==typeof p?parseFloat(p)/100*window.innerHeight:null!=p?p:.4*window.innerHeight;n.useEffect(function(){!g&&S.current&&(E.current=S.current.getBoundingClientRect().height)},[g]);return n.useEffect(function(){if(y){var e=function(e){e.preventDefault();var t=e.clientY-H.current,n=Math.max(c,Math.min(k,R.current+t));C(n),null==h||h(n)},t=function(){b(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[y]),t.jsxs("div",e.__assign({ref:S,style:{position:"relative",width:"100%",minHeight:g?E.current:"auto"}},{children:[t.jsxs("div",e.__assign({style:e.__assign({position:g?"absolute":"relative",zIndex:g?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:g?"".concat(j,"px"):"auto",minHeight:g?"".concat(c,"px"):"auto",maxHeight:g?"".concat(j,"px"):"auto",overflow:"hidden",width:"100%"},m.container)},{children:[t.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},m.header)},{children:t.jsx("span",e.__assign({style:e.__assign({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},m.title)},{children:(null==a?void 0:a.trim())?a:"Data uploaded for your context"}))})),g&&t.jsx("div",e.__assign({style:e.__assign({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},m.body)},{children:s})),g&&t.jsx("div",e.__assign({onMouseDown:function(e){e.preventDefault(),b(!0),H.current=e.clientY,R.current=j,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:t.jsx("div",{style:e.__assign({width:48,height:4,borderRadius:4,background:y?"#a78bfa":"#d1d5db"},m.dragPill)})}))]})),t.jsx("div",e.__assign({style:{position:g?"absolute":"relative",top:g?"".concat(j,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:g?10:"auto"}},{children:t.jsx("button",e.__assign({onClick:x,"aria-label":g?"Collapse":"Expand",style:e.__assign({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},m.notch)},{children:t.jsx(i.ChevronDown,{size:14,color:null!==(r=m.notchArrowColor)&&void 0!==r?r:"#6d28d9",style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};
2
2
  //# sourceMappingURL=ChatDrawer.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("react-markdown"),t=require("rehype-raw"),n=require("remark-gfm"),r=require("react"),o=require("./CognitiveDecisioningWrapper.module.css.js"),a=require("../../assests/svg/ButtonCognitiveIcon.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(i),c=l(t),u=l(n),g=function(){return s.jsx("div",e.__assign({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",color:"#6b27d9",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:s.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[s.jsx("path",{d:"M9 18h6"}),s.jsx("path",{d:"M10 22h4"}),s.jsx("path",{d:"M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.55-3 6H8a7 7 0 0 1-3-6 7 7 0 0 1 7-7z"})]}))}))},h=function(){return s.jsx("div",e.__assign({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:s.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#6b27d9",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},{children:[s.jsx("path",{d:"M4.92363 2.64844H1.93457V5.34844M1.93457 10.7484V12.5484M8.90904 2.64844H12.9601M16.9455 2.64844H19.9346V5.34844M4.92363 20.6484H1.93457V17.9484"}),s.jsx("path",{d:"M18.2707 19.1183C19.6383 17.75 19.6383 15.53 18.2707 14.16C16.9031 12.79 14.6831 12.79 13.3155 14.16C11.9479 15.53 11.9479 17.75 13.3155 19.11C14.6831 20.48 16.9031 20.48 18.2707 19.11ZM18.2707 19.1183L21.1436 21.9987"})]}))}))},f=function(i){var t=i.color,n=void 0===t?"#7b39ed":t,r=i.width,o=void 0===r?13:r,a=i.height,l=void 0===a?13:a,d=i.style;return s.jsx("span",e.__assign({style:e.__assign({display:"inline-flex",alignItems:"center",marginLeft:"4px"},d)},{children:s.jsxs("svg",e.__assign({width:o,height:l,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[s.jsx("path",{d:"M12.9975 5.40607C12.8868 4.86464 12.1132 4.86464 12.0025 5.40607C11.3236 8.72775 8.72775 11.3236 5.40607 12.0025C4.86464 12.1132 4.86464 12.8868 5.40607 12.9975C8.72775 13.6764 11.3236 16.2723 12.0025 19.5939C12.1132 20.1354 12.8868 20.1354 12.9975 19.5939C13.6764 16.2723 16.2723 13.6764 19.5939 12.9975C20.1354 12.8868 20.1354 12.1132 19.5939 12.0025C16.2723 11.3236 13.6764 8.72775 12.9975 5.40607Z",fill:n}),s.jsx("path",{d:"M3.7829 0.026852C3.77558 -0.00895077 3.72442 -0.00895062 3.7171 0.0268522C3.33729 1.88509 1.88509 3.33729 0.0268517 3.7171C-0.00895119 3.72442 -0.00895119 3.77558 0.0268517 3.7829C1.88509 4.16271 3.33729 5.61491 3.7171 7.47315C3.72442 7.50895 3.77558 7.50895 3.7829 7.47315C4.16271 5.61491 5.61491 4.16271 7.47315 3.7829C7.50895 3.77558 7.50895 3.72442 7.47315 3.7171C5.61491 3.33729 4.16271 1.88509 3.7829 0.026852Z",fill:n})]}))}))},x=r.forwardRef(function(i,t){var n=i.reasoning,l=i.gap,x=i.score,p=i.isOpen,_=i.onToggle,j=i.title,v=void 0===j?"Cognitive Decisioning AI":j,m=i.sections,C=i.styles,y=void 0===C?{}:C,k=i.mdComponents,b=void 0===k?{}:k,w=i.headerIcon,M=i.reasoningIcon,N=i.gapIcon,I=i.scoreIcon,B=i.hideTrigger,L=void 0!==B&&B,T=r.useState({reasoning:!0,gap:!0}),q=T[0],H=T[1],W=w||s.jsx(a.ButtonCognitiveIcon,{}),S=M||s.jsx(g,{}),D=N||s.jsx(h,{}),R=I||s.jsx(f,{}),V=r.useMemo(function(){return m||[{id:"reasoning",title:"Reasoning",subtitle:"Why this was picked",icon:S,content:n||"No reasoning provided."},{id:"gap",title:"Gap",subtitle:"What's missing or unclear",icon:D,content:l||"No gaps identified."}]},[m,n,l]),A=r.useMemo(function(){return[c.default]},[]),G=r.useMemo(function(){return[u.default]},[]);return s.jsxs("div",e.__assign({style:{display:"contents"}},{children:[!L&&s.jsxs("button",e.__assign({onClick:_,className:"".concat(o.default.pill," ").concat(p?o.default.pillOpen:o.default.pillClosed),style:y.pill,"aria-expanded":p},{children:[W,s.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:s.jsx("path",{d:"M6 9l6 6 6-6"})}))]})),p&&s.jsxs("div",e.__assign({ref:t,className:o.default.container,style:y.container},{children:[s.jsxs("div",e.__assign({className:o.default.header,style:y.header},{children:[s.jsxs("div",e.__assign({className:o.default.headerTitle,style:y.headerTitle},{children:[W,s.jsx("span",e.__assign({className:o.default.headerTitleText,style:y.headerTitleText},{children:v}))]})),x&&s.jsxs("div",e.__assign({className:o.default.badge,style:y.badge},{children:[R,"Decision Strength: ",x,"%"]}))]})),V.map(function(i,t){return s.jsxs("div",e.__assign({className:o.default.sectionItem,style:y.sectionItem},{children:[s.jsxs("button",e.__assign({onClick:function(){return s=i.id,void H(function(i){var t;return e.__assign(e.__assign({},i),((t={})[s]=!i[s],t))});var s},className:o.default.sectionButton,style:y.sectionButton},{children:[s.jsxs("div",e.__assign({className:o.default.sectionHeaderGroup,style:y.sectionHeaderGroup},{children:[i.icon,s.jsxs("div",{children:[s.jsx("h4",e.__assign({className:o.default.sectionTitle,style:y.sectionTitle},{children:i.title})),i.subtitle&&s.jsx("p",e.__assign({className:o.default.sectionSubtitle,style:y.sectionSubtitle},{children:i.subtitle}))]})]})),s.jsx("svg",e.__assign({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#9CA3AF",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:q[i.id]?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:s.jsx("path",{d:"M6 9l6 6 6-6"})}))]})),q[i.id]&&s.jsx("div",e.__assign({className:o.default.textContent,style:y.textContent},{children:s.jsx(d.default,e.__assign({components:b,rehypePlugins:A,remarkPlugins:G},{children:i.content}))}))]}),i.id)})]}))]}))});x.displayName="CognitiveDecisioningCard",exports.default=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("react-markdown"),t=require("rehype-raw"),n=require("remark-gfm"),r=require("react"),o=require("./CognitiveDecisioningWrapper.module.css.js"),a=require("../../assests/svg/ButtonCognitiveIcon.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(i),c=l(t),u=l(n),g=function(){return s.jsx("div",e.__assign({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",color:"#6b27d9",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:s.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[s.jsx("path",{d:"M9 18h6"}),s.jsx("path",{d:"M10 22h4"}),s.jsx("path",{d:"M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.55-3 6H8a7 7 0 0 1-3-6 7 7 0 0 1 7-7z"})]}))}))},h=function(){return s.jsx("div",e.__assign({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:s.jsxs("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#6b27d9",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},{children:[s.jsx("path",{d:"M4.92363 2.64844H1.93457V5.34844M1.93457 10.7484V12.5484M8.90904 2.64844H12.9601M16.9455 2.64844H19.9346V5.34844M4.92363 20.6484H1.93457V17.9484"}),s.jsx("path",{d:"M18.2707 19.1183C19.6383 17.75 19.6383 15.53 18.2707 14.16C16.9031 12.79 14.6831 12.79 13.3155 14.16C11.9479 15.53 11.9479 17.75 13.3155 19.11C14.6831 20.48 16.9031 20.48 18.2707 19.11ZM18.2707 19.1183L21.1436 21.9987"})]}))}))},f=function(i){var t=i.color,n=void 0===t?"#7b39ed":t,r=i.width,o=void 0===r?13:r,a=i.height,l=void 0===a?13:a,d=i.style;return s.jsx("span",e.__assign({style:e.__assign({display:"inline-flex",alignItems:"center",marginLeft:"4px"},d)},{children:s.jsxs("svg",e.__assign({width:o,height:l,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[s.jsx("path",{d:"M12.9975 5.40607C12.8868 4.86464 12.1132 4.86464 12.0025 5.40607C11.3236 8.72775 8.72775 11.3236 5.40607 12.0025C4.86464 12.1132 4.86464 12.8868 5.40607 12.9975C8.72775 13.6764 11.3236 16.2723 12.0025 19.5939C12.1132 20.1354 12.8868 20.1354 12.9975 19.5939C13.6764 16.2723 16.2723 13.6764 19.5939 12.9975C20.1354 12.8868 20.1354 12.1132 19.5939 12.0025C16.2723 11.3236 13.6764 8.72775 12.9975 5.40607Z",fill:n}),s.jsx("path",{d:"M3.7829 0.026852C3.77558 -0.00895077 3.72442 -0.00895062 3.7171 0.0268522C3.33729 1.88509 1.88509 3.33729 0.0268517 3.7171C-0.00895119 3.72442 -0.00895119 3.77558 0.0268517 3.7829C1.88509 4.16271 3.33729 5.61491 3.7171 7.47315C3.72442 7.50895 3.77558 7.50895 3.7829 7.47315C4.16271 5.61491 5.61491 4.16271 7.47315 3.7829C7.50895 3.77558 7.50895 3.72442 7.47315 3.7171C5.61491 3.33729 4.16271 1.88509 3.7829 0.026852Z",fill:n})]}))}))},x=r.forwardRef(function(i,t){var n=i.reasoning,l=i.gap,x=i.score,p=i.isOpen,_=i.onToggle,v=i.title,j=void 0===v?"Cognitive Decisioning AI":v,C=i.reasoningTitle,m=void 0===C?"Decision Making Factors":C,y=i.reasoningSubtitle,k=void 0===y?"Why this was picked":y,b=i.gapTitle,w=void 0===b?"Gaps in Decision":b,M=i.gapSubtitle,N=void 0===M?"What's missing or unclear":M,L=i.scoreLabel,I=void 0===L?"Decision Strength: ":L,T=i.sections,B=i.styles,q=void 0===B?{}:B,S=i.mdComponents,H=void 0===S?{}:S,W=i.headerIcon,D=i.reasoningIcon,V=i.gapIcon,A=i.scoreIcon,G=i.hideTrigger,O=void 0!==G&&G,P=r.useState({reasoning:!0,gap:!0}),R=P[0],Z=P[1],F=W||s.jsx(a.ButtonCognitiveIcon,{}),z=D||s.jsx(g,{}),E=V||s.jsx(h,{}),J=A||s.jsx(f,{}),K=r.useMemo(function(){return T||[{id:"reasoning",title:m,subtitle:k,icon:z,content:n||"No ".concat(m.toLowerCase()," provided.")},{id:"gap",title:w,subtitle:N,icon:E,content:l||"No ".concat(w.toLowerCase()," provided.")}]},[T,n,l]),Q=r.useMemo(function(){return[c.default]},[]),U=r.useMemo(function(){return[u.default]},[]);return s.jsxs("div",e.__assign({style:{display:"contents"}},{children:[!O&&s.jsxs("button",e.__assign({onClick:_,className:"".concat(o.default.pill," ").concat(p?o.default.pillOpen:o.default.pillClosed),style:q.pill,"aria-expanded":p},{children:[F,s.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:s.jsx("path",{d:"M6 9l6 6 6-6"})}))]})),p&&s.jsxs("div",e.__assign({ref:t,className:o.default.container,style:q.container},{children:[s.jsxs("div",e.__assign({className:o.default.header,style:q.header},{children:[s.jsxs("div",e.__assign({className:o.default.headerTitle,style:q.headerTitle},{children:[F,s.jsx("span",e.__assign({className:o.default.headerTitleText,style:q.headerTitleText},{children:j}))]})),x&&s.jsxs("div",e.__assign({className:o.default.badge,style:q.badge},{children:[J,I,x,"%"]}))]})),K.map(function(i,t){return s.jsxs("div",e.__assign({className:o.default.sectionItem,style:q.sectionItem},{children:[s.jsxs("button",e.__assign({onClick:function(){return s=i.id,void Z(function(i){var t;return e.__assign(e.__assign({},i),((t={})[s]=!i[s],t))});var s},className:o.default.sectionButton,style:q.sectionButton},{children:[s.jsxs("div",e.__assign({className:o.default.sectionHeaderGroup,style:q.sectionHeaderGroup},{children:[i.icon,s.jsxs("div",{children:[s.jsx("h4",e.__assign({className:o.default.sectionTitle,style:q.sectionTitle},{children:i.title})),i.subtitle&&s.jsx("p",e.__assign({className:o.default.sectionSubtitle,style:q.sectionSubtitle},{children:i.subtitle}))]})]})),s.jsx("svg",e.__assign({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#9CA3AF",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:R[i.id]?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:s.jsx("path",{d:"M6 9l6 6 6-6"})}))]})),R[i.id]&&s.jsx("div",e.__assign({className:o.default.textContent,style:q.textContent},{children:s.jsx(d.default,e.__assign({components:H,rehypePlugins:Q,remarkPlugins:U},{children:i.content}))}))]}),i.id)})]}))]}))});x.displayName="CognitiveDecisioningCard",exports.default=x;
2
2
  //# sourceMappingURL=CognitiveDecisioningWrapper.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),s=require("react"),a=require("lucide-react"),t=require("react-markdown"),i=require("rehype-raw"),r=require("./FaqCitation.module.css.js"),l=require("../shared/Audacy/GapIcon.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(t),d=o(i),u=function(s){var a=s.className;return n.jsx("svg",e.__assign({className:a,viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2059 0.857334C8.62849 -0.0137806 6.77225 -0.231241 5.03618 0.251692C3.30011 0.734626 1.8228 1.8794 0.921793 3.43996C0.0207849 5.00052 -0.232 6.85229 0.217771 8.59724C0.667543 10.3422 1.78397 11.841 3.32708 12.7716V15.2653C3.32708 15.3591 3.34555 15.452 3.38145 15.5387C3.41734 15.6253 3.46996 15.7041 3.53629 15.7704C3.60261 15.8367 3.68136 15.8894 3.76802 15.9252C3.85468 15.9611 3.94756 15.9796 4.04136 15.9796C4.13516 15.9796 4.22805 15.9611 4.31471 15.9252C4.40137 15.8894 4.48011 15.8367 4.54644 15.7704C4.61277 15.7041 4.66538 15.6253 4.70128 15.5387C4.73717 15.452 4.75565 15.3591 4.75565 15.2653V12.351C4.75517 12.2196 4.71871 12.0907 4.65021 11.9785C4.58171 11.8663 4.48379 11.775 4.36708 11.7145C3.50392 11.2743 2.77367 10.612 2.25152 9.79584C1.72938 8.97965 1.4342 8.03905 1.39637 7.07087C1.35855 6.10269 1.57946 5.14193 2.03634 4.28749C2.49323 3.43306 3.16958 2.71584 3.99577 2.20967C4.82196 1.7035 5.76813 1.42667 6.73686 1.40769C7.70559 1.38871 8.66188 1.62826 9.50726 2.10168C10.3526 2.5751 11.0566 3.26528 11.5466 4.10116C12.0366 4.93704 12.2949 5.88842 12.2951 6.85733V11.3419C12.2951 11.4498 12.2522 11.5533 12.1759 11.6296C12.0996 11.7059 11.9961 11.7488 11.8882 11.7488H9.64593C9.45649 11.7488 9.27481 11.824 9.14086 11.958C9.0069 12.0919 8.93165 12.2736 8.93165 12.463V15.2653C8.93165 15.4548 9.0069 15.6365 9.14086 15.7704C9.27481 15.9044 9.45649 15.9796 9.64593 15.9796C9.83537 15.9796 10.0171 15.9044 10.151 15.7704C10.285 15.6365 10.3602 15.4548 10.3602 15.2653V13.1773H11.8882C12.1293 13.1773 12.3679 13.1299 12.5906 13.0376C12.8133 12.9454 13.0156 12.8102 13.1861 12.6398C13.3565 12.4693 13.4917 12.267 13.5839 12.0443C13.6762 11.8216 13.7236 11.5829 13.7236 11.3419V6.85848C13.7234 5.63584 13.3974 4.43536 12.7791 3.38058C12.1608 2.3258 11.2726 1.45484 10.2059 0.857334ZM4.98651 3.51676C5.78545 3.05623 6.71898 2.8859 7.62909 3.0346C8.5392 3.1833 9.36997 3.64189 9.98079 4.33276C10.3922 4.7979 10.2779 5.46648 9.85508 5.84705C8.61165 6.97048 6.55108 8.42648 4.50308 8.96933C3.98193 9.10648 3.41051 8.85505 3.21965 8.31791C2.90724 7.43742 2.91289 6.47535 3.23562 5.5986C3.55835 4.72184 4.1778 3.98457 4.98651 3.51676Z",fill:"currentColor"})}))},f=function(s){var t=s.icon,i=s.title,l=s.subtitle,o=s.children,c=s.isOpen,d=s.onToggle,u=s.iconColorClass,f=void 0===u?r.default.iconPurple:u,_=s.iconBgClass,g=void 0===_?r.default.iconBgPurple:_;return n.jsxs("div",e.__assign({className:r.default.sectionBorder},{children:[n.jsxs("button",e.__assign({type:"button",onClick:d,className:r.default.sectionButton},{children:[n.jsxs("div",e.__assign({className:r.default.sectionHeader},{children:[n.jsx("div",e.__assign({className:"".concat(r.default.iconWrapper," ").concat(g," ").concat(f)},{children:n.jsx(t,{className:r.default.icon})})),n.jsxs("div",e.__assign({className:r.default.sectionTitles},{children:[n.jsx("span",e.__assign({className:r.default.sectionTitle},{children:i})),n.jsx("span",e.__assign({className:r.default.sectionSubtitle},{children:l}))]}))]})),n.jsx("div",e.__assign({className:r.default.chevronWrapper},{children:c?n.jsx(a.ChevronUp,{className:r.default.chevron}):n.jsx(a.ChevronDown,{className:r.default.chevron})}))]})),c&&n.jsx("div",e.__assign({className:r.default.sectionContent},{children:o}))]}))},_=function(e,s){if(!s||!e)return n.jsx("span",{dangerouslySetInnerHTML:{__html:e}});var a=s.trim().split(/\n+|(?<=[.!?])\s+/).map(function(e){return e.trim()}).filter(function(e){return e.length>5}),t=e;return a.forEach(function(e,n){var s=e.split(/\s+/).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("([\\s]|<[^>]+>)*");try{var a=new RegExp("(".concat(s,")"),"gi");t=t.replace(a,function(e){var n=!t.includes('data-first-highlight="true"');return'<mark class="'.concat(r.default.highlightMark,'" ').concat(n?'data-first-highlight="true"':"",">").concat(e,"</mark>")})}catch(e){console.error("Regex highlight error:",e)}}),n.jsx("span",{className:r.default.citationContainer,dangerouslySetInnerHTML:{__html:t}})},g=function(t){var i=t.content,l=t.highlightedText,o=t.citationTitle,c=s.useState(!1),d=c[0],u=c[1],f=s.useRef(null),g=s.useRef(!1);return s.useEffect(function(){d&&f.current&&!g.current&&setTimeout(function(){var e,n=null===(e=f.current)||void 0===e?void 0:e.querySelector('[data-first-highlight="true"]');n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),g.current=!0)},100),d||(g.current=!1)},[d]),n.jsxs("details",e.__assign({open:d,onToggle:function(e){return u(e.target.open)},className:r.default.nestedAccordion},{children:[n.jsxs("summary",e.__assign({className:r.default.nestedSummary},{children:[n.jsx("span",{children:o}),n.jsx("span",e.__assign({className:r.default.nestedChevron},{children:d?n.jsx(a.ChevronUp,{className:r.default.nestedChevronIcon}):n.jsx(a.ChevronDown,{className:r.default.nestedChevronIcon})}))]})),n.jsx("div",e.__assign({className:r.default.nestedCard},{children:n.jsx("div",e.__assign({ref:f,className:r.default.nestedCardContent},{children:n.jsx("div",e.__assign({className:r.default.nestedText},{children:_(i,l)}))}))}))]}))};exports.default=function(t){var i=t.citation,o=t.children,_=s.useState(!0),h=_[0],m=_[1],C=s.useState(!0),v=C[0],x=C[1],p=s.useState(!0),j=p[0],N=p[1],w=s.useRef(null),b=null==i?void 0:i.customMetaData,y=(null==b?void 0:b.citation_title)||"Citation",k=(null==b?void 0:b.content)||"",T=(null==b?void 0:b.highlighted_text)||"";null==b||b.citation_source;var I=(null==b?void 0:b.reasoning)||"No reasoning provided.",S=(null==b?void 0:b.gap)||"",q="number"==typeof(null==b?void 0:b.score)?b.score:0,L=S&&S.trim().length>0?S:"1. No gap identified",P=s.useMemo(function(){return{p:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("p",e.__assign({className:r.default.markdownP},a))},strong:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("strong",e.__assign({className:r.default.markdownStrong},a))},ul:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("ul",e.__assign({className:r.default.markdownUl},a))},ol:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("ol",e.__assign({className:r.default.markdownOl},a))},li:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("li",e.__assign({className:r.default.markdownLi},a))},code:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("code",e.__assign({className:r.default.markdownCode},a))},span:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("span",e.__assign({},a))},br:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("br",e.__assign({},a))},a:function(s){s.node;var a=s.href,t=s.children,i=e.__rest(s,["node","href","children"]);return a&&a.includes("doc_id=")?n.jsx(g,{content:k,highlightedText:T,citationTitle:Array.isArray(t)?t.join(""):String(t)}):n.jsx("a",e.__assign({href:a,className:r.default.markdownLink,target:"_blank",rel:"noopener noreferrer"},i,{children:t}))}}},[k,T,y]);return s.useEffect(function(){var e=w.current;if(e){var n=function(){m(e.open)};return e.addEventListener("toggle",n),n(),function(){return e.removeEventListener("toggle",n)}}},[]),n.jsx(n.Fragment,{children:n.jsxs("details",e.__assign({ref:w,open:!0,className:r.default.citationAccordion},{children:[n.jsxs("summary",e.__assign({className:r.default.citationSummary},{children:[n.jsx("span",e.__assign({className:r.default.citationTitle},{children:o})),n.jsx("span",e.__assign({className:r.default.citationChevron},{children:h?n.jsx(a.ChevronUp,{className:r.default.citationChevronIcon}):n.jsx(a.ChevronDown,{className:r.default.citationChevronIcon})}))]})),n.jsxs("div",e.__assign({className:r.default.expandedCard},{children:[n.jsxs("div",e.__assign({className:r.default.mainContent},{children:[n.jsx(f,e.__assign({icon:a.Lightbulb,title:"Reasoning",subtitle:"How the results are fetched?",isOpen:v,onToggle:function(){return x(!v)},iconColorClass:r.default.iconPurple,iconBgClass:r.default.iconBgPurple},{children:n.jsx("div",e.__assign({className:r.default.citationContent},{children:n.jsx(c.default,e.__assign({rehypePlugins:[d.default],components:P},{children:I}))}))})),n.jsx(f,e.__assign({icon:l.GapIcon,title:"Gap",subtitle:"What's missing or unclear?",isOpen:j,onToggle:function(){return N(!j)},iconColorClass:r.default.iconPurple,iconBgClass:r.default.iconBgPurple},{children:n.jsx("div",e.__assign({className:r.default.citationContent},{children:n.jsx(c.default,e.__assign({rehypePlugins:[d.default],components:P},{children:L}))}))}))]})),n.jsxs("div",e.__assign({className:r.default.footer},{children:[n.jsxs("div",e.__assign({className:r.default.footerLeft},{children:[n.jsx(u,{className:r.default.decisioningIcon}),n.jsx("span",e.__assign({className:r.default.footerLabel},{children:"Cognitive Decisioning AI"}))]})),n.jsxs("div",e.__assign({className:r.default.footerRight},{children:[n.jsx(a.Sparkles,{className:r.default.sparklesIcon}),n.jsxs("span",e.__assign({className:r.default.scoreLabel},{children:["AI Relevance: ",q,"%"]}))]}))]}))]}))]}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),s=require("react"),a=require("lucide-react"),t=require("react-markdown"),i=require("rehype-raw"),r=require("./FaqCitation.module.css.js"),l=require("../shared/Audacy/GapIcon.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(t),d=o(i),u=function(s){var a=s.className;return n.jsx("svg",e.__assign({className:a,viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2059 0.857334C8.62849 -0.0137806 6.77225 -0.231241 5.03618 0.251692C3.30011 0.734626 1.8228 1.8794 0.921793 3.43996C0.0207849 5.00052 -0.232 6.85229 0.217771 8.59724C0.667543 10.3422 1.78397 11.841 3.32708 12.7716V15.2653C3.32708 15.3591 3.34555 15.452 3.38145 15.5387C3.41734 15.6253 3.46996 15.7041 3.53629 15.7704C3.60261 15.8367 3.68136 15.8894 3.76802 15.9252C3.85468 15.9611 3.94756 15.9796 4.04136 15.9796C4.13516 15.9796 4.22805 15.9611 4.31471 15.9252C4.40137 15.8894 4.48011 15.8367 4.54644 15.7704C4.61277 15.7041 4.66538 15.6253 4.70128 15.5387C4.73717 15.452 4.75565 15.3591 4.75565 15.2653V12.351C4.75517 12.2196 4.71871 12.0907 4.65021 11.9785C4.58171 11.8663 4.48379 11.775 4.36708 11.7145C3.50392 11.2743 2.77367 10.612 2.25152 9.79584C1.72938 8.97965 1.4342 8.03905 1.39637 7.07087C1.35855 6.10269 1.57946 5.14193 2.03634 4.28749C2.49323 3.43306 3.16958 2.71584 3.99577 2.20967C4.82196 1.7035 5.76813 1.42667 6.73686 1.40769C7.70559 1.38871 8.66188 1.62826 9.50726 2.10168C10.3526 2.5751 11.0566 3.26528 11.5466 4.10116C12.0366 4.93704 12.2949 5.88842 12.2951 6.85733V11.3419C12.2951 11.4498 12.2522 11.5533 12.1759 11.6296C12.0996 11.7059 11.9961 11.7488 11.8882 11.7488H9.64593C9.45649 11.7488 9.27481 11.824 9.14086 11.958C9.0069 12.0919 8.93165 12.2736 8.93165 12.463V15.2653C8.93165 15.4548 9.0069 15.6365 9.14086 15.7704C9.27481 15.9044 9.45649 15.9796 9.64593 15.9796C9.83537 15.9796 10.0171 15.9044 10.151 15.7704C10.285 15.6365 10.3602 15.4548 10.3602 15.2653V13.1773H11.8882C12.1293 13.1773 12.3679 13.1299 12.5906 13.0376C12.8133 12.9454 13.0156 12.8102 13.1861 12.6398C13.3565 12.4693 13.4917 12.267 13.5839 12.0443C13.6762 11.8216 13.7236 11.5829 13.7236 11.3419V6.85848C13.7234 5.63584 13.3974 4.43536 12.7791 3.38058C12.1608 2.3258 11.2726 1.45484 10.2059 0.857334ZM4.98651 3.51676C5.78545 3.05623 6.71898 2.8859 7.62909 3.0346C8.5392 3.1833 9.36997 3.64189 9.98079 4.33276C10.3922 4.7979 10.2779 5.46648 9.85508 5.84705C8.61165 6.97048 6.55108 8.42648 4.50308 8.96933C3.98193 9.10648 3.41051 8.85505 3.21965 8.31791C2.90724 7.43742 2.91289 6.47535 3.23562 5.5986C3.55835 4.72184 4.1778 3.98457 4.98651 3.51676Z",fill:"currentColor"})}))},f=function(s){var t=s.icon,i=s.title,l=s.subtitle,o=s.children,c=s.isOpen,d=s.onToggle,u=s.iconColorClass,f=void 0===u?r.default.iconPurple:u,_=s.iconBgClass,g=void 0===_?r.default.iconBgPurple:_;return n.jsxs("div",e.__assign({className:r.default.sectionBorder},{children:[n.jsxs("button",e.__assign({type:"button",onClick:d,className:r.default.sectionButton},{children:[n.jsxs("div",e.__assign({className:r.default.sectionHeader},{children:[n.jsx("div",e.__assign({className:"".concat(r.default.iconWrapper," ").concat(g," ").concat(f)},{children:n.jsx(t,{className:r.default.icon})})),n.jsxs("div",e.__assign({className:r.default.sectionTitles},{children:[n.jsx("span",e.__assign({className:r.default.sectionTitle},{children:i})),n.jsx("span",e.__assign({className:r.default.sectionSubtitle},{children:l}))]}))]})),n.jsx("div",e.__assign({className:r.default.chevronWrapper},{children:c?n.jsx(a.ChevronUp,{className:r.default.chevron}):n.jsx(a.ChevronDown,{className:r.default.chevron})}))]})),c&&n.jsx("div",e.__assign({className:r.default.sectionContent},{children:o}))]}))},_=function(e,s){if(!s||!e)return n.jsx("span",{dangerouslySetInnerHTML:{__html:e}});var a=s.trim().split(/\n+|(?<=[.!?])\s+/).map(function(e){return e.trim()}).filter(function(e){return e.length>5}),t=e;return a.forEach(function(e,n){var s=e.split(/\s+/).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("([\\s]|<[^>]+>)*");try{var a=new RegExp("(".concat(s,")"),"gi");t=t.replace(a,function(e){var n=!t.includes('data-first-highlight="true"');return'<mark class="'.concat(r.default.highlightMark,'" ').concat(n?'data-first-highlight="true"':"",">").concat(e,"</mark>")})}catch(e){console.error("Regex highlight error:",e)}}),n.jsx("span",{className:r.default.citationContainer,dangerouslySetInnerHTML:{__html:t}})},g=function(t){var i=t.content,l=t.highlightedText,o=t.citationTitle,c=s.useState(!1),d=c[0],u=c[1],f=s.useRef(null),g=s.useRef(!1);return s.useEffect(function(){d&&f.current&&!g.current&&setTimeout(function(){var e,n=null===(e=f.current)||void 0===e?void 0:e.querySelector('[data-first-highlight="true"]');n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),g.current=!0)},100),d||(g.current=!1)},[d]),n.jsxs("details",e.__assign({open:d,onToggle:function(e){return u(e.target.open)},className:r.default.nestedAccordion},{children:[n.jsxs("summary",e.__assign({className:r.default.nestedSummary},{children:[n.jsx("span",{children:o}),n.jsx("span",e.__assign({className:r.default.nestedChevron},{children:d?n.jsx(a.ChevronUp,{className:r.default.nestedChevronIcon}):n.jsx(a.ChevronDown,{className:r.default.nestedChevronIcon})}))]})),n.jsx("div",e.__assign({className:r.default.nestedCard},{children:n.jsx("div",e.__assign({ref:f,className:r.default.nestedCardContent},{children:n.jsx("div",e.__assign({className:r.default.nestedText},{children:_(i,l)}))}))}))]}))};exports.default=function(t){var i=t.citation,o=t.children,_=s.useState(!0),h=_[0],m=_[1],C=s.useState(!0),v=C[0],x=C[1],p=s.useState(!0),j=p[0],N=p[1],w=s.useRef(null),b=null==i?void 0:i.customMetaData,k=(null==b?void 0:b.citation_title)||"Citation",y=(null==b?void 0:b.content)||"",T=(null==b?void 0:b.highlighted_text)||"";null==b||b.citation_source;var I=(null==b?void 0:b.reasoning)||"No reasoning provided.",S=(null==b?void 0:b.gap)||"",q="number"==typeof(null==b?void 0:b.score)?b.score:0,L=S&&S.trim().length>0?S:"1. No gap identified",P=s.useMemo(function(){return{p:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("p",e.__assign({className:r.default.markdownP},a))},strong:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("strong",e.__assign({className:r.default.markdownStrong},a))},ul:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("ul",e.__assign({className:r.default.markdownUl},a))},ol:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("ol",e.__assign({className:r.default.markdownOl},a))},li:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("li",e.__assign({className:r.default.markdownLi},a))},code:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("code",e.__assign({className:r.default.markdownCode},a))},span:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("span",e.__assign({},a))},br:function(s){s.node;var a=e.__rest(s,["node"]);return n.jsx("br",e.__assign({},a))},a:function(s){s.node;var a=s.href,t=s.children,i=e.__rest(s,["node","href","children"]);return a&&a.includes("doc_id=")?n.jsx(g,{content:y,highlightedText:T,citationTitle:Array.isArray(t)?t.join(""):String(t)}):n.jsx("a",e.__assign({href:a,className:r.default.markdownLink,target:"_blank",rel:"noopener noreferrer"},i,{children:t}))}}},[y,T,k]);return s.useEffect(function(){var e=w.current;if(e){var n=function(){m(e.open)};return e.addEventListener("toggle",n),n(),function(){return e.removeEventListener("toggle",n)}}},[]),n.jsx(n.Fragment,{children:n.jsxs("details",e.__assign({ref:w,open:!0,className:r.default.citationAccordion},{children:[n.jsxs("summary",e.__assign({className:r.default.citationSummary},{children:[n.jsx("span",e.__assign({className:r.default.citationTitle},{children:o})),n.jsx("span",e.__assign({className:r.default.citationChevron},{children:h?n.jsx(a.ChevronUp,{className:r.default.citationChevronIcon}):n.jsx(a.ChevronDown,{className:r.default.citationChevronIcon})}))]})),n.jsxs("div",e.__assign({className:r.default.expandedCard},{children:[n.jsxs("div",e.__assign({className:r.default.mainContent},{children:[n.jsx(f,e.__assign({icon:a.Lightbulb,title:"Decision Making Factors",subtitle:"How the results are fetched?",isOpen:v,onToggle:function(){return x(!v)},iconColorClass:r.default.iconPurple,iconBgClass:r.default.iconBgPurple},{children:n.jsx("div",e.__assign({className:r.default.citationContent},{children:n.jsx(c.default,e.__assign({rehypePlugins:[d.default],components:P},{children:I}))}))})),n.jsx(f,e.__assign({icon:l.GapIcon,title:"Gaps in Decision",subtitle:"What's missing or unclear?",isOpen:j,onToggle:function(){return N(!j)},iconColorClass:r.default.iconPurple,iconBgClass:r.default.iconBgPurple},{children:n.jsx("div",e.__assign({className:r.default.citationContent},{children:n.jsx(c.default,e.__assign({rehypePlugins:[d.default],components:P},{children:L}))}))}))]})),n.jsxs("div",e.__assign({className:r.default.footer},{children:[n.jsxs("div",e.__assign({className:r.default.footerLeft},{children:[n.jsx(u,{className:r.default.decisioningIcon}),n.jsx("span",e.__assign({className:r.default.footerLabel},{children:"Cognitive Decisioning AI"}))]})),n.jsxs("div",e.__assign({className:r.default.footerRight},{children:[n.jsx(a.Sparkles,{className:r.default.sparklesIcon}),n.jsxs("span",e.__assign({className:r.default.scoreLabel},{children:["AI Relevance: ",q,"%"]}))]}))]}))]}))]}))})};
2
2
  //# sourceMappingURL=FaqCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),r=require("@react-pdf-viewer/search"),n=require("@react-pdf-viewer/page-navigation"),o=require("@react-pdf-viewer/zoom");exports.PdfHighlightControls=function(i,a,u,l){var c=t.useState(0),s=c[0],p=c[1],f=t.useRef(!1),h=t.useState(0),g=h[0],v=h[1],d=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,o=0;null!==(t=n.exec(e));){var i=e.slice(o,t.index).trim();i&&r.push(i),t[2]&&r.push(t[2].trim()),o=t.index+t[0].length}var a=e.slice(o).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},m=Object.keys(a).map(Number).sort(function(e,t){return e-t}),_=Object.values(a).filter(function(e){return e>0}).length,y=function(t){if(u.current){var r=u.current.querySelectorAll(".rpv-search__highlights"),n=new Set,o=new Set,a=new Map;r.forEach(function(r){var u=r.getAttribute("data-testid"),l=parseInt((null==u?void 0:u.replace("search__highlights-",""))||"-1"),c=r.querySelectorAll(".rpv-search__highlight");if(l===t){var s=new Set;c.forEach(function(t){var r=t,i=(r.getAttribute("title")||"").toLowerCase(),u=r.style.top,l="".concat(i,"_#$_").concat(u);if(r.style.display="none",n.has(l))if(a.has(l)){var c=a.get(l);a.set(l,e.__spreadArray(e.__spreadArray([],c,!0),[r],!1))}else a.set(l,[r]);else{if(n.add(l),a.has(l)){c=a.get(l);a.set(l,e.__spreadArray(e.__spreadArray([],c,!0),[r],!1))}else a.set(l,[r]);o.has(i)?s.add(l):o.add(i)}});var p=A(b,a);p.forEach(function(e){var t=new Set;e.elements.forEach(function(e){var r=e.style.left,n=e.style.width,o="".concat(r,"_").concat(n);t.has(o)?e.style.display="none":(t.add(o),e.style.display="")})}),console.groupCollapsed("[debug: PDF highlight text]"),console.log("input->",i),console.log("processed text->",b),console.log("dom->processed elements->",p),console.groupEnd()}})}},A=function(e,t){for(var r=Array.from(t.entries()),n=0,o=[],i=function(e){return e.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},a=0,u=e;a<u.length;a++)for(var l=u[a],c=i(l);n<r.length;){var s=r[n],p=s[0],f=s[1];if(n++,c===i(p.split("_#$_")[0])){o.push({chunk:l,matchedKey:p,elements:f});break}}return o},T=function(e){u.current&&u.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),o=t.querySelectorAll(".rpv-search__highlight");e.has(n)||o.forEach(function(e){e.style.display="none"})})},b=i.map(function(e){return d(e)}).flat(),x=r.searchPlugin({keyword:b}),S=n.pageNavigationPlugin(),w=o.zoomPlugin(),q=x.jumpToMatch,P=S.jumpToPage,j=w.zoomTo,E=w.ZoomInButton,M=w.ZoomOutButton,B=w.ZoomPopover,I=function(){if(!f.current)try{q(0),f.current=!0}catch(e){requestAnimationFrame(I)}},O=function(e,t){if(u.current&&u.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var o,i,a=null===(o=u.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(i=u.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var c=l.querySelectorAll(".rpv-search__highlight")[t];if(c){var s=a.getBoundingClientRect(),p=c.getBoundingClientRect(),f=a.scrollTop+(p.top-s.top)-a.clientHeight/2+p.height/2;a.scrollTo({top:f,behavior:"smooth"})}}}};setTimeout(n,300)}},Z=t.useMemo(function(){var e={};return m.forEach(function(t,r){var n=a[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[m,a]),C=function(e){var t=a[m[e]];return(Z[t]||[]).indexOf(e)};return{setHighlightIndex:p,highlightIndex:s,cursorIndex:g,setCursorIndex:v,orderedKeys:m,totalHighlights:_,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=m[r];a[n]>0&&t++}return t},tryJump:I,jumpToPage:P,zoomTo:j,hideNonTargetHighlights:T,deduplicateHighlights:y,plugins:[x,S,w],controls:{ZoomInButton:E,ZoomOutButton:M,ZoomPopover:B,goToNext:function(){for(var e=function(e){var t=m[e];if(a[t]>0){var r=a[t]-1,n=C(e);return v(e),P(a[t]-1),O(r,n),setTimeout(function(){y(r)},500),1===Object.keys(a).length&&T(l),{value:void 0}}},t=g+1;t<m.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=m[e];if(a[t]>0){var r=a[t]-1,n=C(e);return v(e),P(a[t]-1),O(r,n),setTimeout(function(){y(r)},500),1===Object.keys(a).length&&T(l),{value:void 0}}},t=g-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),r=require("@react-pdf-viewer/search"),n=require("@react-pdf-viewer/page-navigation"),o=require("@react-pdf-viewer/zoom");exports.PdfHighlightControls=function(i,a,u,l){var c=t.useState(0),s=c[0],p=c[1],f=t.useRef(!1),h=t.useState(0),g=h[0],v=h[1],d=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,o=0;null!==(t=n.exec(e));){var i=e.slice(o,t.index).trim();i&&r.push(i),t[2]&&r.push(t[2].trim()),o=t.index+t[0].length}var a=e.slice(o).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},m=Object.keys(a).map(Number).sort(function(e,t){return e-t}),_=Object.values(a).filter(function(e){return e>0}).length,y=function(t){if(u.current){var r=u.current.querySelectorAll(".rpv-search__highlights"),n=new Set,o=new Set,a=new Map;r.forEach(function(r){var u=r.getAttribute("data-testid"),l=parseInt((null==u?void 0:u.replace("search__highlights-",""))||"-1"),c=r.querySelectorAll(".rpv-search__highlight");if(l===t){var s=new Set;c.forEach(function(t){var r=t,i=(r.getAttribute("title")||"").toLowerCase(),u=r.style.top,l="".concat(i,"_#$_").concat(u);if(r.style.display="none",n.has(l))if(a.has(l)){var c=a.get(l);a.set(l,e.__spreadArray(e.__spreadArray([],c,!0),[r],!1))}else a.set(l,[r]);else{if(n.add(l),a.has(l)){c=a.get(l);a.set(l,e.__spreadArray(e.__spreadArray([],c,!0),[r],!1))}else a.set(l,[r]);o.has(i)?s.add(l):o.add(i)}});var p=A(b,a);p.forEach(function(e){var t=new Set;e.elements.forEach(function(e){var r=e.style.left,n=e.style.width,o="".concat(r,"_").concat(n);t.has(o)?e.style.display="none":(t.add(o),e.style.display="")})}),console.groupCollapsed("[debug: PDF highlight text]"),console.log("input->",i),console.log("processed text->",b),console.log("dom->processed elements->",p),console.groupEnd()}})}},A=function(e,t){for(var r=Array.from(t.entries()),n=0,o=[],i=function(e){return e.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},a=0;a<e.length;a++)for(var u=e[a],l=i(u);n<r.length;){var c=r[n],s=c[0],p=c[1],f=i(s.split("_#$_")[0]),h=e[a+1],g=r[n+1],v=h?i(h):null,d=g?i(g[0].split("_#$_")[0]):null,m=l===f,_=n+1<r.length&&f===i(r[n+1][0].split("_#$_")[0]),y=m;if(m&&_&&v&&(y=v===d),y){o.push({chunk:u,matchedKey:s,elements:p}),n++;break}n++}return o},T=function(e){u.current&&u.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),o=t.querySelectorAll(".rpv-search__highlight");e.has(n)||o.forEach(function(e){e.style.display="none"})})},b=i.map(function(e){return d(e)}).flat(),x=r.searchPlugin({keyword:b}),S=n.pageNavigationPlugin(),w=o.zoomPlugin(),q=x.jumpToMatch,P=S.jumpToPage,j=w.zoomTo,E=w.ZoomInButton,M=w.ZoomOutButton,B=w.ZoomPopover,I=function(){if(!f.current)try{q(0),f.current=!0}catch(e){requestAnimationFrame(I)}},O=function(e,t){if(u.current&&u.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var o,i,a=null===(o=u.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(i=u.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var c=l.querySelectorAll(".rpv-search__highlight")[t];if(c){var s=a.getBoundingClientRect(),p=c.getBoundingClientRect(),f=a.scrollTop+(p.top-s.top)-a.clientHeight/2+p.height/2;a.scrollTo({top:f,behavior:"smooth"})}}}};setTimeout(n,300)}},Z=t.useMemo(function(){var e={};return m.forEach(function(t,r){var n=a[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[m,a]),C=function(e){var t=a[m[e]];return(Z[t]||[]).indexOf(e)};return{setHighlightIndex:p,highlightIndex:s,cursorIndex:g,setCursorIndex:v,orderedKeys:m,totalHighlights:_,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=m[r];a[n]>0&&t++}return t},tryJump:I,jumpToPage:P,zoomTo:j,hideNonTargetHighlights:T,deduplicateHighlights:y,plugins:[x,S,w],controls:{ZoomInButton:E,ZoomOutButton:M,ZoomPopover:B,goToNext:function(){for(var e=function(e){var t=m[e];if(a[t]>0){var r=a[t]-1,n=C(e);return v(e),P(a[t]-1),O(r,n),setTimeout(function(){y(r)},500),1===Object.keys(a).length&&T(l),{value:void 0}}},t=g+1;t<m.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=m[e];if(a[t]>0){var r=a[t]-1,n=C(e);return v(e),P(a[t]-1),O(r,n),setTimeout(function(){y(r)},500),1===Object.keys(a).length&&T(l),{value:void 0}}},t=g-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};
2
2
  //# sourceMappingURL=usePdfHighlight.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as i,useRef as o,useEffect as r}from"react";import{ChevronDown as d}from"lucide-react";var l=function(l){var a=l.children,s=l.uploadListTopContent,c=l.defaultHeight,u=void 0===c?300:c,p=l.minHeight,f=void 0===p?150:p,m=l.maxHeight,h=l.isExpanded,g=void 0!==h&&h,x=l.onToggle,v=l.onHeightChange,y=l.styles,b=void 0===y?{}:y,w=i(!1),H=w[0],S=w[1],k=i(u),D=k[0],E=k[1],C=o(0),I=o(u),L="string"==typeof m?parseFloat(m)/100*window.innerHeight:null!=m?m:.4*window.innerHeight;return r(function(){if(H){var e=function(e){e.preventDefault();var t=e.clientY-C.current,n=Math.max(f,Math.min(L,I.current+t));E(n),null==v||v(n)},t=function(){S(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[H]),t("div",e({style:e({display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:g?"".concat(D,"px"):"auto",minHeight:g?"".concat(f,"px"):"auto",maxHeight:g?"".concat(D,"px"):"auto",overflow:"hidden",width:"100%"},b.container)},{children:[n("div",e({style:e({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},b.header)},{children:t("button",e({onClick:x,style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n("span",e({style:e({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},b.title)},{children:(null==s?void 0:s.trim())?s:"Data uploaded for your context"})),n("span",e({style:{display:"flex",alignItems:"center",width:16,height:16,transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}},{children:n(d,{})}))]}))})),g&&n("div",e({style:e({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},b.body)},{children:a})),g&&n("div",e({onMouseDown:function(e){e.preventDefault(),S(!0),C.current=e.clientY,I.current=D,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:n("div",{style:e({width:48,height:4,borderRadius:4,background:H?"#a78bfa":"#d1d5db"},b.dragPill)})}))]}))};export{l as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as o,useRef as i,useEffect as r}from"react";import{ChevronDown as d}from"lucide-react";var l=function(l){var a,s=l.children,u=l.uploadListTopContent,c=l.defaultHeight,p=void 0===c?300:c,h=l.minHeight,f=void 0===h?150:h,x=l.maxHeight,m=l.isExpanded,g=void 0!==m&&m,v=l.onToggle,y=l.onHeightChange,b=l.styles,w=void 0===b?{}:b,C=o(!1),H=C[0],S=C[1],k=o(p),E=k[0],B=k[1],D=i(0),I=i(p),L=i(null),R=i(0),z="string"==typeof x?parseFloat(x)/100*window.innerHeight:null!=x?x:.4*window.innerHeight;r(function(){!g&&L.current&&(R.current=L.current.getBoundingClientRect().height)},[g]);return r(function(){if(H){var e=function(e){e.preventDefault();var t=e.clientY-D.current,n=Math.max(f,Math.min(z,I.current+t));B(n),null==y||y(n)},t=function(){S(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[H]),t("div",e({ref:L,style:{position:"relative",width:"100%",minHeight:g?R.current:"auto"}},{children:[t("div",e({style:e({position:g?"absolute":"relative",zIndex:g?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:g?"".concat(E,"px"):"auto",minHeight:g?"".concat(f,"px"):"auto",maxHeight:g?"".concat(E,"px"):"auto",overflow:"hidden",width:"100%"},w.container)},{children:[n("div",e({style:e({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},w.header)},{children:n("span",e({style:e({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},w.title)},{children:(null==u?void 0:u.trim())?u:"Data uploaded for your context"}))})),g&&n("div",e({style:e({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},w.body)},{children:s})),g&&n("div",e({onMouseDown:function(e){e.preventDefault(),S(!0),D.current=e.clientY,I.current=E,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:n("div",{style:e({width:48,height:4,borderRadius:4,background:H?"#a78bfa":"#d1d5db"},w.dragPill)})}))]})),n("div",e({style:{position:g?"absolute":"relative",top:g?"".concat(E,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:g?10:"auto"}},{children:n("button",e({onClick:v,"aria-label":g?"Collapse":"Expand",style:e({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},w.notch)},{children:n(d,{size:14,color:null!==(a=w.notchArrowColor)&&void 0!==a?a:"#6d28d9",style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};export{l as default};
2
2
  //# sourceMappingURL=ChatDrawer.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import n from"react-markdown";import r from"rehype-raw";import o from"remark-gfm";import{forwardRef as s,useState as l,useMemo as d}from"react";import a from"./CognitiveDecisioningWrapper.module.css.js";import{ButtonCognitiveIcon as c}from"../../assests/svg/ButtonCognitiveIcon.js";var h=function(){return t("div",e({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",color:"#6b27d9",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:i("svg",e({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("path",{d:"M9 18h6"}),t("path",{d:"M10 22h4"}),t("path",{d:"M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.55-3 6H8a7 7 0 0 1-3-6 7 7 0 0 1 7-7z"})]}))}))},p=function(){return t("div",e({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#6b27d9",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("path",{d:"M4.92363 2.64844H1.93457V5.34844M1.93457 10.7484V12.5484M8.90904 2.64844H12.9601M16.9455 2.64844H19.9346V5.34844M4.92363 20.6484H1.93457V17.9484"}),t("path",{d:"M18.2707 19.1183C19.6383 17.75 19.6383 15.53 18.2707 14.16C16.9031 12.79 14.6831 12.79 13.3155 14.16C11.9479 15.53 11.9479 17.75 13.3155 19.11C14.6831 20.48 16.9031 20.48 18.2707 19.11ZM18.2707 19.1183L21.1436 21.9987"})]}))}))},f=function(n){var r=n.color,o=void 0===r?"#7b39ed":r,s=n.width,l=void 0===s?13:s,d=n.height,a=void 0===d?13:d,c=n.style;return t("span",e({style:e({display:"inline-flex",alignItems:"center",marginLeft:"4px"},c)},{children:i("svg",e({width:l,height:a,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t("path",{d:"M12.9975 5.40607C12.8868 4.86464 12.1132 4.86464 12.0025 5.40607C11.3236 8.72775 8.72775 11.3236 5.40607 12.0025C4.86464 12.1132 4.86464 12.8868 5.40607 12.9975C8.72775 13.6764 11.3236 16.2723 12.0025 19.5939C12.1132 20.1354 12.8868 20.1354 12.9975 19.5939C13.6764 16.2723 16.2723 13.6764 19.5939 12.9975C20.1354 12.8868 20.1354 12.1132 19.5939 12.0025C16.2723 11.3236 13.6764 8.72775 12.9975 5.40607Z",fill:o}),t("path",{d:"M3.7829 0.026852C3.77558 -0.00895077 3.72442 -0.00895062 3.7171 0.0268522C3.33729 1.88509 1.88509 3.33729 0.0268517 3.7171C-0.00895119 3.72442 -0.00895119 3.77558 0.0268517 3.7829C1.88509 4.16271 3.33729 5.61491 3.7171 7.47315C3.72442 7.50895 3.77558 7.50895 3.7829 7.47315C4.16271 5.61491 5.61491 4.16271 7.47315 3.7829C7.50895 3.77558 7.50895 3.72442 7.47315 3.7171C5.61491 3.33729 4.16271 1.88509 3.7829 0.026852Z",fill:o})]}))}))},g=s(function(s,g){var u=s.reasoning,m=s.gap,v=s.score,C=s.isOpen,y=s.onToggle,k=s.title,x=void 0===k?"Cognitive Decisioning AI":k,b=s.sections,w=s.styles,N=void 0===w?{}:w,M=s.mdComponents,I=void 0===M?{}:M,L=s.headerIcon,T=s.reasoningIcon,j=s.gapIcon,B=s.scoreIcon,H=s.hideTrigger,W=void 0!==H&&H,S=l({reasoning:!0,gap:!0}),D=S[0],V=S[1],A=L||t(c,{}),G=T||t(h,{}),R=j||t(p,{}),Z=B||t(f,{}),O=d(function(){return b||[{id:"reasoning",title:"Reasoning",subtitle:"Why this was picked",icon:G,content:u||"No reasoning provided."},{id:"gap",title:"Gap",subtitle:"What's missing or unclear",icon:R,content:m||"No gaps identified."}]},[b,u,m]),P=d(function(){return[r]},[]),z=d(function(){return[o]},[]);return i("div",e({style:{display:"contents"}},{children:[!W&&i("button",e({onClick:y,className:"".concat(a.pill," ").concat(C?a.pillOpen:a.pillClosed),style:N.pill,"aria-expanded":C},{children:[A,t("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:C?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:t("path",{d:"M6 9l6 6 6-6"})}))]})),C&&i("div",e({ref:g,className:a.container,style:N.container},{children:[i("div",e({className:a.header,style:N.header},{children:[i("div",e({className:a.headerTitle,style:N.headerTitle},{children:[A,t("span",e({className:a.headerTitleText,style:N.headerTitleText},{children:x}))]})),v&&i("div",e({className:a.badge,style:N.badge},{children:[Z,"Decision Strength: ",v,"%"]}))]})),O.map(function(r,o){return i("div",e({className:a.sectionItem,style:N.sectionItem},{children:[i("button",e({onClick:function(){return t=r.id,void V(function(i){var n;return e(e({},i),((n={})[t]=!i[t],n))});var t},className:a.sectionButton,style:N.sectionButton},{children:[i("div",e({className:a.sectionHeaderGroup,style:N.sectionHeaderGroup},{children:[r.icon,i("div",{children:[t("h4",e({className:a.sectionTitle,style:N.sectionTitle},{children:r.title})),r.subtitle&&t("p",e({className:a.sectionSubtitle,style:N.sectionSubtitle},{children:r.subtitle}))]})]})),t("svg",e({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#9CA3AF",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:D[r.id]?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:t("path",{d:"M6 9l6 6 6-6"})}))]})),D[r.id]&&t("div",e({className:a.textContent,style:N.textContent},{children:t(n,e({components:I,rehypePlugins:P,remarkPlugins:z},{children:r.content}))}))]}),r.id)})]}))]}))});g.displayName="CognitiveDecisioningCard";export{g as default};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import n from"react-markdown";import o from"rehype-raw";import r from"remark-gfm";import{forwardRef as s,useState as l,useMemo as d}from"react";import a from"./CognitiveDecisioningWrapper.module.css.js";import{ButtonCognitiveIcon as c}from"../../assests/svg/ButtonCognitiveIcon.js";var h=function(){return t("div",e({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",color:"#6b27d9",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:i("svg",e({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("path",{d:"M9 18h6"}),t("path",{d:"M10 22h4"}),t("path",{d:"M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.55-3 6H8a7 7 0 0 1-3-6 7 7 0 0 1 7-7z"})]}))}))},p=function(){return t("div",e({style:{display:"flex",height:"32px",width:"32px",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5ff",flexShrink:0,border:"1.5px solid #f5f5ff"}},{children:i("svg",e({width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#6b27d9",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},{children:[t("path",{d:"M4.92363 2.64844H1.93457V5.34844M1.93457 10.7484V12.5484M8.90904 2.64844H12.9601M16.9455 2.64844H19.9346V5.34844M4.92363 20.6484H1.93457V17.9484"}),t("path",{d:"M18.2707 19.1183C19.6383 17.75 19.6383 15.53 18.2707 14.16C16.9031 12.79 14.6831 12.79 13.3155 14.16C11.9479 15.53 11.9479 17.75 13.3155 19.11C14.6831 20.48 16.9031 20.48 18.2707 19.11ZM18.2707 19.1183L21.1436 21.9987"})]}))}))},g=function(n){var o=n.color,r=void 0===o?"#7b39ed":o,s=n.width,l=void 0===s?13:s,d=n.height,a=void 0===d?13:d,c=n.style;return t("span",e({style:e({display:"inline-flex",alignItems:"center",marginLeft:"4px"},c)},{children:i("svg",e({width:l,height:a,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t("path",{d:"M12.9975 5.40607C12.8868 4.86464 12.1132 4.86464 12.0025 5.40607C11.3236 8.72775 8.72775 11.3236 5.40607 12.0025C4.86464 12.1132 4.86464 12.8868 5.40607 12.9975C8.72775 13.6764 11.3236 16.2723 12.0025 19.5939C12.1132 20.1354 12.8868 20.1354 12.9975 19.5939C13.6764 16.2723 16.2723 13.6764 19.5939 12.9975C20.1354 12.8868 20.1354 12.1132 19.5939 12.0025C16.2723 11.3236 13.6764 8.72775 12.9975 5.40607Z",fill:r}),t("path",{d:"M3.7829 0.026852C3.77558 -0.00895077 3.72442 -0.00895062 3.7171 0.0268522C3.33729 1.88509 1.88509 3.33729 0.0268517 3.7171C-0.00895119 3.72442 -0.00895119 3.77558 0.0268517 3.7829C1.88509 4.16271 3.33729 5.61491 3.7171 7.47315C3.72442 7.50895 3.77558 7.50895 3.7829 7.47315C4.16271 5.61491 5.61491 4.16271 7.47315 3.7829C7.50895 3.77558 7.50895 3.72442 7.47315 3.7171C5.61491 3.33729 4.16271 1.88509 3.7829 0.026852Z",fill:r})]}))}))},f=s(function(s,f){var u=s.reasoning,m=s.gap,v=s.score,C=s.isOpen,y=s.onToggle,k=s.title,x=void 0===k?"Cognitive Decisioning AI":k,b=s.reasoningTitle,w=void 0===b?"Decision Making Factors":b,M=s.reasoningSubtitle,N=void 0===M?"Why this was picked":M,L=s.gapTitle,T=void 0===L?"Gaps in Decision":L,I=s.gapSubtitle,j=void 0===I?"What's missing or unclear":I,B=s.scoreLabel,H=void 0===B?"Decision Strength: ":B,S=s.sections,W=s.styles,D=void 0===W?{}:W,V=s.mdComponents,A=void 0===V?{}:V,G=s.headerIcon,Z=s.reasoningIcon,F=s.gapIcon,O=s.scoreIcon,P=s.hideTrigger,R=void 0!==P&&P,z=l({reasoning:!0,gap:!0}),q=z[0],E=z[1],J=G||t(c,{}),K=Z||t(h,{}),Q=F||t(p,{}),U=O||t(g,{}),X=d(function(){return S||[{id:"reasoning",title:w,subtitle:N,icon:K,content:u||"No ".concat(w.toLowerCase()," provided.")},{id:"gap",title:T,subtitle:j,icon:Q,content:m||"No ".concat(T.toLowerCase()," provided.")}]},[S,u,m]),Y=d(function(){return[o]},[]),$=d(function(){return[r]},[]);return i("div",e({style:{display:"contents"}},{children:[!R&&i("button",e({onClick:y,className:"".concat(a.pill," ").concat(C?a.pillOpen:a.pillClosed),style:D.pill,"aria-expanded":C},{children:[J,t("svg",e({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:C?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:t("path",{d:"M6 9l6 6 6-6"})}))]})),C&&i("div",e({ref:f,className:a.container,style:D.container},{children:[i("div",e({className:a.header,style:D.header},{children:[i("div",e({className:a.headerTitle,style:D.headerTitle},{children:[J,t("span",e({className:a.headerTitleText,style:D.headerTitleText},{children:x}))]})),v&&i("div",e({className:a.badge,style:D.badge},{children:[U,H,v,"%"]}))]})),X.map(function(o,r){return i("div",e({className:a.sectionItem,style:D.sectionItem},{children:[i("button",e({onClick:function(){return t=o.id,void E(function(i){var n;return e(e({},i),((n={})[t]=!i[t],n))});var t},className:a.sectionButton,style:D.sectionButton},{children:[i("div",e({className:a.sectionHeaderGroup,style:D.sectionHeaderGroup},{children:[o.icon,i("div",{children:[t("h4",e({className:a.sectionTitle,style:D.sectionTitle},{children:o.title})),o.subtitle&&t("p",e({className:a.sectionSubtitle,style:D.sectionSubtitle},{children:o.subtitle}))]})]})),t("svg",e({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#9CA3AF",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:q[o.id]?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}},{children:t("path",{d:"M6 9l6 6 6-6"})}))]})),q[o.id]&&t("div",e({className:a.textContent,style:D.textContent},{children:t(n,e({components:A,rehypePlugins:Y,remarkPlugins:$},{children:o.content}))}))]}),o.id)})]}))]}))});f.displayName="CognitiveDecisioningCard";export{f as default};
2
2
  //# sourceMappingURL=CognitiveDecisioningWrapper.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as n}from"tslib";import{jsx as r,Fragment as i,jsxs as t}from"react/jsx-runtime";import{useState as o,useRef as a,useMemo as c,useEffect as l}from"react";import{ChevronUp as s,ChevronDown as d,Lightbulb as u,Sparkles as m}from"lucide-react";import h from"react-markdown";import C from"rehype-raw";import v from"./FaqCitation.module.css.js";import{GapIcon as p}from"../shared/Audacy/GapIcon.js";var g=function(e){var i=e.className;return r("svg",n({className:i,viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2059 0.857334C8.62849 -0.0137806 6.77225 -0.231241 5.03618 0.251692C3.30011 0.734626 1.8228 1.8794 0.921793 3.43996C0.0207849 5.00052 -0.232 6.85229 0.217771 8.59724C0.667543 10.3422 1.78397 11.841 3.32708 12.7716V15.2653C3.32708 15.3591 3.34555 15.452 3.38145 15.5387C3.41734 15.6253 3.46996 15.7041 3.53629 15.7704C3.60261 15.8367 3.68136 15.8894 3.76802 15.9252C3.85468 15.9611 3.94756 15.9796 4.04136 15.9796C4.13516 15.9796 4.22805 15.9611 4.31471 15.9252C4.40137 15.8894 4.48011 15.8367 4.54644 15.7704C4.61277 15.7041 4.66538 15.6253 4.70128 15.5387C4.73717 15.452 4.75565 15.3591 4.75565 15.2653V12.351C4.75517 12.2196 4.71871 12.0907 4.65021 11.9785C4.58171 11.8663 4.48379 11.775 4.36708 11.7145C3.50392 11.2743 2.77367 10.612 2.25152 9.79584C1.72938 8.97965 1.4342 8.03905 1.39637 7.07087C1.35855 6.10269 1.57946 5.14193 2.03634 4.28749C2.49323 3.43306 3.16958 2.71584 3.99577 2.20967C4.82196 1.7035 5.76813 1.42667 6.73686 1.40769C7.70559 1.38871 8.66188 1.62826 9.50726 2.10168C10.3526 2.5751 11.0566 3.26528 11.5466 4.10116C12.0366 4.93704 12.2949 5.88842 12.2951 6.85733V11.3419C12.2951 11.4498 12.2522 11.5533 12.1759 11.6296C12.0996 11.7059 11.9961 11.7488 11.8882 11.7488H9.64593C9.45649 11.7488 9.27481 11.824 9.14086 11.958C9.0069 12.0919 8.93165 12.2736 8.93165 12.463V15.2653C8.93165 15.4548 9.0069 15.6365 9.14086 15.7704C9.27481 15.9044 9.45649 15.9796 9.64593 15.9796C9.83537 15.9796 10.0171 15.9044 10.151 15.7704C10.285 15.6365 10.3602 15.4548 10.3602 15.2653V13.1773H11.8882C12.1293 13.1773 12.3679 13.1299 12.5906 13.0376C12.8133 12.9454 13.0156 12.8102 13.1861 12.6398C13.3565 12.4693 13.4917 12.267 13.5839 12.0443C13.6762 11.8216 13.7236 11.5829 13.7236 11.3419V6.85848C13.7234 5.63584 13.3974 4.43536 12.7791 3.38058C12.1608 2.3258 11.2726 1.45484 10.2059 0.857334ZM4.98651 3.51676C5.78545 3.05623 6.71898 2.8859 7.62909 3.0346C8.5392 3.1833 9.36997 3.64189 9.98079 4.33276C10.3922 4.7979 10.2779 5.46648 9.85508 5.84705C8.61165 6.97048 6.55108 8.42648 4.50308 8.96933C3.98193 9.10648 3.41051 8.85505 3.21965 8.31791C2.90724 7.43742 2.91289 6.47535 3.23562 5.5986C3.55835 4.72184 4.1778 3.98457 4.98651 3.51676Z",fill:"currentColor"})}))},f=function(e){var i=e.icon,o=e.title,a=e.subtitle,c=e.children,l=e.isOpen,u=e.onToggle,m=e.iconColorClass,h=void 0===m?v.iconPurple:m,C=e.iconBgClass,p=void 0===C?v.iconBgPurple:C;return t("div",n({className:v.sectionBorder},{children:[t("button",n({type:"button",onClick:u,className:v.sectionButton},{children:[t("div",n({className:v.sectionHeader},{children:[r("div",n({className:"".concat(v.iconWrapper," ").concat(p," ").concat(h)},{children:r(i,{className:v.icon})})),t("div",n({className:v.sectionTitles},{children:[r("span",n({className:v.sectionTitle},{children:o})),r("span",n({className:v.sectionSubtitle},{children:a}))]}))]})),r("div",n({className:v.chevronWrapper},{children:r(l?s:d,{className:v.chevron})}))]})),l&&r("div",n({className:v.sectionContent},{children:c}))]}))},N=function(e,n){if(!n||!e)return r("span",{dangerouslySetInnerHTML:{__html:e}});var i=n.trim().split(/\n+|(?<=[.!?])\s+/).map(function(e){return e.trim()}).filter(function(e){return e.length>5}),t=e;return i.forEach(function(e,n){var r=e.split(/\s+/).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("([\\s]|<[^>]+>)*");try{var i=new RegExp("(".concat(r,")"),"gi");t=t.replace(i,function(e){var n=!t.includes('data-first-highlight="true"');return'<mark class="'.concat(v.highlightMark,'" ').concat(n?'data-first-highlight="true"':"",">").concat(e,"</mark>")})}catch(e){console.error("Regex highlight error:",e)}}),r("span",{className:v.citationContainer,dangerouslySetInnerHTML:{__html:t}})},w=function(e){var i=e.content,c=e.highlightedText,u=e.citationTitle,m=o(!1),h=m[0],C=m[1],p=a(null),g=a(!1);return l(function(){h&&p.current&&!g.current&&setTimeout(function(){var e,n=null===(e=p.current)||void 0===e?void 0:e.querySelector('[data-first-highlight="true"]');n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),g.current=!0)},100),h||(g.current=!1)},[h]),t("details",n({open:h,onToggle:function(e){return C(e.target.open)},className:v.nestedAccordion},{children:[t("summary",n({className:v.nestedSummary},{children:[r("span",{children:u}),r("span",n({className:v.nestedChevron},{children:r(h?s:d,{className:v.nestedChevronIcon})}))]})),r("div",n({className:v.nestedCard},{children:r("div",n({ref:p,className:v.nestedCardContent},{children:r("div",n({className:v.nestedText},{children:N(i,c)}))}))}))]}))},k=function(N){var k=N.citation,y=N.children,b=o(!0),T=b[0],x=b[1],I=o(!0),B=I[0],L=I[1],P=o(!0),_=P[0],S=P[1],A=a(null),R=null==k?void 0:k.customMetaData,V=(null==R?void 0:R.citation_title)||"Citation",H=(null==R?void 0:R.content)||"",M=(null==R?void 0:R.highlighted_text)||"";null==R||R.citation_source;var j=(null==R?void 0:R.reasoning)||"No reasoning provided.",E=(null==R?void 0:R.gap)||"",O="number"==typeof(null==R?void 0:R.score)?R.score:0,W=E&&E.trim().length>0?E:"1. No gap identified",q=c(function(){return{p:function(i){i.node;var t=e(i,["node"]);return r("p",n({className:v.markdownP},t))},strong:function(i){i.node;var t=e(i,["node"]);return r("strong",n({className:v.markdownStrong},t))},ul:function(i){i.node;var t=e(i,["node"]);return r("ul",n({className:v.markdownUl},t))},ol:function(i){i.node;var t=e(i,["node"]);return r("ol",n({className:v.markdownOl},t))},li:function(i){i.node;var t=e(i,["node"]);return r("li",n({className:v.markdownLi},t))},code:function(i){i.node;var t=e(i,["node"]);return r("code",n({className:v.markdownCode},t))},span:function(i){i.node;var t=e(i,["node"]);return r("span",n({},t))},br:function(i){i.node;var t=e(i,["node"]);return r("br",n({},t))},a:function(i){i.node;var t=i.href,o=i.children,a=e(i,["node","href","children"]);return t&&t.includes("doc_id=")?r(w,{content:H,highlightedText:M,citationTitle:Array.isArray(o)?o.join(""):String(o)}):r("a",n({href:t,className:v.markdownLink,target:"_blank",rel:"noopener noreferrer"},a,{children:o}))}}},[H,M,V]);return l(function(){var e=A.current;if(e){var n=function(){x(e.open)};return e.addEventListener("toggle",n),n(),function(){return e.removeEventListener("toggle",n)}}},[]),r(i,{children:t("details",n({ref:A,open:!0,className:v.citationAccordion},{children:[t("summary",n({className:v.citationSummary},{children:[r("span",n({className:v.citationTitle},{children:y})),r("span",n({className:v.citationChevron},{children:r(T?s:d,{className:v.citationChevronIcon})}))]})),t("div",n({className:v.expandedCard},{children:[t("div",n({className:v.mainContent},{children:[r(f,n({icon:u,title:"Reasoning",subtitle:"How the results are fetched?",isOpen:B,onToggle:function(){return L(!B)},iconColorClass:v.iconPurple,iconBgClass:v.iconBgPurple},{children:r("div",n({className:v.citationContent},{children:r(h,n({rehypePlugins:[C],components:q},{children:j}))}))})),r(f,n({icon:p,title:"Gap",subtitle:"What's missing or unclear?",isOpen:_,onToggle:function(){return S(!_)},iconColorClass:v.iconPurple,iconBgClass:v.iconBgPurple},{children:r("div",n({className:v.citationContent},{children:r(h,n({rehypePlugins:[C],components:q},{children:W}))}))}))]})),t("div",n({className:v.footer},{children:[t("div",n({className:v.footerLeft},{children:[r(g,{className:v.decisioningIcon}),r("span",n({className:v.footerLabel},{children:"Cognitive Decisioning AI"}))]})),t("div",n({className:v.footerRight},{children:[r(m,{className:v.sparklesIcon}),t("span",n({className:v.scoreLabel},{children:["AI Relevance: ",O,"%"]}))]}))]}))]}))]}))})};export{k as default};
1
+ import{__rest as n,__assign as e}from"tslib";import{jsx as r,Fragment as i,jsxs as t}from"react/jsx-runtime";import{useState as o,useRef as a,useMemo as c,useEffect as l}from"react";import{ChevronUp as s,ChevronDown as d,Lightbulb as u,Sparkles as m}from"lucide-react";import h from"react-markdown";import C from"rehype-raw";import v from"./FaqCitation.module.css.js";import{GapIcon as p}from"../shared/Audacy/GapIcon.js";var g=function(n){var i=n.className;return r("svg",e({className:i,viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.2059 0.857334C8.62849 -0.0137806 6.77225 -0.231241 5.03618 0.251692C3.30011 0.734626 1.8228 1.8794 0.921793 3.43996C0.0207849 5.00052 -0.232 6.85229 0.217771 8.59724C0.667543 10.3422 1.78397 11.841 3.32708 12.7716V15.2653C3.32708 15.3591 3.34555 15.452 3.38145 15.5387C3.41734 15.6253 3.46996 15.7041 3.53629 15.7704C3.60261 15.8367 3.68136 15.8894 3.76802 15.9252C3.85468 15.9611 3.94756 15.9796 4.04136 15.9796C4.13516 15.9796 4.22805 15.9611 4.31471 15.9252C4.40137 15.8894 4.48011 15.8367 4.54644 15.7704C4.61277 15.7041 4.66538 15.6253 4.70128 15.5387C4.73717 15.452 4.75565 15.3591 4.75565 15.2653V12.351C4.75517 12.2196 4.71871 12.0907 4.65021 11.9785C4.58171 11.8663 4.48379 11.775 4.36708 11.7145C3.50392 11.2743 2.77367 10.612 2.25152 9.79584C1.72938 8.97965 1.4342 8.03905 1.39637 7.07087C1.35855 6.10269 1.57946 5.14193 2.03634 4.28749C2.49323 3.43306 3.16958 2.71584 3.99577 2.20967C4.82196 1.7035 5.76813 1.42667 6.73686 1.40769C7.70559 1.38871 8.66188 1.62826 9.50726 2.10168C10.3526 2.5751 11.0566 3.26528 11.5466 4.10116C12.0366 4.93704 12.2949 5.88842 12.2951 6.85733V11.3419C12.2951 11.4498 12.2522 11.5533 12.1759 11.6296C12.0996 11.7059 11.9961 11.7488 11.8882 11.7488H9.64593C9.45649 11.7488 9.27481 11.824 9.14086 11.958C9.0069 12.0919 8.93165 12.2736 8.93165 12.463V15.2653C8.93165 15.4548 9.0069 15.6365 9.14086 15.7704C9.27481 15.9044 9.45649 15.9796 9.64593 15.9796C9.83537 15.9796 10.0171 15.9044 10.151 15.7704C10.285 15.6365 10.3602 15.4548 10.3602 15.2653V13.1773H11.8882C12.1293 13.1773 12.3679 13.1299 12.5906 13.0376C12.8133 12.9454 13.0156 12.8102 13.1861 12.6398C13.3565 12.4693 13.4917 12.267 13.5839 12.0443C13.6762 11.8216 13.7236 11.5829 13.7236 11.3419V6.85848C13.7234 5.63584 13.3974 4.43536 12.7791 3.38058C12.1608 2.3258 11.2726 1.45484 10.2059 0.857334ZM4.98651 3.51676C5.78545 3.05623 6.71898 2.8859 7.62909 3.0346C8.5392 3.1833 9.36997 3.64189 9.98079 4.33276C10.3922 4.7979 10.2779 5.46648 9.85508 5.84705C8.61165 6.97048 6.55108 8.42648 4.50308 8.96933C3.98193 9.10648 3.41051 8.85505 3.21965 8.31791C2.90724 7.43742 2.91289 6.47535 3.23562 5.5986C3.55835 4.72184 4.1778 3.98457 4.98651 3.51676Z",fill:"currentColor"})}))},f=function(n){var i=n.icon,o=n.title,a=n.subtitle,c=n.children,l=n.isOpen,u=n.onToggle,m=n.iconColorClass,h=void 0===m?v.iconPurple:m,C=n.iconBgClass,p=void 0===C?v.iconBgPurple:C;return t("div",e({className:v.sectionBorder},{children:[t("button",e({type:"button",onClick:u,className:v.sectionButton},{children:[t("div",e({className:v.sectionHeader},{children:[r("div",e({className:"".concat(v.iconWrapper," ").concat(p," ").concat(h)},{children:r(i,{className:v.icon})})),t("div",e({className:v.sectionTitles},{children:[r("span",e({className:v.sectionTitle},{children:o})),r("span",e({className:v.sectionSubtitle},{children:a}))]}))]})),r("div",e({className:v.chevronWrapper},{children:r(l?s:d,{className:v.chevron})}))]})),l&&r("div",e({className:v.sectionContent},{children:c}))]}))},N=function(n,e){if(!e||!n)return r("span",{dangerouslySetInnerHTML:{__html:n}});var i=e.trim().split(/\n+|(?<=[.!?])\s+/).map(function(n){return n.trim()}).filter(function(n){return n.length>5}),t=n;return i.forEach(function(n,e){var r=n.split(/\s+/).map(function(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("([\\s]|<[^>]+>)*");try{var i=new RegExp("(".concat(r,")"),"gi");t=t.replace(i,function(n){var e=!t.includes('data-first-highlight="true"');return'<mark class="'.concat(v.highlightMark,'" ').concat(e?'data-first-highlight="true"':"",">").concat(n,"</mark>")})}catch(n){console.error("Regex highlight error:",n)}}),r("span",{className:v.citationContainer,dangerouslySetInnerHTML:{__html:t}})},k=function(n){var i=n.content,c=n.highlightedText,u=n.citationTitle,m=o(!1),h=m[0],C=m[1],p=a(null),g=a(!1);return l(function(){h&&p.current&&!g.current&&setTimeout(function(){var n,e=null===(n=p.current)||void 0===n?void 0:n.querySelector('[data-first-highlight="true"]');e&&(e.scrollIntoView({behavior:"smooth",block:"center"}),g.current=!0)},100),h||(g.current=!1)},[h]),t("details",e({open:h,onToggle:function(n){return C(n.target.open)},className:v.nestedAccordion},{children:[t("summary",e({className:v.nestedSummary},{children:[r("span",{children:u}),r("span",e({className:v.nestedChevron},{children:r(h?s:d,{className:v.nestedChevronIcon})}))]})),r("div",e({className:v.nestedCard},{children:r("div",e({ref:p,className:v.nestedCardContent},{children:r("div",e({className:v.nestedText},{children:N(i,c)}))}))}))]}))},w=function(N){var w=N.citation,y=N.children,b=o(!0),T=b[0],x=b[1],I=o(!0),B=I[0],L=I[1],P=o(!0),_=P[0],S=P[1],A=a(null),M=null==w?void 0:w.customMetaData,V=(null==M?void 0:M.citation_title)||"Citation",H=(null==M?void 0:M.content)||"",R=(null==M?void 0:M.highlighted_text)||"";null==M||M.citation_source;var j=(null==M?void 0:M.reasoning)||"No reasoning provided.",D=(null==M?void 0:M.gap)||"",E="number"==typeof(null==M?void 0:M.score)?M.score:0,O=D&&D.trim().length>0?D:"1. No gap identified",W=c(function(){return{p:function(i){i.node;var t=n(i,["node"]);return r("p",e({className:v.markdownP},t))},strong:function(i){i.node;var t=n(i,["node"]);return r("strong",e({className:v.markdownStrong},t))},ul:function(i){i.node;var t=n(i,["node"]);return r("ul",e({className:v.markdownUl},t))},ol:function(i){i.node;var t=n(i,["node"]);return r("ol",e({className:v.markdownOl},t))},li:function(i){i.node;var t=n(i,["node"]);return r("li",e({className:v.markdownLi},t))},code:function(i){i.node;var t=n(i,["node"]);return r("code",e({className:v.markdownCode},t))},span:function(i){i.node;var t=n(i,["node"]);return r("span",e({},t))},br:function(i){i.node;var t=n(i,["node"]);return r("br",e({},t))},a:function(i){i.node;var t=i.href,o=i.children,a=n(i,["node","href","children"]);return t&&t.includes("doc_id=")?r(k,{content:H,highlightedText:R,citationTitle:Array.isArray(o)?o.join(""):String(o)}):r("a",e({href:t,className:v.markdownLink,target:"_blank",rel:"noopener noreferrer"},a,{children:o}))}}},[H,R,V]);return l(function(){var n=A.current;if(n){var e=function(){x(n.open)};return n.addEventListener("toggle",e),e(),function(){return n.removeEventListener("toggle",e)}}},[]),r(i,{children:t("details",e({ref:A,open:!0,className:v.citationAccordion},{children:[t("summary",e({className:v.citationSummary},{children:[r("span",e({className:v.citationTitle},{children:y})),r("span",e({className:v.citationChevron},{children:r(T?s:d,{className:v.citationChevronIcon})}))]})),t("div",e({className:v.expandedCard},{children:[t("div",e({className:v.mainContent},{children:[r(f,e({icon:u,title:"Decision Making Factors",subtitle:"How the results are fetched?",isOpen:B,onToggle:function(){return L(!B)},iconColorClass:v.iconPurple,iconBgClass:v.iconBgPurple},{children:r("div",e({className:v.citationContent},{children:r(h,e({rehypePlugins:[C],components:W},{children:j}))}))})),r(f,e({icon:p,title:"Gaps in Decision",subtitle:"What's missing or unclear?",isOpen:_,onToggle:function(){return S(!_)},iconColorClass:v.iconPurple,iconBgClass:v.iconBgPurple},{children:r("div",e({className:v.citationContent},{children:r(h,e({rehypePlugins:[C],components:W},{children:O}))}))}))]})),t("div",e({className:v.footer},{children:[t("div",e({className:v.footerLeft},{children:[r(g,{className:v.decisioningIcon}),r("span",e({className:v.footerLabel},{children:"Cognitive Decisioning AI"}))]})),t("div",e({className:v.footerRight},{children:[r(m,{className:v.sparklesIcon}),t("span",e({className:v.scoreLabel},{children:["AI Relevance: ",E,"%"]}))]}))]}))]}))]}))})};export{w as default};
2
2
  //# sourceMappingURL=FaqCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e}from"tslib";import{useState as t,useRef as r,useMemo as n}from"react";import{searchPlugin as o}from"@react-pdf-viewer/search";import{pageNavigationPlugin as i}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as a}from"@react-pdf-viewer/zoom";var c=function(c,u,l,s){var f=t(0),p=f[0],h=f[1],g=r(!1),v=t(0),d=v[0],m=v[1],y=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,o=0;null!==(t=n.exec(e));){var i=e.slice(o,t.index).trim();i&&r.push(i),t[2]&&r.push(t[2].trim()),o=t.index+t[0].length}var a=e.slice(o).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},_=Object.keys(u).map(Number).sort(function(e,t){return e-t}),T=Object.values(u).filter(function(e){return e>0}).length,b=function(t){if(l.current){var r=l.current.querySelectorAll(".rpv-search__highlights"),n=new Set,o=new Set,i=new Map;r.forEach(function(r){var a=r.getAttribute("data-testid"),u=parseInt((null==a?void 0:a.replace("search__highlights-",""))||"-1"),l=r.querySelectorAll(".rpv-search__highlight");if(u===t){var s=new Set;l.forEach(function(t){var r=t,a=(r.getAttribute("title")||"").toLowerCase(),c=r.style.top,u="".concat(a,"_#$_").concat(c);if(r.style.display="none",n.has(u))if(i.has(u)){var l=i.get(u);i.set(u,e(e([],l,!0),[r],!1))}else i.set(u,[r]);else{if(n.add(u),i.has(u)){l=i.get(u);i.set(u,e(e([],l,!0),[r],!1))}else i.set(u,[r]);o.has(a)?s.add(u):o.add(a)}});var f=w(S,i);f.forEach(function(e){var t=new Set;e.elements.forEach(function(e){var r=e.style.left,n=e.style.width,o="".concat(r,"_").concat(n);t.has(o)?e.style.display="none":(t.add(o),e.style.display="")})}),console.groupCollapsed("[debug: PDF highlight text]"),console.log("input->",c),console.log("processed text->",S),console.log("dom->processed elements->",f),console.groupEnd()}})}},w=function(e,t){for(var r=Array.from(t.entries()),n=0,o=[],i=function(e){return e.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},a=0,c=e;a<c.length;a++)for(var u=c[a],l=i(u);n<r.length;){var s=r[n],f=s[0],p=s[1];if(n++,l===i(f.split("_#$_")[0])){o.push({chunk:u,matchedKey:f,elements:p});break}}return o},x=function(e){l.current&&l.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),o=t.querySelectorAll(".rpv-search__highlight");e.has(n)||o.forEach(function(e){e.style.display="none"})})},S=c.map(function(e){return y(e)}).flat(),A=o({keyword:S}),E=i(),j=a(),q=A.jumpToMatch,B=E.jumpToPage,I=j.zoomTo,M=j.ZoomInButton,Z=j.ZoomOutButton,O=j.ZoomPopover,P=function(){if(!g.current)try{q(0),g.current=!0}catch(e){requestAnimationFrame(P)}},k=function(e,t){if(l.current&&l.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var o,i,a=null===(o=l.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var c=null===(i=l.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(c){var u=c.querySelectorAll(".rpv-search__highlight")[t];if(u){var s=a.getBoundingClientRect(),f=u.getBoundingClientRect(),p=a.scrollTop+(f.top-s.top)-a.clientHeight/2+f.height/2;a.scrollTo({top:p,behavior:"smooth"})}}}};setTimeout(n,300)}},C=n(function(){var e={};return _.forEach(function(t,r){var n=u[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[_,u]),F=function(e){var t=u[_[e]];return(C[t]||[]).indexOf(e)};return{setHighlightIndex:h,highlightIndex:p,cursorIndex:d,setCursorIndex:m,orderedKeys:_,totalHighlights:T,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=_[r];u[n]>0&&t++}return t},tryJump:P,jumpToPage:B,zoomTo:I,hideNonTargetHighlights:x,deduplicateHighlights:b,plugins:[A,E,j],controls:{ZoomInButton:M,ZoomOutButton:Z,ZoomPopover:O,goToNext:function(){for(var e=function(e){var t=_[e];if(u[t]>0){var r=u[t]-1,n=F(e);return m(e),B(u[t]-1),k(r,n),setTimeout(function(){b(r)},500),1===Object.keys(u).length&&x(s),{value:void 0}}},t=d+1;t<_.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=_[e];if(u[t]>0){var r=u[t]-1,n=F(e);return m(e),B(u[t]-1),k(r,n),setTimeout(function(){b(r)},500),1===Object.keys(u).length&&x(s),{value:void 0}}},t=d-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};export{c as PdfHighlightControls};
1
+ import{__spreadArray as e}from"tslib";import{useState as t,useRef as r,useMemo as n}from"react";import{searchPlugin as o}from"@react-pdf-viewer/search";import{pageNavigationPlugin as i}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as a}from"@react-pdf-viewer/zoom";var l=function(l,u,c,s){var f=t(0),p=f[0],h=f[1],g=r(!1),v=t(0),d=v[0],m=v[1],_=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,o=0;null!==(t=n.exec(e));){var i=e.slice(o,t.index).trim();i&&r.push(i),t[2]&&r.push(t[2].trim()),o=t.index+t[0].length}var a=e.slice(o).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},y=Object.keys(u).map(Number).sort(function(e,t){return e-t}),T=Object.values(u).filter(function(e){return e>0}).length,b=function(t){if(c.current){var r=c.current.querySelectorAll(".rpv-search__highlights"),n=new Set,o=new Set,i=new Map;r.forEach(function(r){var a=r.getAttribute("data-testid"),u=parseInt((null==a?void 0:a.replace("search__highlights-",""))||"-1"),c=r.querySelectorAll(".rpv-search__highlight");if(u===t){var s=new Set;c.forEach(function(t){var r=t,a=(r.getAttribute("title")||"").toLowerCase(),l=r.style.top,u="".concat(a,"_#$_").concat(l);if(r.style.display="none",n.has(u))if(i.has(u)){var c=i.get(u);i.set(u,e(e([],c,!0),[r],!1))}else i.set(u,[r]);else{if(n.add(u),i.has(u)){c=i.get(u);i.set(u,e(e([],c,!0),[r],!1))}else i.set(u,[r]);o.has(a)?s.add(u):o.add(a)}});var f=w(S,i);f.forEach(function(e){var t=new Set;e.elements.forEach(function(e){var r=e.style.left,n=e.style.width,o="".concat(r,"_").concat(n);t.has(o)?e.style.display="none":(t.add(o),e.style.display="")})}),console.groupCollapsed("[debug: PDF highlight text]"),console.log("input->",l),console.log("processed text->",S),console.log("dom->processed elements->",f),console.groupEnd()}})}},w=function(e,t){for(var r=Array.from(t.entries()),n=0,o=[],i=function(e){return e.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g," ").trim()},a=0;a<e.length;a++)for(var l=e[a],u=i(l);n<r.length;){var c=r[n],s=c[0],f=c[1],p=i(s.split("_#$_")[0]),h=e[a+1],g=r[n+1],v=h?i(h):null,d=g?i(g[0].split("_#$_")[0]):null,m=u===p,_=n+1<r.length&&p===i(r[n+1][0].split("_#$_")[0]),y=m;if(m&&_&&v&&(y=v===d),y){o.push({chunk:l,matchedKey:s,elements:f}),n++;break}n++}return o},x=function(e){c.current&&c.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),o=t.querySelectorAll(".rpv-search__highlight");e.has(n)||o.forEach(function(e){e.style.display="none"})})},S=l.map(function(e){return _(e)}).flat(),A=o({keyword:S}),E=i(),j=a(),q=A.jumpToMatch,B=E.jumpToPage,I=j.zoomTo,M=j.ZoomInButton,Z=j.ZoomOutButton,O=j.ZoomPopover,P=function(){if(!g.current)try{q(0),g.current=!0}catch(e){requestAnimationFrame(P)}},$=function(e,t){if(c.current&&c.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var o,i,a=null===(o=c.current)||void 0===o?void 0:o.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var l=null===(i=c.current)||void 0===i?void 0:i.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(l){var u=l.querySelectorAll(".rpv-search__highlight")[t];if(u){var s=a.getBoundingClientRect(),f=u.getBoundingClientRect(),p=a.scrollTop+(f.top-s.top)-a.clientHeight/2+f.height/2;a.scrollTo({top:p,behavior:"smooth"})}}}};setTimeout(n,300)}},k=n(function(){var e={};return y.forEach(function(t,r){var n=u[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[y,u]),C=function(e){var t=u[y[e]];return(k[t]||[]).indexOf(e)};return{setHighlightIndex:h,highlightIndex:p,cursorIndex:d,setCursorIndex:m,orderedKeys:y,totalHighlights:T,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=y[r];u[n]>0&&t++}return t},tryJump:P,jumpToPage:B,zoomTo:I,hideNonTargetHighlights:x,deduplicateHighlights:b,plugins:[A,E,j],controls:{ZoomInButton:M,ZoomOutButton:Z,ZoomPopover:O,goToNext:function(){for(var e=function(e){var t=y[e];if(u[t]>0){var r=u[t]-1,n=C(e);return m(e),B(u[t]-1),$(r,n),setTimeout(function(){b(r)},500),1===Object.keys(u).length&&x(s),{value:void 0}}},t=d+1;t<y.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=y[e];if(u[t]>0){var r=u[t]-1,n=C(e);return m(e),B(u[t]-1),$(r,n),setTimeout(function(){b(r)},500),1===Object.keys(u).length&&x(s),{value:void 0}}},t=d-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};export{l as PdfHighlightControls};
2
2
  //# sourceMappingURL=usePdfHighlight.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDrawerTest.d.ts","sourceRoot":"","sources":["../../../src/ChatDrawerTest.tsx"],"names":[],"mappings":"AA+CA,MAAM,CAAC,OAAO,UAAU,cAAc,4CA+BrC"}
1
+ {"version":3,"file":"ChatDrawerTest.d.ts","sourceRoot":"","sources":["../../../src/ChatDrawerTest.tsx"],"names":[],"mappings":"AA+CA,MAAM,CAAC,OAAO,UAAU,cAAc,4CAmCrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDrawer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatDrawer/ChatDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2GzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ChatDrawer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatDrawer/ChatDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmLzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -16,6 +16,11 @@ export interface ChatDrawerProps {
16
16
  onToggle?: () => void;
17
17
  /** Called on every drag-resize tick with the new height in px */
18
18
  onHeightChange?: (height: number) => void;
19
+ /**
20
+ * When true (default), drawer is position:fixed at bottom — overlays content.
21
+ * Set to false in library test pages or when you want normal document flow.
22
+ */
23
+ overlay?: boolean;
19
24
  /**
20
25
  * Style overrides for the drawer shell.
21
26
  * Lets consuming teams customize colors, borders, and backgrounds
@@ -32,6 +37,10 @@ export interface ChatDrawerProps {
32
37
  body?: CSSProperties;
33
38
  /** Drag handle pill — background color */
34
39
  dragPill?: CSSProperties;
40
+ /** Notch tab below the drawer — controls background, border, size */
41
+ notch?: CSSProperties;
42
+ /** Arrow/chevron color inside the notch. Default: #6d28d9 */
43
+ notchArrowColor?: string;
35
44
  };
36
45
  }
37
46
  //# sourceMappingURL=ChatDrawer.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDrawer.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatDrawer/types/ChatDrawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oEAAoE;IACpE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACP,oEAAoE;QACpE,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,sDAAsD;QACtD,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,sDAAsD;QACtD,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,oDAAoD;QACpD,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,0CAA0C;QAC1C,QAAQ,CAAC,EAAE,aAAa,CAAC;KAC1B,CAAC;CACH"}
1
+ {"version":3,"file":"ChatDrawer.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatDrawer/types/ChatDrawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oEAAoE;IACpE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACP,oEAAoE;QACpE,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,sDAAsD;QACtD,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,sDAAsD;QACtD,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,oDAAoD;QACpD,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,0CAA0C;QAC1C,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,qEAAqE;QACrE,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,6DAA6D;QAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH"}
@@ -28,6 +28,11 @@ interface Props {
28
28
  isOpen: boolean;
29
29
  onToggle: () => void;
30
30
  title?: string;
31
+ reasoningTitle?: string;
32
+ reasoningSubtitle?: string;
33
+ gapTitle?: string;
34
+ gapSubtitle?: string;
35
+ scoreLabel?: string;
31
36
  sections?: SectionContent[];
32
37
  styles?: StyleOverrides;
33
38
  mdComponents?: Partial<import('react-markdown').Components>;
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveDecisioningWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveDecisioning/CognitiveDecisioningWrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,eAAO,MAAM,kBAAkB,+CAI9B,CAAC;AAyDF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACvC;AAED,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,gBAAgB,EAAE,UAAU,CAAC,CAAC;IAE5D,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,wBAAwB,8EA8I5B,CAAC;AAGH,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"CognitiveDecisioningWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/features/CognitiveDecisioning/CognitiveDecisioningWrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,eAAO,MAAM,kBAAkB,+CAI9B,CAAC;AAyDF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACvC;AAED,UAAU,KAAK;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,gBAAgB,EAAE,UAAU,CAAC,CAAC;IAE5D,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,wBAAwB,8EAmJ5B,CAAC;AAGH,eAAe,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePdfHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/usePdfHighlight.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,oBAAoB,kBAChB,MAAM,EAAE,kBACP,OAAO,MAAM,EAAE,MAAM,CAAC,aAC3B,MAAM,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,oBAC9B,IAAI,MAAM,CAAC;;;;;;;+BAyHI,MAAM;;;;2CAmNM,IAAI,MAAM,CAAC;wCAlId,MAAM;;;;;;;;;CA4TlD,CAAC"}
1
+ {"version":3,"file":"usePdfHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/usePdfHighlight.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,oBAAoB,kBAChB,MAAM,EAAE,kBACP,OAAO,MAAM,EAAE,MAAM,CAAC,aAC3B,MAAM,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,oBAC9B,IAAI,MAAM,CAAC;;;;;;;+BAyHI,MAAM;;;;2CA0OM,IAAI,MAAM,CAAC;wCAzJd,MAAM;;;;;;;;;CAmVlD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.163",
3
+ "version": "0.0.165",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",