PageSourceSearch

https://myg2.g2ocean.com/assets/OrganisationShipmentsShowDocuments-DKh62oyZ.js

js g2ocean.com collected 2026-09-26 10:53:37 UTC 4,756 bytes, 1 lines download raw bytes

1import{di as E,k as V,ab as P,B as x,br as f,S as N,l as U,a$ as q,ai as A,bi as L,aA as T,ct as z,cu as F,_ as Q}from"./app_admin-DnIMOVmj.js";import{w as $,X as R,x as s,y as g,C as o,Y as r,z as v,Q as k,U as w,E as S,ay as j,az as Y,B as p,P as m,G,r as B,j as C,F as D,ak as O,S as y,V as W,m as X}from"./vendor-YXgVPBQl.js";import"./vendor_leaflet-D4pRDrnS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"[email protected]"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="224b13ef-9cbb-4c05-8722-1b42bfa7deb2",e._sentryDebugIdIdentifier="sentry-dbid-224b13ef-9cbb-4c05-8722-1b42bfa7deb2")}catch{}})();const H={class:"flex items-center"},J={class:"gap-08 grid grid-cols-2"},K={class:"w-36"},M={class:"space-x-1 truncate text-sm"},Z={class:"hidden sm:flex"},I=$({__name:"OrganisationShipmentDocumentTrigger",props:{id:{default:""},companyName:{default:""},quantity:{default:1},quantityUnit:{default:""},hasAttachment:{type:Boolean,default:!1},isOpen:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,d=B(!1),b=C(()=>f.label("Quantity").value(e.quantity).unit(e.quantityUnit).type("number").toBaseItem()),a=E(),i=async()=>{await new Promise((l,u)=>{N.organisation(a.organisationId).shipment(a.bookingNo).documents(a.loadPortId,a.dischargePortId).download(e.id).onStart(()=>{d.value=!0}).onSuccess(({data:c})=>{const _=`data:application/pdf;base64,${c.file}`,h=document.createElement("a");h.download=c.filename,h.href=_,h.click(),l(!0)}).onError(c=>{u(c)}).onFinish(()=>{d.value=!1}).execute()})};return(l,u)=>{const c=R("title");return s(),g("div",{class:v(["flex items-center border-b pr-6",{"border-charcoal-2":e.isOpen,"border-b-transparent hover:bg-charcoal-1":!e.isOpen}])},[o("button",{type:"button","data-testid":"organisation-shipment-document-trigger",class:"group grow py-4 pl-6 text-left",onClick:u[0]||(u[0]=_=>n("click"))},[o("div",H,[r(V,{icon:"mdi:chevron-right",class:v(["mr-4 text-primary-6",{"-rotate-90":e.isOpen,"rotate-90":!e.isOpen}])},null,8,["class"]),o("div",J,[o("div",K,[k((s(),g("p",{class:v(["truncate whitespace-nowrap font-normal text-charcoal-6",e.isOpen?"text-primary-8":"group-hover:text-primary-8"])},[w(S(e.companyName),1)],2)),[[c]]),k((s(),g("p",M,[w(S(e.id),1)])),[[c]])]),r(P,j(Y(b.value)),null,16)])])]),r(x,{icon:"ic:baseline-download",variant:"btn-tertiary",class:"h-5 w-5 text-primary-8 sm:hidden",onClick:i}),o("div",Z,[e.hasAttachment?(s(),p(x,{key:0,variant:"btn-tertiary",icon:"ic:baseline-download",loading:d.value,onClick:i},{default:m(()=>[...u[1]||(u[1]=[w(" download ",-1)])]),_:1},8,["loading"])):G("",!0)])],2)}}}),ee={"data-test":"shipment-document-row-content",class:"sm:gap-x-08 flex flex-col gap-y-4 bg-charcoal-1 px-6 py-6 sm:grid sm:grid-cols-[auto_minmax(0,1fr)] sm:gap-y-6 sm:space-y-0 sm:pl-14"},te={__name:"OrganisationShipmentDocument",props:{...I.props,notifyParty:{type:String,default:""},volume:{type:[Number,String],default:1},volumeUnit:{type:String,default:""},weight:{type:[Number,String],default:1},weightUnit:{type:String,default:""},consignee:{type:String,default:""}},setup(e){const t=e,n=C(()=>q(f.label("Volume").value(t.volume).unit(t.volumeUnit).type("number").fallback("-"),f.label("Consignee").value(t.consignee).fallback("-"),f.label("Weight").value(t.weight).unit(t.weightUnit).type("number"),f.label("Notify Party").value(t.notifyParty)));return(d,b)=>(s(),p(U,null,{trigger:m(({toggle:a,isOpen:i})=>[r(I,y(t,{"is-open":i,onClick:a}),null,16,["is-open","onClick"])]),default:m(()=>[o("div",ee,[(s(!0),g(D,null,O(n.value,a=>(s(),p(P,y({key:a.id},{ref_for:!0},a),null,16))),128))])]),_:1}))}},ie=$({__name:"OrganisationShipmentsShowDocuments",props:{organisationId:{},bookingNo:{},loadPortId:{},dischargePortId:{}},setup(e){const t=B([]),n=X({search:""}),d=A(N.organisation(e.organisationId).shipment(e.bookingNo).documents(e.loadPortId,e.dischargePortId).index(),({data:a})=>a.length?(t.value=a,!0):!1,{paginated:!0,query:n,getQuery:()=>({search:n.search})}),b=()=>{n.search=""};return(a,i)=>(s(),p(Q,{"data-test":"bill-off-lading",padding:"none"},{default:m(()=>[i[1]||(i[1]=o("div",{class:"border-b border-charcoal-2 px-6 pb-5 pt-6"},[o("p",{class:"text-subtitle-1"},"Bill of Lading")],-1)),r(L,{placeholder:"Search for Consignee or Number",modelValue:n.search,"onUpdate:modelValue":i[0]||(i[0]=l=>n.search=l)},null,8,["modelValue"]),r(T,y(W(d),{onClear:b}),{default:m(()=>[r(z,null,{default:m(()=>[(s(!0),g(D,null,O(t.value,l=>(s(),p(te,y({key:l.id,"data-test":"shipment-document-row"},{ref_for:!0},l),null,16))),128))]),_:1})]),_:1},16),r(F,{styled:""})]),_:1}))}});
1export{ie 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.