taro-react-uilib 1.4.22-1 → 1.4.22
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.
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/font/iconfont.ttf +0 -0
- package/dist/styles/components/font/iconfont.woff +0 -0
- package/dist/styles/components/font/iconfont.woff2 +0 -0
- package/dist/styles/components/icon.scss +5 -1
- package/package.json +1 -1
- package/types/components/Icon/index.d.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"classnames";import{View as a,CheckboxGroup as c}from"@tarojs/components";import
|
|
1
|
+
import e from"react";import t from"classnames";import{View as a,CheckboxGroup as c,Label as l,Checkbox as r}from"@tarojs/components";import s from"../src/hooks/useGenerateId.js";import{pxTransform as o}from"../src/utils/index.js";import n from"./Group/index.js";var i=function(n){var i=n.className,h=n.name,m=n.label,p=n.id,d=n.circle,u=n.onChange,x=n.align,v=n.direction,k=n.justify,b=n.checked,E=n.disabled,f=n.value,N=void 0===f?"":f,g=n.style,y=n.size,j=void 0===y?0:y,A=n.color,C=void 0===A?"var(--color-primary)":A,O=s(p,"xh-checkbox-id"),R=function(e){var t=b||!1,a="";"h5"===process.env.TARO_ENV?(t=e.target.checked,a=e.target.value):(t=e.detail.value.length>0,a=e.detail.value[0]),u&&u(t,a)},T=t("xh-checkbox",i,x,v,k,{h5:"h5"===process.env.TARO_ENV});return"h5"!==process.env.TARO_ENV?e.createElement(a,{className:T,style:g},e.createElement(c,{onChange:R},e.createElement(l,{for:O},e.createElement(r,{id:O,disabled:E,value:N,checked:b,color:C,className:t("xh-checkbox-input",{tt:"tt"===process.env.TARO_ENV})}),e.createElement(a,{className:t("xh-checkbox-input-fake",d&&"circle",{tt:"tt"===process.env.TARO_ENV}),style:j>0?{width:o(j),height:o(j)}:{}}))),e.createElement("span",{className:"xh-checkbox-label"},m)):e.createElement("label",{htmlFor:O,className:T,style:g},e.createElement("input",{type:"checkbox",id:O,name:h,className:"xh-checkbox-input",onChange:R,value:N,defaultChecked:b}),e.createElement("span",{style:j>0?{width:o(j),height:o(j)}:{},className:t("xh-checkbox-input-fake",d&&"circle")}),e.createElement("span",{className:"xh-checkbox-label"},m))};i.Group=n;export{i as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { CheckboxGroup, View } from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\nimport Group from \"./Group\";\nimport \"./index.scss\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHCheckboxProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHCheckboxProps = {\n onChange?: (check: boolean, value: string) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n} & XHComponentCommonProps;\n\nconst XHCheckbox: FC<XHCheckboxProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value,\n style,\n size = 0,\n color = \"var(--color-primary)\",\n } = props;\n\n const finalId = useGenerateId(id, \"xh-checkbox-id\");\n\n const handleOnchange = e => {\n let finalchecked = checked || false;\n let value = \"\";\n if (process.env.TARO_ENV === \"h5\") {\n finalchecked = e.target.checked;\n value = e.target.value;\n } else {\n finalchecked = e.detail.value.length > 0;\n value = e.detail.value[0];\n }\n onChange && onChange(finalchecked, value);\n };\n\n const cls = classNames(\"xh-checkbox\", className, align, direction, justify, {\n h5: process.env.TARO_ENV === \"h5\",\n });\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View className={cls} style={style}>\n <CheckboxGroup onChange={handleOnchange}>\n <
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { CheckboxGroup, Label, View, Checkbox } from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\nimport Group from \"./Group\";\nimport \"./index.scss\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHCheckboxProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHCheckboxProps = {\n onChange?: (check: boolean, value: string) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n} & XHComponentCommonProps;\n\nconst XHCheckbox: FC<XHCheckboxProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value = \"\",\n style,\n size = 0,\n color = \"var(--color-primary)\",\n } = props;\n\n const finalId = useGenerateId(id, \"xh-checkbox-id\");\n\n const handleOnchange = e => {\n let finalchecked = checked || false;\n let value = \"\";\n if (process.env.TARO_ENV === \"h5\") {\n finalchecked = e.target.checked;\n value = e.target.value;\n } else {\n finalchecked = e.detail.value.length > 0;\n value = e.detail.value[0];\n }\n onChange && onChange(finalchecked, value);\n };\n\n const cls = classNames(\"xh-checkbox\", className, align, direction, justify, {\n h5: process.env.TARO_ENV === \"h5\",\n });\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View className={cls} style={style}>\n <CheckboxGroup onChange={handleOnchange}>\n <Label for={finalId}>\n <Checkbox\n id={finalId}\n disabled={disabled}\n value={value as string}\n checked={checked}\n color={color}\n className={classNames(\"xh-checkbox-input\", {\n tt: process.env.TARO_ENV === \"tt\",\n })}\n />\n <View\n className={classNames(\n \"xh-checkbox-input-fake\",\n circle && \"circle\",\n { tt: process.env.TARO_ENV === \"tt\" }\n )}\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n ></View>\n </Label>\n </CheckboxGroup>\n <span className=\"xh-checkbox-label\">{label}</span>\n </View>\n );\n }\n\n return (\n <label htmlFor={finalId} className={cls} style={style}>\n <input\n type=\"checkbox\"\n id={finalId}\n name={name}\n className=\"xh-checkbox-input\"\n onChange={handleOnchange}\n value={value}\n defaultChecked={checked}\n />\n <span\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n className={classNames(\"xh-checkbox-input-fake\", circle && \"circle\")}\n ></span>\n <span className=\"xh-checkbox-label\">{label}</span>\n </label>\n );\n};\n\nconst CheckBox = XHCheckbox as CompoundedComponent;\nCheckBox.Group = Group;\n\nexport default CheckBox;\n"],"names":["CheckBox","props","className","name","label","id","circle","onChange","align","direction","justify","checked","disabled","_a","value","style","_b","size","_c","color","finalId","useGenerateId","handleOnchange","e","finalchecked","process","env","TARO_ENV","target","detail","length","cls","classNames","h5","React","createElement","View","CheckboxGroup","Label","for","Checkbox","tt","width","pxTransform","height","htmlFor","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V,CAAEmC,GAA6B,OAAzBhB,QAAQC,IAAIC,WAEpBZ,MACEE,EAAO,EACH,CACEyB,MAAOC,EAAY1B,GACnB2B,OAAQD,EAAY1B,IAEtB,CAAE,MAKdiB,EAAMC,cAAA,OAAA,CAAAjC,UAAU,qBAAqBE,IAMzC8B,EAAAC,cAAA,QAAA,CAAOU,QAASzB,EAASlB,UAAW6B,EAAKhB,MAAOA,GAC9CmB,EACEC,cAAA,QAAA,CAAAW,KAAK,WACLzC,GAAIe,EACJjB,KAAMA,EACND,UAAU,oBACVK,SAAUe,EACVR,MAAOA,EACPiC,eAAgBpC,IAElBuB,EAAAC,cAAA,OAAA,CACEpB,MACEE,EAAO,EACH,CACEyB,MAAOC,EAAY1B,GACnB2B,OAAQD,EAAY1B,IAEtB,CAAE,EAERf,UAAW8B,EAAW,yBAA0B1B,GAAU,YAE5D4B,EAAMC,cAAA,OAAA,CAAAjC,UAAU,qBAAqBE,GAG3C,EAGAJ,EAASgD,MAAQA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { pxTransform } from \"@/utils\";\nimport type { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHIcon =\n | \"prompt\"\n | \"score\"\n | \"info\"\n | \"failure\"\n | \"success\"\n | \"loading\"\n | \"back\"\n | \"notice\"\n | \"scan\"\n | \"light\"\n | \"faceScan\"\n | \"delete\"\n | \"radioFull\"\n | \"checkboxFull\"\n | \"checkedSquare\"\n | \"checked2\"\n | \"arrowTop\"\n | \"notice2\"\n | \"position\"\n | \"contacts\"\n | \"billFull\"\n | \"bill2\"\n | \"bill3\"\n | \"bill4\"\n | \"edit\"\n | \"editFull\"\n | \"camera\"\n | \"close\"\n | \"gift\"\n | \"message\"\n | \"user\"\n | \"wenhao\"\n | \"kefu\"\n | \"play\"\n | \"arrowLeft\"\n | \"arrowRight\"\n | \"keyboardClose\"\n | \"add\"\n | \"tongxunlu\"\n | \"zhuyi\"\n | \"duigou\"\n | \"edit2\"\n | \"alipay\"\n | \"wechat\"\n | \"friendPay\"\n | \"pen\"\n | \"location\"\n | \"search\"\n | \"qa\"\n | \"thumbsUp\"\n | \"thumbsDown\"\n | \"thumbsUpFull\"\n | \"thumbsDownFull\"\n | \"waiting\"\n | \"scan2\"\n | \"safety\"\n | \"report\"\n | (string & {});\n\nexport type XHIconProps = {\n icon: XHIcon;\n size?: number;\n color?: StandardLonghandProperties[\"color\"];\n style?: React.CSSProperties;\n onClick?: () => void;\n} & XHComponentCommonProps;\n\nconst Icon: React.FC<XHIconProps> = props => {\n const { icon = \"\", size = 0, className, color, style, ...rest } = props;\n\n const fixIcon = icon && `xh-icon-${icon}`;\n const iconCls = classNames(\"xh-icon\", fixIcon, className);\n\n const finalStyle: React.CSSProperties = {\n ...style,\n ...(size > 0 ? { fontSize: pxTransform(size) } : {}),\n color,\n };\n\n return <span className={iconCls} {...{ style: finalStyle }} {...rest} />;\n};\n\nexport default Icon;\n"],"names":["Icon","props","_a","icon","_b","size","className","color","style","rest","__rest","fixIcon","concat","iconCls","classNames","finalStyle","__assign","fontSize","pxTransform","React","createElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { pxTransform } from \"@/utils\";\nimport type { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHIcon =\n | \"prompt\"\n | \"score\"\n | \"info\"\n | \"failure\"\n | \"success\"\n | \"loading\"\n | \"back\"\n | \"notice\"\n | \"scan\"\n | \"light\"\n | \"faceScan\"\n | \"delete\"\n | \"radioFull\"\n | \"checkboxFull\"\n | \"checkedSquare\"\n | \"checked2\"\n | \"arrowTop\"\n | \"notice2\"\n | \"position\"\n | \"contacts\"\n | \"billFull\"\n | \"bill2\"\n | \"bill3\"\n | \"bill4\"\n | \"edit\"\n | \"editFull\"\n | \"camera\"\n | \"close\"\n | \"gift\"\n | \"message\"\n | \"user\"\n | \"wenhao\"\n | \"kefu\"\n | \"play\"\n | \"arrowLeft\"\n | \"arrowRight\"\n | \"keyboardClose\"\n | \"add\"\n | \"tongxunlu\"\n | \"zhuyi\"\n | \"duigou\"\n | \"edit2\"\n | \"alipay\"\n | \"wechat\"\n | \"friendPay\"\n | \"pen\"\n | \"location\"\n | \"search\"\n | \"qa\"\n | \"thumbsUp\"\n | \"thumbsDown\"\n | \"thumbsUpFull\"\n | \"thumbsDownFull\"\n | \"waiting\"\n | \"scan2\"\n | \"safety\"\n | \"report\"\n | \"forbidden\"\n | (string & {});\n\nexport type XHIconProps = {\n icon: XHIcon;\n size?: number;\n color?: StandardLonghandProperties[\"color\"];\n style?: React.CSSProperties;\n onClick?: () => void;\n} & XHComponentCommonProps;\n\nconst Icon: React.FC<XHIconProps> = props => {\n const { icon = \"\", size = 0, className, color, style, ...rest } = props;\n\n const fixIcon = icon && `xh-icon-${icon}`;\n const iconCls = classNames(\"xh-icon\", fixIcon, className);\n\n const finalStyle: React.CSSProperties = {\n ...style,\n ...(size > 0 ? { fontSize: pxTransform(size) } : {}),\n color,\n };\n\n return <span className={iconCls} {...{ style: finalStyle }} {...rest} />;\n};\n\nexport default Icon;\n"],"names":["Icon","props","_a","icon","_b","size","className","color","style","rest","__rest","fixIcon","concat","iconCls","classNames","finalStyle","__assign","fontSize","pxTransform","React","createElement"],"mappings":"6KA6EM,IAAAA,EAA8B,SAAAC,GAC1B,IAAAC,EAA0DD,EAAKE,KAA/DA,aAAO,GAAED,EAAEE,EAA+CH,EAAvCI,KAARA,OAAO,IAAAD,EAAA,IAAGE,EAAqCL,YAA1BM,EAA0BN,EAAKM,MAAxBC,EAAmBP,EAAKO,MAAdC,EAAIC,EAAKT,EAA5D,CAAA,OAAA,OAAA,YAAA,QAAA,UAEAU,EAAUR,GAAQ,WAAWS,OAAAT,GAC7BU,EAAUC,EAAW,UAAWH,EAASL,GAEzCS,EAAUC,EAAAA,EAAAA,EAAA,CAAA,EACXR,GACCH,EAAO,EAAI,CAAEY,SAAUC,EAAYb,IAAU,CAAA,GACjD,CAAAE,MAAKA,IAGP,OAAOY,EAAMC,cAAA,OAAAJ,EAAA,CAAAV,UAAWO,GAAa,CAAEL,MAAOO,GAAkBN,GAClE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import a from"classnames";import{RadioGroup as
|
|
1
|
+
import e from"react";import a from"classnames";import{View as t,RadioGroup as r,Label as l,Radio as s}from"@tarojs/components";import i from"../src/hooks/useGenerateId.js";import{pxTransform as o}from"../src/utils/index.js";import n from"./Group/index.js";var c=function(n){var c=n.className,d=n.name,m=n.label,h=n.id,p=n.circle,u=void 0===p||p,f=n.onChange,v=n.align,E=n.direction,N=n.justify,x=n.checked,y=n.disabled,g=n.value,b=n.style,k=n.size,R=void 0===k?0:k,j=n.color,A=void 0===j?"#f6ab00":j,C=n.fancy,G=void 0!==C&&C,O=i(h,"xh-radio-id"),T=function(e){var a=x||!1,t="";"h5"===process.env.TARO_ENV?(a=e.target.checked,t=e.target.value):(a=e.detail.value.length>0,t=e.detail.value),null==f||f(a,t)},V=a("xh-radio",c,v,E,N);return"h5"!==process.env.TARO_ENV?e.createElement(t,null,e.createElement(r,{onChange:T},e.createElement(l,{for:O,className:V,style:b},e.createElement(s,{id:O,className:a("xh-radio-input",{tt:"tt"===process.env.TARO_ENV}),disabled:y,checked:x,color:A}),e.createElement("span",{style:R>0?{width:o(R),height:o(R)}:{},className:a("xh-radio-input-fake",u&&"circle",{tt:"tt"===process.env.TARO_ENV,fancy:G})}),e.createElement("span",{className:"xh-radio-label"},m)))):e.createElement("label",{htmlFor:O,className:V,style:b},e.createElement("input",{type:"radio",id:O,name:d,className:"xh-radio-input",onChange:T,value:g,disabled:y,defaultChecked:x}),e.createElement("span",{style:R>0?{width:o(R),height:o(R)}:{},className:a("xh-radio-input-fake",{circle:u,fancy:G})}),e.createElement("span",{className:"xh-radio-label"},m))};c.Group=n;export{c as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport {\n RadioGroup,\n Radio as NativeRadio,\n Label,\n View,\n} from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\n\nimport Group from \"./Group\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHRadioProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHRadioProps = {\n onChange?: (check: boolean, value: string | number) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n fancy?: boolean;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n} & XHComponentCommonProps;\n\nconst XHRadio: FC<XHRadioProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle = true,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value,\n style,\n size = 0,\n color = \"#f6ab00\",\n fancy = false,\n } = props;\n\n const finalId = useGenerateId(id, \"xh-radio-id\");\n\n const handleOnchange = e => {\n let finalchecked = checked || false;\n let value = \"\";\n\n if (process.env.TARO_ENV === \"h5\") {\n finalchecked = e.target.checked;\n value = e.target.value;\n } else {\n finalchecked = e.detail.value.length > 0;\n value = e.detail.value;\n }\n onChange?.(finalchecked, value);\n };\n\n const cls = classNames(\"xh-radio\", className, align, direction, justify);\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View>\n <RadioGroup onChange={handleOnchange}>\n <Label for={finalId} className={cls} style={style}>\n <NativeRadio\n id={finalId}\n className={classNames(\"xh-radio-input\", {\n tt: process.env.TARO_ENV === \"tt\",\n })}\n disabled={disabled}\n checked={checked}\n color={color}\n />\n <span\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n className={classNames(\"xh-radio-input-fake\", circle && \"circle\", {\n tt: process.env.TARO_ENV === \"tt\",\n fancy,\n })}\n ></span>\n <span className=\"xh-radio-label\">{label}</span>\n </Label>\n </RadioGroup>\n </View>\n );\n }\n\n return (\n <label htmlFor={finalId} className={cls} style={style}>\n <input\n type=\"radio\"\n id={finalId}\n name={name}\n className=\"xh-radio-input\"\n onChange={handleOnchange}\n value={value}\n disabled={disabled}\n defaultChecked={checked}\n />\n <span\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n className={classNames(\"xh-radio-input-fake\", { circle, fancy })}\n ></span>\n <span className=\"xh-radio-label\">{label}</span>\n </label>\n );\n};\n\nconst Radio = XHRadio as CompoundedComponent;\nRadio.Group = Group;\n\nexport default Radio;\n"],"names":["Radio","props","className","name","label","id","_a","circle","onChange","align","direction","justify","checked","disabled","value","style","_b","size","_c","color","_d","fancy","finalId","useGenerateId","handleOnchange","e","finalchecked","process","env","TARO_ENV","target","detail","length","cls","classNames","React","View","createElement","RadioGroup","Label","for","NativeRadio","tt","width","pxTransform","height","htmlFor","type","defaultChecked","Group"],"mappings":"gQA4CA,IAoGMA,EApG4B,SAAAC,GAE9B,IAAAC,EAgBED,EAAKC,UAfPC,EAeEF,EAfEE,KACJC,EAcEH,QAbFI,EAaEJ,EAAKI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