Build 589089stable
Module 158317
981 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{FY:()=>l,Ub:()=>d,j2:()=>o,pI:()=>c});var i=n(562465),r=n(136857),a=n(626584);n(739508);var s=n(652215);new a.A("OrderActionCreators");class l extends r.Ay{order;constructor(e){super("Order signing failed due to unsatisfied constraints"),this.order=e}}class o extends r.Ay{constructor(){super("Order signed but entitlements not yet visible after polling")}}async function d(e){let t,{orderId:n,expectedRevision:r,loadId:a}=e,o={};null!=r&&(o.expected_revision=r);try{t=await i.Bo.post({url:s.Rsh.ORDER_SIGN(n),body:o,context:null!=a&&""!==a?{load_id:a}:void 0,rejectWithError:!0})}catch(e){var d;if(e instanceof i.oh&&400===e.status&&null!=(d=e.body)&&"object"==typeof d&&"id"in d&&"status"in d)throw new l(e.body);throw e}if(null==t.body)throw Error("Invalid sign order response");return t.body}async function c(e){try{let t=await i.Bo.get({url:s.Rsh.ORDER_ENTITLEMENTS(e),rejectWithError:!1});return null!=t.body?t.body:[]}catch(e){return[]}}}