import{j as t,_ as X,bd as Ne,be as Me,ak as fe,bf as pe,bg as Le,bh as Pe,I as ge,bi as ze,bj as Te,ai as te,x as ne,a1 as re}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf10.js";import{p as me,B as xe,E as ve,b5 as _e,o as Be,b6 as $e,ar as He,ao as he}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf23.js";import{u as D,a as Z}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf92.js";import{u as W}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf19.js";import{u as be}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf36.js";import{a as y,d as Qe}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf4.js";import{a as Ue,g as qe,e as Xe,i as ae,m as We,b as Ke,c as Ve,d as Ge,f as z,h as Ye,j as Ze,k as ye}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf190.js";import{r as V,g as Je,m as G,o as et,c as J,d as Se,e as U,a as tt,b as Ee,s as je,f as oe}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf191.js";import{_ as k,f as nt,r as rt}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf5.js";import{i as O}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf9.js";import{u as at}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf126.js";import{a as ot}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf152.js";import{i as it}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf21.js";const st=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf186.js")),[]));function lt(){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(st,{})})}const ct=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf187.js")),[]));function ie({model:e}){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(ct,{model:e})})}function dt(){const{categories:e}=be(),{language:n}=W(),{open:r}=me(),{filter:p,setFilter:o}=D(),g=[{id:"all",name:n.tab_all,action:()=>o("model",{id:"all"})},{id:"type",name:n.filterQuickReplyPerType,action:i=>r(t.jsx(ie,{model:"type"}),{placement:"left-end"},i.target)},{id:"not_cat",name:n.filterQuickReplyNotPerCategorie,action:()=>o("model",{id:"not_cat"})},{id:"cat",name:n.filterQuickReplyPerCategorie,action:i=>r(t.jsx(ie,{model:"cat"}),{placement:"left-end"},i.target)},{id:"most_used",name:n.filterQuickReplyMostUsed,action:()=>o("model",{id:"most_used"})}],d=t.jsxs("div",{className:"flex justify-center gap-2",children:[t.jsx(Ne,{value:p.search,setValue:i=>o("search",i),placeholder:n.searchQuickReply}),t.jsx("span",{className:"cursor-pointer pulse lg:tooltip lg:tooltip-left","data-tip":n.createQuickReply,onClick:i=>r(t.jsx(lt,{}),{placement:"bottom-end"},i.target,5),children:t.jsx(Me,{className:"!w-[30px] !h-[30px] text-[var(--primaria)]"})})]}),f=t.jsx("div",{className:"flex gap-1 flex-wrap",children:g.map(i=>{var c;return t.jsxs("div",{className:`flex gap-1 badge border border-[var(--secundaria)] border-solid  font-medium rounded-lg shadow-lg text-nowrap pulse cursor-pointer 
                            ${p.model.id===i.id?"bg-label-gradient text-[var(--letra)]":"text-[var(--primaria)]"}`,onClick:x=>i.action(x),children:[i.id==="type"&&p.model.id===i.id&&t.jsx(fe,{type:p.model.parm,style:"w-4 h-4 text-[var(--letra)]"}),i.id==="cat"&&p.model.id===i.id&&t.jsx(pe,{size:18,color:(c=e.find(x=>x.id===p.model.parm))==null?void 0:c.hexColor}),t.jsx("span",{children:i.name}),(i.id==="type"||i.id==="cat")&&t.jsx("span",{children:t.jsx(Le,{size:15})})]})})});return t.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[d,f]})}function ut(e){var n=e.list,r=e.startIndex,p=e.closestEdgeOfTarget,o=e.indexOfTarget,g=e.axis;return V({list:n,startIndex:r,finishIndex:Je({closestEdgeOfTarget:p,startIndex:r,indexOfTarget:o,axis:g})})}function T(e){var n=e.axis,r=e.side;return function(o){var g,d,f=o.clientRect,i=o.overflow,c=o.config,x=Ue[n],a=x.mainAxis,l=x.crossAxis,u=a[r],m=i[u],s=qe[u]({clientRect:f,config:c}),h=DOMRect.fromRect((g={},k(g,a.point,s[a.point]),k(g,a.size,s[a.size]),k(g,l.point,s[l.point]-m[l.start]),k(g,l.size,s[l.size]+m[l.start]+m[l.end]),g)),b=DOMRect.fromRect((d={},k(d,a.point,r==="start"?f[a.point]-m[a.start]:f[a.end]),k(d,l.point,f[l.point]-m[l.start]),k(d,a.size,r==="start"?m[a.start]:m[a.end]),k(d,l.size,m[l.start]+f[l.size]+m[l.end]),d));return{insideOfEdge:h,outsideOfEdge:b}}}var ft={top:T({axis:"vertical",side:"start"}),right:T({axis:"horizontal",side:"end"}),bottom:T({axis:"vertical",side:"end"}),left:T({axis:"horizontal",side:"start"})};function _(e){return e.type==="inside-of-edge"}function B(e){var n,r,p,o;return{top:(n=e==null?void 0:e.top)!==null&&n!==void 0?n:0,right:(r=e==null?void 0:e.right)!==null&&r!==void 0?r:0,bottom:(p=e==null?void 0:e.bottom)!==null&&p!==void 0?p:0,left:(o=e==null?void 0:e.left)!==null&&o!==void 0?o:0}}function pt(e){return{top:B(e.fromTopEdge),right:B(e.fromRightEdge),bottom:B(e.fromBottomEdge),left:B(e.fromLeftEdge)}}function gt(e){var n=e.entry,r=e.timeSinceLastFrame,p=e.input,o=e.config,g=e.allowedAxis,d={x:p.clientX,y:p.clientY},f=n.element.getBoundingClientRect(),i=pt(n.getOverflow()),c=Xe.map(function(s){var h=ft[s]({clientRect:f,overflow:i,config:o}),b=h.insideOfEdge,S=h.outsideOfEdge;return ae({client:d,clientRect:S})?{edge:s,hitbox:S,type:"outside-of-edge"}:ae({client:d,clientRect:b})?{edge:s,hitbox:b,type:"inside-of-edge"}:!1}).filter(function(s){return!!s});if(!c.length)return null;var x=We(n.element),a=c.filter(function(s){return Ke(Ge[s.edge],g)&&Ve[s.edge](n.element)});if(!a.length)return null;var l=new Map(a.map(function(s){return[s.edge,s]})),u=(function(){var s="horizontal",h=l.get("left");if(h)return z({client:d,isDistanceDampeningEnabled:_(h),hitbox:h.hitbox,edge:"left",axis:s,timeSinceLastFrame:r,engagement:x,config:o});var b=l.get("right");return b?z({client:d,isDistanceDampeningEnabled:_(b),hitbox:b.hitbox,edge:"right",axis:s,timeSinceLastFrame:r,engagement:x,config:o}):0})(),m=(function(){var s="vertical",h=l.get("bottom");if(h)return z({client:d,isDistanceDampeningEnabled:_(h),hitbox:h.hitbox,edge:"bottom",axis:s,timeSinceLastFrame:r,engagement:x,config:o});var b=l.get("top");return b?z({client:d,isDistanceDampeningEnabled:_(b),hitbox:b.hitbox,edge:"top",axis:s,timeSinceLastFrame:r,engagement:x,config:o}):0})();return{left:u,top:m}}function mt(e,n){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=xt(e))||n){r&&(e=r);var p=0,o=function(){};return{s:o,n:function(){return p>=e.length?{done:!0}:{done:!1,value:e[p++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var g=!0,d=!1,f;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return g=c.done,c},e:function(c){d=!0,f=c},f:function(){try{!g&&r.return!=null&&r.return()}finally{if(d)throw f}}}}function xt(e,n){if(e){if(typeof e=="string")return se(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return se(e,n)}}function se(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,p=new Array(n);r<n;r++)p[r]=e[r];return p}function vt(e){var n=e.input,r=e.source,p=e.entries,o=e.timeSinceLastFrame,g=e.underUsersPointer,d=mt(p),f;try{for(d.s();!(f=d.n()).done;){var i,c,x,a=f.value;if(!a.element.contains(g)){var l={input:n,source:r,element:a.element};if(!(a.canScroll&&!a.canScroll(l))){var u=Ye((i=a.getConfiguration)===null||i===void 0?void 0:i.call(a,l)),m=(c=(x=a.getAllowedAxis)===null||x===void 0?void 0:x.call(a,l))!==null&&c!==void 0?c:"all",s=gt({entry:a,input:n,timeSinceLastFrame:o,allowedAxis:m,config:u});s&&a.element.scrollBy(s)}}}}catch(h){d.e(h)}finally{d.f()}}function ht(e){var n=e.monitor,r=new Map;function p(g){return r.set(g.element,g),function(){return r.delete(g.element)}}function o(g){var d=g.latestArgs,f=g.underUsersPointer,i=g.timeSinceLastFrame;vt({input:d.location.current.input,source:d.source,entries:Array.from(r).map(function(c){var x=nt(c,2);x[0];var a=x[1];return a}),underUsersPointer:f,timeSinceLastFrame:i})}return Ze(n).onFrame(o),{unsafeOverflowAutoScroll:p}}var bt=ht({monitor:G}),Ce=bt.unsafeOverflowAutoScroll;function Oe(e){var n=e.element,r=e.input;return function(o){var g=o.container,d=n.getBoundingClientRect(),f=g.getBoundingClientRect(),i=Math.min(r.clientX-d.x,f.width),c=Math.min(r.clientY-d.y,f.height);return{x:i,y:c}}}const yt=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf188.js")),[]));function St({card:e}){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(yt,{card:e})})}const Et=y.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf189.js")),[]));function jt({card:e}){return t.jsx(y.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(Et,{card:e})})}const Re=et(function(){const{userAgent:n}=navigator;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),Ct=Qe.div`
    -webkit-transform: perspective(1px) translateZ(0);
    transform: perspective(1px) translateZ(0);
    -webkit-transition-duration: 0.5s;
    transition-duration: 0.5s;
    -webkit-transition-property: color, background-color;
    transition-property: color, background-color;

    &:hover,
    &[activated] {
        background-color: ${e=>e.hexColor};
        border-radius: 4px;
    }
