import{a as e,d as t,l as n,m as r,n as i}from"./pageDetailHtml-CA9cVLla.js";function a(e){let t=e.toLowerCase();return t===`item.taobao.com`||t===`detail.tmall.com`}function o(e){return e.includes(`/item.htm`)}function s(e){try{let t=typeof e==`string`?new URL(e):e;return a(t.hostname)&&o(t.pathname)}catch{return!1}}function c(e){try{return new URL(e).searchParams.get(`id`)??``}catch{return``}}function l(e){try{return new URL(e).hostname.toLowerCase().includes(`tmall.com`)?`tmall`:`taobao`}catch{return`taobao`}}function u(e){return e.searchParams.get(`id`)??``}function d(n,i=48){return r(e(n,[`img`],i*2).map(t).filter(e=>/alicdn\.com/i.test(e)&&!/avatar|sns_logo|tps-\d+-\d+\.png/i.test(e))).slice(0,i)}var f=[`[class*="desc-root"]`,`[class*="detail-desc"]`,`[class*="Detail--desc"]`,`#description`,`.content`],p={key:`taobao`,match(e){return a(e.hostname)&&o(e.pathname)},extractProduct(e,t){let r=u(t),i=n(e,[`[class*="ItemHeader--"] h1`,`[class*="ItemTitle--"]`,`h1`,`title`])||e.title.replace(/-淘宝网.*|-tmall\.com.*$/i,``).trim(),a=n(e,[`[class*="Price--"]`,`[class*="priceWrap"]`,`[class*="price"]`])??``,o=d(e),s=o.slice(0,8),c=o.slice(8);return{id:r,sourceSite:t.hostname.includes(`tmall.com`)?`tmall`:`taobao`,url:t.href,title:i||`淘宝商品`,priceText:a,description:i,specs:[],mainImages:s,detailImages:c,skuImages:[],commentImages:[]}},extractCommentImages(){return[]},async fetchExtraCommentImagesById(){return[]},extractDetailHtml:e=>i(e,f)};({...p});export{l as i,s as n,c as r,p as t};