1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8719],{58719:(t,e,i)=>{i.d(e,{fetchAllProductGroups:()=>l,fetchProductGroupsByIds:()=>p});var r=i(3814);function a(t){let e=t.isActive??t.IsActive??t.active??t.Active;if(!1===e||0===e||"0"===e)return!1;let i=String(t.status??t.Status??"").trim().toLowerCase();return"inactive"!==i&&"passive"!==i&&"pasif"!==i&&"deleted"!==i&&"silindi"!==i}function n(t){let e=t.id??t.Id??t.ID??t.productGroupId??t.ProductGroupId??t.groupId??t.GroupId,i="number"==typeof e?e:parseInt(String(e??"").trim(),10);return Number.isFinite(i)&&i>0?i:0}function u(t){let e=n(t),i=t.imageUrl||t.picture||t.iconUrl||t.image||("object"==typeof t.mainImage&&null!==t.mainImage?t.mainImage.url:void 0),r=String(t.alias??t.Alias??t.seoName??t.SeoName??t.slug??t.Slug??"").trim(),a=String(t.title??t.Title??t.name??t.Name??t.groupName??t.GroupName??t.productGroupName??t.ProductGroupName??t.description??t.Description??"").trim()||r,u=String(t.url??t.Url??t.seoUrl??t.SeoUrl??t.link??t.Link??t.path??t.Path??"").trim();return{id:e,alias:r||a,title:a,url:u?u.startsWith("/")?u.split("?")[0]:`/${u.split("?")[0]}`:void 0,imageUrl:"string"==typeof i&&i.length>0?i:void 0}}async function o(t){let e=(0,r.Fo)(t?.graphqlGuid||t?.guid);if(e)return e;let{getGraphQLGUID:a}=await Promise.resolve().then(i.bind(i,64795));return(0,r.Fo)(a())}async function s(t){let e=await o(t);if((0,r.uJ)(e),(0,r.uJ)(e))return[];let i=await fetch("https://rigelapi.kommerz.io/api/v5/sf/product/product_groups",{method:"GET",headers:{"Content-Type":"application/json",Guid:e},cache:"no-store"});if(!i.ok)return[];let a=await i.json();return a?.status&&a?.data?.status&&Array.isArray(a?.data?.data)?a.data.data.map(t=>({...t,id:n(t)})).filter(t=>t.id>0):[]}async function l(t){try{return(await s(t)).filter(a).map(t=>u(t)).sort((t,e)=>(t.alias||t.title).localeCompare(e.alias||e.title,"tr",{sensitivity:"base"}))}catch{return[]}}async function p(t,e){if(!t.length)return[];try{let i=await s(e),r=new Map(i.map(t=>[t.id,t]));return t.map(t=>r.get(t)).filter(t=>null!=t).map(t=>u(t))}catch{return[]}}}}]);
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.