`;function q({dragging:e,hexColor:n}){return t.jsx("div",{className:"flex-shrink-0 skeleton rounded-md ",style:{height:e.height,backgroundColor:n+"40"}})}const le=async(e,n)=>{e.stopPropagation();const{setUsedRespostaRapida:r}=Z.getState(),{sendAction:p}=ve.getState(),{setAcaoEnvioEmMassa:o}=at.getState(),{setQuickReplyAction:g}=it.getState(),d=!!document.querySelector('[data-id="eem-old"]'),f=!!document.querySelector('[data-id="eem-new"]');await He("respostasRapidas")!==!0&&(r(n.id),d?o(n):f?g(n):p(n))};function ce({card:e,state:n,outerRef:r,innerRef:p,hexColor:o}){const{menuContent:g}=xe(),{open:d}=me(),{getAction:f}=ve(),{setAcao:i}=_e(),{open:c}=Be(),x=!!document.querySelector('[data-id="eem-old"], [data-id="eem-new"]'),a=u=>{u.stopPropagation(),close(),i(f(e.id)),c(t.jsx(jt,{card:e}))},l=u=>{u.stopPropagation(),d(t.jsx(St,{card:e}),{placement:"left-end"},r.current,25,{mounted:()=>{var m,s;return(s=(m=r.current)==null?void 0:m.parentNode)==null?void 0:s.setAttribute("activated","")},desmouted:()=>{var m,s;return(s=(m=r.current)==null?void 0:m.parentNode)==null?void 0:s.removeAttribute("activated","")}})};return t.jsx(Ct,{hexColor:o+"70",children:t.jsxs("div",{ref:r,className:"flex flex-shrink-0 flex-col gap-2 ",onClick:u=>le(u,e),children:[n.type==="is-over"&&n.closestEdge==="top"?t.jsx(q,{dragging:n.dragging,hexColor:o}):null,t.jsx("div",{className:"px-1 py-[5px] border-t border-solid",ref:p,style:{borderColor:`${o}60`,...n.type==="preview"&&{width:n.dragging.width,height:n.dragging.height,transform:Re()?void 0:"rotate(4deg)",backgroundColor:`${o}60`,borderRadius:"4px"}},children:t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("div",{children:t.jsx(fe,{type:e.type})}),t.jsx("div",{className:"truncate",style:{maxWidth:`calc(${g.width}px - 139px)`},children:e.titulo})]}),t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:l,children:t.jsx(Pe,{size:18})}),!x&&t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:a,children:t.jsx($e,{size:20})}),t.jsx("span",{className:"text-[var(--icon)] cursor-pointer pulse",onClick:u=>le(u,e),children:t.jsx(ot,{size:18})})]})]})}),n.type==="is-over"&&n.closestEdge==="bottom"?t.jsx(q,{dragging:n.dragging,hexColor:o}):null]})})}const we=Symbol("card");function Ot({card:e,rect:n,columnId:r}){return{[we]:!0,rect:n,card:e,columnId:r}}function A(e){return!!e[we]}function N({source:e}){return!D.getState().activeFilter&&A(e.data)}const Ae=Symbol("card-drop-target");function ke(e){return!!e[Ae]}function Rt({card:e,columnId:n}){return{[Ae]:!0,card:e,columnId:n}}const De=Symbol("column");function wt({column:e}){return{[De]:!0,column:e}}function M(e){return!!e[De]}function Q({source:e}){var n;return!D.getState().activeFilter&&((n=e.data.column)==null?void 0:n.id)!=="not_cat"&&M(e.data)}function Ie(e,n){const r=Object.keys(e),p=Object.keys(n);return r.length!==p.length?!1:r.every(o=>Object.is(e[o],n[o]))}const $={type:"idle"};function At({card:e,columnId:n,hexColor:r}){const{activeFilter:p}=D(),{language:o}=W(),g=y.useRef(null),d=y.useRef(null),[f,i]=y.useState($);return y.useEffect(()=>{const c=g.current,x=d.current;return O(c&&x),J(Ee({element:x,getInitialData:({element:a})=>Ot({card:e,columnId:n,rect:a.getBoundingClientRect()}),onGenerateDragPreview({nativeSetDragImage:a,location:l,source:u}){const m=u.data;O(A(m)),je({nativeSetDragImage:a,getOffset:Oe({element:x,input:l.current.input}),render({container:s}){i({type:"preview",container:s,dragging:x.getBoundingClientRect()})}})},onDragStart(){p&&ge({type:"Info",message:o.dragAndDropNotMoveInActiveFilter,position:"top-right"}),i({type:"is-dragging"})},onDrop(){i($)}}),Se({element:c,getIsSticky:()=>!0,canDrop:N,getData:({element:a,input:l})=>{const u=Rt({card:e,columnId:n});return tt(u,{element:a,input:l,allowedEdges:["top","bottom"]})},onDragEnter({source:a,self:l}){if(!A(a.data)||a.data.card.id===e.id)return;const u=U(l.data);u&&i({type:"is-over",dragging:a.data.rect,closestEdge:u})},onDrag({source:a,self:l}){if(!A(a.data)||a.data.card.id===e.id)return;const u=U(l.data);if(!u)return;const m={type:"is-over",dragging:a.data.rect,closestEdge:u};i(s=>Ie(m,s)?s:m)},onDragLeave({source:a}){if(A(a.data)){if(a.data.card.id===e.id){i({type:"is-dragging-and-left-self"});return}i($)}},onDrop(){i($)}}))},[e,n,p]),t.jsxs(t.Fragment,{children:[t.jsx(ce,{outerRef:g,innerRef:d,state:f,card:e,hexColor:r}),f.type==="preview"?rt.createPortal(t.jsx(ce,{state:f,card:e,hexColor:r}),f.container):null]})}const Y="data-block-board-panning",kt={isBoardMoreObvious:{type:"boolean",title:"Make board more obvious",description:"Add extra spacing and borders to the board scroll container to make it easier to see and play with"},isFPSPanelEnabled:{type:"boolean",title:"FPS Panel",description:"Display a panel with Frame Per Second (FPS) information"},isCPUBurnEnabled:{type:"boolean",title:"Drop FPS 🔥",description:"Start heavy process that will cause the frame rate on the page to drop"},isOverElementAutoScrollEnabled:{type:"boolean",title:"Over element auto scrolling",description:"Should elements automatically scroll when over them"},isOverflowScrollingEnabled:{type:"boolean",title:"Overflow scrolling",description:"Should overflow scrolling be enabled"},boardScrollSpeed:{type:"select",title:"Board auto scroll speed",description:"What should the max horizontal scroll speed the board be?",options:["fast","standard"]},columnScrollSpeed:{type:"select",title:"Column auto scroll speed",description:"What should the max vertical scroll speed for columns be?",options:["fast","standard"]}},Dt={isBoardMoreObvious:!1,isOverElementAutoScrollEnabled:!0,boardScrollSpeed:"fast",columnScrollSpeed:"standard",isFPSPanelEnabled:!1,isCPUBurnEnabled:!1,isOverflowScrollingEnabled:!0},Fe=y.createContext({fields:kt,settings:Dt,update:()=>{},reset:()=>{}}),It={idle:"","is-card-over":"","is-dragging":"","is-column-over":"skeleton"},H={type:"idle"},de=y.memo(function({column:n}){return n.cards.map(r=>t.jsx(At,{card:r,columnId:n.id,hexColor:n.hexColor},r.id))});function Ft({column:e}){const{categoriaOpen:n,setCategoriaOpen:r}=Z(),{menuContent:p}=xe(),{activeFilter:o}=D(),{language:g}=W(),d=y.useRef(null),f=y.useRef(null),i=y.useRef(null),c=y.useRef(null),{settings:x}=y.useContext(Fe),[a,l]=y.useState(H),u=!o&&n.includes(e.id);y.useEffect(()=>{const h=f.current,b=d.current,S=i.current,R=c.current;O(h),O(b),O(S),O(R);const L=wt({column:e});function w({data:v,location:j}){const C=j.current.dropTargets[0],E=!!(C&&ke(C.data)),P={type:"is-card-over",dragging:v.rect,isOverChildCard:E};l(I=>Ie(P,I)?I:P)}return J(Ee({element:S,getInitialData:()=>L,onGenerateDragPreview({source:v,location:j,nativeSetDragImage:C}){const E=v.data;O(M(E)),je({nativeSetDragImage:C,getOffset:Oe({element:S,input:j.current.input}),render({container:P}){const I=R.getBoundingClientRect(),F=R.cloneNode(!0);O(F instanceof HTMLElement),F.style.width=`${I.width}px`,F.style.height=`${I.height}px`,Re()||(F.style.transform="rotate(4deg)"),P.appendChild(F)}})},onDragStart(){o&&ge({type:"Info",message:g.dragAndDropNotMoveInActiveFilter,position:"top-right"}),l({type:"is-dragging"})},onDrop(){l(H)}}),Se({element:h,getData:()=>L,canDrop({source:v}){return N({source:v})||Q({source:v})},getIsSticky:()=>!0,onDragStart({source:v,location:j}){A(v.data)&&w({data:v.data,location:j})},onDragEnter({source:v,location:j}){if(A(v.data)){w({data:v.data,location:j});return}M(v.data)&&v.data.column.id!==e.id&&l({type:"is-column-over"})},onDropTargetChange({source:v,location:j}){if(A(v.data)){w({data:v.data,location:j});return}},onDragLeave({source:v}){M(v.data)&&v.data.column.id===e.id||l(H)},onDrop(){l(H)}}),ye({canScroll({source:v}){return x.isOverElementAutoScrollEnabled?N({source:v}):!1},getConfiguration:()=>({maxScrollSpeed:x.columnScrollSpeed}),element:b}),Ce({element:b,getConfiguration:()=>({maxScrollSpeed:x.columnScrollSpeed}),canScroll({source:v}){return!x.isOverElementAutoScrollEnabled||!x.isOverflowScrollingEnabled?!1:N({source:v})},getOverflow(){return{forTopEdge:{top:1e3},forBottomEdge:{bottom:1e3}}}}))},[e,x]);const m=t.jsx("div",{ref:f,children:t.jsx("div",{ref:c,[Y]:!0,children:t.jsx("div",{className:`flex max-h-full flex-col ${a.type==="is-column-over"?"invisible":""}`,children:t.jsx("div",{ref:i,children:t.jsx("div",{className:`flex flex-col overflow-y-auto min-h-9 cursor-default
              ${!u&&e.cards.length!==0?"pb-2":""}  
            `,ref:d,children:t.jsxs(t.Fragment,{children:[t.jsx(de,{column:e}),a.type==="is-card-over"&&!a.isOverChildCard&&t.jsx("div",{className:"flex-shrink-0 px-3 py-1",children:t.jsx(q,{dragging:a.dragging,hexColor:e.hexColor})})]})})})})})}),s=t.jsx("div",{className:"flex w-full flex-shrink-0 select-none flex-col",ref:f,children:t.jsx("div",{className:`flex max-h-full flex-col rounded-lg border border-solid border-[var(--conversation-header-border)] ${It[a.type]}`,ref:c,style:!u||a.type==="is-column-over"?{backgroundColor:`${e.hexColor}30`,borderColor:`${e.hexColor}60`}:{},[Y]:!0,children:t.jsxs("div",{className:`flex max-h-full flex-col ${a.type==="is-column-over"?"invisible":""}`,children:[t.jsxs("div",{className:"flex flex-row items-center justify-between p-1 gap-1",ref:i,onClick:()=>r(e.id),children:[t.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsx("div",{children:t.jsx(pe,{size:20,style:{color:e.hexColor}})}),t.jsx("span",{className:"truncate font-semibold",style:{maxWidth:`calc(${p.width}px - 90px)`},children:e.name})]}),t.jsx("div",{children:t.jsx("span",{className:"text-[var(--icon)]",children:u?t.jsx(ze,{size:22,stroke:"0.3"}):t.jsx(Te,{size:22,stroke:"0.3"})})})]}),t.jsx("div",{className:`flex flex-col overflow-y-auto px-1 ml-4 
              ${!u&&e.cards.length!==0?"pb-2":""}  
            `,ref:d,children:!u&&t.jsxs(t.Fragment,{children:[t.jsx(de,{column:e}),a.type==="is-card-over"&&!a.isOverChildCard&&t.jsx("div",{className:"flex-shrink-0 px-3 py-1",children:t.jsx(q,{dragging:a.dragging,hexColor:e.hexColor})})]})})]})})});return e.id==="not_cat"?m:s}function ue(){const{sortCategories:e,categories:n}=be(),{sortQuickReply:r,quickReplies:p}=he(),{list:o,updateFilter:g}=D();y.useEffect(g,[n,p]);const d=y.useRef(null),{settings:f}=y.useContext(Fe);return y.useEffect(()=>{const i=d.current;return O(i),J(G({canMonitor:N,onDrop({source:c,location:x}){const a=c.data;if(!A(a))return;const l=x.current.dropTargets[0];if(!l)return;const u=l.data,m=o.columns.findIndex(b=>b.id===a.columnId),s=o.columns[m];if(!s)return;const h=s.cards.findIndex(b=>b.id===a.card.id);if(ke(u)){const b=o.columns.findIndex(E=>E.id===u.columnId),S=o.columns[b];if(s===S){const E=s.cards.findIndex(K=>K.id===u.card.id);if(h===-1||E===-1||h===E)return;const P=U(u),I=ut({axis:"vertical",list:s.cards,startIndex:h,indexOfTarget:E,closestEdgeOfTarget:P}),F={...s,cards:I},ee=Array.from(o.columns);ee[m]=F,r(ee.flatMap(K=>K.cards));return}if(!S)return;const R=S.cards.findIndex(E=>E.id===u.card.id),w=U(u)==="bottom"?R+1:R,v=Array.from(s.cards);v.splice(h,1),S.id==="not_cat"?delete a.card.categoria:a.card.categoria=S.id;const j=Array.from(S.cards);j.splice(w,0,a.card);const C=Array.from(o.columns);C[m]={...s,cards:v},C[b]={...S,cards:j},r(C.flatMap(E=>E.cards));return}if(M(u)){const b=o.columns.findIndex(v=>v.id===u.column.id),S=o.columns[b];if(!S)return;if(s===S){const v=V({list:s.cards,startIndex:h,finishIndex:s.cards.length-1}),j={...s,cards:v},C=Array.from(o.columns);C[m]=j,r(C.flatMap(E=>E.cards));return}const R=Array.from(s.cards);R.splice(h,1),S.id==="not_cat"?delete a.card.categoria:a.card.categoria=S.id;const L=Array.from(S.cards);L.splice(S.cards.length,0,a.card);const w=Array.from(o.columns);w[m]={...s,cards:R},w[b]={...S,cards:L},r(w.flatMap(v=>v.cards));return}}}),G({canMonitor:Q,onDrop({source:c,location:x}){const a=c.data;if(!M(a))return;const l=x.current.dropTargets[0];if(!l||l.data.column.id==="not_cat")return;const u=l.data;if(!M(u))return;const m=o.columns.findIndex(h=>h.id===a.column.id),s=o.columns.findIndex(h=>h.id===u.column.id);m===-1||s===-1||m!==s&&(V({list:o.columns,startIndex:m,finishIndex:s}),e({oldIndex:m,newIndex:s}))}}),ye({canScroll({source:c}){return f.isOverElementAutoScrollEnabled?N({source:c})||Q({source:c}):!1},getConfiguration:()=>({maxScrollSpeed:f.boardScrollSpeed}),element:i}),Ce({element:i,getConfiguration:()=>({maxScrollSpeed:f.boardScrollSpeed}),canScroll({source:c}){return!f.isOverElementAutoScrollEnabled||!f.isOverflowScrollingEnabled?!1:N({source:c})||Q({source:c})},getOverflow(){return{forLeftEdge:{top:1e3,left:1e3,bottom:1e3},forRightEdge:{top:1e3,right:1e3,bottom:1e3}}}}))},[o,f]),y.useEffect(()=>{let i=null;const c=d.current;O(c);function x({startX:l}){let u=l;const m=oe.bindAll(window,[{type:"pointermove",listener(s){const h=s.clientX,b=u-h;u=h,c==null||c.scrollBy({left:b})}},...["pointercancel","pointerup","pointerdown","keydown","resize","click","visibilitychange"].map(s=>({type:s,listener:()=>m()}))],{capture:!0});i=m}const a=oe.bindAll(c,[{type:"pointerdown",listener(l){l.target instanceof HTMLElement&&(l.target.closest(`[${Y}]`)||x({startX:l.clientX}))}}]);return function(){a(),i==null||i()}},[]),t.jsx("div",{className:`flex h-full flex-col ${f.isBoardMoreObvious?"px-32 py-20":""}`,children:t.jsx("div",{className:`flex h-full flex-col gap-2 overflow-x-auto ${f.isBoardMoreObvious?"rounded border-2 border-dashed":""}`,ref:d,children:o.columns.map(i=>t.jsx(Ft,{column:i},i.id))})})}function Nt({listSize:e}){const{quickReplies:n}=he(),{list:r,activeFilter:p}=D(),{language:o}=W(),{setActiveCreateOrEdit:g}=Z(),d=t.jsxs("div",{className:"grid gap-2 mb-2 pb-4",children:[t.jsx(te,{icon:t.jsx(ne,{size:26,className:"text-[var(--primaria)]"}),title:o.quickRepltEmpty,description:o.quickReplyEmptyDes}),t.jsx(re,{name:o.createQuickReply,funcao:()=>g({type:"create",model:"respostaRapida"})})]}),f=t.jsxs("div",{className:"grid gap-2 mb-2 pb-4",children:[t.jsx(te,{icon:t.jsx(ne,{size:26,className:"text-[var(--primaria)]"}),title:o.noQuickReply,description:o.searchQuickReplyNotFilter}),t.jsx(re,{name:o.clear_filter,funcao:()=>D.setState({activeFilter:!1,filter:{search:"",model:{id:"all",parm:""}}})})]});return t.jsxs("div",{children:[t.jsx(dt,{}),t.jsx("div",{className:"overflow-auto pl-2 pr-1",style:{maxHeight:`calc(100vh - ${e}px)`},children:p?r.columns.length===0?f:t.jsx(ue,{}):n.length===0?d:t.jsx(ue,{})})]})}const Wt=Object.freeze(Object.defineProperty({__proto__:null,default:Nt},Symbol.toStringTag,{value:"Module"}));export{jt as E,Wt as i};
