PageSourceSearch

https://sinkacementhai.com/_nuxt/CYpY1rdy.js

js sinkacementhai.com collected 2026-10-07 14:02:28 UTC 5,475 bytes, 4 lines download raw bytes

1import{b as v,Y as I,r as c,O as S,ag as j,u as K,a as z,s as q,D as M,af as b}from"./B2zKXTBA.js";const m=()=>{const d=v("auth_token");E();const l=I(),o=S();return c({role_user:"ext_buyer",company_id:"-1",limit:500,page:1,category:"",seller_shop_id:o.public.SHOP_ID,orderBy:"",status_product:"",promotion_buy_get_free:{minimumBuy:0,totalFree:0}}),{getSearchProducts:async r=>{try{return await $fetch(`/api/backend_2/partner/search/product/search_bar
2`,{method:"POST",headers:l.getAuthHeaders,body:r})}catch(e){throw console.error("API error:",e),e}},getDetailProducts:async r=>{try{return await $fetch(`/api/backend/api/erp/get_product_detail
3`,{method:"POST",body:{product_id:r}})}catch(e){throw console.error("API error:",e),e}},getCategoryProducts:async()=>{try{return await $fetch(`/api/backend/api/erp/list_category
4`,{method:"GET",headers:{"api-key":o.public.API_KEY,"api-secret":o.public.API_SECRET,"Content-Type":"application/json"}})}catch(r){throw console.error("API error:",r),r}},postFavProduct:async r=>{try{return await $fetch("/api/backend/api/erp/user/add_product_favorite",{method:"POST",headers:{Authorization:`Bearer ${d.value}`,"api-key":o.public.API_KEY,"api-secret":o.public.API_SECRET,"Content-Type":"application/json"},body:r})}catch(e){throw console.error("API error:",e),e}},getFavProductList:async r=>{try{return await $fetch("/api/backend/api/erp/user/list_product_favorite",{method:"POST",headers:{Authorization:`Bearer ${d.value}`,"api-key":o.public.API_KEY,"api-secret":o.public.API_SECRET,"Content-Type":"application/json"},body:r})}catch(e){throw console.error("API error:",e),e}},getQuotationProduct:async r=>{try{return await $fetch("/api/backend/api/erp/product/preview_quotation",{method:"POST",headers:{Authorization:`Bearer ${d.value}`,"api-key":o.public.API_KEY,"api-secret":o.public.API_SECRET,"Content-Type":"application/json"},body:r})}catch(e){throw console.error("API error:",e),e}}}},E=j("product",()=>{const d=K(),l=z(),{can_contact_staff:o}=q(d),P=M(),y=c(null),s=c(""),a=c(null),h=c([]),g=c(0),r=c(1),e=c(1),f=c(0),A=S(),k=c(null),p=c({role_user:"ext_buyer",company_id:"-1",limit:20,page:1,category:"",seller_shop_id:A.public.SHOP_ID,orderBy:"",order_by_price:"",status_product:"",filter_tag_shop_id:"",manufacturer_id:"",promotion_buy_get_free:{minimumBuy:0,totalFree:0},keyword:""}),w=c({product_id:null,role_user:"ext_buyer",action:"",company_id:-1,company_position_id:-1,com_perm_id:-1}),T=c({role_user:"ext_buyer",company_id:-1,company_position_id:-1,com_perm_id:-1,product_type:"",product_category:"",page:1,limit:12}),F=async()=>{try{const{getCategoryProducts:t}=m(),u=await t();k.value=u.data}catch(t){a.value=t.message}},B=async()=>{try{p.value.limit=20;const{orderBy:t,promotion_buy_get_free:u,...n}=p.value,{fetchProductAllSearch_bar:i}=C(),_=await i(n);h.value=_.query_result,r.value=_.pagination.max_page,f.value=_.pagination.total_proudcts}catch(t){a.value=t.message}},$=async()=>{l.changeStateLoading(!0);try{p.value.limit=20;const{order_by_price:t,keyword:u,...n}=p.value,{fetchProductAll:i}=C(),_=await i(n);y.value=_,P.query.keywords||(r.value=_.pagination.max_page,f.value=_.pagination.total_proudcts),l.changeStateLoading(!1)}catch(t){a.value=t.message,l.changeStateLoading(!1)}},O=async t=>{let u=w.value;u={...w.value,product_id:t.product_id,action:t.action};try{const{postFavProduct:n}=m();return await n(u)}catch(n){a.value=n.message}},x=async()=>{var t,u;try{const{getFavProductList:n}=m(),i=await n(T.value);return e.value=((u=(t=i==null?void 0:i.data)==null?void 0:t.pagination)==null?void 0:u.total_pages)||1,i}catch(n){a.value=n.message}},H={role_user:"ext_buyer",company_id:"-1",limit:20,page:1,category:"",seller_shop_id:A.public.SHOP_ID,orderBy:"",status_product:"",promotion_buy_get_free:{minimumBuy:0,totalFree:0}};function L(){g.value=0,p.value={...H}}function R(){g.value=0,p.value.page=1}function Y(t){return!t.stock_count||t.stock_count<=0?"out_of_stock":o.value&&t.contact_staff==="Y"?"contact_staff":"add_to_cart"}function D(t){return!t.stock||t.stock<=0?"out_of_stock":o.value&&t.contact_staff==="Y"?"contact_staff":"add_to_cart"}return{offset:g,totalPages:r,fav_totalPages:e,product:y,error:a,search_product:s,payload:p,listCategory:k,dataSearchbar:h,fav_list_payload:T,loadProduct:$,clearPayload:L,resetPagePayload:R,loadCategoryProduct:F,loadProductSearchbar:B,updateFavProductData:O,LoadFavProduct:x,getButtonTypeForFlashSaleCard:Y,getButtonTypeForNormalCard:D,totalProduct:f}}),C=()=>{E();const d=I();v("auth_token");const l=S();return{fetchProductAll:async s=>{try{return await $fetch("/api/backend_2/partner/search/product/filter",{method:"POST",headers:d.getAuthHeaders,body:s})}catch(a){throw console.log("error :>> ",a),b({statusCode:500,statusMessage:a.value.message})}},fetchProductAllSearch_bar:async s=>{try{return await $fetch("/api/backend_2/partner/search/product/search_bar",{method:"POST",headers:d.getAuthHeaders,body:s})}catch(a){throw console.log("error :>> ",a),b({statusCode:500,statusMessage:a.value.message})}},getSearchHistories:async()=>{try{let s={order_by:"search_count"},a=v("auth_token").value;return await $fetch("/api/backend/api/erp/seller/search-histories",{method:"POST",headers:{"a
4pi-key":l.public.API_KEY,"api-secret":l.public.API_SECRET,"Content-Type":"application/json",...a&&{Authorization:`Bearer ${a}`}},body:s})}catch(s){throw console.log("error :>> ",s),b({statusCode:500,statusMessage:s.value.message})}}}};export{C as a,m as b,E as u};

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.