@televet/kibble-ui 4.0.0-beta.96 → 4.0.0-beta.97

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 (162) hide show
  1. package/dist/chunks/{alert.types-DeHWvQla.js → alert.types-DEe0eEG4.js} +3 -3
  2. package/dist/chunks/{alert.types-DeHWvQla.js.map → alert.types-DEe0eEG4.js.map} +1 -1
  3. package/dist/chunks/{avatar.component-CV_95YCj.js → avatar.component-CvE1vv5L.js} +5 -5
  4. package/dist/chunks/{avatar.component-CV_95YCj.js.map → avatar.component-CvE1vv5L.js.map} +1 -1
  5. package/dist/chunks/{avatarGroup.component-CPTXS5Mp.js → avatarGroup.component-SoAj9p5n.js} +2 -2
  6. package/dist/chunks/{avatarGroup.component-CPTXS5Mp.js.map → avatarGroup.component-SoAj9p5n.js.map} +1 -1
  7. package/dist/chunks/{buttonGroup.component-BJl5t4CV.js → buttonGroup.component-Bp2YbVtj.js} +2 -2
  8. package/dist/chunks/{buttonGroup.component-BJl5t4CV.js.map → buttonGroup.component-Bp2YbVtj.js.map} +1 -1
  9. package/dist/chunks/{characterCounter.component-C4sKYWJ2.js → characterCounter.component-Lya4VMgB.js} +2 -2
  10. package/dist/chunks/{characterCounter.component-C4sKYWJ2.js.map → characterCounter.component-Lya4VMgB.js.map} +1 -1
  11. package/dist/chunks/{checkbox.component-BpSGOInE.js → checkbox.component-PmkaXzNs.js} +7 -7
  12. package/dist/chunks/{checkbox.component-BpSGOInE.js.map → checkbox.component-PmkaXzNs.js.map} +1 -1
  13. package/dist/chunks/{checkbox.records-CTlAD-2Q.js → checkbox.records-Ds6SvFdm.js} +4 -4
  14. package/dist/chunks/{checkbox.records-CTlAD-2Q.js.map → checkbox.records-Ds6SvFdm.js.map} +1 -1
  15. package/dist/chunks/{checkboxGroup.component-B154cVx5.js → checkboxGroup.component-DXWrZuhZ.js} +3 -3
  16. package/dist/chunks/{checkboxGroup.component-B154cVx5.js.map → checkboxGroup.component-DXWrZuhZ.js.map} +1 -1
  17. package/dist/chunks/{conversationCard.component-DCpGDLwc.js → conversationCard.component-D3WN8rhl.js} +7 -7
  18. package/dist/chunks/{conversationCard.component-DCpGDLwc.js.map → conversationCard.component-D3WN8rhl.js.map} +1 -1
  19. package/dist/chunks/{datePicker.component-DSEMVYWG.js → datePicker.component-BSzcmQ9c.js} +7 -7
  20. package/dist/chunks/{datePicker.component-DSEMVYWG.js.map → datePicker.component-BSzcmQ9c.js.map} +1 -1
  21. package/dist/chunks/{dialog-trigger-eqGXDXGQ.js → dialog-trigger-Crrp0YGG.js} +5 -5
  22. package/dist/chunks/{dialog-trigger-eqGXDXGQ.js.map → dialog-trigger-Crrp0YGG.js.map} +1 -1
  23. package/dist/chunks/{heading.component-BHha3j1I.js → heading.component-73t_EqZx.js} +2 -2
  24. package/dist/chunks/{heading.component-BHha3j1I.js.map → heading.component-73t_EqZx.js.map} +1 -1
  25. package/dist/chunks/{index-C_AXAeNS.js → index-B3d3tRic.js} +4 -4
  26. package/dist/chunks/{index-C_AXAeNS.js.map → index-B3d3tRic.js.map} +1 -1
  27. package/dist/chunks/{index-Cbkb_94C.js → index-BBxAd1xM.js} +3 -3
  28. package/dist/chunks/{index-Cbkb_94C.js.map → index-BBxAd1xM.js.map} +1 -1
  29. package/dist/chunks/{index-CJLttzPM.js → index-BODNpj2d.js} +3 -3
  30. package/dist/chunks/{index-CJLttzPM.js.map → index-BODNpj2d.js.map} +1 -1
  31. package/dist/chunks/{index-cSjUS7Xj.js → index-BRBNqTA7.js} +3 -3
  32. package/dist/chunks/{index-cSjUS7Xj.js.map → index-BRBNqTA7.js.map} +1 -1
  33. package/dist/chunks/{index-Bff1r_rH.js → index-BpQwMKfa.js} +2 -2
  34. package/dist/chunks/{index-Bff1r_rH.js.map → index-BpQwMKfa.js.map} +1 -1
  35. package/dist/chunks/{index-DVNjUEDJ.js → index-C-m6RNXT.js} +4 -4
  36. package/dist/chunks/{index-DVNjUEDJ.js.map → index-C-m6RNXT.js.map} +1 -1
  37. package/dist/chunks/{index-OpolRlgD.js → index-CX3yrbBD.js} +3 -3
  38. package/dist/chunks/{index-OpolRlgD.js.map → index-CX3yrbBD.js.map} +1 -1
  39. package/dist/chunks/{index-DUY19L6M.js → index-CYHDITxm.js} +3196 -1649
  40. package/dist/chunks/index-CYHDITxm.js.map +1 -0
  41. package/dist/chunks/{index-Bz8HDeWA.js → index-Cd-5e4RS.js} +2 -2
  42. package/dist/chunks/{index-Bz8HDeWA.js.map → index-Cd-5e4RS.js.map} +1 -1
  43. package/dist/chunks/index-ClcMgyeA.js +10 -0
  44. package/dist/chunks/index-ClcMgyeA.js.map +1 -0
  45. package/dist/chunks/{index-YtNA0Ueo.js → index-Ztgrae6O.js} +49 -49
  46. package/dist/chunks/{index-YtNA0Ueo.js.map → index-Ztgrae6O.js.map} +1 -1
  47. package/dist/chunks/{index-L197Dry5.js → index-mndLieJA.js} +4 -4
  48. package/dist/chunks/{index-L197Dry5.js.map → index-mndLieJA.js.map} +1 -1
  49. package/dist/chunks/{menu.component-D38vU6MX.js → menu.component-CYoNg8cG.js} +8 -8
  50. package/dist/chunks/{menu.component-D38vU6MX.js.map → menu.component-CYoNg8cG.js.map} +1 -1
  51. package/dist/chunks/{modal.types-mGxpGfVt.js → modal.types-hyW2Nhp9.js} +4 -4
  52. package/dist/chunks/{modal.types-mGxpGfVt.js.map → modal.types-hyW2Nhp9.js.map} +1 -1
  53. package/dist/chunks/{pinInput.types-CD_tKvQm.js → pinInput.types-DI4tGMSB.js} +6 -6
  54. package/dist/chunks/{pinInput.types-CD_tKvQm.js.map → pinInput.types-DI4tGMSB.js.map} +1 -1
  55. package/dist/chunks/{popover-root-provider-BErev2-N.js → popover-root-provider-R2bRQ-xz.js} +4 -4
  56. package/dist/chunks/{popover-root-provider-BErev2-N.js.map → popover-root-provider-R2bRQ-xz.js.map} +1 -1
  57. package/dist/chunks/{popover.component-UkDDe5Dh.js → popover.component-CV6ZJKNL.js} +7 -7
  58. package/dist/chunks/{popover.component-UkDDe5Dh.js.map → popover.component-CV6ZJKNL.js.map} +1 -1
  59. package/dist/chunks/{popover.recipe-DlJtOeLy.js → popover.recipe-DDKba5kq.js} +4 -4
  60. package/dist/chunks/{popover.recipe-DlJtOeLy.js.map → popover.recipe-DDKba5kq.js.map} +1 -1
  61. package/dist/chunks/{radio.records-4ih1q8nO.js → radio.records-muLWVHhG.js} +4 -4
  62. package/dist/chunks/{radio.records-4ih1q8nO.js.map → radio.records-muLWVHhG.js.map} +1 -1
  63. package/dist/chunks/{radioGroup.component-DJsYK4YT.js → radioGroup.component-BUFZGQ-P.js} +7 -7
  64. package/dist/chunks/{radioGroup.component-DJsYK4YT.js.map → radioGroup.component-BUFZGQ-P.js.map} +1 -1
  65. package/dist/chunks/{ratingDots.component-BdUvoShh.js → ratingDots.component-CtmqAmV5.js} +3 -3
  66. package/dist/chunks/{ratingDots.component-BdUvoShh.js.map → ratingDots.component-CtmqAmV5.js.map} +1 -1
  67. package/dist/chunks/{render-strategy-CHp7lb6C.js → render-strategy-D5Z6LZ1V.js} +2 -2
  68. package/dist/chunks/{render-strategy-CHp7lb6C.js.map → render-strategy-D5Z6LZ1V.js.map} +1 -1
  69. package/dist/chunks/{select.component-BNMyz5Nm.js → select.component-Fq8Hh2MP.js} +9 -9
  70. package/dist/chunks/{select.component-BNMyz5Nm.js.map → select.component-Fq8Hh2MP.js.map} +1 -1
  71. package/dist/chunks/{sortableList.component-BKthQS8R.js → sortableList.component-Dl8iDhRd.js} +3 -3
  72. package/dist/chunks/{sortableList.component-BKthQS8R.js.map → sortableList.component-Dl8iDhRd.js.map} +1 -1
  73. package/dist/chunks/{spinner.component-CzTRzWbL.js → spinner.component-katjnJzv.js} +2 -2
  74. package/dist/chunks/{spinner.component-CzTRzWbL.js.map → spinner.component-katjnJzv.js.map} +1 -1
  75. package/dist/chunks/{styledAvatar.types-DXwe2DPH.js → styledAvatar.types-C8U-V56j.js} +2 -2
  76. package/dist/chunks/{styledAvatar.types-DXwe2DPH.js.map → styledAvatar.types-C8U-V56j.js.map} +1 -1
  77. package/dist/chunks/{switch.component-DVHjLc9H.js → switch.component-U2g70Pc5.js} +6 -6
  78. package/dist/chunks/{switch.component-DVHjLc9H.js.map → switch.component-U2g70Pc5.js.map} +1 -1
  79. package/dist/chunks/{tabs.component-b8VxTs-T.js → tabs.component-P5GKt5Sv.js} +5 -5
  80. package/dist/chunks/{tabs.component-b8VxTs-T.js.map → tabs.component-P5GKt5Sv.js.map} +1 -1
  81. package/dist/chunks/{tagBlock.component-CfxiQgjI.js → tagBlock.component-CF3z8rKF.js} +5 -5
  82. package/dist/chunks/{tagBlock.component-CfxiQgjI.js.map → tagBlock.component-CF3z8rKF.js.map} +1 -1
  83. package/dist/chunks/{text.component-DJW--Vty.js → text.component-DKtdjH7k.js} +2 -2
  84. package/dist/chunks/{text.component-DJW--Vty.js.map → text.component-DKtdjH7k.js.map} +1 -1
  85. package/dist/chunks/{textInput.component-evu71Hys.js → textInput.component-DSVsTHqO.js} +6 -6
  86. package/dist/chunks/{textInput.component-evu71Hys.js.map → textInput.component-DSVsTHqO.js.map} +1 -1
  87. package/dist/chunks/{textarea.component-CZQMAMYT.js → textarea.component-Cbo5Vs-6.js} +6 -6
  88. package/dist/chunks/{textarea.component-CZQMAMYT.js.map → textarea.component-Cbo5Vs-6.js.map} +1 -1
  89. package/dist/chunks/{theme.provider-DHvMwBwG.js → theme.provider-BHh_9yV5.js} +1138 -2679
  90. package/dist/chunks/theme.provider-BHh_9yV5.js.map +1 -0
  91. package/dist/chunks/theme.provider-Ey-yIBM6.js +24 -0
  92. package/dist/chunks/theme.provider-Ey-yIBM6.js.map +1 -0
  93. package/dist/chunks/{timePicker.component-DXkOhFKy.js → timePicker.component-BSuNH0Ze.js} +3 -3
  94. package/dist/chunks/{timePicker.component-DXkOhFKy.js.map → timePicker.component-BSuNH0Ze.js.map} +1 -1
  95. package/dist/chunks/{timeRange.component-BTmY7o_y.js → timeRange.component-SMQArMaf.js} +2 -2
  96. package/dist/chunks/{timeRange.component-BTmY7o_y.js.map → timeRange.component-SMQArMaf.js.map} +1 -1
  97. package/dist/chunks/{timestamp.component-DLqT7x-O.js → timestamp.component-DAa3tXHL.js} +3 -3
  98. package/dist/chunks/{timestamp.component-DLqT7x-O.js.map → timestamp.component-DAa3tXHL.js.map} +1 -1
  99. package/dist/chunks/{toaster.records-Bb46MMbZ.js → toaster.records-DcadVT_W.js} +2 -2
  100. package/dist/chunks/{toaster.records-Bb46MMbZ.js.map → toaster.records-DcadVT_W.js.map} +1 -1
  101. package/dist/chunks/{tooltip.component-Cr_en1NQ.js → tooltip.component-XxpjNATA.js} +3 -3
  102. package/dist/chunks/{tooltip.component-Cr_en1NQ.js.map → tooltip.component-XxpjNATA.js.map} +1 -1
  103. package/dist/chunks/{typography.records-H4aA5AOA.js → typography.records-DDZuRT8J.js} +2 -2
  104. package/dist/chunks/{typography.records-H4aA5AOA.js.map → typography.records-DDZuRT8J.js.map} +1 -1
  105. package/dist/chunks/{use-field-context-Cm3grEyV.js → use-field-context-BZaIHuSQ.js} +2 -2
  106. package/dist/chunks/{use-field-context-Cm3grEyV.js.map → use-field-context-BZaIHuSQ.js.map} +1 -1
  107. package/dist/chunks/{use-locale-context-BiiNTYMT.js → use-locale-context-BNU4MHrO.js} +71 -71
  108. package/dist/chunks/{use-locale-context-BiiNTYMT.js.map → use-locale-context-BNU4MHrO.js.map} +1 -1
  109. package/dist/chunks/{withFormControl-l2C92-pT.js → withFormControl-BJbzRb4N.js} +6 -6
  110. package/dist/chunks/{withFormControl-l2C92-pT.js.map → withFormControl-BJbzRb4N.js.map} +1 -1
  111. package/dist/chunks/{withTruncation-CQ7mmyn9.js → withTruncation-CR8pGwFg.js} +2 -2
  112. package/dist/chunks/{withTruncation-CQ7mmyn9.js.map → withTruncation-CR8pGwFg.js.map} +1 -1
  113. package/dist/cjs/chakra/index.cjs +1 -1
  114. package/dist/cjs/chakra/index.cjs.map +1 -1
  115. package/dist/cjs/index.cjs +1 -1
  116. package/dist/cjs/theme/index.cjs +1 -1
  117. package/dist/esm/chakra/index.js +165 -162
  118. package/dist/esm/chakra/index.js.map +1 -1
  119. package/dist/esm/components/Alert/index.js +1 -1
  120. package/dist/esm/components/Avatar/index.js +1 -1
  121. package/dist/esm/components/AvatarGroup/index.js +1 -1
  122. package/dist/esm/components/ButtonGroup/index.js +1 -1
  123. package/dist/esm/components/CharacterCounter/index.js +1 -1
  124. package/dist/esm/components/Checkbox/index.js +1 -1
  125. package/dist/esm/components/CheckboxGroup/index.js +1 -1
  126. package/dist/esm/components/ConversationCard/index.js +1 -1
  127. package/dist/esm/components/DatePicker/index.js +1 -1
  128. package/dist/esm/components/Heading/index.js +1 -1
  129. package/dist/esm/components/Menu/index.js +1 -1
  130. package/dist/esm/components/Modal/index.js +1 -1
  131. package/dist/esm/components/PinInput/index.js +1 -1
  132. package/dist/esm/components/Popover/index.js +1 -1
  133. package/dist/esm/components/RadioGroup/index.js +1 -1
  134. package/dist/esm/components/RatingDots/index.js +1 -1
  135. package/dist/esm/components/Select/index.js +1 -1
  136. package/dist/esm/components/SortableList/index.js +1 -1
  137. package/dist/esm/components/Spinner/index.js +1 -1
  138. package/dist/esm/components/StyledAvatar/index.js +1 -1
  139. package/dist/esm/components/Switch/index.js +1 -1
  140. package/dist/esm/components/Tabs/index.js +1 -1
  141. package/dist/esm/components/TagBlock/index.js +1 -1
  142. package/dist/esm/components/Text/index.js +1 -1
  143. package/dist/esm/components/TextInput/index.js +1 -1
  144. package/dist/esm/components/Textarea/index.js +1 -1
  145. package/dist/esm/components/TimePicker/index.js +1 -1
  146. package/dist/esm/components/TimeRange/index.js +1 -1
  147. package/dist/esm/components/Timestamp/index.js +1 -1
  148. package/dist/esm/components/Toast/index.js +1 -1
  149. package/dist/esm/components/Tooltip/index.js +1 -1
  150. package/dist/esm/components/index.js +30 -30
  151. package/dist/esm/index.js +60 -59
  152. package/dist/esm/theme/index.js +4 -3
  153. package/dist/types/chakra/index.d.ts +1 -1
  154. package/dist/types/theme/index.d.ts +1 -1
  155. package/dist/types/theme/theme.config.d.ts +3 -2
  156. package/package.json +1 -21
  157. package/dist/chunks/index-DUY19L6M.js.map +0 -1
  158. package/dist/chunks/index-iaug4k6v.js +0 -8
  159. package/dist/chunks/index-iaug4k6v.js.map +0 -1
  160. package/dist/chunks/theme.provider-Bt7Zc9PF.js +0 -26
  161. package/dist/chunks/theme.provider-Bt7Zc9PF.js.map +0 -1
  162. package/dist/chunks/theme.provider-DHvMwBwG.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { j as o } from "./jsx-runtime-C5mzlN2N.js";
