vendor: 4,408 bytes, lines 1-2
1/*! For license information please see 20174-d3ba3d74d7468004f97f.js.LICENSE.txt */ 2"use strict";(self.webpackChunknetconv=self.webpackChunknetconv||[]).push([[20174,61798],{20174:function(e,r,n){n.d(r,{A9:function(){return h},Ay:function(){return m}});var t=n(96540),o=n(12739),i=n(36628);function a(){var e,r,n="function"==typeof Symbol?Symbol:{},t=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,t,o,i){var a=t&&t.prototype instanceof c?t:c,d=Object.create(a.prototype);return u(d,"_invoke",function(n,t,o){var i,a,u,c=0,d=o||[],s=!1,f={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(r,n){return i=r,a=0,u=e,f.n=n,l}};function v(n,t){for(a=n,u=t,r=0;!s&&c&&!o&&r<d.length;r++){var o,i=d[r],v=f.p,p=i[2];n>3?(o=p===t)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=n<2&&v<i[1])?(a=0,f.v=t,f.n=i[1]):v<p&&(o=n<3||i[0]>t||t>p)&&(i[4]=n,i[5]=t,f.n=p,a=0))}if(o||n>1)return l;throw s=!0,t}return function(o,d,p){if(c>1)throw TypeError("Generator is already running");for(s&&1===d&&v(d,p),a=d,u=p;(r=a<2?e:u)||!s;){i||(a?a<3?(a>1&&(f.n=-1),v(a,u)):f.n=u:f.v=u);try{if(c=2,i){if(a||(o="next"),r=i[o]){if(!(r=r.call(i,u)))throw TypeError("iterator result is not an object");if(!r.done)return r;u=r.value,a<2&&(a=0)}else 1===a&&(r=i.return)&&r.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((r=(s=f.n<0)?u:n.call(t,f))!==l)break}catch(r){i=e,a=1,u=r}finally{c=1}}return{value:r,done:s}}}(n,o,i),!0),d}var l={};function c(){}function d(){}function s(){}r=Object.getPrototypeOf;var f=[][t]?r(r([][t]())):(u(r={},t,function(){return this}),r),v=s.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,u(e,o,"GeneratorFunction")),e.prototype=Object.create(v),e}return d.prototype=s,u(v,"constructor",s),u(s,"constructor",d),d.displayName="GeneratorFunction",u(s,o,"GeneratorFunction"),u(v),u(v,o,"Generator"),u(v,t,function(){return this}),u(v,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:p}})()}function u(e,r,n,t){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,r,n,t){function i(r,n){u(e,r,function(e){return this._invoke(r,n,e)})}r?o?o(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(i("next",0),i("throw",1),i("return",2))},u(e,r,n,t)}function l(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,t)}return n}function c(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?l(Object(n),!0).forEach(function(r){d(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,r||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function s(e,r,n,t,o,i,a){try{var u=e[i](a),l=u.value}catch(e){return void n(e)}u.done?r(l):Promise.resolve(l).then(t,o)}function f(e){return function(){var r=this,n=arguments;return new Promise(function(t,o){var i=e.apply(r,n);function a(e){s(i,t,o,a,u,"next",e)}function u(e){s(i,t,o,a,u,"throw",e)}a(void 0)})}}function v(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===r){if(Object(n)!==n)return;l=!1}else for(;!(l=(t=i.call(n)).done)&&(u.push(t.value),u.length!==r);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,r)||function(e,r){if(e){if("string"==typeof e)return p(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,r):void 0}}
2(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}var b=3e4,g=function(e){return"ERR_CANCELED"===(null===e||void 0===e?void 0:e.code)||"CanceledError"===(null===e||void 0===e?void 0:e.name)};function y(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();if(!e)return!1;if(e.stale)return!0;var n=new Date(e.validated_at||e.generated_at).getTime();return!!Number.isFinite(n)&&r-n>1e3*Number(e.stale_after_seconds||30)}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,t.useMemo)(function(){return JSON.stringify(e)},[e]),n=v((0,t.useState)({data:null,loading:!0,refreshing:!1,error:null}),2),u=n[0],l=n[1],d=(0,t.useRef)(null),s=(0,t.useRef)(new Map),p=(0,t.useRef)(new Map),m=(0,t.useCallback)(f(a().m(function e(){var n,t,i,u,f,v,b,y,m,h,E=arguments;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=(E.length>0&&void 0!==E[0]?E[0]:{}).background,i=void 0!==t&&t,null===(n=d.current)||void 0===n||n.abort(),u=new AbortController,d.current=u,f=JSON.parse(r),v=p.current.get(r),l({data:(null===v||void 0===v?void 0:v.data)||null,loading:!(null!==v&&void 0!==v&&v.data)&&!i,refreshing:Boolean(null===v||void 0===v?void 0:v.data),error:null}),e.p=1,e.n=2,(0,o.Ae)({filters:f,signal:u.signal,etag:s.current.get(r)||null});case 2:if(b=e.v,!u.signal.aborted){e.n=3;break}return e.a(2,null);case 3:if(!b.not_modified){e.n=5;break}if(null!==v&&void 0!==v&&v.data){e.n=4;break}throw s.current.delete(r),p.current.delete(r),new Error("O servidor confirmou um cache que n\xe3o est\xe1 dispon\xedvel nesta sess\xe3o.");case 4:return y=c(c({},v.data),{},{validated_at:b.validated_at}),s.current.set(r,b.etag||s.current.get(r)),p.current.set(r,{data:y}),l({data:y,loading:!1,refreshing:!1,error:null}),e.a(2,y);case 5:return m=b,b.etag&&s.current.set(r,b.etag),p.current.set(r,{data:m}),l({data:m,loading:!1,refreshing:!1,error:null}),e.a(2,m);case 6:if(e.p=6,h=e.v,!g(h)){e.n=7;break}return e.a(2,null);case 7:return l({data:(null===v||void 0===v?void 0:v.data)||null,loading:!1,refreshing:!1,error:h}),e.a(2,null)}},e,null,[[1,6]])})),[r]);return(0,t.useEffect)(function(){return m(),function(){var e;return null===(e=d.current)||void 0===e?void 0:e.abort()}},[m]),(0,t.useEffect)(function(){return(0,i.DJ)(i.o2.ORDERS,function(){return m({background:!0})})},[m]),(0,t.useEffect)(function(){if("undefined"!==typeof document&&"undefined"!==typeof window){var e=null,r=function(){e&&window.clearInterval(e),e=null},n=function(){r(),"hidden"!==document.visibilityState&&(e=window.setInterval(function(){return m({background:!0})},b))},t=function(){"hidden"!==document.visibilityState?(m({background:!0}),n()):r()};return n(),document.addEventListener("visibilitychange",t),function(){r(),document.removeEventListener("visibilitychange",t)}}},[m]),c(c({},u),{},{stale:y(u.data),reload:m})}function h(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.initialOrder,u=void 0===n?null:n,l=r.visibility,d=void 0===l?"store":l,s=String(null===u||void 0===u?void 0:u.id)===String(e)?u:null,p=v((0,t.useState)({order:s,loading:!s,refreshing:!1,error:null,transitionError:null,notice:null,transitioning:null}),2),b=p[0],y=p[1],m=(0,t.useRef)(null),h=(0,t.useRef)(new Map),E=(0,t.useRef)(new Map),w=(0,t.useRef)(!1),O=(0,t.useCallback)(f(a().m(function r(){var n,t,i,u,l,f,v=arguments;return a().w(function(r){for(;;)switch(r.p=r.n){case 0:return t=(v.length>0&&void 0!==v[0]?v[0]:{}).background,i=void 0!==t&&t,null===(n=m.current)||void 0===n||n.abort(),u=new AbortController,m.current=u,y(function(r){var n,t=String(null===(n=r.order)||void 0===n?void 0:n.id)===String(e)?r.order:s;return c(c({},r),{},{order:t,loading:!t&&!i,refreshing:Boolean(t),error:null})}),r.p=1,r.n=2,(0,o.dd)(e,{signal:u.signal,visibility:d});case 2:if(l=r.v,!u.signal.aborted){r.n=3;break}return r.a(2,null);case 3:return y(function(e){return c(c({},e),{},{order:l,loading:!1,refreshing:!1,error:null})}),r.a(2,l);case 4:if(r.p=4,f=r.v,!g(f)){r.n=5;break}return r.a(2,null);case 5:return y(function(e){return c(c({},e),{},{order:[403,404].includes(f.status)?null:e.order,loading:!1,refreshing:!1,error:f})}),r.a(2,null)}},r,null,[[1,4]])})),[e,s,d]);(0,t.useEffect)(function(){return h.current.clear(),E.current.clear(),O({background:Boolean(s)}),function(){var e;return null===(e=m.current)||void 0===e?void 0:e.abort()}},[O,s]);var k=(0,t.useCallback)(function(){var r=f(a().m(function r(n){var t,u,l,d,s,f,v,p,b,g,k,A,S,j,R,C,_,N;return a().w(function(r){for(;;)switch(r.p=r.n){case 0:if(u=(0,o.O5)(n),(l=(0,o.e7)(n))||u){r.n=1;break}return r.a(2,{ok:!1,unsupported:!0}
2);case 1:if(!w.current){r.n=2;break}return r.a(2,{ok:!1,busy:!0});case 2:if(w.current=!0,d=(null===u||void 0===u?void 0:u.key)||l,s="object"===typeof n&&n?n.confirmation:null,f=E.current.get(d),v=(null===f||void 0===f?void 0:f.idempotencyKey)||h.current.get(d)||(0,o.j4)(),h.current.set(d,v),p=u?(null===f||void 0===f?void 0:f.body)||{contract_version:1,expected_version:null===n||void 0===n?void 0:n.expected_version,schedule_fingerprint:(null===n||void 0===n?void 0:n.schedule_fingerprint)||(null===n||void 0===n?void 0:n.fingerprint),confirmation:s}:null,u&&!f&&E.current.set(d,{idempotencyKey:v,body:p}),y(function(e){return c(c({},e),{},{transitioning:d,transitionError:null,notice:null})}),null===(t=m.current)||void 0===t||t.abort(),r.p=3,!u){r.n=5;break}return r.n=4,(0,o.sz)(e,n,{idempotencyKey:v,body:p});case 4:_=r.v,r.n=7;break;case 5:return r.n=6,(0,o.hN)(e,n,{idempotencyKey:v,confirmation:s||("delivered"===l?"CONFIRMAR ENTREGA":void 0)});case 6:_=r.v;case 7:if(b=_,h.current.delete(d),E.current.delete(d),y(function(e){return c(c({},e),{},{order:b.order||e.order,transitioning:null,notice:u?"Adiantamento confirmado pelo servidor.":b.replayed?"A opera\xe7\xe3o j\xe1 havia sido aplicada.":"Pedido atualizado com seguran\xe7a."})}),!u){r.n=8;break}(0,i.CO)(i.o2.ORDERS),r.n=9;break;case 8:return r.n=9,O({background:!0});case 9:return r.a(2,{ok:!0,result:b});case 10:if(r.p=10,409!==(N=r.v).status){r.n=12;break}if(h.current.delete(d),E.current.delete(d),g=u?(0,o.v$)(N.payload||{}):null,y(function(e){return c(c({},e),{},{order:null!==g&&void 0!==g&&g.id?g:e.order,transitioning:null,notice:u?"A janela mudou em outra sess\xe3o. Confira os novos dados antes de confirmar novamente.":"O pedido mudou em outra sess\xe3o. A vers\xe3o mais recente foi carregada."})}),null!==g&&void 0!==g&&g.id){r.n=11;break}return r.n=11,O({background:!0});case 11:return r.a(2,u?{ok:!1,conflict:!0,preserveConfirmation:!0}:{ok:!1,conflict:!0});case 12:if(u||"ORDER_SCHEDULE_ADVANCE_REQUIRED"!==N.code){r.n=14;break}return h.current.delete(d),r.n=13,O({background:!0});case 13:return k=r.v,y(function(e){return c(c({},e),{},{transitioning:null,transitionError:null,notice:k?"Este pedido exige confirma\xe7\xe3o para adiantar a janela. Revise a a\xe7\xe3o atualizada.":"Este pedido exige confirma\xe7\xe3o para adiantar a janela. Atualize e tente novamente."})}),r.a(2,{ok:!1,advanceRequired:!0,refreshed:Boolean(k)});case 14:if(!u||!["SCHEDULE_ADVANCE_NOT_REQUIRED","SCHEDULE_ADVANCE_UNAVAILABLE"].includes(N.code)){r.n=17;break}if(h.current.delete(d),E.current.delete(d),A="SCHEDULE_ADVANCE_UNAVAILABLE"===N.code,S=A?"Este pedido j\xe1 mudou. Confira as a\xe7\xf5es operacionais atualizadas.":"A janela j\xe1 come\xe7ou. Use a a\xe7\xe3o operacional atualizada.",null===(j=(0,o.v$)(N.payload||{}))||void 0===j||!j.id){r.n=15;break}return y(function(e){return c(c({},e),{},{order:j,transitioning:null,transitionError:null,notice:S})}),r.a(2,A?{ok:!1,advanceUnavailable:!0,refreshed:!0}:{ok:!1,advanceNotRequired:!0,refreshed:!0});case 15:return r.n=16,O({background:!0});case 16:return R=r.v,y(function(e){return c(c({},e),{},{transitioning:null,transitionError:null,notice:R?S:"O pedido mudou. Atualize os dados para continuar."})}),r.a(2,A?{ok:!1,advanceUnavailable:!0,refreshed:Boolean(R)}:{ok:!1,advanceNotRequired:!0,refreshed:Boolean(R)});case 17:return C=u&&(!N.status||Number(N.status)>=500||408===Number(N.status)||429===Number(N.status)||"ORDER_SCHEDULED_ADVANCE_RECEIPT_INCOMPLETE"===N.code),u&&!C&&(h.current.delete(d),E.current.delete(d)),y(function(e){return c(c({},e),{},{transitioning:null,transitionError:N})}),r.a(2,{ok:!1,error:N});case 18:return r.p=18,w.current=!1,r.f(18);case 19:return r.a(2)}},r,null,[[3,10,18,19]])}));return function(e){return r.apply(this,arguments)}}(),[O,e]);return c(c({},b),{},{reload:O,transition:k})}},36628:function(e,r,n){function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return o(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n<r;n++)t[n]=e[n];return t}n.d(r,{CO:function(){return c},DJ:function(){return d},o2:function(){return a}});var i="netconv:operational-data-invalidated",a=Object.freeze({INBOX:"inbox",OCCURRENCES:"order_exceptions",ORDERS:"orders",PRODUCTS:"products",REPLENISHMENT:"replenishment",STOCK:"stock",RETURNS:"returns"}),u=new Set(Object.values(a)),l=function(e){return t(new Set((Array.isArray(e)?e:[e]).filter(function(e){return u.has(e)})))};function c(e){var r=l(e);return r.length&&"undefined"!==typeof window?(window.dispatchEvent(new CustomEvent(i,{detail:{resources:r}})),r):r}function d(e,r){if("undefined"===typeof window)return function(){};var n=new Set(l(e)),t=function(e){var t;l(null===e||void 0===e||null===(t=e.detail)||void 0===t?void 0:t.resources).some(function(e){return n.has(e)})&&(null===r||void 0===r||r())};return window.addEventListener(i,t),function(){return window.removeEventListener(i,t)}}}}]); 3//# sourceMappingURL=20174-d3ba3d74d7468004f97f.js.map
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.