@bikdotai/bik-component-library 0.0.858-beta.1 → 0.0.859-beta.0

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 (122) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +23 -23
  3. package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js.map +1 -1
  4. package/dist/cjs/components/agent-builder/components/AiTextArea.js +1 -1
  5. package/dist/cjs/components/agent-builder/components/AiTextArea.js.map +1 -1
  6. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +2 -2
  7. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
  8. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
  9. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js.map +1 -1
  10. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ChartLayout.js +2 -0
  11. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ChartLayout.js.map +1 -0
  12. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js +2 -0
  13. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js.map +1 -0
  14. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js +2 -0
  15. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js.map +1 -0
  16. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js +2 -0
  17. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js.map +1 -0
  18. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
  19. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js.map +1 -1
  20. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.js.map +1 -1
  21. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/chartPalette.js +2 -0
  22. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/chartPalette.js.map +1 -0
  23. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/formatChartValue.js +2 -0
  24. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/formatChartValue.js.map +1 -0
  25. package/dist/cjs/components/bik-chatbot/components/ChatWindow.js +20 -20
  26. package/dist/cjs/components/bik-chatbot/components/ChatWindow.js.map +1 -1
  27. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +2 -2
  28. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  29. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +2 -2
  30. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  31. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
  32. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  33. package/dist/cjs/components/input/ChipInput.js +1 -1
  34. package/dist/cjs/components/input/ChipInput.js.map +1 -1
  35. package/dist/cjs/components/input/Input-helper.js +1 -1
  36. package/dist/cjs/components/input/Input-helper.js.map +1 -1
  37. package/dist/cjs/components/input/Input.js +1 -1
  38. package/dist/cjs/components/input/Input.js.map +1 -1
  39. package/dist/cjs/components/plans/SubscriptionPlanSelector.js +5 -5
  40. package/dist/cjs/components/plans/SubscriptionPlanSelector.js.map +1 -1
  41. package/dist/cjs/editor/BikEditor.js +1 -1
  42. package/dist/cjs/editor/BikEditor.js.map +1 -1
  43. package/dist/cjs/editor/BikEditor.utils.js +3 -3
  44. package/dist/cjs/editor/BikEditor.utils.js.map +1 -1
  45. package/dist/cjs/editor/extensions/buildExtensions.js +2 -2
  46. package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
  47. package/dist/cjs/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js +2 -0
  48. package/dist/cjs/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js.map +1 -0
  49. package/dist/cjs/helpers/sanitize.js +2 -0
  50. package/dist/cjs/helpers/sanitize.js.map +1 -0
  51. package/dist/cjs/index.js +1 -1
  52. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +144 -143
  53. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js.map +1 -1
  54. package/dist/esm/components/agent-builder/components/AiTextArea.js +24 -23
  55. package/dist/esm/components/agent-builder/components/AiTextArea.js.map +1 -1
  56. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +38 -37
  57. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
  58. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +3 -0
  59. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +182 -172
  60. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js.map +1 -1
  61. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ChartLayout.d.ts +16 -0
  62. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ChartLayout.js +69 -0
  63. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ChartLayout.js.map +1 -0
  64. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.d.ts +3 -0
  65. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js +166 -0
  66. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js.map +1 -0
  67. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.model.d.ts +21 -0
  68. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.d.ts +3 -0
  69. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js +176 -0
  70. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js.map +1 -0
  71. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.model.d.ts +19 -0
  72. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.d.ts +23 -0
  73. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js +48 -0
  74. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js.map +1 -0
  75. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
  76. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js.map +1 -1
  77. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +1 -0
  78. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.js.map +1 -1
  79. package/dist/esm/components/analytics-chips-and-dropdowns/chart/chartPalette.d.ts +3 -0
  80. package/dist/esm/components/analytics-chips-and-dropdowns/chart/chartPalette.js +18 -0
  81. package/dist/esm/components/analytics-chips-and-dropdowns/chart/chartPalette.js.map +1 -0
  82. package/dist/esm/components/analytics-chips-and-dropdowns/chart/formatChartValue.d.ts +4 -0
  83. package/dist/esm/components/analytics-chips-and-dropdowns/chart/formatChartValue.js +13 -0
  84. package/dist/esm/components/analytics-chips-and-dropdowns/chart/formatChartValue.js.map +1 -0
  85. package/dist/esm/components/analytics-chips-and-dropdowns/index.d.ts +4 -0
  86. package/dist/esm/components/bik-chatbot/components/ChatWindow.js +54 -53
  87. package/dist/esm/components/bik-chatbot/components/ChatWindow.js.map +1 -1
  88. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +346 -420
  89. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  90. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +35 -33
  91. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  92. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +48 -47
  93. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  94. package/dist/esm/components/feature-announcements/types/props.types.d.ts +2 -2
  95. package/dist/esm/components/input/ChipInput.js +41 -40
  96. package/dist/esm/components/input/ChipInput.js.map +1 -1
  97. package/dist/esm/components/input/Input-helper.d.ts +7 -0
  98. package/dist/esm/components/input/Input-helper.js +16 -25
  99. package/dist/esm/components/input/Input-helper.js.map +1 -1
  100. package/dist/esm/components/input/Input.js +59 -57
  101. package/dist/esm/components/input/Input.js.map +1 -1
  102. package/dist/esm/components/input/Input.model.d.ts +1 -0
  103. package/dist/esm/components/plans/SubscriptionPlanSelector.js +42 -40
  104. package/dist/esm/components/plans/SubscriptionPlanSelector.js.map +1 -1
  105. package/dist/esm/editor/BikEditor.js +221 -217
  106. package/dist/esm/editor/BikEditor.js.map +1 -1
  107. package/dist/esm/editor/BikEditor.utils.d.ts +1 -1
  108. package/dist/esm/editor/BikEditor.utils.js +141 -140
  109. package/dist/esm/editor/BikEditor.utils.js.map +1 -1
  110. package/dist/esm/editor/extensions/buildExtensions.js +35 -25
  111. package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
  112. package/dist/esm/editor/extensions/htmlTagStrip/HtmlTagStripExtension.d.ts +13 -0
  113. package/dist/esm/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js +64 -0
  114. package/dist/esm/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js.map +1 -0
  115. package/dist/esm/helpers/index.d.ts +1 -0
  116. package/dist/esm/helpers/sanitize.d.ts +32 -0
  117. package/dist/esm/helpers/sanitize.js +207 -0
  118. package/dist/esm/helpers/sanitize.js.map +1 -0
  119. package/dist/esm/icons/index.d.ts +1 -1
  120. package/dist/esm/index.js +429 -415
  121. package/dist/esm/index.js.map +1 -1
  122. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ToolInstructionsField.js","sources":["../../../../../src/components/agent-builder/components/ToolInstructionsField.tsx"],"sourcesContent":["import { WandSparkles } from '@src/icons';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { VariableListInterfaceV3 } from '../../variable-picker-v3/model';\nimport {\n\tAiTextAreaInput,\n\tAiTextAreaShell,\n\tFieldBlock,\n} from '../AgentBuilder.styled';\nimport { MentionEditor } from './MentionEditor';\n\ninterface ToolInstructionsFieldProps {\n\tlabel: string;\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tmaxLength: number;\n\tplaceholder?: string;\n\tminHeight?: string;\n\t/** \"Improve with AI\" — resolves with rewritten text. Omit to hide the button. */\n\tonImprove?: (text: string) => Promise<string>;\n\t/**\n\t * Variable catalog. When non-empty the field upgrades from a plain textarea\n\t * to a variables-only `@` mention editor: typing `@` opens the variable\n\t * categories directly (Variables is the sole category, so the picker skips\n\t * the Tools / Sub-agent root), and picks render as chips persisted as\n\t * `{{variable:<name>}}` tokens.\n\t */\n\tvariablesData?: VariableListInterfaceV3[];\n\t'data-test'?: string;\n}\n\n/**\n * A labelled multiline field with an inline \"Improve with AI\" action pinned to\n * the bottom-left of the box (Figma: Rest API / Handover-to-email drawers). The\n * button is hidden when `onImprove` is omitted.\n */\nexport const ToolInstructionsField: React.FC<ToolInstructionsFieldProps> = ({\n\tlabel,\n\tvalue,\n\tonChange,\n\tmaxLength,\n\tplaceholder,\n\tminHeight = '120px',\n\tonImprove,\n\tvariablesData,\n\t...rest\n}) => {\n\tconst [focused, setFocused] = useState(false);\n\tconst [improving, setImproving] = useState(false);\n\t// Bumped when \"Improve with AI\" replaces the text externally — the mention\n\t// editor only reads `value` on (re)mount, so it must be remounted.\n\tconst [editorEpoch, setEditorEpoch] = useState(0);\n\n\tconst withVariables = (variablesData?.length ?? 0) > 0;\n\n\tconst handleImprove = async () => {\n\t\tif (!onImprove || improving || value.trim().length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tsetImproving(true);\n\t\ttry {\n\t\t\tonChange(await onImprove(value));\n\t\t\tif (withVariables) {\n\t\t\t\tsetEditorEpoch((e) => e + 1);\n\t\t\t}\n\t\t} finally {\n\t\t\tsetImproving(false);\n\t\t}\n\t};\n\n\tconst improveAction = onImprove ? (\n\t\t<ImproveRow>\n\t\t\t<Button\n\t\t\t\tdata-test={`${rest['data-test'] ?? 'tool'}-improve`}\n\t\t\t\tbuttonType=\"ai\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tLeadingIcon={WandSparkles}\n\t\t\t\tbuttonText=\"Improve with AI\"\n\t\t\t\tisLoading={improving}\n\t\t\t\tdisabled={improving || value.trim().length === 0}\n\t\t\t\tonClick={handleImprove}\n\t\t\t/>\n\t\t</ImproveRow>\n\t) : undefined;\n\n\t// Variables enabled → the mention-editor variant. `mentionItems` / tool\n\t// hooks stay empty so Variables is the picker's ONLY category and `@` lands\n\t// straight in the variable list.\n\tif (withVariables) {\n\t\treturn (\n\t\t\t<MentionEditor\n\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\tlabel={label}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={onChange}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tminHeight={minHeight}\n\t\t\t\tresetKey={`improve-${editorEpoch}`}\n\t\t\t\tmentionItems={[]}\n\t\t\t\ttools={[]}\n\t\t\t\tvariablesData={variablesData}\n\t\t\t\t// Drawers get the same focused-field \"+ Add data\" affordance as the\n\t\t\t\t// main Step-3 editors.\n\t\t\t\taddDataButton\n\t\t\t\taction={improveAction}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FieldBlock>\n\t\t\t<TitleSmall color={COLORS.content.primary}>{label}</TitleSmall>\n\t\t\t<AiTextAreaShell focused={focused} minHeight={minHeight}>\n\t\t\t\t<AiTextAreaInput\n\t\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tonFocus={() => setFocused(true)}\n\t\t\t\t\tonBlur={() => setFocused(false)}\n\t\t\t\t\tonChange={(e) => onChange(e.target.value)}\n\t\t\t\t/>\n\t\t\t\t{improveAction}\n\t\t\t</AiTextAreaShell>\n\t\t</FieldBlock>\n\t);\n};\n\nconst ImproveRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n`;\n"],"names":["ToolInstructionsField","label","value","onChange","maxLength","placeholder","minHeight","onImprove","variablesData","rest","focused","setFocused","useState","improving","setImproving","editorEpoch","setEditorEpoch","withVariables","handleImprove","e","improveAction","jsx","ImproveRow","Button","WandSparkles","MentionEditor","FieldBlock","TitleSmall","COLORS","jsxs","AiTextAreaShell","AiTextAreaInput","styled"],"mappings":";;;;;;;;;AAuCO,MAAMA,IAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACJ,MAAM;AACL,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAG1C,CAACG,GAAaC,CAAc,IAAIJ,EAAS,CAAC,GAE1CK,KAAiBT,GAAe,UAAU,KAAK,GAE/CU,IAAgB,YAAY;AACjC,QAAI,GAACX,KAAaM,KAAaX,EAAM,KAAA,EAAO,WAAW,IAGvD;AAAA,MAAAY,EAAa,EAAI;AACjB,UAAI;AACH,QAAAX,EAAS,MAAMI,EAAUL,CAAK,CAAC,GAC3Be,KACHD,EAAe,CAACG,MAAMA,IAAI,CAAC;AAAA,MAE7B,UAAA;AACC,QAAAL,EAAa,EAAK;AAAA,MACnB;AAAA;AAAA,EACD,GAEMM,IAAgBb,IACrB,gBAAAc,EAACC,GAAA,EACA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACA,aAAW,GAAGd,EAAK,WAAW,KAAK,MAAM;AAAA,MACzC,YAAW;AAAA,MACX,MAAK;AAAA,MACL,aAAae;AAAAA,MACb,YAAW;AAAA,MACX,WAAWX;AAAA,MACX,UAAUA,KAAaX,EAAM,KAAA,EAAO,WAAW;AAAA,MAC/C,SAASgB;AAAA,IAAA;AAAA,EAAA,GAEX,IACG;AAKJ,SAAID,IAEF,gBAAAI;AAAA,IAACI;AAAA,IAAA;AAAA,MACA,aAAWhB,EAAK,WAAW;AAAA,MAC3B,OAAAR;AAAA,MACA,OAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAU,WAAWS,CAAW;AAAA,MAChC,cAAc,CAAA;AAAA,MACd,OAAO,CAAA;AAAA,MACP,eAAAP;AAAA,MAGA,eAAa;AAAA,MACb,QAAQY;AAAA,IAAA;AAAA,EAAA,sBAMTM,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAL,EAACM,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAU,UAAA3B,GAAM;AAAA,IAClD,gBAAA4B,EAACC,GAAA,EAAgB,SAAApB,GAAkB,WAAAJ,GAClC,UAAA;AAAA,MAAA,gBAAAe;AAAA,QAACU;AAAA,QAAA;AAAA,UACA,aAAWtB,EAAK,WAAW;AAAA,UAC3B,OAAAP;AAAA,UACA,aAAAG;AAAA,UACA,WAAAD;AAAA,UACA,SAAS,MAAMO,EAAW,EAAI;AAAA,UAC9B,QAAQ,MAAMA,EAAW,EAAK;AAAA,UAC9B,UAAU,CAACQ,MAAMhB,EAASgB,EAAE,OAAO,KAAK;AAAA,QAAA;AAAA,MAAA;AAAA,MAExCC;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACD;AAEF,GAEME,IAAaU,EAAO;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"ToolInstructionsField.js","sources":["../../../../../src/components/agent-builder/components/ToolInstructionsField.tsx"],"sourcesContent":["import { stripHtmlTags } from '@src/helpers/sanitize';\nimport { WandSparkles } from '@src/icons';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { VariableListInterfaceV3 } from '../../variable-picker-v3/model';\nimport {\n\tAiTextAreaInput,\n\tAiTextAreaShell,\n\tFieldBlock,\n} from '../AgentBuilder.styled';\nimport { MentionEditor } from './MentionEditor';\n\ninterface ToolInstructionsFieldProps {\n\tlabel: string;\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tmaxLength: number;\n\tplaceholder?: string;\n\tminHeight?: string;\n\t/** \"Improve with AI\" — resolves with rewritten text. Omit to hide the button. */\n\tonImprove?: (text: string) => Promise<string>;\n\t/**\n\t * Variable catalog. When non-empty the field upgrades from a plain textarea\n\t * to a variables-only `@` mention editor: typing `@` opens the variable\n\t * categories directly (Variables is the sole category, so the picker skips\n\t * the Tools / Sub-agent root), and picks render as chips persisted as\n\t * `{{variable:<name>}}` tokens.\n\t */\n\tvariablesData?: VariableListInterfaceV3[];\n\t'data-test'?: string;\n}\n\n/**\n * A labelled multiline field with an inline \"Improve with AI\" action pinned to\n * the bottom-left of the box (Figma: Rest API / Handover-to-email drawers). The\n * button is hidden when `onImprove` is omitted.\n */\nexport const ToolInstructionsField: React.FC<ToolInstructionsFieldProps> = ({\n\tlabel,\n\tvalue,\n\tonChange,\n\tmaxLength,\n\tplaceholder,\n\tminHeight = '120px',\n\tonImprove,\n\tvariablesData,\n\t...rest\n}) => {\n\tconst [focused, setFocused] = useState(false);\n\tconst [improving, setImproving] = useState(false);\n\t// Bumped when \"Improve with AI\" replaces the text externally — the mention\n\t// editor only reads `value` on (re)mount, so it must be remounted.\n\tconst [editorEpoch, setEditorEpoch] = useState(0);\n\n\tconst withVariables = (variablesData?.length ?? 0) > 0;\n\n\tconst handleImprove = async () => {\n\t\tif (!onImprove || improving || value.trim().length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tsetImproving(true);\n\t\ttry {\n\t\t\tonChange(await onImprove(value));\n\t\t\tif (withVariables) {\n\t\t\t\tsetEditorEpoch((e) => e + 1);\n\t\t\t}\n\t\t} finally {\n\t\t\tsetImproving(false);\n\t\t}\n\t};\n\n\tconst improveAction = onImprove ? (\n\t\t<ImproveRow>\n\t\t\t<Button\n\t\t\t\tdata-test={`${rest['data-test'] ?? 'tool'}-improve`}\n\t\t\t\tbuttonType=\"ai\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tLeadingIcon={WandSparkles}\n\t\t\t\tbuttonText=\"Improve with AI\"\n\t\t\t\tisLoading={improving}\n\t\t\t\tdisabled={improving || value.trim().length === 0}\n\t\t\t\tonClick={handleImprove}\n\t\t\t/>\n\t\t</ImproveRow>\n\t) : undefined;\n\n\t// Variables enabled → the mention-editor variant. `mentionItems` / tool\n\t// hooks stay empty so Variables is the picker's ONLY category and `@` lands\n\t// straight in the variable list.\n\tif (withVariables) {\n\t\treturn (\n\t\t\t<MentionEditor\n\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\tlabel={label}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={onChange}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tminHeight={minHeight}\n\t\t\t\tresetKey={`improve-${editorEpoch}`}\n\t\t\t\tmentionItems={[]}\n\t\t\t\ttools={[]}\n\t\t\t\tvariablesData={variablesData}\n\t\t\t\t// Drawers get the same focused-field \"+ Add data\" affordance as the\n\t\t\t\t// main Step-3 editors.\n\t\t\t\taddDataButton\n\t\t\t\taction={improveAction}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FieldBlock>\n\t\t\t<TitleSmall color={COLORS.content.primary}>{label}</TitleSmall>\n\t\t\t<AiTextAreaShell focused={focused} minHeight={minHeight}>\n\t\t\t\t<AiTextAreaInput\n\t\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tonFocus={() => setFocused(true)}\n\t\t\t\t\tonBlur={() => setFocused(false)}\n\t\t\t\t\tonChange={(e) => onChange(stripHtmlTags(e.target.value))}\n\t\t\t\t/>\n\t\t\t\t{improveAction}\n\t\t\t</AiTextAreaShell>\n\t\t</FieldBlock>\n\t);\n};\n\nconst ImproveRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n`;\n"],"names":["ToolInstructionsField","label","value","onChange","maxLength","placeholder","minHeight","onImprove","variablesData","rest","focused","setFocused","useState","improving","setImproving","editorEpoch","setEditorEpoch","withVariables","handleImprove","e","improveAction","jsx","ImproveRow","Button","WandSparkles","MentionEditor","FieldBlock","TitleSmall","COLORS","jsxs","AiTextAreaShell","AiTextAreaInput","stripHtmlTags","styled"],"mappings":";;;;;;;;;;AAwCO,MAAMA,IAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACJ,MAAM;AACL,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAG1C,CAACG,GAAaC,CAAc,IAAIJ,EAAS,CAAC,GAE1CK,KAAiBT,GAAe,UAAU,KAAK,GAE/CU,IAAgB,YAAY;AACjC,QAAI,GAACX,KAAaM,KAAaX,EAAM,KAAA,EAAO,WAAW,IAGvD;AAAA,MAAAY,EAAa,EAAI;AACjB,UAAI;AACH,QAAAX,EAAS,MAAMI,EAAUL,CAAK,CAAC,GAC3Be,KACHD,EAAe,CAACG,MAAMA,IAAI,CAAC;AAAA,MAE7B,UAAA;AACC,QAAAL,EAAa,EAAK;AAAA,MACnB;AAAA;AAAA,EACD,GAEMM,IAAgBb,IACrB,gBAAAc,EAACC,GAAA,EACA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACA,aAAW,GAAGd,EAAK,WAAW,KAAK,MAAM;AAAA,MACzC,YAAW;AAAA,MACX,MAAK;AAAA,MACL,aAAae;AAAAA,MACb,YAAW;AAAA,MACX,WAAWX;AAAA,MACX,UAAUA,KAAaX,EAAM,KAAA,EAAO,WAAW;AAAA,MAC/C,SAASgB;AAAA,IAAA;AAAA,EAAA,GAEX,IACG;AAKJ,SAAID,IAEF,gBAAAI;AAAA,IAACI;AAAA,IAAA;AAAA,MACA,aAAWhB,EAAK,WAAW;AAAA,MAC3B,OAAAR;AAAA,MACA,OAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,WAAAC;AAAA,MACA,UAAU,WAAWS,CAAW;AAAA,MAChC,cAAc,CAAA;AAAA,MACd,OAAO,CAAA;AAAA,MACP,eAAAP;AAAA,MAGA,eAAa;AAAA,MACb,QAAQY;AAAA,IAAA;AAAA,EAAA,sBAMTM,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAL,EAACM,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAU,UAAA3B,GAAM;AAAA,IAClD,gBAAA4B,EAACC,GAAA,EAAgB,SAAApB,GAAkB,WAAAJ,GAClC,UAAA;AAAA,MAAA,gBAAAe;AAAA,QAACU;AAAA,QAAA;AAAA,UACA,aAAWtB,EAAK,WAAW;AAAA,UAC3B,OAAAP;AAAA,UACA,aAAAG;AAAA,UACA,WAAAD;AAAA,UACA,SAAS,MAAMO,EAAW,EAAI;AAAA,UAC9B,QAAQ,MAAMA,EAAW,EAAK;AAAA,UAC9B,UAAU,CAACQ,MAAMhB,EAAS6B,EAAcb,EAAE,OAAO,KAAK,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,MAEvDC;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACD;AAEF,GAEME,IAAaW,EAAO;AAAA;AAAA;AAAA;"}
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { Placement } from '../tooltips';
2
3
  export interface AnalyticsTrendInterface {
3
4
  title: string;
4
5
  value?: number | string;
@@ -10,6 +11,8 @@ export interface AnalyticsTrendInterface {
10
11
  customRange?: Date[];
11
12
  type?: 'vertical' | 'horizontal';
12
13
  tooltip?: string;
14
+ tooltipPlacement?: Placement;
15
+ tooltipWidth?: number;
13
16
  card?: boolean;
14
17
  rightSeparator?: boolean;
15
18
  size?: 'big' | 'small';
@@ -1,87 +1,89 @@
1
- import { jsx as t, jsxs as s, Fragment as Y } from "react/jsx-runtime";
2
- import Z, { useState as O, useEffect as U } from "react";
3
- import { ShimmerComponentStyled as k } from "../shimmer/ShimmerComponent/ShimmerStyled.js";
4
- import P from "../../utils/DateUtils.js";
5
- import { COLORS as l } from "../../constants/Theme.js";
6
- import tt from "../../assets/icons/arrow_down.svg.js";
7
- import et from "../../assets/icons/arrow_up.svg.js";
8
- import rt from "../../assets/icons/info.svg.js";
9
- import { BodyCaption as nt, TitleLarge as ot, TitleMedium as it, Caption as u } from "../TypographyStyle.js";
10
- import { truncateValueForInternationalStore as q, truncateValueForIndianStore as B } from "./chart/utils/calcPercentage.js";
11
- import { AnalyticsTrendContainer as lt, IconContainer as at } from "./CommonStyles.js";
12
- import { Tooltip as V } from "../tooltips/Tooltip.js";
13
- import { Tag as C } from "../tag/Tag.js";
14
- const wt = ({
15
- title: h,
16
- value: r,
17
- trendPercent: e,
1
+ import { jsx as t, jsxs as f, Fragment as P } from "react/jsx-runtime";
2
+ import tt, { useState as _, useEffect as q } from "react";
3
+ import { ShimmerComponentStyled as V } from "../shimmer/ShimmerComponent/ShimmerStyled.js";
4
+ import et from "../../utils/DateUtils.js";
5
+ import { COLORS as i } from "../../constants/Theme.js";
6
+ import rt from "../../assets/icons/arrow_down.svg.js";
7
+ import nt from "../../assets/icons/arrow_up.svg.js";
8
+ import ot from "../../assets/icons/info.svg.js";
9
+ import { BodyCaption as it, TitleLarge as lt, TitleMedium as at, Caption as m } from "../TypographyStyle.js";
10
+ import { truncateValueForInternationalStore as G, truncateValueForIndianStore as H } from "./chart/utils/calcPercentage.js";
11
+ import { AnalyticsTrendContainer as dt, IconContainer as ct } from "./CommonStyles.js";
12
+ import { Tooltip as z } from "../tooltips/Tooltip.js";
13
+ import { Tag as x } from "../tag/Tag.js";
14
+ const Tt = ({
15
+ title: c,
16
+ value: n,
17
+ trendPercent: r,
18
18
  type: a = "horizontal",
19
- timeline: n,
20
- customRange: f,
21
- tooltip: b,
22
- card: y = !0,
23
- rightSeparator: D = !1,
24
- size: $ = "big",
25
- share: o = !1,
19
+ timeline: o,
20
+ customRange: y,
21
+ tooltip: u,
22
+ tooltipPlacement: T = "right",
23
+ tooltipWidth: C = 300,
24
+ card: h = !0,
25
+ rightSeparator: s = !1,
26
+ size: D = "big",
27
+ share: l = !1,
26
28
  formatVal: A,
27
29
  prefixSymbol: d,
28
- trailingIcon: v,
30
+ trailingIcon: p,
29
31
  onTrailIconClick: M,
30
- iconTooltipBody: p,
31
- funnelPercent: w,
32
- isLoading: i,
33
- trendRaw: g,
34
- trendRawString: c,
35
- suffixText: m,
36
- trendStyle: G,
37
- trendContainerStyle: H,
38
- trendIconStyle: z,
39
- containerStyle: J,
40
- prevTrendDiff: F,
41
- relativePercentageDiff: N,
42
- isInternationalStore: I,
43
- Icon: x,
44
- iconContainerStyle: K,
45
- tooltipTimelineText: S,
46
- customTimelineText: W
32
+ iconTooltipBody: b,
33
+ funnelPercent: g,
34
+ isLoading: e,
35
+ trendRaw: F,
36
+ trendRawString: N,
37
+ suffixText: $,
38
+ trendStyle: J,
39
+ trendContainerStyle: K,
40
+ trendIconStyle: S,
41
+ containerStyle: L,
42
+ prevTrendDiff: I,
43
+ relativePercentageDiff: W,
44
+ isInternationalStore: j,
45
+ Icon: v,
46
+ iconContainerStyle: Q,
47
+ tooltipTimelineText: E,
48
+ customTimelineText: O
47
49
  }) => {
48
- const L = $ === "big" ? ot : it, E = typeof e < "u" ? e < 0 ? "negative" : e === 0 ? "neutral" : "positive" : void 0, T = typeof e < "u" ? o ? Math.round(e) : Math.abs(Math.round(e)) : void 0, Q = () => typeof r > "u" ? "--" : typeof r == "number" && A ? r > 999 ? I ? `${d ?? ""}${q(
49
- r
50
- )} ${m ?? ""}` : `${d ?? ""}${B(
51
- r
52
- )} ${m ?? ""}` : `${d ?? ""}${new Intl.NumberFormat("en-IN", {
50
+ const R = D === "big" ? lt : at, U = typeof r < "u" ? r < 0 ? "negative" : r === 0 ? "neutral" : "positive" : void 0, w = typeof r < "u" ? l ? Math.round(r) : Math.abs(Math.round(r)) : void 0, X = () => typeof n > "u" ? "--" : typeof n == "number" && A ? n > 999 ? j ? `${d ?? ""}${G(
51
+ n
52
+ )} ${$ ?? ""}` : `${d ?? ""}${H(
53
+ n
54
+ )} ${$ ?? ""}` : `${d ?? ""}${new Intl.NumberFormat("en-IN", {
53
55
  maximumFractionDigits: 2
54
- }).format(r)} ${m ?? ""}` : `${d ?? ""}${r} ${m ?? ""}`, R = (X) => {
55
- const j = Math.abs(X);
56
- return j % 1 !== 0 ? `${j.toFixed(1)} %` : `${j} %`;
56
+ }).format(n)} ${$ ?? ""}` : `${d ?? ""}${n} ${$ ?? ""}`, Y = (Z) => {
57
+ const k = Math.abs(Z);
58
+ return k % 1 !== 0 ? `${k.toFixed(1)} %` : `${k} %`;
57
59
  };
58
60
  return /* @__PURE__ */ t(
59
- lt,
61
+ dt,
60
62
  {
61
- card: y,
63
+ card: h,
62
64
  style: {
63
- ...J
65
+ ...L
64
66
  },
65
- children: /* @__PURE__ */ s(
67
+ children: /* @__PURE__ */ f(
66
68
  "div",
67
69
  {
68
70
  style: {
69
71
  display: "flex",
70
72
  flexDirection: "row",
71
- gap: x ? 12 : 4,
72
- borderRightWidth: D ? 1 : 0,
73
- borderRightColor: l.stroke.primary,
73
+ gap: v ? 12 : 4,
74
+ borderRightWidth: s ? 1 : 0,
75
+ borderRightColor: i.stroke.primary,
74
76
  borderRightStyle: "solid",
75
- paddingLeft: y ? 0 : 24,
76
- paddingRight: y ? 0 : 24,
77
+ paddingLeft: h ? 0 : 24,
78
+ paddingRight: h ? 0 : 24,
77
79
  height: "100%",
78
- justifyContent: x ? "flex-start" : "space-between",
80
+ justifyContent: v ? "flex-start" : "space-between",
79
81
  alignItems: "center",
80
- ...H ?? {}
82
+ ...K ?? {}
81
83
  },
82
84
  children: [
83
- !!x && /* @__PURE__ */ t(at, { style: { ...K }, children: /* @__PURE__ */ t(x, {}) }),
84
- /* @__PURE__ */ s(
85
+ !!v && /* @__PURE__ */ t(ct, { style: { ...Q }, children: /* @__PURE__ */ t(v, {}) }),
86
+ /* @__PURE__ */ f(
85
87
  "div",
86
88
  {
87
89
  style: {
@@ -89,10 +91,10 @@ const wt = ({
89
91
  flexDirection: "column",
90
92
  gap: 4,
91
93
  height: "100%",
92
- ...G ?? {}
94
+ ...J ?? {}
93
95
  },
94
96
  children: [
95
- /* @__PURE__ */ s(
97
+ /* @__PURE__ */ f(
96
98
  "div",
97
99
  {
98
100
  style: {
@@ -103,36 +105,44 @@ const wt = ({
103
105
  },
104
106
  children: [
105
107
  /* @__PURE__ */ t(
106
- nt,
108
+ it,
107
109
  {
108
110
  style: {
109
- color: l.content.secondary
111
+ color: i.content.secondary
110
112
  },
111
- children: h
113
+ children: c
112
114
  }
113
115
  ),
114
- b && /* @__PURE__ */ t(V, { body: b, placement: "right", width: 300, children: /* @__PURE__ */ t(
115
- "div",
116
+ u && /* @__PURE__ */ t(
117
+ z,
116
118
  {
117
- style: {
118
- display: "flex",
119
- cursor: "pointer",
120
- height: "100%"
121
- },
119
+ body: u,
120
+ placement: T,
121
+ width: C,
122
122
  children: /* @__PURE__ */ t(
123
- rt,
123
+ "div",
124
124
  {
125
- color: l.content.primary,
126
- height: 16,
127
- width: 16
125
+ style: {
126
+ display: "flex",
127
+ cursor: "pointer",
128
+ height: "100%"
129
+ },
130
+ children: /* @__PURE__ */ t(
131
+ ot,
132
+ {
133
+ color: i.content.primary,
134
+ height: 16,
135
+ width: 16
136
+ }
137
+ )
128
138
  }
129
139
  )
130
140
  }
131
- ) })
141
+ )
132
142
  ]
133
143
  }
134
144
  ),
135
- /* @__PURE__ */ s(
145
+ /* @__PURE__ */ f(
136
146
  "div",
137
147
  {
138
148
  style: {
@@ -140,94 +150,94 @@ const wt = ({
140
150
  flexDirection: "row",
141
151
  gap: 12,
142
152
  alignItems: "center",
143
- ...o ? { justifyContent: "space-between" } : {}
153
+ ...l ? { justifyContent: "space-between" } : {}
144
154
  },
145
155
  children: [
146
- i && /* @__PURE__ */ t(k, { width: 108, height: 26 }),
147
- !i && /* @__PURE__ */ t(
148
- L,
156
+ e && /* @__PURE__ */ t(V, { width: 108, height: 26 }),
157
+ !e && /* @__PURE__ */ t(
158
+ R,
149
159
  {
150
160
  style: {
151
- color: l.content.primary
161
+ color: i.content.primary
152
162
  },
153
- children: Q()
163
+ children: X()
154
164
  }
155
165
  ),
156
- typeof N == "number" && /* @__PURE__ */ t(
157
- C,
166
+ typeof W == "number" && /* @__PURE__ */ t(
167
+ x,
158
168
  {
159
- tagText: `${N}%`,
169
+ tagText: `${W}%`,
160
170
  theme: "light",
161
171
  type: "neutral"
162
172
  }
163
173
  ),
164
- a === "horizontal" && !i && !o && /* @__PURE__ */ t(
165
- _,
174
+ a === "horizontal" && !e && !l && /* @__PURE__ */ t(
175
+ B,
166
176
  {
167
- timeline: n,
168
- customRange: f,
169
- percent: T,
170
- direction: E,
171
- trendRaw: g,
172
- trendRawString: c,
177
+ timeline: o,
178
+ customRange: y,
179
+ percent: w,
180
+ direction: U,
181
+ trendRaw: F,
182
+ trendRawString: N,
173
183
  prefixSymbol: d,
174
- trendIconStyle: z,
175
- isInternationalStore: I,
176
- tooltipTimelineText: S,
177
- customTimelineText: W
184
+ trendIconStyle: S,
185
+ isInternationalStore: j,
186
+ tooltipTimelineText: E,
187
+ customTimelineText: O
178
188
  }
179
189
  ),
180
- i && !o && a === "horizontal" && /* @__PURE__ */ t(k, { height: 20, width: 141, marginTop: 6 }),
181
- a === "vertical" && !i && typeof w < "u" && /* @__PURE__ */ t(
182
- C,
190
+ e && !l && a === "horizontal" && /* @__PURE__ */ t(V, { height: 20, width: 141, marginTop: 6 }),
191
+ a === "vertical" && !e && typeof g < "u" && /* @__PURE__ */ t(
192
+ x,
183
193
  {
184
- tagText: `${w} %`,
194
+ tagText: `${g} %`,
185
195
  theme: "light",
186
196
  type: "neutral"
187
197
  }
188
198
  ),
189
- o && !i && typeof T < "u" && /* @__PURE__ */ t(C, { tagText: `${T} %`, theme: "light", type: "neutral" }),
190
- !o && !i && F && F != 0 ? /* @__PURE__ */ t(
191
- C,
199
+ l && !e && typeof w < "u" && /* @__PURE__ */ t(x, { tagText: `${w} %`, theme: "light", type: "neutral" }),
200
+ !l && !e && I && I != 0 ? /* @__PURE__ */ t(
201
+ x,
192
202
  {
193
- tagText: R(F),
203
+ tagText: Y(I),
194
204
  theme: "light",
195
205
  type: "neutral"
196
206
  }
197
- ) : /* @__PURE__ */ t(Y, {})
207
+ ) : /* @__PURE__ */ t(P, {})
198
208
  ]
199
209
  }
200
210
  ),
201
- a === "vertical" && !i && !o && /* @__PURE__ */ t("div", { style: { marginTop: 10 }, children: /* @__PURE__ */ t(
202
- _,
211
+ a === "vertical" && !e && !l && /* @__PURE__ */ t("div", { style: { marginTop: 10 }, children: /* @__PURE__ */ t(
212
+ B,
203
213
  {
204
- timeline: n,
205
- customRange: f,
206
- percent: T,
207
- direction: E,
208
- trendRaw: g,
209
- trendRawString: c,
214
+ timeline: o,
215
+ customRange: y,
216
+ percent: w,
217
+ direction: U,
218
+ trendRaw: F,
219
+ trendRawString: N,
210
220
  prefixSymbol: d,
211
- trendIconStyle: z,
212
- isInternationalStore: I,
213
- tooltipTimelineText: S,
214
- customTimelineText: W
221
+ trendIconStyle: S,
222
+ isInternationalStore: j,
223
+ tooltipTimelineText: E,
224
+ customTimelineText: O
215
225
  }
216
226
  ) }),
217
- i && a === "vertical" && /* @__PURE__ */ t(k, { height: 20, width: 141, marginTop: 6 })
227
+ e && a === "vertical" && /* @__PURE__ */ t(V, { height: 20, width: 141, marginTop: 6 })
218
228
  ]
219
229
  }
220
230
  ),
221
- p && !i && /* @__PURE__ */ t(V, { body: p, placement: "right", children: v && /* @__PURE__ */ t(
231
+ b && !e && /* @__PURE__ */ t(z, { body: b, placement: "right", children: p && /* @__PURE__ */ t(
222
232
  "div",
223
233
  {
224
234
  "data-test": "analytics-trend-trailing-icon",
225
235
  className: "icon--holder",
226
236
  onClick: M,
227
- children: Z.createElement(v, {
237
+ children: tt.createElement(p, {
228
238
  height: 20,
229
239
  width: 20,
230
- color: l.content.secondary
240
+ color: i.content.secondary
231
241
  })
232
242
  }
233
243
  ) })
@@ -236,42 +246,42 @@ const wt = ({
236
246
  )
237
247
  }
238
248
  );
239
- }, _ = ({
240
- percent: h,
241
- direction: r,
242
- timeline: e,
249
+ }, B = ({
250
+ percent: c,
251
+ direction: n,
252
+ timeline: r,
243
253
  customRange: a,
244
- trendRaw: n,
245
- trendRawString: f,
246
- prefixSymbol: b,
247
- trendIconStyle: y,
248
- isInternationalStore: D,
249
- tooltipTimelineText: $,
250
- customTimelineText: o
254
+ trendRaw: o,
255
+ trendRawString: y,
256
+ prefixSymbol: u,
257
+ trendIconStyle: T,
258
+ isInternationalStore: C,
259
+ tooltipTimelineText: h,
260
+ customTimelineText: s
251
261
  }) => {
252
- const A = () => {
253
- let c = "--";
254
- if (n)
255
- return D ? c = String(
256
- q(Math.abs(n))
257
- ) : c = String(B(Math.abs(n))), n < 0 ? "-" + c : c;
258
- }, d = () => {
259
- const c = ((n ?? 0) > 0 ? "+" : "") + (b ?? "");
260
- return typeof n > "u" ? "--" : `${c ?? ""}${A()}`;
261
- }, [v, M] = O(
262
- d()
263
- ), [p, w] = O(
264
- o || ""
262
+ const D = () => {
263
+ let e = "--";
264
+ if (o)
265
+ return C ? e = String(
266
+ G(Math.abs(o))
267
+ ) : e = String(H(Math.abs(o))), o < 0 ? "-" + e : e;
268
+ }, l = () => {
269
+ const e = ((o ?? 0) > 0 ? "+" : "") + (u ?? "");
270
+ return typeof o > "u" ? "--" : `${e ?? ""}${D()}`;
271
+ }, [A, d] = _(
272
+ l()
273
+ ), [p, M] = _(
274
+ s || ""
265
275
  );
266
- U(() => {
267
- o || w(
268
- e === "today" ? "vs yesterday" : e === "yesterday" ? "vs 1 day before" : e === "7 days" ? "vs last 7 days" : e === "30 days" ? "vs last 30 days" : e === "custom" && a ? P.getAnalyticsCustomDateTimelineText(a) : ""
276
+ q(() => {
277
+ s || M(
278
+ r === "today" ? "vs yesterday" : r === "yesterday" ? "vs 1 day before" : r === "7 days" ? "vs last 7 days" : r === "30 days" ? "vs last 30 days" : r === "custom" && a ? et.getAnalyticsCustomDateTimelineText(a) : ""
269
279
  );
270
- }, [e, a]), U(() => {
271
- M(d());
272
- }, [n]);
273
- const i = r === "negative" ? tt : et, g = r === "negative" ? l.background.negative.vibrant : r === "positive" ? l.background.positive.vibrant : l.content.placeholder;
274
- return /* @__PURE__ */ s(
280
+ }, [r, a]), q(() => {
281
+ d(l());
282
+ }, [o]);
283
+ const b = n === "negative" ? rt : nt, g = n === "negative" ? i.background.negative.vibrant : n === "positive" ? i.background.positive.vibrant : i.content.placeholder;
284
+ return /* @__PURE__ */ f(
275
285
  "div",
276
286
  {
277
287
  style: {
@@ -281,33 +291,33 @@ const wt = ({
281
291
  flexWrap: "wrap"
282
292
  },
283
293
  children: [
284
- typeof h == "number" && /* @__PURE__ */ t(
285
- i,
294
+ typeof c == "number" && /* @__PURE__ */ t(
295
+ b,
286
296
  {
287
297
  color: g,
288
298
  height: 16,
289
299
  width: 16,
290
- style: { marginRight: 2, ...y ?? {} }
300
+ style: { marginRight: 2, ...T ?? {} }
291
301
  }
292
302
  ),
293
- typeof h == "number" && r && /* @__PURE__ */ s(u, { style: { color: g }, children: [
294
- r === "neutral" ? 0 : h < 1e3 ? h : ">999",
303
+ typeof c == "number" && n && /* @__PURE__ */ f(m, { style: { color: g }, children: [
304
+ n === "neutral" ? 0 : c < 1e3 ? c : ">999",
295
305
  "%"
296
306
  ] }),
297
- !!n && /* @__PURE__ */ t(u, { style: { marginLeft: 4, color: l.content.placeholder }, children: `(${v})` }),
298
- !n && (f?.length || 0) > 0 && /* @__PURE__ */ t(u, { style: { marginLeft: 4, color: l.content.placeholder }, children: `${f}` }),
299
- e && ($ ? /* @__PURE__ */ t(V, { body: $, placement: "bottom", children: /* @__PURE__ */ t(
300
- u,
307
+ !!o && /* @__PURE__ */ t(m, { style: { marginLeft: 4, color: i.content.placeholder }, children: `(${A})` }),
308
+ !o && (y?.length || 0) > 0 && /* @__PURE__ */ t(m, { style: { marginLeft: 4, color: i.content.placeholder }, children: `${y}` }),
309
+ r && (h ? /* @__PURE__ */ t(z, { body: h, placement: "bottom", children: /* @__PURE__ */ t(
310
+ m,
301
311
  {
302
- style: { marginLeft: 4, color: l.content.placeholder },
303
- children: o || p
312
+ style: { marginLeft: 4, color: i.content.placeholder },
313
+ children: s || p
304
314
  }
305
- ) }) : /* @__PURE__ */ t(u, { style: { marginLeft: 4, color: l.content.placeholder }, children: o || p }))
315
+ ) }) : /* @__PURE__ */ t(m, { style: { marginLeft: 4, color: i.content.placeholder }, children: s || p }))
306
316
  ]
307
317
  }
308
318
  );
309
319
  };
310
320
  export {
311
- wt as AnalyticsTrend
321
+ Tt as AnalyticsTrend
312
322
  };
313
323
  //# sourceMappingURL=AnalyticsTrend.js.map