{"ast":null,"code":"/* eslint-disable no-redeclare */\nimport { useContext } from 'react';\nimport { useStyleRegister } from '@ant-design/cssinjs';\nimport { warning } from 'rc-util';\nimport { ConfigContext } from '../../config-provider/context';\nimport { genCommonStyle, genLinkStyle } from '../../style';\nimport useToken from '../useToken';\nimport statisticToken, { merge as mergeToken } from './statistic';\nimport useResetIconStyle from './useResetIconStyle';\nexport default function genComponentStyleHook(componentName, styleFn, getDefaultToken) {\n  let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  const cells = Array.isArray(componentName) ? componentName : [componentName, componentName];\n  const [component] = cells;\n  const concatComponent = cells.join('-');\n  return prefixCls => {\n    const [theme, token, hashId] = useToken();\n    const {\n      getPrefixCls,\n      iconPrefixCls,\n      csp\n    } = useContext(ConfigContext);\n    const rootPrefixCls = getPrefixCls();\n    // Shared config\n    const sharedConfig = {\n      theme,\n      token,\n      hashId,\n      nonce: () => csp === null || csp === void 0 ? void 0 : csp.nonce,\n      clientOnly: options.clientOnly,\n      // antd is always at top of styles\n      order: options.order || -999\n    };\n    // Generate style for all a tags in antd component.\n    useStyleRegister(Object.assign(Object.assign({}, sharedConfig), {\n      clientOnly: false,\n      path: ['Shared', rootPrefixCls]\n    }), () => [{\n      // Link\n      '&': genLinkStyle(token)\n    }]);\n    // Generate style for icons\n    useResetIconStyle(iconPrefixCls, csp);\n    return [useStyleRegister(Object.assign(Object.assign({}, sharedConfig), {\n      path: [concatComponent, prefixCls, iconPrefixCls]\n    }), () => {\n      const {\n        token: proxyToken,\n        flush\n      } = statisticToken(token);\n      const customComponentToken = Object.assign({}, token[component]);\n      if (options.deprecatedTokens) {\n        const {\n          deprecatedTokens\n        } = options;\n        deprecatedTokens.forEach(_ref => {\n          let [oldTokenKey, newTokenKey] = _ref;\n          var _a;\n          if (process.env.NODE_ENV !== 'production') {\n            process.env.NODE_ENV !== \"production\" ? warning(!(customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[oldTokenKey]), `The token '${String(oldTokenKey)}' of ${component} had deprecated, use '${String(newTokenKey)}' instead.`) : void 0;\n          }\n          // Should wrap with `if` clause, or there will be `undefined` in object.\n          if ((customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[oldTokenKey]) || (customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[newTokenKey])) {\n            (_a = customComponentToken[newTokenKey]) !== null && _a !== void 0 ? _a : customComponentToken[newTokenKey] = customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[oldTokenKey];\n          }\n        });\n      }\n      const defaultComponentToken = typeof getDefaultToken === 'function' ? getDefaultToken(mergeToken(proxyToken, customComponentToken !== null && customComponentToken !== void 0 ? customComponentToken : {})) : getDefaultToken;\n      const mergedComponentToken = Object.assign(Object.assign({}, defaultComponentToken), customComponentToken);\n      const componentCls = `.${prefixCls}`;\n      const mergedToken = mergeToken(proxyToken, {\n        componentCls,\n        prefixCls,\n        iconCls: `.${iconPrefixCls}`,\n        antCls: `.${rootPrefixCls}`\n      }, mergedComponentToken);\n      const styleInterpolation = styleFn(mergedToken, {\n        hashId,\n        prefixCls,\n        rootPrefixCls,\n        iconPrefixCls,\n        overrideComponentToken: customComponentToken\n      });\n      flush(component, mergedComponentToken);\n      return [options.resetStyle === false ? null : genCommonStyle(token, prefixCls), styleInterpolation];\n    }), hashId];\n  };\n}\nexport const genSubStyleComponent = (componentName, styleFn, getDefaultToken, options) => {\n  const useStyle = genComponentStyleHook(componentName, styleFn, getDefaultToken, Object.assign({\n    resetStyle: false,\n    // Sub Style should default after root one\n    order: -998\n  }, options));\n  const StyledComponent = _ref2 => {\n    let {\n      prefixCls\n    } = _ref2;\n    useStyle(prefixCls);\n    return null;\n  };\n  if (process.env.NODE_ENV !== 'production') {\n    StyledComponent.displayName = `SubStyle_${Array.isArray(componentName) ? componentName.join('.') : componentName}`;\n  }\n  return StyledComponent;\n};","map":{"version":3,"names":["useContext","useStyleRegister","warning","ConfigContext","genCommonStyle","genLinkStyle","useToken","statisticToken","merge","mergeToken","useResetIconStyle","genComponentStyleHook","componentName","styleFn","getDefaultToken","options","arguments","length","undefined","cells","Array","isArray","component","concatComponent","join","prefixCls","theme","token","hashId","getPrefixCls","iconPrefixCls","csp","rootPrefixCls","sharedConfig","nonce","clientOnly","order","Object","assign","path","proxyToken","flush","customComponentToken","deprecatedTokens","forEach","_ref","oldTokenKey","newTokenKey","_a","process","env","NODE_ENV","String","defaultComponentToken","mergedComponentToken","componentCls","mergedToken","iconCls","antCls","styleInterpolation","overrideComponentToken","resetStyle","genSubStyleComponent","useStyle","StyledComponent","_ref2","displayName"],"sources":["/Users/chrishaack/UC_Trains_Voice/react-demo/node_modules/antd/es/theme/util/genComponentStyleHook.js"],"sourcesContent":["/* eslint-disable no-redeclare */\nimport { useContext } from 'react';\nimport { useStyleRegister } from '@ant-design/cssinjs';\nimport { warning } from 'rc-util';\nimport { ConfigContext } from '../../config-provider/context';\nimport { genCommonStyle, genLinkStyle } from '../../style';\nimport useToken from '../useToken';\nimport statisticToken, { merge as mergeToken } from './statistic';\nimport useResetIconStyle from './useResetIconStyle';\nexport default function genComponentStyleHook(componentName, styleFn, getDefaultToken) {\n  let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n  const cells = Array.isArray(componentName) ? componentName : [componentName, componentName];\n  const [component] = cells;\n  const concatComponent = cells.join('-');\n  return prefixCls => {\n    const [theme, token, hashId] = useToken();\n    const {\n      getPrefixCls,\n      iconPrefixCls,\n      csp\n    } = useContext(ConfigContext);\n    const rootPrefixCls = getPrefixCls();\n    // Shared config\n    const sharedConfig = {\n      theme,\n      token,\n      hashId,\n      nonce: () => csp === null || csp === void 0 ? void 0 : csp.nonce,\n      clientOnly: options.clientOnly,\n      // antd is always at top of styles\n      order: options.order || -999\n    };\n    // Generate style for all a tags in antd component.\n    useStyleRegister(Object.assign(Object.assign({}, sharedConfig), {\n      clientOnly: false,\n      path: ['Shared', rootPrefixCls]\n    }), () => [{\n      // Link\n      '&': genLinkStyle(token)\n    }]);\n    // Generate style for icons\n    useResetIconStyle(iconPrefixCls, csp);\n    return [useStyleRegister(Object.assign(Object.assign({}, sharedConfig), {\n      path: [concatComponent, prefixCls, iconPrefixCls]\n    }), () => {\n      const {\n        token: proxyToken,\n        flush\n      } = statisticToken(token);\n      const customComponentToken = Object.assign({}, token[component]);\n      if (options.deprecatedTokens) {\n        const {\n          deprecatedTokens\n        } = options;\n        deprecatedTokens.forEach(_ref => {\n          let [oldTokenKey, newTokenKey] = _ref;\n          var _a;\n          if (process.env.NODE_ENV !== 'production') {\n            process.env.NODE_ENV !== \"production\" ? warning(!(customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[oldTokenKey]), `The token '${String(oldTokenKey)}' of ${component} had deprecated, use '${String(newTokenKey)}' instead.`) : void 0;\n          }\n          // Should wrap with `if` clause, or there will be `undefined` in object.\n          if ((customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[oldTokenKey]) || (customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[newTokenKey])) {\n            (_a = customComponentToken[newTokenKey]) !== null && _a !== void 0 ? _a : customComponentToken[newTokenKey] = customComponentToken === null || customComponentToken === void 0 ? void 0 : customComponentToken[oldTokenKey];\n          }\n        });\n      }\n      const defaultComponentToken = typeof getDefaultToken === 'function' ? getDefaultToken(mergeToken(proxyToken, customComponentToken !== null && customComponentToken !== void 0 ? customComponentToken : {})) : getDefaultToken;\n      const mergedComponentToken = Object.assign(Object.assign({}, defaultComponentToken), customComponentToken);\n      const componentCls = `.${prefixCls}`;\n      const mergedToken = mergeToken(proxyToken, {\n        componentCls,\n        prefixCls,\n        iconCls: `.${iconPrefixCls}`,\n        antCls: `.${rootPrefixCls}`\n      }, mergedComponentToken);\n      const styleInterpolation = styleFn(mergedToken, {\n        hashId,\n        prefixCls,\n        rootPrefixCls,\n        iconPrefixCls,\n        overrideComponentToken: customComponentToken\n      });\n      flush(component, mergedComponentToken);\n      return [options.resetStyle === false ? null : genCommonStyle(token, prefixCls), styleInterpolation];\n    }), hashId];\n  };\n}\nexport const genSubStyleComponent = (componentName, styleFn, getDefaultToken, options) => {\n  const useStyle = genComponentStyleHook(componentName, styleFn, getDefaultToken, Object.assign({\n    resetStyle: false,\n    // Sub Style should default after root one\n    order: -998\n  }, options));\n  const StyledComponent = _ref2 => {\n    let {\n      prefixCls\n    } = _ref2;\n    useStyle(prefixCls);\n    return null;\n  };\n  if (process.env.NODE_ENV !== 'production') {\n    StyledComponent.displayName = `SubStyle_${Array.isArray(componentName) ? componentName.join('.') : componentName}`;\n  }\n  return StyledComponent;\n};"],"mappings":"AAAA;AACA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,cAAc,EAAEC,YAAY,QAAQ,aAAa;AAC1D,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,cAAc,IAAIC,KAAK,IAAIC,UAAU,QAAQ,aAAa;AACjE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,eAAe,SAASC,qBAAqBA,CAACC,aAAa,EAAEC,OAAO,EAAEC,eAAe,EAAE;EACrF,IAAIC,OAAO,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAKE,SAAS,GAAGF,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;EACpF,MAAMG,KAAK,GAAGC,KAAK,CAACC,OAAO,CAACT,aAAa,CAAC,GAAGA,aAAa,GAAG,CAACA,aAAa,EAAEA,aAAa,CAAC;EAC3F,MAAM,CAACU,SAAS,CAAC,GAAGH,KAAK;EACzB,MAAMI,eAAe,GAAGJ,KAAK,CAACK,IAAI,CAAC,GAAG,CAAC;EACvC,OAAOC,SAAS,IAAI;IAClB,MAAM,CAACC,KAAK,EAAEC,KAAK,EAAEC,MAAM,CAAC,GAAGtB,QAAQ,CA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