PageSourceSearch

https://web.imobilead.me/_next/static/chunks/pages/filas-4dc051f5a127d00a.js

js imobilead.me collected 2026-10-01 14:24:27 UTC 17,004 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9791],{55938:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filas",function(){return l(10724)}])},74999:function(e,t,l){"use strict";var n=l(37182);l(67294),t.Z=function(e){let{outClass:t,innerClass:l,children:a}=e;return(0,n.tZ)("div",{className:"".concat(t||""," container-full d-flex justify-content-center"),children:(0,n.tZ)("div",{className:"d-flex containerGeral",children:(0,n.tZ)("div",{className:"".concat(l||""," geralText container-fluid"),children:a})})})}},10724:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return J}});var n=l(37182),a=l(67294),i=l(65422),r=l(11163),o=l(74999),s=l(45096),c=l(67545),d=l.n(c),u=l(47235),m=l(81990),h=l(64521),g=l(95858),v=l(13538),f=l(52647),Z=l(75116),p=l(14733),y=l(8993),_=l(52155),w=l(85551),C=l(76260),x=l(25156),N=l(96337),k=l(24548),b=l(42169),S=function(e){let{color:t,title:l,prods:a}=e;return(0,n.tZ)(_.Z,{title:a?a.map(e=>e.titulo_form).join("\n "):l,children:(0,n.tZ)("div",{style:{background:t||"#5EADFF"},className:"tagSm",children:(0,b.Z)(l,22)})})},q=l(19804),A=l(68486),T=l(77395),I=l(62436),Q=l(22002),B=l(52469),E=l(61098),P=l(25305),z=l(65378),X=l(87672),L=l(73522),R=l.n(L);let{Text:O}=P.default,{Panel:M}=z.default;function U(e){let{items:t,title:l}=e,{t:a}=(0,I.$)("queues"),i=e=>{let{userName:t,timestamp:l,queueTitle:i}=e;return(0,n.tZ)("div",{children:(0,n.tZ)(O,{type:"secondary",children:a("logItemModifiedBy",{queueTitle:i,userName:t,timestamp:l})})})};return t&&0!==t.length?(0,n.BX)("div",{className:R().logContainer,children:[(0,n.tZ)(O,{strong:!0,className:R().logTitle,children:l}),(0,n.tZ)("div",{className:R().logCollapse,children:(0,n.tZ)(z.default,{children:t.map(e=>e.error?(0,n.tZ)(M,{header:(0,n.tZ)(O,{type:"danger",children:a("logItemProcessError")}),children:(0,n.tZ)("pre",{children:e.raw})},e.id):(0,n.BX)(M,{header:(0,n.tZ)(i,{userName:e.userName,timestamp:e.timestamp,queueTitle:e.queueTitle}),children:[(0,n.tZ)(X.Z,{orientation:"center",plain:!0,style:{wordWrap:"normal"},children:a("logItemChanges")}),(0,n.BX)("div",{className:R().queueComparisonContainer,children:[(0,n.BX)("div",{className:R().queueColumn,children:[(0,n.tZ)(O,{strong:!0,children:a("logItemOldQueue")}),(0,n.tZ)("pre",{className:R().queueLog,children:e.oldQueue})]}),(0,n.BX)("div",{className:R().queueColumn,children:[(0,n.tZ)(O,{strong:!0,children:a("logItemNewQueue")}),(0,n.tZ)("pre",{className:R().queueLog,children:e.newQueue})]})]})]},e.id))})})]}):null}var j=l(25351);function D(e){var t,l;let{show:i,onClose:r,queueId:o=null,dataVersion:s}=e,{t:c}=(0,I.$)("queues"),{format:d}=(0,k.WJ)(),[u,m]=(0,a.useState)([]),[h,g]=(0,a.useState)([]),[v,f]=(0,a.useState)(!1),Z=(0,a.useRef)({manual:null,automatic:null,dataVersion:null}),p=(0,a.useCallback)(e=>e.map(e=>{try{let t=e.description,l=t.match(/Modificada a fila: (.*?) ID: (\d+)/),n=l?l[1]:"",a=l?parseInt(l[2]):null,i=t.match(/editada por (.*?) \d+/),r=i?i[1]:c("logItemSystemUser"),o=t.match(/Dados: (\{.*\})/);if(!o)throw Error("Formato de dados n\xe3o encontrado");let s=JSON.parse(o[1]),u=c("logItemNotAvailable");(null==s?void 0:s.newQueue)&&(Array.isArray(s.newQueue)?u=s.newQueue.join("\n"):"string"==typeof s.newQueue&&(u=s.newQueue));let m=c("logItemNotAvailable");return(null==s?void 0:s.oldQueue)&&(Array.isArray(s.oldQueue)?m=s.oldQueue.join("\n"):"string"==typeof s.oldQueue&&(m=s.oldQueue)),{id:e.id,queueId:a,userName:r,newQueue:u,oldQueue:m,timestamp:d(e.createdAt,k.lv.dateTimeSeconds),queueTitle:n||""}}catch(t){return console.error("Erro ao processar log:",t),{id:e.id,error:!0,raw:e.description}}}),[c,d]),y=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(f(!0),e||null===Z.current.manual||null===Z.current.automatic||Z.current.dataVersion!==s){let e=new URLSearchParams({type:"QUEUE-UPDATE"}),t=new URLSearchParams({type:"QUEUE-AUTOMATIC-UPDATE"});try{let{data:l}=await E.Z.get("/primelead-api-user/logs?".concat(e)),{data:n}=await E.Z.get("/primelead-api-user/logs?".concat(t)),a=p(l),i=p(n);Z.current={manual:a,automatic:i,dataVersion:s}}catch(e){console.error("Erro ao buscar logs:",e),f(!1);return}}if(o){let e=Z.current.manual.filter(e=>e.queueId===o),t=Z.current.automatic.filter(e=>e.queueId===o);console.log("Filtered Manual Logs:",e),console.log("Filtered Automatic Logs:",t),m(e),g(t)}else m(Z.current.manual),g(Z.current.automatic);f(!1)},[p,o,s]);(0,a.useEffect)(()=>{i&&y()},[i,y]);let _=o?c("latestChangesTitle",{title:(null===(t=u[0])||void 0===t?void 0:t.queueTitle)||(null===(l=h[0])||void 0===l?void 0:l.queueTitle)||c("latestChangesQueueFallback")}):c("latestChangesAllTitle");return(0,n.tZ)(B.default,{width:"80%",open:i,title:_,style:{maxWidth:1080}
1,destroyOnClose:!0,onCancel:r,footer:[(0,n.tZ)(w.ZP,{onClick:r,children:c("latestChangesBack")},"back")],children:(0,n.tZ)(j.Z,{loading:v,children:0!==u.length||0!==h.length||v?(0,n.BX)(n.HY,{children:[(0,n.tZ)(U,{items:u,title:c("latestChangesManual")}),(0,n.tZ)(U,{items:h,title:c("latestChangesAutomatic")})]}):(0,n.tZ)("div",{style:{textAlign:"center",padding:"20px",color:"#999"},children:o?c("latestChangesNoChangesQueue"):c("latestChangesNoChanges")})})})}var F=l(52209),W=l(39155),H=l(90025);let{Search:V}=y.default;var G=function(){let e=(0,r.useRouter)(),{user:t,selectedImob:l}=(0,i.v9)(e=>e.auth),{activeTour:c,pauseTour:y}=(0,W.t)(),[b,B]=(0,a.useState)(!1),[E,P]=(0,a.useState)([]),[z,X]=(0,a.useState)(),[L,R]=(0,a.useState)(),{t:O}=(0,I.$)(["queues","dashboard","common"]),{format:M}=(0,k.WJ)(),[U,j]=(0,a.useState)([]),[G,J]=(0,a.useState)([]),[Y,$]=(0,a.useState)(""),[K,ee]=(0,a.useState)(!1),[et,el]=(0,a.useState)(null),[en,ea]=(0,a.useState)(!1),ei=(0,a.useRef)(null),er=()=>{if(!(0,H.q)(null==t?void 0:t.imobiliaria,l)){ea(!!(null==l?void 0:l.leadQueueEdit));return}ea(!0)},[eo,es]=(0,a.useState)({current:1,pageSize:10,hideOnSinglePage:!0}),[ec,ed]=(0,a.useState)({current:1,pageSize:10}),eu=(0,a.useCallback)(async(e,t)=>{if(b)return;B(!0);let l=1,n=10;e&&(l=e.current,n=e.pageSize);try{let{queues:e,total:a}=await (0,q.WL)({search:!t&&(null==L?void 0:L.length)>0?L:null,page:l,limit:n,withRelations:!0,sort:"updated_at"});P(e),es(e=>({...e,current:l,pageSize:n,total:a}))}catch(e){console.log(e)}B(!1)},[t,b,eo,L,l]),em="dd MMMM yyyy, hh:mm a",eh=[{title:O("common:order"),dataIndex:"id",className:d().colAvat,width:50,render:(e,t,l)=>(0,n.tZ)("div",{className:d().avat,children:(0,n.tZ)("div",{className:d().profilePic,style:{backgroundImage:"url(".concat((null==t?void 0:t.avatar)?t.avatar.url:"/icos/avatar.png",")")},children:(0,n.tZ)("span",{className:0===l?d().active:"",children:(ec.current-1)*ec.pageSize+l+1})})})},{title:O("common:name"),dataIndex:"nome",width:150},{title:O("common:email"),dataIndex:"email",width:150,responsive:["sm"]},{title:O("common:phone"),dataIndex:"telefone",width:150,responsive:["sm"]},{title:"Checkin",key:"checkin",dataIndex:"checkin",width:80,responsive:["sm"],render:e=>(0,n.tZ)("div",{className:"d-flex align-items-center justify-content-center",children:e?(0,n.tZ)(m.Z,{style:{fontSize:25,color:"#2bc155"}}):(0,n.tZ)(h.Z,{style:{fontSize:25,color:"#e5577a"}})})}],eg=(0,a.useCallback)(async e=>{var t;let l=U.find(t=>t.value===e),n=[],a=null==l?void 0:null===(t=l.fila)||void 0===t?void 0:t.split(";");a.length>0&&a.map(e=>{let t=l.corretores.find(t=>t.email===e);n.push(t)}),$(e),J(n)},[U]),ev=(0,a.useCallback)(async e=>{if(!b){B(!0);try{await (0,q.Nw)(e),A.Am.success(O("queueRemovedSuccess")),eu()}catch(e){var t;console.log(e),A.Am.error((null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)===403?O("queueNoPermission"):O("queueRemovedError"))}B(!1)}},[b,eu]),ef=(0,a.useCallback)(e=>{if((null==e?void 0:e.length)>0){var t,l;j(e.map(e=>({...e,value:String(e.id),label:e.titulo})));let n=[];((null===(l=e[0])||void 0===l?void 0:null===(t=l.fila)||void 0===t?void 0:t.split(";"))||[]).forEach(t=>{var l,a;let i=null===(a=e[0])||void 0===a?void 0:null===(l=a.corretores)||void 0===l?void 0:l.find(e=>e.email===t);i&&n.push(i)}),$(String(e[0].id)),J(n)}else j([])},[]),eZ=(0,a.useCallback)(async()=>{if(t){B(!0);try{let{queues:e}=await (0,q.WL)({status:!0,limit:500,withRelations:!0,sort:"updated_at"});ef(e)}catch(e){console.log(e)}B(!1)}},[t,l,ef]),ep=(0,a.useCallback)(e=>"CRONOGRAM"===e.queueMode?O("schedule"):"AUTOMATIC_EXIT"===e.queueMode||e.shouldClearQueueAutomatically?O("automaticExit"):"---",[O]),ey=[{title:O("colTitle"),dataIndex:"titulo",key:"titulo",width:150,sorter:(e,t)=>{var l;return null==e?void 0:null===(l=e.nome)||void 0===l?void 0:l.localeCompare(t.nome)}
1,sortDirections:["descend","ascend"],render:e=>(0,n.tZ)("div",{style:{wordWrap:"break-word",wordBreak:"break-word"},children:(0,n.tZ)(T.Z,{highlightStyle:{backgroundColor:"#ffc069",padding:0},searchWords:[z],autoEscape:!0,textToHighlight:e?e.toString():""})})},{title:O("colManagement"),key:"typeOfManagerBrokers",width:80,render:(e,t)=>(0,n.tZ)("span",{children:ep(t)})},{title:O("colManagers"),dataIndex:"managers",key:"managers",width:200,render:(e,t)=>{var l,a;let i=(null==t?void 0:null===(l=t.gestor)||void 0===l?void 0:l.nome)?t.gestor.nome:"".concat(null==t?void 0:null===(a=t.managers)||void 0===a?void 0:a.map(e=>(null==e?void 0:e.nome)?" ".concat(null==e?void 0:e.nome):"- -"));return(0,n.tZ)("span",{children:(0,Q.aS)(i)})}},{title:O("colOrigins"),dataIndex:"grupos",key:"grupos",responsive:["md"],width:150,render:(e,t)=>{var l,a,i,r,o;return(0,n.tZ)("div",{className:"d-flex flex-row flex-wrap",children:(null==t?void 0:null===(l=t.grupos)||void 0===l?void 0:l.length)>3?(0,n.BX)(n.HY,{children:[null==t?void 0:null===(a=t.grupos)||void 0===a?void 0:a.filter((e,t)=>t+1<=3).map(e=>(0,n.tZ)(S,{color:e.cor,title:e.titulo},e.id)),(0,n.tZ)(S,{title:"+ ".concat((null==t?void 0:null===(i=t.grupos)||void 0===i?void 0:i.length)-3,"..."),prods:null==t?void 0:null===(r=t.grupos)||void 0===r?void 0:r.filter((e,t)=>t+1>3)})]}):(0,n.tZ)(n.HY,{children:null==t?void 0:null===(o=t.grupos)||void 0===o?void 0:o.map(e=>(0,n.tZ)(S,{color:e.cor,title:e.titulo},e.id))})})}},{title:O("colCreatedAt"),dataIndex:"created_at",key:"created_at",responsive:["md"],width:160,render:(e,t)=>(0,n.tZ)("span",{children:t.nova_data?M(t.nova_data,em):M(t.created_at,em)})},{title:"Status",key:"status",dataIndex:"status",responsive:["md"],width:80,sorter:(e,t)=>
1e.status-t.status,sortDirections:["descend","ascend"],render:e=>(0,n.tZ)("div",{className:"d-flex align-items-center justify-content-center",children:e?(0,n.tZ)(_.Z,{title:O("activeQueue"),children:(0,n.tZ)(m.Z,{style:{fontSize:25,color:"#2bc155"}})}):(0,n.tZ)(_.Z,{title:O("inactiveQueue"),children:(0,n.tZ)(h.Z,{style:{fontSize:25,color:"#e5577a"}})})})},{title:"Timer",key:"timerAtivo",dataIndex:"timerAtivo",responsive:["md"],width:80,sorter:(e,t)=>e.timerAtivo-t.timerAtivo,sortDirections:["descend","ascend"],render:e=>(0,n.tZ)("div",{className:"d-flex align-items-center justify-content-center",children:e?(0,n.tZ)(_.Z,{title:O("activeTimer"),children:(0,n.tZ)(m.Z,{style:{fontSize:25,color:"#2bc155"}})}):(0,n.tZ)(_.Z,{title:O("inactiveTimer"),children:(0,n.tZ)(h.Z,{style:{fontSize:25,color:"#e5577a"}})})})},{title:O("colAction"),key:"action",width:120,render:(e,t)=>(0,n.BX)("div",{className:"d-flex align-items-center justify-content-center",children:[(0,n.tZ)(_.Z,{title:O("editQueue"),children:(0,n.tZ)(w.ZP,{onClick:()=>eC(t),type:"primary",size:"small",icon:(0,n.tZ)(g.Z,{}),disabled:!en})}),(0,n.tZ)(_.Z,{title:O("queueChangesHistory"),children:(0,n.tZ)(w.ZP,{onClick:()=>eN(t.id),style:{marginLeft:10},size:"small",icon:(0,n.tZ)(v.Z,{style:{color:"black"}})})}),(0,n.tZ)(C.Z,{disabled:!en,title:O("confirmDeleteQueue"),onConfirm:()=>ev(t.id),okText:O("yes"),cancelText:O("no"),placement:"bottom",children:(0,n.tZ)(_.Z,{title:O("deleteQueue"),children:(0,n.tZ)(w.ZP,{disabled:!en,style:{marginLeft:10},size:"small",icon:(0,n.tZ)(f.Z,{style:{color:"#d63031"}})})})})]})}],e_=()=>{X(""),R(""),eu(null,!0)},ew=()=>{"queue"===c&&(y(),localStorage.setItem("imobilead_queue_form_tour_pending","true")),e.push("/filas/nova")},eC=t=>{e.push("/filas/".concat(t.id))},ex=(0,a.useCallback)(()=>{ee(!1),el(null)},[]),eN=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;el(e),ee(!0)},[]),ek=(0,a.useCallback)(()=>{X(L),eu()},[L,eu]),eb=e=>{R(e.target.value?e.target.value:"")};return(0,a.useEffect)(()=>{let e=null==l?void 0:l.id;t&&e&&ei.current!==e&&(ei.current=e,er(),eu(),eZ())},[t,null==l?void 0:l.id]),(0,a.useEffect)(()=>{if(b)return;let t=new URLSearchParams(window.location.search).get("queue");t&&e.push("/filas/".concat(t))},[b,e]),(0,n.BX)(s.Z,{title:O("pageTitle"),children:[(0,n.BX)(o.Z,{innerClass:"allPad ".concat(d().dashboard," flex-column"),children:[(0,n.tZ)("div",{className:"d-flex flex-lg-row flex-column align-items-center align-items-lg-start",children:(0,n.tZ)("div",{className:"d-flex flex-column",children:(0,n.tZ)("h4",{children:O("title")})})}),(0,n.tZ)("div",{className:"d-flex",children:(0,n.tZ)("div",{className:"d-flex flex-column cardn ".concat(d().cardBig),children:(null==U?void 0:U.length)>0&&(0,n.BX)("div",{className:"d-flex w-100 flex-column ".concat(d().cardQueue),children:[(0,n.BX)("div",{className:"d-flex flex-lg-row align-items-start flex-column w-100 justify-content-between",children:[(0,n.BX)("div",{className:"d-flex flex-column",children:[(0,n.tZ)("h5",{children:O("activeQueues")}),(0,n.tZ)("small",{children:O("queuerOrder")})]}),(0,n.tZ)("div",{className:"d-flex ".concat(d().btnChartRow),children:(0,n.tZ)(x.default,{placeholder:O("chooseQueue"),style:{width:220},value:Y,variant:"borderless",onChange:eg,options:U,showSearch:!0,optionFilterProp:"children",filterOption:u.Z})})]}),(0,n.tZ)("div",{children:(0,n.tZ)(N.Z,{scroll:{y:200},className:d().antd,dataSource:G,columns:eh,pagination:ec,onChange:e=>{if(e){let t=e.current,l=e.pageSize;ed({...ec,current:t,pageSize:l})}}})})]})})}),(0,n.tZ)("h4",{children:O("manageQueues")}),(0,n.tZ)(N.Z,{columns:ey,dataSource:E,bordered:!0,loading:b,title:()=>(0,n.tZ)("div",{className:"d-flex flex-column w-100",children:(0,n.BX)("div",{className:"d-flex flex-lg-row justify-content-between flex-column",children:[(0,n.BX)("div",{children:[(0,n.tZ)(V,{value:L,placeholder:O("searchPlaceholder"),onChange:eb,onSearch:ek,className:"".concat(d().input," ").concat(d().mRight),size:"small"}),z&&z.length>0&&(0,n.tZ)(w.ZP,{size:"small",onClick:e_,icon:(0,n.tZ)(Z.Z,{}),children:O("clear")})]}),(0,n.tZ)("div",{style:{gap:"8px",display:"flex"},children:(0,n.BX)(w.ZP,{type:"primary",onClick:ew,size:"small",className:"queue-add-btn",children:[O("addQueue")," ",(0,n.tZ)(p.Z,{})]})})]})}),onChange:eu,pagination:eo})]}),(0,n.tZ)(D,{show:K,onClose:ex,queueId:et,dataVersion:E}),(0,n.tZ)(F.Z,{variant:"queues"})]})};function J(){return(0,n.tZ)(G,{})}},19804:function(e,t,l){"use strict";l.d(t,{Nw:function(){return c},WL:function(){return i},jd:function(){return o},pT:function(){return s},wo:function(){return r}});var n=l(61098);let a="/primelead-api-integration/queues";async function i(){let{search:e=null,page:t=1,limit:l=50,status:i=null,withRelations:r=!1,sort:o="id"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s={page:t,limit:l,sort:o};e&&(s.search=e),null!=i&&(s.status=String(i)),r&&(s.withRelations="true");let{data:c}=await n.Z.get(a,{params:s});return c||{queues:[],total:0,page:t,limit:l,totalPages:0}}async function r(e){let{data:t}=await n.Z.get("".concat(a,"/").concat(e));return t}async function o(e){let{data:t}=await n.Z.post(a,e);return t}async function s(e,t){let{data:l}=await n.Z.put("".concat(a,"/").concat(e),t);return l}async function c(e){let{data:t}=await n.Z.delete("".concat(a,"/").concat(e));return t}},47235:function(e,t){"use strict";t.Z=(e,t)=>Array.isArray(t.children)?t.children.find(t=>t.toLowerCase().indexOf(e.toLowerCase())>=0):t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0},73522:function(e){e.exports={logContainer:"style_logContainer__o2UIl",logTitle:"style_logTitle__e0Y2N",logCollapse:"style_logCollapse__jwA5I",queueComparisonContainer:"style_queueComparisonContainer__3v_ik",queueColumn:"style_queueColumn__LFegN",queueLog:"style_queueLog__HqTPv"}},67545:function(e){e.exports={dashboard:"style_dashboard__VNlt_",mRight:"style_mRight__GeuTt",input:"style_input__zNQyy",filterCol:"style_filterCol__ms6Rj",rowBorder:"style_rowBorder__fU84n",mid:"style_mid__q2Ckp",big:"style_big__8LLe2",checks:"style_checks__Omt7k",small:"style_small__JVNTC",sm:"style_sm__aQqzA",end:"style_end__RkAO6",downward:"style_downward__EkHwb",upward:"style_upward__6TnKC",btnChartRow:"style_btnChartRow__CtrEw",cardBig:"style_cardBig__AhFfS",avat:"style_avat__lXD39",profilePic:"style_profilePic__5zTit",colAvat:"style_colAvat__KXGXo",queueProductButton:"style_queueProductButton__zzeDD",searchBox:"style_searchBox___93Iv"}}},function(e){e.O(0,[9570,1827,4885,1216,3159,5096,2785,2888,9774,179],function(){return e(e.s=55938)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.