1/*! For license information please see 278.72999195.bundle.js.LICENSE.txt */ 2"use strict";(self.webpackChunkmobicity_web=self.webpackChunkmobicity_web||[]).push([[278],{40278(e,t,r){r.r(t),r.d(t,{default:()=>J});var n=r(96540),a=r(86743),o=r(7191),i=r(23411),c=r(82972),s=r(56347),u=r(23537),l=(r(68578),r(53110)),p=r(45504),h=r(34970),d=r(44303),f=r(89576),m=r(95),y=r(39444),v=r(69894),g=r(21953),b=r(7301),O=r(62088),w=r(19577),P=r(23820),C=r(54472),S=r.n(C),A=r(83350),E=r(9581),x=r(61225),k=r(29647),j=r(19248),_=r(33345),I=r(57991);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function M(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var s=n&&n.prototype instanceof c?n:c,u=Object.create(s.prototype);return B(u,"_invoke",function(r,n,a){var o,c,s,u=0,l=a||[],p=!1,h={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return o=t,c=0,s=e,h.n=r,i}};function d(r,n){for(c=r,s=n,t=0;!p&&u&&!a&&t<l.length;t++){var a,o=l[t],d=h.p,f=o[2];r>3?(a=f===n)&&(s=o[(c=o[4])?5:(c=3,3)],o[4]=o[5]=e):o[0]<=d&&((a=r<2&&d<o[1])?(c=0,h.v=n,h.n=o[1]):d<f&&(a=r<3||o[0]>n||n>f)&&(o[4]=r,o[5]=n,h.n=f,c=0))}if(a||r>1)return i;throw p=!0,n}return function(a,l,f){if(u>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,f),c=l,s=f;(t=c<2?e:s)||!p;){o||(c?c<3?(c>1&&(h.n=-1),d(c,s)):h.n=s:h.v=s);try{if(u=2,o){if(c||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,c<2&&(c=0)}else 1===c&&(t=o.return)&&t.call(o),c<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),c=1);o=e}else if((t=(p=h.n<0)?s:r.call(n,h))!==i)break}catch(t){o=e,c=1,s=t}finally{u=1}}return{value:t,done:p}}}(r,a,o),!0),u}var i={};function c(){}function s(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(B(t={},n,function(){return this}),t),p=u.prototype=c.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,B(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return s.prototype=u,B(p,"constructor",u),B(u,"constructor",s),s.displayName="GeneratorFunction",B(u,a,"GeneratorFunction"),B(p),B(p,a,"Generator"),B(p,n,function(){return this}),B(p,"toString",function(){return"[object Generator]"}),(M=function(){return{w:o,m:h}})()}function B(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}B=function(e,t,r,n){function o(t,r){B(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},B(e,t,r,n)}function N(e,t,r,n,a,o,i){try{var c=e[o](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,a)}function D(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){N(o,n,a,i,c,"next",e)}function c(e){N(o,n,a,i,c,"throw",e)}i(void 0)})}}function q(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,z(n.key),n)}}function R(e,t,r){return t=F(t),function(e,t){if(t&&("object"==T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,G()?Reflect.construct(t,r||[],F(e).constructor):t.apply(e,r))}function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(G=function(){return!!e})()}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}function V(e,t,r){return(t=z(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z(e){var t=function(e){if("object"!=T(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==T(t)?t:t+""}var L=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return V(e=R(this,t,[].concat(n)),"state",{source:l.qm.source(),loading:!0,page:0,purchaseOrderItemCount:0,isOpened:!1,purchaseOrderItem:[],openM
2odalChangeClients:!1,openModalChangePartners:!1,notFoundCompanies:!1,multiSearchOptions:[{title:"Pesquisar por empresa",action:function(){return e.handleOpenSearchModal("company")}},{title:"Pesquisar por parceiro",action:function(){return e.handleOpenSearchModal("partner")}}],searchType:"company",timezone:S().determine().name()}),V(e,"setStateAsync",function(t){return new Promise(function(r){return e.setState(t,r)})}),V(e,"sleep",function(){var e=D(M().m(function e(t){return M().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e){return setTimeout(e,t)}))},e)}));return function(t){return e.apply(this,arguments)}}()),V(e,"setPurchaseOrders",D(M().m(function t(){var r,n,a,o,i,c,s,u,l,p,h,f,m,y,v,g,b,O,w,P,C,S,A,E=arguments;return M().w(function(t){for(;;)switch(t.p=t.n){case 0:if(s=E.length>0&&void 0!==E[0]?E[0]:{},u=E.length>1&&void 0!==E[1]?E[1]:{},l=e.props,p=l.dispatchChangeSearchedCompany,h=l.dispatchChangeSearchedPartner,!(Object.keys(s).length>0)){t.n=1;break}return t.n=1,p(s);case 1:if(!(Object.keys(u).length>0)){t.n=2;break}return t.n=2,h(u);case 2:return f=e.props,m=f.searchedCompany,y=f.searchedPartner,v=e.state,g=v.page,b=v.source,O=v.timezone,w=8*g,P={},t.p=3,t.n=4,(0,d.ec)(w,null==m?void 0:m._id,null==y?void 0:y._id,O,b.token);case 4:P=t.v,t.n=7;break;case 5:if(t.p=5,!(A=t.v).__CANCEL__){t.n=6;break}return t.a(2);case 6:return t.a(2,console.log("error",A));case 7:return C=[],S=[],null!=m&&m.name?(S.push({label:"pela empresa",value:null==m?void 0:m.name}),C.push({title:"Desfiltrar empresa",action:function(){var t=D(M().m(function t(){return M().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,p(void 0);case 1:return s=void 0,e.setState({page:0}),t.n=2,e.setPurchaseOrders(s,u);case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}()})):C.push({title:"Pesquisar por empresa",action:function(){return e.handleOpenSearchModal("company")}}),null!=y&&y.name?(S.push({label:"pelo parceiro",value:null==y?void 0:y.name}),C.push({title:"Desfiltrar parceiro",action:function(){var t=D(M().m(function t(){return M().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,h(void 0);case 1:return u=void 0,e.setState({page:0}),t.n=2,e.setPurchaseOrders(s,u);case 2:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}()})):C.push({title:"Pesquisar por parceiro",action:function(){return e.handleOpenSearchModal("partner")}}),t.n=8,e.setStateAsync({purchaseOrderItem:null!==(r=null===(n=P)||void 0===n?void 0:n.purchaseOrders)&&void 0!==r?r:[],purchaseOrderItemCount:null!==(a=null===(o=P)||void 0===o?void 0:o.purchaseOrdersCount)&&void 0!==a?a:0,loading:!1,openModalChangeClients:!1,openModalChangePartners:!1,filters:S,search:(null!=S?S:[]).length>1?"Pesquisando vários...":null!==(i=null===(c=(null!=S?S:[])[0])||void 0===c?void 0:c.value)&&void 0!==i?i:"",isSearched:null!=(null==m?void 0:m._id)||null!=(null==y?void 0:y._id),multiSearchOptions:C});case 8:return t.a(2)}},t,null,[[3,5]])}))),V(e,"goBack",D(M().m(function t(){var r,n,a;return M().w(function(t){for(;;)switch(t.n){case 0:return r=e.props,n=r.dispatchChangeSearchedCompany,a=r.dispatchChangeSearchedPartner,t.n=1,n();case 1:return t.n=2,a();case 2:e.setPurchaseOrders();case 3:return t.a(2)}},t)}))),V(e,"handleNextPage",function(){var t=D(M().m(function t(r){return M().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.setStateAsync({page:r.selected});case 1:e.setPurchaseOrders();case 2:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()),V(e,"handleDropdownToggle",function(){e.setState({isOpened:!e.state.isOpened})}),V(e,"handleOpenSearchModal",function(t){if(!((e.state.search||"").length<3))return e.setState(V({},"company"===t?"openModalChangeClients":"openModalChangePartners",!0))}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(t,e),r=t,s=[{key:"componentDidMount",value:function(){this.setPurchaseOrders()}},{key:"componentWillUnmount",value:function(){var e,t;(null!==(e=null===(t=this.props.history)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.pathname)&&void 0!==e?e:"").includes("purchaseOrders")||this.props.dispatchResetToInitialState()}},{key:"render",value:function(){var e,t=this,r=this.state,s=r.loading,u=r.purchaseOrderItem;return this.props.user&&30!=this.props.user.access?n.createElement(c.A,null):(document.title="Pedidos de compra em aberto",s?n.createElement(p.A,null):n.createElement("div",null,n.createElement(o.A,null,n.createElement(a.A.Container,{height:"100%"},n.createElement(i.A,{display:"flex",flexDirection:"column"},n.createElement(v.A,{crumbs:null===(e=this.props)||void 0===e?void 0:e.crumbs})),n.createElement(i.A,{display:"flex",gap:P.A.spacing.xxxs,width:"50%",justifyContent:"flex-end"},n.createElement(g.A,{value:this.state.search,onChange:function(e){return t.setState({search:e})},handleSearch:function(){return t.handleOpenSearchModal("company")},clickingOptions:this.state.multiSearchOptions,maxHeight:"160px",overflowX:"hidden",overflowY:"scroll",marginTop:"0px",placeholder:"Pesquisar por empresa...",top:"35px",showBackButton:this.state.isSearched,onBack:this.goBack}))),n.createElement(i.A,{display:"absolute",transform:"translate(0px, -16px)"},n.createElement(_.A,{filters:this.state.filters})),n.createElement(E.A,{heightOffset:98},0!=this.state.purchaseOrderItemCount&&n.createElement(i.A,{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"space-between",gap:P.A.spacing.xxxs},n.createElement(i.A,{width:"100%",height:"".concat(window.innerHeight+24.32,"px"),maxHeight:"".concat(window.innerHeight+24.32,"px"),display:"flex",alignItems:"center",flexDirection:"column",overflowY:"scroll",gap:P.A.spacing.xxxs},(u||[]).map(function(e,r){return n.createElement(f.K,{onClick:function(){var r={purchaseOrderId:e.purchaseOrderId};localStorage.setItem("context",JSON.stringify(r)),t.props.history.push("/purchaseOrders/".concat(e.purchaseOrderId))},key:r},n.createElement(i.A,{display:"flex",width:"25%"},n.createElement(w.A,{title:(e.formattedPeriodName||"").toUpperCase(),subtitle:e.accountName,image:null==e?void 0:e.accountPicture,isProviderPicture:!0})),n.createElement(I.A,null),n.createElement(w.A,{subtitle:e.companyName,image:null==e?void 0:e.companyPicture}),n.createElement(I.A,null),n.createElement(O.A,{title:"PERÃODO",value:e.formattedPeriod,image:"calendar"}),n.createElement(I.A,null),n.createElement(O.A,{title:"VALOR TOTAL",value:"".concat((0,A.A)(e.totalAmount)),image:"calculator"}))})),n.createElement(h.A,{page:this.state.page,totalPage:(0,j.A)(this.state.purchaseOrderItemCount,8),handleNextPage:this.handleNextPage,totalItem:this.state.purchaseOrderItemCount,disableInitialCallback:!0})),0==this.state.purchaseOrderItemCount&&n.createElement(i.A,{width:"100%",height:"100%",display:"flex"},n.createElement(b.A,{title:this.state.isSearched?void 0:"Não existem pedidos de compra em aberto",subtitle:this.state.isSearched?void 0:"Você poderá acessar os pedidos de compra que foram aprovados na aba âContas a pagarâ"}))),this.state.openModalChangeClients&&n.createElement(m.A,{active:!0,onClose:function(e){t.setState({page:0}),t.setPurchaseOrders(e)},onBack:function(){t.setState({openModalChangeClients:!1,search:""})},history:this.props.history,title:"Buscar por empresas",search:this.state.search}),this.state.openModalChangePartners&&n.createElement(y.A,{active:!0,onClose:function(e){t.setState({page:0}),t.setPurchaseOrders(void 0,e)},onBack:function(){return t.setState({openModalChangePartners:!1,search:""})},history:this.props.history,title:"Buscar por parceiros",search:this.state.search}))))}}],s&&q(r.prototype,s),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,s}(n.Component),U={dispatchChangeSearchedCompany:k.z2,dispatchChangeSearchedPartner:k.yD,dispatchResetToInitialState:k.u2},Y=(0,u.A)((0,x.Ng)(function(e){return{searchedCompany:e.purchaseOrdersView.searchedCompany,searchedPartner:e.purchaseOrdersView.searchedPartner}},U)(L));const J=(0,s.withRouter)(Y)}}]);
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.