/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/recma-mdx-escape-missing-components@1.2.4/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{CONTINUE,EXIT,SKIP,visit}from"estree-util-visit";function passTest(e,t){return void 0===e||"string"==typeof e&&e===t||Array.isArray(e)&&e.includes(t)||"function"==typeof e&&e(t)}function statementOfEmptyComponent(){return{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_EmptyComponent"},init:{type:"ArrowFunctionExpression",expression:!0,generator:!1,async:!1,params:[],body:{type:"Literal",value:null}}}],kind:"const"}}const plugin=e=>t=>{visit(t,((e,n,i,r)=>{if(void 0!==i)return 1!==r.length||"FunctionDeclaration"!==e.type?SKIP:"Program"===t.type?(t.body.splice(i,0,statementOfEmptyComponent()),EXIT):CONTINUE})),visit(t,(t=>"VariableDeclarator"!==t.type?CONTINUE:"_components"!==t.init?.name?SKIP:("ObjectPattern"!==t.id.type||t.id.properties.forEach((t=>{if("RestElement"===t.type)return CONTINUE;if("Identifier"===t.key.type&&"Identifier"===t.value.type&&t.key.name===t.value.name){const n=t.key.name;passTest(e,n)&&(t.value={type:"AssignmentPattern",left:{type:"Identifier",name:n},right:{type:"Identifier",name:"_EmptyComponent"}})}return CONTINUE})),CONTINUE)))};export default plugin;
//# sourceMappingURL=/sm/1f0fb332870332a2f43331fee64e826587642a25000c1eac84135eee37b08240.map