codicent-app-sdk 0.3.99 → 0.3.101

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 (56) hide show
  1. package/dist/cjs/components/Button.d.ts.map +1 -1
  2. package/dist/cjs/components/Button.js +1 -1
  3. package/dist/cjs/components/CompoundButton.d.ts.map +1 -1
  4. package/dist/cjs/components/CompoundButton.js +1 -1
  5. package/dist/cjs/components/Footer.d.ts.map +1 -1
  6. package/dist/cjs/components/Footer.js +1 -1
  7. package/dist/cjs/components/Header.d.ts.map +1 -1
  8. package/dist/cjs/components/Header.js +1 -1
  9. package/dist/cjs/components/SnapFooter.d.ts.map +1 -1
  10. package/dist/cjs/components/SnapFooter.js +1 -1
  11. package/dist/cjs/components/Spinner.d.ts.map +1 -1
  12. package/dist/cjs/components/Spinner.js +1 -1
  13. package/dist/cjs/hooks/useAppStyles.d.ts +1 -1
  14. package/dist/cjs/hooks/useLocalization.d.ts.map +1 -1
  15. package/dist/cjs/hooks/useLocalization.js +1 -1
  16. package/dist/cjs/pages/Sales.d.ts.map +1 -1
  17. package/dist/cjs/pages/Sales.js +1 -1
  18. package/dist/cjs/pages/Search.d.ts.map +1 -1
  19. package/dist/cjs/pages/Search.js +1 -1
  20. package/dist/cjs/services/codicent.d.ts +15 -0
  21. package/dist/cjs/services/codicent.d.ts.map +1 -1
  22. package/dist/cjs/services/codicent.js +1 -1
  23. package/dist/esm/components/Button.d.ts.map +1 -1
  24. package/dist/esm/components/Button.js +1 -1
  25. package/dist/esm/components/CompoundButton.d.ts.map +1 -1
  26. package/dist/esm/components/CompoundButton.js +1 -1
  27. package/dist/esm/components/Footer.d.ts.map +1 -1
  28. package/dist/esm/components/Footer.js +1 -1
  29. package/dist/esm/components/Header.d.ts.map +1 -1
  30. package/dist/esm/components/Header.js +1 -1
  31. package/dist/esm/components/SnapFooter.d.ts.map +1 -1
  32. package/dist/esm/components/SnapFooter.js +1 -1
  33. package/dist/esm/components/Spinner.d.ts.map +1 -1
  34. package/dist/esm/components/Spinner.js +1 -1
  35. package/dist/esm/hooks/useAppStyles.d.ts +1 -1
  36. package/dist/esm/hooks/useLocalization.d.ts.map +1 -1
  37. package/dist/esm/hooks/useLocalization.js +1 -1
  38. package/dist/esm/pages/Sales.d.ts.map +1 -1
  39. package/dist/esm/pages/Sales.js +1 -1
  40. package/dist/esm/pages/Search.d.ts.map +1 -1
  41. package/dist/esm/pages/Search.js +1 -1
  42. package/dist/esm/services/codicent.d.ts +15 -0
  43. package/dist/esm/services/codicent.d.ts.map +1 -1
  44. package/dist/esm/services/codicent.js +1 -1
  45. package/dist/index.d.ts +17 -2
  46. package/package.json +1 -1
  47. package/dist/cjs/node_modules/@openai/realtime-api-beta/lib/api.js +0 -1
  48. package/dist/cjs/node_modules/@openai/realtime-api-beta/lib/client.js +0 -1
  49. package/dist/cjs/node_modules/@openai/realtime-api-beta/lib/conversation.js +0 -1
  50. package/dist/cjs/node_modules/@openai/realtime-api-beta/lib/event_handler.js +0 -1
  51. package/dist/cjs/node_modules/@openai/realtime-api-beta/lib/utils.js +0 -1
  52. package/dist/esm/node_modules/@openai/realtime-api-beta/lib/api.js +0 -1
  53. package/dist/esm/node_modules/@openai/realtime-api-beta/lib/client.js +0 -1
  54. package/dist/esm/node_modules/@openai/realtime-api-beta/lib/conversation.js +0 -1
  55. package/dist/esm/node_modules/@openai/realtime-api-beta/lib/event_handler.js +0 -1
  56. package/dist/esm/node_modules/@openai/realtime-api-beta/lib/utils.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+B/B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,G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,EACD,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,yBAAyB,GACzB,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,uBAAuB,GACvB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAsBD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAWxC,CAAC"}
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),u=require("../config/index.js"),r=require("../node_modules/@griffel/react/makeStyles.esm.js"),s=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js"),i=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js"),l=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js"),n=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js"),o=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js"),a=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js"),t=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js"),c=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js"),d=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js"),g=require("../node_modules/@fluentui/react-button/lib/components/Button/Button.js"),R=require("../node_modules/@griffel/core/mergeClasses.esm.js");const j=r.makeStyles({button:{borderRadius:u.getConfigValue("BUTTON_BORDER_RADIUS")||void 0}}),m={DismissRegular:e.jsx(s.DismissRegular,{}),CopyRegular:e.jsx(s.CopyRegular,{}),ShareRegular:e.jsx(i.ShareRegular,{}),SignOut24Regular:e.jsx(l.SignOut24Regular,{}),Payment24Regular:e.jsx(n.Payment24Regular,{}),SlideText24Regular:e.jsx(l.SlideText24Regular,{}),QuestionCircle24Regular:e.jsx(o.QuestionCircle24Regular,{}),SendFilled:e.jsx(a.SendFilled,{}),AttachRegular:e.jsx(t.AttachRegular,{}),ImageRegular:e.jsx(c.ImageRegular,{}),CameraRegular:e.jsx(t.CameraRegular,{}),LocationRegular:e.jsx(c.LocationRegular,{}),LocationFilled:e.jsx(c.LocationFilled,{}),AddRegular:e.jsx(t.AddRegular,{}),ChevronRightFilled:e.jsx(s.ChevronRightFilled,{}),ArrowClockwiseRegular:e.jsx(t.ArrowClockwiseRegular,{}),WandRegular:e.jsx(d.WandRegular,{})};exports.Button=({children:u,className:r,icon:s,image:i,...l})=>{const n=j();return e.jsx(g.Button,{className:R.mergeClasses(r,n.button),icon:s?{children:m[s]}:i?{children:i}:void 0,...l,children:u})};
1
+ "use strict";var e=require("react/jsx-runtime"),u=require("../node_modules/@griffel/react/makeStyles.esm.js"),s=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js"),r=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js"),l=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js"),i=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js"),n=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js"),o=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js"),a=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js"),t=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js"),c=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js"),d=require("../node_modules/@fluentui/react-button/lib/components/Button/Button.js"),g=require("../node_modules/@griffel/core/mergeClasses.esm.js");const j=u.makeStyles({button:{}}),m={DismissRegular:e.jsx(s.DismissRegular,{}),CopyRegular:e.jsx(s.CopyRegular,{}),ShareRegular:e.jsx(r.ShareRegular,{}),SignOut24Regular:e.jsx(l.SignOut24Regular,{}),Payment24Regular:e.jsx(i.Payment24Regular,{}),SlideText24Regular:e.jsx(l.SlideText24Regular,{}),QuestionCircle24Regular:e.jsx(n.QuestionCircle24Regular,{}),SendFilled:e.jsx(o.SendFilled,{}),AttachRegular:e.jsx(a.AttachRegular,{}),ImageRegular:e.jsx(t.ImageRegular,{}),CameraRegular:e.jsx(a.CameraRegular,{}),LocationRegular:e.jsx(t.LocationRegular,{}),LocationFilled:e.jsx(t.LocationFilled,{}),AddRegular:e.jsx(a.AddRegular,{}),ChevronRightFilled:e.jsx(s.ChevronRightFilled,{}),ArrowClockwiseRegular:e.jsx(a.ArrowClockwiseRegular,{}),WandRegular:e.jsx(c.WandRegular,{})};exports.Button=({children:u,className:s,icon:r,image:l,...i})=>{const n=j();return e.jsx(d.Button,{className:g.mergeClasses(s,n.button),icon:r?{children:m[r]}:l?{children:l}:void 0,...i,children:u})};
@@ -1 +1 @@
1
- {"version":3,"file":"CompoundButton.d.ts","sourceRoot":"","sources":["../../../src/components/CompoundButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC;IAC3D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;IAChE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,O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EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EACD,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,yBAAyB,GACzB,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,uBAAuB,GACvB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAsBD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC"}
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),u=require("../config/index.js"),n=require("../node_modules/@griffel/react/makeStyles.esm.js"),r=require("../node_modules/@fluentui/react-button/lib/components/CompoundButton/CompoundButton.js"),s=require("../node_modules/@griffel/core/mergeClasses.esm.js"),i=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js"),o=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js"),l=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js"),a=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js"),t=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js"),c=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js"),d=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js"),g=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js"),m=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js");const R=n.makeStyles({compoundButton:{borderRadius:u.getConfigValue("BUTTON_BORDER_RADIUS")||void 0}}),j={DismissRegular:e.jsx(i.DismissRegular,{}),CopyRegular:e.jsx(i.CopyRegular,{}),ShareRegular:e.jsx(o.ShareRegular,{}),SignOut24Regular:e.jsx(l.SignOut24Regular,{}),Payment24Regular:e.jsx(a.Payment24Regular,{}),SlideText24Regular:e.jsx(l.SlideText24Regular,{}),QuestionCircle24Regular:e.jsx(t.QuestionCircle24Regular,{}),SendFilled:e.jsx(c.SendFilled,{}),AttachRegular:e.jsx(d.AttachRegular,{}),ImageRegular:e.jsx(g.ImageRegular,{}),CameraRegular:e.jsx(d.CameraRegular,{}),LocationRegular:e.jsx(g.LocationRegular,{}),LocationFilled:e.jsx(g.LocationFilled,{}),AddRegular:e.jsx(d.AddRegular,{}),ChevronRightFilled:e.jsx(i.ChevronRightFilled,{}),ArrowClockwiseRegular:e.jsx(d.ArrowClockwiseRegular,{}),WandRegular:e.jsx(m.WandRegular,{})};exports.CompoundButton=({children:u,className:n,icon:i,image:o,secondaryContent:l,...a})=>{const t=R(),c="string"==typeof l?{children:l}:l;return e.jsx(r.CompoundButton,{className:s.mergeClasses(n,t.compoundButton),icon:i?{children:j[i]}:o?{children:o}:void 0,secondaryContent:c,...a,children:u})};
1
+ "use strict";var e=require("react/jsx-runtime"),u=require("../node_modules/@griffel/react/makeStyles.esm.js"),n=require("../node_modules/@fluentui/react-button/lib/components/CompoundButton/CompoundButton.js"),r=require("../node_modules/@griffel/core/mergeClasses.esm.js"),s=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js"),o=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js"),i=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js"),l=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js"),a=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js"),t=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js"),c=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js"),d=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js"),g=require("../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js");const m=u.makeStyles({compoundButton:{}}),j={DismissRegular:e.jsx(s.DismissRegular,{}),CopyRegular:e.jsx(s.CopyRegular,{}),ShareRegular:e.jsx(o.ShareRegular,{}),SignOut24Regular:e.jsx(i.SignOut24Regular,{}),Payment24Regular:e.jsx(l.Payment24Regular,{}),SlideText24Regular:e.jsx(i.SlideText24Regular,{}),QuestionCircle24Regular:e.jsx(a.QuestionCircle24Regular,{}),SendFilled:e.jsx(t.SendFilled,{}),AttachRegular:e.jsx(c.AttachRegular,{}),ImageRegular:e.jsx(d.ImageRegular,{}),CameraRegular:e.jsx(c.CameraRegular,{}),LocationRegular:e.jsx(d.LocationRegular,{}),LocationFilled:e.jsx(d.LocationFilled,{}),AddRegular:e.jsx(c.AddRegular,{}),ChevronRightFilled:e.jsx(s.ChevronRightFilled,{}),ArrowClockwiseRegular:e.jsx(c.ArrowClockwiseRegular,{}),WandRegular:e.jsx(g.WandRegular,{})};exports.CompoundButton=({children:u,className:s,icon:o,image:i,secondaryContent:l,...a})=>{const t=m(),c="string"==typeof l?{children:l}:l;return e.jsx(n.CompoundButton,{className:r.mergeClasses(s,t.compoundButton),icon:o?{children:j[o]}:i?{children:i}:void 0,secondaryContent:c,...a,children:u})};
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/components/Footer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAiFnD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAkG1B,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/components/Footer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA8EnD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAgH1B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),r=require("react-router-dom");require("../services/codicent.js"),require("./Markdown.js"),require("./Textarea.js"),require("./Button.js"),require("./CompoundButton.js"),require("./Spinner.js"),require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js"),require("./Header.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var i=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./FileThumbnail.js"),require("./MessageInput.js"),require("./UploadFile.js"),require("./SnapFooter.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Page.js"),require("../pages/AppFrame.js"),require("../pages/Chat.js"),require("../pages/Compose.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/CrmPagePersistent.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../pages/Purchase.js"),require("../stores/chatStore.js");var o=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js");var n=require("../node_modules/@griffel/react/makeStyles.esm.js"),a=require("../node_modules/@griffel/core/index.esm.js"),t=require("../node_modules/@fluentui/tokens/lib/tokens.js"),l=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-8.js"),u=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-3.js"),c=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-0.js"),d=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-4.js"),j=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js"),g=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-18.js");const p=n.makeStyles({footer:{...a.shorthands.padding("14px"),backgroundColor:i.getConfigValue("APP_FOOTER_COLOR")||t.tokens.colorBrandBackground,color:i.getConfigValue("APP_FOOTER_TEXT_COLOR")||t.tokens.colorNeutralForegroundOnBrand,textAlign:"center",display:"flex",justifyContent:"space-around",alignItems:"center",position:"sticky",bottom:0,zIndex:1e3,paddingBottom:"22px",width:"100%"},container:{display:"flex",justifyContent:"space-around",alignItems:"center",maxWidth:"480px",width:"100%"},button:{color:t.tokens.colorNeutralForegroundOnBrand,height:"24px",width:"24px",...a.shorthands.borderWidth("0")},link:{textDecoration:"none",color:"inherit",display:"flex",flexDirection:"column",alignItems:"center","&.selected":{border:"none",color:i.getConfigValue("APP_FOOTER_SELECTED_COLOR")||void 0},"&:hover":{textDecoration:"none"}},buttonText:{fontSize:"12px"}}),m=()=>{const n=p(),a=r.useLocation(),[t,m]=s.useState(null),{t:x}=o.default();return s.useEffect((()=>{const e=a.pathname;"/"===e?m("home"):"/chat"===e?m("chat"):"/new"===e?m("save"):"/menu"===e?m("menu"):"/log"===e?m("log"):"/canvas"===e?m("canvas"):"/snap"===e&&m("snap")}),[a]),s.useEffect((()=>{t&&console.log(`footer-button: ${t}`)}),[t]),e.jsx("footer",{className:n.footer,children:e.jsxs("div",{className:n.container,children:[e.jsxs(r.Link,{to:"/",className:`${n.link} ${"home"===t?"selected":""}`,onClick:()=>m("home"),children:["home"===t?e.jsx(l.Home24Filled,{}):e.jsx(l.Home24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Hem")})]}),!i.getConfigValue("HIDE_CHAT_BUTTON")&&e.jsxs(r.Link,{to:"/chat",className:`${n.link} ${"chat"===t?"selected":""}`,onClick:()=>m("chat"),children:["chat"===t?e.jsx(u.Chat24Filled,{}):e.jsx(u.Chat24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Chatt")})]}),!i.getConfigValue("HIDE_SAVE_BUTTON")&&e.jsxs(r.Link,{to:"/new",className:`${n.link} ${"save"===t?"selected":""}`,onClick:()=>m("save"),children:["save"===t?e.jsx(c.AddSquare24Filled,{}):e.jsx(c.AddSquare24Regular,{}),e.jsx("p",{className:n.buttonText,children:x(i.getConfigValue("APP_SAVE_TITLE")||"Spara")})]}),i.getConfigValue("SHOW_SNAP_BUTTON")&&e.jsxs(r.Link,{to:"/snap",className:`${n.link} ${"snap"===t?"selected":""}`,onClick:()=>m("snap"),children:["snap"===t?e.jsx(d.ClipboardDay24Filled,{}):e.jsx(d.ClipboardDay24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Snap")})]}),i.getConfigValue("SHOW_LOGBOOK_BUTTON")&&e.jsxs(r.Link,{to:"/log",className:`${n.link} ${"log"===t?"selected":""}`,onClick:()=>m("log"),children:["log"===t?e.jsx(j.SlideText24Filled,{}):e.jsx(j.SlideText24Regular,{}),e.jsx("p",{className:n.buttonText,children:x(i.getConfigValue("APP_LOGBOOK_TITLE")||"Loggbok")})]}),i.getConfigValue("SHOW_CANVAS_BUTTON")&&e.jsxs(r.Link,{to:"/canvas",className:`${n.link} ${"canvas"===t?"selected":""}`,onClick:()=>m("canvas"),children:["canvas"===t?e.jsx(g.Whiteboard24Filled,{}):e.jsx(g.Whiteboard24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Kanvas")})]}),!i.getConfigValue("HIDE_MENU_BUTTON")&&e.jsxs(r.Link,{to:"/menu",className:`${n.link} ${"menu"===t?"selected":""}`,onClick:()=>m("menu"),children:["menu"===t?e.jsx(c.Apps24Filled,{}):e.jsx(c.Apps24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Meny")})]})]})})};exports.Footer=m,exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),r=require("react-router-dom");require("../services/codicent.js"),require("./Markdown.js"),require("./Textarea.js"),require("./Button.js"),require("./CompoundButton.js"),require("./Spinner.js"),require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js"),require("./Header.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var i=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./FileThumbnail.js"),require("./MessageInput.js"),require("./UploadFile.js"),require("./SnapFooter.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Page.js"),require("../pages/AppFrame.js"),require("../pages/Chat.js"),require("../pages/Compose.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/CrmPagePersistent.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../pages/Purchase.js"),require("../stores/chatStore.js");var o=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js");var n=require("../node_modules/@griffel/react/makeStyles.esm.js"),a=require("../node_modules/@griffel/core/index.esm.js"),t=require("../node_modules/@fluentui/tokens/lib/tokens.js"),l=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-8.js"),u=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-3.js"),c=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-0.js"),d=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-4.js"),j=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js"),g=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-18.js");const p=n.makeStyles({footer:{...a.shorthands.padding("14px"),textAlign:"center",display:"flex",justifyContent:"space-around",alignItems:"center",position:"sticky",bottom:0,zIndex:1e3,paddingBottom:"22px",width:"100%"},container:{display:"flex",justifyContent:"space-around",alignItems:"center",maxWidth:"480px",width:"100%"},button:{color:t.tokens.colorNeutralForegroundOnBrand,height:"24px",width:"24px",...a.shorthands.borderWidth("0")},link:{textDecoration:"none",color:"inherit",display:"flex",flexDirection:"column",alignItems:"center","&.selected":{border:"none"},"&:hover":{textDecoration:"none"}},buttonText:{fontSize:"12px"}}),m=()=>{const n=p(),a=r.useLocation(),[m,h]=s.useState(null),{t:x}=o.default(),q={backgroundColor:i.getConfigValue("APP_FOOTER_COLOR")||t.tokens.colorBrandBackground,color:i.getConfigValue("APP_FOOTER_TEXT_COLOR")||t.tokens.colorNeutralForegroundOnBrand},k=i.getConfigValue("APP_FOOTER_SELECTED_COLOR")||void 0;return s.useEffect((()=>{const e=a.pathname;"/"===e?h("home"):"/chat"===e?h("chat"):"/new"===e?h("save"):"/menu"===e?h("menu"):"/log"===e?h("log"):"/canvas"===e?h("canvas"):"/snap"===e&&h("snap")}),[a]),s.useEffect((()=>{m&&console.log(`footer-button: ${m}`)}),[m]),e.jsx("footer",{className:n.footer,style:q,children:e.jsxs("div",{className:n.container,children:[e.jsxs(r.Link,{to:"/",className:`${n.link} ${"home"===m?"selected":""}`,onClick:()=>h("home"),style:"home"===m?{color:k}:void 0,children:["home"===m?e.jsx(l.Home24Filled,{}):e.jsx(l.Home24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Hem")})]}),!i.getConfigValue("HIDE_CHAT_BUTTON")&&e.jsxs(r.Link,{to:"/chat",className:`${n.link} ${"chat"===m?"selected":""}`,onClick:()=>h("chat"),style:"chat"===m?{color:k}:void 0,children:["chat"===m?e.jsx(u.Chat24Filled,{}):e.jsx(u.Chat24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Chatt")})]}),!i.getConfigValue("HIDE_SAVE_BUTTON")&&e.jsxs(r.Link,{to:"/new",className:`${n.link} ${"save"===m?"selected":""}`,onClick:()=>h("save"),style:"save"===m?{color:k}:void 0,children:["save"===m?e.jsx(c.AddSquare24Filled,{}):e.jsx(c.AddSquare24Regular,{}),e.jsx("p",{className:n.buttonText,children:x(i.getConfigValue("APP_SAVE_TITLE")||"Spara")})]}),i.getConfigValue("SHOW_SNAP_BUTTON")&&e.jsxs(r.Link,{to:"/snap",className:`${n.link} ${"snap"===m?"selected":""}`,onClick:()=>h("snap"),style:"snap"===m?{color:k}:void 0,children:["snap"===m?e.jsx(d.ClipboardDay24Filled,{}):e.jsx(d.ClipboardDay24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Snap")})]}),i.getConfigValue("SHOW_LOGBOOK_BUTTON")&&e.jsxs(r.Link,{to:"/log",className:`${n.link} ${"log"===m?"selected":""}`,onClick:()=>h("log"),style:"log"===m?{color:k}:void 0,children:["log"===m?e.jsx(j.SlideText24Filled,{}):e.jsx(j.SlideText24Regular,{}),e.jsx("p",{className:n.buttonText,children:x(i.getConfigValue("APP_LOGBOOK_TITLE")||"Loggbok")})]}),i.getConfigValue("SHOW_CANVAS_BUTTON")&&e.jsxs(r.Link,{to:"/canvas",className:`${n.link} ${"canvas"===m?"selected":""}`,onClick:()=>h("canvas"),style:"canvas"===m?{color:k}:void 0,children:["canvas"===m?e.jsx(g.Whiteboard24Filled,{}):e.jsx(g.Whiteboard24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Kanvas")})]}),!i.getConfigValue("HIDE_MENU_BUTTON")&&e.jsxs(r.Link,{to:"/menu",className:`${n.link} ${"menu"===m?"selected":""}`,onClick:()=>h("menu"),style:"menu"===m?{color:k}:void 0,children:["menu"===m?e.jsx(c.Apps24Filled,{}):e.jsx(c.Apps24Regular,{}),e.jsx("p",{className:n.buttonText,children:x("Meny")})]})]})})};exports.Footer=m,exports.default=m;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkCxD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAsCE,CAAC"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAgCxD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CA4CA,CAAC"}
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react-router-dom");require("./Markdown.js"),require("./Textarea.js"),require("./Button.js"),require("./CompoundButton.js"),require("./Spinner.js"),require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js");var s=require("./VoiceIcon.js"),i=require("./AudioIcon.js");require("./FileThumbnail.js"),require("./MessageInput.js"),require("./UploadFile.js"),require("./SnapFooter.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Footer.js"),require("./Page.js"),require("react"),require("../services/codicent.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var a=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("../pages/AppFrame.js"),require("../pages/Chat.js"),require("../pages/Compose.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/CrmPagePersistent.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../pages/Purchase.js"),require("../stores/chatStore.js"),require("../hooks/useLocalization.js"),require("../hooks/useAppStyles.js");var o=require("../node_modules/@griffel/react/makeStyles.esm.js"),t=require("../node_modules/@griffel/core/index.esm.js"),u=require("../node_modules/@fluentui/tokens/lib/tokens.js"),n=require("../node_modules/@fluentui/react-image/lib/components/Image/Image.js"),l=require("../node_modules/@fluentui/react-text/lib/components/presets/Title3/Title3.js"),j=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js");const c=o.makeStyles({header:{...t.shorthands.padding("14px"),backgroundColor:a.getConfigValue("APP_HEADER_COLOR")||u.tokens.colorBrandBackground,color:a.getConfigValue("APP_HEADER_TEXT_COLOR")||u.tokens.colorNeutralForegroundOnBrand,textAlign:"center",position:"sticky",top:0,zIndex:1e3,alignItems:"center",height:"64px",display:"flex",justifyContent:"space-between"},logo:{height:"40px",shape:"circular"},link:{textDecoration:"none",color:"inherit"},headerItem:{display:"flex",alignItems:"center",gap:"16px"}});exports.Header=({imageUrl:o,title:t,audio:u,voice:d})=>{const g=c();return e.jsxs("header",{className:g.header,children:[e.jsxs("div",{className:g.headerItem,children:[o&&e.jsx(n.Image,{className:g.logo,alt:"Logo",src:o,height:40}),t&&e.jsx(l.Title3,{children:t})]}),e.jsxs("div",{className:g.headerItem,children:[u&&a.getConfigValue("SHOW_MICROPHONE_BUTTON")&&e.jsx(i.default,{audio:u,disabled:d?.isConnected}),d&&a.getConfigValue("SHOW_VOICE_BUTTON")&&e.jsx(s.default,{voice:d,disabled:u?.isRecording}),a.getConfigValue("SHOW_SETTINGS_BUTTON")&&e.jsx(r.Link,{to:"/menu",className:g.link,children:e.jsx(j.Settings24Regular,{})})]})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react-router-dom");require("./Markdown.js"),require("./Textarea.js"),require("./Button.js"),require("./CompoundButton.js"),require("./Spinner.js"),require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js");var s=require("./VoiceIcon.js"),i=require("./AudioIcon.js");require("./FileThumbnail.js"),require("./MessageInput.js"),require("./UploadFile.js"),require("./SnapFooter.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Footer.js"),require("./Page.js"),require("react"),require("../services/codicent.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var a=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("../pages/AppFrame.js"),require("../pages/Chat.js"),require("../pages/Compose.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/CrmPagePersistent.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../pages/Purchase.js"),require("../stores/chatStore.js"),require("../hooks/useLocalization.js"),require("../hooks/useAppStyles.js");var o=require("../node_modules/@griffel/react/makeStyles.esm.js"),t=require("../node_modules/@griffel/core/index.esm.js"),u=require("../node_modules/@fluentui/tokens/lib/tokens.js"),n=require("../node_modules/@fluentui/react-image/lib/components/Image/Image.js"),l=require("../node_modules/@fluentui/react-text/lib/components/presets/Title3/Title3.js"),j=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js");const c=o.makeStyles({header:{...t.shorthands.padding("14px"),textAlign:"center",position:"sticky",top:0,zIndex:1e3,alignItems:"center",height:"64px",display:"flex",justifyContent:"space-between"},logo:{height:"40px",shape:"circular"},link:{textDecoration:"none",color:"inherit"},headerItem:{display:"flex",alignItems:"center",gap:"16px"}});exports.Header=({imageUrl:o,title:t,audio:d,voice:g})=>{const q=c(),p={backgroundColor:a.getConfigValue("APP_HEADER_COLOR")||u.tokens.colorBrandBackground,color:a.getConfigValue("APP_HEADER_TEXT_COLOR")||u.tokens.colorNeutralForegroundOnBrand};return e.jsxs("header",{className:q.header,style:p,children:[e.jsxs("div",{className:q.headerItem,children:[o&&e.jsx(n.Image,{className:q.logo,alt:"Logo",src:o,height:40}),t&&e.jsx(l.Title3,{children:t})]}),e.jsxs("div",{className:q.headerItem,children:[d&&a.getConfigValue("SHOW_MICROPHONE_BUTTON")&&e.jsx(i.default,{audio:d,disabled:g?.isConnected}),g&&a.getConfigValue("SHOW_VOICE_BUTTON")&&e.jsx(s.default,{voice:g,disabled:d?.isRecording}),a.getConfigValue("SHOW_SETTINGS_BUTTON")&&e.jsx(r.Link,{to:"/menu",className:q.link,children:e.jsx(j.Settings24Regular,{})})]})]})};
@@ -1 +1 @@
1
- {"version":3,"file":"SnapFooter.d.ts","sourceRoot":"","sources":["../../../src/components/SnapFooter.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAmB,MAAM,UAAU,CAAC;AAgD1D,QAAA,MAAM,UAAU,wDAMb;IACD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,4CAuCA,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"SnapFooter.d.ts","sourceRoot":"","sources":["../../../src/components/SnapFooter.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAmB,MAAM,UAAU,CAAC;AA8C1D,QAAA,MAAM,UAAU,wDAMb;IACD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,4CA4CA,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react"),require("../services/codicent.js"),require("./Markdown.js"),require("./Textarea.js"),require("./Button.js"),require("./CompoundButton.js"),require("./Spinner.js"),require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js"),require("./Header.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var r=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./FileThumbnail.js"),require("./MessageInput.js"),require("./UploadFile.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Footer.js"),require("./Page.js"),require("../pages/AppFrame.js"),require("../pages/Chat.js"),require("../pages/Compose.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/CrmPagePersistent.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../pages/Purchase.js"),require("../stores/chatStore.js");var s=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js");var i=require("../node_modules/@griffel/react/makeStyles.esm.js"),o=require("../node_modules/@griffel/core/index.esm.js"),a=require("../node_modules/@fluentui/tokens/lib/tokens.js"),t=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-8.js"),n=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-3.js"),u=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-10.js");const l=i.makeStyles({footer:{...o.shorthands.padding("14px"),backgroundColor:r.getConfigValue("APP_HEADER_COLOR")||a.tokens.colorBrandBackground,color:r.getConfigValue("APP_HEADER_TEXT_COLOR")||a.tokens.colorNeutralForegroundOnBrand,textAlign:"center",display:"flex",justifyContent:"space-around",alignItems:"center",position:"sticky",bottom:0,zIndex:1e3,paddingBottom:"22px",width:"100%"},container:{display:"flex",justifyContent:"space-around",alignItems:"center",maxWidth:"480px",width:"100%"},button:{color:a.tokens.colorNeutralForegroundOnBrand,height:"24px",width:"24px",...o.shorthands.borderWidth("0")},link:{textDecoration:"none",color:"inherit","&.selected":{border:"none"},"&:hover":{textDecoration:"none"},minWidth:"48px"},buttonText:{fontSize:"12px"}});exports.default=({onHome:i,onTakePhoto:o,onSwichCamera:a,audio:c,tag:d})=>{const j=l(),{isRecording:q,isSoundCaptured:g,startRecording:p,stopRecording:m}=c,{t:x}=s.default();return e.jsx("footer",{className:j.footer,children:e.jsxs("div",{className:j.container,children:[e.jsxs("div",{className:j.link,onClick:i,children:[e.jsx(t.Home24Regular,{}),e.jsx("p",{className:j.buttonText,children:x("Hem")})]}),e.jsxs("div",{className:j.link,children:[q&&g&&e.jsx(u.MicPulse24Filled,{onClick:m}),q&&!g&&e.jsx(u.MicRecord24Filled,{onClick:m}),!q&&e.jsx(u.Mic24Regular,{onClick:()=>p(d)}),e.jsx("p",{className:j.buttonText,children:x("Ljud")})]}),e.jsxs("div",{className:j.link,onClick:()=>{r.getConfigValue("RESTART_AUDIO_ON_TAKE_PHOTO")&&q?(m(),o(),p(d)):o()},children:[e.jsx(n.Camera24Regular,{}),e.jsx("p",{className:j.buttonText,children:x("Ta kort")})]}),e.jsxs("div",{className:j.link,onClick:a,children:[e.jsx(n.CameraSwitch24Regular,{}),e.jsx("p",{className:j.buttonText,children:x("Byt kamera")})]})]})})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react"),require("../services/codicent.js"),require("./Markdown.js"),require("./Textarea.js"),require("./Button.js"),require("./CompoundButton.js"),require("./Spinner.js"),require("./TextHeader.js"),require("./TypingIndicator.js"),require("./Dialog.js"),require("./ChatInput.js"),require("./CombinedPlaceholderDialog.js"),require("./ChatMessage.js"),require("./Header.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var r=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./FileThumbnail.js"),require("./MessageInput.js"),require("./UploadFile.js"),require("./Profile.js"),require("./MessageItem.js"),require("./Content.js"),require("./AiInput.js"),require("./SearchBox.js"),require("./HtmlView.js"),require("./Footer.js"),require("./Page.js"),require("../pages/AppFrame.js"),require("../pages/Chat.js"),require("../pages/Compose.js"),require("../pages/Snap.js"),require("../pages/Search.js"),require("../pages/Login.js"),require("../pages/CrmPage.js"),require("../pages/CrmPagePersistent.js"),require("../pages/ImageView.js"),require("../pages/FormInvite.js"),require("../pages/FormAccept.js"),require("../pages/Sales.js"),require("../pages/Purchase.js"),require("../stores/chatStore.js");var s=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js");var i=require("../node_modules/@griffel/react/makeStyles.esm.js"),o=require("../node_modules/@griffel/core/index.esm.js"),t=require("../node_modules/@fluentui/tokens/lib/tokens.js"),a=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-8.js"),n=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-3.js"),u=require("../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-10.js");const l=i.makeStyles({footer:{...o.shorthands.padding("14px"),textAlign:"center",display:"flex",justifyContent:"space-around",alignItems:"center",position:"sticky",bottom:0,zIndex:1e3,paddingBottom:"22px",width:"100%"},container:{display:"flex",justifyContent:"space-around",alignItems:"center",maxWidth:"480px",width:"100%"},button:{color:t.tokens.colorNeutralForegroundOnBrand,height:"24px",width:"24px",...o.shorthands.borderWidth("0")},link:{textDecoration:"none",color:"inherit","&.selected":{border:"none"},"&:hover":{textDecoration:"none"},minWidth:"48px"},buttonText:{fontSize:"12px"}});exports.default=({onHome:i,onTakePhoto:o,onSwichCamera:c,audio:d,tag:j})=>{const q=l(),{isRecording:g,isSoundCaptured:p,startRecording:m,stopRecording:x}=d,{t:h}=s.default(),k={backgroundColor:r.getConfigValue("APP_HEADER_COLOR")||t.tokens.colorBrandBackground,color:r.getConfigValue("APP_HEADER_TEXT_COLOR")||t.tokens.colorNeutralForegroundOnBrand};return e.jsx("footer",{className:q.footer,style:k,children:e.jsxs("div",{className:q.container,children:[e.jsxs("div",{className:q.link,onClick:i,children:[e.jsx(a.Home24Regular,{}),e.jsx("p",{className:q.buttonText,children:h("Hem")})]}),e.jsxs("div",{className:q.link,children:[g&&p&&e.jsx(u.MicPulse24Filled,{onClick:x}),g&&!p&&e.jsx(u.MicRecord24Filled,{onClick:x}),!g&&e.jsx(u.Mic24Regular,{onClick:()=>m(j)}),e.jsx("p",{className:q.buttonText,children:h("Ljud")})]}),e.jsxs("div",{className:q.link,onClick:()=>{r.getConfigValue("RESTART_AUDIO_ON_TAKE_PHOTO")&&g?(x(),o(),m(j)):o()},children:[e.jsx(n.Camera24Regular,{}),e.jsx("p",{className:q.buttonText,children:h("Ta kort")})]}),e.jsxs("div",{className:q.link,onClick:c,children:[e.jsx(n.CameraSwitch24Regular,{}),e.jsx("p",{className:q.buttonText,children:h("Byt kamera")})]})]})})};
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,aAAa,GAAG,MAAM,CAAC;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAO1C,CAAC"}
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,aAAa,GAAG,MAAM,CAAC;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAY1C,CAAC"}
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),n=require("../config/index.js"),r=require("../node_modules/@griffel/react/makeStyles.esm.js"),i=require("../node_modules/@fluentui/react-spinner/lib/components/Spinner/Spinner.js");const s=r.makeStyles({spinner:{color:n.getConfigValue("BUTTON_BACKGROUND_COLOR")||"undefined"}});exports.Spinner=({children:n,...r})=>{const t=s();return e.jsx(i.Spinner,{className:t.spinner,...r,children:n})};
1
+ "use strict";var e=require("react/jsx-runtime"),n=require("../config/index.js"),r=require("../node_modules/@griffel/react/makeStyles.esm.js"),i=require("../node_modules/@fluentui/react-spinner/lib/components/Spinner/Spinner.js");const s=r.makeStyles({spinner:{}});exports.Spinner=({children:r,...t})=>{const o=s(),l={color:n.getConfigValue("BUTTON_BACKGROUND_COLOR")||void 0};return e.jsx(i.Spinner,{className:o.spinner,style:l,...t,children:r})};
@@ -1,3 +1,3 @@
1
- declare const useAppStyles: () => Record<"button" | "roundButton" | "menuButton" | "pointer", string>;
1
+ declare const useAppStyles: () => Record<"button" | "pointer" | "roundButton" | "menuButton", string>;
2
2
  export default useAppStyles;
3
3
  //# sourceMappingURL=useAppStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocalization.d.ts","sourceRoot":"","sources":["../../../src/hooks/useLocalization.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IACtB,MAAM,EAAE,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAC7D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAgGD,eAAO,MAAM,gBAAgB,YAAiB,CAAC;AAE/C,QAAA,MAAM,eAAe;aAuCX,MAAM;kBAoEA,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC;;+BAtFC,MAAM;;;CAuJ9C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"useLocalization.d.ts","sourceRoot":"","sources":["../../../src/hooks/useLocalization.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IACtB,MAAM,EAAE,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAC7D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAgGD,eAAO,MAAM,gBAAgB,YAAiB,CAAC;AAE/C,QAAA,MAAM,eAAe;aAuCX,MAAM;kBAwEA,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC;;+BA1FC,MAAM;;;CA+J9C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../node_modules/i18next/dist/esm/i18next.js"),n=require("../services/codicent.js"),r=require("../config/index.js"),a=require("../node_modules/react-i18next/dist/es/initReactI18next.js"),s=require("../node_modules/react-i18next/dist/es/useTranslation.js");const i=()=>{const e=r.getConfigValue("FORCE_LANGUAGE");if(e)return{source:"force_config",language:e};if("undefined"!=typeof window){const e=new URLSearchParams(window.location.search),t=e.get("lang")||e.get("language");if(t)return{source:"url_param",language:t}}if("undefined"!=typeof navigator&&navigator.language){return{source:"browser",language:navigator.language.split("-")[0]}}return{source:"default",language:r.getConfigValue("DEFAULT_LANGUAGE")||"sv"}};let o=null;const l=()=>{if(null===o){const{language:e}=i();o=e}return o},u=()=>{const e=r.getConfigValue("TRANSLATIONS");if(e){const t={};for(const[n,r]of Object.entries(e))t[n]={translation:r};return t}return{en:{translation:{Hello:"Hello"}},sv:{translation:{Hello:"Hej"}}}},c=()=>{if(t.default.isInitialized){const e=u();Object.keys(e).forEach((n=>{t.default.addResourceBundle(n,"translation",e[n].translation,!0,!0)}))}else t.default.use(a.initReactI18next).init({resources:u(),lng:l(),fallbackLng:r.getConfigValue("DEFAULT_LANGUAGE")||"sv",interpolation:{escapeValue:!1}})};c();exports.default=()=>{const{t:t,i18n:a}=s.useTranslation(),[o,u]=e.useState((()=>l())),[g,d]=e.useState(JSON.parse(localStorage.getItem("app-translations")||"{}")),f=e.useRef([]);e.useEffect((()=>{globalThis.__CODICENT_REINIT_I18N__&&(c(),globalThis.__CODICENT_REINIT_I18N__=!1)}),[]),e.useEffect((()=>{a.changeLanguage(o)}),[o,a]);const m=e.useCallback((e=>{const{source:t}=i();"force_config"!==t?"url_param"!==t?u(e):console.warn("Language setting ignored due to URL parameter"):console.warn("Language setting ignored due to FORCE_LANGUAGE configuration")}),[]),_=e.useCallback((()=>i()),[]);return{t:e.useCallback((e=>(a.exists(e)||(async(e,t)=>{const a=`${t} - ${e}`;let s=g[t]?.[e]||void 0;return r.getConfigValue("AUTO_TRANSLATE")&&!s&&-1===f.current.indexOf(a)&&(f.current=[...f.current,a],localStorage.setItem("app-translations",JSON.stringify(g)),s=await n.CodicentService.getMiniChatReply(`Översätt '${e}' till språk '${t}' och svara endast med översättningen.`),s&&s.includes("Error code:")&&(s=void 0),s&&(!e.trim().startsWith('"')&&s.trim().startsWith('"')&&s.trim().endsWith('"')&&(s=s.trim().slice(1,-1)),!e.trim().startsWith("'")&&s.trim().startsWith("'")&&s.trim().endsWith("'")&&(s=s.trim().slice(1,-1)),g[t]={...g[t],[e]:s},localStorage.setItem("app-translations",JSON.stringify(g)),d(g))),s||e})(e,o).then((t=>{a.addResource(o,"translation",e,t)})),t(e))),[a,t,g,o]),tAsync:e.useCallback((async e=>{const t=await(async(e,t)=>{const a=`${t} - ${e}`;let s=g[t]?.[e]||void 0;return r.getConfigValue("AUTO_TRANSLATE")&&!s&&-1===f.current.indexOf(a)&&(f.current=[...f.current,a],localStorage.setItem("app-translations",JSON.stringify(g)),s=await n.CodicentService.getMiniChatReply(`Översätt '${e}' till språk '${t}' och svara endast med översättningen.`),s&&s.includes("Error code:")&&(s=void 0),s&&(!e.trim().startsWith('"')&&s.trim().startsWith('"')&&s.trim().endsWith('"')&&(s=s.trim().slice(1,-1)),!e.trim().startsWith("'")&&s.trim().startsWith("'")&&s.trim().endsWith("'")&&(s=s.trim().slice(1,-1)),g[t]={...g[t],[e]:s},localStorage.setItem("app-translations",JSON.stringify(g)),d(g))),s||e})(e,o);return a.exists(e)||a.addResource(o,"translation",e,t),t}),[a,g,o]),currentLanguage:o,setCurrentLanguage:m,getLanguageInfo:_,isForced:["force_config","url_param"].includes(i().source)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../node_modules/i18next/dist/esm/i18next.js"),r=require("../services/codicent.js"),n=require("../config/index.js"),a=require("../node_modules/react-i18next/dist/es/initReactI18next.js"),s=require("../node_modules/react-i18next/dist/es/useTranslation.js");const i=()=>{const e=n.getConfigValue("FORCE_LANGUAGE");if(e)return{source:"force_config",language:e};if("undefined"!=typeof window){const e=new URLSearchParams(window.location.search),t=e.get("lang")||e.get("language");if(t)return{source:"url_param",language:t}}if("undefined"!=typeof navigator&&navigator.language){return{source:"browser",language:navigator.language.split("-")[0]}}return{source:"default",language:n.getConfigValue("DEFAULT_LANGUAGE")||"sv"}};let o=null;const l=()=>{if(null===o){const{language:e}=i();o=e}return o},c=()=>{const e=n.getConfigValue("TRANSLATIONS");if(e){const t={};for(const[r,n]of Object.entries(e))t[r]={translation:n};return t}return{en:{translation:{Hello:"Hello"}},sv:{translation:{Hello:"Hej"}}}},u=()=>{if(t.default.isInitialized){const e=c();Object.keys(e).forEach((r=>{t.default.addResourceBundle(r,"translation",e[r].translation,!0,!0)}))}else t.default.use(a.initReactI18next).init({resources:c(),lng:l(),fallbackLng:n.getConfigValue("DEFAULT_LANGUAGE")||"sv",interpolation:{escapeValue:!1}})};u();exports.default=()=>{const{t:t,i18n:a}=s.useTranslation(),[o,c]=e.useState((()=>l())),[g,d]=e.useState(JSON.parse(localStorage.getItem("app-translations")||"{}")),f=e.useRef([]);e.useEffect((()=>{globalThis.__CODICENT_REINIT_I18N__&&(u(),globalThis.__CODICENT_REINIT_I18N__=!1)}),[]),e.useEffect((()=>{a.changeLanguage(o)}),[o,a]);const m=e.useCallback((e=>{const{source:t}=i();"force_config"!==t?"url_param"!==t?c(e):console.warn("Language setting ignored due to URL parameter"):console.warn("Language setting ignored due to FORCE_LANGUAGE configuration")}),[]),_=e.useCallback((()=>i()),[]);return{t:e.useCallback((e=>(a.exists(e)||(async(e,t)=>{const a=`${t} - ${e}`;let s=g[t]?.[e]||void 0;if(n.getConfigValue("AUTO_TRANSLATE")&&!s&&-1===f.current.indexOf(a)){f.current=[...f.current,a],localStorage.setItem("app-translations",JSON.stringify(g));try{s=(await r.CodicentService.getTranslations(e,t)).translation}catch(e){console.error("Error fetching translation:",e),s=void 0}s&&s.includes("Error code:")&&(s=void 0),s&&(!e.trim().startsWith('"')&&s.trim().startsWith('"')&&s.trim().endsWith('"')&&(s=s.trim().slice(1,-1)),!e.trim().startsWith("'")&&s.trim().startsWith("'")&&s.trim().endsWith("'")&&(s=s.trim().slice(1,-1)),g[t]={...g[t],[e]:s},localStorage.setItem("app-translations",JSON.stringify(g)),d(g))}return s||e})(e,o).then((t=>{a.addResource(o,"translation",e,t)})),t(e))),[a,t,g,o]),tAsync:e.useCallback((async e=>{const t=await(async(e,t)=>{const a=`${t} - ${e}`;let s=g[t]?.[e]||void 0;if(n.getConfigValue("AUTO_TRANSLATE")&&!s&&-1===f.current.indexOf(a)){f.current=[...f.current,a],localStorage.setItem("app-translations",JSON.stringify(g));try{s=(await r.CodicentService.getTranslations(e,t)).translation}catch(e){console.error("Error fetching translation:",e),s=void 0}s&&s.includes("Error code:")&&(s=void 0),s&&(!e.trim().startsWith('"')&&s.trim().startsWith('"')&&s.trim().endsWith('"')&&(s=s.trim().slice(1,-1)),!e.trim().startsWith("'")&&s.trim().startsWith("'")&&s.trim().endsWith("'")&&(s=s.trim().slice(1,-1)),g[t]={...g[t],[e]:s},localStorage.setItem("app-translations",JSON.stringify(g)),d(g))}return s||e})(e,o);return a.exists(e)||a.addResource(o,"translation",e,t),t}),[a,g,o]),currentLanguage:o,setCurrentLanguage:m,getLanguageInfo:_,isForced:["force_config","url_param"].includes(i().source)}};
@@ -1 +1 @@
1
- {"version":3,"file":"Sales.d.ts","sourceRoot":"","sources":["../../../src/pages/Sales.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AA0F7D,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAkMvD,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Sales.d.ts","sourceRoot":"","sources":["../../../src/pages/Sales.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAyF7D,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAsMvD,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react");require("../components/Markdown.js");var s=require("../components/Textarea.js"),r=require("../components/Button.js");require("../components/CompoundButton.js");var t=require("../components/Text.js");require("../components/Spinner.js");var n=require("../components/Input.js");require("../components/TextHeader.js"),require("../components/TypingIndicator.js");var i=require("../components/Dialog.js");require("../components/ChatInput.js"),require("../components/CombinedPlaceholderDialog.js"),require("../components/ChatMessage.js"),require("../components/Header.js"),require("../services/codicent.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var a=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./AppFrame.js"),require("./Chat.js"),require("./Compose.js"),require("./Snap.js"),require("./Search.js"),require("./Login.js"),require("./CrmPage.js"),require("./CrmPagePersistent.js"),require("./ImageView.js"),require("./FormInvite.js"),require("./FormAccept.js"),require("./Purchase.js"),require("../stores/chatStore.js");var l=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js"),require("../components/FileThumbnail.js"),require("../components/MessageInput.js"),require("../components/UploadFile.js"),require("../components/SnapFooter.js"),require("../components/Profile.js"),require("../components/MessageItem.js"),require("../components/Content.js"),require("../components/AiInput.js"),require("../components/SearchBox.js"),require("../components/HtmlView.js"),require("../components/Footer.js");var c=require("../components/Page.js"),d=require("../node_modules/@griffel/react/makeStyles.esm.js"),u=require("../node_modules/@fluentui/tokens/lib/tokens.js"),p=require("../node_modules/@griffel/core/index.esm.js"),m=require("../node_modules/@fluentui/react-image/lib/components/Image/Image.js"),g=require("../node_modules/@griffel/core/mergeClasses.esm.js");const h=d.makeStyles({root:{display:"flex",flexDirection:"column",height:"100%",touchAction:"pan-y"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:a.getConfigValue("APP_HEADER_COLOR")||u.tokens.colorBrandBackground,color:u.tokens.colorNeutralForegroundOnBrand,...p.shorthands.padding("10px","20px")},logo:{maxWidth:"100px",maxHeight:"50px",height:"auto",cursor:"pointer"},inputContainer:{display:"flex",justifyContent:"flex-end",alignItems:"center",maxWidth:"300px",width:"200px",paddingLeft:"10px"},dashboard:{display:"flex",justifyContent:"space-around",width:"100%",marginTop:"20px"},statBox:{...p.shorthands.padding("10px"),...p.shorthands.borderRadius("12px"),minWidth:"50px",textAlign:"center",color:"white"},buttonContainer:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",gap:"30px",alignItems:"center",...p.shorthands.padding("20px")},actionButton:{width:"14rem",minWidth:"15rem",height:"3rem"},textAreaContainer:{display:"flex",flexDirection:"column",gap:"10px"},opened:{backgroundColor:"#1a5614"},not_home:{backgroundColor:"#f44336"},sales:{backgroundColor:"#2196F3"},call_back:{backgroundColor:"#FF9800"}}),j={opened:"#1a5614",not_home:"#f44336",sales:"#2196F3",call_back:"#FF9800"},x=()=>{const d=h(),{t:u}=l.default(),[p,x]=o.useState(""),[q,f]=o.useState(),[C,v]=o.useState({opened:0,not_home:0,sales:0,call_back:0}),[k,_]=o.useState([]),[b,w]=o.useState(!1),[y,I]=o.useState(""),[S,A]=o.useState(""),[P,F]=o.useState(""),[D,B]=o.useState(!1),[$,N]=o.useState(!1),M=o.useCallback((()=>new Promise((e=>{navigator.geolocation?navigator.geolocation.getCurrentPosition((o=>{const s=`#position (${o.coords.latitude},${o.coords.longitude})`;e(s)})):e(void 0)}))),[f]);o.useEffect((()=>{window.Codicent.getDataMessages({codicent:a.getConfigValue("APP_NAME"),tags:["sales_code"]}).then((e=>{e=e.filter((e=>"1"!==e.data.inactive)),_(e)})).catch(console.error),M()}),[]);const T=async()=>{if(!p)return;const e=["not_home","sales","call_back","opened"],o=new Date;o.setHours(0,0,0,0);const s={...C};for(const r of e){const e=await window.Codicent.getMessages({search:`#${r} #sales_code_${p}`,afterTimestamp:o,length:1e4});s[r]=e.filter((e=>e.content.includes(`#${r} `)&&e.content.includes(`#sales_code_${p}`))).length}v(s)},O=async(e,o="")=>{const s=await M();console.log("Got position",s);const r=`@${a.getConfigValue("APP_NAME")} #sales_code_${p} #${e} ${s||""} ${o.trim().length>0?"#comment ":""}${o}`.trim();await window.Codicent.postMessage({message:r}),T()};return e.jsx(c.Page,{hideHeader:!0,children:e.jsxs("div",{className:d.root,children:[e.jsxs("div",{className:d.header,children:[e.jsx(m.Image,{src:S||a.getConfigValue("APP_ICON_URL")||"https://via.placeholder.com/100",className:d.logo,onClick:()=>P&&N(!0)}),e.jsx("div",{className:d.inputContainer,children:e.jsx(n.Input,{value:p,onChange:e=>x(e.target.value),onBlur:()=>{const e=k.find((e=>e.data.code===p));if(e)A(`https://codicent.com/app/GetImage?fileId=${e.fileId}&width=100`),F(e.data.link),B(!0),T();else{const e=k.find((e=>e.data.code2===p.toUpperCase()));e?(A(`https://codicent.com/app/GetImage?fileId=${e.fileIds&&e.fileIds.length>1?e.fileIds[1]:e.fileId}&width=100`),F(e.data.link2),B(!0),T()):(B(!1),alert(u("Fel försäljningskod!")))}},placeholder:u("Fyll i försäljningskod"),maxLength:16,size:"large"})})]}),D&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:d.dashboard,children:Object.keys(C).map((o=>{return e.jsx("div",{className:(s=o,g.mergeClasses(d.statBox,d[s])),children:e.jsx(t.Text,{weight:"bold",size:400,children:C[o]})},o);var s}))}),e.jsx("div",{className:d.buttonContainer,children:Object.entries(j).map((([o,s])=>e.jsx(r.Button,{size:"large",className:d.actionButton,style:{backgroundColor:s,color:"white"},onClick:()=>{O(o),"opened"===o&&w(!0),"sales"===o&&N(!0)},children:o.charAt(0).toUpperCase()+o.slice(1).replace("_"," ")},o)))}),e.jsxs(i.Dialog,{open:b,children:[e.jsx(i.DialogTitle,{children:u("Skriv in avvikelse")}),e.jsx(i.DialogContent,{children:e.jsx("div",{className:d.textAreaContainer,children:e.jsx(s.Textarea,{value:y,onChange:e=>I(e.target.value),placeholder:u("Skriv din text här..."),rows:4,size:"large"})})}),e.jsx(i.DialogActions,{children:e.jsx(r.Button,{appearance:"primary",onClick:()=>{O("anomaly",`\n${y}`),w(!1),I("")},children:u("Spara")})})]}),e.jsxs(i.Dialog,{open:$,children:[e.jsx(i.DialogTitle,{children:u("Godkännande")}),e.jsx(i.DialogContent,{children:u("Är kunden över 23 år?")}),e.jsxs(i.DialogActions,{children:[e.jsx(r.Button,{appearance:"primary",onClick:()=>window.open(P,"_blank"),children:u("OK")}),e.jsx(r.Button,{appearance:"secondary",onClick:()=>N(!1),children:u("Avbryt")})]})]})]})]})})};exports.Sales=x,exports.default=x;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react");require("../components/Markdown.js");var s=require("../components/Textarea.js"),r=require("../components/Button.js");require("../components/CompoundButton.js");var t=require("../components/Text.js");require("../components/Spinner.js");var n=require("../components/Input.js");require("../components/TextHeader.js"),require("../components/TypingIndicator.js");var i=require("../components/Dialog.js");require("../components/ChatInput.js"),require("../components/CombinedPlaceholderDialog.js"),require("../components/ChatMessage.js"),require("../components/Header.js"),require("../services/codicent.js"),require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var a=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./AppFrame.js"),require("./Chat.js"),require("./Compose.js"),require("./Snap.js"),require("./Search.js"),require("./Login.js"),require("./CrmPage.js"),require("./CrmPagePersistent.js"),require("./ImageView.js"),require("./FormInvite.js"),require("./FormAccept.js"),require("./Purchase.js"),require("../stores/chatStore.js");var l=require("../hooks/useLocalization.js");require("../hooks/useAppStyles.js"),require("../components/FileThumbnail.js"),require("../components/MessageInput.js"),require("../components/UploadFile.js"),require("../components/SnapFooter.js"),require("../components/Profile.js"),require("../components/MessageItem.js"),require("../components/Content.js"),require("../components/AiInput.js"),require("../components/SearchBox.js"),require("../components/HtmlView.js"),require("../components/Footer.js");var c=require("../components/Page.js"),d=require("../node_modules/@griffel/react/makeStyles.esm.js"),u=require("../node_modules/@fluentui/tokens/lib/tokens.js"),p=require("../node_modules/@griffel/core/index.esm.js"),m=require("../node_modules/@fluentui/react-image/lib/components/Image/Image.js"),g=require("../node_modules/@griffel/core/mergeClasses.esm.js");const h=d.makeStyles({root:{display:"flex",flexDirection:"column",height:"100%",touchAction:"pan-y"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",color:u.tokens.colorNeutralForegroundOnBrand,...p.shorthands.padding("10px","20px")},logo:{maxWidth:"100px",maxHeight:"50px",height:"auto",cursor:"pointer"},inputContainer:{display:"flex",justifyContent:"flex-end",alignItems:"center",maxWidth:"300px",width:"200px",paddingLeft:"10px"},dashboard:{display:"flex",justifyContent:"space-around",width:"100%",marginTop:"20px"},statBox:{...p.shorthands.padding("10px"),...p.shorthands.borderRadius("12px"),minWidth:"50px",textAlign:"center",color:"white"},buttonContainer:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",gap:"30px",alignItems:"center",...p.shorthands.padding("20px")},actionButton:{width:"14rem",minWidth:"15rem",height:"3rem"},textAreaContainer:{display:"flex",flexDirection:"column",gap:"10px"},opened:{backgroundColor:"#1a5614"},not_home:{backgroundColor:"#f44336"},sales:{backgroundColor:"#2196F3"},call_back:{backgroundColor:"#FF9800"}}),j={opened:"#1a5614",not_home:"#f44336",sales:"#2196F3",call_back:"#FF9800"},x=()=>{const d=h(),{t:p}=l.default(),[x,q]=o.useState(""),[f,C]=o.useState(),[v,k]=o.useState({opened:0,not_home:0,sales:0,call_back:0}),[_,b]=o.useState([]),[w,y]=o.useState(!1),[I,S]=o.useState(""),[A,P]=o.useState(""),[F,D]=o.useState(""),[B,$]=o.useState(!1),[N,M]=o.useState(!1),T={backgroundColor:a.getConfigValue("APP_HEADER_COLOR")||u.tokens.colorBrandBackground},O=o.useCallback((()=>new Promise((e=>{navigator.geolocation?navigator.geolocation.getCurrentPosition((o=>{const s=`#position (${o.coords.latitude},${o.coords.longitude})`;e(s)})):e(void 0)}))),[C]);o.useEffect((()=>{window.Codicent.getDataMessages({codicent:a.getConfigValue("APP_NAME"),tags:["sales_code"]}).then((e=>{e=e.filter((e=>"1"!==e.data.inactive)),b(e)})).catch(console.error),O()}),[]);const H=async()=>{if(!x)return;const e=["not_home","sales","call_back","opened"],o=new Date;o.setHours(0,0,0,0);const s={...v};for(const r of e){const e=await window.Codicent.getMessages({search:`#${r} #sales_code_${x}`,afterTimestamp:o,length:1e4});s[r]=e.filter((e=>e.content.includes(`#${r} `)&&e.content.includes(`#sales_code_${x}`))).length}k(s)},L=async(e,o="")=>{const s=await O();console.log("Got position",s);const r=`@${a.getConfigValue("APP_NAME")} #sales_code_${x} #${e} ${s||""} ${o.trim().length>0?"#comment ":""}${o}`.trim();await window.Codicent.postMessage({message:r}),H()};return e.jsx(c.Page,{hideHeader:!0,children:e.jsxs("div",{className:d.root,children:[e.jsxs("div",{className:d.header,style:T,children:[e.jsx(m.Image,{src:A||a.getConfigValue("APP_ICON_URL")||"https://via.placeholder.com/100",className:d.logo,onClick:()=>F&&M(!0)}),e.jsx("div",{className:d.inputContainer,children:e.jsx(n.Input,{value:x,onChange:e=>q(e.target.value),onBlur:()=>{const e=_.find((e=>e.data.code===x));if(e)P(`https://codicent.com/app/GetImage?fileId=${e.fileId}&width=100`),D(e.data.link),$(!0),H();else{const e=_.find((e=>e.data.code2===x.toUpperCase()));e?(P(`https://codicent.com/app/GetImage?fileId=${e.fileIds&&e.fileIds.length>1?e.fileIds[1]:e.fileId}&width=100`),D(e.data.link2),$(!0),H()):($(!1),alert(p("Fel försäljningskod!")))}},placeholder:p("Fyll i försäljningskod"),maxLength:16,size:"large"})})]}),B&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:d.dashboard,children:Object.keys(v).map((o=>{return e.jsx("div",{className:(s=o,g.mergeClasses(d.statBox,d[s])),children:e.jsx(t.Text,{weight:"bold",size:400,children:v[o]})},o);var s}))}),e.jsx("div",{className:d.buttonContainer,children:Object.entries(j).map((([o,s])=>e.jsx(r.Button,{size:"large",className:d.actionButton,style:{backgroundColor:s,color:"white"},onClick:()=>{L(o),"opened"===o&&y(!0),"sales"===o&&M(!0)},children:o.charAt(0).toUpperCase()+o.slice(1).replace("_"," ")},o)))}),e.jsxs(i.Dialog,{open:w,children:[e.jsx(i.DialogTitle,{children:p("Skriv in avvikelse")}),e.jsx(i.DialogContent,{children:e.jsx("div",{className:d.textAreaContainer,children:e.jsx(s.Textarea,{value:I,onChange:e=>S(e.target.value),placeholder:p("Skriv din text här..."),rows:4,size:"large"})})}),e.jsx(i.DialogActions,{children:e.jsx(r.Button,{appearance:"primary",onClick:()=>{L("anomaly",`\n${I}`),y(!1),S("")},children:p("Spara")})})]}),e.jsxs(i.Dialog,{open:N,children:[e.jsx(i.DialogTitle,{children:p("Godkännande")}),e.jsx(i.DialogContent,{children:p("Är kunden över 23 år?")}),e.jsxs(i.DialogActions,{children:[e.jsx(r.Button,{appearance:"primary",onClick:()=>window.open(F,"_blank"),children:p("OK")}),e.jsx(r.Button,{appearance:"secondary",onClick:()=>M(!1),children:p("Avbryt")})]})]})]})]})})};exports.Sales=x,exports.default=x;
@@ -1 +1 @@
1
- {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/pages/Search.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAA4E,MAAM,UAAU,CAAC;AAyEtH,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAA;CAAE,CA+GjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/pages/Search.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAA4E,MAAM,UAAU,CAAC;AAwEtH,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAmHjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../components/Markdown.js");require("../components/Textarea.js");var o=require("../components/Button.js");require("../components/CompoundButton.js");var s=require("../components/Title.js");require("../components/Spinner.js"),require("../components/TextHeader.js");var n=require("../components/TypingIndicator.js");require("../components/Dialog.js");var i=require("../components/ChatInput.js");require("../components/CombinedPlaceholderDialog.js"),require("../components/ChatMessage.js"),require("../components/Header.js");var a=require("../hooks/useStateWithLocalStorage.js"),u=require("../services/codicent.js");require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var l=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./AppFrame.js"),require("./Chat.js"),require("./Compose.js"),require("./Snap.js"),require("./Login.js"),require("./CrmPage.js"),require("./CrmPagePersistent.js"),require("./ImageView.js"),require("./FormInvite.js"),require("./FormAccept.js"),require("./Sales.js"),require("./Purchase.js");var c=require("../hooks/useChat.js"),p=require("../hooks/useLocalization.js"),d=require("../hooks/useTemplateVariables.js");require("../hooks/useAppStyles.js"),require("../components/FileThumbnail.js"),require("../components/MessageInput.js"),require("../components/UploadFile.js"),require("../components/SnapFooter.js"),require("../components/Profile.js"),require("../components/MessageItem.js"),require("../components/Content.js"),require("../components/AiInput.js"),require("../components/SearchBox.js"),require("../components/HtmlView.js"),require("../components/Footer.js");var m=require("../components/Page.js"),g=require("../node_modules/@griffel/react/makeStyles.esm.js"),j=require("../node_modules/@fluentui/tokens/lib/tokens.js");const f=g.makeStyles({chatContainer:{width:"100%",flex:1,maxWidth:"800px",height:"100%",backgroundColor:"#ffffff",display:"flex",flexDirection:"column",margin:"0 auto",overflow:"hidden","@media (max-width: 768px)":{maxWidth:"100%",borderRadius:"0"},"@media (max-width: 480px)":{},backgroundPosition:"calc(50%) center",backgroundRepeat:"no-repeat",backgroundSize:"contain",touchAction:"pan-y",overflowY:"auto",marginBottom:"16px"},chatMessages:{display:"flex",flexDirection:"column",flex:1,padding:"16px",overflowY:"auto",touchAction:"pan-y"},inputArea:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"center",height:"100%",padding:"0 16px"},promptButtons:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"start",alignItems:"center",gap:"8px",marginTop:"8px",marginLeft:"6px",marginRight:"2px",marginBottom:"12px"},answerArea:{width:"100%",marginLeft:"12px",marginRight:"12px",backgroundColor:l.getConfigValue("CHAT_BOT_BACKGROUND_COLOR")||j.tokens.colorBrandBackground2,padding:"12px",borderRadius:"16px",marginBottom:"24px"},title:{marginLeft:"12px",padding:"16px"}});exports.default=({state:g})=>{const j=f(),{t:h}=p.default(),{messages:q,isBotTyping:x,handleSend:C,newChat:v}=c.useChat(g.stateMachine),A=r.useRef(null),{service:T}=g,[_,S]=a.default(g.context.selectedApp+"_searchprompts",["Leta information","Vad kan jag göra?","Sök supportställe"]),[b,w]=r.useState(),[k,y]=r.useState(null),[N,O]=r.useState(!1);d.useTemplateVariables(T.uploadFile);r.useEffect((()=>{x&&O(!0)}),[x]),r.useEffect((()=>{v();const e=l.getConfigValue("APP_CONFIG"),r=l.getConfigValue("APP_BUTTONS");r?e.apps[r].questions&&S(e.apps[r].questions.map((e=>h(e)))):console.error("APP_BUTTONS is not defined in the configuration."),void 0!==l.getConfigValue("ANONYMOUS_CODICENT")&&void 0!==l.getConfigValue("ANONYMOUS_TOKEN")?(T.codicent=l.getConfigValue("ANONYMOUS_CODICENT"),T.setToken(l.getConfigValue("ANONYMOUS_TOKEN"))):console.error("Anonymous Codicent or Token is not defined in the configuration.")}),[v,T,S,h]),r.useEffect((()=>{setTimeout((()=>{A.current?.scrollIntoView({behavior:"smooth"})}),10)}),[q]);const I=e=>{w(e),C(e)};return r.useEffect((()=>{const e=q.filter((e=>"bot"===e.sender));let r=e.length>0?e[e.length-1]:null;y({...r,createdAt:new Date}),r&&O(!1)}),[q]),e.jsx(m.Page,{hideHeader:!0,hideFooter:!0,children:e.jsxs("div",{id:"search-container",className:j.chatContainer,style:{backgroundImage:`url(${l.getConfigValue("CHAT_BACKGROUND_IMAGE_URL")})`},children:[e.jsx("div",{className:j.title,children:e.jsx(s.Title,{children:h(l.getConfigValue("APP_SEARCH_TITLE")||"Frågor")})}),e.jsxs("div",{className:j.inputArea,children:[e.jsx(i.default,{noMemory:!0,defaultText:b,codicent:g.context.selectedApp,disableSend:x,onSend:I,rows:3,getImageUrl:u.CodicentService.getImageUrl,getFileInfo:e=>T.getFileInfo(e),selectAll:!0}),e.jsx("div",{className:j.promptButtons,children:_.length>0&&_.map(((r,t)=>e.jsx(o.Button,{onClick:()=>I(r),size:"large",appearance:"primary",shape:"circular",children:r},`search-prompt-${t}`)))}),N&&e.jsx(n.default,{}),k&&!x&&e.jsxs("div",{className:j.answerArea,children:[e.jsx("div",{ref:A}),e.jsx(t.default,{content:k.content})]})]})]})})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../components/Markdown.js");require("../components/Textarea.js");var o=require("../components/Button.js");require("../components/CompoundButton.js");var s=require("../components/Title.js");require("../components/Spinner.js"),require("../components/TextHeader.js");var n=require("../components/TypingIndicator.js");require("../components/Dialog.js");var i=require("../components/ChatInput.js");require("../components/CombinedPlaceholderDialog.js"),require("../components/ChatMessage.js"),require("../components/Header.js");var a=require("../hooks/useStateWithLocalStorage.js"),u=require("../services/codicent.js");require("../utils/MessageContent.js"),require("../node_modules/tinycolor2/esm/tinycolor.js"),require("../_virtual/index.js");var l=require("../config/index.js");require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js"),require("./AppFrame.js"),require("./Chat.js"),require("./Compose.js"),require("./Snap.js"),require("./Login.js"),require("./CrmPage.js"),require("./CrmPagePersistent.js"),require("./ImageView.js"),require("./FormInvite.js"),require("./FormAccept.js"),require("./Sales.js"),require("./Purchase.js");var c=require("../hooks/useChat.js"),p=require("../hooks/useLocalization.js"),d=require("../hooks/useTemplateVariables.js");require("../hooks/useAppStyles.js"),require("../components/FileThumbnail.js"),require("../components/MessageInput.js"),require("../components/UploadFile.js"),require("../components/SnapFooter.js"),require("../components/Profile.js"),require("../components/MessageItem.js"),require("../components/Content.js"),require("../components/AiInput.js"),require("../components/SearchBox.js"),require("../components/HtmlView.js"),require("../components/Footer.js");var m=require("../components/Page.js"),g=require("../node_modules/@griffel/react/makeStyles.esm.js"),j=require("../node_modules/@fluentui/tokens/lib/tokens.js");const f=g.makeStyles({chatContainer:{width:"100%",flex:1,maxWidth:"800px",height:"100%",backgroundColor:"#ffffff",display:"flex",flexDirection:"column",margin:"0 auto",overflow:"hidden","@media (max-width: 768px)":{maxWidth:"100%",borderRadius:"0"},"@media (max-width: 480px)":{},backgroundPosition:"calc(50%) center",backgroundRepeat:"no-repeat",backgroundSize:"contain",touchAction:"pan-y",overflowY:"auto",marginBottom:"16px"},chatMessages:{display:"flex",flexDirection:"column",flex:1,padding:"16px",overflowY:"auto",touchAction:"pan-y"},inputArea:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"center",height:"100%",padding:"0 16px"},promptButtons:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"start",alignItems:"center",gap:"8px",marginTop:"8px",marginLeft:"6px",marginRight:"2px",marginBottom:"12px"},answerArea:{width:"100%",marginLeft:"12px",marginRight:"12px",padding:"12px",borderRadius:"16px",marginBottom:"24px"},title:{marginLeft:"12px",padding:"16px"}});exports.default=({state:g})=>{const h=f(),{t:q}=p.default(),{messages:x,isBotTyping:C,handleSend:v,newChat:A}=c.useChat(g.stateMachine),T=r.useRef(null),{service:_}=g;l.getConfigValue("CHAT_BOT_BACKGROUND_COLOR")||j.tokens.colorBrandBackground2;const[S,w]=a.default(g.context.selectedApp+"_searchprompts",["Leta information","Vad kan jag göra?","Sök supportställe"]),[b,k]=r.useState(),[y,N]=r.useState(null),[O,I]=r.useState(!1);d.useTemplateVariables(_.uploadFile);r.useEffect((()=>{C&&I(!0)}),[C]),r.useEffect((()=>{A();const e=l.getConfigValue("APP_CONFIG"),r=l.getConfigValue("APP_BUTTONS");r?e.apps[r].questions&&w(e.apps[r].questions.map((e=>q(e)))):console.error("APP_BUTTONS is not defined in the configuration."),void 0!==l.getConfigValue("ANONYMOUS_CODICENT")&&void 0!==l.getConfigValue("ANONYMOUS_TOKEN")?(_.codicent=l.getConfigValue("ANONYMOUS_CODICENT"),_.setToken(l.getConfigValue("ANONYMOUS_TOKEN"))):console.error("Anonymous Codicent or Token is not defined in the configuration.")}),[A,_,w,q]),r.useEffect((()=>{setTimeout((()=>{T.current?.scrollIntoView({behavior:"smooth"})}),10)}),[x]);const P=e=>{k(e),v(e)};return r.useEffect((()=>{const e=x.filter((e=>"bot"===e.sender));let r=e.length>0?e[e.length-1]:null;N({...r,createdAt:new Date}),r&&I(!1)}),[x]),e.jsx(m.Page,{hideHeader:!0,hideFooter:!0,children:e.jsxs("div",{id:"search-container",className:h.chatContainer,style:{backgroundImage:`url(${l.getConfigValue("CHAT_BACKGROUND_IMAGE_URL")})`},children:[e.jsx("div",{className:h.title,children:e.jsx(s.Title,{children:q(l.getConfigValue("APP_SEARCH_TITLE")||"Frågor")})}),e.jsxs("div",{className:h.inputArea,children:[e.jsx(i.default,{noMemory:!0,defaultText:b,codicent:g.context.selectedApp,disableSend:C,onSend:P,rows:3,getImageUrl:u.CodicentService.getImageUrl,getFileInfo:e=>_.getFileInfo(e),selectAll:!0}),e.jsx("div",{className:h.promptButtons,children:S.length>0&&S.map(((r,t)=>e.jsx(o.Button,{onClick:()=>P(r),size:"large",appearance:"primary",shape:"circular",children:r},`search-prompt-${t}`)))}),O&&e.jsx(n.default,{}),y&&!C&&e.jsxs("div",{className:h.answerArea,children:[e.jsx("div",{ref:T}),e.jsx(t.default,{content:y.content})]})]})]})})};
@@ -24,6 +24,13 @@ export interface Form {
24
24
  url?: string;
25
25
  schema?: string;
26
26
  }
