"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3773],{53773:(e,t,n)=>{n.r(t),n.d(t,{IconToolbar:()=>S});var s=n(57505),o=n(90321),l=n(77658),c=n(16697),i=n(79870),r=n(10615),a=n(77445),u=n(78473),f=n(50245),E=n(81558),d=n(77863),O=n(52066),h=n(95014),I=n(91059);let p=(0,n(29348).default)(()=>n.e(7726).then(n.bind(n,57726)).then(e=>e.UnifiedIconPicker),{loadableGenerated:{webpack:()=>[57726]},ssr:!1}),N=({shouldFocus:e})=>{let t=(0,u.er)();return(0,s.jsx)(p,{shouldFocus:e,onIconSelect:e=>{let{selection:n}=t;if(!n)return;let s=t.api.string(n.anchor.path),o=n.anchor.offset,l=s.slice(o-E.wl,o),c=s.slice(o-E.Sh,o),i="(fa)"===l?E.wl:"(ico)"===c?E.Sh:0;if(i>0&&t.tf.delete({reverse:!0,distance:i,unit:"character"}),e.type===d.qt.FONT_AWESOME){let n={icon:JSON.stringify({faIcon:e.value})};t.tf.insertNodes((0,h.u)(n))}else if(e.type===d.qt.LUCIDE){let n={icon:JSON.stringify({lucideIcon:e.value})};t.tf.insertNodes((0,I.W)(n))}t.tf.move({unit:"offset"});let r=t.api.block()?.[1];t.selection&&r&&t.api.isEnd(t.selection.anchor,r)&&t.tf.insertText(" "),(0,O.F)(t,t.selection?.focus),(0,E.KO)()},onPickerDestroy:E.KO})},S=()=>{let e=(0,f.useRef)(null),t=(0,u.er)(),n=(0,a.md)(l.lz,{store:(0,l.$H)()})===t.id,{position:d,isPositionReady:O}=(0,i.G)(n,30);return(0,s.jsx)("div",{ref:e,className:"ab-icon-toolbar",children:(0,s.jsx)(o.A,{open:n&&O,align:"start",onOpenChange:e=>!e&&(0,E.KO)(),onOpenAutoFocus:e=>e.preventDefault(),className:"z-[100000000] rounded-3xl w-400",content:(0,s.jsx)(N,{shouldFocus:O}),children:(0,s.jsx)("span",{className:(0,c.cn)("absolute",(0,r.AH)({...d}))})})})}},77863:(e,t,n)=>{n.d(t,{I5:()=>o,qt:()=>s});let s={EMOJI:"EMOJI",FONT_AWESOME:"FONT_AWESOME",API_METHODS:"API_METHODS",LUCIDE:"LUCIDE"},o={[s.FONT_AWESOME]:"Font Awesome",[s.LUCIDE]:"Lucide"};s.EMOJI,s.FONT_AWESOME,s.API_METHODS,s.LUCIDE}}]);