{"mappings":";mJAsCO,IAAMA,EAAiB,uDAKjBC,EAAiB,uDAKjBC,EAAuB,+CAKvBC,EAAuB,+CAMvBC,EAAOC,EAAK,OAAoB,CAC3C,KAAM,OAEN,YAAU,CACR,MAAO,CACL,eAAgB,CAAA,IAIpB,WAAS,CACP,MAAO,CACL,CACE,IAAK,QACN,EACD,CACE,IAAK,IACL,SAAUC,GAASA,EAAqB,MAAM,aAAe,UAAY,IAC1E,EACD,CACE,MAAO,kBACP,UAAWC,GAAQA,EAAK,KAAK,OAAS,KAAK,IAC5C,EACD,CACE,MAAO,cACP,SAAUC,GAAS,4BAA4B,KAAKA,CAAe,GAAK,IACzE,IAIL,WAAW,CAAE,eAAAC,CAAc,EAAE,CAC3B,MAAO,CAAC,SAAUC,EAAgB,KAAK,QAAQ,eAAgBD,CAAc,EAAG,CAAC,GAGnF,aAAW,CACT,MAAO,CACL,QAAS,IAAM,CAAC,CAAE,SAAAE,CAAQ,IACjBA,EAAS,QAAQ,KAAK,IAAI,EAEnC,WAAY,IAAM,CAAC,CAAE,SAAAA,CAAQ,IACpBA,EAAS,WAAW,KAAK,IAAI,EAEtC,UAAW,IAAM,CAAC,CAAE,SAAAA,CAAQ,IACnBA,EAAS,UAAU,KAAK,IAAI,IAKzC,sBAAoB,CAClB,MAAO,CACL,QAAS,IAAM,KAAK,OAAO,SAAS,WAAU,EAC9C,QAAS,IAAM,KAAK,OAAO,SAAS,WAAU,IAIlD,eAAa,CACX,MAAO,CACLC,EAAc,CACZ,KAAMZ,EACN,KAAM,KAAK,KACZ,EACDY,EAAc,CACZ,KAAMV,EACN,KAAM,KAAK,KACZ,IAIL,eAAa,CACX,MAAO,CACLW,EAAc,CACZ,KAAMZ,EACN,KAAM,KAAK,KACZ,EACDY,EAAc,CACZ,KAAMV,EACN,KAAM,KAAK,KACZ,GAGN,CAAA","names":["starInputRegex","starPasteRegex","underscoreInputRegex","underscorePasteRegex","Bold","Mark","node","mark","value","HTMLAttributes","mergeAttributes","commands","markInputRule","markPasteRule"],"sources":["../esm/npm/@tiptap/extension-bold@2.27.3/node_modules/@tiptap/extension-bold/src/bold.ts"],"sourcesContent":["import {\n  Mark,\n  markInputRule,\n  markPasteRule,\n  mergeAttributes,\n} from '@tiptap/core'\n\nexport interface BoldOptions {\n  /**\n   * HTML attributes to add to the bold element.\n   * @default {}\n   * @example { class: 'foo' }\n   */\n  HTMLAttributes: Record\u003cstring, any\u003e,\n}\n\ndeclare module '@tiptap/core' {\n  interface Commands\u003cReturnType\u003e {\n    bold: {\n      /**\n       * Set a bold mark\n       */\n      setBold: () =\u003e ReturnType,\n      /**\n       * Toggle a bold mark\n       */\n      toggleBold: () =\u003e ReturnType,\n      /**\n       * Unset a bold mark\n       */\n      unsetBold: () =\u003e ReturnType,\n    }\n  }\n}\n\n/**\n * Matches bold text via `**` as input.\n */\nexport const starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/\n\n/**\n * Matches bold text via `**` while pasting.\n */\nexport const starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g\n\n/**\n * Matches bold text via `__` as input.\n */\nexport const underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/\n\n/**\n * Matches bold text via `__` while pasting.\n */\nexport const underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g\n\n/**\n * This extension allows you to mark text as bold.\n * @see https://tiptap.dev/api/marks/bold\n */\nexport const Bold = Mark.create\u003cBoldOptions\u003e({\n  name: 'bold',\n\n  addOptions() {\n    return {\n      HTMLAttributes: {},\n    }\n  },\n\n  parseHTML() {\n    return [\n      {\n        tag: 'strong',\n      },\n      {\n        tag: 'b',\n        getAttrs: node =\u003e (node as HTMLElement).style.fontWeight !== 'normal' \u0026\u0026 null,\n      },\n      {\n        style: 'font-weight=400',\n        clearMark: mark =\u003e mark.type.name === this.name,\n      },\n      {\n        style: 'font-weight',\n        getAttrs: value =\u003e /^(bold(er)?|[5-9]\\d{2,})$/.test(value as string) \u0026\u0026 null,\n      },\n    ]\n  },\n\n  renderHTML({ HTMLAttributes }) {\n    return ['strong', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n  },\n\n  addCommands() {\n    return {\n      setBold: () =\u003e ({ commands }) =\u003e {\n        return commands.setMark(this.name)\n      },\n      toggleBold: () =\u003e ({ commands }) =\u003e {\n        return commands.toggleMark(this.name)\n      },\n      unsetBold: () =\u003e ({ commands }) =\u003e {\n        return commands.unsetMark(this.name)\n      },\n    }\n  },\n\n  addKeyboardShortcuts() {\n    return {\n      'Mod-b': () =\u003e this.editor.commands.toggleBold(),\n      'Mod-B': () =\u003e this.editor.commands.toggleBold(),\n    }\n  },\n\n  addInputRules() {\n    return [\n      markInputRule({\n        find: starInputRegex,\n        type: this.type,\n      }),\n      markInputRule({\n        find: underscoreInputRegex,\n        type: this.type,\n      }),\n    ]\n  },\n\n  addPasteRules() {\n    return [\n      markPasteRule({\n        find: starPasteRegex,\n        type: this.type,\n      }),\n      markPasteRule({\n        find: underscorePasteRegex,\n        type: this.type,\n      }),\n    ]\n  },\n})\n"],"version":3}
