@pickaxeproject/react 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/cjs/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
  2. package/dist/cjs/components/Pickaxe/Addons/IceBreaker/index.js +1 -1
  3. package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
  4. package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
  5. package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
  6. package/dist/cjs/components/Pickaxe/Chat/index.js +1 -1
  7. package/dist/cjs/components/Pickaxe/Form/History/Item.js +1 -1
  8. package/dist/cjs/components/Pickaxe/Form/History/Response.js +1 -1
  9. package/dist/cjs/components/Pickaxe/Form/Questions/Document.js +1 -1
  10. package/dist/cjs/components/Pickaxe/common/PickaxeHead.js +1 -1
  11. package/dist/cjs/prose.css +1 -1
  12. package/dist/cjs/src/components/Pickaxe/Addons/IceBreaker/Breaker.d.ts +3 -6
  13. package/dist/cjs/src/components/Pickaxe/Addons/IceBreaker/index.d.ts +3 -7
  14. package/dist/esm/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
  15. package/dist/esm/components/Pickaxe/Addons/IceBreaker/index.js +1 -1
  16. package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
  17. package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
  18. package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
  19. package/dist/esm/components/Pickaxe/Chat/index.js +1 -1
  20. package/dist/esm/components/Pickaxe/Form/History/Item.js +1 -1
  21. package/dist/esm/components/Pickaxe/Form/History/Response.js +1 -1
  22. package/dist/esm/components/Pickaxe/Form/Questions/Document.js +1 -1
  23. package/dist/esm/components/Pickaxe/common/PickaxeHead.js +1 -1
  24. package/dist/esm/prose.css +1 -1
  25. package/dist/esm/src/components/Pickaxe/Addons/IceBreaker/Breaker.d.ts +3 -6
  26. package/dist/esm/src/components/Pickaxe/Addons/IceBreaker/index.d.ts +3 -7
  27. package/package.json +1 -1
  28. package/dist/cjs/hooks/core/useMediaQuery.js +0 -1
  29. package/dist/esm/hooks/core/useMediaQuery.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),s=require("../../../../hooks/core/useHover.js"),o=require("../../../../hooks/studio/useStyleFontSize.js"),t=require("../../../../common/cn.js"),n=require("../../../../hooks/pickaxe/usePickaxeContext.js");exports.default=({text:i="",isMobile:l,onSend:a})=>{const u=s.useHover(),{isHover:c}=u,x=e.__rest(u,["isHover"]),d=o.useStyleFontSize(),{colors:p,styles:j}=n.usePickaxeContext();return r.jsx("div",Object.assign({className:t.default(d.b2,"relative group flex flex-grow cursor-pointer select-none px-[1em] py-[9px] font-semilight transition-colors border w-full",i.length>100?"max-w-[450px]":i.length>70?"max-w-[400px]":"max-w-[300px]",l?"max-w-full":"justify-end"),onClick:()=>null==a?void 0:a(i),style:{background:c?p.secondary:"transparent",borderColor:c?"transparent":p.secondaryText+"30",borderRadius:j.cornerRadius}},x,{children:r.jsx("p",Object.assign({className:t.default("line-clamp-2",l?"":"text-end"),style:{color:c?p.secondaryText:p.secondaryText+"50"}},{children:i}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("../../../../hooks/core/useHover.js"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../../common/cn.js");exports.default=({text:i,onSend:n})=>{const{colors:a,styles:l,forceMobile:x,responsiveBy:c}=o.usePickaxeContext(),u=t.useHover(),{isHover:p}=u,d=e.__rest(u,["isHover"]);return r.jsx("div",Object.assign({className:s.default("relative text-[12px] group flex flex-grow cursor-pointer w-full select-none px-[1em] py-[9px] font-semilight duration-200 transition-colors border w-full ease-in-out","viewport"===c?"min-[767px]:justify-end min-[767px]:max-w-max":"@[767px]/pickaxe-root:justify-end @[767px]/pickaxe-root:max-w-max",x&&"max-w-full"),onClick:()=>null==n?void 0:n(i),style:{background:p?a.secondary:"transparent",borderColor:p?"transparent":a.secondaryText+"30",borderRadius:l.cornerRadius}},d,{children:r.jsx("p",Object.assign({className:s.default("line-clamp-2 duration-200 transition-colors ease-in-out","viewport"===c?"min-[767px]:text-right":"@[767px]/pickaxe-root:text-right",x&&"text-left"),style:{color:p?a.secondaryText:a.secondaryText+"50"}},{children:i}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("framer-motion"),s=require("./Breaker.js"),i=require("../../../../common/cn.js");exports.default=({data:n=[],className:a,isMobile:o,onSend:u})=>{const[c,l]=r.useState(0),d=r.useRef(null);return r.useEffect((()=>{const e=d.current,r=new ResizeObserver((r=>{if(!e)return;if(!r.length)return;const{width:t}=r[0].contentRect;l(e.scrollWidth-t)}));return e&&r.observe(e),()=>{e&&r.unobserve(e)}}),[]),e.jsx(t.motion.div,Object.assign({className:"flex justify-end",ref:d},o&&{whileTap:{cursor:"grab"}},{children:e.jsx(t.motion.div,Object.assign({initial:!1},o&&{drag:"x",dragConstraints:{right:0,left:-c}},{className:i.default("grid grid-cols-1 justify-items-end gap-[0.5em] px-3 py-[1em]",a)},{children:n.map(((r,t)=>e.jsx(s.default,Object.assign({text:r,isMobile:o},u&&{onSend:u}),t)))}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("framer-motion"),i=require("./Breaker.js"),o=require("../../../../common/cn.js");exports.default=({data:s,onSend:n})=>{const{responsiveBy:x}=r.usePickaxeContext();return e.jsx(t.motion.div,Object.assign({className:o.default("flex justify-end flex-col gap-2 pb-4 px-3","viewport"===x?"min-[767px]:items-end min-[767px]:px-0":"@[767px]/pickaxe-root:items-end @[767px]/pickaxe-root:px-0")},{children:s.map(((r,t)=>e.jsx(i.default,{text:r,onSend:n},t)))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/studio/useStyleFontSize.js"),c=require("../../common/PickaxeMarkdown/index.js"),r=require("../../common/PickaxeMarkdown/Renderer.js"),o=require("../../common/PickaxeIcon.js"),i=require("./Document.js"),l=require("../../common/PickaxeCopyButton.js"),n=require("../../../../common/cn.js");exports.default=({index:d,message:x})=>{var m;const{formId:u,pickaxe:j,styles:p,colors:h,misc:k,responsiveBy:b}=a.usePickaxeContext(),[f,v]=s.useState(!1),w=t.useStyleFontSize(),g=null!==(m=null==j?void 0:j.chaticon)&&void 0!==m?m:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${u}.png`;return"assistant"===x.role?e.jsx("div",Object.assign({className:n.default("flex flex-col","viewport"===b?"min-[767px]:max-w-[80%]":"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:"flex gap-x-3"},{children:[k.isChatImage&&"NONE"!==g&&e.jsx(o.default,{src:g,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:h.text}),e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("div",Object.assign({className:n.default(w.b2,"chat-message overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]"),style:{borderRadius:p.cornerRadius}},{children:e.jsx(c.PickaxeMarkdown,Object.assign({theme:p.theme,accentColor:h.accent,linkPreviews:!0,actions:!0},{children:e.jsx(r.PickaxeMarkdownRenderer,Object.assign({value:x.content},0===d&&{maxLines:f?void 0:4,onExpandClick:()=>v(!0)}))}))})),e.jsx("div",Object.assign({className:"mb-2 ml-2 mt-4 flex gap-3"},{children:e.jsx(l.default,{color:h.accent,text:x.content})}))]}))]}))})):"user"===x.role?e.jsx("div",Object.assign({className:n.default("flex gap-x-3 justify-self-end pl-9","viewport"===b?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:n.default(w.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3"),style:{backgroundColor:h.secondary+"80",color:h.secondaryText,borderRadius:p.cornerRadius}},{children:[x.documentIds&&x.documentIds.length>0&&e.jsx("div",Object.assign({className:"flex flex-col items-end"},{children:x.documentIds.map((a=>e.jsx(s.Fragment,{children:a.startsWith("IMAGE-")?e.jsx("div",Object.assign({className:"max-w-[300px]"},{children:e.jsx("img",{style:{borderRadius:p.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${a.split("-")[2]}/${a.split("-")[1]}.${null==a?void 0:a.split("-")[2]}`,alt:""})})):e.jsx(i.default,{documentId:a})},a)))})),e.jsx(c.PickaxeMarkdown,Object.assign({theme:p.theme,accentColor:h.accent},{children:e.jsx(r.PickaxeMarkdownRenderer,{value:x.content})}))]}))})):e.jsx("div",{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/studio/useStyleFontSize.js"),c=require("../../common/PickaxeMarkdown/index.js"),r=require("../../common/PickaxeMarkdown/Renderer.js"),o=require("../../common/PickaxeIcon.js"),i=require("./Document.js"),l=require("../../common/PickaxeCopyButton.js"),n=require("../../../../common/cn.js");exports.default=({index:d,message:x})=>{var m;const{formId:u,pickaxe:j,styles:p,colors:h,misc:k,responsiveBy:f}=a.usePickaxeContext(),[b,v]=s.useState(!1),w=t.useStyleFontSize(),g=null!==(m=null==j?void 0:j.chaticon)&&void 0!==m?m:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${u}.png`;return"assistant"===x.role?e.jsx("div",Object.assign({className:n.default("flex flex-col","viewport"===f?"min-[767px]:max-w-[80%]":"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:"flex gap-x-3"},{children:[k.isChatImage&&"NONE"!==g&&e.jsx(o.default,{src:g,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:h.text}),e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("div",Object.assign({className:n.default(w.b2,"chat-message overflow-x-auto overflow-y-hidden pt-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]"),style:{borderRadius:p.cornerRadius}},{children:e.jsx(c.PickaxeMarkdown,Object.assign({theme:p.theme,accentColor:h.accent,linkPreviews:!0,actions:!0},{children:e.jsx(r.PickaxeMarkdownRenderer,Object.assign({value:x.content},0===d&&{maxLines:b?void 0:4,onExpandClick:()=>v(!0)}))}))})),e.jsx("div",Object.assign({className:"mt-2 flex gap-3"},{children:e.jsx(l.default,{color:h.accent,text:x.content})}))]}))]}))})):"user"===x.role?e.jsx("div",Object.assign({className:n.default("flex gap-x-3 justify-self-end pl-9","viewport"===f?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:n.default(w.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3"),style:{backgroundColor:h.secondary+"80",color:h.secondaryText,borderRadius:p.cornerRadius}},{children:[x.documentIds&&x.documentIds.length>0&&e.jsx("div",Object.assign({className:"flex flex-col items-end"},{children:x.documentIds.map((a=>e.jsx(s.Fragment,{children:a.startsWith("IMAGE-")?e.jsx("div",Object.assign({className:"max-w-[300px]"},{children:e.jsx("img",{style:{borderRadius:p.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${a.split("-")[2]}/${a.split("-")[1]}.${null==a?void 0:a.split("-")[2]}`,alt:""})})):e.jsx(i.default,{documentId:a})},a)))})),e.jsx(c.PickaxeMarkdown,Object.assign({theme:p.theme,accentColor:h.accent},{children:e.jsx(r.PickaxeMarkdownRenderer,{value:x.content})}))]}))})):e.jsx("div",{})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),n=require("../../../../hooks/pickaxe/useConversation.js"),o=require("../../../../hooks/core/useDebounce.js"),l=require("../../common/PickaxeIcon.js"),i=require("../../../Core/ErrorAlert.js"),c=require("../../Addons/Scroll/ScrollLockView.js"),d=require("../../common/PickaxeHead.js"),u=require("../../common/PickaxeInfoModal.js"),x=require("../../common/PickaxeUpgradeCard.js"),m=require("./Message.js"),f=require("../../../../common/cn.js");exports.default=()=>{var j;const g=n.useConversation(),p=r.useStyleFontSize(),{pickaxe:h,styles:b,colors:k,responsiveBy:v,isNewChat:E,setChatId:w}=a.usePickaxeContext(),{messages:y,status:C,limitData:N,error:O}=t.useResponseContext(),[q,S]=s.useState(!1),[B,F]=s.useState(!1),P=s.useRef(null),R=s.useRef(null),I=s.useRef(null),M=s.useMemo((()=>!!g.data&&!(g.data.messages.length<=1)),[g.data]),z=s.useMemo((()=>g.isSuccess&&E&&!M),[g.isSuccess,E,M]),T=o.useDebounce((()=>{D()}),200),D=s.useCallback((()=>{if(!P.current||!I.current)return;const e=P.current.getBoundingClientRect(),s=I.current.getBoundingClientRect().top-e.top;F(s<=210)}),[]);return s.useEffect((()=>{if(!P.current||!I.current)return;const e=new ResizeObserver((()=>{T()}));return e.observe(P.current),e.observe(I.current),()=>{e.disconnect()}}),[]),e.jsxs("div",Object.assign({ref:P,className:"relative flex flex-grow flex-col justify-end"},{children:[q&&e.jsx(u.default,{isOpen:q,onChangeIsOpen:S}),e.jsx("div",Object.assign({ref:R,className:f.default("absolute left-1/2 top-0 flex w-full max-w-[505px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",z&&!B&&"top-1/4 opacity-100")},{children:e.jsx(d.default,{iconClassName:"duration-300 hover:opacity-90",maxLines:2,onIconClick:()=>w("")})})),e.jsx("div",Object.assign({ref:I,className:"pxe-messages-container flex w-full justify-center"},{children:g.isLoading?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[e.jsx("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}})]})):g.isError?e.jsx("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e.jsxs("p",Object.assign({className:f.default(p.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",e.jsx("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):e.jsxs("div",Object.assign({className:"flex flex-col w-full"},{children:[e.jsxs("div",Object.assign({className:f.default("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===v?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[g.data.messages.map(((s,a)=>e.jsx(m.default,{index:a,message:s},a))),y.map(((s,a)=>e.jsx(m.default,{index:g.data.messages.length+a,message:s},a))),"fetching"===C?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==h?void 0:h.chaticon)&&e.jsx(l.default,{src:null!==(j=null==h?void 0:h.chaticon)&&void 0!==j?j:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==h?void 0:h.formid}.png`,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:k.text}),e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:k.secondary+"80",color:k.secondaryText}},{children:[e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}})]}))]})):N?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(x.default,{})})):O?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(i.default,{error:O})})):null]})),e.jsx(c.default,{className:"w-full"})]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),n=require("../../../../hooks/pickaxe/useConversation.js"),o=require("../../../../hooks/core/useDebounce.js"),l=require("../../common/PickaxeIcon.js"),i=require("../../../Core/ErrorAlert.js"),c=require("../../Addons/Scroll/ScrollLockView.js"),d=require("../../common/PickaxeHead.js"),u=require("../../common/PickaxeInfoModal.js"),x=require("../../common/PickaxeUpgradeCard.js"),m=require("./Message.js"),f=require("../../../../common/cn.js");exports.default=()=>{var j;const g=n.useConversation(),p=r.useStyleFontSize(),{pickaxe:h,styles:b,colors:k,responsiveBy:v,isNewChat:E,setChatId:w}=a.usePickaxeContext(),{messages:y,status:C,limitData:N,error:O}=t.useResponseContext(),[q,S]=s.useState(!1),[B,F]=s.useState(!1),P=s.useRef(null),R=s.useRef(null),I=s.useRef(null),M=s.useMemo((()=>!!g.data&&!(g.data.messages.length<=1)),[g.data]),z=s.useMemo((()=>g.isSuccess&&E&&!M),[g.isSuccess,E,M]),T=o.useDebounce((()=>{D()}),200),D=s.useCallback((()=>{if(!P.current||!I.current)return;const e=P.current.getBoundingClientRect(),s=I.current.getBoundingClientRect().top-e.top;F(s<=210)}),[]);return s.useEffect((()=>{if(!P.current||!I.current)return;const e=new ResizeObserver((()=>{T()}));return e.observe(P.current),e.observe(I.current),()=>{e.disconnect()}}),[]),e.jsxs("div",Object.assign({ref:P,className:"relative flex flex-grow flex-col justify-end"},{children:[q&&e.jsx(u.default,{isOpen:q,onChangeIsOpen:S}),e.jsx("div",Object.assign({ref:R,className:f.default("absolute left-1/2 top-0 flex w-full max-w-[550px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",z&&!B&&"top-1/4 opacity-100")},{children:e.jsx(d.default,{iconClassName:"duration-300 hover:opacity-90",maxLines:2,onIconClick:()=>w("")})})),e.jsx("div",Object.assign({ref:I,className:"pxe-messages-container flex w-full justify-center"},{children:g.isLoading?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[e.jsx("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}})]})):g.isError?e.jsx("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e.jsxs("p",Object.assign({className:f.default(p.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",e.jsx("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):e.jsxs("div",Object.assign({className:"flex flex-col w-full"},{children:[e.jsxs("div",Object.assign({className:f.default("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===v?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[g.data.messages.map(((s,a)=>e.jsx(m.default,{index:a,message:s},a))),y.map(((s,a)=>e.jsx(m.default,{index:g.data.messages.length+a,message:s},a))),"fetching"===C?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==h?void 0:h.chaticon)&&e.jsx(l.default,{src:null!==(j=null==h?void 0:h.chaticon)&&void 0!==j?j:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==h?void 0:h.formid}.png`,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:k.text}),e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:k.secondary+"80",color:k.secondaryText}},{children:[e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}})]}))]})):N?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(x.default,{})})):O?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(i.default,{error:O})})):null]})),e.jsx(c.default,{className:"w-full"})]}))}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),o=require("react-textarea-autosize"),r=require("../../../hooks/core/useMediaQuery.js"),i=require("../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../hooks/pickaxe/useResponseContext.js"),n=require("../../../hooks/studio/useStyleInput.js"),l=require("../../../hooks/studio/useStyleFontSize.js"),d=require("../../../hooks/pickaxe/useConversation.js"),c=require("../../../hooks/pickaxe/useSubmit.js"),u=require("../../../hooks/pickaxe/useSubmitResult.js"),m=require("../../../common/documents.js"),p=require("../../../common/error.js"),x=require("../../../common/api/streamer.js"),f=require("../../../common/cn.js"),b=require("../Addons/Document/hooks/useDocument.js"),g=require("../Addons/Scroll/hooks/useScroll.js"),h=require("../../../hooks/core/useHover.js"),j=require("../common/PickaxeBranding.js"),v=require("../Addons/IceBreaker/index.js"),y=require("../../Icons/attach-vertical.svg.js"),k=require("../../Icons/spinner-lines.svg.js"),w=require("../../Icons/file.svg.js"),I=require("../../Icons/x.svg.js"),O=require("../../Icons/arrow-right.svg.js"),N=require("../../../common/utils.js");function q(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C=q(o);exports.default=()=>{var o;const{formId:q,chatId:S,userId:R,studioUserId:D,deploymentId:A,pickaxe:_,styles:T,colors:U,misc:M,responsiveBy:H,isNewChat:E,forceMobile:z,setIsNewChat:B,setIsShowIceBreaker:F,onGenerateComplete:P}=i.usePickaxeContext(),{messages:L,status:W,limits:$,setMessages:G,setStatus:K,setLimitData:Q,setError:J,setIsGenerating:V}=a.useResponseContext(),{documents:X,isUploading:Y,isImageUploadAllowed:Z,upsertDocuments:ee,onFileUpload:se}=b.useDocument(),{scrollStartSession:te,scrollEndSession:oe,scrollToBottom:re}=g.useScroll({auto:!0}),ie=d.useConversation(),ae=c.useSubmit(),ne=u.useSubmitResult(),le=l.useStyleFontSize(),[de,ce]=t.useState(""),ue=h.useHover(),{isHover:me}=ue,pe=e.__rest(ue,["isHover"]),xe=h.useHover(),{isHover:fe}=xe,be=e.__rest(xe,["isHover"]),ge=t.useRef(null),[he]=r.useMediaQuery("(max-width: 767px)"),je=n.useStyleInput(),ve=t.useMemo((()=>{var e,s,t;return!!E&&(!!_&&(!ie.isLoading&&(!((null!==(s=null===(e=ie.data)||void 0===e?void 0:e.messages.length)&&void 0!==s?s:0)>1)&&!!(null===(t=_.icebreakers)||void 0===t?void 0:t.length))))}),[_,E,ie.data,ie.isLoading]),ye=s=>e.__awaiter(void 0,void 0,void 0,(function*(){try{if(Y||"idle"!==W)return;const e=null!=s?s:de;if(!e)return;ce(""),J(""),Q(null),V(!0),B(!1);const t=new Date,o="enduserupload"===(null==_?void 0:_.documentuploadtype),r=X.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),i=r.length?r[r.length-1].documentId:"";K("fetching"),te(),re();const a=Array.from(L);let n=[...a,{id:L.length+1,role:"user",content:e}];G(n),re();const{success:l,data:d,actionData:c,usedDocumentIds:u,endUserDocumentId:m,endUserImageId:p,rawUserInput:f,error:b}=yield ae.mutateAsync(Object.assign(Object.assign(Object.assign({formId:q,responseId:S,value:e},o&&i&&{documentId:i}),D&&{studioUserId:D}),A&&{deploymentId:A}));if(!l)throw new Error(null!=b?b:"An error occurred, please try again.");const g=[];m&&g.push(m),p&&g.push(p),g.length>0&&(n=[...a,Object.assign({id:L.length+1,role:"user",content:e},g&&{documentIds:g})],G(n),re()),ee([]),re();const h=(yield x.streamer({formId:q,responseId:S,data:d,actionData:c})).body;if(!h)throw new Error("Streaming error");const j=h.getReader(),v=new TextDecoder,y=n.length;let k="",w=!0,I=!1;for(;w;){const{value:e,done:s}=yield j.read();w=!s;if(k+=v.decode(e),k)G([...n.slice(0,y),{id:L.length+1,role:"assistant",content:k}]),I||(K("streaming"),I=!0);else if(!w&&!k)throw new Error("Server error")}const O=new Date;k&&(re(),K("idle"),yield ne.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:q,responseId:S,documentIds:u},R&&{userId:R}),D&&{studioUserId:D}),D&&(null==_?void 0:_.studioid)&&{studioId:_.studioid}),A&&{deploymentId:A}),{messages:[Object.assign(Object.assign({role:"user",message:f},g&&{documentIds:g}),{sentAt:t}),{role:"assistant",message:k,sentAt:O}]})),null==P||P(S))}catch(e){let s=p.default(e)||"";s&&!s.includes("Unexpected token 'A',")||(s="Oops! We're experiencing high traffic at the moment. Please try again later.");const t=Object.entries($).find((([e])=>s.includes(e)));t?Q(t[1]):J(s),re()}finally{K("idle"),V(!1),oe()}}));return t.useEffect((()=>{F(ve)}),[ve]),s.jsxs("div",Object.assign({className:f.default("fixed flex w-full flex-col bottom-0 left-0","viewport"===H?"min-[767px]:relative min-[767px]:bottom-auto min-[767px]:left-auto":"absolute @[767px]/pickaxe-root:relative @[767px]/pickaxe-root:bottom-auto @[767px]/pickaxe-root:left-auto")},{children:[!M.isWhiteLabel&&s.jsx("div",Object.assign({className:"flex justify-end pr-3"},{children:s.jsx(j.default,{animateHover:!0})})),ve&&s.jsx(v.default,{data:(null==_?void 0:_.icebreakers)||[],style:{backgroundColor:"transparent",color:U.text},isMobile:z||he,onSend:ye}),s.jsxs("div",Object.assign({id:(null==_?void 0:_.formid)+"--chat-parent",style:je,className:f.default("flex min-h-[56px] flex-col gap-y-2 px-4 py-3 pb-[15px]","block"===T.formFieldStyle&&"shadow")},{children:["idle"===W&&X.length>0&&s.jsx("div",Object.assign({className:f.default("grid grid-cols-1","viewport"===H?"min-[765px]:grid-cols-2":"@[767px]/pickaxe-root:grid-cols-2")},{children:X.map((e=>{var o,r,i;return s.jsx(t.Fragment,{children:"document"===e.type?s.jsxs("div",Object.assign({className:"relative gap-x-[10px] flex items-center px-2 h-[56px] border",style:{borderRadius:je.borderRadius,borderColor:U.secondaryText+"50"}},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:U.accent,borderRadius:je.borderRadius}},{children:Y?s.jsx(k.default,{className:"w-5 h-5 animate-spin",style:{color:U.accentText}}):s.jsx(w.default,{className:"w-5 h-5",style:{color:U.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(f.default(le.b3),"font-medium truncate")},{children:e.name})),s.jsx("p",Object.assign({className:f.default(le.b4,"opacity-80 truncate")},{children:N.formatBytes(e.size)}))]})),s.jsx("button",Object.assign({type:"button",disabled:Y||"idle"!==W,onClick:()=>ee([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:U.accent,borderColor:je.backgroundColor}},{children:s.jsx(I.default,{className:"w-4 h-4",style:{color:U.accentText}})}))]})):"image"===e.type?s.jsxs("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:je.borderRadius}},{children:["finished"===e.status?s.jsx("img",{style:{borderRadius:je.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(o=e.documentId)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[1]}.${null===(i=e.documentId)||void 0===i?void 0:i.split("-")[2]}`,alt:""}):s.jsx("div",{className:"h-full w-full animate-pulse",style:{borderRadius:je.borderRadius,backgroundColor:U.secondary}}),s.jsx("button",Object.assign({type:"button",disabled:Y||"idle"!==W,onClick:()=>ee([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:U.accent,borderColor:je.backgroundColor}},{children:s.jsx(I.default,{className:"w-4 h-4",style:{color:U.accentText}})}))]})):null},e.id)}))})),s.jsxs("div",Object.assign({className:"flex items-end gap-x-2 grow"},{children:[s.jsx(C.default,{id:(null==_?void 0:_.formid)+"--chat-textarea",className:f.default(le.b2,"max-h-60 w-full resize-none border-transparent bg-transparent outline-none ring-0 scrollbar scrollbar-thin placeholder:font-semilight",!de.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:de,placeholder:null!==(o=null==_?void 0:_.placeholdertext)&&void 0!==o?o:"What do you want to talk about?",onChange:e=>ce(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),Y||"idle"!==W||ye()))}}),s.jsxs("div",Object.assign({className:"flex items-center gap-x-2"},{children:["enduserupload"===(null==_?void 0:_.documentuploadtype)&&s.jsxs("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",style:{backgroundColor:fe?U.accent+"10":void 0},disabled:Y||"idle"!==W,onClick:()=>{var e;return null===(e=ge.current)||void 0===e?void 0:e.click()}},be,{children:[s.jsx("input",{id:"file-upload",ref:ge,type:"file",accept:[...m.allowedFileMimeTypes,...Z?m.allowedImageMimeTypes:[]].join(", "),multiple:!1,hidden:!0,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield se(Array.from(s.target.files||[])),s.target.value=""}))}),s.jsx(y.default,{className:"h-6 w-6",style:{color:fe?U.accent:U.accent+"80"}})]})),s.jsx("button",Object.assign({id:(null==_?void 0:_.formid)+"--chat-button",className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",style:{backgroundColor:me?U.accent:U.accent+"10"},disabled:Y||"idle"!==W,onClick:()=>ye()},pe,{children:s.jsx(O.default,{className:"h-6 w-6 shrink-0 stroke-2",style:{color:me?U.accentText:U.accent}})}))]}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),o=require("../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../hooks/pickaxe/useResponseContext.js"),i=require("../../../hooks/studio/useStyleInput.js"),n=require("../../../hooks/studio/useStyleFontSize.js"),a=require("../../../hooks/pickaxe/useConversation.js"),l=require("../../../hooks/pickaxe/useSubmit.js"),d=require("../../../hooks/pickaxe/useSubmitResult.js"),c=require("../../../common/documents.js"),u=require("../../../common/api/streamer.js"),m=require("../Addons/Document/hooks/useDocument.js"),p=require("../Addons/Scroll/hooks/useScroll.js"),x=require("../../../hooks/core/useHover.js"),f=require("../../../common/utils.js"),b=require("../../Icons/attach-vertical.svg.js"),g=require("../../Icons/spinner-lines.svg.js"),h=require("../../Icons/file.svg.js"),j=require("../../Icons/x.svg.js"),v=require("../../Icons/arrow-right.svg.js"),y=require("../common/PickaxeBranding.js"),k=require("../Addons/IceBreaker/index.js"),w=require("react-textarea-autosize"),I=require("../../../common/error.js"),O=require("../../../common/cn.js");function N(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var q=N(w);exports.default=()=>{var w;const{formId:N,chatId:C,userId:S,studioUserId:R,deploymentId:D,pickaxe:A,styles:_,colors:T,misc:U,responsiveBy:H,isNewChat:E,setIsNewChat:z,setIsShowIceBreaker:B,onGenerateComplete:F}=o.usePickaxeContext(),{messages:M,status:P,limits:L,setMessages:W,setStatus:$,setLimitData:G,setError:K,setIsGenerating:J}=r.useResponseContext(),{documents:Q,isUploading:V,isImageUploadAllowed:X,upsertDocuments:Y,onFileUpload:Z}=m.useDocument(),{scrollStartSession:ee,scrollEndSession:se,scrollToBottom:te}=p.useScroll({auto:!0}),oe=a.useConversation(),re=l.useSubmit(),ie=d.useSubmitResult(),ne=n.useStyleFontSize(),ae=i.useStyleInput(),[le,de]=t.useState(""),ce=t.useRef(null),ue=x.useHover(),{isHover:me}=ue,pe=e.__rest(ue,["isHover"]),xe=x.useHover(),{isHover:fe}=xe,be=e.__rest(xe,["isHover"]),ge=t.useMemo((()=>{var e,s,t;return!!E&&(!!A&&(!oe.isLoading&&(!((null!==(s=null===(e=oe.data)||void 0===e?void 0:e.messages.length)&&void 0!==s?s:0)>1)&&!!(null===(t=A.icebreakers)||void 0===t?void 0:t.length))))}),[A,E,oe.data,oe.isLoading]),he=s=>e.__awaiter(void 0,void 0,void 0,(function*(){try{if(V||"idle"!==P)return;const e=null!=s?s:le;if(!e)return;de(""),K(""),G(null),J(!0),z(!1);const t=new Date,o="enduserupload"===(null==A?void 0:A.documentuploadtype),r=Q.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),i=r.length?r[r.length-1].documentId:"";$("fetching"),ee(),te();const n=Array.from(M);let a=[...n,{id:M.length+1,role:"user",content:e}];W(a),te();const{success:l,data:d,actionData:c,usedDocumentIds:m,endUserDocumentId:p,endUserImageId:x,rawUserInput:f,error:b}=yield re.mutateAsync(Object.assign(Object.assign(Object.assign({formId:N,responseId:C,value:e},o&&i&&{documentId:i}),R&&{studioUserId:R}),D&&{deploymentId:D}));if(!l)throw new Error(null!=b?b:"An error occurred, please try again.");const g=[];p&&g.push(p),x&&g.push(x),g.length>0&&(a=[...n,Object.assign({id:M.length+1,role:"user",content:e},g&&{documentIds:g})],W(a),te()),Y([]),te();const h=(yield u.streamer({formId:N,responseId:C,data:d,actionData:c})).body;if(!h)throw new Error("Streaming error");const j=h.getReader(),v=new TextDecoder,y=a.length;let k="",w=!0,I=!1;for(;w;){const{value:e,done:s}=yield j.read();w=!s;if(k+=v.decode(e),k)W([...a.slice(0,y),{id:M.length+1,role:"assistant",content:k}]),I||($("streaming"),I=!0);else if(!w&&!k)throw new Error("Server error")}const O=new Date;k&&(te(),$("idle"),yield ie.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:N,responseId:C,documentIds:m},S&&{userId:S}),R&&{studioUserId:R}),R&&(null==A?void 0:A.studioid)&&{studioId:A.studioid}),D&&{deploymentId:D}),{messages:[Object.assign(Object.assign({role:"user",message:f},g&&{documentIds:g}),{sentAt:t}),{role:"assistant",message:k,sentAt:O}]})),null==F||F(C))}catch(e){let s=I.default(e)||"";s&&!s.includes("Unexpected token 'A',")||(s="Oops! We're experiencing high traffic at the moment. Please try again later.");const t=Object.entries(L).find((([e])=>s.includes(e)));t?G(t[1]):K(s),te()}finally{$("idle"),J(!1),se()}}));return t.useEffect((()=>{B(ge)}),[ge]),s.jsxs("div",Object.assign({className:O.default("fixed flex w-full flex-col bottom-0 left-0","viewport"===H?"min-[767px]:relative min-[767px]:bottom-auto min-[767px]:left-auto":"absolute @[767px]/pickaxe-root:relative @[767px]/pickaxe-root:bottom-auto @[767px]/pickaxe-root:left-auto")},{children:[!U.isWhiteLabel&&s.jsx("div",Object.assign({className:"flex justify-end pr-3 pb-3 @[767px]/pickaxe-root:pr-0"},{children:s.jsx(y.default,{animateHover:!0})})),ge&&s.jsx(k.default,{data:(null==A?void 0:A.icebreakers)||[],onSend:he}),s.jsxs("div",Object.assign({id:(null==A?void 0:A.formid)+"--chat-parent",style:ae,className:O.default("flex min-h-[56px] flex-col gap-y-2 px-4 py-3 pb-[15px]","block"===_.formFieldStyle&&"shadow")},{children:["idle"===P&&Q.length>0&&s.jsx("div",Object.assign({className:O.default("grid grid-cols-1","viewport"===H?"min-[765px]:grid-cols-2":"@[767px]/pickaxe-root:grid-cols-2")},{children:Q.map((e=>{var o,r,i;return s.jsx(t.Fragment,{children:"document"===e.type?s.jsxs("div",Object.assign({className:"relative gap-x-[10px] flex items-center px-2 h-[56px] border",style:{borderRadius:ae.borderRadius,borderColor:T.secondaryText+"50"}},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:T.accent,borderRadius:ae.borderRadius}},{children:V?s.jsx(g.default,{className:"w-5 h-5 animate-spin",style:{color:T.accentText}}):s.jsx(h.default,{className:"w-5 h-5",style:{color:T.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(O.default(ne.b3),"font-medium truncate")},{children:e.name})),s.jsx("p",Object.assign({className:O.default(ne.b4,"opacity-80 truncate")},{children:f.formatBytes(e.size)}))]})),s.jsx("button",Object.assign({type:"button",disabled:V||"idle"!==P,onClick:()=>Y([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:T.accent,borderColor:ae.backgroundColor}},{children:s.jsx(j.default,{className:"w-4 h-4",style:{color:T.accentText}})}))]})):"image"===e.type?s.jsxs("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:ae.borderRadius}},{children:["finished"===e.status?s.jsx("img",{style:{borderRadius:ae.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(o=e.documentId)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[1]}.${null===(i=e.documentId)||void 0===i?void 0:i.split("-")[2]}`,alt:""}):s.jsx("div",{className:"h-full w-full animate-pulse",style:{borderRadius:ae.borderRadius,backgroundColor:T.secondary}}),s.jsx("button",Object.assign({type:"button",disabled:V||"idle"!==P,onClick:()=>Y([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:T.accent,borderColor:ae.backgroundColor}},{children:s.jsx(j.default,{className:"w-4 h-4",style:{color:T.accentText}})}))]})):null},e.id)}))})),s.jsxs("div",Object.assign({className:"flex items-end gap-x-2 grow"},{children:[s.jsx(q.default,{id:(null==A?void 0:A.formid)+"--chat-textarea",className:O.default(ne.b2,"max-h-60 mb-[0.2em] w-full resize-none border-transparent bg-transparent outline-none ring-0 scrollbar scrollbar-thin placeholder:font-semilight",!le.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:le,placeholder:null!==(w=null==A?void 0:A.placeholdertext)&&void 0!==w?w:"What do you want to talk about?",onChange:e=>de(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),V||"idle"!==P||he()))}}),s.jsxs("div",Object.assign({className:"flex items-center gap-x-2"},{children:["enduserupload"===(null==A?void 0:A.documentuploadtype)&&s.jsxs("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors duration-200 ease-in-out",style:{backgroundColor:fe?T.accent+"10":void 0},disabled:V||"idle"!==P,onClick:()=>{var e;return null===(e=ce.current)||void 0===e?void 0:e.click()}},be,{children:[s.jsx("input",{id:"file-upload",ref:ce,type:"file",accept:[...c.allowedFileMimeTypes,...X?c.allowedImageMimeTypes:[]].join(", "),multiple:!1,hidden:!0,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield Z(Array.from(s.target.files||[])),s.target.value=""}))}),s.jsx(b.default,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:fe?T.accent:T.accent+"80"}})]})),s.jsx("button",Object.assign({id:(null==A?void 0:A.formid)+"--chat-button",className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full duration-200 transition-colors ease-in-out",style:{backgroundColor:me?T.accent:T.accent+"10"},disabled:V||"idle"!==P,onClick:()=>he()},pe,{children:s.jsx(v.default,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:me?T.accentText:T.accent}})}))]}))]}))]}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../Addons/Scroll/hooks/useScrollContext.js"),t=require("../../Core/ScrollArea.js"),o=require("./History/index.js"),l=require("./Input.js"),i=require("../../../common/cn.js"),c=require("../Addons/Document/hooks/useDocument.js"),x=require("react");exports.default=()=>{const{isShowIceBreaker:a,responsiveBy:u}=r.usePickaxeContext(),{scrollContainerRef:n}=s.useScrollContext(),{upsertDocuments:p}=c.useDocument();return x.useEffect((()=>()=>{p([])}),[]),e.jsx("div",Object.assign({className:"relative flex flex-grow flex-col items-center"},{children:e.jsxs("div",Object.assign({className:"relative flex w-full max-w-[800px] flex-grow flex-col"},{children:[e.jsx("div",Object.assign({className:i.default("flex w-full flex-grow flex-col pb-[4.5rem]","viewport"===u?"min-[767px]:pb-24":"@[767px]/pickaxe-root:pb-24",a&&"pb-[310px]",a&&("viewport"===u?"min-[767px]:pb-[330px]":"@[767px]/pickaxe-root:pb-[330px]"))},{children:e.jsx(t.default,Object.assign({ref:n,hideScrollbar:!0},{children:e.jsx(o.default,{})}))})),e.jsx("div",Object.assign({className:i.default("absolute bottom-0 flex w-full justify-center","viewport"===u?"min-[767px]:mt-4 min-[767px]:mb-6":"@[767px]/pickaxe-root:mt-4 @[767px]/pickaxe-root:mb-6")},{children:e.jsx(l.default,{})}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../Addons/Scroll/hooks/useScrollContext.js"),t=require("../Addons/Document/hooks/useDocument.js"),o=require("react"),l=require("../../Core/ScrollArea.js"),i=require("./History/index.js"),c=require("./Input.js"),x=require("../../../common/cn.js");exports.default=()=>{const{isShowIceBreaker:a,responsiveBy:u}=r.usePickaxeContext(),{scrollContainerRef:n}=s.useScrollContext(),{upsertDocuments:p}=t.useDocument();return o.useEffect((()=>()=>{p([])}),[]),e.jsx("div",Object.assign({className:"relative flex flex-grow flex-col items-center"},{children:e.jsxs("div",Object.assign({className:"relative flex w-full max-w-[800px] flex-grow flex-col"},{children:[e.jsx("div",Object.assign({className:x.default("flex w-full flex-grow flex-col pb-[6rem]","viewport"===u?"min-[767px]:pb-[7.5rem]":"@[767px]/pickaxe-root:pb-[7.5rem]",a&&"pb-[310px]",a&&("viewport"===u?"min-[767px]:pb-[330px]":"@[767px]/pickaxe-root:pb-[330px]"))},{children:e.jsx(l.default,Object.assign({ref:n,hideScrollbar:!0},{children:e.jsx(i.default,{})}))})),e.jsx("div",Object.assign({className:x.default("absolute bottom-0 flex w-full justify-center","viewport"===u?"min-[767px]:mt-4 min-[767px]:mb-6":"@[767px]/pickaxe-root:mt-4 @[767px]/pickaxe-root:mb-6")},{children:e.jsx(c.default,{})}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),t=require("date-fns"),r=require("../../common/PickaxeMarkdown/index.js"),n=require("../../common/PickaxeMarkdown/Renderer.js"),i=require("../../../Icons/message-square-notes.svg.js"),l=require("../../../Icons/visitor.svg.js"),c=require("../../common/PickaxeIcon.js"),d=require("../../common/PickaxeSimpleButton.js"),u=require("../../common/PickaxeCopyButton.js"),m=require("../../../../common/cn.js"),x=require("../../Addons/Document/hooks/useDocument.js");exports.default=({item:h})=>{const{pickaxe:p,styles:j,colors:f,misc:g,setChatId:v,setIsNewChat:b}=o.usePickaxeContext(),k=a.useStyleFontSize(),{upsertDocuments:y}=x.useDocument(),w=s.useMemo((()=>t.format(h.createdAt,"hh:mm a MMM dd, yy")),[h]),N=s.useMemo((()=>h&&h.messages?h.messages.length:0),[h]),q=s.useMemo((()=>{var e,s,o,a;if("form"===h.type){return(null!==(e=h.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(a=null===(o=null===(s=h.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==a?a:""}),[h]),O=s.useMemo((()=>{var e,s,o,a;return"form"===h.type?null!==(e=h.questionResponse)&&void 0!==e?e:"":null!==(a=null===(o=null===(s=h.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==a?a:""}),[h]);return e.jsxs("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:f.primary,color:f.text}},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(l.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[e.jsx("input",{id:`${h.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:q.length<280}),e.jsx("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:q}}),e.jsx("label",Object.assign({htmlFor:`${h.responseId}-input`,className:m.default(k.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:f.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${h.responseId}-input`,className:m.default(k.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:f.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:f.secondary,color:f.secondaryText}},{children:[g.isChatImage&&e.jsx(c.default,{src:null==p?void 0:p.chaticon,alt:`${null==p?void 0:p.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:f.secondaryText}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(r.PickaxeMarkdown,Object.assign({theme:j.theme,accentColor:f.accent,linkPreviews:!0,actions:!0},{children:e.jsx(n.PickaxeMarkdownRenderer,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:O})})),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==p?void 0:p.enablechatresponses)&&e.jsxs(d.default,Object.assign({color:f.accent,onClick:()=>{return e=h.responseId,y([]),b(!1),void v(e);var e}},{children:[e.jsx(i.default,{className:"h-4 w-4 shrink-0"}),e.jsx("p",Object.assign({className:m.default(k.b3,"font-semibold")},{children:N+1}))]})),e.jsx(u.default,{color:f.accent,text:O})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:m.default(k.b3,"font-semibold uppercase opacity-30")},{children:w}))}))]}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),t=require("../../Addons/Document/hooks/useDocument.js"),r=require("date-fns"),n=require("../../common/PickaxeMarkdown/index.js"),i=require("../../common/PickaxeMarkdown/Renderer.js"),l=require("../../../Icons/message-square-notes.svg.js"),c=require("../../../Icons/visitor.svg.js"),d=require("../../common/PickaxeIcon.js"),u=require("../../common/PickaxeSimpleButton.js"),m=require("../../common/PickaxeCopyButton.js"),x=require("../../../../common/cn.js");exports.default=({item:h})=>{const{pickaxe:p,styles:j,colors:f,misc:g,setChatId:v,setIsNewChat:b}=o.usePickaxeContext(),k=a.useStyleFontSize(),{upsertDocuments:y}=t.useDocument(),w=s.useMemo((()=>r.format(h.createdAt,"hh:mm a MMM dd, yy")),[h]),N=s.useMemo((()=>h&&h.messages?h.messages.length:0),[h]),q=s.useMemo((()=>{var e,s,o,a;if("form"===h.type){return(null!==(e=h.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(a=null===(o=null===(s=h.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==a?a:""}),[h]),O=s.useMemo((()=>{var e,s,o,a;return"form"===h.type?null!==(e=h.questionResponse)&&void 0!==e?e:"":null!==(a=null===(o=null===(s=h.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==a?a:""}),[h]);return e.jsxs("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:f.primary,color:f.text}},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(c.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[e.jsx("input",{id:`${h.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:q.length<280}),e.jsx("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:q}}),e.jsx("label",Object.assign({htmlFor:`${h.responseId}-input`,className:x.default(k.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:f.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${h.responseId}-input`,className:x.default(k.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:f.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:f.secondary,color:f.secondaryText}},{children:[g.isChatImage&&e.jsx(d.default,{src:null==p?void 0:p.chaticon,alt:`${null==p?void 0:p.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:f.secondaryText}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(n.PickaxeMarkdown,Object.assign({theme:j.theme,accentColor:f.accent,linkPreviews:!0,actions:!0},{children:e.jsx(i.PickaxeMarkdownRenderer,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:O})})),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==p?void 0:p.enablechatresponses)&&e.jsxs(u.default,Object.assign({color:f.accent,onClick:()=>{return e=h.responseId,y([]),b(!1),void v(e);var e}},{children:[e.jsx(l.default,{className:"h-4 w-4 shrink-0"}),e.jsx("p",Object.assign({className:x.default(k.b3,"font-semibold")},{children:N+1}))]})),e.jsx(m.default,{color:f.accent,text:O})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:x.default(k.b3,"font-semibold uppercase opacity-30")},{children:w}))}))]}))]}))]}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),r=require("../../Addons/Scroll/hooks/useScrollContext.js"),n=require("../../../../hooks/studio/useStyleFontSize.js"),a=require("date-fns"),l=require("../../common/PickaxeMarkdown/index.js"),c=require("../../common/PickaxeMarkdown/Renderer.js"),i=require("../../../Icons/message-square-notes.svg.js"),d=require("../../../Icons/visitor.svg.js"),u=require("../../common/PickaxeIcon.js"),x=require("../../common/PickaxeSimpleButton.js"),h=require("../../common/PickaxeCopyButton.js"),m=require("../../Addons/Scroll/ScrollLockView.js"),p=require("../../../../common/cn.js"),j=require("../../Addons/Document/hooks/useDocument.js");exports.default=()=>{var f;const{pickaxe:b,styles:g,colors:k,misc:v,setChatId:y,setIsNewChat:w}=o.usePickaxeContext(),{response:q}=t.useResponseContext(),{scrollTargetRef:N,scrollContainerRef:C}=r.useScrollContext(),O=n.useStyleFontSize(),{upsertDocuments:M}=j.useDocument(),I=s.useMemo((()=>q?a.format(q.createdAt,"hh:mm a MMM dd, yy"):a.format(new Date,"hh:mm a MMM dd, yy")),[q]),S=s.useMemo((()=>{var e;if(!q)return"";return(null!==(e=q.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[q]);return q?e.jsxs("div",Object.assign({ref:N,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:k.primary,color:k.text}},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(d.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[e.jsx("input",{id:`${q.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:S.length<280}),e.jsx("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:S}}),e.jsx("label",Object.assign({htmlFor:`${q.responseId}-input`,className:p.default(O.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:k.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${q.responseId}-input`,className:p.default(O.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:k.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[v.isChatImage&&e.jsx(u.default,{src:null==b?void 0:b.chaticon,alt:`${null==b?void 0:b.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:k.secondaryText}),e.jsxs("div",Object.assign({ref:C,className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(l.PickaxeMarkdown,Object.assign({theme:g.theme,accentColor:k.accent,linkPreviews:!0,actions:!0},{children:e.jsx(c.PickaxeMarkdownRenderer,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:q.questionResponse})})),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==b?void 0:b.enablechatresponses)&&e.jsxs(x.default,Object.assign({color:k.accent,onClick:()=>{return e=q.responseId,M([]),w(!1),void y(e);var e}},{children:[e.jsx(i.default,{className:"h-4 w-4 shrink-0"}),e.jsx("p",Object.assign({className:p.default(O.b3,"font-semibold")},{children:q.messages.length+1}))]})),e.jsx(h.default,{color:k.accent,text:null!==(f=q.questionResponse)&&void 0!==f?f:""})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:p.default(O.b3,"font-semibold uppercase opacity-30")},{children:I}))}))]}))]}))]})),e.jsx(m.default,{className:"w-full"})]})):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),r=require("../../Addons/Scroll/hooks/useScrollContext.js"),n=require("../../../../hooks/studio/useStyleFontSize.js"),a=require("../../Addons/Document/hooks/useDocument.js"),l=require("date-fns"),c=require("../../common/PickaxeMarkdown/index.js"),i=require("../../common/PickaxeMarkdown/Renderer.js"),d=require("../../../Icons/message-square-notes.svg.js"),u=require("../../../Icons/visitor.svg.js"),x=require("../../common/PickaxeIcon.js"),h=require("../../common/PickaxeSimpleButton.js"),m=require("../../common/PickaxeCopyButton.js"),p=require("../../Addons/Scroll/ScrollLockView.js"),j=require("../../../../common/cn.js");exports.default=()=>{var f;const{pickaxe:b,styles:g,colors:k,misc:v,setChatId:y,setIsNewChat:w}=o.usePickaxeContext(),{response:q}=t.useResponseContext(),{scrollTargetRef:N,scrollContainerRef:C}=r.useScrollContext(),O=n.useStyleFontSize(),{upsertDocuments:M}=a.useDocument(),I=s.useMemo((()=>q?l.format(q.createdAt,"hh:mm a MMM dd, yy"):l.format(new Date,"hh:mm a MMM dd, yy")),[q]),S=s.useMemo((()=>{var e;if(!q)return"";return(null!==(e=q.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[q]);return q?e.jsxs("div",Object.assign({ref:N,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:k.primary,color:k.text}},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(u.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[e.jsx("input",{id:`${q.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:S.length<280}),e.jsx("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:S}}),e.jsx("label",Object.assign({htmlFor:`${q.responseId}-input`,className:j.default(O.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:k.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${q.responseId}-input`,className:j.default(O.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:k.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[v.isChatImage&&e.jsx(x.default,{src:null==b?void 0:b.chaticon,alt:`${null==b?void 0:b.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:k.secondaryText}),e.jsxs("div",Object.assign({ref:C,className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(c.PickaxeMarkdown,Object.assign({theme:g.theme,accentColor:k.accent,linkPreviews:!0,actions:!0},{children:e.jsx(i.PickaxeMarkdownRenderer,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:q.questionResponse})})),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==b?void 0:b.enablechatresponses)&&e.jsxs(h.default,Object.assign({color:k.accent,onClick:()=>{return e=q.responseId,M([]),w(!1),void y(e);var e}},{children:[e.jsx(d.default,{className:"h-4 w-4 shrink-0"}),e.jsx("p",Object.assign({className:j.default(O.b3,"font-semibold")},{children:q.messages.length+1}))]})),e.jsx(m.default,{color:k.accent,text:null!==(f=q.questionResponse)&&void 0!==f?f:""})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:j.default(O.b3,"font-semibold uppercase opacity-30")},{children:I}))}))]}))]}))]})),e.jsx(p.default,{className:"w-full"})]})):null};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),l=require("../../../../hooks/studio/useStyleInput.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),i=require("../../Addons/Document/hooks/useDocument.js"),n=require("../../../../common/documents.js"),o=require("../../../Icons/attach-vertical.svg.js"),c=require("../../../Icons/check.svg.js"),d=require("../../../Core/ErrorAlert.js"),u=require("../../../../common/cn.js"),b=require("../../../Icons/spinner-lines.svg.js"),m=require("../../../Icons/file.svg.js"),x=require("../../../Icons/x.svg.js"),j=require("../../../Icons/link.svg.js"),f=require("../../../../common/utils.js"),p=require("../../../../hooks/core/useHover.js");exports.default=({field:h,update:g})=>{const y=r.useStyleFontSize(),{colors:v,responsiveBy:w}=a.usePickaxeContext(),N=p.useHover(),{isHover:k}=N,O=e.__rest(N,["isHover"]),{documents:C,documentError:q,websiteLink:I,isUploading:R,isImageUploadAllowed:T,upsertDocuments:_,setDocumentError:D,setWebsiteLink:F,onFileUpload:S,onWebsiteUpload:A}=i.useDocument({onQuestionChange:e=>{g(Object.assign(Object.assign({},h),e))}}),[U,z]=t.useState(!1),E=t.useRef(null),H=l.useStyleInput();return s.jsxs("div",Object.assign({className:"flex flex-col gap-y-4"},{children:[s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[s.jsx("p",Object.assign({className:u.default(y.b3,"font-semibold opacity-70")},{children:h.main})),h.isRequired&&s.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:v.error}},{children:"*"}))]})),s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsx("input",{ref:E,type:"file",accept:[...n.allowedFileMimeTypes,...T?n.allowedImageMimeTypes:[]].join(", "),id:h.id,hidden:!0,multiple:!1,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield S(Array.from(s.target.files||[])),s.target.value=""})),disabled:R}),s.jsxs("div",Object.assign({className:u.default("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 duration-300 ease-in-out transition-all shadow hover:shadow-none",U&&"shadow"),style:H},{children:[s.jsx("input",{type:"text",value:I,className:u.default(y.b2,"w-full outline-none bg-transparent placeholder:font-semilight"),placeholder:"Paste a website/video link or drag a file",onChange:e=>F(e.target.value),onDrop:s=>e.__awaiter(void 0,void 0,void 0,(function*(){s.preventDefault(),yield S(Array.from(s.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),A(I))},onFocus:()=>z(!0),onBlur:()=>z(!1)}),s.jsx("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:I.length>0?s.jsxs(s.Fragment,{children:[s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:R,onClick:()=>A(I)},{children:s.jsx(c.default,{className:"h-5 w-5 shrink-0",style:{color:v.accent}})})),s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:R,onClick:()=>{F(""),D("")}},{children:s.jsx(x.default,{className:"h-6 w-6 shrink-0",style:{color:v.accent}})}))]}):s.jsx("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",disabled:R,onClick:()=>{var e;null===(e=E.current)||void 0===e||e.click()},style:{backgroundColor:k?v.accent+"10":void 0}},O,{children:s.jsx(o.default,{className:"h-6 w-6",style:{color:k?v.accent:v.accent+"80"}})}))}))]}))]}))]})),C.length>0&&s.jsx("div",Object.assign({className:u.default("flex gap-4","viewport"===w?"min-[765px]:flex-col":"@[767px]/pickaxe-root:flex-col")},{children:C.map((e=>{var a,l,r;return s.jsx(t.Fragment,{children:"document"===e.type?s.jsxs("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:H},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:v.accent,borderRadius:H.borderRadius}},{children:R?s.jsx(b.default,{className:"w-5 h-5 animate-spin",style:{color:v.accentText}}):s.jsx(m.default,{className:"w-5 h-5",style:{color:v.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(u.default(y.b3),"font-medium truncate")},{children:e.name})),s.jsx("p",Object.assign({className:u.default(y.b4,"opacity-80 truncate")},{children:f.formatBytes(e.size)}))]})),s.jsx("button",Object.assign({type:"button",disabled:R,onClick:()=>_([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:v.accent,borderColor:H.backgroundColor}},{children:s.jsx(x.default,{className:"w-4 h-4",style:{color:v.accentText}})}))]})):"image"===e.type?s.jsxs("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:H.borderRadius}},{children:["finished"===e.status?s.jsx("img",{style:{borderRadius:H.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(a=e.documentId)||void 0===a?void 0:a.split("-")[2]}/${null===(l=e.documentId)||void 0===l?void 0:l.split("-")[1]}.${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[2]}`,alt:""}):s.jsx("div",{className:"h-full w-full animate-pulse",style:{borderRadius:H.borderRadius,backgroundColor:v.secondary}}),s.jsx("button",Object.assign({type:"button",disabled:R,onClick:()=>_([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:v.accent,borderColor:H.backgroundColor}},{children:s.jsx(x.default,{className:"w-4 h-4",style:{color:v.accentText}})}))]})):"website"===e.type?s.jsxs("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:H},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:v.accent,borderRadius:H.borderRadius}},{children:R?s.jsx(b.default,{className:"w-5 h-5 animate-spin",style:{color:v.accentText}}):s.jsx(j.default,{className:"w-5 h-5",style:{color:v.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(u.default(y.b3),"font-medium truncate")},{children:new URL(e.name).hostname})),s.jsx("p",Object.assign({className:u.default(y.b4,"opacity-80 truncate")},{children:"Website"}))]})),s.jsx("button",Object.assign({type:"button",disabled:R,onClick:()=>_([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:v.accent,borderColor:H.backgroundColor}},{children:s.jsx(x.default,{className:"w-4 h-4",style:{color:v.accentText}})}))]})):null},e.id)}))})),q&&s.jsx(d.default,{error:q,className:"mt-3"})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),l=require("../../../../hooks/studio/useStyleInput.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),i=require("../../Addons/Document/hooks/useDocument.js"),n=require("../../../../hooks/core/useHover.js"),o=require("../../../../common/documents.js"),c=require("../../../../common/utils.js"),d=require("../../../Icons/attach-vertical.svg.js"),u=require("../../../Icons/check.svg.js"),b=require("../../../Icons/spinner-lines.svg.js"),m=require("../../../Icons/file.svg.js"),x=require("../../../Icons/x.svg.js"),j=require("../../../Icons/link.svg.js"),f=require("../../../Core/ErrorAlert.js"),p=require("../../../../common/cn.js");exports.default=({field:h,update:g})=>{const y=r.useStyleFontSize(),{colors:v,responsiveBy:w}=a.usePickaxeContext(),N=n.useHover(),{isHover:k}=N,O=e.__rest(N,["isHover"]),{documents:C,documentError:q,websiteLink:I,isUploading:R,isImageUploadAllowed:T,upsertDocuments:_,setDocumentError:D,setWebsiteLink:F,onFileUpload:S,onWebsiteUpload:A}=i.useDocument({onQuestionChange:e=>{g(Object.assign(Object.assign({},h),e))}}),[U,z]=t.useState(!1),E=t.useRef(null),H=l.useStyleInput();return s.jsxs("div",Object.assign({className:"flex flex-col gap-y-4"},{children:[s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[s.jsx("p",Object.assign({className:p.default(y.b3,"font-semibold opacity-70")},{children:h.main})),h.isRequired&&s.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:v.error}},{children:"*"}))]})),s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsx("input",{ref:E,type:"file",accept:[...o.allowedFileMimeTypes,...T?o.allowedImageMimeTypes:[]].join(", "),id:h.id,hidden:!0,multiple:!1,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield S(Array.from(s.target.files||[])),s.target.value=""})),disabled:R}),s.jsxs("div",Object.assign({className:p.default("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 duration-300 ease-in-out transition-all shadow hover:shadow-none",U&&"shadow"),style:H},{children:[s.jsx("input",{type:"text",value:I,className:p.default(y.b2,"w-full outline-none bg-transparent placeholder:font-semilight"),placeholder:"Paste a website/video link or drag a file",onChange:e=>F(e.target.value),onDrop:s=>e.__awaiter(void 0,void 0,void 0,(function*(){s.preventDefault(),yield S(Array.from(s.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),A(I))},onFocus:()=>z(!0),onBlur:()=>z(!1)}),s.jsx("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:I.length>0?s.jsxs(s.Fragment,{children:[s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:R,onClick:()=>A(I)},{children:s.jsx(u.default,{className:"h-5 w-5 shrink-0",style:{color:v.accent}})})),s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:R,onClick:()=>{F(""),D("")}},{children:s.jsx(x.default,{className:"h-6 w-6 shrink-0",style:{color:v.accent}})}))]}):s.jsx("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",disabled:R,onClick:()=>{var e;null===(e=E.current)||void 0===e||e.click()},style:{backgroundColor:k?v.accent+"10":void 0}},O,{children:s.jsx(d.default,{className:"h-6 w-6",style:{color:k?v.accent:v.accent+"80"}})}))}))]}))]}))]})),C.length>0&&s.jsx("div",Object.assign({className:p.default("flex gap-4","viewport"===w?"min-[765px]:flex-col":"@[767px]/pickaxe-root:flex-col")},{children:C.map((e=>{var a,l,r;return s.jsx(t.Fragment,{children:"document"===e.type?s.jsxs("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:H},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:v.accent,borderRadius:H.borderRadius}},{children:R?s.jsx(b.default,{className:"w-5 h-5 animate-spin",style:{color:v.accentText}}):s.jsx(m.default,{className:"w-5 h-5",style:{color:v.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(p.default(y.b3),"font-medium truncate")},{children:e.name})),s.jsx("p",Object.assign({className:p.default(y.b4,"opacity-80 truncate")},{children:c.formatBytes(e.size)}))]})),s.jsx("button",Object.assign({type:"button",disabled:R,onClick:()=>_([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:v.accent,borderColor:H.backgroundColor}},{children:s.jsx(x.default,{className:"w-4 h-4",style:{color:v.accentText}})}))]})):"image"===e.type?s.jsxs("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:H.borderRadius}},{children:["finished"===e.status?s.jsx("img",{style:{borderRadius:H.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(a=e.documentId)||void 0===a?void 0:a.split("-")[2]}/${null===(l=e.documentId)||void 0===l?void 0:l.split("-")[1]}.${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[2]}`,alt:""}):s.jsx("div",{className:"h-full w-full animate-pulse",style:{borderRadius:H.borderRadius,backgroundColor:v.secondary}}),s.jsx("button",Object.assign({type:"button",disabled:R,onClick:()=>_([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:v.accent,borderColor:H.backgroundColor}},{children:s.jsx(x.default,{className:"w-4 h-4",style:{color:v.accentText}})}))]})):"website"===e.type?s.jsxs("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:H},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:v.accent,borderRadius:H.borderRadius}},{children:R?s.jsx(b.default,{className:"w-5 h-5 animate-spin",style:{color:v.accentText}}):s.jsx(j.default,{className:"w-5 h-5",style:{color:v.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(p.default(y.b3),"font-medium truncate")},{children:new URL(e.name).hostname})),s.jsx("p",Object.assign({className:p.default(y.b4,"opacity-80 truncate")},{children:"Website"}))]})),s.jsx("button",Object.assign({type:"button",disabled:R,onClick:()=>_([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:v.accent,borderColor:H.backgroundColor}},{children:s.jsx(x.default,{className:"w-4 h-4",style:{color:v.accentText}})}))]})):null},e.id)}))})),q&&s.jsx(f.default,{error:q,className:"mt-3"})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),t=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../hooks/studio/useStyleFontSize.js"),r=require("./PickaxeMarkdown/Renderer.js"),n=require("./PickaxeIcon.js"),o=require("./PickaxeInfoModal.js"),c=require("./PickaxeMarkdown/index.js"),l=require("../../../common/cn.js");exports.default=({iconClassName:a,maxLines:u,onIconClick:d})=>{const{pickaxe:x,styles:m,colors:j,misc:k}=t.usePickaxeContext(),[p,f]=i.useState(!1),h=s.useStyleFontSize(),P=i.useMemo((()=>({title:(null==x?void 0:x.formtitle)||"",description:(null==x?void 0:x.formdescription)||""})),[x]);return e.jsxs("div",Object.assign({className:"flex flex-col items-center"},{children:[p&&e.jsx(o.default,{isOpen:p,onChangeIsOpen:f}),k.isProfileImage&&e.jsx(n.default,Object.assign({src:null==x?void 0:x.coverphoto,alt:`${null==x?void 0:x.formtitle}'s Profile Picture`,width:72,height:72,className:l.default("h-[72px] w-[72px] rounded-full",a)},d&&{onClick:d})),k.isTitle&&!!P.title&&e.jsx("h2",Object.assign({className:l.default(h.h2,"mt-6 text-center font-semilight opacity-90",!u&&"line-clamp-2")},{children:null==x?void 0:x.formtitle})),k.isDescription&&!!P.description&&e.jsx(c.PickaxeMarkdown,Object.assign({theme:m.theme,accentColor:j.accent},{children:e.jsx(r.PickaxeMarkdownRenderer,Object.assign({className:"mt-2 text-center",value:P.description},u&&{maxLines:u},{onExpandClick:()=>f(!0)}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),t=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../hooks/studio/useStyleFontSize.js"),r=require("./PickaxeMarkdown/Renderer.js"),o=require("./PickaxeIcon.js"),n=require("./PickaxeInfoModal.js"),c=require("./PickaxeMarkdown/index.js"),l=require("../../../common/cn.js");exports.default=({iconClassName:a,maxLines:u,onIconClick:d})=>{const{pickaxe:x,styles:m,colors:j,misc:k}=t.usePickaxeContext(),[p,f]=i.useState(!1),h=s.useStyleFontSize(),P=i.useMemo((()=>({title:(null==x?void 0:x.formtitle)||"",description:(null==x?void 0:x.formdescription)||""})),[x]);return e.jsxs("div",Object.assign({className:"flex flex-col items-center"},{children:[p&&e.jsx(n.default,{isOpen:p,onChangeIsOpen:f}),k.isProfileImage&&e.jsx(o.default,Object.assign({src:null==x?void 0:x.coverphoto,alt:`${null==x?void 0:x.formtitle}'s Profile Picture`,width:72,height:72,className:l.default("h-[72px] w-[72px] rounded-full",a,!!d&&"cursor-pointer")},d&&{onClick:d})),k.isTitle&&!!P.title&&e.jsx("h2",Object.assign({className:l.default(h.h2,"mt-6 text-center font-semilight opacity-90",!u&&"line-clamp-2")},{children:null==x?void 0:x.formtitle})),k.isDescription&&!!P.description&&e.jsx(c.PickaxeMarkdown,Object.assign({theme:m.theme,accentColor:j.accent},{children:e.jsx(r.PickaxeMarkdownRenderer,Object.assign({className:"mt-2 text-center",value:P.description},u&&{maxLines:u},{onExpandClick:()=>f(!0)}))}))]}))};
@@ -1 +1 @@
1
- .pxe-prose p{font-weight:350}.pxe-prose>p{margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-code,.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-youtube{margin-bottom:2.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child),.pxe-prose>p:not(:first-child) .pxe-markdown-image,.pxe-prose>p:not(:first-child) .pxe-markdown-youtube,.pxe-prose>pre:not(:first-child){margin-top:2.5rem}
1
+ .pxe-prose p{font-weight:350;margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-code,.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-youtube{margin-bottom:2.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child),.pxe-prose>p:not(:first-child) .pxe-markdown-image,.pxe-prose>p:not(:first-child) .pxe-markdown-youtube,.pxe-prose>pre:not(:first-child){margin-top:2.5rem}
@@ -1,9 +1,6 @@
1
- import type { CSSProperties } from "react";
2
1
  interface BreakerProps {
3
- text?: string;
4
- style?: CSSProperties;
5
- isMobile?: boolean;
6
- onSend?: (value: string) => void;
2
+ text: string;
3
+ onSend: (value: string) => void;
7
4
  }
8
- declare const Breaker: ({ text, isMobile, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const Breaker: ({ text, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
9
6
  export default Breaker;
@@ -1,10 +1,6 @@
1
- import { type CSSProperties } from "react";
2
1
  interface IceBreakersProps {
3
- data?: string[];
4
- className?: string;
5
- style?: CSSProperties;
6
- isMobile?: boolean;
7
- onSend?: (value: string) => void;
2
+ data: string[];
3
+ onSend: (value: string) => void;
8
4
  }
9
- declare const IceBreakers: ({ data, className, isMobile, onSend, }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const IceBreakers: ({ data, onSend }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element;
10
6
  export default IceBreakers;
@@ -1 +1 @@
1
- import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{useHover as r}from"../../../../hooks/core/useHover.js";import{useStyleFontSize as s}from"../../../../hooks/studio/useStyleFontSize.js";import t from"../../../../common/cn.js";import{usePickaxeContext as n}from"../../../../hooks/pickaxe/usePickaxeContext.js";const i=({text:i="",isMobile:l,onSend:a})=>{const c=r(),{isHover:m}=c,x=e(c,["isHover"]),p=s(),{colors:d,styles:u}=n();return o("div",Object.assign({className:t(p.b2,"relative group flex flex-grow cursor-pointer select-none px-[1em] py-[9px] font-semilight transition-colors border w-full",i.length>100?"max-w-[450px]":i.length>70?"max-w-[400px]":"max-w-[300px]",l?"max-w-full":"justify-end"),onClick:()=>null==a?void 0:a(i),style:{background:m?d.secondary:"transparent",borderColor:m?"transparent":d.secondaryText+"30",borderRadius:u.cornerRadius}},x,{children:o("p",Object.assign({className:t("line-clamp-2",l?"":"text-end"),style:{color:m?d.secondaryText:d.secondaryText+"50"}},{children:i}))}))};export{i as default};
1
+ import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{useHover as r}from"../../../../hooks/core/useHover.js";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import s from"../../../../common/cn.js";const i=({text:i,onSend:n})=>{const{colors:a,styles:l,forceMobile:c,responsiveBy:x}=t(),p=r(),{isHover:m}=p,u=e(p,["isHover"]);return o("div",Object.assign({className:s("relative text-[12px] group flex flex-grow cursor-pointer w-full select-none px-[1em] py-[9px] font-semilight duration-200 transition-colors border w-full ease-in-out","viewport"===x?"min-[767px]:justify-end min-[767px]:max-w-max":"@[767px]/pickaxe-root:justify-end @[767px]/pickaxe-root:max-w-max",c&&"max-w-full"),onClick:()=>null==n?void 0:n(i),style:{background:m?a.secondary:"transparent",borderColor:m?"transparent":a.secondaryText+"30",borderRadius:l.cornerRadius}},u,{children:o("p",Object.assign({className:s("line-clamp-2 duration-200 transition-colors ease-in-out","viewport"===x?"min-[767px]:text-right":"@[767px]/pickaxe-root:text-right",c&&"text-left"),style:{color:m?a.secondaryText:a.secondaryText+"50"}},{children:i}))}))};export{i as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as r,useRef as t,useEffect as i}from"react";import{motion as s}from"framer-motion";import n from"./Breaker.js";import o from"../../../../common/cn.js";const a=({data:a=[],className:c,isMobile:m,onSend:l})=>{const[d,f]=r(0),u=t(null);return i((()=>{const e=u.current,r=new ResizeObserver((r=>{if(!e)return;if(!r.length)return;const{width:t}=r[0].contentRect;f(e.scrollWidth-t)}));return e&&r.observe(e),()=>{e&&r.unobserve(e)}}),[]),e(s.div,Object.assign({className:"flex justify-end",ref:u},m&&{whileTap:{cursor:"grab"}},{children:e(s.div,Object.assign({initial:!1},m&&{drag:"x",dragConstraints:{right:0,left:-d}},{className:o("grid grid-cols-1 justify-items-end gap-[0.5em] px-3 py-[1em]",c)},{children:a.map(((r,t)=>e(n,Object.assign({text:r,isMobile:m},l&&{onSend:l}),t)))}))}))};export{a as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{motion as t}from"framer-motion";import r from"./Breaker.js";import i from"../../../../common/cn.js";const m=({data:m,onSend:p})=>{const{responsiveBy:n}=o();return e(t.div,Object.assign({className:i("flex justify-end flex-col gap-2 pb-4 px-3","viewport"===n?"min-[767px]:items-end min-[767px]:px-0":"@[767px]/pickaxe-root:items-end @[767px]/pickaxe-root:px-0")},{children:m.map(((o,t)=>e(r,{text:o,onSend:p},t)))}))};export{m as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as o,Fragment as t}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as c}from"../../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdown as i}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as r}from"../../common/PickaxeMarkdown/Renderer.js";import l from"../../common/PickaxeIcon.js";import n from"./Document.js";import m from"../../common/PickaxeCopyButton.js";import d from"../../../../common/cn.js";const x=({index:x,message:p})=>{var h;const{formId:u,pickaxe:f,styles:b,colors:v,misc:g,responsiveBy:j}=a(),[w,k]=o(!1),y=c(),N=null!==(h=null==f?void 0:f.chaticon)&&void 0!==h?h:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${u}.png`;return"assistant"===p.role?e("div",Object.assign({className:d("flex flex-col","viewport"===j?"min-[767px]:max-w-[80%]":"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:"flex gap-x-3"},{children:[g.isChatImage&&"NONE"!==N&&e(l,{src:N,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:v.text}),s("div",Object.assign({className:"flex flex-col"},{children:[e("div",Object.assign({className:d(y.b2,"chat-message overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]"),style:{borderRadius:b.cornerRadius}},{children:e(i,Object.assign({theme:b.theme,accentColor:v.accent,linkPreviews:!0,actions:!0},{children:e(r,Object.assign({value:p.content},0===x&&{maxLines:w?void 0:4,onExpandClick:()=>k(!0)}))}))})),e("div",Object.assign({className:"mb-2 ml-2 mt-4 flex gap-3"},{children:e(m,{color:v.accent,text:p.content})}))]}))]}))})):"user"===p.role?e("div",Object.assign({className:d("flex gap-x-3 justify-self-end pl-9","viewport"===j?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:d(y.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3"),style:{backgroundColor:v.secondary+"80",color:v.secondaryText,borderRadius:b.cornerRadius}},{children:[p.documentIds&&p.documentIds.length>0&&e("div",Object.assign({className:"flex flex-col items-end"},{children:p.documentIds.map((s=>e(t,{children:s.startsWith("IMAGE-")?e("div",Object.assign({className:"max-w-[300px]"},{children:e("img",{style:{borderRadius:b.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${s.split("-")[2]}/${s.split("-")[1]}.${null==s?void 0:s.split("-")[2]}`,alt:""})})):e(n,{documentId:s})},s)))})),e(i,Object.assign({theme:b.theme,accentColor:v.accent},{children:e(r,{value:p.content})}))]}))})):e("div",{})};export{x as default};
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as o,Fragment as t}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as c}from"../../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdown as i}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as r}from"../../common/PickaxeMarkdown/Renderer.js";import n from"../../common/PickaxeIcon.js";import l from"./Document.js";import m from"../../common/PickaxeCopyButton.js";import d from"../../../../common/cn.js";const x=({index:x,message:p})=>{var h;const{formId:u,pickaxe:f,styles:b,colors:v,misc:g,responsiveBy:j}=a(),[w,k]=o(!1),y=c(),N=null!==(h=null==f?void 0:f.chaticon)&&void 0!==h?h:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${u}.png`;return"assistant"===p.role?e("div",Object.assign({className:d("flex flex-col","viewport"===j?"min-[767px]:max-w-[80%]":"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:"flex gap-x-3"},{children:[g.isChatImage&&"NONE"!==N&&e(n,{src:N,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:v.text}),s("div",Object.assign({className:"flex flex-col"},{children:[e("div",Object.assign({className:d(y.b2,"chat-message overflow-x-auto overflow-y-hidden pt-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]"),style:{borderRadius:b.cornerRadius}},{children:e(i,Object.assign({theme:b.theme,accentColor:v.accent,linkPreviews:!0,actions:!0},{children:e(r,Object.assign({value:p.content},0===x&&{maxLines:w?void 0:4,onExpandClick:()=>k(!0)}))}))})),e("div",Object.assign({className:"mt-2 flex gap-3"},{children:e(m,{color:v.accent,text:p.content})}))]}))]}))})):"user"===p.role?e("div",Object.assign({className:d("flex gap-x-3 justify-self-end pl-9","viewport"===j?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:d(y.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3"),style:{backgroundColor:v.secondary+"80",color:v.secondaryText,borderRadius:b.cornerRadius}},{children:[p.documentIds&&p.documentIds.length>0&&e("div",Object.assign({className:"flex flex-col items-end"},{children:p.documentIds.map((s=>e(t,{children:s.startsWith("IMAGE-")?e("div",Object.assign({className:"max-w-[300px]"},{children:e("img",{style:{borderRadius:b.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${s.split("-")[2]}/${s.split("-")[1]}.${null==s?void 0:s.split("-")[2]}`,alt:""})})):e(l,{documentId:s})},s)))})),e(i,Object.assign({theme:b.theme,accentColor:v.accent},{children:e(r,{value:p.content})}))]}))})):e("div",{})};export{x as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as a,useRef as o,useMemo as t,useCallback as r,useEffect as n}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as l}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as c}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as d}from"../../../../hooks/pickaxe/useConversation.js";import{useDebounce as m}from"../../../../hooks/core/useDebounce.js";import u from"../../common/PickaxeIcon.js";import p from"../../../Core/ErrorAlert.js";import x from"../../Addons/Scroll/ScrollLockView.js";import f from"../../common/PickaxeHead.js";import g from"../../common/PickaxeInfoModal.js";import h from"../../common/PickaxeUpgradeCard.js";import b from"./Message.js";import j from"../../../../common/cn.js";const k=()=>{var k;const E=d(),v=c(),{pickaxe:w,styles:y,colors:N,responsiveBy:C,isNewChat:O,setChatId:B}=i(),{messages:F,status:S,limitData:I,error:P}=l(),[R,T]=a(!1),[z,L]=a(!1),A=o(null),D=o(null),H=o(null),M=t((()=>!!E.data&&!(E.data.messages.length<=1)),[E.data]),$=t((()=>E.isSuccess&&O&&!M),[E.isSuccess,O,M]),U=m((()=>{V()}),200),V=r((()=>{if(!A.current||!H.current)return;const e=A.current.getBoundingClientRect(),s=H.current.getBoundingClientRect().top-e.top;L(s<=210)}),[]);return n((()=>{if(!A.current||!H.current)return;const e=new ResizeObserver((()=>{U()}));return e.observe(A.current),e.observe(H.current),()=>{e.disconnect()}}),[]),e("div",Object.assign({ref:A,className:"relative flex flex-grow flex-col justify-end"},{children:[R&&s(g,{isOpen:R,onChangeIsOpen:T}),s("div",Object.assign({ref:D,className:j("absolute left-1/2 top-0 flex w-full max-w-[505px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",$&&!z&&"top-1/4 opacity-100")},{children:s(f,{iconClassName:"duration-300 hover:opacity-90",maxLines:2,onIconClick:()=>B("")})})),s("div",Object.assign({ref:H,className:"pxe-messages-container flex w-full justify-center"},{children:E.isLoading?e("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[s("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===y.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===y.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===y.theme?"#1E1E1F":"#E5E7EB"}})]})):E.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:j(v.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):e("div",Object.assign({className:"flex flex-col w-full"},{children:[e("div",Object.assign({className:j("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===C?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[E.data.messages.map(((e,a)=>s(b,{index:a,message:e},a))),F.map(((e,a)=>s(b,{index:E.data.messages.length+a,message:e},a))),"fetching"===S?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==w?void 0:w.chaticon)&&s(u,{src:null!==(k=null==w?void 0:w.chaticon)&&void 0!==k?k:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==w?void 0:w.formid}.png`,alt:`${null==w?void 0:w.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:N.text}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:N.secondary+"80",color:N.secondaryText}},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:N.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:N.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:N.secondaryText}})]}))]})):I?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(h,{})})):P?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(p,{error:P})})):null]})),s(x,{className:"w-full"})]}))}))]}))};export{k as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as a,useRef as o,useMemo as t,useCallback as r,useEffect as n}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as l}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as c}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as d}from"../../../../hooks/pickaxe/useConversation.js";import{useDebounce as m}from"../../../../hooks/core/useDebounce.js";import u from"../../common/PickaxeIcon.js";import p from"../../../Core/ErrorAlert.js";import x from"../../Addons/Scroll/ScrollLockView.js";import f from"../../common/PickaxeHead.js";import g from"../../common/PickaxeInfoModal.js";import h from"../../common/PickaxeUpgradeCard.js";import b from"./Message.js";import j from"../../../../common/cn.js";const k=()=>{var k;const E=d(),v=c(),{pickaxe:w,styles:y,colors:N,responsiveBy:C,isNewChat:O,setChatId:B}=i(),{messages:F,status:S,limitData:I,error:P}=l(),[R,T]=a(!1),[z,L]=a(!1),A=o(null),D=o(null),H=o(null),M=t((()=>!!E.data&&!(E.data.messages.length<=1)),[E.data]),$=t((()=>E.isSuccess&&O&&!M),[E.isSuccess,O,M]),U=m((()=>{V()}),200),V=r((()=>{if(!A.current||!H.current)return;const e=A.current.getBoundingClientRect(),s=H.current.getBoundingClientRect().top-e.top;L(s<=210)}),[]);return n((()=>{if(!A.current||!H.current)return;const e=new ResizeObserver((()=>{U()}));return e.observe(A.current),e.observe(H.current),()=>{e.disconnect()}}),[]),e("div",Object.assign({ref:A,className:"relative flex flex-grow flex-col justify-end"},{children:[R&&s(g,{isOpen:R,onChangeIsOpen:T}),s("div",Object.assign({ref:D,className:j("absolute left-1/2 top-0 flex w-full max-w-[550px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",$&&!z&&"top-1/4 opacity-100")},{children:s(f,{iconClassName:"duration-300 hover:opacity-90",maxLines:2,onIconClick:()=>B("")})})),s("div",Object.assign({ref:H,className:"pxe-messages-container flex w-full justify-center"},{children:E.isLoading?e("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[s("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===y.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===y.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===y.theme?"#1E1E1F":"#E5E7EB"}})]})):E.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:j(v.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):e("div",Object.assign({className:"flex flex-col w-full"},{children:[e("div",Object.assign({className:j("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===C?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[E.data.messages.map(((e,a)=>s(b,{index:a,message:e},a))),F.map(((e,a)=>s(b,{index:E.data.messages.length+a,message:e},a))),"fetching"===S?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==w?void 0:w.chaticon)&&s(u,{src:null!==(k=null==w?void 0:w.chaticon)&&void 0!==k?k:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==w?void 0:w.formid}.png`,alt:`${null==w?void 0:w.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:N.text}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:N.secondary+"80",color:N.secondaryText}},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:N.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:N.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:N.secondaryText}})]}))]})):I?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(h,{})})):P?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(p,{error:P})})):null]})),s(x,{className:"w-full"})]}))}))]}))};export{k as default};
@@ -1 +1 @@
1
- import{__rest as e,__awaiter as o}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";import{useState as r,useRef as i,useMemo as n,useEffect as l,Fragment as a}from"react";import d from"react-textarea-autosize";import{useMediaQuery as c}from"../../../hooks/core/useMediaQuery.js";import{usePickaxeContext as u}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as m}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as p}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as f}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as h}from"../../../hooks/pickaxe/useConversation.js";import{useSubmit as g}from"../../../hooks/pickaxe/useSubmit.js";import{useSubmitResult as b}from"../../../hooks/pickaxe/useSubmitResult.js";import{allowedFileMimeTypes as v,allowedImageMimeTypes as x}from"../../../common/documents.js";import y from"../../../common/error.js";import{streamer as j}from"../../../common/api/streamer.js";import k from"../../../common/cn.js";import{useDocument as w}from"../Addons/Document/hooks/useDocument.js";import{useScroll as I}from"../Addons/Scroll/hooks/useScroll.js";import{useHover as O}from"../../../hooks/core/useHover.js";import N from"../common/PickaxeBranding.js";import C from"../Addons/IceBreaker/index.js";import S from"../../Icons/attach-vertical.svg.js";import R from"../../Icons/spinner-lines.svg.js";import A from"../../Icons/file.svg.js";import D from"../../Icons/x.svg.js";import U from"../../Icons/arrow-right.svg.js";import{formatBytes as T}from"../../../common/utils.js";const E=()=>{var E;const{formId:H,chatId:z,userId:B,studioUserId:L,deploymentId:M,pickaxe:F,styles:P,colors:W,misc:$,responsiveBy:G,isNewChat:K,forceMobile:_,setIsNewChat:Q,setIsShowIceBreaker:q,onGenerateComplete:J}=u(),{messages:V,status:X,limits:Y,setMessages:Z,setStatus:ee,setLimitData:oe,setError:te,setIsGenerating:se}=m(),{documents:re,isUploading:ie,isImageUploadAllowed:ne,upsertDocuments:le,onFileUpload:ae}=w(),{scrollStartSession:de,scrollEndSession:ce,scrollToBottom:ue}=I({auto:!0}),me=h(),pe=g(),fe=b(),he=f(),[ge,be]=r(""),ve=O(),{isHover:xe}=ve,ye=e(ve,["isHover"]),je=O(),{isHover:ke}=je,we=e(je,["isHover"]),Ie=i(null),[Oe]=c("(max-width: 767px)"),Ne=p(),Ce=n((()=>{var e,o,t;return!!K&&(!!F&&(!me.isLoading&&(!((null!==(o=null===(e=me.data)||void 0===e?void 0:e.messages.length)&&void 0!==o?o:0)>1)&&!!(null===(t=F.icebreakers)||void 0===t?void 0:t.length))))}),[F,K,me.data,me.isLoading]),Se=e=>o(void 0,void 0,void 0,(function*(){try{if(ie||"idle"!==X)return;const o=null!=e?e:ge;if(!o)return;be(""),te(""),oe(null),se(!0),Q(!1);const t=new Date,s="enduserupload"===(null==F?void 0:F.documentuploadtype),r=re.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),i=r.length?r[r.length-1].documentId:"";ee("fetching"),de(),ue();const n=Array.from(V);let l=[...n,{id:V.length+1,role:"user",content:o}];Z(l),ue();const{success:a,data:d,actionData:c,usedDocumentIds:u,endUserDocumentId:m,endUserImageId:p,rawUserInput:f,error:h}=yield pe.mutateAsync(Object.assign(Object.assign(Object.assign({formId:H,responseId:z,value:o},s&&i&&{documentId:i}),L&&{studioUserId:L}),M&&{deploymentId:M}));if(!a)throw new Error(null!=h?h:"An error occurred, please try again.");const g=[];m&&g.push(m),p&&g.push(p),g.length>0&&(l=[...n,Object.assign({id:V.length+1,role:"user",content:o},g&&{documentIds:g})],Z(l),ue()),le([]),ue();const b=(yield j({formId:H,responseId:z,data:d,actionData:c})).body;if(!b)throw new Error("Streaming error");const v=b.getReader(),x=new TextDecoder,y=l.length;let k="",w=!0,I=!1;for(;w;){const{value:e,done:o}=yield v.read();w=!o;if(k+=x.decode(e),k)Z([...l.slice(0,y),{id:V.length+1,role:"assistant",content:k}]),I||(ee("streaming"),I=!0);else if(!w&&!k)throw new Error("Server error")}const O=new Date;k&&(ue(),ee("idle"),yield fe.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:H,responseId:z,documentIds:u},B&&{userId:B}),L&&{studioUserId:L}),L&&(null==F?void 0:F.studioid)&&{studioId:F.studioid}),M&&{deploymentId:M}),{messages:[Object.assign(Object.assign({role:"user",message:f},g&&{documentIds:g}),{sentAt:t}),{role:"assistant",message:k,sentAt:O}]})),null==J||J(z))}catch(e){let o=y(e)||"";o&&!o.includes("Unexpected token 'A',")||(o="Oops! We're experiencing high traffic at the moment. Please try again later.");const t=Object.entries(Y).find((([e])=>o.includes(e)));t?oe(t[1]):te(o),ue()}finally{ee("idle"),se(!1),ce()}}));return l((()=>{q(Ce)}),[Ce]),t("div",Object.assign({className:k("fixed flex w-full flex-col bottom-0 left-0","viewport"===G?"min-[767px]:relative min-[767px]:bottom-auto min-[767px]:left-auto":"absolute @[767px]/pickaxe-root:relative @[767px]/pickaxe-root:bottom-auto @[767px]/pickaxe-root:left-auto")},{children:[!$.isWhiteLabel&&s("div",Object.assign({className:"flex justify-end pr-3"},{children:s(N,{animateHover:!0})})),Ce&&s(C,{data:(null==F?void 0:F.icebreakers)||[],style:{backgroundColor:"transparent",color:W.text},isMobile:_||Oe,onSend:Se}),t("div",Object.assign({id:(null==F?void 0:F.formid)+"--chat-parent",style:Ne,className:k("flex min-h-[56px] flex-col gap-y-2 px-4 py-3 pb-[15px]","block"===P.formFieldStyle&&"shadow")},{children:["idle"===X&&re.length>0&&s("div",Object.assign({className:k("grid grid-cols-1","viewport"===G?"min-[765px]:grid-cols-2":"@[767px]/pickaxe-root:grid-cols-2")},{children:re.map((e=>{var o,r,i;return s(a,{children:"document"===e.type?t("div",Object.assign({className:"relative gap-x-[10px] flex items-center px-2 h-[56px] border",style:{borderRadius:Ne.borderRadius,borderColor:W.secondaryText+"50"}},{children:[s("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:W.accent,borderRadius:Ne.borderRadius}},{children:ie?s(R,{className:"w-5 h-5 animate-spin",style:{color:W.accentText}}):s(A,{className:"w-5 h-5",style:{color:W.accentText}})})),t("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s("p",Object.assign({className:(k(he.b3),"font-medium truncate")},{children:e.name})),s("p",Object.assign({className:k(he.b4,"opacity-80 truncate")},{children:T(e.size)}))]})),s("button",Object.assign({type:"button",disabled:ie||"idle"!==X,onClick:()=>le([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:W.accent,borderColor:Ne.backgroundColor}},{children:s(D,{className:"w-4 h-4",style:{color:W.accentText}})}))]})):"image"===e.type?t("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:Ne.borderRadius}},{children:["finished"===e.status?s("img",{style:{borderRadius:Ne.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(o=e.documentId)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[1]}.${null===(i=e.documentId)||void 0===i?void 0:i.split("-")[2]}`,alt:""}):s("div",{className:"h-full w-full animate-pulse",style:{borderRadius:Ne.borderRadius,backgroundColor:W.secondary}}),s("button",Object.assign({type:"button",disabled:ie||"idle"!==X,onClick:()=>le([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:W.accent,borderColor:Ne.backgroundColor}},{children:s(D,{className:"w-4 h-4",style:{color:W.accentText}})}))]})):null},e.id)}))})),t("div",Object.assign({className:"flex items-end gap-x-2 grow"},{children:[s(d,{id:(null==F?void 0:F.formid)+"--chat-textarea",className:k(he.b2,"max-h-60 w-full resize-none border-transparent bg-transparent outline-none ring-0 scrollbar scrollbar-thin placeholder:font-semilight",!ge.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:ge,placeholder:null!==(E=null==F?void 0:F.placeholdertext)&&void 0!==E?E:"What do you want to talk about?",onChange:e=>be(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),ie||"idle"!==X||Se()))}}),t("div",Object.assign({className:"flex items-center gap-x-2"},{children:["enduserupload"===(null==F?void 0:F.documentuploadtype)&&t("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",style:{backgroundColor:ke?W.accent+"10":void 0},disabled:ie||"idle"!==X,onClick:()=>{var e;return null===(e=Ie.current)||void 0===e?void 0:e.click()}},we,{children:[s("input",{id:"file-upload",ref:Ie,type:"file",accept:[...v,...ne?x:[]].join(", "),multiple:!1,hidden:!0,className:"hidden",onChange:e=>o(void 0,void 0,void 0,(function*(){yield ae(Array.from(e.target.files||[])),e.target.value=""}))}),s(S,{className:"h-6 w-6",style:{color:ke?W.accent:W.accent+"80"}})]})),s("button",Object.assign({id:(null==F?void 0:F.formid)+"--chat-button",className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",style:{backgroundColor:xe?W.accent:W.accent+"10"},disabled:ie||"idle"!==X,onClick:()=>Se()},ye,{children:s(U,{className:"h-6 w-6 shrink-0 stroke-2",style:{color:xe?W.accentText:W.accent}})}))]}))]}))]}))]}))};export{E as default};
1
+ import{__rest as e,__awaiter as t}from"../../../_virtual/_tslib.js";import{jsxs as o,jsx as s}from"react/jsx-runtime";import{useState as r,useRef as i,useMemo as n,useEffect as a,Fragment as l}from"react";import{usePickaxeContext as d}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as c}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as u}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as m}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as p}from"../../../hooks/pickaxe/useConversation.js";import{useSubmit as f}from"../../../hooks/pickaxe/useSubmit.js";import{useSubmitResult as h}from"../../../hooks/pickaxe/useSubmitResult.js";import{allowedFileMimeTypes as g,allowedImageMimeTypes as b}from"../../../common/documents.js";import{streamer as v}from"../../../common/api/streamer.js";import{useDocument as x}from"../Addons/Document/hooks/useDocument.js";import{useScroll as j}from"../Addons/Scroll/hooks/useScroll.js";import{useHover as y}from"../../../hooks/core/useHover.js";import{formatBytes as k}from"../../../common/utils.js";import w from"../../Icons/attach-vertical.svg.js";import I from"../../Icons/spinner-lines.svg.js";import O from"../../Icons/file.svg.js";import N from"../../Icons/x.svg.js";import C from"../../Icons/arrow-right.svg.js";import S from"../common/PickaxeBranding.js";import R from"../Addons/IceBreaker/index.js";import A from"react-textarea-autosize";import D from"../../../common/error.js";import U from"../../../common/cn.js";const T=()=>{var T;const{formId:E,chatId:H,userId:z,studioUserId:B,deploymentId:L,pickaxe:F,styles:P,colors:W,misc:$,responsiveBy:G,isNewChat:K,setIsNewChat:_,setIsShowIceBreaker:M,onGenerateComplete:q}=d(),{messages:J,status:Q,limits:V,setMessages:X,setStatus:Y,setLimitData:Z,setError:ee,setIsGenerating:te}=c(),{documents:oe,isUploading:se,isImageUploadAllowed:re,upsertDocuments:ie,onFileUpload:ne}=x(),{scrollStartSession:ae,scrollEndSession:le,scrollToBottom:de}=j({auto:!0}),ce=p(),ue=f(),me=h(),pe=m(),fe=u(),[he,ge]=r(""),be=i(null),ve=y(),{isHover:xe}=ve,je=e(ve,["isHover"]),ye=y(),{isHover:ke}=ye,we=e(ye,["isHover"]),Ie=n((()=>{var e,t,o;return!!K&&(!!F&&(!ce.isLoading&&(!((null!==(t=null===(e=ce.data)||void 0===e?void 0:e.messages.length)&&void 0!==t?t:0)>1)&&!!(null===(o=F.icebreakers)||void 0===o?void 0:o.length))))}),[F,K,ce.data,ce.isLoading]),Oe=e=>t(void 0,void 0,void 0,(function*(){try{if(se||"idle"!==Q)return;const t=null!=e?e:he;if(!t)return;ge(""),ee(""),Z(null),te(!0),_(!1);const o=new Date,s="enduserupload"===(null==F?void 0:F.documentuploadtype),r=oe.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),i=r.length?r[r.length-1].documentId:"";Y("fetching"),ae(),de();const n=Array.from(J);let a=[...n,{id:J.length+1,role:"user",content:t}];X(a),de();const{success:l,data:d,actionData:c,usedDocumentIds:u,endUserDocumentId:m,endUserImageId:p,rawUserInput:f,error:h}=yield ue.mutateAsync(Object.assign(Object.assign(Object.assign({formId:E,responseId:H,value:t},s&&i&&{documentId:i}),B&&{studioUserId:B}),L&&{deploymentId:L}));if(!l)throw new Error(null!=h?h:"An error occurred, please try again.");const g=[];m&&g.push(m),p&&g.push(p),g.length>0&&(a=[...n,Object.assign({id:J.length+1,role:"user",content:t},g&&{documentIds:g})],X(a),de()),ie([]),de();const b=(yield v({formId:E,responseId:H,data:d,actionData:c})).body;if(!b)throw new Error("Streaming error");const x=b.getReader(),j=new TextDecoder,y=a.length;let k="",w=!0,I=!1;for(;w;){const{value:e,done:t}=yield x.read();w=!t;if(k+=j.decode(e),k)X([...a.slice(0,y),{id:J.length+1,role:"assistant",content:k}]),I||(Y("streaming"),I=!0);else if(!w&&!k)throw new Error("Server error")}const O=new Date;k&&(de(),Y("idle"),yield me.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:E,responseId:H,documentIds:u},z&&{userId:z}),B&&{studioUserId:B}),B&&(null==F?void 0:F.studioid)&&{studioId:F.studioid}),L&&{deploymentId:L}),{messages:[Object.assign(Object.assign({role:"user",message:f},g&&{documentIds:g}),{sentAt:o}),{role:"assistant",message:k,sentAt:O}]})),null==q||q(H))}catch(e){let t=D(e)||"";t&&!t.includes("Unexpected token 'A',")||(t="Oops! We're experiencing high traffic at the moment. Please try again later.");const o=Object.entries(V).find((([e])=>t.includes(e)));o?Z(o[1]):ee(t),de()}finally{Y("idle"),te(!1),le()}}));return a((()=>{M(Ie)}),[Ie]),o("div",Object.assign({className:U("fixed flex w-full flex-col bottom-0 left-0","viewport"===G?"min-[767px]:relative min-[767px]:bottom-auto min-[767px]:left-auto":"absolute @[767px]/pickaxe-root:relative @[767px]/pickaxe-root:bottom-auto @[767px]/pickaxe-root:left-auto")},{children:[!$.isWhiteLabel&&s("div",Object.assign({className:"flex justify-end pr-3 pb-3 @[767px]/pickaxe-root:pr-0"},{children:s(S,{animateHover:!0})})),Ie&&s(R,{data:(null==F?void 0:F.icebreakers)||[],onSend:Oe}),o("div",Object.assign({id:(null==F?void 0:F.formid)+"--chat-parent",style:fe,className:U("flex min-h-[56px] flex-col gap-y-2 px-4 py-3 pb-[15px]","block"===P.formFieldStyle&&"shadow")},{children:["idle"===Q&&oe.length>0&&s("div",Object.assign({className:U("grid grid-cols-1","viewport"===G?"min-[765px]:grid-cols-2":"@[767px]/pickaxe-root:grid-cols-2")},{children:oe.map((e=>{var t,r,i;return s(l,{children:"document"===e.type?o("div",Object.assign({className:"relative gap-x-[10px] flex items-center px-2 h-[56px] border",style:{borderRadius:fe.borderRadius,borderColor:W.secondaryText+"50"}},{children:[s("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:W.accent,borderRadius:fe.borderRadius}},{children:se?s(I,{className:"w-5 h-5 animate-spin",style:{color:W.accentText}}):s(O,{className:"w-5 h-5",style:{color:W.accentText}})})),o("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s("p",Object.assign({className:(U(pe.b3),"font-medium truncate")},{children:e.name})),s("p",Object.assign({className:U(pe.b4,"opacity-80 truncate")},{children:k(e.size)}))]})),s("button",Object.assign({type:"button",disabled:se||"idle"!==Q,onClick:()=>ie([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:W.accent,borderColor:fe.backgroundColor}},{children:s(N,{className:"w-4 h-4",style:{color:W.accentText}})}))]})):"image"===e.type?o("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:fe.borderRadius}},{children:["finished"===e.status?s("img",{style:{borderRadius:fe.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(t=e.documentId)||void 0===t?void 0:t.split("-")[2]}/${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[1]}.${null===(i=e.documentId)||void 0===i?void 0:i.split("-")[2]}`,alt:""}):s("div",{className:"h-full w-full animate-pulse",style:{borderRadius:fe.borderRadius,backgroundColor:W.secondary}}),s("button",Object.assign({type:"button",disabled:se||"idle"!==Q,onClick:()=>ie([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:W.accent,borderColor:fe.backgroundColor}},{children:s(N,{className:"w-4 h-4",style:{color:W.accentText}})}))]})):null},e.id)}))})),o("div",Object.assign({className:"flex items-end gap-x-2 grow"},{children:[s(A,{id:(null==F?void 0:F.formid)+"--chat-textarea",className:U(pe.b2,"max-h-60 mb-[0.2em] w-full resize-none border-transparent bg-transparent outline-none ring-0 scrollbar scrollbar-thin placeholder:font-semilight",!he.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:he,placeholder:null!==(T=null==F?void 0:F.placeholdertext)&&void 0!==T?T:"What do you want to talk about?",onChange:e=>ge(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),se||"idle"!==Q||Oe()))}}),o("div",Object.assign({className:"flex items-center gap-x-2"},{children:["enduserupload"===(null==F?void 0:F.documentuploadtype)&&o("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors duration-200 ease-in-out",style:{backgroundColor:ke?W.accent+"10":void 0},disabled:se||"idle"!==Q,onClick:()=>{var e;return null===(e=be.current)||void 0===e?void 0:e.click()}},we,{children:[s("input",{id:"file-upload",ref:be,type:"file",accept:[...g,...re?b:[]].join(", "),multiple:!1,hidden:!0,className:"hidden",onChange:e=>t(void 0,void 0,void 0,(function*(){yield ne(Array.from(e.target.files||[])),e.target.value=""}))}),s(w,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:ke?W.accent:W.accent+"80"}})]})),s("button",Object.assign({id:(null==F?void 0:F.formid)+"--chat-button",className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full duration-200 transition-colors ease-in-out",style:{backgroundColor:xe?W.accent:W.accent+"10"},disabled:se||"idle"!==Q,onClick:()=>Oe()},je,{children:s(C,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:xe?W.accentText:W.accent}})}))]}))]}))]}))]}))};export{T as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{usePickaxeContext as r}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useScrollContext as t}from"../Addons/Scroll/hooks/useScrollContext.js";import i from"../../Core/ScrollArea.js";import s from"./History/index.js";import l from"./Input.js";import c from"../../../common/cn.js";import{useDocument as m}from"../Addons/Document/hooks/useDocument.js";import{useEffect as p}from"react";const n=()=>{const{isShowIceBreaker:n,responsiveBy:x}=r(),{scrollContainerRef:a}=t(),{upsertDocuments:f}=m();return p((()=>()=>{f([])}),[]),e("div",Object.assign({className:"relative flex flex-grow flex-col items-center"},{children:o("div",Object.assign({className:"relative flex w-full max-w-[800px] flex-grow flex-col"},{children:[e("div",Object.assign({className:c("flex w-full flex-grow flex-col pb-[4.5rem]","viewport"===x?"min-[767px]:pb-24":"@[767px]/pickaxe-root:pb-24",n&&"pb-[310px]",n&&("viewport"===x?"min-[767px]:pb-[330px]":"@[767px]/pickaxe-root:pb-[330px]"))},{children:e(i,Object.assign({ref:a,hideScrollbar:!0},{children:e(s,{})}))})),e("div",Object.assign({className:c("absolute bottom-0 flex w-full justify-center","viewport"===x?"min-[767px]:mt-4 min-[767px]:mb-6":"@[767px]/pickaxe-root:mt-4 @[767px]/pickaxe-root:mb-6")},{children:e(l,{})}))]}))}))};export{n as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{usePickaxeContext as r}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useScrollContext as t}from"../Addons/Scroll/hooks/useScrollContext.js";import{useDocument as i}from"../Addons/Document/hooks/useDocument.js";import{useEffect as s}from"react";import l from"../../Core/ScrollArea.js";import m from"./History/index.js";import c from"./Input.js";import p from"../../../common/cn.js";const n=()=>{const{isShowIceBreaker:n,responsiveBy:x}=r(),{scrollContainerRef:a}=t(),{upsertDocuments:f}=i();return s((()=>()=>{f([])}),[]),e("div",Object.assign({className:"relative flex flex-grow flex-col items-center"},{children:o("div",Object.assign({className:"relative flex w-full max-w-[800px] flex-grow flex-col"},{children:[e("div",Object.assign({className:p("flex w-full flex-grow flex-col pb-[6rem]","viewport"===x?"min-[767px]:pb-[7.5rem]":"@[767px]/pickaxe-root:pb-[7.5rem]",n&&"pb-[310px]",n&&("viewport"===x?"min-[767px]:pb-[330px]":"@[767px]/pickaxe-root:pb-[330px]"))},{children:e(l,Object.assign({ref:a,hideScrollbar:!0},{children:e(m,{})}))})),e("div",Object.assign({className:p("absolute bottom-0 flex w-full justify-center","viewport"===x?"min-[767px]:mt-4 min-[767px]:mb-6":"@[767px]/pickaxe-root:mt-4 @[767px]/pickaxe-root:mb-6")},{children:e(c,{})}))]}))}))};export{n as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as n}from"../../../../hooks/studio/useStyleFontSize.js";import{format as i}from"date-fns";import{PickaxeMarkdown as r}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as a}from"../../common/PickaxeMarkdown/Renderer.js";import l from"../../../Icons/message-square-notes.svg.js";import c from"../../../Icons/visitor.svg.js";import m from"../../common/PickaxeIcon.js";import d from"../../common/PickaxeSimpleButton.js";import p from"../../common/PickaxeCopyButton.js";import h from"../../../../common/cn.js";import{useDocument as u}from"../../Addons/Document/hooks/useDocument.js";const f=({item:f})=>{const{pickaxe:g,styles:x,colors:v,misc:b,setChatId:j,setIsNewChat:y}=t(),k=n(),{upsertDocuments:w}=u(),N=o((()=>i(f.createdAt,"hh:mm a MMM dd, yy")),[f]),O=o((()=>f&&f.messages?f.messages.length:0),[f]),C=o((()=>{var e,s,o,t;if("form"===f.type){return(null!==(e=f.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(t=null===(o=null===(s=f.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[f]),I=o((()=>{var e,s,o,t;return"form"===f.type?null!==(e=f.questionResponse)&&void 0!==e?e:"":null!==(t=null===(o=null===(s=f.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[f]);return e("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:v.primary,color:v.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(c,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${f.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:C.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:C}}),s("label",Object.assign({htmlFor:`${f.responseId}-input`,className:h(k.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:v.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${f.responseId}-input`,className:h(k.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:v.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:v.secondary,color:v.secondaryText}},{children:[b.isChatImage&&s(m,{src:null==g?void 0:g.chaticon,alt:`${null==g?void 0:g.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:v.secondaryText}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(r,Object.assign({theme:x.theme,accentColor:v.accent,linkPreviews:!0,actions:!0},{children:s(a,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:I})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==g?void 0:g.enablechatresponses)&&e(d,Object.assign({color:v.accent,onClick:()=>{return e=f.responseId,w([]),y(!1),void j(e);var e}},{children:[s(l,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:h(k.b3,"font-semibold")},{children:O+1}))]})),s(p,{color:v.accent,text:I})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:h(k.b3,"font-semibold uppercase opacity-30")},{children:N}))}))]}))]}))]}))]}))};export{f as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as n}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as i}from"../../Addons/Document/hooks/useDocument.js";import{format as r}from"date-fns";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as l}from"../../common/PickaxeMarkdown/Renderer.js";import c from"../../../Icons/message-square-notes.svg.js";import m from"../../../Icons/visitor.svg.js";import d from"../../common/PickaxeIcon.js";import p from"../../common/PickaxeSimpleButton.js";import h from"../../common/PickaxeCopyButton.js";import u from"../../../../common/cn.js";const f=({item:f})=>{const{pickaxe:g,styles:x,colors:v,misc:b,setChatId:j,setIsNewChat:y}=t(),k=n(),{upsertDocuments:w}=i(),N=o((()=>r(f.createdAt,"hh:mm a MMM dd, yy")),[f]),O=o((()=>f&&f.messages?f.messages.length:0),[f]),C=o((()=>{var e,s,o,t;if("form"===f.type){return(null!==(e=f.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(t=null===(o=null===(s=f.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[f]),I=o((()=>{var e,s,o,t;return"form"===f.type?null!==(e=f.questionResponse)&&void 0!==e?e:"":null!==(t=null===(o=null===(s=f.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[f]);return e("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:v.primary,color:v.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(m,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${f.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:C.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:C}}),s("label",Object.assign({htmlFor:`${f.responseId}-input`,className:u(k.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:v.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${f.responseId}-input`,className:u(k.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:v.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:v.secondary,color:v.secondaryText}},{children:[b.isChatImage&&s(d,{src:null==g?void 0:g.chaticon,alt:`${null==g?void 0:g.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:v.secondaryText}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(a,Object.assign({theme:x.theme,accentColor:v.accent,linkPreviews:!0,actions:!0},{children:s(l,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:I})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==g?void 0:g.enablechatresponses)&&e(p,Object.assign({color:v.accent,onClick:()=>{return e=f.responseId,w([]),y(!1),void j(e);var e}},{children:[s(c,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:u(k.b3,"font-semibold")},{children:O+1}))]})),s(h,{color:v.accent,text:I})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:u(k.b3,"font-semibold uppercase opacity-30")},{children:N}))}))]}))]}))]}))]}))};export{f as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useMemo as s}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useScrollContext as n}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as c}from"../../../../hooks/studio/useStyleFontSize.js";import{format as i}from"date-fns";import{PickaxeMarkdown as l}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as a}from"../../common/PickaxeMarkdown/Renderer.js";import m from"../../../Icons/message-square-notes.svg.js";import d from"../../../Icons/visitor.svg.js";import p from"../../common/PickaxeIcon.js";import h from"../../common/PickaxeSimpleButton.js";import f from"../../common/PickaxeCopyButton.js";import u from"../../Addons/Scroll/ScrollLockView.js";import x from"../../../../common/cn.js";import{useDocument as g}from"../../Addons/Document/hooks/useDocument.js";const b=()=>{var b;const{pickaxe:j,styles:v,colors:k,misc:y,setChatId:w,setIsNewChat:N}=t(),{response:C}=r(),{scrollTargetRef:O,scrollContainerRef:I}=n(),S=c(),{upsertDocuments:D}=g(),P=s((()=>i(C?C.createdAt:new Date,"hh:mm a MMM dd, yy")),[C]),M=s((()=>{var e;if(!C)return"";return(null!==(e=C.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[C]);return C?e("div",Object.assign({ref:O,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:k.primary,color:k.text}},{children:[o("div",Object.assign({className:"shrink-0 pt-1"},{children:o(d,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[o("input",{id:`${C.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:M.length<280}),o("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:M}}),o("label",Object.assign({htmlFor:`${C.responseId}-input`,className:x(S.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:k.accent}},{children:"See input"})),o("label",Object.assign({htmlFor:`${C.responseId}-input`,className:x(S.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:k.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[y.isChatImage&&o(p,{src:null==j?void 0:j.chaticon,alt:`${null==j?void 0:j.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:k.secondaryText}),e("div",Object.assign({ref:I,className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[o(l,Object.assign({theme:v.theme,accentColor:k.accent,linkPreviews:!0,actions:!0},{children:o(a,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:C.questionResponse})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==j?void 0:j.enablechatresponses)&&e(h,Object.assign({color:k.accent,onClick:()=>{return e=C.responseId,D([]),N(!1),void w(e);var e}},{children:[o(m,{className:"h-4 w-4 shrink-0"}),o("p",Object.assign({className:x(S.b3,"font-semibold")},{children:C.messages.length+1}))]})),o(f,{color:k.accent,text:null!==(b=C.questionResponse)&&void 0!==b?b:""})]})),o("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:o("p",Object.assign({className:x(S.b3,"font-semibold uppercase opacity-30")},{children:P}))}))]}))]}))]})),o(u,{className:"w-full"})]})):null};export{b as default};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useMemo as s}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useScrollContext as n}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as c}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as i}from"../../Addons/Document/hooks/useDocument.js";import{format as l}from"date-fns";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as m}from"../../common/PickaxeMarkdown/Renderer.js";import d from"../../../Icons/message-square-notes.svg.js";import p from"../../../Icons/visitor.svg.js";import h from"../../common/PickaxeIcon.js";import f from"../../common/PickaxeSimpleButton.js";import u from"../../common/PickaxeCopyButton.js";import x from"../../Addons/Scroll/ScrollLockView.js";import g from"../../../../common/cn.js";const b=()=>{var b;const{pickaxe:j,styles:v,colors:k,misc:y,setChatId:w,setIsNewChat:N}=t(),{response:C}=r(),{scrollTargetRef:O,scrollContainerRef:I}=n(),S=c(),{upsertDocuments:D}=i(),P=s((()=>l(C?C.createdAt:new Date,"hh:mm a MMM dd, yy")),[C]),M=s((()=>{var e;if(!C)return"";return(null!==(e=C.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[C]);return C?e("div",Object.assign({ref:O,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:k.primary,color:k.text}},{children:[o("div",Object.assign({className:"shrink-0 pt-1"},{children:o(p,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[o("input",{id:`${C.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:M.length<280}),o("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:M}}),o("label",Object.assign({htmlFor:`${C.responseId}-input`,className:g(S.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:k.accent}},{children:"See input"})),o("label",Object.assign({htmlFor:`${C.responseId}-input`,className:g(S.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:k.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[y.isChatImage&&o(h,{src:null==j?void 0:j.chaticon,alt:`${null==j?void 0:j.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:k.secondaryText}),e("div",Object.assign({ref:I,className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[o(a,Object.assign({theme:v.theme,accentColor:k.accent,linkPreviews:!0,actions:!0},{children:o(m,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:C.questionResponse})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==j?void 0:j.enablechatresponses)&&e(f,Object.assign({color:k.accent,onClick:()=>{return e=C.responseId,D([]),N(!1),void w(e);var e}},{children:[o(d,{className:"h-4 w-4 shrink-0"}),o("p",Object.assign({className:g(S.b3,"font-semibold")},{children:C.messages.length+1}))]})),o(u,{color:k.accent,text:null!==(b=C.questionResponse)&&void 0!==b?b:""})]})),o("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:o("p",Object.assign({className:g(S.b3,"font-semibold uppercase opacity-30")},{children:P}))}))]}))]}))]})),o(x,{className:"w-full"})]})):null};export{b as default};
@@ -1 +1 @@
1
- import{__rest as e,__awaiter as s}from"../../../../_virtual/_tslib.js";import{jsxs as t,jsx as o,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as r,Fragment as n}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleInput as c}from"../../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as d}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as m}from"../../Addons/Document/hooks/useDocument.js";import{allowedFileMimeTypes as u,allowedImageMimeTypes as b}from"../../../../common/documents.js";import p from"../../../Icons/attach-vertical.svg.js";import f from"../../../Icons/check.svg.js";import h from"../../../Core/ErrorAlert.js";import g from"../../../../common/cn.js";import y from"../../../Icons/spinner-lines.svg.js";import j from"../../../Icons/file.svg.js";import x from"../../../Icons/x.svg.js";import v from"../../../Icons/link.svg.js";import{formatBytes as N}from"../../../../common/utils.js";import{useHover as w}from"../../../../hooks/core/useHover.js";const k=({field:k,update:O})=>{const C=d(),{colors:R,responsiveBy:I}=i(),D=w(),{isHover:T}=D,A=e(D,["isHover"]),{documents:U,documentError:E,websiteLink:F,isUploading:z,isImageUploadAllowed:H,upsertDocuments:L,setDocumentError:S,setWebsiteLink:W,onFileUpload:$,onWebsiteUpload:B}=m({onQuestionChange:e=>{O(Object.assign(Object.assign({},k),e))}}),[P,_]=a(!1),q=r(null),K=c();return t("div",Object.assign({className:"flex flex-col gap-y-4"},{children:[t("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[t("div",Object.assign({className:"flex items-center gap-2"},{children:[o("p",Object.assign({className:g(C.b3,"font-semibold opacity-70")},{children:k.main})),k.isRequired&&o("span",Object.assign({className:"select-none font-semibold",style:{color:R.error}},{children:"*"}))]})),t("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[o("input",{ref:q,type:"file",accept:[...u,...H?b:[]].join(", "),id:k.id,hidden:!0,multiple:!1,className:"hidden",onChange:e=>s(void 0,void 0,void 0,(function*(){yield $(Array.from(e.target.files||[])),e.target.value=""})),disabled:z}),t("div",Object.assign({className:g("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 duration-300 ease-in-out transition-all shadow hover:shadow-none",P&&"shadow"),style:K},{children:[o("input",{type:"text",value:F,className:g(C.b2,"w-full outline-none bg-transparent placeholder:font-semilight"),placeholder:"Paste a website/video link or drag a file",onChange:e=>W(e.target.value),onDrop:e=>s(void 0,void 0,void 0,(function*(){e.preventDefault(),yield $(Array.from(e.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),B(F))},onFocus:()=>_(!0),onBlur:()=>_(!1)}),o("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:F.length>0?t(l,{children:[o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:z,onClick:()=>B(F)},{children:o(f,{className:"h-5 w-5 shrink-0",style:{color:R.accent}})})),o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:z,onClick:()=>{W(""),S("")}},{children:o(x,{className:"h-6 w-6 shrink-0",style:{color:R.accent}})}))]}):o("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",disabled:z,onClick:()=>{var e;null===(e=q.current)||void 0===e||e.click()},style:{backgroundColor:T?R.accent+"10":void 0}},A,{children:o(p,{className:"h-6 w-6",style:{color:T?R.accent:R.accent+"80"}})}))}))]}))]}))]})),U.length>0&&o("div",Object.assign({className:g("flex gap-4","viewport"===I?"min-[765px]:flex-col":"@[767px]/pickaxe-root:flex-col")},{children:U.map((e=>{var s,l,a;return o(n,{children:"document"===e.type?t("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:K},{children:[o("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:R.accent,borderRadius:K.borderRadius}},{children:z?o(y,{className:"w-5 h-5 animate-spin",style:{color:R.accentText}}):o(j,{className:"w-5 h-5",style:{color:R.accentText}})})),t("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[o("p",Object.assign({className:(g(C.b3),"font-medium truncate")},{children:e.name})),o("p",Object.assign({className:g(C.b4,"opacity-80 truncate")},{children:N(e.size)}))]})),o("button",Object.assign({type:"button",disabled:z,onClick:()=>L([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:R.accent,borderColor:K.backgroundColor}},{children:o(x,{className:"w-4 h-4",style:{color:R.accentText}})}))]})):"image"===e.type?t("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:K.borderRadius}},{children:["finished"===e.status?o("img",{style:{borderRadius:K.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(s=e.documentId)||void 0===s?void 0:s.split("-")[2]}/${null===(l=e.documentId)||void 0===l?void 0:l.split("-")[1]}.${null===(a=e.documentId)||void 0===a?void 0:a.split("-")[2]}`,alt:""}):o("div",{className:"h-full w-full animate-pulse",style:{borderRadius:K.borderRadius,backgroundColor:R.secondary}}),o("button",Object.assign({type:"button",disabled:z,onClick:()=>L([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:R.accent,borderColor:K.backgroundColor}},{children:o(x,{className:"w-4 h-4",style:{color:R.accentText}})}))]})):"website"===e.type?t("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:K},{children:[o("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:R.accent,borderRadius:K.borderRadius}},{children:z?o(y,{className:"w-5 h-5 animate-spin",style:{color:R.accentText}}):o(v,{className:"w-5 h-5",style:{color:R.accentText}})})),t("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[o("p",Object.assign({className:(g(C.b3),"font-medium truncate")},{children:new URL(e.name).hostname})),o("p",Object.assign({className:g(C.b4,"opacity-80 truncate")},{children:"Website"}))]})),o("button",Object.assign({type:"button",disabled:z,onClick:()=>L([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:R.accent,borderColor:K.backgroundColor}},{children:o(x,{className:"w-4 h-4",style:{color:R.accentText}})}))]})):null},e.id)}))})),E&&o(h,{error:E,className:"mt-3"})]}))};export{k as default};
1
+ import{__rest as e,__awaiter as s}from"../../../../_virtual/_tslib.js";import{jsxs as t,jsx as o,Fragment as l}from"react/jsx-runtime";import{useState as a,useRef as r,Fragment as n}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleInput as c}from"../../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as d}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as m}from"../../Addons/Document/hooks/useDocument.js";import{useHover as u}from"../../../../hooks/core/useHover.js";import{allowedFileMimeTypes as b,allowedImageMimeTypes as p}from"../../../../common/documents.js";import{formatBytes as f}from"../../../../common/utils.js";import h from"../../../Icons/attach-vertical.svg.js";import g from"../../../Icons/check.svg.js";import y from"../../../Icons/spinner-lines.svg.js";import j from"../../../Icons/file.svg.js";import x from"../../../Icons/x.svg.js";import v from"../../../Icons/link.svg.js";import N from"../../../Core/ErrorAlert.js";import w from"../../../../common/cn.js";const k=({field:k,update:O})=>{const C=d(),{colors:R,responsiveBy:I}=i(),D=u(),{isHover:T}=D,A=e(D,["isHover"]),{documents:U,documentError:E,websiteLink:F,isUploading:z,isImageUploadAllowed:H,upsertDocuments:L,setDocumentError:S,setWebsiteLink:W,onFileUpload:$,onWebsiteUpload:B}=m({onQuestionChange:e=>{O(Object.assign(Object.assign({},k),e))}}),[P,_]=a(!1),q=r(null),K=c();return t("div",Object.assign({className:"flex flex-col gap-y-4"},{children:[t("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[t("div",Object.assign({className:"flex items-center gap-2"},{children:[o("p",Object.assign({className:w(C.b3,"font-semibold opacity-70")},{children:k.main})),k.isRequired&&o("span",Object.assign({className:"select-none font-semibold",style:{color:R.error}},{children:"*"}))]})),t("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[o("input",{ref:q,type:"file",accept:[...b,...H?p:[]].join(", "),id:k.id,hidden:!0,multiple:!1,className:"hidden",onChange:e=>s(void 0,void 0,void 0,(function*(){yield $(Array.from(e.target.files||[])),e.target.value=""})),disabled:z}),t("div",Object.assign({className:w("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 duration-300 ease-in-out transition-all shadow hover:shadow-none",P&&"shadow"),style:K},{children:[o("input",{type:"text",value:F,className:w(C.b2,"w-full outline-none bg-transparent placeholder:font-semilight"),placeholder:"Paste a website/video link or drag a file",onChange:e=>W(e.target.value),onDrop:e=>s(void 0,void 0,void 0,(function*(){e.preventDefault(),yield $(Array.from(e.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),B(F))},onFocus:()=>_(!0),onBlur:()=>_(!1)}),o("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:F.length>0?t(l,{children:[o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:z,onClick:()=>B(F)},{children:o(g,{className:"h-5 w-5 shrink-0",style:{color:R.accent}})})),o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:z,onClick:()=>{W(""),S("")}},{children:o(x,{className:"h-6 w-6 shrink-0",style:{color:R.accent}})}))]}):o("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors",disabled:z,onClick:()=>{var e;null===(e=q.current)||void 0===e||e.click()},style:{backgroundColor:T?R.accent+"10":void 0}},A,{children:o(h,{className:"h-6 w-6",style:{color:T?R.accent:R.accent+"80"}})}))}))]}))]}))]})),U.length>0&&o("div",Object.assign({className:w("flex gap-4","viewport"===I?"min-[765px]:flex-col":"@[767px]/pickaxe-root:flex-col")},{children:U.map((e=>{var s,l,a;return o(n,{children:"document"===e.type?t("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:K},{children:[o("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:R.accent,borderRadius:K.borderRadius}},{children:z?o(y,{className:"w-5 h-5 animate-spin",style:{color:R.accentText}}):o(j,{className:"w-5 h-5",style:{color:R.accentText}})})),t("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[o("p",Object.assign({className:(w(C.b3),"font-medium truncate")},{children:e.name})),o("p",Object.assign({className:w(C.b4,"opacity-80 truncate")},{children:f(e.size)}))]})),o("button",Object.assign({type:"button",disabled:z,onClick:()=>L([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:R.accent,borderColor:K.backgroundColor}},{children:o(x,{className:"w-4 h-4",style:{color:R.accentText}})}))]})):"image"===e.type?t("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:K.borderRadius}},{children:["finished"===e.status?o("img",{style:{borderRadius:K.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(s=e.documentId)||void 0===s?void 0:s.split("-")[2]}/${null===(l=e.documentId)||void 0===l?void 0:l.split("-")[1]}.${null===(a=e.documentId)||void 0===a?void 0:a.split("-")[2]}`,alt:""}):o("div",{className:"h-full w-full animate-pulse",style:{borderRadius:K.borderRadius,backgroundColor:R.secondary}}),o("button",Object.assign({type:"button",disabled:z,onClick:()=>L([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:R.accent,borderColor:K.backgroundColor}},{children:o(x,{className:"w-4 h-4",style:{color:R.accentText}})}))]})):"website"===e.type?t("div",Object.assign({className:"relative w-full max-w-[350px] gap-x-[10px] flex items-center px-2 h-[56px] border",style:K},{children:[o("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:R.accent,borderRadius:K.borderRadius}},{children:z?o(y,{className:"w-5 h-5 animate-spin",style:{color:R.accentText}}):o(v,{className:"w-5 h-5",style:{color:R.accentText}})})),t("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[o("p",Object.assign({className:(w(C.b3),"font-medium truncate")},{children:new URL(e.name).hostname})),o("p",Object.assign({className:w(C.b4,"opacity-80 truncate")},{children:"Website"}))]})),o("button",Object.assign({type:"button",disabled:z,onClick:()=>L([]),className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:R.accent,borderColor:K.backgroundColor}},{children:o(x,{className:"w-4 h-4",style:{color:R.accentText}})}))]})):null},e.id)}))})),E&&o(N,{error:E,className:"mt-3"})]}))};export{k as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{usePickaxeContext as s}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as n}from"../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdownRenderer as c}from"./PickaxeMarkdown/Renderer.js";import r from"./PickaxeIcon.js";import l from"./PickaxeInfoModal.js";import{PickaxeMarkdown as m}from"./PickaxeMarkdown/index.js";import a from"../../../common/cn.js";const p=({iconClassName:p,maxLines:d,onIconClick:f})=>{const{pickaxe:x,styles:h,colors:u,misc:k}=s(),[j,g]=o(!1),v=n(),P=t((()=>({title:(null==x?void 0:x.formtitle)||"",description:(null==x?void 0:x.formdescription)||""})),[x]);return e("div",Object.assign({className:"flex flex-col items-center"},{children:[j&&i(l,{isOpen:j,onChangeIsOpen:g}),k.isProfileImage&&i(r,Object.assign({src:null==x?void 0:x.coverphoto,alt:`${null==x?void 0:x.formtitle}'s Profile Picture`,width:72,height:72,className:a("h-[72px] w-[72px] rounded-full",p)},f&&{onClick:f})),k.isTitle&&!!P.title&&i("h2",Object.assign({className:a(v.h2,"mt-6 text-center font-semilight opacity-90",!d&&"line-clamp-2")},{children:null==x?void 0:x.formtitle})),k.isDescription&&!!P.description&&i(m,Object.assign({theme:h.theme,accentColor:u.accent},{children:i(c,Object.assign({className:"mt-2 text-center",value:P.description},d&&{maxLines:d},{onExpandClick:()=>g(!0)}))}))]}))};export{p as default};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{usePickaxeContext as s}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as r}from"../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdownRenderer as n}from"./PickaxeMarkdown/Renderer.js";import c from"./PickaxeIcon.js";import l from"./PickaxeInfoModal.js";import{PickaxeMarkdown as m}from"./PickaxeMarkdown/index.js";import a from"../../../common/cn.js";const p=({iconClassName:p,maxLines:d,onIconClick:f})=>{const{pickaxe:x,styles:h,colors:u,misc:k}=s(),[j,g]=o(!1),v=r(),P=t((()=>({title:(null==x?void 0:x.formtitle)||"",description:(null==x?void 0:x.formdescription)||""})),[x]);return e("div",Object.assign({className:"flex flex-col items-center"},{children:[j&&i(l,{isOpen:j,onChangeIsOpen:g}),k.isProfileImage&&i(c,Object.assign({src:null==x?void 0:x.coverphoto,alt:`${null==x?void 0:x.formtitle}'s Profile Picture`,width:72,height:72,className:a("h-[72px] w-[72px] rounded-full",p,!!f&&"cursor-pointer")},f&&{onClick:f})),k.isTitle&&!!P.title&&i("h2",Object.assign({className:a(v.h2,"mt-6 text-center font-semilight opacity-90",!d&&"line-clamp-2")},{children:null==x?void 0:x.formtitle})),k.isDescription&&!!P.description&&i(m,Object.assign({theme:h.theme,accentColor:u.accent},{children:i(n,Object.assign({className:"mt-2 text-center",value:P.description},d&&{maxLines:d},{onExpandClick:()=>g(!0)}))}))]}))};export{p as default};
@@ -1 +1 @@
1
- .pxe-prose p{font-weight:350}.pxe-prose>p{margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-code,.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-youtube{margin-bottom:2.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child),.pxe-prose>p:not(:first-child) .pxe-markdown-image,.pxe-prose>p:not(:first-child) .pxe-markdown-youtube,.pxe-prose>pre:not(:first-child){margin-top:2.5rem}
1
+ .pxe-prose p{font-weight:350;margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-code,.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-youtube{margin-bottom:2.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child),.pxe-prose>p:not(:first-child) .pxe-markdown-image,.pxe-prose>p:not(:first-child) .pxe-markdown-youtube,.pxe-prose>pre:not(:first-child){margin-top:2.5rem}
@@ -1,9 +1,6 @@
1
- import type { CSSProperties } from "react";
2
1
  interface BreakerProps {
3
- text?: string;
4
- style?: CSSProperties;
5
- isMobile?: boolean;
6
- onSend?: (value: string) => void;
2
+ text: string;
3
+ onSend: (value: string) => void;
7
4
  }
8
- declare const Breaker: ({ text, isMobile, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const Breaker: ({ text, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
9
6
  export default Breaker;
@@ -1,10 +1,6 @@
1
- import { type CSSProperties } from "react";
2
1
  interface IceBreakersProps {
3
- data?: string[];
4
- className?: string;
5
- style?: CSSProperties;
6
- isMobile?: boolean;
7
- onSend?: (value: string) => void;
2
+ data: string[];
3
+ onSend: (value: string) => void;
8
4
  }
9
- declare const IceBreakers: ({ data, className, isMobile, onSend, }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const IceBreakers: ({ data, onSend }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element;
10
6
  export default IceBreakers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const t="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;exports.useMediaQuery=r=>{const n=Array.isArray(r)?r:[r],a="undefined"!=typeof window&&"matchMedia"in window,[i,o]=e.useState(n.map((e=>!!a&&!!window.matchMedia(e).matches)));return t((()=>{if(!a)return;const e=n.map((e=>window.matchMedia(e))),t=e.map((()=>{const t=()=>{const t=e.map((e=>e.matches));var r,n;n=t,(r=i).length===n.length&&r.every(((e,t)=>e===n[t]))||o(t)};return window.addEventListener("resize",t),t}));return()=>{e.forEach(((e,r)=>{window.removeEventListener("resize",t[r])}))}}),[n]),i};
@@ -1 +0,0 @@
1
- import{useState as e,useLayoutEffect as n,useEffect as t}from"react";const r="undefined"!=typeof window?n:t,i=n=>{const t=Array.isArray(n)?n:[n],i="undefined"!=typeof window&&"matchMedia"in window,[o,a]=e(t.map((e=>!!i&&!!window.matchMedia(e).matches)));return r((()=>{if(!i)return;const e=t.map((e=>window.matchMedia(e))),n=e.map((()=>{const n=()=>{const n=e.map((e=>e.matches));var t,r;r=n,(t=o).length===r.length&&t.every(((e,n)=>e===r[n]))||a(n)};return window.addEventListener("resize",n),n}));return()=>{e.forEach(((e,t)=>{window.removeEventListener("resize",n[t])}))}}),[t]),o};export{i as useMediaQuery};