{"version":3,"file":"prepareInstance.mjs","sources":["../../src/helpers/prepareInstance.ts"],"sourcesContent":["import {\n    type Container,\n    type Filter,\n} from 'pixi.js';\nimport { type HostConfig } from '../typedefs/HostConfig';\nimport { type InstanceState } from '../typedefs/InstanceState';\n\n/** Create the instance with the provided sate and attach the component to it. */\nexport function prepareInstance<T extends Container | Filter | HostConfig['instance']>(\n    component: T,\n    state: Partial<InstanceState> = {},\n)\n{\n    const instance = component as HostConfig['instance'];\n\n    instance.__pixireact = Object.assign({\n        filters: [],\n        parent: null,\n        root: null as unknown as HostConfig['containerInstance'],\n        type: '',\n    }, state);\n\n    return instance;\n}\n"],"names":[],"mappings":";AAQO,SAAS,eACZ,CAAA,SAAA,EACA,KAAgC,GAAA,EAEpC,EAAA;AACI,EAAA,MAAM,QAAW,GAAA,SAAA;AAEjB,EAAS,QAAA,CAAA,WAAA,GAAc,OAAO,MAAO,CAAA;AAAA,IACjC,SAAS,EAAC;AAAA,IACV,MAAQ,EAAA,IAAA;AAAA,IACR,IAAM,EAAA,IAAA;AAAA,IACN,IAAM,EAAA;AAAA,KACP,KAAK,CAAA;AAER,EAAO,OAAA,QAAA;AACX;;;;"}