27
+ export interface TranslationResponse {
28
+ text: string;
29
+ translation: string;
30
+ language: string;
31
+ hash: string;
32
+ fromCache: boolean;
33
+ }
27
34
  export interface CodicentServiceOptions {
28
35
  API_BASE_URL: string;
29
36
  APP_LOG_CODICENT: string;
@@ -132,5 +139,13 @@ export declare class CodicentService {
132
139
  getRealtimeConfig(): Promise<{
133
140
  model: string;
134
141
  } | null>;
142
+ /**
143
+ * Get translations using the new GetTranslations API endpoint.
144
+ * @param text - The text to translate
145
+ * @param targetLanguage - The target language code (e.g., 'en', 'sv')
146
+ * @param project - The project name (default: "codicent-mini")
147
+ * @returns Promise that resolves to the translation response
148
+ */
149
+ static getTranslations: (text: string, targetLanguage: string, project?: string) => Promise<TranslationResponse>;
135
150
  }
136
151
  //# sourceMappingURL=codicent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codicent.d.ts","sourceRoot":"","sources":["../../../src/services/codicent.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvC,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,eAAe;IAE1B,iBAAiB,QAAe,MAAM,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,CAA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AC,eAAe,SACd,MAAM,kBACI,MAAM,YACb,MAAM,KACd,OAAO,CAAC,mBAAmB,CAAC,CAsB7B;CACH"}
@@ -1 +1 @@
1
- "use strict";var t,e=require("../node_modules/@stripe/stripe-js/dist/index.js"),o=require("../utils/MessageContent.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("react/jsx-runtime"),require("react"),require("../_virtual/index.js"),require("../config/index.js"),require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js");let a="https://codicent.com/",n="-";const s=()=>void 0!==window.Codicent&&(window.Codicent.handleMessage=function(t){const e=new CustomEvent("codicent-log",{detail:{message:t}});window.dispatchEvent(e)},window.Codicent.init({token:n,baseUrl:a}),!0);let i=s();if(!i){const t=setInterval((()=>{i=s(),i&&clearInterval(t)}),100)}class r{constructor(t){this.createDataMessage=async(t,e)=>await window.Codicent.data.create({codicent:this.codicent,tag:t,data:e}),this.readDataMessages=async(t,e)=>await window.Codicent.data.read({codicent:this.codicent,tag:t,search:e}),this.readOneDataMessage=async t=>await window.Codicent.data.readOne(t),this.updateDataMessage=async(t,e)=>await window.Codicent.data.update({id:t,data:e,codicent:this.codicent}),this.deleteDataMessage=async t=>await window.Codicent.data.delete({id:t,codicent:this.codicent}),this.getAppTheme=async()=>{try{const t=await window.Codicent.getDataMessages({tags:["app-theme"],codicent:this.codicent});return t.length>0?t[0].data:null}catch(t){return console.error("Error fetching app theme:",t),null}},this.getAppButtons=async()=>{const t=(await window.Codicent.getDataMessages({tags:[this.options.BUTTON_TAG],codicent:this.codicent})).map((t=>t.data));return t.sort(((t,e)=>t.title>e.title?1:-1)),t},this.getAppTasks=async()=>(await window.Codicent.getMessages({search:`@${this.codicent} #app-task`,length:50})).map((t=>{const e=new o.default(t.content).content.split("\n"),a=e[0],n=e.slice(1).join("\n");return{id:t.id,title:a,content:n}})),this.getAppPrompts=async()=>(await window.Codicent.getDataMessages({tags:["chatprompt"],codicent:this.codicent})).map((t=>t.data)).map((({title:t,prompt:e})=>({title:t,prompt:e}))),this.uploadFile=async(t,e)=>await window.Codicent.upload(e,t),this.getFileInfo=async t=>await window.Codicent.getFileInfo(t),this.generateApiToken=async(t,e)=>{const o=await fetch(`${a}api/GenerateApiToken?project=${this.codicent}${t?`&expires=${t.toISOString()}`:""}${e?`&forUserNickname=${e}`:""}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!o.ok)throw o.status,new Error(`${o.statusText}`);return await o.text()},this.sendMessage=(t,e)=>window.Codicent.postMessage({message:`@${this.codicent} ${t}`,type:"text",parentId:e}),this.chat=(t,e)=>window.Codicent.getChatReply4({message:t,codicent:this.codicent,messageId:e}),this.getMessagesFast=async(t,e,o=100,n=void 0)=>{const s=await this.request(`${a}app/AppGetMessages`,"POST",{headers:[["Authorization",`Bearer ${this.getToken()}`],["Content-Type","application/json; charset=utf-8"]],body:JSON.stringify({tags:t,codicent:this.codicent,search:e,length:o})});let i=await s.json();if(i.forEach((t=>{t.createdAt=new Date(Date.parse(t.createdAt))})),n){const t=await this.getPublicFlow(n);i=i.concat(t),i.sort(((t,e)=>e.createdAt.getTime()-t.createdAt.getTime()))}return i},this.getMessages=async(t,e)=>{let o=[];const a=t.map((async t=>{const e=await window.Codicent.getMessages({search:`@${this.codicent} #${t}`,length:10});return"chat"===t&&e.forEach((t=>t.content=`#chat\n${t.content}`)),e}));if((await Promise.all(a)).forEach((t=>{o=o.concat(t)})),e)try{const t=await this.getPublicFlow(e);o=o.concat(t)}catch(t){console.warn("Error fetching public flow, PUBLIC_TAG missing in codicent?",t)}return o=o.filter(((t,e,o)=>e===o.findIndex((e=>e.id===t.id)))),o.sort(((t,e)=>e.createdAt.getTime()-t.createdAt.getTime())),o},this.registerUser=async(t,e,o,n)=>{const s=await fetch(`${a}app/RegisterAuth0User`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${n}`]],body:JSON.stringify({nickname:t,email:e,userId:o})});if(!s.ok)return"";const i=await s.text();return window.Codicent.init({token:n,baseUrl:a}),i},this.loginUser=async(t,e)=>{try{const o=await fetch(`${a}app/LoginAuth0User`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${e}`]],body:JSON.stringify({userId:t})});if(!o.ok)return 404===o.status||400===o.status?null:401===o.status?(this.handleUnauthorized(),null):"";const n=await o.text();return this.setToken(n),n}catch(t){return console.warn("Error logging in user:",t),""}},this.nicknameExists=async t=>{const e=await fetch(`${a}app/NicknameExists?nickname=${encodeURIComponent(t)}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"]]});if(!e.ok)return!1;return await e.json()},this.logout=()=>{this.setToken("")},this.isRegistered=()=>null!==localStorage.getItem("codicent_nickname"),this.getApps=async()=>{try{const t=await fetch(`${a}app/AppGetApps`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!t.ok)throw t.status,new Error(`${t.statusText}`);const e=(await t.json()).filter(((t,e,o)=>e===o.findIndex((e=>e.id===t.id))&&(this.options.APP_NAME||t.id.startsWith(this.options.APP_PREFIX))));return e}catch(t){return console.warn("Error fetching apps:",t),null}},this.addFollower=async(t,e)=>{const o=await fetch(`${a}app/AddFollower?nickname=${t}&followerNickname=${e}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!o.ok)throw o.status,new Error(`${o.statusText||"Failed to add follower!"}`);return await o.json()},this.cloneProject=async(t,e)=>{const o=await fetch(`${a}app/CloneProject?project=${t}&newProject=${e}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!o.ok)throw o.status,new Error(`${o.statusText}`);let n=await o.json();if(n){const t='#data #app-theme \n{\n "textcolor": "#212121",\n "backgroundcolor": "#273044",\n "color": "#ffffff",\n "logo": "https://codicent.com/logo512.png",\n "title": "",\n "themeColor": "#581d71",\n "buttonColor": "#c0c0c0",\n "buttonTextColor": "#000000",\n "font": "Montserrat",\n "welcome": "Hej {{username}}!",\n "chatPlaceholder": "Tjena, Loociz här! Vad vill du?",\n "textPlaceholder": "Skriv det du vill spara, så tar jag (Loociz alltså) hand om det!",\n "transcriptionInstructions": "Tryck på knappen för att start och sedan stoppa ljudinspelning."\n}';try{await window.Codicent.postMessage({message:`@${e} ${t}`,type:"text"})||(n=!1)}catch{n=!1}if(n){const t='#data #app-button\n{\n "title": "Ta fram företagsinfo",\n "url": "/#/chat?text=Hej!%20Jag%20vill%20spara%20f%C3%B6retagsinfo.%20Guida%20mig%20steg%20f%C3%B6r%20steg%2C%20ett%20i%20taget%2C%20tills%20vi%20har%20all%20info%20om%20mitt%20f%C3%B6retag.%20Exempel%20p%C3%A5%20data%3A%20f%C3%B6retagsnamn%20eller%20id%C3%A9namn%2C%20org.nr.%2C%20%C3%A4gare%2C%20kontaktinformation%2C%20vision%2C%20aff%C3%A4rsid%C3%A9%2C%20mm."\n}';try{await window.Codicent.postMessage({message:`@${e} ${t}`,type:"text"})||(n=!1)}catch{n=!1}}}return n},this.getNickname=async()=>{try{const t=n.split(".")[1],e=atob(t),o=JSON.parse(e),s=o.sub||o.userId,i=await fetch(`${a}app/GetNickname?userId=${s}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!i.ok)throw 401===i.status?(this.handleUnauthorized(),new Error("Unauthorized")):new Error(`${i.statusText}`);return await i.text()}catch{return""}},this.getChatInstructions=async()=>{try{const t=await window.Codicent.getMessages({search:`@${this.codicent} #instructions`,length:1});if(t.length>0)return t[0].content}catch{console.warn("Error fetching chat instructions")}return""},this.updateChatInstructions=async t=>{try{const e=await window.Codicent.getMessages({search:`@${this.codicent} #instructions`,length:100}),o=`@${this.codicent} #instructions\n${t}`;e.length>0?e[0].content!==o&&(console.log("updating instructions",o),await window.Codicent.postMessage({message:o,type:"text",parentId:e[0].id})):(console.log("new instructions",o),await window.Codicent.postMessage({message:o,type:"text"}))}catch{console.warn("Error updating chat instructions")}},this.getUserInfo=async(t,e=!1)=>{const o=await fetch(`${a}app/GetUserInfo?nickname=${t}${e?"&t="+Date.now():""}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!o.ok)throw 401===o.status?(this.handleUnauthorized(),new Error("Unauthorized")):new Error(`${o.statusText}`);const n=await o.json(),{email:s,picture:i,description:r,followers:c,properties:h,owner:d}=n;return{nickname:t,email:s,name:r,picture:i,followers:c,properties:h,owner:d}},this.updateUserInfo=async({nickname:t,email:e,name:o,picture:n})=>{const s=await fetch(`${a}app/AddOrUpdateUser`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]],body:JSON.stringify({nickname:t,email:e,name:o,picture:n,description:""})});if(!s.ok)throw s.status,new Error(`${s.statusText}`);return await this.getUserInfo(t,!0)},this.requestInvite=async(t,e)=>{const o=await fetch(`${a}app/CreateInvitationOrRequest?forUserNickname=${t}&toProjectNickname=${e}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return!!o.ok||(console.warn(`requestInvite() => ${o.statusText}`),!1)},this.getProjectInfo=this.getUserInfo,this.updateMembersAccess=async(t,e)=>{const o=await fetch(`${a}app/AddOrUpdateProjectProperty?project=${t}&key=APP_EDITORS&value=${e.join(",")}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return!!o.ok||(console.warn(`updateMembersAccess() => ${o.statusText}`),!1)},this.getMembersAccess=async t=>{const e=(await this.getProjectInfo(t,!0)).properties.find((t=>"APP_EDITORS"===t.name));return e&&e.value?e.value.split(","):[]},this.setToken=t=>{n=t,n&&window.Codicent.init({token:n,baseUrl:a})},this.getToken=()=>n,this.checkPurchaseStatus=async()=>{const t=await fetch(`${a}payments/GetPaymentStatus`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!t.ok)throw new Error("Failed to check purchase status");const{isPaid:e}=await t.json();return e},this.checkSubscriptionStatus=async()=>{if(!this.options.SUBSCRIPTION_NEEDED)return"active";const t=await fetch(`${a}payments/GetSubscriptionStatus?t=${Date.now()}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`],["Cache-Control","no-cache, no-store, must-revalidate"],["Pragma","no-cache"],["Expires","0"]]});if(!t.ok)throw new Error("Failed to check subscription status");const{status:e}=await t.json();return e},this.createCheckoutSession=async t=>{const e=await fetch(`${a}payments/CreateCheckoutSession`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]],body:JSON.stringify({priceId:t,successUrl:window.location.href,cancelUrl:window.location.href})});if(!e.ok)throw new Error("Failed to create checkout session");const{id:o}=await e.json();return o},this.redirectToCheckout=async t=>{const o=await e.loadStripe(this.options.STRIPE_PUBLIC_KEY);if(!o)throw new Error("Stripe failed to load");const a=await this.createCheckoutSession(t),{error:n}=await o.redirectToCheckout({sessionId:a});if(n)throw new Error(n.message)},this.getChatHistory=async t=>{const e=await fetch(`${a}api/GetMessageHistory?messageId=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!e.ok)throw new Error("Failed to get chat history");let o=await e.json();return o=o.filter((t=>!t.content.includes("#function_result")&&!t.content.includes("#finish_reason_function_call"))),o},this.getPublicFlow=async t=>{const e=await fetch(`${a}app/GetPublicFlow?codicent=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!e.ok)throw new Error("Failed to get public flow");const o=await e.json();return o.forEach((t=>{t.createdAt=new Date(Date.parse(t.createdAt))})),o},this.getMessageContent=async t=>{const e=await fetch(`${a}app/GetMessageContent?id=${t}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(e.ok){const t=await e.json();return{content:t.content,url:t.url}}return{content:"",url:""}},this.logAction=async(t,e)=>{if(!this.options.APP_LOG_CODICENT)return"";const o={content:`@${this.options.APP_LOG_CODICENT} #debug #${e}\n${t}`,type:"text"},n=await fetch(`${a}app/AddChatMessage`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.options.APP_LOG_TOKEN}`]],body:JSON.stringify(o)});if(!n.ok)throw new Error(`${n.statusText||"Failed to post log message!"}`);return(await n.json()).id},this.createApp=async()=>{try{for(let t=0;t<50;t++){const t=Math.floor(99999*Math.random())+1,e=`${this.options.APP_PREFIX}${t}`;if(!await this.nicknameExists(e)){if(await this.cloneProject(this.options.APP_TEMPLATE,e)){if(this.options.ANONYMOUS_TOKEN)try{const t=this.options.ANONYMOUS_TOKEN.split(".")[1],o=atob(t),a=JSON.parse(o).nickname;if(!await this.addFollower(e,a))throw new Error("Failed to add follower: "+a)}catch(t){console.error("Error extracting adding anonymous follower:",t)}return e}}}}catch(t){console.error("Error creating app:",t)}return null},this.findUsername=async()=>{try{for(let t=0;t<50;t++){const t=Math.floor(99999*Math.random())+1,e=`${this.options.USER_PREFIX}${t}`;if(!await this.nicknameExists(e))return e}}catch(t){console.warn("Error finding username:",t)}return null},this.getForms=async()=>{const t=await this.request(`${a}app/GetForms?codicent=${this.codicent}`,"GET",{headers:[["Authorization",`Bearer ${this.getToken()}`]]});return await t.json()},this.getFormById=async t=>{const e=await fetch(`${a}app/GetFormById?id=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return await e.json()},this.getTodoStatus=async t=>{const e=await fetch(`${a}app/GetTodoStatus?messageId=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return e.ok?await e.text():(e.status,console.warn(`getTodoStatus() => ${e.statusText}`),"unknown")},this.updateTodoStatus=async(t,e)=>{const o=await fetch(`${a}app/UpdateTodoStatus?messageId=${t}&status=${e}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!o.ok)return console.warn(`updateTodoStatus() => ${o.statusText}`),!1;return await o.json()},this.codicent="",this.options=t}async request(t,e,o={}){const a={};o.headers&&o.headers.forEach((([t,e])=>{a[t]=e}));const n=await fetch(t,{...o,method:e,headers:a});if(!n.ok)throw 401===n.status&&this.handleUnauthorized(),new Error(`${n.statusText}`);return n}handleUnauthorized(){this.onUnauthorized&&this.onUnauthorized()}async getRealtimeSessionToken(t="alloy"){const e=`${a}realtime/session?voice=${t}`,o=await fetch(e,{headers:{Authorization:`Bearer ${this.getToken()}`}});if(!o.ok)throw new Error(`Failed to fetch session token: ${o.statusText}`);const n=await o.json(),s=n.client_secret?.value;if(!s)throw new Error("No ephemeral key returned from session endpoint");return s}async getRealtimeConfig(){try{const t=`${a}realtime/config`,e=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${this.getToken()}`}});return e.ok?await e.json():null}catch(t){return console.warn("Failed to fetch realtime config:",t),null}}}t=r,r.getImageUrl=(t,e)=>`${a}app/GetImage?fileId=${t}&width=${e}`,r.getFileUrl=(t,e)=>`${a}app/DownloadFile?fileId=${t}${e?`&extension=${e}`:""}`,r.downloadFile=async e=>{fetch(t.getFileUrl(e.id)).then((t=>{if(t.headers.forEach(((t,e)=>{console.log(`${e}: ${t}`)})),t.ok)return t.blob();throw new Error("Network response was not ok.")})).then((t=>{const o=window.URL.createObjectURL(t),a=document.createElement("a");a.style.display="none",a.href=o,a.download=e.filename,document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o)})).catch((t=>{console.error("There was a problem with the fetch operation:",t)}))},r.getMiniChatReplyOld=async(t,e="codicent-mini",o)=>{let s={project:e,message:t};o&&(s.messageId=o);const i=await fetch(`${a}app/GetAi2ChatReply`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${n}`]],body:JSON.stringify(s)});if(!i.ok)return void i.status;return(await i.json()).content.replace("@codicent-mini","").trim()},r.getMiniChatReply=async(t,e="codicent-mini",o,s=3e5,i=2e3)=>{const r={project:e,message:t};let c;o&&(r.messageId=o);try{const t=await fetch(`${a}app/StartAi2ChatAsync`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${n}`]],body:JSON.stringify(r)});if(!t.ok)return t.status,void console.error(`Failed to start AI chat: ${t.status}`);if(c=(await t.json()).promptMessageId,!c)return void console.error("No promptMessageId returned from server")}catch(t){return void console.error("Error starting AI chat:",t)}const h=Date.now();for(;Date.now()-h<s;)try{const t=await fetch(`${a}app/GetAi2ChatReplyStatus?promptMessageId=${c}`,{method:"GET",headers:[["Authorization",`Bearer ${n}`]]});if(202===t.status){await new Promise((t=>setTimeout(t,i)));continue}if(!t.ok)return void console.error(`Error polling AI chat status: ${t.status}`);const o=await t.json();return o.content.replace(`@${e}`,"").replace("@codicent-mini","").trim()}catch(t){return void console.error("Error polling AI chat status:",t)}console.error("Polling timeout reached for AI chat")},exports.CodicentService=r;
1
+ "use strict";var t,e=require("../node_modules/@stripe/stripe-js/dist/index.js"),a=require("../utils/MessageContent.js");require("../node_modules/tinycolor2/esm/tinycolor.js"),require("react/jsx-runtime"),require("react"),require("../_virtual/index.js"),require("../config/index.js"),require("../utils/cacheManager.js"),require("../lib/wavtools/lib/wav_packer.js"),require("../lib/wavtools/lib/analysis/audio_analysis.js"),require("../lib/wavtools/lib/wav_stream_player.js"),require("../lib/wavtools/lib/wav_recorder.js");let o="https://codicent.com/",n="-";const s=()=>void 0!==window.Codicent&&(window.Codicent.handleMessage=function(t){const e=new CustomEvent("codicent-log",{detail:{message:t}});window.dispatchEvent(e)},window.Codicent.init({token:n,baseUrl:o}),!0);let i=s();if(!i){const t=setInterval((()=>{i=s(),i&&clearInterval(t)}),100)}class r{constructor(t){this.createDataMessage=async(t,e)=>await window.Codicent.data.create({codicent:this.codicent,tag:t,data:e}),this.readDataMessages=async(t,e)=>await window.Codicent.data.read({codicent:this.codicent,tag:t,search:e}),this.readOneDataMessage=async t=>await window.Codicent.data.readOne(t),this.updateDataMessage=async(t,e)=>await window.Codicent.data.update({id:t,data:e,codicent:this.codicent}),this.deleteDataMessage=async t=>await window.Codicent.data.delete({id:t,codicent:this.codicent}),this.getAppTheme=async()=>{try{const t=await window.Codicent.getDataMessages({tags:["app-theme"],codicent:this.codicent});return t.length>0?t[0].data:null}catch(t){return console.error("Error fetching app theme:",t),null}},this.getAppButtons=async()=>{const t=(await window.Codicent.getDataMessages({tags:[this.options.BUTTON_TAG],codicent:this.codicent})).map((t=>t.data));return t.sort(((t,e)=>t.title>e.title?1:-1)),t},this.getAppTasks=async()=>(await window.Codicent.getMessages({search:`@${this.codicent} #app-task`,length:50})).map((t=>{const e=new a.default(t.content).content.split("\n"),o=e[0],n=e.slice(1).join("\n");return{id:t.id,title:o,content:n}})),this.getAppPrompts=async()=>(await window.Codicent.getDataMessages({tags:["chatprompt"],codicent:this.codicent})).map((t=>t.data)).map((({title:t,prompt:e})=>({title:t,prompt:e}))),this.uploadFile=async(t,e)=>await window.Codicent.upload(e,t),this.getFileInfo=async t=>await window.Codicent.getFileInfo(t),this.generateApiToken=async(t,e)=>{const a=await fetch(`${o}api/GenerateApiToken?project=${this.codicent}${t?`&expires=${t.toISOString()}`:""}${e?`&forUserNickname=${e}`:""}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!a.ok)throw a.status,new Error(`${a.statusText}`);return await a.text()},this.sendMessage=(t,e)=>window.Codicent.postMessage({message:`@${this.codicent} ${t}`,type:"text",parentId:e}),this.chat=(t,e)=>window.Codicent.getChatReply4({message:t,codicent:this.codicent,messageId:e}),this.getMessagesFast=async(t,e,a=100,n=void 0)=>{const s=await this.request(`${o}app/AppGetMessages`,"POST",{headers:[["Authorization",`Bearer ${this.getToken()}`],["Content-Type","application/json; charset=utf-8"]],body:JSON.stringify({tags:t,codicent:this.codicent,search:e,length:a})});let i=await s.json();if(i.forEach((t=>{t.createdAt=new Date(Date.parse(t.createdAt))})),n){const t=await this.getPublicFlow(n);i=i.concat(t),i.sort(((t,e)=>e.createdAt.getTime()-t.createdAt.getTime()))}return i},this.getMessages=async(t,e)=>{let a=[];const o=t.map((async t=>{const e=await window.Codicent.getMessages({search:`@${this.codicent} #${t}`,length:10});return"chat"===t&&e.forEach((t=>t.content=`#chat\n${t.content}`)),e}));if((await Promise.all(o)).forEach((t=>{a=a.concat(t)})),e)try{const t=await this.getPublicFlow(e);a=a.concat(t)}catch(t){console.warn("Error fetching public flow, PUBLIC_TAG missing in codicent?",t)}return a=a.filter(((t,e,a)=>e===a.findIndex((e=>e.id===t.id)))),a.sort(((t,e)=>e.createdAt.getTime()-t.createdAt.getTime())),a},this.registerUser=async(t,e,a,n)=>{const s=await fetch(`${o}app/RegisterAuth0User`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${n}`]],body:JSON.stringify({nickname:t,email:e,userId:a})});if(!s.ok)return"";const i=await s.text();return window.Codicent.init({token:n,baseUrl:o}),i},this.loginUser=async(t,e)=>{try{const a=await fetch(`${o}app/LoginAuth0User`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${e}`]],body:JSON.stringify({userId:t})});if(!a.ok)return 404===a.status||400===a.status?null:401===a.status?(this.handleUnauthorized(),null):"";const n=await a.text();return this.setToken(n),n}catch(t){return console.warn("Error logging in user:",t),""}},this.nicknameExists=async t=>{const e=await fetch(`${o}app/NicknameExists?nickname=${encodeURIComponent(t)}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"]]});if(!e.ok)return!1;return await e.json()},this.logout=()=>{this.setToken("")},this.isRegistered=()=>null!==localStorage.getItem("codicent_nickname"),this.getApps=async()=>{try{const t=await fetch(`${o}app/AppGetApps`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!t.ok)throw t.status,new Error(`${t.statusText}`);const e=(await t.json()).filter(((t,e,a)=>e===a.findIndex((e=>e.id===t.id))&&(this.options.APP_NAME||t.id.startsWith(this.options.APP_PREFIX))));return e}catch(t){return console.warn("Error fetching apps:",t),null}},this.addFollower=async(t,e)=>{const a=await fetch(`${o}app/AddFollower?nickname=${t}&followerNickname=${e}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!a.ok)throw a.status,new Error(`${a.statusText||"Failed to add follower!"}`);return await a.json()},this.cloneProject=async(t,e)=>{const a=await fetch(`${o}app/CloneProject?project=${t}&newProject=${e}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!a.ok)throw a.status,new Error(`${a.statusText}`);let n=await a.json();if(n){const t='#data #app-theme \n{\n "textcolor": "#212121",\n "backgroundcolor": "#273044",\n "color": "#ffffff",\n "logo": "https://codicent.com/logo512.png",\n "title": "",\n "themeColor": "#581d71",\n "buttonColor": "#c0c0c0",\n "buttonTextColor": "#000000",\n "font": "Montserrat",\n "welcome": "Hej {{username}}!",\n "chatPlaceholder": "Tjena, Loociz här! Vad vill du?",\n "textPlaceholder": "Skriv det du vill spara, så tar jag (Loociz alltså) hand om det!",\n "transcriptionInstructions": "Tryck på knappen för att start och sedan stoppa ljudinspelning."\n}';try{await window.Codicent.postMessage({message:`@${e} ${t}`,type:"text"})||(n=!1)}catch{n=!1}if(n){const t='#data #app-button\n{\n "title": "Ta fram företagsinfo",\n "url": "/#/chat?text=Hej!%20Jag%20vill%20spara%20f%C3%B6retagsinfo.%20Guida%20mig%20steg%20f%C3%B6r%20steg%2C%20ett%20i%20taget%2C%20tills%20vi%20har%20all%20info%20om%20mitt%20f%C3%B6retag.%20Exempel%20p%C3%A5%20data%3A%20f%C3%B6retagsnamn%20eller%20id%C3%A9namn%2C%20org.nr.%2C%20%C3%A4gare%2C%20kontaktinformation%2C%20vision%2C%20aff%C3%A4rsid%C3%A9%2C%20mm."\n}';try{await window.Codicent.postMessage({message:`@${e} ${t}`,type:"text"})||(n=!1)}catch{n=!1}}}return n},this.getNickname=async()=>{try{const t=n.split(".")[1],e=atob(t),a=JSON.parse(e),s=a.sub||a.userId,i=await fetch(`${o}app/GetNickname?userId=${s}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!i.ok)throw 401===i.status?(this.handleUnauthorized(),new Error("Unauthorized")):new Error(`${i.statusText}`);return await i.text()}catch{return""}},this.getChatInstructions=async()=>{try{const t=await window.Codicent.getMessages({search:`@${this.codicent} #instructions`,length:1});if(t.length>0)return t[0].content}catch{console.warn("Error fetching chat instructions")}return""},this.updateChatInstructions=async t=>{try{const e=await window.Codicent.getMessages({search:`@${this.codicent} #instructions`,length:100}),a=`@${this.codicent} #instructions\n${t}`;e.length>0?e[0].content!==a&&(console.log("updating instructions",a),await window.Codicent.postMessage({message:a,type:"text",parentId:e[0].id})):(console.log("new instructions",a),await window.Codicent.postMessage({message:a,type:"text"}))}catch{console.warn("Error updating chat instructions")}},this.getUserInfo=async(t,e=!1)=>{const a=await fetch(`${o}app/GetUserInfo?nickname=${t}${e?"&t="+Date.now():""}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!a.ok)throw 401===a.status?(this.handleUnauthorized(),new Error("Unauthorized")):new Error(`${a.statusText}`);const n=await a.json(),{email:s,picture:i,description:r,followers:c,properties:h,owner:d}=n;return{nickname:t,email:s,name:r,picture:i,followers:c,properties:h,owner:d}},this.updateUserInfo=async({nickname:t,email:e,name:a,picture:n})=>{const s=await fetch(`${o}app/AddOrUpdateUser`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]],body:JSON.stringify({nickname:t,email:e,name:a,picture:n,description:""})});if(!s.ok)throw s.status,new Error(`${s.statusText}`);return await this.getUserInfo(t,!0)},this.requestInvite=async(t,e)=>{const a=await fetch(`${o}app/CreateInvitationOrRequest?forUserNickname=${t}&toProjectNickname=${e}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return!!a.ok||(console.warn(`requestInvite() => ${a.statusText}`),!1)},this.getProjectInfo=this.getUserInfo,this.updateMembersAccess=async(t,e)=>{const a=await fetch(`${o}app/AddOrUpdateProjectProperty?project=${t}&key=APP_EDITORS&value=${e.join(",")}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return!!a.ok||(console.warn(`updateMembersAccess() => ${a.statusText}`),!1)},this.getMembersAccess=async t=>{const e=(await this.getProjectInfo(t,!0)).properties.find((t=>"APP_EDITORS"===t.name));return e&&e.value?e.value.split(","):[]},this.setToken=t=>{n=t,n&&window.Codicent.init({token:n,baseUrl:o})},this.getToken=()=>n,this.checkPurchaseStatus=async()=>{const t=await fetch(`${o}payments/GetPaymentStatus`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(!t.ok)throw new Error("Failed to check purchase status");const{isPaid:e}=await t.json();return e},this.checkSubscriptionStatus=async()=>{if(!this.options.SUBSCRIPTION_NEEDED)return"active";const t=await fetch(`${o}payments/GetSubscriptionStatus?t=${Date.now()}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`],["Cache-Control","no-cache, no-store, must-revalidate"],["Pragma","no-cache"],["Expires","0"]]});if(!t.ok)throw new Error("Failed to check subscription status");const{status:e}=await t.json();return e},this.createCheckoutSession=async t=>{const e=await fetch(`${o}payments/CreateCheckoutSession`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]],body:JSON.stringify({priceId:t,successUrl:window.location.href,cancelUrl:window.location.href})});if(!e.ok)throw new Error("Failed to create checkout session");const{id:a}=await e.json();return a},this.redirectToCheckout=async t=>{const a=await e.loadStripe(this.options.STRIPE_PUBLIC_KEY);if(!a)throw new Error("Stripe failed to load");const o=await this.createCheckoutSession(t),{error:n}=await a.redirectToCheckout({sessionId:o});if(n)throw new Error(n.message)},this.getChatHistory=async t=>{const e=await fetch(`${o}api/GetMessageHistory?messageId=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!e.ok)throw new Error("Failed to get chat history");let a=await e.json();return a=a.filter((t=>!t.content.includes("#function_result")&&!t.content.includes("#finish_reason_function_call"))),a},this.getPublicFlow=async t=>{const e=await fetch(`${o}app/GetPublicFlow?codicent=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!e.ok)throw new Error("Failed to get public flow");const a=await e.json();return a.forEach((t=>{t.createdAt=new Date(Date.parse(t.createdAt))})),a},this.getMessageContent=async t=>{const e=await fetch(`${o}app/GetMessageContent?id=${t}`,{method:"GET",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.getToken()}`]]});if(e.ok){const t=await e.json();return{content:t.content,url:t.url}}return{content:"",url:""}},this.logAction=async(t,e)=>{if(!this.options.APP_LOG_CODICENT)return"";const a={content:`@${this.options.APP_LOG_CODICENT} #debug #${e}\n${t}`,type:"text"},n=await fetch(`${o}app/AddChatMessage`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${this.options.APP_LOG_TOKEN}`]],body:JSON.stringify(a)});if(!n.ok)throw new Error(`${n.statusText||"Failed to post log message!"}`);return(await n.json()).id},this.createApp=async()=>{try{for(let t=0;t<50;t++){const t=Math.floor(99999*Math.random())+1,e=`${this.options.APP_PREFIX}${t}`;if(!await this.nicknameExists(e)){if(await this.cloneProject(this.options.APP_TEMPLATE,e)){if(this.options.ANONYMOUS_TOKEN)try{const t=this.options.ANONYMOUS_TOKEN.split(".")[1],a=atob(t),o=JSON.parse(a).nickname;if(!await this.addFollower(e,o))throw new Error("Failed to add follower: "+o)}catch(t){console.error("Error extracting adding anonymous follower:",t)}return e}}}}catch(t){console.error("Error creating app:",t)}return null},this.findUsername=async()=>{try{for(let t=0;t<50;t++){const t=Math.floor(99999*Math.random())+1,e=`${this.options.USER_PREFIX}${t}`;if(!await this.nicknameExists(e))return e}}catch(t){console.warn("Error finding username:",t)}return null},this.getForms=async()=>{const t=await this.request(`${o}app/GetForms?codicent=${this.codicent}`,"GET",{headers:[["Authorization",`Bearer ${this.getToken()}`]]});return await t.json()},this.getFormById=async t=>{const e=await fetch(`${o}app/GetFormById?id=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return await e.json()},this.getTodoStatus=async t=>{const e=await fetch(`${o}app/GetTodoStatus?messageId=${t}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});return e.ok?await e.text():(e.status,console.warn(`getTodoStatus() => ${e.statusText}`),"unknown")},this.updateTodoStatus=async(t,e)=>{const a=await fetch(`${o}app/UpdateTodoStatus?messageId=${t}&status=${e}`,{method:"GET",headers:[["Authorization",`Bearer ${this.getToken()}`]]});if(!a.ok)return console.warn(`updateTodoStatus() => ${a.statusText}`),!1;return await a.json()},this.codicent="",this.options=t}async request(t,e,a={}){const o={};a.headers&&a.headers.forEach((([t,e])=>{o[t]=e}));const n=await fetch(t,{...a,method:e,headers:o});if(!n.ok)throw 401===n.status&&this.handleUnauthorized(),new Error(`${n.statusText}`);return n}handleUnauthorized(){this.onUnauthorized&&this.onUnauthorized()}async getRealtimeSessionToken(t="alloy"){const e=`${o}realtime/session?voice=${t}`,a=await fetch(e,{headers:{Authorization:`Bearer ${this.getToken()}`}});if(!a.ok)throw new Error(`Failed to fetch session token: ${a.statusText}`);const n=await a.json(),s=n.client_secret?.value;if(!s)throw new Error("No ephemeral key returned from session endpoint");return s}async getRealtimeConfig(){try{const t=`${o}realtime/config`,e=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${this.getToken()}`}});return e.ok?await e.json():null}catch(t){return console.warn("Failed to fetch realtime config:",t),null}}}t=r,r.getImageUrl=(t,e)=>`${o}app/GetImage?fileId=${t}&width=${e}`,r.getFileUrl=(t,e)=>`${o}app/DownloadFile?fileId=${t}${e?`&extension=${e}`:""}`,r.downloadFile=async e=>{fetch(t.getFileUrl(e.id)).then((t=>{if(t.headers.forEach(((t,e)=>{console.log(`${e}: ${t}`)})),t.ok)return t.blob();throw new Error("Network response was not ok.")})).then((t=>{const a=window.URL.createObjectURL(t),o=document.createElement("a");o.style.display="none",o.href=a,o.download=e.filename,document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(a)})).catch((t=>{console.error("There was a problem with the fetch operation:",t)}))},r.getMiniChatReplyOld=async(t,e="codicent-mini",a)=>{let s={project:e,message:t};a&&(s.messageId=a);const i=await fetch(`${o}app/GetAi2ChatReply`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${n}`]],body:JSON.stringify(s)});if(!i.ok)return void i.status;return(await i.json()).content.replace("@codicent-mini","").trim()},r.getMiniChatReply=async(t,e="codicent-mini",a,s=3e5,i=2e3)=>{const r={project:e,message:t};let c;a&&(r.messageId=a);try{const t=await fetch(`${o}app/StartAi2ChatAsync`,{method:"POST",headers:[["Content-Type","application/json; charset=utf-8"],["Authorization",`Bearer ${n}`]],body:JSON.stringify(r)});if(!t.ok)return t.status,void console.error(`Failed to start AI chat: ${t.status}`);if(c=(await t.json()).promptMessageId,!c)return void console.error("No promptMessageId returned from server")}catch(t){return void console.error("Error starting AI chat:",t)}const h=Date.now();for(;Date.now()-h<s;)try{const t=await fetch(`${o}app/GetAi2ChatReplyStatus?promptMessageId=${c}`,{method:"GET",headers:[["Authorization",`Bearer ${n}`]]});if(202===t.status){await new Promise((t=>setTimeout(t,i)));continue}if(!t.ok)return void console.error(`Error polling AI chat status: ${t.status}`);const a=await t.json();return a.content.replace(`@${e}`,"").replace("@codicent-mini","").trim()}catch(t){return void console.error("Error polling AI chat status:",t)}console.error("Polling timeout reached for AI chat")},r.getTranslations=async(t,e,a="codicent-mini")=>{const s=await fetch(`${o}app/GetTranslations`,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8",Authorization:`Bearer ${n}`},body:JSON.stringify({project:a,text:t,targetLanguage:e})});if(!s.ok)throw s.status,new Error(`Failed to get translations: ${s.statusText}`);return await s.json()},exports.CodicentService=r;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+B/B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;IAChE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EACH,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,yBAAyB,GACzB,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,uBAAuB,GACvB,aAAa,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAsBD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAWxC,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;IAChE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EACD,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,yBAAyB,GACzB,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,uBAAuB,GACvB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAsBD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAWxC,CAAC"}
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{getConfigValue as o}from"../config/index.js";import{makeStyles as i}from"../node_modules/@griffel/react/makeStyles.esm.js";import{DismissRegular as n,CopyRegular as r,ChevronRightFilled as s}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js";import{ShareRegular as u}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js";import{SignOut24Regular as l,SlideText24Regular as t}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js";import{Payment24Regular as c}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js";import{QuestionCircle24Regular as m}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js";import{SendFilled as a}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js";import{AttachRegular as d,CameraRegular as f,AddRegular as g,ArrowClockwiseRegular as R}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js";import{ImageRegular as h,LocationRegular as p,LocationFilled as b}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js";import{WandRegular as j}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js";import{Button as _}from"../node_modules/@fluentui/react-button/lib/components/Button/Button.js";import{mergeClasses as k}from"../node_modules/@griffel/core/mergeClasses.esm.js";const C=i({button:{borderRadius:o("BUTTON_BORDER_RADIUS")||void 0}}),S={DismissRegular:e(n,{}),CopyRegular:e(r,{}),ShareRegular:e(u,{}),SignOut24Regular:e(l,{}),Payment24Regular:e(c,{}),SlideText24Regular:e(t,{}),QuestionCircle24Regular:e(m,{}),SendFilled:e(a,{}),AttachRegular:e(d,{}),ImageRegular:e(h,{}),CameraRegular:e(f,{}),LocationRegular:e(p,{}),LocationFilled:e(b,{}),AddRegular:e(g,{}),ChevronRightFilled:e(s,{}),ArrowClockwiseRegular:e(R,{}),WandRegular:e(j,{})},B=({children:o,className:i,icon:n,image:r,...s})=>{const u=C();return e(_,{className:k(i,u.button),icon:n?{children:S[n]}:r?{children:r}:void 0,...s,children:o})};export{B as Button};
1
+ import{jsx as e}from"react/jsx-runtime";import{makeStyles as o}from"../node_modules/@griffel/react/makeStyles.esm.js";import{DismissRegular as i,CopyRegular as n,ChevronRightFilled as r}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js";import{ShareRegular as l}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js";import{SignOut24Regular as s,SlideText24Regular as u}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js";import{Payment24Regular as t}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js";import{QuestionCircle24Regular as c}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js";import{SendFilled as m}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js";import{AttachRegular as a,CameraRegular as d,AddRegular as f,ArrowClockwiseRegular as g}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js";import{ImageRegular as h,LocationRegular as p,LocationFilled as R}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js";import{WandRegular as b}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js";import{Button as j}from"../node_modules/@fluentui/react-button/lib/components/Button/Button.js";import{mergeClasses as _}from"../node_modules/@griffel/core/mergeClasses.esm.js";const k=o({button:{}}),C={DismissRegular:e(i,{}),CopyRegular:e(n,{}),ShareRegular:e(l,{}),SignOut24Regular:e(s,{}),Payment24Regular:e(t,{}),SlideText24Regular:e(u,{}),QuestionCircle24Regular:e(c,{}),SendFilled:e(m,{}),AttachRegular:e(a,{}),ImageRegular:e(h,{}),CameraRegular:e(d,{}),LocationRegular:e(p,{}),LocationFilled:e(R,{}),AddRegular:e(f,{}),ChevronRightFilled:e(r,{}),ArrowClockwiseRegular:e(g,{}),WandRegular:e(b,{})},S=({children:o,className:i,icon:n,image:r,...l})=>{const s=k();return e(j,{className:_(i,s.button),icon:n?{children:C[n]}:r?{children:r}:void 0,...l,children:o})};export{S as Button};
@@ -1 +1 @@
1
- {"version":3,"file":"CompoundButton.d.ts","sourceRoot":"","sources":["../../../src/components/CompoundButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6B/B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE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AC,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC;IAC3D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;IAChE,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EACD,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,yBAAyB,GACzB,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,oBAAoB,GACpB,uBAAuB,GACvB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAsBD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC"}
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{getConfigValue as e}from"../config/index.js";import{makeStyles as n}from"../node_modules/@griffel/react/makeStyles.esm.js";import{CompoundButton as i}from"../node_modules/@fluentui/react-button/lib/components/CompoundButton/CompoundButton.js";import{mergeClasses as r}from"../node_modules/@griffel/core/mergeClasses.esm.js";import{DismissRegular as u,CopyRegular as s,ChevronRightFilled as t}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js";import{ShareRegular as l}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js";import{SignOut24Regular as c,SlideText24Regular as m}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js";import{Payment24Regular as d}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js";import{QuestionCircle24Regular as a}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js";import{SendFilled as f}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js";import{AttachRegular as g,CameraRegular as p,AddRegular as R,ArrowClockwiseRegular as h}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js";import{ImageRegular as j,LocationRegular as _,LocationFilled as b}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js";import{WandRegular as k}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js";const C=n({compoundButton:{borderRadius:e("BUTTON_BORDER_RADIUS")||void 0}}),B={DismissRegular:o(u,{}),CopyRegular:o(s,{}),ShareRegular:o(l,{}),SignOut24Regular:o(c,{}),Payment24Regular:o(d,{}),SlideText24Regular:o(m,{}),QuestionCircle24Regular:o(a,{}),SendFilled:o(f,{}),AttachRegular:o(g,{}),ImageRegular:o(j,{}),CameraRegular:o(p,{}),LocationRegular:o(_,{}),LocationFilled:o(b,{}),AddRegular:o(R,{}),ChevronRightFilled:o(t,{}),ArrowClockwiseRegular:o(h,{}),WandRegular:o(k,{})},y=({children:e,className:n,icon:u,image:s,secondaryContent:t,...l})=>{const c=C(),m="string"==typeof t?{children:t}:t;return o(i,{className:r(n,c.compoundButton),icon:u?{children:B[u]}:s?{children:s}:void 0,secondaryContent:m,...l,children:e})};export{y as CompoundButton};
1
+ import{jsx as o}from"react/jsx-runtime";import{makeStyles as e}from"../node_modules/@griffel/react/makeStyles.esm.js";import{CompoundButton as n}from"../node_modules/@fluentui/react-button/lib/components/CompoundButton/CompoundButton.js";import{mergeClasses as i}from"../node_modules/@griffel/core/mergeClasses.esm.js";import{DismissRegular as r,CopyRegular as u,ChevronRightFilled as t}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-1.js";import{ShareRegular as s}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-4.js";import{SignOut24Regular as l,SlideText24Regular as c}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js";import{Payment24Regular as m}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-11.js";import{QuestionCircle24Regular as d}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-13.js";import{SendFilled as a}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-3.js";import{AttachRegular as f,CameraRegular as g,AddRegular as p,ArrowClockwiseRegular as h}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-0.js";import{ImageRegular as R,LocationRegular as j,LocationFilled as _}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-2.js";import{WandRegular as b}from"../node_modules/@fluentui/react-icons/lib/icons/chunk-5.js";const k=e({compoundButton:{}}),C={DismissRegular:o(r,{}),CopyRegular:o(u,{}),ShareRegular:o(s,{}),SignOut24Regular:o(l,{}),Payment24Regular:o(m,{}),SlideText24Regular:o(c,{}),QuestionCircle24Regular:o(d,{}),SendFilled:o(a,{}),AttachRegular:o(f,{}),ImageRegular:o(R,{}),CameraRegular:o(g,{}),LocationRegular:o(j,{}),LocationFilled:o(_,{}),AddRegular:o(p,{}),ChevronRightFilled:o(t,{}),ArrowClockwiseRegular:o(h,{}),WandRegular:o(b,{})},y=({children:e,className:r,icon:u,image:t,secondaryContent:s,...l})=>{const c=k(),m="string"==typeof s?{children:s}:s;return o(n,{className:i(r,c.compoundButton),icon:u?{children:C[u]}:t?{children:t}:void 0,secondaryContent:m,...l,children:e})};export{y as CompoundButton};
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/components/Footer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAiFnD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAkG1B,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/components/Footer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA8EnD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAgH1B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as t,useEffect as s}from"react";import{useLocation as i,Link as n}from"react-router-dom";import"../services/codicent.js";import"./Markdown.js";import"./Textarea.js";import"./Button.js";import"./CompoundButton.js";import"./Spinner.js";import"./TextHeader.js";import"./TypingIndicator.js";import"./Dialog.js";import"./ChatInput.js";import"./CombinedPlaceholderDialog.js";import"./ChatMessage.js";import"./Header.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import{getConfigValue as r}from"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"./FileThumbnail.js";import"./MessageInput.js";import"./UploadFile.js";import"./SnapFooter.js";import"./Profile.js";import"./MessageItem.js";import"./Content.js";import"./AiInput.js";import"./SearchBox.js";import"./HtmlView.js";import"./Page.js";import"../pages/AppFrame.js";import"../pages/Chat.js";import"../pages/Compose.js";import"../pages/Snap.js";import"../pages/Search.js";import"../pages/Login.js";import"../pages/CrmPage.js";import"../pages/CrmPagePersistent.js";import"../pages/ImageView.js";import"../pages/FormInvite.js";import"../pages/FormAccept.js";import"../pages/Sales.js";import"../pages/Purchase.js";import"../stores/chatStore.js";import a from"../hooks/useLocalization.js";import"../hooks/useAppStyles.js";import{makeStyles as l}from"../node_modules/@griffel/react/makeStyles.esm.js";import{shorthands as m}from"../node_modules/@griffel/core/index.esm.js";import{tokens as c}from"../node_modules/@fluentui/tokens/lib/tokens.js";import{Home24Filled as p,Home24Regular as d}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-8.js";import{Chat24Filled as u,Chat24Regular as j}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-3.js";import{AddSquare24Filled as h,AddSquare24Regular as g,Apps24Filled as _,Apps24Regular as f}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-0.js";import{ClipboardDay24Filled as T,ClipboardDay24Regular as b}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-4.js";import{SlideText24Filled as k,SlideText24Regular as x}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js";import{Whiteboard24Filled as O,Whiteboard24Regular as C}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-18.js";const N=l({footer:{...m.padding("14px"),backgroundColor:r("APP_FOOTER_COLOR")||c.colorBrandBackground,color:r("APP_FOOTER_TEXT_COLOR")||c.colorNeutralForegroundOnBrand,textAlign:"center",display:"flex",justifyContent:"space-around",alignItems:"center",position:"sticky",bottom:0,zIndex:1e3,paddingBottom:"22px",width:"100%"},container:{display:"flex",justifyContent:"space-around",alignItems:"center",maxWidth:"480px",width:"100%"},button:{color:c.colorNeutralForegroundOnBrand,height:"24px",width:"24px",...m.borderWidth("0")},link:{textDecoration:"none",color:"inherit",display:"flex",flexDirection:"column",alignItems:"center","&.selected":{border:"none",color:r("APP_FOOTER_SELECTED_COLOR")||void 0},"&:hover":{textDecoration:"none"}},buttonText:{fontSize:"12px"}}),v=()=>{const l=N(),m=i(),[c,v]=t(null),{t:I}=a();return s((()=>{const e=m.pathname;"/"===e?v("home"):"/chat"===e?v("chat"):"/new"===e?v("save"):"/menu"===e?v("menu"):"/log"===e?v("log"):"/canvas"===e?v("canvas"):"/snap"===e&&v("snap")}),[m]),s((()=>{c&&console.log(`footer-button: ${c}`)}),[c]),e("footer",{className:l.footer,children:o("div",{className:l.container,children:[o(n,{to:"/",className:`${l.link} ${"home"===c?"selected":""}`,onClick:()=>v("home"),children:[e("home"===c?p:d,{}),e("p",{className:l.buttonText,children:I("Hem")})]}),!r("HIDE_CHAT_BUTTON")&&o(n,{to:"/chat",className:`${l.link} ${"chat"===c?"selected":""}`,onClick:()=>v("chat"),children:[e("chat"===c?u:j,{}),e("p",{className:l.buttonText,children:I("Chatt")})]}),!r("HIDE_SAVE_BUTTON")&&o(n,{to:"/new",className:`${l.link} ${"save"===c?"selected":""}`,onClick:()=>v("save"),children:[e("save"===c?h:g,{}),e("p",{className:l.buttonText,children:I(r("APP_SAVE_TITLE")||"Spara")})]}),r("SHOW_SNAP_BUTTON")&&o(n,{to:"/snap",className:`${l.link} ${"snap"===c?"selected":""}`,onClick:()=>v("snap"),children:[e("snap"===c?T:b,{}),e("p",{className:l.buttonText,children:I("Snap")})]}),r("SHOW_LOGBOOK_BUTTON")&&o(n,{to:"/log",className:`${l.link} ${"log"===c?"selected":""}`,onClick:()=>v("log"),children:[e("log"===c?k:x,{}),e("p",{className:l.buttonText,children:I(r("APP_LOGBOOK_TITLE")||"Loggbok")})]}),r("SHOW_CANVAS_BUTTON")&&o(n,{to:"/canvas",className:`${l.link} ${"canvas"===c?"selected":""}`,onClick:()=>v("canvas"),children:[e("canvas"===c?O:C,{}),e("p",{className:l.buttonText,children:I("Kanvas")})]}),!r("HIDE_MENU_BUTTON")&&o(n,{to:"/menu",className:`${l.link} ${"menu"===c?"selected":""}`,onClick:()=>v("menu"),children:[e("menu"===c?_:f,{}),e("p",{className:l.buttonText,children:I("Meny")})]})]})})};export{v as Footer,v as default};
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import{useState as t,useEffect as s}from"react";import{useLocation as i,Link as n}from"react-router-dom";import"../services/codicent.js";import"./Markdown.js";import"./Textarea.js";import"./Button.js";import"./CompoundButton.js";import"./Spinner.js";import"./TextHeader.js";import"./TypingIndicator.js";import"./Dialog.js";import"./ChatInput.js";import"./CombinedPlaceholderDialog.js";import"./ChatMessage.js";import"./Header.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import{getConfigValue as r}from"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"./FileThumbnail.js";import"./MessageInput.js";import"./UploadFile.js";import"./SnapFooter.js";import"./Profile.js";import"./MessageItem.js";import"./Content.js";import"./AiInput.js";import"./SearchBox.js";import"./HtmlView.js";import"./Page.js";import"../pages/AppFrame.js";import"../pages/Chat.js";import"../pages/Compose.js";import"../pages/Snap.js";import"../pages/Search.js";import"../pages/Login.js";import"../pages/CrmPage.js";import"../pages/CrmPagePersistent.js";import"../pages/ImageView.js";import"../pages/FormInvite.js";import"../pages/FormAccept.js";import"../pages/Sales.js";import"../pages/Purchase.js";import"../stores/chatStore.js";import a from"../hooks/useLocalization.js";import"../hooks/useAppStyles.js";import{makeStyles as l}from"../node_modules/@griffel/react/makeStyles.esm.js";import{shorthands as c}from"../node_modules/@griffel/core/index.esm.js";import{tokens as m}from"../node_modules/@fluentui/tokens/lib/tokens.js";import{Home24Filled as p,Home24Regular as d}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-8.js";import{Chat24Filled as u,Chat24Regular as j}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-3.js";import{AddSquare24Filled as h,AddSquare24Regular as g,Apps24Filled as _,Apps24Regular as f}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-0.js";import{ClipboardDay24Filled as T,ClipboardDay24Regular as v}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-4.js";import{SlideText24Filled as b,SlideText24Regular as k}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-14.js";import{Whiteboard24Filled as x,Whiteboard24Regular as O}from"../node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-18.js";const C=l({footer:{...c.padding("14px"),textAlign:"center",display:"flex",justifyContent:"space-around",alignItems:"center",position:"sticky",bottom:0,zIndex:1e3,paddingBottom:"22px",width:"100%"},container:{display:"flex",justifyContent:"space-around",alignItems:"center",maxWidth:"480px",width:"100%"},button:{color:m.colorNeutralForegroundOnBrand,height:"24px",width:"24px",...c.borderWidth("0")},link:{textDecoration:"none",color:"inherit",display:"flex",flexDirection:"column",alignItems:"center","&.selected":{border:"none"},"&:hover":{textDecoration:"none"}},buttonText:{fontSize:"12px"}}),N=()=>{const l=C(),c=i(),[N,y]=t(null),{t:I}=a(),S={backgroundColor:r("APP_FOOTER_COLOR")||m.colorBrandBackground,color:r("APP_FOOTER_TEXT_COLOR")||m.colorNeutralForegroundOnBrand},P=r("APP_FOOTER_SELECTED_COLOR")||void 0;return s((()=>{const o=c.pathname;"/"===o?y("home"):"/chat"===o?y("chat"):"/new"===o?y("save"):"/menu"===o?y("menu"):"/log"===o?y("log"):"/canvas"===o?y("canvas"):"/snap"===o&&y("snap")}),[c]),s((()=>{N&&console.log(`footer-button: ${N}`)}),[N]),o("footer",{className:l.footer,style:S,children:e("div",{className:l.container,children:[e(n,{to:"/",className:`${l.link} ${"home"===N?"selected":""}`,onClick:()=>y("home"),style:"home"===N?{color:P}:void 0,children:[o("home"===N?p:d,{}),o("p",{className:l.buttonText,children:I("Hem")})]}),!r("HIDE_CHAT_BUTTON")&&e(n,{to:"/chat",className:`${l.link} ${"chat"===N?"selected":""}`,onClick:()=>y("chat"),style:"chat"===N?{color:P}:void 0,children:[o("chat"===N?u:j,{}),o("p",{className:l.buttonText,children:I("Chatt")})]}),!r("HIDE_SAVE_BUTTON")&&e(n,{to:"/new",className:`${l.link} ${"save"===N?"selected":""}`,onClick:()=>y("save"),style:"save"===N?{color:P}:void 0,children:[o("save"===N?h:g,{}),o("p",{className:l.buttonText,children:I(r("APP_SAVE_TITLE")||"Spara")})]}),r("SHOW_SNAP_BUTTON")&&e(n,{to:"/snap",className:`${l.link} ${"snap"===N?"selected":""}`,onClick:()=>y("snap"),style:"snap"===N?{color:P}:void 0,children:[o("snap"===N?T:v,{}),o("p",{className:l.buttonText,children:I("Snap")})]}),r("SHOW_LOGBOOK_BUTTON")&&e(n,{to:"/log",className:`${l.link} ${"log"===N?"selected":""}`,onClick:()=>y("log"),style:"log"===N?{color:P}:void 0,children:[o("log"===N?b:k,{}),o("p",{className:l.buttonText,children:I(r("APP_LOGBOOK_TITLE")||"Loggbok")})]}),r("SHOW_CANVAS_BUTTON")&&e(n,{to:"/canvas",className:`${l.link} ${"canvas"===N?"selected":""}`,onClick:()=>y("canvas"),style:"canvas"===N?{color:P}:void 0,children:[o("canvas"===N?x:O,{}),o("p",{className:l.buttonText,children:I("Kanvas")})]}),!r("HIDE_MENU_BUTTON")&&e(n,{to:"/menu",className:`${l.link} ${"menu"===N?"selected":""}`,onClick:()=>y("menu"),style:"menu"===N?{color:P}:void 0,children:[o("menu"===N?_:f,{}),o("p",{className:l.buttonText,children:I("Meny")})]})]})})};export{N as Footer,N as default};
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkCxD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAsCE,CAAC"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAgCxD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CA4CA,CAAC"}