@economic/taco 1.1.9-alpha.0 → 1.1.9-alpha.1

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 (33) hide show
  1. package/dist/components/Tour/Tour.d.ts +2 -0
  2. package/dist/esm/components/Badge/Badge.js +14 -14
  3. package/dist/esm/components/Badge/Badge.js.map +1 -1
  4. package/dist/esm/components/Calendar/Calendar.js +71 -56
  5. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  6. package/dist/esm/components/Card/Card.js +12 -13
  7. package/dist/esm/components/Card/Card.js.map +1 -1
  8. package/dist/esm/components/Checkbox/Checkbox.js +18 -15
  9. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  10. package/dist/esm/components/Combobox/Combobox.js +25 -23
  11. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  12. package/dist/esm/components/Datepicker/Datepicker.js +52 -48
  13. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  14. package/dist/esm/components/Dialog/Dialog.js +58 -39
  15. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  16. package/dist/esm/components/Field/Field.js +12 -10
  17. package/dist/esm/components/Field/Field.js.map +1 -1
  18. package/dist/esm/components/Form/Form.js +8 -6
  19. package/dist/esm/components/Form/Form.js.map +1 -1
  20. package/dist/esm/components/Group/Group.js +8 -6
  21. package/dist/esm/components/Group/Group.js.map +1 -1
  22. package/dist/esm/components/Hanger/Hanger.js +35 -27
  23. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  24. package/dist/esm/components/Tour/Tour.js +2 -0
  25. package/dist/esm/components/Tour/Tour.js.map +1 -1
  26. package/dist/taco.cjs.development.js +306 -259
  27. package/dist/taco.cjs.development.js.map +1 -1
  28. package/dist/taco.cjs.production.min.js +1 -1
  29. package/dist/taco.cjs.production.min.js.map +1 -1
  30. package/dist/utils/tailwind.d.ts +1 -1
  31. package/package.json +2 -2
  32. package/tailwind.config.js +1 -1
  33. package/types.json +7 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Tour.js","sources":["../../../../src/components/Tour/Tour.tsx"],"sourcesContent":["import keycode from 'keycode';\r\nimport * as React from 'react';\r\nimport Joyride, { Step, CallBackProps, ACTIONS, LIFECYCLE, Placement, EVENTS, TooltipRenderProps } from 'react-joyride';\r\n\r\nimport { Button } from '../Button/Button';\r\nimport { Group } from '../Group/Group';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport { useLocalization } from '../Provider/Provider';\r\n\r\nexport type TourTexts = {\r\n /** Text for back action button */\r\n back: string;\r\n /**\r\n * Text for close button.\r\n * This button is displayed if tour is not continuous - replacing the `Next` button.\r\n * It will pause the flow of the tour and close the tooltip\r\n */\r\n close: string;\r\n /**\r\n * Aria-label and title for close icon button in each step.\r\n * This button skips and completes the flow entirely\r\n */\r\n skip: string;\r\n /**\r\n * Text for last action button.\r\n * This button is displayed when user is on the last step of the tour\r\n */\r\n last: string;\r\n /**\r\n * Text for next action button.\r\n * This button is displayed if tour has more than one steps and is continuous\r\n */\r\n next: string;\r\n /** Aria label and title for beacon that will open the tour step */\r\n open: string;\r\n};\r\n\r\nexport type TourStepProps = {\r\n /** Content can be any valid react node, for e.g. a `div` */\r\n children: React.ReactNode;\r\n /** Define the position of the tour's popup relative to the element is presenting */\r\n position?: Placement;\r\n /** The css selector of the html element you want to include in a tour */\r\n selector: string;\r\n /**\r\n * Show beacon for step.\r\n * A beacon is a styled component which indicates the current element to be presented.\r\n * For more informations about how to create a beacon, read [Joyride](https://docs.react-joyride.com) docs\r\n */\r\n showBeacon?: boolean;\r\n /** Text displayed above the children/content of the popup */\r\n title: string;\r\n};\r\n\r\nconst Tooltip = ({\r\n continuous,\r\n index,\r\n isLastStep,\r\n step,\r\n backProps,\r\n primaryProps,\r\n skipProps,\r\n tooltipProps,\r\n size,\r\n locale,\r\n disableTourSkipOnEsc,\r\n}: TooltipRenderProps & { locale: TourTexts; disableTourSkipOnEsc?: boolean }) => {\r\n const skipButtonRef = React.useRef<HTMLButtonElement>(null);\r\n\r\n React.useEffect(() => {\r\n const onWindowKeyDown = (event: KeyboardEvent): void => {\r\n if (!disableTourSkipOnEsc) {\r\n if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {\r\n event.preventDefault();\r\n skipButtonRef.current.click();\r\n return;\r\n }\r\n }\r\n };\r\n\r\n window.addEventListener('keydown', onWindowKeyDown);\r\n\r\n return () => {\r\n window.removeEventListener('keydown', onWindowKeyDown);\r\n };\r\n }, []);\r\n\r\n return (\r\n <div {...tooltipProps} className=\"yt-tour__step w-88 relative rounded bg-white p-4\">\r\n <IconButton\r\n {...skipProps}\r\n ref={skipButtonRef}\r\n appearance=\"discrete\"\r\n icon=\"close\"\r\n title={locale.skip}\r\n aria-label={locale.skip}\r\n className=\"absolute top-0 right-0 mt-1 mr-1\"\r\n />\r\n {step.title && <h5>{step.title}</h5>}\r\n {step.content}\r\n <Group className=\"mt-4 justify-end\">\r\n {index > 0 && (\r\n <Button {...backProps} appearance=\"discrete\">\r\n {locale.back}\r\n </Button>\r\n )}\r\n <Button {...primaryProps} appearance=\"primary\">\r\n {continuous\r\n ? isLastStep\r\n ? `${locale.last} (${index + 1}/${size})`\r\n : `${locale.next} (${index + 1}/${size})`\r\n : locale.close}\r\n </Button>\r\n </Group>\r\n </div>\r\n );\r\n};\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nexport const TourStep = (_props: TourStepProps): null => null;\r\n\r\nexport type TourProps = {\r\n /** Controls if [Joyride](https://docs.react-joyride.com) is active */\r\n autoStart?: boolean;\r\n /** Children should be one or more `Tour.Step` components */\r\n children: any;\r\n /** Are there more than one steps and should you be able to navigate between them using `Next` and `Previous` buttons */\r\n continuous?: boolean;\r\n /** Disable closing of tour when click on `Escape` */\r\n disableCloseOnEsc?: boolean;\r\n /** Don't close the presenting popup of the tour step when clicking outside it */\r\n disableOverlayClose?: boolean;\r\n /** Allows user to interact with the presented components (mouse and touch events) when the popup is visible */\r\n disableScrolling?: boolean;\r\n /* When user clicks on the close icon button, which will close the tour and complete the flow */\r\n onClose?: (step: TourStepProps) => void;\r\n /* When user completes the entire flow */\r\n onComplete?: Function;\r\n /** When step is ready */\r\n onReady?: (step: TourStepProps) => void;\r\n /* Allow mouse and touch events through the spotlight */\r\n spotlightClicks?: boolean;\r\n /* Stops the injection of custom overflow styles on parent container. Can be used to prevent remaining overflow styles after tour is done. */\r\n disableScrollParentFix?: boolean;\r\n};\r\n\r\nexport const Tour = (props: TourProps) => {\r\n const {\r\n texts: { tour },\r\n } = useLocalization();\r\n\r\n const {\r\n autoStart: run,\r\n onComplete,\r\n onClose,\r\n onReady,\r\n spotlightClicks,\r\n disableCloseOnEsc: disableTourSkipOnEsc,\r\n disableScrollParentFix = false,\r\n ...rest\r\n } = props;\r\n\r\n const steps = React.useMemo(() => {\r\n return React.Children.map(props.children, child => {\r\n const step: Step = {\r\n disableBeacon: !child.props.showBeacon,\r\n target: child.props.selector,\r\n placement: child.props.position,\r\n title: child.props.title,\r\n content: child.props.children,\r\n };\r\n return step;\r\n });\r\n }, [props.children]);\r\n\r\n const getStep = React.useCallback(\r\n (selector: string | HTMLElement) => props.children.find((child: any) => child.props.selector === selector)?.props,\r\n [props.children]\r\n );\r\n\r\n function callback(state: CallBackProps) {\r\n if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {\r\n if (onClose) {\r\n onClose(getStep(state.step.target));\r\n }\r\n }\r\n\r\n if (state.type === EVENTS.TOUR_END) {\r\n if (onComplete) {\r\n onComplete();\r\n }\r\n }\r\n\r\n if (state.lifecycle === LIFECYCLE.READY) {\r\n if (onReady) {\r\n onReady(getStep(state.step.target));\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <Joyride\r\n {...rest}\r\n run={run}\r\n steps={steps}\r\n showProgress\r\n floaterProps={{\r\n disableAnimation: true,\r\n }}\r\n tooltipComponent={tooltipProps => (\r\n <Tooltip {...tooltipProps} locale={tour} disableTourSkipOnEsc={disableTourSkipOnEsc} />\r\n )}\r\n locale={tour}\r\n spotlightPadding={8}\r\n spotlightClicks={spotlightClicks}\r\n disableScrollParentFix={disableScrollParentFix}\r\n callback={callback}\r\n styles={{\r\n /** style beacon */\r\n options: {\r\n // tailwind.theme.colors.blue.light\r\n primaryColor: '#6ba4ff',\r\n },\r\n }}\r\n disableCloseOnEsc\r\n />\r\n );\r\n};\r\n\r\nTour.Step = TourStep;\r\n"],"names":["Tooltip","continuous","index","isLastStep","step","backProps","primaryProps","skipProps","tooltipProps","size","locale","disableTourSkipOnEsc","skipButtonRef","React","onWindowKeyDown","event","keyCode","keycode","current","preventDefault","click","window","addEventListener","removeEventListener","className","IconButton","ref","appearance","icon","title","skip","content","Group","Button","back","last","next","close","TourStep","_props","Tour","props","texts","tour","useLocalization","autoStart","run","onComplete","onClose","onReady","spotlightClicks","disableCloseOnEsc","disableScrollParentFix","rest","steps","map","children","child","disableBeacon","showBeacon","target","selector","placement","position","getStep","find","callback","state","action","ACTIONS","SKIP","lifecycle","LIFECYCLE","COMPLETE","type","EVENTS","TOUR_END","READY","Joyride","showProgress","floaterProps","disableAnimation","tooltipComponent","spotlightPadding","styles","options","primaryColor","Step"],"mappings":";;;;;;;;AAsDA,MAAMA,OAAO,GAAG,CAAC;EACbC,UADa;EAEbC,KAFa;EAGbC,UAHa;EAIbC,IAJa;EAKbC,SALa;EAMbC,YANa;EAObC,SAPa;EAQbC,YARa;EASbC,IATa;EAUbC,MAVa;EAWbC;AAXa,CAAD;EAaZ,MAAMC,aAAa,GAAGC,MAAA,CAAgC,IAAhC,CAAtB;EAEAA,SAAA,CAAgB;IACZ,MAAMC,eAAe,GAAIC,KAAD;MACpB,IAAI,CAACJ,oBAAL,EAA2B;QACvB,IAAII,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,KAAD,CAAzB,IAAoCL,aAAa,CAACM,OAAd,KAA0B,IAAlE,EAAwE;UACpEH,KAAK,CAACI,cAAN;UACAP,aAAa,CAACM,OAAd,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MACrC,IAAI5B,OAAJ,EAAa;QACTA,OAAO,CAACe,OAAO,CAACG,KAAK,CAAC/D,IAAN,CAAWwD,MAAZ,CAAR,CAAP;;;;;EAKZ,OACI/C,aAAA,CAACiE,OAAD,oBACQzB;IACJP,GAAG,EAAEA;IACLQ,KAAK,EAAEA;IACPyB,YAAY;IACZC,YAAY,EAAE;MACVC,gBAAgB,EAAE;;IAEtBC,gBAAgB,EAAE1E,YAAY,IAC1BK,aAAA,CAACb,OAAD,oBAAaQ;MAAcE,MAAM,EAAEiC;MAAMhC,oBAAoB,EAAEA;MAA/D;IAEJD,MAAM,EAAEiC;IACRwC,gBAAgB,EAAE;IAClBjC,eAAe,EAAEA;IACjBE,sBAAsB,EAAEA;IACxBc,QAAQ,EAAEA;IACVkB,MAAM,EAAE;;MAEJC,OAAO,EAAE;;QAELC,YAAY,EAAE;;;IAGtBnC,iBAAiB;IAvBrB,CADJ;AA2BH;AAEDX,IAAI,CAAC+C,IAAL,GAAYjD,QAAZ;;;;"}
