{"version":3,"file":"ConditionalWrapper.cjs","names":["_react","require","_jsxRuntime","ConditionalWrapper","isWrapped","Wrapper","children","jsx","Fragment","MemoizedConditionalWrapper","exports","memo","displayName"],"sources":["../../src/ConditionalWrapper.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\n\nexport type ConditionalWrapperProps = {\n  children: ReactNode;\n  /**\n   * If `true`, wraps children with the provided wrapper element. If `false`, renders children directly.\n   */\n  isWrapped: boolean;\n  Wrapper: (children: ReactNode) => ReactNode;\n};\n\nconst ConditionalWrapper = ({\n  isWrapped,\n  Wrapper,\n  children,\n}: ConditionalWrapperProps) =>\n  isWrapped ? Wrapper(children) : <>{children}</>;\n\nconst MemoizedConditionalWrapper = memo(ConditionalWrapper);\nMemoizedConditionalWrapper.displayName = \"ConditionalWrapper\";\n\nexport { MemoizedConditionalWrapper as ConditionalWrapper };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAAwC,IAAAC,WAAA,GAAAD,OAAA;AAZxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,MAAME,kBAAkB,GAAGA,CAAC;EAC1BC,SAAS;EACTC,OAAO;EACPC;AACuB,CAAC,KACxBF,SAAS,GAAGC,OAAO,CAACC,QAAQ,CAAC,GAAG,IAAAJ,WAAA,CAAAK,GAAA,EAAAL,WAAA,CAAAM,QAAA;EAAAF,QAAA,EAAGA;AAAQ,CAAG,CAAC;AAEjD,MAAMG,0BAA0B,GAAAC,OAAA,CAAAP,kBAAA,GAAG,IAAAQ,WAAI,EAACR,kBAAkB,CAAC;AAC3DM,0BAA0B,CAACG,WAAW,oDAAuB","ignoreList":[]}