1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[563],{27323(B,O,s){s.d(O,{Wi:()=>y,__:()=>e});var e=function(h){return h.Documents="DOCUMENTS",h.Data="DATA",h.Library="LIBRARY",h.Cache="CACHE",h.External="EXTERNAL",h.ExternalStorage="EXTERNAL_STORAGE",h.ExternalCache="EXTERNAL_CACHE",h.LibraryNoCloud="LIBRARY_NO_CLOUD",h.Temporary="TEMPORARY",h}(e||{}),y=function(h){return h.UTF8="utf8",h.ASCII="ascii",h.UTF16="utf16",h}(y||{})},75273(B,O,s){s.d(O,{s:()=>f});var e=s(3594),y=s(64629),_=s(27323);const k=(0,y.F3)("Filesystem",{web:()=>s.e(55).then(s.bind(s,10055)).then(b=>new b.FilesystemWeb)});!function h(b=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},void 0===window.Capacitor||b?void 0!==window.cordova&&function I(b){b.CapacitorUtils.Synapse=new Proxy({},{get:(C,T)=>b.cordova.plugins[T]})}(window):function S(b){b.CapacitorUtils.Synapse=new Proxy({},{get:(C,T)=>new Proxy({},{get:(E,p)=>(t,l,a)=>{const m=b.Capacitor.Plugins[T];void 0!==m?"function"==typeof m[p]?(0,e.A)(function*(){try{const c=yield m[p](t);l(c)}catch(c){a(c)}})():a(new Error(`Method ${p} not found in Capacitor plugin ${T}`)):a(new Error(`Capacitor plugin ${T} not found`))}})})}(window))}();const D=(0,y.F3)("Share",{web:()=>s.e(3377).then(s.bind(s,3377)).then(b=>new b.ShareWeb)}),A=(0,y.F3)("FileOpener");var d=s(84709);let f=(()=>{var b;class C{save(E,p,t){var l=this;return(0,e.A)(function*(){const a=E instanceof Blob?E:new Blob([E],{type:t});y.Ii.isNativePlatform()?yield l.saveNative(a,p,t):l.saveWeb(a,p)})()}saveFromUrl(E,p){var t=this;return(0,e.A)(function*(){try{const l=yield fetch(E);if(!l.ok)throw new Error(`Download failed: ${l.status}`);const a=yield l.blob();yield t.save(a,p,a.type||"application/octet-stream")}catch(l){if(y.Ii.isNativePlatform())throw l;t.openInBrowser(E,p)}})()}openInBrowser(E,p){const t=document.createElement("a");t.href=E,t.download=p,t.target="_blank",t.rel="noopener",document.body.appendChild(t),t.click(),document.body.removeChild(t)}saveWeb(E,p){const t=URL.createObjectURL(E),l=document.createElement("a");l.href=t,l.download=p,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(t)}saveNative(E,p,t){var l=this;return(0,e.A)(function*(){const a=yield l.blobToBase64(E),m=yield k.writeFile({path:p,data:a,directory:_.__.Cache,recursive:!0});try{yield A.open({filePath:m.uri,contentType:t})}catch{yield D.share({title:p,url:m.uri,dialogTitle:"Save or share"})}})()}blobToBase64(E){return new Promise((p,t)=>{const l=new FileReader;l.onloadend=()=>{const a=l.result||"",m=a.indexOf(",");p(m>=0?a.slice(m+1):a)},l.onerror=()=>t(l.error),l.readAsDataURL(E)})}static#t=b=()=>(this.\u0275fac=function(p){return new(p||C)},this.\u0275prov=d.jDH({token:C,factory:C.\u0275fac,providedIn:"root"}))}return b(),C})()},11547(B,O,s){s.d(O,{SampleRequestsPage:()=>W});var e=s(84709),y=s(97049),S=s(87018),I=s(43273),h=s(81421),_=s(88683),k=s(82119),D=s(29643),A=s(76030),d=s(85792),f=s(17284),b=s(91087),C=s(38031),T=s(8744),E=s(25776),p=s(22391),t=s(92958),l=s(31328),a=s(70156),m=s(30949),c=s(65612);function R(g,F){1&g&&(t.j41(0,"div",20),t.EFF(1," Loading sample requests... "),t.k0s())}function v(g,F){if(1&g){const o=t.RV6();t.j41(0,"div",21)(1,"span"),t.EFF(2,"Could not load sample requests."),t.k0s(),t.j41(3,"button",22),t.bIt("click",function(){e.eBV(o);const i=t.XpG();return e.Njj(i.load())}),t.EFF(4,"Retry"),t.k0s()()}}function w(g,F){if(1&g&&t.nrm(0,"app-empty-state",23),2&g){const o=t.XpG();t.Y8G("icon","beaker-outline")("title","No sample requests yet")("subtitle","ALL"===o.activeFilter?"You haven't requested any samples yet. Open a received quote to request one.":"Nothing in this filter right now.")}}function U(g,F){if(1&g){const o=t.RV6();t.j41(0,"tr",32)(1,"td",29)(2,"button",33),t.bIt("click",function(){const i=e.eBV(o).$implicit,n=t.XpG(2);return e.Njj(n.go(i.id))}),t.EFF(3),t.k0s()(),t.j41(4,"td",34),t.EFF(5),t.k0s(),t.j41(6,"td",35),t.EFF(7),t.k0s(),t.j41(8,"td",36),t.EFF(9),t.k0s(),t.j41(10,"td",29)(11,"span",37),t.EFF(12),t.k0s()(),t.j41(13,"td",38),t.EFF(14),t.nI1(15,"date"),t.k0s(),t.j41(16,"td",30)(17,"button",39),t.bIt("click",function(){const i=e.eBV(o).$implicit,n=t.XpG(2);return e.Njj(n.go(i.id))}),t.EFF(18," View "),t.nrm(19,"ion-icon",40),t.k0s()()()}
1if(2&g){const o=F.$implicit,r=t.XpG(2);t.R7$(3),t.SpI(" ",o.refId," "),t.R7$(2),t.JRh(o.linkedTitle||"-"),t.R7$(2),t.JRh(o.vendorName||"-"),t.R7$(2),t.SpI("R",o.round),t.R7$(2),t.xc7("color",r.statusColor(o.status))("background-color",r.statusBg(o.status))("border-color",r.statusColor(o.status)+"33"),t.R7$(),t.SpI(" ",r.statusLabel(o.status)," "),t.R7$(2),t.SpI(" ",o.createdDate?t.i5U(15,12,o.createdDate,"dd MMM yyyy"):"-"," ")}}function N(g,F){if(1&g&&(t.j41(0,"div",24)(1,"div",25)(2,"table",26)(3,"thead",27)(4,"tr",28)(5,"th",29),t.EFF(6,"Ref ID"),t.k0s(),t.j41(7,"th",29),t.EFF(8,"Subject"),t.k0s(),t.j41(9,"th",29),t.EFF(10,"Seller"),t.k0s(),t.j41(11,"th",29),t.EFF(12,"Round"),t.k0s(),t.j41(13,"th",29),t.EFF(14,"Status"),t.k0s(),t.j41(15,"th",29),t.EFF(16,"Created"),t.k0s(),t.j41(17,"th",30),t.EFF(18,"Actions"),t.k0s()()(),t.j41(19,"tbody"),t.DNE(20,U,20,15,"tr",31),t.k0s()()()()),2&g){const o=t.XpG();t.R7$(20),t.Y8G("ngForOf",o.filteredRequests)("ngForTrackBy",o.trackById)}}function $(g,F){if(1&g){const o=t.RV6();t.j41(0,"button",43),t.bIt("click",function(){const i=e.eBV(o).$implicit,n=t.XpG(2);return e.Njj(n.go(i.id))}),t.j41(1,"div",44)(2,"span",45),t.EFF(3),t.k0s(),t.j41(4,"span",46),t.EFF(5),t.k0s()(),t.j41(6,"div",47)(7,"span",48),t.EFF(8),t.k0s(),t.j41(9,"span",49),t.EFF(10),t.k0s()(),t.j41(11,"div",50),t.EFF(12),t.nI1(13,"date"),t.k0s()()}
1if(2&g){const o=F.$implicit,r=t.XpG(2);t.R7$(3),t.JRh(o.refId),t.R7$(),t.xc7("color",r.statusColor(o.status))("background-color",r.statusBg(o.status))("border-color",r.statusColor(o.status)+"33"),t.R7$(),t.SpI(" ",r.statusLabel(o.status)," "),t.R7$(3),t.JRh(o.vendorName||"-"),t.R7$(2),t.SpI("Round ",o.round),t.R7$(2),t.SpI(" ",o.createdDate?t.i5U(13,11,o.createdDate,"dd MMM yyyy"):"-"," ")}}function G(g,F){if(1&g&&(t.j41(0,"div",41),t.DNE(1,$,14,14,"button",42),t.k0s()),2&g){const o=t.XpG();t.R7$(),t.Y8G("ngForOf",o.filteredRequests)("ngForTrackBy",o.trackById)}}function K(g,F){if(1&g){const o=t.RV6();t.j41(0,"div",51)(1,"span",52),t.EFF(2),t.k0s(),t.j41(3,"div",53)(4,"button",54),t.bIt("click",function(){e.eBV(o);const i=t.XpG();return e.Njj(i.onPageChange(-1))}),t.EFF(5," Previous "),t.k0s(),t.j41(6,"button",54),t.bIt("click",function(){e.eBV(o);const i=t.XpG();return e.Njj(i.onPageChange(1))}),t.EFF(7," Next "),t.k0s()()()}if(2&g){const o=t.XpG();t.R7$(2),t.Lme("Page ",o.currentPage+1," of ",o.totalPages),t.R7$(2),t.Y8G("disabled",0===o.currentPage),t.R7$(2),t.Y8G("disabled",o.currentPage>=o.totalPages-1)}}const j=[{code:"ALL",label:"All"},{code:"IN_PROGRESS",label:"In Progress"},{code:"AWAITING_EVALUATION",label:"Awaiting Evaluation"},{code:"APPROVED",label:"Approved"},{code:"REJECTED",label:"Rejected"}],V={ALL:[],IN_PROGRESS:["SAMPLE_REQUESTED","SUPPLIER_ACCEPTED","SUPPLIER_QUOTED","BUYER_ACCEPTED","INVOICE_RAISED","SHIPPED","DELIVERED"],AWAITING_EVALUATION:["DELIVERED"],APPROVED:["SAMPLE_APPROVED"],REJECTED:["SAMPLE_REJECTED","BUYER_REJECTED","SUPPLIER_DECLINED","CANCELLED"]};let W=(()=>{var g;class F{rebuildFilterConfig(){this.filterConfig={fields:[{id:"department",label:"Department",type:"dropdown",placeholder:"Any department",options:this.departmentOptions},{id:"supplier",label:"Seller",type:"counterparty",facetKey:"supplier",placeholder:"Any seller"}]}}labelToCode(r){return j.find(n=>n.label===r)?.code??"ALL"}get activeFilter(){return this.labelToCode(this.activeFilterLabel)}get filteredRequests(){return this.requests}constructor(r,i,n,u,P,x){this.router=r,this.route=i,this.sampleService=n,this.toast=u,this.cdr=P,this.departmentSvc=x,this.destroyRef=(0,e.WQX)(e.abz),this.filterTabs=j,this.statusConfig=f.x,this.availableFilters=["All"],this.activeFilterLabel="All",this.searchTerm="",this.loading=!1,this.hasLoadError=!1,this.currentPage=0,this.pageSize=20,this.totalElements=0,this.totalPages=0,this.requests=[],this.sortConfig={options:[{key:"dateCreated",label:"Date created",type:"date"},{key:"documentNo",label:"Ref ID",type:"text"},{key:"status",label:"Status",type:"status"}],defaultKey:"dateCreated",defaultDirection:"DESC"},this.filterValue={},this.departmentOptions=[{label:"Any department",value:""}],this.counterpartyFacets={},this.filterConfig={fields:[]},this.currentSortColumn=null,this.currentSortDirection=null,this.dateFrom=null,this.dateTo=null,this.dateValueForFilter=null,this.selectedIds=[],this.allMatching=!1,this.exportFilterFn=()=>this.buildExportFilter(),this.storageKey="query_buyer-sample-requests",(0,h.a)({arrowBackOutline:_.arrowBackOutline,beakerOutline:_.beakerOutline,chevronForwardOutline:_.chevronForwardOutline,timeOutline:_.timeOutline,checkmarkCircleOutline:_.checkmarkCircleOutline,closeCircleOutline:_.closeCircleOutline,hourglassOutline:_.hourglassOutline,downloadOutline:_.downloadOutline})}ngOnInit(){const r=this.route.snapshot.queryParams;if(r.from||r.to||r.sort||r.department||r.supplier||r.status){if(this.dateFrom=r.from||null,this.dateTo=r.to||null,r.sort){const[n,u]=String(r.sort).split(",");n&&(this.currentSortColumn=n),("ASC"===u||"DESC"===u)&&(this.currentSortDirection=u)}null!=r.department&&(this.filterValue={...this.filterValue,department:String(r.department)}),null!=r.supplier&&(this.filterValue={...this.filterValue,supplier:String(r.supplier)}),this.applyStatusFromUrl(r.status)}else this.restoreFromStorage();this.syncDateValueFromUrl(),this.rebuildFilterConfig(),this.departmentSvc.asDropdownOptions().pipe((0,y.pQ)(this.destroyRef)).subscribe(n=>{this.departmentOptions=[{label:"Any department",value:""},...n],this.rebuildFilterConfig()}),this.load()}buildExportFilter(){const r=this.currentSortColumn||"dateCreated",i=this.currentSortDirection||"DESC",n=V[this.activeFilter],u=(this.filterValue.supplier||"").toString().trim(),P=(this.filterValue.department||"").toString().trim();return{sort:`${r},${i}`,search:this.searchTerm||void 0,statuses:n.length?n:void 0,dateField:this.dateFrom&&this.dateTo?"requestedDate":void 0,from:this.dateFrom||void 0,to:this.dateTo||void 0,supplierName:u||void 0,department:P||void 0}}get exportEndpoint(){return this.sampleService.exportUrl}applyStatusFromUrl(r){const i=null==r?"":String(r).trim().toUpperCase();if(!i||"ALL"===i)return;const n=j.find(u=>u.code===i);n&&(this.activeFilterLabel=n.label)}setFilter(r){const i=j.find(n=>n.code===r)?.label??"All";this.onFilterChange(i)}onFilterChange(r){this.activeFilterLabel!==r&&(this.activeFilterLabel=r,this.currentPage=0,this.load())}onSearchChange(r){this.searchTerm=r||"",this.currentPage=0,this.load()}load(){this.loading=!0,this.hasLoadError=!1;const r=this.currentSortColumn||"dateCreated",i=this.currentSortDirection||"DESC",u=V[this.activeFilter],P=(this.filterValue.supplier||"").toString().trim(),x=(this.filterValue.department||"").toString().trim();this.sampleService.listV2({page:this.currentPage,size:this.pageSize,sort:`${r},${i}`,search:this.searchTerm||void 0,statuses:u.length?u:void 0,dateField:this.dateFrom&&this.dateTo?"requestedDate":void 0,from:this.dateFrom||void 0,to:this.dateTo||void 0,supplierName:P||void 0,department:x||void 0}).pipe((0,D.W)(()=>(this.hasLoadError=!0,this.toast.error("Could not load sample requests."),(0,k.of)({content:[],page:0,size:this.pageSize,totalElements:0,totalPages:0,last:!0}))),(0,A.j)(()=>{this.loading=!1,this.cdr.markForCheck()})).subscribe(M=>{this.requests=M.content??[],this.totalElements=M.totalElements??this.requests.length,this.totalPages=M.totalPages??1,this.sampleService.currentListIds=this.requests.map(L=>L.id),this.counterpartyFacets={supplier:(M.facets?.supplier||[]).map(L=>({id:L.id,label:L.name,count:L.count}))},this.applyStatusFacet(M.facets?.status),this.cdr.markForCheck()})}applyStatusFacet(r){if(void 0===r)return void(this.availableFilters=j.map(n=>n.label));const i=new Set(r);this.availableFilters=j.filter(n=>
1"ALL"===n.code||V[n.code].some(u=>i.has(u))).map(n=>n.label),this.availableFilters.includes(this.activeFilterLabel)||(this.activeFilterLabel="All")}onSortChange(r){this.currentSortColumn=r.column||null,this.currentSortDirection=r.direction,this.currentPage=0,this.syncUrl(),this.persistToStorage(),this.load()}onFilterApply(r){this.filterValue={...r||{}},this.currentPage=0,this.syncUrl(),this.persistToStorage(),this.load()}onFilterReset(){this.filterValue={},this.currentPage=0,this.syncUrl(),this.persistToStorage(),this.load()}onDateChange(r){this.dateValueForFilter=r,this.dateFrom=r?.from||null,this.dateTo=r?.to||null,this.currentPage=0,this.syncUrl(),this.persistToStorage(),this.load()}syncDateValueFromUrl(){if(this.dateFrom&&this.dateTo){const r=i=>i.slice(0,10);this.dateValueForFilter={preset:"CUSTOM",from:this.dateFrom,to:this.dateTo,customFrom:r(this.dateFrom),customTo:r(this.dateTo),dateField:"dateCreated"}}else this.dateValueForFilter=null}currentSortKey(){return this.currentSortColumn&&this.currentSortDirection?`${this.currentSortColumn},${this.currentSortDirection}`:""}syncUrl(){const r=this.currentSortKey()||null;this.router.navigate([],{relativeTo:this.route,queryParams:{from:this.dateFrom,to:this.dateTo,sort:r,department:this.filterValue.department||null,supplier:this.filterValue.supplier||null},queryParamsHandling:"merge",replaceUrl:!0})}persistToStorage(){try{localStorage.setItem(this.storageKey,JSON.stringify({sort:this.currentSortKey()||null,from:this.dateFrom,to:this.dateTo,department:this.filterValue.department||null,supplier:this.filterValue.supplier||null}))}catch{}}restoreFromStorage(){try{const r=localStorage.getItem(this.storageKey);if(!r)return;const i=JSON.parse(r);if(i.sort){const[n,u]=i.sort.split(",");n&&(this.currentSortColumn=n),("ASC"===u||"DESC"===u)&&(this.currentSortDirection=u)}this.dateFrom=i.from||null,this.dateTo=i.to||null,i.department&&(this.filterValue={...this.filterValue,department:i.department}),i.supplier&&(this.filterValue={...this.filterValue,supplier:i.supplier})}catch{}}statusLabel(r){return this.statusConfig[r]?.label??r}statusColor(r){return this.statusConfig[r]?.color??"#64748b"}statusBg(r){return this.statusConfig[r]?.bg??"#f1f5f9"}go(r){this.router.navigate(["/buyer/sample-requests",r])}goToDashboard(){this.router.navigate(["/dashboard"])}onPageChange(r){const i=this.currentPage+r;i<0||i>=this.totalPages||(this.currentPage=i,this.load())}trackById(r,i){return i.id}static#t=g=()=>(this.\u0275fac=function(i){return new(i||F)(t.rXU(l.Ix),t.rXU(l.nX),t.rXU(a.t),t.rXU(m.f),t.rXU(p.gRc),t.rXU(c.a))},this.\u0275cmp=t.VBU({type:F,selectors:[["app-sample-requests"]],decls:23,vars:28,consts:[["exportCtrl",""],[1,"bg-page"],["title","Sample Requests",3,"back"],[1,"hidden","md:block","bg-white","sticky","top-0","z-20","shadow-sm","border-b","border-[#E3DDC7]/60"],[1,"max-w-page-data","mx-auto","px-3","md:px-6","py-2.5","md:py-3","flex","items-center","justify-between","gap-3"],[1,"flex","items-center","gap-3","min-w-0"],[1,"w-8","h-8","rounded-full","bg-brand/10","hover:bg-brand/20","flex","items-center","justify-center","transition-colors","cursor-pointer","border-none","flex-shrink-0",3,"click"],["name","arrow-back-outline",1,"text-base","text-brand"],[1,"text-page-title","text-brand","m-0","tracking-tight","truncate"],["type","button","aria-label","Export",1,"hidden","md:flex","items-center","gap-1.5","px-3","py-1.5","text-sm","font-semibold","text-brand","border","border-brand/30","bg-white","rounded-lg","hover:bg-brand/5","transition-colors","cursor-pointer","flex-shrink-0",3,"click"],["name","download-outline",1,"text-base"],[1,"list-page-shell","px-3","md:px-8","pt-3","md:pt-6","pb-24","md:pb-16","max-w-page-data","mx-auto","space-y-4"],[3,"filterChange","searchChange","sortChange","filterApply","filterReset","dateChange","filters","activeFilter","showSearch","searchPlaceholder","storageKey","sortConfig","filterConfig","counterpartyFacets","sortColumn","sortDirection","filterValue","dateField","dateValue","dateStorageKey","searchValue"],["class","py-12 flex items-center justify-center text-slate-500 text-sm",4,"ngIf"],["class","p-4 rounded-xl border border-red-200 bg-red-50 text-sm text-red-700 flex items-center justify-between",4,"ngIf"],[3,"icon","title","subtitle",4,"ngIf"],["class","hidden md:block bg-white rounded-xl border border-[#
1E3DDC7]/60 shadow-sm overflow-hidden",4,"ngIf"],["class","md:hidden space-y-3",4,"ngIf"],["class","flex items-center justify-between pt-2 text-sm",4,"ngIf"],[3,"entityLabel","exportUrl","fileNamePrefix","selectedIds","allMatching","totalCount","filterFn"],[1,"py-12","flex","items-center","justify-center","text-slate-500","text-sm"],[1,"p-4","rounded-xl","border","border-red-200","bg-red-50","text-sm","text-red-700","flex","items-center","justify-between"],["type","button",1,"text-sm","font-semibold","underline",3,"click"],[3,"icon","title","subtitle"],[1,"hidden","md:block","bg-white","rounded-xl","border","border-[#E3DDC7]/60","shadow-sm","overflow-hidden"],["appFitViewport","",1,"overflow-x-auto","w-full"],[1,"w-full","text-sm"],[1,"bg-slate-50","border-b","border-slate-100"],[1,"text-left","text-xs","font-semibold","text-slate-500","uppercase","tracking-wide"],[1,"px-4","py-3"],[1,"px-4","py-3","text-right"],["class","border-t border-slate-100 hover:bg-slate-50 transition-colors",4,"ngFor","ngForOf","ngForTrackBy"],[1,"border-t","border-slate-100","hover:bg-slate-50","transition-colors"],["type","button",1,"text-sm","font-semibold","text-brand","hover:underline","bg-transparent","border-0","p-0","cursor-pointer",3,"click"],[1,"px-4","py-3","text-sm","text-slate-700","font-medium"],[1,"px-4","py-3","text-slate-700"],[1,"px-4","py-3","text-slate-600"],[1,"inline-flex","items-center","px-2","py-0.5","rounded-full","text-xs","font-semibold","border"],[1,"px-4","py-3","text-slate-500"],["type","button",1,"inline-flex","items-center","gap-1","text-sm","font-semibold","text-brand","hover:underline","bg-transparent","border-0","p-0","cursor-pointer",3,"click"],["name","chevron-forward-outline"],[1,"md:hidden","space-y-3"],["type","button","class","w-full text-left bg-white rounded-xl ring-1 ring-brand/40 shadow-[0_1px_6px_rgba(0,0,0,0.05)] p-4 cursor-pointer active:bg-[#E3DDC7]/20 transition-colors",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],["type","button",1,"w-full","text-left","bg-white","rounded-xl","ring-1","ring-brand/40","shadow-[0_1px_6px_rgba(0,0,0,0.05)]","p-4","cursor-pointer","active:bg-[#E3DDC7]/20","transition-colors",3,"click"],[1,"flex","items-start","justify-between","gap-3","mb-2"],[1,"text-sm","font-bold","text-brand","tracking-tight","truncate"],[1,"inline-flex","items-center","px-2","py-0.5","rounded-full","text-xs","font-semibold","border","flex-shrink-0"],[1,"flex","items-center","justify-between","mb-1.5"],[1,"text-sm","text-slate-700","font-medium","line-clamp-2","min-w-0","mr-3"],[1,"text-xs","text-slate-500","flex-shrink-0"],[1,"text-xs","text-slate-500","font-medium"],[1,"flex","items-center","justify-between","pt-2","text-sm"],[1,"text-slate-500"],[1,"flex","items-center","gap-2"],["type","button",1,"px-3","py-1.5","rounded-lg","border","border-slate-200","bg-white","text-sm","font-semibold","text-slate-600","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"]],template:function(i,n){if(1&i){const u=t.RV6();t.j41(0,"ion-content",1)(1,"app-mobile-ribbon",2),t.bIt("back",function(){return e.eBV(u),e.Njj(n.goToDashboard())}),t.k0s(),t.j41(2,"header",3)(3,"div",4)(4,"div",5)(5,"button",6),t.bIt("click",function(){return e.eBV(u),e.Njj(n.goToDashboard())}),t.nrm(6,"ion-icon",7),t.k0s(),t.j41(7,"h1",8),t.EFF(8,"Sample Requests"),t.k0s()(),t.j41(9,"button",9),t.bIt("click",function(){e.eBV(u);const x=t.sdS(22);return e.Njj(x.open())}),t.nrm(10,"ion-icon",10),t.j41(11,"span"),t.EFF(12,"Export"),t.k0s()()()(),t.j41(13,"div",11)(14,"app-table-filters",12),t.bIt("filterChange",function(x){return e.eBV(u),e.Njj(n.onFilterChange(x))})("searchChange",function(x){return e.eBV(u),e.Njj(n.onSearchChange(x))})("sortChange",function(x){return e.eBV(u),e.Njj(n.onSortChange(x))})("filterApply",function(x){return e.eBV(u),e.Njj(n.onFilterApply(x))})("filterReset",function(){return e.eBV(u),e.Njj(n.onFilterReset())})("dateChange",function(x){return e.eBV(u),e.Njj(n.onDateChange(x))}),t.k0s(),t.DNE(15,R,2,0,"div",13)(16,v,5,0,"div",14)(17,w,1,3,"app-empty-state",15)(18,N,21,2,"div",16)(19,G,2,2,"div",17)(20,K,8,4,"div",18),t.k0s(),t.nrm(21,"app-export-control",19,0),t.k0s()}2&i&&(t.R7$(14),t.Y8G("filters",n.availableFilters)("activeFilter",n.activeFilterLabel)("showSearch",!0)("searchPlaceholder","Search by ref, title, or seller...")("storageKey","buyer-sample-requests")("sortConfig",n.sortConfig)("filterConfig",n.filterConfig)("counterpartyFacets",n.counterpartyFacets)("sortColumn",n.currentSortColumn)("sortDirection",n.currentSortDirection)("filterValue",n.filterValue)("dateField","dateCreated")("dateValue",n.dateValueForFilter)("dateStorageKey","buyer-sample-requests")("searchValue",n.searchTerm),t.R7$(),t.Y8G("ngIf",n.loading),t.R7$(),t.Y8G("ngIf",n.hasLoadError&&!n.loading),t.R7$(),t.Y8G("ngIf",!n.loading&&!n.hasLoadError&&0===n.filteredRequests.length),t.R7$(),t.Y8G("ngIf",!n.loading&&!n.hasLoadError&&n.filteredRequests.length>0),t.R7$(),t.Y8G("ngIf",!n.loading&&!n.hasLoadError&&n.filteredRequests.length>0),t.R7$(),t.Y8G("ngIf",!n.loading&&!n.hasLoadError&&n.totalPages>1),t.R7$(),t.Y8G("entityLabel","Sample Requests")("exportUrl",n.exportEndpoint)("fileNamePrefix","sample-requests")("selectedIds",n.selectedIds)("allMatching",n.allMatching)("totalCount",n.totalElements)("filterFn",n.exportFilterFn))},dependencies:[S.MD,S.Sq,S.bT,I.W9,I.iq,b.o,C.o,T.h,d.H,E.f,S.vh],styles:[".no-scrollbar[_ngcontent-%COMP%]{scrollbar-width:none}.no-scrollbar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}"],changeDetection:0}))}return g(),F})()},91087(B,O,s){s.d(O,{o:()=>l});var e=s(92958),y=s(87018),S=s(43273),I=s(81421),h=s(88683),_=s(84709),k=s(20373),D=s(90993),A=s(31328);const d=["projectedContent"],f=["*"];function b(a,m){if(1&a){const c=e.RV6();e.j41(0,"button",8),e.bIt("click",function(){_.eBV(c);const v=e.XpG(2);return _.Njj(v.onMenuToggle())}),_.qSk(),e.j41(1,"svg",9),e.nrm(2,"line",10)(3,"line",11)(4,"line",12),e.k0s()()}}function C(a,m){if(1&a){const c=e.RV6();e.j41(0,"button",8),e.bIt("click",function(){_.eBV(c);const v=e.XpG(2);return _.Njj(v.back.emit())}),e.nrm(1,"ion-icon",13),e.k0s()}}function T(a,m){if(1&a&&(e.j41(0,"span",14),e.EFF(1),e.k0s()),2&a){const c=e.XpG(2);e.R7$(),e.SpI(" ",c.title," ")}}function E(a,m){if(1&a){const c=e.RV6();e.qex(0),e.j41(1,"button",15),e.bIt("click",function(){_.eBV(c);const v=e.XpG(2);return _.Njj(v.previous.emit())}),e.nrm(2,"ion-icon",16),e.k0s(),e.j41(3,"button",15),e.bIt("click",function(){_.eBV(c);const v=e.XpG(2);return _.Njj(v.next.emit())}),e.nrm(4,"ion-icon",17),e.k0s(),e.bVm()}if(2&a){const c=e.XpG(2);e.R7$(),e.Y8G("disabled",!c.hasPrevious),e.R7$(2),e.Y8G("disabled",!c.hasNext)}}function p(a,m){if(1&a){const c=e.RV6();e.j41(0,"button",18),e.bIt("click",function(){_.eBV(c);const v=e.XpG(2);return _.Njj(v.action.emit())}),e.nrm(1,"ion-icon",19),e.EFF(2),e.k0s()}if(2&a){const c=e.XpG(2);e.R7$(2),e.SpI(" ",c.actionLabel," ")}}function t(a,m){if(1&a&&(e.j41(0,"div",2)(1,"div",3),e.DNE(2,b,5,0,"button",4)(3,C,2,0,"button",4)(4,T,2,1,"span",5)(5,E,5,2,"ng-container",6),e.j41(6,"span",null,0),e.SdG(8),e.k0s(),e.DNE(9,p,3,1,"button",7),e.k0s()()),2&a){const c=e.XpG();e.R7$(2),e.Y8G("ngIf",!c.mobileTabsActive&&!c.showBack),e.R7$(),e.Y8G("ngIf",c.showBack),e.R7$(),e.Y8G("ngIf",c.title),e.R7$(),e.Y8G("ngIf",c.showPagination),e.R7$(4),e.Y8G("ngIf",c.actionLabel)}}let l=(()=>{var a;class m{constructor(R,v,w){this.menuService=R,this.appState=v,this.router=w,this.showBack=!0,this.title="",this.showPagination=!1,this.hasPrevious=!1,this.hasNext=!1,this.actionLabel="",this.status="",this.statusClass="",this.back=new e.bkB,this.previous=new e.bkB,this.next=new e.bkB,this.action=new e.bkB,this.mobileTabsActive=!1,this.hasProjectedButtons=!1,this.tabRoutes=["/dashboard","/account"],(0,I.a)({menuOutline:h.menuOutline,arrowBackOutline:h.arrowBackOutline,chevronBackOutline:h.chevronBackOutline,chevronForwardOutline:h.chevronForwardOutline,addOutline:h.addOutline})}ngOnInit(){this.menuService.setPageHasOwnMenuToggle(!0),this.tabsSub=this.appState.mobileTabsActive$.subscribe(R=>this.mobileTabsActive=R)}ngAfterViewInit(){setTimeout(()=>{this.projectedContentRef&&(this.hasProjectedButtons=this.projectedContentRef.nativeElement.children.length>0)})}ngOnDestroy(){this.menuService.setPageHasOwnMenuToggle(!1),this.tabsSub?.unsubscribe()}get shouldHideRibbon(){if(!this.mobileTabsActive)return!1;const R=this.router.url.split("?")[0];return this.tabRoutes.includes(R)}onMenuToggle(){this.menuService.toggle("main-menu")}static#t=a=()=>(this.\u0275fac=function(v){return new(v||m)(e.rXU(k.$),e.rXU(D.i),e.rXU(A.Ix))},this.\u0275cmp=e.VBU({type:m,selectors:[["app-mobile-ribbon"]],viewQuery:function(v,w){if(1&v&&e.GBs(d,5),2&v){let U;e.mGM(U=e.lsd())&&(w.projectedContentRef=U.first)}},inputs:{showBack:"showBack",title:"title",showPagination:"showPagination",hasPrevious:"hasPrevious",hasNext:"hasNext",actionLabel:"actionLabel",status:"status",statusClass:"statusClass"},outputs:{back:"back",previous:"previous",next:"next",action:"action"},ngContentSelectors:f,decls:1,vars:1,consts:[["projectedContent",""],["class","md:hidden sticky top-0 z-20 px-4 pb-3 bg-white border-b border-slate-100","style","padding-top: calc(12px + env(safe-area-inset-top, 0px))",4,"ngIf"],[1,"md:hidden","sticky","top-0","z-20","px-4","pb-3","bg-white","border-b","border-slate-100",2,"padding-top","calc(12px + env(safe-area-inset-top, 0px))"],[1,"flex","items-center","gap-2"],["class","w-9 h-9 rounded-full bg-[#00478F]/10 hover:bg-[#00478F]/20 flex items-center justify-center transition-colors cursor-pointer border-none flex-shrink-0",3,"click",4,"ngIf"],["class","text-xl font-bold text-[#00478F] flex-1 min-w-0 truncate leading-tight py-0.5",4,"ngIf"],[4,"ngIf"],["class","flex items-center gap-1 px-3 py-1.5 bg-[#00478F] text-white rounded-lg text-[12px] font-semibold border-none cursor-pointer hover:bg-[#002f6c] transition-colors flex-shrink-0",3,"click",4,"ngIf"],[1,"w-9","h-9","rounded-full","bg-[#00478F]/10","hover:bg-[#00478F]/20","flex","items-center","justify-center","transition-colors","cursor-pointer","border-none","flex-shrink-0",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24","fill","none","stroke","#00478F","stroke-width","2","stroke-linecap","round","aria-hidden","true"],["x1","4","y1","7","x2","20","y2","7"],["x1","4","y1","12","x2","20","y2","12"],["x1","4","y1","17","x2","20","y2","17"],["name","arrow-back-outline",1,"text-lg","text-[#00478F]"],[1,"text-xl","font-bold","text-[#00478F]","flex-1","min-w-0","truncate","leading-tight","py-0.5"],[1,"w-7","h-7","rounded-lg","bg-white","border","border-gray-200","flex","items-center","justify-center","hover:bg-gray-50","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed","text-[#00478F]","shadow-sm","cursor-pointer","flex-shrink-0",3,"click","disabled"],["name","chevron-back-outline",1,"text-sm"],["name","chevron-forward-outline",1,"text-sm"],[1,"flex","items-center","gap-1","px-3","py-1.5","bg-[#00478F]","text-white","rounded-lg","text-[12px]","font-semibold","border-none","cursor-pointer","hover:bg-[#002f6c]","transition-colors","flex-shrink-0",3,"click"],["name","add-outline",1,"text-sm"]],template:function(v,w){1&v&&(e.NAR(),e.DNE(0,t,10,5,"div",1)),2&v&&e.Y8G("ngIf",!w.shouldHideRibbon)},dependencies:[y.MD,y.bT,S.iq],encapsulation:2}))}return a(),m})()},25776(B,O,s){s.d(O,{f:()=>_});var e=s(84709),y=s(92958);let _=(()=>{var k;class D{constructor(){this.host=(0,e.WQX)(y.aKT).nativeElement,this.zone=(0,e.WQX)(y.SKi),this.destroyRef=(0,e.WQX)(e.abz),this.frame=0,this.schedule=()=>{cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.measure())}}ngAfterViewInit(){typeof window>"u"||(this.zone.runOutsideAngular(()=>{if(this.media=window.matchMedia("(min-width: 768px)"),this.media.addEventListener("change",this.schedule),window.addEventListener("resize",this.schedule),typeof ResizeObserver<"u"){this.observer=new ResizeObserver(this.schedule);const d=this.host.firstElementChild;d&&this.observer.observe(d);const f=this.scroller();f!==document.documentElement&&this.observer.observe(f)}this.schedule()}),this.destroyRef.onDestroy(()=>{cancelAnimationFrame(this.frame),this.observer?.disconnect(),this.media?.removeEventListener("change",this.schedule),window.removeEventListener("resize",this.schedule)}))}measure(){const d=this.host;if(!this.media?.matches)return d.style.maxHeight="",void d.style.removeProperty("--oa-thead-bg");d.style.maxHeight="none";const f=this.scroller(),b=d.getBoundingClientRect(),C=f.getBoundingClientRect(),T=b.top-C.top+f.scrollTop-f.clientTop,p=Math.max(0,f.scrollHeight-(b.bottom-C.top+f.scrollTop-f.clientTop)),t=f.clientHeight-p,l=t-T;d.style.maxHeight=`${Math.max(200,Math.round(l>=200?l:t-72))}px`;const m=d.querySelector("thead"),c=m?getComputedStyle(m).backgroundColor:"";d.style.setProperty("--oa-thead-bg",this.isOpaque(c)?c:"#ffffff")}isOpaque(d){if(!d||"transparent"===d)return!1;const f=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(d);return!f||1===Number(f[1])}scroller(){let d=this.host.parentElement;for(;d&&d!==document.body;){if("ION-CONTENT"===d.tagName){const b=d.shadowRoot?.querySelector(".inner-scroll");
1if(b)return b}const{overflowY:f}=getComputedStyle(d);if("auto"===f||"scroll"===f)return d;d=d.parentElement}return document.documentElement}static#t=k=()=>(this.\u0275fac=function(f){return new(f||D)},this.\u0275dir=y.FsC({type:D,selectors:[["","appFitViewport",""]],hostAttrs:[1,"oa-fit-scroll"]}))}return k(),D})()}}]);
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.