{"version":3,"sources":["../../../src/instructions/HideElement.instruction.ts"],"names":[],"mappings":";;;;;AAUO,IAAM,sBAAA,GAAN,cAAqC,WAAA,CAA2C;AAAA,EAQnF,WAAA,CACI,QACA,KAAA,EACF;AACE,IAAA,IAAI,WAAW,KAAA,EAAO;AAClB,MAAA,KAAA,CAAM,KAAgE,CAAA;AAAA,IAC1E,CAAA,MAAO;AACH,MAAA,KAAA,CAAM,mBAAA,CAAoB,WAAA,EAAa,MAAA,EAAQ,KAAK,CAAA;AAAA,IACxD;AAAA,EACJ;AACJ;AAlBa,sBAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,sBAAA,CAAA","file":"HideElement.instruction.mjs","sourcesContent":["import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlHideInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n    namespace: 'a-are-html',\n    description: 'Toggles the visibility of an existing element by setting its inline display to \"none\" on apply and restoring the previous inline display on revert. Used by the $show directive to hide/show an element without unmounting it, preserving its subtree, listeners and scene state.'\n})\nexport class HideElementInstruction extends AreMutation<AreHtmlHideInstructionPayload> {\n\n    /**\n     * Caches the element's inline `display` value captured at apply time so it\n     * can be restored verbatim on revert (mirrors Vue `v-show`).\n     */\n    cache?: string;\n\n    constructor(\n        parent: AreDeclaration,\n        props: AreHtmlHideInstructionPayload | AreInstructionSerialized<AreHtmlHideInstructionPayload>\n    ) {\n        if ('aseid' in props) {\n            super(props as AreInstructionSerialized<AreHtmlHideInstructionPayload>);\n        } else {\n            super(AreHTMLInstructions.HideElement, parent, props);\n        }\n    }\n}\n"]}