2
- import { W as Q } from "./text.component-DJW--Vty.js";
3
- import { p as g, f as U } from "./typography.records-H4aA5AOA.js";
2
+ import { W as Q } from "./text.component-DKtdjH7k.js";
3
+ import { p as g, f as U } from "./typography.records-DDZuRT8J.js";
4
4
  import { I as V } from "./icon.component-DszmCnE4.js";
5
5
  import { F as q } from "./flex-smlF8uQG.js";
6
6
  import * as X from "react";
@@ -8,9 +8,9 @@ import { forwardRef as T, useLayoutEffect as Y, useEffect as ee, useState as L,
8
8
  import { c as M, a as B } from "./factory-Ctbv0Ozn.js";
9
9
  import { c as oe } from "./create-slot-recipe-context-BJmsuxih.js";
10
10
  import { c as ae } from "./create-recipe-context-D7FewUR4.js";
11
- import { u as I, F as le } from "./use-field-context-Cm3grEyV.js";
12
- import { f as j, c as ne, a as ie, h as de } from "./use-locale-context-BiiNTYMT.js";
13
- import { a1 as w, F as ce, d as x, k as fe } from "./index-YtNA0Ueo.js";
11
+ import { u as I, F as le } from "./use-field-context-BZaIHuSQ.js";
12
+ import { f as j, c as ne, a as ie, h as de } from "./use-locale-context-BNU4MHrO.js";
13
+ import { a1 as w, F as ce, d as x, k as fe } from "./index-Ztgrae6O.js";
14
14
  const O = T((a, t) => {
15
15
  const r = I(), e = w(r.getErrorTextProps(), a);
16
16
  return r?.invalid ? /* @__PURE__ */ o.jsx(j.span, { ...e, ref: t }) : null;
@@ -349,4 +349,4 @@ const ve = T(function(t, r) {
349
349
  export {
350
350
  Be as w
351
351
  };
352
- //# sourceMappingURL=withFormControl-l2C92-pT.js.map
352
+ //# sourceMappingURL=withFormControl-BJbzRb4N.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withFormControl-l2C92-pT.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from './withFormControl.types';\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from 'react';\nimport { Field } from '@chakra-ui/react/field';\nimport { FormControlLabelPosition, FormControlSize } from './withFormControl.types';\nimport { SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { TypographyVariant } from 'shared/types/typography';\nimport { Text } from 'components/Text/text.component';\nimport { optionalTextSizeMap } from './withFormControl.records';\nimport { fontSizes } from 'theme/tokens/typography/typography.records';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n fullWidth?: boolean;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\n label,\n labelPosition = 'start',\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = 'md',\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text variant={onContrast ? 'subtleOnContrast' : 'subtle'} fontSize={optionalTextSizeMap[size]}>\n {' '}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? '100%' : 'auto'}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon className=\"FormControl__InvalidIcon\" name=\"warningSign\" variant={invalidIconColor} size={size} />\n )}\n </Flex>\n {label && labelPosition === 'end' && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.subtle.contrast' : 'text.subtle'}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,cAAa,GAAIF,CAAK;AAC5D,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,OAAO,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC/D,CAAC;AACDQ,EAAW,cAAc;ACTzB,MAAMC,KAAsB,OAAO,SAAW,MAAcC,IAAkBC,ICAxE,CAACC,IAAkBC,EAAkB,IAAIC,GAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,QAAQ;AACV,CAAC,GCDKC,KAAW,CAAChB,IAAQ,OAAO;AAC/B,QAAMiB,IAAWH,GAAoB,GAC/B,EAAE,KAAAI,GAAK,UAAAC,IAAW,EAAQF,GAAU,UAAW,SAAAG,IAAU,IAAO,UAAAC,IAAW,IAAO,UAAAC,IAAW,GAAO,IAAGtB,GACvG,CAACuB,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,3,4,5,6,7,8,9]}
1
+ {"version":3,"file":"withFormControl-BJbzRb4N.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from './withFormControl.types';\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from 'react';\nimport { Field } from '@chakra-ui/react/field';\nimport { FormControlLabelPosition, FormControlSize } from './withFormControl.types';\nimport { SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { TypographyVariant } from 'shared/types/typography';\nimport { Text } from 'components/Text/text.component';\nimport { optionalTextSizeMap } from './withFormControl.records';\nimport { fontSizes } from 'theme/tokens/typography/typography.records';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n fullWidth?: boolean;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\n label,\n labelPosition = 'start',\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = 'md',\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text variant={onContrast ? 'subtleOnContrast' : 'subtle'} fontSize={optionalTextSizeMap[size]}>\n {' '}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? '100%' : 'auto'}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon className=\"FormControl__InvalidIcon\" name=\"warningSign\" variant={invalidIconColor} size={size} />\n )}\n </Flex>\n {label && labelPosition === 'end' && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.subtle.contrast' : 'text.subtle'}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,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;AAAA,gBAAAE,KAASC,MAAkB,WAAWO;AAAA,gBACvCC,gBAAAA,EAAAA,KAACM,GAAK,EAAA,WAAU,wBAAuB,YAAW,UAAS,KAAK,GAAG,GAAGjB,IAAc,gBAAgB,QAClG,UAAA;AAAA,kBAAAjG,gBAAAA,EAAA;AAAA,oBAAC2F;AAAA,oBAAA;AAAA,sBACC,UAAA9E;AAAA,sBACA,SAAAC;AAAA,sBACA,YAAAwF;AAAA,sBACA,UAAAvF;AAAA,sBACA,UAAAC;AAAA,sBACA,MAAAwF;AAAA,sBACC,GAAI9G;AAAA,oBAAA;AAAA,kBACP;AAAA,kBACC+G,KAAkB3F,KACjBd,gBAAAA,MAAC2D,GAAK,EAAA,WAAU,4BAA2B,MAAK,eAAc,SAASuC,GAAkB,MAAAM,EAAY,CAAA;AAAA,gBAAA,GAEzG;AAAA,gBACCL,KAASC,MAAkB,SAASO;AAAA,cAAA;AAAA,YAAA;AAAA,UACvC;AAAA,UACCD,KAAkB5F,KACjBd,gBAAAA,EAAA;AAAA,YAACmF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOmB,IAAa,yBAAyB;AAAA,cAE5C,UAAAT;AAAA,YAAA;AAAA,UACH;AAAA,UAEDG,KACChG,gBAAAA,EAAA;AAAA,YAACkF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOoB,IAAa,yBAAyB;AAAA,cAE5C,UAAAN;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AAEA,SAAAJ,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IACjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
@@ -1,6 +1,6 @@
1
1
  import { j as n } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { memo as m, useState as w, useRef as x, useCallback as h, useEffect as g } from "react";
3
- import { T as k } from "./tooltip.component-Cr_en1NQ.js";
3
+ import { T as k } from "./tooltip.component-XxpjNATA.js";
4
4
  import { B as v } from "./box-Ck9I7FYv.js";
5
5
  const N = (i) => {
6
6
  const l = m(i);
@@ -64,4 +64,4 @@ const N = (i) => {
64
64
  export {
65
65
  N as w
66
66
  };
67
- //# sourceMappingURL=withTruncation-CQ7mmyn9.js.map
67
+ //# sourceMappingURL=withTruncation-CR8pGwFg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withTruncation-CQ7mmyn9.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useRef, useState, memo } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Tooltip, TooltipProps } from 'components/Tooltip';\n\nexport interface WithTruncationProps {\n truncated?: boolean;\n noOfLines?: number;\n tooltipProps?: Omit<TooltipProps, 'disabled'>;\n children?: ReactNode | string;\n}\n\nexport const withTruncation = <P extends WithTruncationProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const MemoizedComponent = memo(Component);\n\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (containerRef.current) {\n const textScrollHeight = containerRef.current?.children[0].scrollHeight || 0;\n const containerOffsetHeight = containerRef.current?.offsetHeight || 0;\n setIsTextOverFlowing(textScrollHeight > containerOffsetHeight);\n }\n }, []);\n\n useEffect(() => {\n if (truncated && containerRef.current) {\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n\n resizeObserverRef.current.observe(containerRef.current);\n checkOverflow(); // Initial check\n\n return (): void => {\n window.clearTimeout(timeoutId);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }\n }, [truncated, checkOverflow]);\n\n if (!truncated) {\n return <MemoizedComponent {...(rest as P)}>{children}</MemoizedComponent>;\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipProps?.label || children?.toLocaleString() || ''}\n disabled={!isTextOverFlowing}\n data-testid=\"kibble-truncated-text-tooltip\"\n >\n <Box\n ref={containerRef}\n display=\"inline-block\"\n position=\"relative\"\n className=\"TruncatedText__Wrapper\"\n data-testid=\"kibble-truncated-text-wrapper\"\n >\n <MemoizedComponent\n className=\"TruncatedText__TextContent\"\n data-testid=\"kibble-truncated-text-content\"\n lineClamp={noOfLines}\n {...(rest as P)}\n >\n {children}\n </MemoizedComponent>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name}`;\n return memo(WithTruncation);\n};\n"],"names":["withTruncation","Component","MemoizedComponent","memo","WithTruncation","truncated","noOfLines","children","tooltipProps","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","resizeObserverRef","checkOverflow","useCallback","textScrollHeight","containerOffsetHeight","useEffect","timeoutId","debouncedCheck","jsx","Tooltip","Box"],"mappings":";;;;AAWa,MAAAA,IAAiB,CAAgCC,MAAmD;AACzG,QAAAC,IAAoBC,EAAKF,CAAS;AAExC,WAASG,EAAe;AAAA,IACtB,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GACsC;AACzC,UAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAK,GACnEC,IAAeC,EAAuB,IAAI,GAC1CC,IAAoBD,EAA8B,IAAI,GAEtDE,IAAgBC,EAAY,MAAM;AACtC,UAAIJ,EAAa,SAAS;AACxB,cAAMK,IAAmBL,EAAa,SAAS,SAAS,CAAC,EAAE,gBA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c,kBAAkBH,EAAU,eAAeA,EAAU,IAAI,IAC/EE,EAAKC,CAAc;AAC5B;"}
1
+ {"version":3,"file":"withTruncation-CR8pGwFg.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useRef, useState, memo } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Tooltip, TooltipProps } from 'components/Tooltip';\n\nexport interface WithTruncationProps {\n truncated?: boolean;\n noOfLines?: number;\n tooltipProps?: Omit<TooltipProps, 'disabled'>;\n children?: ReactNode | string;\n}\n\nexport const withTruncation = <P extends WithTruncationProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const MemoizedComponent = memo(Component);\n\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (containerRef.current) {\n const textScrollHeight = containerRef.current?.children[0].scrollHeight || 0;\n const containerOffsetHeight = containerRef.current?.offsetHeight || 0;\n setIsTextOverFlowing(textScrollHeight > containerOffsetHeight);\n }\n }, []);\n\n useEffect(() => {\n if (truncated && containerRef.current) {\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n\n resizeObserverRef.current.observe(containerRef.current);\n checkOverflow(); // Initial check\n\n return (): void => {\n window.clearTimeout(timeoutId);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }\n }, [truncated, checkOverflow]);\n\n if (!truncated) {\n return <MemoizedComponent {...(rest as P)}>{children}</MemoizedComponent>;\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipProps?.label || children?.toLocaleString() || ''}\n disabled={!isTextOverFlowing}\n data-testid=\"kibble-truncated-text-tooltip\"\n >\n <Box\n ref={containerRef}\n display=\"inline-block\"\n position=\"relative\"\n className=\"TruncatedText__Wrapper\"\n data-testid=\"kibble-truncated-text-wrapper\"\n >\n <MemoizedComponent\n className=\"TruncatedText__TextContent\"\n data-testid=\"kibble-truncated-text-content\"\n lineClamp={noOfLines}\n {...(rest as P)}\n >\n {children}\n </MemoizedComponent>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name}`;\n return memo(WithTruncation);\n};\n"],"names":["withTruncation","Component","MemoizedComponent","memo","WithTruncation","truncated","noOfLines","children","tooltipProps","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","resizeObserverRef","checkOverflow","useCallback","textScrollHeight","containerOffsetHeight","useEffect","timeoutId","debouncedCheck","jsx","Tooltip","Box"],"mappings":";;;;AAWa,MAAAA,IAAiB,CAAgCC,MAAmD;AACzG,QAAAC,IAAoBC,EAAKF,CAAS;AAExC,WAASG,EAAe;AAAA,IACtB,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GACsC;AACzC,UAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAK,GACnEC,IAAeC,EAAuB,IAAI,GAC1CC,IAAoBD,EAA8B,IAAI,GAEtDE,IAAgBC,EAAY,MAAM;AACtC,UAAIJ,EAAa,SAAS;AACxB,cAAMK,IAAmBL,EAAa,SAAS,SAAS,CAAC,EAAE,gBAAgB,GACrEM,IAAwBN,EAAa,SAAS,gBAAgB;AACpE,QAAAF,EAAqBO,IAAmBC,CAAqB;AAAA,MAAA;AAAA,IAEjE,GAAG,EAAE;AA2BL,WAzBAC,EAAU,MAAM;AACV,UAAAf,KAAaQ,EAAa,SAAS;AACjC,YAAAQ;AAEJ,cAAMC,IAAiB,MAAY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