1import{_ as ue}from"./FacilTable-DfKEbDoU.js";import{$ as r,c as de,a as _e}from"./index-WRCYpubE.js";import{_ as pe}from"./Thumbnail-CJ26BcPq.js";import{eg as fe,eh as me,ei as ge,dG as C,dz as he,o as h,e as be,w as f,J as t,P as _,H as b,cW as z,cX as K,M as P,N as o,ej as l,m as T,cR as F,O as ye,K as ve,L as xe,ek as we,D as H}from"./vendor-BkjPvJTJ.js";import{_ as $}from"./FlagIcon-Bb63Xb0B.js";import{u as ke}from"./useEditFulfillmentDialog-CFAJlzhh.js";import{b as Ce,f as Se,_ as Le,n as ze,a as Pe}from"./EditFulfillmentDialog-Cco8bXyI.js";import{_ as Te,a as Fe}from"./FulfillmentResultCard-DL9tJqj2.js";import{f as $e}from"./formatMoney-E6P78A61.js";import{b as U}from"./route-block-CsqFOpqe.js";import"./FacilLoader-CuyarLW3.js";import"./FacilText-CTEYpgiK.js";import"./FacilSelectJSX.vue_vue_type_script_lang-CX8BVpw5.js";import"./dom-BKZd2znq.js";import"./FacilSelect-DUd3RxAT.js";import"./FacilChip-Dq_ha_Ns.js";import"./FacilDivider-E6RCxgPU.js";import"./device-CaMZm60a.js";import"./debounce-o5ZiFEFz.js";import"./radiusClass-vxTWyPYe.js";import"./logistics-B5_D8Lrv.js";import"./shared-helpers-Dmy3I7Z8.js";import"./FacilFormLayout-CfPiIjhb.js";import"./FacilFormItem-B_UdMjXY.js";import"./ShippingRatePicker-fgwV58c7.js";import"./RadioSelect-CN9wHf4I.js";import"./FacilRadio-CteRVEyt.js";/* empty css */import"./AppLogoSpinner-1NtI_Gno.js";import"./FulfillmentDynamicSettings-CJK1DrX2.js";import"./FacilTextarea-CTZJudO6.js";import"./FacilNumber-DuB3TFIZ.js";import"./FulfillmentItemTable-lwG8LeTI.js";import"./Page-Cjx7YOTs.js";import"./Popover-BRaVt-R1.js";import"./Logo-Vtlws769.js";import"./LogoOnly-CWm_BAX-.js";import"./RemoteMode-DQkOyQ_U.js";import"./StepProgressBar-BJ9STIpx.js";import"./Number-CS_VHO7d.js";import"./FacilMessage-BDTANZiK.js";import"./backAction-DAHgqZpb.js";import"./FacilMenu-DsrYsQlx.js";import"./FacilListGroup-HuJYBuRH.js";import"./FacilListItem-BJa6H8WW.js";import"./FacilListContent-DVXydDeQ.js";import"./Layout-CTKQ5s4n.js";import"./LayoutSection-CMJ6G5KX.js";import"./Card-pvvCu3sh.js";import"./FacilAccordionPanel-B0uC5tYK.js";import"./FacilProgressBar-hYcymLpO.js";import"./isFalsey-CjNaCpB1.js";(function(){try{var y=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};y.SENTRY_RELEASE={id:"fix@[email protected]"};var v=new y.Error().stack;v&&(y._sentryDebugIds=y._sentryDebugIds||{},y._sentryDebugIds[v]="9ed38f3e-62da-48ae-9f1c-86e2fcd6c49a",y._sentryDebugIdIdentifier="sentry-dbid-9ed38f3e-62da-48ae-9f1c-86e2fcd6c49a")}catch{}})();const Be={class:"mb-6 flex gap-4"},De={class:"font-bold"},Ee={class:"rounded-lg border border-slate-200 bg-slate-50/80 px-5 py-4 text-sm leading-6 text-slate-600"},Ie={class:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-400"},Oe={class:"mt-2 text-sm font-medium text-slate-700"},Re={class:"mt-3 space-y-2 pl-5 text-sm marker:text-slate-400"},je={class:"pl-1"},Me={class:"pl-1"},Ne={class:"pl-1"},Ve={class:"hidden sm:block"},qe=["tabindex","aria-disabled","onClick","onKeyup"],Ke={class:"facil-table__row align-middle"},He={class:"flex flex-col items-start gap-2"},Ue={class:"text-link"},Ge={class:"facil-table__row align-middle"},Je={class:"inline-flex items-center gap-2"},Qe={class:"facil-table__row align-middle"},We={key:0,class:"flex w-full items-center"},Xe={class:"label label--danger label--small"},Ye={key:1,class:"flex w-full flex-col justify-center gap-1"},Ze={key:0,class:"flex h-12 w-28 shrink-0 items-center justify-center"},Ae=["src","alt"],et={class:"facil-table__row align-middle text-right"},tt={class:"font-bold"},lt={class:"facil-table__row align-middle"},st={class:"flex items-center justify-end text-slate-400"},ot={class:"mt-4 flex flex-col gap-3 sm:hidden"},nt=["tabindex","aria-label","aria-disabled","onClick","onKeyup"],rt={class:"flex items-start justify-between gap-2"},at={class:"flex flex-col gap-1"},it={class:"text-sm font-medium text-link"},ct={class:"flex flex-wrap items-center gap-2"},ut={class:"text-sm"},dt={class:"text-sm"},_t={class:"flex items-center justify-between gap-4"},pt={key:0},ft={class:"label label--danger label--small"},mt={key:1,class:"min-w-0 flex-1"},gt={class:"text-sm"},ht={class:"text-base font-bold"},E="borzo-my",bt=Object.assign({name:"BorzoMyFulfillmentPage"},{__name:"index",setup(y){const v=fe(),I=me(),g=ke(),{appInfo:S,fulfillmentOrdersPayload:B,isPageLoading:G,isDialogOpen:D,selectedFulfillmentOrder:J,isRateBatchLoading:Q,rateLoadingProgressPercent:W,rateLoadingCompletedCount:X,rateLoadingTotalCount:Y,rateLoadingElapsedDisplay:Z,rateLoadingEstimateLabel:A,pageTitle:O,currentStep:ee,submissionProgressPercent:te,submissionCompletedCount:le,submissionTotalCount:se,submissionResults:oe}=ge(g),R=C(()=>L.value.filter(n=>!n.rate_error&&n.has_selected_rate).length),ne=C(()=>L.value.filter(n=>!n.rate_error&&!n.has_selected_rate).length),j=n=>{switch(n){case"paid":return"label--muted";case"partially_paid":return"label--attention";case"authorized":return"label--warning";
1case"pending":case"unpaid":return"label--warning";default:return""}},re=C(()=>[{label:r("channels.orders.logistic_fulfillment.table.fulfillment_orders"),value:"fulfillment_orders_name"},{label:r("channels.orders.logistic_fulfillment.table.transit_route"),value:"transit_route"},{label:r("channels.orders.logistic_fulfillment.table.service_name"),value:"service_name"},{label:r("channels.orders.logistic_fulfillment.table.shipping_charge"),value:"shipping_charge",textAlign:"right"},{label:"",value:"action",width:"48px"}]),L=C(()=>{var d;const n=((d=S.value.supported_currencies)==null?void 0:d[0])||"";return B.value.map(i=>{var s,p,M,N,V,q;const m=g.rateResponseCache[String(((s=i==null?void 0:i.fulfillment_order)==null?void 0:s.id)||"")]||null,a=((p=i==null?void 0:i.settings)==null?void 0:p.pickup_service)||null,k=a==null?void 0:a.shipping_charge,e=(a==null?void 0:a.currency_code)||n,x=(m==null?void 0:m.error)??null,c=(M=i.fulfillment_order)==null?void 0:M.location,u=(N=i.order)==null?void 0:N.shipping_address;return{fulfillment_orders_name:i.fulfillment_orders_name||"-",financial_status:((V=i.order)==null?void 0:V.financial_status)||"-",transit_route:{origin:{province:(c==null?void 0:c.city)||(c==null?void 0:c.province)||null,country_code:((c==null?void 0:c.country_code)||"").toLowerCase()||null,country:(c==null?void 0:c.country)||null},destination:{province:(u==null?void 0:u.city)||(u==null?void 0:u.province)||null,country_code:((u==null?void 0:u.country_code)||"").toLowerCase()||null,country:(u==null?void 0:u.country)||null}},courier_url:(a==null?void 0:a.courier_url)||"",service_name:x?"-":(a==null?void 0:a.name)||r("channels.orders.logistic_fulfillment.choose_courier_service"),rate_error:x,has_selected_rate:!!a,shipping_charge:!x&&k!=null?$e(e)(k):"-",fulfillment_order_id:((q=i.fulfillment_order)==null?void 0:q.id)??null}})}),w=n=>{n!=null&&n.rate_error||g.openEditor(n==null?void 0:n.fulfillment_order_id)},ae=async()=>{if(ne.value>0){await H.alert(r("channels.orders.logistic_fulfillment.borzo_my.choose_rate_before_fulfill"),r("channels.orders.logistic_fulfillment.confirm_fulfill_title"),{confirmButtonText:r("buttons.confirm")});return}try{await H.confirm(r("channels.orders.logistic_fulfillment.confirm_fulfill_message",{count:R.value}),r("channels.orders.logistic_fulfillment.confirm_fulfill_title"),{confirmButtonText:r("buttons.confirm"),showCancelButton:!1})}catch{return}await g.submitFulfillments(E)},ie=n=>{n||g.cancelEditor()},ce=C(()=>{const{shop:n,store_id:d,order_ids:i}=v.query;return!n||!d||!i?"":`/orders/apps/logistic/airwaybill?${new URLSearchParams({app:E,shop:n,store_id:d,order_ids:i}).toString()}`});return he(async()=>{var d,i;await g.initializePageData(E,(d=v.query)==null?void 0:d.order_ids,{fulfillmentOrderId:((i=v.query)==null?void 0:i.fulfillment_order_id)||null})&&(g.applyLogisticsDefaultSettings(Ce),B.value.length>0&&g.requiresRateFetch&&await g.initFulfillmentRates((m,a,k={})=>Se({routeQuery:v.query,fulfillmentPayload:m,fulfillmentStore:k.fulfillmentStore,config:a})))}),(n,d)=>{const i=pe,m=_e,a=de,k=ue;return h(),be(Fe,{"page-title":l(O),"app-info":l(S),"is-page-loading":l(G),"is-rate-batch-loading":l(Q),"rate-loading-progress-percent":l(W),"rate-loading-completed-count":l(X),"rate-loading-total-count":l(Y),"rate-loading-elapsed-display":l(Z),"rate-loading-estimate-label":l(A),"fulfillment-orders-count":R.value,"current-step":l(ee),"submission-progress-percent":l(te),"submission-completed-count":l(le),"submission-total-count":l(se),"no-supported-orders":l(B).length===0,"show-parcel-counts":!1,onSubmit:ae,onBackToOrders:d[1]||(d[1]=e=>l(I).push("/orders"))},{notes:f(()=>[t("div",Be,[_(i,{size:"md",bordered:"",src:l(S).img_src},null,8,["src"]),t("h2",De,o(l(r)("channels.orders.logistic_fulfillment.fulfill_with",{title:l(O)})),1)]),t("div",Ee,[t("p",Ie,[_(m,{name:"warning",size:"sm"}),t("span",null,o(l(r)("channels.orders.logistic_fulfillment.important_notes")),1)]),t("p",Oe,o(l(r)("channels.orders.logistic_fulfillment.requirements_intro")),1),t("ul",Re,[t("li",je,o(l(r)("channels.orders.logistic_fulfillment.note_customer_assigned")),1),t("li",Me,o(l(r)("channels.orders.logistic_fulfillment.note_unfulfilled")),1),t("li",Ne,o(l(r)("channels.orders.logistic_fulfillment.borzo_my.select_rate_note")),1)])])]),dialogs:f(()=>[_(Le,{modelValue:l(D),"onUpdate:modelValue":[d[0]||(d[0]=e=>we(D)?D.value=e:null),ie],"fulfillment-order":l(J),"build-provider-settings":l(Pe),"normalize-save-payload":l(ze)},null,8,["modelValue","fulfillment-order","build-provider-settings","normalize-save-payload"])]),result:f(()=>[_(Te,{"app-info":l(S),results:l(oe),"airwaybill-url":ce.value,"show-delivery-column":!1},null,8,["app-info","results","airwaybill-url"])]),default:f(()=>[t("div",Ve,[_(k,{class:"mt-4",headers:re.value,items:L.value,"hide-table-header":""},{row:f(({item:e,index:x})=>{var c,u;return[(h(),b("tr",{key:e.fulfillment_order_id||x,class:P(["group transition-colors duration-200",e.rate_error?"pointer-events-none cursor-not-allowed opacity-60":"cursor-pointer hover:bg-slate-50 focus-within:bg-slate-50"]),tabindex:e.rate_error?-1:0,"aria-disabled":e.rate_error?"true":"false",onClick:s=>w(e),onKeyup:[z(s=>w(e),["enter"]),z(K(s=>w(e),["prevent"]),["space"])]},[t("td",Ke,[t("div",He,[t("span",Ue,o(e.fulfillment_orders_name),1),t("span",{class:P(["label label--medium w-fit",j(e.financial_status)])},o(l(r)("order.listing.financial."+e.financial_status)),3)])]),t("td",Ge,[t("span",Je,[_(a,null,{activator:f(({on:s})=>{var p;return[_($,T({class:"cursor-pointer","country-code":(p=e.transit_route.origin)==null?void 0:p.country_code},F(s)),null,16,["country-code"])]}),default:f(()=>{var s;return[t("span",null,o(((s=e.transit_route.origin)==null?void 0:s.country)||"-"),1)]}),_:2},1024),t("span",null,o((c=e.transit_route.origin)==null?void 0:c.province),1),d[2]||(d[2]=t("span",null,"â",-1)),_(a,null,{activator:f(({on:s})=>{var p;return[_($,T({class:"cursor-pointer","country-code":(p=e.transit_route.destination)==null?void 0:p.country_code},F(s)),null,16,["country-code"])]}),default:f(()=>{var s;return[t("span",null,o(((s=e.transit_route.destination)==null?void 0:s.country)||"-"),1)]}),_:2},1024),t("span",null,o((u=e.transit_route.destination)==null?void 0:u.province),1)])]),t("td",Qe,[e.rate_error?(h(),b("div",We,[t("span",Xe,o(l(r)("channels.orders.logistic_fulfillment.shipping_not_supported")),1)])):(h(),b("div",Ye,[e.courier_url?(h(),b("div",Ze,[t("img",{src:e.courier_url,alt:e.service_name||"Courier logo",class:"max-h-full max-w-full object-contain"},null,8,Ae)])):ye("",!0),t("div",null,o(e.service_name||"-"),1)]))]),t("td",et,[t("span",tt,o(e.shipping_charge),1)]),t("td",lt,[t("div",st,[_(m,{name:"chevron_right",size:"md",class:"transform transition-all duration-200 ease-out group-hover:translate-x-1.5 group-hover:text-slate-500"})])])],42,qe))]}),_:1},8,["headers","items"])]),t("div",ot,[(h(!0),b(ve,null,xe(L.value,(e,x)=>{var c,u;return h(),b("div",{key:e.fulfillment_order_id||x,role:"button",tabindex:e.rate_error?-1:0,"aria-label":e.fulfillment_orders_name,"aria-disabled":e.rate_error?"true":"false",class:P(["group relative flex flex-col gap-3 rounded-lg border border-slate-200 bg-white px-4 py-4 transition-colors duration-200",e.rate_error?"pointer-events-none cursor-not-allowed opacity-60":"cursor-pointer hover:border-slate-300 hover:bg-slate-50 active:bg-slate-100"]),onClick:s=>w(e),onKeyup:[z(s=>w(e),["enter"]),z(K(s=>w(e),["prevent"]),["space"])]},[t("div",rt,[t("div",at,[t("span",it,o(e.fulfillment_orders_name),1),t("span",{class:P(["label label--medium",j(e.financial_status)])},o(l(r)("order.listing.financial."+e.financial_status)),3)]),_(m,{name:"chevron_right",size:"md",class:"mt-0.5 shrink-0 transform text-slate-400 transition-all duration-200 ease-out group-hover:translate-x-1.5 group-hover:text-slate-500"})]),t("div",ct,[_(a,null,{activator:f(({on:s})=>{var p;return[_($,T({class:"cursor-pointer","country-code":(p=e.transit_route.origin)==null?void 0:p.country_code},F(s)),null,16,["country-code"])]}),default:f(()=>{var s;return[t("span",null,o(((s=e.transit_route.origin)==null?void 0:s.country)||"-"),1)]}),_:2},1024),t("span",ut,o((c=e.transit_route.origin)==null?void 0:c.province),1),d[3]||(d[3]=t("span",{class:"text-xs text-slate-400"},"â",-1)),_(a,null,{activator:f(({on:s})=>{var p;return[_($,T({class:"cursor-pointer","country-code":(p=e.transit_route.destination)==null?void 0:p.country_code},F(s)),null,16,["country-code"])]}),default:f(()=>{var s;return[t("span",null,o(((s=e.transit_route.destination)==null?void 0:s.country)||"-"),1)]}),_:2},1024),t("span",dt,o((u=e.transit_route.destination)==null?void 0:u.province),1)]),t("div",_t,[e.rate_error?(h(),b("div",pt,[t("span",ft,o(l(r)("channels.orders.logistic_fulfillment.shipping_not_supported")),1)])):(h(),b("div",mt,[t("div",gt,o(e.service_name),1)])),t("span",ht,o(e.shipping_charge),1)])],42,nt)}),128))])]),_:1},8,["page-title","app-info","is-page-loading","is-rate-batch-loading","rate-loading-progress-percent","rate-loading-completed-count","rate-loading-total-count","rate-loading-elapsed-display","rate-loading-estimate-label","fulfillment-orders-count","current-step","submission-progress-percent","submission-completed-count","submission-total-count","no-supported-orders"])}}});typeof U=="function"&&U(bt);export{bt as default};
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.