1
+ {"version":3,"file":"Tour.js","sources":["../../../../src/components/Tour/Tour.tsx"],"sourcesContent":["import keycode from 'keycode';\r\nimport * as React from 'react';\r\nimport Joyride, { Step, CallBackProps, ACTIONS, LIFECYCLE, Placement, EVENTS, TooltipRenderProps } from 'react-joyride';\r\n\r\nimport { Button } from '../Button/Button';\r\nimport { Group } from '../Group/Group';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport { useLocalization } from '../Provider/Provider';\r\n\r\nexport type TourTexts = {\r\n /** Text for back action button */\r\n back: string;\r\n /**\r\n * Text for close button.\r\n * This button is displayed if tour is not continuous - replacing the `Next` button.\r\n * It will pause the flow of the tour and close the tooltip\r\n */\r\n close: string;\r\n /**\r\n * Aria-label and title for close icon button in each step.\r\n * This button skips and completes the flow entirely\r\n */\r\n skip: string;\r\n /**\r\n * Text for last action button.\r\n * This button is displayed when user is on the last step of the tour\r\n */\r\n last: string;\r\n /**\r\n * Text for next action button.\r\n * This button is displayed if tour has more than one steps and is continuous\r\n */\r\n next: string;\r\n /** Aria label and title for beacon that will open the tour step */\r\n open: string;\r\n};\r\n\r\nexport type TourStepProps = {\r\n /** Content can be any valid react node, for e.g. a `div` */\r\n children: React.ReactNode;\r\n /** Define the position of the tour's popup relative to the element is presenting */\r\n position?: Placement;\r\n /** The css selector of the html element you want to include in a tour */\r\n selector: string;\r\n /**\r\n * Show beacon for step.\r\n * A beacon is a styled component which indicates the current element to be presented.\r\n * For more informations about how to create a beacon, read [Joyride](https://docs.react-joyride.com) docs\r\n */\r\n showBeacon?: boolean;\r\n /** Text displayed above the children/content of the popup */\r\n title: string;\r\n};\r\n\r\nconst Tooltip = ({\r\n continuous,\r\n index,\r\n isLastStep,\r\n step,\r\n backProps,\r\n primaryProps,\r\n skipProps,\r\n tooltipProps,\r\n size,\r\n locale,\r\n disableTourSkipOnEsc,\r\n}: TooltipRenderProps & { locale: TourTexts; disableTourSkipOnEsc?: boolean }) => {\r\n const skipButtonRef = React.useRef<HTMLButtonElement>(null);\r\n\r\n React.useEffect(() => {\r\n const onWindowKeyDown = (event: KeyboardEvent): void => {\r\n if (!disableTourSkipOnEsc) {\r\n if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {\r\n event.preventDefault();\r\n skipButtonRef.current.click();\r\n return;\r\n }\r\n }\r\n };\r\n\r\n window.addEventListener('keydown', onWindowKeyDown);\r\n\r\n return () => {\r\n window.removeEventListener('keydown', onWindowKeyDown);\r\n };\r\n }, []);\r\n\r\n return (\r\n <div {...tooltipProps} className=\"yt-tour__step w-88 relative rounded bg-white p-4\">\r\n <IconButton\r\n {...skipProps}\r\n ref={skipButtonRef}\r\n appearance=\"discrete\"\r\n icon=\"close\"\r\n title={locale.skip}\r\n aria-label={locale.skip}\r\n className=\"absolute top-0 right-0 mt-1 mr-1\"\r\n />\r\n {step.title && <h5>{step.title}</h5>}\r\n {step.content}\r\n <Group className=\"mt-4 justify-end\">\r\n {index > 0 && (\r\n <Button {...backProps} appearance=\"discrete\">\r\n {locale.back}\r\n </Button>\r\n )}\r\n <Button {...primaryProps} appearance=\"primary\">\r\n {continuous\r\n ? isLastStep\r\n ? `${locale.last} (${index + 1}/${size})`\r\n : `${locale.next} (${index + 1}/${size})`\r\n : locale.close}\r\n </Button>\r\n </Group>\r\n </div>\r\n );\r\n};\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nexport const TourStep = (_props: TourStepProps): null => null;\r\n\r\nexport type TourProps = {\r\n /** Controls if [Joyride](https://docs.react-joyride.com) is active */\r\n autoStart?: boolean;\r\n /** Children should be one or more `Tour.Step` components */\r\n children: any;\r\n /** Are there more than one steps and should you be able to navigate between them using `Next` and `Previous` buttons */\r\n continuous?: boolean;\r\n /** Disable closing of tour when click on `Escape` */\r\n disableCloseOnEsc?: boolean;\r\n /** Don't close the presenting popup of the tour step when clicking outside it */\r\n disableOverlayClose?: boolean;\r\n /** Allows user to interact with the presented components (mouse and touch events) when the popup is visible */\r\n disableScrolling?: boolean;\r\n /* When user clicks on the close icon button, which will close the tour and complete the flow */\r\n onClose?: (step: TourStepProps) => void;\r\n /* When user completes the entire flow */\r\n onComplete?: Function;\r\n /** When step is ready */\r\n onReady?: (step: TourStepProps) => void;\r\n /* Allow mouse and touch events through the spotlight */\r\n spotlightClicks?: boolean;\r\n /* Stops the injection of custom overflow styles on parent container. Can be used to prevent remaining overflow styles after tour is done. */\r\n disableScrollParentFix?: boolean;\r\n /** The scroll distance from the element scrollTop value. */\r\n scrollOffset?: number;\r\n};\r\n\r\nexport const Tour = (props: TourProps) => {\r\n const {\r\n texts: { tour },\r\n } = useLocalization();\r\n\r\n const {\r\n autoStart: run,\r\n onComplete,\r\n onClose,\r\n onReady,\r\n spotlightClicks,\r\n disableCloseOnEsc: disableTourSkipOnEsc,\r\n disableScrollParentFix = false,\r\n scrollOffset,\r\n ...rest\r\n } = props;\r\n\r\n const steps = React.useMemo(() => {\r\n return React.Children.map(props.children, child => {\r\n const step: Step = {\r\n disableBeacon: !child.props.showBeacon,\r\n target: child.props.selector,\r\n placement: child.props.position,\r\n title: child.props.title,\r\n content: child.props.children,\r\n };\r\n return step;\r\n });\r\n }, [props.children]);\r\n\r\n const getStep = React.useCallback(\r\n (selector: string | HTMLElement) => props.children.find((child: any) => child.props.selector === selector)?.props,\r\n [props.children]\r\n );\r\n\r\n function callback(state: CallBackProps) {\r\n if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {\r\n if (onClose) {\r\n onClose(getStep(state.step.target));\r\n }\r\n }\r\n\r\n if (state.type === EVENTS.TOUR_END) {\r\n if (onComplete) {\r\n onComplete();\r\n }\r\n }\r\n\r\n if (state.lifecycle === LIFECYCLE.READY) {\r\n if (onReady) {\r\n onReady(getStep(state.step.target));\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <Joyride\r\n {...rest}\r\n run={run}\r\n steps={steps}\r\n showProgress\r\n floaterProps={{\r\n disableAnimation: true,\r\n }}\r\n tooltipComponent={tooltipProps => (\r\n <Tooltip {...tooltipProps} locale={tour} disableTourSkipOnEsc={disableTourSkipOnEsc} />\r\n )}\r\n locale={tour}\r\n spotlightPadding={8}\r\n spotlightClicks={spotlightClicks}\r\n disableScrollParentFix={disableScrollParentFix}\r\n callback={callback}\r\n scrollOffset={scrollOffset}\r\n styles={{\r\n /** style beacon */\r\n options: {\r\n // tailwind.theme.colors.blue.light\r\n primaryColor: '#6ba4ff',\r\n },\r\n }}\r\n disableCloseOnEsc\r\n />\r\n );\r\n};\r\n\r\nTour.Step = TourStep;\r\n"],"names":["Tooltip","continuous","index","isLastStep","step","backProps","primaryProps","skipProps","tooltipProps","size","locale","disableTourSkipOnEsc","skipButtonRef","React","onWindowKeyDown","event","keyCode","keycode","current","preventDefault","click","window","addEventListener","removeEventListener","className","IconButton","ref","appearance","icon","title","skip","content","Group","Button","back","last","next","close","TourStep","_props","Tour","props","texts","tour","useLocalization","autoStart","run","onComplete","onClose","onReady","spotlightClicks","disableCloseOnEsc","disableScrollParentFix","scrollOffset","rest","steps","map","children","child","disableBeacon","showBeacon","target","selector","placement","position","getStep","find","callback","state","action","ACTIONS","SKIP","lifecycle","LIFECYCLE","COMPLETE","type","EVENTS","TOUR_END","READY","Joyride","showProgress","floaterProps","disableAnimation","tooltipComponent","spotlightPadding","styles","options","primaryColor","Step"],"mappings":";;;;;;;;AAsDA,MAAMA,OAAO,GAAG,CAAC;EACbC,UADa;EAEbC,KAFa;EAGbC,UAHa;EAIbC,IAJa;EAKbC,SALa;EAMbC,YANa;EAObC,SAPa;EAQbC,YARa;EASbC,IATa;EAUbC,MAVa;EAWbC;AAXa,CAAD;EAaZ,MAAMC,aAAa,GAAGC,MAAA,CAAgC,IAAhC,CAAtB;EAEAA,SAAA,CAAgB;IACZ,MAAMC,eAAe,GAAIC,KAAD;MACpB,IAAI,CAACJ,oBAAL,EAA2B;QACvB,IAAII,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,KAAD,CAAzB,IAAoCL,aAAa,CAACM,OAAd,KAA0B,IAAlE,EAAwE;UACpEH,KAAK,CAACI,cAAN;UACAP,aAAa,CAACM,OAAd,CAAsBE,KAAtB;UACA;;;KALZ;;IAUAC,MAAM,CAACC,gBAAP,CAAwB,SAAxB,EAAmCR,eAAnC;IAEA,OAAO;MACHO,MAAM,CAACE,mBAAP,CAA2B,SAA3B,EAAsCT,eAAtC;KADJ;GAbJ,EAgBG,EAhBH;EAkBA,OACID,aAAA,MAAA,oBAASL;IAAcgB,SAAS,EAAC;IAAjC,EACIX,aAAA,CAACY,UAAD,oBACQlB;IACJmB,GAAG,EAAEd;IACLe,UAAU,EAAC;IACXC,IAAI,EAAC;IACLC,KAAK,EAAEnB,MAAM,CAACoB;kBACFpB,MAAM,CAACoB;IACnBN,SAAS,EAAC;IAPd,CADJ,EAUKpB,IAAI,CAACyB,KAAL,IAAchB,aAAA,KAAA,MAAA,EAAKT,IAAI,CAACyB,KAAV,CAVnB,EAWKzB,IAAI,CAAC2B,OAXV,EAYIl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