PageSourceSearch

https://s1.sellfox.com/sellfox-web/2026-09/bundle.18204.f92af6d7.js

js sellfox.com collected 2026-09-24 08:47:48 UTC 218,042 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkamzup_web_main=self.webpackChunkamzup_web_main||[]).push([["18204"],{46148:function(e,t,r){r.d(t,{A:function(){return n}});var n=(0,r(28644).A)({name:"TabPage",props:{title:{type:String,default:""},bodyPadding:{type:Boolean,default:!1}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"tp flex column h_p_100 overflow_h"},[e.title||e.$slots.title?r("div",{staticClass:"tp-title flex flex_wrap flex_start center_align f_16 fw_500 flex_no_shrink line_h_32"},[e._t("title",function(){return[r("div",[e._v(e._s(e.title))])]})],2):e._e(),e._v(" "),r("div",{staticClass:"tp-body flex_1 overflow_h",class:{"tp-body-padding":e.bodyPadding}},[e._t("default")],2),e._v(" "),e.$slots.footer?r("div",{staticClass:"tp-footer flex center_just center_align flex_no_shrink"},[e._t("footer")],2):e._e()])},[],!1,null,"50c3720c",null).exports},91157:function(e,t,r){r.d(t,{A:function(){return m}}),r(77949),r(93893),r(31731),r(5092),r(25259),r(937);var n=r(75899),i=r(52559),a=r(94768),o=r(75589),s=r(50903);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){c(a,n,i,o,s,"next",e)}function s(e){c(a,n,i,o,s,"throw",e)}o(void 0)})}}function d(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return l(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var h=a.Ay.getAllShopSiteInfo(),f={name:"ProductInventPriceProfit",components:{TextTips:n.A,NewPriceProfitView:s.A},emits:["controlChange"],props:{code:{type:String,default:null},add:{type:Boolean,default:!0},canCopy:{type:Boolean,default:!0}},watch:{code:function(e){return u(function(){var t;return p(this,function(r){switch(r.label){case 0:if(this.$utils.isEmpty(this.code))return[2];return t=this,[4,this.loadData(e)];case 1:return t.data=r.sent(),[2]}})}).call(this)}},data:function(){return this.editRow={},{dialogBtnLoading:!1,priceProfitDialogType:1,data:[],loading:!1,drawerVisible:!1}},computed:{columns:function(){var e=function(e){var t=e.cellValue;return t?"".concat(t,"%"):a.Ay.formatEmptyValue(null,0)},t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"\uFFE5";return function(t){var r=t.cellValue;return"".concat(e).concat(a.Ay.formatEmptyValue(r,0))}};return[{title:this.$t("main.wares.product.invent.form.base.country"),field:"marketplaceName",minWidth:80,fixed:"left",formatter:function(e){var t=e.cellValue;return a.Ay.formatEmptyValue(t)}},{title:this.$t("main.wares.product.invent.price.profit.suggested.retail"),field:"suggestedRetail",minWidth:100,align:"right",slots:{default:"amount"}},{title:this.$t("main.wares.product.invent.form.listing.profit.price"),field:"grossProfit",minWidth:100,align:"right",slots:{default:"amount"}},{title:this.$t("main.wares.product.invent.form.listing.profit.rate"),field:"grossProfitMargin",minWidth:100,align:"right",formatter:e},{title:"ROI",field:"roi",minWidth:100,align:"right",formatter:e,params:{tip:this.$t("main.wares.product.invent.price.profit.roi.tip")},slots:{header:"header_tip"}},{title:this.$t("main.wares.product.invent.price.profit.purchase.cost"),field:"purchaseCost",minWidth:100,align:"right",formatter:t()},{title:this.$t("main.wares.product.invent.price.profit.head.fee"),field:"headfee",minWidth:100,align:"right",formatter:t()},{title:this.$t("main.wares.product.invent.price.profit.tariff"),field:"tariffPrice",minWidth:100,align:"right",slots:{default:"tariffPrice"}},{title:this.$t("main.wares.product.invent.price.profit.distribution.fee"),field:"distributionFee",minWidth:100,align:"right",slots:{default:"amount"}},{title:this.$t("main.wares.product.invent.price.profit.storage.fee"),field:"reportMonthlyStorageFee",minWidth:100,align:"right",slots:{default:"amount"}},{title:this.$t("main.wares.product.invent.price.profit.platform.fee"),field:"platformFee",minWidth:100,align:"right",slots:{default:"platformFee"}},{title:this.$t("common.operation"),field:"op",width:(0,i.n)("100"),fixed:"right",slots:{default:"op"}}]},priceProfitDialogBtnText:function(){return 1===this.priceProfitDialogType?this.$t("main.wares.product.invent.price.profit.add.to.list"):this.$t("main.wares.product.invent.price.profit.update.to.list")}},created:function(){return u(function(){var e;return p(this,function(t){switch(t.label){case 0:if(!this.$utils.isNotEmpty(this.code))return[3,2];return e=this,[4,this.loadData(this.code)];case 1:e.data=t.sent(),t.label=2;case 2:return[2]}})}).call(this)},methods:{remove:function(e,t){this.$utils.isNotEmpty(e.id)?this.$message.error(this.$t("main.wares.product.invent.price.profit.remove.added.error")):this.data.splice(t,1)},copyHandler:function(e){var t=this.$utils.pick(e,["shopId","shopName","asin","productName","sku","title","image","suggestedRetail","grossProfit","grossProfitMargin","roi","templateId","templateName","marketplaceName","currencySymbol","marketplaceId","longDimension","wideDimension","highDimension","weight","weightType","distributionType","shippingCredits","purchaseCost","headfee","platformFee","platformFeeProportion","reportMonthlyStorageFee","distributionFee","declarePriceData","declarePriceDataType","vatTaxrate","vatTaxation","tariffRate","tariffPrice","advExpenses","advExpensesPriceType","advExpensesPrice","promotionFee","promotionFeeType","promotionPrice","evaluationFee","evaluationFeeType","evaluationPrice","returnFee","returnFeeType","returnPrice","otherFee","otherFeeType","otherprice","content"]);this.data.push(t),this.$emit("controlChange")},addPriceProfit:function(){var e=this;this.priceProfitDialogType=1,(0,o.vr)("product_invent_create_price_profit_add","click"),this.drawerVisible=!0,this.$nextTick(function(){e.$refs.priceProfitView.commodityDataHandle({})})},editPriceProfit:function(e){var t=this;this.priceProfitDialogType=2,this.editRow=e,this.drawerVisible=!0,this.$nextTick(function(){t.$refs.priceProfitView.handleReviewEditData(e)})},priceProfitHandler:function(){1===this.priceProfitDialogType?this.addPriceProfitSuccessHandler():this.editPriceProfitHandler()},editPriceProfitHandler:function(){return u(function(){var e,t,r,n,i;return p(this,function(a){switch(a.label){case 0:e=this,a.label=1;case 1:return a.trys.push([1,4,5,6]),(t=this.$refs.priceProfitView.getProfitInfo()).id=this.editRow.id,t.createTime=this.editRow.createTime,this.dialogBtnLoading=!0,[4,this.$http.updatePriceTrailContent(t)];case 2:return a.sent(),this.$message.success(this.$t("main.wares.product.invent.price.profit.edit.success")),this.drawerVisible=!1,r=this.data.filter(function(t){return e.$utils.isEmpty(t.id)}),[4,this.loadData(this.code)];case 3:return n=a.sent(),this.data=d(n).concat(d(r)),[3,6];case 4:return i=a.sent(),this.$message.handle(i),[3,6];case 5:return this.dialogBtnLoading=!1,[7];case 6:return[2]}})}).call(this)},addPriceProfitSuccessHandler:function(){if(this.$refs.priceProfitView.valid()){var e=this.$refs.priceProfitView.getProfitInfo(),t=this.$utils.getSiteInfo(e.marketplaceId),r=t.name,n=t.currency,i=t.currencySymbol;e.marketplaceName=r,e.currency=n,e.currencySymbol=i,this.data.push(e),this.drawerVisible=!1,this.$emit("controlChange")}},getFormValue:function(){return{priceTrailTemplateContentList:this.data}},drawerClose:function(){var e;null==(e=this.$refs.priceProfitView)||e.restTemplateDataFn()}
1,loadData:function(e){return u(function(){var t,r;return p(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.loading=!0,[4,this.$http.getProductInventPriceProfitByCode(e)];case 1:return(t=n.sent()).forEach(function(e){var t=h[e.marketplaceId];e.currencySymbol=t.currencySymbol}),[2,t];case 2:return r=n.sent(),this.$message.handle(r),[2,[]];case 3:return this.loading=!1,[7];case 4:return[2]}})}).call(this)}}},m=(0,r(28644).A)(f,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"pipp",attrs:{"element-loading-spinner":"icon_load_mid"}},[e.add&&e.$hasPermission("MOD_COMMODITY_DEV.ADD_PRICE")?r("el-button",{staticClass:"mb_12",attrs:{type:"primary"},on:{click:function(t){return e.addPriceProfit()}}},[e._v(e._s(e.$t("main.wares.product.invent.price.profit.add.trial")))]):e._e(),e._v(" "),r("vxe-grid",{staticClass:"vxe_table_row_height_48 vxe_table_padding table_standard PageListMouseWheelClass",attrs:{columns:e.columns,data:e.data,"auto-resize":"",round:"","row-key":"",resizable:"","tooltip-config":{showAll:!0,theme:"light"},"max-height":"540px","highlight-current-row":"","highlight-hover-row":"","show-overflow":"tooltip","show-header-overflow":"tooltip","empty-text":e.$t("main.product.invent.no.data")},scopedSlots:e._u([{key:"header_tip",fn:function(t){var n=t.column,i=n.title,a=n.params.tip;return[r("span",[e._v(e._s(i))]),e._v(" "),r("i",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:a,expression:"tip",arg:"light"}],staticClass:"icon_sf_help"})]}},{key:"amount",fn:function(t){var n=t.row,i=t.column.property;return[r("span",[e._v(e._s(e._f("currencySymbol")(e._f("toThousands")(n[i]),n.currencySymbol)))])]}},{key:"tariffPrice",fn:function(t){var n=t.row;return[r("div",{staticClass:"flex column end_align"},[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light.isShow",value:"\uFFE5"+(n.tariffPrice||0),expression:"`\uFFE5${row.tariffPrice || 0}`",arg:"light",modifiers:{isShow:!0}
1}],staticClass:"line_clamp_max_w w_content"},[e._v("\n                    \uFFE5"+e._s(e._f("empty")(n.tariffPrice,0))+"\n                ")]),e._v(" "),r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light.isShow",value:(n.tariffRate||0)+"%",expression:"`${row.tariffRate || 0.00}%`",arg:"light",modifiers:{isShow:!0}}],staticClass:"line_clamp_max_w w_content f_gray"},[e._v("\n                    "+e._s(e._f("empty")(n.tariffRate,0))+"%\n                ")])])]}},{key:"platformFee",fn:function(t){var n=t.row;return[r("div",{staticClass:"flex column end_align"},[r("TextTips",{scopedSlots:e._u([{key:"content",fn:function(){return[r("div",[e._v(e._s(e._f("currencySymbol")(e._f("toThousands")(n.platformFee),n.currencySymbol)))])]},proxy:!0}],null,!0)},[e._v(" "),r("div",{staticClass:"line_clamp_max_w w_content"},[e._v("\n                        "+e._s(e._f("currencySymbol")(e._f("toThousands")(n.platformFee),n.currencySymbol))+"\n                    ")])]),e._v(" "),r("TextTips",{scopedSlots:e._u([{key:"content",fn:function(){return[r("div",[e._v(" "+e._s(e._f("percent")(e._f("empty")(n.platformFeeProportion,0),2,!e.$utils.isNotEmpty(n.id)))+"%")])]},proxy:!0}],null,!0)},[e._v(" "),r("div",{staticClass:"line_clamp_max_w w_content f_gray"},[e._v("\n                        "+e._s(e._f("percent")(e._f("empty")(n.platformFeeProportion,0),2,!e.$utils.isNotEmpty(n.id)))+"\n                    ")])])],1)]}},{key:"op",fn:function(t){var n=t.row,i=t.rowIndex;return[e.$utils.isNotEmpty(n.id)?[e.$utils.isNotEmpty(n.id)&&e.$hasPermission("MOD_COMMODITY_DEV.ADD_PRICE")?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.editPriceProfit(n)}}},[e._v(e._s(e.$t("common.edit"))+"\n                ")]):e._e(),e._v(" "),e.canCopy&&e.$hasPermission("MOD_COMMODITY_DEV.ADD_PRICE")?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.copyHandler(n)}}},[e._v(e._s(e.$t("common.copy")))]):e._e()]:r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.remove(n,i)}}},[e._v(e._s(e.$t("common.remove")))])]}}])}),e._v(" "),r("el-drawer",{staticClass:"supplier_add_modal",attrs:{direction:"ltr",visible:e.drawerVisible,"append-to-body":!1,modal:!1,"destroy-on-close":!0,"custom-class":"drawer_box",title:e.$t("main.wares.product.invent.price.profit.trial")},on:{"update:visible":function(t){e.drawerVisible=t},closed:e.drawerClose}},[r("NewPriceProfitView",{ref:"priceProfitView",attrs:{"show-commodity-info":!1},scopedSlots:e._u([{key:"actions",fn:function(){return[r("el-button",{attrs:{type:"primary",loading:e.dialogBtnLoading},on:{click:function(t){return e.priceProfitHandler()}}},[e._v("\n                    "+e._s(e.priceProfitDialogBtnText)+"\n                ")])]},proxy:!0}])})],1)],1)},[],!1,null,"76c169d9",null).exports},51193:function(e,t,r){r.d(t,{A:function(){return L}}),r(20767),r(77949),r(31731),r(5092),r(25259),r(937),r(93893),r(915);var n=r(67915),i=r(97938),a=r(52559),o=r(94768),s=r(48904),l=r(85399),c=r(82505),u={name:"TrackCategoryRankField",mixins:[l.A],components:{SinglePopover:c.A},props:{data:{type:Array,default:function(){return[]}}},data:function(){return{bsrRankBig:[]}},computed:{defaultInfo:function(){var e;return(null==(e=this.data)?void 0:e.length)?this.data[0]:null}}},d=r(28644),p=(0,d.A)(u,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.defaultInfo?r("div",{directives:[{name:"single-popover",rawName:"v-single-popover",value:{data:e.data,refName:"popoverRef",dataName:"bsrRankBig"},expression:"{data: data , refName: 'popoverRef',dataName: 'bsrRankBig'}"}]},[r("div",{staticClass:"line_clamp"},[r("span",[e._v(e._s(e.defaultInfo.rank))]),e._v(" "),r("span",{staticClass:"ml_5"},[r("span",{staticClass:"f_gray"},[e._v(e._s(e.defaultInfo.orderStr))]),e._v(" "),1===e.defaultInfo.orderType?r("i",{staticClass:"icon_sf_arrow_up f_red"}):2===e.defaultInfo.orderType?r("i",{staticClass:"icon_sf_arrow_down f_green"}):e._e()]),e._v(" "),e.data&&e.data.length>1?r("i",{staticClass:"icon_sf_down_line ml_5"}):e._e()]),e._v(" "),r("div",{staticClass:"line_clamp f_gray"},[e._v(e._s(e.defaultInfo.categoryName))])]):[e._v("-")],e._v(" "),r("SinglePopover",{ref:"popoverRef"},[r("div",{staticClass:"bsr_detail"},e._l(e.bsrRankBig,function(t,n){return r("div",{key:n,staticClass:"bsr_detail_single"},[r("div",{staticClass:"rank"},[r("span",[e._v(e._s(t.rank))]),e._v(" "),r("span",{staticClass:"ml_5"},[r("span",{staticClass:"f_gray"},[e._v(e._s(t.orderStr))]),e._v(" "),1===t.orderType?r("i",{staticClass:"icon_sf_arrow_up f_red"}):2===t.orderType?r("i",{staticClass:"icon_sf_arrow_down f_green"}):e._e()])]),e._v(" "),r("div",{staticClass:"f_gray"},[e._v(e._s(t.categoryName))])])}),0)])],2)},[],!1,null,null,null).exports,h=(0,d.A)({name:"TrackPriceField",props:{row:Object}},function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("div",{staticClass:"line_clamp"},[this._v(this._s(this.row.currencyCode)+" "+this._s(this.row.priceVal||"0.00"))]),this._v(" "),1===this.row.priceType?t("el-popover",{attrs:{placement:"bottom",width:"200",trigger:"hover"}},[t("ul",[t("li",{staticClass:"flex between"},[t("span",[this._v(this._s(this.$t("main.wares.product.invent.amazon.price")))]),this._v(" "),t("span",this.row.amazonPrice?[this._v(this._s(this.row.currencyCode)+" "+this._s(this.row.amazonPrice))]:[this._v("-")])]),this._v(" "),t("li",{staticClass:"flex between"},[t("span",[this._v(this._s(this.$t("main.wares.product.invent.new.offer.price")))]),this._v(" "),t("span",this.row.newPrice?[this._v(this._s(this.row.currencyCode)+" "+this._s(this.row.newPrice))]:[this._v("-")])]),this._v(" "),t("li",{staticClass:"flex between"},[t("span",[this._v("Listing Price")]),this._v(" "),t("span",this.row.newPrice?[this._v(this._s(this.row.currencyCode)+" "+this._s(this.row.listPrice))]:[this._v("-")])]),this._v(" "),t("li",{staticClass:"flex between"},[t("span",[this._v(this._s(this.$t("main.wares.product.invent.buy.box.price")))]),this._v(" "),t("span",this.row.newPrice?[this._v(this._s(this.row.currencyCode)+" "+this._s(this.row.buyBoxPrice))]:[this._v("-")])])]),this._v(" "),t("div",{attrs:{slot:"reference"},slot:"reference"},[t("span",{staticClass:"buy_box line_clamp"},[this._v("Buy Box")])])]):this._e()],1)},[],!1,null,"80941fdc",null).exports,f=r(30706),m=r(90316),v=r(79842);function g(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var y={name:"ProductInventTrackEdit",components:{Modal:m.aF,OrgStruStaffSelect:v.A},emits:["confirm"],props:{ids:{type:Array,required:!0},monitorUserIds:{type:Array,default:function(){return[]}}},data:function(){return{creatorOptions:{type:"multiple",filterable:!0,clearable:!0,width:208,placeholder:this.$t("main.product.invent.please.select")},loading:!1,form:{trackingIds:this.ids,monitorPersonIds:(this.monitorUserIds||[]).map(function(e){return"".concat(e)})}}},methods:{confirm:function(){var e;return(e=function(){var e;return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,4,5]),this.loading=!0,[4,this.$refs.formRef.validate().catch(function(){return!1})];case 1:if(!t.sent())return[2];return[4,this.$http.trackingBatchUpdate(this.form)];case 2:return t.sent(),this.$message.success(this.$t("common.edit.success")),this.$emit("confirm",this.form.monitorPersonIds),this.$closeModal(),[3,5];case 3:return e=t.sent(),this.$message.handle(e),[3,5];case 4:return this.loading=!1,[7];case 5:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){g(a,n,i,o,s,"next",e)}function s(e){g(a,n,i,o,s,"throw",e)}o(void 0)})}).call(this)}}},_=(0,d.A)(y,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("Modal",{attrs:{title:e.$t("main.product.invent.edit.monitor"),"custom-class":"dialog_mini no_mt","close-on-click-modal":!1,"close-on-press-escape":!1},scopedSlots:e._u([{key:"footer",fn:function(){return[r("el-button",{attrs:{loadingl:e.loading},on:{click:function(t){return e.$closeModal()}}},[e._v(e._s(e.$t("common.cancel")))]),e._v(" "),r("el-button",{attrs:{type:"primary",loadingl:e.loading},on:{click:function(t){return e.confirm()}}},[e._v(e._s(e.$t("main.product.invent.submit")))])]},proxy:!0}])},[r("el-form",{directives:[{name:"i18n-label-adapt",rawName:"v-i18n-label-adapt",value:{maxWidth:60},expression:"{ maxWidth: 60 }"}],ref:"formRef",attrs:{model:e.form,"label-width":"60px"}},[r("el-form-item",{attrs:{prop:"monitorPersonIds",label:e.$t("main.product.invent.monitor.person"),rules:[{required:!0,message:e.$t("main.product.invent.select.monitor.person")}]}},[r("OrgStruStaffSelect",e._b({model:{value:e.form.monitorPersonIds,callback:function(t){e.$set(e.form,"monitorPersonIds",t)},expression:"form.monitorPersonIds"}},"OrgStruStaffSelect",e.creatorOptions,!1))],1)],1)],1)},[],!1,null,null,null).exports,b=r(75589);r(84503),r(46491),r(62394),r(99583),r(13951),r(86754);var w=r(2851),k=r(59335);function S(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function O(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var $=["1","2","3","4","5","6","8","9","10","16","24","23"],I={name:"ProductInventAddTrack",components:{Modal:m.aF,CountrySelector:w.A,OrgStruStaffSelect:v.A},props:{useCount:{type:Number,default:0},maxCount:{type:Number,default:0}},data:function(){var e=this,t=Object.values(this.$utils.getAllShopSiteSelInfo()||{}).reduce(function(e,t){return e[t.value]=t,e},{}),r=$.map(function(r){var n=e.$utils.getSiteInfoByUniqueId(r),i=t[null==n?void 0:n.code];return i?O(C({},i),{value:r}):null}).filter(Boolean);return this.asinValidator=function(t,r,n){if(o.Ay.isEmpty(null==r?void 0:r.trim()))return n(e.$t("main.wares.product.invent.enter.asin"));var i=r.trim().replace(/\uff0c/g,",").replace(/\n/g,",");if(i.split(",").some(function(e){return!/^[A-Z0-9]{10}$/.test(e)}))return n(e.$t("main.wares.product.invent.asin.format.error"));var a=i.split(",").filter(function(e){return o.Ay.isNotEmpty(e)});return 0===a.length?n(e.$t("main.wares.product.invent.enter.monitor.asin")):a.some(function(e){return e.length>20})?n(e.$t("main.wares.product.invent.asin.length.exceeded")):n()},{loading:!1,form:{domainId:null,asins:null,monitorPersonIds:[]},creatorOptions:Object.freeze({type:"multiple",filterable:!0,clearable:!0,width:208,placeholder:this.$t("common.select.placeholder")}),countryOptions:Object.freeze({placeholder:this.$t("main.product.invent.select.site"),type:"single",width:"full",options:r})}},computed:C({},(0,k.mapState)("System",{user:function(e){return e.user}})),created:function(){this.form.monitorPersonIds=["".concat(this.user.id)]},methods:{personChange:function(){this.$refs.formRef.validateField("monitorPersonIds")},countryChange:function(e){this.form.domainId=e},onSubmit:function(){var e;return(e=function(){var e,t,r;return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,3,4]),this.loading=!0,!(e=Math.max(this.maxCount-this.useCount,0)))return this.$message({dangerouslyUseHTMLString:!0,message:this.$t("main.wares.product.invent.monitor.limit.tip",{count:e}),type:"error"}),[2];return[4,this.$refs.formRef.validate().catch(function(){return!1})];case 1:if(!n.sent())return[2];return t=this.form.asins.trim().replace(/\uff0c/g,",").replace(/\n/g,",").split(","),this.$emit("confirm",O(C({},this.$utils.pick(this.form,["domainId","monitorPersonIds"])),{asins:t})),this.$closeModal(),[3,4];case 2:return r=n.sent(),this.$message.handle(r),[3,4];case 3:return this.loading=!1,[7];case 4:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){S(a,n,i,o,s,"next",e)}function s(e){S(a,n,i,o,s,"throw",e)}o(void 0)})}).call(this)}}},R=(0,d.A)(I,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("Modal",{attrs:{title:e.$t("main.wares.product.invent.add.monitor"),"custom-class":"dialog_small dialog_height_auto no_mt","close-on-click-modal":!1,"close-on-press-escape":!1},scopedSlots:e._u([{key:"footer",fn:function(){return[r("el-button",{attrs:{loading:e.loading},on:{click:function(t){return e.$closeModal()}}},[e._v(e._s(e.$t("common.cancel")))]),e._v(" "),r("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.onSubmit()}}},[e._v(e._s(e.$t("common.add")))])]},proxy:!0}])},[r("el-form",{directives:[{name:"i18n-label-adapt",rawName:"v-i18n-label-adapt",value:{maxWidth:60},expression:"{ maxWidth: 60 }"}],ref:"formRef",attrs:{model:e.form,"label-width":"60px"}},[r("div",{staticClass:"flex column-gap-24"},[r("el-form-item",{staticClass:"flex_1",attrs:{label:e.$t("common.site"),prop:"domainId",rules:[{required:!0,message:e.$t("main.wares.product.invent.select.site")}]}},[r("CountrySelector",{attrs:{options:e.countryOptions,placeholder:e.$t("main.wares.product.invent.select.site"),clearable:!0},on:{"on-change":function(t){return e.countryChange(t)}
1}})],1),e._v(" "),r("el-form-item",{staticClass:"flex_1",attrs:{label:e.$t("main.wares.product.invent.monitor.person"),prop:"monitorPersonIds",rules:[{required:!0,message:e.$t("main.wares.product.invent.select.monitor.person")}]}},[r("OrgStruStaffSelect",e._b({on:{"on-change":function(t){return e.personChange()}},model:{value:e.form.monitorPersonIds,callback:function(t){e.$set(e.form,"monitorPersonIds",t)},expression:"form.monitorPersonIds"}},"OrgStruStaffSelect",e.creatorOptions,!1))],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"ASIN",prop:"asins",rules:[{validator:e.asinValidator,trigger:"blur"},{required:!0,message:e.$t("main.wares.product.invent.enter.monitor.asin")}]}},[r("el-input",{attrs:{type:"textarea",autosize:{minRows:5,maxRows:10},placeholder:e.$t("main.wares.product.invent.asin.placeholder")},model:{value:e.form.asins,callback:function(t){e.$set(e.form,"asins",t)},expression:"form.asins"}})],1)],1)],1)},[],!1,null,"4f4859a0",null).exports;function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}r(21927),r(25962),r(48741),r(72860),r(61114),r(86201);var T={name:"ProductInventCreateReview",components:{Modal:m.aF,CountrySelector:w.A},emits:["confirm"],props:{marketplaceId:{type:Number,default:null},asinList:{type:Array,default:function(){return[]}},config:{type:Object,default:function(){return{marketplaceDisabled:!1,asinDisabled:!1}}}},data:function(){var e=this,t=this.$utils.getAllShopSiteSelInfo();return this.asinValidator=function(t,r,n){var i,a=function(e){if(Array.isArray(e))return P(e)}(i=new Set(e.form.asin.split(/\n/).filter(function(e){return e})))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e){if(e){if("string"==typeof e)return P(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return a.length>10?n(e.$t("main.product.invent.max.ten.unique.asins")):a.some(function(e){return!e.match(/^[0-9a-zA-Z]{10}$/)})?n(e.$t("main.product.invent.asin.format.error")):n()},{form:{marketplaceId:this.marketplaceId,asin:this.asinList.join("\n")},countrySelectOptions:{filterable:!0,width:"full",options:t,placeholder:this.$t("common.all.site"),popoverClass:"countries_select",clearable:!0,disabled:this.config.marketplaceDisabled,value:this.marketplaceId}}},methods:{asinInput:function(){var e=this.form.asin.split(/\n/),t=[];if(e.length>10){for(var r=0;r<10;r++)t.push(e[r]);this.form.asin=t.join("\n")}},siteUpdate:function(e){this.form.marketplaceId=e},submit:function(){var e;return(e=function(){return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,this.$refs.formRef.validate().catch(function(){return!1})];case 1:if(!e.sent())return[2];return this.$emit("confirm",{marketplaceId:this.form.marketplaceId,asinList:this.form.asin.split(",")}),this.$closeModal(),[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){x(a,n,i,o,s,"next",e)}function s(e){x(a,n,i,o,s,"throw",e)}o(void 0)})}).call(this)}}},A=(0,d.A)(T,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("Modal",{attrs:{title:e.$t("main.product.invent.add.review.analysis"),"custom-class":"dialog_mini no_mt","close-on-click-modal":!1,"close-on-press-escape":!1},scopedSlots:e._u([{key:"footer",fn:function(){return[r("el-button",{on:{click:function(t){return e.$closeModal()}}},[e._v(e._s(e.$t("common.cancel")))]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submit()}}},[e._v(e._s(e.$t("common.save")))])]},proxy:!0}])},[r("el-form",{directives:[{name:"i18n-label-adapt",rawName:"v-i18n-label-adapt",value:{maxWidth:55},expression:"{ maxWidth: 55 }"}],ref:"formRef",staticClass:"w_p_100",attrs:{model:e.form,"label-width":"55px"}},[r("div",{staticClass:"tip_cls"},[r("i",{staticClass:"f_blue f_16 icon_sf_info"}),e._v(" "),r("span",[e._v(e._s(e.$t("main.product.invent.review.child.asin.tip")))])]),e._v(" "),r("el-form-item",{attrs:{label:e.$t("main.product.invent.site"),prop:"marketplaceId",rules:[{required:!0,message:e.$t("main.product.invent.select.site")}]}},[r("CountrySelector",{ref:"countrySelect",attrs:{options:e.countrySelectOptions},on:{"on-change":e.siteUpdate}})],1),e._v(" "),r("el-form-item",{attrs:{label:"ASIN",prop:"asin",rules:[{required:!0,message:e.$t("main.product.invent.enter.asin")},{validator:e.asinValidator}]}},[r("el-input",{attrs:{maxlength:"1000",disabled:e.config.asinDisabled,rows:6,type:"textarea"},on:{input:e.asinInput},model:{value:e.form.asin,callback:function(t){e.$set(e.form,"asin",t)},expression:"form.asin"}})],1)],1)],1)},[],!1,null,"7e538868",null).exports;r(28729);var j=r(39661),F={name:"FieldList",components:{PopoverContainer:r(9527).A},inheritAttrs:!1,props:{value:{type:Array,default:function(){return[]}},defaultValue:{type:[String,Number],default:"-"},showIcon:{type:Boolean,default:!0},always:{type:Boolean,default:!1}},computed:{isMore:function(){var e;return!!this.always||(null==(e=this.value)?void 0:e.length)>1},displayValue:function(){var e;return(null==(e=this.value)?void 0:e.length)>0?this.value[0]:null}},methods:{resizePopover:function(){this.$refs.popoverRef.resize()}}},D=(0,d.A)(F,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.isMore?r("PopoverContainer",e._b({ref:"popoverRef",scopedSlots:e._u([{key:"trigger",fn:function(){return[r("div",{staticClass:"flex overflow_h center_align pointer"},[e._t("trigger",function(){return[r("div",{staticClass:"flex_1 line_clamp"},[e._v("\n                        "+e._s(e._f("empty")(e.displayValue,e.defaultValue))+"\n                    ")])]},{value:e.displayValue}),e._v(" "),e.showIcon?r("i",{staticClass:"icon_sf_down_line ml_2 flex_no_shrink f_16 f_grey_icon"}):e._e()],2)]},proxy:!0},{key:"default",fn:function(){return[e._t("default",function(){return[r("div",{staticClass:"flex column max_height_300 overflow_auto_y"},e._l(e.value,function(t,n){return r("span",{key:n,staticClass:"lh_16"},[e._v(e._s(e._f("empty")(t,e.defaultValue)))])}),0)]})]},proxy:!0}],null,!0)},"PopoverContainer",e.$attrs,!1)):e._t("trigger",function(){return[r("div",{staticClass:"line_clamp"},[e._v(e._s(e._f("empty")(e.displayValue,e.defaultValue)))])]},{value:e.displayValue})],2)},[],!1,null,null,null).exports;function E(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function V(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){E(a,n,i,o,s,"next",e)}function s(e){E(a,n,i,o,s,"throw",e)}o(void 0)})}}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function M(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function B(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var U={name:"ProductInventTracking",components:{ProductInventReviewField:(0,d.A)({name:"ProductInventReviewField",components:{FieldList:D},props:{data:{type:Array,default:function(){return[]}}},computed:{displayRow:function(){var e,t;return null!=(e=null==(t=this.data)?void 0:t[0])?e:{}}},filters:{reviewStatusName:function(e){return Reflect.get(j.PH,e)}},methods:{toDetail:function(e){this.$router.push({name:"reviewAnalyseDetails",params:{id:e.id}})},scrollHandler:function(){this.$refs.fieldListRef&&this.$refs.fieldListRef.resizePopover()}},data:function(){var e=this;this.ReviewAnalysisStatus=j.p6;var t=function(t){var r=t.cellValue;return e.$utils.formatEmptyValue(r)};return{columns:Object.freeze([{title:this.$t("main.product.invent.country"),field:"marketplaceName",width:100,formatter:t},{title:"ASIN",field:"asin",width:100,slots:{default:"asin"}},{title:this.$t("main.product.invent.analysis.status"),field:"analyzeStatus",width:100,slots:{default:"status"},formatter:function(e){var t=e.cellValue;return Reflect.get(j.PH,t)}},{title:this.$t("common.add.time"),field:"createTime",width:140,formatter:t},{title:this.$t("common.complete.time"),field:"finishTime",width:140,formatter:t},{title:this.$t("common.operation"),field:"op",width:(0,a.n)("80"),slots:{default:"op"}}])}},mounted:function(){window.addEventListener("scroll",this.scrollHandler,!0)},destroyed:function(){window.removeEventListener("scroll",this.scrollHandler,!0)}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("FieldList",{ref:"fieldListRef",attrs:{value:e.data,"show-icon":!1,always:""},scopedSlots:e._u([{key:"trigger",fn:function(){return[r("el-button",{attrs:{type:"text"}},[e._v(e._s(e.$t("main.product.invent.view.result")))])]},proxy:!0}])},[e._v(" "),r("div",{staticClass:"w_700"},[r("vxe-grid",{staticClass:"vxe_table_padding table_standard",attrs:{"tooltip-config":{showAll:!0,theme:"light"},"auto-resize":"","show-overflow":"tooltip","max-height":"350px",stripe:"","show-header-overflow":"tooltip",round:"",columns:e.columns,data:e.data},scopedSlots:e._u([{key:"asin",fn:function(t){var n=t.row;return[r("div",{staticClass:"asin_link",domProps:{innerHTML:e._s(e.$asinlink(n.productAsin||"-",e.$utils.getShopSiteInfo(n.marketplaceId,"url")+"/dp/"+n.productAsin))}})]}},{key:"status",fn:function(t){var n=t.row;return[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:l
1ight",value:n.analyzeReason,expression:"row.analyzeReason",arg:"light"}],class:{f_red:n.analyzeStatus===e.ReviewAnalysisStatus.Fail}},[e._v(e._s(e._f("reviewStatusName")(n.analyzeStatus)))])]}},{key:"op",fn:function(t){var n=t.row;return[n.analyzeStatus===e.ReviewAnalysisStatus.Success?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.toDetail(n)}}},[e._v(e._s(e.$t("main.product.invent.view.result")))]):e._e()]}}])})],1)])},[],!1,null,null,null).exports,TrackPriceField:h,TrackCategoryRankField:p,ImgBox:n.A,RemarkPopover:i.A},emits:["controlChange"],props:{add:{type:Boolean,default:!0},useCount:{type:Number,default:0},maxCount:{type:Number,default:0},code:{type:String,default:null}},data:function(){return{data:[],loading:!1}},computed:{columns:function(){var e=function(e){var t=e.cellValue;return o.Ay.formatEmptyValue(t)},t=function(e){var t=e.cellValue;return o.Ay.formatEmptyValue(t,0)};return[{title:this.$t("main.product.invent.image"),field:"mainImage",width:(0,a.n)("60"),fixed:"left",slots:{default:"mainImage"}},{title:"ASIN",field:"asin",minWidth:120,fixed:"left",slots:{default:"asin"}},{title:this.$t("main.product.invent.country"),field:"domainName",minWidth:100,formatter:e},{title:this.$t("main.product.invent.price"),field:"price",minWidth:100,slots:{default:"price"}},{title:this.$t("main.product.invent.discount.price"),field:"couponValue",minWidth:100,slots:{default:"couponValue"}},{title:this.$t("main.product.invent.publication.date"),field:"publicationDate",minWidth:100,formatter:e},{title:this.$t("main.product.invent.size.mm"),field:"size",minWidth:140,formatter:function(e){var t=e.row;return t.packageLength||t.packageWidth||t.packageHight?"".concat(t.packageLength," * ").concat(t.packageWidth," * ").concat(t.packageHight):"-"}},{title:this.$t("main.product.invent.weight.g"),field:"packageWeight",minWidth:100,formatter:t},{title:this.$t("main.product.invent.big.category.rank"),field:"bsrRankBig",minWidth:120,params:{tip:this.$t("main.wares.product.invent.tracking.invent.category.rank")},slots:{default:"categoryRank",header:"tip_header"}},{title:this.$t("main.product.invent.small.category.rank"),field:"bsrRankSmall",minWidth:120,params:{tip:this.$t("main.wares.product.invent.tracking.invent.category.rank.direct2")},slots:{default:"categoryRank",header:"tip_header"}},{title:this.$t("main.product.invent.review.rating"),field:"rating",minWidth:170,slots:{default:"rating"}},{title:this.$t("main.product.invent.rating.count"),field:"reviewsCount",minWidth:100,align:"right",formatter:t},{title:this.$t("main.product.invent.review.analysis"),field:"review",minWidth:130,slots:{default:"review"}},{title:this.$t("main.product.invent.remark"),field:"remark",minWidth:140,slots:{default:"remark"}},{title:this.$t("common.creator"),field:"createName",minWidth:100,formatter:e},{title:this.$t("main.product.invent.last.update.time"),field:"updateTime",minWidth:140,formatter:e},{title:this.$t("common.operation"),field:"op",width:(0,a.n)("100"),fixed:"right",slots:{default:"op"}}]},_useCount:function(){var e=this,t=this.data.filter(function(t){return e.$utils.isEmpty(t.id)}).length;return this.useCount+t}},watch:{code:function(e){this.$utils.isEmpty(this.code)||this.loadData(e)}},created:function(){this.$utils.isNotEmpty(this.code)&&this.loadData(this.code)},methods:{removeReview:function(e){e.reviewList=[]},addReview:function(e){var t=this,r=this.$utils.getSiteInfoByUniqueId(e.domainId);(0,m.mP)(A,{el:".product-invent",props:{marketplaceId:r.code,asinList:[e.asin],config:{marketplaceDisabled:!0,asinDisabled:!0}},on:{confirm:function(r){e.reviewList=[{asinList:r.asinList,marketplaceId:r.marketplaceId}],t.$message.success(t.$t("main.product.invent.operation.success"))}}})},addTrack:function(){var e=this;(0,b.vr)("product_invent_create_tracking_add","click"),(0,m.mP)(R,{el:".product-invent",props:{useCount:this._useCount,maxCount:this.maxCount},on:{confirm:function(t){var r=t.domainId,n=t.asins,i=t.monitorPersonIds,a=e.$utils.getSiteInfoByUniqueId(r),o=a.name,s=a.url;n.forEach(function(t){return e.data.push({asin:t,domainName:o,domainId:r,monitorPersonIds:i,reviewList:[],asinUrl:"https://".concat(s,"/dp/").concat(t),status:0})}),e.$emit("controlChange")}}})},removeRow:function(e,t){this.$utils.isNotEmpty(e.id)?this.$message.error(this.$t("main.product.invent.cannot.remove.added.monitor")):this.data.splice(t,1)},toTrackingInfo:function(e){(0,m.mP)(f.A,{el:".product-invent",props:{id:e.id,needQuickSwitch:!1,otherLoadFn:this.$http.getProductInventTrackingInfo}})},toEdit:function(e){(0,m.mP)(_,{el:".product-invent",props:{ids:[e.
1id],monitorUserIds:e.monitorPersonIds},on:{confirm:function(t){e.monitorPersonIds=t}}})},editRemark:function(e,t){return V(function(){var r,n;return B(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r={id:e.id,remark:e.remark||""},[4,(0,s.Sy)(r)];case 1:return i.sent(),this.$message.success(this.$t("main.product.invent.update.remark.success")),t.remark=e.remark,this.$emit("row-edit"),[3,3];case 2:return n=i.sent(),this.$message.handle(n),[3,3];case 3:return[2]}})}).call(this)},loadData:function(e){return V(function(){var t,r,n;return B(this,function(i){switch(i.label){case 0:t=this,i.label=1;case 1:return i.trys.push([1,3,4,5]),this.loading=!0,[4,this.$http.getProductInventTrackingByCode(e)];case 2:return r=i.sent(),this.data=r.map(function(e){var r=[],n=[],i=t.$dcopy(e.bsrRank);return i&&"-"!==i&&i.forEach(function(e){e.orderType="",e.order<0?e.orderType=2:e.order>0&&(e.orderType=1),e.orderStr=Math.abs(e.order)>0?Math.abs(e.order):"-",e.bigCategory?r.push(e):n.push(e)}),M(N({},e),{monitorPersonIds:e.monitorPersons.map(function(e){return e.id}),reviewList:[],bsrRankBig:r,bsrRankSmall:n})}),[3,5];case 3:return n=i.sent(),this.$message.handle(n),[3,5];case 4:return this.loading=!1,[7];case 5:return[2]}})}).call(this)},getFormValue:function(){var e=this;return{trackingList:this.data.map(function(t){return M(N({},e.$utils.pick(t,["domainId","monitorPersonIds","reviewList"])),{asins:t.asin})})}}}},L=(0,d.A)(U,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"element-loading-spinner":"icon_load_mid"}},[e.add&&e.$hasPermission("MOD_COMMODITY_DEV.ADD_TRACKING")?r("el-button",{staticClass:"mb_12",attrs:{type:"primary"},on:{click:function(t){return e.addTrack()}}},[e._v(e._s(e.$t("main.product.invent.add.monitor")))]):e._e(),e._v(" "),r("vxe-grid",{staticClass:"vxe_table_row_height_48 vxe_table_padding table_standard PageListMouseWheelClass",attrs:{columns:e.columns,data:e.data,"auto-resize":"",round:"","row-key":"",resizable:"","tooltip-config":{showAll:!0,theme:"light"},"max-height":"540px","highlight-current-row":"","highlight-hover-row":"","show-overflow":"tooltip","show-header-overflow":"tooltip","empty-text":e.$t("main.product.invent.no.data")},scopedSlots:e._u([{key:"tip_header",fn:function(t){var n=t.column,i=n.title,a=n.params.tip;return[r("span",[e._v(e._s(i))]),e._v(" "),r("i",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:a,expression:"tip",arg:"light"}],staticClass:"icon_sf_help"})]}},{key:"mainImage",fn:function(e){var t=e.row;return[r("ImgBox",{key:t.id,attrs:{src:t.mainImage}})]}},{key:"asin",fn:function(t){var n=t.row;return[r("div",{directives:[{name:"copy",rawName:"v-copy",value:{text:n.asin},expression:"{text: row.asin}"}],staticClass:"asin_link line_clamp_max_w w_content lh_14",domProps:{innerHTML:e._s(e.$asinlink(n.asin,n.asinUrl))}}),e._v(" "),n.title?r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:n.title,expression:"row.title",arg:"light"}],staticClass:"f_gray line_clamp_max_w w_content lh_14"},[e._v("\n                "+e._s(e._f("empty")(n.title))+"\n            ")]):r("div",{staticClass:"f_gray line_clamp_max_w w_content lh_14"},[e._v("\n                "+e._s(0===n.status?e.$t("common.data.loading"):e.$t("main.product.invent.product.not.found"))+"\n            ")])]}},{key:"price",fn:function(e){return[r("TrackPriceField",{attrs:{row:e.row}})]}},{key:"couponValue",fn:function(t){var n=t.row;return[r("div",{staticClass:"line_clamp_max_w w_content"},[e._v(e._s(n.currencyCode)+" "+e._s(n.salePrice))]),e._v(" "),r("span",{staticClass:"f_gray line_clamp"},[e._v(e._s(n.couponType?"save "+n.couponValue:e.$t("main.product.invent.no.coupon")))])]}},{key:"categoryRank",fn:function(e){return[r("TrackCategoryRankField",{attrs:{data:e.row[e.column.property]}})]}},{key:"rating",fn:function(t){var n=t.row;return[r("el-rate",{attrs:{disabled:"","show-score":"","text-color":n.rating>0?"#ff9900":"#888888","score-template":"{value}"},model:{value:n.rating,callback:function(t){e.$set(n,"rating",t)},expression:"row.rating"}})]}},{key:"review",fn:function(t){var n=t.row;return[e.add?[n.reviewDetailVoList&&n.reviewDetailVoList.length?r("ProductInventReviewField",{attrs:{data:n.reviewDetailVoList}}):n.reviewList&&n.reviewList.length?r("div",{staticClass:"flex center_align"}
1,[r("span",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:n.reviewList[0].asinList[0],expression:"row.reviewList[0].asinList[0]",arg:"light"}],staticClass:"flex_1 line_clamp_max_w w_content"},[e._v(e._s(n.reviewList[0].asinList[0]))]),e._v(" "),r("i",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.$t("main.product.invent.remove"),expression:"$t('main.product.invent.remove')",arg:"light"}],staticClass:"icon_sf_delete pointer f_error flex_no_shrink f_14",on:{click:function(t){return e.removeReview(n)}}})]):e.$hasPermission("MOD_COMMODITY_DEV.ADD_REVIEW")?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.addReview(n)}}},[e._v("\n                    "+e._s(e.$t("main.product.invent.add.analysis"))+"\n                ")]):r("div",[e._v("-")])]:[n.reviewDetailVoList&&n.reviewDetailVoList.length?r("ProductInventReviewField",{attrs:{data:n.reviewDetailVoList}}):r("div",[e._v("-")])]]}},{key:"remark",fn:function(t){var n=t.row;return[e.$utils.isNotEmpty(n.id)?r("RemarkPopover",{attrs:{row:n,options:{maxLength:100,showWordLimit:!0},bindName:"remark"},on:{"save-remark":function(t){return e.editRemark(t,n)}}}):r("span",[e._v(e._s(e._f("empty")(n.remark)))])]}},{key:"op",fn:function(t){var n=t.row,i=t.rowIndex;return[e.$utils.isNotEmpty(n.id)?[r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.toTrackingInfo(n)}}},[e._v(e._s(e.$t("main.product.invent.detail")))]),e._v(" "),r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.toEdit(n)}}},[e._v(e._s(e.$t("common.edit")))])]:r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.removeRow(n,i)}}},[e._v(e._s(e.$t("main.product.invent.remove")))])]}}])})],1)},[],!1,null,null,null).exports},14910:function(e,t,r){r.d(t,{A:function(){return n}});var n=(0,r(28644).A)({name:"AiResearchEntry",props:{hasReport:{type:Boolean,default:!1}},computed:{entryLabel:function(){return this.hasReport?this.$t("main.product.invent.ai.research.report.tab"):this.$t("main.product.invent.ai.research")}}},function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.$hasPermission("MOD_COMMODITY_DEV.AI_RESEARCH")?n("el-button",{staticClass:"flex center_align flex_no_shrink h_32 product-invent-ai-research",on:{click:function(t){return e.$emit("click")}}},[n("span",{staticClass:"product-invent-ai-research__content"},[n("img",{attrs:{src:r(22260),alt:""}}),e._v("\n        "+e._s(e.entryLabel)+"\n    ")])]):e._e()},[],!1,null,"12cbf060",null).exports},40962:function(e,t,r){r.d(t,{A:function(){return eQ}}),r(31731),r(5092),r(915),r(21927),r(25962),r(48741),r(72860),r(20767);var n=r(65335),i=r(75589),a=r(44498);r(25259),r(77949),r(75038),r(62394),r(84579),r(5411),r(27471),r(46491);var o=r(74943),s=r(52854),l=r(5285);r(937);var c=[{value:"basic-info",apiKey:"basic_info",label:"main.product.invent.ai.research.report.basic.info",help:"main.product.invent.ai.research.report.content.help.basic.info",component:"BasicInfoSection",enabled:!0},{value:"sales-trend",apiKey:"sales_trend",label:"main.product.invent.ai.research.report.sales.trend",help:"main.product.invent.ai.research.report.content.help.sales.trend",component:"SalesTrendSection",enabled:!0},{value:"competitor-data",apiKey:"competitors",label:"main.product.invent.ai.research.report.competitor.data",help:"main.product.invent.ai.research.report.content.help.competitor.data",component:"CompetitorDataSection",enabled:!0},{value:"traffic-keywords",apiKey:"traffic_keywords",label:"main.product.invent.ai.research.report.traffic.keywords",help:"main.product.invent.ai.research.report.content.help.traffic.keywords",component:"TrafficKeywordsSection",enabled:!0},{value:"price-distribution",apiKey:"price_distribution",label:"main.product.invent.ai.research.report.price.distribution",help:"main.product.invent.ai.research.report.content.help.price.distribution",component:"PriceDistributionSection",enabled:!0},{value:"seller-analysis",apiKey:"seller_distribution",label:"main.product.invent.ai.research.report.seller.analysis",help:"main.product.invent.ai.research.report.content.help.seller.analysis",component:"SellerAnalysisSection",enabled:!0},{value:"market-statistics",apiKey:"market_statistics",label:"main.product.invent.ai.research.report.market.statistics",help:"main.product.invent.ai.research.report.content.help.market.statistics",component:"MarketStatisticsSection",enabled:!0}
1,{value:"review-analysis",apiKey:"review_analysis",label:"main.product.invent.ai.research.report.review.analysis",help:"main.product.invent.ai.research.report.content.help.review.analysis",component:"ReviewAnalysisSection",enabled:!1},{value:"ai-strategy",apiKey:"ai_strategy",label:"main.product.invent.ai.research.report.ai.strategy",component:"AiStrategySection",enabled:!1,selectable:!1}];function u(){return c.filter(function(e){return e.enabled&&!1!==e.selectable})}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.enabledOnly;if(!Array.isArray(e))return[];var n=new Set;e.forEach(function(e){var t=c.find(function(t){return t.value===e})||c.find(function(t){return t.apiKey===e});t&&n.add(t.value)});var i=c.filter(function(e){return n.has(e.value)});return void 0===r||r?i.filter(function(e){return e.enabled}):i}var p=[{value:"US",label:"main.product.invent.ai.research.site.us"},{value:"JP",label:"main.product.invent.ai.research.site.jp"},{value:"UK",label:"main.product.invent.ai.research.site.uk"},{value:"DE",label:"main.product.invent.ai.research.site.de"},{value:"FR",label:"main.product.invent.ai.research.site.fr"},{value:"IT",label:"main.product.invent.ai.research.site.it"},{value:"ES",label:"main.product.invent.ai.research.site.es"},{value:"CA",label:"main.product.invent.ai.research.site.ca"},{value:"IN",label:"main.product.invent.ai.research.site.in"}],h={UK:"gb"};function f(e,t){var r=String(e||"").trim();if(!r)return"";var n=r.toUpperCase();if("GB"===n)return"UK";var i=p.find(function(e){return e.value===n});if(i)return i.value;if("function"==typeof t){var a=p.find(function(e){return t(e.label)===r});if(a)return a.value}return""}var m=r(65342);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function y(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function _(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return v(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var b="basic-info",w={name:"AiResearchForm",components:{SfSelect:s.A,Tooltip:l.A},props:{mcpServices:{type:Array,default:function(){return[]}},reportGenerating:{type:Boolean,default:!1},initialForm:{type:Object,default:null},sourcePage:{type:String,default:"create"}},data:function(){return{aiResearchForm:{mcpServiceId:null,asin:"",site:"US",reportContent:["basic-info","sales-trend"]},siteOptions:p,aiResearchReportOptions:u(),requiredReportModule:b,mcpServiceCacheInitialized:!1,debouncedSubmitAiResearch:null}},created:function(){this.debouncedSubmitAiResearch=(0,o.sg1)(this.submitAiResearch,300),this.applyInitialForm()},watch:{initialForm:{deep:!0,handler:function(){this.applyInitialForm()}},mcpServices:{immediate:!0,handler:function(){this.restoreMcpService()}}},computed:{reportHelpColumns:function(){return[{field:"content",title:this.$t("main.product.invent.ai.research.report.content.help.column.content"),width:84,showOverflow:"tooltip"},{field:"description",title:this.$t("main.product.invent.ai.research.report.content.help.column.description"),width:280,showOverflow:"tooltip"}]},reportHelpRows:function(){var e=this;return this.aiResearchReportOptions.map(function(t){return{content:e.$t(t.label),description:e.$t(t.help)}})},mcpServiceOptions:function(){return this.mcpServices.map(function(e){return{label:e.configName||e.name,value:e.id}})},siteSelectOptions:function(){var e=this;return this.siteOptions.map(function(t){return y(g({},t),{label:e.$t(t.label)})})},hasMcpConfigPermission:function(){return this.$hasPermission("MOD_MCP_CONFIG.VIEW_LIST")}},methods:{handleGenerateClick:function(){(0,i.vr)(m.l.generateReport,"click",{source_page:this.sourcePage,site:this.aiResearchForm.site,report_module_count:this.aiResearchForm.reportContent.length,has_mcp_service:null!==this.aiResearchForm.mcpServiceId&&void 0!==this.aiResearchForm.mcpServiceId})},applyInitialForm:function(){var e;this.initialForm&&(this.aiResearchForm=y(g({},this.aiResearchForm),{asin:this.initialForm.asin||"",site:this.initialForm.site||"US",reportContent:[b].concat(_((Array.isArray(this.initialForm.reportContent)?_(this.initialForm.reportContent):this.aiResearchForm.reportContent).filter(function(e){return e!==b}))),mcpServiceId:null!=(e=this.initialForm.mcpServiceId)?e:this.aiResearchForm.mcpServiceId}),this.mcpServiceCacheInitialized=!0)},getMcpServiceCacheKey:function(){var e,t,r,n=(null==(r=this.$store)||null==(t=r.state)||null==(e=t.System)?void 0:e.user)||{},i=n.id||n.uid||"current";return"".concat("product_invent_ai_research_mcp_service_id","_").concat(i)},restoreMcpService:function(){if(!this.mcpServiceCacheInitialized&&this.mcpServices.length){var e=window.localStorage.getItem(this.getMcpServiceCacheKey()),t=this.mcpServices.find(function(t){return String(t.id)===e});this.aiResearchForm.mcpServiceId=t?t.id:null,this.mcpServiceCacheInitialized=!0}},handleMcpServiceChange:function(e){var t=this.mcpServices.find(function(t){return String(t.id)===String(e)});t&&null!==t.id&&void 0!==t.id&&window.localStorage.setItem(this.getMcpServiceCacheKey(),String(t.id))},handleAddMcpService:function(){var e,t;this.hasMcpConfigPermission&&(null==(t=this.$refs.mcpServiceSelect)||null==(e=t.closePopover)||e.call(t),this.aiResearchForm.mcpServiceId=null,this.$router.push({path:"/web/v3/business-setting/index.html",query:{navActive:"ThirdMCPServiceConfig"}}
1))},isValidAsinOrProductLink:function(e){if(!e||/[\s,\uff0c;\uff1b]/.test(e))return!1;if(/^[A-Z0-9]{10}$/i.test(e))return!0;if(!(0,o.YC0)(e,"url")||!/^https?:\/\//i.test(e))return!1;try{var t=new URL(e),r=/(^|\.)amazon\.[a-z]{2,}(?:\.[a-z]{2,})?$/i.test((0,o.UWb)(e)),n=/\/(?:dp|gp\/product|gp\/aw\/d)\/[A-Z0-9]{10}(?:[/?#]|$)/i.test(t.pathname);return r&&n}catch(e){return!1}},submitAiResearch:function(){var e=this;if(!this.reportGenerating){var t=this.aiResearchForm.asin.trim();if(!t)return void this.$message.error(this.$t("main.product.invent.ai.research.validation.asin.required"));if(!this.isValidAsinOrProductLink(t))return void this.$message.error(this.$t("main.product.invent.ai.research.validation.asin.invalid"));if(null===this.aiResearchForm.mcpServiceId||void 0===this.aiResearchForm.mcpServiceId)return void this.$message.error(this.$t("main.product.invent.ai.research.validation.mcp.required"));if(!this.aiResearchForm.site)return void this.$message.error(this.$t("common.validation.required.not.empty",{field:this.$t("main.product.invent.ai.research.site")}));if(!this.aiResearchForm.reportContent.length)return void this.$message.error(this.$t("main.product.invent.ai.research.validation.report.required"));var r=this.mcpServices.find(function(t){return String(t.id)===String(e.aiResearchForm.mcpServiceId)});this.handleMcpServiceChange(this.aiResearchForm.mcpServiceId),this.$emit("submit",{mcpService:r,mcpServiceId:this.aiResearchForm.mcpServiceId,asin:t,site:this.aiResearchForm.site,reportContent:_(this.aiResearchForm.reportContent)})}}}},k=r(28644),S=(0,k.A)(w,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ai-drawer__body"},[n("div",{staticClass:"ai-research-form"},[n("div",{staticClass:"ai-research-form__intro"},[n("div",{staticClass:"ai-resarch-title"},[n("img",{staticClass:"ai-resarch-icon",attrs:{src:r(60446),alt:""}}),e._v(" "),n("div",{staticClass:"ai-research-form__title"},[n("strong",{staticClass:"ai-resarch-text"},[e._v("Hi")]),e._v(e._s(e.$t("main.product.invent.ai.research.expert")))])]),e._v(" "),n("div",{staticClass:"ai-research-form__subtitle"},[e._v(e._s(e.$t("main.product.invent.ai.research.intro")))])]),e._v(" "),n("el-form",{staticClass:"ai-research-form__fields",attrs:{"label-position":"top"},nativeOn:{submit:function(t){return t.preventDefault(),e.debouncedSubmitAiResearch.apply(null,arguments)}}},[n("el-form-item",{attrs:{label:e.$t("main.product.invent.ai.research.mcp.service"),required:""}},[n("SfSelect",{ref:"mcpServiceSelect",staticClass:"w_full",attrs:{filterable:"",width:"100%",options:e.mcpServiceOptions,placeholder:e.$t("common.select.placeholder"),"popover-class-name":"ai-research-mcp-select-popover"},on:{"on-change":e.handleMcpServiceChange},model:{value:e.aiResearchForm.mcpServiceId,callback:function(t){e.$set(e.aiResearchForm,"mcpServiceId",t)},expression:"aiResearchForm.mcpServiceId"}},[e.hasMcpConfigPermission?n("template",{slot:"footer"},[n("div",{staticClass:"ai-research-form__mcp-add",on:{click:function(t){return t.stopPropagation(),e.handleAddMcpService.apply(null,arguments)}}},[n("el-button",{attrs:{type:"text",size:"mini"}},[e._v(e._s(e.$t("main.product.invent.ai.research.mcp.add")))])],1)]):e._e()],2)],1),e._v(" "),n("el-form-item",{attrs:{label:e.$t("main.product.invent.ai.research.asin.link"),required:""}},[n("el-input",{attrs:{placeholder:e.$t("main.product.invent.ai.research.asin.placeholder")},model:{value:e.aiResearchForm.asin,callback:function(t){e.$set(e.aiResearchForm,"asin",t)},expression:"aiResearchForm.asin"}})],1),e._v(" "),n("el-form-item",{attrs:{label:e.$t("main.product.invent.ai.research.site"),required:""}},[n("SfSelect",{staticClass:"w_full",attrs:{width:"100%",filterable:"",options:e.siteSelectOptions,placeholder:e.$t("common.select.placeholder")},model:{value:e.aiResearchForm.site,callback:function(t){e.$set(e.aiResearchForm,"site",t)},expression:"aiResearchForm.site"}})],1),e._v(" "),n("el-form-item",[n("template",{slot:"label"},[n("span",{staticClass:"ai-research-form__label"},[n("span",{staticClass:"ai-research-form__label-text"},[e._v(e._s(e.$t("main.product.invent.ai.research.report.content")))]),e._v(" "),n("Tooltip",{attrs:{isCustom:"",effect:"light",placement:"top","popper-class":"ai-research-report-tooltip"}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("vxe-grid",{staticClass:"ai-research-report-tooltip__grid",attrs:{columns:e.reportHelpColumns,data:e.reportHelpRows,"header-config":{height:40},"cell-config":{height:40},"show-header-overflow":!1,"show-overflow":!1,"highlight-hover-row":"",resizable:""}}
1)],1),e._v(" "),n("i",{staticClass:"icon_sf_help ai-research-form__label-icon",attrs:{size:"16","aria-hidden":"true"}})]),e._v(" "),n("span",{staticClass:"ai-research-form__label-suffix"},[e._v("\uFF1A")])],1)]),e._v(" "),n("el-checkbox-group",{staticClass:"ai-research-form__options",model:{value:e.aiResearchForm.reportContent,callback:function(t){e.$set(e.aiResearchForm,"reportContent",t)},expression:"aiResearchForm.reportContent"}},e._l(e.aiResearchReportOptions,function(t){return n("el-checkbox",{key:t.value,attrs:{label:t.value,disabled:t.value===e.requiredReportModule}},[e._v("\n                        "+e._s(e.$t(t.label))+"\n                    ")])}),1)],2),e._v(" "),n("div",{staticClass:"ai-research-form__footer"},[n("el-button",{attrs:{type:"primary","native-type":"submit",loading:e.reportGenerating},on:{click:e.handleGenerateClick}},[e._v("\n                    "+e._s(e.$t("main.product.invent.ai.research.start"))+"\n                ")])],1)],1)],1)])},[],!1,null,"fac821c2",null).exports,C=r(10961);r(47424),r(59622);var O=(0,k.A)({name:"AiResearchSyncFieldsDialog",props:{fields:{type:Array,default:function(){return[]}},visible:{type:Boolean,default:!1},sourcePage:{type:String,default:"create"}},data:function(){return{dialogVisible:this.visible,draftFields:[],selectedFields:[],closeReason:""}},watch:{visible:function(e){this.dialogVisible=e},dialogVisible:function(e){this.$emit("update:visible",e)}},methods:{resetFields:function(){this.closeReason="",this.draftFields=this.fields.map(function(e,t){return{key:e.key||"sync-field-".concat(t),fieldKey:e.fieldKey||e.key||"sync-field-".concat(t),label:e.label||e.key||"",value:e.value}}),this.selectedFields=this.draftFields.map(function(e){return e.key})},confirmSync:function(){var e=this,t=this.draftFields.filter(function(t){return e.selectedFields.includes(t.key)});this.closeReason="confirm",(0,i.vr)(m.l.confirmSyncFields,"click",{source_page:this.sourcePage,selected_field_count:t.length}),this.$emit("confirm",t),this.dialogVisible=!1},cancelSync:function(){this.closeReason="cancel",this.dialogVisible=!1},handleDialogClose:function(){if("confirm"===this.closeReason){this.closeReason="";return}(0,i.vr)(m.l.cancelSyncFields,"click",{source_page:this.sourcePage,source:this.closeReason||"close_button"}),this.closeReason=""}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{staticClass:"ai-research-sync-dialog",attrs:{visible:e.dialogVisible,title:e.$t("main.product.invent.ai.research.report.insert.fields"),width:"580px","append-to-body":""},on:{"update:visible":function(t){e.dialogVisible=t},open:e.resetFields,close:e.handleDialogClose}},[r("div",{staticClass:"ai-research-sync-dialog__notice"},[r("i",{staticClass:"icon_sf_info_fill",attrs:{"aria-hidden":"true"}}),e._v(" "),r("span",[e._v(e._s(e.$t("main.product.invent.ai.research.report.sync.notice")))])]),e._v(" "),r("div",{staticClass:"ai-research-sync-dialog__table"},[r("div",{staticClass:"ai-research-sync-dialog__header"},[r("span"),e._v(" "),r("strong",[e._v(e._s(e.$t("main.product.invent.ai.research.report.new.product.field")))]),e._v(" "),r("strong",[e._v(e._s(e.$t("main.product.invent.ai.research.report.sync.value")))])]),e._v(" "),e._l(e.draftFields,function(t){return r("div",{key:t.key,staticClass:"ai-research-sync-dialog__row"},[r("el-checkbox",{attrs:{label:t.key},model:{value:e.selectedFields,callback:function(t){e.selectedFields=t},expression:"selectedFields"}},[r("span")]),e._v(" "),r("span",[e._v(e._s(t.label))]),e._v(" "),r("el-input",{staticClass:"ai-research-sync-dialog__value",attrs:{placeholder:e.$t("main.product.invent.ai.research.report.sync.placeholder",{field:t.label}),disabled:!e.selectedFields.includes(t.key)},model:{value:t.value,callback:function(r){e.$set(t,"value",r)},expression:"field.value"}})],1)})],2),e._v(" "),r("template",{slot:"footer"},[r("el-button",{on:{click:e.cancelSync}},[e._v(e._s(e.$t("common.cancel")))]),e._v(" "),r("el-button",{attrs:{type:"primary",disabled:!e.selectedFields.length},on:{click:e.confirmSync}},[e._v("\n            "+e._s(e.$t("common.confirm"))+"\n        ")])],1)],2)},[],!1,null,"80ea319c",null).exports;r(18577),r(33875);var $="cancelled",I="waiting",R={name:"SideAnchor",props:{value:{type:String,default:""},options:{type:Array,default:function(){return[]}},sections:{type:Object,default:function(){return{}}},container:{type:HTMLElement,default:null},offset:{type:Number,default:0},activeVisibleThreshold:{type:Object,default:void 0},scrollBehavior:{type:String,default:"smooth"},syncOnMount:{type:Boolean,default:!0},width:{type:[Number,String],default:200},height:{type:[Number,String],default:void 0}},data:function(){return{activeId:"",sideAnchorDestroyed:!1}}
1,computed:{sideAnchorStyle:function(){var e={width:this.formatSize(this.width),height:this.formatSize(this.height)};return void 0!==this.height&&(e.overflowY="auto"),e}},watch:{value:function(e){!this.sideAnchorDestroyed&&this.sync&&this.sync.handleExternalValueChange(e)},container:function(){!this.sideAnchorDestroyed&&this.sync&&this.sync.attachContainer(this.container)},options:{deep:!0,handler:function(){var e=this;this.$nextTick(function(){!e.sideAnchorDestroyed&&e.sync&&e.sync.handleStructureChange()})}},sections:{deep:!0,handler:function(){var e=this;this.$nextTick(function(){!e.sideAnchorDestroyed&&e.sync&&e.sync.handleStructureChange()})}}},created:function(){var e=this;this.sync=function(e){var t,r,n,i,a=!1,o="",s="",l="",c=!1,u=!1,d=!1;function p(e){return null!=e?e:""}function h(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.max(e,0):t}function f(e,t){var r=e.getBoundingClientRect().top;return t.getBoundingClientRect().top-r+e.scrollTop}function m(e){return"u">typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout(e)}function v(e){if(void 0!==e){if("u">typeof window&&window.cancelAnimationFrame)return void window.cancelAnimationFrame(e);window.clearTimeout(e)}}function g(e){return!e||e.scrollTop<=2}function y(){var e;return null!=(e=b()[0])?e:""}function _(t){if(t){var r,n=(e.getItems()||[]).find(function(e){return e.id===t}),i=(e.getSections()||{})[t],a=i&&i.el;if(n&&!n.disabled&&i&&!i.hidden&&a&&(a.isConnected||document.documentElement.contains(a))){var o=(r=a.getBoundingClientRect()).width>0&&r.height>0?r:void 0;if(o)return{id:t,rect:o}}}}function b(){return(e.getItems()||[]).reduce(function(e,t){var r=_(t.id);return r&&e.push(r.id),e},[])}function w(){var t,r=e.getContainer();if(!r)return[];var n=r.getBoundingClientRect(),i=n.top+h(e.getOffset&&e.getOffset(),0),a=n.bottom,o=e.getActiveVisibleThreshold&&e.getActiveVisibleThreshold(),s={px:o&&h(o.px,0),ratio:o&&("number"==typeof(t=o.ratio)&&Number.isFinite(t)?Math.min(Math.max(t,0),1):void 0)};return(e.getItems()||[]).reduce(function(e,t){var r=_(t.id);if(!r)return e;var n=r.rect,o=Math.min(n.bottom,a)-Math.max(n.top,i);return o<=0||void 0!==s.px&&o<s.px||void 0!==s.ratio&&o/n.height<s.ratio||e.push({id:t.id,top:n.top}),e},[])}function k(){return w().map(function(e){return e.id})}function S(t,r){return!a&&o!==t&&(o=t,e.onValueChange&&e.onValueChange(t),e.onSyncChange&&e.onSyncChange({id:t,reason:r}),!0)}function C(){a||(u=!0,v(t),t=m(function(){a||(u=!1,t=void 0)}))}function O(){void 0!==n&&(clearTimeout(n),n=void 0)}function R(e){O(),s&&(s="",l="",c=!1,e&&C())}function P(t){var r=e.getContainer(),n=(e.getSections()||{})[t],i=n&&n.el;if(!r||!i)return!1;var a=Math.max(f(r,i)-h(e.getOffset&&e.getOffset(),0),0);return 2>=Math.abs(r.scrollTop-a)}function x(){var t,r;d=!0,S(_(r=p(e.getValue&&e.getValue()))?r:g(e.getContainer())?y():null!=(t=k()[0])?t:y(),"init")}function T(){S(function(){if(g(e.getContainer()))return y();var t,r=k()[0];if(r)return r;var n=b();if(!n.length)return"";var i=(e.getItems()||[]).map(function(e){return e.id}),a=i.indexOf(o);if(a>=0){for(var s=a+1;s<i.length;s++)if(n.includes(i[s]))return i[s];for(var l=a-1;l>=0;l--)if(n.includes(i[l]))return i[l]}return null!=(t=n[0])?t:""}(),"model")}function A(){var e=s;return e?_(e)?((P(e)||k().includes(e))&&function(e){if(!c){var t=l;c=!0,t&&S(e,t)}}(e),c&&(a||(O(),n=setTimeout(function(){a||(n=void 0,R())},120))),I):(R(!0),T(),$):"none"}function j(){v(r),r=void 0}function F(){a||(u?C():void 0===r&&(r=m(function(){r=void 0,a||function(){if(!a&&e.getContainer()){if(u)return C();var t=A();if(t!==$){var r=function(){var t=e.getContainer();if(!t)return"";var r=w();if(!r.length)return"";if(g(t))return y()||r[0].id;if(!(t.scrollHeight<=t.clientHeight)&&t.scrollTop+t.clientHeight>=t.scrollHeight-2)return r[r.length-1].id;var n=t.getBoundingClientRect().top+h(e.getOffset&&e.getOffset(),0),i=r.filter(function(e){return e.top<=n+2});return i.length?i[i.length-1].id:r[0].id}();if(r){if(t===I)return;S(r,"scroll")}}}}()})))}function D(t,r){if(a||!_(t))return!1;var n=(e.getSections()||{})[t];return!!e.getContainer()&&!!n&&!!n.el&&((R(!0),u=!1,s=t,l=r,function(t){var r=e.getContainer(),n=(e.getSections()||{})[t],i=n&&n.el;if(!r||!i)return!1;var a=Math.max(f(r,i)-h(e.getOffset&&e.getOffset(),0),0);return r.scrollTo({top:a,behavior:e.getScrollBehavior&&e.getScrollBehavior()||"smooth"}),!0}
1(t))?(P(t)&&A(),!0):(R(!0),!1))}return{scrollToId:function(e){return D(e,"programmatic")},syncNow:function(){if(!a){if(R(!0),!d)return void x();T()}},getActiveId:function(){return o},handleNavClick:function(e){return D(e,"click")},handleExternalValueChange:function(e){if(!a&&p(e)!==o){if(R(!0),_(e))return void S(e,"model");T()}},attachContainer:function(t){a||(i&&(i(),i=void 0),j(),t&&(t.addEventListener("scroll",F,{passive:!0}),i=function(){return t.removeEventListener("scroll",F)},(!e.shouldSyncOnMount||e.shouldSyncOnMount())&&!d&&x()))},handleStructureChange:function(){if(!a&&d){if(s&&!_(s)){R(!0),T();return}_(o)||T()}},destroy:function(){a||(a=!0,i&&(i(),i=void 0),v(t),t=void 0,j(),O())}}}({getItems:function(){return(e.options||[]).map(function(e){return{id:e.id}})},getSections:function(){var t=e.sections||{},r={};return Object.keys(t).forEach(function(e){var n,i,a=t[e]||{};r[e]=(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},a),i=i={el:a.el||document.getElementById(e)||null},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n)}),r},getContainer:function(){return e.container||null},getValue:function(){return e.value},getOffset:function(){return e.offset},getActiveVisibleThreshold:function(){return e.activeVisibleThreshold},getScrollBehavior:function(){return e.scrollBehavior},shouldSyncOnMount:function(){return e.syncOnMount},onValueChange:function(t){e.sideAnchorDestroyed||e.$emit("input",t)},onSyncChange:function(t){e.sideAnchorDestroyed||(e.activeId=t.id,e.$emit("sync-change",t))}})},mounted:function(){var e=this;this.$nextTick(function(){!e.sideAnchorDestroyed&&e.sync&&e.sync.attachContainer(e.container)})},beforeDestroy:function(){this.sideAnchorDestroyed=!0,this.sync&&(this.sync.destroy(),this.sync=null)},methods:{formatSize:function(e){if(void 0!==e&&""!==e)return"number"==typeof e?"".concat(e,"px"):e},handleItemClick:function(e){!this.sideAnchorDestroyed&&this.sync&&(this.$emit("item-click",e.id,e),this.sync.handleNavClick(e.id))},scrollToId:function(e){return!this.sideAnchorDestroyed&&!!this.sync&&this.sync.scrollToId(e)},syncNow:function(){!this.sideAnchorDestroyed&&this.sync&&this.sync.syncNow()},getActiveId:function(){return this.sideAnchorDestroyed||!this.sync?"":this.sync.getActiveId()}}},P=(0,k.A)(R,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("nav",{staticClass:"sf-side-anchor",style:e.sideAnchorStyle},e._l(e.options,function(t,n){return r("button",{key:t.id,staticClass:"sf-side-anchor__item",class:{"sf-side-anchor__item--active":e.activeId===t.id},attrs:{type:"button","data-side-anchor-id":t.id},on:{click:function(r){return e.handleItemClick(t)}}},[r("span",{staticClass:"sf-side-anchor__item-main"},[r("span",{directives:[{name:"tooltip",rawName:"v-tooltip.isShow",value:t.label,expression:"option.label",modifiers:{isShow:!0}
1}],staticClass:"sf-side-anchor__text"},[e._t("default",function(){return[e._v("\n                    "+e._s(t.label)+"\n                ")]},{option:t,active:e.activeId===t.id,index:n})],2),e._v(" "),e.$scopedSlots.right?r("span",{staticClass:"sf-side-anchor__right"},[e._t("right",null,{option:t,active:e.activeId===t.id,index:n})],2):e._e()]),e._v(" "),e.$scopedSlots.bottom?r("span",{staticClass:"sf-side-anchor__bottom"},[e._t("bottom",null,{option:t,active:e.activeId===t.id,index:n})],2):e._e()])}),0)},[],!1,null,"6d5239e5",null).exports,x={name:"AiResearchReportProductHeader",components:{ImgBox:r(67915).A,Tooltip:l.A},props:{report:{type:Object,required:!0},header:{type:Object,required:!0},sourcePage:{type:String,default:"create"},showSyncFields:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0}},computed:{productInfo:function(){return this.header.productInfo||{}},hasSyncFields:function(){return this.header.syncFields.some(function(e){var t;return String(null!=(t=e.value)?t:"").trim()})}},methods:{handleSyncFields:function(){this.hasSyncFields&&((0,i.vr)(m.l.syncFields,"click",{source_page:this.sourcePage}),this.$emit("sync-fields"))},handleAction:function(e){"refresh"===e&&((0,i.vr)(m.l.refreshReport,"click",{source_page:this.sourcePage}),this.$emit("refresh"))},displayValue:function(e){return null==e||""===e?"-":e}}},T=(0,k.A)(x,function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ai-report-product-header"},[t("div",{staticClass:"ai-report-product-header__image"},[t("ImgBox",{attrs:{src:this.productInfo.image_url,option:"dialog"}})],1),this._v(" "),t("div",{staticClass:"ai-report-product-header__info"},[t("div",{staticClass:"ai-report-product-header__title",attrs:{title:this.productInfo.title}},[this._v("\n            "+this._s(this.displayValue(this.productInfo.title))+"\n        ")]),this._v(" "),t("div",{staticClass:"ai-report-product-header__source"},[t("span",[this._v(this._s(this.$t("main.product.invent.ai.research.report.amazon.address"))+":")]),this._v(" "),this.productInfo.asin_url?t("a",{attrs:{href:this.productInfo.asin_url,target:"_blank",rel:"noopener noreferrer"}},[this._v("\n                "+this._s(this.productInfo.asin_url)+"\n            ")]):t("span",[this._v("-")])])]),this._v(" "),t("div",{staticClass:"ai-report-product-header__actions"},[t("div",{staticClass:"ai-report-product-header__action-row"},[this.showSyncFields?t("Tooltip",{attrs:{content:this.hasSyncFields?"":this.$t("main.product.invent.ai.research.report.sync.empty"),effect:"dark"}},[t("span",{staticClass:"ai-report-product-header__sync-wrap"},[t("el-button",{staticClass:"ai-report-product-header__sync-button",attrs:{size:"mini",disabled:!this.hasSyncFields},on:{click:this.handleSyncFields}},[this._v("\n                        "+this._s(this.$t("main.product.invent.ai.research.report.insert.fields"))+"\n                    ")])],1)]):this._e(),this._v(" "),this.showRefresh?t("el-dropdown",{attrs:{trigger:"hover","popper-class":"ai-report-product-header__menu"},on:{command:this.handleAction}},[t("button",{staticClass:"ai-report-product-header__more",attrs:{type:"button","aria-label":this.$t("main.product.invent.ai.research.report.more")}},[t("i",{staticClass:"icon_sf_more_vertical f_16",attrs:{"aria-hidden":"true"}})]),this._v(" "),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"refresh"}},[this._v(this._s(this.$t("main.product.invent.ai.research.report.refresh")))])],1)],1):this._e()],1),this._v(" "),t("div",{staticClass:"ai-report-product-header__report-time"},[t("span",[this._v(this._s(this.$t("main.product.invent.ai.research.report.report.time"))+":")]),this._v(" "),t("span",[this._v(this._s(this.displayValue(this.report.create_time)))])])])])},[],!1,null,"a2dd04e2",null).exports;r(86201);var A=(0,k.A)({name:"AiResearchReportConclusion",props:{conclusion:{type:[Array,String],default:""},title:{type:String,required:!0}},computed:{conclusionItems:function(){return Array.isArray(this.conclusion)?this.conclusion.filter(Boolean):this.conclusion?[this.conclusion]:[]}}},function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.conclusionItems.length?n("div",{staticClass:"ai-report-conclusion"},[n("div",{staticClass:"ai-report-conclusion__title"},[n("img",{attrs:{src:r(22260),alt:"","aria-hidden":"true"}}),e._v(" "),n("span",[e._v(e._s(e.title))])]),e._v(" "),e.conclusionItems.length>1?n("ul",{staticClass:"ai-report-conclusion__list"},e._l(e.conclusionItems,function(t,r){return n("li",{directives:[{name:"tooltip",rawName:"v-tooltip:l
1ight",value:t,expression:"item",arg:"light"}],key:r},[e._v(e._s(t))])}),0):n("p",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.conclusionItems[0],expression:"conclusionItems[0]",arg:"light"}],staticClass:"ai-report-conclusion__text"},[e._v(e._s(e.conclusionItems[0]))])]):e._e()},[],!1,null,"34b82ad3",null).exports,j=(0,k.A)({name:"AiResearchReportSectionFrame",props:{empty:{type:Boolean,default:!1},showEmptyPlaceholder:{type:Boolean,default:!0},sectionId:{type:String,required:!0},title:{type:String,required:!0}}},function(){var e=this.$createElement,t=this._self._c||e;return t("section",{staticClass:"ai-report-section",attrs:{id:this.sectionId}},[t("div",{staticClass:"ai-report-section__header"},[t("h2",[this._v(this._s(this.title))])]),this._v(" "),this._t("default"),this._v(" "),this.empty&&this.showEmptyPlaceholder?t("div",{staticClass:"ai-report-section__placeholder"},[t("img",{attrs:{src:r(22260),alt:"","aria-hidden":"true"}}),this._v(" "),t("span",[this._v(this._s(this.$t("common.no.data")))])]):this._e()],2)},[],!1,null,"724c15bb",null).exports,F={props:{model:{type:Object,required:!0},moduleKey:{type:String,required:!0},sectionId:{type:String,required:!0},title:{type:String,required:!0}},computed:{conclusion:function(){return this.model.conclusion}}};function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function E(e){var t,r;return!!(e&&((null==(t=e.rows)?void 0:t.length)||(null==(r=e.columns)?void 0:r.length)))}function V(e,t){if(null==e||""===e)return"-";if(Array.isArray(e))return e.length?e.map(function(e){return V(e,t)}).join(", "):"-";if((void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"){var r=Object.entries(e);return r.length?r.map(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){o=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw r}}return i}}(e)||function(e){if(e){if("string"==typeof e)return D(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return D(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],i=r[1];return"".concat(n,": ").concat(V(i,t))}).join(" / "):"-"}return e}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function M(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}r(5989);var B=[["asin","main.product.invent.ai.research.report.field.asin"],["brand","main.product.invent.ai.research.report.field.brand"],["marketplace","main.product.invent.ai.research.report.field.marketplace"]],U=[["current_price","main.product.invent.ai.research.report.field.price"],["rating","main.product.invent.ai.research.report.field.rating"],["listing_quality_score","main.product.invent.ai.research.report.field.listing.quality"],["variations","main.product.invent.ai.research.report.field.variations"],["fulfillment","main.product.invent.ai.research.report.field.fulfillment"],["coupon","main.product.invent.ai.research.report.field.coupon"],["available_date","main.product.invent.ai.research.report.field.available.date"],["questions","main.product.invent.ai.research.report.field.questions"]],L=[{key:"seller_name",label:"main.product.invent.ai.research.report.field.seller"},{key:"parent_asin",label:"main.product.invent.ai.research.report.field.parent.asin"},{key:"dimensions",label:"main.product.invent.ai.research.report.field.dimensions"},{key:"package_weight",label:"main.product.invent.ai.research.report.field.package.weight"},{key:"package_dimensions",label:"main.product.invent.ai.research.report.field.package.dimensions"},{key:"bestSeller",label:"main.product.invent.ai.research.report.field.best.seller"},{key:"newRelease",label:"main.product.invent.ai.research.report.field.new.release"},{key:"badges",label:"main.product.invent.ai.research.report.field.badges"},{key:"bsr",label:"main.product.invent.ai.research.report.field.bsr"},{key:"core_selling_points",label:"main.product.invent.ai.research.report.field.selling.points",fullRow:!0},{key:"node_label_path",label:"main.product.invent.ai.research.report.field.category",fullRow:!0}],z=["ratings_count","ratings"],W=["reviews_count","reviews"],q=["lqs","listing_quality_score"],K=["ebc","video"],G={ebc:"main.product.invent.ai.research.report.metric.badge.aplus",video:"main.product.invent.ai.research.report.metric.badge.video",amazon_choice:"main.product.invent.ai.research.report.metric.badge.amazon.choice",amazonChoice:"main.product.invent.ai.research.report.metric.badge.amazon.choice"},H=["amazon_choice","amazonChoice"],Y=(0,k.A)({name:"AiResearchBasicInfoSection",components:{ReportConclusion:A,ReportSectionFrame:j},mixins:[F],computed:{productSource:function(){return this.model.productInfo||{}},productTitle:function(){return this.productSource.title||""},displayProductTitle:function(){return this.getValue(this.productTitle)},productMeta:function(){return this.createEntries(B)},productMetrics:function(){return this.createEntries(U)},otherEntries:function(){return this.padOtherEntries(this.createEntries(L))}},methods:{createEntries:function(e){var t=this;return e.map(function(e){var r=e.key||e[0],n=e.label||e[1];return{key:r,label:t.$t(n),value:t.getBasicValue(r),fullRow:!!e.fullRow}})},padOtherEntries:function(e){var t=[],r=[],n=function(){for(var e;r.length%3!=0;)r.push({key:"__empty-".concat(t.length,"-").concat(r.length),empty:!0});t.push.apply(t,function(e){if(Array.isArray(e))return N(e)}(e=r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return N(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r=[]};return e.forEach(function(e){if(e.fullRow){n(),t.push(e);return}r.push(e)}),n(),t},getBasicValue:function(e){switch(e){case"rating":return this.getRatingValue();case"listing_quality_score":return this.getListingQualityValue();case"badges":return this.getBadgesValue();case"bestSeller":return this.getBadgeFlagValue(["bestSeller","best_seller"]);case"newRelease":return this.getBadgeFlagValue(["newRelease","new_release"]);case"package_weight":return this.getWeightValue();case"bsr":return this.getBsrValue();default:return this.productSource[e]}},getMarketplaceFlagClass:function(e){var t=this,r=f(e,function(e){return t.$t(e)});if(!r)return"";var n=h[r]||r.toLowerCase();return"icon_flag icon_flag_".concat(n)},getMarketplaceLabel:function(e){var t,r,n=this,i=(r=f(e,function(e){return n.$t(e)}),(null==(t=p.find(function(e){return e.value===r}))?void 0:t.label)||"");return i?this.$t(i):this.getValue(e)},hasValue:function(e){return null!=e&&""!==e},getFirstValue:function(e){var t=this;return e.map(function(e){return t.productSource[e]}).find(function(e){return t.hasValue(e)})},formatMetricPart:function(e,t){return"".concat(V(e,this.$t)," ").concat(this.$t(t))},getRatingValue:function(){var e=this.productSource.rating,t=this.getFirstValue(z),r=this.getFirstValue(W);return[this.hasValue(e)?this.formatMetricPart(e,"main.product.invent.ai.research.report.metric.rating.unit"):"",[this.hasValue(t)?this.formatMetricPart(t,"main.product.invent.ai.research.report.metric.ratings.count.unit"):"",this.hasValue(r)?this.formatMetricPart(r,"main.product.invent.ai.research.report.metric.reviews.count.unit"):""].filter(
1Boolean).join(" / ")].filter(Boolean).join(" - ")},getListingQualityValue:function(){var e=this,t=[],r=this.getFirstValue(q);return this.hasValue(r)&&t.push(this.formatListingScore(r)),K.forEach(function(r){var n=e.formatListingBadge(e.getListingBadgeValue(r),r);n&&t.push(n)}),t.join(" \xb7 ")},formatListingScore:function(e){var t=V(e,this.$t);return/^LQS\b/i.test(String(t))?t:"LQS ".concat(t)},getListingBadgeValue:function(e){return this.getBadgeFieldValue([e])},formatListingBadge:function(e,t){return"Y"===e?this.$t(G[t]):""},getWeightValue:function(){var e=this,t=this.getFirstValue(["weight","product_weight"]),r=this.productSource.package_weight,n=[];return this.hasValue(t)&&n.push(V(t,this.$t)),this.hasValue(r)&&(Array.isArray(r)?r.forEach(function(t){e.hasValue(t)&&n.push(V(t,e.$t))}):n.push(V(r,this.$t))),n.join(" / ")},getBadgesValue:function(){var e=this,t=this.getBadgeSource();if(t&&(void 0===t?"undefined":M(t))==="object"&&!Array.isArray(t)){var r=H.find(function(r){return e.hasValue(t[r])});if(r)return this.formatAmazonChoiceValue(t[r],r)}var n=this.getFirstValue(H);if(this.hasValue(n))return this.formatAmazonChoiceValue(n,"amazon_choice");var i=this.getBadgeSource();return"Y"===i||"N"===i?this.formatAmazonChoiceValue(i,"amazon_choice"):""},formatAmazonChoiceValue:function(e,t){return"Y"===e?this.$t(G[t]):"N"===e?"":e},getBadgeSource:function(){return this.productSource.badge||this.productSource.badges},getBadgeFieldValue:function(e){var t=this,r=this.getBadgeSource(),n=r&&(void 0===r?"undefined":M(r))==="object"&&!Array.isArray(r)?e.map(function(e){return r[e]}).find(function(e){return t.hasValue(e)}):void 0;return this.hasValue(n)?n:this.getFirstValue(e)},getBadgeFlagValue:function(e){var t=this.getBadgeFieldValue(e);return"Y"===t?this.$t("common.yes"):"N"===t?"":t},getBsrValue:function(){var e=this,t=this.productSource.bsr;if(this.hasValue(t)&&((void 0===t?"undefined":M(t))!=="object"||Array.isArray(t)))return t;var r=t&&(void 0===t?"undefined":M(t))==="object"?["bsrRank","bsr_rank","rank"].map(function(e){return t[e]}).find(function(t){return e.hasValue(t)}):void 0;return this.hasValue(this.getFirstValue(["bsrRank","bsr_rank"]))?this.getFirstValue(["bsrRank","bsr_rank"]):r},getValue:function(e){return V(e,this.$t)}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ReportSectionFrame",{attrs:{empty:!1,"section-id":e.sectionId,title:e.title}},[e.conclusion?r("ReportConclusion",{attrs:{conclusion:e.conclusion,title:e.$t("main.product.invent.ai.research.report.key.conclusion")}}):e._e(),e._v(" "),r("div",{staticClass:"basic-info__group"},[r("div",{staticClass:"basic-info__group-title"},[e._v(e._s(e.$t("main.product.invent.ai.research.report.product.info")))]),e._v(" "),r("div",{staticClass:"basic-info__product-card"},[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.displayProductTitle,expression:"displayProductTitle",arg:"light"}],staticClass:"basic-info__product-title"},[e._v(e._s(e.displayProductTitle))]),e._v(" "),r("div",{staticClass:"basic-info__product-meta"},e._l(e.productMeta,function(t){return r("span",{key:t.key,staticClass:"basic-info__meta-item"},[r("span",{staticClass:"basic-info__meta-label"},[e._v(e._s(t.label)+"\uFF1A")]),e._v(" "),"marketplace"===t.key?r("strong",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.getMarketplaceLabel(t.value),expression:"getMarketplaceLabel(entry.value)",arg:"light"}],staticClass:"basic-info__meta-value basic-info__meta-marketplace"},[e.getMarketplaceFlagClass(t.value)?r("i",{staticClass:"basic-info__meta-flag",class:e.getMarketplaceFlagClass(t.value)}):e._e(),e._v(" "),r("span",[e._v(e._s(e.getMarketplaceLabel(t.value)))])]):r("strong",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.getValue(t.value),expression:"getValue(entry.value)",arg:"light"}],staticClass:"basic-info__meta-value"},[e._v(e._s(e.getValue(t.value)))])])}),0),e._v(" "),r("div",{staticClass:"basic-info__metrics"},e._l(e.productMetrics,function(t){return r("div",{key:t.key,staticClass:"basic-info__metric"},[r("span",{staticClass:"basic-info__metric-label"},[e._v(e._s(t.label))]),e._v(" "),r("strong",{directives:[{name:"tooltip",rawName:"v-tooltip:l
1ight",value:e.getValue(t.value),expression:"getValue(entry.value)",arg:"light"}],staticClass:"basic-info__metric-value"},[e._v(e._s(e.getValue(t.value)))])])}),0)])]),e._v(" "),r("div",{staticClass:"basic-info__group"},[r("div",{staticClass:"basic-info__group-title"},[e._v(e._s(e.$t("main.product.invent.ai.research.report.other.info")))]),e._v(" "),r("div",{staticClass:"basic-info__other-grid"},e._l(e.otherEntries,function(t){return r("div",{key:t.key,staticClass:"basic-info__field",class:{"basic-info__field--full":t.fullRow,"basic-info__field--empty":t.empty}},[t.empty?e._e():[r("span",{staticClass:"basic-info__label"},[e._v(e._s(t.label))]),e._v(" "),r("span",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.getValue(t.value),expression:"getValue(entry.value)",arg:"light"}],staticClass:"basic-info__value"},[e._v(e._s(e.getValue(t.value)))])]],2)}),0)])],1)},[],!1,null,"3c5e0ef0",null).exports;r(84503);var Q=r(77069);function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function Z(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var J={"sales-trend":[{field:"month",title:(0,Q._)("main.product.invent.ai.research.report.column.month"),align:"left"},{field:"child_units",title:(0,Q._)("main.product.invent.ai.research.report.column.monthly.sales"),align:"right"},{field:"child_revenue",title:(0,Q._)("main.product.invent.ai.research.report.column.monthly.revenue"),align:"right"},{field:"price",title:(0,Q._)("main.product.invent.ai.research.report.column.price"),align:"right"},{field:"bsr",title:(0,Q._)("main.product.invent.ai.research.report.column.bsr"),align:"right"},{field:"coupon",title:(0,Q._)("main.product.invent.ai.research.report.column.coupon"),align:"right"},{field:"mom",title:(0,Q._)("main.product.invent.ai.research.report.column.mom.change"),align:"right"},{field:"trend_judgement",title:(0,Q._)("main.product.invent.ai.research.report.column.trend"),align:"right"}],"competitor-data":[{field:"asin",title:(0,Q._)("main.product.invent.ai.research.report.column.asin.brand"),align:"left",slots:{default:"asin"}},{field:"price",title:(0,Q._)("main.product.invent.ai.research.report.column.price"),align:"right"},{field:"monthly_units",title:(0,Q._)("main.product.invent.ai.research.report.column.monthly.sales"),align:"right"},{field:"monthly_revenue",title:(0,Q._)("main.product.invent.ai.research.report.column.monthly.revenue"),align:"right"},{field:"rating",title:(0,Q._)("main.product.invent.ai.research.report.column.rating.count"),align:"right",slots:{default:"rating"}},{field:"main_category_rank",title:(0,Q._)("main.product.invent.ai.research.report.column.category.rank"),align:"left",slots:{default:"main_category_rank"}},{field:"sub_category_rank",title:(0,Q._)("main.product.invent.ai.research.report.column.subcategory.rank"),align:"left",slots:{default:"sub_category_rank"}},{field:"seller",title:(0,Q._)("main.product.invent.ai.research.report.column.seller.fulfillment"),align:"left",slots:{default:"seller"}},{field:"core_difference",title:(0,Q._)("main.product.invent.ai.research.report.column.differences"),align:"left",slots:{default:"core_difference"}}],"price-distribution":[{field:"price_band",title:(0,Q._)("main.product.invent.ai.research.report.column.price.range"),width:"20%",align:"left"},{field:"products",title:(0,Q._)("main.product.invent.ai.research.report.column.product.count"),width:"20%",minWidth:96,align:"right"},{field:"units",title:(0,Q._)("main.product.invent.ai.research.report.column.sales"),width:"20%",minWidth:96,align:"right"},{field:"revenue",title:(0,Q._)("main.product.invent.ai.research.report.column.revenue"),width:"20%",minWidth:112,align:"right"},{field:"units_ratio",title:(0,Q._)("main.product.invent.ai.research.report.column.sales.share"),width:"20%",minWidth:96,align:"right"}
1],"traffic-keywords":[{field:"keyword",title:(0,Q._)("main.product.invent.ai.research.report.keyword.core"),width:200,align:"left"},{field:"searches",title:(0,Q._)("main.product.invent.ai.research.report.column.searches"),align:"right"},{field:"purchases",title:(0,Q._)("main.product.invent.ai.research.report.column.purchases"),align:"right"},{field:"purchase_rate",title:(0,Q._)("main.product.invent.ai.research.report.column.purchase.rate"),align:"right"},{field:"rank_position",title:(0,Q._)("main.product.invent.ai.research.report.column.natural.rank"),align:"right"},{field:"products",title:(0,Q._)("main.product.invent.ai.research.report.column.product.count"),align:"right"},{field:"supply_demand_ratio",title:(0,Q._)("main.product.invent.ai.research.report.column.supply.demand.ratio"),align:"right"}],"traffic-keywords-ranking":[{field:"keyword",title:(0,Q._)("main.product.invent.ai.research.report.keyword.ranking"),width:242,align:"left"},{field:"rank_position",title:(0,Q._)("main.product.invent.ai.research.report.column.rank"),minWidth:96,align:"right"}],"traffic-keywords-high-volume":[{field:"keyword",title:(0,Q._)("main.product.invent.ai.research.report.keyword.high.volume"),width:242,align:"left"},{field:"searches",title:(0,Q._)("main.product.invent.ai.research.report.column.searches"),minWidth:96,align:"right"}],"review-analysis":[{field:"author",title:(0,Q._)("main.product.invent.ai.research.report.column.review.author"),minWidth:120,align:"left"},{field:"title",title:(0,Q._)("main.product.invent.ai.research.report.column.review.title"),minWidth:160,align:"left"},{field:"content",title:(0,Q._)("main.product.invent.ai.research.report.column.review.content"),minWidth:240,align:"left"},{field:"date",title:(0,Q._)("main.product.invent.ai.research.report.column.review.date"),minWidth:120,align:"left"},{field:"star",title:(0,Q._)("main.product.invent.ai.research.report.column.review.star"),minWidth:80,align:"right"},{field:"likes",title:(0,Q._)("main.product.invent.ai.research.report.column.review.likes"),minWidth:80,align:"right"},{field:"verified",title:(0,Q._)("main.product.invent.ai.research.report.column.review.verified"),minWidth:96,align:"center"}],"seller-analysis.seller_type_concentration":[{field:"seller_type",title:(0,Q._)("main.product.invent.ai.research.report.column.seller.type"),minWidth:117,align:"left"},{field:"product_num",title:(0,Q._)("main.product.invent.ai.research.report.column.product.count"),minWidth:117,align:"right"},{field:"asin_num",title:(0,Q._)("main.product.invent.ai.research.report.column.asin.count"),minWidth:117,align:"right"},{field:"units",title:(0,Q._)("main.product.invent.ai.research.report.column.sales"),minWidth:117,align:"right"},{field:"units_ratio",title:(0,Q._)("main.product.invent.ai.research.report.column.sales.share"),minWidth:117,align:"right"},{field:"rating",title:(0,Q._)("main.product.invent.ai.research.report.column.rating.score"),minWidth:117,align:"right"},{field:"ratings",title:(0,Q._)("main.product.invent.ai.research.report.column.rating.count.only"),minWidth:117,align:"right"}],"seller-analysis.seller_country_distribution":[{field:"country",title:(0,Q._)("main.product.invent.ai.research.report.column.country"),minWidth:137,align:"left"},{field:"products",title:(0,Q._)("main.product.invent.ai.research.report.column.product.count"),minWidth:137,align:"right"},{field:"units",title:(0,Q._)("main.product.invent.ai.research.report.column.sales"),minWidth:137,align:"right"},{field:"units_ratio",title:(0,Q._)("main.product.invent.ai.research.report.column.sales.share"),minWidth:137,align:"right"},{field:"revenue",title:(0,Q._)("main.product.invent.ai.research.report.column.revenue"),minWidth:137,align:"right"},{field:"revenue_ratio",title:(0,Q._)("main.product.invent.ai.research.report.column.revenue.share"),minWidth:137,align:"right"}]},ee=new Set(["source_type","source_mcp","_xid","__xid"]),et={asin:"main.product.invent.ai.research.report.column.asin.brand",brand:"main.product.invent.ai.research.report.column.asin.brand",price:"main.product.invent.ai.research.report.column.price",monthly_units:"main.product.invent.ai.research.report.column.monthly.sales",monthly_revenue:"main.product.invent.ai.research.report.column.monthly.revenue",units:"main.product.invent.ai.research.report.column.sales",revenue:"main.product.invent.ai.research.report.column.revenue",rating:"main.product.invent.ai.research.report.column.rating.score",ratings:"main.product.invent.ai.research.report.column.rating.count.only",ratings_count:"main.product.invent.ai.research.report.column.rating.count.only",main_category_rank:"main.product.invent.ai.research.report.column.category.rank",
1sub_category_rank:"main.product.invent.ai.research.report.column.subcategory.rank",sub_category_ranks:"main.product.invent.ai.research.report.column.subcategory.rank",seller:"main.product.invent.ai.research.report.column.seller.fulfillment",seller_name:"main.product.invent.ai.research.report.column.seller.fulfillment",fulfillment:"main.product.invent.ai.research.report.column.seller.fulfillment",core_difference:"main.product.invent.ai.research.report.column.differences",difference_points:"main.product.invent.ai.research.report.column.differences",seller_type:"main.product.invent.ai.research.report.column.seller.type",country:"main.product.invent.ai.research.report.column.country",products:"main.product.invent.ai.research.report.column.product.count",product_num:"main.product.invent.ai.research.report.column.product.count",product_count:"main.product.invent.ai.research.report.column.product.count",asin_num:"main.product.invent.ai.research.report.column.asin.count",asin_count:"main.product.invent.ai.research.report.column.asin.count",units_ratio:"main.product.invent.ai.research.report.column.sales.share",revenue_ratio:"main.product.invent.ai.research.report.column.revenue.share"};function er(e){return(J[e]||[]).map(function(e){return Z(X({},e),{align:e.align||"center"})})}function en(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ei(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){en(e,t,r[t])})}return e}function ea(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var eo="ai-research-report-column-widths";function es(){try{return JSON.parse(window.localStorage.getItem(eo)||"{}")||{}}catch(e){return{}}}var el=(0,k.A)({name:"AiResearchCompetitorDataSection",components:{ReportConclusion:A,ReportSectionFrame:j},mixins:[F],data:function(){return{columnWidths:es()}},computed:{competitorRows:function(){return this.model.items||[]},competitorColumns:function(){var e=this;return er("competitor-data").map(function(t){return ei({},t,e.columnWidths["".concat(e.moduleKey,".").concat(t.field)]?{width:e.columnWidths["".concat(e.moduleKey,".").concat(t.field)]}:{})})},hasCompetitorData:function(){return!!(this.conclusion||this.competitorRows.length)}},methods:{formatValue:function(e){var t=this;if(null==e||""===e)return"-";if(Array.isArray(e))return e.length?e.map(function(e){return t.formatValue(e)}).join(" / "):"-";if((void 0===e?"undefined":ea(e))==="object"){var r=Object.values(e).filter(function(e){return null!=e&&""!==e});return r.length?r.map(function(e){return t.formatValue(e)}).join(" / "):"-"}return String(e)},getRankValue:function(e){return Array.isArray(e)?e.map(function(e){return null==e?void 0:e.rank}).filter(function(e){return null!=e}).join(" / "):e&&(void 0===e?"undefined":ea(e))==="object"?e.rank:e},getSubCategoryRanks:function(e){return Array.isArray(null==e?void 0:e.sub_category_rank)&&e.sub_category_rank.length?e.sub_category_rank:null==e?void 0:e.sub_category_ranks},getRankCategory:function(e,t){if(null!=t&&""!==t)return this.formatValue(t);if(Array.isArray(e)){var r=e.map(function(e){return(null==e?void 0:e.label)||(null==e?void 0:e.category_name)||(null==e?void 0:e.category)||(null==e?void 0:e.name)}).filter(Boolean);return this.formatValue(r)}return this.formatValue(e&&(void 0===e?"undefined":ea(e))==="object"?e.label||e.category_name||e.category||e.name:null)},handleResizableChange:function(){var e,t,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).column,n=null==r?void 0:r.field,i=Number(null==r?void 0:r.resizeWidth);if(n&&Number.isFinite(i)&&!(i<=0)){this.columnWidths=(e=ei({},es()),t=null!=(t=en({},"".concat(this.moduleKey,".").concat(n),i))?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e);try{window.localStorage.setItem(eo,JSON.stringify(this.columnWidths))}catch(e){}}}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ReportSectionFrame",{attrs:{empty:!e.hasCompetitorData,"show-empty-placeholder":!1,"section-id":e.sectionId,title:e.title}},[e.conclusion?r("ReportConclusion",{attrs:{conclusion:e.conclusion,title:e.$t("main.product.invent.ai.research.report.key.conclusion")}}):e._e(),e._v(" "),r("div",{staticClass:"competitor-data__table"},[r("vxe-grid",{staticClass:"vxe_table_row_height_48 table_standard small_table",attrs:{columns:e.competitorColumns,data:e.competitorRows,size:"small","auto-resize":"","column-key":"",round:"",resizable:"","highlight-current-row":"","highlight-hover-row":"","show-header-overflow":"tooltip","show-overflow":"tooltip","empty-render":{name:"empty"},"scrollbar-config":{x:{visible:"hidden"}}},on:{"resizable-change":e.handleResizableChange},scopedSlots:e._u([{key:"asin",fn:function(t){var n=t.row;return[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.formatValue(n.asin),expression:"formatValue(row.asin)",arg:"light"}],staticClass:"line_clamp lh_18"},[e._v(e._s(e.formatValue(n.asin)))]),e._v(" "),r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.formatValue(n.brand),expression:"formatValue(row.brand)",arg:"light"}],staticClass:"competitor-data__secondary line_clamp"},[e._v(e._s(e.formatValue(n.brand)))])]}},{key:"rating",fn:function(t){var n=t.row;return[r("div",{staticClass:"lh_18"},[e._v(e._s(e.formatValue(n.rating)))]),e._v(" "),r("div",{staticClass:"competitor-data__secondary"},[e._v(e._s(e.formatValue(n.ratings||n.rating_count||n.ratings_count)))])]}},{key:"main_category_rank",fn:function(t){var n=t.row;return[r("div",{staticClass:"lh_18"},[e._v(e._s(e.formatValue(e.getRankValue(n.main_category_rank))))]),e._v(" "),r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:n.main_category_rank.label||n.node_label_path,expression:"row.main_category_rank.label || row.node_label_path",arg:"light"}],staticClass:"competitor-data__secondary line_clamp"},[e._v("\n                    "+e._s(n.main_category_rank.label||n.node_label_path)+"\n                ")])]}},{key:"sub_category_rank",fn:function(t){var n=t.row;return[r("div",{staticClass:"lh_18"},[e._v(e._s(e.formatValue(e.getRankValue(e.getSubCategoryRanks(n)))))]),e._v(" "),r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.getRankCategory(e.getSubCategoryRanks(n),n.sub_category_name),expression:"getRankCategory(getSubCategoryRanks(row), row.sub_category_name)",arg:"light"}],staticClass:"competitor-data__secondary line_clamp"},[e._v("\n                    "+e._s(e.getRankCategory(e.getSubCategoryRanks(n),n.sub_category_name))+"\n                ")])]}},{key:"seller",fn:function(t){var n=t.row;return[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.formatValue(n.seller||n.seller_name),expression:"formatValue(row.seller || row.seller_name)",arg:"light"}],staticClass:"line_clamp lh_18"},[e._v(e._s(e.formatValue(n.seller||n.seller_name)))]),e._v(" "),r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.formatValue(n.fulfillment||n.seller_type),expression:"formatValue(row.fulfillment || row.seller_type)",arg:"light"}],staticClass:"line_clamp lh_18"},[e._v(e._s(e.formatValue(n.fulfillment||n.seller_type)))])]}},{key:"core_difference",fn:function(t){var n=t.row;return[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.formatValue(n.core_difference),expression:"formatValue(row.core_difference)",arg:"light"}],staticClass:"line_clamp_2 lh_18"},[e._v(e._s(e.formatValue(n.core_difference)))])]}}])})],1)],1)},[],!1,null,"665762e8",null).exports;function ec(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){eu(e,t,r[t])})}return e}function ep(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function eh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ec(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ec(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ef="ai-research-report-column-widths";function em(){if("u"<typeof window)return{};try{var e=window.localStorage.getItem(ef);return e?JSON.parse(e):{}}catch(e){return{}}}var ev=(0,k.A)({name:"AiResearchReportTable",props:{columns:{type:Array,default:function(){return[]}},rows:{type:Array,default:function(){return[]}},sectionValue:{type:String,required:!0}},data:function(){return{columnWidths:em()}},computed:{tableColumns:function(){var e=this;return((this.columns.length?this.columns:er(this.sectionValue))||[]).filter(function(e){return e&&e.field&&!ee.has(String(e.field).toLowerCase())}).map(function(e){var t=e.field,r=et[t]?(0,Q._)(et[t]):/^product_/i.test(t)?(0,Q._)("main.product.invent.ai.research.report.column.product.metric"):"",n=e.title,i=r||(!n||n===t||/^[a-z][a-z0-9]*(?:_[a-z0-9]+)+$/i.test(n)?(0,Q._)("main.product.invent.ai.research.report.column.other"):n);return Z(X({},e),{field:t,title:i,align:e.align||"center"})}).map(function(t){var r=t.field,n=e.columnWidths["".concat(e.sectionValue,".").concat(r)];return ed(ep(ed({},t),{formatter:t.formatter||function(t){var r=t.cellValue;return e.formatCellValue(r)}}),n?{width:n}:{})})},isCompact:function(){return"traffic-keywords"===this.sectionValue||"price-distribution"===this.sectionValue||0===this.sectionValue.indexOf("seller-analysis.")},isPriceDistribution:function(){return"price-distribution"===this.sectionValue}},methods:{formatCellValue:function(e){var t=this;if(null==e||""===e)return"-";if(Array.isArray(e))return e.length?e.map(function(e){return t.formatCellValue(e)}).join("\n"):"-";if((void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"){var r=Object.entries(e).filter(function(e){return!["source_type","source_mcp"].includes(eh(e,1)[0])});return r.length?r.map(function(e){var r=eh(e,2),n=r[0],i=r[1];return"".concat(n,": ").concat(t.formatCellValue(i))}).join(" | "):"-"}return String(e)},handleResizableChange:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).column,t=(null==e?void 0:e.field)||(null==e?void 0:e.property),r=Number(null==e?void 0:e.resizeWidth);if(t&&Number.isFinite(r)&&!(r<=0)){var n=ep(ed({},em()),eu({},"".concat(this.sectionValue,".").concat(t),r));this.columnWidths=n;try{window.localStorage.setItem(ef,JSON.stringify(n))}catch(e){}}}}},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ai-report-table"},[t("vxe-grid",{class:["ai-report-table__grid","small_table","vxe_table_v_a_middle",{"ai-report-table__grid--compact":this.isCompact},{"ai-report-table__grid--price":this.isPriceDistribution}],attrs:{columns:this.tableColumns,data:this.rows,size:"small","auto-resize":"","column-key":"",round:"",resizable:"","highlight-current-row":"","highlight-hover-row":"","show-header-overflow":"tooltip","show-overflow":"tooltip","empty-render":{name:"empty"},"scrollbar-config":{x:{visible:"hidden"}}},on:{"resizable-change":this.handleResizableChange}})],1)},[],!1,null,"a1ddb060",null).exports,eg=(0,k.A)({name:"AiResearchDefaultSection",components:{ReportConclusion:A,ReportSectionFrame:j,ReportTable:ev},mixins:[F],computed:{hasDefaultData:function(){var e;return!!(this.conclusion||(null==(e=this.model)?void 0:e.items.length)||E(this.model))},hasTableData:function(){return E(this.model)}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ReportSectionFrame",{attrs:{empty:!e.hasDefaultData,"section-id":e.sectionId,title:e.title}},[e.conclusion?r("ReportConclusion",{attrs:{conclusion:e.conclusion,title:e.$t("main.product.invent.ai.research.report.key.conclusion")}}
1):e._e(),e._v(" "),e.model.items.length?r("div",{staticClass:"ai-report-section__items"},e._l(e.model.items,function(t,n){return r("div",{key:n,staticClass:"ai-report-section__item"},[r("span",{staticClass:"ai-report-section__item-index"},[e._v(e._s(n+1))]),e._v(" "),r("span",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:t,expression:"item",arg:"light"}]},[e._v(e._s(t))])])}),0):e._e(),e._v(" "),e.hasTableData?r("ReportTable",{attrs:{columns:e.model.columns,rows:e.model.rows,"section-value":e.moduleKey}}):e._e()],1)},[],!1,null,"c8be74b4",null).exports,ey=(0,k.A)({name:"AiResearchMarketStatisticsSection",components:{ReportConclusion:A,ReportSectionFrame:j,ReportTable:ev},mixins:[F],computed:{metricGroups:function(){return Object.values(this.model.metrics)},hasMarketData:function(){return!!(this.conclusion||this.metricGroups.length||E(this.model))},hasTableData:function(){return E(this.model)}},methods:{getValue:function(e){return V(e,this.$t)},getMetricLabel:function(e){return e.labelKey&&this.$te(e.labelKey)?this.$t(e.labelKey):e.label||e.key},getGroupTitle:function(e){return e.titleKey&&this.$te(e.titleKey)?this.$t(e.titleKey):e.title}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ReportSectionFrame",{attrs:{empty:!e.hasMarketData,"section-id":e.sectionId,title:e.title}},[e.conclusion?r("ReportConclusion",{attrs:{conclusion:e.conclusion,title:e.$t("main.product.invent.ai.research.report.key.conclusion")}}):e._e(),e._v(" "),e.metricGroups.length?r("div",{staticClass:"market-statistics__groups"},e._l(e.metricGroups,function(t){return r("div",{key:t.key,staticClass:"market-statistics__group"},[t.title||t.titleKey?r("div",{staticClass:"market-statistics__group-title"},[e._v(e._s(e.getGroupTitle(t)))]):e._e(),e._v(" "),r("div",{staticClass:"market-statistics__metrics"},e._l(t.metrics,function(t){return r("div",{key:t.key||t.label,staticClass:"market-statistics__metric"},[r("span",{staticClass:"market-statistics__label"},[e._v(e._s(e.getMetricLabel(t)))]),e._v(" "),r("span",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.getValue(t.value),expression:"getValue(metric.value)",arg:"light"}],staticClass:"market-statistics__value"},[e._v(e._s(e.getValue(t.value)))])])}),0)])}),0):e._e(),e._v(" "),!e.metricGroups.length&&e.hasTableData?r("ReportTable",{attrs:{columns:e.model.columns,rows:e.model.rows,"section-value":e.moduleKey}}):e._e()],1)},[],!1,null,"381d1664",null).exports,e_=(0,k.A)({name:"AiResearchPriceDistributionSection",components:{ReportConclusion:A,ReportSectionFrame:j,ReportTable:ev},mixins:[F],computed:{priceRows:function(){return this.model.ranges},hasPriceData:function(){return!!(this.conclusion||this.priceRows.length)}}},function(){var e=this.$createElement,t=this._self._c||e;return t("ReportSectionFrame",{attrs:{empty:!this.hasPriceData,"show-empty-placeholder":!1,"section-id":this.sectionId,title:this.title}},[this.conclusion?t("ReportConclusion",{attrs:{conclusion:this.conclusion,title:this.$t("main.product.invent.ai.research.report.key.conclusion")}}):this._e(),this._v(" "),t("ReportTable",{attrs:{columns:this.model.columns,rows:this.priceRows,"section-value":this.moduleKey}})],1)},[],!1,null,null,null).exports,eb=(0,k.A)({name:"AiResearchSalesTrendSection",components:{ReportConclusion:A,ReportSectionFrame:j,ReportTable:ev},mixins:[F],computed:{trendRows:function(){return this.model.months},hasSalesData:function(){return!!(this.conclusion||this.trendRows.length)}}},function(){var e=this.$createElement,t=this._self._c||e;return t("ReportSectionFrame",{attrs:{empty:!this.hasSalesData,"show-empty-placeholder":!1,"section-id":this.sectionId,title:this.title}},[this.conclusion?t("ReportConclusion",{attrs:{conclusion:this.conclusion,title:this.$t("main.product.invent.ai.research.report.key.conclusion")}}):this._e(),this._v(" "),t("ReportTable",{attrs:{columns:this.model.columns,rows:this.trendRows,"section-value":this.moduleKey}})],1)},[],!1,null,null,null).exports,ew=(0,k.A)({name:"AiResearchSellerAnalysisSection",components:{ReportConclusion:A,ReportSectionFrame:j,ReportTable:ev},mixins:[F],computed:{sellerTables:function(){return this.model.tables},sellerCards:function(){return this.model.cards}},methods:{getValue:function(e){return V(e,this.$t)},getTableSectionValue:function(e){return"".concat(this.moduleKey,".").concat(e)},getTableTitle:function(e){return e.titleKey&&this.$te(e.titleKey)?this.$t(e.titleKey):e.title}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ReportSectionFrame",{attrs:{empty:!1,"section-id":e.sectionId,title:e.title}},[e.conclusion?r("ReportConclusion",{attrs:{conclusion:e.conclusion,title:e.$t("main.product.invent.ai.research.report.key.conclusion")}}
1):e._e(),e._v(" "),e.sellerTables.length?r("div",{staticClass:"seller-analysis__tables"},e._l(e.sellerTables,function(t){return r("div",{key:t.key,staticClass:"seller-analysis__table-section"},[t.title||t.titleKey?r("div",{staticClass:"seller-analysis__table-title"},[e._v(e._s(e.getTableTitle(t)))]):e._e(),e._v(" "),r("ReportTable",{attrs:{columns:t.columns,rows:t.rows,"section-value":e.getTableSectionValue(t.key)}})],1)}),0):e.sellerCards.length?r("div",{staticClass:"seller-analysis__cards"},e._l(e.sellerCards,function(t){return r("div",{key:t.label,staticClass:"seller-analysis__card"},[r("span",{staticClass:"seller-analysis__label"},[e._v(e._s(t.label))]),e._v(" "),r("span",{directives:[{name:"tooltip",rawName:"v-tooltip:light",value:e.getValue(t.value),expression:"getValue(card.value)",arg:"light"}],staticClass:"seller-analysis__value"},[e._v(e._s(e.getValue(t.value)))])])}),0):r("ReportTable",{attrs:{columns:e.model.columns,rows:e.model.rows,"section-value":e.moduleKey}})],1)},[],!1,null,"30465d50",null).exports;function ek(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ek(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ek(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eC=(0,k.A)({name:"AiResearchTrafficKeywordsSection",components:{ReportConclusion:A,ReportSectionFrame:j,ReportTable:ev},mixins:[F],computed:{mainRows:function(){return this.model.mainRows},mainColumns:function(){return this.model.mainColumns},keywordGroups:function(){return[["ranking",this.model.rankingKeywords,this.getKeywordGroupTitle(this.model.rankingKeywordsTitle)],["high-volume",this.model.highVolumeKeywords,this.getKeywordGroupTitle(this.model.highVolumeKeywordsTitle)]].filter(function(e){return eS(e,2)[1].length}).map(function(e){var t=eS(e,3),r=t[0],n=t[1];return{key:r,title:t[2],items:n,columns:er("traffic-keywords-".concat(r)),sectionValue:"traffic-keywords-".concat(r)}})},hasTrafficData:function(){return!!(this.conclusion||this.mainRows.length||this.mainColumns.length||this.keywordGroups.length)}},methods:{getKeywordGroupTitle:function(e){return this.$te(e)?this.$t(e):e}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ReportSectionFrame",{attrs:{empty:!e.hasTrafficData,"show-empty-placeholder":!1,"section-id":e.sectionId,title:e.title}},[e.conclusion?r("ReportConclusion",{attrs:{conclusion:e.conclusion,title:e.$t("main.product.invent.ai.research.report.key.conclusion")}}):e._e(),e._v(" "),r("div",{staticClass:"traffic-keywords__main-table"},[r("div",{staticClass:"traffic-keywords__table-title"},[r("span",[e._v(e._s(e.$t("main.product.invent.ai.research.report.keyword.core")))])]),e._v(" "),r("ReportTable",{attrs:{columns:e.mainColumns,rows:e.mainRows,"section-value":e.moduleKey}})],1),e._v(" "),e.keywordGroups.length?r("div",{staticClass:"traffic-keywords__groups"},e._l(e.keywordGroups,function(t){return r("div",{key:t.key,staticClass:"traffic-keywords__group"},[t.title?r("div",{staticClass:"traffic-keywords__group-title"},[e._v(e._s(t.title))]):e._e(),e._v(" "),r("ReportTable",{attrs:{columns:t.columns,rows:t.items,"section-value":t.sectionValue}})],1)}),0):e._e()],1)},[],!1,null,"7b86a6e1",null).exports,eO={name:"AiResearchReport",components:{Empty:C.A,AiResearchSyncFieldsDialog:O,ReportProductHeader:T,SideAnchor:P,BasicInfoSection:Y,CompetitorDataSection:el,DefaultSection:eg,MarketStatisticsSection:ey,PriceDistributionSection:e_,SalesTrendSection:eb,SellerAnalysisSection:ew,TrafficKeywordsSection:eC},props:{loading:{type:Boolean,default:!1},report:{type:Object,default:null},status:{type:String,default:""},sourcePage:{type:String,default:"create"},showSyncFields:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0}},data:function(){return{activeSection:"",syncDialogVisible:!1,reportContainer:null}},mounted:function(){this.bindReportContainer(),this.resetToFirstAnchor()},watch:{report:function(){this.resetToFirstAnchor()},reportModules:{handler:function(){var e=this;this.$nextTick(function(){var t;return null==(t=e.$refs.sideAnchor)?void 0:t.syncNow()})}}},computed:{reportModules:function(){var e,t;return null!=(e=null==(t=this.report)?void 0:t.modules)?e:[]},syncFields:function(){var e,t,r;return null!=(e=null==(r=this.report)||null==(t=r.header)?void 0:t.syncFields)?e:[]},anchorOptions:function(){var e=this;return this.reportModules.map(function(t){return{id:e.getSectionId(t.key),label:e.getModuleLabel(t)}})},anchorSections:function(){var e=this,t={};
1return this.reportModules.forEach(function(r){t[e.getSectionId(r.key)]={}}),t}},methods:{bindReportContainer:function(){this.reportContainer=this.$refs.reportScroller||null},resetToFirstAnchor:function(){var e,t=this,r=(null==(e=this.anchorOptions[0])?void 0:e.id)||"";this.activeSection=r,this.$nextTick(function(){var e;t.bindReportContainer(),t.reportContainer&&(t.reportContainer.scrollTop=0),null==(e=t.$refs.sideAnchor)||e.syncNow()})},handleSyncFields:function(){this.showSyncFields&&(this.syncDialogVisible=!0)},getModuleLabel:function(e){return"function"==typeof this.$te&&this.$te(e.label)?this.$t(e.label):e.label},getSectionId:function(e){return"ai-report-section-".concat(e)},getModuleComponent:function(e){var t;return e.component&&null!=(t=this.$options.components[e.component])?t:eg}}},e$=(0,k.A)(eO,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ai-drawer__body ai-report"},[e.loading?r("div",{staticClass:"ai-report__loading flex column center_align center_just"},[r("i",{staticClass:"icon_load_big"}),e._v(" "),r("div",{staticClass:"f_14 f_black lh_22 mt_4"},[e._v(e._s(e.$t("main.product.invent.ai.research.report.generating")))]),e._v(" "),r("div",{staticClass:"f_12 f_gray lh_18 mt_4"},[e._v(e._s(e.$t("main.product.invent.ai.research.report.generating.tip")))])]):"failed"===e.status?r("div",{staticClass:"ai-report__failed flex column center_align center_just"},[r("i",{staticClass:"icon_sf_warning_fill f_24 f_error",attrs:{"aria-hidden":"true"}}),e._v(" "),r("div",{staticClass:"f_14 f_black lh_22 mt_8"},[e._v(e._s(e.$t("main.product.invent.ai.research.task.failed")))])]):e.report?r("div",{staticClass:"ai-report__content"},[r("ReportProductHeader",{attrs:{report:e.report,header:e.report.header,"source-page":e.sourcePage,"show-sync-fields":e.showSyncFields,"show-refresh":e.showRefresh},on:{refresh:function(t){return e.$emit("refresh")},"sync-fields":e.handleSyncFields}}),e._v(" "),r("div",{staticClass:"ai-report__layout"},[r("div",{staticClass:"ai-report__anchors"},[r("SideAnchor",{ref:"sideAnchor",attrs:{"aria-label":e.$t("main.product.invent.ai.research.report.content"),options:e.anchorOptions,sections:e.anchorSections,container:e.reportContainer,offset:20,width:110},model:{value:e.activeSection,callback:function(t){e.activeSection=t},expression:"activeSection"}})],1),e._v(" "),r("main",{ref:"reportScroller",staticClass:"ai-report__main"},e._l(e.reportModules,function(t){return r(e.getModuleComponent(t),{key:t.key,tag:"component",attrs:{model:t.model,"module-key":t.key,"section-id":e.getSectionId(t.key),title:e.getModuleLabel(t)}})}),1)])],1):r("div",{staticClass:"ai-drawer__report-empty"},[r("Empty",{attrs:{"image-size-type":"large",description:e.$t("main.product.invent.ai.research.report.empty"),"custom-class":"ai-report-empty"}})],1),e._v(" "),r("AiResearchSyncFieldsDialog",{attrs:{fields:e.syncFields,visible:e.syncDialogVisible,"source-page":e.sourcePage},on:{"update:visible":function(t){e.syncDialogVisible=t},confirm:function(t){return e.$emit("sync-fields",t)}}})],1)},[],!1,null,"63d29134",null).exports;function eI(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function eR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function eP(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function ex(e){return/processing/i.test((null==e?void 0:e.message)||"")}r(10327),r(48075),r(5083),r(13951),r(99583);var eT=["title","title_summary","asin","asin_url","brand","marketplace","image_url","current_price","rating","ratings_count","ratings","reviews_count","reviews","listing_quality_score","variations","fulfillment","coupon","available_date","questions","seller_name","parent_asin","dimensions","weight","product_weight","package_weight","package_dimensions","badge","badges","bestSeller","best_seller","newRelease","new_release","amazon_choice","amazonChoice","bsr","bsrId","bsrLabel","bsrRank","bsr_id","bsr_label","bsr_rank","core_selling_points","node_label_path"],eA=[{key:"market-size",titleKey:"main.product.invent.ai.research.report.market.statistics.group.market.size",fields:[["sample_products","main.product.invent.ai.research.report.market.statistics.metric.sample.products"],["brands","main.product.invent.ai.research.report.market.statistics.metric.brands"],["sellers","main.product.invent.ai.research.report.market.statistics.metric.sellers"]]},{key:"market-performance",titleKey:"main.product.invent.ai.research.report.market.statistics.group.market.performance",fields:[["avg_units","main.product.invent.ai.research.report.market.statistics.metric.avg.units"],["avg_revenue","main.product.invent.ai.research.report.market.statistics.metric.avg.revenue"],["avg_price","main.product.invent.ai.research.report.market.statistics.metric.avg.price"],["avg_rating","main.product.invent.ai.research.report.market.statistics.metric.avg.rating"],["avg_ratings","main.product.invent.ai.research.report.market.statistics.metric.avg.ratings"]]},{key:"new-product-performance",titleKey:"main.product.invent.ai.research.report.market.statistics.group.new.product.performance",fields:[["new_products","main.product.invent.ai.research.report.market.statistics.metric.new.products"],["new_product_proportion","main.product.invent.ai.research.report.market.statistics.metric.new.product.proportion"],["new_avg_price","main.product.invent.ai.research.report.market.statistics.metric.new.avg.price"],["new_avg_units","main.product.invent.ai.research.report.market.statistics.metric.new.avg.units"],["new_avg_rating","main.product.invent.ai.research.report.market.statistics.metric.new.avg.rating"]]}],ej=[{modelKey:"rankingKeywords",sourceKey:"ranking_keywords",titleKey:"main.product.invent.ai.research.report.keyword.ranking"},{modelKey:"highVolumeKeywords",sourceKey:"high_search_keywords",titleKey:"main.product.invent.ai.research.report.keyword.high.volume"}],eF=[{key:"seller_type_concentration",titleKey:"main.product.invent.ai.research.report.seller.type.distribution"},{key:"seller_country_distribution",titleKey:"main.product.invent.ai.research.report.seller.country.distribution"}];function eD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function eV(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var eN=/\s*[xX\xd7*\uff0a]\s*/,eM=/\s*[dwhl]\s*$/i,eB={"basic-info":function(e){var t=eT.reduce(function(t,r){return t[r]=function(e,t){if("available_date"===e&&("number"==typeof t||/^\d{10,13}$/.test(String(t)))){var r=Number(t);if(!Number.isFinite(r))return t;var n=new Date(r<1e12?1e3*r:r);if(Number.isNaN(n.getTime()))return t;var i=function(e){return String(e).padStart(2,"0")};return"".concat(n.getUTCFullYear(),"-").concat(i(n.getUTCMonth()+1),"-").concat(i(n.getUTCDate()))}if("dimensions"===e||"package_dimensions"===e){if("string"!=typeof t)return t;var a=t.split(eN).map(function(e){return e.trim()}).filter(Boolean);return 3!==a.length?t:a.map(function(e){return e.replace(eM,"").trim()}).join(" x ")}return t}(r,e[r]),t},{});return{conclusion:e.reference_conclusion,productInfo:t}},"competitor-data":function(e){return{conclusion:e.summary,items:Array.isArray(e.items)?e.items:[],columns:Array.isArray(e.columns)?e.columns:[]}},"market-statistics":function(e){var t=e.market_summary,r=eA.map(function(e){return eV(eE({},e),{metrics:e.fields.map(function(e){var r=function(e){if(Array.isArray(e))return e}(e)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){o=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw r}}return i}}(e)||function(e){if(e){if("string"==typeof e)return eD(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eD(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0];return{key:n,labelKey:r[1],value:null==t?void 0:t[n]}}).filter(function(e){return void 0!==e.value&&null!==e.value&&""!==e.value})})}).filter(function(e){return e.metrics.length});return{conclusion:e.summary,metrics:r.reduce(function(e,t){return e[t.key]=t,e},{}),columns:Array.isArray(e.columns)?e.columns:[],rows:Array.isArray(e.rows)?e.rows:[]}},"price-distribution":function(e){return{conclusion:e.summary,ranges:Array.isArray(e.ranges)?e.ranges:[],columns:Array.isArray(e.columns)?e.columns:[]}},"review-analysis":function(e){return{conclusion:e.summary,cards:Array.isArray(e.cards)?e.cards:[],reviews:Array.isArray(e.reviews)?e.reviews:[],columns:Array.isArray(e.columns)?e.columns:[]}},"sales-trend":function(e,t){var r;return{conclusion:e.summary,months:Array.isArray(e.months)?e.months:[],columns:Array.isArray(e.columns)?e.columns:[],keepaTrend:null!=(r=t.keepa_trend)?r:{}}},"seller-analysis":function(e){return{conclusion:e.summary,tables:eF.map(function(t){var r;return eV(eE({},t),{columns:[],rows:Array.isArray(null==(r=e[t.key])?void 0:r.items)?e[t.key].items:[]})}),cards:[],columns:[],rows:[]}},"traffic-keywords":function(e){var t={conclusion:e.summary,mainRows:Array.isArray(e.organic_keywords)?e.organic_keywords:[],mainColumns:[]};return ej.forEach(function(r){var n=r.modelKey,i=r.sourceKey,a=r.titleKey;t[n]=Array.isArray(e[i])?e[i]:[],t["".concat(n,"Title")]=a}),t}},eU=r(46742);function eL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function ez(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function eW(e,t,r){if(!e)return{taskId:r,status:"running",progress:0,totalCount:1,successCount:0,failCount:0};var n,i,a,o,s,l,c,u,p,h,f,m,v,g,y,_,b,w="success"===(e=null!=(y=null==e?void 0:e.data)?y:e).status?"success":"failed"===e.status?"failed":"running";return{taskId:null!=(_=e.task_id)?_:r,status:w,progress:100*("success"===w),totalCount:1,successCount:+("success"===w),failCount:+("failed"===w),errorMessage:null!=(b=e.error_log)?b:"",report:"success"===w?(h=d(Array.isArray((n=null!=(i=null!=(a=null==(n=e)?void 0:n.data)?a:n)?i:{}).selected_modules)?n.selected_modules:null!=(o=t.reportContent)?o:[]),f=(null==(u=n.basic_info)?void 0:u.marketplace)||t.site||n.marketplace,m=h.map(function(e){var t,r,i,a,o,s=(i=null!=(r=(t=n)[e.apiKey])?r:{},(a=eB[e.value])?a(i,t):{conclusion:null!=(o=i.conclusion)?o:"",items:Array.isArray(i.items)?i.items:[],columns:Array.isArray(i.columns)?i.columns:[],rows:Array.isArray(i.rows)?i.rows:[]});return"basic-info"===e.value&&s.productInfo&&(s.productInfo=ez(eL({},s.productInfo),{marketplace:s.productInfo.marketplace||f})),{key:e.value,label:e.label,component:e.component,model:s}}),g=ez(eL({},(v=eB["basic-info"](null!=(s=n.basic_info)?s:{})).productInfo),{marketplace:v.productInfo.marketplace||f}),ez(eL({},n),{asin:null!=(l=n.asin)?l:t.asin,site:null!=(c=n.marketplace)?c:t.site,selected_modules:h.map(function(e){return e.value}),modules:m,header:{productInfo:g,syncFields:(0,eU.rO)(null==(p=n.ai_strategy)?void 0:p.erp_sync_fields)}})):null}}function eq(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eK(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function eG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function eH(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var eY={name:"ProductInventAiResearchDrawer",components:{AiResearchForm:S,AiResearchReport:e$,TabBar:a.A},props:{visible:{type:Boolean,default:!1},mcpServices:{type:Array,default:function(){return[]}},sourcePage:{type:String,default:"create"},initialReport:{type:Object,default:null},showSyncFields:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0}},data:function(){return{active:"detail"===this.sourcePage?"report":"research",reportGenerating:!1,researchFormPreset:null,researchReport:null,aiResearchTask:null,aiResearchTaskManager:null,aiResearchTabs:[{value:"research",label:"main.product.invent.ai.research.tab"},{value:"report",label:"main.product.invent.ai.research.report.tab"}]}},computed:{isDetailSource:function(){return"detail"===this.sourcePage},aiResearchTabOptions:function(){var e=this;return this.aiResearchTabs.filter(function(t){return!e.isDetailSource||"report"===t.value}).map(function(t){return{name:e.$t(t.label),value:t.value}})},drawerVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}}},created:function(){var e=this;this.aiResearchTaskManager=function(e){var t=e.generateReport,r=e.queryReport,n=e.normalizeProgress,i=e.buildParams,a=e.onUpdate,o=e.onError,s=e.getTimeoutMessage,l=e.getFailedMessage,c=null,u=null,d=null,p=!1,h=0,f=function(){return a(eR({},c))},m=function(){u&&(window.clearTimeout(u),u=null),d&&(window.clearTimeout(d),d=null),p=!1},v=function(e){return(null==c?void 0:c.sequence)===(null==e?void 0:e.sequence)&&(null==c?void 0:c.status)==="running"},g=function(e){c=eR({},c,e),f(),"running"!==e.status&&m()},y=function(e,t){v(e)&&g({taskId:c.taskId,status:"failed",totalCount:1,successCount:0,failCount:1,errorMessage:t})},_=function(e){y(e,s())},b=function(e){v(e)&&(u=window.setTimeout(function(){return w(e)},5e3))};function w(e){var t;return(t=function(){var t,i;return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:if(!v(e)||p)return[2];if(Date.now()-e.startedAt>=6e5)return _(e),[2];p=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,r(e)];case 2:return t=a.sent(),v(e)&&g(n(t,c)),[3,5];case 3:return i=a.sent(),v(e)&&!ex(i)&&(y(e,""),o(i)),[3,5];case 4:return p=!1,[7];case 5:return b(e),[2]}})},function(){var e=this,r=arguments;
1return new Promise(function(n,i){var a=t.apply(e,r);function o(e){eI(a,n,i,o,s,"next",e)}function s(e){eI(a,n,i,o,s,"throw",e)}o(void 0)})})()}function k(){m(),c=null}return{start:function(e){k();var r=Date.now();h+=1,c={taskId:"local-ai-research-".concat(r),status:"running",progress:0,totalCount:1,successCount:0,failCount:0,noticeClosed:!1,startedAt:r,sequence:h,form:e},f();var n=c;d=window.setTimeout(function(){return _(n)},6e5),Promise.resolve().then(function(){return t(i(e))}).then(function(e){var t,r,i,a,o=null!=(r=null!=(i=null==(a=null!=(t=null==e?void 0:e.data)?t:e)?void 0:a.taskId)?i:null==a?void 0:a.task_id)?r:"";if(!o)throw Error(l());v(n)&&(c=eP(eR({},c),{taskId:o}),f(),w(n))}).catch(function(e){if(v(n)){if(ex(e))return void w(n);y(n,""),o(e)}})},resume:function(e){k(),h+=1,c=eP(eR({},e),{status:"running",startedAt:e.startedAt||Date.now(),sequence:h}),f();var t=c;d=window.setTimeout(function(){return _(t)},6e5),w(t)},stop:k}}({generateReport:function(e){return(0,n.pd)(e)},queryReport:function(e){return(0,n.YW)({param:e.form.asin})},normalizeProgress:function(e,t){return eW(e,t.form,t.taskId)},buildParams:function(t){return e.buildGenerateParams(t)},onUpdate:function(t){return e.handleTaskUpdate(t)},onError:function(t){return e.$message.handle(t)},getTimeoutMessage:function(){return e.$t("main.product.invent.ai.research.task.timeout")},getFailedMessage:function(){return e.$t("main.product.invent.ai.research.task.failed")}}),this.applyInitialReport(this.initialReport)},watch:{initialReport:function(e){this.applyInitialReport(e)}},methods:{applyInitialReport:function(e){if(this.aiResearchTaskManager.stop(),!e){this.researchReport=null,this.aiResearchTask=null,this.researchFormPreset=null,this.reportGenerating=!1,this.active=this.isDetailSource?"report":"research";return}var t,r,n=null!=(t=null==e?void 0:e.data)?t:e,i=(null==n?void 0:n.task_id)||(null==n?void 0:n.taskId),a=i&&i===(null==(r=this.aiResearchTask)?void 0:r.taskId)?this.aiResearchTask.form:null,o=eH(eG({},a||{}),{asin:(null==a?void 0:a.asin)||(null==n?void 0:n.asin)||"",site:(null==a?void 0:a.site)||(null==n?void 0:n.marketplace)||"US",reportContent:Array.isArray(null==n?void 0:n.selected_modules)?n.selected_modules:[]}),s=eW(n,o,i||"");this.aiResearchTask=eH(eG({},this.aiResearchTask,s),{form:o}),this.reportGenerating="running"===s.status,this.researchReport=s.report||null,this.active="report","running"===s.status&&s.taskId&&this.aiResearchTaskManager.resume(this.aiResearchTask)},onEscapeKey:function(e){"Escape"===e.key&&this.closeDrawer("esc")},onDrawerClose:function(){document.removeEventListener("keydown",this.onEscapeKey)},closeDrawer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close_button";this.reportUserEvent("cancel",{source:e}),this.drawerVisible=!1},onDrawerOpen:function(){var e;return(e=function(){return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){return document.addEventListener("keydown",this.onEscapeKey),(this.isDetailSource||this.researchReport)&&(this.active="report"),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){eK(a,n,i,o,s,"next",e)}function s(e){eK(a,n,i,o,s,"throw",e)}o(void 0)})}).call(this)},onDrawerClosed:function(){this.reportGenerating||this.isDetailSource||(this.active="research"),this.$emit("closed")},openReport:function(){this.handleTabChange("report","task_notice")},handleTabChange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tab";this.isDetailSource&&"research"===e||("research"===e&&this.active!==e&&this.researchReport&&this.fillResearchFormFromReport(),this.active=e,"report"===e&&this.reportUserEvent("report",{source:t}))},submitAiResearch:function(e){var t,r=eH(eG({},e),{reportContent:Array.isArray(e.reportContent)?function(e){if(Array.isArray(e))return eq(e)}(t=e.reportContent)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return eq(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eq(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[]});this.researchFormPreset=r,this.reportGenerating||(this.active="report",this.researchReport=null,this.aiResearchTaskManager.start(r))},fillResearchFormFromReport:function(){var e,t,r,n,i,a,o,s=(null==(a=this.aiResearchTask)?void 0:a.form)||{},l=((null==(o=this.researchReport)?void 0:o.modules)||[]).map(function(e){var t,r;return t=e.key,(r=c.find(function(e){return e.apiKey===t}))?r.value:t}),d=new Set(u().map(function(e){return e.value}));this.researchFormPreset={asin:null!=(e=null!=(t=s.asin)?t:this.researchReport.asin)?e:"",site:null!=(r=null!=(n=s.site)?n:this.researchReport.marketplace)?r:"US",reportContent:l.filter(function(e){return d.has(e)}),mcpServiceId:null!=(i=s.mcpServiceId)?i:null}},refreshReport:function(){this.researchReport&&(this.fillResearchFormFromReport(),this.active="research")},buildGenerateParams:function(e){return{input:e.asin,marketplace:e.site,modules:d(e.reportContent).map(function(e){return e.apiKey}),mcpConfigId:Number(e.mcpServiceId)}},syncFields:function(e){this.$emit("sync-fields",e)},handleTaskUpdate:function(e){this.aiResearchTask=e,this.reportGenerating="running"===e.status,"success"===e.status&&(this.researchReport=e.report),"failed"===e.status&&e.errorMessage&&this.$message.error(e.errorMessage),this.$emit("task-update",eH(eG({},e),{form:void 0}))},reportUserEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=m.l[e];r&&(0,i.vr)(r,"click",eG({source_page:this.sourcePage},t))}},beforeDestroy:function(){var e;document.removeEventListener("keydown",this.onEscapeKey),null==(e=this.aiResearchTaskManager)||e.stop()}},eQ=(0,k.A)(eY,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ai-drawer-host"},[r("el-drawer",{staticClass:"ai-drawer",attrs:{visible:e.drawerVisible,"with-header":!1,direction:"rtl",size:"75%",modal:!1,"modal-append-to-body":!1},on:{"update:visible":function(t){e.drawerVisible=t},open:e.onDrawerOpen,close:e.onDrawerClose,closed:e.onDrawerClosed}},[r("div",{staticClass:"ai-drawer__header"},[r("tab-bar",{staticClass:"ai-drawer__tabs flex items_center",attrs:{options:e.aiResearchTabOptions,"selected-item":e.active,"mounted-type":!1,"is-new-version":!0},on:{selectedValue:e.handleTabChange}}),e._v(" "),r("div",{staticClass:"ai-drawer__actions flex items-center"},[r("span",{staticClass:"ai-drawer__esc-tip"},[e._v(e._s(e.$t("main.product.invent.ai.research.esc.tip")))]),e._v(" "),r("button",{staticClass:"ai-drawer__icon-btn",attrs:{type:"button","aria-label":e.$t("main.product.invent.ai.research.collapse")},on:{click:e.closeDrawer}},[r("i",{staticClass:"icon_sf_doubleleft_line"})]),e._v(" "),r("button",{staticClass:"ai-drawer__icon-btn",attrs:{type:"button","aria-label":e.$t("common.close")},on:{click:e.closeDrawer}},[r("i",{staticClass:"icon_sf_close"}
1)])])],1),e._v(" "),"research"===e.active?r("AiResearchForm",{attrs:{"mcp-services":e.mcpServices,"source-page":e.sourcePage,"report-generating":e.reportGenerating,"initial-form":e.researchFormPreset},on:{submit:e.submitAiResearch}}):r("AiResearchReport",{attrs:{loading:e.reportGenerating,report:e.researchReport,status:e.aiResearchTask?e.aiResearchTask.status:"","source-page":e.sourcePage,"show-sync-fields":e.showSyncFields,"show-refresh":e.showRefresh},on:{refresh:e.refreshReport,"sync-fields":e.syncFields}})],1)],1)},[],!1,null,"46836f39",null).exports},24270:function(e,t,r){r.d(t,{A:function(){return N}}),r(29855),r(915),r(5092),r(31731),r(21927),r(25962),r(48741),r(72860),r(18577),r(937),r(84503),r(77949);var n=r(80020),i=function(e,t){return n.Ay.post("".concat("/api/gw/sellfox/sellfox-purchase/sellfox/commodityImageSearch","/").concat(e),t)},a=r(75589);r(86201),r(95365),r(20767),r(33875),r(62394),r(99583),r(61114);var o=r(13339),s=r(66406),l=r(31835);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var d="srcPerformanceTag",p="srcShippingTag",h="srcInvoiceTag",f="vxe_table_header_tag",m={super_factory:"main.product.invent.alibaba.seller.super.factory",powerful_merchants:"main.product.invent.alibaba.seller.powerful.merchants",tp_member:"main.product.invent.alibaba.seller.tp.member"},v={shipIn24Hours:"main.product.invent.alibaba.ship.in.24.hours",shipIn48Hours:"main.product.invent.alibaba.ship.in.48.hours"},g={name:"Commodity1688Table",components:{FloatingInput:l.A},props:{rows:{type:Array,default:function(){return[]}},loading:Boolean,selectable:Boolean,readonly:Boolean,supplierLoading:Boolean,sortField:{type:String,default:""},sortOrder:{type:String,default:""}},data:function(){return{localSortField:"",localSortOrder:"",vxeTableGroupObj:new s.A({tagTop:4,tagInfo:{srcPerformanceTag:{name:this.$t("main.product.invent.alibaba.performance"),color:o.SM},srcShippingTag:{name:this.$t("main.product.invent.alibaba.shipping"),color:"#7B61FF"},srcInvoiceTag:{name:this.$t("main.product.invent.alibaba.invoice.info"),color:"#FFA91E"}}})}},computed:{groupHostClass:function(){return"c1688TableGroup-".concat(this._uid)},tableHeight:function(){return this.selectable?"100%":void 0},tableMaxHeight:function(){return this.selectable?void 0:520},rowConfig:function(){var e={keyField:"offerId"};return this.selectable&&(e.height=68),e},activeSortField:function(){return this.selectable?this.sortField:this.localSortField},activeSortOrder:function(){return this.selectable?this.sortOrder:this.localSortOrder},sortConfig:function(){var e,t,r=this.activeSortField&&this.activeSortOrder&&"null"!==this.activeSortOrder?{field:this.activeSortField,order:this.activeSortOrder}:void 0;return e=u({},this.$utils.sortIcon()),t=t={trigger:"cell",orders:this.$utils.getSortList(),remote:this.selectable,defaultSort:r,sortMethod:this.selectable?void 0:this.localSortMethod},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e},columns:function(){var e=this,t=this,r=function(r,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u({title:e.$t("main.product.invent.alibaba.".concat(r)),field:n,minWidth:i,resizable:!0,formatter:a.slots?void 0:function(e){var r=e.cellValue;return t.$utils.formatEmptyValue(r)}},a)},n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u({headerClassName:"".concat(f," ").concat(e)},t)},i=function(e,t){return{field:t,title:"",width:16,minWidth:16,resizable:!1,showOverflow:!1,headerClassName:"".concat(f," ").concat(e," c1688-group-gap"),className:"c1688-group-gap",formatter:function(){return""}}},a=[];return(this.selectable&&a.push({type:"checkbox",width:44,fixed:"left"}),a.push(r("image","imageUrl",220,{slots:{default:"product"}}),r("price","price",100,{sortable:!0,align:"left",slots:{default:"price"}}),r("supplier","companyName",200,{slots:{default:"supplier"}}),r("service.score","compositeServiceScore",100,{formatter:function(t){var r=t.cellValue;return e.scoreText(r)}}),i(d,"_performanceGap"),r("sales","monthSold",100,n(d,{sortable:!0,align:"right"})),r("repurchase.rate","repurchaseRate",100,n(d,{sortable:!0,align:"right"})),r("fulfillment.rate","perfectFulfillmentRate30d",100,n(d,{align:"right"})),r("pickup.short","pickupWithin24hRate30d",100,n(d,{align:"right"})),i(p,"_shippingGap"),r("shipping.time","shippingTimeGuarantee",100,n(p,{formatter:function(t){var r=t.cellValue;return e.shippingTimeText(r)}})),r("delayed.rate","delayedShippingRate7d",110,n(p,{align:"right"})),r("pickup.week","pickupWithin24hRate7d",120,n(p,{align:"right"})),r("shipping.address","sendGoodsAddress",100,n(p)),i(h,"_invoiceGap"),r("online.invoice","supportOnlineInvoice",100,n(h,{slots:{default:"support"}})),r("fast.invoice","supportFastInvoice",100,n(h,{slots:{default:"support"}})),r("invoice.types","invoiceTypes",100,n(h,{formatter:function(t){var r=t.cellValue;return e.invoiceTypesText(r)}}))),this.selectable)?a.push(r("operation","offerId",120,{fixed:"right",slots:{default:"add"}}
1)):(a.push(r("remark","remark",200,{slots:{default:"remark"},showOverflow:!1})),this.readonly||a.push(r("operation","id",70,{fixed:"right",slots:{default:"operation"}}))),a}},methods:{listedText:function(e){return null==e||""===e?"-":this.$t("main.product.invent.alibaba.listed.on",{date:e})},formatPrice:function(e){return null==e||""===e?"-":"\xa5".concat(e)},scoreText:function(e){return null==e||""===e?"-":"".concat(e).concat(this.$t("main.product.invent.alibaba.score.unit"))},sellerTags:function(e){var t=this;return(Array.isArray(e.sellerIdentities)?e.sellerIdentities:[]).map(function(e){return t.sellerIdentityText(e)}).filter(Boolean)},sellerIdentityText:function(e){var t=m[e];return t?this.$t(t):""},shippingTimeText:function(e){if(null==e||""===e)return"-";var t=v[e];return t?this.$t(t):this.$utils.formatEmptyValue(e)},invoiceTypesText:function(e){return Array.isArray(e)&&e.length?e.join(" / "):"-"},isDetailFieldLoading:function(e){return this.supplierLoading&&(null==e||""===e)},onRemarkInput:function(e,t){this.$set(e,"remark",t)},saveRemark:function(e){this.$emit("save-remark",e,e.remark)},getHeaderCellClassName:function(e){var t=e.column;return t.sortable&&t.field===this.activeSortField&&this.activeSortOrder&&"null"!==this.activeSortOrder?"sort_field ".concat(this.activeSortOrder):""},onSortChange:function(e){var t=e.property||e.field||"",r=e.order&&"null"!==e.order?e.order:"";this.selectable||(this.localSortField=r?t:"",this.localSortOrder=r),this.$emit("sort-change",e)},localSortMethod:function(e){var t=this,r=e.data,n=e.property,i=e.order;if(!i||"null"===i)return r;var a=((function(e){if(Array.isArray(e))return c(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e){if(e){if("string"==typeof e)return c(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,r){return t.compareSortValue(e[n],r[n])});return"desc"===i?a.reverse():a},compareSortValue:function(e,t){var r=null==e||""===e,n=null==t||""===t;if(r&&n)return 0;if(r)return 1;if(n)return -1;var i=this.toSortNumber(e),a=this.toSortNumber(t);return null!==i&&null!==a?i-a:String(e).localeCompare(String(t),"zh")},toSortNumber:function(e){if("number"==typeof e&&Number.isFinite(e))return e;var t=String(e).replace(/,/g,"").match(/-?\d+(?:\.\d+)?/);return t?Number(t[0]):null},isTableColumnReady:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$refs.grid;if(!e||"function"!=typeof e.getTableColumn)return!1;var t=e.getTableColumn();return Array.isArray(null==t?void 0:t.visibleColumn)},refreshGroupTag:function(){var e=this;this.$nextTick(function(){var t=e.$refs.grid;if(t){var r=function(n){if(!e._isDestroyed){if(e.isTableColumnReady(t)){e.vxeTableGroupObj.addTag(t,".addVxeTableGroupTag.".concat(e.groupHostClass)),e.vxeTableGroupObj.resizeHandle();return}n<3&&setTimeout(function(){return r(n+1)},100)}};setTimeout(function(){return r(0)},200)}})},onResizableChange:function(){this.isTableColumnReady()&&this.vxeTableGroupObj.resizeHandle()},onScroll:function(e){e.isX&&this.vxeTableGroupObj.scrollHandle()}},watch:{rows:{handler:function(){this.refreshGroupTag()},immediate:!0},selectable:function(){this.refreshGroupTag()},loading:function(e){e||this.refreshGroupTag()}},mounted:function(){this.refreshGroupTag()},beforeDestroy:function(){this.vxeTableGroupObj.removeAllTag()}},y=r(28644),_=(0,y.A)(g,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"c1688-table addVxeTableGroupTag",class:e.groupHostClass,attrs:{"element-loading-spinner":"icon_load_mid"}},[r("vxe-grid",{ref:"grid",staticClass:"table_standard vxe_table_padding",attrs:{columns:e.columns,data:e.rows,round:"","row-id":"offerId","column-config":{resizable:!0},"row-config":e.rowConfig,"checkbox-config":{reserve:!0},"sort-config":e.sortConfig,"header-cell-class-name":e.getHeaderCellClassName,height:e.tableHeight,"max-height":e.tableMaxHeight,"auto-resize":"","show-header-overflow":"tooltip","tooltip-config":{theme:"light"}},on:{"checkbox-change":function(t){return e.$emit("selection-change")},"checkbox-all":function(t){return e.$emit("selection-change")},"sort-change":e.onSortChange,"resizable-change":e.onResizableChange,scroll:e.onScroll},scopedSlots:e._u([{key:"product",fn:function(t){var n=t.row;return[r("div",{staticClass:"flex"},[n.imageUrl?r("img",{staticClass:"c1688-image",attrs:{src:n.imageUrl,alt:""}}
1):e._e(),e._v(" "),r("div",{staticClass:"c1688-product"},[n.detailUrl?r("a",{directives:[{name:"tooltip",rawName:"v-tooltip:light.isShow",value:n.subject,expression:"row.subject",arg:"light",modifiers:{isShow:!0}}],staticClass:"link_text c1688-title",attrs:{href:n.detailUrl,target:"_blank",rel:"noopener noreferrer"}},[e._v(e._s(e._f("empty")(n.subject)))]):r("span",{directives:[{name:"tooltip",rawName:"v-tooltip:light.isShow",value:n.subject,expression:"row.subject",arg:"light",modifiers:{isShow:!0}}],staticClass:"c1688-title"},[e._v(e._s(e._f("empty")(n.subject)))]),e._v(" "),r("div",{staticClass:"f_gray"},[e._v(e._s(e.listedText(n.onlineTime)))]),e._v(" "),r("div",{staticClass:"c1688-tag-list"},[n.selectedSource?r("span",{staticClass:"c1688-tag"},[e._v(e._s(e.$t("main.product.invent.alibaba.selected.source")))]):e._e(),e._v(" "),n.dropshipping?r("span",{staticClass:"c1688-tag"},[e._v(e._s(e.$t("main.product.invent.alibaba.dropshipping")))]):e._e()])])])]}},{key:"price",fn:function(t){var n=t.row;return[r("div",[e._v(e._s(e.formatPrice(n.price)))]),e._v(" "),r("div",{staticClass:"f_gray"},[e._v(e._s(e.$t("main.product.invent.alibaba.min.order",{count:n.minOrderQuantity||0})))])]}},{key:"supplier",fn:function(t){var n=t.row;return[r("div",{staticClass:"line_clamp"},[e.isDetailFieldLoading(n.companyName)?r("i",{staticClass:"el-icon-loading c1688-supplier-loading"}):[e._v(e._s(e._f("empty")(n.companyName)))]],2),e._v(" "),r("div",{staticClass:"f_gray line_clamp"},[[e._v(e._s(e._f("empty")(n.companyAddress)))]],2),e._v(" "),e.sellerTags(n).length?r("div",{staticClass:"c1688-tag-list"},e._l(e.sellerTags(n),function(t){return r("span",{key:t,staticClass:"c1688-tag"},[e._v(e._s(t))])}),0):e.supplierLoading?r("i",{staticClass:"el-icon-loading c1688-supplier-loading"}):e._e()]}},{key:"support",fn:function(t){return[t.row[t.column.field]?r("span",{staticClass:"c1688-support"},[r("i",{staticClass:"icon_sf_right"}),e._v(e._s(e.$t("main.product.invent.alibaba.supported"))+"\n        ")]):r("span",{staticClass:"c1688-support"},[r("i",{staticClass:"icon_sf_close"}),e._v(e._s(e.$t("main.product.invent.alibaba.unsupported"))+"\n        ")])]}},{key:"remark",fn:function(t){var n=t.row;return[e.readonly?r("span",{staticClass:"line_clamp"},[e._v(e._s(e._f("empty")(n.remark)))]):r("FloatingInput",{staticClass:"c1688-remark",attrs:{value:n.remark,maxlength:500,width:"160px",placeholder:e.$t("common.please.enter")},on:{input:function(t){return e.onRemarkInput(n,t)},change:function(t){return e.saveRemark(n)}}})]}},{key:"add",fn:function(t){var n=t.row;return[r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.$emit("add",n)}}},[e._v(e._s(e.$t("main.product.invent.alibaba.add.one")))])]}},{key:"operation",fn:function(t){var n=t.row;return[r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.$emit("remove",n)}}},[e._v(e._s(e.$t("common.remove")))])]}}])})],1)},[],!1,null,"61114526",null).exports;r(84579),r(5411),r(27471),r(46491),r(47424),r(59622),r(25259);var b=r(10961),w=r(52854),k=r(2576),S=r(20368),C="product_invent_alibaba_image_search_add",O="alibaba_module";function $(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function I(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){$(a,n,i,o,s,"next",e)}function s(e){$(a,n,i,o,s,"throw",e)}o(void 0)})}}function R(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var P=/\.(jpe?g|png|gif|webp)(?:[._]|$)/i;function x(e){if(!e||"string"!=typeof e)return!1;try{var t=new URL(e.trim());if(!["http:","https:"].includes(t.protocol)||!t.hostname)return!1;return P.test(t.pathname)}catch(e){return!1}}var T=[{value:"totalEpScoreLv1",labelKey:"main.product.invent.alibaba.score.five"},{value:"totalEpScoreLv2",labelKey:"main.product.invent.alibaba.score.four.five.to.five"},{value:"totalEpScoreLv3",labelKey:"main.product.invent.alibaba.score.four.to.four.five"},{value:"totalEpScoreLv4",labelKey:"main.product.invent.alibaba.score.below.four"}],A={price:"price",monthSold:"monthSold",repurchaseRate:"rePurchaseRate"},j={name:"Commodity1688SearchDialog",components:{Commodity1688Table:_,Pagination:k.A,Empty:b.A,SfSelect:w.A},props:{visible:Boolean,existingCount:{type:Number,default:0},existingOfferIds:{type:Array,default:function(){return[]}},presetImageUrl:{type:String,default:""},sourcePage:{type:String,default:"create"},entry:{type:String,default:""}},data:function(){return{dialogVisible:this.visible,loading:!1,imageId:"",imageUrl:"",urlInput:"",sourceType:"",rows:[],hasSearched:!1,selectedMap:{},scoreFilter:"",filters:{isOnePsale:!1,noReason7DReturn:!1},sortField:"",sortOrder:"desc",query:{priceStart:"",priceEnd:""},paginator:{currentPage:1,pageSize:20,totalResult:0},hasUploadedInSession:!1,searchRequestId:0,detailRequestId:0,supplierLoading:!1}},computed:{selectedRows:function(){return Object.values(this.selectedMap)},isImageMode:function(){return"image"===this.sourceType&&!!(this.imageId||this.imageUrl)},isUrlMode:function(){return!this.isImageMode&&!!this.urlInput},isSourceActive:function(){return this.isImageMode||this.isUrlMode},previewImageUrl:function(){return this.imageUrl||""},scoreOptions:function(){var e=this;return T.map(function(t){return{value:t.value,label:e.$t(t.labelKey)}})}},watch:{visible:function(e){this.dialogVisible=e,e&&(this.resetForOpen(),this.hasUploadedInSession=!1,this.applyPresetImage())},dialogVisible:function(e){this.$emit("update:visible",e)},"$route.fullPath":function(){this.closeDialog()}},mounted:function(){this.visible&&(this.resetForOpen(),this.hasUploadedInSession=!1,this.applyPresetImage())},deactivated:function(){this.closeDialog()},beforeDestroy:function(){this.closeDialog()},methods:{resetForOpen:function(){this.clearSource(),this.resetSearchFilters()},resetSearchFilters:function(){this.filters={isOnePsale:!1,noReason7DReturn:!1},this.scoreFilter="",this.sortField="",this.sortOrder="desc",this.query={priceStart:"",priceEnd:""}},applyPresetImage:function(){var e=this,t=(this.presetImageUrl||"").trim();t&&(this.clearSource(),this.imageUrl=t,this.urlInput=t,this.sourceType="image",this.handleSearch({auto:!0}).catch(function(t){return e.$message.handle(t)}))},uploadLocalImage:function(e){return I(function(){var t,r,n,i;return R(this,function(a){switch(a.label){case 0:if(t=e&&e.name?e.name:"",!/\.(jpeg|jpg|png|gif|webp)$/i.test(t))return this.$message.error(this.$t("main.product.invent.alibaba.invalid.image.format")),[2];r=this.searchRequestId,this.loading=!0,a.label=1;case 1:return a.trys.push([1,5,6,7]),[4,(0,S.yt)(e.raw,{onItemSuccess:function(e,t){n=t}}
1)];case 2:return a.sent(),[4,this.exchangeImageId(n.fileId,"image")];case 3:return a.sent(),this.resetSearchFilters(),[4,this.searchFromFirst()];case 4:return a.sent(),[3,7];case 5:return i=a.sent(),this.$message.handle(i),[3,7];case 6:return this.searchRequestId===r&&(this.loading=!1),[7];case 7:return[2]}})}).call(this)},uploadUrlImage:function(){return I(function(){var e,t,r,n,i,a,o,s=arguments;return R(this,function(l){switch(l.label){case 0:if(e=this,r=void 0===(t=(s.length>0&&void 0!==s[0]?s[0]:{}).report)||t,!x(this.urlInput))return this.$message.error(this.$t("main.product.invent.alibaba.invalid.image.url")),[2];l.label=1;case 1:return l.trys.push([1,4,,5]),i=this.urlInput,[4,(0,S.Kv)(i,function(t){return e.$http.requiceUploadImageUrl({scopeName:(0,S.OK)(!0),cosTypeName:"commodity_pic",imgUrl:t.fileUrl})},{onItemSuccess:function(e,t){n=t},onError:function(t){return e.$message.error(t)}})];case 2:if(l.sent(),!(a=n&&(n.fileId||n.cosKey)))throw Error(this.$t("main.product.invent.alibaba.image.file.id.missing"));return[4,this.exchangeImageId(a,"url",{report:r})];case 3:return l.sent(),[3,5];case 4:return o=l.sent(),this.$message.handle(o),[3,5];case 5:return[2]}})}).apply(this,arguments)},reportUpload:function(e){var t=this.hasUploadedInSession,r={source_page:this.sourcePage,entry:this.entry,source_type:e};t?((0,a.vr)("product_invent_alibaba_image_search_replace","click",r),(0,a.vr)("image"===e?"product_invent_alibaba_image_search_replace_local":"product_invent_alibaba_image_search_replace_url","click",r)):((0,a.vr)("product_invent_alibaba_image_search_upload","click",r),(0,a.vr)("image"===e?"product_invent_alibaba_image_search_upload_local":"product_invent_alibaba_image_search_upload_url","click",r)),this.hasUploadedInSession=!0},exchangeImageId:function(e,t){return I(function(e,t){var r,n,a,o=arguments;return R(this,function(s){switch(s.label){case 0:return n=void 0===(r=(o.length>2&&void 0!==o[2]?o[2]:{}).report)||r,[4,i("upload1688Image",{fileId:e})];case 1:if(!(a=s.sent())||!a.imageId)throw Error(this.$t("main.product.invent.alibaba.image.file.id.missing"));return n&&this.reportUpload(t),this.imageId=a.imageId,this.imageUrl=a.imageUrl||this.imageUrl,this.sourceType=this.imageUrl?"image":t,"image"===this.sourceType&&(this.urlInput=""),this.clearSelection(),this.rows=[],this.hasSearched=!1,[2]}})}).apply(this,arguments)},buildFilters:function(){var e=this,t=Object.keys(this.filters).filter(function(t){return e.filters[t]});return this.scoreFilter&&t.unshift(this.scoreFilter),t},handleSearch:function(){return I(function(){var e,t,r,n=arguments;return R(this,function(i){switch(i.label){case 0:if(t=void 0!==(e=(n.length>0&&void 0!==n[0]?n[0]:{}).auto)&&e,!this.imageId&&(this.urlInput||this.imageUrl)&&(!this.urlInput&&this.imageUrl&&(this.urlInput=this.imageUrl),!x(this.urlInput)))return this.$message.error(this.$t("main.product.invent.alibaba.invalid.image.url")),[2];this.resetSearchFilters(),r=this.searchRequestId,this.loading=!0,i.label=1;case 1:if(i.trys.push([1,,6,7]),!(!this.imageId&&(this.urlInput||this.imageUrl)))return[3,3];return!this.urlInput&&this.imageUrl&&(this.urlInput=this.imageUrl),[4,this.uploadUrlImage({report:!t})];case 2:i.sent(),i.label=3;case 3:if(!this.imageId)return[3,5];return[4,this.searchFromFirst()];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:return this.searchRequestId===r&&(this.loading=!1),[7];case 7:return[2]}})}).apply(this,arguments)},searchFromFirst:function(){return I(function(){return R(this,function(e){switch(e.label){case 0:return this.clearSelection(),this.paginator.currentPage=1,this.hasSearched=!0,[4,this.loadData()];case 1:return e.sent(),[2]}})}).call(this)},refreshSearch:function(){this.clearSelection(),this.loadData()},clearSelection:function(){this.selectedMap={};var e,t,r,n,i=null==(t=this.$refs.table)||null==(e=t.$refs)?void 0:e.grid;null==i||null==(r=i.clearCheckboxReserve)||r.call(i),null==i||null==(n=i.clearCheckboxRow)||n.call(i)},loadData:function(){return I(function(){var e,t,r;return R(this,function(n){switch(n.label){case 0:if(!this.imageId)return[2];this.searchRequestId+=1,e=this.searchRequestId,this.loading=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,i("search1688Commodity",{imageId:this.imageId,beginPage:this.paginator.currentPage,pageSize:this.paginator.pageSize,priceStart:this.query.priceStart||void 0,priceEnd:this.query.priceEnd||void 0,filters:this.buildFilters(),sortField:this.sortField?A[this.sortField]||this.sortField:void 0,sortOrder:this.sortField?this.sortOrder:void 0})];case 2:if(t=n.sent(),e!==this.searchRequestId)return[2];return this.rows=t.rows||[],this.paginator={currentPage:t.pageNo||1,pageSize:t.pageSize||20,totalResult:t.totalSize||0},this.$nextTick(this.restoreSelection),this.loadDetails(),[3,5];case 3:return r=n.sent(),e===this.searchRequestId&&this.$message.handle(r),[3,5];case 4:return e===this.searchRequestId&&(this.loading=!1),[7];case 5:return[2]}})}).call(this)},clearSource:function(){this.searchRequestId+=1,this.detailRequestId+=1,this.imageId="",this.imageUrl="",this.urlInput="",this.sourceType="",this.rows=[],this.clearSelection(),this.hasSearched=!1,this.paginator={currentPage:1,pageSize:20,totalResult:0},this.supplierLoading=!1},loadDetails:function(){return I(function(){var e,t,r,n;return R(this,function(a){switch(a.label){case 0:if(e=this.rows.map(function(e){return e.offerId}
1).filter(Boolean),this.detailRequestId+=1,t=this.detailRequestId,!e.length)return this.supplierLoading=!1,[2];this.supplierLoading=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,i("query1688CommodityDetail",{offerIds:e})];case 2:if(r=a.sent(),t!==this.detailRequestId)return[2];return n=(r||[]).reduce(function(e,t){return e[t.offerId]=t,e},{}),this.rows=this.rows.map(function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,n[e.offerId]||{})}),[3,5];case 3:return a.sent(),[3,5];case 4:return t===this.detailRequestId&&(this.supplierLoading=!1),[7];case 5:return[2]}})}).call(this)},restoreSelection:function(){var e=this;this.rows.forEach(function(t){e.selectedMap[t.offerId]&&e.$refs.table.$refs.grid.setCheckboxRow(t,!0)})},syncSelection:function(){var e=this;this.$nextTick(function(){var t,r=e.$refs.table.$refs.grid,n=((null==(t=r.getCheckboxReserveRecords)?void 0:t.call(r))||[]).concat(r.getCheckboxRecords());new Set(e.rows.map(function(e){return e.offerId})).forEach(function(t){return e.$delete(e.selectedMap,t)}),n.forEach(function(t){return e.$set(e.selectedMap,t.offerId,t)})})},pageChange:function(e){var t=e.currentPage,r=e.pageSize;this.paginator.currentPage=t,this.paginator.pageSize=r,this.loadData()},handleSortChange:function(e){var t=e.property,r=e.field,n=e.order,i=n&&"null"!==n;this.sortField=i?t||r:"",this.sortOrder=i?n:"desc",this.searchFromFirst()},remainingCount:function(e){var t=new Set((this.existingOfferIds||[]).map(function(e){return String(e)})),r=e.filter(function(e){return e.offerId&&!t.has(String(e.offerId))}).length;return Math.max(20-this.existingCount,0)-r},addOne:function(e){0>this.remainingCount([e])?this.$message.error(this.$t("main.product.invent.alibaba.limit",{count:Math.max(20-this.existingCount,0)})):((0,a.vr)(C,"click",{source_page:this.sourcePage,entry:this.entry,selected_count:1}),this.$emit("confirm",[e]))},confirmSelection:function(){0>this.remainingCount(this.selectedRows)?this.$message.error(this.$t("main.product.invent.alibaba.limit",{count:Math.max(20-this.existingCount,0)})):((0,a.vr)(C,"click",{source_page:this.sourcePage,entry:this.entry,selected_count:this.selectedRows.length}),this.$emit("confirm",this.selectedRows,this.closeDialog))},closeDialog:function(){this.dialogVisible=!1}}},F=(0,y.A)(j,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{staticClass:"c1688-search-dialog",attrs:{"custom-class":"c1688-search-dialog__content",visible:e.dialogVisible,title:e.$t("main.product.invent.alibaba.image.search"),width:"100%","append-to-body":"",modal:!1,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t},closed:function(t){return e.$emit("update:visible",!1)}}},[r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"c1688-search",attrs:{"element-loading-spinner":"icon_load_big"}},[r("div",{staticClass:"search-wrap"},[r("div",{staticClass:"c1688-search__source",class:{"is-active":e.isSourceActive}},[e.isUrlMode?e._e():r("el-upload",{staticClass:"c1688-search__upload",attrs:{action:"","show-file-list":!1,"auto-upload":!1,accept:".jpeg,.jpg,.png,.gif,.webp","on-change":e.uploadLocalImage}}
1,[r("div",{staticClass:"c1688-search__upload-card",class:{"is-preview":e.isImageMode}},[e.isImageMode?r("img",{attrs:{src:e.previewImageUrl,alt:""}}):r("i",{staticClass:"icon_sf_add"}),e._v(" "),e.isImageMode?r("button",{staticClass:"c1688-search__image-clear",attrs:{type:"button",title:e.$t("common.close")},on:{click:function(t){return t.stopPropagation(),e.clearSource.apply(null,arguments)}}},[r("i",{staticClass:"icon_sf_close_fill"})]):e._e()])]),e._v(" "),e.isImageMode?r("div",{staticClass:"c1688-search__source-spacer"}):e._e(),e._v(" "),e.isImageMode?e._e():r("div",{staticClass:"c1688-search__source-value"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.urlInput,expression:"urlInput",modifiers:{trim:!0}}],attrs:{type:"text",placeholder:e.$t("main.product.invent.alibaba.upload.image.or.url")},domProps:{value:e.urlInput},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSearch.apply(null,arguments)},input:function(t){t.target.composing||(e.urlInput=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),e.isUrlMode?r("button",{staticClass:"c1688-search__clear",attrs:{type:"button",title:e.$t("common.close")},on:{click:e.clearSource}},[r("i",{staticClass:"icon_sf_close"})]):e._e()]),e._v(" "),r("el-button",{attrs:{type:"primary",disabled:!e.isSourceActive,loading:e.loading},on:{click:e.handleSearch}},[e._v(e._s(e.$t("common.search")))])],1)]),e._v(" "),e.hasSearched?r("div",{staticClass:"c1688-search__toolbar"},[r("el-button",{attrs:{type:"primary",disabled:!e.selectedRows.length},on:{click:e.confirmSelection}},[e._v("\n                "+e._s(e.$t("main.product.invent.alibaba.batch.add"))+"\n            ")]),e._v(" "),r("div",{staticClass:"c1688-search__filters"},[r("el-checkbox",{on:{change:e.searchFromFirst},model:{value:e.filters.isOnePsale,callback:function(t){e.$set(e.filters,"isOnePsale",t)},expression:"filters.isOnePsale"}},[e._v(e._s(e.$t("main.product.invent.alibaba.dropshipping")))]),e._v(" "),r("el-checkbox",{on:{change:e.searchFromFirst},model:{value:e.filters.noReason7DReturn,callback:function(t){e.$set(e.filters,"noReason7DReturn",t)},expression:"filters.noReason7DReturn"}},[e._v(e._s(e.$t("main.product.invent.alibaba.return.seven.days")))]),e._v(" "),r("div",{staticClass:"c1688-search__price-range"},[r("span",{staticClass:"c1688-search__price-prefix"},[e._v("\xa5")]),e._v(" "),r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.query.priceStart,expression:"query.priceStart",modifiers:{trim:!0}}],attrs:{type:"text",placeholder:e.$t("main.product.invent.alibaba.min.price")},domProps:{value:e.query.priceStart},on:{change:e.searchFromFirst,input:function(t){t.target.composing||e.$set(e.query,"priceStart",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),r("span",{staticClass:"c1688-search__price-sep"},[e._v("~")]),e._v(" "),r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.query.priceEnd,expression:"query.priceEnd",modifiers:{trim:!0}}],attrs:{type:"text",placeholder:e.$t("main.product.invent.alibaba.max.price")},domProps:{value:e.query.priceEnd},on:{change:e.searchFromFirst,input:function(t){t.target.composing||e.$set(e.query,"priceEnd",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),e._e(),e._v(" "),r("i",{staticClass:"c1688-search__refresh icon_sf_rotate",attrs:{icon:"el-icon-refresh-right"},on:{click:e.refreshSearch}})],1)],1):e._e(),e._v(" "),e.hasSearched?[r("div",{staticClass:"c1688-search__result"},[r("Commodity1688Table",{ref:"table",attrs:{rows:e.rows,"supplier-loading":e.supplierLoading,selectable:"","sort-field":e.sortField,"sort-order":e.sortOrder},on:{"selection-change":e.syncSelection,"sort-change":e.handleSortChange,add:e.addOne}}),e._v(" "),r("div",{staticClass:"c1688-search__footer"},[r("span",[e._v(e._s(e.$t("main.product.invent.alibaba.selected.count",{count:e.selectedRows.length})))]),e._v(" "),r("Pagination",{attrs:{paginator:e.paginator,"custom-pager-sizes":[20]},on:{"page-change":e.pageChange}})],1)],1)]:r("div",{staticClass:"c1688-search__empty"},[r("Empty",{attrs:{description:e.$t("common.no.data")}})],1)],2)])},[],!1,null,"5daa0bac",null).exports;function D(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function E(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){D(a,n,i,o,s,"next",e)}function s(e){D(a,n,i,o,s,"throw",e)}o(void 0)})}}function V(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var N=(0,y.A)({name:"Commodity1688Panel",components:{Commodity1688Table:_,Commodity1688SearchDialog:F},props:{developmentNo:{type:String,default:""},readonly:Boolean,sourcePage:{type:String,default:"create"}},data:function(){return{rows:[],pendingRows:[],searchVisible:!1,presetImageUrl:"",searchEntry:O,loading:!1,activeDevelopmentNo:this.developmentNo,loadRequestId:0}},watch:{developmentNo:{handler:function(e){this.activeDevelopmentNo=e,e?this.loadData():(this.loadRequestId+=1,this.rows=this.pendingRows.slice())},immediate:!0},"$route.fullPath":function(){this.searchVisible=!1}},deactivated:function(){this.searchVisible=!1},computed:{existingOfferIds:function(){return this.rows.map(function(e){return e.offerId}
1).filter(Boolean)}},methods:{reportOpen:function(e){(0,a.vr)("product_invent_alibaba_image_search_click","click",{source_page:this.sourcePage,entry:e})},openSearch:function(){this.searchEntry=O,this.presetImageUrl="",this.reportOpen(this.searchEntry),this.searchVisible=!0},openSearchWithImage:function(e){this.searchEntry="commodity_image",this.presetImageUrl=e||"",this.reportOpen(this.searchEntry),this.searchVisible=!0},loadData:function(){return E(function(){var e,t,r;return V(this,function(n){switch(n.label){case 0:if(!this.activeDevelopmentNo)return[2,!1];this.loadRequestId+=1,e=this.loadRequestId,this.loading=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,i("pageByDevelopmentNo",{developmentNo:this.activeDevelopmentNo,pageNo:1,pageSize:20})];case 2:if(t=n.sent(),e!==this.loadRequestId)return[2,!0];return this.rows=t.rows||[],[2,!0];case 3:return r=n.sent(),this.$message.handle(r),[2,!1];case 4:return e===this.loadRequestId&&(this.loading=!1),[7];case 5:return[2]}})}).call(this)},addRows:function(e,t){return E(function(e,t){var r,n,a,o,s,l,c,u,d=arguments;return V(this,function(p){switch(p.label){case 0:if(r=this,a=void 0!==(n=(d.length>2&&void 0!==d[2]?d[2]:{}).silent)&&n,o=function(){a||r.$message.success(r.$t("common.add.success"))},!this.activeDevelopmentNo){if(l=new Set(Object.keys(s=this.pendingRows.reduce(function(e,t){return e[t.offerId]=t,e},{})).map(String)),c=e.filter(function(e){return e.offerId&&!l.has(String(e.offerId))}).length,l.size+c>20)return this.$message.error(this.$t("main.product.invent.alibaba.limit",{count:Math.max(20-l.size,0)})),[2];return e.forEach(function(e){s[e.offerId]=e}),this.setPendingRows(Object.values(s)),o(),"function"==typeof t&&t(),[2,!0]}this.loading=!0,p.label=1;case 1:return p.trys.push([1,4,5,6]),[4,i("sync1688Commity",{developmentNo:this.activeDevelopmentNo,offers:e})];case 2:return p.sent(),[4,this.loadData()];case 3:if(!p.sent())return[2,!1];return o(),"function"==typeof t&&t(),[2,!0];case 4:return u=p.sent(),this.$message.handle(u),[2,!1];case 5:return this.loading=!1,[7];case 6:return[2]}})}).apply(this,arguments)},syncPending:function(e){return E(function(){var t;return V(this,function(r){switch(r.label){case 0:if(!this.pendingRows.length)return[2,!0];if(!e)return this.$message.error(this.$t("common.save.failed")),[2,!1];return this.activeDevelopmentNo=e,[4,this.addRows(this.pendingRows,void 0,{silent:!0})];case 1:return(t=r.sent())&&(this.pendingRows=[]),[2,t]}})}).call(this)},saveRemark:function(e,t){return E(function(){var r;return V(this,function(n){switch(n.label){case 0:if(!this.activeDevelopmentNo||!e.id)return this.$set(e,"remark",t),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,i("update1688CommodityRemark",{id:e.id,remark:t})];case 2:return n.sent(),this.$set(e,"remark",t),[3,4];case 3:return r=n.sent(),this.$message.handle(r),[3,4];case 4:return[2]}})}).call(this)},setPendingRows:function(e){this.pendingRows=e,this.rows=e,this.$emit("pending-change",this.pendingRows)},removeRow:function(e){return E(function(){var t;return V(this,function(r){switch(r.label){case 0:if(!e.id)return this.setPendingRows(this.pendingRows.filter(function(t){return t.offerId!==e.offerId})),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i("remove1688Commodity",{id:e.id})];case 2:return r.sent(),this.rows=this.rows.filter(function(t){return t.id!==e.id}),this.$message.success(this.$t("main.product.invent.alibaba.remove.success")),[3,4];case 3:return t=r.sent(),this.$message.handle(t),[3,4];case 4:return[2]}})}).call(this)}}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("section",{staticClass:"c1688-panel"},[r("div",{staticClass:"c1688-panel__toolbar"},[e.readonly?e._e():r("el-button",{attrs:{type:"primary"},on:{click:e.openSearch}},[e._v("\n            "+e._s(e.$t("main.product.invent.alibaba.image.search"))+"\n        ")])],1),e._v(" "),r("Commodity1688Table",{attrs:{rows:e.rows,readonly:e.readonly,loading:e.loading},on:{"save-remark":e.saveRemark,remove:e.removeRow}}),e._v(" "),r("Commodity1688SearchDialog",{attrs:{visible:e.searchVisible,"preset-image-url":e.presetImageUrl,"existing-count":e.rows.length,"existing-offer-ids":e.existingOfferIds,"source-page":e.sourcePage,entry:e.searchEntry},on:{"update:visible":function(t){e.searchVisible=t},confirm:e.addRows}})],1)},[],!1,null,"0382cc1d",null).exports},54955:function(e,t,r){r.d(t,{A:function(){return o}}),r(915),r(5092),r(10327),r(21927),r(48741),r(72860),r(75038),r(67411),r(95365),r(31731);var n=r(28644);function i(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}var a={name:"NavCard",components:{NavCardTab:(0,n.A)({name:"NavCardTab",props:{label:String,active:{type:Boolean,default:!1},line:{type:Boolean,default:!1},error:{type:Boolean,default:!1}},emits:["click"],methods:{onClick:function(){this.$emit("click")}}},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"nc-nav-node"}
1,[t("div",{staticClass:"nc-nav-node-desc",class:{error:this.error,"is-error":this.error,active:this.active},on:{click:this.onClick}},[t("div",{staticClass:"nc-nav-node-desc-status"}),this._v(" "),t("div",{staticClass:"nc-nav-node-desc-title"},[this._v(this._s(this.label))])]),this._v(" "),this.line?t("div",{staticClass:"nc-nav-node-line"}):this._e()])},[],!1,null,"36849df8",null).exports},props:{},data:function(){return{cardContainer:[],currentTab:""}},provide:function(){return{installCard:this.addCard,unInstallCard:this.delCard}},methods:{validate:function(){var e;return(e=function(){var e;return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:return[4,Promise.all(this.cardContainer.map(function(e){return e.validate()}))];case 1:if(e=t.sent().find(function(e){return!e.valid}))return this.$message.error(e.message),[2,!1];return[2,!0]}})},function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function s(e){i(o,n,a,s,l,"next",e)}function l(e){i(o,n,a,s,l,"throw",e)}s(void 0)})}).call(this)},addCard:function(e){this.cardContainer.findIndex(function(t){return t.key===e.key})>-1||(this.cardContainer.push(e),this.cardContainer.sort(function(e,t){return e.sort-t.sort}),1===this.cardContainer.length&&(this.currentTab=e.key))},delCard:function(e){this.cardContainer=this.cardContainer.filter(function(t){return t.key!==e})},scrollHandler:r(94768).Ay.debounce(function(e){for(var t=e.target.scrollTop,r=this.cardContainer.length-1;r>=0;r--){var n=this.cardContainer[r],i=n.host.offsetTop-12;if(t===i){this.currentTab=n.key;break}if(t>i){this.currentTab=this.cardContainer[r+1].key;break}}},300),scrollTargetNode:function(e){var t=e.host.offsetTop-12;this.$refs.cardContainerRef.scrollTo({top:t,behavior:"smooth"}),this.currentTab=e.key}}},o=(0,n.A)(a,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("section",{staticClass:"nc"},[r("aside",{staticClass:"nc-nav"},e._l(e.cardContainer,function(t,n){return r("NavCardTab",{key:n,attrs:{label:t.title,active:t.key===e.currentTab,error:t.error,line:n!==e.cardContainer.length-1},on:{click:function(r){return e.scrollTargetNode(t)}}})}),1),e._v(" "),r("article",{ref:"cardContainerRef",staticClass:"nc-card",on:{scroll:function(t){return e.scrollHandler(t)}}},[e._t("default")],2)])},[],!1,null,"21101ed0",null).exports},66182:function(e,t,r){function n(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}r.d(t,{A:function(){return i}}),r(20767),r(95365);var i=(0,r(28644).A)({name:"NavCardItem",props:{title:String,uniqueKey:[String,Number],sort:{type:Number,default:1}},inject:["installCard","unInstallCard"],provide:function(){return{navCardItem:this}},data:function(){return this.formSlot=null,{context:{}}},mounted:function(){var e=this;this.context={key:this.uniqueKey,title:this.title,host:this.$refs.hostRef,error:!1,sort:this.sort,setValid:function(t){return e.setValid(t)},validate:function(){return e.validate()}},this.installCard(this.context)},methods:{validate:function(){var e;return(e=function(){return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){return this.formSlot?[2,this.formSlot.validate()]:[2,{valid:!0}]})},function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,l,"next",e)}function l(e){n(o,i,a,s,l,"throw",e)}s(void 0)})}).call(this)},addFormSlot:function(e){this.formSlot=e},delFormSlot:function(){this.formSlot=null},setValid:function(e){this.context.error=!e}},destroyed:function(){this.unInstallCard(this.uniqueKey)}},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"hostRef",staticClass:"nci"},[r("header",{staticClass:"nci-header"},[r("div",{staticClass:"nci-header-title"},[e._t("title",function(){return[e._v(e._s(e.title))]})],2)]),e._v(" "),r("article",{staticClass:"nci-body"},[e._t("default")],2)])},[],!1,null,"1072ee46",null).exports},60446:function(e,t,r){e.exports=r.p+"51969b36e1f66cf2.svg"},42439:function(e,t,r){r.d(t,{FH:function(){return u},RG:function(){return d},Sf:function(){return c},XG:function(){return h},dD:function(){return p},gk:function(){return s},pl:function(){return o},sd:function(){return l},wX:function(){return a}}),r(46491),r(20767),r(33875),r(62394),r(13951),r(915),r(5092),r(31731),r(21927),r(25962),r(48741),r(72860),r(99583),r(937);var n=r(30799);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}
1var a=[{cn:(0,n.Tl)("main.tools.chat.gpt.language.english"),code:"en_US"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.chinese"),code:"zh_CN"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.japanese"),code:"ja"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.portuguese"),code:"pt"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.spanish"),code:"es"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.german"),code:"de"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.french"),code:"fr"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.italian"),code:"it"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.dutch"),code:"nl"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.turkish"),code:"tr"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.arabic"),code:"ar"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.polish"),code:"pl"},{cn:(0,n.Tl)("main.tools.chat.gpt.language.swedish"),code:"sv"}],o=[{cn:(0,n.Tl)("main.tools.chat.gpt.site.united.states"),code:"ATVPDKIKX0DER"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.japan"),code:"A1VC38T7YXB528"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.canada"),code:"A2EUQ1WTGCTBG2"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.sweden"),code:"A2NODRKZP88ZB9"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.mexico"),code:"A1AM78C64UM0Y8"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.united.kingdom"),code:"A1F83G8C2ARO7P"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.germany"),code:"A1PA6795UKMFR9"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.france"),code:"A13V1IB3VIYZZH"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.spain"),code:"A1RKKUPIHCS9HS"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.italy"),code:"APJ6JRA9NG5V4"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.netherlands"),code:"A1805IZSGTT6HS"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.singapore"),code:"A19VAU5U5O7RUS"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.australia"),code:"A39IBJ37TRP1C6"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.saudi.arabia"),code:"A17E79C6D8DWNP"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.uae"),code:"A2VIGQ35RCS4UG"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.belgium.dutch"),code:"AMEN7PMS3EDWL,Dutch"},{cn:(0,n.Tl)("main.tools.chat.gpt.site.belgium.french"),code:"AMEN7PMS3EDWL,French"}],s=[{label:(0,n.Tl)("main.tools.chat.gpt.country.united.states"),value:"1"},{label:(0,n.Tl)("main.tools.chat.gpt.country.united.kingdom"),value:"2"},{label:(0,n.Tl)("main.tools.chat.gpt.country.germany"),value:"3"},{label:(0,n.Tl)("main.tools.chat.gpt.country.france"),value:"4"},{label:(0,n.Tl)("main.tools.chat.gpt.country.japan"),value:"5"},{label:(0,n.Tl)("main.tools.chat.gpt.country.canada"),value:"6"},{label:(0,n.Tl)("main.tools.chat.gpt.country.italy"),value:"8"},{label:(0,n.Tl)("main.tools.chat.gpt.country.spain"),value:"9"},{label:(0,n.Tl)("main.tools.chat.gpt.country.india"),value:"10"},{label:(0,n.Tl)("main.tools.chat.gpt.country.uae"),value:"11"},{label:(0,n.Tl)("main.tools.chat.gpt.country.sweden"),value:"12"},{label:(0,n.Tl)("main.tools.chat.gpt.country.saudi.arabia"),value:"13"},{label:(0,n.Tl)("main.tools.chat.gpt.country.brazil"),value:"14"},{label:(0,n.Tl)("main.tools.chat.gpt.country.mexico"),value:"16"},{label:(0,n.Tl)("main.tools.chat.gpt.country.australia"),value:"17"},{label:(0,n.Tl)("main.tools.chat.gpt.country.singapore"),value:"18"},{label:(0,n.Tl)("main.tools.chat.gpt.country.netherlands"),value:"19"},{label:(0,n.Tl)("main.tools.chat.gpt.country.belgium"),value:"20"}],l={commodityCategory:function(e,t,r){return t&&t.trim()?r():r(Error((0,n.Tl)("main.tools.chat.gpt.error.commodity.category.required")))},bulletPointsMaxWordNum:function(e,t,r){return t?Number.isFinite(t)?t<200||t>500?r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.range"))):r():r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.number"))):r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.required")))},titleMaxWordNum:function(e,t,r){return t?Number.isFinite(t)?t<200||t>1e3?r(Error((0,n.Tl)("main.tools.chat.gpt.error.word.limit.range.two.hundred.thousand"))):r():r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.number"))):r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.required")))},descriptionMaxWordNum:function(e,t,r){return t?Number.isFinite(t)?t<1e3||t>4e3?r(Error((0,n.Tl)("main.tools.chat.gpt.error.word.limit.range.thous
1and.four.thousand"))):r():r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.number"))):r(Error((0,n.Tl)("main.tools.chat.gpt.error.each.word.limit.required")))},validateKeyword:function(e,t,r){var i=t.split("\n").map(function(e){return e.trim()}).filter(Boolean);return""===t||0===i.length?r(Error((0,n.Tl)("main.tools.chat.gpt.error.keyword.required"))):i.length>200?r(Error((0,n.Tl)("main.tools.chat.gpt.error.keyword.max.two.hundred"))):r()},validateCommodityModel:function(e,t,r){var i=t.split("\n").map(function(e){return e.trim()}).filter(Boolean);return""===t||0===i.length?r():i.length>20?r(Error((0,n.Tl)("main.tools.chat.gpt.error.max.twenty"))):r()},validateCommodityParam:function(e,t,r){var i=t.split("\n").map(function(e){return e.trim()}).filter(Boolean);return""===t||0===i.length?r():i.length>20?r(Error((0,n.Tl)("main.tools.chat.gpt.error.max.twenty"))):r()},validateStudyAsin:function(e,t,r){return t.split("\n").map(function(e){return e.trim()}).filter(Boolean).length>3?r(Error((0,n.Tl)("main.tools.chat.gpt.error.max.three.asin"))):r()}},c={extractKeys:function(e){var t;return function(e){if(Array.isArray(e))return i(e)}(t=new Set(e.split("\n").map(function(e){return e.trim()}).filter(Boolean)))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},amazonHtml:function(e){return e.replace(/<p[^>]*>/g,"").replace(/<\/p>/g,"").replace(/<span[^>]*>/g,"").replace(/<\/span>/g,"").replace(/<strong>/g,"<b>").replace(/<\/strong>/g,"</b>").replace(/<em>/g,"<i>").replace(/<\/em>/g,"</i>")||""}};(0,n.Tl)("main.tools.chat.gpt.title"),(0,n.Tl)("main.tools.chat.gpt.bullet.points"),(0,n.Tl)("main.tools.chat.gpt.product.description");var u={},d={};[{key:"title",value:1,permission:"MOD_GENERATE_TITLE.UPDATE_PRODUCT"},{key:"bulletPoints",value:2,permission:"MOD_GENERATE_BULLET_POINT.UPDATE_PRODUCT"},{key:"description",value:3,permission:"MOD_GENERATE_PRODUCT_DESCRIPTION.UPDATE_PRODUCT"}].forEach(function(e){var t=e.key,r=e.value,n=e.permission;u[t]=r,d[t]=n});var p=[{label:(0,n.Tl)("main.tools.chat.gpt.all.star.rating"),value:"allStarRating"},{label:(0,n.Tl)("main.tools.chat.gpt.one.star"),value:"starRating1"},{label:(0,n.Tl)("main.tools.chat.gpt.two.star"),value:"starRating2"},{label:(0,n.Tl)("main.tools.chat.gpt.three.star"),value:"starRating3"},{label:(0,n.Tl)("main.tools.chat.gpt.four.star"),value:"starRating4"},{label:(0,n.Tl)("main.tools.chat.gpt.five.star"),value:"starRating5"}],h=5;(0,n.Tl)("main.tools.chat.gpt.review.analysis"),(0,n.Tl)("main.tools.chat.gpt.review.cost")},8696:function(e,t,r){r.d(t,{a:function(){return a}});var n=r(77069),i=r(52559),a=[{title:(0,n._)("main.wares.product.invent.supplier.column.preferred"),field:"preferred",width:56,align:"center",slots:{default:"preferred"}},{title:(0,n._)("common.type"),field:"supplierType",width:80,slots:{header:"supplierType_header",default:"supplierType"}},{title:(0,n._)("common.supplier"),field:"supplierName",minWidth:200,slots:{default:"supplierName"}},{title:(0,n._)("common.currency"),field:"currency",width:90,slots:{default:"currency"}},{title:(0,n._)("main.wares.product.invent.supplier.column.include.tax"),field:"includeTax",width:90,slots:{default:"includeTax"}},{title:(0,n._)("main.wares.product.invent.supplier.column.tax.rate"),field:"taxRate",width:90,slots:{default:"taxRate"}},{title:(0,n._)("main.wares.product.invent.supplier.column.purchase.qty"),field:"purchaseQty",width:130,showOverflow:!1,slots:{default:"purchaseQty"}},{title:(0,n._)("main.wares.product.invent.supplier.column.purchase.unit.price"),field:"purchasePrice",width:130,showOverflow:!1,slots:{default:"purchasePrice"}},{title:(0,n._)("main.wares.product.invent.supplier.column.tax.included.price"),field:"priceIncludeTax",width:170,showOverflow:!1,slots:{default:"priceIncludeTax"}},{title:(0,n._)("main.wares.product.invent.supplier.column.quote.links"),field:"quoteLinksText",minWidth:260,showOverflow:!1,slots:{default:"quoteLinksText"}},{title:(0,n._)("main.wares.product.invent.supplier.column.quote.remark"),field:"quoteRemark",minWidth:170,slots:{default:"quoteRemark"}},{title:(0,n._)("common.operation"),field:"operation",width:(0,i.n)(104),fixed:"right",slots:{default:"operation"}}]},54576:function(e,t,r){r.d(t,{G2:function(){return o},R:function(){return s},Sr:function(){return u},UQ:function(){return l},gK:function(){return a},mH:function(){return i},sS:function(){return c},tN:function(){return d}});var n=r(77069),i="supplierInfos",a="formal",o="temporary",s=[{label:(0,n._)("main.wares.product.invent.supplier.type.formal"),value:a},{label:(0,n._)("main.wares.product.invent.supplier.type.temporary"),value:o}],l=[{label:(0,n._)("common.yes"),value:1},{label:(0,n._)("common.no"),value:0}],c=20,u=6,d=[(0,n._)("main.wares.product.invent.supplier.type.tip.formal"),(0,n._)("main.wares.product.invent.supplier.type.tip.temporary"),(0,n._)("main.wares.product.invent.supplier.type.tip.sync.formal.only")]},46742:function(e,t,r){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}r.d(t,{W8:function(){return v},rO:function(){return f}}),r(86754),r(46491),r(62394),r(99583),r(915),r(5092),r(77949),r(29855),r(31731),r(61114),r(20767),r(33875),r(75038),r(937);var a=/^\s*([\d.,]+)\s*(cm|mm|inches|inch|in)?\s*[xX\xd7*\uff0a]\s*([\d.,]+)\s*(cm|mm|inches|inch|in)?\s*[xX\xd7*\uff0a]\s*([\d.,]+)\s*(cm|mm|inches|inch|in)?\s*$/i,o=/^\s*([\d.,]+)\s*(g|grams?|kg|kilograms?|oz|ounces?|lbs?|pounds?|\u514b|\u5343\u514b|\u516c\u65a4|\u76ce\u53f8|\u78c5)\.?\s*$/i,s=/["\u201d]/g,l=/\b[dwhl]\b/gi,c=Object.freeze({demandName:"demandName",productName:"productName",productSpecification:"productSpecification",productWeight:"productWeight",remark:"remark",source:"source"}),u=[c.productName,c.productSpecification,c.productWeight],d=Object.freeze({\u9700\u6C42\u540D\u79F0:c.demandName,\u54C1\u540D:c.productName,\u5546\u54C1\u89C4\u683C:c.productSpecification,\u5546\u54C1\u91CD\u91CF:c.productWeight,\u5907\u6CE8:c.remark,\u6765\u6E90:c.source}),p=Object.freeze({demand_name:c.demandName,demandname:c.demandName,title:c.demandName,product_name:c.productName,productname:c.productName,name:c.productName,product_specification:c.productSpecification,productspecification:c.productSpecification,specification:c.productSpecification,dimensions:c.productSpecification,product_weight:c.productWeight,productweight:c.productWeight,weight:c.productWeight,source_url:c.source,source_urls:c.source,sourceurls:c.source});function h(e){var t=String(null!=e?e:"").trim();return t?d[t]||p[t.replace(/[-\s]/g,"_").toLowerCase()]||t:""}function f(e){return(Array.isArray(e)?e:[]).map(function(t,r){var n=null==t?void 0:t.field,i=h((null==t?void 0:t.fieldKey)||(null==t?void 0:t.key)||n)||"sync-field-".concat(r),a=e.slice(0,r).filter(function(e){return h((null==e?void 0:e.fieldKey)||(null==e?void 0:e.key)||(null==e?void 0:e.field))===i}).length,o=a?"".concat(i,"-").concat(a):i;return{key:o,fieldKey:i,label:(null==t?void 0:t.label)||n||o,value:null==t?void 0:t.value}})}function m(e,t){var r;return(null==(r=e[t])?void 0:r[0])||""}function v(e,t){var r=t.hasBaseForm,n=t.hasCommodityRows,d=t.unitConversion,p=(e||[]).reduce(function(e,t){var r=h((null==t?void 0:t.fieldKey)||(null==t?void 0:t.key)||(null==t?void 0:t.field)),n=(Array.isArray(null==t?void 0:t.value)?t.value:[null==t?void 0:t.value]).map(function(e){if(!e||(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"||!("value"in e))return e;var t=r===c.productWeight?e.unit||e.unitName||e.uom:"";return t?"".concat(e.value," ").concat(t):e.value}).filter(function(e){return null!=e&&String(e).trim()}).map(function(e){return String(e).trim()});return r&&n.length&&(e[r]=i(e[r]||[]).concat(i(n))),e},{}),f=[],v=[],g=function(e,t,r){return f.push({field:e,value:t,apply:r})};if(r&&m(p,c.demandName)&&g(c.demandName,m(p,c.demandName),function(e){return(0,e.set)(e.baseForm,"title",m(p,c.demandName))}),n){if(m(p,c.productName)&&g(c.productName,p[c.productName],function(e){var t=e.set;return e.commodityRows.forEach(function(e,r){var n,i,a,o;return t(e,"name",(n=c.productName,null!=(i=null!=(a=(o=p[n]||[])[r])?a:o[0])?i:""))})}),m(p,c.productSpecification)){var y=p[c.productSpecification].map(function(e){var t=String(e).replace(s," inch ").replace(l," ").replace(/\s+/g," ").trim().match(a);if(!t)return null;var r=[t[1],t[3],t[5]].map(function(e){return Number(e.replace(/,/g,""))});if(r.some(function(e){return!Number.isFinite(e)}
1))return null;var n=[t[2],t[4],t[6]],i=n.find(Boolean)||"";return r.map(function(e,t){var r=n[t]||i;return/inches|inch|in/i.test(r)?Number(d(e,"inchToCm")):/mm/i.test(r)?e/10:e})});y.some(Boolean)?g(c.productSpecification,p[c.productSpecification],function(e){var t=e.set;return e.commodityRows.forEach(function(e,r){var n=y[r]||y[0];n&&["length","width","height"].forEach(function(r,i){t(e,r,n[i]),t(e,"".concat(r,"Imp"),d(n[i],"inch"))})})}):v.push(c.productSpecification)}if(m(p,c.productWeight)){var _=p[c.productWeight].map(function(e){var t=e.match(o);if(!t)return null;var r=Number(t[1].replace(/,/g,""));if(!Number.isFinite(r))return null;var n=t[2].toLowerCase(),i=/^(?:kg|kilograms?|\u5343\u514b|\u516c\u65a4)$/.test(n)?Number(d(r,"kgTog")):/^(?:oz|ounces?|\u76ce\u53f8)$/.test(n)?Number(d(r,"g")):/^(?:lb|lbs|pounds?|\u78c5)$/.test(n)?Number(d(r,"lbTog")):r;return Number.isFinite(i)?i:null});_.some(function(e){return null!==e})?g(c.productWeight,p[c.productWeight],function(e){var t=e.set;return e.commodityRows.forEach(function(e,r){var n,i=null!=(n=_[r])?n:_[0];null!=i&&(t(e,"weight",i),t(e,"weightImp",d(i,"oz")))})}):v.push(c.productWeight)}}else u.forEach(function(e){m(p,e)&&v.push(e)});if(r&&m(p,c.remark)&&g(c.remark,m(p,c.remark),function(e){return(0,e.set)(e.baseForm,"remark",m(p,c.remark))}),m(p,c.source)){var b=m(p,c.source);r&&/^https?:\/\//i.test(b)?g(c.source,b,function(e){var t=e.set,r=e.baseForm;return t(r,"sourceUrls",[b].concat(i((r.sourceUrls||[]).slice(1))))}):v.push(c.source)}return{changes:f,skipped:v}}},65342:function(e,t,r){r.d(t,{l:function(){return n}});var n={open:"product_invent_ai_research_click",generateReport:"product_invent_ai_research_generate_report_click",cancel:"product_invent_ai_research_cancel_click",report:"product_invent_ai_research_report_click",
1syncFields:"product_invent_ai_research_report_sync_fields_click",refreshReport:"product_invent_ai_research_report_refresh_click",confirmSyncFields:"product_invent_ai_research_report_sync_fields_confirm_click",cancelSyncFields:"product_invent_ai_research_report_sync_fields_cancel_click"}},65812:function(e,t,r){r(77949),r(5092),r(10327),r(21927),r(48741),r(72860);var n=r(62422),i=r(42439);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t,r,n,i,a,o){try{var s=e[a](o),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,i)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(r=i.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.A={name:"trackingMixin",data:function(){return{trackingCountInfo:{maxCount:0,userCount:0},reviewCountInfo:{}}},computed:{trackingCountText:function(){var e,t,r,n,i=null!=(e=null==(r=this.trackingCountInfo)?void 0:r.userCount)?e:0,a=null!=(t=null==(n=this.trackingCountInfo)?void 0:n.maxCount)?t:0;return"".concat(i,"/").concat(a)}},methods:{loadTrackingAndReviewCount:function(){var e;return(e=function(){var e,t,r;return function(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:l(0)}),s(o,"throw",{value:l(1)}),s(o,"return",{value:l(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function l(s){return function(l){var c=[s,l];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,Promise.all([this.$http.getTrackingCount(),(0,n.S0)({type:i.XG})])];case 1:return t=(e=s.apply(void 0,[a.sent(),2]))[0],r=e[1],this.trackingCountInfo=t,this.reviewCountInfo=r,[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)})}).call(this)},toTrackingPage:function(){this.$router.push({name:"CommodityMonitoring"})}}}}}]);

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.