/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@udecode/plate-reset-node@49.0.0/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of __getOwnPropNames(t))__hasOwnProp.call(e,s)||s===o||__defProp(e,s,{get:()=>t[s],enumerable:!(r=__getOwnPropDesc(t,s))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),index_exports={};__export(index_exports,{BaseResetNodePlugin:()=>BaseResetNodePlugin}),module.exports=__toCommonJS(index_exports);var import_plate=require("@udecode/plate"),BaseResetNodePlugin=(0,import_plate.createTSlatePlugin)({key:"resetNode",editOnly:!0,options:{rules:[]}}).overrideEditor((({editor:e,getOptions:t,tf:{deleteBackward:o,deleteFragment:r}})=>({transforms:{deleteBackward(r){if(!t().disableFirstBlockReset){const{selection:t}=e;if(t&&e.api.isCollapsed()){const o=e.api.start([]);if(import_plate.PointApi.equals(t.anchor,o)){const t=import_plate.NodeApi.get(e,[0]),{children:o,...r}=e.api.create.block({},[0]);return void e.tf.withoutNormalizing((()=>{const{id:o,...s}=import_plate.NodeApi.extractProps(t);e.tf.unsetNodes(Object.keys(s),{at:[0]}),e.tf.setNodes(r,{at:[0]})}))}}}o(r)},deleteFragment(o){!t().disableEditorReset&&(()=>{const{selection:t}=e;if(t)return import_plate.RangeApi.equals(t,e.api.range([]))?(e.tf.reset({children:!0,select:!0}),!0):void 0})()||r(o)}}})));
//# sourceMappingURL=/sm/8332a02fd58d4221b664d78a5cb4729f72b82ef31a874663f99ca291804e7a73.map